lucw 8 miesięcy temu
rodzic
commit
a5f0e4522d

+ 10 - 15
src/views/batchRecord/components/tables/materialTable.vue

@@ -21,6 +21,13 @@
           row.code
         }}</el-link>
       </template>
+      <template v-slot:status="{ row }">
+        <el-tag
+          :type="['info', 'success', 'warning', 'danger'][row.status]"
+          effect="dark"
+          >{{ statusList[row.status] }}</el-tag
+        >
+      </template>
     </ele-pro-table>
 
     <detailed
@@ -109,20 +116,7 @@
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 150,
-            formatter: (row) => {
-              switch (row.status) {
-                case 0:
-                  return '未领料';
-                case 1:
-                  return '已领料';
-                case 2:
-                  return '已出库';
-                case 3:
-                  return '部分出库';
-                default:
-                  return '';
-              }
-            }
+            slot: 'status'
           },
           {
             label: '操作',
@@ -137,7 +131,8 @@
         cacheKeyUrl: 'mes-259231040-material-table',
         detailedShow: false,
         selfDetailedShow: false,
-        detailedObj: null
+        detailedObj: null,
+        statusList: ['未领料', '领料中', '已出库', '已驳回']
       };
     },
     computed: {

+ 4 - 10
src/views/batchRecord/components/tables/workReportTable.vue

@@ -23,6 +23,7 @@
       :routeObj="routeObj"
       @closeRoute="routingShow = false"
     ></routings>
+
   </div>
 </template>
 
@@ -97,20 +98,13 @@
             minWidth: 150
           },
           {
-            prop: 'reportStatus',
+            prop: '',
             label: '状态',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 150,
             formatter: (row) => {
-              switch (row.reportStatus) {
-                case 0:
-                  return '未报工';
-                case 1:
-                  return '已报工';
-                default:
-                  return '';
-              }
+              return '已报工';
             }
           },
           {
@@ -171,7 +165,7 @@
       },
       async goToDetail(row) {
         const data = await getById(row.workOrderId);
-        this.routeObj = row;
+        this.routeObj = data;
         this.routingShow = true;
       }
     }

+ 11 - 5
src/views/home/index.vue

@@ -316,15 +316,21 @@
         });
         this.arr.forEach((item, index) => {
           if (item.name === '生产总数') {
-            item.num = rest.formingNum || 0;
+            item.num = rest.formingNum ? Number(rest.formingNum).toFixed(2) : 0;
           } else if (item.name === '待生产数量') {
-            item.num = rest.pendingProductionCount || 0;
+            item.num = rest.pendingProductionCount
+              ? Number(rest.pendingProductionCount).toFixed(2)
+              : 0;
           } else if (item.name === '已完成数量') {
-            item.num = rest.formedNum || 0;
+            item.num = rest.formedNum ? Number(rest.formedNum).toFixed(2) : 0;
           } else if (item.name === '生产中数量') {
-            item.num = rest.inProgressWorkOrderCount || 0;
+            item.num = rest.inProgressWorkOrderCount
+              ? Number(rest.inProgressWorkOrderCount).toFixed(2)
+              : 0;
           } else if (item.name === '已延期') {
-            item.num = rest.postponeCount || 0;
+            item.num = rest.postponeCount
+              ? Number(rest.postponeCount).toFixed(2)
+              : 0;
           }
         });
         // console.log(rest, 'rest');

+ 3 - 0
src/views/produce/components/jobBooking/details.vue

@@ -433,16 +433,19 @@
       detailPackagingGrouping
     },
     props: {
+      // 工单信息对象 包含id 工单id
       routeObj: {
         type: Object,
         default() {
           return {};
         }
       },
+      // taskId 工序id
       newId: {
         type: String,
         default: ''
       },
+      // 包含 taskId 和 type(taskType)
       curTaskObj: {
         type: Object,
         default() {

+ 54 - 35
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -225,12 +225,22 @@
 
       <el-table-column label="检查人">
         <template slot-scope="scope">
-          <div
-            @click="openSelectUser(scope.row)"
-            style="display: flex; align-items: center; cursor: pointer"
-          >
-            <div>{{ showCheckUserNames(scope.row.checkUsers) }}</div
-            ><i class="el-icon-caret-bottom"></i>
+          <div>
+            <el-select
+              v-model="scope.row.checkUsersIds"
+              placeholder="请选择检查人"
+              filterable
+              multiple
+              @change="checkUsersIdsChange(scope.row)"
+            >
+              <el-option
+                v-for="item in activeTeamUserList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              >
+              </el-option>
+            </el-select>
           </div>
         </template>
       </el-table-column>
@@ -321,13 +331,6 @@
         </el-button>
       </div>
     </template>
-    <!-- 选择用户 -->
-    <SelectUser
-      ref="SelectUserRef"
-      v-model="showSelectUser"
-      multipleSelect
-      @selectUserFinished="selectUserFinished"
-    ></SelectUser>
 
     <toolModal ref="toolModalRef" @chooseModal="chooseModal" />
   </ele-modal>
@@ -348,6 +351,7 @@
   } from '@/api/producetaskrecordrulesrecord/index';
   import toolModal from '@/views/batchRecord/components/toolModal.vue';
   import { getTeam } from '@/api/produce/job.js';
+  import { det, row } from 'mathjs';
 
   export default {
     components: { SelectUser, toolModal },
@@ -525,6 +529,11 @@
           }
         }
         return '类记录表';
+      },
+      activeTeamUserList() {
+        return this.teamUserList.filter((user) =>
+          this.addForm.executeUsersIds.includes(user.id)
+        );
       }
     },
     mounted() {
@@ -596,6 +605,7 @@
           console.log('dat 缓存', data);
           data.details = data.details.map((i) => {
             i.toolNames = i.tools.map((j) => j.toolName).join(',');
+            i.checkUsersIds = i.checkUsers.map((j) => j.userId);
             return i;
           });
           this.$util.assignObject(this.addForm, data);
@@ -618,6 +628,14 @@
               ? this.addForm.executeUsers[0].teamId
               : '';
 
+          // 加载班组人员列表
+          if (this.addForm.teamId) {
+            const index = this.teamList.findIndex(
+              (item) => item.id == this.addForm.teamId
+            );
+            this.teamUserList = this.teamAllList[index];
+          }
+
           this.loading = false;
         } catch (error) {
           this.loading = false;
@@ -656,17 +674,13 @@
             checkStatusDesc: i.defaultValue || '',
             errorMsg: '',
             checkUsers: [],
+            checkUsersIds: [],
             paramValue: i.paramValue,
             toolNames: i.tools.map((i) => i.toolName).join(',')
           };
         });
         console.log('this.addForm 添加规则', this.addForm, list);
       },
-      openSelectUser(row) {
-        this.currentRow = row;
-        console.log('row', row);
-        this.showSelectUser = true;
-      },
       handleBeforeClose() {
         this.addForm = JSON.parse(JSON.stringify(this.formDate));
         console.log('this.$refs.ruleFormRef', this.addForm);
@@ -675,23 +689,6 @@
           this.visible = false;
         });
       },
-
-      selectUserFinished(userInfo) {
-        console.log('userInfo', userInfo);
-        this.currentRow.checkUsers = userInfo.map((i) => {
-          // 构建参数和接口的对应上
-          return { ...i, userName: i.name, userId: i.id };
-        });
-      },
-      showCheckUserNames(userList) {
-        if (userList.length == 0) return '请选择部门-选择员工';
-
-        return userList
-          .map((i) => {
-            return i.groupName + '-' + i.userName;
-          })
-          .join(',');
-      },
       // 提交
       submit(type) {
         // 验证表单
@@ -861,6 +858,12 @@
         console.log('this.addForm.executeUsers', this.addForm.executeUsers);
 
         this.computedDuration();
+
+        // 同步详情执行人
+        this.addForm.details.forEach((detail) => {
+          detail.checkUsersIds = this.addForm.executeUsersIds;
+          detail.checkUsers = this.addForm.executeUsers;
+        });
       },
       checkChange() {
         this.addForm.executeUsersIds = [];
@@ -895,6 +898,22 @@
         ) {
           this.addForm.duration = Number(this.addForm.duration).toFixed(1);
         }
+      },
+      checkUsersIdsChange(row) {
+        // 同步 checkUsers
+        row.checkUsers = row.checkUsersIds.map((i) => {
+          const user = this.activeTeamUserList.find((item) => item.id === i);
+          return {
+            teamId: this.addForm.teamId,
+            teamName: this.teamList.find(
+              (team) => team.id == this.addForm.teamId
+            )?.name,
+            userId: user.id,
+            userName: user.name
+          };
+        });
+
+        console.log('row', row);
       }
     }
   };

+ 9 - 14
src/views/produce/components/routings.vue

@@ -11,7 +11,6 @@
       :maxable="true"
     >
       <div class="routing_box">
-
         工艺路线: <span>{{ routeObj.produceRoutingName }}</span></div
       >
       <div>
@@ -26,10 +25,10 @@
               <!-- <div>投:{{  item.feedExistNum || 0  }} 报:{{item.reportExistNum  || 0}}</div> -->
               <div>{{ desIndex == index ? '此处' : '' }}</div>
             </template>
-        </el-step>
+          </el-step>
         </el-steps>
         <el-tabs type="border-card">
-          <el-tab-pane label="领料记录" >
+          <el-tab-pane label="领料记录">
             <!-- <feedDetails
               v-if="newId!=='-1'"
               :routeObj="routeObj"
@@ -37,9 +36,9 @@
             ></feedDetails> -->
             <pickDetails ref="pickListRef" :isDetails="true"></pickDetails>
           </el-tab-pane>
-          <el-tab-pane label="投料详情" >
+          <el-tab-pane label="投料详情">
             <feedDetails
-              v-if="newId!=='-1'"
+              v-if="newId !== '-1'"
               :routeObj="routeObj"
               :curTaskObj="curTaskObj"
             ></feedDetails>
@@ -81,14 +80,12 @@
         routeList: [],
         activeIndex: 0,
         desIndex: 0,
-        newId:'',
+        newId: '',
         curTaskObj: null
       };
     },
     methods: {
       getTaskFn() {
-
-
         getTaskInstanceList(this.routeObj.id).then((res) => {
           this.routeList = res;
 
@@ -99,16 +96,15 @@
 
           this.desIndex = index;
 
-
+          console.log('res', res, index);
           this.newId = res[index].taskId;
 
-          console.log(this.routeObj,666666);
+          console.log(this.routeObj, 666666);
 
           if (this.routeObj.taskId != -2) {
-            this.curTaskObj = JSON.parse(JSON.stringify( this.routeObj));
-
+            this.curTaskObj = JSON.parse(JSON.stringify(this.routeObj));
           } else {
-            this.curTaskObj  =  JSON.parse(JSON.stringify( this.routeList[0]));
+            this.curTaskObj = JSON.parse(JSON.stringify(this.routeList[0]));
             this.desIndex = 0;
           }
 
@@ -135,7 +131,6 @@
     },
 
     created() {
-
       this.getTaskFn();
     }
   };

+ 1 - 3
vue.config.js

@@ -35,12 +35,10 @@ module.exports = {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.125:18086',
-        // 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.125:18086',
         // 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.103:18086',192.168.1.116
         // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.30:18086',