taskDEetailsPage.vue 13 KB

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