|
|
@@ -25,7 +25,7 @@
|
|
|
<div class="step-content flex-row justify-between">
|
|
|
<div class="method-container flex-col">
|
|
|
<div class="input-container flex-row">
|
|
|
- <el-input class="input-item" v-model="goods_art_no" placeholder="请输入货号"> </el-input>
|
|
|
+ <el-input class="input-item" ref="goodsArtNo" v-model="goods_art_no" placeholder="请输入货号"> </el-input>
|
|
|
|
|
|
</div>
|
|
|
<div class="auto-method flex-row justify-between">
|
|
|
@@ -78,7 +78,7 @@
|
|
|
<div>拍摄记录</div>
|
|
|
<div class="c-666 fs-12" v-if="goodsList.length" >
|
|
|
<el-button :disabled="!(runLoading || takePictureLoading)" @click="oneClickStop" v-if="configInfoStore.appModel === 1" class="input-button" type="primary" size="mini">一键停止</el-button>
|
|
|
- <el-button :disabled="runLoading || takePictureLoading" @click="delAll" class="input-button" type="primary" size="mini">一键删除</el-button>
|
|
|
+ <el-button :disabled="runLoading || takePictureLoading" @click="delAll" class="input-button" type="danger" size="mini">一键删除</el-button>
|
|
|
</div>
|
|
|
</span>
|
|
|
<img class="divider-line" referrerpolicy="no-referrer" src="@/assets/images/Photography/divider-line.png" />
|
|
|
@@ -375,7 +375,6 @@ async function runGoods(data) {
|
|
|
type: 'run_mcu',
|
|
|
data,
|
|
|
})
|
|
|
- ElMessage.success('开始拍摄,请稍后')
|
|
|
runLoading.value = true;
|
|
|
runAction.value.action = data.action
|
|
|
runAction.value.goods_art_no = data.goods_art_no
|
|
|
@@ -393,6 +392,9 @@ async function runGoods(data) {
|
|
|
ElMessage.error(result.msg)
|
|
|
runLoading.value = false
|
|
|
return;
|
|
|
+ }else{
|
|
|
+
|
|
|
+ ElMessage.success('开始拍摄,请稍后')
|
|
|
}
|
|
|
})
|
|
|
|
|
|
@@ -451,7 +453,12 @@ const del = async function(params){
|
|
|
ElMessage.info('货号删除成功')
|
|
|
getPhotoRecords()
|
|
|
if(reNosObj.value.goods_art_no){
|
|
|
- runGoods(reNosObj.value)
|
|
|
+ runGoods(
|
|
|
+ {
|
|
|
+ "action": reNosObj.value.action,
|
|
|
+ "goods_art_no":reNosObj.value.goods_art_no
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
}else if(result.msg) {
|
|
|
ElMessage.error(result.msg)
|
|
|
@@ -469,27 +476,100 @@ const reTakePicture = async (img)=>{
|
|
|
cancelButtonText: '取消',
|
|
|
})
|
|
|
|
|
|
- socketStore.sendMessage({
|
|
|
- type: 're_take_picture',
|
|
|
- "data":{"record_id":img.id},
|
|
|
- })
|
|
|
+ runLoading.value = true;
|
|
|
+ reNosObj.value.goods_art_no = img.goods_art_no
|
|
|
+ reNosObj.value.action = 're_take_picture'
|
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_re_take_picture');
|
|
|
+ let params = {
|
|
|
+ id: img.action_id
|
|
|
+ }
|
|
|
|
|
|
- clientStore.ipc.on(icpList.socket.message + '_re_take_picture', (event, result) => {
|
|
|
- console.log('_re_take_picture')
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigDetail);
|
|
|
+
|
|
|
+ clientStore.ipc.send(icpList.setting.getDeviceConfigDetail, params);
|
|
|
+
|
|
|
+
|
|
|
+ clientStore.ipc.on(icpList.setting.getDeviceConfigDetail, (event, result) => {
|
|
|
+
|
|
|
+ console.log('getDeviceConfigDetail')
|
|
|
console.log(result)
|
|
|
- if(result.code === 0){
|
|
|
- getPhotoRecords()
|
|
|
- setTimeout(()=>{
|
|
|
- showlastPhoto.value = false
|
|
|
- },6000)
|
|
|
- }else if(result.msg) {
|
|
|
+ if(result.code == 0 && result.data){
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigDetail);
|
|
|
+
|
|
|
+ this_run_mcu_single(result.data)
|
|
|
+ }else if(result.msg){
|
|
|
+ runLoading.value = false;
|
|
|
+ reNosObj.value.goods_art_no = ''
|
|
|
+ reNosObj.value.action = ''
|
|
|
ElMessage.error(result.msg)
|
|
|
}
|
|
|
- clientStore.ipc.removeAllListeners(icpList.socket.message + '_re_take_picture');
|
|
|
+ });
|
|
|
+
|
|
|
+ function this_run_mcu_single(data){
|
|
|
+
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.socket.message+'_run_mcu_single');
|
|
|
+ socketStore.sendMessage({
|
|
|
+ type: 'run_mcu_single',
|
|
|
+ data: {
|
|
|
+ camera_height: Number(data.camera_height),
|
|
|
+ camera_angle: Number(data.camera_angle),
|
|
|
+ led_switch:data.led_switch,
|
|
|
+ id:0,
|
|
|
+ mode_type:data.mode_type,
|
|
|
+ turntable_position:Number(data.turntable_position),
|
|
|
+ action_name:data.action_name || '测试',
|
|
|
+ turntable_angle: Number(data.turntable_angle),
|
|
|
+ shoe_upturn: Number(data.shoe_upturn),
|
|
|
+ action_index:1,
|
|
|
+ number_focus:0,
|
|
|
+ take_picture:false,
|
|
|
+ pre_delay:0,
|
|
|
+ after_delay:0,
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ clientStore.ipc.on(icpList.socket.message+'_run_mcu_single', async (event, result) => {
|
|
|
+ console.log('_run_mcu_single_row')
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.socket.message+'_run_mcu_single');
|
|
|
+ this_re_take_picture()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ async function this_re_take_picture(){
|
|
|
+
|
|
|
+ await ElMessageBox.alert('已复位到该视图下,请把鞋子摆放完毕之后,点击按钮开始重拍', '提示',{
|
|
|
+ confirmButtonText:"开始重拍"
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.socket.message + '_digicam_take_picture');
|
|
|
+ socketStore.sendMessage({
|
|
|
+ type: 'digicam_take_picture',
|
|
|
+ "data":{"id":img.id,"goods_art_no":img.goods_art_no},
|
|
|
+ })
|
|
|
+ clientStore.ipc.on(icpList.socket.message + '_digicam_take_picture', (event, result) => {
|
|
|
+ console.log('_digicam_take_picture')
|
|
|
+ console.log(result)
|
|
|
+
|
|
|
+ runLoading.value = false;
|
|
|
+ if(result.code === 0){
|
|
|
+ getPhotoRecords()
|
|
|
+ setTimeout(()=>{
|
|
|
+ showlastPhoto.value = false
|
|
|
+ },6000)
|
|
|
+ }else if(result.msg) {
|
|
|
+
|
|
|
+ runLoading.value = false;
|
|
|
+ reNosObj.value.goods_art_no = ''
|
|
|
+ reNosObj.value.action = ''
|
|
|
+ ElMessage.error(result.msg)
|
|
|
+ }
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.socket.message + '_digicam_take_picture');
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- })
|
|
|
}
|
|
|
|
|
|
const reNosObj = ref({
|
|
|
@@ -505,7 +585,8 @@ const reTakePictureNos = async (goods_art_no,item)=>{
|
|
|
})
|
|
|
reNosObj.value.goods_art_no = goods_art_no
|
|
|
reNosObj.value.action = '执行左脚程序'
|
|
|
- if(item.items && typeof item.items === 'object' && item.items[0].image_deal_mode){
|
|
|
+ console.log(item);
|
|
|
+ if(item.items && typeof item.items === 'object' && item.items[0].PhotoRecord.image_deal_mode){
|
|
|
reNosObj.value.action = '执行右脚程序'
|
|
|
}
|
|
|
del({goods_art_nos:[goods_art_no]})
|
|
|
@@ -537,6 +618,7 @@ const oneClickStop = ()=>{
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+const goodsArtNo = ref()
|
|
|
/**
|
|
|
* 页面挂载时初始化事件监听器并获取初始数据。
|
|
|
*/
|
|
|
@@ -548,7 +630,8 @@ onMounted(async () => {
|
|
|
if (result.code === 0 && result.data?.data) {
|
|
|
console.log(goods_art_no.value);
|
|
|
if(!goods_art_no.value){
|
|
|
- ElMessage.error('请先扫描货号或者手动输入货号!')
|
|
|
+ ElMessage.error('请在左侧第一步中,先扫描货号或者手动输入货号!')
|
|
|
+ goodsArtNo.value?.focus() // 聚焦输入框
|
|
|
return;
|
|
|
}
|
|
|
runGoods({
|
|
|
@@ -605,6 +688,19 @@ onMounted(async () => {
|
|
|
|
|
|
})
|
|
|
|
|
|
+
|
|
|
+ // 监听一键停止结束
|
|
|
+ clientStore.ipc.on(icpList.socket.message + '_run_mcu_stop', (event, result) => {
|
|
|
+ console.log('_run_mcu_stop')
|
|
|
+
|
|
|
+ runLoading.value = false;
|
|
|
+ reNosObj.value.goods_art_no = ''
|
|
|
+ reNosObj.value.action = ''
|
|
|
+ runAction.value.goods_art_no = '';
|
|
|
+ runAction.value.action = '';
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
// 监听拍照完成后的最终状态事件
|
|
|
clientStore.ipc.on(icpList.socket.message + '_photo_take_finish', (event, result) => {
|
|
|
console.log('_photo_take_finish')
|
|
|
@@ -669,7 +765,8 @@ const onRemoteControl = (type)=>{
|
|
|
|
|
|
|
|
|
if(!goods_art_no.value){
|
|
|
- ElMessage.error('请先扫描货号或者手动输入货号!')
|
|
|
+ ElMessage.error('请在左侧第一步中,先扫描货号或者手动输入货号!')
|
|
|
+ goodsArtNo.value?.focus() // 聚焦输入框
|
|
|
return;
|
|
|
}
|
|
|
let action = '执行左脚程序'
|
|
|
@@ -719,6 +816,9 @@ onBeforeUnmount(() => {
|
|
|
clientStore.ipc.removeAllListeners(icpList.socket.message + '_photo_take_finish');
|
|
|
clientStore.ipc.removeAllListeners(icpList.socket.message + '_run_mcu_update');
|
|
|
clientStore.ipc.removeAllListeners(icpList.socket.message + '_stop_action');
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.socket.message + '_run_mcu_stop');
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.socket.message + '_digicam_take_picture');
|
|
|
+
|
|
|
/* window.removeEventListener('storage', handleStorageEvent);*/
|
|
|
|
|
|
|