index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. <template>
  2. <view class="container">
  3. <uni-navbar title="运输申请"></uni-navbar>
  4. <view class="box commonMt" style="overflow: hidden;">
  5. <view class="topMap">
  6. <mapPreview :startPoint='form.startPoint' :endPoint='form.endPoint' v-show="isMap"
  7. :mtRoutePointList='form.mtRoutePointList'></mapPreview>
  8. </view>
  9. <view class="box3">
  10. <view class="addLineSuccess-big-box commonBj commonMt">
  11. <view class="addLineSuccess-big-box-top">
  12. <image style="width: 45rpx;height: 45rpx; margin-left: 30rpx;"
  13. src="../../static/images/transport/dingwei.png" mode="widthFix">
  14. </image>
  15. <text class="listTitle">路线信息</text>
  16. </view>
  17. <view class="addLineSuccess-big-box-bottom" style="padding-bottom: 40rpx;">
  18. <view class="addLineSuccess-big-box-bottom-item">
  19. <view class="flexAlignCenter">
  20. <view class="greenCircle">
  21. </view>
  22. <text class="itemText">运输名称:</text>
  23. </view>
  24. <view class="flexAlignCenter">
  25. <text class="infoText">{{form.transportName}}</text>
  26. </view>
  27. </view>
  28. <!-- <view class="map">
  29. <mapImg :startPoint='form.startPoint' :endPoint='form.endPoint'
  30. :mtRoutePointList='form.mtRoutePointList'></mapImg>
  31. </view> -->
  32. <view class="addLineSuccess-big-box-bottom-item">
  33. <view class="flexAlignCenter">
  34. <view class="greenCircle">
  35. </view>
  36. <text class="itemText">开始地址:</text>
  37. </view>
  38. <view class="flexAlignCenter">
  39. <text class="infoText">{{form.startName}}</text>
  40. </view>
  41. </view>
  42. <!-- <view class="border-style"></view> -->
  43. <view class="addLineSuccess-big-box-bottom-item">
  44. <view class="flexAlignCenter">
  45. <view class="greenCircle">
  46. </view>
  47. <text class="itemText">结束地址:</text>
  48. </view>
  49. <view class="flexAlignCenter">
  50. <text class="infoText">{{form.endName}}</text>
  51. </view>
  52. </view>
  53. <!-- <view class="border-style"></view> -->
  54. <view class="addLineSuccess-big-box-bottom-item">
  55. <view class="flexAlignCenter">
  56. <view class="greenCircle">
  57. </view>
  58. <text class="itemText">运输期限:</text>
  59. </view>
  60. <view class="flexAlignCenter">
  61. <text class="infoText">{{form.startDate}} 至 {{form.endDate}}</text>
  62. </view>
  63. </view>
  64. <!-- <view class="border-style"></view> -->
  65. <view class="addLineSuccess-big-box-bottom-item">
  66. <view class="flexAlignCenter">
  67. <view class="greenCircle">
  68. </view>
  69. <text class="itemText">开始时间:</text>
  70. </view>
  71. <view class="flexAlignCenter">
  72. <text class="infoText">{{ changeTime(form.startTime) }}</text>
  73. </view>
  74. </view>
  75. <!-- <view class="border-style"></view> -->
  76. <view class="addLineSuccess-big-box-bottom-item">
  77. <view class="flexAlignCenter">
  78. <view class="greenCircle">
  79. </view>
  80. <text class="itemText">结束时间:</text>
  81. </view>
  82. <view class="flexAlignCenter">
  83. <text class="infoText">{{ changeTime(form.endTime) }}</text>
  84. </view>
  85. </view>
  86. <!-- <view class="border-style"></view> -->
  87. <view class="addLineSuccess-big-box-bottom-item">
  88. <view class="flexAlignCenter">
  89. <view class="greenCircle">
  90. </view>
  91. <text class="itemText">计划车辆:</text>
  92. </view>
  93. <view class="flexAlignCenter">
  94. <text class="infoText">{{form.expectCar}}</text>
  95. </view>
  96. </view>
  97. <!-- <view class="border-style"></view> -->
  98. <view class="addLineSuccess-big-box-bottom-item">
  99. <view class="flexAlignCenter">
  100. <view class="greenCircle">
  101. </view>
  102. <text class="itemText">上报企业:</text>
  103. </view>
  104. <view class="flexAlignCenter">
  105. <text class="infoText">{{form.companyName}}</text>
  106. </view>
  107. </view>
  108. <!-- <view class="border-style"></view> -->
  109. </view>
  110. </view>
  111. <!-- 审批状态 -->
  112. <view class="reject-box mt28 commonMb commonBj">
  113. <view class="reject-box-top just-content-start">
  114. <image src="../../static/images/car/yunshu.png" mode="widthFix"></image>
  115. <text class="listTitle">审批状态</text>
  116. </view>
  117. <view class="reject-box-bottom pb0">
  118. <view class="state-icon">
  119. <view class="flexAlignCenter center">
  120. <view class="redCircle">
  121. </view>
  122. <text class="itemText mr46">审批状态:</text>
  123. <view class="normal" :class="auditType===1?'success':''" @tap="successClick">
  124. <image style="width: 33rpx;height: 33rpx;margin-right: 12rpx;"
  125. src="../../static/images/cityCar/state2.png" mode="widthFix"></image>
  126. <text>通过</text>
  127. </view>
  128. <view class="normal ml37" :class="auditType===-1?'fail':''" @tap="failClick">
  129. <image style="width: 33rpx;height: 33rpx;margin-right: 12rpx;"
  130. src="../../static/images/cityCar/state1.png" mode="widthFix"></image>
  131. <text>驳回</text>
  132. </view>
  133. </view>
  134. </view>
  135. <!-- <view :class="isPass?'border-style mb':'border-style2'"></view> -->
  136. <!-- <view class="state-icon" v-if="auditType === -1">
  137. <view class="flexAlignCenter center">
  138. <view class="redCircle">
  139. </view>
  140. <text class="itemText">驳回原因:</text>
  141. </view>
  142. </view>
  143. <u--textarea confirmType="done" v-if="auditType === -1" class="textareaStyle" height="198rpx"
  144. v-model="auditContent" placeholder="请输入驳回原因">
  145. </u--textarea> -->
  146. <u--form v-if="auditType === -1" :model="uform" ref="uForm" :rules="rules" labelWidth="0"
  147. class='formStyle formClass'>
  148. <u-form-item prop="auditContent">
  149. <view class="flexBox mb40">
  150. <view class="redCircle"></view>
  151. <text class="itemText">驳回原因</text>
  152. </view>
  153. <u--textarea confirmType="done" v-if="auditType === -1" class="textareaStyle"
  154. maxlength="255" height="198rpx" v-model="uform.auditContent" placeholder="请输入驳回原因">
  155. </u--textarea>
  156. </u-form-item>
  157. </u--form>
  158. <!-- <view v-if="!isPass" class="border-style2 mb"></view> -->
  159. </view>
  160. </view>
  161. <u-button @click="submit" class="custom-style mt33 commonMb" shape="circle"
  162. color="linear-gradient(to top, #F59A02, #FFD334)">确认审批</u-button>
  163. </view>
  164. </view>
  165. </view>
  166. </template>
  167. <script>
  168. import {
  169. transportDetail
  170. } from "../../api/company/transport.js"
  171. import {
  172. checkTransport
  173. } from "@/api/city/transport.js"
  174. export default {
  175. data() {
  176. return {
  177. // 通过样式开关
  178. auditType: 1,
  179. // 驳回样式开关
  180. isFail: false,
  181. isMap: true,
  182. form: {
  183. startTime: "00:00:00",
  184. endTime: "00:00:00",
  185. // 结束坐标和开始坐标
  186. endPoint: '',
  187. startPoint: '',
  188. mtRoutePointList: [],
  189. },
  190. uform: {
  191. // 驳回原因
  192. auditContent: null,
  193. },
  194. rules: {
  195. auditContent: [{
  196. required: true,
  197. whitespace:true,
  198. message: '请输入驳回原因',
  199. trigger: ['blur', 'change']
  200. }, ],
  201. },
  202. }
  203. },
  204. methods: {
  205. submit() {
  206. if (this.auditType === -1) {
  207. this.$refs.uForm.validate().then(async res => {
  208. console.log(this.form);
  209. let obj = {}
  210. obj.id = this.form.id
  211. obj.auditState = this.auditType
  212. obj.auditContent = this.uform.auditContent
  213. obj.startDate = this.form.startDate
  214. checkTransport(obj).then(res => {
  215. console.log(res);
  216. this.uform.auditContent = null
  217. this.$tab.navigateBack()
  218. // uni.redirectTo({
  219. // url: '/pages/cityTransport/index'
  220. // });
  221. // this.$tab.navigateTo('/pages/cityTransport/index')
  222. // uni.showToast({
  223. // title: '已审批'
  224. // })
  225. })
  226. })
  227. } else {
  228. let obj = {}
  229. obj.id = this.form.id
  230. obj.auditState = this.auditType
  231. obj.auditContent = this.uform.auditContent
  232. obj.startDate = this.form.startDate
  233. checkTransport(obj).then(res => {
  234. console.log(res);
  235. this.uform.auditContent = null
  236. this.$tab.navigateBack()
  237. // uni.redirectTo({
  238. // url: '/pages/cityTransport/index'
  239. // });
  240. // this.$tab.navigateTo('/pages/cityTransport/index')
  241. // uni.showToast({
  242. // title: '已审批'
  243. // })
  244. })
  245. }
  246. },
  247. // 切换按钮事件
  248. successClick() {
  249. if (this.auditType === 1) {
  250. return
  251. } else {
  252. this.auditType = 1
  253. }
  254. },
  255. failClick() {
  256. if (this.isFail === -1) {
  257. return
  258. } else {
  259. this.auditType = -1
  260. }
  261. },
  262. // 获取运输申请详情
  263. async getDetail(id) {
  264. this.isMap = false;
  265. const res = await transportDetail(id)
  266. console.log('运输详情', res);
  267. this.form = res.data;
  268. this.isMap = true;
  269. },
  270. changeTime(time) {
  271. return time.slice(0, 5)
  272. },
  273. },
  274. onLoad(option) {
  275. if (option.id) {
  276. this.getDetail(option.id)
  277. this.uform.auditContent = null
  278. }
  279. }
  280. }
  281. </script>
  282. <style lang="scss" scoped>
  283. .mr46 {
  284. margin-right: 46rpx !important;
  285. }
  286. // 驳回表单样式
  287. .flexBox {
  288. display: flex;
  289. align-items: center;
  290. }
  291. .mb40 {
  292. margin-bottom: 40rpx;
  293. }
  294. .formClass {
  295. /deep/.u-form-item {
  296. margin-bottom: 56rpx;
  297. }
  298. /deep/.u-form-item__body {
  299. padding: 0;
  300. }
  301. /deep/.u-form-item__body__right__content__slot {
  302. display: block !important;
  303. // margin-bottom: 56rpx;
  304. }
  305. }
  306. // 审批状态按钮样式
  307. .normal {
  308. width: 170rpx;
  309. height: 58rpx;
  310. background: rgba(126, 142, 193, 0.6);
  311. border-radius: 36rpx;
  312. display: flex;
  313. justify-content: center;
  314. align-items: center;
  315. font-size: 28rpx;
  316. font-weight: bold;
  317. color: #FFFFFF;
  318. }
  319. .success {
  320. background: linear-gradient(90deg, #3FC377 0%, #83D992 100%);
  321. box-shadow: 0px 2rpx 13rpx 0px rgba(27, 43, 95, 0.25);
  322. }
  323. .fail {
  324. background: linear-gradient(90deg, #FF2D04 0%, #FFA53E 100%);
  325. box-shadow: 0px 2rpx 13rpx 0px rgba(27, 43, 95, 0.25);
  326. }
  327. .ml37 {
  328. margin-left: 37rpx;
  329. }
  330. .center {
  331. justify-content: center;
  332. align-items: center;
  333. }
  334. .textareaStyle {
  335. background: rgba(255, 255, 255, 0.1);
  336. border: 2rpx solid #495B93 !important;
  337. border-radius: 15rpx;
  338. /deep/ .input-placeholder {
  339. color: #7E8EC1 !important;
  340. font-size: 26rpx;
  341. }
  342. }
  343. .reject-box-top {
  344. width: 100%;
  345. height: 69rpx;
  346. background: #7FB5FF;
  347. border-radius: 26rpx 26rpx 0px 0px;
  348. display: flex;
  349. justify-content: space-between;
  350. uni-image {
  351. width: 50rpx;
  352. margin-left: 32rpx;
  353. vertical-align: middle;
  354. }
  355. }
  356. .reject-box-bottom {
  357. padding: 40rpx;
  358. .state-icon {
  359. display: flex;
  360. margin: 40rpx 0;
  361. }
  362. .state-icon:nth-child(1) {
  363. margin: 0 0 40rpx;
  364. }
  365. .border-style {
  366. border-top: 1rpx dashed #F98803;
  367. width: 90%;
  368. margin: 0 auto;
  369. }
  370. .border-style2 {
  371. border-top: 1rpx dashed #FB5637;
  372. width: 90%;
  373. margin: 0 auto;
  374. }
  375. }
  376. .reject-box-bottom:nth-child(2) {
  377. padding: 40rpx 40rx 20rpx !important;
  378. }
  379. .just-content-start {
  380. justify-content: flex-start !important;
  381. align-items: center;
  382. }
  383. .pb0 {
  384. padding-bottom: 0 !important;
  385. }
  386. .mt28 {
  387. margin-top: 40rpx;
  388. }
  389. //
  390. .addLineSuccess-big-box {
  391. .addLineSuccess-big-box-top {
  392. height: 69rpx;
  393. background: #7FB5FF;
  394. border-radius: 26rpx 26rpx 0rpx 0rpx;
  395. display: flex;
  396. align-items: center;
  397. }
  398. .addLineSuccess-big-box-bottom {
  399. padding: 0rpx 39rpx;
  400. border-radius: 0 0 28rpx 28rpx;
  401. .addLineSuccess-big-box-bottom-item {
  402. display: flex;
  403. margin: 36rpx auto;
  404. }
  405. .map {
  406. // width: 599rpx;
  407. height: 339rpx;
  408. background: #FFFFFF;
  409. border: 2rpx solid #495B93;
  410. border-radius: 15rpx;
  411. margin: 25rpx auto 40rpx;
  412. }
  413. // .border-style {
  414. // border-top: 1rpx dashed #F98803;
  415. // margin: 0 auto;
  416. // }
  417. }
  418. }
  419. .custom-style {
  420. box-shadow: 0px 2rpx 13rpx 0rpx rgba(27, 43, 95, 0.25);
  421. border-radius: 28rpx;
  422. font-size: 28rpx;
  423. font-weight: bold;
  424. color: #FFFFFF;
  425. margin: 27rpx 0 36rpx;
  426. height: 85rpx;
  427. }
  428. .bg-color-green {
  429. background: #36C372 !important;
  430. }
  431. .mb {
  432. margin-bottom: 11rpx !important;
  433. }
  434. .mt31 {
  435. margin-top: 31rpx;
  436. }
  437. .mb43 {
  438. margin-bottom: 43rpx;
  439. }
  440. </style>