warehouse_approval.vue 11 KB

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