Commit 5a20be2e authored by jiangqihao's avatar jiangqihao

收货信息表

parent 91406d7e
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>
<BusinessTable v-bind="constant"/>
</div>
</template>
<script>
import constant from './constant'
export default {
props: {
// addBtnStart: {
// type: Boolean,
// default: true
// },
objectID: {
type: String,
default: ''
}
},
data() {
return {
constant: {},
}
},
watch: {
objectID: {
handler(newVal) {
constant.tableConfig.initialParams = {
BusinessObjectID: newVal
}
this.constant = constant
},
immediate: true,
deep: true
}
},
created() {
// this.addBtnStart = this.$route.query.addBtnStart
// var config = JSON.parse(JSON.stringify(constant))
// config.tableConfig.columns.handle = {
// label: '操作',
// hideInFilter: true,
// fixed: 'right',
// renderItem: (h, scope, listeners) => {
// return h(
// 'el-button',
// {
// on: {
// click: (e) => listeners.handleEdit(scope.row, scope.$index)
// },
// props: {
// type: 'text'
// }
// },
// '编辑')
// }
// }
// config.tableConfig.tableTitle = '收货地址'
// 设置表单的初始搜索条件,该条件一般不会发生改变
// if (this.$attrs['form-data'] && this.$attrs['form-data'].BusinessObjectID) {
// config.tableConfig.initialParams = {
// BusinessObjectID: this.$attrs['form-data'].BusinessObjectID,
// }
// } else {
// config.tableConfig.url = ''
// }
// this.constant = config
}
}
</script>
<style>
</style>
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
@request-success="handleSuccess" @request-success="handleSuccess"
/> />
</div> </div>
<CustomerAddress :objectID='objectID' v-if="showAdress"/>
<PersonalInFo :addBtnStart='addBtnStart' :dedeleBtnStart="dedeleBtnStart" :type-code="typeCode" :searchUrl="searchUrl"/> <PersonalInFo :addBtnStart='addBtnStart' :dedeleBtnStart="dedeleBtnStart" :type-code="typeCode" :searchUrl="searchUrl"/>
</div> </div>
</template> </template>
...@@ -19,14 +20,16 @@ ...@@ -19,14 +20,16 @@
<script> <script>
import Title from '@/components/Title' import Title from '@/components/Title'
import { customerCreate, provinceSearch, citySearch, districtSearch, customerGetOne } from '@/api/customers'; import { customerCreate, provinceSearch, citySearch, districtSearch, customerGetOne } from '@/api/customers';
import { qccGetOne } from '@/api/qcc' import { qccGetOne, Customer } from '@/api/qcc';
import PersonalInFo from './conponents/personal-info' import PersonalInFo from './conponents/personal-info'
import { uploadCode } from '@/api/upload' import { uploadCode } from '@/api/upload'
import CustomerAddress from './conponents/customersAdd-adress'
export default { export default {
components: { components: {
Title, Title,
PersonalInFo, PersonalInFo,
CustomerAddress,
customerCreate, customerCreate,
provinceSearch, provinceSearch,
citySearch, citySearch,
...@@ -42,6 +45,7 @@ export default { ...@@ -42,6 +45,7 @@ export default {
title: '注册信息', title: '注册信息',
dedeleBtnStart: true, dedeleBtnStart: true,
objectID: '', objectID: '',
showAdress: false,
addBtnStart: true, addBtnStart: true,
formData: {}, formData: {},
isShowSubmitBtn: false, isShowSubmitBtn: false,
...@@ -214,7 +218,7 @@ export default { ...@@ -214,7 +218,7 @@ export default {
type: 'input', type: 'input',
layout: 12, layout: 12,
label: '商务负责人姓名', label: '商务负责人姓名',
disabled: true disabled: true,
}, },
ExtBusinessPhone_SDK: { ExtBusinessPhone_SDK: {
type: 'input', type: 'input',
...@@ -313,7 +317,9 @@ export default { ...@@ -313,7 +317,9 @@ export default {
}, },
async getOneData() { async getOneData() {
this.loading = true this.loading = true
// this.objectId = JSON.parse(localStorage.getItem('USERINFO')).ExtCustomerObjectID_SDK
if (JSON.parse(localStorage.getItem('USERINFO')).ExtCustomerObjectID_SDK !== '') { if (JSON.parse(localStorage.getItem('USERINFO')).ExtCustomerObjectID_SDK !== '') {
this.objectID = JSON.parse(localStorage.getItem('USERINFO')).ExtCustomerObjectID_SDK
this.searchUrl = '/file/search' this.searchUrl = '/file/search'
customerGetOne({ objectID: JSON.parse(localStorage.getItem('USERINFO')).ExtCustomerObjectID_SDK }).then(res => { customerGetOne({ objectID: JSON.parse(localStorage.getItem('USERINFO')).ExtCustomerObjectID_SDK }).then(res => {
// this.searchUrl = '/file/search' // this.searchUrl = '/file/search'
...@@ -386,6 +392,8 @@ export default { ...@@ -386,6 +392,8 @@ export default {
} }
} }
this.sections.push(show) this.sections.push(show)
} else {
this.showAdress = true
} }
this.formData = res.results[0] this.formData = res.results[0]
this.addBtnStart = false this.addBtnStart = 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