taskPhotoTaking.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <template>
  2. <div class="taskPhotoTaking">
  3. <van-nav-bar class="navBar" left-arrow title="生动化陈列" @click-left="onClickLeft">
  4. <template #right>
  5. <span
  6. v-if="isEdit && insert == '1'"
  7. @click="onSubmit"
  8. style="
  9. color: white;
  10. background: rgb(0, 87, 186);
  11. display: block;
  12. padding: 6px 10px;
  13. border-radius: 6px;
  14. "
  15. >保存</span
  16. >
  17. </template>
  18. </van-nav-bar>
  19. <div class="content" v-if="formData">
  20. <div class="container">
  21. <van-form ref="tabstoreVal">
  22. <div v-for="(item, index) in formData.collectionItemList" :key="index">
  23. <div v-if="item.answerType == 'zp'" class="formLabel z-cell">
  24. <van-cell>
  25. <template #title>
  26. <!-- <span v-if="item.isMust == 0" class="van-f-red">*</span> -->
  27. <div class="headline">
  28. <span class="headlineIcon"></span>
  29. <span class="headlineTitle">上传照片</span>
  30. </div>
  31. <!-- 操作说明图片和电话 -->
  32. <taskTips
  33. v-if="item.contactPhone || item.examplePhoto"
  34. :contactPhone="item.contactPhone"
  35. :examplePhoto="item.examplePhoto">
  36. </taskTips>
  37. </template>
  38. </van-cell>
  39. <deleteUploadImg
  40. :imgs="item.fileInfoList"
  41. :storeGroupId="storeGroupId"
  42. :taskIds="taskIds"
  43. :visitsId="visitsId"
  44. :collectionItemId="item.collectionId"
  45. :putInCode="formData.putInCode"
  46. :photoIdentifyType="formData.photoIdentifyType"
  47. @upDataDetail="getDetaile"
  48. :pictureSource="item.pictureSource"
  49. :continuousShoot="item.continuousShoot"
  50. :insert="insert"
  51. :objectType="objectType"></deleteUploadImg>
  52. </div>
  53. </div>
  54. </van-form>
  55. </div>
  56. <div class="dataList" v-if="dataList">
  57. <div class="headline" style="margin-top: 10px">
  58. <span class="headlineIcon"></span>
  59. <span class="headlineTitle">门店参与的陈列任务要求</span>
  60. </div>
  61. <div class="dataItem" v-for="(item, index) in dataList">
  62. <div class="itemTop">
  63. <div class="itemIndex">
  64. <p>{{ index + 1 }}、</p>
  65. </div>
  66. <div class="itemHtml" v-html="item.displayInstructions"></div>
  67. </div>
  68. <div class="itemBottom" v-if="insert == '0'">
  69. <img
  70. @click="openDialog(item)"
  71. :src="
  72. item.taskPhotoConditionPassed == 1
  73. ? require('@/assets/taskPhotoSu.png')
  74. : require('@/assets/taskPhotoErr.png')
  75. " />
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <el-dialog
  81. title="识别结果"
  82. :visible.sync="vanPopup"
  83. width="80%"
  84. :append-to-body="true"
  85. :close-on-click-modal="false"
  86. @close="vanPopup == false"
  87. custom-class="identifyResultdialog">
  88. <!-- 识别结果 -->
  89. <div class="identifyResult" v-if="taskPhotoRecognitionResult" style="padding: 0 10px">
  90. <div class="resultContent">
  91. <el-table
  92. :data="taskPhotoRecognitionResult"
  93. border
  94. class="table-headermd1"
  95. style="width: 100%">
  96. <el-table-column label="" type="index" width="50px" align="center" />
  97. <el-table-column label="产品" prop="skuProductName" align="center" />
  98. <el-table-column label="要求" prop="conditionIdentifyNum" align="center" width="60px">
  99. </el-table-column>
  100. <el-table-column
  101. label="识别排面数"
  102. prop="identifyTheNumberOfCards"
  103. width="70px"
  104. align="center"
  105. >meetTheStandard
  106. <template slot-scope="scope">
  107. <span :style="{ color: scope.row.meetTheStandard == 1 ? '#07c160' : 'red' }">
  108. {{ scope.row.identifyTheNumberOfCards }}
  109. </span>
  110. </template>
  111. </el-table-column>
  112. </el-table>
  113. </div>
  114. </div>
  115. </el-dialog>
  116. </div>
  117. </template>
  118. <script>
  119. import { getCollectionInfosBatch, addCollectionAnswerBatch, getVisitsDetail } from '@/api/index';
  120. import taskTips from './taskTips';
  121. import deleteUploadImg from '@/components/deleteUploadImgTaskPhoto';
  122. export default {
  123. name: 'abnortaskPhotoTakingmalVisit',
  124. components: { taskTips, deleteUploadImg },
  125. data() {
  126. return {
  127. isEdit: true,
  128. formData: null,
  129. dataList: null,
  130. taskIds: [],
  131. visitsId: null,
  132. storeGroupId: '',
  133. objectType: '',
  134. insert: '',
  135. vanPopup: false,
  136. taskPhotoRecognitionResult: null,
  137. };
  138. },
  139. activated() {
  140. this.taskIds = this.$route.query.taskIds || [];
  141. this.visitsId = this.$route.query.visitsId || '';
  142. this.storeGroupId = this.$route.query.storeGroupId || '';
  143. this.objectType = this.$route.query.photoType || '';
  144. this.insert = this.$route.query.insert;
  145. if (this.$route.query.source == 'historicalDetails') {
  146. this.getVisitsDetailFun();
  147. } else {
  148. this.getDetaile();
  149. }
  150. },
  151. methods: {
  152. getVisitsDetailFun() {
  153. this.toastLoading(0, '加载中...', true);
  154. getVisitsDetail({ visitsId: this.visitsId }).then((res) => {
  155. this.toastLoading().clear();
  156. if (res.data.sfaTaskList) {
  157. this.dataList = res.data.sfaTaskList.filter((val) => val.taskType == '5');
  158. this.formData = this.dataList[0];
  159. } else {
  160. this.formData = null;
  161. }
  162. });
  163. },
  164. getDetaile() {
  165. console.log(this.$route.query);
  166. getCollectionInfosBatch({
  167. storeCode: this.$route.query.storeCode,
  168. insert: this.insert == '1' ? true : false,
  169. id: this.visitsId,
  170. taskIds: this.taskIds.split(','),
  171. }).then((res) => {
  172. if (res.data && res.data.length) {
  173. this.dataList = res.data;
  174. this.formData = res.data[0];
  175. } else {
  176. this.formData = null;
  177. }
  178. });
  179. },
  180. openDialog(item) {
  181. this.vanPopup = true;
  182. this.taskPhotoRecognitionResult = item.taskPhotoRecognitionResult;
  183. },
  184. onSubmit() {
  185. let formData = {
  186. storeId: this.$route.query.storeId,
  187. storeCode: this.$route.query.storeCode,
  188. storeGroupId: this.$route.query.storeGroupId,
  189. visitsId: this.visitsId,
  190. taskList: this.taskIds.split(',').map((val) => Number(val)),
  191. insert: true,
  192. collectionAnswers: [],
  193. checkUnManage: 'N',
  194. deviceCode: '',
  195. putInCode: '',
  196. equipmentCode: '',
  197. };
  198. addCollectionAnswerBatch(formData).then((res) => {
  199. if (res.code == 200) {
  200. localStorage.setItem('getRequestFlage', 'true');
  201. this.$router.go(-1);
  202. }
  203. });
  204. },
  205. onClickLeft() {
  206. this.$router.go(-1);
  207. },
  208. },
  209. };
  210. </script>
  211. <style lang="scss" scoped>
  212. .taskPhotoTaking {
  213. display: flex;
  214. flex-direction: column;
  215. width: 100%;
  216. height: 100%;
  217. overflow: hidden;
  218. .content {
  219. padding: 10px;
  220. flex: 1;
  221. width: 100%;
  222. height: 100%;
  223. display: flex;
  224. flex-direction: column;
  225. padding-bottom: 46px;
  226. .container {
  227. background: #fff;
  228. width: 100%;
  229. border-radius: 6px;
  230. // padding: 10px;
  231. padding: 0 10px 10px 0px;
  232. }
  233. .formLabel {
  234. // margin-left: 20px;
  235. border-bottom: 1px solid #f1f1f1;
  236. }
  237. .formLabel .van-cell {
  238. padding: 10px 0;
  239. }
  240. .formLabel .van-cell::after {
  241. border: 0;
  242. }
  243. .formLabel .van-field {
  244. border: 1px solid #f1f1f1;
  245. padding: 6px;
  246. width: 100%;
  247. border-radius: 4px;
  248. overflow: hidden;
  249. }
  250. .formLabel .van-field__control {
  251. padding: 0 10px;
  252. }
  253. .formLabel .formLabeltitle {
  254. position: absolute;
  255. top: 8px;
  256. }
  257. .z-cell .van-cell__title {
  258. font-size: 16px;
  259. }
  260. .van-f-red {
  261. color: red;
  262. width: 8px;
  263. display: inline-block;
  264. line-height: 26px;
  265. }
  266. .headline {
  267. font-weight: 600;
  268. font-size: 16px;
  269. position: relative;
  270. display: flex;
  271. align-items: center;
  272. .headlineIcon {
  273. display: inline-block;
  274. position: absolute;
  275. width: 3px;
  276. height: 60%;
  277. background: #3875c6;
  278. left: 5px;
  279. }
  280. .headlineTitle {
  281. display: inline-block;
  282. padding: 8px 20px;
  283. background: #eef5ff;
  284. border-radius: 0 20px 20px 0;
  285. }
  286. }
  287. }
  288. .dataList {
  289. width: 100%;
  290. margin-top: 10px;
  291. overflow-y: auto;
  292. background: #fff;
  293. .dataItem {
  294. display: flex;
  295. border-radius: 6px;
  296. flex-direction: row;
  297. margin-bottom: 10px;
  298. // padding: 10px;
  299. font-size: 16px;
  300. padding-left: 20px;
  301. .itemIndex {
  302. }
  303. .itemTop {
  304. flex: 1;
  305. overflow: hidden;
  306. border-bottom: 1px solid #a7a5a5;
  307. padding-bottom: 10px;
  308. .itemHtml {
  309. overflow-x: auto;
  310. }
  311. }
  312. .itemTop,
  313. .itemBottom {
  314. display: flex;
  315. flex-direction: row;
  316. }
  317. .itemBottom {
  318. align-items: center;
  319. width: 40px;
  320. margin-left: 5px;
  321. img {
  322. width: 100%;
  323. height: 33px;
  324. }
  325. }
  326. }
  327. }
  328. }
  329. </style>
  330. <style lang="scss">
  331. // .taskPhotoTaking {
  332. // .itenHtml {
  333. // overflow: hidden;
  334. // img {
  335. // width: 100%;
  336. // }
  337. // }
  338. // }
  339. .identifyResultdialog {
  340. width: vw(690) !important;
  341. margin-top: 1vh !important;
  342. border-radius: 8px !important;
  343. font-size: vw(32) !important;
  344. height: 70% !important;
  345. display: flex;
  346. flex-direction: column;
  347. .el-dialog__headerbtn {
  348. width: vw(44);
  349. height: vw(44);
  350. background-color: #e1e1e1;
  351. border-radius: 50%;
  352. margin-top: -3px;
  353. }
  354. .el-dialog__body {
  355. flex: 1;
  356. overflow-y: auto;
  357. }
  358. }
  359. .table-headermd1 {
  360. font-size: 14px;
  361. text-align: center;
  362. position: initial;
  363. width: 98% !important;
  364. margin: 0 auto;
  365. border-right: 0;
  366. border-radius: 8px;
  367. th {
  368. color: #000;
  369. font-weight: bold;
  370. }
  371. td {
  372. color: #000;
  373. }
  374. .el-table__cell {
  375. padding: 6px 0 !important;
  376. .cell {
  377. padding: 0;
  378. }
  379. }
  380. }
  381. </style>