sparepartDetail.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <template>
  2. <view class="plan-approval-container">
  3. <uni-nav-bar
  4. fixed="true"
  5. statusBar="true"
  6. left-icon="back"
  7. title="申领单审批详情"
  8. @clickLeft="back"
  9. ></uni-nav-bar>
  10. <view class="content">
  11. <!-- 基本信息 -->
  12. <view class="baseinfo">
  13. <view class="col">
  14. <text class="label">申领单号</text>
  15. <text class="desc">{{ baseInfo.code }}</text>
  16. </view>
  17. <view class="col">
  18. <text class="label">来源类型</text>
  19. <text class="desc"
  20. >{{
  21. baseInfo.sourceType == 1 ? '保养工单' : '维修工单'
  22. }}-申请备品备件</text
  23. >
  24. </view>
  25. <view class="col">
  26. <text class="label">来源工单号</text>
  27. <text class="desc">{{ baseInfo.sourceCode }}</text>
  28. </view>
  29. <view class="col">
  30. <text class="label">期望完成时间</text>
  31. <text class="desc">{{ baseInfo.expectedPerformanceTime }}</text>
  32. </view>
  33. <view class="col">
  34. <text class="label">申领部门</text>
  35. <text class="desc">{{ baseInfo.applyDeptName }}</text>
  36. </view>
  37. <view class="col">
  38. <text class="label">申领人</text>
  39. <text class="desc">{{ baseInfo.applyUserName }}</text>
  40. </view>
  41. <view class="col">
  42. <text class="label">申领人电话</text>
  43. <text class="desc">{{ baseInfo.applyUserPhone }}</text>
  44. </view>
  45. </view>
  46. <view class="detail-title"> 申请明细 </view>
  47. <view class="detail-list">
  48. <view
  49. class="list-item"
  50. v-for="(item, index) in baseInfo.sparePartsApplyDetailList"
  51. :key="item.id"
  52. >
  53. <div class="item-name">
  54. <div class="name-text">{{ item.informationName }}</div>
  55. <div class="name-intro">
  56. ({{ item.informationCode }}/{{ item.modelType }})
  57. </div>
  58. </div>
  59. <div>
  60. <text class="item-num">{{ item.num }}</text>
  61. <text class="item-unit">{{ item.measuringUnit }}</text>
  62. </div>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="approval-container" v-if="isApproval && baseInfo.status == 1">
  67. <view class="approval_btn-wrapper">
  68. <text class="approval-btn refuse" @click="handleRefuse">驳回</text>
  69. <text class="approval-btn primary" @click="handlePass(true)">通过</text>
  70. </view>
  71. <uni-popup ref="inputDialog" type="dialog">
  72. <uni-popup-dialog
  73. ref="inputClose"
  74. mode="input"
  75. title="驳回原因"
  76. placeholder="请输入内容"
  77. :before-close="true"
  78. @close="handleClose"
  79. @confirm="timeoutCauseConfirm"
  80. ></uni-popup-dialog>
  81. </uni-popup>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. import { post, get, postJ } from '@/utils/api.js'
  87. export default {
  88. data () {
  89. return {
  90. options: {},
  91. baseInfo: {},
  92. isApproval: false
  93. }
  94. },
  95. onLoad (options) {
  96. this.options = options
  97. this.isApproval = options.type === 'approval'
  98. },
  99. onShow () {
  100. this.getInfo()
  101. },
  102. computed: {},
  103. methods: {
  104. getInfo () {
  105. get(
  106. this.apiUrl + `/sparePartsApply/detail/${this.options.workOrderCode}`
  107. ).then(res => {
  108. if (res?.success) {
  109. this.baseInfo = res.data
  110. }
  111. })
  112. },
  113. // 审批
  114. handleRefuse () {
  115. this.$refs.inputDialog.open()
  116. },
  117. handleClose () {
  118. this.$refs.inputDialog.close()
  119. },
  120. handlePass (checked, cause) {
  121. const params = {
  122. checked,
  123. handleType: 0,
  124. myHandleId: this.options.id,
  125. id: this.baseInfo.id,
  126. type: 9,
  127. workOrderId: this.options.workOrderId
  128. }
  129. if (cause) {
  130. params.cause = cause
  131. }
  132. postJ(this.apiUrl + '/plan/info/audit', params).then(res => {
  133. if (res?.success) {
  134. uni.navigateTo({
  135. url: `/pages/home/backlog/result?type=${
  136. checked ? 'approve' : 'refuse'
  137. }&status=0`
  138. })
  139. }
  140. })
  141. },
  142. timeoutCauseConfirm (value) {
  143. if (!value) {
  144. uni.showToast({
  145. title: '请输入驳回原因',
  146. icon: 'none'
  147. })
  148. return
  149. }
  150. this.handlePass(false, value)
  151. this.$refs.inputDialog.close()
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="scss" scoped>
  157. .tab-title {
  158. width: 100%;
  159. padding: 0 30rpx;
  160. margin-bottom: 12rpx;
  161. display: flex;
  162. height: $tab-height;
  163. line-height: $tab-height;
  164. background-color: #ffffff;
  165. border-bottom: 1px solid #f2f2f2;
  166. box-sizing: border-box;
  167. .tab-item {
  168. width: 30%;
  169. text-align: center;
  170. font-size: 32rpx;
  171. color: $uni-text-color-grey;
  172. }
  173. .tab-item.active {
  174. color: $j-primary-border-green;
  175. border-bottom: 1px solid $j-primary-border-green;
  176. }
  177. }
  178. .plan-approval-container {
  179. display: flex;
  180. flex-direction: column;
  181. padding-bottom: 80rpx;
  182. /deep/.uni-collapse-item {
  183. background-color: rgba(21, 122, 44, 0.372549019607843);
  184. }
  185. .content {
  186. flex: 1;
  187. overflow: auto;
  188. .baseinfo {
  189. padding: 0 22rpx;
  190. font-size: 28rpx;
  191. .col {
  192. display: flex;
  193. padding: 10rpx 0;
  194. border-bottom: 1rpx dashed #d7d7d7;
  195. .label {
  196. display: inline-block;
  197. width: 200rpx;
  198. text-align: right;
  199. margin-right: 20rpx;
  200. font-weight: bold;
  201. }
  202. .desc {
  203. flex: 1;
  204. word-break: break-all;
  205. }
  206. }
  207. }
  208. }
  209. .collapse-title {
  210. display: flex;
  211. justify-content: space-between;
  212. align-items: center;
  213. font-size: 28rpx;
  214. height: 80rpx;
  215. padding: 8rpx;
  216. box-sizing: border-box;
  217. }
  218. .collapse-item-wrapper {
  219. padding: 12rpx;
  220. .info-container {
  221. margin-bottom: 20rpx;
  222. }
  223. }
  224. }
  225. .pd-list-item {
  226. padding: 10rpx;
  227. border-bottom: 1px solid #d7d7d7;
  228. .item {
  229. display: flex;
  230. font-size: 28rpx;
  231. justify-content: space-between;
  232. padding: 10rpx;
  233. }
  234. }
  235. .detail-title {
  236. width: 96%;
  237. margin: 20rpx auto 0;
  238. background: #e7e7e7;
  239. line-height: 68rpx;
  240. text-align: center;
  241. border: 1rpx solid #e7e7e7;
  242. }
  243. .detail-list {
  244. width: 96%;
  245. margin: 0 auto;
  246. border-left: 1rpx solid #e7e7e7;
  247. border-right: 1rpx solid #e7e7e7;
  248. border-bottom: 1rpx solid #e7e7e7;
  249. font-size: 30rpx;
  250. .list-item {
  251. border-bottom: 1rpx solid #e7e7e7;
  252. display: flex;
  253. align-items: center;
  254. justify-content: space-between;
  255. padding: 20rpx;
  256. .item-name {
  257. .name-text {
  258. color: #333;
  259. }
  260. .name-intro {
  261. color: #aaaaaa;
  262. }
  263. }
  264. .item-num {
  265. width: 80rpx;
  266. display: inline-block;
  267. }
  268. .item-unit {
  269. display: inline-block;
  270. }
  271. }
  272. .list-item:last-child {
  273. border: none;
  274. }
  275. }
  276. .approval-container {
  277. width: 100vw;
  278. height: 80rpx;
  279. .approval_btn-wrapper {
  280. display: flex;
  281. position: fixed;
  282. bottom: 0;
  283. width: 100vw;
  284. height: 80rpx;
  285. background-color: #fff;
  286. }
  287. .approval-btn {
  288. flex: 1;
  289. line-height: 78rpx;
  290. text-align: center;
  291. border: 1rpx solid $j-primary-border-green;
  292. &.refuse {
  293. color: red;
  294. }
  295. &.primary {
  296. background-color: $j-primary-border-green;
  297. color: #fff;
  298. }
  299. }
  300. }
  301. </style>