visitedTaskDetail.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <template>
  2. <div class="visitedTaskDetail">
  3. <van-nav-bar class="navBar" title="拜访任务详情" left-arrow @click-left="onClickLeft" />
  4. <div class="lineGrey"></div>
  5. <div class="deviceCode" v-if="showCode">
  6. <div class="vertical"></div>
  7. <p>设备编号:{{ deviceCode }}</p>
  8. <p>投放编号:{{ putInCode }}</p>
  9. </div>
  10. <div class="lineGrey" v-if="showCode"></div>
  11. <div
  12. class="container containert"
  13. style="width: 100%; margin: 0 auto; padding: 10px 0"
  14. v-if="taskType == 3">
  15. <el-table
  16. :data="tableData1"
  17. border
  18. style="width: 100%"
  19. class="table-headermd"
  20. :span-method="objectSpanMethod">
  21. <el-table-column prop="collectionName" label="物料类型" width="180">
  22. <template slot-scope="scope">
  23. <span class="tipTitle" @click="tipTitle(scope.row.signDictype)">{{
  24. scope.row.signDictype
  25. }}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column prop="collectionName" label="物料名称" width="180">
  29. <template slot-scope="scope">
  30. <span class="tipTitle" @click="tipTitle(scope.row.collectionName)">{{
  31. scope.row.collectionName
  32. }}</span>
  33. </template>
  34. </el-table-column>
  35. <el-table-column prop="inventoryNum" width="180" label="库存" />
  36. <el-table-column prop="address">
  37. <template slot="header">
  38. <span>发放量</span>
  39. </template>
  40. <template slot-scope="scope">
  41. <p class="f-right">{{ scope.row.value }}</p>
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. </div>
  46. <div
  47. class="container containert"
  48. style="width: 100%; margin: 0 auto; padding: 10px 0"
  49. v-if="taskType == 2">
  50. <p v-if="checkShow" style="padding: 0 10px; font-size: 14px">全部不经营</p>
  51. <el-table
  52. :data="tableData1"
  53. border
  54. style="width: 100%"
  55. class="table-headermd"
  56. v-if="!checkShow">
  57. <el-table-column prop="collectionName" label="产品名称" width="180">
  58. <template slot-scope="scope">
  59. <span class="tipTitle" @click="tipTitle(scope.row.collectionName)">{{
  60. scope.row.collectionName
  61. }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column prop="name" width="180">
  65. <template slot="header">
  66. <span>进货原价</span>
  67. </template>
  68. <template slot-scope="scope">
  69. <p class="f-right">{{ scope.row.xdjhyj }}</p>
  70. </template>
  71. </el-table-column>
  72. <el-table-column prop="address">
  73. <template slot="header">
  74. <span>促后净价</span>
  75. </template>
  76. <template slot-scope="scope">
  77. <p class="f-right">{{ scope.row.xdjhchjj }}</p>
  78. </template>
  79. </el-table-column>
  80. <el-table-column prop="address">
  81. <template slot="header">
  82. <span>油工拿货价</span>
  83. </template>
  84. <template slot-scope="scope">
  85. <p class="f-right">{{ scope.row.ygnhj }}</p>
  86. </template>
  87. </el-table-column>
  88. </el-table>
  89. </div>
  90. <div
  91. class="container containert"
  92. style="width: 94%; margin: 0 auto; border-radius: 6px"
  93. v-if="taskType == 1">
  94. <van-form ref="tabstoreVal">
  95. <div v-for="(item, index) in collectionItemList" :key="index">
  96. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'sz'">
  97. <van-cell>
  98. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  99. </van-cell>
  100. <p class="mg0">{{ item.answerValue }}</p>
  101. <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  102. <van-field
  103. class="mobile-input"
  104. v-model="item.collectionOptionList[0].collectionOption"
  105. autosize
  106. readonly
  107. type="textarea" />
  108. </p>
  109. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  110. </div>
  111. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'zp'">
  112. <van-cell>
  113. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  114. </van-cell>
  115. <!--<p style="color: #444;-->
  116. <!--font-size: 12px;-->
  117. <!--margin: 0;-->
  118. <!--padding:10px 0;text-align: right">{{item.collectionOptionList[0].collectionOption}}</p>-->
  119. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  120. </div>
  121. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'wb'">
  122. <van-cell>
  123. <template #title>
  124. {{ index + 1 }}.{{ item.collectionName }}
  125. <span
  126. style="color: #00afff; position: absolute; top: 8px; right: 0px"
  127. v-if="item.showHistory == 1"
  128. @click="getCollectionShowHistory(item)"
  129. >回显历史</span
  130. >
  131. </template>
  132. </van-cell>
  133. <div class="selesetText">
  134. <p class="mg0">{{ item.answerValue }}</p>
  135. </div>
  136. <p style="color: #444; font-size: 12px; margin: 0; text-align: right">
  137. <van-field
  138. class="mobile-input"
  139. v-model="item.collectionOptionList[0].collectionOption"
  140. autosize
  141. readonly
  142. type="textarea" />
  143. </p>
  144. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  145. </div>
  146. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'tel'">
  147. <van-cell>
  148. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  149. </van-cell>
  150. <div class="selesetText">
  151. <p class="mg0">{{ item.answerValue }}</p>
  152. </div>
  153. <p style="color: #444; font-size: 12px; margin: 0; text-align: right">
  154. <van-field
  155. class="mobile-input"
  156. v-model="item.collectionOptionList[0].collectionOption"
  157. autosize
  158. readonly
  159. type="textarea" />
  160. </p>
  161. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  162. </div>
  163. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'date'">
  164. <van-cell>
  165. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  166. </van-cell>
  167. <div class="selesetText">
  168. <p class="mg0">{{ item.answerValue }}</p>
  169. </div>
  170. <p style="color: #444; font-size: 12px; margin: 0; text-align: right">
  171. <van-field
  172. class="mobile-input"
  173. v-model="item.collectionOptionList[0].collectionOption"
  174. autosize
  175. readonly
  176. type="textarea" />
  177. </p>
  178. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  179. </div>
  180. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'sm'">
  181. <van-cell>
  182. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  183. </van-cell>
  184. <div class="selesetText">
  185. <div style="font-size: 14px" v-if="item.collectionOptionList[0].answerValue">
  186. <div v-if="item.success" style="color: green">
  187. <p>系统资产编码:{{ item.equipmentCode1 }}</p>
  188. <p>&nbsp;&nbsp;&nbsp;&nbsp;条形码编码:{{ item.equipmentCode2 }}</p>
  189. <span style="float: right; margin-top: -48px"
  190. ><van-icon name="passed" size="16" />&nbsp;一致</span
  191. >
  192. </div>
  193. <div v-if="!item.success" style="color: red">
  194. <p>系统资产编码:{{ item.equipmentCode1 }}</p>
  195. <p>&nbsp;&nbsp;&nbsp;&nbsp;条形码编码:{{ item.equipmentCode2 }}</p>
  196. <span style="float: right; margin-top: -48px"
  197. ><van-icon name="close" size="16" />&nbsp;不一致</span
  198. >
  199. </div>
  200. </div>
  201. </div>
  202. <p
  203. style="color: #444; font-size: 12px; margin: 0; text-align: right"
  204. v-if="item.collectionOptionList[0].collectionOption">
  205. <van-field
  206. class="mobile-input"
  207. v-model="item.collectionOptionList[0].collectionOption"
  208. autosize
  209. readonly
  210. type="textarea" />
  211. </p>
  212. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  213. </div>
  214. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'duox'">
  215. <van-cell>
  216. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  217. </van-cell>
  218. <div class="selesetText">
  219. <p class="mg0" v-for="(item1, index1) in item.collectionOptionList" :key="index1">
  220. <span v-if="item1.isCheck == 1">{{ item1.collectionOption }}</span>
  221. </p>
  222. </div>
  223. <!--<p style="color: #444;-->
  224. <!--font-size: 12px;-->
  225. <!--margin: 0;-->
  226. <!--padding:10px 0;text-align: right">{{item.collectionOptionList[0].collectionOption}}</p>-->
  227. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  228. </div>
  229. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'dx'">
  230. <van-cell>
  231. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  232. </van-cell>
  233. <div class="selesetText">
  234. <p class="mg0" v-for="(item2, index2) in item.collectionOptionList" :key="index2">
  235. <span v-if="item2.isCheck == 1">{{ item2.collectionOption }}</span>
  236. </p>
  237. </div>
  238. <!--<p style="color: #444;-->
  239. <!--font-size: 12px;-->
  240. <!--margin: 0;-->
  241. <!--padding:10px 0;text-align: right">{{item.collectionOptionList[0].collectionOption}}</p>-->
  242. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  243. </div>
  244. </div>
  245. </van-form>
  246. </div>
  247. <van-dialog v-model="listShow" title="历史回显" show-cancel-button :showConfirmButton="false">
  248. <div style="border: 1px solid #eee; margin-top: 18px">
  249. <div class="itenHhistory" v-for="item in list">
  250. <p>内容:{{ item.answerValue }}</p>
  251. <p>拜访人:{{ item.nickName }}</p>
  252. <p>拜访时间:{{ item.createTime }}</p>
  253. </div>
  254. </div>
  255. </van-dialog>
  256. <br />
  257. </div>
  258. </template>
  259. <script>
  260. import { getCollectionShowHistory, getPhotoTypeList } from '@/api/index';
  261. import deleteUploadImg from '@/components/deleteUploadImg';
  262. import { getVisitsDetail } from '@/api/home';
  263. export default {
  264. name: 'abnormalVisit',
  265. components: { deleteUploadImg },
  266. data() {
  267. return {
  268. value: '',
  269. sdsd: false,
  270. showPicker: false,
  271. logshow: false,
  272. imgs: [],
  273. checkboxGroup: [],
  274. listShow: false,
  275. showCode: false,
  276. deviceCode: '',
  277. list: [],
  278. radio: '',
  279. uploadid2: 'uploadid2',
  280. collectionItemList: [],
  281. rdId: '',
  282. show: false,
  283. PhotoTypeList: [],
  284. PhotoType: '',
  285. PhotoTypeText: '',
  286. indexselect: 0,
  287. visitId: '',
  288. storeGroupId: '',
  289. taskId: '',
  290. collectionId: '',
  291. chainId: '',
  292. collectionAnswerlisd: [],
  293. tableData1: [],
  294. taskType: 1,
  295. flag: false,
  296. indeximg: '',
  297. checkShow: false,
  298. infoData: {},
  299. putInCode: '',
  300. urlParameter: null,
  301. };
  302. },
  303. created() {
  304. this.urlParameter = this.$route.query;
  305. this.taskType = this.$route.query.taskType;
  306. this.PhotoType = this.$route.query.photoType;
  307. this.visitId = this.$route.query.id + '';
  308. this.taskId = this.$route.query.taskId + '';
  309. this.chainId = this.$route.query.chainId + '';
  310. this.storeGroupId = this.$route.query.storeGroupId + '';
  311. if (this.$route.query.photoType != null) {
  312. this.indexselect = 0;
  313. } else {
  314. this.indexselect = 1;
  315. }
  316. // this.getPhotoTypeList();
  317. this.info();
  318. },
  319. methods: {
  320. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  321. const cellValue = row[column.property];
  322. if (cellValue && ['signDictype'].includes(column.property)) {
  323. const prevRow = this.tableData1[rowIndex - 1];
  324. let nextRow = this.tableData1[rowIndex + 1];
  325. if (prevRow && prevRow[column.property] === cellValue) {
  326. return { rowspan: 0, colspan: 0 };
  327. } else {
  328. let countRowspan = 1;
  329. while (nextRow && nextRow[column.property] === cellValue) {
  330. nextRow = this.tableData1[++countRowspan + rowIndex];
  331. }
  332. if (countRowspan > 1) {
  333. return { rowspan: countRowspan, colspan: 1 };
  334. }
  335. }
  336. }
  337. },
  338. // 历史回显
  339. getCollectionShowHistory(id) {
  340. getCollectionShowHistory({
  341. chainId: this.infoData.chainId,
  342. collectionId: id.collectionId,
  343. visitsId: this.$route.query.visitId,
  344. storeGroupId: this.$route.query.storeGroupId,
  345. taskId: this.$route.query.taskId,
  346. }).then((res) => {
  347. if (res.data.length > 0) {
  348. this.list = res.data;
  349. this.listShow = true;
  350. } else {
  351. this.$toast('暂无历史信息');
  352. }
  353. });
  354. },
  355. checkFn(val) {
  356. var arrc = [];
  357. for (var cl = 0; cl < val.length; cl++) {
  358. if (val[cl].isCheck == '1') {
  359. arrc.push(val[cl].collectionOption);
  360. }
  361. }
  362. return arrc.join(',');
  363. },
  364. info() {
  365. getVisitsDetail({ visitsId: this.visitId }).then((res) => {
  366. this.infoData = res.data;
  367. var collectionItemLists =
  368. res.data.sfaTaskList[this.$route.query.activatedIndex].collectionItemList;
  369. if (res.data.sfaTaskList[this.$route.query.activatedIndex].checkUnManage == 'Y') {
  370. this.checkShow = true;
  371. } else {
  372. this.checkShow = false;
  373. }
  374. this.deviceCode = res.data.sfaTaskList[this.$route.query.activatedIndex].deviceCode || ''; // 设备编号
  375. this.putInCode = res.data.sfaTaskList[this.$route.query.activatedIndex].putInCode || ''; // 投放编号
  376. if (res.data.sfaTaskList[this.$route.query.activatedIndex].inspectionType == 'buy') {
  377. this.showCode = true;
  378. } else {
  379. this.showCode = false;
  380. }
  381. if (this.$route.query.taskType == 1) {
  382. for (var q = 0; q < collectionItemLists.length; q++) {
  383. if (
  384. collectionItemLists[q].answerType == 'sz' ||
  385. collectionItemLists[q].answerType == 'wb' ||
  386. collectionItemLists[q].answerType == 'tel' ||
  387. collectionItemLists[q].answerType == 'date'
  388. ) {
  389. collectionItemLists[q].answerValue =
  390. collectionItemLists[q].collectionOptionList[0].answerValue;
  391. }
  392. if (collectionItemLists[q].answerType == 'sm') {
  393. collectionItemLists[q].success = false;
  394. if (
  395. collectionItemLists[q].collectionOptionList[0].answerValue != null &&
  396. collectionItemLists[q].collectionOptionList[0].answerValue != ''
  397. ) {
  398. collectionItemLists[q].equipmentCode2 =
  399. collectionItemLists[q].collectionOptionList[0].answerValue.split(',')[1];
  400. if (
  401. collectionItemLists[q].collectionOptionList[0].answerValue.split(',')[0] != 'null'
  402. ) {
  403. collectionItemLists[q].equipmentCode1 =
  404. collectionItemLists[q].collectionOptionList[0].answerValue.split(',')[0];
  405. } else {
  406. collectionItemLists[q].equipmentCode1 = '编码不存在';
  407. }
  408. if (
  409. collectionItemLists[q].collectionOptionList[0].answerValue.split(',')[0] ==
  410. collectionItemLists[q].collectionOptionList[0].answerValue.split(',')[1]
  411. ) {
  412. collectionItemLists[q].success = true;
  413. }
  414. }
  415. }
  416. if (
  417. collectionItemLists[q].answerType == 'duox' ||
  418. collectionItemLists[q].answerType == 'dx'
  419. ) {
  420. collectionItemLists[q].answerValue = [];
  421. for (var qq = 0; qq < collectionItemLists[q].collectionOptionList.length; qq++) {
  422. if (collectionItemLists[q].collectionOptionList[qq].isCheck == 1) {
  423. collectionItemLists[q].answerValue.push(
  424. collectionItemLists[q].collectionOptionList[qq].collectionOptionId
  425. );
  426. collectionItemLists[q].collectionOptionList[qq].code =
  427. collectionItemLists[q].collectionCode;
  428. collectionItemLists[q].collectionOptionList[qq].answerType =
  429. collectionItemLists[q].answerType;
  430. this.collectionAnswerlisd.push(collectionItemLists[q].collectionOptionList[qq]);
  431. }
  432. }
  433. collectionItemLists[q].answerValue = collectionItemLists[q].answerValue.join();
  434. }
  435. }
  436. this.collectionItemList = collectionItemLists;
  437. } else {
  438. for (var f = 0; f < collectionItemLists.length; f++) {
  439. var collectionOptionListarr = collectionItemLists[f].collectionOptionList;
  440. for (var ff = 0; ff < collectionOptionListarr.length; ff++) {
  441. if (ff == '0') {
  442. collectionItemLists[f].xdjhyj = collectionOptionListarr[ff].answerValue;
  443. collectionItemLists[f].value = collectionOptionListarr[ff].answerValue;
  444. }
  445. if (ff == '1') {
  446. collectionItemLists[f].xdjhchjj = collectionOptionListarr[ff].answerValue;
  447. }
  448. if (ff == '2') {
  449. collectionItemLists[f].ygnhj = collectionOptionListarr[ff].answerValue;
  450. }
  451. }
  452. }
  453. this.tableData1 = collectionItemLists;
  454. }
  455. });
  456. },
  457. getPhotoTypeList() {
  458. getPhotoTypeList({}).then((res) => {
  459. var PhotoTypeLists = [];
  460. for (var p = 0; p < res.data.length; p++) {
  461. PhotoTypeLists.push({
  462. dictValue: res.data[p].dictValue,
  463. text: res.data[p].dictLabel,
  464. });
  465. }
  466. this.PhotoTypeList = PhotoTypeLists;
  467. });
  468. },
  469. onClickLeft() {
  470. this.$router.go(-1);
  471. },
  472. tipTitle(val) {
  473. this.$toast(val);
  474. },
  475. },
  476. };
  477. </script>
  478. <style scoped>
  479. .container {
  480. background-color: white;
  481. }
  482. .van-f-red {
  483. color: red;
  484. width: 8px;
  485. display: inline-block;
  486. line-height: 26px;
  487. }
  488. .formLabel {
  489. margin: 0 16px;
  490. padding-bottom: 16px;
  491. border-bottom: 1px solid #f1f1f1;
  492. }
  493. .formLabel .van-cell {
  494. padding: 10px 0;
  495. }
  496. .formLabel .van-cell::after {
  497. border: 0;
  498. }
  499. .formLabel .van-field {
  500. border: 1px solid #f1f1f1;
  501. padding: 6px;
  502. width: 100%;
  503. border-radius: 4px;
  504. overflow: hidden;
  505. }
  506. .formLabel .van-field__control {
  507. padding: 0 10px;
  508. }
  509. .formLabel .formLabeltitle {
  510. position: absolute;
  511. top: 8px;
  512. }
  513. .z-checkbox .van-radio {
  514. padding: 6px 0;
  515. }
  516. .z-cell .van-cell__title {
  517. font-size: 16px;
  518. }
  519. .deviceCode {
  520. font-size: 16px;
  521. padding: 12px;
  522. background-color: white;
  523. margin: 0 12px;
  524. border-radius: 5px;
  525. position: relative;
  526. overflow: hidden;
  527. }
  528. .vertical {
  529. background-color: #2b2f3a;
  530. height: 14px;
  531. width: 8px;
  532. border-radius: 40px;
  533. position: absolute;
  534. left: -3px;
  535. top: 50px;
  536. }
  537. </style>
  538. <style>
  539. .table-headermd {
  540. font-size: 1.2rem;
  541. text-align: center;
  542. position: initial;
  543. width: 94% !important;
  544. margin: 0 auto;
  545. border-right: 0;
  546. }
  547. .table-headermd .el-table__header,
  548. .table-headermd .el-table__body {
  549. width: 100% !important;
  550. }
  551. .table-headermd col {
  552. width: 5.8rem;
  553. }
  554. .table-headermd col:nth-child(2),
  555. .table-headermd col:nth-child(4),
  556. .table-headermd col:nth-child(3) {
  557. width: 5rem;
  558. }
  559. .table-headermd .van-cell {
  560. padding: 0 4px;
  561. height: 100%;
  562. }
  563. .table-headermd th.el-table__cell > .cell {
  564. padding: 0 4px;
  565. }
  566. .table-headermd th.el-table__cell {
  567. background-color: #1989fa;
  568. color: #fff;
  569. }
  570. .table-headermd .el-table__cell {
  571. padding: 4px 0;
  572. }
  573. .table-headermd .tipTitle {
  574. overflow: hidden;
  575. text-overflow: ellipsis;
  576. display: -webkit-box;
  577. -webkit-box-orient: vertical;
  578. -webkit-line-clamp: 2;
  579. }
  580. .table-headermd::before {
  581. height: 0;
  582. }
  583. .f-right {
  584. text-align: right;
  585. margin: 0;
  586. }
  587. .mg0 {
  588. margin: 6px 10px;
  589. color: #909090;
  590. font-size: 14px;
  591. }
  592. .selesetText {
  593. margin-bottom: 16px;
  594. }
  595. .z-cells .van-cell__title {
  596. font-weight: bold;
  597. color: #4a4a4a;
  598. }
  599. .z-cells .van-cell {
  600. padding-bottom: 0;
  601. }
  602. </style>
  603. <style>
  604. .containert .van-cell__title {
  605. overflow: auto;
  606. height: auto;
  607. }
  608. .mobile-input .van-field__control {
  609. font-size: 12px;
  610. color: #999;
  611. border: 0;
  612. }
  613. .formLabel .mobile-input {
  614. border: 0 !important;
  615. }
  616. </style>