taskDEetailsPage.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. <template>
  2. <view class="box">
  3. <u-navbar :autoBack="true" title="巡查" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
  4. <view>
  5. <view class="xxxc_box">
  6. <view style="display: flex; align-items: center; font-size: 30rpx; font-weight: 600; color: #b75830; margin-bottom: 10rpx">
  7. <uni-icons type="sound" size="22" color="#b75830"></uni-icons>
  8. <view>任务详情</view>
  9. </view>
  10. <view>
  11. <view style="color: #90592a">
  12. <view class="">{{ cr_title }}</view>
  13. <!-- <text>{{ taskDetails.type_text || '暂无任务' }}:</text> -->
  14. <text>巡查时间:{{ taskDetails.progress == 3 ? taskDetails.submit_time : taskDetails.created_at }}</text>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <!-- 线下巡查 -->
  20. <view class="map_tit">
  21. <image style="width: 186rpx; height: 40rpx" src="/static/img/right_img.png"></image>
  22. <view class="">巡查报告</view>
  23. <image style="width: 186rpx; height: 40rpx" src="/static/img/left_img.png"></image>
  24. </view>
  25. <view v-if="taskDetails.progress == '-1'" style="margin-left: 10%; font-size: 36rpx; color: red">驳回原因:{{ taskDetails.feedback }}</view>
  26. <view class="zk_box">
  27. <view @click="AssetBtn(item)" class="zk_item" v-for="(item, index) in assetList" :key="item.id">
  28. <!-- 调整 -->
  29. <view class="top_box" style="">
  30. <view>
  31. <view v-if="item.image != ''">
  32. <image :src="item.image" style="width: 280rpx; height: 200rpx"></image>
  33. </view>
  34. <view v-else style="width: 280rpx; height: 200rpx">
  35. <image
  36. v-if="item.title == '文保牌'"
  37. src="https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/wbp1.png"
  38. style="width: 280rpx; height: 200rpx"
  39. ></image>
  40. <image v-else src="https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/zwtp.png" style="width: 280rpx; height: 200rpx"></image>
  41. </view>
  42. </view>
  43. <view @click="AssetShow = true" class="" style="display: flex; align-items: center">
  44. <view style="margin-left: 20rpx">
  45. <view style="font-size: 32rpx; color: #444444; font-weight: 600">文物{{ item.type_text }}状况</view>
  46. <view style="height: 150rpx; overflow: scroll; margin-top: 20rpx; font-size: 28rpx; font-weight: 400; color: rgba(68, 68, 68, 0.6)">
  47. {{ item.type == 1 ? '文物本体' : item.title }}:{{ item.desc }}
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 调整 -->
  53. <view class="" style="margin-top: 30rpx; display: flex; justify-content: space-between">
  54. <view style="width: 100%; margin: auto">
  55. <!-- <Segmented activeColor="#c87d5a" :current="item.status" :target="item" :values="displayedItems" @clickItem="onClickItem" styleType="button"></Segmented> -->
  56. <view class="fzdj"></view>
  57. <Segmented
  58. activeColor="#c87d5a"
  59. :current="taskDetails.patrolTaskAnnexList[index].status"
  60. :target="item"
  61. :values="displayedItems"
  62. styleType="button"
  63. ></Segmented>
  64. <!-- 每项上传的照片 -->
  65. <view class="" style="display: flex; flex-wrap: wrap; justify-content: start; margin-top: 20rpx">
  66. <image
  67. @click="clickImg(item.extraImages, index2)"
  68. v-for="(item2, index2) in item.extraImages"
  69. :src="item2.url"
  70. :key="item2.index2"
  71. style="width: 210rpx; height: 120rpx; margin-left: 10rpx; margin-top: 10rpx"
  72. ></image>
  73. </view>
  74. <!-- 每项的描述 -->
  75. <!-- :style="{ height: item.describeVal != undefined ? '80rpx' : '0rpx' }" -->
  76. <view style="font-weight: normal; font-size: 30rpx; margin-top: 10rpx; line-height: 40rpx; color: rgba(68, 68, 68, 0.6)">
  77. {{ item.describeVal || '' }}
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <!-- 文物资产详情 -->
  84. <u-popup :show="AssetShow" @close="close" mode="center" :closeable="true" bgColor="#f9dbbf" round="5">
  85. <view class="pop_box">
  86. <view style="text-align: center; margin-right: 20rpx; margin-bottom: 20rpx; font-size: 32rpx">{{ assetDetails.title }}</view>
  87. <view>状况:{{ assetDetails.status_text }}</view>
  88. <view>位置:{{ assetDetails.position ? assetDetails.position : '暂未显示' }}</view>
  89. <view>
  90. <image style="width: 180rpx; height: 140rpx" :src="assetDetails.image"></image>
  91. </view>
  92. </view>
  93. </u-popup>
  94. <view v-if="taskDetails.progress_text == '待审核'" style="margin: auto; width: 90%; display: flex; justify-content: space-around; margin-top: 50rpx">
  95. <view class="tjxc" @click="returnShow = true">驳回</view>
  96. <view class="tjxc" @click="examineTask(3)">通过</view>
  97. </view>
  98. <!-- 驳回描述弹层 -->
  99. <u-popup bgColor="#f2c8a2" :show="returnShow" @close="close" mode="center" customStyle="width:600rpx;padding: 30rpx;" round="20rpx">
  100. <view style="text-align: center; font-size: 30rpx">确认驳回该任务吗?</view>
  101. <view style="margin-top: 20rpx">
  102. <u--textarea height="80" v-model.trim="returnVal" placeholder="请填写驳回原因:"></u--textarea>
  103. </view>
  104. <view class="bt_box">
  105. <view
  106. class="bt1"
  107. @click.stop="
  108. returnShow = false;
  109. returnVal = '';
  110. "
  111. >
  112. 取消
  113. </view>
  114. <view @click.stop="isOk(-1)" class="bt2">确认</view>
  115. </view>
  116. </u-popup>
  117. </view>
  118. </template>
  119. <script>
  120. let that;
  121. export default {
  122. data() {
  123. return {
  124. cr_title: '',
  125. returnShow: false,
  126. returnVal: '',
  127. currents: [],
  128. status: 0,
  129. cr_id: '' /* 文物id */,
  130. cr_code: '' /* 文物编号 */,
  131. taskDetails: {} /* 任务详情 */,
  132. taskId: '' /* 任务id */,
  133. eventTypeId: '' /* 异常事件类型id */,
  134. stateId: '' /* 状态id */,
  135. items: [{ title: '未知' }, { title: '正常', status: 1 }, { title: '异常', status: 2 }],
  136. displayedItems: [],
  137. current: 0,
  138. assetList: [] /* 资产列表 */,
  139. assetDetails: {} /* 资产详情 */,
  140. AssetShow: false,
  141. normal: false,
  142. patrolIndex: '',
  143. describeVal: '',
  144. show: false,
  145. showPicker: false,
  146. situation: '',
  147. // 弹层Tab
  148. // 上传的图片
  149. fileList: []
  150. };
  151. },
  152. onLoad(o) {
  153. // console.log(o, 'ooo');
  154. that = this;
  155. this.task_id = o.id; /* 任务id */
  156. this.cr_id = o.cr_id; /* 文物id */
  157. this.cr_code = o.cr_code;
  158. this.cr_title = o.cr_title;
  159. // 处理状态
  160. this.displayedItems = this.items.map((item) => item.title);
  161. this.getPatrolTaskDetails(o.id);
  162. },
  163. methods: {
  164. // 任务详情
  165. getPatrolTaskDetails(id) {
  166. this.$api.getPatrolTaskDetails({ main_body_id: 1, task_id: id }, function (res) {
  167. // console.log(res, '任务详情');
  168. that.taskDetails = res.data;
  169. that.cr_id = that.taskDetails.cr_id;
  170. that.cr_code = that.taskDetails.cr_code;
  171. that.taskId = that.taskDetails.id;
  172. that.getCrProperty();
  173. // that.taskDetails.patrolTaskAnnexList.forEach((item) => {
  174. // if (item.status == 1) {
  175. // that.status = 1;
  176. // } else if (item.status == 2) {
  177. // that.status = 2;
  178. // }
  179. // });
  180. });
  181. },
  182. // 文物资产列表
  183. getCrProperty() {
  184. this.$api.getCrProperty({ main_body_id: 1, cr_id: this.cr_id }, function (res) {
  185. // console.log(res, 'resres');
  186. if (res.code === 1) {
  187. // that.assetList = res.data;
  188. let alist = res.data;
  189. that.taskDetails.patrolTaskAnnexList.forEach((requestItem, index) => {
  190. // console.log(alist, '999999');
  191. alist.forEach((item, i) => {
  192. if (item.id == requestItem.property_id) {
  193. // console.log(item, '3333333333');
  194. // console.log(alist[i], '1111111111');
  195. alist[i].describeVal = requestItem.desc;
  196. alist[i].extraImages = [];
  197. requestItem.images.forEach((img, imgidx) => {
  198. alist[i].extraImages.push({ url: img });
  199. });
  200. alist[i].status_text = requestItem.status_text;
  201. }
  202. });
  203. });
  204. that.assetList = alist;
  205. } else {
  206. console.log(res.msg);
  207. }
  208. });
  209. },
  210. // 任务审核
  211. examineTask(progress) {
  212. this.$api.examineTask({ main_body_id: 1, task_id: this.task_id, progress: progress, feedback: this.returnVal }, function (res) {
  213. that.$common.errorToShow(res.msg);
  214. });
  215. },
  216. // 确认驳回
  217. isOk(progress) {
  218. if (this.returnVal == '') {
  219. that.$common.errorToShow('请填写描述');
  220. } else {
  221. // console.log(progress, 999999);
  222. this.examineTask(progress);
  223. }
  224. },
  225. // 文物资产项
  226. AssetBtn(item) {
  227. this.assetDetails = item;
  228. this.describeVal = item.describeVal;
  229. },
  230. // 图片预览
  231. clickImg(item, i) {
  232. console.log(item, 66);
  233. console.log(i, 77);
  234. let img = [];
  235. item.forEach((item) => {
  236. img.push(item.url);
  237. });
  238. uni.previewImage({
  239. urls: img, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  240. current: img[i] // 当前显示图片的http链接,默认是第一个
  241. });
  242. },
  243. // 加载字体
  244. loadGlobalFont() {
  245. try {
  246. uni.loadFontFace({
  247. family: 'MyGlobalFont', // 自定义字体名
  248. source: 'url("https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/songTi.ttf")',
  249. success() {
  250. console.log('全局字体加载成功');
  251. }
  252. });
  253. } catch (error) {
  254. console.error('全局字体加载异常', error);
  255. }
  256. },
  257. close() {
  258. this.show = false;
  259. this.showPicker = false;
  260. this.normal = false;
  261. this.AssetShow = false;
  262. this.returnShow = false;
  263. }
  264. }
  265. };
  266. </script>
  267. <style>
  268. .box {
  269. height: auto;
  270. width: 100%;
  271. padding-bottom: 50rpx;
  272. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xy_bgt.png');
  273. background-size: 100% 100%;
  274. /* background-attachment: fixed; */
  275. background-repeat: repeat-y;
  276. min-height: 100%;
  277. height: auto;
  278. font-family: 'MyGlobalFont';
  279. }
  280. .top_box {
  281. padding: 20rpx;
  282. width: 100%;
  283. margin: auto;
  284. display: flex;
  285. border: 2rpx solid #ebc9a9;
  286. background-color: #fefdfb;
  287. }
  288. .u-textarea__field.data-v-09988a29 {
  289. color: #000000 !important;
  290. }
  291. .u-textarea.data-v-09988a29 {
  292. background-color: #f1bd8e !important;
  293. }
  294. .active {
  295. color: #fae5bb !important;
  296. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/cy_tit1.png') !important;
  297. }
  298. /deep/.u-textarea.data-v-09988a29 {
  299. background-color: #f1bd8e !important;
  300. border-radius: 0;
  301. }
  302. /deep/.u-textarea.data-v-09988a29 {
  303. background-color: #f1bd8e !important;
  304. }
  305. .tab_active {
  306. background-color: #b75830 !important;
  307. }
  308. .filter-box {
  309. padding: 30upx 50upx 0 50upx;
  310. margin-bottom: 30upx;
  311. display: flex;
  312. align-items: center;
  313. justify-content: space-between;
  314. }
  315. .filter-box .b-item {
  316. width: 278rpx;
  317. height: 80rpx;
  318. font-size: 30rpx;
  319. color: #ffefc4;
  320. font-weight: 600;
  321. text-align: center;
  322. line-height: 80rpx;
  323. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/cy_tit2.png');
  324. background-size: 100% 100%;
  325. }
  326. .map_tit {
  327. display: flex;
  328. align-items: center;
  329. margin-left: 125rpx;
  330. margin-top: 50rpx;
  331. font-size: 32rpx;
  332. font-weight: 900;
  333. line-height: 52rpx;
  334. color: #444444;
  335. }
  336. .map_tit2 {
  337. position: relative;
  338. top: -176rpx;
  339. }
  340. .jk_box {
  341. display: flex;
  342. flex-wrap: wrap;
  343. justify-content: space-between;
  344. width: 90%;
  345. margin: auto;
  346. }
  347. .img {
  348. width: 100%;
  349. height: 100%;
  350. }
  351. .jk_item {
  352. width: 310rpx;
  353. height: 230rpx;
  354. margin-top: 40rpx;
  355. }
  356. .zk_box {
  357. width: 90%;
  358. margin: auto;
  359. margin-top: 30rpx;
  360. }
  361. .zk_item {
  362. /* justify-content: space-between;
  363. display: flex; */
  364. font-size: 30rpx;
  365. font-weight: 600;
  366. margin-top: 40rpx;
  367. }
  368. .zk_item2 {
  369. display: block !important;
  370. font-size: 30rpx;
  371. font-weight: 600;
  372. margin-top: 40rpx;
  373. }
  374. .tjxc {
  375. width: 230rpx;
  376. height: 82rpx;
  377. font-size: 30rpx;
  378. font-weight: 600;
  379. color: #fef3e1;
  380. line-height: 82rpx;
  381. text-align: center;
  382. background-color: #c87d5a;
  383. }
  384. .pop_box {
  385. width: 635rpx;
  386. padding: 80rpx 40rpx 40rpx 40rpx;
  387. font-size: 30rpx;
  388. font-weight: 600;
  389. }
  390. .pop_item {
  391. height: 60rpx;
  392. border-radius: 10rpx;
  393. text-align: center;
  394. padding: 10rpx;
  395. border: 2rpx solid #d67b54;
  396. }
  397. .lx {
  398. display: flex;
  399. justify-content: space-between;
  400. width: 515rpx;
  401. height: 70rpx;
  402. margin: auto;
  403. margin-top: 30rpx;
  404. border: 2rpx solid #d67b54;
  405. border-radius: 10rpx;
  406. line-height: 70rpx;
  407. padding-left: 20rpx;
  408. padding-right: 20rpx;
  409. }
  410. .fzdj {
  411. width: 92%;
  412. height: 40px;
  413. background-color: transparent;
  414. position: absolute;
  415. z-index: 1;
  416. }
  417. .tit_box {
  418. width: 530rpx;
  419. display: flex;
  420. justify-content: space-between;
  421. align-items: center;
  422. margin-bottom: 40rpx;
  423. }
  424. .tit_box2 {
  425. width: 630rpx;
  426. display: flex;
  427. justify-content: space-between;
  428. align-items: center;
  429. margin-top: 40rpx;
  430. margin-left: 80rpx;
  431. }
  432. .zque {
  433. width: 260rpx;
  434. height: 70rpx;
  435. margin: auto;
  436. text-align: center;
  437. line-height: 70rpx;
  438. background-color: #ffffff;
  439. border-radius: 10rpx;
  440. }
  441. .xxxc_box {
  442. /* height: 400rpx; */
  443. margin: auto;
  444. padding: 50rpx 70rpx 80rpx 90rpx;
  445. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xxxc_top.png');
  446. background-size: 100% 100%;
  447. }
  448. .wwmc {
  449. display: flex;
  450. align-items: center;
  451. justify-content: space-around;
  452. }
  453. .wwmc_left {
  454. display: flex;
  455. align-items: center;
  456. justify-content: space-around;
  457. width: 250rpx;
  458. height: 60rpx;
  459. line-height: 60rpx;
  460. background-color: #f1bd8e;
  461. border-radius: 10rpx;
  462. font-size: 30rpx;
  463. }
  464. .wwmc_right {
  465. width: 250rpx;
  466. height: 60rpx;
  467. text-align: center;
  468. line-height: 60rpx;
  469. background-color: #f1bd8e;
  470. border-radius: 6rpx;
  471. font-size: 30rpx;
  472. }
  473. .wwmc_right2 {
  474. width: 250rpx;
  475. height: 60rpx;
  476. text-align: center;
  477. /* line-height: 60rpx; */
  478. background-color: #f1bd8e;
  479. border-radius: 6rpx;
  480. font-size: 30rpx;
  481. }
  482. .bt_box {
  483. display: flex;
  484. margin-top: 100rpx;
  485. justify-content: space-around;
  486. }
  487. .bt1 {
  488. width: 220rpx;
  489. height: 78rpx;
  490. border: 1px solid #312520;
  491. border-radius: 39rpx;
  492. text-align: center;
  493. line-height: 78rpx;
  494. color: black;
  495. }
  496. .bt2 {
  497. width: 220rpx;
  498. height: 78rpx;
  499. background: #ca5642;
  500. border-radius: 39rpx;
  501. text-align: center;
  502. line-height: 78rpx;
  503. color: #ffffff;
  504. }
  505. </style>