|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
<template>
|
|
|
|
|
<vxe-modal class-name="csty-bi-lei-qi-form" v-model="refShow" width="1200" height="770" show-zoom show-footer :mask-closable=true>
|
|
|
|
|
<vxe-modal class-name="csty-bi-lei-qi-form" v-model="refShow" width="1200" height="770" show-zoom show-footer
|
|
|
|
|
:mask-closable=true>
|
|
|
|
|
<template #title>
|
|
|
|
|
<span style="color:#ffffff">{{ modalTitle }}</span>
|
|
|
|
|
</template>
|
|
|
|
@ -44,12 +45,12 @@
|
|
|
|
|
<span>{{ params.data.CategoryType }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-form-item> -->
|
|
|
|
|
<vxe-form-item title="序列号" field="SerialNo" span="12">
|
|
|
|
|
<!-- <vxe-form-item title="序列号" field="SerialNo" span="12">
|
|
|
|
|
<template #default="params">
|
|
|
|
|
<vxe-input v-model="params.data.SerialNo" placeholder="请输入序列号" clearable
|
|
|
|
|
@change="fnChangeA(params)"></vxe-input>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-form-item>
|
|
|
|
|
</vxe-form-item> -->
|
|
|
|
|
<vxe-form-item title="原材料检验批次号" field="RmibNumber" span="12">
|
|
|
|
|
<template #default="params">
|
|
|
|
|
<vxe-input v-model="params.data.RmibNumber" placeholder="请输入原材料检验批次号" clearable
|
|
|
|
@ -113,7 +114,7 @@
|
|
|
|
|
<span>{{ params.data.PdCode }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-form-item> -->
|
|
|
|
|
<vxe-form-item title="感知过程" field="ProcessType" span="12">
|
|
|
|
|
<!-- <vxe-form-item title="感知过程" field="ProcessType" span="12">
|
|
|
|
|
<template #default="params">
|
|
|
|
|
<vxe-select v-model="params.data.ProcessType" clearable filterable :disabled="true">
|
|
|
|
|
<template v-for="(item) in dictProcessType">
|
|
|
|
@ -121,7 +122,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-select>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-form-item>
|
|
|
|
|
</vxe-form-item> -->
|
|
|
|
|
<vxe-form-item title="检验结果是否合格" field="IsQualify" span="12">
|
|
|
|
|
<template #default="params">
|
|
|
|
|
<vxe-select v-model="params.data.IsQualify" clearable>
|
|
|
|
@ -257,6 +258,7 @@ import type { UploadProps, UploadChangeParam } from 'ant-design-vue'
|
|
|
|
|
import { config } from '@/config/axios/config'
|
|
|
|
|
import XEUtils from 'xe-utils'
|
|
|
|
|
import * as FileUploadApi from '@/api/gw/fileUpload'
|
|
|
|
|
import * as comApi from '@/api/gw/com'
|
|
|
|
|
// 字典
|
|
|
|
|
const dictStore = useDictStore()
|
|
|
|
|
const { dictProcessType } = storeToRefs(dictStore)
|
|
|
|
@ -383,6 +385,7 @@ const open = async (type: string, row?: any) => {
|
|
|
|
|
case 'add':
|
|
|
|
|
refShow.value = true
|
|
|
|
|
modalTitle.value = '新增避雷器'
|
|
|
|
|
formDataA.value.SerialNo = await comApi.getSystemSerialNo()
|
|
|
|
|
break;
|
|
|
|
|
case 'edit':
|
|
|
|
|
refShow.value = true
|
|
|
|
@ -424,12 +427,13 @@ const open = async (type: string, row?: any) => {
|
|
|
|
|
}
|
|
|
|
|
const rowInfoB = await BiLeiQiApi.getBiLeiQi(paramsB)
|
|
|
|
|
rowInfoB.Data.ID = 0
|
|
|
|
|
rowInfoB.Data.ManufactureDate = dayjs().format("YYYY-MM-DD"),
|
|
|
|
|
rowInfoB.Data.IncomDate = dayjs().format("YYYY-MM-DD"),
|
|
|
|
|
rowInfoB.Data.ManufactureDate = dayjs().format("YYYY-MM-DD")
|
|
|
|
|
rowInfoB.Data.IncomDate = dayjs().format("YYYY-MM-DD")
|
|
|
|
|
rowInfoB.Data.CheckTime = dayjs().format("YYYY-MM-DD HH:mm:ss")
|
|
|
|
|
rowInfoB.Data.PutCenterTime = dayjs().format("YYYY-MM-DD HH:mm:ss")
|
|
|
|
|
rowInfoB.Data.Sended = 0
|
|
|
|
|
formDataA.value = rowInfoB.Data
|
|
|
|
|
formDataA.value.SerialNo = await comApi.getSystemSerialNo()
|
|
|
|
|
break;
|
|
|
|
|
case 'delete':
|
|
|
|
|
modalTitle.value = '删除避雷器'
|
|
|
|
@ -488,40 +492,45 @@ const fnDeleteA = async (row: any) => {
|
|
|
|
|
}
|
|
|
|
|
// 提交
|
|
|
|
|
const fnSubmitA = async () => {
|
|
|
|
|
switch (formTypeA.value) {
|
|
|
|
|
case 'add':
|
|
|
|
|
const paramsA = {
|
|
|
|
|
data: formDataA.value
|
|
|
|
|
refFormA.value.validate().then(async (res: any) => {
|
|
|
|
|
if (!res) {
|
|
|
|
|
formDataA.value.Sended = 0
|
|
|
|
|
switch (formTypeA.value) {
|
|
|
|
|
case 'add':
|
|
|
|
|
const paramsA = {
|
|
|
|
|
data: formDataA.value
|
|
|
|
|
}
|
|
|
|
|
await BiLeiQiApi.saveBiLeiQi(paramsA)
|
|
|
|
|
await fnSubmitB()
|
|
|
|
|
VXETable.modal.message({ content: '新增成功', status: 'success' })
|
|
|
|
|
break;
|
|
|
|
|
case 'edit':
|
|
|
|
|
let setVal: any = _map(formDataA.value, (o1, k1) => {
|
|
|
|
|
return { field: k1, value: o1 }
|
|
|
|
|
})
|
|
|
|
|
const paramsB = {
|
|
|
|
|
filter: {
|
|
|
|
|
field: 'ID',
|
|
|
|
|
value: formDataA.value.ID
|
|
|
|
|
},
|
|
|
|
|
set: setVal
|
|
|
|
|
}
|
|
|
|
|
await BiLeiQiApi.editBiLeiQi(paramsB)
|
|
|
|
|
await fnSubmitB()
|
|
|
|
|
VXETable.modal.message({ content: '编辑成功', status: 'success' })
|
|
|
|
|
break;
|
|
|
|
|
case 'copy':
|
|
|
|
|
const paramsC = {
|
|
|
|
|
data: formDataA.value
|
|
|
|
|
}
|
|
|
|
|
await BiLeiQiApi.saveBiLeiQi(paramsC)
|
|
|
|
|
VXETable.modal.message({ content: '复制成功', status: 'success' })
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
await BiLeiQiApi.saveBiLeiQi(paramsA)
|
|
|
|
|
await fnSubmitB()
|
|
|
|
|
VXETable.modal.message({ content: '新增成功', status: 'success' })
|
|
|
|
|
break;
|
|
|
|
|
case 'edit':
|
|
|
|
|
let setVal: any = _map(formDataA.value, (o1, k1) => {
|
|
|
|
|
return { field: k1, value: o1 }
|
|
|
|
|
})
|
|
|
|
|
const paramsB = {
|
|
|
|
|
filter: {
|
|
|
|
|
field: 'ID',
|
|
|
|
|
value: formDataA.value.ID
|
|
|
|
|
},
|
|
|
|
|
set: setVal
|
|
|
|
|
}
|
|
|
|
|
await BiLeiQiApi.editBiLeiQi(paramsB)
|
|
|
|
|
await fnSubmitB()
|
|
|
|
|
VXETable.modal.message({ content: '编辑成功', status: 'success' })
|
|
|
|
|
break;
|
|
|
|
|
case 'copy':
|
|
|
|
|
const paramsC = {
|
|
|
|
|
data: formDataA.value
|
|
|
|
|
}
|
|
|
|
|
await BiLeiQiApi.saveBiLeiQi(paramsC)
|
|
|
|
|
VXETable.modal.message({ content: '复制成功', status: 'success' })
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
refShow.value = false
|
|
|
|
|
emit('success')
|
|
|
|
|
refShow.value = false
|
|
|
|
|
emit('success')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 表单B - 提交
|
|
|
|
|
const fnSubmitB = async () => {
|
|
|
|
@ -538,6 +547,7 @@ const fnSubmitB = async () => {
|
|
|
|
|
formDataB.value.DataUniqueIdentifier = formDataA.value.DataUniqueIdentifier
|
|
|
|
|
formDataB.value.CheckTime = formDataA.value.CheckTime
|
|
|
|
|
formDataB.value.PutCenterTime = formDataA.value.PutCenterTime
|
|
|
|
|
formDataB.value.Sended = 0
|
|
|
|
|
const queryParamsA: any = {
|
|
|
|
|
"filter": {
|
|
|
|
|
"field": 'SerialNo',
|
|
|
|
|