|
|
|
@ -36,6 +36,7 @@
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="分类" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-select
|
|
|
|
|
mode="multiple"
|
|
|
|
|
placeholder="请选择分类"
|
|
|
|
|
v-decorator="['cateCode', { rules: [{ required: true, message: '请选择分类!' }] }]"
|
|
|
|
|
>
|
|
|
|
@ -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) {
|
|
|
|
|