nandufysq.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. <template>
  2. <zj-page-layout :hasFooter="true">
  3. <view class="all-container">
  4. <view class="info-container card mt30" v-if="orderDetail">
  5. <view class="common-title"><text>工单信息</text></view>
  6. <view>
  7. <view class="row">
  8. <view class="label">订单编号</view>
  9. <view class="value">{{ orderDetail.id }}</view>
  10. <view class="ctrl" @tap="$copy(orderDetail.id)">复制</view>
  11. </view>
  12. <view class="row">
  13. <view class="label">客户名称</view>
  14. <view class="value">{{ orderDetail.userName }}</view>
  15. </view>
  16. <view class="row">
  17. <view class="label">客户电话</view>
  18. <view class="value">{{ orderDetail.userMobile }}</view>
  19. </view>
  20. <view class="row">
  21. <view class="label">客户地址</view>
  22. <view class="value">
  23. {{ orderDetail.province || '' }}{{ orderDetail.city || '' }}{{ orderDetail.area || ''
  24. }}{{ orderDetail.street || '' }}{{ orderDetail.address || orderDetail.gpsAddress }}
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- -->
  30. <!-- -->
  31. <!-- -->
  32. <!-- -->
  33. <!-- -->
  34. <view class="mt30 remark-container">
  35. <view class="common-title"
  36. ><text><text>*</text>申请理由</text></view
  37. >
  38. <u--textarea
  39. v-model="remarkVal"
  40. :disabled="!isBinji"
  41. placeholder="请输入备注内容"
  42. fixed
  43. border="none"
  44. height="120"
  45. ></u--textarea>
  46. </view>
  47. <!-- -->
  48. <!-- -->
  49. <!-- -->
  50. <!-- -->
  51. <!-- -->
  52. <view class="mt30 remark-container">
  53. <view class="common-title"
  54. ><text><text>*</text>问题描述</text></view
  55. >
  56. <u--textarea
  57. v-model="remarkVal2"
  58. :disabled="!isBinji"
  59. placeholder="请输入备注内容"
  60. fixed
  61. border="none"
  62. height="120"
  63. ></u--textarea>
  64. </view>
  65. <!-- -->
  66. <!-- -->
  67. <!-- -->
  68. <!-- -->
  69. <!-- -->
  70. <view class="mt30 image-container">
  71. <view class="common-title"
  72. ><text><text>*</text>环境照片(最多15张,可上传图片或视频)</text></view
  73. >
  74. <view class="images">
  75. <block v-for="(item, index) in imageList" :key="index">
  76. <view class="img">
  77. <image v-if="isImage(item.url)" :src="item.url" mode="aspectFill" @tap="prevImg(item.url)"></image>
  78. <image
  79. v-if="!isImage(item.url)"
  80. src="@/static/common/shipin.png"
  81. mode="aspectFill"
  82. @tap="prevVideo(item.url)"
  83. ></image>
  84. <text v-if="isBinji" class="iconfont icon-guanbi1" @tap="delImage(index)"></text>
  85. </view>
  86. </block>
  87. <view class="add" @tap="addImage" v-if="imageList.length < 15 && isBinji">
  88. <text class="iconfont icon-xiangji"></text>
  89. <text class="text">添加图片</text>
  90. </view>
  91. </view>
  92. </view>
  93. <!-- -->
  94. <!-- -->
  95. <!-- -->
  96. <!-- -->
  97. <!-- -->
  98. <view
  99. class="info-container card mt30"
  100. v-if="oldData && oldData.workerInvolveApplyItems && oldData.workerInvolveApplyItems.length"
  101. >
  102. <view class="common-title">
  103. <text>审核信息</text>
  104. <text style="color: orange">
  105. {{ returnText(oldData) }}
  106. </text>
  107. </view>
  108. <view>
  109. <view class="row">
  110. <view class="label">申请时间</view>
  111. <view class="value">{{ oldData.createTime }}</view>
  112. </view>
  113. <view class="row">
  114. <view class="label">审批费用</view>
  115. <view class="value">{{ oldData.maintenancePricePass || oldData.websitMaintenancePricePass }}</view>
  116. </view>
  117. <view class="row">
  118. <view class="label">审批时间</view>
  119. <view class="value">{{ oldData.auditTime || oldData.websitAuditTime }}</view>
  120. </view>
  121. <view class="row">
  122. <view class="label">审批备注</view>
  123. <view class="value">{{ oldData.remark || oldData.websitRemark }} </view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. <template slot="footer">
  129. <view class="footer-btn-group" v-if="!oldData">
  130. <u-button text="提交" type="primary" size="large" @click="submitData"></u-button>
  131. </view>
  132. <view class="footer-btn-group" v-if="oldData && oldData.status == 2">
  133. <u-button text="重新申请" type="primary" size="large" @click="shenheapi"></u-button>
  134. </view>
  135. </template>
  136. <video
  137. v-if="videoUrl"
  138. :src="videoUrl"
  139. style="width: 100%; height: 100%; position: fixed; top: 0; left: 0; z-index: 99999999999999"
  140. ></video>
  141. <cover-image
  142. v-if="videoUrl"
  143. style="
  144. width: 120rpx;
  145. height: 120rpx;
  146. position: fixed;
  147. right: 10rpx;
  148. top: 10rpx;
  149. z-index: 9999999999999999;
  150. border-radius: 50%;
  151. "
  152. @click="videoUrl = ''"
  153. src="@/static/common/guanbi.png"
  154. ></cover-image>
  155. </zj-page-layout>
  156. </template>
  157. <script>
  158. import { uploadImgFull } from '@/common/utils/util.js'
  159. export default {
  160. components: {},
  161. data() {
  162. return {
  163. remarkVal: '',
  164. remarkVal2: '',
  165. imageList: [],
  166. orderDetail: null,
  167. canClickBtn: true,
  168. oldData: null,
  169. videoUrl: ''
  170. }
  171. },
  172. computed: {
  173. isBinji() {
  174. return !this.oldData || this.oldData?.status == 2
  175. }
  176. },
  177. async onLoad({ id, type }) {
  178. this.id = id
  179. this.getOrderDetail()
  180. this.$api
  181. .post('/workerApply/detail', {
  182. orderBaseId: this.id
  183. })
  184. .then(res => {
  185. if (res.data) {
  186. this.oldData = res.data
  187. this.remarkVal = res.data.reason
  188. this.remarkVal2 = res.data.problemDescription
  189. this.imageList = res.data?.image ? res.data.image.split(',').map(url => ({ url })) : []
  190. }
  191. })
  192. .catch(res => {})
  193. },
  194. methods: {
  195. returnText(data) {
  196. return { 1: '待网点审核', 2: '驳回重申', 3: '待中心审核', 4: '驳回禁止申诉', 5: '通过审核' }[data.status]
  197. },
  198. // 获取详情
  199. getOrderDetail() {
  200. return new Promise((resolve, reject) => {
  201. this.$api
  202. .post('/pg/order/base/detail', {
  203. orderBaseId: this.id
  204. })
  205. .then(res => {
  206. this.orderDetail = res.data
  207. resolve(1)
  208. })
  209. .catch(res => {
  210. reject(0)
  211. })
  212. })
  213. },
  214. // 添加图片
  215. async addImage() {
  216. uni.showActionSheet({
  217. title: '上传图片或视频',
  218. itemList: ['图片', '视频'],
  219. itemColor: '#000',
  220. success: e => {
  221. if (e.tapIndex === 0) {
  222. uni.chooseImage({
  223. count: 6 - this.imageList.length,
  224. success: res => {
  225. uni.showLoading()
  226. res.tempFilePaths.forEach(async item => {
  227. let data = await uploadImgFull(item)
  228. this.imageList.push(data)
  229. })
  230. uni.hideLoading()
  231. },
  232. fail: err => {
  233. alert(err)
  234. }
  235. })
  236. } else if (e.tapIndex === 1) {
  237. uni.chooseVideo({
  238. compressed: true,
  239. sourceType: ['camera', 'album'],
  240. camera: 'back',
  241. success: async res => {
  242. uni.showLoading()
  243. let data = await uploadImgFull(res.tempFilePath)
  244. this.imageList.push(data)
  245. uni.hideLoading()
  246. },
  247. fail: err => {
  248. alert(err)
  249. }
  250. })
  251. }
  252. },
  253. fail: e => {
  254. console.log(e)
  255. }
  256. })
  257. },
  258. isImage(ext) {
  259. return ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff'].includes(
  260. ext.substr(ext.lastIndexOf('.') + 1)
  261. )
  262. },
  263. // 删除图片
  264. delImage(index) {
  265. this.imageList.splice(index, 1)
  266. },
  267. //预览图片
  268. prevImg(current) {
  269. uni.previewImage({
  270. current,
  271. urls: this.imageList.map(item => {
  272. return item.url
  273. })
  274. })
  275. },
  276. prevVideo(current) {
  277. this.videoUrl = current
  278. },
  279. // 提交
  280. async submitData() {
  281. if (!this.canClickBtn) return this.$toast('请勿频繁操作')
  282. this.canClickBtn = false
  283. setTimeout(() => {
  284. this.canClickBtn = true
  285. }, 3000)
  286. var params = {
  287. orderBaseId: this.id
  288. }
  289. if (!this.remarkVal) {
  290. return this.$toast('请填写申请理由')
  291. } else {
  292. params.reason = this.remarkVal
  293. }
  294. if (!this.remarkVal2) {
  295. return this.$toast('请填写问题描述')
  296. } else {
  297. params.problemDescription = this.remarkVal2
  298. }
  299. if (!this.imageList.length) {
  300. return this.$toast('请上传环境照片')
  301. } else {
  302. params.image = this.imageList
  303. .map(item => {
  304. return item.url
  305. })
  306. .join(',')
  307. }
  308. this.$api
  309. .postJson('/workerApply/add', {
  310. ...params
  311. })
  312. .then(res => {
  313. this.canClickBtn = true
  314. this.submitSuccess()
  315. })
  316. },
  317. async shenheapi() {
  318. if (!this.canClickBtn) return this.$toast('请勿频繁操作')
  319. this.canClickBtn = false
  320. setTimeout(() => {
  321. this.canClickBtn = true
  322. }, 3000)
  323. var params = {
  324. id: this.oldData.id,
  325. orderBaseId: this.id
  326. }
  327. if (!this.remarkVal) {
  328. return this.$toast('请填写申请理由')
  329. } else {
  330. params.reason = this.remarkVal
  331. }
  332. if (!this.remarkVal2) {
  333. return this.$toast('请填写问题描述')
  334. } else {
  335. params.problemDescription = this.remarkVal2
  336. }
  337. if (!this.imageList.length) {
  338. return this.$toast('请上传环境照片')
  339. } else {
  340. params.image = this.imageList
  341. .map(item => {
  342. return item.url
  343. })
  344. .join(',')
  345. }
  346. this.$api
  347. .postJson('/workerApply/update', {
  348. ...params
  349. })
  350. .then(res => {
  351. this.canClickBtn = true
  352. this.submitSuccess()
  353. })
  354. },
  355. submitSuccess(tab = '') {
  356. this.$successToast('提交成功')
  357. setTimeout(() => {
  358. this.$navToPage(
  359. {
  360. delta: 1
  361. },
  362. 'navigateBack'
  363. )
  364. }, 500)
  365. }
  366. }
  367. }
  368. </script>
  369. <style lang="scss" scoped>
  370. .all-container {
  371. padding-bottom: 30rpx;
  372. }
  373. .common-title {
  374. font-size: 32rpx;
  375. font-weight: 600;
  376. padding: 30rpx 0;
  377. display: flex;
  378. justify-content: space-between;
  379. text {
  380. text {
  381. color: $minor-color;
  382. }
  383. }
  384. }
  385. .type-container {
  386. background: #ffffff;
  387. padding: 0 30rpx;
  388. .list {
  389. display: flex;
  390. flex-wrap: wrap;
  391. justify-content: space-between;
  392. .item {
  393. width: calc((100% - 30rpx) / 3);
  394. height: 80rpx;
  395. line-height: 80rpx;
  396. text-align: center;
  397. border-radius: 20rpx;
  398. background: #f4f5f9;
  399. margin-bottom: 30rpx;
  400. &.active {
  401. background: $theme-color;
  402. color: #ffffff;
  403. }
  404. }
  405. }
  406. }
  407. .date-conteiner {
  408. background: #ffffff;
  409. padding: 30rpx 30rpx;
  410. .item {
  411. display: flex;
  412. align-items: center;
  413. justify-content: space-between;
  414. height: 50rpx;
  415. .label {
  416. margin-right: 30rpx;
  417. text {
  418. color: $error-color;
  419. }
  420. }
  421. .picker {
  422. .placeholder {
  423. color: $sec-font;
  424. }
  425. .iconfont {
  426. margin-left: 12rpx;
  427. color: $sec-font;
  428. }
  429. }
  430. }
  431. }
  432. .over-container {
  433. background: #ffffff;
  434. padding: 10rpx 30rpx;
  435. .row {
  436. height: 100rpx;
  437. display: flex;
  438. align-items: center;
  439. justify-content: space-between;
  440. .label {
  441. font-size: 32rpx;
  442. font-weight: 600;
  443. display: flex;
  444. align-items: center;
  445. text {
  446. color: $minor-color;
  447. }
  448. ::v-deep .u-icon {
  449. margin-left: 8rpx;
  450. }
  451. }
  452. .btn {
  453. ::v-deep .u-button {
  454. height: 60rpx;
  455. }
  456. }
  457. }
  458. }
  459. .sign-container {
  460. background: #ffffff;
  461. padding: 0 30rpx 30rpx;
  462. .empty {
  463. height: 200rpx;
  464. background: #f4f5f9;
  465. display: flex;
  466. align-items: center;
  467. justify-content: center;
  468. border-radius: 12rpx;
  469. color: $sec-font;
  470. }
  471. .img {
  472. position: relative;
  473. image {
  474. width: 100%;
  475. height: 200rpx;
  476. }
  477. text {
  478. position: absolute;
  479. right: -10rpx;
  480. top: -10rpx;
  481. width: 40rpx;
  482. height: 40rpx;
  483. border-radius: 50%;
  484. background: #ff3f42;
  485. font-size: 24rpx;
  486. color: #ffffff;
  487. text-align: center;
  488. line-height: 40rpx;
  489. display: block;
  490. }
  491. }
  492. }
  493. .remark-container {
  494. padding: 1rpx 30rpx 30rpx;
  495. background: #ffffff;
  496. ::v-deep .u-textarea {
  497. background: #f4f5f9;
  498. }
  499. }
  500. .image-container {
  501. padding: 1rpx 30rpx 30rpx;
  502. background: #ffffff;
  503. .images {
  504. display: flex;
  505. flex-wrap: wrap;
  506. .add {
  507. display: flex;
  508. flex-direction: column;
  509. align-items: center;
  510. justify-content: center;
  511. width: 146rpx;
  512. height: 146rpx;
  513. border: 2rpx dashed #dadada;
  514. border-radius: 10rpx;
  515. margin-top: 20rpx;
  516. .iconfont {
  517. font-size: 48rpx;
  518. color: #999999;
  519. }
  520. .text {
  521. font-size: 24rpx;
  522. color: #999999;
  523. margin-top: 10rpx;
  524. }
  525. }
  526. .img {
  527. position: relative;
  528. margin-right: 20rpx;
  529. margin-top: 20rpx;
  530. &:nth-child(4n) {
  531. margin-right: 0;
  532. }
  533. image {
  534. width: 150rpx;
  535. height: 150rpx;
  536. border-radius: 10rpx;
  537. overflow: hidden;
  538. display: block;
  539. }
  540. text {
  541. position: absolute;
  542. right: -10rpx;
  543. top: -10rpx;
  544. width: 40rpx;
  545. height: 40rpx;
  546. border-radius: 50%;
  547. background: #ff3f42;
  548. font-size: 24rpx;
  549. color: #ffffff;
  550. text-align: center;
  551. line-height: 40rpx;
  552. display: block;
  553. }
  554. }
  555. }
  556. }
  557. .info-container {
  558. background: #ffffff;
  559. padding: 30rpx;
  560. .row {
  561. display: flex;
  562. margin-top: 20rpx;
  563. &:first-child {
  564. margin-top: 0;
  565. }
  566. .label {
  567. font-size: 28rpx;
  568. color: $sec-font;
  569. margin-right: 20rpx;
  570. flex-shrink: 0;
  571. }
  572. .value {
  573. font-size: 28rpx;
  574. }
  575. .ctrl {
  576. font-size: 28rpx;
  577. color: $theme-color;
  578. margin-left: 20rpx;
  579. }
  580. }
  581. }
  582. // .card {
  583. // @include zj-card;
  584. // }
  585. </style>