| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642 |
- <template>
- <div class="visitedTaskDetail">
- <van-nav-bar class="navBar" title="拜访任务详情" left-arrow @click-left="onClickLeft" />
- <div class="lineGrey"></div>
- <div class="deviceCode" v-if="showCode">
- <div class="vertical"></div>
- <p>设备编号:{{ deviceCode }}</p>
- <p>投放编号:{{ putInCode }}</p>
- </div>
- <div class="lineGrey" v-if="showCode"></div>
- <div
- class="container containert"
- style="width: 100%; margin: 0 auto; padding: 10px 0"
- v-if="taskType == 3">
- <el-table
- :data="tableData1"
- border
- style="width: 100%"
- class="table-headermd"
- :span-method="objectSpanMethod">
- <el-table-column prop="collectionName" label="物料类型" width="180">
- <template slot-scope="scope">
- <span class="tipTitle" @click="tipTitle(scope.row.signDictype)">{{
- scope.row.signDictype
- }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="collectionName" label="物料名称" width="180">
- <template slot-scope="scope">
- <span class="tipTitle" @click="tipTitle(scope.row.collectionName)">{{
- scope.row.collectionName
- }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="inventoryNum" width="180" label="库存" />
- <el-table-column prop="address">
- <template slot="header">
- <span>发放量</span>
- </template>
- <template slot-scope="scope">
- <p class="f-right">{{ scope.row.value }}</p>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div
- class="container containert"
- style="width: 100%; margin: 0 auto; padding: 10px 0"
- v-if="taskType == 2">
- <p v-if="checkShow" style="padding: 0 10px; font-size: 14px">全部不经营</p>
- <el-table
- :data="tableData1"
- border
- style="width: 100%"
- class="table-headermd"
- v-if="!checkShow">
- <el-table-column prop="collectionName" label="产品名称" width="180">
- <template slot-scope="scope">
- <span class="tipTitle" @click="tipTitle(scope.row.collectionName)">{{
- scope.row.collectionName
- }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="name" width="180">
- <template slot="header">
- <span>进货原价</span>
- </template>
- <template slot-scope="scope">
- <p class="f-right">{{ scope.row.xdjhyj }}</p>
- </template>
- </el-table-column>
- <el-table-column prop="address">
- <template slot="header">
- <span>促后净价</span>
- </template>
- <template slot-scope="scope">
- <p class="f-right">{{ scope.row.xdjhchjj }}</p>
- </template>
- </el-table-column>
- <el-table-column prop="address">
- <template slot="header">
- <span>油工拿货价</span>
- </template>
- <template slot-scope="scope">
- <p class="f-right">{{ scope.row.ygnhj }}</p>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div
- class="container containert"
- style="width: 94%; margin: 0 auto; border-radius: 6px"
- v-if="taskType == 1">
- <van-form ref="tabstoreVal">
- <div v-for="(item, index) in collectionItemList" :key="index">
- <div class="formLabel z-cell z-cells" v-if="item.answerType == 'sz'">
- <van-cell>
- <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
- </van-cell>
- <p class="mg0">{{ item.answerValue }}</p>
- <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
- <van-field
- class="mobile-input"
- v-model="item.collectionOptionList[0].collectionOption"
- autosize
- readonly
- type="textarea" />
- </p>
- <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
- </div>
- <div class="formLabel z-cell z-cells" v-if="item.answerType == 'zp'">
- <van-cell>
- <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
- </van-cell>
- <!--<p style="color: #444;-->
- <!--font-size: 12px;-->
- <!--margin: 0;-->
- <!--padding:10px 0;text-align: right">{{item.collectionOptionList[0].collectionOption}}</p>-->
- <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
- </div>
- <div class="formLabel z-cell z-cells" v-if="item.answerType == 'wb'">
- <van-cell>
- <template #title>
- {{ index + 1 }}.{{ item.collectionName }}
- <span
- style="color: #00afff; position: absolute; top: 8px; right: 0px"
- v-if="item.showHistory == 1"
- @click="getCollectionShowHistory(item)"
- >回显历史</span
- >
- </template>
- </van-cell>
- <div class="selesetText">
- <p class="mg0">{{ item.answerValue }}</p>
- </div>
- <p style="color: #444; font-size: 12px; margin: 0; text-align: right">
- <van-field
- class="mobile-input"
- v-model="item.collectionOptionList[0].collectionOption"
- autosize
- readonly
- type="textarea" />
- </p>
- <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
- </div>
- <div class="formLabel z-cell z-cells" v-if="item.answerType == 'tel'">
- <van-cell>
- <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
- </van-cell>
- <div class="selesetText">
- <p class="mg0">{{ item.answerValue }}</p>
- </div>
- <p style="color: #444; font-size: 12px; margin: 0; text-align: right">
- <van-field
- class="mobile-input"
- v-model="item.collectionOptionList[0].collectionOption"
- autosize
- readonly
- type="textarea" />
- </p>
- <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
- </div>
- <div class="formLabel z-cell z-cells" v-if="item.answerType == 'date'">
- <van-cell>
- <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
- </van-cell>
- <div class="selesetText">
- <p class="mg0">{{ item.answerValue }}</p>
- </div>
- <p style="color: #444; font-size: 12px; margin: 0; text-align: right">
- <van-field
- class="mobile-input"
- v-model="item.collectionOptionList[0].collectionOption"
- autosize
- readonly
- type="textarea" />
- </p>
- <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
- </div>
- <div class="formLabel z-cell z-cells" v-if="item.answerType == 'sm'">
- <van-cell>
- <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
- </van-cell>
- <div class="selesetText">
- <div style="font-size: 14px" v-if="item.collectionOptionList[0].answerValue">
- <div v-if="item.success" style="color: green">
- <p>系统资产编码:{{ item.equipmentCode1 }}</p>
- <p> 条形码编码:{{ item.equipmentCode2 }}</p>
- <span style="float: right; margin-top: -48px"
- ><van-icon name="passed" size="16" /> 一致</span
- >
- </div>
- <div v-if="!item.success" style="color: red">
- <p>系统资产编码:{{ item.equipmentCode1 }}</p>
- <p> 条形码编码:{{ item.equipmentCode2 }}</p>
- <span style="float: right; margin-top: -48px"
- ><van-icon name="close" size="16" /> 不一致</span
- >
- </div>
- </div>
- </div>
- <p
- style="color: #444; font-size: 12px; margin: 0; text-align: right"
- v-if="item.collectionOptionList[0].collectionOption">
- <van-field
- class="mobile-input"
- v-model="item.collectionOptionList[0].collectionOption"
- autosize
- readonly
- type="textarea" />
- </p>
- <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
- </div>
- <div class="formLabel z-cell z-cells" v-if="item.answerType == 'duox'">
- <van-cell>
- <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
- </van-cell>
- <div class="selesetText">
- <p class="mg0" v-for="(item1, index1) in item.collectionOptionList" :key="index1">
- <span v-if="item1.isCheck == 1">{{ item1.collectionOption }}</span>
- </p>
- </div>
- <!--<p style="color: #444;-->
- <!--font-size: 12px;-->
- <!--margin: 0;-->
- <!--padding:10px 0;text-align: right">{{item.collectionOptionList[0].collectionOption}}</p>-->
- <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
- </div>
- <div class="formLabel z-cell z-cells" v-if="item.answerType == 'dx'">
- <van-cell>
- <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
- </van-cell>
- <div class="selesetText">
- <p class="mg0" v-for="(item2, index2) in item.collectionOptionList" :key="index2">
- <span v-if="item2.isCheck == 1">{{ item2.collectionOption }}</span>
- </p>
- </div>
- <!--<p style="color: #444;-->
- <!--font-size: 12px;-->
- <!--margin: 0;-->
- <!--padding:10px 0;text-align: right">{{item.collectionOptionList[0].collectionOption}}</p>-->
- <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
- </div>
- </div>
- </van-form>
- </div>
- <van-dialog v-model="listShow" title="历史回显" show-cancel-button :showConfirmButton="false">
- <div style="border: 1px solid #eee; margin-top: 18px">
- <div class="itenHhistory" v-for="item in list">
- <p>内容:{{ item.answerValue }}</p>
- <p>拜访人:{{ item.nickName }}</p>
- <p>拜访时间:{{ item.createTime }}</p>
- </div>
- </div>
- </van-dialog>
- <br />
- </div>
- </template>
- <script>
- import { getCollectionShowHistory, getPhotoTypeList } from '@/api/index';
- import deleteUploadImg from '@/components/deleteUploadImg';
- import { getVisitsDetail } from '@/api/home';
- export default {
- name: 'abnormalVisit',
- components: { deleteUploadImg },
- data() {
- return {
- value: '',
- sdsd: false,
- showPicker: false,
- logshow: false,
- imgs: [],
- checkboxGroup: [],
- listShow: false,
- showCode: false,
- deviceCode: '',
- list: [],
- radio: '',
- uploadid2: 'uploadid2',
- collectionItemList: [],
- rdId: '',
- show: false,
- PhotoTypeList: [],
- PhotoType: '',
- PhotoTypeText: '',
- indexselect: 0,
- visitId: '',
- storeGroupId: '',
- taskId: '',
- collectionId: '',
- chainId: '',
- collectionAnswerlisd: [],
- tableData1: [],
- taskType: 1,
- flag: false,
- indeximg: '',
- checkShow: false,
- infoData: {},
- putInCode: '',
- urlParameter: null,
- };
- },
- created() {
- this.urlParameter = this.$route.query;
- this.taskType = this.$route.query.taskType;
- this.PhotoType = this.$route.query.photoType;
- this.visitId = this.$route.query.id + '';
- this.taskId = this.$route.query.taskId + '';
- this.chainId = this.$route.query.chainId + '';
- this.storeGroupId = this.$route.query.storeGroupId + '';
- if (this.$route.query.photoType != null) {
- this.indexselect = 0;
- } else {
- this.indexselect = 1;
- }
- // this.getPhotoTypeList();
- this.info();
- },
- methods: {
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- const cellValue = row[column.property];
- if (cellValue && ['signDictype'].includes(column.property)) {
- const prevRow = this.tableData1[rowIndex - 1];
- let nextRow = this.tableData1[rowIndex + 1];
- if (prevRow && prevRow[column.property] === cellValue) {
- return { rowspan: 0, colspan: 0 };
- } else {
- let countRowspan = 1;
- while (nextRow && nextRow[column.property] === cellValue) {
- nextRow = this.tableData1[++countRowspan + rowIndex];
- }
- if (countRowspan > 1) {
- return { rowspan: countRowspan, colspan: 1 };
- }
- }
- }
- },
- // 历史回显
- getCollectionShowHistory(id) {
- getCollectionShowHistory({
- chainId: this.infoData.chainId,
- collectionId: id.collectionId,
- visitsId: this.$route.query.visitId,
- storeGroupId: this.$route.query.storeGroupId,
- taskId: this.$route.query.taskId,
- }).then((res) => {
- if (res.data.length > 0) {
- this.list = res.data;
- this.listShow = true;
- } else {
- this.$toast('暂无历史信息');
- }
- });
- },
- checkFn(val) {
- var arrc = [];
- for (var cl = 0; cl < val.length; cl++) {
- if (val[cl].isCheck == '1') {
- arrc.push(val[cl].collectionOption);
- }
- }
- return arrc.join(',');
- },
- info() {
- getVisitsDetail({ visitsId: this.visitId }).then((res) => {
- this.infoData = res.data;
- var collectionItemLists =
- res.data.sfaTaskList[this.$route.query.activatedIndex].collectionItemList;
- if (res.data.sfaTaskList[this.$route.query.activatedIndex].checkUnManage == 'Y') {
- this.checkShow = true;
- } else {
- this.checkShow = false;
- }
- this.deviceCode = res.data.sfaTaskList[this.$route.query.activatedIndex].deviceCode || ''; // 设备编号
- this.putInCode = res.data.sfaTaskList[this.$route.query.activatedIndex].putInCode || ''; // 投放编号
- if (res.data.sfaTaskList[this.$route.query.activatedIndex].inspectionType == 'buy') {
- this.showCode = true;
- } else {
- this.showCode = false;
- }
- if (this.$route.query.taskType == 1) {
- for (var q = 0; q < collectionItemLists.length; q++) {
- if (
- collectionItemLists[q].answerType == 'sz' ||
- collectionItemLists[q].answerType == 'wb' ||
- collectionItemLists[q].answerType == 'tel' ||
- collectionItemLists[q].answerType == 'date'
- ) {
- collectionItemLists[q].answerValue =
- collectionItemLists[q].collectionOptionList[0].answerValue;
- }
- if (collectionItemLists[q].answerType == 'sm') {
- collectionItemLists[q].success = false;
- if (
- collectionItemLists[q].collectionOptionList[0].answerValue != null &&
- collectionItemLists[q].collectionOptionList[0].answerValue != ''
- ) {
- collectionItemLists[q].equipmentCode2 =
- collectionItemLists[q].collectionOptionList[0].answerValue.split(',')[1];
- if (
- collectionItemLists[q].collectionOptionList[0].answerValue.split(',')[0] != 'null'
- ) {
- collectionItemLists[q].equipmentCode1 =
- collectionItemLists[q].collectionOptionList[0].answerValue.split(',')[0];
- } else {
- collectionItemLists[q].equipmentCode1 = '编码不存在';
- }
- if (
- collectionItemLists[q].collectionOptionList[0].answerValue.split(',')[0] ==
- collectionItemLists[q].collectionOptionList[0].answerValue.split(',')[1]
- ) {
- collectionItemLists[q].success = true;
- }
- }
- }
- if (
- collectionItemLists[q].answerType == 'duox' ||
- collectionItemLists[q].answerType == 'dx'
- ) {
- collectionItemLists[q].answerValue = [];
- for (var qq = 0; qq < collectionItemLists[q].collectionOptionList.length; qq++) {
- if (collectionItemLists[q].collectionOptionList[qq].isCheck == 1) {
- collectionItemLists[q].answerValue.push(
- collectionItemLists[q].collectionOptionList[qq].collectionOptionId
- );
- collectionItemLists[q].collectionOptionList[qq].code =
- collectionItemLists[q].collectionCode;
- collectionItemLists[q].collectionOptionList[qq].answerType =
- collectionItemLists[q].answerType;
- this.collectionAnswerlisd.push(collectionItemLists[q].collectionOptionList[qq]);
- }
- }
- collectionItemLists[q].answerValue = collectionItemLists[q].answerValue.join();
- }
- }
- this.collectionItemList = collectionItemLists;
- } else {
- for (var f = 0; f < collectionItemLists.length; f++) {
- var collectionOptionListarr = collectionItemLists[f].collectionOptionList;
- for (var ff = 0; ff < collectionOptionListarr.length; ff++) {
- if (ff == '0') {
- collectionItemLists[f].xdjhyj = collectionOptionListarr[ff].answerValue;
- collectionItemLists[f].value = collectionOptionListarr[ff].answerValue;
- }
- if (ff == '1') {
- collectionItemLists[f].xdjhchjj = collectionOptionListarr[ff].answerValue;
- }
- if (ff == '2') {
- collectionItemLists[f].ygnhj = collectionOptionListarr[ff].answerValue;
- }
- }
- }
- this.tableData1 = collectionItemLists;
- }
- });
- },
- getPhotoTypeList() {
- getPhotoTypeList({}).then((res) => {
- var PhotoTypeLists = [];
- for (var p = 0; p < res.data.length; p++) {
- PhotoTypeLists.push({
- dictValue: res.data[p].dictValue,
- text: res.data[p].dictLabel,
- });
- }
- this.PhotoTypeList = PhotoTypeLists;
- });
- },
- onClickLeft() {
- this.$router.go(-1);
- },
- tipTitle(val) {
- this.$toast(val);
- },
- },
- };
- </script>
- <style scoped>
- .container {
- background-color: white;
- }
- .van-f-red {
- color: red;
- width: 8px;
- display: inline-block;
- line-height: 26px;
- }
- .formLabel {
- margin: 0 16px;
- padding-bottom: 16px;
- 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-checkbox .van-radio {
- padding: 6px 0;
- }
- .z-cell .van-cell__title {
- font-size: 16px;
- }
- .deviceCode {
- font-size: 16px;
- padding: 12px;
- background-color: white;
- margin: 0 12px;
- border-radius: 5px;
- position: relative;
- overflow: hidden;
- }
- .vertical {
- background-color: #2b2f3a;
- height: 14px;
- width: 8px;
- border-radius: 40px;
- position: absolute;
- left: -3px;
- top: 50px;
- }
- </style>
- <style>
- .table-headermd {
- font-size: 1.2rem;
- text-align: center;
- position: initial;
- width: 94% !important;
- margin: 0 auto;
- border-right: 0;
- }
- .table-headermd .el-table__header,
- .table-headermd .el-table__body {
- width: 100% !important;
- }
- .table-headermd col {
- width: 5.8rem;
- }
- .table-headermd col:nth-child(2),
- .table-headermd col:nth-child(4),
- .table-headermd col:nth-child(3) {
- width: 5rem;
- }
- .table-headermd .van-cell {
- padding: 0 4px;
- height: 100%;
- }
- .table-headermd th.el-table__cell > .cell {
- padding: 0 4px;
- }
- .table-headermd th.el-table__cell {
- background-color: #1989fa;
- color: #fff;
- }
- .table-headermd .el-table__cell {
- padding: 4px 0;
- }
- .table-headermd .tipTitle {
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- }
- .table-headermd::before {
- height: 0;
- }
- .f-right {
- text-align: right;
- margin: 0;
- }
- .mg0 {
- margin: 6px 10px;
- color: #909090;
- font-size: 14px;
- }
- .selesetText {
- margin-bottom: 16px;
- }
- .z-cells .van-cell__title {
- font-weight: bold;
- color: #4a4a4a;
- }
- .z-cells .van-cell {
- padding-bottom: 0;
- }
- </style>
- <style>
- .containert .van-cell__title {
- overflow: auto;
- height: auto;
- }
- .mobile-input .van-field__control {
- font-size: 12px;
- color: #999;
- border: 0;
- }
- .formLabel .mobile-input {
- border: 0 !important;
- }
- </style>
|