Explorar o código

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

LAPTOP-16IUEB3P\Lenovo %!s(int64=2) %!d(string=hai) anos
pai
achega
0afe60aaad

+ 10 - 4
src/api/material/manage.js

@@ -9,7 +9,6 @@ export async function getTreeByPid (pid) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 // 新增物料
 export async function addMaterial (data) {
   const res = await request.post(`/main/category/add`, data);
@@ -21,7 +20,7 @@ export async function addMaterial (data) {
 
 // 编辑物料
 export async function editMaterial (data) {
-  const res = await request.post(`/main/category/edit`,data);
+  const res = await request.post(`/main/category/edit`, data);
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -30,7 +29,7 @@ export async function editMaterial (data) {
 
 // 获取列表
 export async function getMaterialList (data) {
-  const res = await request.get(`/main/category/getList`,{
+  const res = await request.get(`/main/category/getList`, {
     params: data
   });
   if (res.data.code == 0) {
@@ -48,7 +47,6 @@ export async function getDetailInfo (id) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 //删除
 export async function removeMaterial (id) {
   const res = await request.get(`/main/category/remove/${id}`);
@@ -57,3 +55,11 @@ export async function removeMaterial (id) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+//根据类别ID获取bom与工艺路线列表  产品管理
+export async function getBomRoutingList (categoryId) {
+  const res = await request.get(`/main/category/getSourceList/${categoryId}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 10 - 8
src/store/modules/user.js

@@ -13,16 +13,18 @@ const formatRouter = (list) => {
     let arr = [];
     for (const p of list) {
       if (p.menuType === 2) {
-        p.children = [];
-        authorities.push(p);
+        // p.children = [];
+        // authorities.push(p);
+        p.hide = true;
+      }
+      //  else {
+      if (p.children?.length) {
+        p.children = fn(p.children);
       } else {
-        if (p.children?.length) {
-          p.children = fn(p.children);
-        } else {
-          p.children = [];
-        }
-        arr.push(p);
+        p.children = [];
       }
+      arr.push(p);
+      // }
     }
 
     return arr;

+ 1 - 1
src/views/classifyManage/treeClassify/index.vue

@@ -111,7 +111,7 @@
       // 编辑
       junmpEdit ({ id }) {
         this.$router.push({
-          path: '/classifyManage/treeClassify/details',
+          path: '/treeClassify/details',
           query: {
             id
           }

+ 9 - 12
src/views/equipmentManage/components/link-material-dialog.vue

@@ -251,12 +251,9 @@
         this.visible = false;
       },
       async save () {
-        if (!this.datasourceRightShow.length) {
-          return this.$message.error('请添加关联数据');
-        }
         const params = {
           mainCategoryId: this.row.categoryLevelId,
-          mainCategoryLevelRootId: this.row.categoryLevelGroupId,
+          mainCategoryLevelRootId: this.type,
           materialDetailsPOList: this.datasourceRightShow.map((i) => ({
             ...i,
             categoryLevelRootId: this.type
@@ -271,11 +268,11 @@
         if (!this.selection.length) {
           return this.$message.error('请选择关联数据');
         }
-        this.datasource = this.datasource.filter((i) =>
-          !this.selection.find((t) => t.categoryId == i.categoryId)
+        this.datasource = this.datasource.filter(
+          (i) => !this.selection.find((t) => t.categoryId == i.categoryId)
         );
-        this.datasourceShow = this.datasourceShow.filter((i) =>
-          !this.selection.find((t) => t.categoryId == i.categoryId)
+        this.datasourceShow = this.datasourceShow.filter(
+          (i) => !this.selection.find((t) => t.categoryId == i.categoryId)
         );
 
         this.datasourceRightShow.push(...this.selection);
@@ -288,11 +285,11 @@
           return this.$message.error('请选择取消关联数据');
         }
 
-        this.datasourceRight = this.datasourceRight.filter((i) =>
-          !this.selectionRight.find((t) => t.categoryId == i.categoryId)
+        this.datasourceRight = this.datasourceRight.filter(
+          (i) => !this.selectionRight.find((t) => t.categoryId == i.categoryId)
         );
-        this.datasourceRightShow = this.datasourceRightShow.filter((i) =>
-          !this.selectionRight.find((t) => t.categoryId == i.categoryId)
+        this.datasourceRightShow = this.datasourceRightShow.filter(
+          (i) => !this.selectionRight.find((t) => t.categoryId == i.categoryId)
         );
 
         this.datasourceShow.push(...this.selectionRight);

+ 0 - 1
src/views/ledgerAssets/equipment/edit.vue

@@ -833,7 +833,6 @@
           this.positionInfo.lineCode = pathIds[2];
           this.positionInfo.lineName = pathName[2];
 
-          console.log(this.positionInfo, 'this.positionInfo');
           this.$nextTick(() => {
             this.$refs.WorkshopSelectRef.getList();
             this.$refs.FactoryLineSelectRef.getList();

+ 114 - 32
src/views/material/product/components/link-msg.vue

@@ -3,30 +3,38 @@
     <headerTitle title="关联信息"></headerTitle>
     <el-tabs v-model="activeTab">
       <el-tab-pane label="可用模具">
-        <ele-pro-table :columns="moduleColumn" :datasource="[]">
+        <ele-pro-table :columns="moduleColumn" :datasource="moduleData">
         </ele-pro-table>
       </el-tab-pane>
       <el-tab-pane label="BOM">
-        <ele-pro-table :columns="BOMColumn" :datasource="[]"> </ele-pro-table
+        <ele-pro-table :columns="BOMColumn" :datasource="bomData">
+        </ele-pro-table
       ></el-tab-pane>
       <el-tab-pane label="工艺路线">
-        <ele-pro-table :columns="pathColumn" :datasource="[]"> </ele-pro-table
+        <ele-pro-table :columns="pathColumn" :datasource="pathData">
+        </ele-pro-table
       ></el-tab-pane>
       <!-- <el-tab-pane label="质量标准"></el-tab-pane> -->
-     <!-- <el-tab-pane label="文件">
+      <!-- <el-tab-pane label="文件">
         <ele-pro-table :columns="fileColumn" :datasource="[]"> </ele-pro-table
       ></el-tab-pane> -->
       <el-tab-pane label="关联设备">
-        <ele-pro-table :columns="equiColumn" :datasource="[]"> </ele-pro-table
+        <ele-pro-table :columns="equiColumn" :datasource="eqData">
+        </ele-pro-table
       ></el-tab-pane>
     </el-tabs>
   </div>
 </template>
 
 <script>
+  import { getBomRoutingList } from '@/api/material/manage.js';
+  import { getRelatesInformationList } from '@/api/material/product.js';
+  import dictMixins from '@/mixins/dictMixins';
   export default {
+    mixins: [dictMixins],
     props: {
       id: [Number, String],
+      categoryLevelId: [Number, String]
     },
     data () {
       return {
@@ -39,59 +47,76 @@
             align: 'center'
           },
           {
-            label: '编码'
+            label: '编码',
+            prop: 'code'
           },
           {
-            label: '名称'
+            label: '名称',
+            prop: 'name'
           },
           {
-            label: '牌号'
+            label: '牌号',
+            prop: 'brandNum'
           },
           {
-            label: '型号'
+            label: '型号',
+            prop: 'modelType'
           },
           {
-            label: '收缩系数'
+            label: '收缩系数',
+            prop: 'extendInfo.shrinkEffictive'
           },
           {
-            label: '大模体型号'
-          },
-          {
-            label: '物品类型'
+            label: '大模体型号',
+            prop: 'extendInfo.maxMoldType'
           },
+          // {
+          //   label: '物品类型',
+          //   prop: ''
+          // },
           {
-            label: '分类'
+            label: '分类',
+            prop: 'categoryLevelGroupName'
           }
         ],
         BOMColumn: [
           {
-            label: 'BOM编码'
+            label: 'BOM编码',
+            prop: 'code'
           },
           {
-            label: 'BOM名称'
+            label: 'BOM名称',
+            prop: 'name'
           },
           {
-            label: '版本号'
+            label: '版本号',
+            prop: 'version'
           },
           {
-            label: '基本数量'
+            label: '基本数量',
+            prop: 'baseCount'
           },
           {
-            label: '单位'
+            label: '单位',
+            prop: 'baseCountUnit'
           }
         ],
         pathColumn: [
           {
-            label: '工艺路线组编码'
+            label: '工艺路线组编码',
+            prop: 'code'
           },
           {
-            label: '工艺路线名称'
+            label: '工艺路线名称',
+            prop: 'name'
           },
           {
-            label: '生产版本'
+            label: '生产版本',
+            prop: ''
           },
           {
-            label: '工艺路线版本'
+            label: '工艺路线版本',
+            prop: 'version'
           }
         ],
         fileColumn: [
@@ -107,27 +132,84 @@
           //   type: 'selection'
           // },
           {
-            label: '设备分类'
+            label: '设备分类',
+            prop: 'categoryLevelGroupName'
           },
           {
-            label: '设备编码'
+            label: '设备编码',
+            prop: 'code'
           },
           {
-            label: '设备名称'
+            label: '设备名称',
+            prop: 'name'
           },
           {
-            label: '产能'
+            label: '产能',
+            formatter: (row) => {
+              return (
+                row.quantity &&
+                `${row.quantity}/${this.getDictValue(
+                  '重量单位',
+                  row.quantityUnitId
+                )}`
+              );
+            }
           }
-        ]
+        ],
+        moduleData: [],
+        eqData: [],
+        bomData: [],
+        pathData: []
       };
     },
-    created(){
-      console.log('id2',this.id)
+    watch: {
+      id: {
+        handler (val) {
+          if (val) {
+            this.getData();
+          }
+        },
+        immediate: true
+      },
+      categoryLevelId: {
+        handler (val) {
+          if (val) {
+            this.getModuleData();
+            this.getEqData();
+          }
+        },
+        immediate: true
+      }
+    },
+    created () {
+      this.requestDict('重量单位');
     },
     methods: {
+      async getData () {
+        const data = await getBomRoutingList(this.id);
 
-    }
+        this.bomData = data?.bomList || [];
+        this.pathData = data?.routingList || [];
+      },
+      // 关联设备
+      async getEqData () {
+        const data = await getRelatesInformationList({
+          mainCategoryId: this.categoryLevelId,
+          categoryLevelRootId: 4 //设备
+        });
 
+        this.eqData = data;
+      },
+      // 关联舟皿
+      async getModuleData () {
+        const data = await getRelatesInformationList({
+          mainCategoryId: this.categoryLevelId,
+          categoryLevelRootId: 5 //模具
+        });
+
+        this.moduleData = data;
+      }
+    }
   };
 </script>
 <style lang="scss" scoped>

+ 68 - 65
src/views/material/product/detail.vue

@@ -157,7 +157,11 @@
     <!-- 备注信息 -->
     <RemarkInfo ref="remarkRefs" :form="remarkform" />
     <!-- 关联信息 -->
-    <linkMsg ref="linkMsgRef" :id="id" />
+    <linkMsg
+      ref="linkMsgRef"
+      :id="$route.query.id"
+      :categoryLevelId="form.categoryLevelId"
+    />
   </div>
 </template>
 
@@ -180,7 +184,7 @@
   import { getDetails } from '@/api/classifyManage/itemInformation';
   import { addMaterial } from '@/api/material/manage.js';
   import { deepClone } from '@/utils/index';
-  import { finishPageTab , reloadPageTab } from '@/utils/page-tab-util';
+  import { finishPageTab, reloadPageTab } from '@/utils/page-tab-util';
   export default {
     name: 'ManageMaterial',
     components: {
@@ -208,15 +212,15 @@
           categoryLevelName: ''
         },
         remarkform: {
-          remarkAttach:[]
+          remarkAttach: []
         },
-        categoryAps:{},
-        categoryMes:{},
-        categoryMold:{},
-        categoryPallet:{},
-        categoryQms:{},
-        categoryVehicle:{},
-        categoryWms:{},
+        categoryAps: {},
+        categoryMes: {},
+        categoryMold: {},
+        categoryPallet: {},
+        categoryQms: {},
+        categoryVehicle: {},
+        categoryWms: {},
         // 表单验证规则
         rules: {
           categoryLevelGroupName: [
@@ -231,8 +235,8 @@
             { required: true, message: '请选择计量单位', trigger: 'change' }
           ]
         },
-        PathInfo:{},
-        id:null
+        PathInfo: {},
+        id: null
       };
     },
     created () {
@@ -240,52 +244,51 @@
     },
     methods: {
       async _getDetails () {
-        this.id = this.$route.query.id
         const data = await getDetails(this.$route.query.id);
-        const info = deepClone(data)
+        const info = deepClone(data);
         this.form = {
           ...info.category
-        }
-        this.judgeSet(info)
+        };
+        this.judgeSet(info);
         this.searchDeptNodeClick(this.form.deptLeaderId);
       },
       // 判断字段类型并赋值
-      judgeSet(info){
-         if(typeof info.categoryAps == 'string'){
-            this.categoryAps = {}
-         }else{
-            this.categoryAps = info.categoryAps
-         }
-         if(typeof info.categoryMes == 'string'){
-            this.categoryMes = {}
-         }else{
-            this.categoryMes = info.categoryMes
-         }
-         if(typeof info.categoryMold == 'string'){
-            this.categoryMold = {}
-         }else{
-            this.categoryMold = info.categoryMold
-         }
-         if(typeof info.categoryPallet == 'string'){
-            this.categoryPallet = {}
-         }else{
-            this.categoryPallet = info.categoryPallet
-         }
-         if(typeof info.categoryQms == 'string'){
-            this.categoryQms = {}
-         }else{
-            this.categoryQms = info.categoryQms
-         }
-         if(typeof info.categoryVehicle == 'string'){
-            this.categoryVehicle = {}
-         }else{
-            this.categoryVehicle = info.categoryVehicle
-         }
-         if(typeof info.categoryWms == 'string'){
-            this.categoryWms = {}
-         }else{
-            this.categoryWms = info.categoryWms
-         }
+      judgeSet (info) {
+        if (typeof info.categoryAps == 'string') {
+          this.categoryAps = {};
+        } else {
+          this.categoryAps = info.categoryAps;
+        }
+        if (typeof info.categoryMes == 'string') {
+          this.categoryMes = {};
+        } else {
+          this.categoryMes = info.categoryMes;
+        }
+        if (typeof info.categoryMold == 'string') {
+          this.categoryMold = {};
+        } else {
+          this.categoryMold = info.categoryMold;
+        }
+        if (typeof info.categoryPallet == 'string') {
+          this.categoryPallet = {};
+        } else {
+          this.categoryPallet = info.categoryPallet;
+        }
+        if (typeof info.categoryQms == 'string') {
+          this.categoryQms = {};
+        } else {
+          this.categoryQms = info.categoryQms;
+        }
+        if (typeof info.categoryVehicle == 'string') {
+          this.categoryVehicle = {};
+        } else {
+          this.categoryVehicle = info.categoryVehicle;
+        }
+        if (typeof info.categoryWms == 'string') {
+          this.categoryWms = {};
+        } else {
+          this.categoryWms = info.categoryWms;
+        }
       },
       // 选择所属部门
       searchDeptNodeClick (id, info) {
@@ -298,7 +301,7 @@
       //选择负责人
       handleDirectorChange (id, info) {},
       // 确定分类
-      confirmCategory (node, title,PathInfo) {
+      confirmCategory (node, title, PathInfo) {
         if (title == '选择产品分类') {
           this.$set(this.form, 'productCategoryLevelName', node.name);
           this.$set(this.form, 'productCategoryLevelId', node.id);
@@ -307,14 +310,14 @@
           this.$set(this.form, 'categoryLevelId', node.id);
           this.$set(this.form, 'categoryLevelPath', node.name);
           this.$set(this.form, 'categoryLevelPathId', node.id);
-          this.PathInfo = PathInfo
+          this.PathInfo = PathInfo;
         }
       },
       openCategory () {
         this.$refs.categoryRefs.open(this.form.categoryLevelGroupId);
       },
       cancel () {
-        finishPageTab()
+        finishPageTab();
         this.$router.go(-1);
       },
 
@@ -337,14 +340,14 @@
           //   ? this.remarkform.remark
           //   : '';
           const data = {
-            categoryWms:this.categoryWms,
-            categoryAps:this.categoryAps,
-            categoryMes:this.categoryMes,
-            categoryMold:this.categoryMold,
-            categoryPallet:this.categoryPallet,
-            categoryQms:this.categoryQms,
-            categoryVehicle:this.categoryVehicle,
-            category:{
+            categoryWms: this.categoryWms,
+            categoryAps: this.categoryAps,
+            categoryMes: this.categoryMes,
+            categoryMold: this.categoryMold,
+            categoryPallet: this.categoryPallet,
+            categoryQms: this.categoryQms,
+            categoryVehicle: this.categoryVehicle,
+            category: {
               ...this.form,
               ...this.remarkform,
               ...this.PathInfo
@@ -354,9 +357,9 @@
             .then((msg) => {
               this.loading = false;
               this.$message.success(msg);
-              finishPageTab()
+              finishPageTab();
               reloadPageTab({ fullPath: '/material/product' });
-              this.$router.go(-1)
+              this.$router.go(-1);
             })
             .catch((e) => {
               this.loading = false;

+ 12 - 12
src/views/material/productLinkMaterial/components/link-material-dialog.vue

@@ -302,12 +302,12 @@
         this.visible = false;
       },
       async save () {
-        if (!this.datasourceRightShow.length) {
-          return this.$message.error('请添加关联数据');
-        }
+        // if (!this.datasourceRightShow.length) {
+        //   return this.$message.error('请添加关联数据');
+        // }
         const params = {
           mainCategoryId: this.row.categoryLevelId,
-          mainCategoryLevelRootId: this.row.categoryLevelGroupId,
+          mainCategoryLevelRootId: this.type,
           materialDetailsPOList: this.datasourceRightShow.map((i) => ({
             ...i,
             categoryLevelRootId: this.type
@@ -323,11 +323,11 @@
         if (!this.selection.length) {
           return this.$message.error('请选择关联数据');
         }
-        this.datasource = this.datasource.filter((i) =>
-          !this.selection.find((t) => t.categoryId == i.categoryId)
+        this.datasource = this.datasource.filter(
+          (i) => !this.selection.find((t) => t.categoryId == i.categoryId)
         );
-        this.datasourceShow = this.datasourceShow.filter((i) =>
-          !this.selection.find((t) => t.categoryId == i.categoryId)
+        this.datasourceShow = this.datasourceShow.filter(
+          (i) => !this.selection.find((t) => t.categoryId == i.categoryId)
         );
 
         this.datasourceRightShow.push(...this.selection);
@@ -340,11 +340,11 @@
           return this.$message.error('请选择取消关联数据');
         }
 
-        this.datasourceRight = this.datasourceRight.filter((i) =>
-          !this.selectionRight.find((t) => t.categoryId == i.categoryId)
+        this.datasourceRight = this.datasourceRight.filter(
+          (i) => !this.selectionRight.find((t) => t.categoryId == i.categoryId)
         );
-        this.datasourceRightShow = this.datasourceRightShow.filter((i) =>
-          !this.selectionRight.find((t) => t.categoryId == i.categoryId)
+        this.datasourceRightShow = this.datasourceRightShow.filter(
+          (i) => !this.selectionRight.find((t) => t.categoryId == i.categoryId)
         );
 
         this.datasourceShow.push(...this.selectionRight);

+ 48 - 40
src/views/technology/version/components/link-material-dialog.vue

@@ -1,5 +1,10 @@
 <template>
-  <ele-modal :visible.sync="visible" :title="`给工序【${row.code}${row.name}】分配物料`" width="90%" @close="cancel">
+  <ele-modal
+    :visible.sync="visible"
+    :title="`给工序【${row.code}${row.name}】分配物料`"
+    width="90%"
+    @close="cancel"
+  >
     <el-row :gutter="40">
       <el-col :span="12">
         <headerTitle>
@@ -35,7 +40,8 @@
               class="ml20"
               size="mini"
               @click="handleCancelConect"
-              >取消分配</el-button>
+              >取消分配</el-button
+            >
           </template>
         </headerTitle>
         <ele-pro-table
@@ -88,9 +94,12 @@
 </template>
 
 <script>
-  import { getBomSubList , saveBomList } from '@/api/technology/version/version.js';
+  import {
+    getBomSubList,
+    saveBomList
+  } from '@/api/technology/version/version.js';
   export default {
-    components: {  },
+    components: {},
     data () {
       return {
         visible: false,
@@ -98,11 +107,10 @@
         datasourceShow: [],
         datasourceRightShow: [],
         selectionRight: [],
-        selection: [],
-      }
-    },
-    created () {
+        selection: []
+      };
     },
+    created () {},
     computed: {
       columns () {
         return [
@@ -131,7 +139,7 @@
             prop: 'unit'
           }
         ];
-      },
+      }
     },
     methods: {
       open (row) {
@@ -143,16 +151,16 @@
         this.visible = false;
       },
       async save () {
-        if (!this.datasourceRightShow.length) {
-          return this.$message.error('请添加关联数据');
-        }
-        const arr = []
-        this.datasourceRightShow.map(item=>{
-           arr.push(item.bomSubId)
-        })
+        // if (!this.datasourceRightShow.length) {
+        //   return this.$message.error('请添加关联数据');
+        // }
+        const arr = [];
+        this.datasourceRightShow.map((item) => {
+          arr.push(item.bomSubId);
+        });
         const params = {
-          produceVersionId:this.row.produceVersionId,
-          taskInstanceId:this.row.id,
+          produceVersionId: this.row.produceVersionId,
+          taskInstanceId: this.row.id,
           bomSubId: arr
         };
         await saveBomList(params);
@@ -164,8 +172,8 @@
         if (!this.selection.length) {
           return this.$message.error('请选择关联数据');
         }
-        this.datasourceShow = this.datasourceShow.filter((i) =>
-          !this.selection.find((t) => t.bomSubId == i.bomSubId)
+        this.datasourceShow = this.datasourceShow.filter(
+          (i) => !this.selection.find((t) => t.bomSubId == i.bomSubId)
         );
         this.datasourceRightShow.push(...this.selection);
         this.selection = [];
@@ -174,32 +182,32 @@
         if (!this.selectionRight.length) {
           return this.$message.error('请选择取消关联数据');
         }
-        this.datasourceRightShow = this.datasourceRightShow.filter((i) =>
-          !this.selectionRight.find((t) => t.bomSubId == i.bomSubId)
+        this.datasourceRightShow = this.datasourceRightShow.filter(
+          (i) => !this.selectionRight.find((t) => t.bomSubId == i.bomSubId)
         );
         this.datasourceShow.push(...this.selectionRight);
         this.selectionRight = [];
       },
       async getDatasource () {
-         const params = {
-            bomId:this.row.bomId,
-            produceVersionId:this.row.produceVersionId,
-            routingTaskId:this.row.id,
-            pageNum:1,
-            size:-1
-         }
+        const params = {
+          bomId: this.row.bomId,
+          produceVersionId: this.row.produceVersionId,
+          routingTaskId: this.row.id,
+          pageNum: 1,
+          size: -1
+        };
         const data = await getBomSubList(params);
-          if(typeof data.uncorrelatedList == 'string' ){
-             this.datasource = []
-          }else{
-            this.datasourceShow = data.uncorrelatedList;
-          }
-          if(typeof data.correlatedList == 'string' ){
-             this.datasourceRightShow = []
-          }else{
-            this.datasourceRightShow = data.correlatedList;
-          }
-      },
+        if (typeof data.uncorrelatedList == 'string') {
+          this.datasource = [];
+        } else {
+          this.datasourceShow = data.uncorrelatedList;
+        }
+        if (typeof data.correlatedList == 'string') {
+          this.datasourceRightShow = [];
+        } else {
+          this.datasourceRightShow = data.correlatedList;
+        }
+      }
     }
   };
 </script>