Issueandreceipt_task_approval.vue 18 KB

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