Просмотр исходного кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

lucw 9 месяцев назад
Родитель
Сommit
9dd614313b

+ 6 - 10
src/views/factoryModel/station/components/edit.vue

@@ -425,7 +425,7 @@
             assetName: '', //设备名称
             meterMeasuringUnit: '', // 节拍计量单位
             workCenterId: null, //所属工作中心
-            produceId: null, //可执行工序
+            // produceId: null, //可执行工序
             type: null,
             teamId: null
           },
@@ -669,8 +669,7 @@
           pageNum: 1,
           size: 999,
           type: 1,
-        enable:1
-
+          enable: 1
         });
         this.factoryList = list || [];
       },
@@ -814,8 +813,7 @@
           type: 2,
           parentId: this.form.extInfo.factoryId,
           size: 9999,
-        enable:1
-
+          enable: 1
         };
         getFactoryarea(par).then((res) => {
           this.workshopPlanList = res.list;
@@ -849,7 +847,7 @@
       change_productionLineId() {},
       // 请求详情
       getData(id) {
-       return getById(id).then((res) => {
+        return getById(id).then((res) => {
           if (
             res.workstationSubstanceList &&
             res.workstationSubstanceList.length > 0
@@ -862,15 +860,13 @@
             // }
           }
           this.form = Object.assign({}, this.form, res);
-          if(this.form?.extInfo?.teamId){
-           
-            this.userListFn(this.form.extInfo.teamId)
+          if (this.form?.extInfo?.teamId) {
+            this.userListFn(this.form.extInfo.teamId);
           }
 
           if (res.taskList?.length) {
             this.form.taskNames = res.taskList.map((i) => i.name);
           }
-
         });
       }
     }

+ 23 - 3
src/views/material/product/index.vue

@@ -15,7 +15,11 @@
             :highlight-current="true"
             node-key="id"
             @node-click="handleNodeClick"
-          ></el-tree>
+          >
+            <span class="custom-tree-node" slot-scope="{ node, data }">
+              {{( isCode == 1 ? data.code : '' )+ ' ' + data.name }}
+            </span>
+          </el-tree>
         </div>
 
         <template v-slot:content>
@@ -64,7 +68,7 @@
                   <el-col v-bind="styleResponsive ? { sm: 6 } : { span: 6 }">
                     <el-form-item label="节点编码:">
                       <div class="ele-text-secondary">
-                        {{ current.code }}
+                        {{ currentData.categoryLevelPathCode }}
                       </div>
                     </el-form-item>
                   </el-col>
@@ -129,6 +133,7 @@
 
   import dictMixins from '@/mixins/dictMixins';
   import { getTreeByGroup } from '@/api/classifyManage';
+  import { parameterGetByCode } from '@/api/system/dictionary/index.js';
 
   import { getInfoById } from '@/api/classifyManage';
 
@@ -143,6 +148,7 @@
     data() {
       return {
         loading: false,
+        isCode: 0,
         current: {},
         curNode: {},
         treeList: [],
@@ -192,6 +198,14 @@
     },
     created() {
       this.getTreeData();
+      //是否显示code
+      parameterGetByCode({
+        code: 'mian_product_code'
+      }).then((res) => {
+        if (res.value) {
+          this.isCode = res.value;
+        }
+      });
     },
     methods: {
       async getTreeData() {
@@ -292,22 +306,28 @@
         }
 
         this.pathList.unshift(data);
+
         const PathInfo = {
           categoryLevelPath: '',
           categoryLevelPathId: [],
-          // rootCategoryLevelId: null,
+          categoryLevelPathCode: '',
           categoryLevelId: '',
           categoryLevelName: '',
           ruleCode: ''
         };
         const pathName = [];
+        const pathCode = [];
+        console.log(this.pathList, 'this.pathList');
         this.pathList.map((item) => {
           pathName.unshift(item.name);
+          pathCode.unshift(item.code);
+
           PathInfo.categoryLevelPathId.unshift(item.id);
           // PathInfo.rootCategoryLevelId = item.rootCategoryLevelId;
         });
         PathInfo.categoryLevelPath = pathName.join('-');
         PathInfo.categoryLevelPathId = PathInfo.categoryLevelPathId.join(',');
+        PathInfo.categoryLevelPathCode = pathCode.join('-');
         PathInfo.categoryLevelId = data.id;
         PathInfo.categoryLevelName = data.name;
         PathInfo.ruleCode = ruleCode;

+ 23 - 7
src/views/material/product/oneProduct.vue

@@ -15,7 +15,11 @@
             :highlight-current="true"
             node-key="id"
             @node-click="handleNodeClick"
-          ></el-tree>
+          >
+            <span class="custom-tree-node" slot-scope="{ node, data }">
+              {{( isCode == 1 ? data.code : '' )+ ' ' + data.name }}
+            </span>
+          </el-tree>
         </div>
 
         <template v-slot:content>
@@ -63,7 +67,7 @@
                   <el-col v-bind="styleResponsive ? { sm: 6 } : { span: 6 }">
                     <el-form-item label="节点编码:">
                       <div class="ele-text-secondary">
-                        {{ current.code }}
+                        {{ currentData.categoryLevelPathCode }}
                       </div>
                     </el-form-item>
                   </el-col>
@@ -118,8 +122,8 @@
             >
             </IndexData>
           </div>
-        </template> </ele-split-layout
-      >
+        </template>
+      </ele-split-layout>
     </el-card>
   </div>
 </template>
@@ -133,6 +137,7 @@
   import { getInfoById } from '@/api/classifyManage';
 
   import { deepClone } from '@/utils';
+  import { parameterGetByCode } from '@/api/system/dictionary/index.js';
 
   export default {
     name: 'oneProductIndex',
@@ -146,13 +151,14 @@
       return {
         loading: false,
         current: {},
+        isCode:0,
         curNode: {},
         currentData: {},
         treeList: [],
         treeLoading: false,
         formData: {},
         rootTreeId: null,
-        where:{},
+        where: {},
         defaultProps: {
           children: 'children',
           label: 'name'
@@ -190,6 +196,14 @@
     },
     created() {
       this.getTreeData();
+            //是否显示code
+      parameterGetByCode({
+        code: 'mian_product_code'
+      }).then((res) => {
+        if (res.value) {
+          this.isCode = res.value;
+        }
+      });
     },
     methods: {
       async getTreeData() {
@@ -297,14 +311,16 @@
         const PathInfo = {
           categoryLevelPath: '',
           categoryLevelPathId: [],
-          // rootCategoryLevelId: null,
+          categoryLevelPathCode: '',
           categoryLevelId: '',
           categoryLevelName: '',
           ruleCode: ''
         };
         const pathName = [];
+        const pathCode = [];
         this.pathList.map((item) => {
           pathName.unshift(item.name);
+          pathCode.unshift(item.code);
           PathInfo.categoryLevelPathId.unshift(item.id);
           // PathInfo.rootCategoryLevelId = item.rootCategoryLevelId;
         });
@@ -313,7 +329,7 @@
         PathInfo.categoryLevelId = data.id;
         PathInfo.categoryLevelName = data.name;
         PathInfo.ruleCode = ruleCode;
-
+        PathInfo.categoryLevelPathCode = pathCode.join('-');
         this.currentData = deepClone(PathInfo);
         console.log(this.currentData, '选中的产品分类');
       },

+ 32 - 3
src/views/technology/route/components/production/components/user-search.vue

@@ -36,6 +36,25 @@
           </el-select>
         </el-form-item>
       </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 6 }">
+        <el-form-item label="工作中心:">
+          <el-select
+            v-model="where.workCenterId"
+            placeholder="请选择"
+            filterable
+            clearable
+          >
+            <el-option
+              v-for="item in workCenterList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
       <!-- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="性别:">
           <el-select
@@ -50,7 +69,7 @@
         </el-form-item>
       </el-col> -->
 
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 8 } : { span: 4 }">
         <div class="ele-form-actions">
           <el-button
             type="primary"
@@ -69,6 +88,7 @@
 
 <script>
   import route from '@/api/technology/route';
+  import work from '@/api/technology/work';
   export default {
     props: {
       taskInfo: {
@@ -82,14 +102,16 @@
       const defaultWhere = {
         code: '',
         name: '',
-        factoriesId: ''
+        factoriesId: '',
+        workCenterId: ''
         // nickname: '',
         // sex: undefined
       };
       return {
         // 表单数据
         where: { ...defaultWhere },
-        factoryList: []
+        factoryList: [],
+        workCenterList: []
       };
     },
     computed: {
@@ -100,6 +122,7 @@
     },
     mounted() {
       this.getFactoryList();
+      this.getListWorkCenter();
       const data = this.deepCopy(this.taskInfo);
       this.where.factoriesId = data.factoryId;
       this.search();
@@ -140,6 +163,12 @@
           type: 1
         });
         this.factoryList = res.list;
+      },
+
+      async getListWorkCenter() {
+        await work.list({ pageNum: 1, size: -1 }).then((res) => {
+          this.workCenterList = res.list;
+        });
       }
     }
   };