|
|
@@ -62,6 +62,11 @@
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="last-photo" v-show="showlastPhoto" v-key="lastPhoto.image_path">
|
|
|
+ <div>{{lastPhtotoName[lastPhoto.image_index] || ''}}</div>
|
|
|
+ <el-image :src="getFilePath(lastPhoto.image_path)" fit="contain" ></el-image>
|
|
|
+ </div>
|
|
|
<div class="history-section flex-col">
|
|
|
<span class="history-title flex between">
|
|
|
<div>拍摄记录</div>
|
|
|
@@ -266,6 +271,12 @@ async function getPhotoRecords(params?:{}) {
|
|
|
clientStore.ipc.removeAllListeners(icpList.takePhoto.getPhotoRecords);
|
|
|
if(result.code === 0){
|
|
|
goodsList.value = result.data.list
|
|
|
+ if(isDelGoodsGetList.value){
|
|
|
+ isDelGoodsGetList.value = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ getLastPhotoRecord()
|
|
|
+
|
|
|
}else if(result.msg) {
|
|
|
ElMessage.error(result.msg)
|
|
|
}
|
|
|
@@ -290,6 +301,7 @@ async function runGoods(data) {
|
|
|
})
|
|
|
ElMessage.success('开始拍摄,请稍后')
|
|
|
runLoading.value = true;
|
|
|
+ console.log(runAction.value);
|
|
|
runAction.value = data
|
|
|
goods_art_no.value = ''
|
|
|
goods_art_no_tpl.value = ''
|
|
|
@@ -351,6 +363,7 @@ const delGoods = async function(params){
|
|
|
* 删除指定的商品货号。
|
|
|
* @param params - 包含需要删除的货号列表的对象。
|
|
|
*/
|
|
|
+const isDelGoodsGetList = ref(false)
|
|
|
const del = async function(params){
|
|
|
|
|
|
clientStore.ipc.removeAllListeners(icpList.takePhoto.delectGoodsArts);
|
|
|
@@ -358,6 +371,7 @@ const del = async function(params){
|
|
|
clientStore.ipc.on(icpList.takePhoto.delectGoodsArts, (event, result) => {
|
|
|
clientStore.ipc.removeAllListeners(icpList.takePhoto.delectGoodsArts);
|
|
|
if(result.code === 0){
|
|
|
+ isDelGoodsGetList.value =true
|
|
|
ElMessage.info('货号删除成功')
|
|
|
getPhotoRecords()
|
|
|
if(reNosObj.value.goods_art_no){
|
|
|
@@ -391,6 +405,9 @@ const reTakePicture = async (record_id)=>{
|
|
|
console.log(result)
|
|
|
if(result.code === 0){
|
|
|
getPhotoRecords()
|
|
|
+ setTimeout(()=>{
|
|
|
+ showlastPhoto.value = false
|
|
|
+ },6000)
|
|
|
}else if(result.msg) {
|
|
|
ElMessage.error(result.msg)
|
|
|
}
|
|
|
@@ -489,13 +506,18 @@ onMounted(async () => {
|
|
|
clientStore.ipc.on(icpList.socket.message + '_photo_take_finish', (event, result) => {
|
|
|
console.log('_photo_take_finish')
|
|
|
console.log(result)
|
|
|
- if(result.code === 0) runLoading.value = false;
|
|
|
+ if(result.code === 0) {
|
|
|
+ runLoading.value = false;
|
|
|
+ setTimeout(()=>{
|
|
|
+ showlastPhoto.value = false
|
|
|
+ },5000)
|
|
|
+ }
|
|
|
|
|
|
})
|
|
|
|
|
|
// 监听手动触发拍照事件
|
|
|
clientStore.ipc.on(icpList.socket.message + '_handler_take_picture', async (event, result) => {
|
|
|
- console.log('_photo_take_finish')
|
|
|
+ console.log('_handler_take_picture')
|
|
|
console.log(result)
|
|
|
if(result.code === 0){
|
|
|
if(runLoading.value || takePictureLoading.value){
|
|
|
@@ -523,6 +545,21 @@ onMounted(async () => {
|
|
|
|
|
|
|
|
|
const onRemoteControl = (type)=>{
|
|
|
+ if(type == 'take_picture'){
|
|
|
+
|
|
|
+ if(runLoading.value || takePictureLoading.value){
|
|
|
+ ElMessage.error('拍摄程序正在运行,请稍候')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ ElMessage.success('正在拍摄中,请稍候')
|
|
|
+ socketStore.sendMessage({
|
|
|
+ type: 'handler_take_picture',
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if(!goods_art_no.value){
|
|
|
ElMessage.error('请先扫描货号或者手动输入货号!')
|
|
|
return;
|
|
|
@@ -577,6 +614,40 @@ onBeforeUnmount(() => {
|
|
|
|
|
|
})
|
|
|
|
|
|
+/*
|
|
|
+* 打开最近一张拍摄图
|
|
|
+* */
|
|
|
+const lastPhoto = ref({})
|
|
|
+const showlastPhoto = ref(false)
|
|
|
+const lastPhtotoName = ref({
|
|
|
+ 0:"俯视图",
|
|
|
+ 1:"侧视图",
|
|
|
+ 2:"后视图",
|
|
|
+ 3:"鞋底",
|
|
|
+ 4:"内里",
|
|
|
+})
|
|
|
+const getLastPhotoRecord = async ()=>{
|
|
|
+ if(goodsList.value && goodsList.value.length === 0) return;
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.takePhoto.getLastPhotoRecord);
|
|
|
+ clientStore.ipc.send(icpList.takePhoto.getLastPhotoRecord,);
|
|
|
+
|
|
|
+ clientStore.ipc.on(icpList.takePhoto.getLastPhotoRecord, (event, result) => {
|
|
|
+ console.log('getLastPhotoRecord')
|
|
|
+ console.log(result)
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.takePhoto.getLastPhotoRecord);
|
|
|
+ if(result.code === 0){
|
|
|
+ if(lastPhoto.value.image_path){
|
|
|
+ if( lastPhoto.value.image_path == result.data.image_path) return;
|
|
|
+ showlastPhoto.value = true
|
|
|
+ }
|
|
|
+ lastPhoto.value = result.data
|
|
|
+ }else if(result.msg) {
|
|
|
+ ElMessage.error(result.msg)
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 打开主图详情页面。
|
|
|
*/
|
|
|
@@ -1049,9 +1120,9 @@ function openPhotographyDetail() {
|
|
|
height: 1px;
|
|
|
margin-top: 9px;
|
|
|
}
|
|
|
+ width: 100%;
|
|
|
|
|
|
.history-warp {
|
|
|
- width: 100%;
|
|
|
flex-grow: 1;
|
|
|
overflow: auto;
|
|
|
height: calc(100% - 125px);
|
|
|
@@ -1190,6 +1261,13 @@ function openPhotographyDetail() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.last-photo{
|
|
|
+ position: fixed;
|
|
|
+ left: 20px;
|
|
|
+ top: 50px;
|
|
|
+ bottom: 20px;
|
|
|
+ right: 350px;
|
|
|
+ z-index: 10;
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|