| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382 |
- <template>
- <div class="taskPhotoTaking">
- <van-nav-bar class="navBar" left-arrow title="生动化陈列" @click-left="onClickLeft">
- <template #right>
- <span
- v-if="isEdit && insert == '1'"
- @click="onSubmit"
- style="
- color: white;
- background: rgb(0, 87, 186);
- display: block;
- padding: 6px 10px;
- border-radius: 6px;
- "
- >保存</span
- >
- </template>
- </van-nav-bar>
- <div class="content" v-if="formData">
- <div class="container">
- <van-form ref="tabstoreVal">
- <div v-for="(item, index) in formData.collectionItemList" :key="index">
- <div v-if="item.answerType == 'zp'" class="formLabel z-cell">
- <van-cell>
- <template #title>
- <!-- <span v-if="item.isMust == 0" class="van-f-red">*</span> -->
- <div class="headline">
- <span class="headlineIcon"></span>
- <span class="headlineTitle">上传照片</span>
- </div>
- <!-- 操作说明图片和电话 -->
- <taskTips
- v-if="item.contactPhone || item.examplePhoto"
- :contactPhone="item.contactPhone"
- :examplePhoto="item.examplePhoto">
- </taskTips>
- </template>
- </van-cell>
- <deleteUploadImg
- :imgs="item.fileInfoList"
- :storeGroupId="storeGroupId"
- :taskIds="taskIds"
- :visitsId="visitsId"
- :collectionItemId="item.collectionId"
- :putInCode="formData.putInCode"
- :photoIdentifyType="formData.photoIdentifyType"
- @upDataDetail="getDetaile"
- :pictureSource="item.pictureSource"
- :continuousShoot="item.continuousShoot"
- :insert="insert"
- :objectType="objectType"></deleteUploadImg>
- </div>
- </div>
- </van-form>
- </div>
- <div class="dataList" v-if="dataList">
- <div class="headline" style="margin-top: 10px">
- <span class="headlineIcon"></span>
- <span class="headlineTitle">门店参与的陈列任务要求</span>
- </div>
- <div class="dataItem" v-for="(item, index) in dataList">
- <div class="itemTop">
- <div class="itemIndex">
- <p>{{ index + 1 }}、</p>
- </div>
- <div class="itemHtml" v-html="item.displayInstructions"></div>
- </div>
- <div class="itemBottom" v-if="insert == '0'">
- <img
- @click="openDialog(item)"
- :src="
- item.taskPhotoConditionPassed == 1
- ? require('@/assets/taskPhotoSu.png')
- : require('@/assets/taskPhotoErr.png')
- " />
- </div>
- </div>
- </div>
- </div>
- <el-dialog
- title="识别结果"
- :visible.sync="vanPopup"
- width="80%"
- :append-to-body="true"
- :close-on-click-modal="false"
- @close="vanPopup == false"
- custom-class="identifyResultdialog">
- <!-- 识别结果 -->
- <div class="identifyResult" v-if="taskPhotoRecognitionResult" style="padding: 0 10px">
- <div class="resultContent">
- <el-table
- :data="taskPhotoRecognitionResult"
- border
- class="table-headermd1"
- style="width: 100%">
- <el-table-column label="" type="index" width="50px" align="center" />
- <el-table-column label="产品" prop="skuProductName" align="center" />
- <el-table-column label="要求" prop="conditionIdentifyNum" align="center" width="60px">
- </el-table-column>
- <el-table-column
- label="识别排面数"
- prop="identifyTheNumberOfCards"
- width="70px"
- align="center"
- >meetTheStandard
- <template slot-scope="scope">
- <span :style="{ color: scope.row.meetTheStandard == 1 ? '#07c160' : 'red' }">
- {{ scope.row.identifyTheNumberOfCards }}
- </span>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { getCollectionInfosBatch, addCollectionAnswerBatch, getVisitsDetail } from '@/api/index';
- import taskTips from './taskTips';
- import deleteUploadImg from '@/components/deleteUploadImgTaskPhoto';
- export default {
- name: 'abnortaskPhotoTakingmalVisit',
- components: { taskTips, deleteUploadImg },
- data() {
- return {
- isEdit: true,
- formData: null,
- dataList: null,
- taskIds: [],
- visitsId: null,
- storeGroupId: '',
- objectType: '',
- insert: '',
- vanPopup: false,
- taskPhotoRecognitionResult: null,
- };
- },
- activated() {
- this.taskIds = this.$route.query.taskIds || [];
- this.visitsId = this.$route.query.visitsId || '';
- this.storeGroupId = this.$route.query.storeGroupId || '';
- this.objectType = this.$route.query.photoType || '';
- this.insert = this.$route.query.insert;
- if (this.$route.query.source == 'historicalDetails') {
- this.getVisitsDetailFun();
- } else {
- this.getDetaile();
- }
- },
- methods: {
- getVisitsDetailFun() {
- this.toastLoading(0, '加载中...', true);
- getVisitsDetail({ visitsId: this.visitsId }).then((res) => {
- this.toastLoading().clear();
- if (res.data.sfaTaskList) {
- this.dataList = res.data.sfaTaskList.filter((val) => val.taskType == '5');
- this.formData = this.dataList[0];
- } else {
- this.formData = null;
- }
- });
- },
- getDetaile() {
- console.log(this.$route.query);
- getCollectionInfosBatch({
- storeCode: this.$route.query.storeCode,
- insert: this.insert == '1' ? true : false,
- id: this.visitsId,
- taskIds: this.taskIds.split(','),
- }).then((res) => {
- if (res.data && res.data.length) {
- this.dataList = res.data;
- this.formData = res.data[0];
- } else {
- this.formData = null;
- }
- });
- },
- openDialog(item) {
- this.vanPopup = true;
- this.taskPhotoRecognitionResult = item.taskPhotoRecognitionResult;
- },
- onSubmit() {
- let formData = {
- storeId: this.$route.query.storeId,
- storeCode: this.$route.query.storeCode,
- storeGroupId: this.$route.query.storeGroupId,
- visitsId: this.visitsId,
- taskList: this.taskIds.split(',').map((val) => Number(val)),
- insert: true,
- collectionAnswers: [],
- checkUnManage: 'N',
- deviceCode: '',
- putInCode: '',
- equipmentCode: '',
- };
- addCollectionAnswerBatch(formData).then((res) => {
- if (res.code == 200) {
- localStorage.setItem('getRequestFlage', 'true');
- this.$router.go(-1);
- }
- });
- },
- onClickLeft() {
- this.$router.go(-1);
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .taskPhotoTaking {
- display: flex;
- flex-direction: column;
- width: 100%;
- height: 100%;
- overflow: hidden;
- .content {
- padding: 10px;
- flex: 1;
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- padding-bottom: 46px;
- .container {
- background: #fff;
- width: 100%;
- border-radius: 6px;
- // padding: 10px;
- padding: 0 10px 10px 0px;
- }
- .formLabel {
- // margin-left: 20px;
- border-bottom: 1px solid #f1f1f1;
- }
- .formLabel .van-cell {
- padding: 10px 0;
- }
- .formLabel .van-cell::after {
- border: 0;
- }
- .formLabel .van-field {
- border: 1px solid #f1f1f1;
- padding: 6px;
- width: 100%;
- border-radius: 4px;
- overflow: hidden;
- }
- .formLabel .van-field__control {
- padding: 0 10px;
- }
- .formLabel .formLabeltitle {
- position: absolute;
- top: 8px;
- }
- .z-cell .van-cell__title {
- font-size: 16px;
- }
- .van-f-red {
- color: red;
- width: 8px;
- display: inline-block;
- line-height: 26px;
- }
- .headline {
- font-weight: 600;
- font-size: 16px;
- position: relative;
- display: flex;
- align-items: center;
- .headlineIcon {
- display: inline-block;
- position: absolute;
- width: 3px;
- height: 60%;
- background: #3875c6;
- left: 5px;
- }
- .headlineTitle {
- display: inline-block;
- padding: 8px 20px;
- background: #eef5ff;
- border-radius: 0 20px 20px 0;
- }
- }
- }
- .dataList {
- width: 100%;
- margin-top: 10px;
- overflow-y: auto;
- background: #fff;
- .dataItem {
- display: flex;
- border-radius: 6px;
- flex-direction: row;
- margin-bottom: 10px;
- // padding: 10px;
- font-size: 16px;
- padding-left: 20px;
- .itemIndex {
- }
- .itemTop {
- flex: 1;
- overflow: hidden;
- border-bottom: 1px solid #a7a5a5;
- padding-bottom: 10px;
- .itemHtml {
- overflow-x: auto;
- }
- }
- .itemTop,
- .itemBottom {
- display: flex;
- flex-direction: row;
- }
- .itemBottom {
- align-items: center;
- width: 40px;
- margin-left: 5px;
- img {
- width: 100%;
- height: 33px;
- }
- }
- }
- }
- }
- </style>
- <style lang="scss">
- // .taskPhotoTaking {
- // .itenHtml {
- // overflow: hidden;
- // img {
- // width: 100%;
- // }
- // }
- // }
- .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;
- }
- }
- .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;
- }
- td {
- color: #000;
- }
- .el-table__cell {
- padding: 6px 0 !important;
- .cell {
- padding: 0;
- }
- }
- }
- </style>
|