deliveryDetails.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  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">
  17. {{recordStatus(info.status)}}
  18. </view>
  19. </view>
  20. <!-- 出库单详情 -->
  21. <view class="details">
  22. <view class="item">
  23. <view class="name">
  24. 所属项目
  25. </view>
  26. <view class="value">
  27. {{info.projectName}}
  28. </view>
  29. </view>
  30. <view class="item">
  31. <view class="name">
  32. 需求时间
  33. </view>
  34. <view class="value">
  35. {{info.startTime?info.startTime:'无'}}
  36. </view>
  37. </view>
  38. <view class="item">
  39. <view class="name">
  40. 使用周期至
  41. </view>
  42. <view class="value">
  43. {{info.endTime}}
  44. </view>
  45. </view>
  46. <view class="item">
  47. <view class="name">
  48. 申请时间
  49. </view>
  50. <view class="value">
  51. {{info.createTime}}
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 出库设备清单 -->
  56. <view class="list">
  57. <view class="list-head">
  58. <view class="title">
  59. 出库设备清单
  60. </view>
  61. <view class="amount" @click="gotoUrl('pages/projectDepartment/exportApplication/deliveriedList?id='+id)">
  62. 全部 <text>{{recordsTotal}}</text> 件设备
  63. <u-icon name="arrow-right"></u-icon>
  64. </view>
  65. </view>
  66. <!-- 清单信息 -->
  67. <view class="list-infos" v-for="(item,i) in outRecordDeviceList" :key="i" >
  68. <view class="infos-head">
  69. <view class="name">
  70. {{item.deviceName}}
  71. </view>
  72. <view class="state">
  73. {{recordItemStatus(item.status)}}: <text>{{item.needCount}}</text>
  74. </view>
  75. </view>
  76. <view class="infos">
  77. <view class="infos-1">
  78. <view class="infos-item">
  79. <view class="item-name">
  80. 厂家:
  81. </view>
  82. <view class="item-value">
  83. {{item.deviceInfo.manufactor}}
  84. </view>
  85. </view>
  86. <view class="infos-item">
  87. <view class="item-name">
  88. 单位:
  89. </view>
  90. <view class="item-value">
  91. {{item.deviceInfo.unit}}
  92. </view>
  93. </view>
  94. </view>
  95. <view class="infos-2">
  96. <view class="infos-item">
  97. <view class="item-name">
  98. 规格:
  99. </view>
  100. <view class="item-value">
  101. {{item.deviceInfo.specifications}}
  102. </view>
  103. </view>
  104. <view class="infos-item">
  105. <view class="item-name">
  106. 型号:
  107. </view>
  108. <view class="item-value">
  109. {{item.deviceInfo.model}}
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. <u-divider border-color="#CFD2D5">仅显示部分数据</u-divider>
  116. </view>
  117. <approveList ref="approveList"
  118. :outRecordDetailObj="outRecordDetailObj"
  119. :approveList="approveList"></approveList>
  120. </view>
  121. <u-popup v-model="showpopup" mode="bottom"
  122. border-radius="14"
  123. :closeable="true" >
  124. <p style=" margin-top: 30px;">请在下方空白区域使用正楷字体进行电子签名</p>
  125. <view class="signature">
  126. <l-signature
  127. disableScroll ref="signatureRef" :penColor="penColor" :penSize="penSize"
  128. :openSmooth="openSmooth"></l-signature>
  129. </view>
  130. <view class="clean-save">
  131. <view class="clean" @click="onClick('clear')">
  132. <view class="">
  133. 清除
  134. </view>
  135. </view>
  136. <view class="save" @click="onClick('save')">
  137. <view class="">
  138. 保存并提交
  139. </view>
  140. </view>
  141. </view>
  142. </u-popup>
  143. <!-- 确认出库 -->
  144. <view class="bottom" v-if="isSpPerson" >
  145. <!-- <button>确认出库</button> -->
  146. <u-button
  147. @click="submit(2)"
  148. style="width: 49%;margin-right: 10rpx;"
  149. size="medium" type="revoke" >拒绝</u-button>
  150. <u-button
  151. @click="submit(1)"
  152. style="width: 49%;" size="medium" type="primary" >签字同意</u-button>
  153. </view>
  154. </view>
  155. </template>
  156. <script>
  157. import LSignature from '@/pages/projectDepartment/components/l-signature/l-signature.vue'
  158. import * as API from '@/apis/pagejs/approve.js'
  159. import {
  160. recordStatus,recordItemStatus
  161. } from '@/apis/status.js'
  162. import {
  163. base64ToFile
  164. } from '@/apis/utils/index.js'
  165. import approveList from "@/components/ApproveList.vue"
  166. export default {
  167. components: {
  168. approveList,LSignature
  169. },
  170. data() {
  171. return {
  172. isSpPerson:false,
  173. id:"",
  174. outRecordDetailObj:{},
  175. info:{
  176. projectName:"",
  177. startTime:"",
  178. endTime:"",
  179. createTime:"",
  180. },
  181. outUser:{
  182. name:"",
  183. headImg:""
  184. },
  185. outRecordDeviceList:[],
  186. approveList:[],
  187. recordsTotal:0,
  188. signUrl:"",
  189. showpopup:false,
  190. penColor: '',
  191. penSize: 5,
  192. openSmooth: true,
  193. }
  194. },
  195. onLoad(op){
  196. this.id=op.id
  197. this.getInfo()
  198. },
  199. methods: {
  200. recordStatus,recordItemStatus,
  201. onClick(type) {
  202. this.url =""
  203. if(type == 'openSmooth') {
  204. this.openSmooth = !this.openSmooth
  205. return
  206. }
  207. if (type == 'save') {
  208. this.$refs.signatureRef.canvasToTempFilePath({
  209. success: (res) => {
  210. // 是否为空画板 无签名
  211. if(res.isEmpty){
  212. this.signUrl ="";
  213. }else{
  214. // var file=base64ToFile( res.tempFilePath,'1.jpg')
  215. //this.uploadBase64Json(file)
  216. this.signUrl=res.tempFilePath
  217. this.saveRecordApprove("1");
  218. }
  219. }
  220. })
  221. return
  222. }
  223. if (this.$refs.signatureRef)
  224. this.$refs.signatureRef[type]()
  225. },
  226. uploadBase64Json(file){
  227. var formData={
  228. subFolder:"exportProcess",
  229. photoFile:file
  230. }
  231. API.uploadPicture(formData).then((res) => {
  232. uni.hideLoading();
  233. //this.signUrl =
  234. //this.saveRecordApprove("1");
  235. }).catch(error => {
  236. uni.showToast({
  237. title: error,
  238. icon: "none"
  239. })
  240. })
  241. },
  242. getList(){
  243. API.outRecordDeviceById({
  244. recordId:this.id,
  245. pageSize:3,
  246. pageIndex:1,
  247. }).then((res) => {
  248. uni.hideLoading();
  249. this.outRecordDeviceList=res.data.data;
  250. this.recordsTotal=res.data.recordsTotal;
  251. }).catch(error => {
  252. uni.showToast({
  253. title: error,
  254. icon: "none"
  255. })
  256. })
  257. },
  258. getInfo(){
  259. uni.showLoading({
  260. title: "加载中",
  261. mask: true,
  262. })
  263. API.outRecordDetail({
  264. id:this.id,
  265. }).then((res) => {
  266. var info= this.carhelp.getPersonInfo()
  267. this.info=res.data.outRecord;
  268. this.approveList=res.data.approveList;
  269. this.isSpPerson=false;
  270. for(var i in this.approveList){
  271. var item =this.approveList[i]
  272. if(item.status==1){
  273. continue
  274. }
  275. if(item.status==2){
  276. break;
  277. }
  278. if(item.status==0){
  279. for(var j in item.approveUserList){
  280. var itemj =item.approveUserList[j]
  281. if(itemj.id==info.id){
  282. this.isSpPerson=true;
  283. }
  284. }
  285. break;
  286. }
  287. }
  288. this.outUser=res.data.outUser;
  289. this.outRecordDetailObj=res.data;
  290. this.getList()
  291. }).catch(error => {
  292. uni.showToast({
  293. title: error,
  294. icon: "none"
  295. })
  296. })
  297. },saveRecordApprove(status){
  298. uni.showLoading({
  299. title: "加载中",
  300. mask: true,
  301. })
  302. API.saveRecordApprove({
  303. recordId:this.id,
  304. status:status,
  305. signUrl:this.signUrl
  306. }).then((res) => {
  307. this.showpopup=false;
  308. const eventChannel = this.getOpenerEventChannel();
  309. eventChannel.emit('refreshData');
  310. // uni.showToast({
  311. // title:"操作成功"
  312. // })
  313. uni.showModal({
  314. title:"提示",
  315. content:"操作成功",
  316. showCancel:false,
  317. success(resc) {
  318. if(resc.confirm){
  319. }else{
  320. }
  321. }
  322. })
  323. uni.showLoading({
  324. title: "加载中",
  325. mask: true,
  326. })
  327. this.getInfo()
  328. }).catch(error => {
  329. uni.showToast({
  330. title: error,
  331. icon: "none"
  332. })
  333. })
  334. },
  335. submit(status){
  336. var message=""
  337. if(status==2){
  338. message="拒绝"
  339. this.signUrl=""
  340. var _this=this;
  341. uni.showModal({
  342. title:"提示",
  343. content:"是否"+message+"出库审批",
  344. success(res) {
  345. if(res.confirm){
  346. _this.saveRecordApprove(status);
  347. }else{
  348. }
  349. }
  350. })
  351. }else{
  352. message="同意"
  353. this.showpopup=true;
  354. }
  355. }
  356. }
  357. }
  358. </script>
  359. <style scoped lang="scss">
  360. .signature{
  361. background-color: #fff;
  362. margin-top: 8px;
  363. height: 160px;
  364. border: #c2c2c2 1px solid;
  365. }
  366. .clean-save{
  367. background-color: #fff;
  368. display: flex;
  369. .clean,.save{
  370. width: 50%;
  371. text-align: center;
  372. color: #252525;
  373. line-height: 40px;
  374. }
  375. .clean,.save{
  376. border:#c2c2c2 1px solid;
  377. display: flex;
  378. justify-content: center;
  379. img{
  380. margin-right: 4px;
  381. }
  382. }
  383. }
  384. page {
  385. padding-bottom: 200rpx;
  386. }
  387. // 出库单状态
  388. .head {
  389. background-color: #fff;
  390. padding: 24rpx 32rpx;
  391. display: flex;
  392. align-items: center;
  393. color: #101010;
  394. font-size: 32rpx;
  395. .photo {
  396. width: 84rpx;
  397. height: 84rpx;
  398. border-radius: 100rpx;
  399. .u-avatar{
  400. }
  401. img {
  402. width: 100%;
  403. height: 100%;
  404. overflow: hidden;
  405. }
  406. }
  407. .name {
  408. color: #101010;
  409. font-size: 32rpx;
  410. margin-right: 8rpx;
  411. margin-left: 24rpx;
  412. max-width: 200rpx;
  413. overflow: hidden;
  414. text-overflow: ellipsis;
  415. white-space: nowrap
  416. }
  417. .submit {
  418. text {
  419. color: #3385FF;
  420. }
  421. }
  422. .state {
  423. line-height: 48rpx;
  424. padding: 0 24rpx;
  425. border-radius: 50px;
  426. background-color: rgba(255, 255, 255, 1);
  427. color: rgba(51, 133, 255, 1);
  428. font-size: 12px;
  429. text-align: center;
  430. font-family: Arial;
  431. border: 1px solid rgba(51, 133, 255, 1);
  432. margin-left: auto;
  433. }
  434. }
  435. // 出库单详情
  436. .details {
  437. background-color: #fff;
  438. margin-top: 24rpx;
  439. padding: 0 32rpx;
  440. .item {
  441. display: flex;
  442. justify-content: space-between;
  443. padding: 22rpx 0;
  444. border-bottom: 1px solid rgba(244, 244, 244, 1);
  445. .name {
  446. color: rgba(119, 119, 119, 1);
  447. }
  448. .value {
  449. color: #101010;
  450. }
  451. }
  452. }
  453. // 出库单列表
  454. .list {
  455. background-color: #fff;
  456. margin-top: 24rpx;
  457. padding: 22rpx 32rpx;
  458. .list-head {
  459. display: flex;
  460. justify-content: space-between;
  461. align-items: center;
  462. .title {
  463. color: #333333;
  464. font-size: 32rpx
  465. }
  466. .amount {
  467. color: #777777;
  468. font-size: 24rpx;
  469. text {
  470. color: #3385FF;
  471. }
  472. /deep/.u-icon--right {
  473. margin-left: 8rpx;
  474. }
  475. }
  476. }
  477. // 清单信息
  478. .list-infos {
  479. border-radius: 8px;
  480. background-color: #F5F6F9;
  481. margin-top: 24rpx;
  482. padding: 24rpx;
  483. .infos-head {
  484. display: flex;
  485. justify-content: space-between;
  486. align-items: center;
  487. margin-bottom: 24rpx;
  488. .name {
  489. color: rgba(51, 51, 51, 1);
  490. font-size: 32rpx;
  491. }
  492. .state {
  493. color: rgba(0, 81, 255, 1);
  494. }
  495. }
  496. .infos {
  497. margin-top: 16rpx;
  498. display: flex;
  499. color: #777777;
  500. font-size: 24rpx;
  501. .infos-1 {
  502. margin-right: 68rpx;
  503. }
  504. .infos-item {
  505. display: flex;
  506. margin-bottom: 8rpx;
  507. }
  508. }
  509. }
  510. }
  511. // 流程
  512. .process {
  513. background-color: #fff;
  514. margin-top: 24rpx;
  515. padding: 24rpx 32rpx;
  516. .title {
  517. color: rgba(51, 51, 51, 1);
  518. font-size: 32rpx;
  519. }
  520. .u-time-axis-item{
  521. //margin-bottom: 76rpx;
  522. }
  523. .u-time-axis {
  524. //padding: 18rpx 40rpx;
  525. }
  526. .u-node {
  527. width: 18rpx;
  528. height: 18rpx;
  529. border-radius: 100rpx !important;
  530. display: flex;
  531. justify-content: center;
  532. align-items: center;
  533. background: #d0d0d0;
  534. }
  535. .u-order{
  536. margin-bottom: 32rpx;
  537. }
  538. .u-order-title {
  539. color: #333333;
  540. font-weight: bold;
  541. font-size: 32rpx;
  542. }
  543. .u-order-desc {
  544. margin-bottom: 16rpx;
  545. display: flex;
  546. justify-content: space-between;
  547. align-items: center;
  548. .level {
  549. color: #333333;
  550. font-size: 32rpx;
  551. font-weight: bold;
  552. }
  553. .date {
  554. color: rgba(119, 119, 119, 1);
  555. }
  556. .state {
  557. color: rgba(255, 121, 0, 1);
  558. }
  559. }
  560. .u-order-time {
  561. width: 160rpx;
  562. color: #777777;
  563. font-size: 28rpx;
  564. margin-top: 16rpx;
  565. display: flex;
  566. flex-direction: column;
  567. align-items: center;
  568. .photo {
  569. width: 56rpx;
  570. height: 56rpx;
  571. border-radius: 100px;
  572. margin-bottom: 4rpx;
  573. img {
  574. width: 100%;
  575. height: 100%;
  576. overflow: hidden;
  577. position: relative;
  578. }
  579. }
  580. .confirm {
  581. position: absolute;
  582. top: 46rpx;
  583. left: 56rpx;
  584. }
  585. .name {
  586. color: rgba(51, 51, 51, 1);
  587. font-size: 24rpx;
  588. }
  589. }
  590. }
  591. // .u-time-axis{
  592. // .u-time-axis-item:last-of-type{
  593. // margin-bottom: 0;
  594. // }
  595. // }
  596. // 确认出库
  597. .bottom{
  598. text-align: center;
  599. background-color: #fff;
  600. margin-top: 44rpx;
  601. padding: 16rpx 32rpx;
  602. z-index: 999;
  603. position: fixed;
  604. left: 0;
  605. right: 0;
  606. bottom: 0;
  607. // uni-button{
  608. // border-radius: 8px;
  609. // background: linear-gradient(180deg, rgba(22,119,255,1) 0%,rgba(16,98,213,1) 100%);
  610. // color: rgba(255, 255, 255, 1);
  611. // font-size: 32rpx;
  612. // line-height: 88rpx;
  613. // }
  614. }
  615. </style>