|
|
@ -36,6 +36,7 @@
|
|
|
|
<a-col :span="8">
|
|
|
|
<a-col :span="8">
|
|
|
|
<a-form-item label="分类" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
<a-form-item label="分类" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
<a-select
|
|
|
|
<a-select
|
|
|
|
|
|
|
|
mode="multiple"
|
|
|
|
placeholder="请选择分类"
|
|
|
|
placeholder="请选择分类"
|
|
|
|
v-decorator="['cateCode', { rules: [{ required: true, message: '请选择分类!' }] }]"
|
|
|
|
v-decorator="['cateCode', { rules: [{ required: true, message: '请选择分类!' }] }]"
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -89,13 +90,9 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
visible: false,
|
|
|
|
visible: false,
|
|
|
|
confirmLoading: false,
|
|
|
|
confirmLoading: false,
|
|
|
|
MainOrSub: [],
|
|
|
|
|
|
|
|
form: this.$form.createForm(this),
|
|
|
|
form: this.$form.createForm(this),
|
|
|
|
data: {},
|
|
|
|
data: {},
|
|
|
|
plainOptions: [
|
|
|
|
id: ''
|
|
|
|
{ label: '主单', value: 'IsMain' },
|
|
|
|
|
|
|
|
{ label: '分单', value: 'IsSub' }
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
@ -127,25 +124,19 @@ export default {
|
|
|
|
edit(record) {
|
|
|
|
edit(record) {
|
|
|
|
this.data = record
|
|
|
|
this.data = record
|
|
|
|
console.log(record)
|
|
|
|
console.log(record)
|
|
|
|
|
|
|
|
this.id = record.id
|
|
|
|
this.visible = true
|
|
|
|
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(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
cateCode: record.cateCode,
|
|
|
|
cateCode: record.cateCode
|
|
|
|
|
|
|
|
.split('[')[1]
|
|
|
|
|
|
|
|
.split(']')[0]
|
|
|
|
|
|
|
|
.split(','),
|
|
|
|
cateName: record.cateName,
|
|
|
|
cateName: record.cateName,
|
|
|
|
displayName: record.displayName,
|
|
|
|
displayName: record.displayName,
|
|
|
|
tenantId: record.tenantId,
|
|
|
|
tenantId: record.tenantId,
|
|
|
|
tenantName: record.tenantName,
|
|
|
|
tenantName: record.tenantName,
|
|
|
|
id: record.id,
|
|
|
|
|
|
|
|
type: record.type
|
|
|
|
type: record.type
|
|
|
|
})
|
|
|
|
})
|
|
|
|
console.log(this.form.getFieldsValue())
|
|
|
|
console.log(this.form.getFieldsValue())
|
|
|
@ -159,23 +150,34 @@ export default {
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
console.log(errors, values)
|
|
|
|
console.log(errors, values)
|
|
|
|
if (!errors) {
|
|
|
|
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 => {
|
|
|
|
this.SysTenantData.forEach(item => {
|
|
|
|
console.log(item)
|
|
|
|
console.log(item)
|
|
|
|
if (values.tenantName == item.name) {
|
|
|
|
if (values.tenantName == item.name) {
|
|
|
|
values.tenantId = item.id
|
|
|
|
values.tenantId = item.id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
let cateName = ''
|
|
|
|
this.CateData.forEach(item => {
|
|
|
|
this.CateData.forEach(item => {
|
|
|
|
if (values.cateCode == item.code) {
|
|
|
|
values.cateCode.forEach(ele => {
|
|
|
|
values.cateName = item.name
|
|
|
|
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 })
|
|
|
|
BookingPrintTemplateSave({ file: this.file, data: values })
|
|
|
|
.then(res => {
|
|
|
|
.then(res => {
|
|
|
|
if (res.success) {
|
|
|
|
if (res.success) {
|
|
|
|