From af2b318da9d4c51b5b8afb2f4cefe86ff049bc7c Mon Sep 17 00:00:00 2001 From: songshankun <songshankun@foxmail.com> Date: 星期二, 17 十月 2023 21:16:45 +0800 Subject: [PATCH] feat: 添加缺失的请求 --- src/views/client/salesLead/DetailSalesLead.vue | 165 ++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 110 insertions(+), 55 deletions(-) diff --git a/src/views/client/salesLead/DetailSalesLead.vue b/src/views/client/salesLead/DetailSalesLead.vue index b5b4d88..ac32fcb 100644 --- a/src/views/client/salesLead/DetailSalesLead.vue +++ b/src/views/client/salesLead/DetailSalesLead.vue @@ -3,7 +3,7 @@ <el-drawer :visible.sync="detailConfig.visible" size="80%" :before-close="handleClose" :wrapperClosable="false"> <template slot="title"> <div class="header"> - <span class="header-label">瀹㈡埛鍚嶇О</span> + <span class="header-label">閿�鍞嚎绱�</span> <span class="header-title">{{ detailConfig.infomation.name }}</span> </div> </template> @@ -31,11 +31,11 @@ <li v-for="(item, i) in basicInfoList" :key="i"> <div class="left"> <div class="content-title">{{ item.leftStr + "锛�" }}</div> - <div class="content-data">{{ item.leftValue }}</div> + <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div> </div> - <div class="right"> - <div class="content-title">{{ item.rightStr }}</div> - <div class="content-data">{{ item.rightValue }}</div> + <div v-if="item.rightStr && item.rightStr.length > 0" class="right"> + <div class="content-title">{{ item.rightStr + "锛�" }}</div> + <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div> </div> </li> </ul> @@ -53,14 +53,18 @@ <li v-for="(item, i) in dynamicInfoList" :key="i"> <div class="left"> <div class="content-title">{{ item.leftStr + "锛�" }}</div> - <div class="content-data">{{ item.leftValue }}</div> + <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div> </div> - <div class="right"> - <div class="content-title">{{ item.rightStr }}</div> - <div class="content-data">{{ item.rightValue }}</div> + <div v-if="item.rightStr && item.rightStr.length > 0" class="right"> + <div class="content-title">{{ item.rightStr + "锛�" }}</div> + <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div> </div> </li> </ul> + <div class="business_scope"> + <div class="content-title">{{ "鏈�鏂拌繘灞曪細" }}</div> + <div class="content-data">{{ record ? record : "--" }}</div> + </div> </div> </div> <!-- 鍦板潃淇℃伅 --> @@ -75,11 +79,11 @@ <li v-for="(item, i) in addressInfoList" :key="i"> <div class="left"> <div class="content-title">{{ item.leftStr + "锛�" }}</div> - <div class="content-data">{{ item.leftValue }}</div> + <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div> </div> - <div class="right"> - <div class="content-title">{{ item.rightStr }}</div> - <div class="content-data">{{ item.rightValue }}</div> + <div v-if="item.rightStr && item.rightStr.length > 0" class="right"> + <div class="content-title">{{ item.rightStr + "锛�" }}</div> + <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div> </div> </li> </ul> @@ -97,7 +101,7 @@ <li> <div class="left remark"> <div class="content-title">{{ "澶囨敞锛�" }}</div> - <div class="content-data">{{ "澶囨敞鍐呭" }}</div> + <div class="content-data">{{ detailConfig.infomation.desc }}</div> </div> </li> </ul> @@ -105,7 +109,11 @@ </div> </div> <div v-if="activeName === 'second'" class="second"> - <FollowupRecords :isDetail="true" /> + <FollowupRecords + :isDetail="true" + :follow-record="detailConfig.infomation.FollowRecord" + :add-config="addConfig" + /> </div> </div> </el-drawer> @@ -140,89 +148,103 @@ isAddressExpand: true, // 鍦板潃淇℃伅 addressInfoList: [], isRemarkExpand: true, // 澶囨敞淇℃伅 - remarkInfoList: [] + remarkInfoList: [], + addConfig: {}, + record: "", // 鏈�鏂拌繘灞� + noContactDays: 0, + newContactDays: "" } }, created() { - this.setData() + this.setData(this.detailConfig.infomation) + this.addConfig = { + id_name: "sales_leads_id", + id: this.detailConfig.infomation.id, + common_name: this.detailConfig.infomation.id, + sales_leads_name: this.detailConfig.infomation.name, + sales_leads_id: this.detailConfig.infomation.id + } }, mounted() {}, methods: { - setData() { + setData(item) { + if (item.FollowRecord && item.FollowRecord.length > 0) { + this.record = item.FollowRecord[0].record + console.log(item.FollowRecord[0].follow_time) + if (item.FollowRecord[0].follow_time && item.FollowRecord[0].follow_time.length > 0) { + let follow_time = item.FollowRecord[0].follow_time + this.newContactDays = follow_time.substring(0, 10) + this.noContactDays = this.getDiffDay(Date.now(), this.newContactDays) + } + } this.basicInfoList = [ { - leftStr: "瀹㈡埛鍚嶇О", - leftValue: this.detailConfig.infomation.name, + leftStr: "鎰忓悜瀹㈡埛鍚嶇О", + leftValue: item.name, rightStr: "閿�鍞嚎绱㈢紪鍙�", - rightValue: this.detailConfig.infomation.number + rightValue: item.number }, { leftStr: "鑱旂郴浜哄鍚�", - leftValue: this.detailConfig.infomation.contact_name, + leftValue: item.contact_name, rightStr: "鑱旂郴浜鸿亴鍔�", - rightValue: this.detailConfig.infomation.contact_position + rightValue: item.contact_position }, { leftStr: "鎵嬫満鍙风爜", - leftValue: this.detailConfig.infomation.contact_phone, - rightStr: "鍟嗘満鐘舵��", + leftValue: item.contact_phone, + rightStr: "绾跨储鐘舵��", rightValue: "鏂板缓" }, { - leftStr: "鍟嗘満鏉ユ簮", - leftValue: this.detailConfig.infomation.sales_sources_id, + leftStr: "绾跨储鏉ユ簮", + leftValue: item.sales_resources, rightStr: "璐熻矗浜�", - rightValue: this.detailConfig.infomation.member_id + rightValue: item.member_name }, { leftStr: "鍒嗛厤鏃ユ湡", leftValue: "", - rightStr: "鍏捣鐘舵��", + // rightStr: "鍏捣鐘舵��", + // rightValue: "" + rightStr: "鍒涘缓鏃堕棿", rightValue: "" }, { - leftStr: "鍒涘缓鏃堕棿", + // leftStr: "鍒涘缓鏃堕棿", + // leftValue: "", + // rightStr: "鍒涘缓浜�", + // rightValue: "" + leftStr: "鍒涘缓浜�", leftValue: "", - rightStr: "鍒涘缓浜�", + rightStr: "", rightValue: "" }, - { - leftStr: "鍏抽棴鍘熷洜", - leftValue: "", - rightStr: "绛惧埌", - rightValue: "" - } + // { + // leftStr: "鍏抽棴鍘熷洜", + // leftValue: "", + // rightStr: "", + // rightValue: "" + // } ] this.dynamicInfoList = [ { leftStr: "鏈仈绯诲ぉ鏁�", - leftValue: "", - rightStr: "鏈�鏂版帹杩涙椂闂�", - rightValue: "" - }, - { - leftStr: "鏈�鏂拌繘灞�", - leftValue: "", + leftValue: this.noContactDays, rightStr: "鏈�鏂拌仈绯绘棩鏈�", - rightValue: "" + rightValue: this.newContactDays } ] this.addressInfoList = [ { leftStr: "鍥藉", - leftValue: "", + leftValue: "涓浗", rightStr: "鐪佷唤", - rightValue: "" + rightValue: item.Province.name }, { leftStr: "鍩庡競", - leftValue: "", - rightStr: "鍖哄煙", - rightValue: "" - }, - { - leftStr: "鍦板潃", - leftValue: "", + leftValue: item.City.name, rightStr: "", rightValue: "" } @@ -244,7 +266,22 @@ this.isDynamicExpand = !this.isDynamicExpand } else if (value === "address") { this.isAddressExpand = !this.isAddressExpand + } else if (value === "remark") { + this.isRemarkExpand = !this.isRemarkExpand } + }, + // 璁$畻涓や釜鏃ユ湡涔嬮棿鐨勫樊鍊� + getDiffDay(date_1, date_2) { + let totalDays, diffDate + let myDate_1 = date_1 + let myDate_2 = Date.parse(date_2) + // 灏嗕袱涓棩鏈熼兘杞崲涓烘绉掓牸寮忥紝鐒跺悗鍋氬樊 + diffDate = Math.abs(myDate_1 - myDate_2) // 鍙栫浉宸绉掓暟鐨勭粷瀵瑰�� + + totalDays = Math.floor(diffDate / (1000 * 3600 * 24)) // 鍚戜笅鍙栨暣 + // console.log(totalDays) + + return totalDays // 鐩稿樊鐨勫ぉ鏁� } } } @@ -313,7 +350,7 @@ align-items: center; height: 40px; .content-title { - width: 220px; + width: 320px; text-align: right; color: #555; } @@ -327,6 +364,24 @@ width: 100%; } } + .business_scope { + display: flex; + align-items: center; + font-size: 14px; + min-height: 40px; + .content-title { + width: 320px; + text-align: right; + color: #555; + } + .content-data { + flex: 1; + padding: 5px; + text-align: left; + margin-left: 25px; + color: #333; + } + } } } } -- Gitblit v1.8.0