张同海 2 years ago
parent 6812343e4d
commit 253cfdb9f5

@ -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: '请选择分类!' }] }]"
>
@ -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 => {

@ -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) {

@ -17,7 +17,13 @@
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="分类">
<a-select v-model="queryParam.cateCode" style="width: 100%" placeholder="请选择分类" allow-clear>
<a-select
v-model="queryParam.cateCode"
style="width: 100%"
placeholder="请选择分类"
mode="multiple"
allow-clear
>
<a-select-option v-for="item in CateData" :key="item.id" :value="item.code">
{{ item.name }}
</a-select-option>
@ -450,7 +456,8 @@ button {
.Open {
}
.Close {
height: 45px;
min-height: 45px;
padding-bottom: 8px;
overflow: hidden;
}
.SetFlex {

Loading…
Cancel
Save