周兴 3 лет назад
Родитель
Сommit
1eff551296

+ 1 - 1
src/components/base/dk-list/dk-list.vue

@@ -1,4 +1,4 @@
-<!-- @desc:list组件  @auth:周兴  @time:2022/11/15 13:03 -->
+<!-- @desc:dk-list组件  @auth:周兴  @time:2023/1/4 9:26 -->
 <template>
   <div>
     <div v-if="type==='drag'" class="list-item" draggable  @dragend="dragend($event,listItem)" :class="currentItemIndex === listIndex?'current-item':''" v-for="(listItem,listIndex) in list" :key="listIndex" @click="itemClick(listItem,listIndex)">{{listItem[label]}}</div>

+ 3 - 1
src/mixins/index.js

@@ -174,6 +174,7 @@ export const indexMixin = {
             }
             if (closeFlag && modalRef && this.$refs[modalRef]) {
               this.$refs[modalRef].showModal = false;
+              this.searchData(1); // 重新触发查询
             }
           } else {
             // 如果不成功就提示错误信息
@@ -235,7 +236,7 @@ export const indexMixin = {
     excuteNoParam(service, method, params = [], showMessage = true, button = '') {
       if (service && params && params.length > 0) {
         this.loading = true;
-        let url = service.prefix + (method?method:'');
+        let url = service.prefix + (method ? method : '');
         let par = ''
         params.forEach(it => {
           par += '/' + it
@@ -245,6 +246,7 @@ export const indexMixin = {
           res.then(t => {
             if (showMessage) {
               if (t.code === this.$config.SUCCESS_CODE) {
+                button = button ? button : method;
                 this.$Message.success(this.$t('I_001', {'param': this.$v(button)}))
               } else {
                 this.$Message.error(res.message)

+ 12 - 5
src/view/basic/factory/index.vue

@@ -156,9 +156,9 @@ export default {
      */
     onSwitchChange(param) {
       if (param.flgValid) {
-        this.excuteNoParam(this.$service.factoryService, this.$service.factoryService.enable, [param.postId])
+        this.excuteNoParam(this.$service.factoryService, this.$service.factoryService.enable, [param.ftyId])
       } else {
-        this.excuteNoParam(this.$service.factoryService, this.$service.factoryService.disable, [param.postId])
+        this.excuteNoParam(this.$service.factoryService, this.$service.factoryService.disable, [param.ftyId])
       }
     },
     /*************************************************一览界面操作end*********************************************/
@@ -170,6 +170,9 @@ export default {
      */
     add() {
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'fty') // 给modal标题赋值
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.editAddModal = true
     },
     /**
@@ -197,12 +200,16 @@ export default {
       this.params = this.formData
     },
     /**
-     * @desc   : 保存数据
+     * @desc   : 保存方法
      * @author : 周兴
-     * @date   : 2022年12月13日10:56:56
+     * @date   : 2023/1/4 9:25
      */
     saveData() {
-      return this.excute(this.$service.factoryService, this.$service.factoryService.insert, this.params);
+      if(this.type === this.$config.formMode.add){
+        return this.excute(this.$service.factoryService, this.$service.factoryService.insert, this.params);
+      }else{
+        return this.excute(this.$service.factoryService, this.$service.factoryService.update, this.params);
+      }
     },
     /**
      * @desc   : 清空数据

+ 4 - 9
src/view/basic/organization/index.vue

@@ -135,12 +135,9 @@ export default {
      * @date   : 2022年12月13日10:28:36
      */
     add(){
-      this.modalTitle = this.setTitle('add','fty')
+      this.modalTitle = this.setTitle(this.$config.formMode.add,'fty')
       this.modalParams = {
-        formRef: 'formInline',
-        button: 'add',
-        clearFlag: true,
-        closeFlag: false
+        button: this.$config.formMode.add,
       }
       this.editAddModal = true
     },
@@ -152,12 +149,10 @@ export default {
      */
     edit(rows){
       this.modalParams = {
-        formRef: 'formInline',
-        button: 'add',
-        clearFlag: true,
+        button: this.$config.formMode.edit,
         closeFlag: true
       }
-      this.modalTitle = this.setTitle('edit','fty')
+      this.modalTitle = this.setTitle(this.$config.formMode.edit,'fty')
       if(rows.length>0){
         this.formData = {...rows[0]}
       }

+ 4 - 9
src/view/core/busobj-category/index.vue

@@ -219,12 +219,9 @@
        *   @author : 寇珊珊
        */
       add() {
-        this.modalTitle = this.setTitle('add', 'busobjCategory')
+        this.modalTitle = this.setTitle(this.$config.formMode.add, 'busobjCategory')
         this.modalParams = {
-          formRef: 'modal_editAdd',
-          button: 'add',
-          clearFlag: true,
-          closeFlag: false
+          button: this.$config.formMode.add,
         }
         this.editAddModal = true
       },
@@ -235,12 +232,10 @@
        */
       edit(rows) {
         this.modalParams = {
-          formRef: 'modal_editAdd',
-          button: 'edit',
-          clearFlag: true,
+          button: this.$config.formMode.edit,
           closeFlag: true
         }
-        this.modalTitle = this.setTitle('edit', 'busobjCategory')
+        this.modalTitle = this.setTitle(this.$config.formMode.edit, 'busobjCategory')
         if (rows.length > 0) {
           this.formData = {...rows[0]}
         }

+ 5 - 10
src/view/core/busobj/index.vue

@@ -196,7 +196,7 @@
        *   @author : 寇珊珊
        */
       saveData() {
-        return this.modalParams.button === 'add'
+        return this.modalParams.button === this.$config.formMode.add
           ? this.excute(this.$service.busobjService, this.$service.busobjService.insert, this.params)
           : this.excute(this.$service.busobjService, this.$service.busobjService.update, this.params)
       },
@@ -206,12 +206,9 @@
        *   @author : 寇珊珊
        */
       add() {
-        this.modalTitle = this.setTitle('add', 'busobj')
+        this.modalTitle = this.setTitle(this.$config.formMode.add, 'busobj')
         this.modalParams = {
-          formRef: 'modal_editAdd',
-          button: 'add',
-          clearFlag: true,
-          closeFlag: false
+          button: this.$config.formMode.add,
         }
         this.editAddModal = true
       },
@@ -222,12 +219,10 @@
        */
       edit(rows) {
         this.modalParams = {
-          formRef: 'modal_editAdd',
-          button: 'edit',
-          clearFlag: true,
+          button: this.$config.formMode.edit,
           closeFlag: true
         }
-        this.modalTitle = this.setTitle('edit', 'busobj')
+        this.modalTitle = this.setTitle(this.$config.formMode.edit, 'busobj')
         if (rows.length > 0) {
           this.formData = {...rows[0]}
         }

+ 3 - 0
src/view/core/carr-kiln-car/index.vue

@@ -220,6 +220,9 @@
        */
       add() {
         this.modalTitle = this.setTitle(this.$config.formMode.add, 'carrKilnCar')
+        this.modalParams = {
+          button: this.$config.formMode.add,
+        }
         this.editAddModal = true
       },
       /**

+ 3 - 0
src/view/core/equip-kiln/index.vue

@@ -271,6 +271,9 @@ export default {
      */
     add() {
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'equipKiln')
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.editAddModal = true
     },
     /**

+ 4 - 9
src/view/core/equip-thmeter/index.vue

@@ -223,12 +223,9 @@
        *   @author : 寇珊珊
        */
       add() {
-        this.modalTitle = this.setTitle('add', 'equipThmeter')
+        this.modalTitle = this.setTitle(this.$config.formMode.add, 'equipThmeter')
         this.modalParams = {
-          formRef: 'modal_editAdd',
-          button: 'add',
-          clearFlag: true,
-          closeFlag: false
+          button: this.$config.formMode.add,
         }
         this.editAddModal = true
       },
@@ -239,12 +236,10 @@
        */
       edit(rows) {
         this.modalParams = {
-          formRef: 'modal_editAdd',
-          button: 'edit',
-          clearFlag: true,
+          button: this.$config.formMode.edit,
           closeFlag: true
         }
-        this.modalTitle = this.setTitle('edit', 'equipThmeter')
+        this.modalTitle = this.setTitle(this.$config.formMode.edit, 'equipThmeter')
         if (rows.length > 0) {
           this.formData = {...rows[0]}
         }

+ 3 - 0
src/view/core/label-print-layout/index.vue

@@ -230,6 +230,9 @@ export default {
      */
     add() {
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'labelPrintLayout')
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.editAddModal = true
     },
     /**

+ 3 - 0
src/view/core/label-printer/index.vue

@@ -238,6 +238,9 @@ export default {
      */
     add() {
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'labelPrinter')
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.editAddModal = true
     },
     /**

+ 3 - 0
src/view/core/product-brand/index.vue

@@ -230,6 +230,9 @@ export default {
      */
     add() {
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'productBrand')
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.editAddModal = true
     },
     /**

+ 3 - 0
src/view/core/product-colour/index.vue

@@ -231,6 +231,9 @@ export default {
      */
     add() {
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'productColour')
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.editAddModal = true
     },
     /**

+ 3 - 0
src/view/core/product-defect-type/index.vue

@@ -197,6 +197,9 @@ export default {
      */
     add() {
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'productDefectType')
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.editAddModal = true
     },
     /**

+ 3 - 0
src/view/core/product-defect/index.vue

@@ -256,6 +256,9 @@ export default {
      */
     add() {
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'productDefect')
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.editAddModal = true
     },
     /**

+ 3 - 0
src/view/core/product-grade/index.vue

@@ -251,6 +251,9 @@ export default {
      */
     add() {
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'productGrade')
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.editAddModal = true
     },
     /**

+ 3 - 0
src/view/core/product-logo/index.vue

@@ -264,6 +264,9 @@ export default {
      */
     add() {
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'productLogo')
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.editAddModal = true
     },
     /**

+ 3 - 0
src/view/core/product-place/index.vue

@@ -226,6 +226,9 @@ export default {
      */
     add() {
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'productPlace')
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.editAddModal = true
     },
     /**

+ 3 - 1
src/view/core/role/index.vue

@@ -723,8 +723,10 @@ export default {
      * @date   : 2022年12月13日10:28:36
      */
     add() {
-      console.log('bbb')
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'roleName')
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.loading = false
       this.editAddModal = true
     },

+ 3 - 1
src/view/core/staff/index.vue

@@ -281,8 +281,10 @@ export default {
      * @date   : 2022年12月13日10:28:36
      */
     add() {
-      console.log('333')
       this.modalTitle = this.setTitle(this.$config.formMode.add, 'staff')
+      this.modalParams = {
+        button: this.$config.formMode.add,
+      }
       this.editAddModal = true
     },
     /**

+ 5 - 10
src/view/core/unique-base/index.vue

@@ -232,7 +232,7 @@ export default {
      *   @author : 洪旭东
      */
     saveData() {
-      return this.modalParams.button === 'add'
+      return this.modalParams.button === this.$config.formMode.add
         ? this.excute(this.$service.uniqueBaseService, this.$service.uniqueBaseService.insert, this.params)
         : this.excute(this.$service.uniqueBaseService, this.$service.uniqueBaseService.update, this.params)
     },
@@ -242,12 +242,9 @@ export default {
      *   @author : 洪旭东
      */
     add() {
-      this.modalTitle = this.setTitle('add', 'uniqueBase')
+      this.modalTitle = this.setTitle(this.$config.formMode.add, 'uniqueBase')
       this.modalParams = {
-        formRef: 'modal_editAdd',
-        button: 'add',
-        clearFlag: true,
-        closeFlag: false
+        button: this.$config.formMode.add,
       }
       this.editAddModal = true
     },
@@ -258,12 +255,10 @@ export default {
      */
     edit(rows) {
       this.modalParams = {
-        formRef: 'modal_editAdd',
-        button: 'edit',
-        clearFlag: true,
+        button: this.$config.formMode.edit,
         closeFlag: true
       }
-      this.modalTitle = this.setTitle('edit', 'uniqueBase')
+      this.modalTitle = this.setTitle(this.$config.formMode.edit, 'uniqueBase')
       if (rows.length > 0) {
         this.formData = {...rows[0]}
       }