longfenglin 1 год назад
Родитель
Сommit
78289d454f

+ 40 - 31
src/views/produce/components/jobBooking/components/jobBom.vue

@@ -243,46 +243,50 @@ export default {
     },
 
     blurNum() {
-     
+     let total =Number(this.item.workReportInfo.formedNum) + Number(this.item.workReportInfo.notFormedNum);
+     if(total > this.item.formingNum){
+      this.item.workReportInfo.formedNum=0
+       this.$message.warning('合格品数量加不合格数量不能大于要求生产数量');
+     }
 
 
-      let total =
-        Number(this.item.workReportInfo.formedNum) +
-        Number(this.notFormedList[0].notFormedNum);
+      // let total =
+      //   Number(this.item.workReportInfo.formedNum) +
+      //   Number(this.notFormedList[0].notFormedNum);
 
-      console.log(total, '9****');
+      // console.log(total, '9****');
 
-      this.$emit('modeNum', total);
+      // this.$emit('modeNum', total);
 
 
-      if (
-        this.item.product[0] &&
-        this.item.product[0].feedQuantity > 0 &&
-        Number(this.item.workReportInfo.formedNum)
-      ) {
-        this.$set(
-          this.notFormedList[0],
-          'notFormedNum',
-          this.item.product[0].feedQuantity -
-          Number(this.item.workReportInfo.formedNum)
-        );
-        this.notForme();
-      }
+      // if (
+      //   this.item.product[0] &&
+      //   this.item.product[0].feedQuantity > 0 &&
+      //   Number(this.item.workReportInfo.formedNum)
+      // ) {
+      //   this.$set(
+      //     this.notFormedList[0],
+      //     'notFormedNum',
+      //     this.item.product[0].feedQuantity -
+      //     Number(this.item.workReportInfo.formedNum)
+      //   );
+      //   this.notForme();
+      // }
 
-      let weight =
-        Number(this.item.workReportInfo.formedNum) *
-        Number(this.item.singleWeight) *
-        Number(this.item.weightMultiple);
+      // let weight =
+      //   Number(this.item.workReportInfo.formedNum) *
+      //   Number(this.item.singleWeight) *
+      //   Number(this.item.weightMultiple);
 
-      if (['G', 'g', '克'].includes(this.item.singleWeightUnit)) {
-        weight = parseFloat((weight / 1000).toFixed(2));
-      } else {
-        weight = parseFloat(weight.toFixed(2));
-      }
+      // if (['G', 'g', '克'].includes(this.item.singleWeightUnit)) {
+      //   weight = parseFloat((weight / 1000).toFixed(2));
+      // } else {
+      //   weight = parseFloat(weight.toFixed(2));
+      // }
 
-      console.log(this.item, 'weight');
+      // console.log(this.item, 'weight');
 
-      this.$set(this.item.workReportInfo, 'formedWeight', weight);
+      // this.$set(this.item.workReportInfo, 'formedWeight', weight);
 
       this.$forceUpdate();
     },
@@ -328,7 +332,12 @@ export default {
 
 
     changeNum() {
-      this.notForme();
+      let total =Number(this.item.workReportInfo.formedNum) + Number(this.item.workReportInfo.notFormedNum);
+      if(total > this.item.formingNum){
+        this.item.workReportInfo.notFormedNum=0
+        this.$message.warning('合格品数量加不合格数量不能大于要求生产数量');
+      }
+      // this.notForme();
       // this.blurNum()
     }
   }

+ 75 - 63
src/views/produce/components/jobBooking/components/jobDdBom.vue

@@ -32,9 +32,9 @@
                 <!-- v-if="(clientEnvironmentId == 3 && item.singleReport == 0) ||  taskObj.type == 4 || clientEnvironmentId == 2" -->
                 <div class="item rx-sc">
                     <div class="rx ww40">
-                        <div class="lable lable100 rx-cc">合格品数量</div>
+                        <div class="lable lable100 rx-cc">合格品数量111</div>
                         <div class="content content_num rx-sc">
-                            <el-input size="mini" v-model="item.workReportInfo.formedNum" placeholder="请输入合格品数量"
+                            <el-input size="mini" v-model.number="item.workReportInfo.formedNum" placeholder="请输入合格品数量"
                                 @input="blurNum">
                                 <template slot="append">{{ item.unit }}</template>
                             </el-input>
@@ -57,7 +57,7 @@
                     <div class="rx ww40">
                         <div class="lable lable100 rx-cc">不合格数量</div>
                         <div class="content content_num rx-sc">
-                            <el-input size="mini" v-model="item.workReportInfo.notFormedNum" placeholder="请输入不合格数量"
+                            <el-input size="mini" v-model.number="item.workReportInfo.notFormedNum" placeholder="请输入不合格数量"
                                 @input="changeNum">
                                 <template slot="append">{{ item.unit }}</template>
                             </el-input>
@@ -152,34 +152,35 @@ export default {
 
     watch: {
         item: {
+            immediate: true,
             deep: true,
             handler(newVal) {
-                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()
-                }
+                // 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()
+                // }
                 
             }
         },
@@ -290,16 +291,16 @@ export default {
 
         singleQuery() {
             console.log(this.item.workReportInfo);
-
             if (!this.item.workReportInfo.formedNum) return this.$message.info("请输入合格品数")
-            if (this.item.workReportInfo.notFormedNum == '' || this.item.workReportInfo.notFormedNum == null) return this.$message.info(
+            
+            if (this.item.workReportInfo.notFormedNum === '' || this.item.workReportInfo.notFormedNum == null) return this.$message.info(
                 "请输入不合格品数"
             )
 
 
             const req = {
                 "formedNum": this.item.workReportInfo.formedNum,
-                "notFormedNum": this.item.workReportInfo.notFormedNum,
+                "notFormedNum": this.item.workReportInfo.notFormedNum||0,
                 "taskId": this.item.workReportInfo.taskId,
                 "workOrderId": this.item.workReportInfo.workOrderId
             };
@@ -342,44 +343,49 @@ export default {
         },
 
         blurNum() {
+            let total =this.item.workReportInfo.formedNum + this.item.workReportInfo.notFormedNum;
+            console.log('111222',total)
+            if(total > this.item.formingNum){
+            this.item.workReportInfo.formedNum=0
+            this.$message.warning('合格品数量加不合格数量不能大于要求生产数量');
+            }
+            // let total =
+            //     Number(this.item.workReportInfo.formedNum) +
+            //     Number(this.notFormedList[0].notFormedNum);
 
-            let total =
-                Number(this.item.workReportInfo.formedNum) +
-                Number(this.notFormedList[0].notFormedNum);
+            // console.log(total, '9****');
 
-            console.log(total, '9****');
+            // this.$emit('modeNum', total);
 
-            this.$emit('modeNum', total);
 
+            // if (
+            //     this.item.product[0] &&
+            //     this.item.product[0].feedQuantity > 0 &&
+            //     Number(this.item.workReportInfo.formedNum)
+            // ) {
+            //     this.$set(
+            //         this.notFormedList[0],
+            //         'notFormedNum',
+            //         this.item.product[0].feedQuantity -
+            //         Number(this.item.workReportInfo.formedNum)
+            //     );
+            //     this.notForme();
+            // }
 
-            if (
-                this.item.product[0] &&
-                this.item.product[0].feedQuantity > 0 &&
-                Number(this.item.workReportInfo.formedNum)
-            ) {
-                this.$set(
-                    this.notFormedList[0],
-                    'notFormedNum',
-                    this.item.product[0].feedQuantity -
-                    Number(this.item.workReportInfo.formedNum)
-                );
-                this.notForme();
-            }
+            // let weight =
+            //     Number(this.item.workReportInfo.formedNum) *
+            //     Number(this.item.singleWeight) *
+            //     Number(this.item.weightMultiple);
 
-            let weight =
-                Number(this.item.workReportInfo.formedNum) *
-                Number(this.item.singleWeight) *
-                Number(this.item.weightMultiple);
+            // if (['G', 'g', '克'].includes(this.item.singleWeightUnit)) {
+            //     weight = parseFloat((weight / 1000).toFixed(2));
+            // } else {
+            //     weight = parseFloat(weight.toFixed(2));
+            // }
 
-            if (['G', 'g', '克'].includes(this.item.singleWeightUnit)) {
-                weight = parseFloat((weight / 1000).toFixed(2));
-            } else {
-                weight = parseFloat(weight.toFixed(2));
-            }
+            // console.log(this.item, 'weight');
 
-            console.log(this.item, 'weight');
-
-            this.$set(this.item.workReportInfo, 'formedWeight', weight);
+            // this.$set(this.item.workReportInfo, 'formedWeight', weight);
 
             this.$forceUpdate();
         },
@@ -425,7 +431,13 @@ export default {
 
 
         changeNum() {
-            this.notForme();
+            let total =this.item.workReportInfo.formedNum + this.item.workReportInfo.notFormedNum;
+            console.log('no111222',total)
+            if(total > this.item.formingNum){
+            this.item.workReportInfo.notFormedNum=0
+            this.$message.warning('合格品数量加不合格数量不能大于要求生产数量');
+            }
+            // this.notForme();
             // this.blurNum()
         }
     }

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

@@ -387,7 +387,9 @@ console.log('agasgasgs',this.taskObj.type)
               formingWeight: null,
               formedNum: null,
               formedWeight: null,
-              taskId: this.taskObj.id
+              taskId: this.taskObj.id,
+              notFormedNum:null,
+              notFormedWeigh:null
             };
 
             obj.notFormedList = [

+ 3 - 2
src/views/produce/components/outsourcing/pickingList.vue

@@ -391,7 +391,8 @@ export default {
 
         if(this.id==2){
           param.dimension = 1;
-          URL = outInDetailPdaPage;
+          // URL = outInDetailPdaPage;
+          URL = pageeLedgerMain;
         }else if(this.id==3){
 
           URL = categoryGetList
@@ -538,7 +539,7 @@ export default {
         });
       } else if (this.isType == 'weiwai') {
 
-        this.treeIds = '1,23,9';
+        this.treeIds = '9, 23, 2, 1, 4, 14, 5, 8, 16, 13, 15, 6, 10, 22';
         this.visible = true;
       }
     },

+ 6 - 6
src/views/produce/components/outsourcing/pickingListSearch.vue

@@ -30,19 +30,19 @@
       </el-col>
 
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="物品编码:" prop="code">
+        <el-form-item label="物品编码:" prop="categoryCode">
           <el-input
             clearable
             placeholder="请输入"
-            v-model.trim="where.code"
+            v-model.trim="where.categoryCode"
           ></el-input>
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="物品名称:" prop="assetName">
+        <el-form-item label="物品名称:" prop="categoryName">
           <el-input
             clearable
-            v-model="where.assetName"
+            v-model="where.categoryName"
             placeholder="请输入"
           ></el-input>
         </el-form-item>
@@ -122,9 +122,9 @@
 
         modelType: '',
         specification: '',
-        code: '',
+        categoryCode: '',
 
-        assetName: ''
+        categoryName: ''
       };
       return {
         defaultWhere,

+ 2 - 1
src/views/produce/components/picking/pickingList.vue

@@ -572,7 +572,8 @@ export default {
 
   created() {
     if (this.isType == 'pick') {
-      this.treeIds = '1, 5, 7, 8, 10, 13, 14, 23, 26, 9, 28';
+      // this.treeIds = '1, 5, 7, 8, 10, 13, 14, 23, 26, 9, 28';
+      this.treeIds='9, 23, 2, 1, 4, 14, 5, 8, 16, 13, 15, 6, 10, 22'
     } else if (this.isType == 'feed') {
       this.treeIds = '1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 26, 9, 23,28';
     } else if (this.isType == 'job') {

+ 40 - 25
src/views/produceOrder/index.vue

@@ -11,9 +11,13 @@
 
 
 
-      <el-tabs v-model="activeName" type="card">
-        <el-tab-pane label="未完成工单" name="first"></el-tab-pane>
-        <el-tab-pane label="已完成工单" name="second"></el-tab-pane>
+      <el-tabs v-model="tabValue" type="card" @tab-click="handleTabClick">
+        <!-- <el-tab-pane label="未完成工单" name="first"></el-tab-pane>
+        <el-tab-pane label="已完成工单" name="second"></el-tab-pane> -->
+        <el-tab-pane label="生产中" name="5"></el-tab-pane>
+        <el-tab-pane label="待生产" name="4"></el-tab-pane>
+        <el-tab-pane label="已完成" name="6"></el-tab-pane>
+        <el-tab-pane label="已延期" name="7"></el-tab-pane>
       </el-tabs>
       <!-- 数据表格 -->
       <ele-pro-table ref="table" :key="activeName" :initLoad="false" :columns="newColumns" :datasource="datasource"
@@ -161,6 +165,7 @@ export default {
 
     return {
       activeName: 'first',
+      tabValue:'5',
       id: '',
       where:{},
       // 加载状态
@@ -265,16 +270,16 @@ export default {
           placeholder: '',
           width: 240,
         },
-        {
-          label: "状态:",
-          value: 'status',
-          type: "select",
-
-          placeholder: '',
-          width: 240,
-          // 加载状态
-          planList: this.statusOpt.first
-        },
+        // {
+        //   label: "状态:",
+        //   value: 'status',
+        //   type: "select",
+
+        //   placeholder: '',
+        //   width: 240,
+        //   // 加载状态
+        //   planList: this.statusOpt.first
+        // },
         {
           label: "班组:",
           value: 'teamId',
@@ -479,18 +484,18 @@ export default {
           showOverflowTooltip: true,
           minWidth: 110
         },
-        {
-          prop: 'status',
-          slot: 'status',
-          label: '状态',
-          align: 'center',
-          formatter: (row) => {
-            const obj = this.statusOpt[this.activeName].find(
-              (i) => i.value == row.status
-            );
-            return obj && obj.label;
-          }
-        },
+        // {
+        //   prop: 'status',
+        //   slot: 'status',
+        //   label: '状态',
+        //   align: 'center',
+        //   formatter: (row) => {
+        //     const obj = this.statusOpt[this.activeName].find(
+        //       (i) => i.value == row.status
+        //     );
+        //     return obj && obj.label;
+        //   }
+        // },
         {
           prop: 'deviceName',
           slot: 'deviceName',
@@ -574,9 +579,19 @@ export default {
 
       this.$refs.equipmentRef.open()
     },
+    handleTabClick(){
+      if(this.tabValue=='6'){
+        this.activeName="second"
+      }else{
+        this.activeName="first"
+      }
+       this.reload()
+    },
 
     /* 表格数据源 */
     async datasource({ page, limit, where, order }) {
+      // console.log('1123',where)
+      where.statusList=[this.tabValue]
       let res = await getPage({
         ...where,
         ...order,