warehouse_approval.vue 9.1 KB

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