|
@@ -50,6 +50,8 @@ export default {
|
|
|
storageName: '',
|
|
|
storageMobile: '',
|
|
|
storageAddress: '',
|
|
|
+ status: true,
|
|
|
+ type: [],
|
|
|
},
|
|
|
formType: 'add',
|
|
|
formVisible: false,
|
|
@@ -96,7 +98,7 @@ export default {
|
|
|
rules: [...mobile]
|
|
|
}
|
|
|
}, {
|
|
|
- md: 6,
|
|
|
+ md: 12,
|
|
|
isShow: true,
|
|
|
name: 'el-input',
|
|
|
attributes: { placeholder: '请输入' },
|
|
@@ -105,6 +107,28 @@ export default {
|
|
|
prop: 'storageAddress',
|
|
|
rules: []
|
|
|
}
|
|
|
+ }, {
|
|
|
+ md: 6,
|
|
|
+ isShow: true,
|
|
|
+ name: 'el-checkbox',
|
|
|
+ options: [{value: '商品', label: '商品'}, {value: '辅材', label: '辅材'}, {value: '配件', label: '配件'}],
|
|
|
+ attributes: {},
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '仓储属性',
|
|
|
+ prop: 'type',
|
|
|
+ rules: [...required]
|
|
|
+ },
|
|
|
+ }, {
|
|
|
+ md: 6,
|
|
|
+ isShow: true,
|
|
|
+ name: 'el-radio',
|
|
|
+ options: [{value: true, label: '启用'}, {value: false, label: '禁用'}],
|
|
|
+ attributes: {},
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '状态',
|
|
|
+ prop: 'status',
|
|
|
+ rules: [...required]
|
|
|
+ },
|
|
|
}]
|
|
|
}
|
|
|
},
|
|
@@ -162,6 +186,7 @@ export default {
|
|
|
} else if(type == 'edit'){
|
|
|
this.formDialogType = 1
|
|
|
getStorageDetail({ id }).then(res => {
|
|
|
+ res.data.type = res.data.type.split(',');
|
|
|
Object.assign(this.formData, res.data)
|
|
|
})
|
|
|
}
|
|
@@ -181,7 +206,7 @@ export default {
|
|
|
formConfirm(cancel) {
|
|
|
this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
|
|
|
if (valid) {
|
|
|
- ([addStorage, editStorage][this.formDialogType])(this.formData).then(res => {
|
|
|
+ ([addStorage, editStorage][this.formDialogType])({...this.formData, type: this.formData.type.join(',')}).then(res => {
|
|
|
this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
|
|
|
cancel('list')
|
|
|
this.$refs.pageRef.refreshList()
|