|
|
@ -258,7 +258,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup name="MuPaiForm">
|
|
|
|
<script lang="ts" setup name="MuPaiForm">
|
|
|
|
import { ref, onMounted, computed } from 'vue'
|
|
|
|
import { ref, reactive, onMounted, computed } from 'vue'
|
|
|
|
import { VXETable } from 'vxe-table'
|
|
|
|
import { VXETable } from 'vxe-table'
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
import { map as _map } from 'lodash'
|
|
|
|
import { map as _map } from 'lodash'
|
|
|
@ -268,6 +268,7 @@ import { storeToRefs } from 'pinia'
|
|
|
|
import type { UploadProps, UploadChangeParam } from 'ant-design-vue'
|
|
|
|
import type { UploadProps, UploadChangeParam } from 'ant-design-vue'
|
|
|
|
import { config } from '@/config/axios/config'
|
|
|
|
import { config } from '@/config/axios/config'
|
|
|
|
import XEUtils from 'xe-utils'
|
|
|
|
import XEUtils from 'xe-utils'
|
|
|
|
|
|
|
|
import * as FileUploadApi from '@/api/gw/fileUpload'
|
|
|
|
|
|
|
|
|
|
|
|
const dictStore = useDictStore()
|
|
|
|
const dictStore = useDictStore()
|
|
|
|
const { dictPdCode, dictProcessType } = storeToRefs(dictStore)
|
|
|
|
const { dictPdCode, dictProcessType } = storeToRefs(dictStore)
|
|
|
@ -284,7 +285,6 @@ const emit = defineEmits(['success'])
|
|
|
|
// 是否显示
|
|
|
|
// 是否显示
|
|
|
|
const refShow = ref(false)
|
|
|
|
const refShow = ref(false)
|
|
|
|
// 表单A - 初始数据
|
|
|
|
// 表单A - 初始数据
|
|
|
|
|
|
|
|
|
|
|
|
const formDataAInit: any = {
|
|
|
|
const formDataAInit: any = {
|
|
|
|
"ID": 0,
|
|
|
|
"ID": 0,
|
|
|
|
"StandardVersion": 1,
|
|
|
|
"StandardVersion": 1,
|
|
|
@ -314,36 +314,57 @@ const formDataAInit: any = {
|
|
|
|
"Width": undefined,
|
|
|
|
"Width": undefined,
|
|
|
|
"Sended": 0
|
|
|
|
"Sended": 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 表单B - 初始数据
|
|
|
|
|
|
|
|
const formDataBInit: any = {
|
|
|
|
|
|
|
|
ID: 0,
|
|
|
|
|
|
|
|
StandardVersion: "",
|
|
|
|
|
|
|
|
SupplierWorkNo: "",
|
|
|
|
|
|
|
|
SupplierCode: "",
|
|
|
|
|
|
|
|
ModelCode: "",
|
|
|
|
|
|
|
|
CategoryType: "",
|
|
|
|
|
|
|
|
SerialNo: "",
|
|
|
|
|
|
|
|
FileItems: JSON.stringify([{ "id": 1, "type": 1, "typeCode": 1, "fileName": "", "fileUrl": "", "fileType": 1, "fType": ".pdf" }, { "id": 2, "type": 1, "typeCode": 2, "fileName": "", "fileUrl": "", "fileType": 1, "fType": ".pdf" }]),
|
|
|
|
|
|
|
|
CheckTime: "",
|
|
|
|
|
|
|
|
PutCenterTime: "",
|
|
|
|
|
|
|
|
PdCode: "GX000080",
|
|
|
|
|
|
|
|
FpdCode: "",
|
|
|
|
|
|
|
|
Ecode: '',
|
|
|
|
|
|
|
|
SgEntityId: "",
|
|
|
|
|
|
|
|
DataUniqueIdentifier: "",
|
|
|
|
|
|
|
|
Sended: 0
|
|
|
|
|
|
|
|
}
|
|
|
|
// 表单
|
|
|
|
// 表单
|
|
|
|
const refFormA = ref()
|
|
|
|
const refFormA = ref()
|
|
|
|
// 表单
|
|
|
|
// 表单
|
|
|
|
const fileItems = ref([
|
|
|
|
const fileItems = computed(() => {
|
|
|
|
{ "id": 1, "type": 1, "typeCode": 1, "fileName": "", "fileUrl": "", "fileType": 1, "fType": ".pdf" },
|
|
|
|
let FileItems: any = XEUtils.clone(formDataB.value.FileItems, true)
|
|
|
|
{ "id": 2, "type": 1, "typeCode": 2, "fileName": "", "fileUrl": "", "fileType": 1, "fType": ".pdf" }
|
|
|
|
FileItems = JSON.parse(FileItems)
|
|
|
|
])
|
|
|
|
return FileItems
|
|
|
|
|
|
|
|
})
|
|
|
|
const fnChgFileA = async (info: UploadChangeParam) => {
|
|
|
|
const fnChgFileA = async (info: UploadChangeParam) => {
|
|
|
|
if (info.file.response) {
|
|
|
|
if (info.file.response) {
|
|
|
|
let FileItemsA: any = XEUtils.clone(fileItems.value, true)
|
|
|
|
let FileItems: any = XEUtils.clone(formDataB.value.FileItems, true)
|
|
|
|
FileItemsA[0]['fileName'] = info.file.name
|
|
|
|
FileItems = JSON.parse(FileItems)
|
|
|
|
FileItemsA[0]['fileUrl'] = info.file.response
|
|
|
|
FileItems[0]['fileName'] = info.file.name
|
|
|
|
fileItems.value = FileItemsA
|
|
|
|
FileItems[0]['fileUrl'] = info.file.response
|
|
|
|
|
|
|
|
formDataB.value.FileItems = JSON.stringify(FileItems)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const fnChgFileB = async (info: UploadChangeParam) => {
|
|
|
|
const fnChgFileB = async (info: UploadChangeParam) => {
|
|
|
|
if (info.file.response) {
|
|
|
|
if (info.file.response) {
|
|
|
|
let FileItemsA: any = XEUtils.clone(fileItems.value, true)
|
|
|
|
let FileItems: any = XEUtils.clone(formDataB.value.FileItems, true)
|
|
|
|
FileItemsA[1]['fileName'] = info.file.name
|
|
|
|
FileItems = JSON.parse(FileItems)
|
|
|
|
FileItemsA[1]['fileUrl'] = info.file.response
|
|
|
|
FileItems[1]['fileName'] = info.file.name
|
|
|
|
fileItems.value = FileItemsA
|
|
|
|
FileItems[1]['fileUrl'] = info.file.response
|
|
|
|
|
|
|
|
formDataB.value.FileItems = JSON.stringify(FileItems)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 表单类型[add - 新增|update - 修改|del - 删除]
|
|
|
|
// 表单类型[add - 新增|update - 修改|del - 删除]
|
|
|
|
const formTypeA: any = ref('')
|
|
|
|
const formTypeA: any = ref('')
|
|
|
|
// 弹窗标题
|
|
|
|
// 弹窗标题
|
|
|
|
const modalTitle = ref('未知表单')
|
|
|
|
const modalTitle = ref('未知表单')
|
|
|
|
// 表单数据
|
|
|
|
// 表单A数据
|
|
|
|
const formDataA: any = ref(formDataAInit)
|
|
|
|
const formDataA: any = ref(formDataAInit)
|
|
|
|
|
|
|
|
|
|
|
|
// 表单规则
|
|
|
|
// 表单规则
|
|
|
|
const formRulesA: any = ref({
|
|
|
|
const formRulesA: any = ref({
|
|
|
|
SupplierWorkNo: [
|
|
|
|
SupplierWorkNo: [
|
|
|
@ -389,20 +410,21 @@ const formRulesA: any = ref({
|
|
|
|
{ required: true, message: '请输入公称宽度' }
|
|
|
|
{ required: true, message: '请输入公称宽度' }
|
|
|
|
]
|
|
|
|
]
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
// 表单B数据
|
|
|
|
|
|
|
|
const formDataB: any = ref(formDataBInit)
|
|
|
|
// 挂载
|
|
|
|
// 挂载
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// 打开弹窗
|
|
|
|
// 打开弹窗
|
|
|
|
const open = async (type: string, row?: any) => {
|
|
|
|
const open = async (type: string, row?: any) => {
|
|
|
|
formTypeA.value = type
|
|
|
|
formTypeA.value = type
|
|
|
|
|
|
|
|
await fnResetA()
|
|
|
|
switch (type) {
|
|
|
|
switch (type) {
|
|
|
|
case 'add':
|
|
|
|
case 'add':
|
|
|
|
await fnResetA()
|
|
|
|
|
|
|
|
modalTitle.value = '新增母排'
|
|
|
|
modalTitle.value = '新增母排'
|
|
|
|
refShow.value = true
|
|
|
|
refShow.value = true
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'edit':
|
|
|
|
case 'edit':
|
|
|
|
await fnResetA()
|
|
|
|
|
|
|
|
modalTitle.value = '编辑母排'
|
|
|
|
modalTitle.value = '编辑母排'
|
|
|
|
refShow.value = true
|
|
|
|
refShow.value = true
|
|
|
|
const paramsA = {
|
|
|
|
const paramsA = {
|
|
|
@ -415,9 +437,22 @@ const open = async (type: string, row?: any) => {
|
|
|
|
const rowInfoA = await MuPaiApi.getMuPai(paramsA)
|
|
|
|
const rowInfoA = await MuPaiApi.getMuPai(paramsA)
|
|
|
|
rowInfoA.Data.Sended = 0
|
|
|
|
rowInfoA.Data.Sended = 0
|
|
|
|
formDataA.value = rowInfoA.Data
|
|
|
|
formDataA.value = rowInfoA.Data
|
|
|
|
|
|
|
|
// 获取附件信息
|
|
|
|
|
|
|
|
const queryFileParamsA: any = {
|
|
|
|
|
|
|
|
"filter": {
|
|
|
|
|
|
|
|
"field": 'SerialNo',
|
|
|
|
|
|
|
|
"operator": "Eq",
|
|
|
|
|
|
|
|
"value": formDataA.value.SerialNo
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const dataFileRes = await FileUploadApi.getPagingFileList(queryFileParamsA)
|
|
|
|
|
|
|
|
if (dataFileRes.Code == 0 && dataFileRes.List) {
|
|
|
|
|
|
|
|
if (dataFileRes.List.length > 0) {
|
|
|
|
|
|
|
|
formDataB.value = dataFileRes.List[0]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'copy':
|
|
|
|
case 'copy':
|
|
|
|
await fnResetA()
|
|
|
|
|
|
|
|
modalTitle.value = '复制母排'
|
|
|
|
modalTitle.value = '复制母排'
|
|
|
|
refShow.value = true
|
|
|
|
refShow.value = true
|
|
|
|
const paramsB = {
|
|
|
|
const paramsB = {
|
|
|
@ -512,11 +547,51 @@ const fnSubmitA = async () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 表单B - 提交
|
|
|
|
// 表单B - 提交
|
|
|
|
const fnSubmitB = async () => {
|
|
|
|
const fnSubmitB = async () => {
|
|
|
|
console.log('fnSubmitB')
|
|
|
|
formDataB.value.StandardVersion = formDataA.value.StandardVersion
|
|
|
|
|
|
|
|
formDataB.value.SupplierWorkNo = formDataA.value.SupplierWorkNo
|
|
|
|
|
|
|
|
formDataB.value.SupplierCode = formDataA.value.SupplierCode
|
|
|
|
|
|
|
|
formDataB.value.ModelCode = formDataA.value.ModelCode
|
|
|
|
|
|
|
|
formDataB.value.CategoryType = formDataA.value.CategoryType
|
|
|
|
|
|
|
|
formDataB.value.SerialNo = formDataA.value.SerialNo
|
|
|
|
|
|
|
|
formDataB.value.FpdCode = formDataA.value.PdCode
|
|
|
|
|
|
|
|
formDataB.value.Ecode = formDataA.value.Ecode
|
|
|
|
|
|
|
|
formDataB.value.SgEntityId = formDataA.value.SgEntityId
|
|
|
|
|
|
|
|
formDataB.value.DataUniqueIdentifier = formDataA.value.DataUniqueIdentifier
|
|
|
|
|
|
|
|
formDataB.value.CheckTime = formDataA.value.CheckTime
|
|
|
|
|
|
|
|
formDataB.value.PutCenterTime = formDataA.value.PutCenterTime
|
|
|
|
|
|
|
|
const queryParamsA: any = {
|
|
|
|
|
|
|
|
"filter": {
|
|
|
|
|
|
|
|
"field": 'SerialNo',
|
|
|
|
|
|
|
|
"operator": "Eq",
|
|
|
|
|
|
|
|
"value": formDataA.value.SerialNo
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const dataFileRes = await FileUploadApi.getPagingFileList(queryParamsA)
|
|
|
|
|
|
|
|
if (dataFileRes.Code == 0 && dataFileRes.List) {
|
|
|
|
|
|
|
|
if (dataFileRes.List.length > 0) {
|
|
|
|
|
|
|
|
let setVal: any = _map(formDataB.value, (o1, k1) => {
|
|
|
|
|
|
|
|
return { field: k1, value: o1 }
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
const paramsB = {
|
|
|
|
|
|
|
|
filter: {
|
|
|
|
|
|
|
|
field: 'SerialNo',
|
|
|
|
|
|
|
|
value: formDataB.value.SerialNo
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
set: setVal
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
await FileUploadApi.editFile(paramsB)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
const paramsA = {
|
|
|
|
|
|
|
|
data: formDataB.value
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
await FileUploadApi.saveFile(paramsA)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 重置
|
|
|
|
// 重置
|
|
|
|
const fnResetA = () => {
|
|
|
|
const fnResetA = () => {
|
|
|
|
formDataA.value = formDataAInit
|
|
|
|
formDataA.value = formDataAInit
|
|
|
|
|
|
|
|
formDataB.value = formDataBInit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 关闭窗体
|
|
|
|
// 关闭窗体
|
|
|
|
const fnEventCancel = () => {
|
|
|
|
const fnEventCancel = () => {
|
|
|
|