WithdrawalProcessing.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <el-dialog
  3. :visible.sync="visible"
  4. v-bind="modalOptions"
  5. @close="cardData = {}"
  6. >
  7. <div>
  8. <el-descriptions title="" :column="2" border>
  9. <el-descriptions-item label="店铺名称:">
  10. {{ formData.shopName }}
  11. </el-descriptions-item>
  12. <el-descriptions-item label="店铺编码:">
  13. {{ formData.shopCode }}
  14. </el-descriptions-item>
  15. <el-descriptions-item label="银行名称:">
  16. {{ formData.bankName }}
  17. </el-descriptions-item>
  18. <el-descriptions-item label="银行卡号:">
  19. {{ formData.bankCard }}
  20. </el-descriptions-item>
  21. <el-descriptions-item label="收款人姓名:">
  22. {{ formData.collectionName }}
  23. </el-descriptions-item>
  24. <el-descriptions-item label="提现金额:">
  25. {{ formData.withdrawalMoney }}
  26. </el-descriptions-item>
  27. <el-descriptions-item label="处理编号:">
  28. {{ formData.handleSn }}
  29. </el-descriptions-item>
  30. <el-descriptions-item label="申请时间:">
  31. {{ formData.applyTime }}
  32. </el-descriptions-item>
  33. <el-descriptions-item v-if="formData.handleTime" label="处理时间:">
  34. {{ formData.handleTime }}
  35. </el-descriptions-item>
  36. <el-descriptions-item label="审核状态">
  37. <div>
  38. <span v-if="formData.state === 0">待处理</span>
  39. <span v-else-if="formData.state === 1">已处理</span>
  40. <span v-else-if="formData.state === 2">通过</span>
  41. <span v-else-if="formData.state === 3">拒绝</span>
  42. <span v-else-if="formData.state === 4">待确认</span>
  43. <span v-else>--</span>
  44. </div>
  45. </el-descriptions-item>
  46. <el-descriptions-item label="备注:">
  47. {{ formData.cause || '--' }}
  48. </el-descriptions-item>
  49. <el-descriptions-item label="惠市宝订单的分账状态:">
  50. <div>
  51. <span v-if="formData.summaryHsbSplitState === -1">无需分账</span>
  52. <span v-else-if="formData.summaryHsbSplitState === 0">未分账</span>
  53. <span v-else-if="formData.summaryHsbSplitState === 1">部分分账</span>
  54. <span v-else-if="formData.summaryHsbSplitState === 2">已分账</span>
  55. <span v-else>--</span>
  56. </div>
  57. </el-descriptions-item>
  58. <el-descriptions-item label="惠市宝已分账金额:">
  59. {{ formData.summaryHsbSplitedAmount }}
  60. </el-descriptions-item>
  61. <el-descriptions-item label="惠市宝剩余分账金额:">
  62. {{ formData.summaryHsbSplitRemainAmount }}
  63. </el-descriptions-item>
  64. <el-descriptions-item label="非惠市宝订单的相关提现金额:">
  65. {{ formData.summaryNotHsbAmount }}
  66. </el-descriptions-item>
  67. <el-descriptions-item label="已认证身份姓名">
  68. {{ cardData.name || "未认证" }}
  69. </el-descriptions-item>
  70. <el-descriptions-item label="已认证身份证">
  71. {{ cardData.idCard || "未认证" }}
  72. </el-descriptions-item>
  73. <el-descriptions-item label="已认证电话号码">
  74. {{ cardData.phone || "未认证"}}
  75. </el-descriptions-item>
  76. </el-descriptions>
  77. </div>
  78. <div style="color: red;font-size: 16px;text-align: center; margin-top:20px;">* 请确认您已转账成功,再点击确认。说明:分账金额代表已打款,T+1到账</div>
  79. <el-input v-show="formData.state == 3" v-model="formData.cause" type="textarea" autosize placeholder="请输入拒绝打款理由">
  80. </el-input>
  81. <div v-show="formData.state == 2" style="margin-top: 30px;">
  82. <el-radio v-model="formData.type" label="1" border>通联</el-radio>
  83. <el-radio v-model="formData.type" label="2" border>线下</el-radio>
  84. </div>
  85. <template #footer>
  86. <span>
  87. <el-button @click="visible = false">取 消</el-button>
  88. <el-button v-if="formData.state === 3" type="danger" @click="handleRefuse">确认拒绝打款</el-button>
  89. <el-button v-else type="danger" @click="handleRefuse">拒绝打款</el-button>
  90. <el-button v-if="formData.state === 0" type="primary" @click="handleExamine">确认用户信息</el-button>
  91. <el-button v-else-if="formData.state === 2" type="primary" @click="handleConfirm">确认打款</el-button>
  92. </span>
  93. </template>
  94. </el-dialog>
  95. </template>
  96. <script>
  97. import { withdrawalGetById, withdrawalHandle,getWithdrawalAccount } from '@/api/withdrawal'
  98. export default {
  99. name: 'WithdrawalProcessing',
  100. components: {
  101. },
  102. data() {
  103. return {
  104. modalOptions: {
  105. closeOnClickModal: false,
  106. width: '820px',
  107. title: '提现处理'
  108. },
  109. visible: false,
  110. formData: {
  111. withdrawalId: '',
  112. shopName: '',
  113. shopCode: '',
  114. bankName: '',
  115. bankCard: '',
  116. collectionName: '',
  117. withdrawalMoney: '',
  118. handleSn: '',
  119. applyTime: '',
  120. handleTime: '',
  121. state: '',
  122. type: '', // 支付方式选择
  123. cause: '', // 拒绝理由
  124. summaryHsbSplitState: '',
  125. summaryHsbSplitedAmount: '',
  126. summaryHsbSplitRemainAmount: '',
  127. summaryNotHsbAmount: ''
  128. },
  129. formRules: {
  130. },
  131. // 身份证信息
  132. cardData:{}
  133. }
  134. },
  135. methods: {
  136. handleClose() {
  137. this.visible = false
  138. },
  139. async initList() {
  140. },
  141. handleOpen(params = {}) {
  142. this.modalOptions.title = '提现处理'
  143. this.formData = Object.assign(this.$options.data().formData, params)
  144. this.visible = true
  145. this.initList()
  146. if (params.withdrawalId) {
  147. this.getInfo(params.withdrawalId)
  148. this.getWithdrawalInfo(params.shopId)
  149. } else {
  150. this.$refs.formData && this.$refs.formData.resetFields()
  151. }
  152. },
  153. async getInfo(id) {
  154. const loading = this.$loading({ text: '加载中' })
  155. try {
  156. const res = await withdrawalGetById({ withdrawalId: id })
  157. this.formData = Object.assign(this.$options.data().formData, res.data, {
  158. withdrawalId: res.data.withdrawalId || '',
  159. shopName: res.data.shopName || '',
  160. shopCode: res.data.shopCode || '',
  161. bankName: res.data.bankName || '',
  162. bankCard: res.data.bankCard || '',
  163. collectionName: res.data.collectionName || '',
  164. withdrawalMoney: res.data.withdrawalMoney || 0,
  165. handleSn: res.data.handleSn || '',
  166. applyTime: res.data.applyTime || '',
  167. handleTime: res.data.handleTime || '',
  168. state: res.data.state || 0,
  169. type: res.data.type || '',
  170. cause: res.data.cause || '',
  171. summaryHsbSplitState: res.data.summaryHsbSplitState,
  172. summaryHsbSplitedAmount: res.data.summaryHsbSplitedAmount,
  173. summaryHsbSplitRemainAmount: res.data.summaryHsbSplitRemainAmount,
  174. summaryNotHsbAmount: res.data.summaryNotHsbAmount
  175. })
  176. this.$nextTick(() => {
  177. this.$refs.formData && this.$refs.formData.validate()
  178. })
  179. } finally {
  180. loading.close()
  181. }
  182. },
  183. // 单独用来请求提现的身份证以及手机号姓名等
  184. async getWithdrawalInfo(id){
  185. let {data} = await getWithdrawalAccount({ shopIds: id })
  186. this.cardData = data[0]
  187. },
  188. // 拒绝打款
  189. async handleRefuse() {
  190. if (this.formData.state == 3) {
  191. if (!this.formData.cause) return this.$message.error('拒绝理由不能为空')
  192. const res = await withdrawalHandle({
  193. withdrawalId: this.formData.withdrawalId,
  194. state: '3',
  195. audit: 2,
  196. cause: this.formData.cause
  197. })
  198. if (res.code == '') {
  199. this.$message.success('成功拒绝打款!!!')
  200. }
  201. this.visible = false
  202. this.$emit('success')
  203. } else {
  204. this.formData.state = 3
  205. this.$message.warning('请填写理由并确定拒绝打款!!!')
  206. }
  207. },
  208. // 确认审核
  209. handleExamine() {
  210. this.$confirm('确定审核通过吗?')
  211. .then(async () => {
  212. await withdrawalHandle({
  213. withdrawalId: this.formData.withdrawalId,
  214. state: '0',
  215. audit: 1,
  216. type: ''
  217. })
  218. this.$message.success('操作成功!请再次确认!')
  219. this.getInfo(this.formData.withdrawalId)
  220. this.$emit('success')
  221. })
  222. .catch(() => {})
  223. },
  224. // 确认打款
  225. handleConfirm() {
  226. this.$confirm('确定打款吗?')
  227. .then(async () => {
  228. if (!this.formData.type) return this.$message.error('请选择打款方式')
  229. await withdrawalHandle({
  230. withdrawalId: this.formData.withdrawalId,
  231. state: '2',
  232. audit: 1,
  233. type: this.formData.type
  234. })
  235. this.$message.success('打款成功!!!')
  236. this.visible = false
  237. this.$emit('success')
  238. })
  239. .catch(() => {})
  240. }
  241. }
  242. }
  243. </script>