|
@@ -60,7 +60,8 @@
|
|
|
getCarrierInfoProcess,
|
|
|
getCarrierInfo,
|
|
|
saveFactoryInspecion,
|
|
|
- saveFirstFactoryInspection
|
|
|
+ saveFirstFactoryInspection,
|
|
|
+ checkHasInspection
|
|
|
} from '@/api/business/processInspection.js'
|
|
|
import {
|
|
|
debounce
|
|
@@ -179,7 +180,7 @@
|
|
|
)
|
|
|
} else {
|
|
|
const result = {
|
|
|
- carrierCode: '000682'
|
|
|
+ carrierCode: '000952'
|
|
|
}
|
|
|
getCarrierInfo(result).then(response => {
|
|
|
if (response.code == 200) {
|
|
@@ -206,8 +207,8 @@
|
|
|
};
|
|
|
lot.value.carrierCode = result.carrierCode
|
|
|
carrierCode.value = result.carrierCode;
|
|
|
- lot.value.inspectionCarrierId = '1844294555287994371'
|
|
|
- lot.value.inspectionCarrierCode = "300071"
|
|
|
+ lot.value.inspectionCarrierId = '1846793994447667208'
|
|
|
+ lot.value.inspectionCarrierCode = "300172"
|
|
|
// console.log("res", res);
|
|
|
uni.hideLoading();
|
|
|
// 判断是否批次号和检查箱码都扫完
|
|
@@ -312,27 +313,71 @@
|
|
|
processInspection.reviewerId = 0
|
|
|
}
|
|
|
//保存
|
|
|
- console.log(processInspection)
|
|
|
- lot.value = {}
|
|
|
- if (store.userInfo.roles.some(item => item.roleKey == 'factoryInspection')) {
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/factoryInspection/form",
|
|
|
- success: (res) => {
|
|
|
- // 通过eventChannel向被打开页面传送数据
|
|
|
- res.eventChannel.emit("factoryInspectionFrom", {
|
|
|
- data: processInspection.lot
|
|
|
+ //判断当前工序是否做过交检
|
|
|
+ checkHasInspection({
|
|
|
+ id: lot.value.id,
|
|
|
+ type: "factoryInspection"
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ //没有检查
|
|
|
+ lot.value = {}
|
|
|
+ if (store.userInfo.roles.some(item => item.roleKey == 'factoryInspection')) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/factoryInspection/form",
|
|
|
+ success: (res) => {
|
|
|
+ // 通过eventChannel向被打开页面传送数据
|
|
|
+ res.eventChannel.emit("factoryInspectionFrom", {
|
|
|
+ data: processInspection.lot
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
+ } else {
|
|
|
+ saveFirstFactoryInspection(processInspection).then(res => {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/factoryInspection/index'
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
- })
|
|
|
- } else {
|
|
|
- saveFirstFactoryInspection(processInspection).then(res => {
|
|
|
+ } else {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: `${lot.value.lotCode}批次已经做过出厂检,是否重复创建`,
|
|
|
+ showCancel: true,
|
|
|
+ cancelText: '取消',
|
|
|
+ confirmText: '确定',
|
|
|
+ confirmColor: '#ff0000',
|
|
|
+ cancelColor: '#55aa00',
|
|
|
+ complete: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ lot.value = {}
|
|
|
+ if (store.userInfo.roles.some(item => item.roleKey ==
|
|
|
+ 'factoryInspection')) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/factoryInspection/form",
|
|
|
+ success: (res) => {
|
|
|
+ // 通过eventChannel向被打开页面传送数据
|
|
|
+ res.eventChannel.emit(
|
|
|
+ "factoryInspectionFrom", {
|
|
|
+ data: processInspection.lot
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ saveFirstFactoryInspection(processInspection).then(res => {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/factoryInspection/index'
|
|
|
+ })
|
|
|
+ })
|
|
|
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/factoryInspection/index'
|
|
|
- })
|
|
|
- })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
} else {
|
|
|
if (lot.value.allCarrierName == undefined) {
|