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

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

695593266@qq.com 10 месяцев назад
Родитель
Сommit
cf6e045f7c

+ 14 - 2
src/mixins/tableColumnsMixin.js

@@ -55,6 +55,13 @@ export default {
         }
       }
     },
+    getColumns() {
+      if (typeof this.columns == 'function') {
+        return this.columns();
+      } else {
+        return this.columns;
+      }
+    },
     //服务器和本地配置columns对比
     columnsContrast(list) {
       const key = 'label';
@@ -62,8 +69,10 @@ export default {
       let sList = list.filter((d, i, r) => {
         return d[key];
       });
-      let devColumns =
-        this.newColumns?.length > 0 ? this.newColumns : this.columns;
+      let devColumns = this.newColumns?.length
+        ? this.newColumns
+        : this.getColumns();
+
       let dList = devColumns.filter((d, i, r) => {
         return d[key] && d[key] !== '序号';
       });
@@ -192,6 +201,9 @@ export default {
 
     // 添加column记录接口
     async saveTableConfig(data) {
+      if (!data?.columnConfig?.length) {
+        return;
+      }
       try {
         const res = await request({
           url: '/sys/table-config/save',

+ 3 - 1
src/views/produce/components/feeding/components/batchProductsBom.vue

@@ -122,7 +122,8 @@
           batchNo: ''
         },
         itemData: {},
-        itemIndex: ''
+        itemIndex: '',
+        columnsVersion:0
       };
     },
 
@@ -143,6 +144,7 @@
     computed: {
       columns() {
         let action = {};
+        let columnsVersion=this.columnsVersion;
 
         if (!this.isEdit) {
           action = {

+ 3 - 1
src/views/produce/components/feeding/components/instanceBom.vue

@@ -132,6 +132,7 @@
         return this.$store.state.user.info.clientEnvironmentId;
       },
       columns() {
+        let columnsVersion = this.columnsVersion;
         return [
           ...[
             {
@@ -286,7 +287,8 @@
     data() {
       return {
         deviceList: [],
-        cacheKeyUrl: 'mes_produce_feeding_instanceBom'
+        cacheKeyUrl: 'mes_produce_feeding_instanceBom',
+        columnsVersion: 0
       };
     },
 

+ 3 - 1
src/views/produce/components/feeding/components/semiProductBom.vue

@@ -136,6 +136,7 @@
       },
       columns() {
         // let materielCode = this.workInfo.singleReport == 0 && ;
+        let columnsVersion = this.columnsVersion;
 
         return [
           ...[
@@ -324,7 +325,8 @@
     data() {
       return {
         deviceList: [],
-        cacheKeyUrl: 'mes_produce_feeding_semiProductBom'
+        cacheKeyUrl: 'mes_produce_feeding_semiProductBom',
+        columnsVersion:0
       };
     },
 

+ 4 - 1
src/views/produce/components/inspection/components/byProductBom.vue

@@ -154,6 +154,7 @@
 
     computed: {
       columns() {
+        let columnsVersion=this.columnsVersion
         let name = {
           width: 120,
           show: false
@@ -268,7 +269,9 @@
         visible: false,
         selection: [],
         cacheKeyUrl: 'produce-job-booking-by-product-bom',
-        warehouseList: []
+        warehouseList: [],
+        columnsVersion: 0
+
       };
     },
 

+ 3 - 1
src/views/produce/components/inspection/components/workInProgress.vue

@@ -113,6 +113,7 @@
       },
       columns() {
         // let materielCode = this.workInfo.singleReport == 0 && ;
+        let columnsVersion=this.columnsVersion
 
         return [
           ...[
@@ -297,7 +298,8 @@
     data() {
       return {
         deviceList: [],
-        cacheKeyUrl: 'mes_produce_feeding_semiProductBom'
+        cacheKeyUrl: 'mes_produce_feeding_semiProductBom',
+        columnsVersion:0
       };
     },
 

+ 3 - 1
src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

@@ -690,6 +690,8 @@
         return this.$store.state.user.taskObj;
       },
       columns() {
+       
+        let  columnsVersion=this.columnsVersion;
         let areaCodeColumns = {
           show: false
         };
@@ -982,7 +984,7 @@
         cacheKeyUrl: 'mes_produce_jobBooking_BatchSemiProductJobBom',
         weight: 0,
         reportWeight: 0,
-
+        columnsVersion:0,
         paramList: [],
 
         resultObj: {},

+ 4 - 1
src/views/produce/components/jobBooking/components/newByProductBom.vue

@@ -168,6 +168,8 @@
 
     computed: {
       columns() {
+        let  columnsVersion=this.columnsVersion;
+
         let name = {
           width: 120,
           show: false
@@ -287,7 +289,8 @@
         cacheKeyUrl: 'produce-inspection-by-product-bom',
         warehouseList: [],
         dialogVisible: false,
-        warehouseName: ''
+        warehouseName: '',
+        columnsVersion:0
       };
     },
 

+ 2 - 0
src/views/produce/components/jobBooking/components/newSemiProductJobBom.vue

@@ -550,6 +550,7 @@
         stepsList: [],
         selection: [],
         cacheKeyUrl: 'mes_produce_jobBooking_semiProductJobBom',
+        columnsVersion:0,
         weight: 0,
         reportWeight: 0,
 
@@ -656,6 +657,7 @@
         return this.$store.state.user.taskObj;
       },
       columns() {
+        let columnsVersion=this.columnsVersion
         let areaCodeColumns = {
           width: 55,
           show: false

+ 4 - 1
src/views/produce/components/jobBooking/components/semiProductJobBom.vue

@@ -633,7 +633,8 @@
           maxNumber: ''
         },
         dialogVisible: false,
-        dialogEngrave: false
+        dialogEngrave: false,
+        columnsVersion:0
       };
     },
 
@@ -670,6 +671,8 @@
         return this.$store.state.user.taskObj;
       },
       columns() {
+        let columnsVersion=this.columnsVersion
+
         let areaCodeColumns = {
           width: 55,
           show: false

+ 1 - 1
src/views/produce/components/new_produceOrder.vue

@@ -114,7 +114,7 @@
     computed: {
       // 表格列配置
       columns() {
-        this.columnsVersion++;
+        let columnsVersion = this.columnsVersion;
         return [
           {
             width: 45,

+ 1 - 1
src/views/produce/components/produceOrder.vue

@@ -96,7 +96,7 @@
     computed: {
       // 表格列配置
       columns() {
-        this.columnsVersion++;
+        let columnsVersion=this.columnsVersion;
         return [
           {
             width: 45,

+ 8 - 8
src/views/produceOrder/index.vue

@@ -23,7 +23,7 @@
         ref="table"
         :key="activeName"
         :initLoad="false"
-        :columns="newColumns"
+        :columns="columns"
         :datasource="datasource"
         row-key="code"
         :selection.sync="selection"
@@ -31,7 +31,7 @@
         autoAmendPage
         :parse-data="parseData"
         @columns-change="handleColumnChange"
-        cache-key="productOrder"
+        :cache-key="cacheKeyUrl"
       >
         <template v-slot:toolbar>
           <!-- <el-button type="success">新建</el-button> -->
@@ -278,7 +278,7 @@
           { label: '预制计划', value: '3' }
         ],
         selection: [],
-        newColumns: [],
+        columns: [],
         cacheKeyUrl: '7cc8e5d2-mes-produceOrder',
         columnsVersion: 0,
         dispatchVisible: false,
@@ -398,7 +398,7 @@
           }
         ];
       },
-      columns() {
+      basicColumns() {
         const num = this.columnsVersion;
         const opt = {
           first: [
@@ -707,10 +707,10 @@
       tabValue: {
         handler(newVal) {
           if (newVal === '6') {
-            this.newColumns.splice(3, 1);
+            this.columns.splice(3, 1);
           } else {
-            if (this.newColumns[3].label !== '生产订单号') {
-              this.newColumns.splice(3, 0, {
+            if (this.columns[3].label !== '生产订单号') {
+              this.columns.splice(3, 0, {
                 label: '生产订单号',
                 slot: 'apsWorkOrderCode',
                 align: 'center',
@@ -899,7 +899,7 @@
             };
           });
 
-          this.newColumns = [...this.columns, ...newRes, ...privateColumn];
+          this.columns = [...this.basicColumns, ...newRes, ...privateColumn];
           this.getTabColumns();
           this.$forceUpdate();
         });