|
@@ -68,12 +68,33 @@
|
|
|
</van-form>
|
|
</van-form>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="skuDeatil">
|
|
<div class="skuDeatil">
|
|
|
- <div class="headline" style="margin-top: 10px">
|
|
|
|
|
- <span class="headlineIcon"></span>
|
|
|
|
|
- <span class="headlineTitle">SKU图像识别结果</span>
|
|
|
|
|
|
|
+ <div class="headline" style="margin-top: 10px; justify-content: space-between">
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="skuDeatilHeaderLeft"
|
|
|
|
|
+ style="
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ ">
|
|
|
|
|
+ <span class="headlineIcon"></span>
|
|
|
|
|
+ <span class="headlineTitle">SKU图像识别结果</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="skuDeatilHeaderRight"
|
|
|
|
|
+ v-if="!formData.displayRewardTaskEditable"
|
|
|
|
|
+ style="margin-right: 72px">
|
|
|
|
|
+ <van-button plain type="primary" @click="editTable" v-if="!editTableFlag"
|
|
|
|
|
+ >编辑</van-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <van-button type="primary" @click="saveTable" v-if="editTableFlag">保存</van-button>
|
|
|
|
|
+ <!-- <span style="color: #07c160" @click="editTable" v-if="!editTableFlag">编辑</span>
|
|
|
|
|
+ <span style="color: red" @click="saveTable" v-if="editTableFlag">保存</span> -->
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<el-table
|
|
<el-table
|
|
|
- :data="formData.taskPhotoRecognitionResult"
|
|
|
|
|
|
|
+ :data="taskPhotoRecognitionResult"
|
|
|
:span-method="taskObjectSpanMethod"
|
|
:span-method="taskObjectSpanMethod"
|
|
|
border
|
|
border
|
|
|
class="table-headermd1"
|
|
class="table-headermd1"
|
|
@@ -89,11 +110,18 @@
|
|
|
<span class="tipTitle">{{ scope.row.skuProductName }}</span>
|
|
<span class="tipTitle">{{ scope.row.skuProductName }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
|
|
- label="排面数"
|
|
|
|
|
- prop="identifyTheNumberOfCards"
|
|
|
|
|
- align="center"
|
|
|
|
|
- width="50"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column label="排面数" prop="identifyTheNumberOfCards" align="center" width="80">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span v-if="!editTableFlag">{{ scope.row.identifyTheNumberOfCards }}</span>
|
|
|
|
|
+ <van-field
|
|
|
|
|
+ v-else
|
|
|
|
|
+ v-model="scope.row.identifyTheNumberOfCards"
|
|
|
|
|
+ placeholder="请输入排面数"
|
|
|
|
|
+ type="digit"
|
|
|
|
|
+ @input="onPositiveIntegerInput(scope.row, $event)"
|
|
|
|
|
+ @blur="inputbluwl(scope.row)" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="要求" prop="conditionIdentifyNum" align="center" width="60px">
|
|
<el-table-column label="要求" prop="conditionIdentifyNum" align="center" width="60px">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span
|
|
<span
|
|
@@ -138,13 +166,10 @@
|
|
|
@close="vanPopup == false"
|
|
@close="vanPopup == false"
|
|
|
custom-class="identifyResultdialog">
|
|
custom-class="identifyResultdialog">
|
|
|
<!-- 识别结果 -->
|
|
<!-- 识别结果 -->
|
|
|
- <div
|
|
|
|
|
- class="identifyResult"
|
|
|
|
|
- v-if="formData.taskPhotoRecognitionResult"
|
|
|
|
|
- style="padding: 0 10px">
|
|
|
|
|
|
|
+ <div class="identifyResult" v-if="taskPhotoRecognitionResult" style="padding: 0 10px">
|
|
|
<div class="resultContent">
|
|
<div class="resultContent">
|
|
|
<el-table
|
|
<el-table
|
|
|
- :data="formData.taskPhotoRecognitionResult"
|
|
|
|
|
|
|
+ :data="taskPhotoRecognitionResult"
|
|
|
:span-method="taskObjectSpanMethod"
|
|
:span-method="taskObjectSpanMethod"
|
|
|
border
|
|
border
|
|
|
class="table-headermd1"
|
|
class="table-headermd1"
|
|
@@ -175,6 +200,7 @@ import {
|
|
|
addCollectionAnswerBatch,
|
|
addCollectionAnswerBatch,
|
|
|
getVisitsDetailPerfectStore,
|
|
getVisitsDetailPerfectStore,
|
|
|
getVisitsDetailPerfectStoreByTaskId,
|
|
getVisitsDetailPerfectStoreByTaskId,
|
|
|
|
|
+ updateDisplayRewardCaseSkuCount,
|
|
|
} from '@/api/index';
|
|
} from '@/api/index';
|
|
|
import taskTips from '@/views/deviceWithin/taskTips';
|
|
import taskTips from '@/views/deviceWithin/taskTips';
|
|
|
import deleteUploadImg from '@/components/deleteUploadImgTaskPhoto';
|
|
import deleteUploadImg from '@/components/deleteUploadImgTaskPhoto';
|
|
@@ -195,6 +221,8 @@ export default {
|
|
|
vanPopup: false,
|
|
vanPopup: false,
|
|
|
taskPhotoRecognitionResult: null,
|
|
taskPhotoRecognitionResult: null,
|
|
|
spanArr: [],
|
|
spanArr: [],
|
|
|
|
|
+ editTableFlag: false,
|
|
|
|
|
+ editCountArr: [],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
activated() {
|
|
activated() {
|
|
@@ -204,6 +232,7 @@ export default {
|
|
|
this.objectType = this.$route.query.photoType || '';
|
|
this.objectType = this.$route.query.photoType || '';
|
|
|
this.insert = this.$route.query.insert;
|
|
this.insert = this.$route.query.insert;
|
|
|
this.formData = null;
|
|
this.formData = null;
|
|
|
|
|
+ this.editCountArr = [];
|
|
|
this.getVisitsDetailFun();
|
|
this.getVisitsDetailFun();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -247,8 +276,9 @@ export default {
|
|
|
this.toastLoading().clear();
|
|
this.toastLoading().clear();
|
|
|
if (res.code == 200 && res.data && res.data.length > 0) {
|
|
if (res.code == 200 && res.data && res.data.length > 0) {
|
|
|
this.formData = res.data[0];
|
|
this.formData = res.data[0];
|
|
|
- console.log(this.formData.taskPhotoRecognitionResult);
|
|
|
|
|
- this.getSpanArr(this.formData.taskPhotoRecognitionResult);
|
|
|
|
|
|
|
+ this.taskPhotoRecognitionResult =
|
|
|
|
|
+ JSON.parse(JSON.stringify(this.formData.taskPhotoRecognitionResult)) || [];
|
|
|
|
|
+ this.getSpanArr(this.taskPhotoRecognitionResult);
|
|
|
console.log(this.formData);
|
|
console.log(this.formData);
|
|
|
} else {
|
|
} else {
|
|
|
this.formData = null;
|
|
this.formData = null;
|
|
@@ -289,6 +319,85 @@ export default {
|
|
|
startPosition: index,
|
|
startPosition: index,
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ inputbluwl(row) {
|
|
|
|
|
+ let filteredResults = this.formData.taskPhotoRecognitionResult.filter(
|
|
|
|
|
+ (val) => val.skuProductCode == row.skuProductCode,
|
|
|
|
|
+ );
|
|
|
|
|
+ if (row.identifyTheNumberOfCards != null && row.identifyTheNumberOfCards !== '') {
|
|
|
|
|
+ const original = Number(filteredResults[0]?.identifyTheNumberOfCards || '0');
|
|
|
|
|
+ const current = Number(row.identifyTheNumberOfCards);
|
|
|
|
|
+ if (current < original) {
|
|
|
|
|
+ this.$toast('排面数不能小于原始值');
|
|
|
|
|
+ row.identifyTheNumberOfCards = String(original);
|
|
|
|
|
+ const existingIndex = this.editCountArr.findIndex(
|
|
|
|
|
+ (item) => item.skuProductCode === row.skuProductCode,
|
|
|
|
|
+ );
|
|
|
|
|
+ if (existingIndex >= 0) {
|
|
|
|
|
+ this.editCountArr.splice(existingIndex, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const editCount = current - original;
|
|
|
|
|
+ if (editCount > 0) {
|
|
|
|
|
+ const existingIndex = this.editCountArr.findIndex(
|
|
|
|
|
+ (item) => item.skuProductCode === row.skuProductCode,
|
|
|
|
|
+ );
|
|
|
|
|
+ if (existingIndex >= 0) {
|
|
|
|
|
+ this.editCountArr[existingIndex].editCount = editCount;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.editCountArr.push({
|
|
|
|
|
+ taskId: row.taskId, // Long 任务id
|
|
|
|
|
+ visitId: row.visitId, // Long 拜访id
|
|
|
|
|
+ skuProductCode: row.skuProductCode, // String 产品code
|
|
|
|
|
+ editCount,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (editCount === 0) {
|
|
|
|
|
+ const existingIndex = this.editCountArr.findIndex(
|
|
|
|
|
+ (item) => item.skuProductCode === row.skuProductCode,
|
|
|
|
|
+ );
|
|
|
|
|
+ if (existingIndex >= 0) {
|
|
|
|
|
+ this.editCountArr.splice(existingIndex, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$toast('排面数不能为空');
|
|
|
|
|
+ row.identifyTheNumberOfCards = filteredResults[0]?.identifyTheNumberOfCards;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onPositiveIntegerInput(row, value) {
|
|
|
|
|
+ if (value == null) {
|
|
|
|
|
+ row.identifyTheNumberOfCards = '';
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let sanitized = String(value).replace(/[^\d]/g, '');
|
|
|
|
|
+ if (sanitized !== '') {
|
|
|
|
|
+ sanitized = sanitized.replace(/^0+/, '');
|
|
|
|
|
+ if (sanitized === '') {
|
|
|
|
|
+ sanitized = '0';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ row.identifyTheNumberOfCards = sanitized;
|
|
|
|
|
+ },
|
|
|
|
|
+ editTable() {
|
|
|
|
|
+ this.editTableFlag = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ saveTable() {
|
|
|
|
|
+ console.log(this.editCountArr);
|
|
|
|
|
+ if (this.editCountArr.length == 0) {
|
|
|
|
|
+ // this.$toast('请至少修改一项排面数');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ updateDisplayRewardCaseSkuCount(this.editCountArr).then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$toast('修改成功');
|
|
|
|
|
+ this.getVisitsDetailFun();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$toast(res.message || '修改失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ this.editTableFlag = false;
|
|
|
|
|
+ },
|
|
|
onClickLeft() {
|
|
onClickLeft() {
|
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|
|
|
},
|
|
},
|
|
@@ -448,6 +557,18 @@ export default {
|
|
|
background-color: #ee0a24 !important;
|
|
background-color: #ee0a24 !important;
|
|
|
border: 1px solid #ee0a24 !important;
|
|
border: 1px solid #ee0a24 !important;
|
|
|
}
|
|
}
|
|
|
|
|
+ .table-headermd1 {
|
|
|
|
|
+ .el-table__cell {
|
|
|
|
|
+ height: 50px !important;
|
|
|
|
|
+ .van-field {
|
|
|
|
|
+ padding: 0 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ .van-field__control {
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.identifyResultdialog {
|
|
.identifyResultdialog {
|
|
|
width: vw(690) !important;
|
|
width: vw(690) !important;
|
|
@@ -526,4 +647,20 @@ export default {
|
|
|
.el-table::before {
|
|
.el-table::before {
|
|
|
height: 0;
|
|
height: 0;
|
|
|
}
|
|
}
|
|
|
|
|
+.skuDeatilHeaderRight {
|
|
|
|
|
+ button {
|
|
|
|
|
+ // width: 120px;
|
|
|
|
|
+ height: 36px;
|
|
|
|
|
+ border-radius: 18px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .van-button--primary {
|
|
|
|
|
+ background-color: #2b73cf;
|
|
|
|
|
+ border-color: #2b73cf;
|
|
|
|
|
+ }
|
|
|
|
|
+ .van-button--primary.van-button--plain {
|
|
|
|
|
+ color: #3875c6;
|
|
|
|
|
+ border-color: #dcdfe6;
|
|
|
|
|
+ background-color: rgba(217, 233, 255, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|