warehouse_approval.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  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-popup v-model="show1" mode="center">
  73. <view style="width: 300px;padding: 30rpx 10rpx;border-radius: 20rpx;">
  74. <view class="rejectText">审核意见(驳回)</view>
  75. <u-input v-model="rejectInfo" type="textarea" :border="border" class="rejectInfoCss"
  76. placeholder="请输入审核意见" />
  77. <view class="flex">
  78. <u-button @click="show1 = false" type="error" hover-class='none'>取消</u-button>
  79. <u-button @click="reject()" type="success">确定</u-button>
  80. </view>
  81. </view>
  82. </u-popup>
  83. <u-popup v-model="show2" mode="center">
  84. <view style="width: 300px;padding: 30rpx 10rpx;border-radius: 20rpx;">
  85. <view class="rejectText">审核意见(通过)</view>
  86. <u-input v-model="rejectInfo1" type="textarea" :border="border" :height="height" :auto-height="autoHeight" class="rejectInfoCss"
  87. placeholder="请输入审核意见" />
  88. <view class="flex">
  89. <u-button @click="show2 = false" type="error" hover-class='none'>取消</u-button>
  90. <u-button @click="audit()" type="success">确定</u-button>
  91. </view>
  92. </view>
  93. </u-popup>
  94. <u-toast ref="uToast" />
  95. <view style='padding:10px;' class='flex bottom-btn'>
  96. <u-button @click='show1 = true' type="error" class="btn1" hover-class='none'>驳回</u-button>
  97. <u-button @click='show2 = true' type="success" class="btn2">通过</u-button>
  98. </view>
  99. </view>
  100. </template>
  101. <script>
  102. import {
  103. mapState
  104. } from 'vuex';
  105. export default {
  106. name: "task",
  107. data() {
  108. return {
  109. show: false,
  110. height: 200,
  111. autoHeight: true,
  112. border: false,
  113. show2:false,
  114. show1:false,
  115. rejectInfo:"",
  116. rejectInfo1:"",
  117. id: 0,
  118. list: {},
  119. pcUserInfo: uni.getStorageSync('pcUserInfo'),
  120. switchVal: false,
  121. contractNoList: []
  122. };
  123. },
  124. computed: {
  125. ...mapState(['hasLogin', 'userInfo'])
  126. },
  127. onLoad(options) {
  128. this.id = options.id
  129. },
  130. onShow() {
  131. var that = this
  132. this.$nextTick(function() {
  133. that.getData()
  134. })
  135. },
  136. methods: {
  137. getData() {
  138. var data = []
  139. this.$api.doRequest('get', '/purchasePrice/purchasePriceLook', {
  140. id: this.id
  141. }).then(res => {
  142. if (res.data.code == 200) {
  143. this.list = res.data.data
  144. }
  145. })
  146. },
  147. confirm(item) {
  148. this.list.contractNo = item[0].value
  149. },
  150. audit() {
  151. if (!this.rejectInfo1) {
  152. this.$api.msg('审核意见不能为空!')
  153. }else{
  154. var that = this
  155. that.show2 = false
  156. uni.showModal({
  157. content: "是否确定通过审核?",
  158. showCancel: true,
  159. confirmText: '确定',
  160. success: function(res) {
  161. if (res.confirm) {
  162. that.$api.doRequest('post', '/purchasePrice/purchasePriceEdit',that.list ).then(res => {
  163. if (res.data.code == 200) {
  164. that.$api.doRequest('post', '/workflow/api/handle', {
  165. approved: true,
  166. auditMind: that.rejectInfo1,
  167. needReapply: true,
  168. taskId: that.list.taskId,
  169. }).then(res1 => {
  170. if (res1.data.code == 200) {
  171. that.$api.msg('审核成功');
  172. setTimeout(function() {
  173. uni.navigateBack()
  174. }, 1000);
  175. } else {
  176. that.$api.msg(res1.data.message);
  177. }
  178. })
  179. } else {
  180. that.$api.msg('系统异常,请联系管理员');
  181. }
  182. })
  183. }
  184. }
  185. })
  186. }
  187. },
  188. reject() {
  189. if (!this.rejectInfo) {
  190. this.$api.msg('驳回原因不能为空!')
  191. }else{
  192. var that = this
  193. that.show1 = false
  194. uni.showModal({
  195. content: "是否确定驳回?",
  196. showCancel: true,
  197. confirmText: '确定',
  198. success: function(res) {
  199. if (res.confirm) {
  200. that.$api.doRequest('post', '/workflow/api/handle', {
  201. taskId: that.list.taskId,
  202. approved: false,
  203. auditMind: that.rejectInfo,
  204. needReapply: true,
  205. }).then(res1 => {
  206. if (res1.data.code == 200) {
  207. that.$api.msg('驳回成功');
  208. setTimeout(function() {
  209. uni.navigateBack()
  210. }, 1000);
  211. } else {
  212. that.$api.msg(res1.data.message);
  213. }
  214. })
  215. }
  216. }
  217. })
  218. }
  219. }
  220. }
  221. }
  222. </script>
  223. <style scoped lang="scss">
  224. .warp {
  225. margin: 10rpx;
  226. padding: 20rpx 20rpx 330rpx 20rpx;
  227. }
  228. .content1,
  229. .content2 {
  230. border-radius: 20rpx;
  231. background: white;
  232. padding: 20rpx;
  233. .title {
  234. font-size: 28rpx;
  235. font-weight: 600;
  236. color: #333333;
  237. text-align: left;
  238. }
  239. .row {
  240. display: flex;
  241. justify-content: space-between;
  242. border-bottom: 1px solid #EEEEEE;
  243. padding: 21rpx 0;
  244. .right,
  245. input {
  246. font-size: 28rpx;
  247. color: #333333;
  248. }
  249. }
  250. }
  251. .content2 {
  252. margin-top: 20rpx;
  253. }
  254. .bottom-btn {
  255. width: 100%;
  256. position: fixed;
  257. bottom:0;
  258. display: flex;
  259. z-index: 2;
  260. left: 0;
  261. background-color: #f8f8f8;
  262. flex-direction: column;
  263. .btn1,.btn2{
  264. width: 100%;
  265. margin-bottom: 26rpx;
  266. border-radius: 90rpx;
  267. }
  268. .btn1{
  269. background: white;
  270. color: #00C265;
  271. }
  272. }
  273. .submit {
  274. width: 40%;
  275. background: #22C572;
  276. border-radius: 10rpx;
  277. }
  278. .boder{
  279. border:0;
  280. border-bottom: 0!important;
  281. }
  282. .topInfo {
  283. height: 210rpx;
  284. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  285. padding: 30rpx;
  286. .topInfo-item {
  287. height: 150rpx;
  288. background-color: #FFFFFF;
  289. border-radius: 20rpx;
  290. padding: 40rpx;
  291. .logo {
  292. width: 40rpx;
  293. height: 40rpx;
  294. margin-top: 8rpx;
  295. }
  296. .infoText {
  297. font-size: 36rpx;
  298. font-weight: 600;
  299. margin-left: 20rpx;
  300. }
  301. .infoData {
  302. color: #878C9C;
  303. font-size: 26rpx;
  304. margin-top: 10rpx;
  305. }
  306. }
  307. }
  308. .rejectInfoCss {
  309. border: 1px solid #ccc;
  310. border-radius: 10rpx;
  311. background-color: #F9F9FA;
  312. // height: 100px;
  313. overflow-y: auto;
  314. margin: 30rpx;
  315. }
  316. .rejectText {
  317. text-align: center;
  318. }
  319. /deep/.u-input__textarea{
  320. height: 300rpx!important;
  321. }
  322. </style>