Commit 69ceb835 authored by danfuman's avatar danfuman

修改

parent e967da69
......@@ -19,38 +19,38 @@
<el-form ref="queryForm" :model="searchParam" :inline="true" size="small">
<el-form-item>
<el-cascader ref="address1" :class="[`select-adaptive-${inputID1}`]" :options="addressList" :props="addressProps" v-model="address"
@change="iptAdaptive(inputID1,true)" placeholder="地区选择" collapse-tags style="width: 130px;" clearable></el-cascader>
@change="iptAdaptive(inputID1,true)" placeholder="地区选择" collapse-tags style="width: 130px;" clearable></el-cascader>
</el-form-item>
<el-form-item prop="companyNatures">
<el-select v-model="searchParam.companyNatures" :class="[`select-adaptive-${inputID2}`]" style="width: 130px;"
@change="iptAdaptive(inputID2,true)" multiple collapse-tags clearable class="form-content-width" placeholder="客户性质">
@change="iptAdaptive(inputID2,true)" multiple collapse-tags clearable class="form-content-width" placeholder="客户性质">
<el-option v-for="(item, index) in companyNaturelist" :key="index" :label="item.dictLabel" :value="item.dictValue" />
</el-select>
</el-form-item>
<el-form-item prop="isOn">
<el-select v-model="searchParam.isOn" :class="[`select-adaptive-${inputID3}`]" filterable clearable style="width: 130px;"
@change="iptAdaptive(inputID3)" class="form-content-width" placeholder="上市公司">
@change="iptAdaptive(inputID3)" class="form-content-width" placeholder="上市公司">
<el-option v-for="(item, index) in isMajorlist" :key="index" :label="item.dictLabel" :value="item.dictValue" />
</el-select>
</el-form-item>
<el-form-item prop="creditLevels">
<el-select v-model="searchParam.creditLevels" :class="[`select-adaptive-${inputID4}`]" style="width: 130px;"
@change="iptAdaptive(inputID4,true)" multiple collapse-tags clearable class="form-content-width" placeholder="资信评级">
@change="iptAdaptive(inputID4,true)" multiple collapse-tags clearable class="form-content-width" placeholder="资信评级">
<el-option v-for="(item, index) in creditLevellist" :key="index" :label="item.dictLabel" :value="item.dictValue" />
</el-select>
</el-form-item>
<el-form-item prop="companyName">
<div class="normal-search-container" :class="{'is-hover-search' : searchHoverStatus}" @mouseover="searchHover($event)"
@mouseleave="searchUnHover($event,form)">
@mouseleave="searchUnHover($event,form)">
<img src="@/assets/images/enterprise/enterprise-search-icon.svg" alt="">
<span v-show="!searchHoverStatus && !searchParam.companyName">搜索</span>
<el-input v-model="searchParam.companyName" placeholder="输入关键词查询" style="width:238px;" @focus="searchFocus($event)"
@blur="searchBlur($event)" @input="value => searchInput(value)" v-show="searchHoverStatus || searchParam.companyName"
@keydown.native.enter="handleSearch">
@blur="searchBlur($event)" @input="value => searchInput(value)" v-show="searchHoverStatus || searchParam.companyName"
@keydown.native.enter="handleSearch">
<template slot="suffix">
<transition mode="out-in" appear name="fade">
<img src="@/assets/images/enterprise/search-input-clear-icon.svg" alt=""
@click.stop="searchParam.companyName = '';handleSearch" v-show="showClearIcon">
@click.stop="searchParam.companyName = '';handleSearch" v-show="showClearIcon">
</transition>
</template>
</el-input>
......@@ -70,7 +70,7 @@
<skeleton v-if="isSkeleton"></skeleton>
<div class="table-item">
<el-table v-show="!isSkeleton&&tableData.total > 0" class="fixed-table" v-horizontal-scroll="'hover'" ref="thistables"
:data="tableData.rows" stripe border style="width: 100%">
:data="tableData.rows" stripe border style="width: 100%">
<el-table-column prop="index" label="序号" fixed="left" width="60">
<template slot-scope='scope'>
<span>{{ (searchParam.pageNum - 1) * searchParam.pageSize + scope.$index + 1 }}</span>
......@@ -83,11 +83,11 @@
<div class="ps3">
<el-tooltip class="item" effect="dark" content="写跟进" placement="top" transition="" :open-delay="450">
<div @click="toDetail(scope.row,'gjjl')"><img class="i" src="@/assets/images/project/edit_1.png"><img class="o"
src="@/assets/images/project/edit_11.png"></div>
src="@/assets/images/project/edit_11.png"></div>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="编辑信息" placement="top" transition="" :open-delay="450">
<div @click="toDetail(scope.row,'business')"><img class="i" src="@/assets/images/project/edit_2.png"><img class="o"
src="@/assets/images/project/edit_22.png"></div>
src="@/assets/images/project/edit_22.png"></div>
</el-tooltip>
</div>
</div>
......@@ -191,7 +191,7 @@
</div>
<div class="bottems" v-if="tableData.total>searchParam.pageSize">
<el-pagination background :page-size="searchParam.pageSize" :current-page="searchParam.pageNum" @current-change="handleCurrentChange"
layout="prev, pager, next" :total="tableData.total">
layout="prev, pager, next" :total="tableData.total">
</el-pagination>
</div>
</div>
......@@ -205,7 +205,7 @@
<el-input type="text" placeholder="请输入" v-model="queryParam.companyName" @input="getCompany(1)"></el-input>
<div class="resultlist infinite-list" v-if="showlist" id="box" v-infinite-scroll="load" style="overflow:auto">
<div class="infinite-list-item" v-for="(item,index) in companData" @click="selCompany(item)"><span v-html="item.name"
:key="companypage"></span></div>
:key="companypage"></span></div>
</div>
</el-form-item>
<el-form-item label="客户等级:" class="row">
......@@ -221,7 +221,7 @@
</el-form-item>
<el-form-item label="企业注册地:" class="row">
<el-cascader :props="props" @change="getAddr($event)" ref="address" v-model="queryParam.address" :options="addressList"
clearable></el-cascader>
clearable></el-cascader>
</el-form-item>
<el-form-item label="统一社会信用代码:" class="row">
<el-input type="text" placeholder="请输入" v-model="queryParam.creditCode"></el-input>
......@@ -240,914 +240,920 @@
</template>
<script>
import { getToken } from '@/utils/auth';
import '@/assets/styles/project.scss';
import { addCustomer, getCustomerList, importData } from '@/api/custom/custom';
import { getDictType, getEnterprise } from '@/api/main';
import prvinceTree from '@/assets/json/provinceTree';
import batchimport from '../../project/projectList/component/batchImport';
import skeleton from '../../project/projectList/component/skeleton';
import { encodeStr } from '@/assets/js/common';
import { v4 } from "uuid";
export default {
name: 'CustomList',
components: { batchimport, skeleton },
data() {
return {
encodeStr,
pldr: false,
types: 'custom',
searchParam: {
companyName: '',
pageNum: 1,
pageSize: 20
},
address: '',
props: { checkStrictly: true, expandTrigger: 'hover' },
dialogVisible: false,
textarea: "",
nowedit: -1,//当前正在编辑的文本
tipslit: [],//项目标签
tipsvalue: "",//标签填写内容
tableData: [],//列表
companData: [],//联想企业列表
addressProps: {
multiple: true,
expandTrigger: 'hover'
},
//上市公司
isMajorlist: [
{
dictValue: 0,
dictLabel: '否',
import { getToken } from '@/utils/auth';
import '@/assets/styles/project.scss';
import { addCustomer, getCustomerList, importData } from '@/api/custom/custom';
import { getDictType, getEnterprise } from '@/api/main';
import prvinceTree from '@/assets/json/provinceTree';
import batchimport from '../../project/projectList/component/batchImport';
import skeleton from '../../project/projectList/component/skeleton';
import { encodeStr } from '@/assets/js/common';
import { v4 } from "uuid";
export default {
name: 'CustomList',
components: { batchimport, skeleton },
data() {
return {
encodeStr,
pldr: false,
types: 'custom',
searchParam: {
companyName: '',
pageNum: 1,
pageSize: 20
},
{
dictValue: 1,
dictLabel: '是',
}
],
companyNaturelist: [], //客户性质
creditLevellist: [], //资信评级
customerLevel: [],//客户等级
addressList: [],//地区
//添加客户
queryParam: {
companyId: '',//jsk企业id
companyName: '',//客户名称(企业名称
customerLevel: '',//客户等级
legalPerson: '',//法定代表人
registerCapital: '',//注册资本
registerAddress: '',//企业注册地址
creditCode: '',//社会统一信用代码
address: '',//选择的地址
provinceId: '',
cityId: '',
districtId: '',
},
rules: {
companyName: [{ required: true, message: '请输入非空格字符!', trigger: 'blur' },]
},
//批量导入
action: process.env.VUE_APP_BASE_API + "/customer/importData",
fileList: [],
headers: {
Authorization: "Bearer " + getToken(),
},
// isNew:true,
showlist: false,
keys: 1,
isSkeleton: true,
companypage: 1,
isscroll: false,
inputID1: this.getUid(),
inputID2: this.getUid(),
inputID3: this.getUid(),
inputID4: this.getUid(),
showSearchBox: false,
searchHoverStatus: false,
showClearIcon: false
};
},
created() {
if (this.$route.query.key) {
this.searchParam.companyName = this.$route.query.key;
}
if (this.$route.query.type === '1') {
this.searchParam.companyNatures = ['国有企业'];
}
if (this.$route.query.type === '2') {
this.searchParam.companyNatures = ['央企'];
}
if (this.$route.query.type === '3') {
this.searchParam.companyNatures = ['事业单位', '机关单位'];
}
this.$watch(() => this.$route.params, () => {
this.getCustomerList();
this.getDictType();
this.prvinceTree();
this.handleQuery();
this.searchParam.companyName = '';
},
// 组件创建完后获取数据,
// 此时 data 已经被 observed 了
{ immediate: true }
);
},
methods: {
searchFocus(event) {
const { target } = event;
if (target?.value?.length) {
this.showClearIcon = true;
}
},
searchBlur(event) {
this.showClearIcon = false;
},
searchInput(value) {
if (value?.length) {
this.showClearIcon = true;
}
},
searchHover(event) {
this.searchHoverStatus = true;
address: '',
props: { checkStrictly: true, expandTrigger: 'hover' },
dialogVisible: false,
textarea: "",
nowedit: -1,//当前正在编辑的文本
tipslit: [],//项目标签
tipsvalue: "",//标签填写内容
tableData: [],//列表
companData: [],//联想企业列表
addressProps: {
multiple: true,
expandTrigger: 'hover'
},
//上市公司
isMajorlist: [
{
dictValue: 0,
dictLabel: '否',
},
{
dictValue: 1,
dictLabel: '是',
}
],
companyNaturelist: [], //客户性质
creditLevellist: [], //资信评级
customerLevel: [],//客户等级
addressList: [],//地区
//添加客户
queryParam: {
companyId: '',//jsk企业id
companyName: '',//客户名称(企业名称
customerLevel: '',//客户等级
legalPerson: '',//法定代表人
registerCapital: '',//注册资本
registerAddress: '',//企业注册地址
creditCode: '',//社会统一信用代码
address: '',//选择的地址
provinceId: '',
cityId: '',
districtId: '',
},
rules: {
companyName: [{ required: true, message: '请输入非空格字符!', trigger: 'blur' },]
},
//批量导入
action: process.env.VUE_APP_BASE_API + "/customer/importData",
fileList: [],
headers: {
Authorization: "Bearer " + getToken(),
},
// isNew:true,
showlist: false,
keys: 1,
isSkeleton: true,
companypage: 1,
isscroll: false,
inputID1: this.getUid(),
inputID2: this.getUid(),
inputID3: this.getUid(),
inputID4: this.getUid(),
showSearchBox: false,
searchHoverStatus: false,
showClearIcon: false
};
},
searchUnHover(event) {
if (!this.searchParam.companyName) {
this.searchHoverStatus = false;
created() {
if (this.$route.query.key) {
this.searchParam.companyName = this.$route.query.key;
}
},
async handleQuery() {
let [type1, type2] = await Promise.all([
getDictType('company_nature_type'),
getDictType('credit_level_type'),
]);
if (type1.code == 200) {
type1.data.forEach(item => {
this.companyNaturelist.push({ dictLabel: item.dictLabel, dictValue: item.dictLabel });
});
if (this.$route.query.type === '1') {
this.searchParam.companyNatures = ['国有企业'];
}
if (type2.code == 200) {
type2.data.forEach(item => {
this.creditLevellist.push({ dictLabel: item.dictLabel, dictValue: item.dictLabel });
});
if (this.$route.query.type === '2') {
this.searchParam.companyNatures = ['央企'];
}
},
sq1(item, sq) {
this.$nextTick(() => {
item.sq1 = sq;
this.keys++;
});
},
sq2(item, sq) {
this.$nextTick(() => {
item.sq2 = sq;
this.keys++;
});
},
handleALL(event) {
var one = document.getElementById("box");
if (one) {
if (!one.contains(event.target)) {
this.showlist = false;
}
if (this.$route.query.type === '3') {
this.searchParam.companyNatures = ['事业单位', '机关单位'];
}
this.getCustomerList();
this.getDictType();
this.prvinceTree();
this.handleQuery();
this.searchParam.companyName = '';
// this.$watch(() => this.$route.params, () => {
// this.getCustomerList();
// this.getDictType();
// this.prvinceTree();
// this.handleQuery();
// this.searchParam.companyName = '';
// },
// // 组件创建完后获取数据,
// // 此时 data 已经被 observed 了
// { immediate: true }
// );
},
toct() {
this.dialogVisible = false;
this.$router.push({ path: '/macro/urban' });
},
getDictType() {
//获取客户等级
getDictType('customer_level_type').then(result => {
this.customerLevel = result.code == 200 ? result.data : [];
});
},
pldrs() {
this.pldr = true;
},
cancelimport() {
this.pldr = false;
},
//获取客户列表
getCustomerList() {
let params = this.searchParam;
if (this.address.length > 0) {
let arr = this.$refs.address1.getCheckedNodes();
let provinceCode = [], cityCode = [], countyCode = [];
for (var i in arr) {
if (arr[i].parent) {
if (!arr[i].parent.checked) {
arr[i].hasChildren && cityCode.push(arr[i].value);
!arr[i].hasChildren && countyCode.push(arr[i].value);
}
} else {
provinceCode.push(arr[i].value);
}
}
if (provinceCode.length > 0) {
params.provinceIds = provinceCode;
methods: {
searchFocus(event) {
const { target } = event;
if (target?.value?.length) {
this.showClearIcon = true;
}
if (cityCode.length > 0) {
params.cityIds = cityCode;
},
searchBlur(event) {
this.showClearIcon = false;
},
searchInput(value) {
if (value?.length) {
this.showClearIcon = true;
}
if (countyCode.length > 0) {
params.districtIds = countyCode;
},
searchHover(event) {
this.searchHoverStatus = true;
},
searchUnHover(event) {
if (!this.searchParam.companyName) {
this.searchHoverStatus = false;
}
} else {
if (params.provinceIds) {
delete params.provinceIds;
},
async handleQuery() {
let [type1, type2] = await Promise.all([
getDictType('company_nature_type'),
getDictType('credit_level_type'),
]);
if (type1.code == 200) {
type1.data.forEach(item => {
this.companyNaturelist.push({ dictLabel: item.dictLabel, dictValue: item.dictLabel });
});
}
if (params.cityIds) {
delete params.cityIds;
if (type2.code == 200) {
type2.data.forEach(item => {
this.creditLevellist.push({ dictLabel: item.dictLabel, dictValue: item.dictLabel });
});
console.log(this.creditLevellist)
}
if (params.districtIds) {
delete params.districtIds;
},
sq1(item, sq) {
this.$nextTick(() => {
item.sq1 = sq;
this.keys++;
});
},
sq2(item, sq) {
this.$nextTick(() => {
item.sq2 = sq;
this.keys++;
});
},
handleALL(event) {
var one = document.getElementById("box");
if (one) {
if (!one.contains(event.target)) {
this.showlist = false;
}
}
}
getCustomerList(params).then(result => {
this.isSkeleton = false;
this.tableData = result;
this.tableData.rows.forEach(item => {
item.registerCapital = item.registerCapital == null ? null : item.registerCapital.replace(/^\D*(\d*(?:\.\d{0,6})?).*$/g, '$1');
if (item.mainBusiness != "" && item.mainBusiness != null && item.mainBusiness.length > 84) {
item.mainBusiness1 = item.mainBusiness.substring(0, 81);
item.sq1 = true;
} else {
item.sq1 = false;
},
toct() {
this.dialogVisible = false;
this.$router.push({ path: '/macro/urban' });
},
getDictType() {
//获取客户等级
getDictType('customer_level_type').then(result => {
this.customerLevel = result.code == 200 ? result.data : [];
});
},
pldrs() {
this.pldr = true;
},
cancelimport() {
this.pldr = false;
},
//获取客户列表
getCustomerList() {
let params = this.searchParam;
if (this.address.length > 0) {
let arr = this.$refs.address1.getCheckedNodes();
let provinceCode = [], cityCode = [], countyCode = [];
for (var i in arr) {
if (arr[i].parent) {
if (!arr[i].parent.checked) {
arr[i].hasChildren && cityCode.push(arr[i].value);
!arr[i].hasChildren && countyCode.push(arr[i].value);
}
} else {
provinceCode.push(arr[i].value);
}
}
if (item.companyAttribute != "" && item.companyAttribute != null && item.companyAttribute.length > 84) {
item.companyAttribute1 = item.companyAttribute.substring(0, 81);
item.sq2 = true;
} else {
item.sq2 = false;
if (provinceCode.length > 0) {
params.provinceIds = provinceCode;
}
// console.log(item)
});
});
},
//跳转到客户详情
toDetail(row, type) {
let customerId = row.customerId;
let companyId = row.companyId;
let path = type;
// if(type == "" && companyId == null){
// path = 'business'
// }
this.$router.push({ path: '/enterprise/' + encodeStr(companyId), query: { customerId: customerId, path: path } });
},
handleSearch() {
this.$nextTick(() => {
this.searchParam.pageNum = 1;
this.getCustomerList();
});
},
clearname(value) {
if (value == "") {
this.handleCurrentChange(1);
}
},
//翻页
handleCurrentChange(val) {
this.isSkeleton = true;
this.pldr = false;
// this.isNew = false
this.searchParam.pageNum = val;
this.getCustomerList();
},
//打开新建窗口
opennew() {
this.dialogVisible = true;
},
getAddr(obj) {
if (obj.length == 0) {
this.queryParam.provinceId = '';
this.queryParam.cityId = '';
this.queryParam.districtId = '';
return false;
}
let labelString = this.$refs.address.getCheckedNodes()[0].pathLabels.join("-");
this.queryParam.registerAddress = labelString;
this.queryParam.provinceId = obj[0];
this.queryParam.cityId = obj.length >= 1 ? obj[1] : '';
this.queryParam.districtId = obj.length >= 2 ? obj[2] : '';
},
//获取建设库客户
getCompany(value) {
this.queryParam.companyId = null;
if (value == 1) {
this.companData = [];
this.companypage = 1;
}
if (this.queryParam.companyName.length >= 2) {
let param = {
keyword: this.queryParam.companyName,
page: {
limit: 20,
page: this.companypage
if (cityCode.length > 0) {
params.cityIds = cityCode;
}
if (countyCode.length > 0) {
params.districtIds = countyCode;
}
} else {
if (params.provinceIds) {
delete params.provinceIds;
}
};
getEnterprise(JSON.stringify(param)).then(result => {
if (result.code != 200) {
return false;
if (params.cityIds) {
delete params.cityIds;
}
if (result.data.list != null && result.data.list.length > 0) {
this.isscroll = true;
if (this.companData.length === 0) {
this.companData = result.data.list;
if (params.districtIds) {
delete params.districtIds;
}
}
getCustomerList(params).then(result => {
this.isSkeleton = false;
this.tableData = result;
this.tableData.rows.forEach(item => {
item.registerCapital = item.registerCapital == null ? null : item.registerCapital.replace(/^\D*(\d*(?:\.\d{0,6})?).*$/g, '$1');
if (item.mainBusiness != "" && item.mainBusiness != null && item.mainBusiness.length > 84) {
item.mainBusiness1 = item.mainBusiness.substring(0, 81);
item.sq1 = true;
} else {
let arr2 = result.data.list;
arr2.unshift(2, 0);
Array.prototype.splice.apply(this.companData, arr2);
item.sq1 = false;
}
if (this.companData.length === 0) {
this.showlist = false;
if (item.companyAttribute != "" && item.companyAttribute != null && item.companyAttribute.length > 84) {
item.companyAttribute1 = item.companyAttribute.substring(0, 81);
item.sq2 = true;
} else {
this.showlist = true;
item.sq2 = false;
}
this.companypage += 1;
} else {
this.isscroll = false;
}
// console.log(item)
});
});
}
},
load() {
if (this.isscroll) {
this.getCompany(2);
}
},
selCompany(item) {
this.queryParam.companyId = item.jskEid;
this.queryParam.companyName = item.name.replace(/<[^>]+>/g, '');
this.queryParam.legalPerson = item.legalPerson;
let registeredCapitalStr = "";
if (item.registeredCapitalStr == "0" || item.registeredCapitalStr == 0) {
registeredCapitalStr = '';
} else {
registeredCapitalStr = item.registeredCapitalStr;
}
this.queryParam.registerCapital = registeredCapitalStr;
this.queryParam.creditCode = item.creditCode;
this.queryParam.provinceId = item.provinceId;
this.queryParam.cityId = item.cityId;
this.queryParam.districtId = item.cityId;
let list = [];
if (item.provinceId != null && item.provinceId != "")
list.push(item.provinceId);
if (item.cityId != null && item.cityId != "")
list.push(item.cityId);
if (item.districtId != null && item.districtId != "")
list.push(item.districtId);
this.$nextTick(() => {
this.queryParam.address = list;
let _this = this;
setTimeout(function () {
if (_this.$refs.address) {
_this.queryParam.registerAddress = _this.$refs.address.getCheckedNodes()[0].pathLabels.join("-");
}
}, 1000);
});
this.showlist = false;
},
//添加客户
submitForm(formName) {
// if(this.queryParam.companyId=="" || this.queryParam.companyId == null){
// this.$message.error({message:'请选择企业!',showClose:true})
//
// return;
// }
this.$refs[formName].validate((valid) => {
if (valid) {
addCustomer(this.queryParam).then(result => {
if (result.code == 200) {
this.$message.success('添加成功!');
this.dialogVisible = false;
this.handleCurrentChange(1);
this.resetForm('ruleForm');
},
//跳转到客户详情
toDetail(row, type) {
let customerId = row.customerId;
let companyId = row.companyId;
let path = type;
// if(type == "" && companyId == null){
// path = 'business'
// }
this.$router.push({ path: '/enterprise/' + encodeStr(companyId), query: { customerId: customerId, path: path } });
},
handleSearch() {
this.$nextTick(() => {
this.searchParam.pageNum = 1;
this.getCustomerList();
});
},
clearname(value) {
if (value == "") {
this.handleCurrentChange(1);
}
},
//翻页
handleCurrentChange(val) {
this.isSkeleton = true;
this.pldr = false;
// this.isNew = false
this.searchParam.pageNum = val;
this.getCustomerList();
},
//打开新建窗口
opennew() {
this.dialogVisible = true;
},
getAddr(obj) {
if (obj.length == 0) {
this.queryParam.provinceId = '';
this.queryParam.cityId = '';
this.queryParam.districtId = '';
return false;
}
let labelString = this.$refs.address.getCheckedNodes()[0].pathLabels.join("-");
this.queryParam.registerAddress = labelString;
this.queryParam.provinceId = obj[0];
this.queryParam.cityId = obj.length >= 1 ? obj[1] : '';
this.queryParam.districtId = obj.length >= 2 ? obj[2] : '';
},
//获取建设库客户
getCompany(value) {
this.queryParam.companyId = null;
if (value == 1) {
this.companData = [];
this.companypage = 1;
}
if (this.queryParam.companyName.length >= 2) {
let param = {
keyword: this.queryParam.companyName,
page: {
limit: 20,
page: this.companypage
}
};
getEnterprise(JSON.stringify(param)).then(result => {
if (result.code != 200) {
return false;
}
if (result.data.list != null && result.data.list.length > 0) {
this.isscroll = true;
if (this.companData.length === 0) {
this.companData = result.data.list;
} else {
let arr2 = result.data.list;
arr2.unshift(2, 0);
Array.prototype.splice.apply(this.companData, arr2);
}
if (this.companData.length === 0) {
this.showlist = false;
} else {
this.showlist = true;
}
this.companypage += 1;
} else {
this.$message.error(result.msg);
this.isscroll = false;
}
});
} else {
}
});
},
resetForm(formName) {
this.queryParam = {
companyId: '',//jsk企业id
companyName: '',//客户名称(企业名称
customerLevel: '',//客户等级
legalPerson: '',//法定代表人
registerCapital: '',//注册资本
registerAddress: '',//企业注册地址
creditCode: '',//社会统一信用代码
address: '',//选择的地址
provinceId: '',
cityId: '',
districtId: '',
},
this.dialogVisible = false;
this.showlist = false;
},
load() {
if (this.isscroll) {
this.getCompany(2);
}
},
selCompany(item) {
this.queryParam.companyId = item.jskEid;
this.queryParam.companyName = item.name.replace(/<[^>]+>/g, '');
this.queryParam.legalPerson = item.legalPerson;
let registeredCapitalStr = "";
if (item.registeredCapitalStr == "0" || item.registeredCapitalStr == 0) {
registeredCapitalStr = '';
} else {
registeredCapitalStr = item.registeredCapitalStr;
}
this.queryParam.registerCapital = registeredCapitalStr;
this.queryParam.creditCode = item.creditCode;
this.queryParam.provinceId = item.provinceId;
this.queryParam.cityId = item.cityId;
this.queryParam.districtId = item.cityId;
//地区
async prvinceTree() {
// await axios.post("https://files.jiansheku.com/file/json/common/provinceTree.json", {}, {
// headers: {
// 'Content-Type': 'application/json'
// }
// }).then(res => {
// if (res.data.code == 200) {
// console.log(res.data.data)
// }
// })
// console.log(prvinceTree)
this.addressList = prvinceTree;
this.getadd(this.addressList);
},
//处理注册地数据
getadd(row) {
this.addrcallback(row, this.getadd);
},
addrcallback(row, callback) {
if (row) {
row.forEach(item => {
item.value = item.id;
callback && callback(item.children);
let list = [];
if (item.provinceId != null && item.provinceId != "")
list.push(item.provinceId);
if (item.cityId != null && item.cityId != "")
list.push(item.cityId);
if (item.districtId != null && item.districtId != "")
list.push(item.districtId);
this.$nextTick(() => {
this.queryParam.address = list;
let _this = this;
setTimeout(function () {
if (_this.$refs.address) {
_this.queryParam.registerAddress = _this.$refs.address.getCheckedNodes()[0].pathLabels.join("-");
}
}, 1000);
});
}
},
//输入数字
number(value) {
if (value == '')
this.queryParam.registerCapital = value;
else
this.queryParam.registerCapital = value.replace(/^\D*(\d*(?:\.\d{0,6})?).*$/g, '$1');//输入6位小数
},
iptAdaptive(uid, multiple = false) {
multiple ? this.multipleAdaptiveHandle(uid) : this.iptAdaptiveHandle(uid);
},
getUid() {
return v4();
},
// 多选处理
async multipleAdaptiveHandle(uid) {
try {
await this.$nextTick();
const dom = document.querySelector(`.select-adaptive-${uid}`);
const iptChild = dom.querySelector(".el-input__inner");
if (dom) {
const textContainer = document.createElement("span");
const textName = `text-${uid}`;
textContainer.classList.add(textName);
const selectChildren = dom.querySelectorAll(".el-tag");
if (selectChildren.length) {
let width = 0;
selectChildren.forEach(item => {
const text = item.textContent;
const itemInfo = window.getComputedStyle(item);
textContainer.style.setProperty("visibility", "hidden");
textContainer.style.setProperty("display", "inline-block");
textContainer.style.setProperty("font-size", "14px");
textContainer.style.setProperty("padding", itemInfo.padding);
textContainer.style.setProperty("box-sizing", "border-box");
textContainer.textContent = text;
document.body.append(textContainer);
width += textContainer.offsetWidth + parseInt(itemInfo.marginLeft) + parseInt(itemInfo.marginRight);
textContainer.remove();
this.showlist = false;
},
//添加客户
submitForm(formName) {
// if(this.queryParam.companyId=="" || this.queryParam.companyId == null){
// this.$message.error({message:'请选择企业!',showClose:true})
//
// return;
// }
this.$refs[formName].validate((valid) => {
if (valid) {
addCustomer(this.queryParam).then(result => {
if (result.code == 200) {
this.$message.success('添加成功!');
this.dialogVisible = false;
this.handleCurrentChange(1);
this.resetForm('ruleForm');
} else {
this.$message.error(result.msg);
}
});
dom.style.setProperty("width", `${width + 50}px`);
this.handleSearch();
return;
} else {
}
textContainer.style.setProperty("visibility", "hidden");
textContainer.style.setProperty("display", "inline-block");
textContainer.style.setProperty("font-size", "14px");
textContainer.style.setProperty("padding", "0px 8px");
textContainer.style.setProperty("box-sizing", "border-box");
textContainer.textContent = iptChild.getAttribute("placeholder");
document.body.append(textContainer);
// let containerWidth = textContainer.offsetWidth + 12 + 8;
let containerWidth = 130;
textContainer.remove();
dom.style.setProperty("width", `${containerWidth}px`);
this.handleSearch();
}
});
},
resetForm(formName) {
this.queryParam = {
companyId: '',//jsk企业id
companyName: '',//客户名称(企业名称
customerLevel: '',//客户等级
legalPerson: '',//法定代表人
registerCapital: '',//注册资本
registerAddress: '',//企业注册地址
creditCode: '',//社会统一信用代码
address: '',//选择的地址
provinceId: '',
cityId: '',
districtId: '',
},
this.dialogVisible = false;
this.showlist = false;
},
} catch (error) {
console.log(error);
}
},
// 单选处理
async iptAdaptiveHandle(uid) {
try {
await this.$nextTick();
const dom = document.querySelector(`.select-adaptive-${uid}`);
const realStyles = window.getComputedStyle(dom);
if (dom) {
//地区
async prvinceTree() {
// await axios.post("https://files.jiansheku.com/file/json/common/provinceTree.json", {}, {
// headers: {
// 'Content-Type': 'application/json'
// }
// }).then(res => {
// if (res.data.code == 200) {
// console.log(res.data.data)
// }
// })
// console.log(prvinceTree)
this.addressList = prvinceTree;
this.getadd(this.addressList);
},
//处理注册地数据
getadd(row) {
this.addrcallback(row, this.getadd);
},
addrcallback(row, callback) {
if (row) {
row.forEach(item => {
item.value = item.id;
callback && callback(item.children);
});
}
},
//输入数字
number(value) {
if (value == '')
this.queryParam.registerCapital = value;
else
this.queryParam.registerCapital = value.replace(/^\D*(\d*(?:\.\d{0,6})?).*$/g, '$1');//输入6位小数
},
iptAdaptive(uid, multiple = false) {
multiple ? this.multipleAdaptiveHandle(uid) : this.iptAdaptiveHandle(uid);
},
getUid() {
return v4();
},
// 多选处理
async multipleAdaptiveHandle(uid) {
try {
await this.$nextTick();
const dom = document.querySelector(`.select-adaptive-${uid}`);
const iptChild = dom.querySelector(".el-input__inner");
const textContainer = document.createElement("span");
const textName = `text-${uid}`;
textContainer.classList.add(textName);
textContainer.style.setProperty("visibility", "hidden");
textContainer.style.setProperty("display", "inline-block");
textContainer.style.setProperty("font-size", "14px");
const hasPadding = (parseInt(realStyles.paddingLeft) || parseInt(realStyles.paddingRight)) ? true : false;
hasPadding ? textContainer.style.setProperty("padding", "0px 8px") : null;
textContainer.style.setProperty("box-sizing", "border-box");
textContainer.textContent = iptChild.value ? iptChild.value : iptChild.getAttribute("placeholder");
document.body.append(textContainer);
// let containerWidth = textContainer.offsetWidth + 12 + 8;
let containerWidth = 0;
if (iptChild.value) {
containerWidth = 70;
} else {
containerWidth = 130;
if (dom) {
const textContainer = document.createElement("span");
const textName = `text-${uid}`;
textContainer.classList.add(textName);
const selectChildren = dom.querySelectorAll(".el-tag");
if (selectChildren.length) {
let width = 0;
selectChildren.forEach(item => {
const text = item.textContent;
const itemInfo = window.getComputedStyle(item);
textContainer.style.setProperty("visibility", "hidden");
textContainer.style.setProperty("display", "inline-block");
textContainer.style.setProperty("font-size", "14px");
textContainer.style.setProperty("padding", itemInfo.padding);
textContainer.style.setProperty("box-sizing", "border-box");
textContainer.textContent = text;
document.body.append(textContainer);
width += textContainer.offsetWidth + parseInt(itemInfo.marginLeft) + parseInt(itemInfo.marginRight);
textContainer.remove();
});
dom.style.setProperty("width", `${width + 50}px`);
this.handleSearch();
return;
}
textContainer.style.setProperty("visibility", "hidden");
textContainer.style.setProperty("display", "inline-block");
textContainer.style.setProperty("font-size", "14px");
textContainer.style.setProperty("padding", "0px 8px");
textContainer.style.setProperty("box-sizing", "border-box");
textContainer.textContent = iptChild.getAttribute("placeholder");
document.body.append(textContainer);
// let containerWidth = textContainer.offsetWidth + 12 + 8;
let containerWidth = 130;
textContainer.remove();
dom.style.setProperty("width", `${containerWidth}px`);
this.handleSearch();
}
textContainer.remove();
dom.style.setProperty("width", `${containerWidth}px`);
} catch (error) {
console.log(error);
}
this.handleSearch();
} catch (error) {
},
// 单选处理
async iptAdaptiveHandle(uid) {
try {
await this.$nextTick();
const dom = document.querySelector(`.select-adaptive-${uid}`);
const realStyles = window.getComputedStyle(dom);
if (dom) {
const iptChild = dom.querySelector(".el-input__inner");
const textContainer = document.createElement("span");
const textName = `text-${uid}`;
textContainer.classList.add(textName);
textContainer.style.setProperty("visibility", "hidden");
textContainer.style.setProperty("display", "inline-block");
textContainer.style.setProperty("font-size", "14px");
const hasPadding = (parseInt(realStyles.paddingLeft) || parseInt(realStyles.paddingRight)) ? true : false;
hasPadding ? textContainer.style.setProperty("padding", "0px 8px") : null;
textContainer.style.setProperty("box-sizing", "border-box");
textContainer.textContent = iptChild.value ? iptChild.value : iptChild.getAttribute("placeholder");
document.body.append(textContainer);
// let containerWidth = textContainer.offsetWidth + 12 + 8;
let containerWidth = 0;
if (iptChild.value) {
containerWidth = 70;
} else {
containerWidth = 130;
}
textContainer.remove();
dom.style.setProperty("width", `${containerWidth}px`);
}
this.handleSearch();
} catch (error) {
}
},
clickFocus(e) {
document.getElementById(e).classList.toggle('span-ba');
}
},
clickFocus(e) {
document.getElementById(e).classList.toggle('span-ba');
}
}
}
</script>
<style lang="scss" scoped>
.custom-list-container {
width: 100%;
height: 100%;
padding: 24px;
box-sizing: border-box;
.custom-list-container {
width: 100%;
height: 100%;
padding: 24px;
box-sizing: border-box;
.miantitle {
padding: 12px 0px;
padding-top: 0px;
margin: 0px;
}
.miantitle {
padding: 12px 0px;
padding-top: 0px;
margin: 0px;
}
::v-deep .el-card {
.table_search {
.el-form-item {
.el-input {
.el-input__inner {
&::placeholder {
color: rgba(35, 35, 35, 0.8);
font-size: 14px;
}
&:focus {
color: rgba(35, 35, 35, 1);
::v-deep .el-card {
.table_search {
.el-form-item {
.el-input {
.el-input__inner {
&::placeholder {
color: rgba(35, 35, 35, 0.8);
font-size: 14px;
}
&:focus {
color: rgba(35, 35, 35, 1);
}
}
}
.el-input__suffix {
.el-input__icon {
color: rgba(35, 35, 35, 0.8);
.el-input__suffix {
.el-input__icon {
color: rgba(35, 35, 35, 0.8);
}
}
}
}
}
}
}
}
.box-card {
@import "@/assets/styles/search-common.scss";
padding-top: 16px;
width: 100%;
height: 100%;
.table_search {
::v-deep .el-form {
.el-input {
line-height: 32px;
.el-input__inner {
height: 32px;
.box-card {
@import "@/assets/styles/search-common.scss";
padding-top: 16px;
width: 100%;
height: 100%;
.table_search {
::v-deep .el-form {
.el-input {
line-height: 32px;
border-radius: 4px;
border: 0;
.el-input__inner {
height: 32px;
line-height: 32px;
border-radius: 4px;
border: 0;
}
}
}
.is-focus {
.el-input__inner {
background: #f4f6f9;
.is-focus {
.el-input__inner {
background: #f4f6f9;
}
}
}
}
::v-deep .normal-search-container {
display: flex;
align-items: center;
::v-deep .normal-search-container {
display: flex;
align-items: center;
&.is-hover-search {
width: 238px;
background: #f4f6f9;
border-radius: 4px 4px 4px 4px;
&.is-hover-search {
width: 238px;
background: #f4f6f9;
border-radius: 4px 4px 4px 4px;
& > img {
cursor: unset;
& > img {
cursor: unset;
}
}
}
&:hover {
& > span {
color: #0081ff;
&:hover {
& > span {
color: #0081ff;
}
}
}
& > img {
width: 16px;
height: 16px;
margin-left: 12px;
cursor: pointer;
}
& > span {
color: rgba(35, 35, 35, 0.8);
font-weight: 400;
margin-left: 8px;
line-height: 22px;
font-size: 14px;
cursor: pointer;
}
& > img {
width: 16px;
height: 16px;
margin-left: 12px;
cursor: pointer;
}
.el-input {
& > .el-input__inner {
border: none;
height: 32px;
line-height: 32px;
caret-color: #0081ff;
& > span {
color: rgba(35, 35, 35, 0.8);
font-weight: 400;
margin-left: 8px;
line-height: 22px;
font-size: 14px;
background: #f4f6f9;
padding-right: 26px;
padding-left: 8px;
cursor: pointer;
}
&::placeholder {
color: rgba(35, 35, 35, 0.4) !important;
font-size: 14px !important;
.el-input {
& > .el-input__inner {
border: none;
height: 32px;
line-height: 32px;
}
}
.el-input__suffix {
right: 12px;
display: flex;
align-items: center;
caret-color: #0081ff;
color: rgba(35, 35, 35, 0.8);
font-size: 14px;
background: #f4f6f9;
padding-right: 26px;
padding-left: 8px;
.el-input__suffix-inner {
height: 14px;
width: 14px;
&::placeholder {
color: rgba(35, 35, 35, 0.4) !important;
font-size: 14px !important;
line-height: 32px;
}
}
.el-input__suffix {
right: 12px;
display: flex;
align-items: center;
img {
cursor: pointer;
vertical-align: unset;
margin-bottom: 14px;
.el-input__suffix-inner {
height: 14px;
width: 14px;
}
img {
cursor: pointer;
vertical-align: unset;
margin-bottom: 14px;
}
}
}
}
}
}
}
.box {
position: relative;
> span {
position: absolute;
right: 10px;
bottom: 0;
color: #0081ff;
cursor: pointer;
&:hover {
color: #006ad1;
.box {
position: relative;
> span {
position: absolute;
right: 10px;
bottom: 0;
color: #0081ff;
cursor: pointer;
&:hover {
color: #006ad1;
}
}
}
}
.dc {
font-size: 12px;
color: #3d3d3d;
font-weight: 400;
position: relative;
&::after {
content: " ";
width: 2px;
height: 2px;
background: rgba(35, 35, 35, 0.4);
border-radius: 50%;
position: absolute;
top: 16px;
left: 14px;
}
> div {
display: inline-block;
margin-left: 20px;
.dc {
font-size: 12px;
color: #3d3d3d;
font-weight: 400;
position: relative;
&::after {
content: " ";
width: 2px;
height: 2px;
background: rgba(35, 35, 35, 0.4);
border-radius: 50%;
position: absolute;
top: 16px;
left: 14px;
}
> div {
display: inline-block;
margin-left: 20px;
}
}
}
.img.img1 {
margin-right: 2px;
background: url("../../../../src/assets/images/project/add_2.png") no-repeat
.img.img1 {
margin-right: 2px;
background: url("../../../../src/assets/images/project/add_2.png") no-repeat
center center;
background-size: 100%;
}
.w88 {
width: 88px;
}
.tables {
position: relative;
min-height: calc(100vh - 134px);
/*overflow: auto;*/
.empty {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.btn {
margin-right: 8px;
margin-top: 16px;
}
background-size: 100%;
}
.table_search {
::v-deep .el-cascader {
height: 32px;
line-height: 32px;
.el-input {
input {
height: 32px !important;
}
.w88 {
width: 88px;
}
.tables {
position: relative;
min-height: calc(100vh - 134px);
/*overflow: auto;*/
.empty {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.btn {
margin-right: 8px;
margin-top: 16px;
}
.el-cascader__tags {
flex-wrap: inherit;
margin-top: 1px;
.el-tag {
/*max-width: 120px;*/
}
.table_search {
::v-deep .el-cascader {
height: 32px;
line-height: 32px;
.el-input {
input {
height: 32px !important;
}
}
.el-cascader__tags {
flex-wrap: inherit;
margin-top: 1px;
.el-tag {
/*max-width: 120px;*/
}
}
.el-input__suffix {
top: 1px;
}
}
.el-input__suffix {
top: 1px;
}
}
::v-deep .normal-search-container {
height: 32px;
display: flex;
align-items: center;
::v-deep .normal-search-container {
height: 32px;
display: flex;
align-items: center;
&.is-hover-search {
width: 238px;
background: #f4f6f9;
border-radius: 4px 4px 4px 4px;
&.is-hover-search {
width: 238px;
background: #f4f6f9;
border-radius: 4px 4px 4px 4px;
& > img {
cursor: unset;
& > img {
cursor: unset;
}
}
}
&:hover {
& > span {
color: #0081ff;
&:hover {
& > span {
color: #0081ff;
}
}
}
& > img {
width: 16px;
height: 16px;
margin-left: 12px;
cursor: pointer;
}
& > span {
color: rgba(35, 35, 35, 0.8);
font-weight: 400;
margin-left: 8px;
line-height: 22px;
font-size: 14px;
cursor: pointer;
}
& > img {
width: 16px;
height: 16px;
margin-left: 12px;
cursor: pointer;
}
.el-input {
& > .el-input__inner {
border: none;
height: 32px;
line-height: 32px;
caret-color: #0081ff;
& > span {
color: rgba(35, 35, 35, 0.8);
font-weight: 400;
margin-left: 8px;
line-height: 22px;
font-size: 14px;
background: #f4f6f9;
padding-right: 26px;
padding-left: 8px;
cursor: pointer;
}
&::placeholder {
color: rgba(35, 35, 35, 0.4) !important;
font-size: 14px !important;
.el-input {
& > .el-input__inner {
border: none;
height: 32px;
line-height: 32px;
}
}
.el-input__suffix {
right: 12px;
display: flex;
align-items: center;
caret-color: #0081ff;
color: rgba(35, 35, 35, 0.8);
font-size: 14px;
background: #f4f6f9;
padding-right: 26px;
padding-left: 8px;
.el-input__suffix-inner {
height: 14px;
width: 14px;
&::placeholder {
color: rgba(35, 35, 35, 0.4) !important;
font-size: 14px !important;
line-height: 32px;
}
}
.el-input__suffix {
right: 12px;
display: flex;
align-items: center;
img {
cursor: pointer;
vertical-align: unset;
.el-input__suffix-inner {
height: 14px;
width: 14px;
}
img {
cursor: pointer;
vertical-align: unset;
}
}
}
}
}
.cooperate-name {
margin-left: 12px;
display: flex;
border-radius: 2px;
border: 1px solid #d9d9d9;
line-height: 34px;
height: 34px;
float: left;
span {
width: 60px;
height: 32px;
line-height: 32px;
font-size: 14px;
background: #f5f5f5;
text-align: center;
color: #0081ff;
border: 1px solid #efefef;
border-left: 0;
cursor: pointer;
}
&.span-ba {
border: 1px solid #0081ff;
.cooperate-name {
margin-left: 12px;
display: flex;
border-radius: 2px;
border: 1px solid #d9d9d9;
line-height: 34px;
height: 34px;
float: left;
span {
color: #ffffff;
background: #0081ff;
width: 60px;
height: 32px;
line-height: 32px;
font-size: 14px;
background: #f5f5f5;
text-align: center;
color: #0081ff;
border: 1px solid #efefef;
border-left: 0;
cursor: pointer;
}
&.span-ba {
border: 1px solid #0081ff;
span {
color: #ffffff;
background: #0081ff;
border: 1px solid #0081ff;
}
}
::v-deep .el-input {
flex: 1;
}
::v-deep .el-input__inner {
border: 0;
line-height: 32px;
height: 32px;
position: absolute;
top: 0;
padding-right: 28px;
font-size: 12px;
padding-left: 8px;
}
}
::v-deep .el-input {
flex: 1;
}
::v-deep .el-input__inner {
border: 0;
line-height: 32px;
height: 32px;
position: absolute;
top: 0;
padding-right: 28px;
font-size: 12px;
padding-left: 8px;
}
}
}
}
.ps1 {
display: flex;
justify-content: space-between;
.ps2 {
width: 350px;
}
.ps3 {
width: 60px;
.ps1 {
display: flex;
justify-content: right;
> div {
margin-left: 12px;
> img {
float: right;
margin: 3px 0 0 4px;
width: 14px;
}
.i {
display: inline-block;
}
.o {
display: none;
}
&:hover {
cursor: pointer;
justify-content: space-between;
.ps2 {
width: 350px;
}
.ps3 {
width: 60px;
display: flex;
justify-content: right;
> div {
margin-left: 12px;
> img {
float: right;
margin: 3px 0 0 4px;
width: 14px;
}
.i {
display: none;
display: inline-block;
}
.o {
display: inline-block;
display: none;
}
&:hover {
cursor: pointer;
.i {
display: none;
}
.o {
display: inline-block;
}
}
}
}
}
}
.popbot {
.wordprimary {
display: inline;
padding-right: 26px;
.popbot {
.wordprimary {
display: inline;
padding-right: 26px;
}
}
.searchInput {
width: 240px;
}
}
.searchInput {
width: 240px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment