Prechádzať zdrojové kódy

feat:仓储管理-增加仓储属性和状态

Moss 1 rok pred
rodič
commit
e0cd82f23e
1 zmenil súbory, kde vykonal 27 pridanie a 2 odobranie
  1. 27 2
      src/views/mallManagement/storage/index.vue

+ 27 - 2
src/views/mallManagement/storage/index.vue

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