123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520 |
- <template>
- <div>
- <basicDetails
- ref="details"
- :titleText="mainData.enterprisename"
- formPath="salerPrivatecustomer"
- :editData="mainData"
- :mainAreaData="mainAreaData"
- turnPageId="20221012164402"
- idname="sa_customersid"
- tags=""
- typeTask="我的客户"
- :tabs="[
- '详细信息',
- '联系人',
- '客户地址',
- '开票信息',
- '项目商机',
- '报价单',
- '关联合同',
- '账户余额',
- '银行卡信息',
- '关联线索',
- ]"
- @pageChange="pageChange"
- @onEditSuccess="onEditSuccess"
- @logSuccess="queryMainData"
- @sysTag="sysTag"
- >
- <div slot="tags">
- <!-- 使用此插槽可不传[tags] -->
- <!-- :tabs="['经销商团队','代理区域','营销类别','账户余额']" -->
- <!-- <tagPanl slot="tags" :data="tags" :id="mainData.sa_customersid" @onSuccess="queryMainData"/>-->
- </div>
- <div slot="customOperationBef">
- <commissionSet
- class="inline-16"
- v-if="tool.checkAuth($route.name, 'commissionSet')"
- ownertable="sa_customers"
- @setSuccess="queryMainData"
- :data="mainData"
- ></commissionSet>
- </div>
- <div slot="customOperation">
- <!-- 此区域提供了自定义操作按钮 -->
- <el-button
- class="inline-16"
- type="primary"
- size="mini"
- @click="portraitShowFun"
- >{{ $t("360°画像") }}</el-button
- >
- <!-- <mindmap class="inline-16" ref="mindmap" :id="this.$route.query.id" name="custom"></mindmap> -->
- <statusChange
- class="inline-16"
- v-if="tool.checkAuth($route.name, 'statusChange')"
- :disabled="mainData.disabled"
- :id="mainData.sa_customersid"
- @statusChangeSuccess="statusChangeSuccess"
- ></statusChange>
- <share
- class="inline-16"
- v-if="
- tool.checkAuth($route.name, 'share') &&
- mainData.sourcepoolname === ''
- "
- :disabled="mainData.disabled"
- :id="mainData.sa_customersid"
- @onshow="onSuccess"
- @shareSuccess="onSuccess"
- ></share>
- <toBack
- class="inline-16"
- v-if="
- tool.checkAuth($route.name, 'back') &&
- mainData.sa_customerpoolid_source !== 0
- "
- :disabled="mainData.disabled"
- :data="mainData"
- @backSuccess="onSuccess"
- ></toBack>
- <duplicatesCustomer
- class="inline-16"
- v-if="tool.checkAuth($route.name, 'queryDuplicates')"
- :data="mainData"
- @onSuccessTag="onSuccessTag"
- ></duplicatesCustomer>
- <confirmSelection class="inline-16" content="暂缓的客户将不计入客户相关数据统计,是否确定暂缓该客户" btn-title="暂缓" btn-type="primary" confirm-button-text="确定暂缓" cancel-button-text="取消"
- paramId="20221010164602" @onSuccess="queryMainData();$refs.details.$refs.tag.queryTag();$refs.baseDetail.basicData()" v-if="tool.checkAuth($route.name,'putOff') && mainData.status != '暂缓' && mainData.disabled"
- ></confirmSelection>
- <confirmSelection class="inline-16" content="是否确定取消暂缓并继续跟进客户" btn-title="取消暂缓" btn-type="primary" confirm-button-text="取消暂缓" cancel-button-text="关闭"
- paramId="20221010164602" @onSuccess="queryMainData();$refs.details.$refs.tag.queryTag();$refs.baseDetail.basicData()" v-if="tool.checkAuth($route.name,'putOff') && mainData.status == '暂缓' && mainData.disabled"
- ></confirmSelection>
- <to_void
- class="inline-16"
- v-if="tool.checkAuth($route.name, 'toVoid')"
- :id="mainData.sa_customersid"
- :disabled="mainData.disabled"
- :data="mainData"
- @onshow="onSuccess"
- @toVoidSuccess="onSuccess"
- ></to_void>
- <recovery
- class="inline-16"
- v-if="
- tool.checkAuth($route.name, 'recovery') &&
- mainData.sa_customerpoolid_source !== 0
- "
- :data="mainData"
- @onshow="onSuccess"
- @backSuccess="onSuccess"
- ></recovery>
- </div>
- <div slot="slot0">
- <detailed
- :data="mainData"
- v-if="Object.keys(mainData).length > 1"
- ref="baseDetail"
- ></detailed>
- </div>
- <div slot="slot1" class="normal-panel">
- <contacts
- :data="mainData"
- ref="contactsRef"
- @onSuccess="onSuccess"
- v-if="flag"
- ></contacts>
- </div>
- <div slot="slot2" class="normal-panel">
- <address_manage :data="mainData" v-if="flag"></address_manage>
- </div>
- <div slot="slot3" class="normal-panel">
- <financial :mainData="mainData" v-if="flag"></financial>
- </div>
- <div slot="slot4" class="normal-panel">
- <projectChange :data="mainData" v-if="flag"></projectChange>
- </div>
- <div slot="slot5" class="normal-panel">
- <quotedPrice :data="mainData" v-if="flag"></quotedPrice>
- </div>
- <div slot="slot6" class="normal-panel">
- <contract :data="mainData" v-if="flag"></contract>
- </div>
- <div slot="slot7" class="normal-panel">
- <accountMoney :data="mainData" v-if="flag"></accountMoney>
- </div>
- <div slot="slot8" class="normal-panel">
- <bankCard :data="mainData" v-if="flag"></bankCard>
- </div>
- <div slot="slot9" class="normal-panel">
- <followLeads :data="mainData" v-if="flag"></followLeads>
- </div>
- </basicDetails>
- <PortraitDetail
- ref="PortraitDetail"
- v-if="PortraitShow"
- :data="mainData"
- ></PortraitDetail>
- </div>
- </template>
- <script>
- import detailed from "./modules/detailedData";
- import contacts from "./modules/contacts/list";
- import address_manage from "./modules/addressManage/list";
- import transactionUser from "./modules/operation/transactionUser";
- import lock from "./modules/operation/lock";
- import unlock from "./modules/operation/unlock";
- import share from "./modules/operation/share";
- import send_back from "./modules/operation/sendBack";
- import to_void from "./modules/operation/toVoid";
- import transaction_status from "./modules/operation/transactionStatus";
- import statusChange from "./modules/operation/statusChange";
- import recovery from "./modules/operation/recovery";
- import financial from "./modules/financialInfo/index.vue";
- import projectChange from "./modules/projectChange/list";
- import quotedPrice from "./modules/quotedPrice/list";
- import followLeads from "./modules/followLeads/index";
- import toBack from "@/SDrpManagement/salerPrivatecustomer/detail/modules/operation/toBack";
- import contract from "./modules/contract/index";
- import accountMoney from "./modules/accountMoney/index";
- import bankCard from "./modules/bankCard/index";
- import duplicatesCustomer from "@/components/duplicatesData/duplicatesCustomer";
- import mindmap from "@/components/mindmap/index.vue";
- import PortraitDetail from "@/HDrpManagement/customerPortrait/modules/detail.vue";
- import commissionSet from "@/components/commissionSetNew/index.vue";
- export default {
- name: "detail",
- data() {
- return {
- mainData: {
- disabled: false,
- },
- mainAreaData: [],
- userInfo: JSON.parse(window.sessionStorage.getItem("active_account")),
- tags: {},
- visible: false,
- dialogFormVisible: false,
- dialogFormLeader: false,
- form: {
- status: "",
- userid: "",
- },
- users: [],
- flag: false,
- disabled: false,
- tagFlag: false,
- PortraitShow: false,
- };
- },
- components: {
- detailed,
- contacts,
- address_manage,
- transactionUser,
- lock,
- unlock,
- share,
- send_back,
- to_void,
- transaction_status,
- recovery,
- financial,
- projectChange,
- quotedPrice,
- followLeads,
- statusChange,
- toBack,
- contract,
- accountMoney,
- bankCard,
- duplicatesCustomer,
- mindmap,
- PortraitDetail,
- commissionSet,
- },
- watch: {
- /*$route (val) {
- if (val.path == '/customerDetail') {
- console.log(val,'rouer111')
- /!* this.getFileList()
- this.$refs.add.dialogVisible = false*!/
- }
- },*/
- async mainData(val) {
- const res = await this.$api.requested({
- id: 20220930103501,
- content: {
- ownertable: "sa_customers",
- ownerid: this.$route.query.id,
- },
- });
- const agent = await this.$api.requested({
- id: 20230329122604,
- content: {
- ownertable: "sa_customers",
- ownerid: this.$route.query.id,
- },
- });
- if (this.mainData.leader.length !== 0) {
- if (
- JSON.parse(window.sessionStorage.getItem("active_account")).userid ===
- this.mainData.leader[0].userid
- ) {
- /*是负责人*/
- this.mainData.disabled = true;
- } else {
- let flag = 0;
- for (var i = 0; i < res.data[0].team.length; i++) {
- if (
- res.data[0].team[i].userid ===
- JSON.parse(window.sessionStorage.getItem("active_account")).userid
- ) {
- if (res.data[0].team[i].editable === 1) {
- this.mainData.disabled = true;
- flag = 1;
- break;
- } else {
- flag = 0;
- break;
- }
- }
- }
- /*不是负责人*/
- flag === 0
- ? agent.data.editable === 0
- ? (this.mainData.disabled = false)
- : (this.mainData.disabled = true)
- : (this.mainData.disabled = true);
- this.$refs.details.$refs.group.editdataleader =
- agent.data.editdataleader;
- }
- }
- console.log("权限结果", this.mainData.disabled);
- },
- },
- methods: {
- goPortrait() {
- let model;
- let id = this.$route.query.id;
- JSON.parse(sessionStorage.getItem("module_info")).forEach((item1) => {
- item1.modules.forEach((item2) => {
- item2.apps.forEach((item3) => {
- if (item3.systemappid == 259) {
- model = item3;
- return;
- }
- });
- });
- });
- sessionStorage.setItem("active_modules", JSON.stringify(model));
- this.$store.dispatch("changeDetailDrawer", false);
- this.$router.push("/customerportrait");
- setTimeout(() => {
- this.$router.push({
- path: "/customerportrait",
- query: {
- id: id,
- isTrue: 1,
- },
- });
- }, 1000);
- },
- async queryMainData() {
- const res = await this.$api.requested({
- id: 20221012164302,
- content: {
- sa_customersid: this.$route.query.id,
- },
- });
- /* this.mainData = res.data*/
- this.mainData = Object.assign({}, this.mainData, res.data);
- /*if (this.mainData.reward_point){
- let point = ''
- for (var i = 0;i< this.mainData.reward_point.length;i++){
- if (i === this.mainData.reward_point.length -1){
- point = point + this.mainData.reward_point[i]
- }else {
- point = point + this.mainData.reward_point[i] + ','
- }
- }
- this.mainData.reward_point = point
- }*/
- this.$refs["details"].param.content.type = this.$route.query.tabIndex;
- this.$refs["details"].param.content.isExport = false;
- this.changeDataStructure();
- this.flag = true;
- },
- show() {
- this.visible = false;
- },
- portraitShowFun() {
- this.PortraitShow = true;
- this.$nextTick(() => {
- this.$refs.PortraitDetail.dialogFormVisible = true;
- });
- },
- changeDataStructure() {
- let that = this;
- this.mainAreaData = [
- {
- label: "客户编号",
- value: this.mainData.sa_customersid,
- },
- {
- label: "erp编号",
- value: this.mainData.erpagentnum,
- },
- {
- label: "客户名称",
- value: this.mainData.enterprisename,
- },
- {
- label: "客户类型",
- value: this.mainData.type,
- },
- {
- label: "客户等级",
- value: this.mainData.grade === 0 ? "" : this.mainData.grade,
- },
- {
- label: "客户分类",
- value: this.mainData.customergrade,
- },
- {
- label: "成交状态",
- value: this.$t(this.mainData.tradingstatus),
- style: function () {
- let style = {};
- switch (that.mainData.tradingstatus) {
- case "已成交":
- style = { color: "#3874f6" };
- break;
- case "未成交":
- style = { color: "#e6a23c" };
- break;
- case "多次成交":
- style = { color: "#e6a23c" };
- break;
- default:
- break;
- }
- return style;
- },
- },
- {
- label: "合作状态",
- value: this.$t(this.mainData.status),
- style: function () {
- let style = {};
- switch (that.mainData.status) {
- case "潜在":
- style = { color: "#3874f6" };
- break;
- case "合作中":
- style = { color: "#67c23a" };
- break;
- case "暂缓":
- style = { color: "#e6a23c" };
- break;
- case "暂缓":
- style = { color: "#d90a0a" };
- break;
- case "已终止":
- style = { color: "#f56c6c" };
- break;
- default:
- break;
- }
- return style;
- },
- },
- {
- label: "来源公海",
- value: this.mainData.sourcepoolname,
- },
- {
- label: "负责人",
- value: this.mainData.leader
- ? this.mainData.leader.length
- ? this.mainData.leader[0].name
- : "--"
- : "--",
- },
- {
- label: "部门",
- value: this.mainData.leader
- ? this.mainData.leader.length
- ? this.mainData.leader[0].depname
- : "--"
- : "--",
- },
- {
- label: "归属经销商",
- value: this.mainData.agentname,
- },
- {
- label: "营销费用",
- value:
- "¥ " + this.tool.formatAmount(this.mainData.salesfeesamount, 2),
- },
- ];
- if (
- this.$route.query.portrait == "1" ||
- this.$route.query.portrait == "ht" ||
- this.$route.query.portrait == "xm" ||
- this.$route.query.portrait == "dd" ||
- this.$route.query.portrait == "fw"
- ) {
- this.$refs.mindmap.onShow();
- }
- },
- // 监听切换数据,上一页,下一页
- pageChange(id, rowindex, tabIndex) {
- console.log("翻页");
- this.flag = false;
- /* tabIndex = this.$route.query.tabIndex*/
- /* this.$router.replace({path:'/customerDetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex,portrait:''}})*/
- this.queryMainData(id);
- },
- onSuccess() {
- this.visible = false;
- this.queryMainData(this.$route.query.id);
- this.$emit("onSuccess");
- },
- statusChangeSuccess() {
- /* this.$refs.details.refreshTag()
- this.$refs.baseDetail.basicData()
- this.$refs.baseDetail.systemData()*/
- this.flag = false;
- this.queryMainData();
- },
- onEditSuccess() {
- this.flag = false;
- this.queryMainData();
- },
- sysTag(val) {
- this.tagFlag = false;
- for (let i = 0; i < val.length; i++) {
- if (val[i] == "疑似重复") {
- this.tagFlag = true;
- break;
- }
- }
- },
- onSuccessTag() {
- this.$refs.details.$refs.tag.queryTag();
- },
- },
- mounted() {},
- created() {
- this.queryMainData(this.$route.query.id);
- },
- };
- </script>
- <style scoped>
- </style>
|