warehouse_approval.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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.warehouseName}}</view>
  28. </view>
  29. <view class='row'>
  30. <view class="left">干粮收购价格(元/公斤)</view>
  31. <view class="right">{{list.warehouseName}}</view>
  32. </view>
  33. <view class='row'>
  34. <view class="left">销售上限</view>
  35. <view class="right">{{list.warehouseName}}</view>
  36. </view>
  37. </view>
  38. <view class="content2">
  39. <view class="title">粮价设置</view>
  40. <view v-for="(item,index) in 4" :key="index">
  41. <view class="row">
  42. <view class="left">等级</view>
  43. <view class="right">一等、二等</view>
  44. </view>
  45. <view class="row">
  46. <view class="left">基准单价(元/公斤)</view>
  47. <view class="right">2.2</view>
  48. </view>
  49. <view class="row" v-for="(item1,index1) in 10" :key="index1">
  50. <view class="left">15-23降幅(元/0.1%)</view>
  51. <view class="right">0.001</view>
  52. </view>
  53. </view>
  54. </view>
  55. <u-toast ref="uToast" />
  56. <view style='padding:10px;' class='flex'>
  57. <u-button v-if='list.status=="未审核"' @click='reject' type="error">驳回</u-button>
  58. <u-button v-if='list.status=="未审核"' @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. console.log(options)
  89. this.id = options.id
  90. },
  91. onShow() {
  92. var that = this
  93. this.$nextTick(function() {
  94. that.getData()
  95. })
  96. // this.userInfo = uni.getStorageSync("userInfo")
  97. },
  98. methods: {
  99. getData() {
  100. var data = []
  101. this.$api.doRequest('get', '/purchasePrice/purchasePriceLook', {
  102. id: this.id
  103. }).then(res => {
  104. if (res.data.code == 200) {
  105. this.list = res.data.data
  106. console.log(this.list)
  107. }
  108. })
  109. },
  110. confirm(item) {
  111. this.list.contractNo = item[0].value
  112. },
  113. audit() {
  114. var that = this
  115. uni.showModal({
  116. content: "是否确定通过审核?",
  117. showCancel: true,
  118. confirmText: '提交',
  119. success: function(res) {
  120. if (res.confirm) {
  121. that.$api.doRequest('post', '/workflow/api/handle', {
  122. taskId: that.list.taskId,
  123. approved: true,
  124. auditMind: '34',
  125. needReapply: false,
  126. }).then(res1 => {
  127. if (res1.data.code == 200) {
  128. that.$api.msg('审核成功');
  129. that.$nextTick(function() {
  130. uni.navigateBack()
  131. })
  132. } else {
  133. that.$api.msg('系统异常,请联系管理员');
  134. }
  135. })
  136. }
  137. }
  138. })
  139. },
  140. reject() {
  141. var that = this
  142. uni.showModal({
  143. content: "是否确定驳回?",
  144. showCancel: true,
  145. confirmText: '提交',
  146. success: function(res) {
  147. if (res.confirm) {
  148. that.$api.doRequest('post', '/workflow/api/handle', {
  149. taskId: that.list.taskId,
  150. approved: false,
  151. auditMind: '已驳回',
  152. needReapply: true,
  153. }).then(res1 => {
  154. if (res1.data.code == 200) {
  155. that.$api.msg('驳回成功');
  156. that.$nextTick(function() {
  157. uni.navigateBack()
  158. })
  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>