warehouse_approval.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="warp">
  3. <view class='content1'>
  4. <view class="title">基本信息</view>
  5. <view class='row'>
  6. <view class="left">仓库</view>
  7. <view class="right">{{list.warehouseName}}</view>
  8. </view>
  9. <view class='row'>
  10. <view class="left">货名</view>
  11. <view class="right">{{list.goodsName}}</view>
  12. </view>
  13. <view class='row'>
  14. <view class="left">基准水分(%)</view>
  15. <view class="right">{{list.waterBase}}</view>
  16. </view>
  17. <view class='row'>
  18. <view class="left">干粮水分(%)</view>
  19. <view class="right">{{list.waterMin}}</view>
  20. </view>
  21. <view class='row'>
  22. <view class="left">水分上限(%)</view>
  23. <view class="right">{{list.waterMax}}</view>
  24. </view>
  25. <view class='row'>
  26. <view class="left">扣重比</view>
  27. <view class="right">{{list.deductWeight}}</view>
  28. </view>
  29. <view class='row'>
  30. <view class="left">干粮收购价格(元/公斤)</view>
  31. <view class="right">{{list.dryGrainPrice}}</view>
  32. </view>
  33. <view class='row'>
  34. <view class="left">销售上限</view>
  35. <view class="right">{{list.saleLimit}}</view>
  36. </view>
  37. </view>
  38. <view class="content2">
  39. <view class="title">粮价设置</view>
  40. <view v-for="(item,index) in list.details" :key="index">
  41. <view class="row">
  42. <view class="left">等级</view>
  43. <view class="right">{{item.level}}</view>
  44. </view>
  45. <view class="row">
  46. <view class="left">基准单价(元/公斤)</view>
  47. <view class="right">{{item.basePrice}}</view>
  48. </view>
  49. <view class="row" v-for="(item1,index1) in item.modelList" :key="index1">
  50. <view class="left">{{item1.startWater}}-{{item1.endWater}}降幅(元/0.1%)</view>
  51. <view class="right">{{item1.price}}</view>
  52. </view>
  53. </view>
  54. </view>
  55. <u-toast ref="uToast" />
  56. <view style='padding:10px;' class='flex'>
  57. <u-button @click='reject' type="error">驳回</u-button>
  58. <u-button @click='audit' type="success">通过</u-button>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import {
  64. mapState
  65. } from 'vuex';
  66. export default {
  67. name: "task",
  68. data() {
  69. return {
  70. show: false,
  71. id: 0,
  72. list: {},
  73. form: {
  74. name: '',
  75. intro: '',
  76. sex: ''
  77. },
  78. radio: '',
  79. pcUserInfo: uni.getStorageSync('pcUserInfo'),
  80. switchVal: false,
  81. contractNoList: []
  82. };
  83. },
  84. computed: {
  85. ...mapState(['hasLogin', 'userInfo'])
  86. },
  87. onLoad(options) {
  88. this.id = options.id
  89. },
  90. onShow() {
  91. var that = this
  92. this.$nextTick(function() {
  93. that.getData()
  94. })
  95. },
  96. methods: {
  97. getData() {
  98. var data = []
  99. this.$api.doRequest('get', '/purchasePrice/purchasePriceLook', {
  100. id: this.id
  101. }).then(res => {
  102. if (res.data.code == 200) {
  103. this.list = res.data.data
  104. }
  105. })
  106. },
  107. confirm(item) {
  108. this.list.contractNo = item[0].value
  109. },
  110. audit() {
  111. var that = this
  112. uni.showModal({
  113. content: "是否确定通过审核?",
  114. showCancel: true,
  115. confirmText: '确定',
  116. success: function(res) {
  117. if (res.confirm) {
  118. that.$api.doRequest('post', '/purchasePrice/purchasePriceEdit', {
  119. taskId: that.list.taskId,
  120. approved: true,
  121. auditMind: '34',
  122. needReapply: true,
  123. }).then(res1 => {
  124. if (res1.data.code == 200) {
  125. that.$api.msg('审核成功');
  126. that.$nextTick(function() {
  127. uni.navigateBack()
  128. })
  129. } else {
  130. that.$api.msg('系统异常,请联系管理员');
  131. }
  132. })
  133. }
  134. }
  135. })
  136. },
  137. reject() {
  138. var that = this
  139. uni.showModal({
  140. content: "是否确定驳回?",
  141. showCancel: true,
  142. confirmText: '确定',
  143. success: function(res) {
  144. if (res.confirm) {
  145. that.$api.doRequest('post', '/workflow/api/handle', {
  146. taskId: that.list.taskId,
  147. approved: false,
  148. auditMind: '已驳回',
  149. needReapply: true,
  150. }).then(res1 => {
  151. if (res1.data.code == 200) {
  152. that.$api.msg('驳回成功');
  153. // that.$nextTick(function() {
  154. // uni.navigateBack()
  155. // })
  156. this.setTimeout(function() {
  157. uni.navigateBack()
  158. }, 1000);
  159. } else {
  160. that.$api.msg(res1.data.message);
  161. }
  162. }).catch()
  163. }
  164. }
  165. })
  166. }
  167. }
  168. }
  169. </script>
  170. <style scoped lang="scss">
  171. .warp {
  172. margin: 10rpx;
  173. padding: 20rpx 20rpx 140rpx 20rpx;
  174. }
  175. .content1,
  176. .content2 {
  177. border-radius: 20rpx;
  178. background: white;
  179. padding: 20rpx;
  180. .title {
  181. font-size: 28rpx;
  182. font-weight: 600;
  183. color: #333333;
  184. text-align: center;
  185. }
  186. .row {
  187. display: flex;
  188. justify-content: space-between;
  189. border-bottom: 1px solid #EEEEEE;
  190. padding: 21rpx 0;
  191. .right,
  192. input {
  193. font-size: 28rpx;
  194. color: #333333;
  195. }
  196. }
  197. }
  198. .content2 {
  199. margin-top: 20rpx;
  200. }
  201. .bottom-btn {
  202. width: 92%;
  203. position: fixed;
  204. bottom: 40rpx;
  205. display: flex;
  206. z-index: 2;
  207. }
  208. .submit {
  209. width: 40%;
  210. background: #22C572;
  211. border-radius: 10rpx;
  212. }
  213. </style>