|
@@ -68,10 +68,11 @@ export default {
|
|
remark: '',
|
|
remark: '',
|
|
status: 'ON',
|
|
status: 'ON',
|
|
venderType: 'M',
|
|
venderType: 'M',
|
|
- imageUrl: []
|
|
|
|
|
|
+ imageUrl: [],
|
|
|
|
+ checkList: []
|
|
},
|
|
},
|
|
- formType: 'add',
|
|
|
|
- formVisible: false,
|
|
|
|
|
|
+ formType: 'add',
|
|
|
|
+ formVisible: false,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -166,11 +167,16 @@ export default {
|
|
render: (h, { props, onInput }) => {
|
|
render: (h, { props, onInput }) => {
|
|
var { value } = props
|
|
var { value } = props
|
|
return (
|
|
return (
|
|
- <el-radio-group v-model={this.formData.venderType}>
|
|
|
|
- <el-radio disabled={this.formDialogType == 2} label="M">辅材</el-radio>
|
|
|
|
- <el-radio disabled={this.formDialogType == 2} label="P">配件</el-radio>
|
|
|
|
- <el-radio disabled={this.formDialogType == 2} label="A">辅材和配件</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
|
|
+ // <el-radio-group v-model={this.formData.venderType}>
|
|
|
|
+ // <el-radio disabled={this.formDialogType == 2} label="M">辅材</el-radio>
|
|
|
|
+ // <el-radio disabled={this.formDialogType == 2} label="P">配件</el-radio>
|
|
|
|
+ // <el-radio disabled={this.formDialogType == 2} label="A">辅材和配件</el-radio>
|
|
|
|
+ // </el-radio-group>
|
|
|
|
+ <el-checkbox-group v-model={this.formData.checkList}>
|
|
|
|
+ <el-checkbox disabled={this.formDialogType == 2} label="辅材"></el-checkbox>
|
|
|
|
+ <el-checkbox disabled={this.formDialogType == 2} label="配件"></el-checkbox>
|
|
|
|
+ <el-checkbox disabled={this.formDialogType == 2} label="商品"></el-checkbox>
|
|
|
|
+ </el-checkbox-group>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
}, {
|
|
}, {
|
|
@@ -386,14 +392,16 @@ export default {
|
|
this.formDialogType = 1
|
|
this.formDialogType = 1
|
|
getDetail({ id }).then(res => {
|
|
getDetail({ id }).then(res => {
|
|
Object.assign(this.formData, res.data, {
|
|
Object.assign(this.formData, res.data, {
|
|
- imageUrl: res.data?.imageUrl ? res.data?.imageUrl?.split(",").map(item => ({ url: item })) : []
|
|
|
|
|
|
+ imageUrl: res.data?.imageUrl ? res.data?.imageUrl?.split(",").map(item => ({ url: item })) : [],
|
|
|
|
+ checkList: res.data.venderType.split(',')
|
|
})
|
|
})
|
|
})
|
|
})
|
|
}else{
|
|
}else{
|
|
this.formDialogType = 2
|
|
this.formDialogType = 2
|
|
getDetail({ id }).then(res => {
|
|
getDetail({ id }).then(res => {
|
|
Object.assign(this.formData, res.data, {
|
|
Object.assign(this.formData, res.data, {
|
|
- imageUrl: res.data?.imageUrl ? res.data?.imageUrl?.split(",").map(item => ({ url: item })) : []
|
|
|
|
|
|
+ imageUrl: res.data?.imageUrl ? res.data?.imageUrl?.split(",").map(item => ({ url: item })) : [],
|
|
|
|
+ checkList: res.data.venderType.split(',')
|
|
})
|
|
})
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -410,6 +418,7 @@ export default {
|
|
if (valid) {
|
|
if (valid) {
|
|
([add, edit][this.formDialogType])({
|
|
([add, edit][this.formDialogType])({
|
|
...this.formData,
|
|
...this.formData,
|
|
|
|
+ venderType: this.formData.checkList.join(','),
|
|
imageUrl: this.formData.imageUrl.map(item => item.url).join(",")
|
|
imageUrl: this.formData.imageUrl.map(item => item.url).join(",")
|
|
}).then(res => {
|
|
}).then(res => {
|
|
this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
|
|
this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
|