Commit f22f0847 authored by jiangqihao's avatar jiangqihao

新增代理商

parent 7afac3ab
...@@ -99,14 +99,14 @@ export function customerCreate(data) { ...@@ -99,14 +99,14 @@ export function customerCreate(data) {
// }) // })
// } // }
// // 客户项目信息 // 客户项目信息
// export const project = { export const project = {
// createUrl: '/project/create', createUrl: '/address/create',
// searchUrl: '/project/search', searchUrl: '/address/search',
// detailUrl: '/project/getOne', detailUrl: '/address/getOne',
// updateUrl: '/project/update', updateUrl: '/address/update',
// deleteUrl: '/project/delete' deleteUrl: '/address/delete'
// } }
// // 客户市场信息 // // 客户市场信息
// export const market = { // export const market = {
......
// import dictionary from '@/api/dictionary'
const basicConfig = {
labelPosition: 'left',
isShowBackBtn: false,
isShowSubmitBtn: true,
formDesc: {
Name: {
type: 'lov',
label: '公司企称',
layout: 24
},
ExtSecondName_SDK: {
type: 'input',
label: '公司企称曾用名',
layout: 12,
},
ExtSocialUnifiedCreditCode_SDK: {
type: 'input',
label: '社会统一信用代码',
layout: 12
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
layout: 12,
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
layout: 12,
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '税务登记编号',
// layout: 12
// },
ExtAddressDetail_SDK: {
type: 'input',
label: '详细经营地址',
layout: 12,
},
}
}
export default { basicConfig }
import { project } from '@/api/customers'
const tableConfig = {
tableTitle: '上传附件',
url: project.searchUrl,
showPagination: false,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
Name: {
label: '联系人',
},
Phone: {
label: '电话'
},
Detail: {
label: '地址详细信息'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
class: 'el-icon-edit',
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
formDesc: {
Name: {
type: 'input',
layout: 12,
label: '联系人'
},
Phone: {
label: '电话',
type: 'input',
layout: 12,
},
Detail: {
label: '地址详细信息',
type: 'input',
layout: 12,
},
}
}
export default {
tableConfig,
formConfig,
...project
}
<template>
<div v-if="addBtnStart">
<BusinessTable v-bind="constant"/>
</div>
</template>
<script>
import constant from './constant'
export default {
props: {
addBtnStart: {
type: Boolean,
default: false
}
},
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID
}
this.constant = constant
},
watch: {
addBtnStart: {
handler(newVal) {
console.log(newVal)
},
immediate: true,
deep: true
}
}
}
</script>
<style>
</style>
\ No newline at end of file
import { project } from '@/api/customers'
const tableConfig = {
tableTitle: '收货地址',
url: project.searchUrl,
showPagination: false,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
Name: {
label: '联系人',
},
Phone: {
label: '电话'
},
Detail: {
label: '地址详细信息'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
on: {
click: (e) => listeners.handleEdit(scope.row, scope.$index)
},
class: 'el-icon-edit',
props: {
type: 'text'
}
},
'编辑')
}
}
}
}
const formConfig = {
labelPosition: 'left',
submitBtnText: '保存',
formDesc: {
Name: {
type: 'input',
layout: 12,
label: '联系人'
},
Phone: {
label: '电话',
type: 'input',
layout: 12,
},
Detail: {
label: '地址详细信息',
type: 'input',
layout: 12,
},
}
}
export default {
tableConfig,
formConfig,
...project
}
<template>
<div v-if="addBtnStart">
<BusinessTable v-bind="constant"/>
</div>
</template>
<script>
import constant from './constant'
export default {
props: {
addBtnStart: {
type: Boolean,
default: false
}
},
data() {
return {
constant: {}
}
},
created() {
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
AccountID: this.$route.query.objectID
}
this.constant = constant
},
watch: {
addBtnStart: {
handler(newVal) {
console.log(newVal)
},
immediate: true,
deep: true
}
}
}
</script>
<style>
</style>
\ No newline at end of file
// import dictionary from '@/api/dictionary'
const basicConfig = {
labelPosition: 'left',
isShowBackBtn: false,
isShowSubmitBtn: true,
formDesc: {
Name: {
type: 'lov',
label: '公司企称',
layout: 24
},
ExtSecondName_SDK: {
type: 'input',
label: '公司企称曾用名',
layout: 12,
},
ExtSocialUnifiedCreditCode_SDK: {
type: 'input',
label: '社会统一信用代码',
layout: 12
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
layout: 12,
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
layout: 12,
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '税务登记编号',
// layout: 12
// },
ExtAddressDetail_SDK: {
type: 'input',
label: '详细经营地址',
layout: 12,
},
}
}
const adressConfig = {
labelPosition: 'left',
isShowBackBtn: false,
isShowSubmitBtn: true,
formDesc: {
Name: {
type: 'select',
label: '省份',
layout: 24
},
ExtSecondName_SDK: {
type: 'input',
label: '城市',
layout: 12,
},
ExtSocialUnifiedCreditCode_SDK: {
type: 'input',
label: '县市',
layout: 12
},
ExtAddressDetail_SDK: {
type: 'input',
label: '详细经营地址',
layout: 12,
},
}
}
export default { basicConfig, adressConfig }
<template> <template>
<!-- <div> <div class="form-container">
<basicConfig />
<adressConfig />
</div> -->
<div>
<Title :title="title"> <Title :title="title">
<span>*</span>为必填项 <span>*</span>为必填项
</Title> </Title>
<div class="form-container"> <div>
<ele-form-section <ele-form-section
v-model="formData" v-model="formData"
:request-fn="handleSubmit" :request-fn="handleSubmit"
...@@ -16,21 +12,31 @@ ...@@ -16,21 +12,31 @@
@request-success="handleSuccess" @request-success="handleSuccess"
/> />
</div> </div>
<customerAddAddress :addBtnStart='addBtnStart'/>
<customerAddAccessory :addBtnStart='addBtnStart'/>
<!-- <div class="btn">
<el-button type="primary">提交保存</el-button>
</div> -->
</div> </div>
</template> </template>
<script> <script>
import Title from '@/components/Title' import Title from '@/components/Title'
import {customerCreate} from '@/api/customers' import { customerCreate } from '@/api/customers';
import customerAddAddress from './components/customersAdd-adress/index'
import customerAddAccessory from './components/customersAdd-accessory/index'
export default { export default {
components: { components: {
Title, Title,
customerCreate customerCreate,
customerAddAddress,
customerAddAccessory
}, },
data () { data () {
return { return {
title: '代理商新增', title: '代理商新增',
addBtnStart: false,
formData: {}, formData: {},
sections: [ sections: [
{ {
...@@ -159,13 +165,16 @@ export default { ...@@ -159,13 +165,16 @@ export default {
methods: { methods: {
handleSubmit (data) { handleSubmit (data) {
console.log(data) console.log(data)
this.addBtnStart = true
customerCreate(this.paramsToFormData(data)).then(res => { customerCreate(this.paramsToFormData(data)).then(res => {
console.log(res) console.log(res)
this.addBtnStart = true
this.$message.success('创建成功')
}) })
// return Promise.resolve() // return Promise.resolve()
}, },
handleSuccess () { handleSuccess () {
this.$message.success('创建成功') // this.$message.success('创建成功')
}, },
// 对象格式转化为键值对 // 对象格式转化为键值对
paramsToFormData(obj) { paramsToFormData(obj) {
...@@ -197,4 +206,7 @@ export default { ...@@ -197,4 +206,7 @@ export default {
margin-left: 45% !important; margin-left: 45% !important;
} }
} }
.btn {
margin-left: 45%;
}
</style> </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