Commit 4c848d5b authored by jiangqihao's avatar jiangqihao

asd

parent 84f8de39
......@@ -38,6 +38,15 @@ export function customerCreate(data) {
})
}
// 查询单条代理商信息
export function customerGetOne(data) {
return request({
url: '/customer/getOne',
method: 'post',
data
})
}
// 查询省
export function provinceSearch(data) {
return request({
......@@ -47,7 +56,6 @@ export function provinceSearch(data) {
})
}
// 查询市
export function citySearch(data){
return request({
......
......@@ -118,14 +118,14 @@
/>
</div>
<el-dropdown-menu slot="dropdown">
<router-link to="/profile/index">
<router-link to="/">
<el-dropdown-item>
{{ $t('navbar.profile') }}
{{ $t('navbar.dashboard') }}
</el-dropdown-item>
</router-link>
<router-link to="/">
<router-link to="/profile/index">
<el-dropdown-item>
{{ $t('navbar.dashboard') }}
{{ $t('navbar.profile') }}
</el-dropdown-item>
</router-link>
<router-link to="/changePass/index">
......
......@@ -27,12 +27,12 @@ const customersRouter = {
meta: {title: '代理商新增'},
hidden: true,
},
{
path: '/potential',
component: () => import('@/views/customers/potential-customers'),
name: 'PotentialCustomers',
meta: { title: 'potentialCustomers' }
},
// {
// path: '/potential',
// component: () => import('@/views/customers/potential-customers'),
// name: 'PotentialCustomers',
// meta: { title: 'potentialCustomers' }
// },
{
path: '/potential-list',
component: () => import('@/views/customers/potential-list'),
......@@ -40,13 +40,6 @@ const customersRouter = {
meta: {title: '省级代理商审批'},
hidden: true,
},
{
path: '/citypotential-list',
component: () => import('@/views/customers/citypotenial-list'),
name: 'CityPotenialList',
meta: {title: '城市代理商审批'},
hidden: true,
},
{
path: '/Provincial-agentList',
component: () => import('@/views/customers/provincial-agentList'),
......@@ -57,7 +50,25 @@ const customersRouter = {
path: '/Municipal-agentList',
component: () => import('@/views/customers/municipal-agentList'),
name: 'MunicipalAgentList',
meta: { title: '市级代理商' }
meta: { title: '城市代理商' }
},
{
path: '/potential',
component: () => import('@/views/customers/potential-customers'),
name: 'PotentialCustomers',
meta: { title: 'potentialCustomers' }
},
{
path: '/citypotential-list',
component: () => import('@/views/customers/citypotenial-list'),
name: 'CityPotenialList',
meta: {title: '城市代理商审批'},
hidden: true,
}, {
path: '/Personal-customers',
component: () => import('@/views/customers/personal-customers'),
name: 'PersonalCustomers',
meta: { title: '代理商信息' }
},
// {
// path: 'resource',
......
<template>
<div class="form-container">
<Title :title="title">
<span>*</span>为必填项
</Title>
<div class="basic-info">
<ele-form-section
v-model="formData"
:request-fn="handleSubmit"
:rules="rules"
:sections="sections"
@request-success="handleSuccess"
/>
</div>
<!-- <customerAddAddress :objectId='objectId' :form-data="$attrs['form-data']"/>
<customerAddAccessory :objectId='objectId' :form-data="$attrs['form-data']"/> -->
</div>
</template>
<script>
import Title from '@/components/Title'
import { customerCreate, provinceSearch, citySearch, districtSearch, customerGetOne } from '@/api/customers';
import { qccGetOne } from '@/api/qcc'
export default {
components: {
Title,
customerCreate,
provinceSearch,
citySearch,
districtSearch,
qccGetOne,
customerGetOne
},
data () {
return {
title: '代理商新增',
addBtnStart: false,
objectId: '',
formData: {},
isShowSubmitBtn: false,
isShowBackBtn: false,
sections: [
{
title: '基本信息',
formDesc: {
Name: {
type: 'lov',
label: '公司全称',
layout: 16,
code: 'qcc',
displayKey:'Name',
disabled: true,
btnTitle: '获取企查查信息',
returnFn: function(row) {
return {
Name: row.Name,
ExtSocialUnifiedCreditCode_SDK: row.CreditCode,
ExtCorporateName_SDK: row.OperName
}
},
},
ExtSecondName_SDK: {
type: 'input',
label: '公司全称曾用名',
layout: 10,
disabled: true,
},
ExtSocialUnifiedCreditCode_SDK: {
type: 'input',
label: '社会统一信用代码',
layout: 10,
disabled: true
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
layout: 10,
default: '',
disabled: true,
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
layout: 10,
disabled: true,
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '税务登记编号',
// layout: 10
// },
}
},
{
title: '地址信息',
formDesc: {
ExtProvince_SDK: {
type: 'select',
label: '省份',
layout: 10,
disabled: true,
options: async data => {
const res = await provinceSearch({})
var result = res.results.map(item => {
return {
text: item.Name,
value: item.Code
}
})
return result
},
},
ExtCity_SDK: {
type: 'select',
label: '地市',
layout: 10,
isOptions: true,
disabled: true,
optionsLinkageFields: ['ExtProvince_SDK'],
options: async data => {
if (!data.ExtProvince_SDK) {
return []
}
const res = await citySearch({
provinceCode: data.ExtProvince_SDK
})
var result = res.results.map(item => {
return {
text: item.Name,
value: item.Code
}
})
return result
},
},
ExtDistrict_SDK: {
type: 'select',
label: '县市',
layout: 10,
isOptions: true,
disabled: true,
optionsLinkageFields: ['ExtProvince_SDK', 'ExtCity_SDK'],
options: async data => {
if (!data.ExtCity_SDK) {
return []
}
const res = await districtSearch({
cityCode: data.ExtCity_SDK
})
var result = res.results.map(item => {
return {
text: item.Name,
value: item.Code
}
})
return result
},
},
ExtAddressDetail_SDK: {
type: 'input',
label: '详细经营地址',
layout: 10,
disabled: true,
},
}
},
{
title: '联系信息',
formDesc: {
ExtLeader_SDK: {
type: 'input',
label: '公司负责人姓名',
disabled: true,
layout: 10
},
ExtLeaderPhone_SDK: {
type: 'input',
label: '公司负责人联系方式',
disabled: true,
layout: 10
},
ExtLeaderEmail_SDK: {
type: 'input',
label: '公司负责人邮箱',
layout: 10,
disabled: true
},
ExtUnis_SDK: {
type: 'input',
layout: 10,
label: 'Unis业务负责人姓名',
disabled: true
},
ExtUnisPhone_SDK: {
type: 'input',
layout: 10,
label: 'Unis业务负责人联系方式',
disabled: true
},
ExtUnisEmail_SDK: {
type: 'input',
label: 'Unis业务负责人邮箱',
layout: 10,
disabled: true
},
ExtBusiness_SDK: {
type: 'input',
layout: 10,
label: '商务负责人姓名',
disabled: true
},
ExtBusinessPhone_SDK: {
type: 'input',
layout: 10,
label: '商务负责人联系方式',
disabled: true
},
ExtBusinessEmail_SDK: {
type: 'input',
label: '商务负责人邮箱',
layout: 10,
disabled: true
},
}
}
],
}
},
watch: {
'formData.ExtSocialUnifiedCreditCode_SDK': {
handler(newValue) {
console.log("单个属性监听", newValue)
qccGetOne({searchKey: newValue}).then(res =>{
this.sections[0].formDesc.ExtRegisteredCapital_SDK.default = res.results.Result.RegistCapi
console.log(this.sections[0].formDesc.ExtRegisteredCapital_SDK.default)
})
}
}
},
created() {
const perjectID = JSON.parse(localStorage.getItem('USERINFO'))
customerGetOne({objectID: perjectID.ObjectID}).then(res => {
console.log(res)
})
},
methods: {
handleSubmit (data) {
const formData = this.$translateToC4CData(data)
formData.extCustomerType_SDK = '121'
console.log(formData)
customerCreate(this.paramsToFormData(formData)).then(res => {
this.addBtnStart = true
this.objectId = res.results
const objectID = res.results
this.$router.push({
path: '/customersAdd',
query: { objectID: objectID, addBtnStart: false}
})
this.$message.success('创建成功')
})
// return Promise.resolve()
},
handleSuccess () {
// this.$message.success('创建成功')
},
// 对象格式转化为键值对
paramsToFormData(obj) {
const formData = new FormData();
Object.keys(obj).forEach((key) => {
if (obj[key] instanceof Array) {
obj[key].forEach((item) => {
formData.append(key, item);
});
return;
}
formData.append(key, obj[key]);
});
return formData;
},
}
}
</script>
<style lang="scss" scoped>
::v-deep .el-row--flex {
display: -webkit-box;
.el-col-14 {
width: 90%;
}
}
.basic-info {
::v-deep .ele-form-btns{
.el-form-item__content {
margin-left: 40% !important;
}
}
}
.btn {
display: none;
}
</style>
......@@ -103,7 +103,6 @@
<el-button
:loading="loading"
type="primary"
icon="el-icon-check"
@click="handleNext"
>确定</el-button>
</div>
......@@ -337,6 +336,7 @@ export default {
})
} else {
this.$message.error('确认密码出错!!')
this.loading = false
}
},
......
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