warehouse_approval.vue 10 KB

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