warehouse_approval.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  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="list.status == '已驳回'"
  8. style="height: 40rpx;"></image><!-- 驳回 -->
  9. <image src="../../../static/img/tongguo.png" mode="" v-if="list.status == '已通过'"
  10. style="height: 40rpx;"></image><!-- 通过 -->
  11. <image src="../../../static/img/daishenhe.png" mode="" v-if="list.status == '审核中'"
  12. style="height: 40rpx;"></image><!-- 待审核 -->
  13. </view>
  14. <view class="infoText">{{list.status}}</view>
  15. </view>
  16. <view class="infoData">{{list.updateDate}}</view>
  17. </view>
  18. </view>
  19. <view class='content1'>
  20. <view class="title">基本信息</view>
  21. <view class='row'>
  22. <view class="left">仓库</view>
  23. <view class="right">{{list.warehouseName}}</view>
  24. </view>
  25. <view class='row'>
  26. <view class="left">货名</view>
  27. <view class="right">{{list.goodsName}}</view>
  28. </view>
  29. <view class='row'>
  30. <view class="left">基准水分(%)</view>
  31. <view class="right">{{list.waterBase}}</view>
  32. </view>
  33. <view class='row'>
  34. <view class="left">干粮水分(%)</view>
  35. <view class="right">{{list.waterMin}}</view>
  36. </view>
  37. <view class='row'>
  38. <view class="left">水分上限(%)</view>
  39. <view class="right">{{list.waterMax}}</view>
  40. </view>
  41. <view v-if="list.paramType == '2'" class='row'>
  42. <view class="left">扣重比</view>
  43. <view class="right">{{list.deductWeight}}</view>
  44. </view>
  45. <view class='row'>
  46. <view class="left">干粮收购价格(元/公斤)</view>
  47. <view class="right">{{list.dryGrainPrice}}</view>
  48. </view>
  49. <view class='row boder'>
  50. <view class="left">销售上限</view>
  51. <view class="right">{{list.saleLimit}}</view>
  52. </view>
  53. </view>
  54. <view class="content2">
  55. <view class="title">粮价设置</view>
  56. <view v-for="(item,index) in list.details" :key="index">
  57. <view class="row">
  58. <view class="left">等级</view>
  59. <view class="right">{{item.level}}</view>
  60. </view>
  61. <view v-if="list.paramType == '2'" class="row">
  62. <view class="left">基准单价(元/公斤)</view>
  63. <view class="right">{{item.basePrice}}</view>
  64. </view>
  65. <view class="row" v-for="(item1,index1) in item.modelList" :key="index1"
  66. :class="index1==item.modelList.length-1?'boder':''">
  67. <view v-if="list.paramType == '2'" class="left">{{item1.startWater}}-{{item1.endWater}}降幅(元/0.1%)
  68. </view>
  69. <view v-else class="left">{{item1.startWater}}-{{item1.endWater}}扣重比</view>
  70. <view class="right">{{item1.price}}</view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="content3">
  75. <view class="title row">
  76. 流程
  77. </view>
  78. <view v-for="(item,index) in auditList" :key='index' class="audit">
  79. <view class="row">
  80. <view class="left">
  81. <view class="item1">
  82. <view class="item-content">{{item.operatorTitle}}</view>
  83. <view v-if="item.status=='success'" class='status success'>
  84. <u-icon name="checkmark" color="#2979ff" size="28"></u-icon>
  85. </view>
  86. <view v-if="item.status=='error'" class='status error'>
  87. <u-icon name="close" color="rgb(245, 108, 108)" size="28"></u-icon>
  88. </view>
  89. <view v-if="item.status=='question'" class='status question'>
  90. <u-icon name="question" color="#f9ae3d" size="28"></u-icon>
  91. </view>
  92. </view>
  93. <view class="item2">
  94. <view class="name">{{item.desc}}
  95. </view>
  96. <view class='time'>{{item.updateDate}}</view>
  97. <view v-if="item.status=='success'" class="status success">{{item.commonStaffs1?item.staffscontent:item.operatorName}}<text v-if='!item.commonStaffs1'>已审核</text></view>
  98. <!-- <view v-if="item.status='error'" class="status error">{{item.commonStaffs1?item.staffscontent:item.operatorName}}<text v-if='!item.commonStaffs1'>{{item.workflowHistoricTasks ? "已审核":'未审核'}}</text></view> -->
  99. <view v-if="item.status=='question'" class="status question">{{item.commonStaffs1?item.staffscontent:''}}<text v-if='!item.commonStaffs1'>未审核</text></view>
  100. <!-- <view class="status success">吕波(已审核)</view> -->
  101. </view>
  102. </view>
  103. <view v-if='item.commonStaffs1' class="right">
  104. <u-icon @click='showcontent(item)' :name="item.showflow?'arrow-up':'arrow-down'" size="28"></u-icon>
  105. </view>
  106. </view>
  107. <view v-if='item.showflow' style='padding:10px 0 0 50px;'>
  108. <view class='row2'>
  109. <view v-for='item1 in item.commonStaffs1' style='margin:5px;text-align:center;'>
  110. <view class="item-content">
  111. <u-icon v-if='item1.status' name="checkmark" color="#fff" size="14"></u-icon>
  112. <u-icon v-if='!item1.status' name="question" color="#f9ae3d" size="14"></u-icon>
  113. </view>
  114. <view class="name">{{item1.staffName}}</view>
  115. </view>
  116. </view>
  117. </view>
  118. <view class="row-line" v-if="index!= auditList.length - 1"></view>
  119. </view>
  120. </view>
  121. <view v-if='show1' class="shade">
  122. <view class="wrap">
  123. <view class="alert-top">
  124. <view class="title">
  125. 审核意见(驳回)
  126. </view>
  127. <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
  128. </view>
  129. <view class="u-textarea-style">
  130. <view class="right-bottom">
  131. {{rejectInfo.length}}/100个字
  132. </view>
  133. <u-input class="" v-model='rejectInfo' placeholder="请在此输入审核意见" type="textarea" height="414"
  134. maxlength="100" />
  135. </view>
  136. <!-- <u-button @click="show1 = false" class="cancel">取消</u-button>
  137. <u-button @click="reject()" class="confirm">确定</u-button> -->
  138. <view @click='show1 = false' class="cancel">取消</view>
  139. <view @click='reject()' class="confirm">确定</view>
  140. </view>
  141. </view>
  142. <view v-if='show2' class="shade">
  143. <view class="wrap">
  144. <view class="alert-top">
  145. <view class="title">
  146. 审核意见(通过)
  147. </view>
  148. <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
  149. </view>
  150. <view class="u-textarea-style">
  151. <view class="right-bottom">
  152. {{rejectInfo1.length}}/100个字
  153. </view>
  154. <u-input class="" v-model='rejectInfo1' placeholder="请在此输入审核意见" type="textarea" height="414"
  155. maxlength="100" />
  156. </view>
  157. <!-- <u-button @click="show2 = false" class="cancel">取消</u-button>
  158. <u-button @click="audit()" class="confirm">确定</u-button> -->
  159. <view @click='show2 = false' class="cancel">取消</view>
  160. <view @click='audit()' class="confirm">确定</view>
  161. </view>
  162. </view>
  163. <u-toast ref="uToast" />
  164. <view style='padding:10px;' class='flex bottom-btn'>
  165. <u-button v-if='isSHowBtn' @click='show1 = true' type="error" class="btn1" hover-class='none'>驳回</u-button>
  166. <u-button v-if='isSHowBtn' @click='show2 = true' type="success" class="btn2">通过</u-button>
  167. </view>
  168. </view>
  169. </template>
  170. <script>
  171. import helper from '@/common/helper.js';
  172. import {
  173. mapState
  174. } from 'vuex';
  175. export default {
  176. name: "task",
  177. data() {
  178. return {
  179. everyCheck: '',
  180. isSHowBtn: true,
  181. show: false,
  182. height: 200,
  183. autoHeight: true,
  184. border: false,
  185. show2: false,
  186. show1: false,
  187. rejectInfo: "",
  188. rejectInfo1: "",
  189. id: 0,
  190. list: {},
  191. auditList:[],
  192. pcUserInfo: uni.getStorageSync('pcUserInfo'),
  193. switchVal: false,
  194. contractNoList: []
  195. };
  196. },
  197. computed: {
  198. ...mapState(['hasLogin', 'userInfo'])
  199. },
  200. onBackPress(e) {
  201. if (this.everyCheck) {
  202. uni.navigateTo({
  203. url: "/pages/task/my_task"
  204. })
  205. return true;
  206. }
  207. },
  208. onLoad(options) {
  209. this.everyCheck = uni.getStorageSync("everyTask")
  210. this.id = options.id
  211. this.isSHowBtn = options.isShowbtn
  212. },
  213. onShow() {
  214. var that = this
  215. this.$nextTick(function() {
  216. that.getData()
  217. })
  218. },
  219. methods: {
  220. close() {
  221. this.show1 = false
  222. this.show2 = false
  223. },
  224. showcontent(item){
  225. item.showflow=!item.showflow
  226. },
  227. getData() {
  228. var data = []
  229. this.$api.doRequest('get', '/purchasePrice/purchasePriceLook', {
  230. id: this.id
  231. }).then(res => {
  232. if (res.data.code == 200) {
  233. this.list = res.data.data
  234. }
  235. })
  236. this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
  237. businessCode: 'PROCUREMENT-PRICE-APPROVE',
  238. tmpCompId: uni.getStorageSync('pcUserInfo').compId
  239. }).then(res1 => {
  240. this.$api.doRequest('get', '/commonUser/getHis', {
  241. workflowId: res1.data.data[0].id,
  242. businessKey: this.id
  243. }).then(response => {
  244. // uni.hideLoading()
  245. for (let i = 0; i < response.data.data.length; i++) {
  246. this.$set(response.data.data[i],'status','question')
  247. console.log(response.data.data[i].workflowHistoricTasks,i)
  248. if(response.data.data[i].commonStaffs){
  249. response.data.data[i].showflow=false
  250. response.data.data[i].operatorTitle=response.data.data[i].desc[0]
  251. response.data.data[i].operatorName=response.data.data[i].desc
  252. response.data.data[i].staffscontent='共'+response.data.data[i].commonStaffs.length+'人,当前审核'+response.data.data[i].workflowHistoricTasks.length+'人'
  253. if(response.data.data[i].workflowHistoricTasks&&response.data.data[i].workflowHistoricTasks.length>0){
  254. if(response.data.data[i].workflowHistoricTasks.length!=response.data.data[i].commonStaffs.length){
  255. // response.data.data[i].status='question'
  256. this.$set(response.data.data[i],'status','question')
  257. }else{
  258. this.$set(response.data.data[i],'status','success')
  259. // response.data.data[i].status='success'
  260. }
  261. response.data.data[i].workflowlen=response.data.data[i].workflowHistoricTasks.length
  262. var workflowdata=response.data.data[i].workflowHistoricTasks
  263. var staffsdata=response.data.data[i].commonStaffs
  264. for (let q = 0; q < staffsdata.length; q++) {
  265. staffsdata[q].status=false
  266. staffsdata[q].staffTitle=staffsdata[q].staffName
  267. for (let k = 0; k < workflowdata.length; k++) {
  268. if(staffsdata[q].staffId==workflowdata[k].operatorId){
  269. staffsdata[q].status=true
  270. }
  271. }
  272. }
  273. }
  274. response.data.data[i].commonStaffs1=response.data.data[i].commonStaffs
  275. }else{
  276. if(response.data.data[i].workflowHistoricTasks&&response.data.data[i].workflowHistoricTasks.length>0){
  277. this.$set(response.data.data[i],'status','success')
  278. response.data.data[i].operatorTitle=response.data.data[i].workflowHistoricTasks[0].operatorName[0]
  279. response.data.data[i].operatorName=response.data.data[i].workflowHistoricTasks[0].operatorName
  280. }else{
  281. this.$set(response.data.data[i],'status','question')
  282. // response.data.data[i].status='question'
  283. response.data.data[i].operatorTitle=response.data.data[i].desc[0]
  284. response.data.data[i].operatorName=response.data.data[i].desc
  285. }
  286. }
  287. }
  288. console.log(response.data.data)
  289. this.auditList = response.data.data
  290. })
  291. })
  292. },
  293. confirm(item) {
  294. this.list.contractNo = item[0].value
  295. },
  296. audit() {
  297. var that = this
  298. that.show2 = false
  299. uni.showModal({
  300. content: "是否确定通过审核?",
  301. showCancel: true,
  302. confirmText: '确定',
  303. success: function(res) {
  304. if (res.confirm) {
  305. uni.showLoading({
  306. title: "审核中"
  307. })
  308. // that.$api.doRequest('post', '/purchasePrice/purchasePriceEdit', that.list)
  309. // .then(res => {
  310. // if (res.data.code == 200) {
  311. that.$api.doRequest('post', '/workflow/api/handle', {
  312. approved: true,
  313. auditMind: that.rejectInfo1,
  314. needReapply: true,
  315. taskId: that.list.taskId,
  316. }).then(res1 => {
  317. if (res1.data.code == 200) {
  318. that.$api.msg('审核成功');
  319. setTimeout(function() {
  320. if (this.everyCheck) {
  321. helper.setAudit(that.list)
  322. } else {
  323. uni.navigateBack()
  324. }
  325. uni.hideLoading()
  326. }, 1000);
  327. } else {
  328. that.$api.msg(res1.data.message);
  329. }
  330. })
  331. // } else {
  332. // that.$api.msg('系统异常,请联系管理员');
  333. // }
  334. // })
  335. }
  336. }
  337. })
  338. },
  339. reject() {
  340. if (!this.rejectInfo) {
  341. this.$api.msg('驳回原因不能为空!')
  342. } else {
  343. var that = this
  344. that.show1 = false
  345. uni.showModal({
  346. content: "是否确定驳回?",
  347. showCancel: true,
  348. confirmText: '确定',
  349. success: function(res) {
  350. if (res.confirm) {
  351. that.$api.doRequest('post', '/workflow/api/handle', {
  352. taskId: that.list.taskId,
  353. approved: false,
  354. auditMind: that.rejectInfo,
  355. needReapply: true,
  356. }).then(res1 => {
  357. if (res1.data.code == 200) {
  358. that.$api.msg('驳回成功');
  359. setTimeout(function() {
  360. if (that.everyCheck) {
  361. helper.setAudit(that.list)
  362. } else {
  363. uni.navigateBack()
  364. }
  365. uni.hideLoading()
  366. }, 1000);
  367. } else {
  368. that.$api.msg(res1.data.message);
  369. }
  370. })
  371. }
  372. }
  373. })
  374. }
  375. }
  376. }
  377. }
  378. </script>
  379. <style scoped lang="scss">
  380. .warp {
  381. margin: 10rpx;
  382. padding: 20rpx 20rpx 330rpx 20rpx;
  383. }
  384. .content1,
  385. .content2 {
  386. border-radius: 20rpx;
  387. background: white;
  388. padding: 20rpx;
  389. .title {
  390. font-size: 28rpx;
  391. font-weight: 600;
  392. color: #333333;
  393. text-align: left;
  394. }
  395. .row {
  396. display: flex;
  397. justify-content: space-between;
  398. border-bottom: 1px solid #EEEEEE;
  399. padding: 21rpx 0;
  400. .right,
  401. input {
  402. font-size: 28rpx;
  403. color: #333333;
  404. }
  405. }
  406. }
  407. .content2 {
  408. margin-top: 20rpx;
  409. }
  410. .bottom-btn {
  411. width: 100%;
  412. position: fixed;
  413. bottom: 0;
  414. display: flex;
  415. z-index: 2;
  416. left: 0;
  417. background-color: #f8f8f8;
  418. flex-direction: column;
  419. .btn1,
  420. .btn2 {
  421. width: 100%;
  422. margin-bottom: 26rpx;
  423. border-radius: 90rpx;
  424. }
  425. .btn1 {
  426. background: white;
  427. color: #00C265;
  428. }
  429. }
  430. .submit {
  431. width: 40%;
  432. background: #22C572;
  433. border-radius: 10rpx;
  434. }
  435. .boder {
  436. border: 0;
  437. border-bottom: 0 !important;
  438. }
  439. .topInfo {
  440. height: 210rpx;
  441. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  442. padding: 30rpx;
  443. .topInfo-item {
  444. height: 150rpx;
  445. background-color: #FFFFFF;
  446. border-radius: 20rpx;
  447. padding: 40rpx;
  448. .logo {
  449. width: 40rpx;
  450. height: 40rpx;
  451. margin-top: 8rpx;
  452. }
  453. .infoText {
  454. font-size: 36rpx;
  455. font-weight: 600;
  456. margin-left: 20rpx;
  457. }
  458. .infoData {
  459. color: #878C9C;
  460. font-size: 26rpx;
  461. margin-top: 10rpx;
  462. }
  463. }
  464. }
  465. .shade {
  466. position: fixed;
  467. top: 0;
  468. left: 0;
  469. height: 100%;
  470. width: 100%;
  471. background: rgba(0, 0, 0, 0.4);
  472. z-index: 3;
  473. .wrap {
  474. position: absolute;
  475. left: 0;
  476. top: 0;
  477. right: 0;
  478. bottom: 0;
  479. margin: auto;
  480. background: #fff;
  481. width: calc(100% - 198rpx);
  482. height: 700rpx;
  483. border-radius: 20rpx;
  484. .alert-top {
  485. padding: 33rpx;
  486. display: flex;
  487. justify-content: center;
  488. align-items: center;
  489. position: relative;
  490. }
  491. .title {
  492. font-size: 32rpx;
  493. font-weight: 600;
  494. color: #333333;
  495. }
  496. .close {
  497. position: absolute;
  498. right: 33rpx;
  499. }
  500. }
  501. }
  502. // .cancel,
  503. // .confirm {
  504. // position: absolute;
  505. // display: inline-block;
  506. // width: 50%;
  507. // text-align: center;
  508. // bottom: 0;
  509. // padding: 10px;
  510. // border-top: 1px solid #eee;
  511. // font-size: 34rpx;
  512. // }
  513. // .cancel {
  514. // left: 0;
  515. // border-right: 1px solid #eee;
  516. // color: #AFB3BF;
  517. // }
  518. // .confirm {
  519. // right: 0;
  520. // color: #22C572;
  521. // }
  522. .u-textarea-style {
  523. margin: 20rpx;
  524. background: #F9F9FA;
  525. border-radius: 10px;
  526. border: 1px solid #EEEEEE;
  527. padding: 10rpx 20rpx;
  528. position: relative;
  529. .right-bottom {
  530. position: absolute;
  531. right: 20rpx;
  532. bottom: 20rpx;
  533. color: #AFB3BF;
  534. }
  535. }
  536. /deep/.u-input__textarea {
  537. height: 300rpx !important;
  538. }
  539. .cancel,
  540. .confirm {
  541. position: absolute;
  542. display: inline-block;
  543. width: 50%;
  544. text-align: center;
  545. bottom: 0;
  546. padding: 10px;
  547. border-top: 1px solid #eee;
  548. font-size: 34rpx;
  549. }
  550. .cancel {
  551. left: 0;
  552. border-right: 1px solid #eee;
  553. color: #AFB3BF;
  554. }
  555. .confirm {
  556. right: 0;
  557. color: #22C572;
  558. }
  559. .content3 {
  560. background: white;
  561. margin: 20rpx 0;
  562. border-radius: 20rpx;
  563. padding: 20rpx;
  564. .row {
  565. display: flex;
  566. justify-content: space-between;
  567. .left {
  568. display: flex;
  569. align-items: center;
  570. .item1{
  571. position:relative;
  572. .item-content{
  573. background:#22C572;
  574. width: 50px;
  575. height: 50px;
  576. border-radius: 50%;
  577. line-height: 50px;
  578. text-align: center;
  579. font-size: 20px;
  580. color: #fff;
  581. }
  582. .status{
  583. position:absolute;
  584. border-radius: 50%;
  585. padding: 1px 2px;
  586. right: 0;
  587. bottom: 0;
  588. background:#fff;
  589. }
  590. .status.success{
  591. border:1px solid rgb(60, 156, 255);
  592. }
  593. .status.error{
  594. border:1px solid rgb(245, 108, 108);
  595. }
  596. .status.question{
  597. border:1px solid #f9ae3d;
  598. }
  599. }
  600. .item2 {
  601. margin-left: 20rpx;
  602. .name {
  603. font-size: 32rpx;
  604. font-weight: 800;
  605. }
  606. .status.success {
  607. color: #6CC48C;
  608. }
  609. .status.error {
  610. color: rgb(245, 108, 108);
  611. }
  612. .status.question {
  613. color: #f9ae3d;
  614. }
  615. .time{
  616. color:#999;
  617. }
  618. }
  619. }
  620. .right {
  621. color: #B0B1B5;
  622. margin-top: 10px;
  623. }
  624. }
  625. .row2{
  626. display:flex;
  627. .item-content{
  628. background:#22C572;
  629. width: 30px;
  630. height: 30px;
  631. border-radius: 50%;
  632. line-height: 30px;
  633. text-align: center;
  634. font-size: 12px;
  635. color: #fff;
  636. padding:0 2px;
  637. margin:0 auto;
  638. }
  639. .status{
  640. position:absolute;
  641. top:0;right:0;
  642. }
  643. }
  644. .row-line {
  645. width: 1px;
  646. height: 30px;
  647. background: #F2F2F2;
  648. margin: 10rpx 50rpx;
  649. }
  650. .audit {
  651. margin-top: 20rpx;
  652. }
  653. }
  654. </style>