调整
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
<a-form-item label="结算项目" v-bind="validateInfos.contractId">
|
||||
<TowerContractSelectModel
|
||||
:placeholder="`请选择结算项目`"
|
||||
v-model:value="contactNumber"
|
||||
v-model:value="projectName"
|
||||
@done="chooseContract"
|
||||
/>
|
||||
</a-form-item>
|
||||
@@ -44,167 +44,168 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="8" :sm="24" :xs="24">
|
||||
<a-form-item label="本期开始日期" v-bind="validateInfos.startDate">
|
||||
<a-date-picker
|
||||
class="ele-fluid"
|
||||
placeholder="请选择开始日期"
|
||||
v-model:value="form.startDate"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="结算方式">
|
||||
<a-select placeholder="请先选择项目" style="width: 250px" size="small" :disabled="!form.contractId"
|
||||
v-model:value="form.settleMethod">
|
||||
<a-select-option v-for="(item, index) in ContractSettleMethod" :key="index" :value="index">
|
||||
{{ item }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-form-item label="本期开始日期" v-bind="validateInfos.dateRange">
|
||||
<a-range-picker v-model:value="dateRange" picker="month" />
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="本期开始日期" v-bind="validateInfos.startDate">-->
|
||||
<!-- <a-date-picker-->
|
||||
<!-- class="ele-fluid"-->
|
||||
<!-- placeholder="请选择开始日期"-->
|
||||
<!-- v-model:value="form.startDate"-->
|
||||
<!-- valueFormat="YYYY-MM-DD"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- <a-form-item label="结算方式">-->
|
||||
<!-- <a-select placeholder="请先选择项目" style="width: 250px" size="small" :disabled="!form.contractId"-->
|
||||
<!-- v-model:value="form.settleMethod">-->
|
||||
<!-- <a-select-option v-for="(item, index) in ContractSettleMethod" :key="index" :value="index">-->
|
||||
<!-- {{ item }}-->
|
||||
<!-- </a-select-option>-->
|
||||
<!-- </a-select>-->
|
||||
<!-- </a-form-item>-->
|
||||
</a-col>
|
||||
<a-col :md="8" :sm="24" :xs="24">
|
||||
<a-form-item label="本期结束日期" v-bind="validateInfos.endDate">
|
||||
<a-date-picker
|
||||
class="ele-fluid"
|
||||
placeholder="请选择开始日期"
|
||||
v-model:value="form.endDate"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
/>
|
||||
</a-form-item>
|
||||
<div v-if="[0, 3].indexOf(form.settleMethod) > -1">
|
||||
<span>每月</span>
|
||||
<a-select placeholder="必选项" style="width: 250px" size="small"
|
||||
v-model:value="form.extendMonthDate">
|
||||
<a-select-option v-for="item in dateList" :key="item" :value="item">
|
||||
{{ item }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<span>号</span>
|
||||
<span class="ml-05">至下月</span>
|
||||
<span class="ml-05" v-if="form.extendMonthDate">{{ form.extendMonthDate - 1 }}号</span>
|
||||
</div>
|
||||
</a-col>
|
||||
<!-- <a-col :md="8" :sm="24" :xs="24">-->
|
||||
<!-- <a-form-item label="本期结束日期" v-bind="validateInfos.endDate">-->
|
||||
<!-- <a-date-picker-->
|
||||
<!-- class="ele-fluid"-->
|
||||
<!-- placeholder="请选择开始日期"-->
|
||||
<!-- v-model:value="form.endDate"-->
|
||||
<!-- valueFormat="YYYY-MM-DD"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- <div v-if="[0, 3].indexOf(form.settleMethod) > -1">-->
|
||||
<!-- <span>每月</span>-->
|
||||
<!-- <a-select placeholder="必选项" style="width: 250px" size="small"-->
|
||||
<!-- v-model:value="form.extendMonthDate">-->
|
||||
<!-- <a-select-option v-for="item in dateList" :key="item" :value="item">-->
|
||||
<!-- {{ item }}-->
|
||||
<!-- </a-select-option>-->
|
||||
<!-- </a-select>-->
|
||||
<!-- <span>号</span>-->
|
||||
<!-- <span class="ml-05">至下月</span>-->
|
||||
<!-- <span class="ml-05" v-if="form.extendMonthDate">{{ form.extendMonthDate - 1 }}号</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </a-col>-->
|
||||
</a-row>
|
||||
</a-card>
|
||||
</a-form>
|
||||
<a-card>
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane :key="0" tab="租金结算">
|
||||
<template #default>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex-1">
|
||||
<a-button :disabled="!form.contractId || contractEquipmentList.length === 0" type="primary"
|
||||
@click.native="doShowSelectEquipment(0)">
|
||||
选择结算设备
|
||||
</a-button>
|
||||
<a-button class="mx-05" :disabled="!form.contractId || contractEquipmentList.length === 0"
|
||||
type="primary" @click.native="oneKetAddEquipment(0)">一键加载结算设备
|
||||
</a-button>
|
||||
<a-button :disabled="!form.startDate || !form.startDate" type="primary"
|
||||
@click.native="onyKeyAsyncDate(0)">同步结算起止日期
|
||||
</a-button>
|
||||
</div>
|
||||
<a-input style="width: 300px" v-model:value="taxRate[0]" @change="changeTaxRate($event, 0)">
|
||||
<template #prefix>税率</template>
|
||||
<template #addonAfter>%</template>
|
||||
</a-input>
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane :key="0" tab="租金结算">
|
||||
<template #default v-if="activeKey === 0">
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex-1">
|
||||
<a-button :disabled="!form.contractId || contractEquipmentList.length === 0" type="primary"
|
||||
@click.native="doShowSelectEquipment(0)">
|
||||
新增
|
||||
</a-button>
|
||||
<!-- <a-button class="mx-05" :disabled="!form.contractId || contractEquipmentList.length === 0"-->
|
||||
<!-- type="primary" @click.native="oneKetAddEquipment(0)">一键加载结算设备-->
|
||||
<!-- </a-button>-->
|
||||
<!-- <a-button :disabled="!form.startDate || !form.startDate" type="primary"-->
|
||||
<!-- @click.native="onyKeyAsyncDate(0)">同步结算起止日期-->
|
||||
<!-- </a-button>-->
|
||||
</div>
|
||||
<table0 :data-source="dataSource[0]" />
|
||||
</template>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane :key="1" tab="进退场费">
|
||||
<template #default>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex-1">
|
||||
<a-button :disabled="!form.contractId || contractEquipmentList.length === 0" type="primary"
|
||||
@click.native="doShowSelectEquipment(1)">
|
||||
选择结算设备
|
||||
</a-button>
|
||||
<a-button class="mx-05" :disabled="!form.contractId || contractEquipmentList.length === 0"
|
||||
type="primary" @click.native="oneKetAddEquipment(1)">一键加载结算设备
|
||||
</a-button>
|
||||
<a-button :disabled="!form.startDate || !form.startDate" type="primary"
|
||||
@click.native="onyKeyAsyncDate(1)">同步结算起止日期
|
||||
</a-button>
|
||||
</div>
|
||||
<a-input style="width: 300px" v-model:value="taxRate[1]" @change="changeTaxRate($event, 1)">
|
||||
<template #prefix>税率</template>
|
||||
<template #addonAfter>%</template>
|
||||
</a-input>
|
||||
<a-input style="width: 300px" v-model:value="taxRate[0]" @change="changeTaxRate($event, 0)">
|
||||
<template #prefix>税率</template>
|
||||
<template #addonAfter>%</template>
|
||||
</a-input>
|
||||
</div>
|
||||
<table0 :data-source="dataSource[0]" />
|
||||
</template>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane :key="1" tab="进退场费">
|
||||
<template #default v-if="activeKey === 1">
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex-1">
|
||||
<a-button :disabled="!form.contractId || contractEquipmentList.length === 0" type="primary"
|
||||
@click.native="doShowSelectEquipment(1)">
|
||||
选择结算设备
|
||||
</a-button>
|
||||
<a-button class="mx-05" :disabled="!form.contractId || contractEquipmentList.length === 0"
|
||||
type="primary" @click.native="oneKetAddEquipment(1)">一键加载结算设备
|
||||
</a-button>
|
||||
<a-button :disabled="!form.startDate || !form.startDate" type="primary"
|
||||
@click.native="onyKeyAsyncDate(1)">同步结算起止日期
|
||||
</a-button>
|
||||
</div>
|
||||
<table1 :data-source="dataSource[1]" />
|
||||
</template>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane :key="2" tab="操作人员工资结算">
|
||||
<template #default>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex-1">
|
||||
<a-button :disabled="!form.contractId || contractEquipmentList.length === 0" type="primary"
|
||||
@click.native="doShowSelectEquipment(2)">
|
||||
选择结算设备
|
||||
</a-button>
|
||||
<a-button class="mx-05" :disabled="!form.contractId || contractEquipmentList.length === 0"
|
||||
type="primary" @click.native="oneKetAddEquipment(2)">一键加载结算设备
|
||||
</a-button>
|
||||
<a-button :disabled="!form.startDate || !form.startDate" type="primary"
|
||||
@click.native="onyKeyAsyncDate(2)">同步结算起止日期
|
||||
</a-button>
|
||||
</div>
|
||||
<a-input style="width: 300px" v-model:value="taxRate[2]" @change="changeTaxRate($event, 2)">
|
||||
<template #prefix>税率</template>
|
||||
<template #addonAfter>%</template>
|
||||
</a-input>
|
||||
<a-input style="width: 300px" v-model:value="taxRate[1]" @change="changeTaxRate($event, 1)">
|
||||
<template #prefix>税率</template>
|
||||
<template #addonAfter>%</template>
|
||||
</a-input>
|
||||
</div>
|
||||
<table1 :data-source="dataSource[1]" />
|
||||
</template>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane :key="2" tab="操作人员工资结算">
|
||||
<template #default>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex-1">
|
||||
<a-button :disabled="!form.contractId || contractEquipmentList.length === 0" type="primary"
|
||||
@click.native="doShowSelectEquipment(2)">
|
||||
选择结算设备
|
||||
</a-button>
|
||||
<a-button class="mx-05" :disabled="!form.contractId || contractEquipmentList.length === 0"
|
||||
type="primary" @click.native="oneKetAddEquipment(2)">一键加载结算设备
|
||||
</a-button>
|
||||
<!-- <a-button :disabled="!form.startDate || !form.startDate" type="primary"-->
|
||||
<!-- @click.native="onyKeyAsyncDate(2)">同步结算起止日期-->
|
||||
<!-- </a-button>-->
|
||||
</div>
|
||||
<table2 :data-source="dataSource[2]" />
|
||||
</template>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane :key="3" tab="其他费用清单">
|
||||
<template #default>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex-1">
|
||||
<a-button :disabled="!form.contractId || contractEquipmentList.length === 0" type="primary"
|
||||
@click.native="doShowSelectEquipment(3)">
|
||||
选择结算设备
|
||||
</a-button>
|
||||
<a-button class="mx-05" :disabled="!form.contractId || contractEquipmentList.length === 0"
|
||||
type="primary" @click.native="oneKetAddEquipment(3)">一键加载结算设备
|
||||
</a-button>
|
||||
<a-button :disabled="!form.startDate || !form.startDate" type="primary"
|
||||
@click.native="onyKeyAsyncDate(3)">同步结算起止日期
|
||||
</a-button>
|
||||
</div>
|
||||
<a-input style="width: 300px" v-model:value="taxRate[3]" @change="changeTaxRate($event, 3)">
|
||||
<template #prefix>税率</template>
|
||||
<template #addonAfter>%</template>
|
||||
</a-input>
|
||||
<a-input style="width: 300px" v-model:value="taxRate[2]" @change="changeTaxRate($event, 2)">
|
||||
<template #prefix>税率</template>
|
||||
<template #addonAfter>%</template>
|
||||
</a-input>
|
||||
</div>
|
||||
<table2 :data-source="dataSource[2]" v-if="activeKey === 2" />
|
||||
</template>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane :key="3" tab="其他费用清单">
|
||||
<template #default v-if="activeKey === 3">
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex-1">
|
||||
<a-button :disabled="!form.contractId || contractEquipmentList.length === 0" type="primary"
|
||||
@click.native="doShowSelectEquipment(3)">
|
||||
选择结算设备
|
||||
</a-button>
|
||||
<a-button class="mx-05" :disabled="!form.contractId || contractEquipmentList.length === 0"
|
||||
type="primary" @click.native="oneKetAddEquipment(3)">一键加载结算设备
|
||||
</a-button>
|
||||
<!-- <a-button :disabled="!form.startDate || !form.startDate" type="primary"-->
|
||||
<!-- @click.native="onyKeyAsyncDate(3)">同步结算起止日期-->
|
||||
<!-- </a-button>-->
|
||||
</div>
|
||||
<table3 :data-source="dataSource[3]" />
|
||||
</template>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane :key="4" tab="扣除项">
|
||||
<template #default>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex-1">
|
||||
<a-button :disabled="!form.contractId || contractEquipmentList.length === 0" type="primary"
|
||||
@click.native="doShowSelectEquipment(4)">
|
||||
选择结算设备
|
||||
</a-button>
|
||||
<a-button class="mx-05" :disabled="!form.contractId || contractEquipmentList.length === 0"
|
||||
type="primary" @click.native="oneKetAddEquipment(4)">一键加载结算设备
|
||||
</a-button>
|
||||
<a-button :disabled="!form.startDate || !form.startDate" type="primary"
|
||||
@click.native="onyKeyAsyncDate(4)">同步结算起止日期
|
||||
</a-button>
|
||||
</div>
|
||||
<a-input style="width: 300px" v-model:value="taxRate[4]" @change="changeTaxRate($event, 4)">
|
||||
<template #prefix>税率</template>
|
||||
<template #addonAfter>%</template>
|
||||
</a-input>
|
||||
<a-input style="width: 300px" v-model:value="taxRate[3]" @change="changeTaxRate($event, 3)">
|
||||
<template #prefix>税率</template>
|
||||
<template #addonAfter>%</template>
|
||||
</a-input>
|
||||
</div>
|
||||
<table3 :data-source="dataSource[3]" />
|
||||
</template>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane :key="4" tab="扣除项">
|
||||
<template #default v-if="activeKey === 4">
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex-1">
|
||||
<a-button :disabled="!form.contractId || contractEquipmentList.length === 0" type="primary"
|
||||
@click.native="doShowSelectEquipment(4)">
|
||||
选择结算设备
|
||||
</a-button>
|
||||
<a-button class="mx-05" :disabled="!form.contractId || contractEquipmentList.length === 0"
|
||||
type="primary" @click.native="oneKetAddEquipment(4)">一键加载结算设备
|
||||
</a-button>
|
||||
<!-- <a-button :disabled="!form.startDate || !form.startDate" type="primary"-->
|
||||
<!-- @click.native="onyKeyAsyncDate(4)">同步结算起止日期-->
|
||||
<!-- </a-button>-->
|
||||
</div>
|
||||
<table4 :data-source="dataSource[4]" />
|
||||
</template>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
<a-input style="width: 300px" v-model:value="taxRate[4]" @change="changeTaxRate($event, 4)">
|
||||
<template #prefix>税率</template>
|
||||
<template #addonAfter>%</template>
|
||||
</a-input>
|
||||
</div>
|
||||
<table4 :data-source="dataSource[4]" />
|
||||
</template>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</ele-modal>
|
||||
<ele-modal
|
||||
:width="'80%'"
|
||||
@@ -237,7 +238,7 @@ import { Form, message } from "ant-design-vue";
|
||||
import { assignObject, EleProTable } from "ele-admin-pro";
|
||||
import { useUserStore } from "@/store/modules/user";
|
||||
import { Contract, ContractSettleMethod } from "@/api/tower/contract/model";
|
||||
import dayjs from "dayjs";
|
||||
import dayjs, { Dayjs } from "dayjs";
|
||||
|
||||
import { Settle } from "@/api/tower/settle/model";
|
||||
import { addSettle, updateSettle } from "@/api/tower/settle";
|
||||
@@ -310,7 +311,6 @@ const getDataSource = async () => {
|
||||
res.forEach(item => {
|
||||
if ((item.type === 0 || item.type === 2)) {
|
||||
const days = dayjs(item.endDate).diff(dayjs(item.startDate), "day");
|
||||
item.dailyAmount = (item.monthAmount / 30).toFixed(2);
|
||||
item = { ...item, ...{ days } };
|
||||
}
|
||||
dataSource.value[item.type].push(item);
|
||||
@@ -339,32 +339,40 @@ const rules = reactive({
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
startDate: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择开始日期",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
endDate: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择结束日期",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
// startDate: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: "请选择开始日期",
|
||||
// trigger: "blur"
|
||||
// }
|
||||
// ],
|
||||
// endDate: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: "请选择结束日期",
|
||||
// trigger: "blur"
|
||||
// }
|
||||
// ],
|
||||
settleNo: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入结算单号",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
],
|
||||
dateRange: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择所属期间",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
|
||||
});
|
||||
|
||||
const contactNumber = ref<string | undefined>("");
|
||||
const projectName = ref<string | undefined>("");
|
||||
const chooseContract = (res: Contract) => {
|
||||
contactNumber.value = res.contactNumber;
|
||||
projectName.value = res.projectName;
|
||||
form.contractId = res.contractId;
|
||||
form.settleMethod = res.settleMethod;
|
||||
form.startDate = res.startDate;
|
||||
@@ -374,6 +382,8 @@ const chooseContract = (res: Contract) => {
|
||||
|
||||
const { resetFields, validate, validateInfos } = useForm(form, rules);
|
||||
|
||||
const dateRange = ref<[Dayjs, Dayjs] | [string, string]>()
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
validate()
|
||||
@@ -385,9 +395,12 @@ const save = () => {
|
||||
let totalAmount = 0;
|
||||
dataSource.value.forEach(data => {
|
||||
data.forEach(item => {
|
||||
if ((item.type === 0 || item.type === 2) && item.dailyAmount && item.days) totalAmount += item.dailyAmount * item.days;
|
||||
else if ((item.type === 1 || item.type === 3) && item.singleAmount && item.num) totalAmount += item.singleAmount * item.num;
|
||||
else if (item.type === 4 && item.singleAmount && item.num) totalAmount -= item.singleAmount * item.num;
|
||||
if ((item.type === 0 || item.type === 2) && item.dailyAmount && item.days)
|
||||
totalAmount += (item.dailyAmount * item.day) + (item.monthAmount * item.month);
|
||||
else if ((item.type === 1 || item.type === 3) && item.singleAmount && item.num)
|
||||
totalAmount += item.singleAmount * item.num;
|
||||
else if (item.type === 4 && item.singleAmount && item.num)
|
||||
totalAmount -= item.singleAmount * item.num;
|
||||
});
|
||||
});
|
||||
data.totalAmount = totalAmount;
|
||||
@@ -446,7 +459,7 @@ const addDataSource = (data: ContractSettleEquipment, index) => {
|
||||
// factoryNo: data.factoryNo,
|
||||
startDate: form.startDate ?? "",
|
||||
endDate: form.endDate ?? "",
|
||||
monthAmount: 0,
|
||||
monthAmount: data.rentAmount ?? 0,
|
||||
taxRate: taxRate.value[index],
|
||||
singleAmount: 0,
|
||||
num: 0,
|
||||
@@ -454,7 +467,10 @@ const addDataSource = (data: ContractSettleEquipment, index) => {
|
||||
remark: "",
|
||||
userId: loginUser.value.userId,
|
||||
days,
|
||||
dailyAmount: 0
|
||||
dailyAmount: 0,
|
||||
inDate: "",
|
||||
outDate: "",
|
||||
payRate: 100
|
||||
});
|
||||
};
|
||||
|
||||
@@ -480,13 +496,15 @@ watch(
|
||||
loading.value = false;
|
||||
assignObject(form, props.data);
|
||||
isUpdate.value = true;
|
||||
contactNumber.value = props.data.contactNumber;
|
||||
projectName.value = props.data.projectName;
|
||||
getDataSource();
|
||||
getContractEquipmentList();
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
contactNumber.value = "";
|
||||
projectName.value = "";
|
||||
dataSource.value = [[], [], [], [], []];
|
||||
resetFields();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user