|
|
@@ -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>
|