|
|
@@ -68,12 +68,33 @@
|
|
|
</van-form>
|
|
|
</div>
|
|
|
<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>
|
|
|
<el-table
|
|
|
- :data="formData.taskPhotoRecognitionResult"
|
|
|
+ :data="taskPhotoRecognitionResult"
|
|
|
:span-method="taskObjectSpanMethod"
|
|
|
border
|
|
|
class="table-headermd1"
|
|
|
@@ -89,11 +110,31 @@
|
|
|
<span class="tipTitle">{{ scope.row.skuProductName }}</span>
|
|
|
</template>
|
|
|
</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"
|
|
|
+ :class="{ shelfEdit: scope.row.shelfEdit == 1, identifyTheNumber: true }"
|
|
|
+ >{{ scope.row.identifyTheNumberOfCards }}
|
|
|
+ </span>
|
|
|
+ <span v-else-if="!editTableFlag" class="identifyTheNumber">
|
|
|
+ {{ scope.row.identifyTheNumberOfCards }}
|
|
|
+ </span>
|
|
|
+ <van-field
|
|
|
+ v-else
|
|
|
+ :class="{
|
|
|
+ shelfEdit: scope.row.shelfEdit == 1,
|
|
|
+ identifyTheNumber: true,
|
|
|
+ isEdit: scope.row.identifyTheNumberOfCards > '0',
|
|
|
+ }"
|
|
|
+ v-model="scope.row.identifyTheNumberOfCards"
|
|
|
+ placeholder="请输入排面数"
|
|
|
+ type="digit"
|
|
|
+ :disabled="scope.row.identifyTheNumberOfCards == '0'"
|
|
|
+ @input="onPositiveIntegerInput(scope.row, $event)"
|
|
|
+ @blur="inputbluwl(scope.row)" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="要求" prop="conditionIdentifyNum" align="center" width="60px">
|
|
|
<template slot-scope="scope">
|
|
|
<span
|
|
|
@@ -138,13 +179,10 @@
|
|
|
@close="vanPopup == false"
|
|
|
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">
|
|
|
<el-table
|
|
|
- :data="formData.taskPhotoRecognitionResult"
|
|
|
+ :data="taskPhotoRecognitionResult"
|
|
|
:span-method="taskObjectSpanMethod"
|
|
|
border
|
|
|
class="table-headermd1"
|
|
|
@@ -175,6 +213,7 @@ import {
|
|
|
addCollectionAnswerBatch,
|
|
|
getVisitsDetailPerfectStore,
|
|
|
getVisitsDetailPerfectStoreByTaskId,
|
|
|
+ updateDisplayRewardCaseSkuCount,
|
|
|
} from '@/api/index';
|
|
|
import taskTips from '@/views/deviceWithin/taskTips';
|
|
|
import deleteUploadImg from '@/components/deleteUploadImgTaskPhoto';
|
|
|
@@ -195,6 +234,8 @@ export default {
|
|
|
vanPopup: false,
|
|
|
taskPhotoRecognitionResult: null,
|
|
|
spanArr: [],
|
|
|
+ editTableFlag: false,
|
|
|
+ editCountArr: [],
|
|
|
};
|
|
|
},
|
|
|
activated() {
|
|
|
@@ -204,6 +245,8 @@ export default {
|
|
|
this.objectType = this.$route.query.photoType || '';
|
|
|
this.insert = this.$route.query.insert;
|
|
|
this.formData = null;
|
|
|
+ this.editCountArr = [];
|
|
|
+ this.editTableFlag = false;
|
|
|
this.getVisitsDetailFun();
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -247,8 +290,9 @@ export default {
|
|
|
this.toastLoading().clear();
|
|
|
if (res.code == 200 && res.data && res.data.length > 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);
|
|
|
} else {
|
|
|
this.formData = null;
|
|
|
@@ -289,6 +333,86 @@ export default {
|
|
|
startPosition: index,
|
|
|
});
|
|
|
},
|
|
|
+ inputbluwl(row) {
|
|
|
+ let filteredResults = this.formData.taskPhotoRecognitionResult.filter(
|
|
|
+ (val) => val.skuProductCode == row.skuProductCode,
|
|
|
+ );
|
|
|
+ if (row.rawIdentifyNum != null && row.rawIdentifyNum !== '') {
|
|
|
+ const original = Number(filteredResults[0]?.rawIdentifyNum || '0'); //原始值
|
|
|
+ const activeOriginal = Number(filteredResults[0]?.identifyTheNumberOfCards || '0'); //上一次修改后的值
|
|
|
+ const current = Number(row.identifyTheNumberOfCards); //当前输入的值
|
|
|
+ if (current < original) {
|
|
|
+ this.$toast('排面数不能小于原始值');
|
|
|
+ row.identifyTheNumberOfCards = String(activeOriginal);
|
|
|
+ const existingIndex = this.editCountArr.findIndex(
|
|
|
+ (item) => item.skuProductCode === row.skuProductCode,
|
|
|
+ );
|
|
|
+ if (existingIndex >= 0) {
|
|
|
+ this.editCountArr.splice(existingIndex, 1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ const editCount = current - activeOriginal; //本次修改的值
|
|
|
+ if (editCount === 0) {
|
|
|
+ const existingIndex = this.editCountArr.findIndex(
|
|
|
+ (item) => item.skuProductCode === row.skuProductCode,
|
|
|
+ );
|
|
|
+ if (existingIndex >= 0) {
|
|
|
+ this.editCountArr.splice(existingIndex, 1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ 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 {
|
|
|
+ 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() {
|
|
|
this.$router.go(-1);
|
|
|
},
|
|
|
@@ -448,54 +572,58 @@ export default {
|
|
|
background-color: #ee0a24 !important;
|
|
|
border: 1px solid #ee0a24 !important;
|
|
|
}
|
|
|
-}
|
|
|
-.identifyResultdialog {
|
|
|
- width: vw(690) !important;
|
|
|
- margin-top: 1vh !important;
|
|
|
- border-radius: 8px !important;
|
|
|
- font-size: vw(32) !important;
|
|
|
- height: 70% !important;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- .el-dialog__headerbtn {
|
|
|
- width: vw(44);
|
|
|
- height: vw(44);
|
|
|
- background-color: #e1e1e1;
|
|
|
- border-radius: 50%;
|
|
|
- margin-top: -3px;
|
|
|
+ .table-headermd1 {
|
|
|
+ .el-table__cell {
|
|
|
+ height: 50px !important;
|
|
|
+ .van-field {
|
|
|
+ padding: 0 !important;
|
|
|
+ }
|
|
|
+ .van-field__control {
|
|
|
+ height: 32px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- .el-dialog__body {
|
|
|
- flex: 1;
|
|
|
- overflow-y: auto;
|
|
|
+ .shelfEdit {
|
|
|
+ height: 100%;
|
|
|
+ color: #036bf3;
|
|
|
+ .van-field__body {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ input {
|
|
|
+ height: 100%;
|
|
|
+ color: #036bf3;
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
-.table-headermd1 {
|
|
|
- font-size: 14px;
|
|
|
- text-align: center;
|
|
|
- position: initial;
|
|
|
- width: 98% !important;
|
|
|
- margin: 0 auto;
|
|
|
- border-right: 0;
|
|
|
- border-radius: 8px;
|
|
|
- th {
|
|
|
- color: #000;
|
|
|
- font-weight: bold;
|
|
|
+ .identifyTheNumber {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
- td {
|
|
|
- color: #000;
|
|
|
+ .isEdit {
|
|
|
+ border: 1px solid #609de8;
|
|
|
}
|
|
|
- .el-table__cell {
|
|
|
- padding: 6px 0 !important;
|
|
|
- .cell {
|
|
|
- padding: 0;
|
|
|
+ .identifyResultdialog {
|
|
|
+ width: vw(690) !important;
|
|
|
+ margin-top: 1vh !important;
|
|
|
+ border-radius: 8px !important;
|
|
|
+ font-size: vw(32) !important;
|
|
|
+ height: 70% !important;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ .el-dialog__headerbtn {
|
|
|
+ width: vw(44);
|
|
|
+ height: vw(44);
|
|
|
+ background-color: #e1e1e1;
|
|
|
+ border-radius: 50%;
|
|
|
+ margin-top: -3px;
|
|
|
+ }
|
|
|
+ .el-dialog__body {
|
|
|
+ flex: 1;
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
-.skuDeatil {
|
|
|
- width: 100%;
|
|
|
- margin-top: 10px;
|
|
|
- background: #fff;
|
|
|
- border-radius: 6px;
|
|
|
.table-headermd1 {
|
|
|
font-size: 14px;
|
|
|
text-align: center;
|
|
|
@@ -504,7 +632,6 @@ export default {
|
|
|
margin: 0 auto;
|
|
|
border-right: 0;
|
|
|
border-radius: 8px;
|
|
|
- margin-top: 10px;
|
|
|
th {
|
|
|
color: #000;
|
|
|
font-weight: bold;
|
|
|
@@ -513,17 +640,64 @@ export default {
|
|
|
color: #000;
|
|
|
}
|
|
|
.el-table__cell {
|
|
|
- padding: 6px 0 !important;
|
|
|
+ padding: 0 !important;
|
|
|
.cell {
|
|
|
+ height: 100%;
|
|
|
padding: 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .table-headermd1 th.el-table__cell {
|
|
|
- background-color: #f5f5f5;
|
|
|
+ .skuDeatil {
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 10px;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 6px;
|
|
|
+ .table-headermd1 {
|
|
|
+ font-size: 14px;
|
|
|
+ text-align: center;
|
|
|
+ position: initial;
|
|
|
+ width: 98% !important;
|
|
|
+ margin: 0 auto;
|
|
|
+ border-right: 0;
|
|
|
+ border-radius: 8px;
|
|
|
+ margin-top: 10px;
|
|
|
+ th {
|
|
|
+ color: #000;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ td {
|
|
|
+ color: #000;
|
|
|
+ }
|
|
|
+ .el-table__cell {
|
|
|
+ padding: 0 !important;
|
|
|
+ .cell {
|
|
|
+ height: 100%;
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .table-headermd1 th.el-table__cell {
|
|
|
+ background-color: #f5f5f5;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.el-table::before {
|
|
|
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>
|