deliveryDetails.vue 12 KB

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