|
@@ -10,8 +10,12 @@
|
|
|
]" @get-list="getList">
|
|
|
</byTable>
|
|
|
<div style="padding: 0 20px 0px 20px; background-color: white" v-if="rateStatus">
|
|
|
- <el-table :data="sourceList.data" v-loading="loading" :height="tableHeight">
|
|
|
- <el-table-column label="合同编号" prop="code" width="140" fixed />
|
|
|
+ <el-table :data="sourceList.data" v-loading="loading" :height="tableHeight" :row-style="changeStyle">
|
|
|
+ <el-table-column label="合同编号" prop="code" width="140" fixed>
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div style="color: #409eff; cursor: pointer; word-break: break-all" @click="openDetails(row)"> {{ ( row.code) }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="合同金额" width="140" fixed>
|
|
|
<template #default="{ row }">
|
|
|
<div>{{ row.currency }} {{ moneyFormat( row.amount,2) }}</div>
|
|
@@ -48,8 +52,50 @@
|
|
|
<el-popover placement="top-start" :width="600" trigger="hover" @show="showEcharts(row,$index)">
|
|
|
<template #default>
|
|
|
<div>
|
|
|
- <div :ref="row.contractId+$index" style="height:320px">
|
|
|
+ <div :ref="row.contractId+$index" style="height:250px">
|
|
|
</div>
|
|
|
+ <el-table :data="row.grossProfitInfoListOne" style="width: 100%;margin-top:10px">
|
|
|
+ <el-table-column prop="createTime" label="时间" width="160" />
|
|
|
+ <el-table-column label="毛利">
|
|
|
+ <template #default="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ moneyFormat(scope.row.gross,2) }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="销售合同金额">
|
|
|
+ <template #default="scope">
|
|
|
+ <div>
|
|
|
+ <span v-if="scope.$index>0 && getIsTop(row.grossProfitInfoListOne,scope,'contractAmount')"
|
|
|
+ style="position:relative;top:3px">
|
|
|
+ <el-icon color="#f54a45" :size="18" v-if="getColor(row.grossProfitInfoListOne,scope,'contractAmount')">
|
|
|
+ <Top />
|
|
|
+ </el-icon>
|
|
|
+ <el-icon v-else color="#90d562" :size="18">
|
|
|
+ <Bottom />
|
|
|
+ </el-icon>
|
|
|
+ </span>
|
|
|
+ {{scope.row.contractCurrency}} {{ moneyFormat(scope.row.contractAmount ,2)}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="采购合同金额">
|
|
|
+ <template #default="scope">
|
|
|
+ <div>
|
|
|
+ <span v-if="scope.$index>0 && getIsTop(row.grossProfitInfoListOne,scope,'purchaseAmount')"
|
|
|
+ style="position:relative;top:3px">
|
|
|
+ <el-icon color="#f54a45" :size="18" v-if="getColor(row.grossProfitInfoListOne,scope,'purchaseAmount')">
|
|
|
+ <Top />
|
|
|
+ </el-icon>
|
|
|
+ <el-icon v-else color="#90d562" :size="18">
|
|
|
+ <Bottom />
|
|
|
+ </el-icon>
|
|
|
+ </span>
|
|
|
+ CNY {{ moneyFormat(scope.row.purchaseAmount ,2)}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #reference>
|
|
@@ -70,7 +116,6 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="客户名称" prop="customerName" min-width="200" />
|
|
|
<el-table-column label="业务员" prop="userName" width="120" />
|
|
|
-
|
|
|
<el-table-column label="应付货款" width="120">
|
|
|
<template #default="{ row }">
|
|
|
<div>
|
|
@@ -342,6 +387,16 @@ const isSettled = ref([
|
|
|
value: "0",
|
|
|
},
|
|
|
]);
|
|
|
+const isLoss = ref([
|
|
|
+ {
|
|
|
+ label: "亏",
|
|
|
+ value: "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "盈",
|
|
|
+ value: "0",
|
|
|
+ },
|
|
|
+]);
|
|
|
const selectConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
@@ -354,6 +409,11 @@ const selectConfig = computed(() => {
|
|
|
prop: "isSettled",
|
|
|
data: isSettled.value,
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "盈亏",
|
|
|
+ prop: "isLoss",
|
|
|
+ data: isLoss.value,
|
|
|
+ },
|
|
|
];
|
|
|
});
|
|
|
const config = computed(() => {
|
|
@@ -517,7 +577,15 @@ const getList = async (req) => {
|
|
|
proxy
|
|
|
.post("/contract/getProfitBudgetPage", sourceList.value.pagination)
|
|
|
.then((res) => {
|
|
|
- sourceList.value.data = res.rows;
|
|
|
+ sourceList.value.data = res.rows.map((x) => {
|
|
|
+ return {
|
|
|
+ ...x,
|
|
|
+ grossProfitInfoListOne: x.grossProfitInfoList.slice(
|
|
|
+ 1,
|
|
|
+ x.grossProfitInfoList.length
|
|
|
+ ),
|
|
|
+ };
|
|
|
+ });
|
|
|
sourceList.value.pagination.total = res.total;
|
|
|
setTimeout(() => {
|
|
|
loading.value = false;
|
|
@@ -926,9 +994,12 @@ const optionTwo = reactive({
|
|
|
${params[0].seriesName}:${params[0].data}
|
|
|
<br/> 销售合同金额:${
|
|
|
showRowData.value.grossProfitInfoList[params[0].dataIndex + 1]
|
|
|
+ .contractCurrency
|
|
|
+ } ${
|
|
|
+ showRowData.value.grossProfitInfoList[params[0].dataIndex + 1]
|
|
|
.contractAmount
|
|
|
}
|
|
|
- <br/> 采购合同金额:${
|
|
|
+ <br/> 采购合同金额:CNY ${
|
|
|
showRowData.value.grossProfitInfoList[params[0].dataIndex + 1]
|
|
|
.purchaseAmount
|
|
|
}`;
|
|
@@ -982,6 +1053,47 @@ const showEcharts = (row, index) => {
|
|
|
myChart.setOption(optionTwo.data);
|
|
|
myChart.resize();
|
|
|
};
|
|
|
+
|
|
|
+const openDetails = (row) => {
|
|
|
+ proxy.$router.push({
|
|
|
+ name: "contractDetails",
|
|
|
+ query: {
|
|
|
+ currentContractId: row.contractId,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const changeStyle = ({ row }) => {
|
|
|
+ if (row.gross < 0) {
|
|
|
+ return {
|
|
|
+ color: "#f54a45",
|
|
|
+ };
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const getIsTop = (data, sonRow, att) => {
|
|
|
+ // 上一行
|
|
|
+ const row1 = data[sonRow.$index - 1];
|
|
|
+ // 当前行
|
|
|
+ const row2 = sonRow.row;
|
|
|
+ if (Number(row1[att]) == Number(row2[att])) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const getColor = (data, sonRow, att) => {
|
|
|
+ // 上一行
|
|
|
+ const row1 = data[sonRow.$index - 1];
|
|
|
+ // 当前行
|
|
|
+ const row2 = sonRow.row;
|
|
|
+ if (Number(row2[att]) > Number(row1[att])) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|