warehouse_approval.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  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 v-if='show1' class="shade">
  75. <view class="wrap">
  76. <view class="alert-top">
  77. <view class="title">
  78. 审核意见(驳回)
  79. </view>
  80. <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
  81. </view>
  82. <view class="u-textarea-style">
  83. <view class="right-bottom">
  84. {{rejectInfo.length}}/100个字
  85. </view>
  86. <u-input class="" v-model='rejectInfo' placeholder="请在此输入审核意见" type="textarea" height="414"
  87. maxlength="100" />
  88. </view>
  89. <!-- <u-button @click="show1 = false" class="cancel">取消</u-button>
  90. <u-button @click="reject()" class="confirm">确定</u-button> -->
  91. <view @click='show1 = false' class="cancel">取消</view>
  92. <view @click='reject()' class="confirm">确定</view>
  93. </view>
  94. </view>
  95. <view v-if='show2' class="shade">
  96. <view class="wrap">
  97. <view class="alert-top">
  98. <view class="title">
  99. 审核意见(通过)
  100. </view>
  101. <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
  102. </view>
  103. <view class="u-textarea-style">
  104. <view class="right-bottom">
  105. {{rejectInfo1.length}}/100个字
  106. </view>
  107. <u-input class="" v-model='rejectInfo1' placeholder="请在此输入审核意见" type="textarea" height="414"
  108. maxlength="100" />
  109. </view>
  110. <!-- <u-button @click="show2 = false" class="cancel">取消</u-button>
  111. <u-button @click="audit()" class="confirm">确定</u-button> -->
  112. <view @click='show2 = false' class="cancel">取消</view>
  113. <view @click='audit()' class="confirm">确定</view>
  114. </view>
  115. </view>
  116. <u-toast ref="uToast" />
  117. <view style='padding:10px;' class='flex bottom-btn'>
  118. <u-button v-if='isSHowBtn' @click='show1 = true' type="error" class="btn1" hover-class='none'>驳回</u-button>
  119. <u-button v-if='isSHowBtn' @click='show2 = true' type="success" class="btn2">通过</u-button>
  120. </view>
  121. </view>
  122. </template>
  123. <script>
  124. import helper from '@/common/helper.js';
  125. import {
  126. mapState
  127. } from 'vuex';
  128. export default {
  129. name: "task",
  130. data() {
  131. return {
  132. everyCheck: '',
  133. isSHowBtn: true,
  134. show: false,
  135. height: 200,
  136. autoHeight: true,
  137. border: false,
  138. show2: false,
  139. show1: false,
  140. rejectInfo: "",
  141. rejectInfo1: "",
  142. id: 0,
  143. list: {},
  144. pcUserInfo: uni.getStorageSync('pcUserInfo'),
  145. switchVal: false,
  146. contractNoList: []
  147. };
  148. },
  149. computed: {
  150. ...mapState(['hasLogin', 'userInfo'])
  151. },
  152. onBackPress(e) {
  153. if(this.everyCheck){
  154. uni.navigateTo({
  155. url: "/pages/task/my_task"
  156. })
  157. return true;
  158. }
  159. },
  160. onLoad(options) {
  161. this.everyCheck = uni.getStorageSync("everyTask")
  162. this.id = options.id
  163. this.isSHowBtn = options.isShowbtn
  164. },
  165. onShow() {
  166. var that = this
  167. this.$nextTick(function() {
  168. that.getData()
  169. })
  170. },
  171. methods: {
  172. close(){
  173. this.show1 = false
  174. this.show2 = false
  175. },
  176. getData() {
  177. var data = []
  178. this.$api.doRequest('get', '/purchasePrice/purchasePriceLook', {
  179. id: this.id
  180. }).then(res => {
  181. if (res.data.code == 200) {
  182. this.list = res.data.data
  183. }
  184. })
  185. },
  186. confirm(item) {
  187. this.list.contractNo = item[0].value
  188. },
  189. audit() {
  190. if (!this.rejectInfo1) {
  191. this.$api.msg('审核意见不能为空!')
  192. } else {
  193. var that = this
  194. that.show2 = false
  195. uni.showModal({
  196. content: "是否确定通过审核?",
  197. showCancel: true,
  198. confirmText: '确定',
  199. success: function(res) {
  200. if (res.confirm) {
  201. uni.showLoading({
  202. title: "审核中"
  203. })
  204. that.$api.doRequest('post', '/purchasePrice/purchasePriceEdit', that.list)
  205. .then(res => {
  206. if (res.data.code == 200) {
  207. that.$api.doRequest('post', '/workflow/api/handle', {
  208. approved: true,
  209. auditMind: that.rejectInfo1,
  210. needReapply: true,
  211. taskId: that.list.taskId,
  212. }).then(res1 => {
  213. if (res1.data.code == 200) {
  214. that.$api.msg('审核成功');
  215. setTimeout(function() {
  216. if (this.everyCheck) {
  217. helper.setAudit(that.list)
  218. } else {
  219. uni.navigateBack()
  220. }
  221. uni.hideLoading()
  222. }, 1000);
  223. } else {
  224. that.$api.msg(res1.data.message);
  225. }
  226. })
  227. } else {
  228. that.$api.msg('系统异常,请联系管理员');
  229. }
  230. })
  231. }
  232. }
  233. })
  234. }
  235. },
  236. reject() {
  237. if (!this.rejectInfo) {
  238. this.$api.msg('驳回原因不能为空!')
  239. } else {
  240. var that = this
  241. that.show1 = false
  242. uni.showModal({
  243. content: "是否确定驳回?",
  244. showCancel: true,
  245. confirmText: '确定',
  246. success: function(res) {
  247. if (res.confirm) {
  248. that.$api.doRequest('post', '/workflow/api/handle', {
  249. taskId: that.list.taskId,
  250. approved: false,
  251. auditMind: that.rejectInfo,
  252. needReapply: true,
  253. }).then(res1 => {
  254. if (res1.data.code == 200) {
  255. that.$api.msg('驳回成功');
  256. setTimeout(function() {
  257. if (that.everyCheck) {
  258. helper.setAudit(that.list)
  259. } else {
  260. uni.navigateBack()
  261. }
  262. uni.hideLoading()
  263. }, 1000);
  264. } else {
  265. that.$api.msg(res1.data.message);
  266. }
  267. })
  268. }
  269. }
  270. })
  271. }
  272. }
  273. }
  274. }
  275. </script>
  276. <style scoped lang="scss">
  277. .warp {
  278. margin: 10rpx;
  279. padding: 20rpx 20rpx 330rpx 20rpx;
  280. }
  281. .content1,
  282. .content2 {
  283. border-radius: 20rpx;
  284. background: white;
  285. padding: 20rpx;
  286. .title {
  287. font-size: 28rpx;
  288. font-weight: 600;
  289. color: #333333;
  290. text-align: left;
  291. }
  292. .row {
  293. display: flex;
  294. justify-content: space-between;
  295. border-bottom: 1px solid #EEEEEE;
  296. padding: 21rpx 0;
  297. .right,
  298. input {
  299. font-size: 28rpx;
  300. color: #333333;
  301. }
  302. }
  303. }
  304. .content2 {
  305. margin-top: 20rpx;
  306. }
  307. .bottom-btn {
  308. width: 100%;
  309. position: fixed;
  310. bottom: 0;
  311. display: flex;
  312. z-index: 2;
  313. left: 0;
  314. background-color: #f8f8f8;
  315. flex-direction: column;
  316. .btn1,
  317. .btn2 {
  318. width: 100%;
  319. margin-bottom: 26rpx;
  320. border-radius: 90rpx;
  321. }
  322. .btn1 {
  323. background: white;
  324. color: #00C265;
  325. }
  326. }
  327. .submit {
  328. width: 40%;
  329. background: #22C572;
  330. border-radius: 10rpx;
  331. }
  332. .boder {
  333. border: 0;
  334. border-bottom: 0 !important;
  335. }
  336. .topInfo {
  337. height: 210rpx;
  338. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  339. padding: 30rpx;
  340. .topInfo-item {
  341. height: 150rpx;
  342. background-color: #FFFFFF;
  343. border-radius: 20rpx;
  344. padding: 40rpx;
  345. .logo {
  346. width: 40rpx;
  347. height: 40rpx;
  348. margin-top: 8rpx;
  349. }
  350. .infoText {
  351. font-size: 36rpx;
  352. font-weight: 600;
  353. margin-left: 20rpx;
  354. }
  355. .infoData {
  356. color: #878C9C;
  357. font-size: 26rpx;
  358. margin-top: 10rpx;
  359. }
  360. }
  361. }
  362. .shade {
  363. position: fixed;
  364. top: 0;
  365. left: 0;
  366. height: 100%;
  367. width: 100%;
  368. background: rgba(0, 0, 0, 0.4);
  369. z-index: 3;
  370. .wrap {
  371. position: absolute;
  372. left: 0;
  373. top: 0;
  374. right: 0;
  375. bottom: 0;
  376. margin: auto;
  377. background: #fff;
  378. width: calc(100% - 198rpx);
  379. height: 700rpx;
  380. border-radius: 20rpx;
  381. .alert-top {
  382. padding: 33rpx;
  383. display: flex;
  384. justify-content: center;
  385. align-items: center;
  386. position: relative;
  387. }
  388. .title {
  389. font-size: 32rpx;
  390. font-weight: 600;
  391. color: #333333;
  392. }
  393. .close {
  394. position: absolute;
  395. right: 33rpx;
  396. }
  397. }
  398. }
  399. // .cancel,
  400. // .confirm {
  401. // position: absolute;
  402. // display: inline-block;
  403. // width: 50%;
  404. // text-align: center;
  405. // bottom: 0;
  406. // padding: 10px;
  407. // border-top: 1px solid #eee;
  408. // font-size: 34rpx;
  409. // }
  410. // .cancel {
  411. // left: 0;
  412. // border-right: 1px solid #eee;
  413. // color: #AFB3BF;
  414. // }
  415. // .confirm {
  416. // right: 0;
  417. // color: #22C572;
  418. // }
  419. .u-textarea-style {
  420. margin: 20rpx;
  421. background: #F9F9FA;
  422. border-radius: 10px;
  423. border: 1px solid #EEEEEE;
  424. padding: 10rpx 20rpx;
  425. position: relative;
  426. .right-bottom {
  427. position: absolute;
  428. right: 20rpx;
  429. bottom: 20rpx;
  430. color: #AFB3BF;
  431. }
  432. }
  433. /deep/.u-input__textarea {
  434. height: 300rpx !important;
  435. }
  436. .cancel,
  437. .confirm {
  438. position: absolute;
  439. display: inline-block;
  440. width: 50%;
  441. text-align: center;
  442. bottom: 0;
  443. padding: 10px;
  444. border-top: 1px solid #eee;
  445. font-size: 34rpx;
  446. }
  447. .cancel {
  448. left: 0;
  449. border-right: 1px solid #eee;
  450. color: #AFB3BF;
  451. }
  452. .confirm {
  453. right: 0;
  454. color: #22C572;
  455. }
  456. </style>