deliveryDetails.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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. }
  273. .submit {
  274. text {
  275. color: #3385FF;
  276. }
  277. }
  278. .state {
  279. line-height: 48rpx;
  280. padding: 0 24rpx;
  281. border-radius: 50px;
  282. background-color: rgba(255, 255, 255, 1);
  283. color: rgba(51, 133, 255, 1);
  284. font-size: 12px;
  285. text-align: center;
  286. font-family: Arial;
  287. border: 1px solid rgba(51, 133, 255, 1);
  288. margin-left: auto;
  289. }
  290. }
  291. // 出库单详情
  292. .details {
  293. background-color: #fff;
  294. margin-top: 24rpx;
  295. padding: 0 32rpx;
  296. .item {
  297. display: flex;
  298. justify-content: space-between;
  299. padding: 22rpx 0;
  300. border-bottom: 1px solid rgba(244, 244, 244, 1);
  301. .name {
  302. color: rgba(119, 119, 119, 1);
  303. }
  304. .value {
  305. color: #101010;
  306. }
  307. }
  308. }
  309. // 出库单列表
  310. .list {
  311. background-color: #fff;
  312. margin-top: 24rpx;
  313. padding: 22rpx 32rpx;
  314. .list-head {
  315. display: flex;
  316. justify-content: space-between;
  317. align-items: center;
  318. .title {
  319. color: #333333;
  320. font-size: 32rpx
  321. }
  322. .amount {
  323. color: #777777;
  324. font-size: 24rpx;
  325. text {
  326. color: #3385FF;
  327. }
  328. /deep/.u-icon--right {
  329. margin-left: 8rpx;
  330. }
  331. }
  332. }
  333. // 清单信息
  334. .list-infos {
  335. border-radius: 8px;
  336. background-color: #F5F6F9;
  337. margin-top: 24rpx;
  338. padding: 24rpx;
  339. .infos-head {
  340. display: flex;
  341. justify-content: space-between;
  342. align-items: center;
  343. margin-bottom: 24rpx;
  344. .name {
  345. color: rgba(51, 51, 51, 1);
  346. font-size: 32rpx;
  347. }
  348. .state {
  349. color: rgba(0, 81, 255, 1);
  350. }
  351. }
  352. .infos {
  353. margin-top: 16rpx;
  354. display: flex;
  355. color: #777777;
  356. font-size: 24rpx;
  357. .infos-1 {
  358. margin-right: 68rpx;
  359. }
  360. .infos-item {
  361. display: flex;
  362. margin-bottom: 8rpx;
  363. }
  364. }
  365. }
  366. }
  367. // .u-time-axis{
  368. // .u-time-axis-item:last-of-type{
  369. // margin-bottom: 0;
  370. // }
  371. // }
  372. // 确认出库
  373. .bottom{
  374. background-color: #fff;
  375. margin-top: 44rpx;
  376. padding: 16rpx 32rpx;
  377. z-index: 999;
  378. position: fixed;
  379. left: 0;
  380. right: 0;
  381. bottom: 0;
  382. // uni-button{
  383. // border-radius: 8px;
  384. // background: linear-gradient(180deg, rgba(22,119,255,1) 0%,rgba(16,98,213,1) 100%);
  385. // color: rgba(255, 255, 255, 1);
  386. // font-size: 32rpx;
  387. // line-height: 88rpx;
  388. // }
  389. }
  390. </style>