deliveryDetails.vue 14 KB

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