|
@@ -1,22 +1,52 @@
|
|
|
<template>
|
|
|
<div v-loading="loading" class="progress">
|
|
|
<el-timeline reverse>
|
|
|
- <el-timeline-item v-for="(item, index) in progressList" :key="index" color="#0084FF" placement="top" hide-timestamp>
|
|
|
+ <el-timeline-item
|
|
|
+ v-for="(item, index) in progressList"
|
|
|
+ :key="index"
|
|
|
+ color="#0084FF"
|
|
|
+ placement="top"
|
|
|
+ hide-timestamp
|
|
|
+ >
|
|
|
<div class="details" :style="getColor(item.type)">
|
|
|
<div class="t">{{ getTitle(item.type) }}</div>
|
|
|
<div class="content11" v-if="item.type != 30">
|
|
|
<span class="gray">跟进摘要: </span>
|
|
|
- <span class="val"> {{ getContent(item) }} </span>
|
|
|
+ <span class="val">
|
|
|
+ <!-- {{ getContent(item) }} -->
|
|
|
+ <span v-if="item.type === 10">报价单总金额</span>
|
|
|
+ <span v-if="item.type === 20">合同总金额</span>
|
|
|
+ <span>{{ moneyFormat(item.amount, 2) }}</span>
|
|
|
+ <span
|
|
|
+ v-if="item.type === 10 && item.code"
|
|
|
+ :class="{ 'code-class': isHave }"
|
|
|
+ @click="isHaveOne ? handlePushRoute(item) : () => {}"
|
|
|
+ >({{ item.code }})</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ v-if="item.type === 20 && item.contractCode"
|
|
|
+ :class="{ 'code-class': isHaveOne }"
|
|
|
+ @click="isHave ? handlePushRoute(item) : () => {}"
|
|
|
+ >({{ item.contractCode }})</span
|
|
|
+ >
|
|
|
+ </span>
|
|
|
</div>
|
|
|
<div class="content11" v-else>
|
|
|
<span class="gray">跟进记录: </span>
|
|
|
<span class="val"> {{ item.remark }} </span>
|
|
|
</div>
|
|
|
- <div style="margin: 8px 0; display: flex" v-if="item.fileList && item.fileList.length > 0">
|
|
|
+ <div
|
|
|
+ style="margin: 8px 0; display: flex"
|
|
|
+ v-if="item.fileList && item.fileList.length > 0"
|
|
|
+ >
|
|
|
<div style="width: 36px; color: #999999">附件:</div>
|
|
|
<div style="width: calc(100% - 36px)">
|
|
|
<div v-for="(file, index) in item.fileList" :key="index">
|
|
|
- <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
|
|
|
+ <a
|
|
|
+ style="color: #409eff; cursor: pointer"
|
|
|
+ @click="openFile(file.fileUrl)"
|
|
|
+ >{{ file.fileName }}</a
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -28,6 +58,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+import useUserStore from "@/store/modules/user";
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
customerId: {
|
|
|
type: String,
|
|
@@ -36,21 +68,49 @@ const props = defineProps({
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const loading = ref(false);
|
|
|
const progressList = ref([]);
|
|
|
+// 判断当前用户有无销售合同页面权限
|
|
|
+const isHave = ref(false);
|
|
|
+if (
|
|
|
+ useUserStore().permissions &&
|
|
|
+ useUserStore().permissions.includes("contract")
|
|
|
+) {
|
|
|
+ isHave.value = true;
|
|
|
+}
|
|
|
+// 判断当前用户有无报价单页面权限
|
|
|
+const isHaveOne = ref(false);
|
|
|
+if (
|
|
|
+ useUserStore().permissions &&
|
|
|
+ useUserStore().permissions.includes("priceSheet")
|
|
|
+) {
|
|
|
+ isHaveOne.value = true;
|
|
|
+}
|
|
|
+
|
|
|
const getData = () => {
|
|
|
loading.value = true;
|
|
|
- proxy.post("/saleQuotation/latestFollowUp", { id: props.customerId }).then((res) => {
|
|
|
- progressList.value = res.rows;
|
|
|
- if (res.rows && res.rows.length > 0 && res.rows.map((rows) => rows.id).length > 0) {
|
|
|
- proxy.post("/fileInfo/getList", { businessIdList: res.rows.map((rows) => rows.id) }).then((fileObj) => {
|
|
|
- for (let i = 0; i < res.rows.length; i++) {
|
|
|
- progressList.value[i].fileList = fileObj[progressList.value[i].id] || [];
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- setTimeout(() => {
|
|
|
- loading.value = false;
|
|
|
- }, 200);
|
|
|
- });
|
|
|
+ proxy
|
|
|
+ .post("/saleQuotation/latestFollowUp", { id: props.customerId })
|
|
|
+ .then((res) => {
|
|
|
+ progressList.value = res.rows;
|
|
|
+ if (
|
|
|
+ res.rows &&
|
|
|
+ res.rows.length > 0 &&
|
|
|
+ res.rows.map((rows) => rows.id).length > 0
|
|
|
+ ) {
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", {
|
|
|
+ businessIdList: res.rows.map((rows) => rows.id),
|
|
|
+ })
|
|
|
+ .then((fileObj) => {
|
|
|
+ for (let i = 0; i < res.rows.length; i++) {
|
|
|
+ progressList.value[i].fileList =
|
|
|
+ fileObj[progressList.value[i].id] || [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false;
|
|
|
+ }, 200);
|
|
|
+ });
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
if (props.customerId) {
|
|
@@ -74,7 +134,11 @@ const getContent = (item) => {
|
|
|
if (item.type === 10) {
|
|
|
return "报价单总金额 " + proxy.moneyFormat(item.amount, 2);
|
|
|
} else if (item.type === 20) {
|
|
|
- return "合同总金额 " + proxy.moneyFormat(item.amount, 2) + ` (${item.contractCode}) `;
|
|
|
+ return (
|
|
|
+ "合同总金额 " +
|
|
|
+ proxy.moneyFormat(item.amount, 2) +
|
|
|
+ ` (${item.contractCode}) `
|
|
|
+ );
|
|
|
}
|
|
|
};
|
|
|
const openFile = (path) => {
|
|
@@ -90,9 +154,31 @@ const getColor = (type) => {
|
|
|
};
|
|
|
return "background-color: " + obj[type];
|
|
|
};
|
|
|
+
|
|
|
+const handlePushRoute = (row) => {
|
|
|
+ if (row.type === 10) {
|
|
|
+ proxy.$router.push({
|
|
|
+ name: "PriceSheet",
|
|
|
+ query: {
|
|
|
+ code: row.code,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else if (row.type === 20) {
|
|
|
+ proxy.$router.push({
|
|
|
+ name: "Contract",
|
|
|
+ query: {
|
|
|
+ code: row.contractCode,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.code-class {
|
|
|
+ cursor: pointer;
|
|
|
+ color: #409eff;
|
|
|
+}
|
|
|
:deep(.el-timeline-item) {
|
|
|
padding-bottom: 10px;
|
|
|
}
|