deliveryDetails.vue 13 KB

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