|
|
@@ -81,7 +81,7 @@
|
|
|
<div class="flex between flex-item c-333">
|
|
|
<div class="chaochu flex-item flex left">货号:{{ item.goods_art_no }}</div>
|
|
|
<div>
|
|
|
- <el-button size="small" type="primary" plain>重拍</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="reTakePictureNos(item.goods_art_no,item)" plain>重拍</el-button>
|
|
|
<el-button size="small" @click="delGoods({goods_art_nos:[item.goods_art_no]})">删除</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -108,7 +108,7 @@
|
|
|
<div class="image-slot"></div>
|
|
|
</template>
|
|
|
</el-image>
|
|
|
- <div class="reset-button">重拍</div>
|
|
|
+ <div class="reset-button" @click="reTakePicture(image.id)">重拍</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -195,6 +195,38 @@ const menu = computed(()=>{
|
|
|
const clientStore = client();
|
|
|
|
|
|
const Router = useRouter()
|
|
|
+/*const goodsList = ref([
|
|
|
+ {
|
|
|
+ "goods_art_no": "123456789",
|
|
|
+ "items": [
|
|
|
+ {
|
|
|
+ "record_id":1,
|
|
|
+ "image_deal_mode":0,
|
|
|
+ "image_path": "C:\\Users\\Administrator\\Pictures\\digiCamControl\\Session1\\DSC_0001.jpg",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "record_id":2,
|
|
|
+ "image_deal_mode":0,
|
|
|
+ "image_path": "C:\\Users\\Administrator\\Pictures\\digiCamControl\\Session1\\DSC_0002.jpg",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "record_id":3,
|
|
|
+ "image_deal_mode":0,
|
|
|
+ "image_path": "C:\\Users\\Administrator\\Pictures\\digiCamControl\\Session1\\DSC_0003.jpg",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "record_id":4,
|
|
|
+ "image_deal_mode":0,
|
|
|
+ "image_path": "C:\\Users\\Administrator\\Pictures\\digiCamControl\\Session1\\DSC_0004.jpg",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "record_id":5,
|
|
|
+ "image_deal_mode":0,
|
|
|
+ "image_path": "C:\\Users\\Administrator\\Pictures\\digiCamControl\\Session1\\DSC_0005.jpg",
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+])*/
|
|
|
const goodsList = ref([])
|
|
|
const goods_art_no_tpl = ref('')
|
|
|
const goods_art_no = ref('')
|
|
|
@@ -245,6 +277,11 @@ async function getPhotoRecords(params?:{}) {
|
|
|
* @param data - 包含拍摄所需的数据对象。
|
|
|
*/
|
|
|
async function runGoods(data) {
|
|
|
+ if(runLoading.value || takePictureLoading.value){
|
|
|
+ ElMessage.error('拍摄程序正在运行,请稍候')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
await socketStore.connectSocket();
|
|
|
|
|
|
socketStore.sendMessage({
|
|
|
@@ -256,7 +293,8 @@ async function runGoods(data) {
|
|
|
runAction.value = data
|
|
|
goods_art_no.value = ''
|
|
|
goods_art_no_tpl.value = ''
|
|
|
-
|
|
|
+ reNosObj.value.goods_art_no = null;
|
|
|
+ reNosObj.value.action = null;
|
|
|
|
|
|
clientStore.ipc.on(icpList.socket.message + '_run_mcu', (event, result) => {
|
|
|
|
|
|
@@ -265,7 +303,7 @@ async function runGoods(data) {
|
|
|
console.log(result);
|
|
|
if(result.code !== 0 && result.msg){
|
|
|
ElMessage.error(result.msg)
|
|
|
- runLoading.value = false
|
|
|
+ // runLoading.value = false
|
|
|
return;
|
|
|
}
|
|
|
})
|
|
|
@@ -322,6 +360,9 @@ const del = async function(params){
|
|
|
if(result.code === 0){
|
|
|
ElMessage.info('货号删除成功')
|
|
|
getPhotoRecords()
|
|
|
+ if(reNosObj.value.goods_art_no){
|
|
|
+ runGoods(reNosObj.value)
|
|
|
+ }
|
|
|
}else if(result.msg) {
|
|
|
ElMessage.error(result.msg)
|
|
|
}
|
|
|
@@ -329,6 +370,54 @@ const del = async function(params){
|
|
|
|
|
|
}
|
|
|
|
|
|
+//单个重拍
|
|
|
+
|
|
|
+const reTakePicture = async (record_id)=>{
|
|
|
+ if(!record_id) return;
|
|
|
+ await ElMessageBox.confirm('此操作会先删除此数据,需要继续吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ })
|
|
|
+
|
|
|
+ socketStore.sendMessage({
|
|
|
+ type: 're_take_picture',
|
|
|
+ "data":{"record_id":record_id},
|
|
|
+ })
|
|
|
+
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.socket.message + '_re_take_picture');
|
|
|
+
|
|
|
+ clientStore.ipc.on(icpList.socket.message + '_re_take_picture', (event, result) => {
|
|
|
+ console.log('_re_take_picture')
|
|
|
+ console.log(result)
|
|
|
+ if(result.code === 0){
|
|
|
+ getPhotoRecords()
|
|
|
+ }else if(result.msg) {
|
|
|
+ ElMessage.error(result.msg)
|
|
|
+ }
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.socket.message + '_re_take_picture');
|
|
|
+
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const reNosObj = ref({
|
|
|
+ goods_art_no:null,
|
|
|
+ action:null,
|
|
|
+})
|
|
|
+//货号重拍
|
|
|
+const reTakePictureNos = async (goods_art_no,item)=>{
|
|
|
+
|
|
|
+ await ElMessageBox.confirm('此操作会先删除删除货号:'+goods_art_no+'的拍摄数据吗,需要继续吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ })
|
|
|
+ reNosObj.value.goods_art_no = goods_art_no
|
|
|
+ reNosObj.value.action = '执行左脚程序'
|
|
|
+ if(item.items && typeof item.items === 'object' && item.items[0].image_deal_mode){
|
|
|
+ reNosObj.value.action = '执行右脚程序'
|
|
|
+ }
|
|
|
+ del({goods_art_nos:[goods_art_no]})
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 检查是否可以进入下一步操作。
|
|
|
*/
|