warehouse_approval.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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" :class="index1==item.modelList.length-1?'boder':''">
  66. <view v-if="list.paramType == '2'" class="left">{{item1.startWater}}-{{item1.endWater}}降幅(元/0.1%)</view>
  67. <view v-else class="left">{{item1.startWater}}-{{item1.endWater}}扣重比</view>
  68. <view class="right">{{item1.price}}</view>
  69. </view>
  70. </view>
  71. </view>
  72. <u-toast ref="uToast" />
  73. <view style='padding:10px;' class='flex bottom-btn'>
  74. <u-button @click='reject' type="error" class="btn1" hover-class='none'>驳回</u-button>
  75. <u-button @click='audit' type="success" class="btn2">通过</u-button>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. import {
  81. mapState
  82. } from 'vuex';
  83. export default {
  84. name: "task",
  85. data() {
  86. return {
  87. show: false,
  88. id: 0,
  89. list: {},
  90. form: {
  91. name: '',
  92. intro: '',
  93. sex: ''
  94. },
  95. radio: '',
  96. pcUserInfo: uni.getStorageSync('pcUserInfo'),
  97. switchVal: false,
  98. contractNoList: []
  99. };
  100. },
  101. computed: {
  102. ...mapState(['hasLogin', 'userInfo'])
  103. },
  104. onLoad(options) {
  105. this.id = options.id
  106. },
  107. onShow() {
  108. var that = this
  109. this.$nextTick(function() {
  110. that.getData()
  111. })
  112. },
  113. methods: {
  114. getData() {
  115. var data = []
  116. this.$api.doRequest('get', '/purchasePrice/purchasePriceLook', {
  117. id: this.id
  118. }).then(res => {
  119. if (res.data.code == 200) {
  120. this.list = res.data.data
  121. }
  122. })
  123. },
  124. confirm(item) {
  125. this.list.contractNo = item[0].value
  126. },
  127. audit() {
  128. var that = this
  129. uni.showModal({
  130. content: "是否确定通过审核?",
  131. showCancel: true,
  132. confirmText: '确定',
  133. success: function(res) {
  134. if (res.confirm) {
  135. that.$api.doRequest('post', '/purchasePrice/purchasePriceEdit',that.list ).then(res => {
  136. if (res.data.code == 200) {
  137. that.$api.doRequest('post', '/workflow/api/handle', {
  138. approved: true,
  139. auditMind: "",
  140. needReapply: true,
  141. taskId: that.list.taskId,
  142. }).then(res1 => {
  143. if (res1.data.code == 200) {
  144. that.$api.msg('审核成功');
  145. that.setTimeout(function() {
  146. uni.navigateBack()
  147. }, 1000);
  148. } else {
  149. that.$api.msg(res1.data.message);
  150. }
  151. })
  152. } else {
  153. that.$api.msg('系统异常,请联系管理员');
  154. }
  155. })
  156. }
  157. }
  158. })
  159. },
  160. reject() {
  161. var that = this
  162. uni.showModal({
  163. content: "是否确定驳回?",
  164. showCancel: true,
  165. confirmText: '确定',
  166. success: function(res) {
  167. if (res.confirm) {
  168. that.$api.doRequest('post', '/workflow/api/handle', {
  169. taskId: that.list.taskId,
  170. approved: false,
  171. auditMind: '已驳回',
  172. needReapply: true,
  173. }).then(res1 => {
  174. if (res1.data.code == 200) {
  175. that.$api.msg('驳回成功');
  176. // that.$nextTick(function() {
  177. // uni.navigateBack()
  178. // })
  179. this.setTimeout(function() {
  180. uni.navigateBack()
  181. }, 1000);
  182. } else {
  183. that.$api.msg(res1.data.message);
  184. }
  185. })
  186. }
  187. }
  188. })
  189. }
  190. }
  191. }
  192. </script>
  193. <style scoped lang="scss">
  194. .warp {
  195. margin: 10rpx;
  196. padding: 20rpx 20rpx 330rpx 20rpx;
  197. }
  198. .content1,
  199. .content2 {
  200. border-radius: 20rpx;
  201. background: white;
  202. padding: 20rpx;
  203. .title {
  204. font-size: 28rpx;
  205. font-weight: 600;
  206. color: #333333;
  207. text-align: left;
  208. }
  209. .row {
  210. display: flex;
  211. justify-content: space-between;
  212. border-bottom: 1px solid #EEEEEE;
  213. padding: 21rpx 0;
  214. .right,
  215. input {
  216. font-size: 28rpx;
  217. color: #333333;
  218. }
  219. }
  220. }
  221. .content2 {
  222. margin-top: 20rpx;
  223. }
  224. .bottom-btn {
  225. width: 100%;
  226. position: fixed;
  227. bottom:0;
  228. display: flex;
  229. z-index: 2;
  230. left: 0;
  231. background-color: #f8f8f8;
  232. flex-direction: column;
  233. .btn1,.btn2{
  234. width: 100%;
  235. margin-bottom: 26rpx;
  236. border-radius: 90rpx;
  237. }
  238. .btn1{
  239. background: white;
  240. color: #00C265;
  241. }
  242. }
  243. .submit {
  244. width: 40%;
  245. background: #22C572;
  246. border-radius: 10rpx;
  247. }
  248. .boder{
  249. border:0;
  250. border-bottom: 0!important;
  251. }
  252. .topInfo {
  253. height: 210rpx;
  254. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  255. padding: 30rpx;
  256. .topInfo-item {
  257. height: 150rpx;
  258. background-color: #FFFFFF;
  259. border-radius: 20rpx;
  260. padding: 40rpx;
  261. .logo {
  262. width: 40rpx;
  263. height: 40rpx;
  264. margin-top: 8rpx;
  265. }
  266. .infoText {
  267. font-size: 36rpx;
  268. font-weight: 600;
  269. margin-left: 20rpx;
  270. }
  271. .infoData {
  272. color: #878C9C;
  273. font-size: 26rpx;
  274. margin-top: 10rpx;
  275. }
  276. }
  277. }
  278. </style>