acquisition_settlement_approval.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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="status == '已驳回'"
  8. style="height: 40rpx;"></image><!-- 驳回 -->
  9. <image src="../../../static/img/tongguo.png" mode="" v-if="status == '已通过'"
  10. style="height: 40rpx;"></image><!-- 通过 -->
  11. <image src="../../../static/img/daishenhe.png" mode=""
  12. v-if="status == '审核中' || status == '待决策人审核'" style="height: 40rpx;"></image><!-- 待审核 -->
  13. </view>
  14. <view class="infoText">{{status}}</view>
  15. </view>
  16. <view class="infoData">{{updateDate}}</view>
  17. </view>
  18. </view>
  19. <view class='content1'>
  20. <view class='row content-item'>
  21. <view class="left" style="color: #878C9C ;">仓库</view>
  22. <view class="right">{{warehouseName}}</view>
  23. </view>
  24. <view class="content-item">
  25. <view v-for="(item,index) in List">
  26. <view class='row row1'>
  27. <view class="left title">{{item.paymentNo}}</view>
  28. <view class="right title">{{item.carNo}}</view>
  29. </view>
  30. <view class='row'>
  31. <view class="left goodsInfoCss">{{item.goodsName}}({{item.netWeight}}kg -
  32. ¥{{item.tidalGrainPrice}})</view>
  33. <view class="right priceCss">¥{{item.amountIngPayable}}</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <u-popup v-model="show1" mode="center">
  39. <view style="width: 300px;padding: 30rpx 10rpx;border-radius: 20rpx;">
  40. <view class="rejectText">审核意见(驳回)</view>
  41. <u-input v-model="rejectInfo" type="textarea" :border="border" class="rejectInfoCss"
  42. placeholder="请输入审核意见" />
  43. <view class="flex">
  44. <u-button @click="show1 = false" type="error" hover-class='none'>取消</u-button>
  45. <u-button @click="rejectSubmit()" type="success">确定</u-button>
  46. </view>
  47. </view>
  48. </u-popup>
  49. <u-popup v-model="show2" mode="center">
  50. <view style="width: 300px;padding: 30rpx 10rpx;border-radius: 20rpx;">
  51. <view class="rejectText">审核意见(通过)</view>
  52. <u-input v-model="rejectInfo1" type="textarea" :border="border" :height="height"
  53. :auto-height="autoHeight" class="rejectInfoCss" placeholder="请输入审核意见" />
  54. <view class="flex">
  55. <u-button @click="show2 = false" type="error" hover-class='none'>取消</u-button>
  56. <u-button @click="passSubmit()" type="success">确定</u-button>
  57. </view>
  58. </view>
  59. </u-popup>
  60. <u-toast ref="uToast" />
  61. <view style='padding:10px;' class='flex bottom-btn'>
  62. <!-- getRoles("acquisitionQuality.initial") -->
  63. <u-button v-if='isSHowBtn' @click='show1 = true' type="error" class="btn1" hover-class='none'>驳回</u-button>
  64. <u-button v-if='isSHowBtn' @click='show2 = true' type="success" class="btn2">通过</u-button>
  65. <!-- <u-button @click='rejectSubmit()' type="error" class="btn1" hover-class='none'>驳回</u-button>
  66. <u-button @click='passSubmit()' type="success" class="btn2">通过</u-button> -->
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import helper from '@/common/helper.js';
  72. import {
  73. mapState
  74. } from 'vuex';
  75. export default {
  76. data() {
  77. return {
  78. isSHowBtn: true,
  79. height: 200,
  80. autoHeight: true,
  81. border: false,
  82. show2: false,
  83. show1: false,
  84. id: "",
  85. currentPage: 1,
  86. pageSize: 100,
  87. rejectInfo: "", //审核驳回意见
  88. rejectInfo1: "", //审核通过意见
  89. List: [],
  90. status: "",
  91. updateDate: "",
  92. warehouseName: "",
  93. everyCheck: ''
  94. }
  95. },
  96. onBackPress(e) {
  97. uni.navigateTo({
  98. url: "/pages/task/my_task"
  99. })
  100. return true;
  101. },
  102. onLoad(options) {
  103. this.id = options.id
  104. this.everyCheck = uni.getStorageSync("everyTask")
  105. this.isSHowBtn = options.isShowbtn
  106. },
  107. onShow(options) {
  108. this.getList()
  109. },
  110. computed: {
  111. ...mapState(['hasLogin', 'userInfo']),
  112. },
  113. methods: {
  114. getList() {
  115. //查仓库名
  116. this.$api.doRequest('get', '/paymentManagement/getInfo', {
  117. id: this.id
  118. }).then(res => {
  119. if (res.data.code == 200) {
  120. this.status = res.data.data.approveStatus
  121. this.updateDate = res.data.data.updateDate
  122. this.warehouseName = res.data.data.warehouseName
  123. this.$api.doRequest('get', '/paymentManagement/selectPaymentManagement', {
  124. currentPage: this.currentPage,
  125. pageSize: this.pageSize,
  126. warehouseName: res.data.data.warehouseName,
  127. managementType: 1
  128. }).then(res1 => {
  129. if (res1.data.code == 200) {
  130. this.List = res1.data.data.records
  131. }
  132. })
  133. }
  134. })
  135. },
  136. //驳回
  137. rejectSubmit() {
  138. if (!this.rejectInfo) {
  139. this.$api.msg('驳回原因不能为空!')
  140. } else {
  141. var that = this
  142. that.show1 = false
  143. if (this.List.length > 0) {
  144. uni.showModal({
  145. content: "确定驳回付款申请?",
  146. showCancel: true,
  147. confirmText: '确定',
  148. success: function(res) {
  149. if (res.confirm) {
  150. that.audit(that.List[0], 0, false, '', '')
  151. }
  152. }
  153. })
  154. }
  155. }
  156. },
  157. //通過
  158. passSubmit() {
  159. if (!this.rejectInfo1) {
  160. this.$api.msg('审核意见不能为空!')
  161. } else {
  162. var that = this
  163. this.show2 = false
  164. uni.showModal({
  165. content: "确定通过付款申请?",
  166. showCancel: true,
  167. confirmText: '确定',
  168. success: function(res) {
  169. if (res.confirm) {
  170. that.audit(that.List[0], 0, true)
  171. }
  172. }
  173. })
  174. }
  175. },
  176. audit(item, index, status, status2, reason) {
  177. uni.showLoading({
  178. title: "审核中"
  179. })
  180. if (this.List.length > 0) {
  181. if (status == true && item.status == "已驳回") {
  182. this.$api.doRequest('get', '/paymentManagement/api/openAuditFlow', {
  183. compId: "2710b21efc1e4393930c5dc800010dc4",
  184. id: item.id
  185. }).then(res => {
  186. if (res.data.code == 200) {
  187. this.audit(this.List[index + 1], index + 1, status, status2, reason)
  188. }
  189. })
  190. } else {
  191. this.$api.doRequest('post', '/workflow/api/handle', {
  192. taskId: item.taskId,
  193. approved: status,
  194. auditMind: reason ? this.rejectInfo : this.rejectInfo1,
  195. needReapply: status2 ? true : false
  196. }).then(res => {
  197. if (res.data.code == 200) {
  198. this.audit(this.List[index + 1], index + 1, status, status2, reason)
  199. }
  200. })
  201. }
  202. } else {
  203. if (status == true) {
  204. this.$api.msg('通过成功')
  205. } else if (status == false) {
  206. this.$api.msg('驳回成功')
  207. }
  208. let that = this
  209. setTimeout(function() {
  210. if (that.everyCheck) {
  211. helper.setAudit(that.list)
  212. } else {
  213. uni.navigateBack()
  214. }
  215. uni.hideLoading()
  216. }, 1000);
  217. }
  218. },
  219. }
  220. }
  221. </script>
  222. <style scoped lang="scss">
  223. .warp {
  224. margin: 10rpx;
  225. padding: 20rpx 20rpx 240rpx 20rpx;
  226. }
  227. .content1 {
  228. margin-top: 30rpx;
  229. .content-item {
  230. border-radius: 20rpx;
  231. background: white;
  232. padding: 40rpx 20rpx;
  233. margin-bottom: 30rpx;
  234. }
  235. .title {
  236. font-size: 32rpx;
  237. font-weight: 600;
  238. color: #333333;
  239. margin: 30rpx 0;
  240. }
  241. .goodsInfoCss {
  242. font-size: 28rpx;
  243. font-weight: 600;
  244. color: #878C9C;
  245. margin: 26rpx 10rpx;
  246. }
  247. .priceCss {
  248. font-size: 40rpx;
  249. margin: 26rpx 10rpx;
  250. color: #22C572;
  251. font-weight: 600;
  252. }
  253. .row {
  254. display: flex;
  255. justify-content: space-between;
  256. border-bottom: 1px solid #EEEEEE;
  257. .right,
  258. input {
  259. font-size: 28rpx;
  260. // color: #333333;
  261. }
  262. }
  263. }
  264. .bottom-btn {
  265. width: 100%;
  266. position: fixed;
  267. bottom: 0;
  268. display: flex;
  269. z-index: 2;
  270. left: 0;
  271. background-color: #f8f8f8;
  272. flex-direction: column;
  273. .btn1,
  274. .btn2 {
  275. width: 100%;
  276. margin-bottom: 26rpx;
  277. border-radius: 90rpx;
  278. }
  279. .btn1 {
  280. background: white;
  281. color: #00C265;
  282. }
  283. }
  284. .row1 {
  285. border-bottom: 0 !important;
  286. }
  287. .topInfo {
  288. height: 210rpx;
  289. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  290. padding: 30rpx;
  291. .topInfo-item {
  292. height: 150rpx;
  293. background-color: #FFFFFF;
  294. border-radius: 20rpx;
  295. padding: 40rpx;
  296. .logo {
  297. width: 40rpx;
  298. height: 40rpx;
  299. margin-top: 8rpx;
  300. }
  301. .infoText {
  302. font-size: 36rpx;
  303. font-weight: 600;
  304. margin-left: 20rpx;
  305. }
  306. .infoData {
  307. color: #878C9C;
  308. font-size: 26rpx;
  309. margin-top: 10rpx;
  310. }
  311. }
  312. }
  313. .rejectInfoCss {
  314. border: 1px solid #ccc;
  315. border-radius: 10rpx;
  316. background-color: #F9F9FA;
  317. // height: 100px;
  318. overflow-y: auto;
  319. margin: 30rpx;
  320. }
  321. .rejectText {
  322. text-align: center;
  323. }
  324. /deep/.u-input__textarea {
  325. height: 300rpx !important;
  326. }
  327. </style>