Explorar o código

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

lucw hai 7 meses
pai
achega
5a48cd26d2

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

@@ -705,6 +705,11 @@
           if (!valid) {
             return false;
           }
+          this.form.tMainFactoryWorkstationOperationAddPOList =
+            this.$refs.stationMeter.getValue();
+          if (!this.form.tMainFactoryWorkstationOperationAddPOList.length) {
+            return this.$message.error('请添加工序');
+          }
           this.loading = true;
 
           if (this.type != 'edit') {
@@ -728,12 +733,7 @@
               substanceId: this.form.extInfo.assetId
             }
           ];
-          console.log(
-            this.$refs.stationMeter.getValue(),
-            'this.$refs.stationMeter.getValue()'
-          );
-          this.form.tMainFactoryWorkstationOperationAddPOList =
-            this.$refs.stationMeter.getValue();
+
           saveOrUpdate_gw(this.form)
             .then((msg) => {
               this.loading = false;

+ 3 - 3
src/views/material/product/detail.vue

@@ -1184,9 +1184,9 @@
         this.judgeSet(info);
 
         if (this.status == 1) {
-          rootCategoryCode(this.categoryLevelPathId).then((res) => {
-            this.$set(this.form, 'code', res);
-          });
+          // rootCategoryCode(this.categoryLevelPathId).then((res) => {
+          //   this.$set(this.form, 'code', res);
+          // });
 
           this.form.createTime = null;
         }

+ 1 - 0
src/views/productionScheduling/productionShift/components/addOrEditDialog.vue

@@ -127,6 +127,7 @@
     totalWorkingMinutes: '', //	总工作时长
     restDurationMinutes: '', //	休息时长
     status: 0,
+    factoryIds:[],
     list: [] //表格数据
   };
   import { getCode } from '@/api/codeManagement';

+ 13 - 0
src/views/productionScheduling/productionShift/index.vue

@@ -147,6 +147,19 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            minWidth: 180,
+            prop: 'factoryVos',
+            label: '所属工厂',
+            align: 'center',
+            formatter: (row, column) => {
+             if(row.factoryVos){
+              return row.factoryVos.map(item => item.factoryName).join(',')
+             }
+            },
+            showOverflowTooltip: true
+          },
+
           {
             minWidth: 180,
             prop: 'attendanceStartTime',

+ 127 - 116
src/views/productionScheduling/stationBeat/components/addOrEditDialog.vue

@@ -27,7 +27,7 @@
               clearable
               readonly
               v-model="form.code"
-              @click.native="$refs.produceRef.open()"
+              @click.native="$refs.productListRef.open()"
               placeholder="请选择"
             />
           </el-form-item>
@@ -37,7 +37,7 @@
             <el-input clearable disabled v-model="form.name" placeholder=" " />
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+        <!-- <el-col :span="12">
           <el-form-item label="BOM类型" prop="bomCategory">
             <el-select
               v-model="form.bomCategory"
@@ -105,7 +105,7 @@
               ></el-option>
             </el-select>
           </el-form-item>
-        </el-col>
+        </el-col> -->
       </el-row>
       <headerTitle title="工位节拍"> </headerTitle>
       <ele-pro-table
@@ -120,7 +120,7 @@
         <template v-slot:toolbar>
           <div style="display: flex">
             <el-form-item label="工序名称" prop="operationId">
-              <el-select
+              <!-- <el-select
                 v-model="form.operationId"
                 style="width: 230px"
                 v-if="form.produceRoutingId"
@@ -132,20 +132,18 @@
                   :value="item.sourceTaskId"
                   @click.native="changeOperationId(item)"
                 ></el-option>
-              </el-select>
+              </el-select> -->
               <el-input
-                v-if="!form.produceRoutingId"
                 style="width: 230px"
                 readonly
                 :value="form.operationName"
                 placeholder=" "
               />
               <el-button
-                v-if="!form.produceRoutingId"
                 size="small"
                 type="primary"
                 style="margin-left: 10px"
-                @click.native="taskinstanceDialogFlag = true"
+                @click.native="taskinstanceDialogOpen"
                 >选择
               </el-button>
             </el-form-item>
@@ -158,7 +156,7 @@
                 placeholder=" "
               />
             </el-form-item>
-            <el-form-item label-width="0">
+            <!-- <el-form-item label-width="0">
               <el-button
                 size="small"
                 type="primary"
@@ -166,7 +164,7 @@
                 @click.native="$refs.stationBeatDialogRef.open()"
                 >新增工位
               </el-button>
-            </el-form-item>
+            </el-form-item> -->
           </div>
         </template>
         <template v-slot:stationCycleTime="{ row, $index }">
@@ -215,10 +213,10 @@
 
       <el-button @click="cancel">返回</el-button>
     </div>
-    <ProductModal
-      ref="produceRef"
+    <productList
+      ref="productListRef"
       @changeParent="produceConfirm"
-    ></ProductModal>
+    ></productList>
     <taskinstanceDialog
       ref="taskinstanceDialogRef"
       v-if="taskinstanceDialogFlag"
@@ -253,7 +251,8 @@
     list: [] //表格数据
   };
   import { getFactoryarea } from '@/api/factoryModel';
-  import ProductModal from '@/components/productList/product-list.vue';
+  import productList from '@/components/productList/product-list.vue';
+
   import taskinstanceDialog from '@/components/procedure/taskinstanceDialog.vue';
   import stationBeatDialog from '@/views/factoryModel/station/components/stationBeatDialog.vue';
   import {
@@ -266,7 +265,11 @@
     selectFactoryWorkstation
   } from '@/api/productionScheduling/stationBeat';
   export default {
-    components: { ProductModal, taskinstanceDialog, stationBeatDialog },
+    components: {
+      productList,
+      taskinstanceDialog,
+      stationBeatDialog
+    },
     computed: {},
     data() {
       return {
@@ -293,9 +296,9 @@
           // ],
           code: [{ required: true, message: '编码不能为空', trigger: 'change' }]
         },
-        factoryList: [],
+        // factoryList: [],
         selection: [],
-        productionLineList: [],
+        // productionLineList: [],
         columns: [
           {
             width: 60,
@@ -381,12 +384,12 @@
     },
     computed: {
       cycleTime() {
+        let num = this.form.list.length;
         let cycleTime = this.form.list.reduce((pre, cur) => {
           return pre + Number(cur.stationCycleTime);
         }, 0);
-        this.form.cycleTime =
-          cycleTime / this.form.list.length / this.form.list.length;
-        return cycleTime / this.form.list.length / this.form.list.length || 0;
+        this.form.cycleTime = Math.ceil(cycleTime / num / num)||0;
+        return this.form.cycleTime;
       }
     },
 
@@ -401,12 +404,12 @@
           this.form.list.forEach((item, index) => {
             item.key = index;
           });
-          this.getBomInfo(this.form.productId);
-          this.changeProductType('init');
+          // this.getBomInfo(this.form.productId);
+          // this.changeProductType('init');
 
-          if (this.form.factoriesId) {
-            this.change_factoryId({ id: this.form.factoriesId });
-          }
+          // if (this.form.factoriesId) {
+          //   this.change_factoryId({ id: this.form.factoriesId });
+          // }
         }
       },
       handParent() {
@@ -427,20 +430,28 @@
         });
         this.factoryList = list || [];
       },
-      async change_factoryId(item) {
-        const { list } = await getFactoryarea({
-          pageNum: 1,
-          size: 999,
-          type: 4,
-          factoryId: item.id,
-          enable: 1
+      taskinstanceDialogOpen() {
+        this.taskinstanceDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.taskinstanceDialogRef.open({
+            productId: this.form.productId
+          });
         });
-        this.productionLineList = list || [];
-        this.form.factoriesName = item.name;
-      },
-      change_productionLineId(item, index) {
-        this.$set(this.form.list[index], 'productionLineName', item.name);
       },
+      // async change_factoryId(item) {
+      //   const { list } = await getFactoryarea({
+      //     pageNum: 1,
+      //     size: 999,
+      //     type: 4,
+      //     factoryId: item.id,
+      //     enable: 1
+      //   });
+      //   this.productionLineList = list || [];
+      //   this.form.factoriesName = item.name;
+      // },
+      // change_productionLineId(item, index) {
+      //   this.$set(this.form.list[index], 'productionLineName', item.name);
+      // },
       produceConfirm(data) {
         this.form.name = data[0].name;
         this.form.code = data[0].code;
@@ -448,91 +459,91 @@
         this.form.brandNo = data[0].brandNum;
         this.form.modelType = data[0].modelType;
         this.form.specification = data[0].specification;
-        this.produceCancel();
-        this.getBomInfo(data[0].id);
-      },
-      produceCancel() {
-        this.form.bomCategory = '';
-        this.bomCategoryList = [];
-        this.form.bomVersion = '';
-        this.form.bomId = '';
-        this.bomVersionList = [];
-        this.routingList = [];
-        this.form.produceRoutingId = '';
-        this.form.produceRoutingName = '';
-        this.produceRoutingList = [];
-        this.form.operationId = '';
-        this.form.operationName = '';
-        this.taskList = [];
-        this.form.list = [];
+        // this.produceCancel();
+        // this.getBomInfo(data[0].id);
       },
+      // produceCancel() {
+      //   this.form.bomCategory = '';
+      //   this.bomCategoryList = [];
+      //   this.form.bomVersion = '';
+      //   this.form.bomId = '';
+      //   this.bomVersionList = [];
+      //   this.routingList = [];
+      //   this.form.produceRoutingId = '';
+      //   this.form.produceRoutingName = '';
+      //   this.produceRoutingList = [];
+      //   this.form.operationId = '';
+      //   this.form.operationName = '';
+      //   this.taskList = [];
+      //   this.form.list = [];
+      // },
 
       // 获取bom信息
-      async getBomInfo(id) {
-        const res = await listBomType({ categoryId: id });
-        if (!res || res.length == 0) return;
-        let bomMap = {
-          2: { code: '2', name: 'MBOM' },
-          3: { code: '3', name: 'ABOM' }
-        };
-        let arr = [];
-        res.map((item) => {
-          if (bomMap[item.bomType]) {
-            arr.push(bomMap[item.bomType]);
-          }
-        });
-        this.bomCategoryList = arr;
-      },
+      // async getBomInfo(id) {
+      //   const res = await listBomType({ categoryId: id });
+      //   if (!res || res.length == 0) return;
+      //   let bomMap = {
+      //     2: { code: '2', name: 'MBOM' },
+      //     3: { code: '3', name: 'ABOM' }
+      //   };
+      //   let arr = [];
+      //   res.map((item) => {
+      //     if (bomMap[item.bomType]) {
+      //       arr.push(bomMap[item.bomType]);
+      //     }
+      //   });
+      //   this.bomCategoryList = arr;
+      // },
 
       // 根据bom类型和产品id获取bom版本
-      async changeProductType(type) {
-        let data = await bomListByPlan({
-          bomType: this.form.bomCategory,
-          categoryId: this.form.productId
-        });
-        this.bomVersionList = data;
-        if (data.length) {
-          if (type != 'init') {
-            this.form.bomId = data[0].id;
-            this.form.bomVersion = data[0].versions;
-          }
-          this.changeBomId(type);
-        }
-      },
-      async changeBomId(type) {
-        const res = await bomRoutingList(this.form.bomId);
-        let arr = res || [];
-        this.routingList = arr;
-        if (type != 'init') {
-          this.form.bomVersion = this.bomVersionList.find(
-            (item) => item.id == this.form.bomId
-          )?.versions;
-          this.taskList = [];
-          this.form.produceRoutingId = '';
-          this.form.produceRoutingName = '';
-          this.form.operationName = '';
-          this.form.operationId = '';
-          this.form.list = [];
-        }
+      // async changeProductType(type) {
+      //   let data = await bomListByPlan({
+      //     bomType: this.form.bomCategory,
+      //     categoryId: this.form.productId
+      //   });
+      //   this.bomVersionList = data;
+      //   if (data.length) {
+      //     if (type != 'init') {
+      //       this.form.bomId = data[0].id;
+      //       this.form.bomVersion = data[0].versions;
+      //     }
+      //     this.changeBomId(type);
+      //   }
+      // },
+      // async changeBomId(type) {
+      //   const res = await bomRoutingList(this.form.bomId);
+      //   let arr = res || [];
+      //   this.routingList = arr;
+      //   if (type != 'init') {
+      //     this.form.bomVersion = this.bomVersionList.find(
+      //       (item) => item.id == this.form.bomId
+      //     )?.versions;
+      //     this.taskList = [];
+      //     this.form.produceRoutingId = '';
+      //     this.form.produceRoutingName = '';
+      //     this.form.operationName = '';
+      //     this.form.operationId = '';
+      //     this.form.list = [];
+      //   }
 
-        if (arr.length) {
-          if (type != 'init') {
-            this.form.produceRoutingId = arr[0].id;
-            this.form.produceRoutingName = arr[0].name;
-          }
-          this.changeRoutingList(type);
-        }
-      },
-      async changeRoutingList(type) {
-        const res = await listByRoutingIds([this.form.produceRoutingId]);
-        let arr = res || [];
-        this.taskList = arr;
-        if (type != 'init') {
-          this.form.operationName = '';
-          this.form.operationId = '';
-          this.form.list = [];
-        }
-      },
+      //   if (arr.length) {
+      //     if (type != 'init') {
+      //       this.form.produceRoutingId = arr[0].id;
+      //       this.form.produceRoutingName = arr[0].name;
+      //     }
+      //     this.changeRoutingList(type);
+      //   }
+      // },
+      // async changeRoutingList(type) {
+      //   const res = await listByRoutingIds([this.form.produceRoutingId]);
+      //   let arr = res || [];
+      //   this.taskList = arr;
+      //   if (type != 'init') {
+      //     this.form.operationName = '';
+      //     this.form.operationId = '';
+      //     this.form.list = [];
+      //   }
+      // },
       async changeOperationId(item) {
         this.form.operationName = item.name;
         this.form.operationId = item.sourceTaskId || item.id;

+ 30 - 3
src/views/workforceManagement/schedule/detail.vue

@@ -78,6 +78,9 @@
   import ManagementTable from './components/ManagementTable.vue';
   import { finishPageTab } from '@/utils/page-tab-util';
   import { debounce } from 'throttle-debounce';
+  import {
+    getTableList,
+  } from '@/api/productionScheduling/productionShift';
   export default {
     components: {
       ManagementTable
@@ -373,6 +376,33 @@
       },
       // 获取班次
       getBc() {
+        //         return getTableList({
+        //   pageNum: 1,
+        //   size: 999
+        // }).then((res) => {
+        //   console.log(res,'dsdsd');
+        //   this.classesList = res.records.map((n) => {
+        //     return {
+        //       id: n.id,
+        //       name: `${n.shiftName}(${n.attendanceStartTime}-${n.attendanceEndTime})`
+        //     };
+        //   });
+        //   let len = Math.round(this.classesList.length / 5);
+        //   len == 0 ? (len = 1) : len;
+        //   const color = [
+        //     '#fb6f7b',
+        //     '#f59a23',
+        //     '#4672ca',
+        //     '#2196f3',
+        //     '#00bcd4',
+        //     '#009688'
+        //   ];
+        //   for (var i = 0; i < len; i++) {
+        //     this.colorList = this.colorList.concat(color);
+        //   }
+        //   this.showClassesList = this.classesList;
+        //   this.configColor();
+        // });
         return getpullDown().then((res) => {
           this.classesList = res.map((n) => {
             return {
@@ -383,10 +413,8 @@
               )})`
             };
           });
-
           let len = Math.round(this.classesList.length / 5);
           len == 0 ? (len = 1) : len;
-
           const color = [
             '#fb6f7b',
             '#f59a23',
@@ -399,7 +427,6 @@
             this.colorList = this.colorList.concat(color);
           }
           this.showClassesList = this.classesList;
-
           this.configColor();
         });
       },

+ 1 - 1
vue.config.js

@@ -43,7 +43,7 @@ module.exports = {
         // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.251:18086',
 
-        target: 'http://192.168.1.251:18086', // 开发
+        target: 'http://192.168.1.11:18086', // 开发
         // target: 'http://192.168.1.116:18086', // 赵沙金
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域