perfectStoreTSJ.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <template>
  2. <div class="perfectStoreTSJ">
  3. <van-nav-bar class="navBar" title="AI 调色机识别" left-arrow @click-left="onClickLeft" />
  4. <div class="content">
  5. <!-- <div class="contentBox" v-for="val in tiaoSJArr"> -->
  6. <div class="contentBox" v-if="tiaoSJArr">
  7. <div class="deviceCode">
  8. <div class="vertical"></div>
  9. <div class="codeData">
  10. <p style="margin: 13px 0">设备编号:{{ tiaoSJArr.deviceCode || '' }}</p>
  11. <p style="margin: 13px 0">投放编号:{{ tiaoSJArr.putInCode || '' }}</p>
  12. </div>
  13. </div>
  14. <div class="shopSign specialTask" v-if="tiaoSJArr && tiaoSJArr.qualifiedState">
  15. <div class="specialTaskLeft">
  16. <div class="SignText">识别结果:</div>
  17. <div class="signContent">
  18. <div class="icon">
  19. <van-icon name="checked" color="#07c160" v-if="tiaoSJArr.qualifiedState == '1'" />
  20. <van-icon name="warning" color="#ee0a24" v-else />
  21. </div>
  22. <div :style="{ color: tiaoSJArr.qualifiedState == '1' ? '#07c160' : '#ee0a24' }">
  23. {{
  24. tiaoSJArr.qualifiedState == '1'
  25. ? '调色机完整,投放号正确'
  26. : tiaoSJArr.unqualifiedReason
  27. }}
  28. </div>
  29. </div>
  30. <div class="shopSignButton">
  31. <div class="" style="display: flex">
  32. <van-button round type="primary" v-if="tiaoSJArr.qualifiedState == '1'"
  33. >通过</van-button
  34. >
  35. <van-button round type="danger" v-else>不通过</van-button>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <div
  41. class="container containert"
  42. style="font-size: 16px; width: 100%; margin: 0 auto; padding-bottom: 10px"
  43. v-if="tiaoSJArr.collectionItemList.length">
  44. <van-form ref="tabstoreVal">
  45. <div v-for="(item, index) in tiaoSJArr.collectionItemList" :key="index">
  46. <div v-if="item.answerType == 'tel_send_code'" class="formLabel z-cell z-cells">
  47. <van-cell>
  48. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  49. </van-cell>
  50. <div class="selesetText">
  51. <p class="mg0">{{ item.answerValue }}</p>
  52. </div>
  53. </div>
  54. <div v-if="item.answerType == 'nyr'" class="formLabel z-cell z-cells">
  55. <van-cell>
  56. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  57. </van-cell>
  58. <div class="selesetText">
  59. <p class="mg0">{{ item.answerValue }}</p>
  60. </div>
  61. </div>
  62. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'sz'">
  63. <van-cell>
  64. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  65. </van-cell>
  66. <p class="mg0">{{ item.answerValue }}</p>
  67. <p
  68. style="
  69. color: #444;
  70. font-size: 12px;
  71. margin: 0;
  72. padding: 10px 0;
  73. text-align: right;
  74. ">
  75. <van-field
  76. class="mobile-input"
  77. v-model="item.collectionOptionList[0].collectionOption"
  78. autosize
  79. readonly
  80. type="textarea" />
  81. </p>
  82. <div v-if="item.fileInfoList" class="imgBox">
  83. <img
  84. v-for="value in item.fileInfoList"
  85. :src="value.fileUrl"
  86. @click="previewsImg(item.fileInfoList)" />
  87. </div>
  88. </div>
  89. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'zp'">
  90. <van-cell>
  91. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  92. </van-cell>
  93. <div v-if="item.fileInfoList" class="imgBox">
  94. <img
  95. v-for="value in item.fileInfoList"
  96. :src="value.fileUrl"
  97. @click="previewsImg(item.fileInfoList)" />
  98. </div>
  99. </div>
  100. <div
  101. class="formLabel z-cell z-cells"
  102. v-if="item.answerType == 'wb' || item.answerType == 'dhwb'">
  103. <van-cell>
  104. <template #title>
  105. {{ index + 1 }}.{{ item.collectionName }}
  106. <span
  107. style="color: #00afff; position: absolute; top: 8px; right: 0px"
  108. v-if="item.showHistory == 1"
  109. @click="getCollectionShowHistory(item)"
  110. >回显历史</span
  111. >
  112. </template>
  113. </van-cell>
  114. <div class="selesetText">
  115. <p class="mg0">{{ item.answerValue }}</p>
  116. </div>
  117. <p style="color: #444; font-size: 12px; margin: 0; text-align: right">
  118. <van-field
  119. class="mobile-input"
  120. v-model="item.collectionOptionList[0].collectionOption"
  121. autosize
  122. readonly
  123. type="textarea" />
  124. </p>
  125. <div v-if="item.fileInfoList" class="imgBox">
  126. <img
  127. v-for="value in item.fileInfoList"
  128. :src="value.fileUrl"
  129. @click="previewsImg(item.fileInfoList)" />
  130. </div>
  131. </div>
  132. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'tel'">
  133. <van-cell>
  134. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  135. </van-cell>
  136. <div class="selesetText">
  137. <p class="mg0">{{ item.answerValue }}</p>
  138. </div>
  139. <p style="color: #444; font-size: 12px; margin: 0; text-align: right">
  140. <van-field
  141. class="mobile-input"
  142. v-model="item.collectionOptionList[0].collectionOption"
  143. autosize
  144. readonly
  145. type="textarea" />
  146. </p>
  147. <div v-if="item.fileInfoList" class="imgBox">
  148. <img
  149. v-for="value in item.fileInfoList"
  150. :src="value.fileUrl"
  151. @click="previewsImg(item.fileInfoList)" />
  152. </div>
  153. </div>
  154. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'date'">
  155. <van-cell>
  156. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  157. </van-cell>
  158. <div class="selesetText">
  159. <p class="mg0">{{ item.answerValue }}</p>
  160. </div>
  161. <p style="color: #444; font-size: 12px; margin: 0; text-align: right">
  162. <van-field
  163. class="mobile-input"
  164. v-model="item.collectionOptionList[0].collectionOption"
  165. autosize
  166. readonly
  167. type="textarea" />
  168. </p>
  169. <div v-if="item.fileInfoList" class="imgBox">
  170. <img
  171. v-for="value in item.fileInfoList"
  172. :src="value.fileUrl"
  173. @click="previewsImg(item.fileInfoList)" />
  174. </div>
  175. </div>
  176. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'sm'">
  177. <van-cell>
  178. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  179. </van-cell>
  180. <div class="selesetText">
  181. <div style="font-size: 14px" v-if="item.collectionOptionList[0].answerValue">
  182. <div v-if="item.success" style="color: green">
  183. <p>系统资产编码:{{ item.equipmentCode1 }}</p>
  184. <p>&nbsp;&nbsp;&nbsp;&nbsp;条形码编码:{{ item.equipmentCode2 }}</p>
  185. <span style="float: right; margin-top: -48px"
  186. ><van-icon name="passed" size="16" />&nbsp;一致</span
  187. >
  188. </div>
  189. <div v-if="!item.success" style="color: red">
  190. <p>系统资产编码:{{ item.equipmentCode1 }}</p>
  191. <p>&nbsp;&nbsp;&nbsp;&nbsp;条形码编码:{{ item.equipmentCode2 }}</p>
  192. <span style="float: right; margin-top: -48px"
  193. ><van-icon name="close" size="16" />&nbsp;不一致</span
  194. >
  195. </div>
  196. </div>
  197. </div>
  198. <p
  199. style="color: #444; font-size: 12px; margin: 0; text-align: right"
  200. v-if="item.collectionOptionList[0].collectionOption">
  201. <van-field
  202. class="mobile-input"
  203. v-model="item.collectionOptionList[0].collectionOption"
  204. autosize
  205. readonly
  206. type="textarea" />
  207. </p>
  208. <div v-if="item.fileInfoList" class="imgBox">
  209. <img
  210. v-for="value in item.fileInfoList"
  211. :src="value.fileUrl"
  212. @click="previewsImg(item.fileInfoList)" />
  213. </div>
  214. </div>
  215. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'duox'">
  216. <van-cell>
  217. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  218. </van-cell>
  219. <div class="selesetText">
  220. <p class="mg0" v-for="(item1, index1) in item.collectionOptionList" :key="index1">
  221. <span v-if="item1.isCheck == 1">{{ item1.collectionOption }}</span>
  222. </p>
  223. </div>
  224. <div v-if="item.fileInfoList" class="imgBox">
  225. <img
  226. v-for="value in item.fileInfoList"
  227. :src="value.fileUrl"
  228. @click="previewsImg(item.fileInfoList)" />
  229. </div>
  230. </div>
  231. <div class="formLabel z-cell z-cells" v-if="item.answerType == 'dx'">
  232. <van-cell>
  233. <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
  234. </van-cell>
  235. <div class="selesetText">
  236. <p class="mg0" v-for="(item2, index2) in item.collectionOptionList" :key="index2">
  237. <span v-if="item2.isCheck == 1">{{ item2.collectionOption }}</span>
  238. </p>
  239. </div>
  240. <div v-if="item.fileInfoList" class="imgBox">
  241. <img
  242. v-for="value in item.fileInfoList"
  243. :src="value.fileUrl"
  244. @click="previewsImg(item.fileInfoList)" />
  245. </div>
  246. </div>
  247. </div>
  248. </van-form>
  249. </div>
  250. <!-- <div class="shopSignImg">
  251. <div class="text">店招照片</div>
  252. <div class="imgBox">
  253. <img
  254. v-if="val && val.qualifiedState"
  255. :src="val.fileUrl"
  256. @click="previewsImg(val.fileUrl)" />
  257. </div>
  258. </div> -->
  259. </div>
  260. </div>
  261. </div>
  262. </template>
  263. <script>
  264. import deleteUploadImg from '@/components/deleteUploadImg';
  265. import { getVisitsDetailPerfectStoreByTaskId } from '@/api/index';
  266. import { ImagePreview } from 'vant';
  267. export default {
  268. name: 'perfectStoreTSJ',
  269. components: { deleteUploadImg },
  270. data() {
  271. return {
  272. visitsId: '',
  273. detail: null,
  274. tiaoSJArr: null,
  275. // collectionItemList: [],
  276. };
  277. },
  278. activated() {
  279. this.visitsId = this.$route.query.visitId || '';
  280. this.detail = null;
  281. this.getVisitsDetailFn();
  282. },
  283. methods: {
  284. getVisitsDetailFn() {
  285. this.toastLoading(0, '加载中...', true);
  286. this.tiaoSJArr = null;
  287. // this.collectionItemList = [];
  288. getVisitsDetailPerfectStoreByTaskId({
  289. visitsId: this.visitsId,
  290. taskId: this.$route.query.taskId,
  291. })
  292. .then((res) => {
  293. this.toastLoading().clear();
  294. if (res.code == 200) {
  295. this.detail = res.data;
  296. this.tiaoSJArr = this.detail;
  297. console.log(this.tiaoSJArr);
  298. for (let i = 0; i < this.tiaoSJArr.length; i++) {
  299. this.filterCollectionItemLists(this.tiaoSJArr[i].collectionItemList);
  300. }
  301. } else {
  302. this.$dialog.alert({
  303. message: res.msg,
  304. });
  305. }
  306. })
  307. .catch((err) => {
  308. this.$dialog.alert({
  309. message: err.msg,
  310. });
  311. });
  312. },
  313. filterCollectionItemLists(item) {
  314. for (let q = 0; q < item.length; q++) {
  315. if (
  316. item[q].answerType == 'sz' ||
  317. item[q].answerType == 'wb' ||
  318. item[q].answerType == 'tel' ||
  319. item[q].answerType == 'date' ||
  320. item[q].answerType == 'tel_send_code' ||
  321. item[q].answerType == 'check_code' ||
  322. item[q].answerType == 'nyr' ||
  323. item[q].answerType == 'dhwb'
  324. ) {
  325. item[q].answerValue = item[q].collectionOptionList[0].answerValue;
  326. }
  327. if (item[q].answerType == 'sm') {
  328. item[q].success = false;
  329. if (
  330. item[q].collectionOptionList[0].answerValue != null &&
  331. item[q].collectionOptionList[0].answerValue != ''
  332. ) {
  333. item[q].equipmentCode2 = item[q].collectionOptionList[0].answerValue.split(',')[1];
  334. if (item[q].collectionOptionList[0].answerValue.split(',')[0] != 'null') {
  335. item[q].equipmentCode1 = item[q].collectionOptionList[0].answerValue.split(',')[0];
  336. } else {
  337. item[q].equipmentCode1 = '编码不存在';
  338. }
  339. if (
  340. item[q].collectionOptionList[0].answerValue.split(',')[0] ==
  341. item[q].collectionOptionList[0].answerValue.split(',')[1]
  342. ) {
  343. item[q].success = true;
  344. }
  345. }
  346. }
  347. if (item[q].answerType == 'duox' || item[q].answerType == 'dx') {
  348. item[q].answerValue = [];
  349. if (item[q].collectionOptionList.length) {
  350. for (var qq = 0; qq < item[q].collectionOptionList.length; qq++) {
  351. if (item[q].collectionOptionList[qq].isCheck == 1) {
  352. item[q].answerValue.push(item[q].collectionOptionList[qq].collectionOptionId);
  353. item[q].collectionOptionList[qq].code = item[q].collectionCode;
  354. item[q].collectionOptionList[qq].answerType = item[q].answerType;
  355. }
  356. }
  357. item[q].answerValue = item[q].answerValue.join();
  358. }
  359. }
  360. }
  361. },
  362. previewsImg(fileInfoList) {
  363. var arrimg = [];
  364. for (var imgi = 0; imgi < fileInfoList.length; imgi++) {
  365. arrimg.push(fileInfoList[imgi].fileUrl);
  366. }
  367. ImagePreview(arrimg);
  368. },
  369. onClickLeft() {
  370. this.$router.go(-1);
  371. },
  372. },
  373. };
  374. </script>
  375. <style lang="scss" scoped>
  376. .perfectStoreTSJ {
  377. width: 100%;
  378. height: 100%;
  379. display: flex;
  380. flex-direction: column;
  381. overflow: hidden;
  382. .content {
  383. flex: 1;
  384. overflow-y: auto;
  385. padding: 10px 15px;
  386. .contentBox {
  387. width: 100%;
  388. margin-top: 10px;
  389. .deviceCode {
  390. font-size: 16px;
  391. background-color: white;
  392. border-radius: 5px;
  393. position: relative;
  394. overflow: hidden;
  395. display: flex;
  396. flex-direction: row;
  397. align-items: center;
  398. margin-bottom: 10px;
  399. // padding: 3px 0;
  400. }
  401. .vertical {
  402. background-color: rgb(25, 137, 250);
  403. height: 14px;
  404. width: 8px;
  405. border-radius: 40px;
  406. margin-right: 10px;
  407. }
  408. .container {
  409. background: #fff;
  410. }
  411. }
  412. // ///////
  413. .specialTask {
  414. display: flex;
  415. flex-direction: row;
  416. padding: 10px;
  417. font-size: 16px;
  418. justify-content: space-between;
  419. background: #e5faff;
  420. .specialTaskLeft {
  421. display: flex;
  422. flex-direction: row;
  423. width: 100%;
  424. }
  425. .SignText {
  426. width: 80px;
  427. font-weight: 600;
  428. }
  429. .signContent {
  430. flex: 1;
  431. display: flex;
  432. flex-direction: row;
  433. margin: 0 8px;
  434. .icon {
  435. padding-top: 2px;
  436. margin-right: 5px;
  437. }
  438. }
  439. }
  440. .shopSignButton {
  441. width: 56px;
  442. button {
  443. width: 55px;
  444. height: 28px;
  445. padding: 0;
  446. font-size: 12px;
  447. }
  448. }
  449. .shopSignImg {
  450. .text {
  451. font-size: 16px;
  452. font-weight: 600;
  453. padding: 15px 10px;
  454. }
  455. }
  456. }
  457. .imgBox {
  458. width: 100%;
  459. text-align: center;
  460. img {
  461. width: 60%;
  462. }
  463. }
  464. }
  465. </style>
  466. <style lang="scss">
  467. .perfectStoreTSJ {
  468. .van-button--danger {
  469. background-color: #ee0a24 !important;
  470. border: 1px solid #ee0a24 !important;
  471. }
  472. .formLabel {
  473. margin: 0 16px;
  474. // padding-bottom: 16px;
  475. border-bottom: 1px solid #f1f1f1;
  476. }
  477. .formLabel .van-cell {
  478. padding: 5px 0;
  479. font-size: 16px;
  480. }
  481. .formLabel .van-cell::after {
  482. border: 0;
  483. }
  484. .formLabel .van-field {
  485. border: 1px solid #f1f1f1;
  486. padding: 6px;
  487. width: 100%;
  488. border-radius: 4px;
  489. overflow: hidden;
  490. }
  491. .formLabel .van-field__control {
  492. padding: 0 10px;
  493. }
  494. .formLabel .formLabeltitle {
  495. position: absolute;
  496. top: 8px;
  497. }
  498. }
  499. </style>