695593266@qq.com пре 10 месеци
родитељ
комит
1fd143e536

+ 26 - 6
pages/pda/feeding/components/workInProgressList.vue

@@ -288,7 +288,15 @@ export default {
         return;
       }
 
-      console.log(this.itemData, "2222");
+      if (value == 0) {
+        this.$message.warning("拆批数不能等于0");
+        return;
+      }
+
+      if (!value) {
+        this.$message.warning("拆批数不能为空");
+        return;
+      }
 
       if (this.bacthData.extInfo.sourceQuantity < value) {
         this.$message.warning("拆批数不能大于数量");
@@ -328,8 +336,21 @@ export default {
     },
 
     deleteBatch(index) {
-      this.listArr.splice(index, 1);
-      this.$set(this.itemData, "product", this.listArr);
+      uni.showModal({
+        title: "删除",
+        content: "是否确实删除此物料!",
+        confirmText: "确认", //这块是确定按钮的文字
+        success: (rr) => {
+          this.listArr.splice(index, 1);
+          this.$set(this.itemData, "product", this.listArr);
+
+          if (this.listArr.length == 0) {
+            this.$set(this.itemData.workReportInfo, "formedNum", 0);
+            this.$set(this.itemData.workReportInfo, "notFormedNum", 0);
+          }
+          this.$forceUpdate();
+        },
+      });
     },
 
     deepCopy(obj, hash = new WeakMap()) {
@@ -365,9 +386,8 @@ export default {
             o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
             o.deviceId = f.instanceId;
             this.$forceUpdate();
-          } else if(this.deviceList.length > 1) {
-						
-					}
+          } else if (this.deviceList.length > 1) {
+          }
         });
       });
     },

+ 45 - 10
pages/pda/jobBooking/components/batchJobBom.vue

@@ -65,7 +65,7 @@
           </view>
         </view>
 
-        <view
+        <!-- <view
           class="item rx-sc"
           v-for="(not, notIndex) in notFormedList"
           :key="notIndex"
@@ -73,7 +73,6 @@
           <view class="rx ww55">
             <view class="lable lable150 rx-cc">不合格数量</view>
             <view class="content content_num">
-              <!-- //详情 -->
               <input
                 class="uni-input"
                 v-model="item.workReportInfo.notFormedNum"
@@ -112,15 +111,42 @@
                 v-else
               />
               <view class="unit">{{ item.weightUnit }}</view>
+            </view>
+          </view>
+        </view> -->
+
+        <view class="item rx-sc">
+          <view class="rx ww55">
+            <view class="lable lable150 rx-cc">不合格数量</view>
+            <view class="content content_num">
+              <!-- //详情 -->
+              <input
+                class="uni-input"
+                v-model="item.workReportInfo.notFormedNum"
+                type="digit"
+                :disabled="isDetails"
+                @input="changeNum"
+              />
+
+              <view class="unit">{{ item.unit }}</view>
+            </view>
+          </view>
 
-              <!-- <view class="penalize" v-if='!isDetails'
-								:style="{ background: not.warehouseId ? '#FFA07A' : '' }" @click="penalize">处置</view> -->
-              <!-- <view class="penalize" v-if='isDetails'
-								:style="{ background: not.warehouseId ? '#FFA07A' : '' }"
-								@click="handleView(isDetails ? not.warehouseName : item.warehouseName)">查看</view> -->
+          <view class="rx ww45">
+            <view class="lable rx-cc ww80">重量</view>
+            <view class="content content_num">
+              <input
+                class="uni-input"
+                v-model="item.workReportInfo.notFormedWeight"
+                type="digit"
+                :disabled="isDetails"
+              />
+
+              <view class="unit">{{ item.weightUnit }}</view>
             </view>
           </view>
         </view>
+
         <view class="item rx-sc">
           <view class="rx ww55">
             <view class="lable lable150 rx-cc">报工备注</view>
@@ -241,17 +267,26 @@ export default {
           let notFormedNum = 0;
 
           newVal.product.forEach((item) => {
-            if (!item.extInfo.isQualified || item.extInfo.isQualified == 1) {
+            if (
+              !item.extInfo.isQualified ||
+              item.extInfo.isQualified == 1 ||
+              item.extInfo.isQualified == 3
+            ) {
               formedNum = formedNum + Number(item.feedQuantity);
             } else {
               notFormedNum = notFormedNum + Number(item.feedQuantity);
             }
           });
 
+          console.log("合格数量:" + formedNum, "不合格数量:" + notFormedNum);
+
           this.$set(this.item.workReportInfo, "formedNum", formedNum);
           this.$set(this.item.workReportInfo, "notFormedNum", notFormedNum);
+
+          // console.log(this.item.workReportInfo);
+          this.item.workReportInfo = this.deepCopy(this.item.workReportInfo);
+          this.$forceUpdate();
         }
-        this.$forceUpdate();
         // if (!this.currentTaskDiagram.isFirstTask) {
         //   this.getSemiProductList(newVal);
         // }
@@ -405,7 +440,7 @@ export default {
     },
 
     singleBatch() {
-      console.log(this.item.workReportInfo);
+      console.log(this.item.workReportInfo, "11111111");
 
       if (!this.item.workReportInfo.formedNum)
         return uni.showToast({

+ 318 - 62
pages/pda/jobBooking/components/batchProductJobBom.vue

@@ -113,6 +113,23 @@
           </view>
         </view>
 
+        <view class="item rx-sc">
+          <view class="rx ww50">
+            <view class="lable lable150 rx-cc">批次号</view>
+            <view class="content content_num">
+              <view v-if="isDetails">{{ it.batchNo }}</view>
+              <input class="uni-input" v-else v-model="it.batchNo" />
+            </view>
+          </view>
+
+          <view class="rx ww50">
+            <view class="lable lable150 rx-cc">牌号</view>
+            <view class="content content_num">
+              <view>{{ it.brandNum }}</view>
+            </view>
+          </view>
+        </view>
+
         <view class="item rx-sc">
           <view class="rx ww50">
             <view class="lable lable150 rx-cc">物料代号</view>
@@ -137,7 +154,12 @@
 
         <view class="item rx-sc">
           <view class="rx ww50">
-            <view class="lable lable150 rx-cc">刻码</view>
+            <view class="lable lable150 rx-cc" v-if="clientEnvironmentId != 5"
+              >刻码</view
+            >
+            <view class="lable lable150 rx-cc" v-if="clientEnvironmentId == 5"
+              >识别码</view
+            >
             <view class="content content_num">
               <view v-if="isDetails">{{ it.extInfo.engrave }}</view>
               <input class="uni-input" v-else v-model="it.extInfo.engrave" />
@@ -182,6 +204,7 @@
             </view>
           </view>
         </view>
+
         <view class="item rx-sc">
           <view class="rx ww50">
             <view class="lable lable150 rx-cc">位置</view>
@@ -201,58 +224,6 @@
           </view>
         </view>
 
-        <!-- <view class="item rx-sc">
-          <view class="rx ww45">
-            <view class="lable lable150 rx-cc">是否合格</view>
-            <view class="content content_num">
-              <zxz-uni-data-select
-                :localdata="isQualifiedList"
-                v-model="it.extInfo.isQualified"
-                dataValue="code"
-                format="{name}"
-                dataKey="code"
-                filterable
-                :disabled="isDetails"
-                :clear="false"
-                @change="handleInput"
-              ></zxz-uni-data-select>
-            </view>
-          </view>
-
-          <view class="rx ww50">
-            <view class="lable lable150 rx-cc">类型</view>
-            <view class="content content_num">
-              <zxz-uni-data-select
-                :localdata="notTypeList"
-                v-model="it.extInfo.notType"
-                dataValue="code"
-                format="{name}"
-                dataKey="code"
-                filterable
-                :disabled="isDetails"
-                :clear="false"
-              ></zxz-uni-data-select>
-            </view>
-          </view>
-        </view>
-
-        <view
-          class="item rx-sc"
-          v-if="
-            it.extInfo.isQualified != 1 &&
-            it.extInfo.notType != 5 &&
-            it.extInfo.notType != 8
-          "
-        >
-          <view class="rx">
-            <view class="lable lable150 rx-cc">原因</view>
-            <view class="content content_num">
-              <view v-if="isDetails">{{ it.extInfo.notReason }}</view>
-              <input class="uni-input" v-else v-model="it.extInfo.notReason" />
-            </view>
-          </view>
-        </view> -->
-
         <view class="item rx-sc">
           <view class="rx ww50">
             <view class="lable lable150 rx-cc">是否合格</view>
@@ -275,7 +246,7 @@
             v-if="it.extInfo.isQualified && it.extInfo.isQualified == 2"
           >
             <view class="lable lable150 rx-cc">处置类型</view>
-            <view class="content content_num">
+            <view class="content">
               <zxz-uni-data-select
                 :localdata="notTypeList"
                 v-model="it.extInfo.notType"
@@ -294,7 +265,7 @@
           <view class="rx ww50">
             <view class="lable lable150 rx-cc">原因/处置</view>
             <view
-              class="content content_num"
+              class="content"
               v-if="
                 it.extInfo.isQualified != 1 &&
                 it.extInfo.notType != 5 &&
@@ -303,12 +274,16 @@
               "
             >
               <view v-if="isDetails">{{ it.extInfo.notReason }}</view>
-              <input class="uni-input" v-else v-model="it.extInfo.notReason" />
+              <input
+                class="uni-input content_num"
+                v-else
+                v-model="it.extInfo.notReason"
+              />
             </view>
 
             <view
               v-if="![1, 2, 3, 4, 6, 9, 7].includes(Number(it.extInfo.notType))"
-              class="content content_num"
+              class="content"
             >
               <span v-if="isDetails">{{ it.extInfo.taskName }}</span>
               <zxz-uni-data-select
@@ -339,6 +314,32 @@
             </view>
           </view>
         </view>
+
+        <view class="item rx-sc">
+          <view class="rx">
+            <view class="lable lable150 rx-cc">操作</view>
+            <view class="content rx-bc">
+              <view style="display: flex">
+                <u-button
+                  size="small"
+                  class="u-reset-button"
+                  type="primary"
+                  @click="batchClick(it, idx)"
+                  v-if="it.extInfo.sourceQuantity > 1"
+                  >拆批</u-button
+                >
+                <u-button
+                  size="small"
+                  class="u-reset-button"
+                  type="error"
+                  @click="deleteBatch(idx)"
+                  style="margin-left: 20px"
+                  >删除</u-button
+                >
+              </view>
+            </view>
+          </view>
+        </view>
       </view>
 
       <view
@@ -557,6 +558,89 @@
         </view>
       </view>
     </u-popup>
+
+    <uni-popup ref="inputDialog" type="center" :animation="false">
+      <view class="popup-content">
+        <view style="font-size: 18px; margin-bottom: 10px">拆批</view>
+        <uni-forms
+          ref="baseForm"
+          :modelValue="batchForm"
+          label-position="left"
+          label-align="center"
+        >
+          <uni-forms-item label="批次号:" label-width="100" prop="batchNo">
+            <uni-easyinput
+              v-model="batchForm.batchNo"
+              placeholder="请输入批次号"
+            />
+          </uni-forms-item>
+
+          <uni-forms-item label="拆批数:" label-width="100" prop="quantity">
+            <uni-easyinput
+              v-model="batchForm.quantity"
+              placeholder="请输入拆批数"
+            />
+          </uni-forms-item>
+
+          <uni-forms-item
+            label="是否合格:"
+            label-width="100"
+            prop="isQualified"
+          >
+            <zxz-uni-data-select
+              :localdata="isQualifiedList"
+              v-model="batchForm.isQualified"
+              dataValue="code"
+              format="{name}"
+              dataKey="code"
+              filterable
+              :clear="false"
+              @change="isChange"
+            ></zxz-uni-data-select>
+          </uni-forms-item>
+
+          <uni-forms-item
+            label="不合格类型:"
+            label-width="100"
+            prop="notType"
+            v-if="batchForm.isQualified == 2"
+          >
+            <zxz-uni-data-select
+              :localdata="notTypeList"
+              v-model="batchForm.notType"
+              dataValue="code"
+              format="{name}"
+              dataKey="code"
+              filterable
+              :clear="false"
+            ></zxz-uni-data-select>
+          </uni-forms-item>
+
+          <uni-forms-item
+            label="不良原因:"
+            v-if="
+              batchForm.isQualified != 1 &&
+              batchForm.notType &&
+              batchForm.notType != 5 &&
+              batchForm.notType != 8
+            "
+            prop="notReason"
+          >
+            <uni-easyinput
+              v-model="batchForm.notReason"
+              placeholder="请输入不良原因"
+            />
+          </uni-forms-item>
+        </uni-forms>
+
+        <view class="button-group">
+          <button type="primary" size="mini" @click="handleClose">取消</button>
+          <button type="primary" size="mini" @click="timeoutCauseConfirm">
+            确定
+          </button>
+        </view>
+      </view>
+    </uni-popup>
   </view>
 </template>
 
@@ -564,6 +648,8 @@
 import { getTaskInstanceList } from "@/api/pda/workOrder.js";
 
 import { saveParam, getComputeParam } from "@/api/pda/tangu.js";
+import { splitBatch } from "@/api/pda/feeding";
+import SearchPopup from "./searchPopup.vue";
 export default {
   props: {
     item: {
@@ -587,6 +673,10 @@ export default {
     },
   },
 
+  components: {
+    SearchPopup,
+  },
+
   watch: {
     equipmentList: {
       immediate: true,
@@ -647,11 +737,11 @@ export default {
 
       isQualifiedList: [
         {
-          code: "1",
+          code: 1,
           name: "合格",
         },
         {
-          code: "2",
+          code: 2,
           name: "不合格",
         },
       ],
@@ -694,6 +784,16 @@ export default {
           name: "转试销",
         },
       ],
+      batchShow: false,
+      batchForm: {
+        quantity: "",
+        batchNo: "",
+        notReason: "",
+        isQualified: 1,
+        notType: "",
+      },
+      bacthData: {},
+      bacthIndex: "",
     };
   },
   created() {
@@ -821,8 +921,8 @@ export default {
     handleInput() {
       let arr = JSON.parse(JSON.stringify(this.list));
       this.sumweight(arr);
-      // this.sunTj();
-      console.log("arr11111112222", arr);
+      this.sunTj();
+      console.log("arr11111112222", this.item);
       // console.log('this.list33333',this.list)
     },
     sumweight(arr) {
@@ -882,7 +982,36 @@ export default {
             this.list.splice(idx, 1);
           }
 
-          if (this.list.length != 0) {
+          if (this.list.length == 0) {
+            this.$set(this.item.workReportInfo, "formedNum", 0);
+            this.$set(this.item.workReportInfo, "notFormedNum", 0);
+          }
+          this.$forceUpdate();
+        },
+      });
+    },
+
+    batchClick(item, index) {
+      this.batchForm.quantity = "";
+      this.batchForm.notType = "";
+      this.batchForm.notReason = "";
+      this.batchForm.isQualified = 1;
+      this.bacthData = item;
+      this.bacthIndex = index;
+      this.batchForm.batchNo = item.batchNo;
+      this.$refs.inputDialog.open();
+    },
+
+    deleteBatch(index) {
+      uni.showModal({
+        title: "删除",
+        content: "是否确实删除此物料!",
+        confirmText: "确认", //这块是确定按钮的文字
+        success: (rr) => {
+          this.list.splice(index, 1);
+          this.$set(this.item, "product", this.list);
+
+          if (this.list.length == 0) {
             this.$set(this.item.workReportInfo, "formedNum", 0);
             this.$set(this.item.workReportInfo, "notFormedNum", 0);
           }
@@ -891,6 +1020,111 @@ export default {
       });
     },
 
+    handleClose() {
+      this.$refs.inputDialog.close();
+    },
+    async timeoutCauseConfirm() {
+      if (!this.batchForm.quantity) {
+        uni.showToast({
+          title: "请输入拆批的数量",
+          icon: "none",
+        });
+        return;
+      }
+
+      if (this.batchForm.quantity == 0) {
+        uni.showToast({
+          title: "拆批数不能等于0",
+          icon: "none",
+        });
+        return;
+      }
+
+      if (!this.batchForm.quantity) {
+        uni.showToast({
+          title: "拆批数不能为空",
+          icon: "none",
+        });
+        return;
+      }
+
+      if (this.bacthData.extInfo.sourceQuantity < this.batchForm.quantity) {
+        uni.showToast({
+          title: "拆批数不能大于数量",
+          icon: "none",
+        });
+        return;
+      }
+
+      if (this.batchForm.isQualified == 2 && !this.batchForm.notType) {
+        uni.showToast({
+          title: "请选择不合格类型",
+          icon: "none",
+        });
+        return;
+      }
+
+      let dataList = [];
+      await splitBatch({
+        product: this.bacthData,
+        splitQt: Number(this.batchForm.quantity),
+        batchNo: this.batchForm.batchNo,
+        isQualified: this.batchForm.isQualified,
+        notType: this.batchForm.notType,
+        notReason: this.batchForm.notReason,
+      }).then((res) => {
+        res.forEach((item) => {
+          dataList.push(this.deepCopy(item));
+        });
+        this.refreshData(dataList, this.batchForm.quantity);
+      });
+
+      // this.$refs.inputDialog.close()
+    },
+
+    refreshData(list, feedQuantity) {
+      const number =
+        Number(this.list[this.bacthIndex].extInfo.sourceQuantity) -
+        Number(feedQuantity);
+      this.list[this.bacthIndex].extInfo.sourceQuantity = number;
+      this.list[this.bacthIndex].feedQuantity = number;
+      this.list[this.bacthIndex].extInfo.newWeight =
+        (Number(this.list[this.bacthIndex].extInfo.newWeight) * 100000) /
+          100000 -
+        (Number(list[0].extInfo.newWeight) * 100000) / 100000;
+
+      list.forEach((item) => {
+        item.childBatch = 1;
+      });
+      let _arr = [...this.list, ...list];
+      this.$set(this.list, this.list.length, ...list);
+      this.$set(this.item, "product", _arr);
+      this.$forceUpdate();
+      this.$refs.inputDialog.close();
+    },
+
+    isChange(val) {
+      if (val == "合格") {
+        this.batchForm.notType = "";
+        this.batchForm.notReason = "";
+      }
+    },
+    deepCopy(obj, hash = new WeakMap()) {
+      if (obj === null) return null;
+      if (obj instanceof Date) return new Date(obj);
+      if (obj instanceof RegExp) return new RegExp(obj);
+      if (typeof obj !== "object" && typeof obj !== "function") return obj;
+      if (hash.has(obj)) return hash.get(obj);
+
+      const result = Array.isArray(obj) ? [] : {};
+      hash.set(obj, result);
+
+      return Object.keys(obj).reduce((acc, key) => {
+        acc[key] = this.deepCopy(obj[key], hash);
+        return acc;
+      }, result);
+    },
+
     save() {
       if (this.isFirstTask == 1) {
         this.resultObj = {};
@@ -1127,6 +1361,13 @@ export default {
   }
 }
 
+.button-group {
+  margin-top: 15px;
+  display: flex;
+  width: 100%;
+  justify-content: space-around;
+}
+
 .materialBor {
   border: 1rpx solid #157a2c;
 }
@@ -1226,6 +1467,17 @@ export default {
   }
 }
 
+.popup-content {
+  @include flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+  padding: 15px;
+  background-color: #fff;
+  box-sizing: border-box;
+  border-radius: 10px 10px 10px 10px;
+}
+
 .round {
   width: 32rpx;
   height: 32rpx;
@@ -1272,4 +1524,8 @@ export default {
     color: $theme-color;
   }
 }
+
+::v-deep .uni-forms-item__label {
+  font-size: 12px;
+}
 </style>

+ 44 - 0
pages/pda/jobBooking/components/searchPopup.vue

@@ -0,0 +1,44 @@
+<template>
+	<view>
+		<u-popup :show="show" :mode='mode' :closeOnClickOverlay='false' >
+			
+			<view  :style="{paddingTop: mode == 'top' ?  topHight + 'px' : ''}">
+				<slot name="list"></slot>
+				<slot name="operate"></slot>
+
+
+			</view>
+		</u-popup>
+		
+		
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			mode: {
+				type: String,
+				default: ''
+			}
+		},
+		data() {
+			return {
+				show: true,
+				topHight: 20 || 20
+			}
+		},
+		created() {
+			let app = uni.getSystemInfoSync()
+			 this.topHight = app.statusBarHeight || 20
+		},
+		methods: {
+		
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 23 - 1
pages/pda/jobBooking/components/semiProductJobBom.vue

@@ -102,6 +102,23 @@
           </view>
         </view>
 
+        <view class="item rx-sc">
+          <view class="rx ww50">
+            <view class="lable lable150 rx-cc">批次号</view>
+            <view class="content content_num">
+              <view v-if="isDetails">{{ it.batchNo }}</view>
+              <input class="uni-input" v-else v-model="it.batchNo" />
+            </view>
+          </view>
+
+          <view class="rx ww50">
+            <view class="lable lable150 rx-cc">牌号</view>
+            <view class="content content_num">
+              <view>{{ it.brandNum }}</view>
+            </view>
+          </view>
+        </view>
+
         <view class="item rx-sc">
           <view class="rx ww50">
             <view class="lable lable150 rx-cc">物料代号</view>
@@ -126,7 +143,12 @@
 
         <view class="item rx-sc">
           <view class="rx ww50">
-            <view class="lable lable150 rx-cc">刻码</view>
+            <view class="lable lable150 rx-cc" v-if="clientEnvironmentId != 5"
+              >刻码</view
+            >
+            <view class="lable lable150 rx-cc" v-if="clientEnvironmentId == 5"
+              >识别码</view
+            >
             <view class="content content_num">
               <view v-if="isDetails">{{ it.extInfo.engrave }}</view>
               <input class="uni-input" v-else v-model="it.extInfo.engrave" />

+ 2 - 27
pages/pda/jobBooking/components/singleJobBom.vue

@@ -63,11 +63,7 @@
           </view>
         </view>
 
-        <view
-          class="item rx-sc"
-          v-for="(not, notIndex) in notFormedList"
-          :key="notIndex"
-        >
+        <view class="item rx-sc">
           <view class="rx ww55">
             <view class="lable lable150 rx-cc">不合格数量</view>
             <view class="content content_num">
@@ -77,17 +73,9 @@
                 v-model="item.workReportInfo.notFormedNum"
                 type="digit"
                 :disabled="isDetails"
-                v-if="isDetails"
                 @input="changeNum"
               />
 
-              <input
-                class="uni-input"
-                v-model="not.notFormedNum"
-                type="number"
-                v-else
-                @input="changeNum(not)"
-              />
               <view class="unit">{{ item.unit }}</view>
             </view>
           </view>
@@ -100,22 +88,9 @@
                 v-model="item.workReportInfo.notFormedWeight"
                 type="digit"
                 :disabled="isDetails"
-                v-if="isDetails"
               />
-              <input
-                class="uni-input"
-                v-model="not.notFormedWeight"
-                type="digit"
-                :disabled="isDetails"
-                v-else
-              />
-              <view class="unit">{{ item.weightUnit }}</view>
 
-              <!-- <view class="penalize" v-if='!isDetails'
-								:style="{ background: not.warehouseId ? '#FFA07A' : '' }" @click="penalize">处置</view> -->
-              <!-- <view class="penalize" v-if='isDetails'
-								:style="{ background: not.warehouseId ? '#FFA07A' : '' }"
-								@click="handleView(isDetails ? not.warehouseName : item.warehouseName)">查看</view> -->
+              <view class="unit">{{ item.weightUnit }}</view>
             </view>
           </view>
         </view>

+ 0 - 2
pages/pda/jobBooking/index/index.vue

@@ -834,7 +834,6 @@ export default {
               this.objData.workReportInfo.formedNum = numCot;
             }
           } else if (this.objData.product.length > 0) {
-            console.log(this.objData.product, "this.objData.product");
             const number = this.objData.product.reduce((acc, pro) => {
               return pro.feedQuantity ? acc + Number(pro.feedQuantity) : acc;
             }, 0);
@@ -849,7 +848,6 @@ export default {
           this.objData.workReportInfo.workOrderId = res.workOrderId;
 
           this.paramDetailList = res.paramDetailList;
-          console.log(this.objData, "this.paramDetailList");
 
           // this.paramDetailList = res.paramDetailList.map((m) => {
           //   if (m.extInfo.textType == 5) {