taskDEetailsPage.vue 13 KB

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