123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446 |
- import { ref,computed } from "vue";
- import { auditorOrderSettlement } from "@/api/finance/settlement.js";
- //功能
- export default ({proxy,jlzj_area_type}) => {
- const router = useRouter();
- const dialogFormRef = ref(null);
- const userTableRef = ref(null);
- const {
- lrr_service_status,
- settlement_application_auditor_status,
- area_settlement_status,
- service_centre_settlement_stauts
- } = proxy.useDict("lrr_service_status","settlement_application_auditor_status","area_settlement_status","service_centre_settlement_stauts");
- const tabList =computed(() => {
- let data = []
- data = settlement_application_auditor_status.value.map(item => {
- return {
- title: item.label,
- name: item.value
- }
- })
- return [{
- title: '全部',
- name: ''
- },...data] || [];
- })
- //打开弹窗
- const openDialog = (ids) => {
- console.log('ids', ids);
- try {
- dialogFormRef.value.initForm({ids:ids}, {})
- } 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 = {
- ids: data.ids,
- auditorStatus: data.auditorStatus,
- auditorRemark: data.auditorRemark
- }
- const res = await auditorOrderSettlement(parmas);
- if (res.code === 200) {
- proxy.$modal.msgSuccess("审核成功");
- userTableRef.value.resetForm();
- dialogFormRef.value.handleDialog(false);
- return;
- }
- proxy.$modal.msgSuccess(res.msg);
- } catch (error) {
- console.log('error', error);
- }
- }
- const list_quyu = ref([
- {
- label: jlzj_area_type.value === '0'?'区域中心':'服务中心',
- prop: 'areaName',
- type: 'input',
- isSearch: true,
- width:'150px'
- },
- {
- label: '提交人',
- prop: 'applyUserName',
- type: 'input',
- width:'150px',
- isSearch: false
- },
- {
- label: '订单编号',
- prop: 'outTradeNo',
- type: 'input',
- isSearch: true,
- width:'200px',
- },
- {
- label: '订单开始时间',
- queryLabel: '订单时间',
- prop: 'orderTime',
- width: '160px',
- isSearch: true,
- type: 'date',
- keys: ['startTime', 'endTime'],
- },
- {
- label: '订单完成时间',
- prop: 'serviceEndTime',
- width:'160px',
- },
- {
- label: '用户名称',
- prop: 'userNickName',
- width:'140px',
- type: 'input',
- isSearch: false
- },
- {
- label: '用户联系方式',
- prop: 'userPhone',
- width: '140px',
- type: 'input',
- isSearch: true
- },
- {
- label: '志愿者',
- prop: 'volunteerName',
- width:'140px',
- type: 'input',
- isSearch: false
- },
- {
- label: '志愿者联系方式',
- prop: 'volunteerPhone',
- width: '140px',
- type: 'input',
- isSearch: true
- },
- {
- label: '服务项目',
- prop: 'businessTierName',
- width:'170px'
- },
- {
- label: '订单总金额',
- prop: 'orderTotalPrice',
- width:'140px'
- },
- {
- label: '订单状态',
- prop: 'orderStatus',
- type: 'dict',
- dict: lrr_service_status,
- isSearch: false,
- width:'150px'
- },
- {
- label: '区域公司抽成比例',
- prop: 'areaDistributionRatio',
- width:'150px'
- },
- {
- label: '区域公司抽成金额',
- prop: 'areaDistributionAmount',
- width:'150px'
- },
- {
- label: '区域公司结算状态',
- prop: 'areaSettlementStatus',
- type: 'dict',
- dict: area_settlement_status,
- width:'150px',
- },
- {
- label: '区域公司结算时间',
- prop: 'areaSettlementTime',
- width:'150px',
- },
- {
- label: '开户行',
- prop: 'areaPayeeBankName',
- width:'150px'
- },
- {
- label: '收款账户',
- prop: 'areaPayeeAccount',
- width:'180px',
- type: 'input',
- isSearch: true
- },
- {
- label: '收款人',
- prop: 'areaPayeeName',
- width:'150px'
- },
- {
- label: '审核原因说明',
- prop: 'auditorRemark',
- width:'150px'
- },
- {
- label: '审核状态',
- prop: 'auditorStatus',
- type: 'dict',
- dict: settlement_application_auditor_status,
- width:'150px',
- },
- ])
- const list_fuwu = ref([
- {
- label: jlzj_area_type.value === '0'?'区域中心':'服务中心',
- prop: jlzj_area_type.value === '0'?'areaName':'serviceCentreName',
- type: 'input',
- isSearch: true,
- width:'150px'
- },
- {
- label: '提交人',
- prop: 'applyUserName',
- type: 'input',
- width:'150px',
- isSearch: false
- },
- {
- label: '订单编号',
- prop: 'outTradeNo',
- type: 'input',
- isSearch: true,
- width:'200px',
- },
- {
- label: '订单开始时间',
- queryLabel: '订单时间',
- prop: 'orderTime',
- width: '160px',
- isSearch: true,
- type: 'date',
- keys: ['startTime', 'endTime'],
- },
- {
- label: '订单完成时间',
- prop: 'serviceEndTime',
- width:'160px',
- },
- {
- label: '用户名称',
- prop: 'userNickName',
- width:'140px',
- type: 'input',
- isSearch: false
- },
- {
- label: '用户联系方式',
- prop: 'userPhone',
- width: '140px',
- type: 'input',
- isSearch: true
- },
- {
- label: '志愿者',
- prop: 'volunteerName',
- width:'140px',
- type: 'input',
- isSearch: false
- },
- {
- label: '志愿者联系方式',
- prop: 'volunteerPhone',
- width: '140px',
- type: 'input',
- isSearch: true
- },
- {
- label: '服务项目',
- prop: 'businessTierName',
- width:'170px'
- },
- {
- label: '订单总金额',
- prop: 'orderTotalPrice',
- width:'140px'
- },
- {
- label: '订单状态',
- prop: 'orderStatus',
- type: 'dict',
- dict: lrr_service_status,
- isSearch: false,
- width:'150px'
- },
- {
- label: '区域公司抽成比例',
- prop: 'areaDistributionRatio',
- width:'150px'
- },
- {
- label: '区域公司抽成金额',
- prop: 'areaDistributionAmount',
- width:'150px'
- },
- {
- label: '区域公司结算状态',
- prop: 'areaSettlementStatus',
- type: 'dict',
- dict: area_settlement_status,
- width:'150px',
- },
- {
- label: '区域公司结算时间',
- prop: 'areaSettlementTime',
- width:'150px',
- },
- {
- label: '服务中心抽成比例',
- prop: 'serviceCentreDistributionRatio',
- width:'150px'
- },
- {
- label: '服务中心抽成金额',
- prop: 'serviceCentreDistributionAmount',
- width:'150px'
- },
- {
- label: '服务中心结算状态',
- prop: 'serviceCentreSettlementStatus',
- type: 'dict',
- dict: service_centre_settlement_stauts,
- width:'150px',
- },
- {
- label: '服务中心结算时间',
- prop: 'serviceCentreSettlementTime',
- width:'150px',
- },
- {
- label: '审核原因说明',
- prop: 'auditorRemark',
- width:'150px'
- },
- {
- label: '审核状态',
- prop: 'auditorStatus',
- type: 'dict',
- dict: settlement_application_auditor_status,
- width:'150px',
- },
- ])
- return {
- dialogFormRef,
- userTableRef,
- tabList,
- openDialog,
- exportFile,
- submitForm,
- tableColumn:
- jlzj_area_type.value === '0'? list_quyu:list_fuwu,
- dialogData: {
- title: '审核',
- column: [
- {
- label: '审核状态',
- prop: 'auditorStatus',
- type: 'radio',
- rules: [
- { required: true, message: '请选择审核状态', trigger: 'blur' }
- ],
- options: [
- {
- label: '通过',
- value: '20'
- },
- {
- label: '不通过',
- value: '30'
- }
- ]
- },
- {
- label: '驳回原因',
- prop: 'auditorRemark',
- type: 'textarea',
- show:(form)=>{
- console.log('驳回原因',form);
- return form.auditorStatus === '30'
- }
- },
- ]
- },
- searchBtns:[
- {
- label: '批量审核',
- func: () => {
- const ids = userTableRef.value.ids;
- console.log('批量删除', ids)
- ids.length > 0 && openDialog(ids)
- },
- key: 'applicant',
- type: 'primary',
- show: (tabsValue) => {
-
- return tabsValue === '10'
- }
- },
- {
- label: '导出',
- func: (parmas) => {
- try {
- proxy.download("core/orderSettlementApplication/export",{
- ...parmas,
- auditorStatus: parmas.tabsValue
- }, `订单费用结算申请表_${new Date().getTime()}.xlsx`);
- } catch (error) {
- }
- },
- key: 'export',
- type: 'primary'
- },
- ],
- scopeBtns:[
- {
- label: '审核',
- type: 'primary',
- key: 'examine',
- func: (row) => {
- console.log(row)
- openDialog([row.id])
- },
- show:(row)=>{
- return row.auditorStatus === '10'
- }
- },
- // {
- // label: '查看详情',
- // type: 'primary',
- // key: 'details',
- // func: (row) => {
- // console.log(row)
- // router.push({
- // path: "/order-details",
- // query: { id: row.mainOrderId }
- // });
- // }
- // },
- ]
-
- }
- }
|