|
|
@@ -36,7 +36,7 @@
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
:icon="Download"
|
|
|
- @click="exportExcel"
|
|
|
+ @click="handleExportExcel"
|
|
|
>导出到Excel
|
|
|
</el-button>
|
|
|
</div>
|
|
|
@@ -96,13 +96,18 @@
|
|
|
label-position="left"
|
|
|
:rules="rule"
|
|
|
>
|
|
|
- <el-form-item label="日期">
|
|
|
+ <el-form-item
|
|
|
+ label="日期"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="detailData.sczl_rq"
|
|
|
style="width: 120px;"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="员工编号">
|
|
|
+ <el-form-item
|
|
|
+ label="员工编号"
|
|
|
+ @keyup.enter="handleGetYg"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="detailData.sczl_bh"
|
|
|
style="width: 100px;"
|
|
|
@@ -110,6 +115,7 @@
|
|
|
<el-input
|
|
|
v-model="detailData.name"
|
|
|
style="width: 100px; padding-left: 5px;"
|
|
|
+ readonly
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="组别">
|
|
|
@@ -155,12 +161,16 @@
|
|
|
/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
label="印件工序"
|
|
|
width="100"
|
|
|
>
|
|
|
<template #default="{ row }">
|
|
|
- <el-input v-model="row.sczl_yjGx" />
|
|
|
+ <el-input
|
|
|
+ v-model="row.sczl_yjGx"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
@@ -168,12 +178,18 @@
|
|
|
width="100"
|
|
|
>
|
|
|
<template #default="{ row }">
|
|
|
- <el-input v-model="row.sczl_gxmc" />
|
|
|
+ <el-input
|
|
|
+ v-model="row.sczl_gxmc"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="印件名称">
|
|
|
<template #default="{ row }">
|
|
|
- <el-input v-model="row.Gd_cpmc" />
|
|
|
+ <el-input
|
|
|
+ v-model="row.Gd_cpmc"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
@@ -235,137 +251,6 @@
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
- <!-- <el-form :model="form" inline="true" label-position="left" ref="elFormRef1" :rules="rule">
|
|
|
- <el-form-item label="日期">
|
|
|
- <el-input v-model="form.sczl_rq" style="width: 120px;" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="员工编号">
|
|
|
- <el-input v-model="form.sczl_bh" style="width: 100px;" />
|
|
|
- <el-input v-model="form.name" style="width: 100px; padding-left: 5px;" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="组别">
|
|
|
- <el-input v-model="form.sczl_bzdh" style="width: 50px;" />
|
|
|
- </el-form-item>
|
|
|
- <br>
|
|
|
- <el-form-item label="计时时数" style="padding-left: 195px;">
|
|
|
- <el-input v-model="form.sczl_jsss" style="width: 100px;" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="冲月定额">
|
|
|
- <el-input v-model="form.sczl_冲定额" style="width: 50px;" />
|
|
|
- </el-form-item>
|
|
|
- <br>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <el-form :model="form" inline="true" label-position="top" ref="elFormRef2" :rules="rule">
|
|
|
- <el-form-item label="工单编号">
|
|
|
- <div style="width: 150px;">
|
|
|
- <el-input v-model="form.sczl_rq" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="工单编号">
|
|
|
- <div style="width: 150px;">
|
|
|
- <el-input v-model="form.sczl_rq" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="工单编号">
|
|
|
- <div style="width: 150px;">
|
|
|
- <el-input v-model="form.sczl_rq" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="工单编号">
|
|
|
- <div style="width: 150px;">
|
|
|
- <el-input v-model="form.sczl_rq" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="工单编号">
|
|
|
- <div style="width: 150px;">
|
|
|
- <el-input v-model="form.sczl_rq" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="工单编号">
|
|
|
- <div style="width: 150px;">
|
|
|
- <el-input v-model="form.sczl_rq" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="工单编号">
|
|
|
- <div style="width: 150px;">
|
|
|
- <el-input v-model="form.sczl_rq" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="工单编号">
|
|
|
- <div style="width: 150px;">
|
|
|
- <el-input v-model="form.sczl_rq" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="工单编号">
|
|
|
- <div style="width: 150px;">
|
|
|
- <el-input v-model="form.sczl_rq" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="工单编号">
|
|
|
- <div style="width: 150px;">
|
|
|
- <el-input v-model="form.sczl_rq" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- <el-input v-model="form.sczl_rq" style="margin-top: 5px;" />
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-form> -->
|
|
|
-
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
<el-button @click="closeDialog">取 消</el-button>
|
|
|
@@ -426,7 +311,8 @@ import { createCompany, deleteCompanyByIds, updateCompany } from '@/api/company'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import { Download, Search } from '@element-plus/icons-vue'
|
|
|
import { reactive, ref } from 'vue'
|
|
|
-import { getGxMc, getInfo, getLocate, getPackingSideTable, getPackingTable } from '@/api/mes_api_gty/myapi'
|
|
|
+import { getGxMc, getInfo, getLocate, getPackingSideTable, getPackingTable, updatePackingTable, getYg } from '@/api/mes_api_gty/myapi'
|
|
|
+import { createSKApi } from '@/api/chatgpt'
|
|
|
|
|
|
defineOptions({
|
|
|
name: '06PackingDocuments',
|
|
|
@@ -435,40 +321,28 @@ defineOptions({
|
|
|
// 侧边栏数据
|
|
|
const treeData = reactive([])
|
|
|
const getSideData = async() => {
|
|
|
- const response = await getPackingSideTable()
|
|
|
- if (response.code === 0) {
|
|
|
- const transformedData = response.data.map(item => ({
|
|
|
- label: `${item.date.replace(/-/g, '.')}【单据数: ${item.counts}张】`,
|
|
|
- children: item.sys.map(sysItem => ({
|
|
|
- label: `${sysItem.sys_id} 【记录数: ${sysItem.count}张】`,
|
|
|
- params: {
|
|
|
- date: item.date.replace(/\./g, '-'),
|
|
|
- sys_id: sysItem.sys_id,
|
|
|
- },
|
|
|
- })),
|
|
|
- }))
|
|
|
- treeData.splice(0, treeData.length, ...transformedData)
|
|
|
+ try {
|
|
|
+ const response = await getPackingSideTable()
|
|
|
+ if (response.code === 0) {
|
|
|
+ const transformedData = response.data.map(item => ({
|
|
|
+ label: `${item.date.replace(/-/g, '.')}【单据数: ${item.counts}张】`,
|
|
|
+ children: item.sys.map(sysItem => ({
|
|
|
+ label: `${sysItem.sys_id} 【记录数: ${sysItem.count}张】`,
|
|
|
+ params: {
|
|
|
+ date: item.date.replace(/\./g, '-'),
|
|
|
+ sys_id: sysItem.sys_id,
|
|
|
+ },
|
|
|
+ })),
|
|
|
+ }))
|
|
|
+ treeData.splice(0, treeData.length, ...transformedData)
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
getSideData()
|
|
|
|
|
|
-// 自动化生成的字典(可能为空)以及字段
|
|
|
-const formData = ref({
|
|
|
- id: '',
|
|
|
- name: '',
|
|
|
- date: '',
|
|
|
- group: '',
|
|
|
- packingOutput: '',
|
|
|
- reworkOutput: '',
|
|
|
- pieceOutput: '',
|
|
|
- order: '',
|
|
|
- user: '',
|
|
|
- createTime: '',
|
|
|
- updateTime: '',
|
|
|
- uniqid: '',
|
|
|
-})
|
|
|
-
|
|
|
// 验证规则
|
|
|
const rule = reactive({})
|
|
|
|
|
|
@@ -506,25 +380,33 @@ const params = {
|
|
|
|
|
|
// 获取列表数据
|
|
|
const getTableData = async() => {
|
|
|
- const response = await getPackingTable({
|
|
|
- date: params.date, sys_id: params.sys_id,
|
|
|
- page: page.value.toString(), limit: limit.value.toString(),
|
|
|
- })
|
|
|
- if (response.code === 0) {
|
|
|
- total.value = response.data.total
|
|
|
- tableData.splice(0, tableData.length, ...response.data.rows)
|
|
|
+ try {
|
|
|
+ const response = await getPackingTable({
|
|
|
+ date: params.date, sys_id: params.sys_id,
|
|
|
+ page: page.value.toString(), limit: limit.value.toString(),
|
|
|
+ })
|
|
|
+ if (response.code === 0) {
|
|
|
+ total.value = response.data.total
|
|
|
+ tableData.splice(0, tableData.length, ...response.data.rows)
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 获取定位数据
|
|
|
const getLocateTable = async() => {
|
|
|
- const response = await getLocate({
|
|
|
- gdbh: params.gdbh,
|
|
|
- page: page.value.toString(), limit: limit.value.toString(),
|
|
|
- })
|
|
|
- if (response.code === 0) {
|
|
|
- total.value = response.data.total
|
|
|
- tableData.splice(0, tableData.length, ...response.data.rows)
|
|
|
+ try {
|
|
|
+ const response = await getLocate({
|
|
|
+ gdbh: params.gdbh,
|
|
|
+ page: page.value.toString(), limit: limit.value.toString(),
|
|
|
+ })
|
|
|
+ if (response.code === 0) {
|
|
|
+ total.value = response.data.total
|
|
|
+ tableData.splice(0, tableData.length, ...response.data.rows)
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -578,6 +460,8 @@ const handleCurrentChange = () => {
|
|
|
|
|
|
// ============== 详情页面 ==============
|
|
|
const detailData = reactive({
|
|
|
+ UniqId: '',
|
|
|
+ selectIndex: 0,
|
|
|
sczl_rq: '',
|
|
|
sczl_bh: '',
|
|
|
name: '',
|
|
|
@@ -587,81 +471,156 @@ const detailData = reactive({
|
|
|
sczl_desc: '',
|
|
|
table: [],
|
|
|
})
|
|
|
-const selectData = reactive([
|
|
|
- {
|
|
|
- Gd_cpmc: '黄金叶(乐途硬)小盒(二维码改版)',
|
|
|
- Gy0_gxmc: '包装',
|
|
|
- jyGx: '01-71',
|
|
|
- },
|
|
|
-])
|
|
|
-let tableIndex = 0
|
|
|
+const selectData = reactive([])
|
|
|
+
|
|
|
+// 行为控制标记(弹窗内部需要增还是改)
|
|
|
+const type = ref('')
|
|
|
+// 弹窗控制标记
|
|
|
+const dialogFormVisible = ref(false)
|
|
|
+const dialogSelectVisible = ref(false)
|
|
|
|
|
|
// 获取详细信息
|
|
|
const getTableInfo = async(id) => {
|
|
|
- const response = await getInfo({ UniqId: id })
|
|
|
- if (response.code === 0) {
|
|
|
- const { sczl_rq, sczl_bh, name, sczl_bzdh, sczl_jsss, sczl_冲定额, sczl_desc, ...rest } = response.data
|
|
|
- // 直接赋值基础属性
|
|
|
- Object.assign(detailData, { sczl_rq, sczl_bh, name, sczl_bzdh, sczl_jsss, sczl_冲定额, sczl_desc })
|
|
|
- // 生成表格数据
|
|
|
- detailData.table = Array.from({ length: 6 }, (_, i) => i + 1) // 创建一个长度为6的数组 [1, 2, 3, 4, 5, 6]
|
|
|
- .map(num => {
|
|
|
- return {
|
|
|
- sczl_gdbh: rest[`sczl_gdbh${num}`],
|
|
|
- sczl_yjGx: rest[`sczl_yjGx${num}`],
|
|
|
- sczl_gxmc: rest[`sczl_gxmc${num}`],
|
|
|
- Gd_cpmc: rest[`Gd_cpmc${num}`],
|
|
|
- sczl_cl: rest[`sczl_cl${num}`],
|
|
|
- sczl_返工产量: rest[`sczl_返工产量${num}`],
|
|
|
- sczl_PgCl: rest[`sczl_PgCl${num}`],
|
|
|
- sczl_计产系数: rest[`sczl_计产系数${num}`],
|
|
|
- sczl_Jtbh1: rest[`sczl_Jtbh${num}`],
|
|
|
- sczl_dedh: rest[`sczl_dedh${num}`],
|
|
|
- }
|
|
|
- })
|
|
|
- .filter(item => item.sczl_gdbh !== '') // 过滤掉空的工单编号
|
|
|
- dialogFormVisible.value = true
|
|
|
+ try {
|
|
|
+ const response = await getInfo({ UniqId: id })
|
|
|
+ if (response.code === 0) {
|
|
|
+ const { sczl_rq, sczl_bh, name, sczl_bzdh, sczl_jsss, sczl_冲定额, sczl_desc, ...rest } = response.data
|
|
|
+ // 直接赋值基础属性
|
|
|
+ Object.assign(detailData, { sczl_rq, sczl_bh, name, sczl_bzdh, sczl_jsss, sczl_冲定额, sczl_desc })
|
|
|
+ // 生成表格数据
|
|
|
+ detailData.table = Array.from({ length: 6 }, (_, i) => i + 1) // 创建一个长度为6的数组 [1, 2, 3, 4, 5, 6]
|
|
|
+ .map(num => {
|
|
|
+ return {
|
|
|
+ sczl_gdbh: rest[`sczl_gdbh${num}`],
|
|
|
+ sczl_yjGx: rest[`sczl_yjGx${num}`],
|
|
|
+ sczl_gxmc: rest[`sczl_gxmc${num}`],
|
|
|
+ Gd_cpmc: rest[`Gd_cpmc${num}`],
|
|
|
+ sczl_cl: rest[`sczl_cl${num}`],
|
|
|
+ sczl_返工产量: rest[`sczl_返工产量${num}`],
|
|
|
+ sczl_PgCl: rest[`sczl_PgCl${num}`],
|
|
|
+ sczl_计产系数: rest[`sczl_计产系数${num}`],
|
|
|
+ sczl_Jtbh1: rest[`sczl_Jtbh${num}`],
|
|
|
+ sczl_dedh: rest[`sczl_dedh${num}`],
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // .filter(item => item.sczl_gdbh !== '') // 过滤掉空的工单编号
|
|
|
+ detailData.UniqId = id
|
|
|
+ dialogFormVisible.value = true
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 获取工序名称
|
|
|
+const getTableGxMc = async(index, row) => {
|
|
|
+ try {
|
|
|
+ const response = await getGxMc({ gdbh: row.sczl_gdbh })
|
|
|
+ if (response.code === 0) {
|
|
|
+ const { Gd_cpmc, Gy0_gxmc, jyGx } = response.data[0]
|
|
|
+ if (response.data.length === 1) {
|
|
|
+ detailData.table[index].Gd_cpmc = Gd_cpmc
|
|
|
+ detailData.table[index].sczl_yjGx = jyGx
|
|
|
+ detailData.table[index].sczl_gxmc = Gy0_gxmc
|
|
|
+ } else {
|
|
|
+ selectData.splice(0, selectData.length, ...response.data)
|
|
|
+ detailData.selectIndex = index
|
|
|
+ dialogSelectVisible.value = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 双击表格操作
|
|
|
+// 更新数据
|
|
|
+const updateDetailData = async() => {
|
|
|
+ const restoredData = {
|
|
|
+ UniqId: detailData.UniqId,
|
|
|
+ sczl_rq: detailData.sczl_rq,
|
|
|
+ sczl_bh: detailData.sczl_bh,
|
|
|
+ name: detailData.name,
|
|
|
+ sczl_bzdh: detailData.sczl_bzdh,
|
|
|
+ sczl_jsss: detailData.sczl_jsss,
|
|
|
+ sczl_冲定额: detailData.sczl_冲定额,
|
|
|
+ sczl_desc: detailData.sczl_desc,
|
|
|
+ }
|
|
|
+ detailData.table.forEach((item, index, array) => {
|
|
|
+ const num = index + 1
|
|
|
+ restoredData[`sczl_gdbh${num}`] = item.sczl_gdbh
|
|
|
+ restoredData[`sczl_yjGx${num}`] = item.sczl_yjGx
|
|
|
+ restoredData[`sczl_gxmc${num}`] = item.sczl_gxmc
|
|
|
+ restoredData[`Gd_cpmc${num}`] = item.Gd_cpmc
|
|
|
+ restoredData[`sczl_cl${num}`] = item.sczl_cl
|
|
|
+ restoredData[`sczl_返工产量${num}`] = item.sczl_返工产量
|
|
|
+ restoredData[`sczl_PgCl${num}`] = item.sczl_PgCl
|
|
|
+ restoredData[`sczl_计产系数${num}`] = item.sczl_计产系数
|
|
|
+ restoredData[`sczl_Jtbh${num}`] = item.sczl_Jtbh1
|
|
|
+ restoredData[`sczl_dedh${num}`] = item.sczl_dedh
|
|
|
+ })
|
|
|
+ // restoredData.UniqId = 0
|
|
|
+ // const res = await updatePackingTable(restoredData)
|
|
|
+ console.log(restoredData)
|
|
|
+}
|
|
|
+
|
|
|
+// 双击打开详情页
|
|
|
function doubleClick(row, column, event) {
|
|
|
type.value = 'update'
|
|
|
getTableInfo(row.UniqId)
|
|
|
}
|
|
|
|
|
|
-// 处理回车
|
|
|
-const handleEnter = (index, row) => {
|
|
|
- getTableGxMc(index, row)
|
|
|
+const handleGetYg = async() => {
|
|
|
+ try {
|
|
|
+ const res = await getYg({ sczl_bh: detailData.sczl_bh })
|
|
|
+ if (res.code === 0) {
|
|
|
+ detailData.name = res.data.ygxm
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-// 获取详细信息
|
|
|
-const getTableGxMc = async(index, row) => {
|
|
|
- console.log(row)
|
|
|
- const response = await getGxMc({ gdbh: row.sczl_gdbh })
|
|
|
- if (response.code === 0) {
|
|
|
- const { Gd_cpmc, Gy0_gxmc, jyGx } = response.data[0]
|
|
|
- if (response.data.length === 1) {
|
|
|
- detailData.table[index].Gd_cpmc = Gd_cpmc
|
|
|
- detailData.table[index].sczl_yjGx = jyGx
|
|
|
- detailData.table[index].sczl_gxmc = Gy0_gxmc
|
|
|
- } else {
|
|
|
- selectData.splice(0, selectData.length, ...response.data)
|
|
|
- tableIndex = index
|
|
|
- dialogSelectVisible.value = true
|
|
|
- }
|
|
|
+// 处理选择框回车操作
|
|
|
+const handleEnter = (index, row) => {
|
|
|
+ if (row.sczl_gdbh === '') {
|
|
|
+ detailData.table[index].sczl_yjGx = ''
|
|
|
+ detailData.table[index].sczl_gxmc = ''
|
|
|
+ detailData.table[index].Gd_cpmc = ''
|
|
|
+ } else {
|
|
|
+ getTableGxMc(index, row)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 处理选择框
|
|
|
const handleSelectClick = (row, column, event) => {
|
|
|
const { Gd_cpmc, Gy0_gxmc, jyGx } = row
|
|
|
- detailData.table[tableIndex].Gd_cpmc = Gd_cpmc
|
|
|
- detailData.table[tableIndex].sczl_yjGx = jyGx
|
|
|
- detailData.table[tableIndex].sczl_gxmc = Gy0_gxmc
|
|
|
+ const index = detailData.selectIndex
|
|
|
+ detailData.table[index].Gd_cpmc = Gd_cpmc
|
|
|
+ detailData.table[index].sczl_yjGx = jyGx
|
|
|
+ detailData.table[index].sczl_gxmc = Gy0_gxmc
|
|
|
dialogSelectVisible.value = false
|
|
|
}
|
|
|
|
|
|
+// 弹窗确定
|
|
|
+const enterDialog = () => {
|
|
|
+ switch (type.value) {
|
|
|
+ case 'create':
|
|
|
+
|
|
|
+ break
|
|
|
+ case 'update':
|
|
|
+ updateDetailData()
|
|
|
+ break
|
|
|
+
|
|
|
+ default:
|
|
|
+ break
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 关闭弹窗
|
|
|
+const closeDialog = () => {
|
|
|
+ dialogFormVisible.value = false
|
|
|
+}
|
|
|
+
|
|
|
// 多选数据
|
|
|
const multipleSelection = ref([])
|
|
|
// 多选
|
|
|
@@ -700,9 +659,6 @@ const onDelete = async() => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 行为控制标记(弹窗内部需要增还是改)
|
|
|
-const type = ref('')
|
|
|
-
|
|
|
// 更新行
|
|
|
// const updateCompanyFunc = async(row) => {
|
|
|
// const res = await findCompany({ ID: row.ID })
|
|
|
@@ -713,48 +669,10 @@ const type = ref('')
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
-// 弹窗控制标记
|
|
|
-const dialogFormVisible = ref(false)
|
|
|
-const dialogSelectVisible = ref(false)
|
|
|
-
|
|
|
// 关闭弹窗
|
|
|
-const closeDialog = () => {
|
|
|
- dialogFormVisible.value = false
|
|
|
- formData.value = {
|
|
|
- address: '',
|
|
|
- image: '',
|
|
|
- name: '',
|
|
|
- }
|
|
|
-}
|
|
|
-// 弹窗确定
|
|
|
-const enterDialog = async() => {
|
|
|
- elFormRef.value?.validate(async(valid) => {
|
|
|
- if (!valid) return
|
|
|
- let res
|
|
|
- switch (type.value) {
|
|
|
- case 'create':
|
|
|
- res = await createCompany(formData.value)
|
|
|
- break
|
|
|
- case 'update':
|
|
|
- res = await updateCompany(formData.value)
|
|
|
- break
|
|
|
- default:
|
|
|
- res = await createCompany(formData.value)
|
|
|
- break
|
|
|
- }
|
|
|
- if (res.code === 0) {
|
|
|
- ElMessage({
|
|
|
- type: 'success',
|
|
|
- message: '创建/更改成功',
|
|
|
- })
|
|
|
- closeDialog()
|
|
|
- getTableData()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
|
|
|
// 导出excel
|
|
|
-function exportExcel() {
|
|
|
+function handleExportExcel() {
|
|
|
console.log('导出到excel')
|
|
|
}
|
|
|
|