deliveryDetails.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <template>
  2. <view >
  3. <u-navbar title="出库单详情"></u-navbar>
  4. <!-- 出库单状态 -->
  5. <view class="container">
  6. <view class="head">
  7. <view class="photo">
  8. <u-avatar size="84" :src="outUser.headImg"></u-avatar>
  9. </view>
  10. <view class="name">
  11. {{outUser.name}}
  12. </view>
  13. <view class="submit">
  14. 提交了<text>出库申请</text>
  15. </view>
  16. <view class="state" :style="{
  17. color:recordStatusColor(info.status),
  18. borderColor:recordStatusColor(info.status)
  19. }">
  20. {{recordStatus(info.status)}}
  21. </view>
  22. </view>
  23. <!-- 出库单详情 -->
  24. <view class="details">
  25. <view class="item">
  26. <view class="name">
  27. 所属项目
  28. </view>
  29. <view class="value">
  30. {{info.projectName}}
  31. </view>
  32. </view>
  33. <view class="item">
  34. <view class="name">
  35. 需求时间
  36. </view>
  37. <view class="value">
  38. {{info.startTime?info.startTime:'无'}}
  39. </view>
  40. </view>
  41. <view class="item">
  42. <view class="name">
  43. 使用周期至
  44. </view>
  45. <view class="value">
  46. {{info.endTime}}
  47. </view>
  48. </view>
  49. <view class="item">
  50. <view class="name">
  51. 申请时间
  52. </view>
  53. <view class="value">
  54. {{info.createTime}}
  55. </view>
  56. </view>
  57. </view>
  58. <!-- 出库设备清单 -->
  59. <view class="list">
  60. <view class="list-head">
  61. <view class="title">
  62. 出库设备清单
  63. </view>
  64. <view class="amount" @click="gotoUrl('pages/projectDepartment/exportApplication/deliveriedList?id='+id)">
  65. 全部 <text>{{recordsTotal}}</text> 件设备
  66. <u-icon name="arrow-right"></u-icon>
  67. </view>
  68. </view>
  69. <!-- 清单信息 -->
  70. <view class="list-infos" v-for="(item,i) in outRecordDeviceList" :key="i" >
  71. <view class="infos-head">
  72. <view class="name">
  73. {{item.deviceName}}
  74. </view>
  75. <view class="state">
  76. {{recordItemStatus(item.status)}}: <text>{{item.needCount}}</text>
  77. </view>
  78. </view>
  79. <view class="infos">
  80. <view class="infos-1">
  81. <view class="infos-item">
  82. <view class="item-name">
  83. 厂家:
  84. </view>
  85. <view class="item-value">
  86. {{item.deviceInfo.manufactor}}
  87. </view>
  88. </view>
  89. <view class="infos-item">
  90. <view class="item-name">
  91. 单位:
  92. </view>
  93. <view class="item-value">
  94. {{item.deviceInfo.unit}}
  95. </view>
  96. </view>
  97. </view>
  98. <view class="infos-2">
  99. <view class="infos-item">
  100. <view class="item-name">
  101. 规格:
  102. </view>
  103. <view class="item-value">
  104. {{item.deviceInfo.specifications}}
  105. </view>
  106. </view>
  107. <view class="infos-item">
  108. <view class="item-name">
  109. 型号:
  110. </view>
  111. <view class="item-value">
  112. {{item.deviceInfo.model}}
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. <u-divider border-color="#CFD2D5">仅显示部分数据</u-divider>
  119. </view>
  120. <approveList ref="approveList"
  121. :outRecordDetailObj="outRecordDetailObj"
  122. :approveList="approveList"></approveList>
  123. </view>
  124. <!-- 确认出库 -->
  125. <view class="bottom" >
  126. <!-- <button>确认出库</button> -->
  127. <u-button v-if="info.status==0" type="revoke" @click="revokeBtn" >撤销</u-button>
  128. <u-button v-if="info.status==1" type="primary" >签字验收</u-button>
  129. </view>
  130. </view>
  131. </template>
  132. <script>
  133. import * as API from '@/apis/pagejs/projectDepartment.js'
  134. import {
  135. recordStatus,recordStatusColor,recordItemStatus
  136. } from '@/apis/status.js'
  137. import approveList from "@/components/ApproveList.vue"
  138. export default {
  139. components: {
  140. approveList
  141. },
  142. data() {
  143. return {
  144. id:"",
  145. info:{
  146. projectName:"",
  147. startTime:"",
  148. endTime:"",
  149. createTime:"",
  150. },
  151. outUser:{
  152. name:"",
  153. headImg:""
  154. },
  155. outRecordDetailObj:{},
  156. outRecordDeviceList:[],
  157. approveList:[],
  158. recordsTotal:0,
  159. }
  160. },
  161. onLoad(op){
  162. this.id=op.id
  163. this.getInfo()
  164. },
  165. methods: {
  166. recordStatusColor,
  167. recordStatus,recordItemStatus,
  168. getList(){
  169. API.outRecordDeviceById({
  170. recordId:this.id,
  171. pageSize:3,
  172. pageIndex:1,
  173. }).then((res) => {
  174. uni.hideLoading();
  175. this.outRecordDeviceList=res.data.data;
  176. this.recordsTotal=res.data.recordsTotal;
  177. }).catch(error => {
  178. uni.showToast({
  179. title: error,
  180. icon: "none"
  181. })
  182. })
  183. },
  184. revokeMethod(){
  185. uni.showLoading({
  186. title: "加载中",
  187. mask: true,
  188. })
  189. API.cancelOutRecord({
  190. recordId:this.id,
  191. }).then((res) => {
  192. uni.hideLoading();
  193. this.getInfo(true)
  194. }).catch(error => {
  195. uni.showToast({
  196. title: error,
  197. icon: "none"
  198. })
  199. })
  200. },
  201. revokeBtn(){
  202. var _this=this
  203. uni.showModal({
  204. content:"确认是否撤销?",
  205. title:"提示",
  206. success(res) {
  207. if(res.confirm){
  208. _this.revokeMethod()
  209. }else{
  210. }
  211. }
  212. })
  213. },
  214. getInfo(bl){
  215. uni.showLoading({
  216. title: "加载中",
  217. mask: true,
  218. })
  219. API.outRecordDetail({
  220. id:this.id,
  221. }).then((res) => {
  222. this.outRecordDetailObj=res.data;
  223. this.info=res.data.outRecord;
  224. this.approveList=res.data.approveList;
  225. this.outUser=res.data.outUser;
  226. if(bl){
  227. const eventChannel = this.getOpenerEventChannel();
  228. eventChannel.emit('refreshData');
  229. uni.hideLoading();
  230. }else{
  231. this.getList()
  232. }
  233. }).catch(error => {
  234. uni.showToast({
  235. title: error,
  236. icon: "none"
  237. })
  238. })
  239. }
  240. }
  241. }
  242. </script>
  243. <style scoped lang="scss">
  244. page {
  245. padding-bottom: 200rpx;
  246. }
  247. // 出库单状态
  248. .head {
  249. background-color: #fff;
  250. padding: 24rpx 32rpx;
  251. display: flex;
  252. align-items: center;
  253. color: #101010;
  254. font-size: 32rpx;
  255. .photo {
  256. width: 84rpx;
  257. height: 84rpx;
  258. border-radius: 100rpx;
  259. .u-avatar{
  260. }
  261. img {
  262. width: 100%;
  263. height: 100%;
  264. overflow: hidden;
  265. }
  266. }
  267. .name {
  268. color: #101010;
  269. font-size: 32rpx;
  270. margin-right: 8rpx;
  271. margin-left: 24rpx;
  272. max-width: 200rpx;
  273. overflow: hidden;
  274. text-overflow: ellipsis;
  275. white-space: nowrap
  276. }
  277. .submit {
  278. text {
  279. color: #3385FF;
  280. }
  281. }
  282. .state {
  283. line-height: 48rpx;
  284. padding: 0 24rpx;
  285. border-radius: 50px;
  286. background-color: rgba(255, 255, 255, 1);
  287. color: rgba(51, 133, 255, 1);
  288. font-size: 12px;
  289. text-align: center;
  290. font-family: Arial;
  291. border: 1px solid rgba(51, 133, 255, 1);
  292. margin-left: auto;
  293. }
  294. }
  295. // 出库单详情
  296. .details {
  297. background-color: #fff;
  298. margin-top: 24rpx;
  299. padding: 0 32rpx;
  300. .item {
  301. display: flex;
  302. justify-content: space-between;
  303. padding: 22rpx 0;
  304. border-bottom: 1px solid rgba(244, 244, 244, 1);
  305. .name {
  306. color: rgba(119, 119, 119, 1);
  307. }
  308. .value {
  309. color: #101010;
  310. }
  311. }
  312. }
  313. // 出库单列表
  314. .list {
  315. background-color: #fff;
  316. margin-top: 24rpx;
  317. padding: 22rpx 32rpx;
  318. .list-head {
  319. display: flex;
  320. justify-content: space-between;
  321. align-items: center;
  322. .title {
  323. color: #333333;
  324. font-size: 32rpx
  325. }
  326. .amount {
  327. color: #777777;
  328. font-size: 24rpx;
  329. text {
  330. color: #3385FF;
  331. }
  332. /deep/.u-icon--right {
  333. margin-left: 8rpx;
  334. }
  335. }
  336. }
  337. // 清单信息
  338. .list-infos {
  339. border-radius: 8px;
  340. background-color: #F5F6F9;
  341. margin-top: 24rpx;
  342. padding: 24rpx;
  343. .infos-head {
  344. display: flex;
  345. justify-content: space-between;
  346. align-items: center;
  347. margin-bottom: 24rpx;
  348. .name {
  349. color: rgba(51, 51, 51, 1);
  350. font-size: 32rpx;
  351. }
  352. .state {
  353. color: rgba(0, 81, 255, 1);
  354. }
  355. }
  356. .infos {
  357. margin-top: 16rpx;
  358. display: flex;
  359. color: #777777;
  360. font-size: 24rpx;
  361. .infos-1 {
  362. margin-right: 68rpx;
  363. }
  364. .infos-item {
  365. display: flex;
  366. margin-bottom: 8rpx;
  367. }
  368. }
  369. }
  370. }
  371. // .u-time-axis{
  372. // .u-time-axis-item:last-of-type{
  373. // margin-bottom: 0;
  374. // }
  375. // }
  376. // 确认出库
  377. .bottom{
  378. background-color: #fff;
  379. margin-top: 44rpx;
  380. padding: 16rpx 32rpx;
  381. z-index: 999;
  382. position: fixed;
  383. left: 0;
  384. right: 0;
  385. bottom: 0;
  386. // uni-button{
  387. // border-radius: 8px;
  388. // background: linear-gradient(180deg, rgba(22,119,255,1) 0%,rgba(16,98,213,1) 100%);
  389. // color: rgba(255, 255, 255, 1);
  390. // font-size: 32rpx;
  391. // line-height: 88rpx;
  392. // }
  393. }
  394. </style>