Issueandreceipt_task_approval.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  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. uni.showLoading({
  390. title:"审核中"
  391. })
  392. this.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(res => {
  393. if (res.data.code == 200) {
  394. this.$api.doRequest('post', '/workflow/api/handle', {
  395. taskId: list.taskId,
  396. approved: true,
  397. auditMind: '34',
  398. needReapply: false
  399. }).then(res => {
  400. uni.hideLoading()
  401. if (res.data.code == 200) {
  402. this.$api.msg('审核成功!')
  403. setTimeout(function() {
  404. uni.navigateBack()
  405. }, 1000);
  406. }else{
  407. this.$api.msg('审核失败!')
  408. }
  409. }).catch(res => {
  410. uni.hideLoading()
  411. if(res.message){
  412. uni.showToast({
  413. title: res.message,
  414. icon: 'none',
  415. duration: 2000
  416. })
  417. }
  418. else{
  419. uni.showToast({
  420. title: "系统异常,请联系管理员",
  421. icon: 'none',
  422. duration: 2000
  423. })
  424. }
  425. })
  426. }
  427. else{
  428. this.$api.msg('审核失败!')
  429. }
  430. }).catch(res => {
  431. uni.hideLoading()
  432. if(res.message){
  433. uni.showToast({
  434. title: res.message,
  435. icon: 'none',
  436. duration: 2000
  437. })
  438. }
  439. else{
  440. uni.showToast({
  441. title: "系统异常,请联系管理员",
  442. icon: 'none',
  443. duration: 2000
  444. })
  445. }
  446. })
  447. },
  448. requestaudit(list, status) {
  449. list.compId = '2710b21efc1e4393930c5dc800010dc4'
  450. list.publisher = this.userInfo.userName
  451. this.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(res => {
  452. if (res.data.code == 200) {
  453. this.$api.doRequest('post', '/workflow/api/handle', {
  454. taskId: list.taskId,
  455. approved: false,
  456. auditMind: this.rejectInfo,
  457. needReapply: true
  458. }).then(res => {
  459. if (res.data.code == 200) {
  460. this.$api.msg('驳回成功!')
  461. setTimeout(function() {
  462. uni.navigateBack()
  463. }, 1000);
  464. }
  465. })
  466. }
  467. })
  468. },
  469. }
  470. }
  471. </script>
  472. <style scoped lang="scss">
  473. .content1 {
  474. margin: 10rpx;
  475. padding-bottom: 224rpx;
  476. .title {
  477. height: 70rpx;
  478. line-height: 60rpx;
  479. font-size: 32rpx;
  480. font-weight: 600;
  481. color: #333333;
  482. border-bottom: 2rpx solid #EEEEEE;
  483. }
  484. }
  485. .uForm {
  486. padding: 0 40rpx;
  487. }
  488. .u-form-item {
  489. padding: 0;
  490. }
  491. .bottom-btn {
  492. width: 100%;
  493. position: fixed;
  494. bottom: 0;
  495. display: flex;
  496. z-index: 2;
  497. left: 0;
  498. background-color: #f8f8f8;
  499. flex-direction: column;
  500. .btn1,
  501. .btn2 {
  502. width: 100%;
  503. margin-bottom: 26rpx;
  504. border-radius: 90rpx;
  505. }
  506. .btn1 {
  507. background: white;
  508. color: #00C265;
  509. }
  510. }
  511. .submit {
  512. width: 50%;
  513. background: #22C572;
  514. border-radius: 10rpx;
  515. }
  516. .part2 {
  517. margin-top: 20rpx;
  518. }
  519. .textarea {
  520. border: 1px solid #ccc;
  521. border-radius: 10rpx;
  522. background-color: #F9F9FA;
  523. height: 100px;
  524. }
  525. .row {
  526. display: flex;
  527. justify-content: space-between;
  528. // border-bottom: 1px solid #EEEEEE;
  529. padding: 21rpx 0;
  530. .right,
  531. input {
  532. font-size: 28rpx;
  533. color: #333333;
  534. }
  535. }
  536. //弹出框
  537. // .popup {
  538. // padding: 30rpx;
  539. // border-radius: 20rpx;
  540. // }
  541. .rejectInfoCss {
  542. border: 1px solid #ccc;
  543. border-radius: 10rpx;
  544. background-color: #F9F9FA;
  545. height: 100px;
  546. margin: 30rpx;
  547. }
  548. .uForm_item {
  549. padding: 20rpx;
  550. background-color: #FFFFFF;
  551. margin: 20rpx;
  552. border-radius: 20rpx;
  553. }
  554. .rejectText {
  555. text-align: center;
  556. }
  557. .topInfo {
  558. height: 210rpx;
  559. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  560. padding: 30rpx;
  561. .topInfo-item {
  562. height: 150rpx;
  563. background-color: #FFFFFF;
  564. border-radius: 20rpx;
  565. padding: 40rpx;
  566. .logo {
  567. width: 40rpx;
  568. height: 40rpx;
  569. margin-top: 8rpx;
  570. }
  571. .infoText {
  572. font-size: 36rpx;
  573. font-weight: 600;
  574. margin-left: 20rpx;
  575. }
  576. .infoData {
  577. color: #878C9C;
  578. font-size: 26rpx;
  579. margin-top: 10rpx;
  580. }
  581. }
  582. }
  583. </style>