|
@@ -1,13 +1,21 @@
|
|
|
<template>
|
|
|
<div class="tenant">
|
|
|
<div class="content">
|
|
|
- <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
|
|
|
- highlight-current-row :statConfig="statConfig" :action-list="[
|
|
|
+ <byTable
|
|
|
+ :source="sourceList.data"
|
|
|
+ :pagination="sourceList.pagination"
|
|
|
+ :config="config"
|
|
|
+ :loading="loading"
|
|
|
+ :selectConfig="selectConfig"
|
|
|
+ highlight-current-row
|
|
|
+ :statConfig="statConfig"
|
|
|
+ :action-list="[
|
|
|
{
|
|
|
text: '创建合同',
|
|
|
action: () => newContract(),
|
|
|
},
|
|
|
- ]" @get-list="getList">
|
|
|
+ ]"
|
|
|
+ @get-list="getList">
|
|
|
<template #code="{ item }">
|
|
|
<div style="width: 100%">
|
|
|
<a style="color: #409eff; cursor: pointer; word-break: break-all" @click="openDetails(item)">{{ item.code }}</a>
|
|
@@ -31,42 +39,31 @@
|
|
|
<a style="color: #409eff; cursor: pointer; word-break: break-all">{{ moneyFormat(item.sumClaimMoney, 4) }}</a>
|
|
|
</template>
|
|
|
<template #default>
|
|
|
- <div style="width: 100%; padding: 10px" v-if="
|
|
|
- item.claimContractList && item.claimContractList.length > 0
|
|
|
- ">
|
|
|
- <div v-for="(record, index) in item.claimContractList" :key="index" style="background: #f1f1f1; border-radius: 2px" :style="{
|
|
|
- 'margin-bottom':
|
|
|
- index !== item.claimContractList.length - 1
|
|
|
- ? '20px'
|
|
|
- : '0px',
|
|
|
- }" :class="{ 'act-class': record.id === currentId }" @mouseenter="handleMoveEnter(record)">
|
|
|
- <div style="
|
|
|
- display: flex;
|
|
|
- justify-content: space-around;
|
|
|
- padding: 5px 0;
|
|
|
- ">
|
|
|
+ <div style="width: 100%; padding: 10px" v-if="item.claimContractList && item.claimContractList.length > 0">
|
|
|
+ <div
|
|
|
+ v-for="(record, index) in item.claimContractList"
|
|
|
+ :key="index"
|
|
|
+ style="background: #f1f1f1; border-radius: 2px"
|
|
|
+ :style="{
|
|
|
+ 'margin-bottom': index !== item.claimContractList.length - 1 ? '20px' : '0px',
|
|
|
+ }"
|
|
|
+ :class="{ 'act-class': record.id === currentId }"
|
|
|
+ @mouseenter="handleMoveEnter(record)">
|
|
|
+ <div style="display: flex; justify-content: space-around; padding: 5px 0">
|
|
|
<div style="color: #333333">
|
|
|
- <div style="color: #999999; margin-bottom: 4px">
|
|
|
- 认领金额:
|
|
|
- </div>
|
|
|
+ <div style="color: #999999; margin-bottom: 4px">认领金额:</div>
|
|
|
{{ record.currency }} {{ record.money }}
|
|
|
</div>
|
|
|
<div style="color: #333333">
|
|
|
- <div style="color: #999999; margin-bottom: 4px">
|
|
|
- 汇率:
|
|
|
- </div>
|
|
|
+ <div style="color: #999999; margin-bottom: 4px">汇率:</div>
|
|
|
{{ record.rate }}
|
|
|
</div>
|
|
|
<div style="color: #333333">
|
|
|
- <div style="color: #999999; margin-bottom: 4px">
|
|
|
- 时间:
|
|
|
- </div>
|
|
|
+ <div style="color: #999999; margin-bottom: 4px">时间:</div>
|
|
|
{{ record.createTime }}
|
|
|
</div>
|
|
|
<div style="color: #333333">
|
|
|
- <div style="color: #999999; margin-bottom: 4px">
|
|
|
- 认领人:
|
|
|
- </div>
|
|
|
+ <div style="color: #999999; margin-bottom: 4px">认领人:</div>
|
|
|
{{ dictValueLabel(record.createUser, userList) }}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -86,16 +83,12 @@
|
|
|
<span v-if="item.refundStatus && item.refundStatus !== 0">
|
|
|
{{ dictValueLabel(item.refundStatus, refundStatusNew) }}
|
|
|
</span>
|
|
|
- <span v-else>{{
|
|
|
- dictValueLabel(item.refundStatusNew, refundStatusNew)
|
|
|
- }}</span>
|
|
|
+ <span v-else>{{ dictValueLabel(item.refundStatusNew, refundStatusNew) }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #status="{ item }">
|
|
|
<div>
|
|
|
- <span :style="getStyle(item.status)">{{
|
|
|
- dictValueLabel(item.status, status)
|
|
|
- }}</span>
|
|
|
+ <span :style="getStyle(item.status)">{{ dictValueLabel(item.status, status) }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #buyCorporationId="{ item }">
|
|
@@ -196,6 +189,7 @@ const sourceList = ref({
|
|
|
keyword: "",
|
|
|
status: "",
|
|
|
sellCorporationId: "",
|
|
|
+ userId: "",
|
|
|
},
|
|
|
});
|
|
|
const loading = ref(false);
|
|
@@ -216,6 +210,11 @@ const selectConfig = computed(() => {
|
|
|
prop: "contractType",
|
|
|
data: contractType.value,
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "业务员",
|
|
|
+ prop: "userId",
|
|
|
+ data: userList.value,
|
|
|
+ },
|
|
|
];
|
|
|
});
|
|
|
const config = computed(() => {
|
|
@@ -444,46 +443,38 @@ const config = computed(() => {
|
|
|
];
|
|
|
});
|
|
|
const getDict = () => {
|
|
|
- proxy
|
|
|
- .getDictOne([
|
|
|
- "contract_type",
|
|
|
- "account_currency",
|
|
|
- "trade_mode",
|
|
|
- "shipping_method",
|
|
|
- "unit",
|
|
|
- ])
|
|
|
- .then((res) => {
|
|
|
- if (res.contract_type && res.contract_type.length > 0) {
|
|
|
- contractType.value = res.contract_type.map((x) => ({
|
|
|
- label: x.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- }
|
|
|
- if (res.account_currency && res.account_currency.length > 0) {
|
|
|
- accountCurrency.value = res.account_currency.map((x) => ({
|
|
|
- label: x.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- }
|
|
|
- if (res.trade_mode && res.trade_mode.length > 0) {
|
|
|
- tradeMethods.value = res.trade_mode.map((x) => ({
|
|
|
- label: x.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- }
|
|
|
- if (res.shipping_method && res.shipping_method.length > 0) {
|
|
|
- shippingMethod.value = res.shipping_method.map((x) => ({
|
|
|
- label: x.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- }
|
|
|
- if (res.unit && res.unit.length > 0) {
|
|
|
- productUnit.value = res.unit.map((x) => ({
|
|
|
- label: x.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- }
|
|
|
- });
|
|
|
+ proxy.getDictOne(["contract_type", "account_currency", "trade_mode", "shipping_method", "unit"]).then((res) => {
|
|
|
+ if (res.contract_type && res.contract_type.length > 0) {
|
|
|
+ contractType.value = res.contract_type.map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ if (res.account_currency && res.account_currency.length > 0) {
|
|
|
+ accountCurrency.value = res.account_currency.map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ if (res.trade_mode && res.trade_mode.length > 0) {
|
|
|
+ tradeMethods.value = res.trade_mode.map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ if (res.shipping_method && res.shipping_method.length > 0) {
|
|
|
+ shippingMethod.value = res.shipping_method.map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ if (res.unit && res.unit.length > 0) {
|
|
|
+ productUnit.value = res.unit.map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ });
|
|
|
proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
|
corporationList.value = res.rows.map((item) => {
|
|
|
return {
|
|
@@ -560,60 +551,58 @@ onMounted(() => {
|
|
|
getList();
|
|
|
});
|
|
|
const getTotal = () => {
|
|
|
- proxy
|
|
|
- .post("/contract/getHeadCustomerStatistics", sourceList.value.pagination)
|
|
|
- .then((res) => {
|
|
|
- statConfig.value = [
|
|
|
+ proxy.post("/contract/getHeadCustomerStatistics", sourceList.value.pagination).then((res) => {
|
|
|
+ statConfig.value = [
|
|
|
+ {
|
|
|
+ label: "合计",
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ statConfig.value[0].data.push({
|
|
|
+ label: "合计",
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ label: "数量",
|
|
|
+ num: res.sumQuantity,
|
|
|
+ color: "rgb(171 0 255)",
|
|
|
+ },
|
|
|
{
|
|
|
- label: "合计",
|
|
|
- data: [],
|
|
|
+ label: "金额",
|
|
|
+ num: res.sumAmount.toFixed(2),
|
|
|
+ color: "rgb(171 0 255)",
|
|
|
},
|
|
|
- ];
|
|
|
+ {
|
|
|
+ label: "到账金额",
|
|
|
+ num: res.sumArrivalAmount.toFixed(2),
|
|
|
+ color: "rgb(171 0 255)",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ });
|
|
|
+ for (let i = 0; i < res.list.length; i++) {
|
|
|
statConfig.value[0].data.push({
|
|
|
- label: "合计",
|
|
|
+ label: res.list[i].sellCorporationName,
|
|
|
data: [
|
|
|
{
|
|
|
label: "数量",
|
|
|
- num: res.sumQuantity,
|
|
|
- color: "rgb(171 0 255)",
|
|
|
+ num: res.list[i].sumQuantity,
|
|
|
+ color: "blue",
|
|
|
},
|
|
|
{
|
|
|
label: "金额",
|
|
|
- num: res.sumAmount.toFixed(2),
|
|
|
- color: "rgb(171 0 255)",
|
|
|
+ num: res.list[i].sumAmount.toFixed(2),
|
|
|
+ color: "blue",
|
|
|
},
|
|
|
{
|
|
|
label: "到账金额",
|
|
|
- num: res.sumArrivalAmount.toFixed(2),
|
|
|
- color: "rgb(171 0 255)",
|
|
|
+ num: res.list[i].sumClaimMoney.toFixed(2),
|
|
|
+ color: "blue",
|
|
|
},
|
|
|
],
|
|
|
});
|
|
|
- for (let i = 0; i < res.list.length; i++) {
|
|
|
- statConfig.value[0].data.push({
|
|
|
- label: res.list[i].sellCorporationName,
|
|
|
- data: [
|
|
|
- {
|
|
|
- label: "数量",
|
|
|
- num: res.list[i].sumQuantity,
|
|
|
- color: "blue",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "金额",
|
|
|
- num: res.list[i].sumAmount.toFixed(2),
|
|
|
- color: "blue",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "到账金额",
|
|
|
- num: res.list[i].sumClaimMoney.toFixed(2),
|
|
|
- color: "blue",
|
|
|
- },
|
|
|
- ],
|
|
|
- });
|
|
|
- }
|
|
|
- console.log(statConfig.value);
|
|
|
- console.log(res);
|
|
|
- });
|
|
|
+ }
|
|
|
+ console.log(statConfig.value);
|
|
|
+ console.log(res);
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const newContract = () => {
|
|
@@ -646,10 +635,7 @@ const clickDownload = () => {
|
|
|
};
|
|
|
const statistics = (label, index) => {
|
|
|
let num = 0;
|
|
|
- if (
|
|
|
- printDetails.value.productInfoList &&
|
|
|
- printDetails.value.productInfoList.length > 0
|
|
|
- ) {
|
|
|
+ if (printDetails.value.productInfoList && printDetails.value.productInfoList.length > 0) {
|
|
|
printDetails.value.productInfoList.map((item) => {
|
|
|
if (item[label]) {
|
|
|
num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
|
|
@@ -660,10 +646,7 @@ const statistics = (label, index) => {
|
|
|
};
|
|
|
const statisticsTwo = (label, index) => {
|
|
|
let num = 0;
|
|
|
- if (
|
|
|
- printDetails.value.contractProjectList &&
|
|
|
- printDetails.value.contractProjectList.length > 0
|
|
|
- ) {
|
|
|
+ if (printDetails.value.contractProjectList && printDetails.value.contractProjectList.length > 0) {
|
|
|
printDetails.value.contractProjectList.map((item) => {
|
|
|
if (item[label]) {
|
|
|
num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
|
|
@@ -674,15 +657,8 @@ const statisticsTwo = (label, index) => {
|
|
|
};
|
|
|
const computeScale = (item) => {
|
|
|
let text = 0;
|
|
|
- if (
|
|
|
- item.sumClaimMoney &&
|
|
|
- Number(item.sumClaimMoney) > 0 &&
|
|
|
- item.amountCNY &&
|
|
|
- Number(item.amountCNY) > 0
|
|
|
- ) {
|
|
|
- text = parseFloat(
|
|
|
- (Number(item.sumClaimMoney) / Number(item.amountCNY)) * 100
|
|
|
- ).toFixed(2);
|
|
|
+ if (item.sumClaimMoney && Number(item.sumClaimMoney) > 0 && item.amountCNY && Number(item.amountCNY) > 0) {
|
|
|
+ text = parseFloat((Number(item.sumClaimMoney) / Number(item.amountCNY)) * 100).toFixed(2);
|
|
|
}
|
|
|
return text + "%";
|
|
|
};
|
|
@@ -712,8 +688,7 @@ const openDetails = (row) => {
|
|
|
const printObj = ref({
|
|
|
id: "printMe",
|
|
|
popTitle: "",
|
|
|
- extraCss:
|
|
|
- "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
|
|
|
+ extraCss: "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
|
|
|
extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
|
|
|
});
|
|
|
const clickAlteration = (row) => {
|