detail.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <template>
  2. <view class="maintenance-container">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="任务工单详情" @clickLeft="back"></uni-nav-bar>
  4. <view class="maintenance-wrapper">
  5. <view class="maintenance-content">
  6. <KdTabs v-model="active" :list="['基本信息']" />
  7. <scroll-view :scroll-y='true' class="kd-baseInfo" v-show="active === 0">
  8. <view class="kd-cell">
  9. <text class="kd-label">工单编号</text>
  10. <text class="kd-content">{{ info.code }}</text>
  11. </view>
  12. <template v-if="info.status === 0">
  13. <view class="kd-cell">
  14. <text class="kd-label">应开工时间</text>
  15. <text class="kd-content text-warning">{{ currentRow.planTimeStart }}</text>
  16. </view>
  17. <view class="kd-cell">
  18. <text class="kd-label" v-if="info.status === 0">应完成时间</text>
  19. <text class="kd-content text-warning">{{ currentRow.planTimeEnd }}</text>
  20. </view>
  21. </template>
  22. <template v-else>
  23. <view class="kd-cell">
  24. <text class="kd-label">开始时间</text>
  25. <text class="kd-content text-warning">{{ currentRow.realStartTime }}</text>
  26. </view>
  27. <view class="kd-cell">
  28. <text class="kd-label">完成时间</text>
  29. <text class="kd-content">{{ currentRow.realEndTime }}</text>
  30. </view>
  31. </template>
  32. <view class="kd-cell">
  33. <text class="kd-label">计划名称</text>
  34. <text class="kd-content">{{ currentRow.planName }}</text>
  35. </view>
  36. <view class="kd-cell">
  37. <text class="kd-label">负责部门</text>
  38. <text class="kd-content">{{ currentRow.responsibleDeptName }}</text>
  39. </view>
  40. <view class="kd-cell">
  41. <text class="kd-label">负责人</text>
  42. <text class="kd-content">{{ currentRow.responsiblePersonName }}</text>
  43. </view>
  44. <view class="kd-cell">
  45. <text class="kd-label">车辆号</text>
  46. <text class="kd-content">{{ currentRow.trakNumber }}</text>
  47. </view>
  48. <view class="kd-cell">
  49. <text class="kd-label">司机</text>
  50. <text class="kd-content">{{ currentRow.driverName }}</text>
  51. </view>
  52. <view class="kd-cell">
  53. <text class="kd-label">司机电话</text>
  54. <text class="kd-content">{{ info.phone }}</text>
  55. </view>
  56. <view class="kd-cell">
  57. <text class="kd-label">任务类型</text>
  58. <text class="kd-content">{{getDict('logistic_delivery_type',info.taskType ) }}</text>
  59. </view>
  60. <view class="kd-cell">
  61. <text class="kd-label">备注</text>
  62. <text class="kd-content">{{ info.remark }}</text>
  63. </view>
  64. </scroll-view>
  65. <template>
  66. <template v-if="info.status === 0">
  67. <button class="btn-execute" type="primary" @click="handleExecute(1)">开始执行</button>
  68. <button class="btn-reassignment" type="primary" @click="handleAssign">转派</button>
  69. </template>
  70. <template v-else-if="info.status === 1">
  71. <button class="btn-execute" type="primary" @click="handleReport('update')">报工</button>
  72. </template>
  73. <button v-else-if="info.status === 2" class="btn-execute" type="primary"
  74. @click="handleReport('view')">查看报工详情</button>
  75. </template>
  76. </view>
  77. </view>
  78. <uni-popup ref="inputDialog" type="dialog">
  79. <uni-popup-dialog ref="inputClose" mode="input" title="您当前已超出计划完成时间,请填写原因" placeholder="请输入内容"
  80. :before-close="true" @close="handleClose" @confirm="timeoutCauseConfirm"></uni-popup-dialog>
  81. </uni-popup>
  82. <transfer ref="transferRef" @success="back" />
  83. </view>
  84. </template>
  85. <script>
  86. import transfer from './transfer.vue'
  87. import KdTabs from '@/components/KdTabs.vue'
  88. import {
  89. logisticlistcostGetByIdAPI,
  90. logistictraklistnoteUpdateAPI
  91. } from '@/api/pda/dispatchManage/index.js'
  92. export default {
  93. components: {
  94. KdTabs,
  95. transfer,
  96. },
  97. data() {
  98. return {
  99. currentRow: {},
  100. active: 0,
  101. info: {}
  102. }
  103. },
  104. onLoad(options) {
  105. this.currentRow = JSON.parse(options.item)
  106. // 详情
  107. this.getInfo()
  108. },
  109. computed: {
  110. getDict() {
  111. return (dictName, val) => {
  112. let find = this.currentRow.dictList[dictName].find(item => item[val]) || {}
  113. return find[val] ? find[val] : ''
  114. }
  115. }
  116. },
  117. methods: {
  118. back() {
  119. uni.navigateBack({
  120. delta: 1
  121. })
  122. },
  123. getInfo() {
  124. logisticlistcostGetByIdAPI(this.currentRow.id).then(res => {
  125. this.info = res
  126. })
  127. },
  128. handleExecute(status) {
  129. this.currentRow.status = status
  130. logistictraklistnoteUpdateAPI(this.currentRow)
  131. uni.showModal({
  132. title: `此工单执行成功`,
  133. content: '',
  134. confirmText: '确认',
  135. showCancel: false, // 是否显示取消按钮,默认为 true
  136. success: res => {
  137. if (res.confirm) {
  138. this.back()
  139. }
  140. }
  141. })
  142. },
  143. handleReport() {
  144. this.info.dictList = this.currentRow.dictList
  145. let jsonItem = JSON.stringify(this.info)
  146. uni.navigateTo({
  147. url: `/pages/dispatchManage/taskWork/reportDetail?item=${jsonItem}`
  148. })
  149. },
  150. handleAssign() {
  151. this.$refs.transferRef.open(this.currentRow)
  152. },
  153. }
  154. }
  155. </script>
  156. <style lang="scss" scoped>
  157. @import '@/components/submitted.scss';
  158. .list-cell {
  159. display: flex;
  160. align-items: center;
  161. justify-content: space-between;
  162. color: $uni-text-color-grey;
  163. padding: 5rpx 20rpx;
  164. }
  165. .font-sm {
  166. font-size: $uni-font-size-sm;
  167. }
  168. .font-text {
  169. color: $uni-text-color;
  170. }
  171. .btn-execute {
  172. background-color: $j-primary-border-green;
  173. width: 450rpx;
  174. margin-top: 10vh;
  175. }
  176. .btn-sparepart {
  177. width: 450rpx;
  178. margin-top: 20rpx;
  179. }
  180. .btn-reassignment {
  181. color: $uni-color-primary;
  182. background-color: transparent;
  183. border: none;
  184. box-shadow: none;
  185. &::after {
  186. display: none;
  187. }
  188. }
  189. .maintenance-container {
  190. position: fixed;
  191. top: 0;
  192. bottom: 0;
  193. width: 100vw;
  194. display: flex;
  195. flex-direction: column;
  196. /deep/.u-popup {
  197. flex: none !important;
  198. }
  199. }
  200. .maintenance-wrapper {
  201. position: relative;
  202. flex: 1;
  203. }
  204. .maintenance-content {
  205. padding-top: 40rpx;
  206. box-sizing: border-box;
  207. // height: calc(100vh - 88rpx);
  208. position: absolute;
  209. top: 0;
  210. bottom: 0;
  211. left: 0;
  212. right: 0;
  213. display: flex;
  214. flex-direction: column;
  215. }
  216. .kd-cell {
  217. line-height: 90rpx;
  218. border-bottom: 1px dashed #dadada;
  219. display: flex;
  220. justify-content: space-between;
  221. .kd-label {
  222. display: inline-block;
  223. width: 7em;
  224. font-weight: bold;
  225. }
  226. .kd-content {
  227. flex: 1;
  228. text-align: left;
  229. word-break: break-all;
  230. }
  231. }
  232. .kd-baseInfo {
  233. padding: 0 32rpx;
  234. font-size: 28rpx;
  235. height: 70%;
  236. }
  237. .kd-equipment {
  238. flex: 1;
  239. display: flex;
  240. flex-direction: column;
  241. overflow: hidden;
  242. .kd-type-box {
  243. text-align: center;
  244. padding: 26rpx 0;
  245. view {
  246. position: relative;
  247. display: inline-block;
  248. width: 120rpx;
  249. padding: 4rpx 0;
  250. color: #747474;
  251. margin: 0 20rpx;
  252. background-color: rgba(215, 215, 215, 0.5);
  253. &.type—active {
  254. background-color: #1e7f35;
  255. color: #fff;
  256. }
  257. .count {
  258. position: absolute;
  259. top: -9px;
  260. right: -9px;
  261. width: 18px;
  262. height: 18px;
  263. border-radius: 50%;
  264. font-size: 12px;
  265. background-color: red;
  266. color: #fff;
  267. }
  268. }
  269. }
  270. .kd-list-container {
  271. flex: 1;
  272. display: flex;
  273. flex-direction: column;
  274. overflow: hidden;
  275. padding: 12rpx 18rpx;
  276. background-color: $page-bg;
  277. .u-list {
  278. flex: 1;
  279. height: 100% !important;
  280. }
  281. }
  282. }
  283. .spare-parts {
  284. flex: 1;
  285. overflow: hidden;
  286. }
  287. .kd-card {
  288. background-color: #fff;
  289. margin-bottom: 20rpx;
  290. padding: 8rpx 0;
  291. font-size: 28rpx;
  292. word-break: break-all;
  293. .kd-card-wrapper {
  294. padding: 0 30rpx;
  295. border-bottom: 1px solid #dadada;
  296. }
  297. .kd-cell {
  298. line-height: 60rpx;
  299. }
  300. .kd-cell:last-of-type {
  301. border-bottom: none;
  302. }
  303. .status-box {
  304. margin-right: 16rpx;
  305. }
  306. .card-footer {
  307. display: flex;
  308. justify-content: flex-end;
  309. align-items: center;
  310. padding: 8rpx 0 20rpx;
  311. button {
  312. width: 180rpx;
  313. height: 56rpx;
  314. line-height: 56rpx;
  315. font-size: 28rpx;
  316. margin: 0 8rpx;
  317. }
  318. .primary-btn {
  319. background-color: $j-primary-border-green;
  320. }
  321. }
  322. }
  323. .apply-box {
  324. width: 70%;
  325. margin: 0 auto;
  326. display: flex;
  327. align-items: center;
  328. justify-content: space-around;
  329. }
  330. </style>