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

@ -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: '请选择分类!' }] }]"
> >
@ -131,21 +132,30 @@ export default {
this.confirmLoading = true this.confirmLoading = true
validateFields((errors, values) => { validateFields((errors, values) => {
if (!errors) { 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 => { this.SysTenantData.forEach(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) {
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
}
}
console.log(values, 11111111) console.log(values, 11111111)
BookingPrintTemplateSave({ file: this.file, data: values }) BookingPrintTemplateSave({ file: this.file, data: values })
.then(res => { .then(res => {

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

@ -17,7 +17,13 @@
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-form-item label="分类"> <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"> <a-select-option v-for="item in CateData" :key="item.id" :value="item.code">
{{ item.name }} {{ item.name }}
</a-select-option> </a-select-option>
@ -450,7 +456,8 @@ button {
.Open { .Open {
} }
.Close { .Close {
height: 45px; min-height: 45px;
padding-bottom: 8px;
overflow: hidden; overflow: hidden;
} }
.SetFlex { .SetFlex {

Loading…
Cancel
Save