Commit a668db84 authored by zhanglw's avatar zhanglw

添加客户信息

parent ab931088
......@@ -7,7 +7,16 @@ export const HttpReq = {
uploadBusinessLicense: function(data) {
return request({
url: '/api/bsw/users/updateBusinessLicense',
method: 'POST',
method: 'post',
data: data
}).then((res) => {
return res
})
},
deleteBusinessLicense: function(data) {
return request({
url: '/api/bsw/users/deleteBusinessLicense',
method: 'delete',
data: data
}).then((res) => {
return res
......@@ -20,6 +29,16 @@ export const HttpReq = {
method: 'get',
params: param
})
},
// 获取行政区划
addCustomer: function(data) {
return request({
url: '/api/bsw/users/addCustomer',
method: 'POST',
data: data
}).then((res) => {
return res
})
}
}
}
......
......@@ -2,43 +2,44 @@
<!-- 表单渲染 -->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelView" :visible="visible" :title="title" width="860px">
<el-form ref="formViewRef" :model="formData" :rules="rules" :status-icon="true" label-width="240px">
<el-form-item label="标识设置:" class="form-cell" prop="rank">
<el-form-item label="标识设置:" class="form-cell" prop="supplierLevel">
<div class="cell-box">
<el-radio-group v-model="formData.rank" size="mini">
<el-radio-group v-model="formData.supplierLevel" size="mini">
<el-radio v-for="item in dict.supplier_rank" :key="item.value" :label="item.value">
{{ item.label }}
</el-radio>
</el-radio-group>
</div>
</el-form-item>
<el-form-item label="企业名称:" class="form-cell" prop="name">
<el-form-item label="企业名称:" class="form-cell" prop="enterpriseName">
<div class="cell-box">
<el-input v-model="formData.name" placeholder="请输入企业名称" class="cell-input" />
<el-input v-model="formData.enterpriseName" placeholder="请输入企业名称" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="企业联系人:" class="form-cell" prop="xxxxx">
<el-form-item label="企业联系人:" class="form-cell" prop="enterpriseContactPerson">
<div class="cell-box">
<el-input v-model="formData.xxxxx" placeholder="请输入联系人" class="cell-input" />
<el-input v-model="formData.enterpriseContactPerson" placeholder="请输入联系人" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="企业联系人手机号:" class="form-cell" prop="xxxxx">
<el-form-item label="企业联系人手机号:" class="form-cell" prop="enterpriseContactPersonPhone">
<div class="cell-box">
<el-input v-model="formData.xxxxx" placeholder="请输入手机号" class="cell-input" />
<el-input v-model="formData.enterpriseContactPersonPhone" placeholder="请输入手机号" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="企业地址:" class="form-cell" prop="xxxxx">
<el-form-item label="企业地址:" class="form-cell" prop="enterpriseAddress">
<div class="cell-box">
<el-input v-model="formData.xxxxx" placeholder="请输入地址" class="cell-input" />
<el-input v-model="formData.enterpriseAddress" placeholder="请输入地址" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="企业邮箱:" class="form-cell" prop="xxxxx">
<el-form-item label="企业邮箱:" class="form-cell" prop="enterpriseEmail">
<div class="cell-box">
<el-input v-model="formData.xxxxx" placeholder="请输入邮箱" class="cell-input" />
<el-input v-model="formData.enterpriseEmail" placeholder="请输入邮箱" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="营业执照:" class="form-cell">
<el-form-item label="营业执照:" class="form-cell" prop="businessLicense">
<div class="cell-box">
<el-upload
ref="uploadCom"
action="/api/bsw/users/updateBusinessLicense"
name="businessLicense"
list-type="picture-card"
......@@ -55,103 +56,103 @@
<img width="100%" :src="dialogImageUrl">
</el-dialog>
</div>
{{ formData.picFileName }}
{{ formData.businessLicense }}
</el-form-item>
<el-form-item label="统一社会信用代码:" class="form-cell" prop="xxxxx">
<el-form-item label="统一社会信用代码:" class="form-cell" prop="unifiedSocialCreditCode">
<div class="cell-box">
<el-input v-model="formData.xxxxx" placeholder="请输入18位统一社会信用代码" class="cell-input" />
<el-input v-model="formData.unifiedSocialCreditCode" placeholder="请输入18位统一社会信用代码" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="纳税人识别号:" class="form-cell" prop="xxxxx">
<el-form-item label="纳税人识别号:" class="form-cell" prop="taxpayerIdentificationNumber">
<div class="cell-box">
<el-input v-model="formData.xxxxx" placeholder="请输入纳税人识别号" class="cell-input" />
<el-input v-model="formData.taxpayerIdentificationNumber" placeholder="请输入纳税人识别号" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="所属行业:" class="form-cell" prop="hy">
<el-form-item label="所属行业:" class="form-cell" prop="industry">
<div class="cell-box">
<el-select v-model="formData.hy" placeholder="无" class="cell-select">
<el-select v-model="formData.industry" placeholder="无" class="cell-select">
<el-option v-for="item in dict.industry_type" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
</el-form-item>
<el-form-item label="登记机关:" class="form-cell" prop="xxxxx">
<el-form-item label="登记机关:" class="form-cell" prop="registrationAuthority">
<div class="cell-box">
<el-input v-model="formData.xxxxx" placeholder="请输入登记机关" class="cell-input" />
<el-input v-model="formData.registrationAuthority" placeholder="请输入登记机关" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="法定代表人:" class="form-cell" prop="xxxxx">
<el-form-item label="法定代表人:" class="form-cell" prop="legalRepresentative">
<div class="cell-box">
<el-input v-model="formData.xxxxx" placeholder="请输入法定代表人" class="cell-input" />
<el-input v-model="formData.legalRepresentative" placeholder="请输入法定代表人" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="经营状态:" class="form-cell" prop="zt">
<el-form-item label="经营状态:" class="form-cell" prop="businessStatus">
<div class="cell-box">
<el-select v-model="formData.zt" placeholder="无" class="cell-select">
<el-select v-model="formData.businessStatus" placeholder="无" class="cell-select">
<el-option v-for="item in dict.business_status" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
</el-form-item>
<el-form-item label="成立日期:" class="form-cell" prop="zt">
<el-form-item label="成立日期:" class="form-cell" prop="establishmentDate">
<div class="cell-box">
<el-date-picker v-model="formData.date" type="date" placeholder="请选择日期" />
<el-date-picker v-model="formData.establishmentDate" type="date" placeholder="请选择日期" />
</div>
</el-form-item>
<el-form-item label="经营期限:" class="form-cell" prop="xxxxx">
<el-form-item label="经营期限(年):" class="form-cell" prop="operatingPeriod">
<div class="cell-box">
<el-input v-model="formData.xxxxx" type="number" placeholder="请输入数字" class="cell-input" />
<el-input v-model="formData.operatingPeriod" type="number" placeholder="请输入数字" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="审核/年检日期:" class="form-cell" prop="zt">
<el-form-item label="审核/年检日期:" class="form-cell" prop="annualInspectionDate">
<div class="cell-box">
<el-date-picker v-model="formData.date" type="date" placeholder="请选择日期" />
<el-date-picker v-model="formData.annualInspectionDate" type="date" placeholder="请选择日期" />
</div>
</el-form-item>
<el-form-item label="企业类型:" class="form-cell" prop="lx">
<el-form-item label="企业类型:" class="form-cell" prop="enterpriseType">
<div class="cell-box">
<el-select v-model="formData.lx" placeholder="无" class="cell-select">
<el-select v-model="formData.enterpriseType" placeholder="无" class="cell-select">
<el-option v-for="item in dict.company_type" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
</el-form-item>
<el-form-item label="注册资本:" class="form-cell" prop="xxxxx">
<el-form-item label="注册资本(万元):" class="form-cell" prop="registeredCapital">
<div class="cell-box">
<el-input v-model="formData.xxxxx" type="number" placeholder="请输入数字" class="cell-input" />
<el-input v-model="formData.registeredCapital" type="number" placeholder="请输入数字" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="注册地址:" class="form-cell" prop="lx">
<el-form-item label="注册地址:" class="form-cell">
<div class="cell-box">
<el-select v-model="formData.province" placeholder="省" style="width: 120px" @change="findAreaByCodeAndType(formData.province,2, 'cityOpts')">
<el-select v-model="formData.registeredAddressProvince" placeholder="省" style="width: 120px" @change="findAreaByCodeAndType(formData.registeredAddressProvince,2, 'cityOpts')">
<el-option v-for="item in provinceOpts" :key="item.id" :label="item.name" :value="item.code" />
</el-select>
<el-select v-model="formData.city" placeholder="市" style="width: 160px" @change="findAreaByCodeAndType(formData.city,3, 'countyOpts')">
<el-select v-model="formData.registeredAddressCity" placeholder="市" style="width: 160px" @change="findAreaByCodeAndType(formData.registeredAddressCity,3, 'countyOpts')">
<el-option v-for="item in cityOpts" :key="item.id" :label="item.name" :value="item.code" />
</el-select>
<el-select v-model="formData.county" placeholder="区/县" style="width: 160px">
<el-select v-model="formData.registeredAddressArea" placeholder="区/县" style="width: 160px">
<el-option v-for="item in countyOpts" :key="item.id" :label="item.name" :value="item.code" />
</el-select>
</div>
<div class="cell-box">
<el-input v-model="formData.xxxxx" placeholder="详细地址(例如:和平路北大街106号)" class="cell-input" />
<el-input v-model="formData.registeredAddressStreet" placeholder="详细地址(例如:和平路北大街106号)" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="经营范围:" class="form-cell" prop="xxxxx">
<el-form-item label="经营范围:" class="form-cell" prop="businessScope">
<div class="cell-box">
<el-input v-model="formData.textarea" type="textarea" placeholder="请输入文本内容" maxlength="1000" :autosize="{ minRows: 4, maxRows: 6}" show-word-limit resize="none" class="cell-input" />
<el-input v-model="formData.businessScope" type="textarea" placeholder="请输入文本内容" maxlength="1000" :autosize="{ minRows: 4, maxRows: 6}" show-word-limit resize="none" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="企业介绍:" class="form-cell" prop="xxxxx">
<el-form-item label="企业介绍:" class="form-cell" prop="enterpriseIntroduction">
<div class="cell-box">
<el-input v-model="formData.textarea" type="textarea" placeholder="请输入文本内容" maxlength="1000" :autosize="{ minRows: 4, maxRows: 6}" show-word-limit resize="none" class="cell-input" />
<el-input v-model="formData.enterpriseIntroduction" type="textarea" placeholder="请输入文本内容" maxlength="1000" :autosize="{ minRows: 4, maxRows: 6}" show-word-limit resize="none" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="主营产品:" class="form-cell" prop="xxxxx">
<el-form-item label="主营产品介绍:" class="form-cell" prop="mainProductsIntroduction">
<div class="cell-box">
<el-input v-model="formData.textarea" type="textarea" placeholder="请输入文本内容" maxlength="1000" :autosize="{ minRows: 4, maxRows: 6}" show-word-limit resize="none" class="cell-input" />
<el-input v-model="formData.mainProductsIntroduction" type="textarea" placeholder="请输入文本内容" maxlength="1000" :autosize="{ minRows: 4, maxRows: 6}" show-word-limit resize="none" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="业务范围:" class="form-cell" prop="xxxxx">
<el-form-item label="业务范围:" class="form-cell" prop="businessScopeIntroduction">
<div class="cell-box">
<el-input v-model="formData.textarea" type="textarea" placeholder="请输入文本内容" maxlength="1000" :autosize="{ minRows: 4, maxRows: 6}" show-word-limit resize="none" class="cell-input" />
<el-input v-model="formData.businessScopeIntroduction" type="textarea" placeholder="请输入文本内容" maxlength="1000" :autosize="{ minRows: 4, maxRows: 6}" show-word-limit resize="none" class="cell-input" />
</div>
</el-form-item>
</el-form>
......@@ -179,15 +180,46 @@ export default {
cityOpts: [],
countyOpts: [],
formData: {
rank: '1',
picFileName: '',
province: null,
city: null,
county: null,
name: ''
annualInspectionDate: '', // 审核日期
businessLicense: '', // 营业执照的照片名称
businessScope: '', // 经营范围
businessScopeIntroduction: '', // 业务范围介绍
businessStatus: '', // 经营状态
enterpriseAddress: '', // 企业地址
enterpriseContactPerson: '', // 企业联系人
enterpriseContactPersonPhone: '', // 企业联系人手机号
enterpriseEmail: '', // 企业邮箱
enterpriseIntroduction: '', // 企业介绍
enterpriseName: '', // 企业名称
enterpriseType: '', // 企业类型
establishmentDate: '', // 成立日期
industry: '', // 所属行业
legalRepresentative: '', // 法定代表人
mainProductsIntroduction: '', // 主营产品介绍
operatingPeriod: '', // 经营期限
registeredAddressArea: '', // 注册地址-区
registeredAddressCity: '', // 注册地址-市
registeredAddressProvince: '', // 注册地址-省
registeredAddressStreet: '', // 注册地址-街道
registeredCapital: '', // 注册资本
registrationAuthority: '', // 登记机关
supplierLevel: '1', // 供应商级别
taxpayerIdentificationNumber: '', // 纳税人识别号
unifiedSocialCreditCode: '', // 统一社会信用代码
sysUserId: null
},
rules: {
name: { required: true, message: '请输入企业名称', trigger: 'blur' }
enterpriseName: { required: true, message: '请填写企业名称', trigger: 'blur' },
enterpriseContactPerson: { required: true, message: '请填写企业联系人', trigger: 'blur' },
enterpriseContactPersonPhone: { required: true, message: '请填写企业联系人手机号', trigger: 'blur' },
enterpriseAddress: { required: true, message: '请填写企业地址', trigger: 'blur' },
businessLicense: { required: true, message: '请输上传营业执照', trigger: 'blur' },
unifiedSocialCreditCode: { required: true, message: '请填写统一社会信用代码', trigger: 'blur' },
industry: { required: true, message: '请选择所属行业', trigger: 'blur' },
registeredCapital: { required: true, message: '请填写注册资本', trigger: 'blur' },
enterpriseIntroduction: { required: true, message: '请填写企业介绍', trigger: 'blur' },
mainProductsIntroduction: { required: true, message: '请填写主营产品介绍', trigger: 'blur' },
businessScopeIntroduction: { required: true, message: '请填写业务范围介绍', trigger: 'blur' }
}
}
},
......@@ -202,6 +234,7 @@ export default {
this.visible = true
},
hideView() {
this.$refs.uploadCom.clearFiles()
this.$refs.formViewRef.resetFields()
this.cityOpts = []
this.countyOpts = []
......@@ -214,6 +247,13 @@ export default {
this.$refs.formViewRef.validate((valid, obj) => {
if (valid) {
console.log(this.formData)
HttpReq.backstageApi.addCustomer(this.formData).then((res) => {
this.$notify({
title: res.msg,
type: 'success',
duration: 2500
})
})
} else {
this.$message({
message: '表单信息有误,请核对无误后提交!',
......@@ -229,11 +269,20 @@ export default {
})
},
handleRemove(file, fileList) {
HttpReq.backstageApi.deleteBusinessLicense({
businessLicense: file.response.businessLicense
}).then((res) => {
this.$notify({
title: res.msg,
type: 'success',
duration: 2500
})
const arr = []
fileList.forEach(item => {
arr.push(item.response.businessLicense)
})
this.formData.picFileName = arr.join(';')
this.formData.businessLicense = arr.join(';')
})
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
......@@ -241,9 +290,9 @@ export default {
},
excelImported(response, file, fileList) {
this.$nextTick(() => {
const arr = this.formData.picFileName ? this.formData.picFileName.split(';') : []
const arr = this.formData.businessLicense ? this.formData.businessLicense.split(';') : []
arr.push(response.businessLicense)
this.formData.picFileName = arr.join(';')
this.formData.businessLicense = arr.join(';')
this.$notify({
title: '上传成功!',
type: 'success',
......@@ -255,11 +304,11 @@ export default {
switch (optsName) {
case 'provinceOpts':
case 'cityOpts':
this.formData.city = null
this.formData.county = null
this.formData.registeredAddressCity = null
this.formData.registeredAddressArea = null
break
case 'countyOpts':
this.formData.county = null
this.formData.registeredAddressArea = null
}
HttpReq.backstageApi.findAreaByCodeAndType({
code, type
......
......@@ -7,7 +7,7 @@
</div>
<div class="card-panel-description">
<div class="card-panel-text">
今日访
今日访
</div>
<count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num" />
</div>
......
......@@ -17,7 +17,7 @@ import LineChart from './dashboard/LineChart'
const lineChartData = {
newVisitis: {
dataArr: [100, 120, 161, 134, 105, 160, 165],
dataLable: '每日访'
dataLable: '每日访'
},
messages: {
dataArr: [200, 192, 120, 144, 160, 130, 140],
......
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