695593266@qq.com 7 kuukautta sitten
vanhempi
commit
7109591fbc

+ 6 - 1
src/views/beEntrusted/components/goodsDetail.vue

@@ -42,7 +42,8 @@
 
     <template v-slot:footer v-if="type != 'detail' && type != 'send'">
       <el-button @click="cancel">取消</el-button>
-      <el-button type="primary" @click="save"> 确定 </el-button>
+      <el-button type="primary" @click="rejectReason"> 驳回 </el-button>
+      <el-button type="primary" @click="save"> 确认收货 </el-button>
     </template>
   </ele-modal>
 </template>
@@ -240,6 +241,10 @@
         this.visible = false;
       },
 
+      rejectReason() {
+        
+      },
+
       chooseData(dataList) {
         this.goodsList = [];
 

+ 4 - 0
src/views/beEntrusted/index.vue

@@ -501,6 +501,10 @@
           return this.$message.warning('只能选择一条数据');
         }
 
+        if (this.selection[0].approvalStatus == 1) {
+          return this.$message.warning('请先收货再转生产订单');
+        }
+
         if (
           this.selection[0].changeType == 1 ||
           this.selection[0].changeType == 2

+ 5 - 0
src/views/entrust/components/goodsDetail.vue

@@ -54,6 +54,7 @@
 
     <template v-slot:footer v-if="type != 'detail' && itemData.sendStatus != 4">
       <el-button @click="cancel">取消</el-button>
+      <el-button @click="rejectReason" type="primary">驳回</el-button>
       <el-button type="primary" @click="save"> 确定 </el-button>
     </template>
 
@@ -274,6 +275,10 @@
         });
       },
 
+      rejectReason() {
+
+      },
+
       deepCopy(obj, hash = new WeakMap()) {
         if (obj === null) return null;
         if (obj instanceof Date) return new Date(obj);

+ 7 - 0
src/views/entrust/components/produceOrder.vue

@@ -530,6 +530,13 @@
             slot: 'outsourceStatus',
             showOverflowTooltip: true
           },
+          {
+            prop: 'entrustStatus',
+            label: '请托状态',
+            align: 'center',
+            slot: 'entrustStatus',
+            showOverflowTooltip: true
+          },
           {
             prop: 'priority',
             label: '优先级',

+ 0 - 3
src/views/produce/components/feeding/components/workOrderBom.vue

@@ -73,9 +73,6 @@
             <div v-else>
               <div class="content">未委外</div>
             </div>
-            <div v-else>
-              <div class="content">{{ '' }}</div>
-            </div>
           </div>
 
           <div class="rx ww33">

+ 1 - 27
src/views/produce/components/feeding/index.vue

@@ -607,7 +607,7 @@
       },
 
       async getTeamList(id) {
-        if(!id) return;
+        if (!id) return;
         const ids = id.split(',');
         this.teamList = [];
         this.teamUserList = [];
@@ -855,29 +855,6 @@
             this.checkFeed(res.data);
           }
         });
-
-        // for (let item of this.List) {
-        //   await checkRepeatFeed({
-        //     currentTaskDiagram: item.currentTaskDiagram,
-        //     workOrderId: item.workOrderId
-        //   }).then((res) => {
-        //     if (res.data == 0) {
-        //       // this.feedReport();
-        //     } else {
-        //       this.$confirm('已经有投料是否继续重复投料?', '提示', {
-        //         confirmButtonText: '确定',
-        //         cancelButtonText: '取消',
-        //         type: 'warning'
-        //       })
-        //         .then(() => {
-        //           // this.feedReport();
-        //         })
-        //         .catch(() => {
-        //           this.loading.close();
-        //         });
-        //     }
-        //   });
-        // }
       },
 
       checkFeed(list) {
@@ -922,7 +899,6 @@
 
             // 延迟刷新
             setTimeout(() => {
-              // 点击了缓存或者投料
               this.$emit('reload');
             }, 500);
 
@@ -1020,12 +996,10 @@
     overflow: auto;
   }
 
-  /* 输入框最大宽度*/
   ::v-deep .el-select__tags-text {
     max-width: 90px;
   }
 
-  /* 底部滚动条的高度*/
   ::v-deep .el-select__tags::-webkit-scrollbar {
     height: 2px !important;
   }

+ 45 - 46
src/views/produce/components/jobBooking/components/jobBom.vue

@@ -290,55 +290,54 @@
         immediate: true,
         deep: true,
         handler(newVal) {
-          // this.$set(this.item, 'workReportInfo', newVal.workReportInfo);
-          console.log(newVal, '修改后的数据');
-          if (newVal.product && newVal.product.length != 0) {
-            let formedNum = 0;
-            let notFormedNum = 0;
-            let lossNum = 0;
-
-            newVal.product.forEach((item) => {
-              if (
-                (!item.extInfo.isQualified ||
-                  item.extInfo.isQualified == 1 ||
-                  item.extInfo.isQualified == 3) &&
-                !item.extInfo.isLoss
-              ) {
-                formedNum = this.add(formedNum, Number(item.feedQuantity));
-              } else if (!item.extInfo.isLoss) {
-                if (item.extInfo.notType == 5 || item.extInfo.notType == 8) {
-                  formedNum = this.add(formedNum, Number(item.feedQuantity));
+          if (newVal.product && newVal.product.length !== 0) {
+            const product = newVal.product;
+
+            const finalList = product.some((it) => it.confirm == 1)
+              ? product.filter((it) => it.confirm == 1)
+              : product;
+
+            const isLoss = (item) => item.extInfo.isLoss == 1;
+
+            const isFormed = (item) => {
+              const { isQualified, notType } = item.extInfo;
+              return (
+                !isQualified ||
+                isQualified == 1 ||
+                isQualified == 3 ||
+                notType == 5 ||
+                notType == 8
+              );
+            };
+
+            const getQty = (item) => Number(item.feedQuantity);
+
+            const result = finalList.reduce(
+              (acc, item) => {
+                const qty = getQty(item);
+
+                if (isLoss(item)) {
+                  acc.lossNum = this.add(acc.lossNum, qty);
+                } else if (isFormed(item)) {
+                  acc.formedNum = this.add(acc.formedNum, qty);
                 } else {
-                  notFormedNum = this.add(
-                    notFormedNum,
-                    Number(item.feedQuantity)
-                  );
+                  acc.notFormedNum = this.add(acc.notFormedNum, qty);
                 }
-              } else if (item.extInfo.isLoss == 1) {
-                lossNum = this.add(lossNum, Number(item.feedQuantity));
-              }
-            });
-
-            this.$set(this.item.workReportInfo, 'formedNum', formedNum);
-            this.$set(this.item.workReportInfo, 'notFormedNum', notFormedNum);
-            this.$set(this.item.workReportInfo, 'lossQuantity', lossNum);
-          }
 
-          // if (
-          //   this.clientEnvironmentId == 3 &&
-          //   this.item.currentTaskDiagram.type == 6
-          // ) {
-          //   if (newVal.semiProductList.length != 0) {
-          //     const semiList = newVal.semiProductList;
-          //     // if(semiList.ba)
-          //   }
-          // }
-          // this.set()
-          // if(this.taskObj.type == 6 ){
-          //   console.log('112334',newVal)
-          // }
-          // let weightValue=parseFloat((newVal.workReportInfo.formedWeight).toFixed(2))
-          // this.$set(this.item.workReportInfo,'formedWeight',weightValue)
+                return acc;
+              },
+              { formedNum: 0, notFormedNum: 0, lossNum: 0 }
+            );
+
+            this.$set(this.item.workReportInfo, 'formedNum', result.formedNum);
+            this.$set(
+              this.item.workReportInfo,
+              'notFormedNum',
+              result.notFormedNum
+            );
+            this.$set(this.item.workReportInfo, 'lossQuantity', result.lossNum);
+            this.$forceUpdate();
+          }
         }
       }
     },

+ 38 - 50
src/views/produce/components/jobBooking/components/jobDdBom.vue

@@ -183,60 +183,48 @@
         immediate: true,
         deep: true,
         handler(newVal) {
-          if (newVal.semiProductList && newVal.semiProductList.length != 0) {
-            let formedNum = 0;
-            let notFormedNum = 0;
-
-            newVal.semiProductList.forEach((item) => {
-              if (
-                !item.extInfo.isQualified ||
-                item.extInfo.isQualified == 1 ||
-                item.extInfo.isQualified == 3
-              ) {
-                // formedNum = formedNum + Number(item.feedQuantity);
-                formedNum = this.add(formedNum, Number(item.feedQuantity));
-              } else {
-                if (item.extInfo.notType == 5 || item.extInfo.notType == 8) {
-                  // formedNum = formedNum + Number(item.feedQuantity);
-                  formedNum = this.add(formedNum, Number(item.feedQuantity));
+          if (newVal.semiProductList && newVal.semiProductList.length !== 0) {
+            const list = newVal.semiProductList;
+
+            const finalList = list.some((it) => it.confirm == 1)
+              ? list.filter((it) => it.confirm == 1)
+              : list;
+
+            const isFormed = (item) => {
+              const { isQualified, notType } = item.extInfo;
+              return (
+                !isQualified ||
+                isQualified == 1 ||
+                isQualified == 3 ||
+                notType == 5 ||
+                notType == 8
+              );
+            };
+
+            const getQty = (item) => Number(item.feedQuantity);
+
+            const result = finalList.reduce(
+              (acc, item) => {
+                const qty = getQty(item);
+
+                if (isFormed(item)) {
+                  acc.formedNum = this.add(acc.formedNum, qty);
                 } else {
-                  // notFormedNum = notFormedNum + Number(item.feedQuantity);
-                  notFormedNum = this.add(
-                    notFormedNum,
-                    Number(item.feedQuantity)
-                  );
+                  acc.notFormedNum = this.add(acc.notFormedNum, qty);
                 }
-                // notFormedNum = notFormedNum + Number(item.feedQuantity);
-              }
-            });
 
-            this.$set(this.item.workReportInfo, 'formedNum', formedNum);
-            this.$set(this.item.workReportInfo, 'notFormedNum', notFormedNum);
+                return acc;
+              },
+              { formedNum: 0, notFormedNum: 0 }
+            );
+
+            this.$set(this.item.workReportInfo, 'formedNum', result.formedNum);
+            this.$set(
+              this.item.workReportInfo,
+              'notFormedNum',
+              result.notFormedNum
+            );
           }
-          // console.log('jhsaighajighsag',newVal)
-          // if (newVal.semiProductList.length) {
-          //     let formedNum = 0;
-          //     let noFormingNum = 0;
-          //     let formedWeight = 0
-          //     let notFormedWeight = 0
-          //     newVal.semiProductList.forEach(v => {
-          //         // 合格品数量
-          //         if (v.extInfo.isQualified == 1) {
-          //             formedNum += 1;
-          //             formedWeight += (Number(v.extInfo.reportWeight)||0)
-          //         } else {
-          //             noFormingNum += 1;
-          //             notFormedWeight += (Number(v.extInfo.reportWeight)||0)
-          //         }
-          //     });
-          //     newVal.workReportInfo.formedNum = formedNum;
-          //     newVal.workReportInfo.notFormedNum = noFormingNum;
-          //     newVal.workReportInfo.formedWeight = parseFloat(formedWeight.toFixed(2))
-          //     // this.$set(this.item.workReportInfo,'formedWeight',formedWeight.toFixed(2))
-          //     newVal.workReportInfo.notFormedWeight = parseFloat(notFormedWeight.toFixed(2))
-          //     //  this.$set(this.item.workReportInfo,'notFormedWeight',notFormedWeight.toFixed(2))
-          //     this.$forceUpdate()
-          // }
         }
       },
 

+ 1 - 98
src/views/produce/components/jobBooking/index.vue

@@ -772,7 +772,7 @@
       },
 
       async getTeamList(id) {
-        if(!id) return;
+        if (!id) return;
         const ids = id.split(',');
         this.teamList = [];
         this.teamUserList = [];
@@ -1514,23 +1514,6 @@
           }
         }
 
-        // for (let i = 0; i < this.List.length; i++) {
-        //   if (
-        //     this.List[i].packInfo &&
-        //     Object.keys(this.List[i].packInfo).length === 0
-        //   ) {
-        //     this.loading.close();
-        //     return this.$message.warning('请到主数据配置包装规格');
-        //   }
-        // }
-
-        // if(this.taskObj.type !=6){
-        //   if(this.reportNeedFeed==1&&!(this.List[0].semiProductList.length>0||this.List[0].pickOutInList.length>0)){
-        //     this.loading.close();
-        //     return this.$message.warning('请先投料再报工');
-        //   }
-        // }
-
         let bol2;
         bol2 = this.List.every((e) => {
           return (
@@ -1539,14 +1522,6 @@
           );
         });
 
-        // if (!bol2) {
-        //   this.$message.warning('请输入合格品数量');
-        //   this.loading.close();
-        //   return false;
-        // }
-
-        // 预制体
-
         let wId;
         let bol = true;
         let _i;
@@ -1589,13 +1564,6 @@
           }
         });
 
-        // if (!bol) {
-        //   this.$message.warning(`请完善工单${wId}第${_i}处置方式`);
-        //   this.loading.close();
-
-        //   return false;
-        // }
-
         if (this.clientEnvironmentId == 3) {
           for (const item of this.List) {
             if (item.singleReport == 0) {
@@ -1666,16 +1634,6 @@
               }
             }
           }
-
-          // let succ = this.List.some((L) => {
-          //   return L.productRecycleList.length > 0;
-          // });
-          // if (succ) {
-          //   const isRecycle = await this.checkRecycle();
-          //   if (!isRecycle) {
-          //     return false;
-          //   }
-          // }
         }
 
         if (this.taskObj.type == 4) {
@@ -1688,10 +1646,6 @@
           } else {
             this.checkPack();
           }
-
-          // if (!isPack) {
-          // 	return false
-          // }
         }
 
         if (this.taskObj.type == 1) {
@@ -1763,32 +1717,6 @@
             currentTaskDiagram: item.currentTaskDiagram,
             workOrderId: item.workOrderId
           });
-          // await checkReportNumber({
-          //   currentTaskDiagram: item.currentTaskDiagram,
-          //   workOrderId: item.workOrderId
-          // }).then((res) => {
-          //   const totalNum = Number(item.formingNum);
-          //   const reportNum = this.add(
-          //     item.workReportInfo.notFormedNum,
-          //     item.workReportInfo.formedNum
-          //   );
-          //   const totalReportNum = this.add(reportNum, Number(res));
-          //   if (totalReportNum > totalNum) {
-          //     this.$confirm('报工数量大于生产数量, 是否继续报工?', '提示', {
-          //       confirmButtonText: '确定',
-          //       cancelButtonText: '取消',
-          //       type: 'warning'
-          //     })
-          //       .then(() => {
-          //         this.jobBookReport();
-          //       })
-          //       .catch(() => {
-          //         this.loading.close();
-          //       });
-          //   } else {
-          //     this.jobBookReport();
-          //   }
-          // });
         }
 
         await checkReportNumber(newList).then((res) => {
@@ -1796,28 +1724,6 @@
             this.checkJobBook(res);
           }
         });
-
-        // this.loadingBtn = true;
-        // jobSave(this.List)
-        //   .then((res) => {
-        //     this.loadingBtn = false;
-        //     this.loading.close();
-        //     this.$message.success('报工成功');
-        //     this.checked = false;
-        //     this.executorIdList = [];
-        //     this.teamId = '';
-        //     this.getList(this.idsList);
-        //     this.$emit('jobSuccess', 'Success');
-        //   })
-        //   .catch(() => {
-        //     this.loadingBtn = false;
-        //     this.loading.close();
-        //   });
-        // .finally(() => {
-        //   setTimeout(function () {
-        //     this.loading.close();
-        //   }, 3000);
-        // });
       },
 
       checkJobBook(list) {
@@ -1922,8 +1828,6 @@
       },
 
       checkRecycle() {
-        // this.loading.close();
-
         return new Promise((resolve) => {
           this.$confirm('是否跳过副产品回收处置!', '提示', {
             confirmButtonText: '确定',
@@ -1971,7 +1875,6 @@
                 f['productRecycleList'] = o.extInfo.productRecycleList;
                 f['semiProductList'] = o.extInfo.semiProductList;
                 f['modelList'] = o.extInfo.modelList;
-                // this.$set(this.List[index].workReportInfo,'executorTime',timestampToDateTime(o.extInfo.workReportInfo.executorTime))
                 this.$forceUpdate();
               }
             });

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

@@ -17,22 +17,6 @@
       :cache-key="cacheKeyUrl"
       :row-class-name="tableRowClassName"
     >
-      <!-- <template v-slot:toolbar>
-        <div class="rx-bc">
-          <div class="c_title">工单列表 </div>
-
-          <div>
-            <el-input
-              style="width: 180px"
-              clearable
-              v-model="code"
-              placeholder="请输入工单号"
-            />
-            <el-button  size="mini" type="primary" style="margin: 0 5px" @click="handleSearch">查询</el-button>
-          </div>
-        </div>
-      </template> -->
-
       <template v-slot:code="{ row }">
         <el-link type="primary" @click="handRoute(row)" :underline="false">{{
           row.code
@@ -556,7 +540,7 @@
   }
 
   ::v-deep .el-table .ent-row {
-    background: #5419d4;
+    background: #d1b609;
     // color: #39d9ac;
   }
 

+ 3 - 12
src/views/produce/index.vue

@@ -35,7 +35,7 @@
           @tab-click="tabClickValue"
         >
           <!-- :render-content="renderContent"-->
-          <el-tab-pane label="工" name="0">
+          <el-tab-pane label="工" name="0">
             <div class="custom-tree-node">
               <el-tree
                 :data="produceTaskList"
@@ -56,21 +56,12 @@
                 </span>
               </el-tree>
             </div>
-            <!--
-              v-loading="treeLoading"
-              :node-key="nodeKey"
-              ref="tree"
-              :highlight-current="true"
-              :expand-on-click-node="false"
-              @node-click="handleNodeClick"
-              v-bind="$attrs"
-              :default-expand-all="defaultExpandAll" -->
           </el-tab-pane>
 
           <!-- <el-tab-pane label="我的任务" name="second"> -->
-          <!-- <AssetTree @handleNodeClick="handleNodeClickNew" @setRootId="setRootId" id="0" :paramsType="'type'"
+            <!-- <AssetTree @handleNodeClick="handleNodeClickNew" @setRootId="setRootId" id="0" :paramsType="'type'"
               ref="treeList" eqDevice="sb" /> -->
-          <!-- <el-tree
+            <!-- <el-tree
               :data="factoryworkstationList"
               :props="defaultPropsTow"
               node-key="id"

+ 38 - 20
src/views/taskList/components/Ddtails.vue

@@ -234,16 +234,18 @@
           unqualifiedQuantity: '',
           qualifiedWeight: '',
           qualifiedQuantity: '',
-          remark: ''
+          remark: '',
+          reportQuantity: '',
+          lossQuantity: ''
         },
         rules: {
-          qualifiedQuantity: [
-            {
-              required: true,
-              message: '请输入合格数量',
-              trigger: 'blur'
-            }
-          ],
+          // qualifiedQuantity: [
+          //   {
+          //     required: true,
+          //     message: '请输入合格数量',
+          //     trigger: 'blur'
+          //   }
+          // ],
           // qualifiedWeight: [
           //   {
           //     required: true,
@@ -251,13 +253,13 @@
           //     trigger: 'blur'
           //   }
           // ],
-          unqualifiedQuantity: [
-            {
-              required: true,
-              message: '请输入不合格数量',
-              trigger: 'blur'
-            }
-          ]
+          // unqualifiedQuantity: [
+          //   {
+          //     required: true,
+          //     message: '请输入不合格数量',
+          //     trigger: 'blur'
+          //   }
+          // ],
           // unqualifiedWeight: [
           //   {
           //     required: true,
@@ -265,6 +267,21 @@
           //     trigger: 'blur'
           //   }
           // ]
+          reportQuantity: [
+            {
+              required: true,
+              message: '请输入报工数量',
+              trigger: 'blur'
+            }
+          ],
+
+          lossQuantity: [
+            {
+              required: true,
+              message: '请输入损耗数量',
+              trigger: 'blur'
+            }
+          ]
         },
         current: {},
         detailsVisible: false,
@@ -337,7 +354,9 @@
           unqualifiedQuantity: '',
           qualifiedWeight: '',
           qualifiedQuantity: '',
-          remark: ''
+          remark: '',
+          reportQuantity: '',
+          lossQuantity: ''
         };
         this.$refs.form.resetFields();
         this.detailsVisible = false;
@@ -400,11 +419,10 @@
       },
       // 计算数量
       calculateQuantity(type) {
-        let total =
-          this.form.qualifiedQuantity - 0 + (this.form.unqualifiedQuantity - 0);
-        if (total > this.current.quantity) {
+        let total = this.form.reportQuantity - 0 + (this.form.lossQuantity - 0);
+        if (total > this.current.formingNum) {
           this.form[type] = 0;
-          this.$message.warning('合格数量加不合格数量不能大于任务数量');
+          this.$message.warning('报工数量加损耗数量不能大于要求完成数量');
         }
       },
       // 数量正则 quantity

+ 4 - 4
src/views/taskList/index.vue

@@ -30,12 +30,12 @@
         :height="tableHeight"
         @fullscreen-change="fullscreenChange"
       >
-        <template v-slot:assignCode="{ row }">
+        <template v-slot:assigneeCode="{ row }">
           <el-link
             :underline="false"
             type="primary"
             @click="details('assign', row)"
-            >{{ row.assignCode }}
+            >{{ row.assigneeCode }}
           </el-link>
         </template>
         <template v-slot:workOrderCode="{ row }">
@@ -204,8 +204,8 @@
             fixed: 'left'
           },
           {
-            slot: 'assignCode',
-            prop: 'assignCode',
+            slot: 'assigneeCode',
+            prop: 'assigneeCode',
             label: '任务编码',
             align: 'center',
             showOverflowTooltip: true,

+ 3 - 2
src/views/wanLong/components/dailySearch.vue

@@ -22,8 +22,9 @@
         <el-form-item label="产品分类:">
           <el-select
             clearable
-            v-model="where.categoryLevelId"
+            v-model="where.categoryLevelIds"
             placeholder="请选择"
+            multiple
           >
             <el-option
               v-for="item in categoryData"
@@ -79,7 +80,7 @@
         createTime: new Date(),
         startTime: '',
         endTime: '',
-        categoryLevelId: '',
+        categoryLevelIds: [],
         workOrderStatusList: []
       };
       return {

+ 7 - 4
src/views/wanLong/index.vue

@@ -12,6 +12,7 @@
         :current.sync="current"
         highlight-current-row
         row-key="id"
+        :needPage="false"
         :height="tableHeight"
         :selection.sync="selection"
         @fullscreen-change="fullscreenChange"
@@ -69,7 +70,8 @@
         selection: [],
         tableHeight: 'calc(100vh - 320px)',
         dynamicColumns: [], // 保存 taskList 动态列
-        taskNames: [] // taskName 列名数组
+        taskNames: [], // taskName 列名数组
+        timeDate: ''
         // categoryData: [],
         // categoryType: [],
 
@@ -212,7 +214,8 @@
             prop: 'middleNum',
             width: 120,
             showOverflowTooltip: true,
-            align: 'center'
+            align: 'center',
+            sortable: 'custom'
           },
           {
             label: '库存数量',
@@ -296,7 +299,7 @@
           where.startTime = dateStr + ' 00:00:00';
           where.endTime = dateStr + ' 23:59:59';
         }
-        console.log(where, '8989');
+        this.timeDate = where.startTime.split(' ')[0];
         return getDailyList({
           pageNum: page,
           size: -1,
@@ -396,7 +399,7 @@
           const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });
           saveAs(
             new Blob([wbout], { type: 'application/octet-stream' }),
-            '生产日报.xlsx'
+            `${this.timeDate}生产日报.xlsx`
           );
 
           this.$message.success('导出成功');

+ 1 - 1
vue.config.js

@@ -33,7 +33,7 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://124.71.68.31:50001',
-        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.125:18086',