warehouse_approval.vue 5.7 KB

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