|
@@ -1,14 +1,26 @@
|
|
|
-import { ref,computed } from "vue";
|
|
|
// 区域
|
|
|
-export default (proxy) => {
|
|
|
+import { ref, computed } from "vue";
|
|
|
+import {
|
|
|
+ applyOrderSettlement,
|
|
|
+ serviceSettlement, regionalsettlement
|
|
|
+} from "@/api/finance/settlement.js";
|
|
|
|
|
|
- const {
|
|
|
+const PING_TAI = '0'; //平台
|
|
|
+const QU_YU = '3'; //区域
|
|
|
+const FU_WU_ZHONG_XIN = '4'; //服务中心
|
|
|
+
|
|
|
+export default ({ proxy, jlzj_area_type }) => {
|
|
|
+ const dialogFormRef = ref(null);
|
|
|
+ const userTableRef = ref(null);
|
|
|
+ const dialogType = ref('applyfor');
|
|
|
+
|
|
|
+ const {
|
|
|
lrr_service_status,
|
|
|
- area_settlement_status,
|
|
|
- service_centre_settlement_stauts
|
|
|
- } = proxy.useDict("lrr_service_status","area_settlement_status","service_centre_settlement_stauts");
|
|
|
+ service_centre_settlement_stauts,
|
|
|
+ area_settlement_status
|
|
|
+ } = proxy.useDict("lrr_service_status", "service_centre_settlement_stauts", "area_settlement_status");
|
|
|
|
|
|
- const tabList =computed(() => {
|
|
|
+ const tabList = computed(() => {
|
|
|
let data = []
|
|
|
data = area_settlement_status.value.map(item => {
|
|
|
return {
|
|
@@ -18,20 +30,134 @@ export default (proxy) => {
|
|
|
})
|
|
|
return data || [];
|
|
|
})
|
|
|
+ const openDialog = (data, type) => {
|
|
|
+ try {
|
|
|
+ dialogType.value = type;
|
|
|
+
|
|
|
+
|
|
|
+ let params = { mainOrderIds: data };
|
|
|
+ let disabledData = {};
|
|
|
+
|
|
|
+ dialogFormRef.value.initForm(params, disabledData)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('error', error);
|
|
|
+ } finally {
|
|
|
+ console.log('dialogFormRef.value', dialogFormRef.value);
|
|
|
+ dialogFormRef.value.handleDialog(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //结算申请
|
|
|
+ const applyforSubmit = async (data) => {
|
|
|
+
|
|
|
+ const parmas = {
|
|
|
+ secondOrderIds: data.mainOrderIds,
|
|
|
+ payeeMethod: data.payeeMethod,
|
|
|
+ payeeAccount: data.payeeAccount,
|
|
|
+ payeeBankName: data.payeeBankName,
|
|
|
+ payeeName: data.payeeName,
|
|
|
+ payeeRemark: data.payeeRemark,
|
|
|
+
|
|
|
+ }
|
|
|
+ const res = await applyOrderSettlement(parmas);
|
|
|
+ if (res.code === 200) {
|
|
|
+ proxy.$modal.msgSuccess("审核成功");
|
|
|
+ userTableRef.value.resetForm();
|
|
|
+ dialogFormRef.value.handleDialog(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //区域费用结算
|
|
|
+ const handleRegionalSettlement = async (data) => {
|
|
|
+ try {
|
|
|
+ const parmas = {
|
|
|
+ secondOrderIds: data.mainOrderIds,
|
|
|
+ payerMethod: data.payerMethod,
|
|
|
+ payerAccount: data.payerAccount,
|
|
|
+ payerBankName: data.payerBankName,
|
|
|
+ payerName: data.payerName,
|
|
|
+ payerRemark: data.payerRemark,
|
|
|
+ payerTime: data.payerTime
|
|
|
+ }
|
|
|
+ const res = await regionalsettlement(parmas);
|
|
|
+ if (res.code === 200) {
|
|
|
+ proxy.$modal.msgSuccess("操作成功");
|
|
|
+ userTableRef.value.resetForm();
|
|
|
+ dialogFormRef.value.handleDialog(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log("TCL: handleRegionalSettlement -> error", error)
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //弹窗申请提交
|
|
|
+ const submitForm = async (data) => {
|
|
|
+ try {
|
|
|
+ console.log('submit', data);
|
|
|
+ //申请
|
|
|
+ if (dialogType.value === 'applyfor') {
|
|
|
+ await applyforSubmit(data);
|
|
|
+ }
|
|
|
|
|
|
+ if (dialogType.value === 'settlement') {
|
|
|
+ await handleRegionalSettlement(data);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log('error', error);
|
|
|
+ }
|
|
|
+ }
|
|
|
return {
|
|
|
- tableColumn:ref([
|
|
|
+ dialogFormRef,
|
|
|
+ userTableRef,
|
|
|
+ tabList,
|
|
|
+ tabKey: 'areaSettlementStatus',
|
|
|
+ submitForm,
|
|
|
+ searchBtns: [
|
|
|
+ {
|
|
|
+ label: '批量申请',
|
|
|
+ func: () => {
|
|
|
+ const ids = userTableRef.value.ids;
|
|
|
+ console.log('批量删除', ids)
|
|
|
+ ids.length > 0 && openDialog(ids, 'applyfor')
|
|
|
+ },
|
|
|
+ key: 'applicant',
|
|
|
+ type: 'primary',
|
|
|
+ // hasPermi:["finance:apply"]
|
|
|
+ show: (tabsValue) => {
|
|
|
+ console.log("TCL: tabsValue",jlzj_area_type.value, tabsValue)
|
|
|
+ return jlzj_area_type.value !== PING_TAI && tabsValue === '10'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '批量费用结算',
|
|
|
+ func: () => {
|
|
|
+ const ids = userTableRef.value.ids;
|
|
|
+ console.log('批量删除', ids)
|
|
|
+ ids.length > 0 && openDialog(ids, 'settlement')
|
|
|
+ },
|
|
|
+ key: 'settlement',
|
|
|
+ type: 'primary',
|
|
|
+ show: (tabsValue) => {
|
|
|
+
|
|
|
+ return jlzj_area_type.value === PING_TAI && tabsValue === '40'
|
|
|
+ }
|
|
|
+ // hasPermi:["finance:settlement"]
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ dialogType,
|
|
|
+ tableColumn: ref([
|
|
|
{
|
|
|
label: '订单号',
|
|
|
prop: 'outTradeNo',
|
|
|
type: 'input',
|
|
|
isSearch: true,
|
|
|
- width:'200px',
|
|
|
+ width: '200px',
|
|
|
},
|
|
|
{
|
|
|
label: '订单时间',
|
|
|
prop: 'orderTime',
|
|
|
- width:'160px',
|
|
|
+ width: '160px',
|
|
|
isSearch: true,
|
|
|
type: 'date',
|
|
|
keys: ['serviceCompleteStartTime', 'serviceCompleteEndTime'],
|
|
@@ -39,7 +165,7 @@ export default (proxy) => {
|
|
|
{
|
|
|
label: '订单完成时间',
|
|
|
prop: 'serviceEndTime',
|
|
|
- width:'160px',
|
|
|
+ width: '160px',
|
|
|
isSearch: true,
|
|
|
type: 'date',
|
|
|
keys: ['serviceCompleteStartTime', 'serviceCompleteEndTime'],
|
|
@@ -47,26 +173,26 @@ export default (proxy) => {
|
|
|
{
|
|
|
label: '用户名称',
|
|
|
prop: 'userNickName',
|
|
|
- width:'140px',
|
|
|
+ width: '140px',
|
|
|
type: 'input',
|
|
|
isSearch: true
|
|
|
},
|
|
|
{
|
|
|
label: '志愿者名称',
|
|
|
prop: 'volunteerName',
|
|
|
- width:'140px',
|
|
|
+ width: '140px',
|
|
|
type: 'input',
|
|
|
isSearch: true
|
|
|
},
|
|
|
{
|
|
|
label: '服务项目',
|
|
|
prop: 'businessTierName',
|
|
|
- width:'170px'
|
|
|
+ width: '170px'
|
|
|
},
|
|
|
{
|
|
|
label: '订单总金额(元)',
|
|
|
prop: 'orderTotalPrice',
|
|
|
- width:'140px'
|
|
|
+ width: '140px'
|
|
|
},
|
|
|
{
|
|
|
label: '订单状态',
|
|
@@ -74,48 +200,74 @@ export default (proxy) => {
|
|
|
type: 'dict',
|
|
|
dict: lrr_service_status,
|
|
|
isSearch: false,
|
|
|
- width:'100px'
|
|
|
+ width: '100px'
|
|
|
},
|
|
|
{
|
|
|
label: '服务中心',
|
|
|
prop: 'serviceCentreName',
|
|
|
type: 'input',
|
|
|
isSearch: true,
|
|
|
- width:'150px'
|
|
|
+ width: '150px'
|
|
|
},
|
|
|
{
|
|
|
label: '抽成金额',
|
|
|
prop: 'areaDistributionAmount',
|
|
|
- width:'150px'
|
|
|
+ width: '150px'
|
|
|
},
|
|
|
{
|
|
|
label: '结算状态',
|
|
|
prop: 'areaSettlementStatus',
|
|
|
type: 'dict',
|
|
|
dict: area_settlement_status,
|
|
|
- width:'150px',
|
|
|
+ width: '150px',
|
|
|
},
|
|
|
{
|
|
|
label: '结算时间',
|
|
|
prop: 'areaSettlementTime',
|
|
|
- width:'160px',
|
|
|
+ width: '160px',
|
|
|
},
|
|
|
{
|
|
|
label: '服务中心抽成金额',
|
|
|
prop: 'serviceCentreDistributionAmount',
|
|
|
- width:'150px',
|
|
|
+ width: '150px',
|
|
|
},
|
|
|
{
|
|
|
label: '服务中心结算状态',
|
|
|
prop: 'serviceCentreSettlementStatus',
|
|
|
- width:'100px',
|
|
|
+ width: '130px',
|
|
|
type: 'dict',
|
|
|
dict: service_centre_settlement_stauts,
|
|
|
+ isSearch: true,
|
|
|
},
|
|
|
]),
|
|
|
-
|
|
|
- tabList,
|
|
|
- tabKey:'areaSettlementStatus'
|
|
|
-
|
|
|
+ scopeBtns: [
|
|
|
+ {
|
|
|
+ label: '结算申请',
|
|
|
+ type: 'primary',
|
|
|
+ key: 'examine',
|
|
|
+ func: (row) => {
|
|
|
+ console.log(row)
|
|
|
+ openDialog([row.orderId], 'applyfor')
|
|
|
+ },
|
|
|
+ hasPermi: ["finance:apply"],
|
|
|
+ show: (row) => {
|
|
|
+ return row.areaSettlementStatus === '10' && jlzj_area_type.value !== PING_TAI
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '费用结算',
|
|
|
+ type: 'primary',
|
|
|
+ key: 'examine',
|
|
|
+ func: (row) => {
|
|
|
+ console.log(row)
|
|
|
+ openDialog([row.orderId], 'settlement')
|
|
|
+ },
|
|
|
+ hasPermi: ["finance:settlement"],
|
|
|
+ show: (row) => {
|
|
|
+ return row.areaSettlementStatus === '40' && jlzj_area_type.value === PING_TAI
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ ]
|
|
|
}
|
|
|
}
|