|
@@ -0,0 +1,399 @@
|
|
|
+import { ref, computed } from "vue";
|
|
|
+import { auditorOrderSettlement } from "@/api/finance/settlement.js";
|
|
|
+
|
|
|
+import { takeList, paymentList, takeApproval, careatPayment,payoutCheck } from "@/api/finance/withdrawal.js";
|
|
|
+//功能
|
|
|
+export default ({ proxy, jlzj_area_type }) => {
|
|
|
+ const router = useRouter();
|
|
|
+ const dialogFormRef = ref(null);
|
|
|
+ const userTableRef = ref(null);
|
|
|
+ const dialogVerifyRef =ref(null);
|
|
|
+ const tabkey = ref('0');
|
|
|
+ const {
|
|
|
+ pay_type,
|
|
|
+ is_pay,
|
|
|
+ volunteer_app_status,
|
|
|
+ is_verified,
|
|
|
+ payment_status
|
|
|
+ } = proxy.useDict("pay_type", "is_pay", "volunteer_app_status","payment_status","is_verified");
|
|
|
+
|
|
|
+
|
|
|
+ //打开弹窗
|
|
|
+ const openDialog = (data, type) => {
|
|
|
+ console.log('data', data);
|
|
|
+ try {
|
|
|
+ const disabledData = {
|
|
|
+ alipayAccountNo: true,
|
|
|
+ alipayName: true,
|
|
|
+ takeAmount: true,
|
|
|
+ createTime: true,
|
|
|
+
|
|
|
+ }
|
|
|
+ //审核
|
|
|
+ if (type === 'examine') {
|
|
|
+
|
|
|
+ dialogFormRef.value.initForm(data, disabledData)
|
|
|
+ }
|
|
|
+ if (type === 'details') {
|
|
|
+ disabledData['appStatus'] = true;
|
|
|
+ disabledData['rejectReason'] = true;
|
|
|
+ dialogFormRef.value.initForm(data, disabledData)
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (error) {
|
|
|
+ console.log('error', error);
|
|
|
+ } finally {
|
|
|
+ console.log('dialogFormRef.value', dialogFormRef.value);
|
|
|
+ dialogFormRef.value.handleDialog(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //导出
|
|
|
+ const exportFile = async (parmas) => {
|
|
|
+ console.log("TCL: exportFile -> parmas", parmas)
|
|
|
+ // try {
|
|
|
+ // proxy.download("core/orderSettlementApplication/export",{
|
|
|
+ // ...queryParams.value,
|
|
|
+ // }, `订单费用结算_${new Date().getTime()}.xlsx`);
|
|
|
+ // } catch (error) {
|
|
|
+ // }
|
|
|
+ }
|
|
|
+
|
|
|
+ //审核提交
|
|
|
+ const submitForm = async (data) => {
|
|
|
+
|
|
|
+ try {
|
|
|
+ console.log('submit', data);
|
|
|
+ const parmas = {
|
|
|
+ volunteerTakeRecordId: data.volunteerTakeRecordId,
|
|
|
+ appStatus: data.appStatus,
|
|
|
+ rejectReason: data.rejectReason
|
|
|
+ }
|
|
|
+ const res = await takeApproval(parmas);
|
|
|
+ if (up_res.code === 200) {
|
|
|
+ proxy.$modal.msgSuccess("审核成功");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ proxy.$modal.msgSuccess(res.msg);
|
|
|
+ } catch (error) {
|
|
|
+ console.log('error', error);
|
|
|
+ } finally {
|
|
|
+ userTableRef.value.resetForm();
|
|
|
+ dialogFormRef.value.handleDialog(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const getList = (data) => {
|
|
|
+ const parmasData = JSON.parse(JSON.stringify(data));
|
|
|
+ if (parmasData.tabkeys) {
|
|
|
+ delete parmasData.tabkeys;
|
|
|
+ }
|
|
|
+ console.log("TCL: getList -> data", data, parmasData)
|
|
|
+ tabkey.value = data.tabkeys;
|
|
|
+ return data.tabkeys !== '4' ? takeList({ ...parmasData, appStatus: data.tabkeys }) : paymentList(parmasData)
|
|
|
+ }
|
|
|
+
|
|
|
+ const paymentSubmit = async (ids) => {
|
|
|
+ try {
|
|
|
+
|
|
|
+ const res = await careatPayment({
|
|
|
+ ids,
|
|
|
+ payType: '2'
|
|
|
+ })
|
|
|
+ if (res.code === 200) {
|
|
|
+ proxy.$modal.msgSuccess("创建成功!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ proxy.$modal.msgSuccess(res.msg);
|
|
|
+ } catch (error) {
|
|
|
+ console.log('error', error);
|
|
|
+ } finally {
|
|
|
+ userTableRef.value.resetForm();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const openVerify = (data) => {
|
|
|
+ try {
|
|
|
+ const disabledData = {
|
|
|
+ volunteerPaymentRecordsId: true,
|
|
|
+ paymentOrderNumber:true,
|
|
|
+ payType:true
|
|
|
+
|
|
|
+ }
|
|
|
+ dialogVerifyRef.value.initForm(data, disabledData)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('error', error);
|
|
|
+ } finally {
|
|
|
+ userTableRef.value.resetForm();
|
|
|
+ dialogVerifyRef.value.handleDialog(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const submitVerify = async(data) => {
|
|
|
+ try {
|
|
|
+ console.log('submit', data);
|
|
|
+ const parmas = {
|
|
|
+ volunteerPaymentRecordsId: data.volunteerPaymentRecordsId,
|
|
|
+ paymentOrderNumber: data.paymentOrderNumber,
|
|
|
+ payPassword:data.payPassword
|
|
|
+ }
|
|
|
+ const res = await payoutCheck(parmas);
|
|
|
+ if (up_res.code === 200) {
|
|
|
+ proxy.$modal.msgSuccess("审核成功");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ proxy.$modal.msgSuccess(res.msg);
|
|
|
+ } catch (error) {
|
|
|
+ console.log('error', error);
|
|
|
+ } finally {
|
|
|
+ userTableRef.value.resetForm();
|
|
|
+ dialogVerifyRef.value.handleDialog(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return {
|
|
|
+ dialogFormRef,
|
|
|
+ userTableRef,
|
|
|
+ dialogVerifyRef,
|
|
|
+ tabList: [
|
|
|
+ {
|
|
|
+ title: '待审核',
|
|
|
+ name: '1'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '已驳回',
|
|
|
+ name: '3'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '待处理',
|
|
|
+ name: '2'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '打款单',
|
|
|
+ name: '4'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ openDialog,
|
|
|
+ exportFile,
|
|
|
+ submitForm,
|
|
|
+ getList,
|
|
|
+ submitVerify,
|
|
|
+ tabkey,
|
|
|
+ talkeColumn:ref([
|
|
|
+ {
|
|
|
+ label: '支付宝账户',
|
|
|
+ prop: 'alipayAccountNo',
|
|
|
+ type: 'input',
|
|
|
+ isSearch: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '支付宝姓名',
|
|
|
+ prop: 'alipayName',
|
|
|
+ type: 'input',
|
|
|
+ isSearch: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '提现申请金额',
|
|
|
+ prop: 'takeAmount',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '账户类型',
|
|
|
+ prop: 'payType',
|
|
|
+ type: 'dict',
|
|
|
+ dict: pay_type
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '申请时间',
|
|
|
+ prop: 'createTime',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '数据情况',
|
|
|
+ prop: 'isPay',
|
|
|
+ type: 'dict',
|
|
|
+ dict: is_pay
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '审核状态',
|
|
|
+ prop: 'appStatus',
|
|
|
+ type: 'dict',
|
|
|
+ dict: volunteer_app_status
|
|
|
+ }
|
|
|
+ ]),
|
|
|
+ paymentColumn: ref([
|
|
|
+ {
|
|
|
+ label: '打款单单号',
|
|
|
+ prop: 'paymentOrderNumber',
|
|
|
+ type: 'input',
|
|
|
+ isSearch: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '打款单总金额',
|
|
|
+ prop: 'totalPaymentAmount',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '实际打款金额',
|
|
|
+ prop: 'actualPaymentAmount',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '验证状态',
|
|
|
+ prop: 'isVerified',
|
|
|
+ type: 'dict',
|
|
|
+ dict: is_verified
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '打款状态',
|
|
|
+ prop: 'paymentStatus',
|
|
|
+ type: 'dict',
|
|
|
+ dict: payment_status
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '打款结果',
|
|
|
+ prop: 'appStatus',
|
|
|
+ type: 'render',
|
|
|
+ render:(row) => {
|
|
|
+ console.log("TCL: exportFile -> row", row)
|
|
|
+ return `成功:${row.successfulPaymentAmount}; 失败:${row.failedPaymentAmount}`
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '生成时间',
|
|
|
+ prop: 'createTime',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '打款时间',
|
|
|
+ prop: 'createTime',
|
|
|
+ },
|
|
|
+ ]),
|
|
|
+ dialogData: {
|
|
|
+ title: '结算申请',
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: '支付宝账户',
|
|
|
+ prop: 'alipayAccountNo',
|
|
|
+ type: 'input',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '支付宝姓名',
|
|
|
+ prop: 'alipayName',
|
|
|
+ type: 'input',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '提现申请金额',
|
|
|
+ prop: 'takeAmount',
|
|
|
+ type: 'input',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '申请时间',
|
|
|
+ prop: 'createTime',
|
|
|
+ type: 'input',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '审核状态',
|
|
|
+ prop: 'appStatus',
|
|
|
+ type: 'radio',
|
|
|
+ rules: [
|
|
|
+ { required: true, message: '请选择审核状态', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ label: '通过',
|
|
|
+ value: '2'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '不通过',
|
|
|
+ value: '3'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '驳回原因',
|
|
|
+ prop: 'rejectReason',
|
|
|
+ type: 'textarea',
|
|
|
+ show: (form) => {
|
|
|
+ console.log('驳回原因', form);
|
|
|
+ return form.appStatus === '3'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ searchBtns: [
|
|
|
+ {
|
|
|
+ label: '创建打款单',
|
|
|
+ func: () => {
|
|
|
+ const ids = userTableRef.value.ids;
|
|
|
+ console.log('批量删除', ids)
|
|
|
+ ids.length > 0 && paymentSubmit(ids)
|
|
|
+ },
|
|
|
+ key: 'applicant',
|
|
|
+ type: 'primary',
|
|
|
+ show: (row) => {
|
|
|
+ return tabkey.value === '2'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ scopeBtns: [
|
|
|
+ {
|
|
|
+ label: '审核',
|
|
|
+ type: 'primary',
|
|
|
+ key: 'examine',
|
|
|
+ func: (row) => {
|
|
|
+ console.log(row)
|
|
|
+ openDialog(row, 'examine')
|
|
|
+ },
|
|
|
+ show: (row) => {
|
|
|
+ return tabkey.value === '0' && row.appStatus === '1'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // label: '查看详情',
|
|
|
+ // type: 'primary',
|
|
|
+ // key: 'details',
|
|
|
+ // func: (row) => {
|
|
|
+ // console.log(row)
|
|
|
+ // openDialog(row, 'details')
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ label: '验证',
|
|
|
+ type: 'primary',
|
|
|
+ key: 'details',
|
|
|
+ func: (row) => {
|
|
|
+ console.log(row)
|
|
|
+ openVerify(row)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ dialogVerifyData: ref({
|
|
|
+ title: '结算申请',
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: '打款id',
|
|
|
+ prop: 'volunteerPaymentRecordsId',
|
|
|
+ type: 'input',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '打款单单号',
|
|
|
+ prop: 'paymentOrderNumber',
|
|
|
+ type: 'input',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '打款方式',
|
|
|
+ prop: 'payType',
|
|
|
+ type: 'select',
|
|
|
+ options: pay_type
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '打款验证密码',
|
|
|
+ prop: 'payPassword',
|
|
|
+ type: 'input',
|
|
|
+ dese:'发送验证码',
|
|
|
+ deseClick:(data)=>{
|
|
|
+ console.log("TCL: exportFile -> data", data)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ }),
|
|
|
+
|
|
|
+ }
|
|
|
+}
|