Commit b0adcc57 authored by jiangqihao's avatar jiangqihao

高级认证

parent a10c5ec3
......@@ -76,6 +76,24 @@ export function districtSearch(data){
})
}
// 附件查询
export function fileInfoSearch(data){
return request({
url: '/search',
method: 'post',
data
})
}
// CCP高级认证
export function seniorCertification(data) {
return request({
url: '/customer/seniorCertification',
method: 'post',
data
})
}
// 客户发布记录
// 签约产品组
export function searchProduct(data) {
......
......@@ -165,9 +165,7 @@ export default {
},
watch: {
url: {
handler(newVal) {
},
handler(newVal) { },
deep: true
}
},
......
......@@ -123,16 +123,16 @@
{{ $t('navbar.dashboard') }}
</el-dropdown-item>
</router-link>
<router-link to="/profile/index">
<!-- <router-link to="/profile/index">
<el-dropdown-item>
{{ $t('navbar.profile') }}
</el-dropdown-item>
</router-link>
<router-link to="/changePass/index">
</router-link> -->
<!-- <router-link to="/changePass/index">
<el-dropdown-item>
修改密码
</el-dropdown-item>
</router-link>
</router-link> -->
<el-dropdown-item
divided
@click.native="logout"
......
......@@ -27,6 +27,27 @@ const customersRouter = {
meta: {title: '代理商新增'},
hidden: true,
},
{
path: '/customersDetails/total',
component: () => import('@/views/customers/customers-details/index.vue'),
name: 'customersDetails',
meta: {title: '总代理商详情'},
hidden: true,
},
{
path: '/customersDetails/province',
component: () => import('@/views/customers/customers-details/province.vue'),
name: 'customersDetails',
meta: {title: '省代理商详情'},
hidden: true,
},
{
path: '/customersDetails/area',
component: () => import('@/views/customers/customers-details/area.vue'),
name: 'customersDetails',
meta: {title: '城市代理商详情'},
hidden: true,
},
// {
// path: '/potential',
// component: () => import('@/views/customers/potential-customers'),
......
<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>
<div class="btn">
<el-button
type="primary"
:loading="loading"
@click="authentication"
>
认 证
</el-button>
</div>
<PersonalInFo :addBtnStart='addBtnStart' :dedeleBtnStart="dedeleBtnStart" :type-code="typeCode" :isShowEditBtn='btn'/>
</div>
</template>
<script>
import Title from '@/components/Title'
import { customerCreate, provinceSearch, citySearch, districtSearch, customerGetOne, seniorCertification } from '@/api/customers';
import { qccGetOne } from '@/api/qcc'
import PersonalInFo from '../personal-customers/conponents/personal-info'
import { uploadCode } from '@/api/upload'
export default {
components: {
Title,
PersonalInFo,
customerCreate,
provinceSearch,
citySearch,
districtSearch,
qccGetOne,
customerGetOne,
seniorCertification
},
data () {
return {
loading: false,
typeCode: uploadCode.customer,
title: '城市代理商详情',
addBtnStart: true,
dedeleBtnStart: true,
btn:false,
objectID: '',
btnStart: true,
formData: {},
isShowSubmitBtn: false,
isShowBackBtn: false,
sections: [
{
title: '基本信息',
formDesc: {
Name: {
type: 'input',
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: 12,
disabled: true,
},
ExtSocialUnifiedCreditCode_SDK: {
type: 'input',
label: '社会统一信用代码',
layout: 12,
disabled: true
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
layout: 12,
default: '',
disabled: true,
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
layout: 12,
disabled: true,
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '税务登记编号',
// layout: 10
// },
}
},
{
title: '地址信息',
formDesc: {
ExtProvince_SDK: {
type: 'select',
label: '省份',
layout: 12,
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: 12,
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: 12,
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: 12,
disabled: true,
},
}
},
{
title: '联系信息',
formDesc: {
ExtLeader_SDK: {
type: 'input',
label: '公司负责人姓名',
disabled: true,
layout: 12
},
ExtLeaderPhone_SDK: {
type: 'input',
label: '公司负责人联系方式',
disabled: true,
layout: 12
},
ExtLeaderEmail_SDK: {
type: 'input',
label: '公司负责人邮箱',
layout: 12,
disabled: true
},
ExtUnis_SDK: {
type: 'input',
layout: 12,
label: 'Unis业务负责人姓名',
disabled: true
},
ExtUnisPhone_SDK: {
type: 'input',
layout: 12,
label: 'Unis业务负责人联系方式',
disabled: true
},
ExtUnisEmail_SDK: {
type: 'input',
label: 'Unis业务负责人邮箱',
layout: 12,
disabled: true
},
ExtBusiness_SDK: {
type: 'input',
layout: 12,
label: '商务负责人姓名',
disabled: true
},
ExtBusinessPhone_SDK: {
type: 'input',
layout: 12,
label: '商务负责人联系方式',
disabled: true
},
ExtBusinessEmail_SDK: {
type: 'input',
label: '商务负责人邮箱',
layout: 12,
disabled: true
},
}
},
{
title: "签约信息",
formDesc: {
ExtChannelType_SDK: {
type: 'input',
label: '签约渠道类型',
layout: 12,
disabled: true
},
ExtLockRsp_SDK: {
type: 'input',
label: '签约渠道类型',
layout: 12,
disabled: true
},
ExtLockCity_SDK: {
type: 'input',
label: '城市范围覆盖',
layout: 12,
disabled: true
},
}
},
{
title: "合作日期",
formDesc: {
ExtStartDate_SDK: {
type: 'input',
label: '初始合作开始时间',
layout: 12,
disabled: true
},
ExtAuthenticationDate_SDK: {
type: 'input',
label: '高级认证日期',
layout: 12,
disabled: true
},
ExtEndDate_SDK: {
type: 'input',
label: '合作终止日期',
layout: 12,
disabled: true
},
}
}
],
rules: {}
}
},
// 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() {
this.getOneData()
},
methods: {
handleSubmit (data) {},
handleSuccess () {},
// 对象格式转化为键值对
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;
},
getOneData() {
const dataId = this.$route.query.objectID
customerGetOne({ objectID: dataId }).then(res => {
this.formData = res.results[0]
if(res.results[0].ExtCustomerType_SDK === '111') {
this.btnStart = false
}
})
},
authentication() {
this.loading = true
const val = {
objectID: this.formData.ObjectID,
extLeaderEmail_SDK: this.formData.ExtLeaderEmail_SDK,
name: this.formData.Name,
creationOn: this.formData.CreationOn,
extProvince_SDK: this.formData.ExtProvince_SDK,
extCity_SDK: this.formData.ExtCity_SDK,
}
seniorCertification(val).then(res => {
this.loading = false
this.$message.success('认证成功')
})
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .el-row--flex {
display: -webkit-box;
.el-col-14 {
width: 90%;
}
}
::v-deep .ele-form-btns{
display: none;
}
.basic-info {
::v-deep .ele-form-btns{
.el-form-item__content {
margin-left: 40% !important;
}
}
}
.btn {
// display: none;
margin-left: 90%;
padding-top: 30px;
}
</style>
<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>
<PersonalInFo :addBtnStart='addBtnStart' :dedeleBtnStart="dedeleBtnStart" :type-code="typeCode"/>
</div>
</template>
<script>
import Title from '@/components/Title'
import { customerCreate, provinceSearch, citySearch, districtSearch, customerGetOne } from '@/api/customers';
import { qccGetOne } from '@/api/qcc'
import PersonalInFo from '../personal-customers/conponents/personal-info'
import { uploadCode } from '@/api/upload'
export default {
components: {
Title,
PersonalInFo,
customerCreate,
provinceSearch,
citySearch,
districtSearch,
qccGetOne,
customerGetOne
},
data () {
return {
typeCode: uploadCode.customer,
title: '总代理商详情',
addBtnStart: true,
dedeleBtnStart: true,
objectID: '',
btnStart: true,
formData: {},
isShowSubmitBtn: false,
isShowBackBtn: false,
sections: [
{
title: '基本信息',
formDesc: {
Name: {
type: 'input',
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: 12,
disabled: true,
},
ExtSocialUnifiedCreditCode_SDK: {
type: 'input',
label: '社会统一信用代码',
layout: 12,
disabled: true
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
layout: 12,
default: '',
disabled: true,
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
layout: 12,
disabled: true,
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '税务登记编号',
// layout: 10
// },
}
},
{
title: '地址信息',
formDesc: {
ExtProvince_SDK: {
type: 'select',
label: '省份',
layout: 12,
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: 12,
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: 12,
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: 12,
disabled: true,
},
}
},
{
title: '联系信息',
formDesc: {
ExtLeader_SDK: {
type: 'input',
label: '公司负责人姓名',
disabled: true,
layout: 12
},
ExtLeaderPhone_SDK: {
type: 'input',
label: '公司负责人联系方式',
disabled: true,
layout: 12
},
ExtLeaderEmail_SDK: {
type: 'input',
label: '公司负责人邮箱',
layout: 12,
disabled: true
},
ExtUnis_SDK: {
type: 'input',
layout: 12,
label: 'Unis业务负责人姓名',
disabled: true
},
ExtUnisPhone_SDK: {
type: 'input',
layout: 12,
label: 'Unis业务负责人联系方式',
disabled: true
},
ExtUnisEmail_SDK: {
type: 'input',
label: 'Unis业务负责人邮箱',
layout: 12,
disabled: true
},
ExtBusiness_SDK: {
type: 'input',
layout: 12,
label: '商务负责人姓名',
disabled: true
},
ExtBusinessPhone_SDK: {
type: 'input',
layout: 12,
label: '商务负责人联系方式',
disabled: true
},
ExtBusinessEmail_SDK: {
type: 'input',
label: '商务负责人邮箱',
layout: 12,
disabled: true
},
}
},
{
title: "签约信息",
formDesc: {
ExtChannelType_SDK: {
type: 'input',
label: '签约渠道类型',
layout: 12,
disabled: true
},
ExtLockRsp_SDK: {
type: 'input',
label: '签约渠道类型',
layout: 12,
disabled: true
},
ExtLockCity_SDK: {
type: 'input',
label: '城市范围覆盖',
layout: 12,
disabled: true
},
}
},
{
title: "合作日期",
formDesc: {
ExtStartDate_SDK: {
type: 'input',
label: '初始合作开始时间',
layout: 12,
disabled: true
},
ExtAuthenticationDate_SDK: {
type: 'input',
label: '高级认证日期',
layout: 12,
disabled: true
},
ExtEndDate_SDK: {
type: 'input',
label: '合作终止日期',
layout: 12,
disabled: true
},
}
}
],
rules: {}
}
},
// 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() {
this.getOneData()
},
methods: {
handleSubmit (data) {},
handleSuccess () {},
// 对象格式转化为键值对
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;
},
getOneData() {
const dataId = this.$route.query.objectID
customerGetOne({ objectID: dataId }).then(res => {
this.formData = res.results[0]
if(res.results[0].ExtCustomerType_SDK === '111') {
this.btnStart = false
}
})
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .el-row--flex {
display: -webkit-box;
.el-col-14 {
width: 90%;
}
}
::v-deep .ele-form-btns{
display: none;
}
.basic-info {
::v-deep .ele-form-btns{
.el-form-item__content {
margin-left: 40% !important;
}
}
}
.btn {
display: none;
}
</style>
<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>
<PersonalInFo :addBtnStart='addBtnStart' :dedeleBtnStart="dedeleBtnStart" :type-code="typeCode"/>
</div>
</template>
<script>
import Title from '@/components/Title'
import { customerCreate, provinceSearch, citySearch, districtSearch, customerGetOne } from '@/api/customers';
import { qccGetOne } from '@/api/qcc'
import PersonalInFo from '../personal-customers/conponents/personal-info'
import { uploadCode } from '@/api/upload'
export default {
components: {
Title,
PersonalInFo,
customerCreate,
provinceSearch,
citySearch,
districtSearch,
qccGetOne,
customerGetOne
},
data () {
return {
typeCode: uploadCode.customer,
title: '省代理商详情',
addBtnStart: true,
dedeleBtnStart: true,
objectID: '',
btnStart: true,
formData: {},
isShowSubmitBtn: false,
isShowBackBtn: false,
sections: [
{
title: '基本信息',
formDesc: {
Name: {
type: 'input',
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: 12,
disabled: true,
},
ExtSocialUnifiedCreditCode_SDK: {
type: 'input',
label: '社会统一信用代码',
layout: 12,
disabled: true
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
layout: 12,
default: '',
disabled: true,
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
layout: 12,
disabled: true,
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '税务登记编号',
// layout: 10
// },
}
},
{
title: '地址信息',
formDesc: {
ExtProvince_SDK: {
type: 'select',
label: '省份',
layout: 12,
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: 12,
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: 12,
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: 12,
disabled: true,
},
}
},
{
title: '联系信息',
formDesc: {
ExtLeader_SDK: {
type: 'input',
label: '公司负责人姓名',
disabled: true,
layout: 12
},
ExtLeaderPhone_SDK: {
type: 'input',
label: '公司负责人联系方式',
disabled: true,
layout: 12
},
ExtLeaderEmail_SDK: {
type: 'input',
label: '公司负责人邮箱',
layout: 12,
disabled: true
},
ExtUnis_SDK: {
type: 'input',
layout: 12,
label: 'Unis业务负责人姓名',
disabled: true
},
ExtUnisPhone_SDK: {
type: 'input',
layout: 12,
label: 'Unis业务负责人联系方式',
disabled: true
},
ExtUnisEmail_SDK: {
type: 'input',
label: 'Unis业务负责人邮箱',
layout: 12,
disabled: true
},
ExtBusiness_SDK: {
type: 'input',
layout: 12,
label: '商务负责人姓名',
disabled: true
},
ExtBusinessPhone_SDK: {
type: 'input',
layout: 12,
label: '商务负责人联系方式',
disabled: true
},
ExtBusinessEmail_SDK: {
type: 'input',
label: '商务负责人邮箱',
layout: 12,
disabled: true
},
}
},
{
title: "签约信息",
formDesc: {
ExtChannelType_SDK: {
type: 'input',
label: '签约渠道类型',
layout: 12,
disabled: true
},
ExtLockRsp_SDK: {
type: 'input',
label: '签约渠道类型',
layout: 12,
disabled: true
},
ExtLockCity_SDK: {
type: 'input',
label: '城市范围覆盖',
layout: 12,
disabled: true
},
}
},
{
title: "合作日期",
formDesc: {
ExtStartDate_SDK: {
type: 'input',
label: '初始合作开始时间',
layout: 12,
disabled: true
},
ExtAuthenticationDate_SDK: {
type: 'input',
label: '高级认证日期',
layout: 12,
disabled: true
},
ExtEndDate_SDK: {
type: 'input',
label: '合作终止日期',
layout: 12,
disabled: true
},
}
}
],
rules: {}
}
},
// 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() {
this.getOneData()
},
methods: {
handleSubmit (data) {},
handleSuccess () {},
// 对象格式转化为键值对
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;
},
getOneData() {
const dataId = this.$route.query.objectID
customerGetOne({ objectID: dataId }).then(res => {
this.formData = res.results[0]
if(res.results[0].ExtCustomerType_SDK === '111') {
this.btnStart = false
}
})
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .el-row--flex {
display: -webkit-box;
.el-col-14 {
width: 90%;
}
}
::v-deep .ele-form-btns{
display: none;
}
.basic-info {
::v-deep .ele-form-btns{
.el-form-item__content {
margin-left: 40% !important;
}
}
}
.btn {
display: none;
}
</style>
......@@ -67,7 +67,7 @@ const tableConfig = {
icon: 'el-icon-edit-outline',
type: 'text'
}
}, i18n.t('详情')),
}, '详情'),
// h('el-button', {
// on: {
// click: (e) => listeners.handleTakeEffect(scope.row, 'takeEffect')
......
......@@ -47,16 +47,14 @@ export default {
},
created() {
this.tableListeners = {
// handleDetails: this.handleDetails, // 添加
// handleTakeEffect: this.handleTakeEffect, // 生效
handleEdit: this.handleEdit, // 编辑
// handleInvalid: this.handleInvalid // 失效
handleEdit: this.handleEdit, // 详情
}
},
methods: {
// 编辑
handleEdit() {
console.log("编辑")
handleEdit(row) {
console.log(row)
this.$router.push({ path: '/customersDetails/total',query: { objectID: row.ObjectID}})
},
// 添加
handleAdd() {
......
......@@ -51,7 +51,7 @@ const tableConfig = {
icon: 'el-icon-edit-outline',
type: 'text'
}
}, i18n.t('详情')),
}, '详情'),
// h('el-button', {
// on: {
// click: (e) => listeners.handleTakeEffect(scope.row, 'takeEffect')
......
......@@ -47,6 +47,7 @@ export default {
methods: {
// 编辑
handleEdit(row) {
this.$router.push({ path: '/customersDetails/area',query: { objectID: row.ObjectID}})
console.log("编辑", row)
},
// 添加
......
import { file } from '@/api/customers'
const tableConfig = {
tableTitle: '附件信息',
url: file.searchUrl,
// url: '',
isSearch: true,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
CreateOn_SDK: {
label: '创建时间'
},
FileName: {
label: '文件名'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h('div', [
// h('el-button', {
// on: {
// click: (e) => listeners.handleEdit(scope.row, 'edit')
// },
// props: {
// icon: 'el-icon-edit-outline',
// type: 'text'
// }
// }, '编辑'),
h('el-button', {
on: {
click: (e) => listeners.handleDownload(scope.row, 'takeEffect')
},
props: {
icon: 'el-icon-circle-check',
type: 'text'
}
}, '下载'),
])
},
}
}
}
const formConfig = {
labelPosition: 'left',
isShowBackBtn: false,
isShowSubmitBtn: false,
formDesc: {
TypeCode: {
vif: false,
label: '类型',
default: ''
},
FileDetails: {
label: '附件'
}
}
}
export default {
tableConfig,
formConfig,
...file
}
<template>
<div>
<FileTable :type-code="typeCode" :objectID='objectId'/>
<div class="table-container">
<form-title :title="tableConfig.tableTitle">
<div v-if="isShowEditBtn">
<el-button
type="primary"
icon="el-icon-plus"
@click="handleAdd()"
:disabled="addBtnStart"
>添加</el-button>
<el-button
type="danger"
icon="el-icon-delete"
@click="handleDelete()"
:disabled="dedeleBtnStart"
>删除</el-button>
</div>
</form-title>
<ele-table
ref="eleTable"
:multiple="false"
:listeners="tableListeners"
v-bind="tableConfig"
:expand-params="expandParams"
@handleSelectionChange="handleSelectionChange"
/>
<el-dialog
:title="dialogTitle"
:visible.sync="dialogFormVisible"
:loading="loading"
>
<ele-form
ref="form"
v-model="formData"
v-bind="formConfig"
>
<template v-slot:FileDetails>
<upload-btn
:objectID="formData.ObjectID"
:fileDetails="formData.FileDetails"
:file-list="fileList"
@change="changeFileList"
/>
</template>
</ele-form>
<div
slot="footer"
class="dialog-footer"
>
<el-button @click="dialogFormVisible = false">取消</el-button>
<el-button
type="primary"
@click="handleSave"
>保存</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { uploadCode } from '@/api/upload'
import FileTable from '@/views/public/file-info'
import constant from './constant'
import UploadBtn from './upload-btn'
import { file, fileInfoSearch } from '@/api/customers'
export default {
components: {
FileTable
},
components: { UploadBtn, fileInfoSearch },
name: 'FileInfo',
props: {
// addBtnStart: {
// type: Boolean,
// default: false
isShowEditBtn: {
type: Boolean,
default: true
},
// 不同的typeCode代表不同模块的附件
typeCode: {
type: String,
required: true
},
// 同一模块的附件通过moduleType区分
moduleType: {
type: String,
default: ''
},
// path: {
// type: String,
// required: true
// },
objectId: {
objectID: {
type: String,
default: ''
},
addBtnStart: {
type: Boolean,
default: true,
},
dedeleBtnStart: {
type: Boolean,
default: true,
}
},
data() {
return {
typeCode: uploadCode.customer,
// addBtnStart: false
tableConfig: constant.tableConfig,
formConfig: constant.formConfig,
expandParams: {},
desc: {},
tableListeners: {}, // 事件监听对象,供ele-table内部调用
formData: {},
fileList: [],
row: {},
$index: -1,
current: null,
dialogFormVisible: false,
dialogTitle: '',
loading: false,
// url: ''
}
},
watch: {
// addBtnStart: {
// handler(newVal) {
// console.log(newVal)
// },
// immediate: true,
// deep: true
// },
objectId: {
handler(newVal) {
// constant.tableConfig.initialParams = {
// BusinessObjectID: newVal
// }
},
isShowEditBtn(val) {
this.tableConfig.columns.handle.vif = val
},
btnStart: {
handler(val){},
deep: true,
immediate: true,
deep: true
}
},
created() {
// this.addBtnStart = this.$route.query.addBtnStart
this.tableConfig.columns.handle.vif = this.isShowEditBtn
constant.tableConfig.initialParams = {
BusinessObjectID: this.objectID || this.$route.query.objectID,
TypeCode: this.typeCode
}
if (this.moduleType) {
constant.tableConfig.initialParams.ModuleType = this.moduleType
}
constant.formConfig.formDesc.TypeCode.default = this.typeCode
// constant.formConfig.formDesc.Path.default = this.path
this.tableListeners = {
handleEdit: this.handleEdit,
handleDownload: this.handleDownload
}
},
methods: {
getDetails(params) {
this.loading = true
this.$request(file.detailUrl, params).then((res) => {
this.loading = false
this.formData = res.results[0]
})
},
handleAdd() {
this.dialogTitle = '创建附件'
this.formData = {}
this.fileList = []
this.dialogFormVisible = true
},
handleEdit(row, index) {
this.dialogTitle = '编辑附件'
this.$index = index
this.row = row
this.formData = {}
this.getDetails({ objectID: row.ObjectID })
this.fileList = []
this.dialogFormVisible = true
},
// 选择/删除临时文件
changeFileList(fileList) {
this.fileList = fileList
},
handleSave() {
const fd = this.$getUpdateChange(this.row, this.formData)
if (Object.keys(fd).length < 2 && this.fileList.length === 0) {
this.dialogFormVisible = false
return
}
const formData = new FormData()
for (const key in fd) {
formData.append(key, fd[key])
}
if (this.moduleType) {
formData.append('moduleType', this.moduleType)
}
this.fileList.forEach((item) => {
formData.append('file', item.raw)
})
// if (this.fileList.length > 0) {
// formData.path = this.path
// }
if (!this.formData.ObjectID) {
const businessObjectID =
this.$route.query.objectID || this.tableConfig.initialParams.objectID
formData.append('businessObjectID', businessObjectID)
formData.delete('objectID')
this.loading = true
this.$request(file.createUrl, formData).then(res => {
console.log(res)
this.loading = false
this.dialogFormVisible = false
this.fileList = []
this.$message.success('添加成功!')
this.$refs.eleTable.url = file.searchUrl
this.$refs.eleTable.handleSearch()
}).catch(() => {
this.loading = false
// this.tableConfig.url = file.searchUrl
})
} else {
formData.append('typeCode', this.typeCode)
this.$request(file.updateUrl, formData).then((res) => {
this.loading = false
this.dialogFormVisible = false
this.$message.success('修改成功!')
// this.tableConfig.url = file.searchUrl
this.$refs.eleTable.url = file.searchUrl
this.$refs.eleTable.handleSearch()
}).catch(() => {
this.loading = false
})
}
},
handleSelectionChange(selection) {
this.current = selection.length > 0 ? selection[0] : null
},
handleDelete() {
if (this.current === null) {
this.$message.warning('请先选择一行数据')
return
}
console.log(this.$refs.eleTable.tableData)
if (!this.$refs.eleTable.tableData[0].FileLabel == 1) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$request(file.deleteUrl, { objectID: this.current.ObjectID }).then(() => {
this.$message.success('删除成功!')
this.$refs.eleTable.url = file.searchUrl
this.$refs.eleTable.handleSearch()
}
)
})
} else {
this.$message.error('当前选中的附件禁止删除')
}
// this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// this.$request(file.deleteUrl, { objectID: this.current.ObjectID }).then(() => {
// this.$message.success('删除成功!')
// this.$refs.eleTable.url = file.searchUrl
// this.$refs.eleTable.handleSearch()
// }
// )
// })
},
handleDownload(row) {
window.open(row.FileURL)
}
}
}
</script>
<style>
</style>
\ No newline at end of file
</style>
<template>
<div>
<el-upload
v-if="vif"
:disabled="disabled"
ref="upload"
action="false"
:limit="5"
:multiple="multiple"
:on-change="handleChange"
:on-remove="handleRemove"
:auto-upload="false"
:on-exceed="handleExceed"
:file-list="fileList"
>
<el-button size="small" type="primary">上传文件</el-button>
</el-upload>
<!-- <upload-list
v-if="objectID"
v-bind="config"
:files="fileDetails"
@remove="handleRemoveReq" /> -->
</div>
</template>
<script>
import { file } from '@/api/customers'
import UploadList from '@/components/UploadFile/UploadList.vue'
export default {
components: { UploadList },
name: 'UploadBtn',
props: {
vif: {
type: Boolean,
default: true
},
disabled: {
type: Boolean,
default: false
},
objectID: {
type: String,
default: function() {
return this.$route.query.objectID
}
},
// 是否支持多选文件
multiple: {
type: Boolean,
default: false
},
// 已上传到服务器的文件列表
fileDetails: {
type: Array,
default: function() {
return []
}
},
config: {
type: Object,
default: function() {
return {}
}
},
fileList: {
type: Array,
default: function() {
return []
}
}
},
data() {
return {
// fileList: [],
}
},
watch: {
fileList: {
handler(newVal){},
deep: true,
immediate: true
}
},
created() {
},
methods: {
// 监控上传文件列表
handleChange(file, fileList) {
this.fileList = fileList
this.$emit('change', fileList)
},
// 移除文件
handleRemove(file, fileList) {
this.fileList = fileList
this.$emit('change', fileList)
},
handleExceed() {
this.$message.warning('上传文件超出文件数量')
}
// // 删除文件
// handleRemoveReq(index, item) {
// this.$request(file.deleteDetailUrl, [{ objectID: item.ObjectID }]).then(() => {
// this.$message.success('删除成功!')
// this.fileDetails.splice(index, 1)
// }
// )
// }
}
}
</script>
<style>
</style>
......@@ -12,7 +12,7 @@
@request-success="handleSuccess"
/>
</div>
<PersonalInFo :objectId='objectId'/>
<PersonalInFo :addBtnStart='addBtnStart' :dedeleBtnStart="dedeleBtnStart" :type-code="typeCode"/>
</div>
</template>
......@@ -21,6 +21,7 @@ import Title from '@/components/Title'
import { customerCreate, provinceSearch, citySearch, districtSearch, customerGetOne } from '@/api/customers';
import { qccGetOne } from '@/api/qcc'
import PersonalInFo from './conponents/personal-info'
import { uploadCode } from '@/api/upload'
export default {
components: {
......@@ -35,9 +36,11 @@ export default {
},
data () {
return {
title: '代理商新增',
addBtnStart: false,
objectId: '',
typeCode: uploadCode.customer,
title: '代理商详情',
dedeleBtnStart: true,
objectID: '',
addBtnStart: true,
formData: {},
isShowSubmitBtn: false,
isShowBackBtn: false,
......@@ -308,9 +311,14 @@ export default {
},
getOneData() {
const dataId = JSON.parse(localStorage.getItem('USERINFO')).ExtCustomerObjectID_SDK
this.$router.push({
path: '/Personal-customers',
query: { objectID: dataId}
})
customerGetOne({ objectID: dataId }).then(res => {
this.formData = res.results[0]
console.log(res)
this.addBtnStart = false
this.dedeleBtnStart = false
})
}
}
......
......@@ -51,7 +51,7 @@ const tableConfig = {
icon: 'el-icon-edit-outline',
type: 'text'
}
}, i18n.t('详情')),
}, '详情'),
// h('el-button', {
// on: {
// click: (e) => listeners.handleTakeEffect(scope.row, 'takeEffect')
......
......@@ -48,6 +48,7 @@ export default {
methods: {
// 编辑
handleEdit(row) {
this.$router.push({ path: '/customersDetails/province',query: { objectID: row.ObjectID}})
console.log("编辑", row)
},
// 添加
......
......@@ -134,14 +134,14 @@ export default {
data() {
const validateUsername = (rule, value, callback) => {
if (!value) {
callback(new Error('Please enter the correct user name'))
callback(new Error('请输入账号'))
} else {
callback()
}
}
const validatePassword = (rule, value, callback) => {
if (value.length < 6) {
callback(new Error('The password can not be less than 6 digits'))
callback(new Error('请输入密码'))
} else {
callback()
}
......@@ -178,7 +178,8 @@ export default {
rules: [
{
trigger: "blur",
message: "请输入原始密码"
message: "原始密码",
placeholder: "原始密码"
}
],
attrs: {
......@@ -187,35 +188,42 @@ export default {
}
},
NewPassword: {
type: "input",
type: "password",
label: "新密码",
layout: 14,
required: true,
rules: [
{
min: 8,
max: 16,
type: "string",
trigger: "blur",
message: "请输入新密码"
}
message: "密码由字母(区分大小写)和数字组成,长度不能小于8位" }
],
attrs: {
size: "mini",
clearable: false
clearable: false,
minlength: 8
}
},
AgainPassword: {
type: "input",
type: "password",
label: "确认密码",
layout: 14,
required: true,
rules: [
{
min: 8,
max: 16,
type: "string",
trigger: "blur",
message: "请输入新密码"
message: "密码由字母(区分大小写)和数字组成,长度不能小于8位"
}
],
attrs: {
size: "mini",
clearable: false
clearable: false,
minlength: 8
}
}
},
......
......@@ -23,7 +23,6 @@
:url="url"
@handleSelectionChange="handleSelectionChange"
/>
<el-dialog
:title="dialogTitle"
:visible.sync="dialogFormVisible"
......
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