|
@@ -56,6 +56,9 @@
|
|
|
<view class="btn uni-row" style="margin-top: 48rpx;" @click.stop="handleConfirm">确定</view>
|
|
|
</view>
|
|
|
<QrScanner v-if="showQrCodeReader" @decode="onDecodeHandler" @close="qrReaderClose" />
|
|
|
+ <dialog-processInspection ref='selectProcessInspection'
|
|
|
+ @handleSelectProcessInspection='handleSelectProcessInspection'></dialog-processInspection>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -88,104 +91,105 @@
|
|
|
const carrierCode = ref('')
|
|
|
const equipmentList = ref([])
|
|
|
const inspectionChamber = ref(null)
|
|
|
+ const selectProcessInspection = ref(null)
|
|
|
const userList = ref([])
|
|
|
const userId = ref(null)
|
|
|
const equipment = ref(null)
|
|
|
const lot = ref({})
|
|
|
const query = ref({})
|
|
|
const showQrCodeReader = ref(false);
|
|
|
-
|
|
|
+
|
|
|
function onDecodeHandler(data) {
|
|
|
showQrCodeReader.value = false;
|
|
|
- const result = {
|
|
|
- carrierCode: data,
|
|
|
- processCode: '',
|
|
|
- deptId: store.curDeptDetails.deptId
|
|
|
- }
|
|
|
- if (!result.carrierCode || result.carrierCode == "") {
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: "请扫载具码",
|
|
|
- duration: 1000
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- //判断该箱是否绑定批次
|
|
|
-
|
|
|
- result.processCode = store.outsourcedCode;
|
|
|
- // console.log(result.processCode)
|
|
|
- /************************ 根据扫码查询到的数据和需要检查的工序查询信息 ************************/
|
|
|
- getCarrierInfo(result).then(response => {
|
|
|
- if (response.code == 200) {
|
|
|
- // 判断是哪种返回值 假设是想信息则给lot附检查箱信息
|
|
|
- // 假设是dayworkCarriers 则 判断是几个批次,假设为多批,则弹出选择框。
|
|
|
- if (response.data.dayworkCarriers != null) {
|
|
|
- if (response.data.dayworkCarriers.length > 1) {
|
|
|
- query.value = result;
|
|
|
- selectProcessInspection.value.open(response.data.dayworkCarriers)
|
|
|
- } else {
|
|
|
- // console.log(response)
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中'
|
|
|
- });
|
|
|
- // 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
|
|
|
- // 需要定义一个请求方法, 从后端获取
|
|
|
- result.deptId = store.curDeptDetails.deptId
|
|
|
- getFirstInspectionLotInfo(result).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- console.log(res)
|
|
|
- getUser(res.data.dayworkItemList)
|
|
|
- getEquipment(res.data.dayworkItemList)
|
|
|
- lot.value = {
|
|
|
- ...lot.value,
|
|
|
- ...res.data
|
|
|
- };
|
|
|
- lot.value.carrierCode = result.carrierCode
|
|
|
- carrierCode.value = result.carrierCode;
|
|
|
- // console.log("res", res);
|
|
|
- uni.hideLoading();
|
|
|
- // 判断是否批次号和检查箱码都扫完
|
|
|
- checkSave()
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: res.msg,
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: err.message,
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
- } else if (response.data.inspectionCarrier != null) {
|
|
|
- console.log(response)
|
|
|
- lot.value.inspectionCarrierCode = response.data.inspectionCarrier.code
|
|
|
- lot.value.inspectionCarrierId = response.data.inspectionCarrier.id
|
|
|
+ const result = {
|
|
|
+ carrierCode: data,
|
|
|
+ processCode: '',
|
|
|
+ deptId: store.curDeptDetails.deptId
|
|
|
+ }
|
|
|
+ if (!result.carrierCode || result.carrierCode == "") {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "请扫载具码",
|
|
|
+ duration: 1000
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //判断该箱是否绑定批次
|
|
|
+
|
|
|
+ result.processCode = store.outsourcedCode;
|
|
|
+ // console.log(result.processCode)
|
|
|
+ /************************ 根据扫码查询到的数据和需要检查的工序查询信息 ************************/
|
|
|
+ getCarrierInfo(result).then(response => {
|
|
|
+ if (response.code == 200) {
|
|
|
+ // 判断是哪种返回值 假设是想信息则给lot附检查箱信息
|
|
|
+ // 假设是dayworkCarriers 则 判断是几个批次,假设为多批,则弹出选择框。
|
|
|
+ if (response.data.dayworkCarriers != null) {
|
|
|
+ if (response.data.dayworkCarriers.length > 1) {
|
|
|
+ query.value = result;
|
|
|
+ selectProcessInspection.value.open(response.data.dayworkCarriers)
|
|
|
+ } else {
|
|
|
+ // console.log(response)
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ // 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
|
|
|
+ // 需要定义一个请求方法, 从后端获取
|
|
|
+ result.deptId = store.curDeptDetails.deptId
|
|
|
+ getFirstInspectionLotInfo(result).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ console.log(res)
|
|
|
+ getUser(res.data.dayworkItemList)
|
|
|
+ getEquipment(res.data.dayworkItemList)
|
|
|
+ lot.value = {
|
|
|
+ ...lot.value,
|
|
|
+ ...res.data
|
|
|
+ };
|
|
|
+ lot.value.carrierCode = result.carrierCode
|
|
|
+ carrierCode.value = result.carrierCode;
|
|
|
+ // console.log("res", res);
|
|
|
+ uni.hideLoading();
|
|
|
// 判断是否批次号和检查箱码都扫完
|
|
|
checkSave()
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
}
|
|
|
- } else {
|
|
|
+ }).catch(err => {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
- title: response.msg,
|
|
|
+ title: err.message,
|
|
|
duration: 2000
|
|
|
})
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: err.message,
|
|
|
- duration: 2000
|
|
|
})
|
|
|
- })
|
|
|
+
|
|
|
+ }
|
|
|
+ } else if (response.data.inspectionCarrier != null) {
|
|
|
+ console.log(response)
|
|
|
+ lot.value.inspectionCarrierCode = response.data.inspectionCarrier.code
|
|
|
+ lot.value.inspectionCarrierId = response.data.inspectionCarrier.id
|
|
|
+ // 判断是否批次号和检查箱码都扫完
|
|
|
+ checkSave()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: response.msg,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: err.message,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
//H5扫码器关闭
|
|
|
function qrReaderClose() {
|
|
|
showQrCodeReader.value = false;
|
|
@@ -410,6 +414,53 @@
|
|
|
function handleGetEquipmentList() {
|
|
|
getEquipment(lot.value.dayworkItemList)
|
|
|
}
|
|
|
+ //选择批号弹窗带回
|
|
|
+ function handleSelectProcessInspection(data) {
|
|
|
+ console.log("带回", data)
|
|
|
+ query.value.lotCode = data
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ getFirstInspectionLotInfo(query.value).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ console.log(res)
|
|
|
+
|
|
|
+ if (res.data.dayworkItemList.length == 0) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: "该批次当天没有报工",
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ console.log("888")
|
|
|
+ getUser(res.data.dayworkItemList)
|
|
|
+ getEquipment(res.data.dayworkItemList)
|
|
|
+ lot.value = {
|
|
|
+ ...lot.value,
|
|
|
+ ...res.data
|
|
|
+ };
|
|
|
+ lot.value.carrierCode = query.value.carrierCode
|
|
|
+ carrierCode.value = query.value.carrierCode;
|
|
|
+ // console.log("res", res);
|
|
|
+ uni.hideLoading();
|
|
|
+ // 判断是否批次号和检查箱码都扫完
|
|
|
+ checkSave()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: err.message,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
function getEquipment(data) {
|
|
|
const uniqueEquipmentMap = new Map();
|