acquisition_settlement_approval.vue 7.9 KB

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