taskDEetailsPage.vue 13 KB

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