|
@@ -218,14 +218,17 @@ export const downloadDataFromAPI = async (gxpk : string, callback ?: () => void)
|
|
|
const infoJson = await getLatestTask(gxpk, null);
|
|
|
if (infoJson?.['data'] != null) {
|
|
|
let info = infoJson?.['data'] as UTSJSONObject ?? {} as UTSJSONObject
|
|
|
- // let ingNum = parseInt(info?.['pdid'] as string);
|
|
|
+ let photoCount = parseInt(info?.['photoCount'] as string);
|
|
|
+ let keyCount = parseInt(info?.['keyCount'] as string);
|
|
|
+ let recordCount = parseInt(info?.['recordCount'] as string);
|
|
|
+
|
|
|
//覆盖标识位
|
|
|
let overwiteFlag = ref(false);
|
|
|
// 先检查是否有任务正在执行中
|
|
|
- // if (info != null && ingNum > 0) {
|
|
|
- // uni.showToast({ title: `当前产品号已有任务在执行中!`, icon: 'error' });
|
|
|
- // return false;
|
|
|
- // }
|
|
|
+ if (info != null && ( photoCount + keyCount + recordCount)> 0) {
|
|
|
+ uni.showToast({ title: `当前工序码已有任务在执行中!`, icon: 'error' });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
// 使用Promise来处理异步流程
|
|
|
let deleteDataPromise = new Promise<boolean>((resolve) => {
|
|
|
// if (info != null && ingNum == 0) {
|
|
@@ -233,7 +236,7 @@ export const downloadDataFromAPI = async (gxpk : string, callback ?: () => void)
|
|
|
//可以被覆盖,需要有提示框,给用户确认
|
|
|
uni.showModal({
|
|
|
title: '系统提示',
|
|
|
- content: '该工序编号已存在任务是否覆盖掉?',
|
|
|
+ content: '该工序码已存在任务是否覆盖掉?',
|
|
|
cancelText: '取消',
|
|
|
confirmText: '确定',
|
|
|
success: function (res) {
|
|
@@ -719,10 +722,6 @@ export const uploadDataToAPI = async (gxpk : string, callback ?: () => void) : P
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (callback != null) {
|
|
|
- callback();
|
|
|
- }
|
|
|
-
|
|
|
if (finalFailedCount > 0) {
|
|
|
canContinueFlag = false
|
|
|
}
|
|
@@ -819,6 +818,10 @@ export const uploadDataToAPI = async (gxpk : string, callback ?: () => void) : P
|
|
|
icon: 'error'
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
}
|
|
|
return true;
|
|
|
} catch (error) {
|