|
|
@@ -0,0 +1,664 @@
|
|
|
+<template>
|
|
|
+<!--上级企业 负责人-->
|
|
|
+ <div>
|
|
|
+ <el-button size="small" type="primary" @click="dialogFormVisible = true">新 建</el-button>
|
|
|
+ <el-drawer
|
|
|
+ direction="rtl"
|
|
|
+ append-to-body
|
|
|
+ title="新建公海客户"
|
|
|
+ :show-close="false"
|
|
|
+ :visible.sync="dialogFormVisible"
|
|
|
+ @close="onClose"
|
|
|
+ size="600px">
|
|
|
+ <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="20">
|
|
|
+ <el-form-item label="客户名称:" prop="enterprisename">
|
|
|
+ <el-input v-model="form.enterprisename" placeholder="客户名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-popover
|
|
|
+ placement="right"
|
|
|
+ width="900"
|
|
|
+ v-model="businessShow"
|
|
|
+ trigger="manual">
|
|
|
+ <el-input
|
|
|
+ style="width:300px;margin-bottom: 10px"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ v-model="form.enterprisename"
|
|
|
+ clearable
|
|
|
+ @clear="businessSearch"
|
|
|
+ size="mini"
|
|
|
+ @keyup.enter.native="businessSearch">
|
|
|
+ <i slot="prefix" class="el-icon-search" @click="businessSearch"></i>
|
|
|
+ </el-input>
|
|
|
+ <el-table :data="businessData" @row-click="businessSelect" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
|
|
|
+ <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 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" :disabled="form.enterprisename === ''">工商查询</el-button>
|
|
|
+ </el-popover>
|
|
|
+ </el-col>
|
|
|
+ <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="24">
|
|
|
+ <el-form-item label="erp编号:" prop="erpagentnum">
|
|
|
+ <el-input v-model="form.erpagentnum" placeholder="请输入erp编号" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>-->
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="客户类型:" prop="type">
|
|
|
+ <el-select v-model="form.type" placeholder="请选择客户类型" size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="item in customerType()"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.value">
|
|
|
+<!-- <span style="float: left">{{ item.value }}</span>
|
|
|
+ <span v-if="item.remarks !== ''" style="float: right; color: #8492a6; font-size: 10px">{{ item.remarks }}</span>-->
|
|
|
+ <span style="float: left">{{ item.value }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="客户等级:" >
|
|
|
+ <el-select v-model="form.grade" placeholder="请选择客户等级" style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in options.customerGrade"
|
|
|
+ :key="item.rowindex"
|
|
|
+ :label="item.value "
|
|
|
+ :value="item.value">
|
|
|
+ <span style="float: left">{{ item.value }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="客户分类:" >
|
|
|
+ <el-select v-model="form.customergrade" placeholder="请选择客户分类" style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in options.customerClassification"
|
|
|
+ :key="item.rowindex"
|
|
|
+ :label="item.value "
|
|
|
+ :value="item.value">
|
|
|
+ <span style="float: left">{{ item.value }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="客户行业:" >
|
|
|
+ <el-select
|
|
|
+ ref="sle"
|
|
|
+ style="width:100%;"
|
|
|
+ v-model="form.industry"
|
|
|
+ multiple
|
|
|
+ placeholder="请选择所属行业"
|
|
|
+ size="mini"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in options.industryData"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ <span style="float: left">{{ item.value }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <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="24">
|
|
|
+ <el-form-item label="法人:" prop="contact">
|
|
|
+ <el-input v-model="form.contact" placeholder="请输入法人信息" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="联系电话:" prop="telephone">
|
|
|
+ <el-input v-model="form.telephone" placeholder="请输入联系电话" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="省市县:" prop="province">
|
|
|
+ <el-cascader
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="value"
|
|
|
+ :options="basicData.data().areaData"
|
|
|
+ @change="cascaderChange" clearable>
|
|
|
+ </el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <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="24">
|
|
|
+ <el-form-item label="上级企业:" >
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ width="700"
|
|
|
+ trigger="click"
|
|
|
+ v-model="customerShow"
|
|
|
+ @show="customerList">
|
|
|
+ <el-input
|
|
|
+ style="width:300px;margin-bottom: 10px"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ v-model="customerParam.content.where.condition"
|
|
|
+ clearable
|
|
|
+ @clear="customerList(customerParam.content.pageNumber = 1)"
|
|
|
+ size="mini"
|
|
|
+ @keyup.enter.native="customerList(customerParam.content.pageNumber = 1)">
|
|
|
+ <i slot="prefix" class="el-icon-search" @click="customerList(customerParam.content.pageNumber = 1)"></i>
|
|
|
+ </el-input>
|
|
|
+ <el-table :data="customer.customerData" @row-click="customerData" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
|
|
|
+ <el-table-column
|
|
|
+ label="客户编号"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.sa_customersid?scope.row.sa_customersid:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="客户名称"
|
|
|
+ width="200">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.enterprisename?scope.row.enterprisename:'--'}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="地址"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="container normal-panel" style="text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ small
|
|
|
+ @size-change="handleSizeChangeCustomer"
|
|
|
+ @current-change="handleCurrentChangeCustomer"
|
|
|
+ :page-sizes="[10,20,50,100,]"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :current-page="customer.currentPage"
|
|
|
+ :total="customer.total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <el-input slot="reference" :readonly="true" v-model="form.superiorenterprisename" autocomplete="off" placeholder="请选择客户" @input="selectCustomer"></el-input>
|
|
|
+ </el-popover>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <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="24">
|
|
|
+ <el-form-item label="公海池:" prop="sa_customerpoolid">
|
|
|
+ <el-select v-model="form.sa_customerpoolid" placeholder="请选择公海池" size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="item in publicList()"
|
|
|
+ :key="item.sa_customerpoolid"
|
|
|
+ :label="item.poolname"
|
|
|
+ :value="item.sa_customerpoolid">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="fixed__btn__panel">
|
|
|
+ <el-button size="small" @click="onClose" class="normal-btn-width inline-16">取 消</el-button>
|
|
|
+ <duplicateCheck ref="check" :data="form" @onSuccess="onClose" @onCheck="onCheck"></duplicateCheck>
|
|
|
+ <el-button size="small" type="primary" :loading="loading" @click="onSave" class="normal-btn-width">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import duplicateCheck from "@/components/duplicatesCheck/publicCustomerCheck";
|
|
|
+import {mapGetters} from "vuex";
|
|
|
+export default {
|
|
|
+ name: "add",
|
|
|
+ inject:['customerLead','customerType','arealist','publicList'],
|
|
|
+ components:{duplicateCheck},
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ dialogFormVisible:false,
|
|
|
+ isordercheck:true,
|
|
|
+ isusedcheck:false,
|
|
|
+ customerShow:false,
|
|
|
+ checkResults:'',
|
|
|
+ businessData:[],
|
|
|
+ businessParam:{
|
|
|
+ "id": 20221208103601,
|
|
|
+ "content": {
|
|
|
+ "pageNumber":1,
|
|
|
+ "pageSize":5,
|
|
|
+ "keyword":''
|
|
|
+ },
|
|
|
+ },
|
|
|
+ businessShow:false,
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ options:{
|
|
|
+ industryData:[],
|
|
|
+ customerGrade:[],
|
|
|
+ customerClassification:[],
|
|
|
+ },
|
|
|
+ form:{
|
|
|
+ sa_customersid: 0,//新增是传0
|
|
|
+ parentid: 0, //上级客户ID,默认或没有上级的时候传0
|
|
|
+ sys_enterpriseid: 0, //合作企业档案ID,新增是传0,更新
|
|
|
+ enterprisename:"",//客户名称(企业名称)
|
|
|
+ type: "", //客户类型
|
|
|
+ customergrade:'',//客户等级
|
|
|
+ sa_customerpoolid: '', //客户池(公海池)ID,默认或没有的时候传0
|
|
|
+ source: "", //客户来源
|
|
|
+ province:"",//非必填,可选
|
|
|
+ city:"",//非必填,可选
|
|
|
+ county:"",//非必填,可选
|
|
|
+ address:"",//非必填,可选
|
|
|
+ abbreviation:"",//非必填,可选
|
|
|
+ taxno:"",//税号,非必填,可选
|
|
|
+ grade:'',// 客户等级(商户等级)
|
|
|
+ industry:[],//非必填,可选,所属行业
|
|
|
+ contact:"",//非必填,可选
|
|
|
+ phonenumber:"",//非必填,可选
|
|
|
+ ispublic:1,
|
|
|
+ telephone: "",
|
|
|
+ sa_agentsid: "",
|
|
|
+ erpagentnum:""
|
|
|
+ },
|
|
|
+ value:'',
|
|
|
+ rules:{
|
|
|
+ enterprisename:[
|
|
|
+ { required: true, message: '输入客户名称', trigger: 'blur'},
|
|
|
+ ],
|
|
|
+ type: [
|
|
|
+ { required: true, message: '还未选择客户类型', trigger: 'change' },
|
|
|
+ ],
|
|
|
+ source:[
|
|
|
+ { required: false, message: '请填写客户来源', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ sa_customerpoolid:[
|
|
|
+ { required: true, message: '请选择公海池', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ contact: [
|
|
|
+ { required: true, message: '请输入法人', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ telephone: [
|
|
|
+ { required: true, message: '请输入联系电话', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ province: [
|
|
|
+ { required: true, message: '请选择省市县', trigger: 'change' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ customerParam:{
|
|
|
+ "id": 20220920083901,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 10,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "type":2,
|
|
|
+ "sa_projectid":""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ customer:{
|
|
|
+ customerData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ ...mapGetters({
|
|
|
+ loading:'loading'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ /*工商查询*/
|
|
|
+ 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
|
|
|
+ this.businessShow = true
|
|
|
+ },
|
|
|
+ /*选择工商信息*/
|
|
|
+ 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 === "-" ? '' : val.address
|
|
|
+ this.form.taxno = val.taxNum
|
|
|
+ this.value = [val.regProvince,val.regCity,val.regArea]
|
|
|
+ this.form.province = val.regProvince
|
|
|
+ this.form.city = val.regCity
|
|
|
+ this.form.county = val.regArea
|
|
|
+ this.form.contact = val.legalPerson
|
|
|
+ }).catch(() => {
|
|
|
+ this.businessShow = false
|
|
|
+ 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()
|
|
|
+ },*/
|
|
|
+ /*查重检查*/
|
|
|
+ onCheck(){
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ this.$refs.check.queryRule()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /*自动查重判断*/
|
|
|
+ duplicateCheck(){
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221208172002,
|
|
|
+ "content": {
|
|
|
+ "sa_customersid":0,
|
|
|
+ "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(){
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ this.$store.commit('setLoading',true)
|
|
|
+ this.$refs.check.creatShow = true
|
|
|
+ this.$refs.check.queryRule(()=>{
|
|
|
+ this.$store.commit('setLoading',false)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSubmit(){
|
|
|
+ this.$refs['form'].validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ /*if (this.form.province) {
|
|
|
+ this.form.city = this.form.province[1]
|
|
|
+ this.form.county = this.form.province[2]
|
|
|
+ this.form.province = this.form.province[0]
|
|
|
+ }*/
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20221010164302",
|
|
|
+ "version":1,
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ 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 = ''
|
|
|
+ this.value = ''
|
|
|
+ }else {
|
|
|
+ this.setTag(res.data.sa_customersid)
|
|
|
+ }
|
|
|
+
|
|
|
+ /*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 = ''
|
|
|
+ this.value = ''
|
|
|
+ },
|
|
|
+ onClose(){
|
|
|
+ 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 = ''
|
|
|
+ this.value = ''
|
|
|
+ this.businessShow = false
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ },
|
|
|
+ cascaderChange (val) {
|
|
|
+ this.form.province = val[0]
|
|
|
+ if (val.length === 1)
|
|
|
+ return this.form = Object.assign({},this.form,{province:val[0],city:'',county:''})
|
|
|
+
|
|
|
+ this.form = Object.assign({},this.form,{province:val[0],city:val[1],county:val[2]})
|
|
|
+ this.$refs.form.validateField('province')
|
|
|
+ },
|
|
|
+ async customerList(){
|
|
|
+ const res = await this.$api.requested(this.customerParam)
|
|
|
+ this.customer.customerData = res.data
|
|
|
+ this.customer.total = res.total
|
|
|
+ this.customer.currentPage = res.pageNumber
|
|
|
+ },
|
|
|
+ selectCustomer(){
|
|
|
+ this.customerParam.content.where.condition = this.form.enterprisename
|
|
|
+ this.customerList()
|
|
|
+ },
|
|
|
+ /*客户选择信息*/
|
|
|
+ customerData(val){
|
|
|
+ this.form.parentid = val.sa_customersid
|
|
|
+ this.form.superiorenterprisename = val.enterprisename
|
|
|
+ this.customerShow = false
|
|
|
+ },
|
|
|
+ /*客户分页*/
|
|
|
+ handleSizeChangeCustomer(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.customerParam.content.pageSize = val
|
|
|
+ this.customerList()
|
|
|
+ },
|
|
|
+ handleCurrentChangeCustomer(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.customerParam.content.pageNumber = val
|
|
|
+ this.customerList()
|
|
|
+ },
|
|
|
+ /*行业列表*/
|
|
|
+ async industryList(){
|
|
|
+ const siteid = JSON.parse(sessionStorage.getItem('active_account')).siteid
|
|
|
+ console.log("行业列表")
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "classname": "sysmanage.develop.optiontype.optiontype",
|
|
|
+ "method": "optiontypeselect",
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "typename": "industry",
|
|
|
+ "parameter": {
|
|
|
+ "siteid": siteid
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.options.industryData = res.data
|
|
|
+ },
|
|
|
+ /*客户分类*/
|
|
|
+ async gradeList(){
|
|
|
+ const siteid = JSON.parse(sessionStorage.getItem('active_account')).siteid
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "classname": "sysmanage.develop.optiontype.optiontype",
|
|
|
+ "method": "optiontypeselect",
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "typename": "customergrade",
|
|
|
+ "parameter": {
|
|
|
+ "siteid": siteid
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log("客户等级",res.data)
|
|
|
+ /*for (var i=0;i<res.data.length; i++){
|
|
|
+ if (res.data[i].remarks !== ''){
|
|
|
+ this.options.gradeData[i] = res.data[i].value + "——" + res.data[i].remarks
|
|
|
+ }else{
|
|
|
+ this.options.gradeData[i] = res.data[i].value
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+ this.options.customerClassification = res.data
|
|
|
+ console.log("处理后客户等级",this.options.customerClassification)
|
|
|
+ },
|
|
|
+ /*客户等级*/
|
|
|
+ queryCustomerGrade(){
|
|
|
+ this.$store.dispatch('optiontypeselect','agentgrade').then(res=>{
|
|
|
+ this.options.customerGrade = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ checkSuccess(val){
|
|
|
+ this.checkResults = val
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.industryList()
|
|
|
+ this.gradeList()
|
|
|
+ this.queryCustomerGrade()
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ /deep/.el-select,.el-cascader {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ /deep/.el-input__prefix {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+</style>
|