deliveryDetails.vue 12 KB

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