695593266@qq.com 8 kuukautta sitten
vanhempi
commit
f2654f422e

+ 5 - 5
src/components/CommomSelect/person-select.vue

@@ -33,14 +33,14 @@
         default: true
       }
     },
-    data () {
+    data() {
       return {
         dictList: []
       };
     },
     computed: {
       selectVal: {
-        set (val) {
+        set(val) {
           this.$emit(
             'selfChange',
             val,
@@ -48,18 +48,18 @@
           );
           this.$emit('updateVal', val);
         },
-        get () {
+        get() {
           return this.value;
         }
       }
     },
-    created () {
+    created() {
       if (this.init) {
         this.getList();
       }
     },
     methods: {
-      async getList (params) {
+      async getList(params) {
         let data = { pageNum: 1, size: -1 };
         // 如果传了参数就是获取巡点检人员数据
         if (params) {

+ 1 - 1
src/views/factoryModel/workshop/components/edit.vue

@@ -281,7 +281,7 @@
             }
           }
           if (row.extInfo.principalDep) {
-            const params = { executeGroupId: row.extInfo.principalDep };
+            const params = { groupId: row.extInfo.principalDep };
             this.$nextTick(() => {
               this.$refs.directorRef.getList(params);
             });

+ 14 - 2
src/views/material/BOMmanage/components/routing.vue

@@ -107,6 +107,7 @@
   import routingDialog from './routingDialog.vue';
   import route from '@/api/technology/route';
   import UserEdit from '@/views/technology/route/components/user-edit.vue';
+  import { parameterGetByCode } from '@/api/system/dictionary-data';
   import {
     workingProcedureUpdate,
     workingProcedureSave
@@ -220,12 +221,14 @@
           { label: '生效', value: 1 }
         ],
         loading: false,
-        isBomRoute: false
+        isBomRoute: false,
+        isCategory: false
       };
     },
 
     created() {
       console.log(this.attributeData, 'attributeDataattributeData111');
+      this.getCategoryType();
       // this.isDelete = false;
     },
 
@@ -234,6 +237,14 @@
         this.$refs.routingDialogRef.open(this.taskParam, this.tableData);
       },
 
+      async getCategoryType() {
+        await parameterGetByCode({
+          code: 'add_routing_binding'
+        }).then((res) => {
+          this.isCategory = res.value == '1' ? true : false;
+        });
+      },
+
       createRoute(row) {
         this.current = row;
         this.showEdit = true;
@@ -357,7 +368,8 @@
             (Object.keys(this.tableData.processRoute).length == 0 ||
               this.tableData.processRoute.list.length == 0) &&
             isCreateBom == '2' &&
-            !this.isWt
+            !this.isWt &&
+            this.isCategory
           ) {
             if (this.tableData.routingIdList.length != 0) {
               // this.selected(this.tableData.routingIdList);

+ 1 - 0
src/views/material/BOMmanage/components/user-detail.vue

@@ -3,6 +3,7 @@
   <ele-modal
     width="1060px"
     :visible="visible"
+    v-if="visible"
     :append-to-body="true"
     :close-on-click-modal="false"
     custom-class="ele-dialog-form"

+ 79 - 1
src/views/technology/route/components/chooseCategory.vue

@@ -29,6 +29,15 @@
           @click="openEdit(null)"
           >新增</el-button
         >
+
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-delete"
+          class="ele-btn-icon"
+          @click="batchDelete"
+          >批量删除</el-button
+        >
       </template>
 
       <template v-slot:routingVersion="{ row }">
@@ -51,7 +60,7 @@
       @chooseCategory="chooseCategory"
     ></chooseCategoryList>
 
-    <choose-goods ref="chooseGoodsRef" @chooseGoods="chooseGoods"></choose-goods>
+    <choose-goods ref="chooseGoodsRef" @allGoods="allGoods"></choose-goods>
   </ele-modal>
 </template>
 
@@ -71,6 +80,12 @@
         selection: [],
 
         columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
           {
             prop: 'categoryLevelCode',
             label: '物品分类编码',
@@ -231,6 +246,69 @@
           acc[key] = this.deepCopy(obj[key], hash);
           return acc;
         }, result);
+      },
+
+      allGoods(goodsList) {
+        let categoryList = [];
+        goodsList.forEach((item) => {
+          if (!item.children) {
+            categoryList.push(this.deepCopy(item));
+          }
+        });
+
+        categoryList.forEach((item) => {
+          item.routingId = this.routeData.id;
+          item.routingVersion = this.routeData.version;
+          item.routingName = this.routeData.name;
+          item.routingCode = this.routeData.code;
+          item.categoryLevelCode = item.code;
+          item.categoryLevelId = item.id;
+          item.categoryLevelName = item.name;
+          item.type = this.type;
+        });
+        route
+          .batchSaveCategory(categoryList)
+          .then(() => {
+            this.$message.success('保存成功');
+            this.$refs.table.reload();
+          })
+          .catch(() => {
+            this.$message.error('保存失败');
+          });
+      },
+
+      batchDelete() {
+        if (this.selection.length == 0) {
+          this.$message.warning('请选择需要删除的数据');
+          return;
+        }
+
+        const messageTitle =
+          this.type == 1
+            ? '此操将删除该分类所绑定的工艺路线, 是否继续?'
+            : '此操将删除该物品所绑定的工艺路线, 是否继续?';
+
+        this.$confirm(messageTitle, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            let ids = [];
+            this.selection.forEach((item) => {
+              ids.push(item.id);
+            });
+            route
+              .deteleRoutingCategory(ids)
+              .then(() => {
+                this.$message.success('删除成功');
+                this.$refs.table.reload();
+              })
+              .catch(() => {
+                this.$message.error('删除失败');
+              });
+          })
+          .catch(() => {});
       }
     }
   };

+ 10 - 0
src/views/technology/route/components/chooseGoods.vue

@@ -48,6 +48,8 @@
                 :currentData="currentData"
                 cacheKeyUrl="9b62e840-material-product"
                 lyType="wp"
+                @allGoods="allGoods"
+                @cancel="cancel"
               >
               </IndexData>
             </div>
@@ -310,6 +312,14 @@
           }
         }
         return parents;
+      },
+
+      allGoods(goodsList) {
+        this.$emit('allGoods', goodsList);
+        this.visible = false;
+      },
+      cancel() {
+        this.visible = false;
       }
     }
   };

+ 20 - 9
src/views/technology/route/components/index-data.vue

@@ -25,14 +25,12 @@
           {{ getDictValueFn(row.componentAttribute) }}
         </div>
       </template>
-
-      <template v-slot:footer>
-        <el-button @click="pageShow = false">取消</el-button>
-        <el-button type="primary" :loading="loading" @click="save">
-          选择
-        </el-button>
-      </template>
     </ele-pro-table>
+
+    <div class="btns">
+      <el-button type="primary" @click="save" class="btn"> 选择 </el-button>
+      <el-button @click="cancel">取消</el-button>
+    </div>
   </div>
 </template>
 
@@ -469,8 +467,11 @@
           return;
         }
 
-        this.$emit('chooseGoods', this.selection);
-        this.pageShow = false;
+        this.$emit('allGoods', this.selection);
+      },
+
+      cancel() {
+        this.$emit('cancel');
       },
 
       success() {
@@ -520,4 +521,14 @@
     width: 100px;
     margin-left: 10px;
   }
+
+  .btns {
+    margin-top: 10px;
+    display: flex;
+    flex-direction: row-reverse;
+
+    .btn {
+      margin-left: 10px;
+    }
+  }
 </style>