warehouse_approval.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  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. var that = this
  191. that.show2 = false
  192. uni.showModal({
  193. content: "是否确定通过审核?",
  194. showCancel: true,
  195. confirmText: '确定',
  196. success: function(res) {
  197. if (res.confirm) {
  198. uni.showLoading({
  199. title: "审核中"
  200. })
  201. that.$api.doRequest('post', '/purchasePrice/purchasePriceEdit', that.list)
  202. .then(res => {
  203. if (res.data.code == 200) {
  204. that.$api.doRequest('post', '/workflow/api/handle', {
  205. approved: true,
  206. auditMind: that.rejectInfo1,
  207. needReapply: true,
  208. taskId: that.list.taskId,
  209. }).then(res1 => {
  210. if (res1.data.code == 200) {
  211. that.$api.msg('审核成功');
  212. setTimeout(function() {
  213. if (this.everyCheck) {
  214. helper.setAudit(that.list)
  215. } else {
  216. uni.navigateBack()
  217. }
  218. uni.hideLoading()
  219. }, 1000);
  220. } else {
  221. that.$api.msg(res1.data.message);
  222. }
  223. })
  224. } else {
  225. that.$api.msg('系统异常,请联系管理员');
  226. }
  227. })
  228. }
  229. }
  230. })
  231. },
  232. reject() {
  233. if (!this.rejectInfo) {
  234. this.$api.msg('驳回原因不能为空!')
  235. } else {
  236. var that = this
  237. that.show1 = false
  238. uni.showModal({
  239. content: "是否确定驳回?",
  240. showCancel: true,
  241. confirmText: '确定',
  242. success: function(res) {
  243. if (res.confirm) {
  244. that.$api.doRequest('post', '/workflow/api/handle', {
  245. taskId: that.list.taskId,
  246. approved: false,
  247. auditMind: that.rejectInfo,
  248. needReapply: true,
  249. }).then(res1 => {
  250. if (res1.data.code == 200) {
  251. that.$api.msg('驳回成功');
  252. setTimeout(function() {
  253. if (that.everyCheck) {
  254. helper.setAudit(that.list)
  255. } else {
  256. uni.navigateBack()
  257. }
  258. uni.hideLoading()
  259. }, 1000);
  260. } else {
  261. that.$api.msg(res1.data.message);
  262. }
  263. })
  264. }
  265. }
  266. })
  267. }
  268. }
  269. }
  270. }
  271. </script>
  272. <style scoped lang="scss">
  273. .warp {
  274. margin: 10rpx;
  275. padding: 20rpx 20rpx 330rpx 20rpx;
  276. }
  277. .content1,
  278. .content2 {
  279. border-radius: 20rpx;
  280. background: white;
  281. padding: 20rpx;
  282. .title {
  283. font-size: 28rpx;
  284. font-weight: 600;
  285. color: #333333;
  286. text-align: left;
  287. }
  288. .row {
  289. display: flex;
  290. justify-content: space-between;
  291. border-bottom: 1px solid #EEEEEE;
  292. padding: 21rpx 0;
  293. .right,
  294. input {
  295. font-size: 28rpx;
  296. color: #333333;
  297. }
  298. }
  299. }
  300. .content2 {
  301. margin-top: 20rpx;
  302. }
  303. .bottom-btn {
  304. width: 100%;
  305. position: fixed;
  306. bottom: 0;
  307. display: flex;
  308. z-index: 2;
  309. left: 0;
  310. background-color: #f8f8f8;
  311. flex-direction: column;
  312. .btn1,
  313. .btn2 {
  314. width: 100%;
  315. margin-bottom: 26rpx;
  316. border-radius: 90rpx;
  317. }
  318. .btn1 {
  319. background: white;
  320. color: #00C265;
  321. }
  322. }
  323. .submit {
  324. width: 40%;
  325. background: #22C572;
  326. border-radius: 10rpx;
  327. }
  328. .boder {
  329. border: 0;
  330. border-bottom: 0 !important;
  331. }
  332. .topInfo {
  333. height: 210rpx;
  334. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  335. padding: 30rpx;
  336. .topInfo-item {
  337. height: 150rpx;
  338. background-color: #FFFFFF;
  339. border-radius: 20rpx;
  340. padding: 40rpx;
  341. .logo {
  342. width: 40rpx;
  343. height: 40rpx;
  344. margin-top: 8rpx;
  345. }
  346. .infoText {
  347. font-size: 36rpx;
  348. font-weight: 600;
  349. margin-left: 20rpx;
  350. }
  351. .infoData {
  352. color: #878C9C;
  353. font-size: 26rpx;
  354. margin-top: 10rpx;
  355. }
  356. }
  357. }
  358. .shade {
  359. position: fixed;
  360. top: 0;
  361. left: 0;
  362. height: 100%;
  363. width: 100%;
  364. background: rgba(0, 0, 0, 0.4);
  365. z-index: 3;
  366. .wrap {
  367. position: absolute;
  368. left: 0;
  369. top: 0;
  370. right: 0;
  371. bottom: 0;
  372. margin: auto;
  373. background: #fff;
  374. width: calc(100% - 198rpx);
  375. height: 700rpx;
  376. border-radius: 20rpx;
  377. .alert-top {
  378. padding: 33rpx;
  379. display: flex;
  380. justify-content: center;
  381. align-items: center;
  382. position: relative;
  383. }
  384. .title {
  385. font-size: 32rpx;
  386. font-weight: 600;
  387. color: #333333;
  388. }
  389. .close {
  390. position: absolute;
  391. right: 33rpx;
  392. }
  393. }
  394. }
  395. // .cancel,
  396. // .confirm {
  397. // position: absolute;
  398. // display: inline-block;
  399. // width: 50%;
  400. // text-align: center;
  401. // bottom: 0;
  402. // padding: 10px;
  403. // border-top: 1px solid #eee;
  404. // font-size: 34rpx;
  405. // }
  406. // .cancel {
  407. // left: 0;
  408. // border-right: 1px solid #eee;
  409. // color: #AFB3BF;
  410. // }
  411. // .confirm {
  412. // right: 0;
  413. // color: #22C572;
  414. // }
  415. .u-textarea-style {
  416. margin: 20rpx;
  417. background: #F9F9FA;
  418. border-radius: 10px;
  419. border: 1px solid #EEEEEE;
  420. padding: 10rpx 20rpx;
  421. position: relative;
  422. .right-bottom {
  423. position: absolute;
  424. right: 20rpx;
  425. bottom: 20rpx;
  426. color: #AFB3BF;
  427. }
  428. }
  429. /deep/.u-input__textarea {
  430. height: 300rpx !important;
  431. }
  432. .cancel,
  433. .confirm {
  434. position: absolute;
  435. display: inline-block;
  436. width: 50%;
  437. text-align: center;
  438. bottom: 0;
  439. padding: 10px;
  440. border-top: 1px solid #eee;
  441. font-size: 34rpx;
  442. }
  443. .cancel {
  444. left: 0;
  445. border-right: 1px solid #eee;
  446. color: #AFB3BF;
  447. }
  448. .confirm {
  449. right: 0;
  450. color: #22C572;
  451. }
  452. </style>