|
@@ -236,8 +236,7 @@ export default function usePhotography() {
|
|
|
ElMessage.error(result.msg)
|
|
ElMessage.error(result.msg)
|
|
|
runLoading.value = false
|
|
runLoading.value = false
|
|
|
return;
|
|
return;
|
|
|
- } else {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ } else if (!isDemoMode.value) {
|
|
|
ElMessage.success('开始拍摄,请稍后')
|
|
ElMessage.success('开始拍摄,请稍后')
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -293,7 +292,7 @@ export default function usePhotography() {
|
|
|
* 删除指定的商品货号。
|
|
* 删除指定的商品货号。
|
|
|
* @param params - 包含需要删除的货号列表的对象。
|
|
* @param params - 包含需要删除的货号列表的对象。
|
|
|
*/
|
|
*/
|
|
|
- const del = async function (params) {
|
|
|
|
|
|
|
+ const del = async function (params, options?: { silent?: boolean }) {
|
|
|
console.log(icpList.takePhoto.delectGoodsArts, params);
|
|
console.log(icpList.takePhoto.delectGoodsArts, params);
|
|
|
return new Promise((resolve) => {
|
|
return new Promise((resolve) => {
|
|
|
const channel = icpList.takePhoto.delectGoodsArts
|
|
const channel = icpList.takePhoto.delectGoodsArts
|
|
@@ -307,7 +306,9 @@ export default function usePhotography() {
|
|
|
console.log("icpList.takePhoto.delectGoodsArts", params);
|
|
console.log("icpList.takePhoto.delectGoodsArts", params);
|
|
|
if (result.code === 0) {
|
|
if (result.code === 0) {
|
|
|
isDelGoodsGetList.value = true
|
|
isDelGoodsGetList.value = true
|
|
|
- ElMessage.info('货号删除成功')
|
|
|
|
|
|
|
+ if (!options?.silent) {
|
|
|
|
|
+ ElMessage.info('货号删除成功')
|
|
|
|
|
+ }
|
|
|
getPhotoRecords()
|
|
getPhotoRecords()
|
|
|
if (reNosObj.value.goods_art_no) {
|
|
if (reNosObj.value.goods_art_no) {
|
|
|
runGoods(
|
|
runGoods(
|
|
@@ -316,7 +317,7 @@ export default function usePhotography() {
|
|
|
"goods_art_no": reNosObj.value.goods_art_no
|
|
"goods_art_no": reNosObj.value.goods_art_no
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- } else if (result.msg) {
|
|
|
|
|
|
|
+ } else if (result.msg && !options?.silent) {
|
|
|
ElMessage.error(result.msg)
|
|
ElMessage.error(result.msg)
|
|
|
}
|
|
}
|
|
|
resolve(result)
|
|
resolve(result)
|
|
@@ -834,28 +835,19 @@ const onRemoteControl = async (type) => {
|
|
|
console.log(result)
|
|
console.log(result)
|
|
|
if (result.code === 0) {
|
|
if (result.code === 0) {
|
|
|
setLogInfo(route, { action: '全部拍摄完成', goods_art_no: runAction.value.goods_art_no });
|
|
setLogInfo(route, { action: '全部拍摄完成', goods_art_no: runAction.value.goods_art_no });
|
|
|
- // 全部拍摄完成后,触发抠图队列
|
|
|
|
|
- if (runAction.value.goods_art_no) {
|
|
|
|
|
|
|
+ // 演示模式不发送抠图,货号马上会删掉并进入下一轮
|
|
|
|
|
+ if (runAction.value.goods_art_no && !isDemoMode.value) {
|
|
|
scheduleSegment(runAction.value.goods_art_no)
|
|
scheduleSegment(runAction.value.goods_art_no)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 演示模式:拍摄完成后自动删除货号(正在手动停止时不再自动删)
|
|
|
|
|
- if (isDemoMode.value && !demoStopping.value) {
|
|
|
|
|
- const demoGoodsNo = demoGoodsArtNo.value
|
|
|
|
|
- setTimeout(async () => {
|
|
|
|
|
- if (!isDemoMode.value || demoStopping.value) return
|
|
|
|
|
- try {
|
|
|
|
|
- await del({ goods_art_nos: [demoGoodsNo] })
|
|
|
|
|
- ElMessage.info('演示拍摄完成,货号已自动删除')
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.error('自动删除演示货号失败:', e)
|
|
|
|
|
- }
|
|
|
|
|
- }, 2000)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const finishedGoodsNo = runAction.value.goods_art_no
|
|
|
runLoading.value = false;
|
|
runLoading.value = false;
|
|
|
runAction.value.goods_art_no = '';
|
|
runAction.value.goods_art_no = '';
|
|
|
runAction.value.action = '';
|
|
runAction.value.action = '';
|
|
|
|
|
+
|
|
|
|
|
+ if (isDemoMode.value && !demoStopping.value) {
|
|
|
|
|
+ continueDemoLoop(finishedGoodsNo || demoGoodsArtNo.value)
|
|
|
|
|
+ }
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
showlastPhoto.value = false
|
|
showlastPhoto.value = false
|
|
|
}, 3000)
|
|
}, 3000)
|
|
@@ -1170,21 +1162,24 @@ const onRemoteControl = async (type) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 演示模式:监听拍摄完成事件
|
|
|
|
|
- * 演示模式下拍摄完成后自动删除货号
|
|
|
|
|
|
|
+ * 演示模式:拍完删货号后自动开始下一轮,直到用户点停止
|
|
|
*/
|
|
*/
|
|
|
- const handlePhotoTakeFinishForDemo = (goodsArtNo: string) => {
|
|
|
|
|
- if (isDemoMode.value && goodsArtNo === demoGoodsArtNo.value && !demoStopping.value) {
|
|
|
|
|
- setTimeout(async () => {
|
|
|
|
|
- if (!isDemoMode.value || demoStopping.value) return
|
|
|
|
|
- try {
|
|
|
|
|
- await del({ goods_art_nos: [demoGoodsArtNo.value] })
|
|
|
|
|
- ElMessage.info('演示拍摄完成,货号已自动删除')
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.error('自动删除演示货号失败:', e)
|
|
|
|
|
- }
|
|
|
|
|
- }, 2000)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const continueDemoLoop = (goodsArtNo: string) => {
|
|
|
|
|
+ const demoGoodsNo = goodsArtNo || demoGoodsArtNo.value
|
|
|
|
|
+ const demoAction = demoProgramType.value
|
|
|
|
|
+ setTimeout(async () => {
|
|
|
|
|
+ if (!isDemoMode.value || demoStopping.value) return
|
|
|
|
|
+ try {
|
|
|
|
|
+ await del({ goods_art_nos: [demoGoodsNo] }, { silent: true })
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('演示循环删除货号失败:', e)
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!isDemoMode.value || demoStopping.value) return
|
|
|
|
|
+ runGoods({
|
|
|
|
|
+ action: demoAction,
|
|
|
|
|
+ goods_art_no: demoGoodsNo
|
|
|
|
|
+ })
|
|
|
|
|
+ }, 2000)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|