Issueandreceipt_task_details.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  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. </view>
  231. </template>
  232. <script>
  233. import {
  234. mapState
  235. } from 'vuex';
  236. export default {
  237. data() {
  238. return {
  239. id: "",
  240. OutList: {}, //出
  241. EnterList: {}, //入
  242. retreatList: {}, //退
  243. type: '移库',
  244. show: false,
  245. show1: false,
  246. border: false,
  247. rejectInfo: "", //驳回原因
  248. pjList: [{
  249. type: '一等品'
  250. },
  251. {
  252. type: '二等品'
  253. },
  254. {
  255. type: '三等品'
  256. },
  257. {
  258. type: '等外'
  259. }
  260. ],
  261. }
  262. },
  263. // onReady() {
  264. // this.$refs.uForm.setRules(this.rules);
  265. // },
  266. onLoad(options) {
  267. this.id = options.id
  268. this.getList()
  269. },
  270. computed: {
  271. ...mapState(['hasLogin', 'userInfo']),
  272. },
  273. methods: {
  274. getList() {
  275. this.$api.doRequest('get', '/inOutWarehouseTask/getTask', {
  276. id: this.id
  277. }).then(res => {
  278. if (res.data.code == 200) {
  279. this.$api.doRequest('get', '/inOutWarehouseTask/getInOutWarehouseTask', {
  280. relevanceId: res.data.data.relevanceId
  281. }).then(res => {
  282. if (res.data.code == 200) {
  283. for (let i = 0; i < res.data.data.length; i++) {
  284. if (res.data.data[i].inOutType == "移库出库" || res.data.data[i]
  285. .inOutType == "贸易服务出库" || res.data.data[i].inOutType == "销售出库" ||
  286. res.data.data[i].inOutType == "暂存出库") {
  287. this.OutList = res.data.data[i]
  288. this.OutList.judge = 1
  289. } else if (res.data.data[i].inOutType == "移库入库" || res.data.data[i]
  290. .inOutType == "暂存入库" || res
  291. .data.data[i].inOutType == "采购入库" || res.data.data[i].inOutType ==
  292. "贸易服务入库") {
  293. this.EnterList = res.data.data[i]
  294. this.EnterList.judge = 2
  295. } else if (res.data.data[i].inOutType == "退库") {
  296. this.retreatList = res.data.data[i]
  297. this.retreatList.judge = 3
  298. }
  299. }
  300. }
  301. })
  302. }
  303. })
  304. },
  305. pjPicker(e) {
  306. this.OutList.grade = this.pjList[e[0]].type
  307. this.OutList.gradeKey = e[0] + 1
  308. },
  309. pjPicker1(e) {
  310. this.EnterList.grade = this.pjList[e[0]].type
  311. this.EnterList.gradeKey = e[0] + 1
  312. },
  313. passSubmit() {
  314. this.OutList.inOutFlag = 1
  315. this.EnterList.inOutFlag = 2
  316. if (this.OutList.taskTypeKey == 1) {
  317. this.requestadd(this.OutList)
  318. } else if (this.EnterList.taskTypeKey == 2) {
  319. this.requestadd(this.EnterList)
  320. } else if (
  321. this.OutList.taskTypeKey == 3 ||
  322. this.OutList.taskTypeKey == 4
  323. ) {
  324. this.requestadd(this.OutList, 'repetition')
  325. if (!this.deletetask) {
  326. this.requestadd(this.EnterList, 'repetition')
  327. }
  328. }
  329. if(this.retreatList.taskTypeKey == 1 || this.retreatList.taskTypeKey == 2){
  330. this.requestadd(this.retreatList)
  331. }else if(this.retreatList.taskTypeKey == 3 || this.retreatList.taskTypeKey == 4){
  332. this.requestadd(this.retreatList, 'repetition')
  333. }
  334. },
  335. rejectSubmit() {
  336. // (1出库2入库3移库4退库并出库)
  337. if (!this.rejectInfo) {
  338. this.$api.msg('驳回原因不能为空!')
  339. } else {
  340. this.show1 = false
  341. if (this.OutList.taskTypeKey == 1 ) {
  342. this.requestaudit(this.OutList)
  343. } else if (this.OutList.taskTypeKey == 2) {
  344. this.requestaudit(this.OutList)
  345. } else if (
  346. this.OutList.taskTypeKey == 3 ||
  347. this.OutList.taskTypeKey == 4
  348. ) {
  349. this.requestaudit(this.OutList, 'repetition')
  350. if (!this.deletetask) {
  351. this.requestaudit(this.OutList, 'repetition')
  352. }
  353. }
  354. if(this.EnterList){
  355. if(this.EnterList.taskTypeKey == 1 || this.EnterList.taskTypeKey == 2){
  356. this.requestaudit(this.EnterList)
  357. }else if(this.EnterList.taskTypeKey == 3 || this.EnterList.taskTypeKey == 4){
  358. this.requestaudit(this.EnterList, 'repetition')
  359. }
  360. }
  361. if(this.retreatList){
  362. if(this.retreatList.taskTypeKey == 1 || this.retreatList.taskTypeKey == 2){
  363. this.requestaudit(this.retreatList)
  364. }else if(this.retreatList.taskTypeKey == 3 || this.retreatList.taskTypeKey == 4){
  365. this.requestaudit(this.retreatList, 'repetition')
  366. }
  367. }
  368. }
  369. },
  370. requestadd(list, status) {
  371. list.compId = sessionStorage.getItem('ws-pf_compId')
  372. list.publisher = this.userInfo.userName
  373. this.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(res => {
  374. if (res.data.code == 200) {
  375. this.$api.doRequest('post', '/workflow/api/handle', {
  376. taskId: list.taskId,
  377. approved: true,
  378. auditMind: '34',
  379. needReapply: false
  380. }).then(res => {
  381. if (res.data.code == 200) {
  382. this.$api.msg('审核成功!')
  383. setTimeout(function() {
  384. uni.navigateBack()
  385. }, 1000);
  386. }
  387. })
  388. }
  389. })
  390. },
  391. requestaudit(list, status) {
  392. list.compId = '2710b21efc1e4393930c5dc800010dc4'
  393. list.publisher = this.userInfo.userName
  394. this.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(res => {
  395. if (res.data.code == 200) {
  396. this.$api.doRequest('post', '/workflow/api/handle', {
  397. taskId: list.taskId,
  398. approved: false,
  399. auditMind: this.rejectInfo,
  400. needReapply: true
  401. }).then(res => {
  402. if (res.data.code == 200) {
  403. this.$api.msg('驳回成功!')
  404. setTimeout(function() {
  405. uni.navigateBack()
  406. }, 1000);
  407. }
  408. })
  409. }
  410. })
  411. },
  412. }
  413. }
  414. </script>
  415. <style scoped lang="scss">
  416. .content1 {
  417. margin: 10rpx;
  418. padding-bottom: 224rpx;
  419. .title {
  420. height: 70rpx;
  421. line-height: 60rpx;
  422. font-size: 32rpx;
  423. font-weight: 600;
  424. color: #333333;
  425. border-bottom: 2rpx solid #EEEEEE;
  426. }
  427. }
  428. .uForm {
  429. padding: 0 40rpx;
  430. }
  431. .u-form-item {
  432. padding: 0;
  433. }
  434. .bottom-btn {
  435. width: 100%;
  436. position: fixed;
  437. bottom: 0;
  438. display: flex;
  439. z-index: 2;
  440. left: 0;
  441. background-color: #f8f8f8;
  442. flex-direction: column;
  443. .btn1,
  444. .btn2 {
  445. width: 100%;
  446. margin-bottom: 26rpx;
  447. border-radius: 90rpx;
  448. }
  449. .btn1 {
  450. background: white;
  451. color: #00C265;
  452. }
  453. }
  454. .submit {
  455. width: 50%;
  456. background: #22C572;
  457. border-radius: 10rpx;
  458. }
  459. .part2 {
  460. margin-top: 20rpx;
  461. }
  462. .textarea {
  463. border: 1px solid #ccc;
  464. border-radius: 10rpx;
  465. background-color: #F9F9FA;
  466. height: 100px;
  467. }
  468. .row {
  469. display: flex;
  470. justify-content: space-between;
  471. // border-bottom: 1px solid #EEEEEE;
  472. padding: 21rpx 0;
  473. .right,
  474. input {
  475. font-size: 28rpx;
  476. color: #333333;
  477. }
  478. }
  479. //弹出框
  480. // .popup {
  481. // padding: 30rpx;
  482. // border-radius: 20rpx;
  483. // }
  484. .rejectInfoCss {
  485. border: 1px solid #ccc;
  486. border-radius: 10rpx;
  487. background-color: #F9F9FA;
  488. height: 100px;
  489. margin: 30rpx;
  490. }
  491. .uForm_item {
  492. padding: 20rpx;
  493. background-color: #FFFFFF;
  494. margin: 20rpx;
  495. border-radius: 20rpx;
  496. }
  497. .rejectText {
  498. text-align: center;
  499. }
  500. .topInfo {
  501. height: 210rpx;
  502. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  503. padding: 30rpx;
  504. .topInfo-item {
  505. height: 150rpx;
  506. background-color: #FFFFFF;
  507. border-radius: 20rpx;
  508. padding: 40rpx;
  509. .logo {
  510. width: 40rpx;
  511. height: 40rpx;
  512. margin-top: 8rpx;
  513. }
  514. .infoText {
  515. font-size: 36rpx;
  516. font-weight: 600;
  517. margin-left: 20rpx;
  518. }
  519. .infoData {
  520. color: #878C9C;
  521. font-size: 26rpx;
  522. margin-top: 10rpx;
  523. }
  524. }
  525. }
  526. </style>