|
|
@@ -9,16 +9,53 @@
|
|
|
:show-close="false"
|
|
|
:visible.sync="dialogFormVisible"
|
|
|
@close="onClose"
|
|
|
- size="30%">
|
|
|
+ size="40%">
|
|
|
<div class="drawer__panel">
|
|
|
<el-row :gutter="20">
|
|
|
<el-form :model="form" :rules="rules" ref="form" label-width="90px" label-position="right" size="mini">
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="20">
|
|
|
<el-form-item label="客户名称:" prop="enterprisename">
|
|
|
<el-input v-model="form.enterprisename" placeholder="客户名称"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-popover
|
|
|
+ placement="right"
|
|
|
+ width="600"
|
|
|
+ v-model="businessShow"
|
|
|
+ trigger="click">
|
|
|
+ <el-table :data="businessData" @row-click="businessSelect">
|
|
|
+ <el-table-column width="260" label="客户名称">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.companyName?scope.row.companyName:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="350" label="客户地址">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="200" label="客户税号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.taxNum?scope.row.taxNum:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!-- <div class="container normal-panel" style="text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-sizes="[5]"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>-->
|
|
|
+ <el-button size="mini" type="primary" style="width: 100%" @click="businessSearch" slot="reference">工商查询</el-button>
|
|
|
+ </el-popover>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="客户类型:" prop="type">
|
|
|
<el-select v-model="form.type" placeholder="请选择客户类型" size="small">
|
|
|
<el-option
|
|
|
@@ -32,12 +69,12 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="客户来源:" prop="source">
|
|
|
<el-input v-model="form.source" placeholder="客户来源"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="客户等级:" prop="grade">
|
|
|
<el-select v-model="form.grade" placeholder="请选择客户等级" size="small">
|
|
|
<el-option
|
|
|
@@ -49,37 +86,37 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="详细地址:" prop="address">
|
|
|
<el-input v-model="form.address" placeholder="详细地址"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="企业简称:" prop="abbreviation">
|
|
|
<el-input v-model="form.abbreviation" placeholder="企业简称"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="税号:" prop="taxno">
|
|
|
<el-input v-model="form.taxno" placeholder="税号"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="所属行业:" prop="industry">
|
|
|
<el-input v-model="form.industry" placeholder="所属行业"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="联系人:" prop="contact">
|
|
|
<el-input v-model="form.contact" placeholder="联系人"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="联系电话:" prop="phonenumber">
|
|
|
<el-input v-model="form.phonenumber" placeholder="联系电话"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="省市县:" prop="province">
|
|
|
<el-cascader
|
|
|
size="small"
|
|
|
@@ -90,7 +127,7 @@
|
|
|
</el-cascader>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="公海池:" prop="sa_customerpoolid">
|
|
|
<el-select v-model="form.sa_customerpoolid" placeholder="请选择公海池" size="small">
|
|
|
<el-option
|
|
|
@@ -107,7 +144,8 @@
|
|
|
</div>
|
|
|
<div class="fixed__btn__panel">
|
|
|
<el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
|
|
|
- <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="duplicateChecking" class="normal-btn-width">查 重</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="onSave" class="normal-btn-width">确 定</el-button>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
</div>
|
|
|
@@ -122,6 +160,19 @@ export default {
|
|
|
dialogFormVisible:false,
|
|
|
isordercheck:true,
|
|
|
isusedcheck:false,
|
|
|
+ checkResults:'',
|
|
|
+ businessData:[],
|
|
|
+ businessParam:{
|
|
|
+ "id": 20221208103601,
|
|
|
+ "content": {
|
|
|
+ "pageNumber":1,
|
|
|
+ "pageSize":5,
|
|
|
+ "keyword":''
|
|
|
+ },
|
|
|
+ },
|
|
|
+ businessShow:false,
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
form:{
|
|
|
"sa_customersid": 0,//新增是传0
|
|
|
"parentid": 0, //上级客户ID,默认或没有上级的时候传0
|
|
|
@@ -139,7 +190,8 @@ export default {
|
|
|
"grade":'',// 客户等级(商户等级)
|
|
|
"industry":"",//非必填,可选,所属行业
|
|
|
"contact":"",//非必填,可选
|
|
|
- "phonenumber":""//非必填,可选
|
|
|
+ "phonenumber":"",//非必填,可选
|
|
|
+ "ispublic":1
|
|
|
},
|
|
|
rules:{
|
|
|
enterprisename:[
|
|
|
@@ -158,6 +210,106 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
+ /*手动查重*/
|
|
|
+ duplicateChecking(){
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221208172002,
|
|
|
+ "content": {
|
|
|
+ "enterprisename":this.form.enterprisename,
|
|
|
+ "taxno":this.form.taxno,
|
|
|
+ "address":this.form.address
|
|
|
+
|
|
|
+ },
|
|
|
+ })
|
|
|
+ console.log(res,"查重结果")
|
|
|
+ if (res.data.length !== 0){
|
|
|
+ console.log("重复")
|
|
|
+ }
|
|
|
+ this.checkResults = res.data.length
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /*工商查询*/
|
|
|
+ async businessSearch(){
|
|
|
+ this.businessParam.content.keyword = this.form.enterprisename
|
|
|
+ const res = await this.$api.requested(this.businessParam)
|
|
|
+ console.log(res,"工商查询结果")
|
|
|
+ this.businessData = res.data
|
|
|
+ this.total = res.total
|
|
|
+ this.currentPage = res.pageNumber
|
|
|
+ },
|
|
|
+ /*选择工商信息*/
|
|
|
+ businessSelect(val){
|
|
|
+ console.log("选择的工商信息",val)
|
|
|
+ this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.businessShow = false
|
|
|
+ this.form.enterprisename = val.companyName
|
|
|
+ this.form.address = val.address
|
|
|
+ this.form.taxno = val.taxNum
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消更新'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /*handleSizeChange(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.param.content.pageSize = val
|
|
|
+ this.businessSearch()
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.param.content.pageNumber = val
|
|
|
+ this.businessSearch()
|
|
|
+ },*/
|
|
|
+ /*自动查重判断*/
|
|
|
+ duplicateCheck(){
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221208172002,
|
|
|
+ "content": {
|
|
|
+ "enterprisename":this.form.enterprisename,
|
|
|
+ "taxno":this.form.taxno,
|
|
|
+ "address":this.form.address
|
|
|
+ },
|
|
|
+ })
|
|
|
+ console.log(res,"查重结果")
|
|
|
+ if (res.data.length !== 0){
|
|
|
+ console.log("重复")
|
|
|
+ }
|
|
|
+ this.checkResults = res.data.length
|
|
|
+ this.onSave()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSave(){
|
|
|
+ if (this.checkResults === ''){
|
|
|
+ this.duplicateCheck()
|
|
|
+ }else {
|
|
|
+ if (this.checkResults !== 0){
|
|
|
+ this.$confirm('该客户疑似重复,是否确认创建客户?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.onSubmit()
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ this.onSubmit()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
onSubmit(){
|
|
|
this.$refs['form'].validate(async (valid) => {
|
|
|
if (!valid) return false
|
|
|
@@ -172,33 +324,74 @@ export default {
|
|
|
"content": this.form
|
|
|
})
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
- this.$emit('onSuccess')
|
|
|
- this.$refs['form'].resetFields();
|
|
|
- this.form = {
|
|
|
- "sa_customersid": 0,//新增是传0
|
|
|
- "parentid": 0, //上级客户ID,默认或没有上级的时候传0
|
|
|
- "sys_enterpriseid": 0, //合作企业档案ID,新增是传0,更新
|
|
|
- "enterprisename":"",//客户名称(企业名称)
|
|
|
- "type": "", //客户类型
|
|
|
- "sa_customerpoolid": '', //客户池(公海池)ID,默认或没有的时候传0
|
|
|
- "source": "", //客户来源
|
|
|
- "province":"",//非必填,可选
|
|
|
- "city":"",//非必填,可选
|
|
|
- "county":"",//非必填,可选
|
|
|
- "address":"",//非必填,可选
|
|
|
- "abbreviation":"",//非必填,可选
|
|
|
- "taxno":"",//税号,非必填,可选
|
|
|
- "grade":'',// 客户等级(商户等级)
|
|
|
- "industry":"",//非必填,可选,所属行业
|
|
|
- "contact":"",//非必填,可选
|
|
|
- "phonenumber":""//非必填,可选
|
|
|
+ if (this.checkResults === 0){
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ this.$refs['form'].resetFields();
|
|
|
+ this.form = {
|
|
|
+ "sa_customersid": 0,//新增是传0
|
|
|
+ "parentid": 0, //上级客户ID,默认或没有上级的时候传0
|
|
|
+ "sys_enterpriseid": 0, //合作企业档案ID,新增是传0,更新
|
|
|
+ "enterprisename":"",//客户名称(企业名称)
|
|
|
+ "type": "", //客户类型
|
|
|
+ "sa_customerpoolid": '', //客户池(公海池)ID,默认或没有的时候传0
|
|
|
+ "source": "", //客户来源
|
|
|
+ "province":"",//非必填,可选
|
|
|
+ "city":"",//非必填,可选
|
|
|
+ "county":"",//非必填,可选
|
|
|
+ "address":"",//非必填,可选
|
|
|
+ "abbreviation":"",//非必填,可选
|
|
|
+ "taxno":"",//税号,非必填,可选
|
|
|
+ "grade":'',// 客户等级(商户等级)
|
|
|
+ "industry":"",//非必填,可选,所属行业
|
|
|
+ "contact":"",//非必填,可选
|
|
|
+ "phonenumber":""//非必填,可选
|
|
|
+ }
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.checkResults = ''
|
|
|
+ }else {
|
|
|
+ this.setTag(res.data.sa_customersid)
|
|
|
}
|
|
|
- this.dialogFormVisible = false
|
|
|
- this.$router.push({path:'/PublicCustomerDetail',query:{id:res.data.sa_customersid,rowindex:0}})
|
|
|
- this.$store.dispatch('changeDetailDrawer',true)
|
|
|
+
|
|
|
+ /*this.$router.push({path:'/PublicCustomerDetail',query:{id:res.data.sa_customersid,rowindex:0}})
|
|
|
+ this.$store.dispatch('changeDetailDrawer',true)*/
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ async setTag(id){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20220929090901,
|
|
|
+ "content": {
|
|
|
+ "ownertable":"sa_customers",
|
|
|
+ "ownerid":id,
|
|
|
+ "datatag":[
|
|
|
+ "疑似重复",
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ this.$refs['form'].resetFields();
|
|
|
+ this.form = {
|
|
|
+ "sa_customersid": 0,//新增是传0
|
|
|
+ "parentid": 0, //上级客户ID,默认或没有上级的时候传0
|
|
|
+ "sys_enterpriseid": 0, //合作企业档案ID,新增是传0,更新
|
|
|
+ "enterprisename":"",//客户名称(企业名称)
|
|
|
+ "type": "", //客户类型
|
|
|
+ "sa_customerpoolid": '', //客户池(公海池)ID,默认或没有的时候传0
|
|
|
+ "source": "", //客户来源
|
|
|
+ "province":"",//非必填,可选
|
|
|
+ "city":"",//非必填,可选
|
|
|
+ "county":"",//非必填,可选
|
|
|
+ "address":"",//非必填,可选
|
|
|
+ "abbreviation":"",//非必填,可选
|
|
|
+ "taxno":"",//税号,非必填,可选
|
|
|
+ "grade":'',// 客户等级(商户等级)
|
|
|
+ "industry":"",//非必填,可选,所属行业
|
|
|
+ "contact":"",//非必填,可选
|
|
|
+ "phonenumber":""//非必填,可选
|
|
|
+ }
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.checkResults = ''
|
|
|
+ },
|
|
|
onClose(){
|
|
|
this.$refs['form'].resetFields();
|
|
|
this.form = {
|
|
|
@@ -220,6 +413,8 @@ export default {
|
|
|
"contact":"",//非必填,可选
|
|
|
"phonenumber":""//非必填,可选
|
|
|
}
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.checkResults = ''
|
|
|
},
|
|
|
cascaderChange() {
|
|
|
|