Issueandreceipt_task_approval.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. <template>
  2. <view class="warp">
  3. <view class="topInfo">
  4. <view class="topInfo-item">
  5. <view class="flex info">
  6. <view class="logo">
  7. <image src="../../../static/img/reject.png" mode="" v-if="OutList.taskStatus == '已驳回'"
  8. style="height: 40rpx;"></image><!-- 驳回 -->
  9. <image src="../../../static/img/tongguo.png" mode="" v-if="OutList.taskStatus == '已通过'"
  10. style="height: 40rpx;"></image><!-- 通过 -->
  11. <image src="../../../static/img/daishenhe.png" mode="" v-if="OutList.taskStatus == '审核中'"
  12. style="height: 40rpx;"></image><!-- 待审核 -->
  13. </view>
  14. <view class="infoText">{{OutList.taskStatus}}</view>
  15. </view>
  16. <view class="infoData">{{OutList.updateDate}}</view>
  17. </view>
  18. </view>
  19. <view class="content1">
  20. <u-form :model="OutList" ref="uForm">
  21. <u-form-item label="任务类型" prop="inOutType" label-width="140" class="uForm_item">
  22. <u-input v-model="OutList.inOutType" input-align="right" disabled v-if="OutList.inOutType" />
  23. <u-input v-model="EnterList.inOutType" input-align="right" disabled v-else />
  24. </u-form-item>
  25. <view v-if="retreatList.judge == 3">
  26. <!-- 退库 -->
  27. <view class="uForm_item">
  28. <view class="title part2">{{retreatList.inOutType}}</view>
  29. <view class='row'>
  30. <view class="left">编号</view>
  31. <view class="right">退库({{retreatList.inOutTaskNo}}}</view>
  32. </view>
  33. <view class='row'>
  34. <view class="left">仓库</view>
  35. <view class="right">{{retreatList.sendWarehouse}}</view>
  36. </view>
  37. <view class='row'>
  38. <view class="left">出库类型</view>
  39. <view class="right">{{retreatList.inOutType}}</view>
  40. </view>
  41. <view class='row' v-if="retreatList.inOutType == '移库出库'">
  42. <view class="left">移库任务编号</view>
  43. <view class="right">{{retreatList.moveTaskNo}}</view>
  44. </view>
  45. <view class='row' v-if="retreatList.inOutType != '移库出库'">
  46. <view class="left">合同编号</view>
  47. <view class="right">{{retreatList.contractNo}}</view>
  48. </view>
  49. <view class='row'>
  50. <view class="left">货名</view>
  51. <view class="right">{{retreatList.goodsName}}</view>
  52. </view>
  53. <view class='row'>
  54. <view class="left">重量(吨)</view>
  55. <view class="right">{{retreatList.weight}}</view>
  56. </view>
  57. <view class='row'>
  58. <view class="left">预计出库日期</view>
  59. <view class="right">{{retreatList.predictDate}}</view>
  60. </view>
  61. <view class='row'>
  62. <view class="left">出库经办人</view>
  63. <view class="right">{{retreatList.publisher}}</view>
  64. </view>
  65. </view>
  66. <view class="uForm_item">
  67. <u-form-item label="品级" prop="grade" label-width="150">
  68. <u-input v-model="retreatList.grade" input-align="right" placeholder="" @click='show=true'
  69. disabled />
  70. <u-picker :range="pjList" range-key="type" @confirm='pjPicker($event)' v-model="show"
  71. mode="selector">
  72. </u-picker>
  73. </u-form-item>
  74. <u-form-item label="容重(克/升)>=" prop="bulkDensity" label-width="190">
  75. <u-input v-model="retreatList.bulkDensity" input-align="right" placeholder="" />
  76. </u-form-item>
  77. <u-form-item label="水分(%)<=" prop="waterContent" label-width="160">
  78. <u-input v-model="retreatList.waterContent" input-align="right" placeholder="" />
  79. </u-form-item>
  80. <u-form-item label="单价(元/吨)" prop="unitPrice" label-width="160">
  81. <u-input v-model="retreatList.unitPrice" input-align="right" placeholder="" />
  82. </u-form-item>
  83. </view>
  84. </view>
  85. <view v-if="OutList.judge == 1">
  86. <view class="uForm_item">
  87. <!-- 出库 -->
  88. <view class="title part2">{{OutList.inOutType}}</view>
  89. <view class='row'>
  90. <view class="left">编号</view>
  91. <view class="right">出库({{OutList.inOutTaskNo}})</view>
  92. </view>
  93. <view class='row'>
  94. <view class="left">仓库</view>
  95. <view class="right">{{OutList.sendWarehouse}}</view>
  96. </view>
  97. <view class='row'>
  98. <view class="left">出库类型</view>
  99. <view class="right">{{OutList.inOutType}}</view>
  100. </view>
  101. <view class='row' v-if="OutList.inOutType == '移库出库'">
  102. <view class="left">移库任务编号</view>
  103. <view class="right">{{OutList.moveTaskNo}}</view>
  104. </view>
  105. <view class='row' v-if="OutList.inOutType != '移库出库'">
  106. <view class="left">合同编号</view>
  107. <view class="right">{{OutList.contractNo}}</view>
  108. </view>
  109. <view class='row'>
  110. <view class="left">货名</view>
  111. <view class="right">{{OutList.goodsName}}</view>
  112. </view>
  113. <view class='row'>
  114. <view class="left">重量(吨)</view>
  115. <view class="right">{{OutList.weight}}</view>
  116. </view>
  117. <view class='row'>
  118. <view class="left">预计出库日期</view>
  119. <view class="right">{{OutList.predictDate}}</view>
  120. </view>
  121. <view class='row'>
  122. <view class="left">出库经办人</view>
  123. <view class="right">{{OutList.publisher}}</view>
  124. </view>
  125. </view>
  126. <view class="uForm_item">
  127. <u-form-item label="品级" prop="grade" label-width="150" v-if="retreatList.inOutType != '退库'">
  128. <u-input v-model="OutList.grade" input-align="right" placeholder="" @click='show=true'
  129. disabled />
  130. <u-picker :range="pjList" range-key="type" @confirm='pjPicker($event)' v-model="show"
  131. mode="selector"></u-picker>
  132. </u-form-item>
  133. <u-form-item label="容重(克/升)>=" prop="bulkDensity" label-width="190"
  134. v-if="retreatList.inOutType != '退库'">
  135. <u-input v-model="OutList.bulkDensity" input-align="right" placeholder="" />
  136. </u-form-item>
  137. <u-form-item label="水分(%)<=" prop="waterContent" label-width="160"
  138. v-if="retreatList.inOutType != '退库'">
  139. <u-input v-model="OutList.waterContent" input-align="right" placeholder="" />
  140. </u-form-item>
  141. <u-form-item label="单价(元/吨)" prop="unitPrice" label-width="160"
  142. v-if="retreatList.inOutType != '退库'">
  143. <u-input v-model="OutList.unitPrice" input-align="right" placeholder="" />
  144. </u-form-item>
  145. <u-form-item label="业务描述" prop="businessDescribe" label-width="160" label-position="top"
  146. v-if="OutList.inOutType != '移库出库'">
  147. <u-input v-model="OutList.businessDescribe" input-align="left" placeholder="请输入业务描述"
  148. type="textarea" class="textarea" maxlength="150" />
  149. </u-form-item>
  150. <u-form-item v-if="retreatList.inOutType!='退库'" label="仓位号(选填)" prop="binNumber"
  151. label-width="170">
  152. <u-input v-model="OutList.binNumber" input-align="right" placeholder="未指定" />
  153. </u-form-item>
  154. </view>
  155. </view>
  156. <view v-if="EnterList.judge == 2">
  157. <view class="uForm_item">
  158. <!-- 入库 -->
  159. <view class="title part2">{{EnterList.inOutType}}</view>
  160. <view class='row'>
  161. <view class="left">编号</view>
  162. <view class="right">入库({{EnterList.inOutTaskNo}})</view>
  163. </view>
  164. <view class='row'>
  165. <view class="left">仓库</view>
  166. <view class="right">{{EnterList.warehouseName}}</view>
  167. </view>
  168. <view class='row'>
  169. <view class="left">入库类型</view>
  170. <view class="right">{{EnterList.inOutType}}</view>
  171. </view>
  172. <view class='row' v-if="EnterList.inOutType == '移库入库'">
  173. <view class="left">移库任务编号</view>
  174. <view class="right">{{EnterList.moveTaskNo}}</view>
  175. </view>
  176. <view class='row' v-if="EnterList.inOutType != '移库入库'">
  177. <view class="left">合同编号</view>
  178. <view class="right">{{EnterList.contractNo}}</view>
  179. </view>
  180. <view class='row'>
  181. <view class="left">货名</view>
  182. <view class="right">{{EnterList.goodsName}}</view>
  183. </view>
  184. <view class='row'>
  185. <view class="left">重量(吨)</view>
  186. <view class="right">{{EnterList.weight}}</view>
  187. </view>
  188. <view class='row'>
  189. <view class="left">预计入库日期</view>
  190. <view class="right">{{EnterList.predictDate}}</view>
  191. </view>
  192. <view class='row'>
  193. <view class="left">出库经办人</view>
  194. <view class="right">{{EnterList.publisher}}</view>
  195. </view>
  196. </view>
  197. <view class="uForm_item">
  198. <u-form-item label="品级" prop="grade" label-width="150" v-if="EnterList.inOutType != '移库入库' ">
  199. <u-input v-model="EnterList.grade" input-align="right" placeholder="请选择品级"
  200. @click='show=true' disabled />
  201. <u-picker :range="pjList" range-key="type" @confirm='pjPicker1($event)' v-model="show"
  202. mode="selector">
  203. </u-picker>
  204. </u-form-item>
  205. <u-form-item label="容重(克/升)>=" prop="bulkDensity" label-width="190"
  206. v-if="EnterList.inOutType != '移库入库'">
  207. <u-input v-model="EnterList.bulkDensity" input-align="right" placeholder="请输入容重占比" />
  208. </u-form-item>
  209. <u-form-item label="水分(%)<=" prop="waterContent" label-width="160"
  210. v-if="EnterList.inOutType != '移库入库'">
  211. <u-input v-model="EnterList.waterContent" input-align="right" placeholder="请输入水分占比" />
  212. </u-form-item>
  213. <u-form-item label="单价(元/吨)" prop="unitPrice" label-width="160"
  214. v-if="EnterList.inOutType != '移库入库'">
  215. <u-input v-model="EnterList.unitPrice" input-align="right" placeholder="请输入单价" />
  216. </u-form-item>
  217. <u-form-item label="业务描述" prop="businessDescribe" label-width="160" label-position="top">
  218. <u-input v-model="EnterList.businessDescribe" input-align="left" placeholder="请输入业务描述"
  219. type="textarea" class="textarea" maxlength="150" />
  220. </u-form-item>
  221. <u-form-item v-if="OutList.inOutType!='退库'" label="仓位号(选填)" prop="binNumber" label-width="170">
  222. <u-input v-model="EnterList.binNumber" input-align="right" placeholder="未指定" />
  223. </u-form-item>
  224. </view>
  225. </view>
  226. </u-form>
  227. </view>
  228. <u-popup v-model="show1" mode="center">
  229. <view style="width: 300px;padding: 30rpx 10rpx;border-radius: 20rpx;">
  230. <view class="rejectText">驳回原因</view>
  231. <u-input v-model="rejectInfo" type="textarea" :border="border" class="rejectInfoCss"
  232. placeholder="请输入驳回原因" />
  233. <view class="flex">
  234. <u-button @click="show1 = false" class="submit">取消</u-button>
  235. <u-button @click="rejectSubmit()" class="submit">确定</u-button>
  236. </view>
  237. </view>
  238. </u-popup>
  239. <u-toast ref="uToast" />
  240. <view style='padding:10px;' class='flex bottom-btn'>
  241. <u-button @click='show1 = true' type="error" class="btn1" hover-class='none'>驳回</u-button>
  242. <u-button @click='passSubmit()' type="success" class="btn2">通过</u-button>
  243. </view>
  244. </view>
  245. </template>
  246. <script>
  247. import {
  248. mapState
  249. } from 'vuex';
  250. export default {
  251. data() {
  252. return {
  253. id: "",
  254. OutList: {}, //出
  255. EnterList: {}, //入
  256. retreatList: {}, //退
  257. type: '移库',
  258. show: false,
  259. show1: false,
  260. border: false,
  261. rejectInfo: "", //驳回原因
  262. pjList: [{
  263. type: '一等品'
  264. },
  265. {
  266. type: '二等品'
  267. },
  268. {
  269. type: '三等品'
  270. },
  271. {
  272. type: '等外'
  273. }
  274. ],
  275. }
  276. },
  277. // onReady() {
  278. // this.$refs.uForm.setRules(this.rules);
  279. // },
  280. onLoad(options) {
  281. this.id = options.id
  282. this.getList()
  283. },
  284. computed: {
  285. ...mapState(['hasLogin', 'userInfo']),
  286. },
  287. methods: {
  288. getList() {
  289. this.$api.doRequest('get', '/inOutWarehouseTask/getTask', {
  290. id: this.id
  291. }).then(res => {
  292. if (res.data.code == 200) {
  293. this.$api.doRequest('get', '/inOutWarehouseTask/getInOutWarehouseTask', {
  294. relevanceId: res.data.data.relevanceId
  295. }).then(res => {
  296. if (res.data.code == 200) {
  297. for (let i = 0; i < res.data.data.length; i++) {
  298. if (res.data.data[i].inOutType == "移库出库" || res.data.data[i]
  299. .inOutType == "贸易服务出库" || res.data.data[i].inOutType == "销售出库" ||
  300. res.data.data[i].inOutType == "暂存出库") {
  301. this.OutList = res.data.data[i]
  302. this.OutList.judge = 1
  303. } else if (res.data.data[i].inOutType == "移库入库" || res.data.data[i]
  304. .inOutType == "暂存入库" || res
  305. .data.data[i].inOutType == "采购入库" || res.data.data[i].inOutType ==
  306. "贸易服务入库") {
  307. this.EnterList = res.data.data[i]
  308. this.EnterList.judge = 2
  309. } else if (res.data.data[i].inOutType == "退库") {
  310. this.retreatList = res.data.data[i]
  311. this.retreatList.judge = 3
  312. }
  313. }
  314. }
  315. })
  316. }
  317. })
  318. },
  319. pjPicker(e) {
  320. this.OutList.grade = this.pjList[e[0]].type
  321. this.OutList.gradeKey = e[0] + 1
  322. },
  323. pjPicker1(e) {
  324. this.EnterList.grade = this.pjList[e[0]].type
  325. this.EnterList.gradeKey = e[0] + 1
  326. },
  327. passSubmit() {
  328. this.OutList.inOutFlag = 1
  329. this.EnterList.inOutFlag = 2
  330. if (this.OutList.taskTypeKey == 1) {
  331. this.requestadd(this.OutList)
  332. } else if (this.EnterList.taskTypeKey == 2) {
  333. this.requestadd(this.EnterList)
  334. } else if (
  335. this.OutList.taskTypeKey == 3 ||
  336. this.OutList.taskTypeKey == 4
  337. ) {
  338. this.requestadd(this.OutList, 'repetition')
  339. if (!this.deletetask) {
  340. this.requestadd(this.EnterList, 'repetition')
  341. }
  342. }
  343. },
  344. rejectSubmit() {
  345. // (1出库2入库3移库4退库并出库)
  346. if (!this.rejectInfo) {
  347. this.$api.msg('驳回原因不能为空!')
  348. } else {
  349. this.show1 = false
  350. if (this.OutList.taskTypeKey == 1) {
  351. this.requestaudit(this.OutList)
  352. } else if (this.OutList.taskTypeKey == 2) {
  353. this.requestaudit(this.OutList)
  354. } else if (
  355. this.OutList.taskTypeKey == 3 ||
  356. this.OutList.taskTypeKey == 4
  357. ) {
  358. this.requestaudit(this.OutList, 'repetition')
  359. if (!this.deletetask) {
  360. this.requestaudit(this.OutList, 'repetition')
  361. }
  362. }
  363. }
  364. },
  365. requestadd(list, status) {
  366. list.compId = sessionStorage.getItem('ws-pf_compId')
  367. list.publisher = this.userInfo.userName
  368. this.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(res => {
  369. if (res.data.code == 200) {
  370. this.$api.doRequest('post', '/workflow/api/handle', {
  371. taskId: list.taskId,
  372. approved: true,
  373. auditMind: '34',
  374. needReapply: false
  375. }).then(res => {
  376. if (res.data.code == 200) {
  377. this.$api.msg('审核成功!')
  378. this.setTimeout(function() {
  379. uni.navigateBack()
  380. }, 1000);
  381. }
  382. })
  383. }
  384. })
  385. },
  386. requestaudit(list, status) {
  387. list.compId = '2710b21efc1e4393930c5dc800010dc4'
  388. list.publisher = this.userInfo.userName
  389. this.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(res => {
  390. if (res.data.code == 200) {
  391. this.$api.doRequest('post', '/workflow/api/handle', {
  392. taskId: list.taskId,
  393. approved: false,
  394. auditMind: this.rejectInfo,
  395. needReapply: true
  396. }).then(res => {
  397. if (res.data.code == 200) {
  398. this.$api.msg('驳回成功!')
  399. this.setTimeout(function() {
  400. uni.navigateBack()
  401. }, 1000);
  402. }
  403. })
  404. }
  405. })
  406. },
  407. }
  408. }
  409. </script>
  410. <style scoped lang="scss">
  411. .content1 {
  412. margin: 10rpx;
  413. padding-bottom: 224rpx;
  414. .title {
  415. height: 70rpx;
  416. line-height: 60rpx;
  417. font-size: 32rpx;
  418. font-weight: 600;
  419. color: #333333;
  420. border-bottom: 2rpx solid #EEEEEE;
  421. }
  422. }
  423. .uForm {
  424. padding: 0 40rpx;
  425. }
  426. .u-form-item {
  427. padding: 0;
  428. }
  429. .bottom-btn {
  430. width: 100%;
  431. position: fixed;
  432. bottom: 0;
  433. display: flex;
  434. z-index: 2;
  435. left: 0;
  436. background-color: #f8f8f8;
  437. flex-direction: column;
  438. .btn1,
  439. .btn2 {
  440. width: 100%;
  441. margin-bottom: 26rpx;
  442. border-radius: 90rpx;
  443. }
  444. .btn1 {
  445. background: white;
  446. color: #00C265;
  447. }
  448. }
  449. .submit {
  450. width: 40%;
  451. background: #22C572;
  452. border-radius: 10rpx;
  453. }
  454. .part2 {
  455. margin-top: 20rpx;
  456. }
  457. .textarea {
  458. border: 1px solid #ccc;
  459. border-radius: 10rpx;
  460. background-color: #F9F9FA;
  461. height: 100px;
  462. }
  463. .row {
  464. display: flex;
  465. justify-content: space-between;
  466. // border-bottom: 1px solid #EEEEEE;
  467. padding: 21rpx 0;
  468. .right,
  469. input {
  470. font-size: 28rpx;
  471. color: #333333;
  472. }
  473. }
  474. //弹出框
  475. // .popup {
  476. // padding: 30rpx;
  477. // border-radius: 20rpx;
  478. // }
  479. .rejectInfoCss {
  480. border: 1px solid #ccc;
  481. border-radius: 10rpx;
  482. background-color: #F9F9FA;
  483. height: 100px;
  484. margin: 30rpx;
  485. }
  486. .uForm_item {
  487. padding: 20rpx;
  488. background-color: #FFFFFF;
  489. margin: 20rpx;
  490. border-radius: 20rpx;
  491. }
  492. .rejectText {
  493. text-align: center;
  494. }
  495. .topInfo {
  496. height: 210rpx;
  497. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  498. padding: 30rpx;
  499. .topInfo-item {
  500. height: 150rpx;
  501. background-color: #FFFFFF;
  502. border-radius: 20rpx;
  503. padding: 40rpx;
  504. .logo {
  505. width: 40rpx;
  506. height: 40rpx;
  507. margin-top: 8rpx;
  508. }
  509. .infoText {
  510. font-size: 36rpx;
  511. font-weight: 600;
  512. margin-left: 20rpx;
  513. }
  514. .infoData {
  515. color: #878C9C;
  516. font-size: 26rpx;
  517. margin-top: 10rpx;
  518. }
  519. }
  520. }
  521. </style>