diff --git a/src/views/main/PrintingNew/addForm.vue b/src/views/main/PrintingNew/addForm.vue index c850acc..7f73057 100644 --- a/src/views/main/PrintingNew/addForm.vue +++ b/src/views/main/PrintingNew/addForm.vue @@ -36,6 +36,7 @@ @@ -131,21 +132,30 @@ export default { this.confirmLoading = true validateFields((errors, values) => { if (!errors) { - for (const key in values) { - if (typeof values[key] === 'object' && !(values[key] === null)) { - values[key] = JSON.stringify(values[key]) - } - } this.SysTenantData.forEach(item => { if (values.tenantName == item.name) { values.tenantId = item.id } }) + let cateName = '' this.CateData.forEach(item => { - if (values.cateCode == item.code) { - values.cateName = item.name - } + values.cateCode.forEach(ele => { + if (ele == item.code) { + cateName ? (cateName = `${cateName},${item.name}`) : (cateName = item.name) + } + }) + }) + values.cateName = cateName + let cateCode = '' + values.cateCode.forEach(item => { + cateCode ? (cateCode = `${cateCode},${item}`) : (cateCode = item) }) + values.cateCode = `[${cateCode}]` + for (const key in values) { + if (typeof values[key] === 'object' && !(values[key] === null)) { + values[key] = JSON.stringify(values[key]) + } + } console.log(values, 11111111) BookingPrintTemplateSave({ file: this.file, data: values }) .then(res => { diff --git a/src/views/main/PrintingNew/editForm.vue b/src/views/main/PrintingNew/editForm.vue index 7876193..8436144 100644 --- a/src/views/main/PrintingNew/editForm.vue +++ b/src/views/main/PrintingNew/editForm.vue @@ -36,6 +36,7 @@ @@ -89,13 +90,9 @@ export default { }, visible: false, confirmLoading: false, - MainOrSub: [], form: this.$form.createForm(this), data: {}, - plainOptions: [ - { label: '主单', value: 'IsMain' }, - { label: '分单', value: 'IsSub' } - ] + id: '' } }, mounted() { @@ -127,25 +124,19 @@ export default { edit(record) { this.data = record console.log(record) + this.id = record.id this.visible = true - const typeOption = this.$options - this.typeData = typeOption.filters['dictData']('edi_type') - console.log(record.isMain) - this.MainOrSub = [] - if (record.isMain) { - this.MainOrSub.push('IsMain') - } - if (record.isSub) { - this.MainOrSub.push('IsSub') - } setTimeout(() => { this.form.setFieldsValue({ - cateCode: record.cateCode, + cateCode: record.cateCode + .split('[')[1] + .split(']')[0] + .split(','), cateName: record.cateName, displayName: record.displayName, tenantId: record.tenantId, tenantName: record.tenantName, - id: record.id, + type: record.type }) console.log(this.form.getFieldsValue()) @@ -159,23 +150,34 @@ export default { validateFields((errors, values) => { console.log(errors, values) if (!errors) { - for (const key in values) { - console.log(key, 1) - if (typeof values[key] === 'object' && !(values[key] === null)) { - values[key] = JSON.stringify(values[key]) - } - } this.SysTenantData.forEach(item => { console.log(item) if (values.tenantName == item.name) { values.tenantId = item.id } }) + let cateName = '' this.CateData.forEach(item => { - if (values.cateCode == item.code) { - values.cateName = item.name - } + values.cateCode.forEach(ele => { + if (ele == item.code) { + cateName ? (cateName = `${cateName},${item.name}`) : (cateName = item.name) + } + }) + }) + values.cateName = cateName + let cateCode = '' + values.cateCode.forEach(item => { + cateCode ? (cateCode = `${cateCode},${item}`) : (cateCode = item) }) + values.cateCode = `[${cateCode}]` + for (const key in values) { + console.log(key, 1) + if (typeof values[key] === 'object' && !(values[key] === null)) { + values[key] = JSON.stringify(values[key]) + } + } + console.log(values) + values.id = this.id BookingPrintTemplateSave({ file: this.file, data: values }) .then(res => { if (res.success) { diff --git a/src/views/main/PrintingNew/index.vue b/src/views/main/PrintingNew/index.vue index 8f32aa6..012ce69 100644 --- a/src/views/main/PrintingNew/index.vue +++ b/src/views/main/PrintingNew/index.vue @@ -17,7 +17,13 @@ - + {{ item.name }} @@ -450,7 +456,8 @@ button { .Open { } .Close { - height: 45px; + min-height: 45px; + padding-bottom: 8px; overflow: hidden; } .SetFlex {