Commit f05f844b authored by rex's avatar rex

Merge branch 'dev' into 'master'

Dev

See merge request !4
parents 1facc496 6afa9e5c
......@@ -3,7 +3,7 @@ export const employee = {
createUrl: '/employee/create',
searchUrl: '/employee/search',
detailUrl: '/employee/getOne',
updateUrl: '/employee/update',
updateUrl: '/updatePassword',
confirmUpdateUrl: '/employee/confirmUpdate',
cancelUpdateUrl: '/employee/cancelUpdate'
}
......@@ -14,5 +14,6 @@ export const role = {
searchUrl: '/roleToMenu/search',
detailUrl: '/roleToMenu/getOne',
updateUrl: '/roleToMenu/update',
deleteUrl: '/roleToMenu/delete'
deleteUrl: '/roleToMenu/delete',
searchOneUrl: '/roleToMenu/searchOne',
}
......@@ -7,12 +7,22 @@ export const customer = {
detailUrl: '/customer/getOne',
updateUrl: '/customer/update',
deleteUrl: '/customer/delete',
updataAppUrl: '/customer/rejectCustomerCommit',
}
//查询省级供应商待审批列表
export const province = {
searchUrl: '/customer/searchProcessCustomer',
}
//查询审批单个列表
export function getCustomer(data) {
return request({
url: '/customer/getOne',
method: 'post',
data
})
}
// 查询全部代理商数据
export function getAllData(data) {
return request({
......@@ -21,6 +31,7 @@ export function getAllData(data) {
data
})
}
// 新增代理商
export function customerCreate(data) {
return request({
......@@ -30,6 +41,15 @@ export function customerCreate(data) {
})
}
// 查询单条代理商信息
export function customerGetOne(data) {
return request({
url: '/customer/getOne',
method: 'post',
data
})
}
// 查询省
export function provinceSearch(data) {
return request({
......@@ -39,7 +59,6 @@ export function provinceSearch(data) {
})
}
// 查询市
export function citySearch(data){
return request({
......@@ -58,6 +77,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) {
......@@ -67,6 +104,54 @@ export function searchProduct(data) {
data
})
}
//查询渠道类型
export function typeSearch(data){
return request({
url: '/commonSession/searchAll',
method: 'post',
data
})
}
//查询渠道类型
export function lockRsp(data){
return request({
url: '/customer/searchLockRsp',
method: 'post',
data
})
}
//审批的提交
export function ProcessApproval(data){
return request({
url: '/customer/processApproval',
method: 'post',
data
})
}
//审批流程历史记录
export function processHistory(data){
return request({
url: '/processHistory/searchAll',
method: 'post',
data
})
}
//获取附件列表
export function getModels(data){
return request({
url: '/file/search',
method: 'post',
data
})
}
//单条信息附件
export function getOneModel(data){
return request({
url: '/file/search',
method: 'post',
data
})
}
// // 客户发布记录
// export const releaseRecord = {
// createUrl: '/releaserecord/create',
......@@ -136,7 +221,7 @@ export function searchProduct(data) {
// 客户项目信息
export const project = {
createUrl: '/address/create',
createUrl: '/address/createByCustomer',
searchUrl: '/address/search',
detailUrl: '/address/getOne',
updateUrl: '/address/update',
......@@ -256,11 +341,12 @@ export const project = {
// 客户附件
export const file = {
createUrl: '/create',
searchUrl: '/search',
detailUrl: '/getOne',
updateUrl: '/update',
deleteUrl: '/delete',
createUrl: '/file/create',
searchUrl: '/file/search',
detailUrl: '/file/getOne',
updateUrl: '/file/update',
deleteUrl: '/file/delete',
batchCreate: '/file/batchCreate'
}
// export const businessLog = {
......
......@@ -178,21 +178,29 @@ export default {
qcc: {
searchUrl: '/qcc/search',
formDesc: {
Status: {
label: '状态',
type: 'input',
layout: 12,
vif: false,
},
Name: {
label: '公司名称',
type: 'input',
layout: 12
layout: 14
},
OperName: {
label: '法人',
type: 'input',
layout: 12
layout: 12,
vif: false,
},
CreditCode: {
label: '社会统一信用代码',
type: 'input',
layout: 12
}
layout: 12,
vif: false,
},
}
}
}
import request from '@/utils/request'
export const Qcc = {
searchUrl: '/qcc/search',
detailUrl: '/qcc/getOne'
......@@ -14,4 +16,12 @@ export const Customer = {
export const Common = {
searchUrl: '/commonSession/searchAll',
}
\ No newline at end of file
}
export function qccGetOne(data) {
return request({
url: '/qcc/getOne',
method: 'post',
data
})
}
......@@ -137,8 +137,8 @@ export default {
this.loading = true
const formData = this.$translateToC4CData(this.formData)
if (this.dialogTitle === this.desc.add) {
const accountID = this.$route.query.objectID || this.tableConfig.initialParams.objectID
formData.accountID = accountID
const BusinessObjectID = this.$route.query.objectID || this.tableConfig.initialParams.objectID
formData.businessObjectID = BusinessObjectID
this.$request(this.createUrl, [formData]).then(res => {
this.formData.objectID = res.results[0]
if (this.tableConfig.url) {
......
......@@ -111,7 +111,7 @@
</template>
<!-- 按钮区插槽 -->
<template v-slot:form-btn="{ btns }">
<!-- <template v-slot:form-btn="{ btns }">
<slot :btns="getBtns(btns)" name="form-btn">
<el-button
v-for="(btn, index) of btns"
......@@ -120,7 +120,7 @@
@click="btn.click"
>{{ btn.text }}</el-button>
</slot>
</template>
</template> -->
</ele-form>
</template>
......@@ -145,7 +145,7 @@ export default {
},
data() {
return {
getDeepFormDesc: null
getDeepFormDesc: null,
}
},
computed: {
......
......@@ -23,7 +23,7 @@
</template>
<el-option
v-for="option in options"
:key="option.value"
:key="option.id || option.value"
:label="option.text"
:value="option.value"
v-bind="option.attrs"
......@@ -67,6 +67,31 @@ export default {
}
},
methods: {
// 变化处理
// handleChange(value) {
// var result = {}
// if (!this.attrs.multiple) {
// this.options.forEach(item => {
// if (item.value === value) {
// result = item.value
// }
// })
// } else {
// result = {
// value: [],
// text: []
// }
// this.options.forEach(item => {
// value.forEach(jtem => {
// if (item.value === jtem) {
// result.value.push(item.value)
// result.text.push(item.text)
// }
// })
// })
// }
// this.$emit('input', result)
// },
changeOptions(q) {
if (this.remoteMethod) {
this.loading = true
......
......@@ -163,6 +163,12 @@ export default {
return finalColumns
}
},
watch: {
url: {
handler(newVal) { },
deep: true
}
},
created() {
// 根据url是否有值确定是否需要请求
if (this.url) {
......
......@@ -54,7 +54,7 @@
<el-button
type="primary"
@click="handleSearch"
>查询</el-button>
>{{btnTitle}}</el-button>
<el-button
plain
@click="handleReset"
......@@ -75,7 +75,7 @@
highlight-current-row
:header-cell-style="dialogHeaderCellStyle"
style="width: 100%;"
@row-dblclick="handleSelect"
@row-click="handleSelect"
@selection-change="(rows) => (selectedRows = rows)"
>
<el-table-column
......@@ -180,6 +180,10 @@ export default {
placeholder: {
type: String,
default: ''
},
btnTitle: {
type: String,
default: '查询'
}
},
data: function() {
......@@ -197,14 +201,14 @@ export default {
tableData: [],
pageData: {
total: 0,
currentPage: 0,
pageIndex: 0,
pageSize: 10
},
text: this.value,
selectedRows: [],
hovering: false,
focused: false,
loading: true
loading: false
}
},
computed: {
......@@ -231,15 +235,17 @@ export default {
var formConfig = Object.assign(this.defaultFormConfig, lovData[this.code])
this.formConfig = formConfig
this.dialogTableVisible = true
this.handleSearch()
// this.handleSearch()
},
handleSearch() {
this.pageData.currentPage = 1
this.fetchTable()
},
handleReset() {
this.tableData = []
this.pageData.total = 0
this.searchData = {}
this.handleSearch()
// this.handleSearch()
},
fetchTable() {
this.loading = true
......@@ -247,9 +253,24 @@ export default {
const data = Object.assign({}, this.initialParams, this.searchData, this.pageData)
const params = this.$translateToC4CData(data)
delete params.total
console.log(params)
if (this.code === 'qcc') {
params.searchKey = params.name
delete params.name
}
console.log("后",params)
this.$request(url, params).then(res => {
this.tableData = res.results.Result || []
this.pageData.total = Number(res.totalSize || 0)
if (this.code === 'qcc'){
if (res.results.Paging === null) {
this.pageData.total = 0
} else {
this.pageData.total = Number(res.results.Paging.TotalRecords || 0)
}
}else {
this.pageData.total = Number(res.results.Paging.TotalRecords || 0)
}
// this.pageData.total = Number(res.results.Paging.TotalRecords || 0)
this.loading = false
})
},
......
......@@ -66,9 +66,9 @@ export default {
externalLink: '外链',
profile: '个人中心',
customers: '代理商',
potentialCustomers: '省级代理商管理',
regularCustomers: '城市级代理商管理',
customers: '代理商管理',
potentialCustomers: '代理商审批',
regularCustomers: '城市级代理商',
enterpriseCustomers: '企业客户',
products: '产品',
......
......@@ -118,21 +118,21 @@
/>
</div>
<el-dropdown-menu slot="dropdown">
<router-link to="/profile/index">
<el-dropdown-item>
{{ $t('navbar.profile') }}
</el-dropdown-item>
</router-link>
<router-link to="/">
<el-dropdown-item>
{{ $t('navbar.dashboard') }}
</el-dropdown-item>
</router-link>
<router-link to="/changePass/index">
<!-- <router-link to="/profile/index">
<el-dropdown-item>
{{ $t('navbar.profile') }}
</el-dropdown-item>
</router-link> -->
<!-- <router-link to="/changePass/index">
<el-dropdown-item>
修改密码
</el-dropdown-item>
</router-link>
</router-link> -->
<el-dropdown-item
divided
@click.native="logout"
......
/*
* @Descripttion:
* @Author: 薛泽展
* @Date: 2021-10-12 12:29:05
* @Since: JDK1.8
*/
import router from './router'
import store from './store'
import { Message } from 'element-ui'
......@@ -14,9 +8,9 @@ import getPageTitle from '@/utils/get-page-title'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/prov-register', '/city-register', '/login', '/auth-redirect'] // no redirect whitelist
const whiteList = ['/prov-register', '/city-register','/prov-progress','/city-progress' ,'/login', '/auth-redirect'] // no redirect whitelist
router.beforeEach(async(to, from, next) => {
router.beforeEach(async (to, from, next) => {
// start progress bar
NProgress.start()
// set page title
......@@ -34,7 +28,6 @@ router.beforeEach(async(to, from, next) => {
// determine whether the user has obtained his permission roles through getInfo
const hasRoles = store.getters.roles && store.getters.roles.length > 0
if (hasRoles) {
console.log(to)
store.commit('permission/SET_CURRENTTOPNAVPATH', to.matched[0].path)
const routes = store.getters.permission_routes
routes.forEach(route => {
......@@ -47,10 +40,12 @@ router.beforeEach(async(to, from, next) => {
try {
// get user info
// note: roles must be a object array! such as: ['admin'] or ,['developer','editor']
const { roles } = await store.dispatch('user/getInfo')
const { ExtRoleCode_SDK } = await store.dispatch('user/getInfo')
// generate accessible routes map based on roles
const accessRoutes = await store.dispatch('permission/generateRoutes', roles)
// 获取按钮权限
await store.dispatch('permission/getPermissions', ExtRoleCode_SDK)
// 获取路由权限
const accessRoutes = await store.dispatch('permission/generateRoutes')
// dynamically add accessible routes
router.addRoutes(accessRoutes)
......@@ -62,31 +57,21 @@ router.beforeEach(async(to, from, next) => {
// remove token and go to login page to re-login
await store.dispatch('user/resetToken')
Message.error(error || 'Has Error')
next(`/login?redirect=${to.path}`)
next(`/login?redirect=${to.fullPath}`)
NProgress.done()
}
}
}
}
} else {
/* has no token*/
console.info('=========================111' + to.path)
if (whiteList.indexOf(to.path) !== -1) {
// in the free login whitelist, go directly
console.info('=========================2222')
next()
} else {
console.info('=========================3333')
// other pages that do not have permission to access are redirected to the login page.
if (to.path === '/city-register') {
next({ path: '/city-register'})
} else if (to.path === '/prov-register') {
next({ path : '/prov-register'})
} else {
next(`/login?redirect=${to.path}`)
NProgress.done()
}
// next(`/login?redirect=${to.path}`)
// NProgress.done()
next(`/login?redirect=${to.fullPath}`)
NProgress.done()
}
}
})
......
......@@ -8,7 +8,7 @@ import Layout from '@/layout'
/* Router Modules */
import customersRouter from './modules/customers'
// import contractRouter from './modules/contract'
import modelsRouter from './modules/models'
// import collectionRouter from './modules/collection'
// import inventoryRouter from './modules/inventory'
// import productsRouter from './modules/products'
......@@ -80,6 +80,16 @@ export const constantRoutes = [
component: () => import('@/views/login/city-register/index'),
hidden: true
},
{
path: '/prov-progress',
component: () => import('@/views/login/prov-progress/index'),
hidden: true
},
{
path: '/city-progress',
component: () => import('@/views/login/city-progress/index'),
hidden: true
},
{
path: '/auth-redirect',
component: () => import('@/views/login/auth-redirect'),
......@@ -155,7 +165,7 @@ export const asyncRoutes = [
/** when your routing map is too long, you can split it into small modules **/
customersRouter,
// contractRouter,
modelsRouter,
// collectionRouter,
// inventoryRouter,
// productsRouter,
......
......@@ -13,32 +13,77 @@ const customersRouter = {
icon: 'user'
},
children: [
// 总代理商管理
{
path: '/overview',
component: () => import('@/views/customers/customers-overview'),
name: 'CustomersOverview',
meta: { title: '总代理商管理' }
meta: { title: '总代理商' }
},
// 添加新代理商
{
path: '/customersAdd',
component: () => import('@/views/customers/customers-add'),
name: 'CustomersAdd',
name: 'CustomersOverviewAdd',
meta: {title: '代理商新增'},
hidden: true,
},
{
path: '/CustomersOverview-detail',
component: () => import('@/views/customers/customers-details/index.vue'),
name: 'CustomersOverviewDetail',
meta: {title: '总代理商详情'},
hidden: true,
},
{
path: '/CustomersProvince-detail',
component: () => import('@/views/customers/customers-details/province.vue'),
name: 'CustomersProvinceDetail',
meta: {title: '省代理商详情'},
hidden: true,
},
{
path: '/CustomersCity-detail',
component: () => import('@/views/customers/customers-details/area.vue'),
name: 'CustomersCityDetail',
meta: {title: '城市代理商详情'},
hidden: true,
},
{
path: '/potential-list',
component: () => import('@/views/customers/potential-list'),
name: 'CustomersProcessDetail',
meta: {title: '省级代理商审批'},
hidden: true,
},
{
path: '/Provincial-agentList',
component: () => import('@/views/customers/provincial-agentList'),
name: 'CustomersProvince',
meta: { title: '省级代理商' }
},
{
path: '/Municipal-agentList',
component: () => import('@/views/customers/municipal-agentList'),
name: 'CustomersCity',
meta: { title: '城市代理商' }
},
{
path: '/potential',
component: () => import('@/views/customers/potential-customers'),
name: 'PotentialCustomers',
name: 'CustomersProcess',
meta: { title: 'potentialCustomers' }
},
{
path: '/regular',
component: () => import('@/views/customers/regular-customers'),
name: 'RegularCustomers',
meta: { title: 'regularCustomers' }
path: '/citypotential-list',
component: () => import('@/views/customers/citypotenial-list'),
name: 'CustomersProcessDetail',
meta: {title: '城市代理商审批'},
hidden: true,
}, {
path: '/Personal-customers',
component: () => import('@/views/customers/personal-customers'),
name: 'CustomersMessage',
meta: { title: '代理商信息' }
},
// {
// path: 'resource',
......
/** When your routing table is too long, you can split it into small modules **/
import Layout from '@/layout'
const modelsRouter = {
path: '/models',
component: Layout,
redirect: '/models/potential',
name: 'Templates',
meta: {
topTitle: '模板',
title: '模板管理',
icon: 'documentation'
},
children: [
{
path: 'total',
component: () => import('@/views/models/total-models'),
name: 'TemplatesOverview',
meta: { title: '总代模板' }
},
{
path: 'prov',
component: () => import('@/views/models/prov-models'),
name: 'TemplatesProvince',
meta: { title: '省代模板' }
},
{
path: 'city',
component: () => import('@/views/models/city-models'),
name: 'TemplatesCity',
meta: { title: '城市模板' }
},
{
path: 'all',
component: () => import('@/views/models/all-models'),
name: 'TemplatesAll',
meta: { title: '全部模板' }
},
// {
// path: 'detail',
// component: () => import('@/views/contract/contract-detail/detail'),
// name: 'ContractDetail',
// hidden: true,
// meta: { title: '合同详情' }
// },
// {
// path: 'template-edit',
// component: () => import('@/views/contract/template-detail/edit'),
// name: 'ContractTemplateDetail',
// hidden: true,
// meta: { title: '合同模板编辑' }
// }
]
}
export default modelsRouter
import { asyncRoutes, constantRoutes } from '@/router'
import normalRequest from '@/utils/normal-request'
import { role } from '@/api/account'
/**
* Use meta.role to determine if the current user has permission
* @param roles
* @param route
*/
function hasPermission(roles, route) {
if (route.meta && route.meta.roles) {
return roles.some(role => route.meta.roles.includes(role))
} else {
return true
function hasPermission(route, paths) {
// console.log("route",route)
if (route.name) {
// console.log('name',route.name)
return paths.includes(route.name)
}
}
function treeToArray(menus, permissions, paths) {
// if (menus && Array.isArray(menus)) {
menus.forEach(item => {
// if (item.isTrue) {
permissions.push(item.ID)
// if (item.path) {
paths.push(item.Path)
// }
// }
// treeToArray(item.subMenus, permissions, paths)
})
// }
}
/**
* Filter asynchronous routing tables by recursion
* @param routes asyncRoutes
* @param roles
* @param permissions
*/
export function filterAsyncRoutes(routes, roles) {
export function filterAsyncRoutes(routes, paths) {
const res = []
routes.forEach(route => {
const tmp = { ...route }
if (hasPermission(roles, tmp)) {
if (hasPermission(route, paths)) {
if (tmp.children) {
tmp.children = filterAsyncRoutes(tmp.children, roles)
tmp.children = filterAsyncRoutes(tmp.children, paths)
}
res.push(tmp)
}
})
// console.log(res)
return res
}
const state = {
routes: [], // 项目所有的路由
addRoutes: [],
paths: JSON.parse(localStorage.getItem('PATHS')) || [], // 菜单路由
permissions: JSON.parse(localStorage.getItem('PERMISSIONS')) || [], // 按钮权限
sideRoutes: [], // 侧边栏路由,用于渲染侧边菜单栏
currentTopNavPath: '' // 当前一级路由地址,用于刷新时回显当前选中的顶端菜单栏
}
......@@ -46,6 +63,12 @@ const mutations = {
state.addRoutes = routes
state.routes = constantRoutes.concat(routes)
},
SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions
},
SET_PATHS: (state, paths) => {
state.paths = paths
},
SET_CURRENTTOPNAVPATH: (state, path) => {
state.currentTopNavPath = path
},
......@@ -55,17 +78,32 @@ const mutations = {
}
const actions = {
generateRoutes({ commit }, roles) {
generateRoutes({ commit }) {
return new Promise(resolve => {
const paths = JSON.parse(localStorage.getItem('PATHS'))
let accessedRoutes
if (roles.includes('admin')) {
accessedRoutes = asyncRoutes || []
const test = false // 是否测试阶段
if (test) {
accessedRoutes = asyncRoutes
} else {
accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
accessedRoutes = filterAsyncRoutes(asyncRoutes, paths)
}
commit('SET_ROUTES', accessedRoutes)
resolve(accessedRoutes)
})
},
async getPermissions({ commit }, roleId) {
await normalRequest(role.searchOneUrl, { id: roleId }).then(res => {
var menus = res.results.data.results[0].RoleToMenuMenuList
var permissions = []
var paths = []
treeToArray(menus, permissions, paths)
console.log(paths)
localStorage.setItem('PERMISSIONS', JSON.stringify(permissions))
localStorage.setItem('PATHS', JSON.stringify(paths))
commit('SET_PERMISSIONS', permissions)
commit('SET_PATHS', paths)
})
}
}
......
......@@ -38,7 +38,10 @@ const actions = {
data.roles = ['admin']
data.avatar = 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif'
commit('SET_TOKEN', data.ObjectID)
localStorage.setItem('USERINFO', JSON.stringify(data))
localStorage.setItem('CEINFO', JSON.stringify(data))
if (!data.ExtIsFistTime_SDK) {
localStorage.setItem('USERINFO', JSON.stringify(data))
}
setToken(data.ObjectID)
resolve()
}).catch(error => {
......
<template>
<div class="form-container">
<Title :title="title">
<span>*</span>为必填项
</Title>
<div class="basic-info" v-loading='loading'>
<ele-form-section v-model="formData"
:rules="rules"
:sections="sections">
<template v-slot:ExtLockRsp_SDK="{ formData }">
<!-- 插槽内容有el-form-item组件包裹 -->
<el-select v-if="formData.ExtProcessNode_SDK==2"
v-model="formData.ExtLockRsp_SDK"
style="width: 91%"
multiple
filterable
placeholder="请选择"
no-match-text="无匹配数据"
@change="handleSelectRSP">
<el-option v-for="item in province"
:key="item.ExtAgentID_SDK"
:label="item.Name"
:value="item.ExtAgentID_SDK" />
</el-select>
<el-input v-else
v-model="formData.ExtLockRspName_SDK"
disabled>
</el-input>
</template>
<template v-slot:ExtLockCity_SDK="{ formData }">
<!-- 插槽内容有el-form-item组件包裹 -->
<el-select v-if="formData.ExtProcessNode_SDK==2"
v-model="formData.ExtLockCity_SDK"
style="width: 91%"
multiple
filterable
placeholder="请选择"
no-match-text="无匹配数据"
@change='handleSelectCity'>
<el-option v-for="item in apptions"
:key="item.Code"
:label="item.Name"
:value="item.Code" />
</el-select>
<el-input v-else
v-model="formData.ExtLockCityName_SDK"
disabled>
</el-input>
</template>
<template v-slot:ExtChannelType_SDK="{ formData }">
<!-- 插槽内容有el-form-item组件包裹 -->
<el-select v-if="formData.ExtProcessNode_SDK==2"
v-model="formData.ExtChannelType_SDK"
style="width: 91%"
placeholder="请选择"
no-match-text="无匹配数据">
<el-option v-for="item in cOptions"
:key="item.keyword"
:label="item.content"
:value="item.keyword" />
</el-select>
<el-input v-else
v-model="formData.ExtChannelType_SDKText"
disabled>
</el-input>
</template>
</ele-form-section>
<div class="table-contain">
<div class="form-container">附件信息</div>
<el-table :data="tableData2"
border
style="width: 100%">
<el-table-column prop="FileName"
label="附件名称">
</el-table-column>
<el-table-column prop="CreateOn_SDK"
label="上传日期">
</el-table-column>
<el-table-column prop="CreateName_SDK"
label="操作者">
</el-table-column>
<el-table-column label="操作">
<el-link slot-scope="{ row }"
type="primary"
@click="btnLink(row)">下载</el-link>
</el-table-column>
</el-table>
<pagination v-show="TotalRecords>0"
:total="TotalRecords"
:page.sync="page.currentPage"
:limit.sync="page.pageSize"
@pagination="getList" />
</div>
<div class="table-contain">
<div class="form-container">审批意见</div>
<div class="btn">
<el-button type="primary"
@click="approve">审批</el-button>
<el-button type=""
@click="reject">退回</el-button>
</div>
<el-table :data="tableData"
border
style="width: 100%">
<el-table-column prop="Node"
label="审批节点">
</el-table-column>
<el-table-column prop="Result"
label="审批结果">
</el-table-column>
<el-table-column prop="CreateOn_SDK"
label="审批时间">
</el-table-column>
<el-table-column prop="Note"
label="备注">
</el-table-column>
</el-table>
<pagination v-show="TotalRecords>0"
:total="TotalRecords"
:page.sync="page.currentPage"
:limit.sync="page.pageSize"
@pagination="getList" />
</div>
<el-dialog title="审批意见"
:visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label-width=500>
<el-input v-model="form.note"
autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer"
class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary"
:loading="loading"
@click="approveClick">确 定</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import { getCustomer, typeSearch, lockRsp, ProcessApproval, processHistory, getOneModel } from '@/api/customers';
import Pagination from '@/components/Pagination'
import { Country } from '@/api/qcc'
export default {
components: {
Pagination,
Title,
},
data() {
return {
form: {},
dialogFormVisible: false,
title: '城市代理商审批',
addBtnStart: false,
objectId: '',
id: '',
status: 0,
loading: false,
tableData2: [],
formData: {},
province: [],
sections: [
{
title: '基本信息',
formDesc: {
Name: {
type: 'input',
label: '公司全称',
layout: 24,
code: 'qcc',
disabled: true,
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: '社会统一信用代码',
disabled: true,
layout: 12
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
disabled: true,
layout: 12,
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
disabled: true,
layout: 12,
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '税务登记编号',
// layout: 12
// },
}
},
{
title: '地址信息',
formDesc: {
ExtProvinceName_SDK: {
type: 'input',
label: '省份',
layout: 12,
disabled: true,
},
ExtCityName_SDK: {
type: 'input',
label: '城市',
layout: 12,
isOptions: true,
disabled: true,
},
ExtDistrictName_SDK: {
type: 'input',
label: '县市',
layout: 12,
isOptions: true,
disabled: true,
},
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: '公司负责人邮箱',
disabled: true,
layout: 12
},
ExtUnis_SDK: {
type: 'input',
layout: 12,
disabled: true,
label: 'Unis业务负责人姓名'
},
ExtUnisPhone_SDK: {
type: 'input',
layout: 12,
disabled: true,
label: 'Unis业务负责人联系方式'
},
ExtUnisEmail_SDK: {
type: 'input',
disabled: true,
label: 'Unis业务负责人邮箱',
layout: 12
},
// ExtBusiness_SDK: {
// type: 'input',
// layout: 12,
// disabled:true,
// label: '商务负责人姓名'
// },
// ExtBusinessPhone_SDK: {
// type: 'input',
// layout: 12,
// disabled:true,
// label: '商务负责人联系方式'
// },
// ExtBusinessEmail_SDK: {
// type: 'input',
// disabled:true,
// label: '商务负责人邮箱',
// layout: 12
// },
}
},
{
title: '签约信息',
formDesc: {
ExtChannelType_SDK: {
type: 'select',
label: '签约渠道类型',
layout: 12,
},
ExtLockRsp_SDK: {
type: 'select',
label: '锁定RSP',
layout: 12,
isOptions: true,
},
ExtLockCity_SDK: {
type: 'select',
label: '覆盖范围(城市)',
layout: 12,
},
}
},
],
tableData: [],
TotalRecords: 0,
page: {},
apptions: [],
cOptions: [],
// 同 vue-ele-form
rules: {
ExtChannelType_SDK: {required: true, message: '请选择签约渠道类型',trigger: 'change' },
ExtLockRsp_SDK: { required: true, message: '请选择锁定RSP' },
ExtLockCity_SDK: { required: true, message: '请选择城市覆盖范围' },
}
}
},
watch: {
},
created() {
this.id = this.$route.query.id
this.getList()
this.getHistoryList()
this.getFile()
},
methods: {
getFile() {
const page = {
currentPage: 1,
pageSize: 10,
businessObjectID: this.id
}
getOneModel(page).then(resp => {
this.tableData2 = resp.results
})
},
getList() {
this.loading=true
getCustomer({ objectID: this.id }).then((resp) => {
this.loading=false
resp.results[0].ExtChannelType_SDK=null
resp.results[0].ExtChannelType_SDKText=null
this.formData = resp.results[0]
lockRsp({ extProvince_SDK: resp.results[0].ExtProvince_SDK }).then((resp) => {
this.province = resp.results
})
const app = { provinceCode: resp.results[0].ExtProvince_SDK }
this.$request(Country.searchCity, app).then((resp) => {
this.apptions = resp.results
})
typeSearch({ code: 'ExtChannelType_SDK', module: 'Customer', content: 'CCP' }).then((resp) => {
this.cOptions = resp
})
})
},
getHistoryList() {
processHistory({ businessObjectID: this.id }).then((resp) => {
this.tableData = resp.results
})
},
btnLink(row) {
window.open(row.FileURL)
},
handleSelectRSP(value) {
console.log('val', value)
let cont = []
let val = []
this.province.forEach((el) => {
value.forEach((item) => {
if (el.ExtAgentID_SDK == item) {
cont.push(el.Name)
val.push(el.ExtAgentID_SDK)
}
})
})
this.formData.ExtLockRspName_SDK = cont//获取的 name
this.formData.ExtLockRsp_SDK = val//获取的 id
},
handleSelectCity(value) {
let cont = []
let val = []
this.apptions.forEach((el) => {
value.forEach((item) => {
if (el.Code == item) {
cont.push(el.Name)
val.push(el.Code)
}
})
})
this.formData.ExtLockCityName_SDK = cont//获取的 name
this.formData.ExtLockCity_SDK = val//获取的 id
},
handleSuccess() {
// this.$message.success('创建成功')
},
approve() {
this.dialogFormVisible = true
this.status = 1
},
reject() {
this.dialogFormVisible = true
this.status = 2
},
approveClick() {
const extLockRsp_SDK = this.formData.ExtLockRsp_SDK.toString()
const extLockRspName_SDK = this.formData.ExtLockRspName_SDK.toString()
const extLockCity_SDK = this.formData.ExtLockCity_SDK.toString()
const extLockCityName_SDK = this.formData.ExtLockCityName_SDK.toString()
const cc = {
extProcessNode_SDK: this.formData.ExtProcessNode_SDK,
extCustomerType_SDK: this.formData.ExtCustomerType_SDK,
extProvince_SDK: this.formData.ExtProvince_SDK,
objectID: this.formData.ObjectID,
extLockRsp_SDK: extLockRsp_SDK,
extLockRspName_SDK: extLockRspName_SDK,
extLockCity_SDK: extLockCity_SDK,
extLockCityName_SDK: extLockCityName_SDK,
extChannelType_SDK: this.formData.ExtChannelType_SDK
}
if (this.status == 1) {
const add = { customerDTO: cc, note: this.form.note, result: "approve" }
this.loading = true
ProcessApproval(add).then((resp) => {
this.loading = false
this.$message.success("审批成功!")
this.dialogFormVisible = false
this.$router.back()
})
} else {
const bdd = { customerDTO: cc, note: this.form.note, result: "reject" }
this.loading = true
ProcessApproval(bdd).then((resp) => {
this.loading = false
this.$message.success("退回成功!")
this.dialogFormVisible = false
this.$router.back()
})
}
},
// 对象格式转化为键值对
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 {
display: none;
}
}
}
.btn {
margin-left: 45%;
margin-bottom: 8px;
}
.table-contain {
padding: 0 80px 0 20px;
margin-left: 65px;
background: #fff;
border-radius: 2px;
}
</style>
<template>
<div v-if="addBtnStart">
<FileTable :type-code="typeCode" :objectID='objectId' />
<div>
<FileTable :type-code="typeCode" :objectID='objectId' :form-data="$attrs['form-data']"/>
</div>
</template>
......@@ -13,10 +13,10 @@ export default {
FileTable
},
props: {
addBtnStart: {
type: Boolean,
default: false
},
// addBtnStart: {
// type: Boolean,
// default: false
// },
objectId: {
type: String,
default: ''
......@@ -24,24 +24,30 @@ export default {
},
data() {
return {
typeCode: uploadCode.customer
typeCode: uploadCode.customer,
// addBtnStart: false
}
},
watch: {
addBtnStart: {
handler(newVal) {
console.log(newVal)
},
immediate: true,
deep: true
},
// addBtnStart: {
// handler(newVal) {
// console.log(newVal)
// },
// immediate: true,
// deep: true
// },
objectId: {
handler(newVal) {
console.log(newVal)
handler(newVal) {
// constant.tableConfig.initialParams = {
// BusinessObjectID: newVal
// }
},
immediate: true,
deep: true
}
},
created() {
// this.addBtnStart = this.$route.query.addBtnStart
}
}
</script>
......
<template>
<div v-if="addBtnStart">
<div>
<BusinessTable v-bind="constant"/>
</div>
</template>
......@@ -9,10 +9,10 @@ import constant from './constant'
export default {
props: {
addBtnStart: {
type: Boolean,
default: false
},
// addBtnStart: {
// type: Boolean,
// default: true
// },
objectId: {
type: String,
default: ''
......@@ -20,33 +20,60 @@ export default {
},
data() {
return {
constant: {}
constant: {},
// addBtnStart: true
}
},
watch: {
addBtnStart: {
handler(newVal) {
console.log(newVal)
},
immediate: true,
deep: true
},
// addBtnStart: {
// handler(newVal) {
// console.log(newVal)
// },
// immediate: true,
// deep: true
// },
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 = '收货地址'
// 设置表单的初始搜索条件,该条件一般不会发生改变
constant.tableConfig.initialParams = {
BusinessObjectID: this.objectId
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 = constant
this.constant = config
}
}
</script>
......
import { provinceSearch, citySearch, districtSearch } from '@/api/customers';
const sections = [
{
title: '基本信息',
formDesc: {
Name: {
type: 'lov',
label: '公司全称',
layout: 16,
code: 'qcc',
displayKey:'Name',
btnTitle: '获取企查查信息',
disabled:true,
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: 12
// },
}
},
{
title: '地址信息',
formDesc: {
ExtProvince_SDK: {
type: 'select',
label: '省份',
layout: 12,
options: async data => {
const res = await provinceSearch({})
var result = res.results.map(item => {
return {
text: item.Name,
value: item.Code
}
})
return result
},
disabled:true,
},
ExtCity_SDK: {
type: 'select',
label: '地市',
layout: 12,
isOptions: 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
},
disabled:true,
},
ExtDistrict_SDK: {
type: 'select',
label: '县市',
layout: 12,
isOptions: 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
},
disabled:true,
},
ExtAddressDetail_SDK: {
type: 'input',
label: '详细经营地址',
layout: 12,
disabled:true,
},
}
},
{
title: '联系信息',
formDesc: {
ExtLeader_SDK: {
type: 'input',
label: '公司负责人姓名',
layout: 12,
disabled:true,
},
ExtLeaderPhone_SDK: {
type: 'input',
label: '公司负责人联系方式',
layout: 12,
disabled:true,
},
ExtLeaderEmail_SDK: {
type: 'input',
label: '公司负责人邮箱',
layout: 12,
disabled:true,
},
ExtUnis_SDK: {
type: 'input',
layout: 12,
label: 'Unis业务负责人姓名',
disabled:true,
break: 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,
break: true,
},
ExtBusinessPhone_SDK: {
type: 'input',
layout: 12,
label: '商务负责人联系方式',
disabled:true,
},
ExtBusinessEmail_SDK: {
type: 'input',
label: '商务负责人邮箱',
layout: 12,
disabled:true,
},
}
}
]
export default sections
\ No newline at end of file
......@@ -3,7 +3,7 @@
<Title :title="title">
<span>*</span>为必填项
</Title>
<div>
<div class="basic-info" v-loading="loading">
<ele-form-section
v-model="formData"
:request-fn="handleSubmit"
......@@ -12,11 +12,10 @@
@request-success="handleSuccess"
/>
</div>
<customerAddAddress :addBtnStart='addBtnStart' :objectId='objectId'/>
<customerAddAccessory :addBtnStart='addBtnStart' :objectId='objectId'/>
<!-- <div class="btn">
<el-button type="primary">提交保存</el-button>
</div> -->
<div v-if='addBtnStart'>
<customerAddAddress :objectId='objectId' :form-data="$attrs['form-data']"/>
<customerAddAccessory :objectId='objectId' :form-data="$attrs['form-data']"/>
</div>
</div>
</template>
......@@ -25,8 +24,8 @@ import Title from '@/components/Title'
import { customerCreate, provinceSearch, citySearch, districtSearch } from '@/api/customers';
import customerAddAddress from './components/customersAdd-adress/index'
import customerAddAccessory from './components/customersAdd-accessory/index'
// import dictionary from '@/api/dictionary'
import { qccGetOne } from '@/api/qcc'
import constant from './constant'
export default {
components: {
......@@ -36,24 +35,29 @@ export default {
customerAddAccessory,
provinceSearch,
citySearch,
districtSearch
districtSearch,
qccGetOne
},
data () {
return {
title: '代理商新增',
addBtnStart: true,
loading: false,
addBtnStart: false,
displayBtn: false,
objectId: '',
formData: {},
province: [],
sections: [
{
title: '基本信息',
formDesc: {
Name: {
type: 'lov',
label: '公司称',
layout: 24,
label: '公司称',
layout: 16,
code: 'qcc',
displayKey:'Name',
btnTitle: '获取企查查信息',
disabled:false,
returnFn: function(row) {
return {
Name: row.Name,
......@@ -64,23 +68,28 @@ export default {
},
ExtSecondName_SDK: {
type: 'input',
label: '公司称曾用名',
label: '公司称曾用名',
layout: 12,
disabled:false,
},
ExtSocialUnifiedCreditCode_SDK: {
type: 'input',
label: '社会统一信用代码',
layout: 12
layout: 12,
disabled: this.displayBtn
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
layout: 12,
default: '',
disabled: true
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
layout: 12,
disabled: true
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
......@@ -92,7 +101,7 @@ export default {
{
title: '地址信息',
formDesc: {
ExtProvinceCode_SDK: {
ExtProvince_SDK: {
type: 'select',
label: '省份',
layout: 12,
......@@ -106,19 +115,20 @@ export default {
})
return result
},
disabled:false,
},
ExtCityCode_SDK: {
ExtCity_SDK: {
type: 'select',
label: '市',
label: '市',
layout: 12,
isOptions: true,
optionsLinkageFields: ['ExtProvinceCode_SDK'],
optionsLinkageFields: ['ExtProvince_SDK'],
options: async data => {
if (!data.ExtProvinceCode_SDK) {
if (!data.ExtProvince_SDK) {
return []
}
const res = await citySearch({
provinceCode: data.ExtProvinceCode_SDK
provinceCode: data.ExtProvince_SDK
})
var result = res.results.map(item => {
return {
......@@ -128,19 +138,20 @@ export default {
})
return result
},
disabled:false,
},
ExtDistrictCode_SDK: {
ExtDistrict_SDK: {
type: 'select',
label: '县市',
layout: 12,
isOptions: true,
optionsLinkageFields: ['ExtProvinceCode_SDK', 'ExtCityCode_SDK'],
optionsLinkageFields: ['ExtProvince_SDK', 'ExtCity_SDK'],
options: async data => {
if (!data.ExtCityCode_SDK) {
if (!data.ExtCity_SDK) {
return []
}
const res = await districtSearch({
cityCode: data.ExtCityCode_SDK
cityCode: data.ExtCity_SDK
})
var result = res.results.map(item => {
return {
......@@ -150,11 +161,13 @@ export default {
})
return result
},
disabled:false,
},
ExtAddressDetail_SDK: {
type: 'input',
label: '详细经营地址',
layout: 12,
disabled:false,
},
}
},
......@@ -164,73 +177,108 @@ export default {
ExtLeader_SDK: {
type: 'input',
label: '公司负责人姓名',
layout: 12
layout: 12,
disabled:false,
},
ExtLeaderPhone_SDK: {
type: 'input',
label: '公司负责人联系方式',
layout: 12
layout: 12,
disabled:false,
},
ExtLeaderEmail_SDK: {
type: 'input',
label: '公司负责人邮箱',
layout: 12
layout: 12,
disabled:false,
},
ExtUnis_SDK: {
type: 'input',
layout: 12,
label: 'Unis业务负责人姓名'
label: 'Unis业务负责人姓名',
disabled:false,
break: true,
},
ExtUnisPhone_SDK: {
type: 'input',
layout: 12,
label: 'Unis业务负责人联系方式'
label: 'Unis业务负责人联系方式',
disabled:false,
},
ExtUnisEmail_SDK: {
type: 'input',
label: 'Unis业务负责人邮箱',
layout: 12
layout: 12,
disabled:false,
},
ExtBusiness_SDK: {
type: 'input',
layout: 12,
label: '商务负责人姓名'
label: '商务负责人姓名',
disabled:false,
break: true,
},
ExtBusinessPhone_SDK: {
type: 'input',
layout: 12,
label: '商务负责人联系方式'
label: '商务负责人联系方式',
disabled:false,
},
ExtBusinessEmail_SDK: {
type: 'input',
label: '商务负责人邮箱',
layout: 12
layout: 12,
disabled:false,
},
}
}
],
// 同 vue-ele-form
rules: {
Name: {required: true, message: '名称必填'},
ExtSocialUnifiedCreditCode_SDK: { required: true, message: '名称必填' },
ExtSocialUnifiedCreditCode_SDK: { required: true, message: '名称必填' },
ExtRegisteredCapital_SDK: {required: true, message: '名称必填' },
ExtCorporateName_SDK: { required: true, message: '名称必填' },
Name: {required: true, message: '公司名称必填'},
ExtSocialUnifiedCreditCode_SDK: { required: true, message: '社会统一信用代码必填' },
ExtRegisteredCapital_SDK: {required: true, message: '注册资本必填' },
ExtCorporateName_SDK: { required: true, message: '法人必填' },
ExtProvince_SDK: { required: true, message: '省份必填' },
ExtDistrict_SDK: {required: true, message: '城市必填' },
ExtCity_SDK: { required: true, message: '县区必填' },
ExtLeader_SDK: { required: true, message: '公司负责人姓名' },
ExtLeaderPhone_SDK: { required: true, message: '公司负责人联系方式' },
ExtLeaderEmail_SDK: { required: true, message: '公司负责人邮箱' },
ExtUnis_SDK: { required: true, message: 'Unis业务负责人姓名' },
ExtUnisPhone_SDK: { required: true, message: 'Unis业务负责人联系方式' },
ExtUnisEmail_SDK: { required: true, message: 'Unis业务负责人邮箱' },
}
}
},
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)
})
}
}
},
methods: {
handleSubmit (data) {
console.log(data)
// this.addBtnStart = true
customerCreate(this.paramsToFormData(data)).then(res => {
// console.log(res)
const formData = this.$translateToC4CData(data)
formData.extCustomerType_SDK = '121'
this.loading = true
customerCreate(this.paramsToFormData(formData)).then(res => {
this.addBtnStart = true
this.objectId = res.results
const objectID = res.results
this.sections = constant
this.$router.push({
path: '/customersAdd',
query: { objectID: objectID, addBtnStart: false}
})
this.$message.success('创建成功')
this.loading = false
})
// return Promise.resolve()
},
handleSuccess () {
// this.$message.success('创建成功')
......@@ -260,12 +308,14 @@ export default {
width: 90%;
}
}
::v-deep .ele-form-btns{
.el-form-item__content {
margin-left: 45% !important;
.basic-info {
::v-deep .ele-form-btns{
.el-form-item__content {
margin-left: 40% !important;
}
}
}
.btn {
margin-left: 45%;
margin-left: 35%;
}
</style>
<template>
<div class="form-container" v-loading="loading">
<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="btnLoading"
@click="authentication"
:disabled="showAuthentication"
>
认 证
</el-button>
</div>
<div>
<PersonalInFo :addBtnStart='addBtnStart' :dedeleBtnStart="dedeleBtnStart" :type-code="typeCode" :isShowBtn='isShowBtn' :isShowEditBtn="isShowEditBtn"/>
</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,
btnLoading: false,
typeCode: uploadCode.customer,
title: '城市代理商详情',
addBtnStart: true,
dedeleBtnStart: true,
isShowBtn:true,
isShowEditBtn: false,
objectID: '',
btnStart: true,
formData: {},
isShowSubmitBtn: false,
isShowBackBtn: false,
showAuthentication: 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,
break: 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,
break: true,
},
ExtBusinessPhone_SDK: {
type: 'input',
layout: 12,
label: '商务负责人联系方式',
disabled: true
},
ExtBusinessEmail_SDK: {
type: 'input',
label: '商务负责人邮箱',
layout: 12,
disabled: true
},
}
},
{
title: "签约信息",
formDesc: {
ExtChannelType_SDKText: {
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() {
this.loading = true
const dataId = this.$route.query.objectID
customerGetOne({ objectID: dataId }).then(res => {
this.loading = false
this.formData = res.results[0]
if(res.results[0].ExtCustomerType_SDK === '111') {
this.btnStart = false
}
}).catch(() => {
this.loading = false
this.$$message.error("数据获取失败")
})
},
authentication() {
this.btnLoading = 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.btnLoading = 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" v-loading="loading">
<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 {
loading: false,
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,
break: 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,
break: true,
},
ExtBusinessPhone_SDK: {
type: 'input',
layout: 12,
label: '商务负责人联系方式',
disabled: true
},
ExtBusinessEmail_SDK: {
type: 'input',
label: '商务负责人邮箱',
layout: 12,
disabled: true
},
}
},
{
title: "签约信息",
formDesc: {
ExtChannelType_SDKText: {
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() {
this.loading = true
const dataId = this.$route.query.objectID
customerGetOne({ objectID: dataId }).then(res => {
this.formData = res.results[0]
this.loading = false
if(res.results[0].ExtCustomerType_SDK === '111') {
this.btnStart = false
}
}).catch(() => {
this.loading = false
this.$$message.error("数据获取失败")
})
}
}
}
</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" v-loading="loading">
<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 {
loading: false,
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,
break: 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,
break: true,
},
ExtBusinessPhone_SDK: {
type: 'input',
layout: 12,
label: '商务负责人联系方式',
disabled: true
},
ExtBusinessEmail_SDK: {
type: 'input',
label: '商务负责人邮箱',
layout: 12,
disabled: true
},
}
},
{
title: "签约信息",
formDesc: {
ExtChannelType_SDKText: {
type: 'input',
label: '签约渠道类型',
layout: 12,
disabled: true,
// value: 'ExtChannelType_SDKText'
},
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() {
this.loading = true
const dataId = this.$route.query.objectID
customerGetOne({ objectID: dataId }).then(res => {
this.loading = false
this.formData = res.results[0]
if(res.results[0].ExtCustomerType_SDK === '111') {
this.btnStart = false
}
}).catch(() => {
this.loading = false
this.$$message.error("数据获取失败")
})
}
}
}
</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>
......@@ -25,7 +25,7 @@ const tableConfig = {
// }, scope.row.ID)
// }
// },
ExtCustomerID_SDK: {
ExtAgentID_SDK: {
label: '代理商编码',
type: 'input'
},
......@@ -67,7 +67,7 @@ const tableConfig = {
icon: 'el-icon-edit-outline',
type: 'text'
}
}, i18n.t('table.edit')),
}, '详情'),
// h('el-button', {
// on: {
// click: (e) => listeners.handleTakeEffect(scope.row, 'takeEffect')
......
......@@ -21,6 +21,7 @@
v-bind="tableConfig"
:expand-params="expandParams"
:listeners="tableListeners"
:initialParams="initialParams"
@handleSelectionChange="handleSelectionChange"
/>
</div>
......@@ -38,26 +39,28 @@ export default {
return {
expandParams: {}, // 筛选条件
tableListeners: {}, // 事件监听对象,供ele-table内部调用
tableConfig: constant
tableConfig: constant,
initialParams: {
extCustomerType_SDK: "121"
}
}
},
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: '/CustomersOverview-detail',query: { objectID: row.ObjectID}})
},
// 添加
handleAdd() {
this.$router.push({ path: '/customersAdd' })
}
},
handleSelectionChange() {}
}
}
</script>
......
import i18n from '@/lang'
import { customer } from '@/api/customers'
const tableConfig = {
url: customer.searchUrl,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
ExtAgentID_SDK: {
label: '代理商编码',
type: 'input'
},
Name: {
label: '公司名称',
type: 'input',
showInSearch: true,
},
ExtCorporateName_SDK: {
label: '法定人代表',
type: 'input'
},
ExtSocialUnifiedCreditCode_SDK: {
label: '统一社会信用代码',
type: 'input'
},
CreationOn: {
label: '注册时间',
type: 'input'
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '代理商类型',
// showInSearch: true
// },
handle: {
label: '操作',
fixed: 'right',
minWidth: 100,
hideInFilter: true,
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.handleTakeEffect(scope.row, 'takeEffect')
// },
// props: {
// icon: 'el-icon-circle-check',
// type: 'text'
// }
// }, i18n.t('table.takeEffect')),
// h('el-button', {
// on: {
// click: (e) => listeners.handleInvalid(scope.row, 'invalid')
// },
// props: {
// icon: 'el-icon-circle-check',
// type: 'text'
// }
// }, i18n.t('table.invalid'))
])
}
}
}
}
export default tableConfig
<template>
<div class="app-container">
<ele-search
:columns="tableConfig.columns"
@handleSearch="handleSearch"
@handleReset="handleReset"
@handleFilter="handleFilter"
/>
<div class="table-container">
<ele-table
ref="eleTable"
v-bind="tableConfig"
:expand-params="expandParams"
:listeners="tableListeners"
:initialParams="initialParams"
@handleSelectionChange="handleSelectionChange"
/>
</div>
</div>
</template>
<script>
import constant from './constant'
import tableMixin from '@/mixins/table'
export default {
mixins: [tableMixin],
inject: ['reload'],
data() {
return {
expandParams: {}, // 筛选条件
tableListeners: {}, // 事件监听对象,供ele-table内部调用
tableConfig: constant,
initialParams: {
extCustomerType_SDK: '111'
}
}
},
created() {
this.tableListeners = {
// handleDetails: this.handleDetails, // 添加
// handleTakeEffect: this.handleTakeEffect, // 生效
handleEdit: this.handleEdit, // 编辑
// handleInvalid: this.handleInvalid // 失效
}
},
methods: {
// 编辑
handleEdit(row) {
this.$router.push({ path: '/CustomersCity-detail',query: { objectID: row.ObjectID}})
// console.log("编辑", row)
},
// 添加
handleAdd() {
this.$router.push({ path: '/customersAdd' })
},
handleSelectionChange() {
}
}
}
</script>
<style>
</style>
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 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="true"
: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"
:loading='loading'
>保存</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import constant from './constant'
import UploadBtn from './upload-btn'
import { file, fileInfoSearch } from '@/api/customers'
export default {
components: { UploadBtn, fileInfoSearch },
name: 'FileInfo',
props: {
isShowEditBtn: {
type: Boolean,
default: true
},
// 不同的typeCode代表不同模块的附件
typeCode: {
type: String,
required: true
},
// 同一模块的附件通过moduleType区分
moduleType: {
type: String,
default: ''
},
// path: {
// type: String,
// required: true
// },
objectID: {
type: String,
default: ''
},
addBtnStart: {
type: Boolean,
default: true,
},
dedeleBtnStart: {
type: Boolean,
default: true,
},
isShowBtn: {
type: Boolean,
default: true,
}
},
data() {
return {
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: {
isShowEditBtn: {
handler(val){},
deep: true,
immediate: true
// this.tableConfig.columns.handle.vif = val
},
addBtnStart: {
handler(val){},
deep: true,
immediate: true,
},
dedeleBtnStart: {
handler(val){},
deep: true,
immediate: true,
},
isShowBtn: {
handler(val){},
deep: true,
immediate: true,
}
},
created() {
this.tableConfig.columns.handle.vif = this.isShowBtn
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
console.log(businessObjectID)
formData.append('businessObjectID', businessObjectID)
formData.delete('objectID')
this.loading = true
this.$request(file.createUrl, formData).then(() => {
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
})
} 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>
<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 {}
},
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>
<template>
<div class="form-container" v-loading="loading">
<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 './conponents/personal-info'
import { uploadCode } from '@/api/upload'
export default {
components: {
Title,
PersonalInFo,
customerCreate,
provinceSearch,
citySearch,
districtSearch,
qccGetOne,
customerGetOne
},
data () {
return {
loading: false,
typeCode: uploadCode.customer,
title: '代理商详情qer',
dedeleBtnStart: true,
objectID: '',
addBtnStart: 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_SDKText: {
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;
},
async getOneData() {
this.loading = true
customerGetOne({ objectID: JSON.parse(localStorage.getItem('USERINFO')).ExtCustomerObjectID_SDK }).then(res => {
this.formData = res.results[0]
this.addBtnStart = false
this.loading = false
this.dedeleBtnStart = false
this.$router.push({
path: '/Personal-customers',
query: { objectID: JSON.parse(localStorage.getItem('USERINFO')).ExtCustomerObjectID_SDK}
})
}).catch(() => {
this.loading = false
this.$$message.error("数据获取失败")
})
}
}
}
</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>
......@@ -25,26 +25,26 @@ const tableConfig = {
}, scope.row.ID)
}
},
ExtProductGroup_SDK: {
label: '签约产品组',
showInSearch: true,
type: 'select',
fixed: 'left',
isOptions:'true',
options: async data => {
const res = await searchProduct({code:'ExtProductGroup_SDK',module:'Customer'})
var result = res.map(item => {
return {
text: item.content,
value: item.keyword
}
})
return result
},
},
// ExtProductGroup_SDK: {
// label: '签约产品组',
// showInSearch: true,
// type: 'select',
// fixed: 'left',
// isOptions:'true',
// options: async data => {
// const res = await searchProduct({code:'ExtProductGroup_SDK',module:'Customer'})
// var result = res.map(item => {
// return {
// text: item.content,
// value: item.keyword
// }
// })
// return result
// },
// },
},
columns: {
ExtCustomerID_SDK: {
ExtAgentID_SDK: {
label: '代理商编码',
type: 'input'
},
......
......@@ -11,7 +11,6 @@
<ele-table
ref="eleTable"
v-bind="tableConfig"
:expand-params="expandParams"
:listeners="tableListeners"
/>
......@@ -27,7 +26,6 @@ export default {
inject: ['reload'],
data() {
return {
expandParams: {}, // 筛选条件
tableListeners: {}, // 事件监听对象,供ele-table内部调用
tableConfig: constant
}
......@@ -43,7 +41,12 @@ export default {
methods: {
// 编辑
handleEdit(val) {
this.$router.push({ path: '/customersAdd',query:{id:val.ObjectID} })
if(val.ExtCustomerType_SDK=='101'){
this.$router.push({ path: '/potential-list',query:{id:val.ObjectID} })
}else{
this.$router.push({ path: '/citypotential-list',query:{id:val.ObjectID} })
}
},
}
......
<template>
<div class="form-container">
<Title :title="title">
<span>*</span>为必填项
</Title>
<div class="basic-info" v-loading='loading'>
<ele-form-section v-model="formData"
:rules="rules"
:sections="sections">
<template v-slot:ExtLockCity_SDK="{ formData }">
<!-- 插槽内容有el-form-item组件包裹 -->
<el-select v-if="formData.ExtProcessNode_SDK==2"
v-model="formData.ExtLockCity_SDK"
:disabled="!formData.ExtProcessNode_SDK==2"
style="width: 91%"
multiple
filterable
placeholder="请选择"
no-match-text="无匹配数据"
@change="handleSelectCity">
<el-option v-for="item in province"
:key="item.Code"
:label="item.Name"
:value="item.Code" />
</el-select>
<el-input v-else
v-model="formData.ExtLockCityName_SDK"
disabled>
</el-input>
</template>
</ele-form-section>
<div class="table-contain">
<div class="form-container">附件信息</div>
<el-table :data="tableData2"
border
style="width: 100%">
<el-table-column prop="FileName"
label="附件名称">
</el-table-column>
<el-table-column prop="CreateOn_SDK"
label="上传日期">
</el-table-column>
<el-table-column prop="CreateName_SDK"
label="操作者">
</el-table-column>
<el-table-column label="操作">
<el-link slot-scope="{ row }"
type="primary"
@click="btnLink(row)">下载</el-link>
</el-table-column>
</el-table>
<pagination v-show="TotalRecords>0"
:total="TotalRecords"
:page.sync="page.currentPage"
:limit.sync="page.pageSize"
@pagination="getList" />
</div>
<div class="table-contain">
<div class="form-container">审批意见</div>
<div class="btn">
<el-button type="primary"
@click="approve">审批</el-button>
<el-button type=""
@click="reject">退回</el-button>
</div>
<el-table :data="tableData"
border
style="width: 100%">
<el-table-column prop="Node"
label="审批节点">
</el-table-column>
<el-table-column prop="Result"
label="审批结果">
</el-table-column>
<el-table-column prop="CreateOn_SDK"
label="审批时间">
</el-table-column>
<el-table-column prop="Note"
label="备注">
</el-table-column>
</el-table>
<pagination v-show="TotalRecords>0"
:total="TotalRecords"
:page.sync="page.currentPage"
:limit.sync="page.pageSize"
@pagination="getList" />
</div>
<el-dialog title="审批意见"
:visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label-width=500>
<el-input v-model="form.note"
autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer"
class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary"
:loading="loading"
@click="approveClick">确 定</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import { getCustomer, typeSearch, lockRsp, ProcessApproval, processHistory, province, getOneModel } from '@/api/customers';
import { Country } from '@/api/qcc'
import Pagination from '@/components/Pagination'
export default {
components: {
Pagination,
Title,
},
data() {
return {
form: {},
dialogFormVisible: false,
title: '省级代理商审批',
addBtnStart: false,
objectId: '',
id: '',
status: 0,
loading: false,
formData: {},
province: [],
tableData2: [],
sections: [
{
title: '基本信息',
formDesc: {
Name: {
type: 'input',
label: '公司全称',
layout: 24,
code: 'qcc',
disabled: true,
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: '社会统一信用代码',
disabled: true,
layout: 12
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
disabled: true,
layout: 12,
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
disabled: true,
layout: 12,
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '税务登记编号',
// layout: 12
// },
}
},
{
title: '地址信息',
formDesc: {
ExtProvinceName_SDK: {
type: 'input',
label: '省份',
layout: 12,
disabled: true,
},
ExtCityName_SDK: {
type: 'input',
label: '城市',
layout: 12,
isOptions: true,
disabled: true,
},
ExtDistrictName_SDK: {
type: 'input',
label: '县市',
layout: 12,
isOptions: true,
disabled: true,
},
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: '公司负责人邮箱',
disabled: true,
layout: 12
},
ExtUnis_SDK: {
type: 'input',
layout: 12,
disabled: true,
label: 'Unis业务负责人姓名'
},
ExtUnisPhone_SDK: {
type: 'input',
layout: 12,
disabled: true,
label: 'Unis业务负责人联系方式'
},
ExtUnisEmail_SDK: {
type: 'input',
disabled: true,
label: 'Unis业务负责人邮箱',
layout: 12
},
ExtBusiness_SDK: {
type: 'input',
layout: 12,
disabled: true,
label: '商务负责人姓名'
},
ExtBusinessPhone_SDK: {
type: 'input',
layout: 12,
disabled: true,
label: '商务负责人联系方式'
},
ExtBusinessEmail_SDK: {
type: 'input',
disabled: true,
label: '商务负责人邮箱',
layout: 12
},
}
},
{
title: '签约信息',
formDesc: {
ExtChannelType_SDKText: {
type: 'input',
label: '签约渠道类型',
layout: 12,
disabled: true
},
ExtProductGroup_SDK: {
type: 'input',
label: '签约产品组',
layout: 12,
disabled: true
},
ExtTotalAgent_SDK: {
type: 'input',
label: '签约总代',
layout: 12,
disabled: true
},
ExtLockCity_SDK: {
type: 'select',
label: '覆盖范围(城市)',
layout: 12,
},
}
},
],
tableData: [],
TotalRecords: 0,
page: {},
// 同 vue-ele-form
rules: {
ExtLockCity_SDK: { required: true, message: '请选择覆盖城市范围' },
}
}
},
watch: {
// province:{
// handler(newVal,oldVal){
// this.province=newVal
// },
// deep:true
// }
},
created() {
this.id = this.$route.query.id
this.getList()
this.getHistoryList()
this.getFile()
},
methods: {
getFile() {
const page = {
currentPage: 1,
pageSize: 10,
businessObjectID: this.id
}
getOneModel(page).then(resp => {
this.tableData2 = resp.results
})
},
btnLink(row) {
window.open(row.FileURL)
},
getList() {
this.loading=true
getCustomer({ objectID: this.id }).then((resp) => {
this.loading=false
this.formData = resp.results[0]
const app = { provinceCode: resp.results[0].ExtProvince_SDK }
this.$request(Country.searchCity, app).then((resp) => {
this.province = resp.results
})
})
},
getHistoryList() {
processHistory({ businessObjectID: this.id }).then((resp) => {
this.tableData = resp.results
})
},
handleSelectCity(value) {
let cont = []
let val = []
this.province.forEach((el) => {
value.forEach((item) => {
if (el.Code == item) {
cont.push(el.Name)
val.push(el.Code)
}
})
})
this.formData.ExtLockCityName_SDK = cont//获取的 name
this.formData.ExtLockCity_SDK = val//获取的 id
},
handleSuccess() {
// this.$message.success('创建成功')
},
approve() {
this.dialogFormVisible = true
this.status = 1
},
reject() {
this.dialogFormVisible = true
this.status = 2
},
approveClick() {
const ExtLockCity_SDK = this.formData.ExtLockCity_SDK.toString()
const ExtLockCityName_SDK = this.formData.ExtLockCityName_SDK.toString()
const cc = {
extProcessNode_SDK: this.formData.ExtProcessNode_SDK,
extCustomerType_SDK: this.formData.ExtCustomerType_SDK,
extProvince_SDK: this.formData.ExtProvince_SDK,
objectID: this.formData.ObjectID,
extLockRsp_SDK: this.formData.extLockRsp_SDK,
extLockCity_SDK: ExtLockCity_SDK,
extLockCityName_SDK: ExtLockCityName_SDK,
extChannelType_SDK: this.formData.ExtChannelType_SDK
}
if (this.status == 1) {
const add = { customerDTO: cc, note: this.form.note, result: "approve" }
this.loading = true
ProcessApproval(add).then((resp) => {
this.loading = false
this.$message.success("审批成功!")
this.dialogFormVisible = false
this.$router.back()
})
} else {
this.loading = true
const bdd = { customerDTO: cc, note: this.form.note, result: "reject" }
ProcessApproval(bdd).then((resp) => {
this.loading = false
this.$message.success("退回成功!")
this.dialogFormVisible = false
this.$router.back()
})
}
},
// 对象格式转化为键值对
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 {
display: none;
}
}
}
.btn {
margin-left: 45%;
margin-bottom: 8px;
}
.table-contain {
padding: 0 80px 0 20px;
margin-left: 65px;
background: #fff;
border-radius: 2px;
}
</style>
import i18n from '@/lang'
import { customer } from '@/api/customers'
const tableConfig = {
url: customer.searchUrl,
defaultColumns: {
minWidth: 120,
showOverflowTooltip: true,
align: 'center'
},
columns: {
ExtAgentID_SDK: {
label: '代理商编码',
type: 'input'
},
Name: {
label: '公司名称',
type: 'input',
showInSearch: true,
},
ExtCorporateName_SDK: {
label: '法定人代表',
type: 'input'
},
ExtSocialUnifiedCreditCode_SDK: {
label: '统一社会信用代码',
type: 'input'
},
CreationOn: {
label: '注册时间',
type: 'input'
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '代理商类型',
// showInSearch: true
// },
handle: {
label: '操作',
fixed: 'right',
minWidth: 100,
hideInFilter: true,
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.handleTakeEffect(scope.row, 'takeEffect')
// },
// props: {
// icon: 'el-icon-circle-check',
// type: 'text'
// }
// }, i18n.t('table.takeEffect')),
// h('el-button', {
// on: {
// click: (e) => listeners.handleInvalid(scope.row, 'invalid')
// },
// props: {
// icon: 'el-icon-circle-check',
// type: 'text'
// }
// }, i18n.t('table.invalid'))
])
}
}
}
}
export default tableConfig
<template>
<div class="app-container">
<ele-search
:columns="tableConfig.columns"
@handleSearch="handleSearch"
@handleReset="handleReset"
@handleFilter="handleFilter"
/>
<div class="table-container">
<ele-table
ref="eleTable"
v-bind="tableConfig"
:expand-params="expandParams"
:listeners="tableListeners"
:initialParams="initialParams"
@handleSelectionChange="handleSelectionChange"
/>
</div>
</div>
</template>
<script>
import constant from './constant'
import tableMixin from '@/mixins/table'
export default {
mixins: [tableMixin],
inject: ['reload'],
data() {
return {
expandParams: {}, // 筛选条件
tableListeners: {}, // 事件监听对象,供ele-table内部调用
tableConfig: constant,
initialParams: {
extCustomerType_SDK: '101'
}
}
},
created() {
this.tableListeners = {
// handleDetails: this.handleDetails, // 添加
// handleTakeEffect: this.handleTakeEffect, // 生效
handleEdit: this.handleEdit, // 编辑
// handleInvalid: this.handleInvalid // 失效
}
},
methods: {
// 编辑
handleEdit(row) {
this.$router.push({ path: '/CustomersProvince-detail',query: { objectID: row.ObjectID}})
console.log("编辑", row)
},
// 添加
handleAdd() {
this.$router.push({ path: '/customersAdd' })
},
handleSelectionChange() {
}
}
}
</script>
<style>
</style>
<template>
<div class="dashboard-editor-container">
<panel-group @handleSetLineChartData="handleSetLineChartData" />
<div class="two-column">
<div class="left" />
<SystemNotice />
</div>
<div class="two-column">
<div class="left" />
</div>
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<line-chart :chart-data="lineChartData" />
</el-row>
<el-row :gutter="32">
<el-col
:xs="24"
:sm="24"
:lg="8"
>
<div class="chart-wrapper">
<raddar-chart />
</div>
</el-col>
<el-col
:xs="24"
:sm="24"
:lg="8"
>
<div class="chart-wrapper">
<pie-chart />
</div>
</el-col>
<el-col
:xs="24"
:sm="24"
:lg="8"
>
<div class="chart-wrapper">
<bar-chart />
</div>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col
:xs="{span: 24}"
:sm="{span: 24}"
:md="{span: 24}"
:lg="{span: 12}"
:xl="{span: 12}"
style="padding-right:8px;margin-bottom:30px;"
>
<transaction-table />
</el-col>
<el-col
:xs="{span: 24}"
:sm="{span: 12}"
:md="{span: 12}"
:lg="{span: 6}"
:xl="{span: 6}"
style="margin-bottom:30px;"
>
<todo-list />
</el-col>
<el-col
:xs="{span: 24}"
:sm="{span: 12}"
:md="{span: 12}"
:lg="{span: 6}"
:xl="{span: 6}"
style="margin-bottom:30px;"
>
<box-card />
</el-col>
</el-row>
<div>
<h2>首页</h2>
</div>
</template>
<script>
import SystemNotice from './components/SystemNotice'
// import ComplaintsAndSuggestions from './components/ComplaintsAndSuggestions'
import PanelGroup from './components/PanelGroup'
import LineChart from './components/LineChart'
import RaddarChart from './components/RaddarChart'
import PieChart from './components/PieChart'
import BarChart from './components/BarChart'
import TransactionTable from './components/TransactionTable'
import TodoList from './components/TodoList'
import BoxCard from './components/BoxCard'
const lineChartData = {
newVisitis: {
expectedData: [100, 120, 161, 134, 105, 160, 165],
actualData: [120, 82, 91, 154, 162, 140, 145]
},
messages: {
expectedData: [200, 192, 120, 144, 160, 130, 140],
actualData: [180, 160, 151, 106, 145, 150, 130]
},
purchases: {
expectedData: [80, 100, 121, 104, 105, 90, 100],
actualData: [120, 90, 100, 138, 142, 130, 130]
},
shoppings: {
expectedData: [130, 140, 141, 142, 145, 150, 160],
actualData: [120, 82, 91, 154, 162, 140, 130]
}
}
export default {
name: 'DashboardAdmin',
components: {
SystemNotice,
// ComplaintsAndSuggestions,
PanelGroup,
LineChart,
RaddarChart,
PieChart,
BarChart,
TransactionTable,
TodoList,
BoxCard
},
data() {
return {
lineChartData: lineChartData.newVisitis
}
},
methods: {
handleSetLineChartData(type) {
this.lineChartData = lineChartData[type]
}
}
}
</script>
<style lang="scss" scoped>
.dashboard-editor-container {
padding: 32px;
background-color: rgb(240, 242, 245);
position: relative;
.github-corner {
position: absolute;
top: 0px;
border: 0;
right: 0;
}
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
margin-bottom: 32px;
}
}
</script>
@media (max-width: 1024px) {
.chart-wrapper {
padding: 8px;
}
}
<style>
.two-column {
display: flex;
justify-content: space-between;
margin-bottom: 30px;
> div {
width: 49%;
background-color: #fff;
}
}
</style>
</style>
\ No newline at end of file
<template>
<div class="form-container">
<Title :title="title">
</Title>
<div style="height:50px;display: flex;align-items: center;float: right;
margin-right: 90px;">
<div class="parallelogram2"></div>
<div style="margin-right:15px">当前节点</div>
<!-- <div class="parallelogram3"></div>
<div style="margin-right:15px">未审批</div> -->
</div>
<div style="height:150px;display: flex;margin: 20px 20%;">
<div class="div_list">
<div id="parallelogram"
:class="{'bgcolor':formData.ExtProcessNode_SDK==1}">
<div class="div_txt">提交</div>
</div>
<div class="parallelogram1"></div>
<div class="triangle_right"></div>
</div>
<div class="div_list">
<div id="parallelogram"
:class="{'bgcolor':formData.ExtProcessNode_SDK==2}">
<div class="div_txt2">审批_1区域渠道经理</div>
</div>
<div class="parallelogram1"></div>
<div class="triangle_right"></div>
</div>
<div class="div_list">
<div id="parallelogram"
:class="{'bgcolor':formData.ExtProcessNode_SDK==3}">
<div class="div_txt2">审批_2渠道销售总监</div>
</div>
<div class="parallelogram1"></div>
<div class="triangle_right"></div>
</div>
<div class="div_list">
<div id="parallelogram"
:class="{'bgcolor':formData.ExtProcessNode_SDK==4}">
<div class="div_txt2">审批_3渠道管理部</div>
</div>
<div class="parallelogram1"></div>
<div class="triangle_right"></div>
</div>
<div class="div_list">
<div id="parallelogram"
:class="{'bgcolor':formData.ExtProcessNode_SDK==5}">
<div class="div_txt">完成</div>
</div>
</div>
</div>
<div class="basic-info"
v-loading='loading'>
<ele-form-section v-model="formData"
:rules="rules"
:sections="sections"
ref="formData">
<template v-slot:ExtLeader_SDK="{ formData }">
<el-input v-model="formData.ExtLeader_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtLeaderPhone_SDK="{ formData }">
<el-input v-model="formData.ExtLeaderPhone_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtLeaderEmail_SDK="{ formData }">
<el-input v-model="formData.ExtLeaderEmail_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtUnis_SDK="{ formData }">
<el-input v-model="formData.ExtUnis_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtUnisPhone_SDK="{ formData }">
<el-input v-model="formData.ExtUnisPhone_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtUnisEmail_SDK="{ formData }">
<el-input v-model="formData.ExtUnisEmail_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ApproveBtn="{ formData }">
<el-button style="margin-left: 40%;"
type="primary"
@click="handleApprove"
:loading="btnloading"
v-if="formData.ExtProcessNode_SDK==1">提交</el-button>
</template>
</ele-form-section>
<div class="table-contain">
<PersonalInFo :addBtnStart='formData.ExtProcessNode_SDK!=1'
:isShowEditBtn='formData.ExtProcessNode_SDK==1'
:dedeleBtnStart="formData.ExtProcessNode_SDK!=1"
:type-code="typeCode" />
</div>
<div class="table-contain">
<div class="form-container">审批意见</div>
<!-- <div class="btn">
<el-button type="primary" @click="approve">审批</el-button>
<el-button type="" @click="reject">退回</el-button>
</div> -->
<el-table :data="tableData"
border
style="width: 100%">
<el-table-column prop="Node"
label="审批节点">
</el-table-column>
<el-table-column prop="CreateName_SDK"
label="审批人">
</el-table-column>
<el-table-column prop="Result"
label="审批结果">
</el-table-column>
<el-table-column prop="CreateOn_SDK"
label="审批时间">
</el-table-column>
<el-table-column prop="Note"
label="备注">
</el-table-column>
</el-table>
<pagination v-show="TotalRecords>0"
:total="TotalRecords"
:page.sync="page.currentPage"
:limit.sync="page.pageSize"
@pagination="getList" />
</div>
<!-- <el-dialog title="审批意见" :visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label-width=500>
<el-input v-model="form.note" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" :loading="loading" @click="approveClick">确 定</el-button>
</div>
</el-dialog> -->
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import { getCustomer, typeSearch, lockRsp, customer, processHistory, getOneModel } from '@/api/customers';
import Pagination from '@/components/Pagination'
import PersonalInFo from '../components/personal-info'
import { uploadCode } from '@/api/upload'
import { Country } from '@/api/qcc'
export default {
components: {
Pagination,
Title,
PersonalInFo
},
data() {
return {
form: {},
typeCode: uploadCode.customer,
dialogFormVisible: false,
title: '城市代理商审批进度查询',
addBtnStart: false,
objectId: '',
id: '',
status: 0,
loading: false,
formData: {},
tableData2: [],
province: [],
sections: [
{
title: '基本信息',
formDesc: {
Name: {
type: 'input',
label: '公司全称',
layout: 24,
code: 'qcc',
disabled: true,
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: '社会统一信用代码',
disabled: true,
layout: 12
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
disabled: true,
layout: 12,
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
disabled: true,
layout: 12,
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '税务登记编号',
// layout: 12
// },
}
},
{
title: '地址信息',
formDesc: {
ExtProvinceName_SDK: {
type: 'input',
label: '省份',
layout: 12,
disabled: true,
},
ExtCityName_SDK: {
type: 'input',
label: '城市',
layout: 12,
isOptions: true,
disabled: true,
},
ExtDistrictName_SDK: {
type: 'input',
label: '县市',
layout: 12,
isOptions: true,
disabled: true,
},
ExtAddressDetail_SDK: {
type: 'input',
label: '详细经营地址',
layout: 12,
disabled: true,
},
}
},
{
title: '联系信息',
formDesc: {
ExtLeader_SDK: {
label: '公司负责人姓名',
layout: 12
},
ExtLeaderPhone_SDK: {
label: '公司负责人联系方式',
layout: 12
},
ExtLeaderEmail_SDK: {
label: '公司负责人邮箱',
layout: 12
},
ExtUnis_SDK: {
layout: 12,
label: 'Unis业务负责人姓名'
},
ExtUnisPhone_SDK: {
layout: 12,
label: 'Unis业务负责人联系方式'
},
ExtUnisEmail_SDK: {
label: 'Unis业务负责人邮箱',
layout: 12
},
ApproveBtn: {
label: '',
},
}
},
],
tableData: [],
TotalRecords: 0,
btnloading: false,
page: {},
apptions: [],
cOptions: [],
// 同 vue-ele-form
rules: {
ExtLeader_SDK: { required: true, message: '请输入公司负责人姓名' },
ExtLeaderPhone_SDK: { required: true, message: '请输入公司负责人电话' },
ExtLeaderEmail_SDK: { required: true, message: '请输入公司负责人邮箱' },
ExtUnis_SDK: { required: true, message: '请输入Unis负责人姓名' },
ExtUnisPhone_SDK: { required: true, message: '请输入Unis负责人电话' },
ExtUnisEmail_SDK: { required: true, message: '请输入Unis负责人邮箱' },
}
}
},
watch: {
},
created() {
this.id = this.$route.query.objectID
this.getList()
this.getHistoryList()
this.getFile()
this.getChannelType()
},
methods: {
getFile() {
const page = {
currentPage: 1,
pageSize: 10,
businessObjectID: this.id
}
getOneModel(page).then(resp => {
this.tableData2 = resp.results
})
},
getList() {
this.loading = true
getCustomer({ objectID: this.id }).then((resp) => {
this.loading = false
this.formData = resp.results[0]
lockRsp({ extProvince_SDK: resp.results[0].ExtProvince_SDK }).then((resp) => {
this.province = resp.results
})
const app = { provinceCode: resp.results[0].ExtProvince_SDK }
this.$request(Country.searchCity, app).then((resp) => {
this.apptions = resp.results
})
})
},
getChannelType() {
typeSearch({ code: 'ExtChannelType_SDK', module: 'Customer', content: 'CCP' }).then((resp) => {
this.cOptions = resp
})
},
getHistoryList() {
processHistory({ businessObjectID: this.id }).then((resp) => {
this.tableData = resp.results
})
},
btnLink(row) {
window.open(row.FileURL)
},
handleUpload() {
},
handleApprove() {
if (this.formData.ExtLeader_SDK == null || this.formData.ExtLeader_SDK == '') {
this.$message.warning('请输入必填信息')
} else if (this.formData.ExtLeaderPhone_SDK == null || this.formData.ExtLeaderPhone_SDK == '') {
this.$message.warning('请输入必填信息')
} else if (this.formData.ExtLeaderEmail_SDK == null || this.formData.ExtLeaderEmail_SDK == '') {
this.$message.warning('请输入必填信息')
} else if (this.formData.ExtUnis_SDK == null || this.formData.ExtUnis_SDK == '') {
this.$message.warning('请输入必填信息')
} else if (this.formData.ExtUnisPhone_SDK == null || this.formData.ExtUnisPhone_SDK == '') {
this.$message.warning('请输入必填信息')
} else if (this.formData.ExtUnisEmail_SDK == null || this.formData.ExtUnisEmail_SDK == '') {
this.$message.warning('请输入必填信息')
} else {
this.formData.objectID = this.id
this.btnloading = true
const arr = this.$translateToC4CData(this.formData)
this.$request(customer.updataAppUrl, arr).then((resp) => {
this.btnloading = false
this.$message.success('提交成功!')
this.$router.back()
}).catch((err) => {
this.btnloading = false
})
}
// this.$refs[formData].validate((valid) => {
// if (valid) {
// this.formData.extCustomerType_SDK = 111
// this.btnloading = true
// this.$request(Customer.searchUrl, this.paramsToFormData(this.formData)).then((resp) => {
// this.btnloading = false
// this.$message.success('提交成功!')
// this.$router.back()
// }).catch((err) => {
// this.btnloading = false
// })
// } else {
// this.btnloading = false
// this.$message.warning('请输入必填信息!')
// }
// });
},
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 {
display: none;
}
}
}
.btn {
margin-left: 45%;
margin-bottom: 8px;
}
.table-contain {
padding: 0 80px 0 20px;
margin-left: 65px;
background: #fff;
border-radius: 2px;
}
.div_list {
display: flex;
margin-right: 10px;
justify-content: center;
align-items: center;
}
.div_txt {
text-align: center;
line-height: 75px;
}
.div_txt2 {
height: 80px;
margin-top: 12px;
}
.triangle_right {
width: 0;
height: 0;
border-top: 20px solid transparent;
border-left: 20px solid #a22796;
border-bottom: 20px solid transparent;
}
.bgcolor {
background: #a22796 !important;
}
#parallelogram {
width: 115px;
height: 75px;
background: #fff;
margin-right: 10px;
border: 2px solid #a22796;
-webkit-transform: skew(0deg);
-moz-transform: skew(0deg);
-o-transform: skew(0deg);
transform: skew(0deg);
}
.parallelogram1 {
width: 45px;
height: 20px;
background: #a22796;
border: 2px solid #a22796;
-webkit-transform: skew(0deg);
-moz-transform: skew(0deg);
-o-transform: skew(0deg);
transform: skew(0deg);
}
.parallelogram2 {
width: 80px;
height: 30px;
margin-right: 10px;
background: #a22796;
border: 2px solid #a22796;
-webkit-transform: skew(0deg);
-moz-transform: skew(0deg);
-o-transform: skew(0deg);
transform: skew(0deg);
}
.parallelogram3 {
width: 80px;
height: 30px;
margin-right: 10px;
background: #fff;
border: 2px solid #a22796;
-webkit-transform: skew(0deg);
-moz-transform: skew(0deg);
-o-transform: skew(0deg);
transform: skew(0deg);
}
</style>
......@@ -7,6 +7,8 @@
<el-form id="registerForm"
:model="formData"
status-icon
ref="formData"
v-loading="btnloading"
:rules="supplierBaseRules"
label-position="right">
<el-row class="border-bottom">
......@@ -16,10 +18,9 @@
<el-col :span="13"
class="padding-bottom">
<el-form-item label="公司全称:"
prop="Name"
label-width="150px"
>
<el-input v-model="formData.Name"
label-width="150px">
<el-input v-model="formData.name"
readonly
placeholder='请选择公司'
style="width: 100%">
<i slot="suffix"
......@@ -45,8 +46,7 @@
class="padding-bottom">
<el-form-item label="统一社会信用代码:"
label-width="150px"
prop="extSocialUnifiedCreditCode_SDK"
>
prop="extSocialUnifiedCreditCode_SDK">
<template>
<el-input v-model="formData.extSocialUnifiedCreditCode_SDK"
placeholder="企查查获取"
......@@ -99,48 +99,55 @@
:offset="1"
class="padding-bottom">
<el-form-item label="省份:"
prop="extProvinceCode_SDK"
label-width="80px"
>
<el-select v-model="formData.extProvinceCode_SDK" style="width: 91%" filterable placeholder="请选择省份" no-match-text="无匹配数据" @change="handleSelect">
<el-option
v-for="item in countryOptions"
:key="item.Code"
:label="item.Name"
:value="item.Code"
/>
prop="extProvince_SDK"
label-width="80px">
<el-select v-model="formData.extProvince_SDK"
style="width: 91%"
filterable
placeholder="请选择省份"
no-match-text="无匹配数据"
@change="handleSelect">
<el-option v-for="item in countryOptions"
:key="item.Code"
:label="item.Name"
:value="item.Code" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="7"
class="padding-bottom">
<el-form-item label="市:"
prop="extCityCode_SDK"
prop="extCity_SDK"
label-width="80px"
required>
<el-select v-model="formData.extCityCode_SDK" style="width: 91%" filterable placeholder="请选择市" @change="handleSelectCity" >
<el-option
v-for="item in cityOptions"
:key="item.Code"
:label="item.Name"
:value="item.Code"
/>
<el-select v-model="formData.extCity_SDK"
style="width: 91%"
filterable
placeholder="请选择市"
@change="handleSelectCity">
<el-option v-for="item in cityOptions"
:key="item.Code"
:label="item.Name"
:value="item.Code" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="7"
class="padding-bottom">
<el-form-item label="区:"
prop="extDistrictCode_SDK"
prop="extDistrict_SDK"
label-width="80px"
required>
<el-select v-model="formData.extDistrictCode_SDK" style="width: 91%" filterable placeholder="请选择区" no-match-text="无匹配数据">
<el-option
v-for="item in disOptions"
:key="item.Code"
:label="item.Name"
:value="item.Code"
/>
<el-select v-model="formData.extDistrict_SDK"
style="width: 91%"
filterable
placeholder="请选择区"
no-match-text="无匹配数据"
@change="handleSelectDis">
<el-option v-for="item in disOptions"
:key="item.Code"
:label="item.Name"
:value="item.Code" />
</el-select>
</el-form-item>
</el-col>
......@@ -151,7 +158,7 @@
label-width="150px"
prop="extAddressDetail_SDK">
<el-input v-model="formData.extAddressDetail_SDK"
placeholder=""
placeholder="街道,道路,小区楼栋"
autocomplete="off"
style="width: 80%"
clearable />
......@@ -167,8 +174,7 @@
class="padding-bottom">
<el-form-item label="公司负责人姓名:"
prop="extLeader_SDK"
label-width="150px"
>
label-width="150px">
<el-input v-model="formData.extLeader_SDK"
placeholder=""
style="width: 80%"
......@@ -181,8 +187,7 @@
<el-form-item label="公司负责人联系电话:"
prop="extLeaderPhone_SDK"
label-width="160px"
class="filter-icon-none"
>
class="filter-icon-none">
<el-input v-model="formData.extLeaderPhone_SDK"
placeholder=""
style="width: 80%"
......@@ -201,8 +206,7 @@
<el-form-item label="公司负责人邮箱:"
prop="extLeaderEmail_SDK"
label-width="150px"
class="filter-icon-none"
>
class="filter-icon-none">
<el-input v-model="formData.extLeaderEmail_SDK"
placeholder=""
style="width: 52%"
......@@ -216,8 +220,7 @@
class="padding-bottom">
<el-form-item label="Unis业务负责人姓名:"
prop="extUnis_SDK"
label-width="160px"
>
label-width="160px">
<el-input v-model="formData.extUnis_SDK"
placeholder=""
style="width: 80%"
......@@ -229,8 +232,7 @@
class="padding-bottom">
<el-form-item label="Unis业务负责人电话:"
prop="extUnisPhone_SDK"
label-width="160px"
>
label-width="160px">
<el-input v-model="formData.extUnisPhone_SDK"
placeholder=""
style="width: 90%"
......@@ -244,8 +246,7 @@
<el-form-item label="Unis业务负责人邮箱:"
prop="extUnisEmail_SDK"
label-width="160px"
class="filter-icon-none"
>
class="filter-icon-none">
<el-input v-model="formData.extUnisEmail_SDK"
placeholder=""
style="width: 80%"
......@@ -263,17 +264,15 @@
:offset="1"
class="padding-bottom">
<el-form-item label="营业执照:"
prop="financerMobile"
prop="file"
:show-message='false'
label-width="100px"
class="filter-icon-none"
required>
<el-upload class="upload-demo"
:headers="myHeader"
:on-change="handleChange"
action="https://jsonplaceholder.typicode.com/posts/"
multiple
:limit="1"
>
class="filter-icon-none">
<el-upload :on-change="handleChange"
:on-remove="handleRemoveFile"
:auto-upload='false'
action="false"
:limit="1">
<el-button size="small"
type="primary">点击上传</el-button>
......@@ -281,7 +280,13 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col align="center">
<el-button type="primary"
:loading="btnloading"
@click="handleApprove">提交</el-button>
</el-col>
</el-row>
</el-form>
<el-dialog title="请选择公司"
:visible.sync="dialogTableVisible"
......@@ -326,22 +331,17 @@
:limit.sync="page.pageSize"
@pagination="getList" />
</el-dialog>
<el-row>
<el-col align="center">
<el-button type="primary" @click="handleApprove">提交</el-button>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
import { Qcc,Country,Customer } from '@/api/qcc'
import { Qcc, Country, Customer } from '@/api/qcc'
import Pagination from '@/components/Pagination'
export default {
name: 'city-register',
components: {
components: {
Pagination
},
data() {
......@@ -350,120 +350,183 @@ export default {
inputEnter: false,
countryArea: '',
title: '城市代理商注册',
loading: false,
btnloading: false,
formInline: {},
recordList: [],
tableData: [],
fileList:[],
countryOptions:[],
cityOptions:[],
disOptions:[],
fileList: [],
countryOptions: [],
cityOptions: [],
disOptions: [],
supplierBaseRules: {
Name: [{ required: true, message: '请选择公司名称', trigger: 'blur' }],
extSocialUnifiedCreditCode_SDK: [{ required: true, message: '请输入统一社会信用代码', trigger: 'blur' }],
extRegisteredCapital_SDK: [{ required: true, message: '请输入注册资本(万元)', trigger: 'blur' }],
extCorporateName_SDK: [{ required: true, message: '请输入法人', trigger: 'blur' }],
extProvinceCode_SDK: [{ required: true, message: '请选择省份', trigger: 'blur' }],
extCityCode_SDK: [{ required: true, message: '请选择市', trigger: 'blur' }],
extDistrictCode_SDK: [{ required: true, message: '请选择区', trigger: 'blur' }],
extAddressDetail_SDK: [{ required: true, message: '请输入详细经营地址', trigger: 'blur' }],
extLeader_SDK: [{ required: true, message: '请输入公司负责人姓名', trigger: 'blur' }],
extLeaderPhone_SDK: [{ required: true, message: '请输入公司负责人联系电话', trigger: 'blur' }],
extLeaderEmail_SDK: [{ required: true, message: '请输入公司负责人邮箱', trigger: 'blur' }],
extUnis_SDK: [{ required: true, message: '请输入Unis业务负责人姓名', trigger: 'blur' }],
extUnisPhone_SDK: [{ required: true, message: '请输入Unis业务负责人电话', trigger: 'blur' }],
extUnisEmail_SDK: [{ required: true, message: '请输入Unis业务负责人邮箱', trigger: 'blur' }],
extSocialUnifiedCreditCode_SDK: [{ required: true, message: '请输入统一社会信用代码' }],
extRegisteredCapital_SDK: [{ required: true, message: '请输入注册资本(万元)' }],
extCorporateName_SDK: [{ required: true, message: '请输入法人' }],
extProvince_SDK: [{ required: true, message: '请选择省份' }],
extCity_SDK: [{ required: true, message: '请选择市' }],
extDistrict_SDK: [{ required: true, message: '请选择区' }],
extAddressDetail_SDK: [{ required: true, message: '请输入详细经营地址', trigger: 'blur' }],
extLeader_SDK: [{ required: true, message: '请输入公司负责人姓名', trigger: 'blur' }],
extLeaderPhone_SDK: [{ required: true, message: '请输入公司负责人联系电话', trigger: 'blur' }],
extLeaderEmail_SDK: [{ required: true, message: '请输入公司负责人邮箱', trigger: 'blur' },
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
extUnis_SDK: [{ required: true, message: '请输入Unis业务负责人姓名', trigger: 'blur' }],
extUnisPhone_SDK: [{ required: true, message: '请输入Unis业务负责人电话', trigger: 'blur' }],
file: [{ required: true, message: '请上传附件' }],
extUnisEmail_SDK: [{ required: true, message: '请输入Unis业务负责人邮箱', trigger: 'blur' },
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
},
dialogTableVisible: false,
TotalRecords:0,
TotalRecords: 0,
page: {
currentPage: 0,
pageSize: 0,
}
}
},
watch: {
},
computed: {
visitedViews() {
return this.$store.state.tagsView.visitedViews
},
},
created() {
this.selectCountry()
},
methods: {
getList() {
this.page.searchKey=this.formInline.Name
this.page.searchKey = this.formInline.Name
this.$request(Qcc.searchUrl, this.page).then((resp) => {
this.tableData = resp.results.Result
this.page = resp.results.Paging
this.TotalRecords=resp.results.Paging.TotalRecords
if (resp.results.Result) {
this.tableData = resp.results.Result
this.page = resp.results.Paging
this.TotalRecords = resp.results.Paging.TotalRecords
} else {
this.$message.warning('无相关公司!')
}
})
},
selectCountry(){
selectCountry() {
this.$request(Country.searchPro, this.page).then((resp) => {
this.countryOptions=resp.results
this.countryOptions = resp.results
})
},
handleSelect(value){
const app={provinceCode:value}
this.$request(Country.searchCity,app).then((resp) => {
this.cityOptions=resp.results
handleSelect(value) {
const app = { provinceCode: value }
this.$request(Country.searchCity, app).then((resp) => {
this.cityOptions = resp.results
})
},
handleSelectCity(value){
const app={cityCode:value}
this.$request(Country.searchDis,app).then((resp) => {
this.disOptions=resp.results
let obj = {};
obj = this.countryOptions.find((item) => {//这里的userList就是上面遍历的数据源
return item.Code === value;//筛选出匹配数据
});
this.formData.extProvinceName_SDK = obj.Name//获取的 name
this.formData.extProvince_SDK = value//获取的 id
},
handleSelectCity(value) {
const app = { cityCode: value }
this.$request(Country.searchDis, app).then((resp) => {
this.disOptions = resp.results
})
},
let obj = {};
obj = this.cityOptions.find((item) => {//这里的userList就是上面遍历的数据源
return item.Code === value;//筛选出匹配数据
});
this.formData.extCityName_SDK = obj.Name//获取的 name
this.formData.extCity_SDK = value//获取的 id
},
handleSelectDis(value) {
let obj = {};
obj = this.disOptions.find((item) => {//这里的userList就是上面遍历的数据源
return item.Code === value;//筛选出匹配数据
});
this.formData.extDistrictName_SDK = obj.Name//获取的 name
this.formData.extDistrict_SDK = value//获取的 id
},
createLovTable() {
this.dialogTableVisible = true
},
select(row, column, event) {
this.page.searchKey=row.CreditCode
this.page.searchKey = row.CreditCode
this.$request(Qcc.detailUrl, this.page).then((resp) => {
this.formData.extCorporateName_SDK = row.OperName
this.formData.extSocialUnifiedCreditCode_SDK = row.CreditCode
this.formData.Name = row.Name
this.formData.extRegisteredCapital_SDK=resp.results.Result.RegistCapi
this.dialogTableVisible = false
this.formData.extSocialUnifiedCreditCode_SDK = row.CreditCode
this.formData.name = row.Name
this.formData.extRegisteredCapital_SDK = resp.results.Result.RegistCapi
this.dialogTableVisible = false
})
},
handleApprove(){
this.formData.ExtCustomerType_SDK=111
this.$request(Customer.searchUrl,this.paramsToFormData(this.formData)).then((resp) => {
this.$message.success('提交成功!')
handleApprove() {
this.$refs.formData.validate((valid) => {
if (valid) {
if (this.formData.file == null || this.formData.file == '' || this.formData.file == []) {
return this.$message.warning('请上传附件')
}
this.formData.extCustomerType_SDK = 111
this.btnloading = true
this.$request(Customer.searchUrl, this.paramsToFormData(this.formData)).then((resp) => {
this.btnloading = false
this.$message.success('提交成功!')
this.$router.back()
}).catch((err) => {
this.btnloading = false
// this.$message({
// type: 'warning',
// message: err
// })
})
} else {
this.btnloading = false
this.$message.warning('请输入必填信息!')
}
});
},
handleClickGoBack() {
// const visitedViews = this.$store.state.tagsView.visitedViews
// const path = this.$route.path
// visitedViews.forEach(function(item, index) {
// if (item.path == path) {
// visitedViews.splice(index, 1)
// }
// })
this.$store.dispatch('tagsView/delView', this.visitedViews).then((visitedViews) => {
this.$router.back()
})
},
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;
},
reSet() {this.formInline.Name='' },
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;
},
reSet() { this.formInline.Name = '' },
handleClose() {
this.dialogTableVisible = false
},
myHeader(){
return {'Content-Type': 'multipart/form-data'}
myHeader() {
return { 'Content-Type': 'multipart/form-data' }
},
handleChange(file, fileList) {
this.formData.file = file.raw
this.supplierBaseRules.file = []
},
handleChange(file,fileList){
this.formData.file=(file.raw)
handleRemoveFile(res, file) {
this.supplierBaseRules.file = [{ required: true, message: '请上传附件', trigger: ['blur', 'change'] }]
},
onSubmit() { },
handlePreview() { },
handleRemove() { },
beforeRemove() { },
handleExceed() { },
handleNext() { }
}
}
</script>
......
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 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="true"
: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"
:loading='loading'
>保存</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import constant from './constant'
import UploadBtn from './upload-btn'
import { file, fileInfoSearch } from '@/api/customers'
export default {
components: { UploadBtn, fileInfoSearch },
name: 'FileInfo',
props: {
isShowEditBtn: {
type: Boolean,
default: true
},
// 不同的typeCode代表不同模块的附件
typeCode: {
type: String,
required: true
},
// 同一模块的附件通过moduleType区分
moduleType: {
type: String,
default: ''
},
// path: {
// type: String,
// required: true
// },
objectID: {
type: String,
default: ''
},
addBtnStart: {
type: Boolean,
default: true,
},
dedeleBtnStart: {
type: Boolean,
default: true,
},
isShowBtn: {
type: Boolean,
default: true,
}
},
data() {
return {
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: {
isShowEditBtn: {
handler(val){},
deep: true,
immediate: true
// this.tableConfig.columns.handle.vif = val
},
addBtnStart: {
handler(val){},
deep: true,
immediate: true,
},
dedeleBtnStart: {
handler(val){},
deep: true,
immediate: true,
},
isShowBtn: {
handler(val){},
deep: true,
immediate: true,
}
},
created() {
this.tableConfig.columns.handle.vif = this.isShowBtn
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 = []
console.log('dddd',this.$refs.eleTable)
if(this.$refs.eleTable.tableData.length>=1){
return this.$message.warning('只能上传一个附件,请删除后再上传!')
}
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
console.log(businessObjectID)
formData.append('businessObjectID', businessObjectID)
// formData.append('typeCode',this.typeCode)
formData.delete('objectID')
this.loading = true
this.$request(file.createUrl, formData).then(() => {
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
})
} 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) {
if (selection.length > 1) {
const del_row = selection.shift()
this.$refs.eleTable.toggleRowSelection(del_row, false)
}
this.current = selection.length > 0 ? selection[0] : null
},
handleDelete() {
if (this.current === null) {
this.$message.warning('请先选择一行数据')
return
}
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()
}
)
})
// 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>
<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,
}
},
data() {
return {}
},
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>
const formConfig = {
labelPosition: 'left',
isShowBackBtn: false,
isShowSubmitBtn: false,
span: 12,
rules: {
newPassword: {
trigger: 'blur',
validator: function(rule, value, callback) {
if (this.formData.Ext_EmployeePassword_KUT === this.formData.newPassword) {
return callback(new Error('原密码与新密码不可一致'))
} else {
return callback()
}
}
},
againPassword: {
trigger: 'blur',
validator: function(rule, value, callback) {
if (this.formData.newPassword !== this.formData.againPassword) {
return callback(new Error('新密码与确认密码不一致'))
} else {
return callback()
}
}
}
},
formDesc: {
Ext_EmployeePassword_KUT: {
label: '原密码登陆',
type: 'input',
layout: 20,
required: true
},
newPassword: {
label: '新密码',
type: 'input',
layout: 20,
required: true
},
againPassword: {
label: '确认密码',
type: 'input',
layout: 20,
required: true
}
}
}
export default {
formConfig
}
......@@ -80,13 +80,34 @@
<!-- <p>创新服务全民</p>
</div> -->
<!-- <el-dialog :title="$t('login.thirdparty')" :visible.sync="showDialog">
{{ $t('login.thirdpartyTips') }}
<br>
<br>
<br>
<social-sign />
</el-dialog> -->
<el-dialog
:visible.sync="updatePassword"
width='40%'
:close-on-click-modal="clickModel"
:close-on-press-escape="clickModel"
:show-close="clickModel"
>
<div class="changePass">
<div class="title-container">
<img src="../../assets/images/login_top.png">
<h3 class="title">修改初始密码</h3>
</div>
<div >
<ele-form
ref="form"
v-bind="formConfig"
v-model="formData"
/>
</div>
<div class="submit-btn">
<el-button
:loading="loading"
type="primary"
@click="handleNext"
>确定</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
......@@ -94,29 +115,42 @@
// import { validUsername } from '@/utils/validate'
// import LangSelect from '@/components/LangSelect'
// import SocialSign from './components/SocialSignin'
// import path from 'path';
// import { update } from '@/api/flow/flow-definition';
// import changePassword from '@/views/changePass/index'
import Title from '@/components/Title'
import EleTable from '@/components/EleTable/EleTable.vue'
import { employee } from '@/api/account'
export default {
name: 'Login',
// components: { LangSelect, SocialSign },
components: {
// changePassword,
Title,
EleTable
},
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()
}
}
return {
clickModel: false,
loginForm: {
username: 'xzz',
password: '123456'
username: '',
password: ''
},
loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
......@@ -127,7 +161,80 @@ export default {
loading: false,
showDialog: false,
redirect: undefined,
otherQuery: {}
otherQuery: {},
updatePassword: false,
formData: {},
formConfig: {
isDialog: true,
isShowBackBtn: false,
isShowSubmitBtn: false,
isShowCancelBtn: false,
formDesc: {
OldPassword: {
type: "input",
label: "原始密码",
layout: 24,
required: true,
rules: [
{
trigger: "blur",
message: "原始密码",
placeholder: "原始密码"
}
],
attrs: {
size: "mini",
clearable: false
}
},
NewPassword: {
type: "password",
label: "新密码",
layout: 24,
required: true,
rules: [
{
min: 8,
max: 16,
type: "string",
trigger: "blur",
message: "请按照密码规则输入!!"}
],
tip: "密码由字母(区分大小写)和数字组成,长度8-16位",
attrs: {
size: "mini",
clearable: false,
minlength: 8
}
},
AgainPassword: {
type: "password",
label: "确认密码",
layout: 24,
required: true,
rules: [
{
min: 8,
max: 16,
type: "string",
trigger: "blur",
message: "请按照密码规则输入!!"
}
],
tip: "与新密码保持一致",
attrs: {
size: "mini",
clearable: false,
minlength: 8
}
}
},
order: [
"OldPassword",
"NewPassword",
"AgainPassword"
]
}
}
},
watch: {
......@@ -144,6 +251,9 @@ export default {
},
created() {
localStorage.removeItem('USERINFO')
localStorage.removeItem('PERMISSIONS')
localStorage.removeItem('PATHS')
// this.userInfo = JSON.parse(localStorage.getItem('CEINFO'))
// window.addEventListener('storage', this.afterQRScan)
},
mounted() {
......@@ -181,16 +291,33 @@ export default {
}
this.$store.dispatch('user/login', params)
.then(() => {
this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
this.loading = false
const start = JSON.parse(localStorage.getItem('CEINFO')).ExtIsFistTime_SDK ? true : false
if (start) {
this.$confirm('首次登录请修改密码', '提示', {
confirmButtonText: '确定',
showClose: false,
showCancelButton: false,
type: 'warning'
}).then(() => {
this.updatePassword = true
this.loading = false
})
} else {
// localStorage.setItem('PATHS', JSON.parse(localStorage.getItem('PATHS')))
this.$router.push({ path: '/', query: this.otherQuery })
// this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
this.loading = false
}
})
.catch(() => {
this.$message.error('登录异常,请重新登录')
this.loading = false
})
} else {
console.log('error submit!!')
return false
}
})
},
getOtherQuery(query) {
......@@ -200,25 +327,50 @@ export default {
}
return acc
}, {})
},
async handleNext() {
await this.$refs.form.validate()
this.loading = true
if (this.$refs.form.$refs.NewPassword[0].value === this.$refs.form.$refs.AgainPassword[0].value) {
const formData = this.formData
formData.ObjectID = JSON.parse(localStorage.getItem('CEINFO')).ObjectID
console.log(formData)
const formNewData = {
objectID: formData.ObjectID,
extPassword_SDK: formData.OldPassword,
newPassword: formData.NewPassword
}
this.$request(employee.updateUrl, formNewData).then(() => {
localStorage.setItem('USERINFO', JSON.stringify(JSON.parse(localStorage.getItem('CEINFO'))))
localStorage.removeItem('CEINFO')
// console.log("登入成功")
this.loading = false
this.updatePassword = false
this.$router.push({ path: '/', query: this.otherQuery })
})
} else {
this.loading = false
this.$message.error('确认密码出错!!')
}
},
updateBaseInfo() {
const formData = this.formData
this.formData.ObjectID = this.userInfo.ObjectID
console.log(333333333, this.formData)
// this.$getUpdateChange(JSON.parse(this.formDataOldStr), this.formData)
if (Object.keys(formData).length > 1) {
this.loading = true
this.$request(employee.updateUrl, formData).then(() => {
this.loading = false
this.$message.success('更新成功!')
})
} else {
this.$message.error('sorry')
}
}
// afterQRScan() {
// if (e.key === 'x-admin-oauth-code') {
// const code = getQueryObject(e.newValue)
// const codeMap = {
// wechat: 'code',
// tencent: 'code'
// }
// const type = codeMap[this.auth_type]
// const codeName = code[type]
// if (codeName) {
// this.$store.dispatch('LoginByThirdparty', codeName).then(() => {
// this.$router.push({ path: this.redirect || '/' })
// })
// } else {
// alert('第三方登录失败')
// }
// }
// }
}
}
</script>
......@@ -235,23 +387,36 @@ export default {
display: inline-block;
height: 47px;
width: 85%;
input {
border: 0px;
border-radius: 0px;
padding: 12px 5px 12px 15px;
color: #999;
height: 47px;
font-size: 14px;
}
}
.el-form-item {
border: 1px solid #ccc;
border-radius: 5px;
color: #454545;
margin-bottom: 30px;
}
.changePass {
.el-form-item {
border: none;
display: flex;
.el-form-item__content {
border: 1px solid #454545;
border-radius: 5px;
}
.ele-form-btns{
border: none !important;
}
}
.el-form-item__label {
width: 90px;
}
}
}
</style>
......@@ -312,7 +477,7 @@ $dark_gray:#889aa4;
.title-container {
position: relative;
margin: 50px auto;
margin: 0px auto 50px !important;
img {
width: 50%;
margin-left: 25%;
......@@ -343,4 +508,37 @@ $dark_gray:#889aa4;
user-select: none;
}
}
.submit-btn {
padding: 0 15px 20px 0px;
.el-button {
height: 40px;
width: 330px;
}
}
.el-dialog__body {
padding: 0px 20px;
}
.changePass {
::v-deep .el-row {
display: flex;
flex-flow: wrap;
justify-content: center;
}
::v-deep .el-form-item {
margin-bottom: 20px;
.el-input{
height: 37px !important;
}
}
::v-deep .el-form-item__content {
width: 330px;
height: 32px;
.el-input {
height: 32px;
.el-input__inner {
height: 28px;
}
}
}
}
</style>
<template>
<div class="form-container">
<Title :title="title">
</Title>
<div style="height:50px;display: flex;align-items: center;float: right;
margin-right: 90px;">
<div class="parallelogram2"></div>
<div style="margin-right:15px">当前节点</div>
<!-- <div class="parallelogram3"></div>
<div style="margin-right:15px">未审批</div> -->
</div>
<div style="height:150px;display: flex;margin: 20px 15%;">
<div class="div_list">
<div id="parallelogram"
:class="{'bgcolor':formData.ExtProcessNode_SDK==1}">
<div class="div_txt">提交</div>
</div>
<div class="parallelogram1"></div>
<div class="triangle_right"></div>
</div>
<div class="div_list">
<div id="parallelogram"
:class="{'bgcolor':formData.ExtProcessNode_SDK==2}">
<div class="div_txt2">审批_1区域渠道经理</div>
</div>
<div class="parallelogram1"></div>
<div class="triangle_right"></div>
</div>
<div class="div_list">
<div id="parallelogram"
:class="{'bgcolor':formData.ExtProcessNode_SDK==3}">
<div class="div_txt2">审批_2渠道销售部大区负责人</div>
</div>
<div class="parallelogram1"></div>
<div class="triangle_right"></div>
</div>
<div class="div_list">
<div id="parallelogram"
:class="{'bgcolor':formData.ExtProcessNode_SDK==4}">
<div class="div_txt2">审批_3渠道销售总监</div>
</div>
<div class="parallelogram1"></div>
<div class="triangle_right"></div>
</div>
<div class="div_list">
<div id="parallelogram"
:class="{'bgcolor':formData.ExtProcessNode_SDK==5}">
<div class="div_txt2">审批_4渠道管理部</div>
</div>
<div class="parallelogram1"></div>
<div class="triangle_right"></div>
</div>
<div class="div_list">
<div id="parallelogram"
:class="{'bgcolor':formData.ExtProcessNode_SDK==6}">
<div class="div_txt">完成</div>
</div>
</div>
</div>
<div class="basic-info"
v-loading="loading">
<ele-form-section v-model="formData"
:rules="rules"
:sections="sections">
<template v-slot:ExtLeader_SDK="{ formData }">
<el-input v-model="formData.ExtLeader_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtLeaderPhone_SDK="{ formData }">
<el-input v-model="formData.ExtLeaderPhone_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtLeaderEmail_SDK="{ formData }">
<el-input v-model="formData.ExtLeaderEmail_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtUnis_SDK="{ formData }">
<el-input v-model="formData.ExtUnis_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtUnisPhone_SDK="{ formData }">
<el-input v-model="formData.ExtUnisPhone_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtUnisEmail_SDK="{ formData }">
<el-input v-model="formData.ExtUnisEmail_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtBusiness_SDK="{ formData }">
<el-input v-model="formData.ExtUnisEmail_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtBusinessPhone_SDK="{ formData }">
<el-input v-model="formData.ExtUnisEmail_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ExtBusinessEmail_SDK="{ formData }">
<el-input v-model="formData.ExtUnisEmail_SDK"
:disabled="formData.ExtProcessNode_SDK!=1"></el-input>
</template>
<template v-slot:ApproveBtn="{ formData }">
<el-button style="margin-left: 40%;"
type="primary"
@click="handleApprove"
:loading="btnloading"
v-if="formData.ExtProcessNode_SDK==1">提交</el-button>
</template>
<template v-slot:ExtChannelType_SDK="{ formData }">
<!-- 插槽内容有el-form-item组件包裹 -->
<el-select v-if="formData.ExtProcessNode_SDK==1"
v-model="formData.ExtChannelType_SDK"
style="width: 91%"
filterable
placeholder="请选择"
no-match-text="无匹配数据">
<el-option v-for="item in aOptions"
:key="item.keyword"
:label="item.content"
:value="item.keyword" />
</el-select>
<el-input v-else
v-model="formData.ExtChannelType_SDKText"
disabled>
</el-input>
</template>
<template v-slot:ExtProductGroup_KUT="{ formData }">
<!-- 插槽内容有el-form-item组件包裹 -->
<el-select v-if="formData.ExtProcessNode_SDK==1"
v-model="formData.ExtProductGroup_KUT"
style="width: 91%"
multiple
filterable
placeholder="请选择"
no-match-text="无匹配数据"
@change="handSelect2">
<el-option v-for="item in bOptions"
:key="item.id"
:label="item.content"
:value="item.keyword" />
</el-select>
<el-input v-else
v-model="formData.ExtProductGroup_SDK"
disabled>
</el-input>
</template>
<template v-slot:ExtTotalAgent_KUT="{ formData }">
<!-- 插槽内容有el-form-item组件包裹 -->
<el-select v-if="formData.ExtProcessNode_SDK==1"
v-model="formData.ExtTotalAgent_KUT"
style="width: 91%"
multiple
filterable
placeholder="请选择"
no-match-text="无匹配数据"
@change="handSelect3">
<el-option v-for="item in cOptions"
:key="item.id"
:label="item.content"
:value="item.keyword" />
</el-select>
<el-input v-else
v-model="formData.ExtTotalAgent_SDK"
disabled>
</el-input>
</template>
</ele-form-section>
<div class="table-contain">
<PersonalInFo :addBtnStart='!formData.ExtProcessNode_SDK==1'
:isShowEditBtn='formData.ExtProcessNode_SDK==1'
:dedeleBtnStart="!formData.ExtProcessNode_SDK==1"
:type-code="typeCode" />
</div>
<div class="table-contain">
<div class="form-container">审批意见</div>
<!-- <div class="btn">
<el-button type="primary" @click="approve">审批</el-button>
<el-button type="" @click="reject">退回</el-button>
</div> -->
<el-table :data="tableData"
border
style="width: 100%">
<el-table-column prop="Node"
label="审批节点">
</el-table-column>
<el-table-column prop="CreateName_SDK"
label="审批人">
</el-table-column>
<el-table-column prop="Result"
label="审批结果">
</el-table-column>
<el-table-column prop="CreateOn_SDK"
label="审批时间">
</el-table-column>
<el-table-column prop="Note"
label="备注">
</el-table-column>
</el-table>
<pagination v-show="TotalRecords>0"
:total="TotalRecords"
:page.sync="page.currentPage"
:limit.sync="page.pageSize"
@pagination="getList" />
</div>
<!-- <el-dialog title="审批意见" :visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label-width=500>
<el-input v-model="form.note" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" :loading="loading" @click="approveClick">确 定</el-button>
</div>
</el-dialog> -->
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import { getCustomer, getOneModel, customer, ProcessApproval, processHistory, province } from '@/api/customers';
import { Country, Common } from '@/api/qcc'
import PersonalInFo from '../components/personal-info'
import { uploadCode } from '@/api/upload'
import Pagination from '@/components/Pagination'
export default {
components: {
Pagination,
Title,
PersonalInFo
},
data() {
return {
form: {},
typeCode: uploadCode.customer,
dialogFormVisible: false,
title: '省级代理商审批进度查询',
addBtnStart: false,
objectId: '',
id: '',
status: 0,
loading: false,
formData: {},
province: [],
sections: [
{
title: '基本信息',
formDesc: {
Name: {
type: 'input',
label: '公司全称',
layout: 24,
code: 'qcc',
disabled: true,
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: '社会统一信用代码',
disabled: true,
layout: 12
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
disabled: true,
layout: 12,
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
disabled: true,
layout: 12,
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '税务登记编号',
// layout: 12
// },
}
},
{
title: '地址信息',
formDesc: {
ExtProvinceName_SDK: {
type: 'input',
label: '省份',
layout: 12,
disabled: true,
},
ExtCityName_SDK: {
type: 'input',
label: '城市',
layout: 12,
isOptions: true,
disabled: true,
},
ExtDistrictName_SDK: {
type: 'input',
label: '县市',
layout: 12,
isOptions: true,
disabled: true,
},
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: '公司负责人邮箱',
disabled: true,
layout: 12
},
ExtUnis_SDK: {
type: 'input',
layout: 12,
disabled: true,
label: 'Unis业务负责人姓名'
},
ExtUnisPhone_SDK: {
type: 'input',
layout: 12,
disabled: true,
label: 'Unis业务负责人联系方式'
},
ExtUnisEmail_SDK: {
type: 'input',
disabled: true,
label: 'Unis业务负责人邮箱',
layout: 12
},
ExtBusiness_SDK: {
type: 'input',
layout: 12,
disabled: true,
label: '商务负责人姓名'
},
ExtBusinessPhone_SDK: {
type: 'input',
layout: 12,
disabled: true,
label: '商务负责人联系方式'
},
ExtBusinessEmail_SDK: {
type: 'input',
disabled: true,
label: '商务负责人邮箱',
layout: 12
},
}
},
{
title: '签约信息',
formDesc: {
ExtChannelType_SDK: {
label: '签约渠道类型',
layout: 12,
},
ExtProductGroup_KUT: {
label: '签约产品组',
layout: 12,
},
ExtTotalAgent_KUT: {
label: '签约总代',
layout: 12,
},
ApproveBtn: {
label: '',
},
}
},
],
tableData: [],
tableData2: [],
isShowEditBtn: false,
btnloading: false,
aOptions: [],
bOptions: [],
cOptions: [],
TotalRecords: 0,
page: {},
// 同 vue-ele-form
rules: {
ExtLeader_SDK: { required: true, message: '请输入公司负责人姓名' },
ExtLeaderPhone_SDK: { required: true, message: '请输入公司负责人电话' },
ExtLeaderEmail_SDK: { required: true, message: '请输入公司负责人邮箱' },
ExtUnis_SDK: { required: true, message: '请输入Unis负责人姓名' },
ExtUnisPhone_SDK: { required: true, message: '请输入Unis负责人电话' },
ExtUnisEmail_SDK: { required: true, message: '请输入Unis负责人邮箱' },
ExtUnisEmail_SDK: { required: true, message: '请输入商务负责人姓名' },
ExtUnisEmail_SDK: { required: true, message: '请输入商务负责人电话' },
ExtUnisEmail_SDK: { required: true, message: '请输入商务负责人邮箱' },
}
}
},
watch: {
// province:{
// handler(newVal,oldVal){
// this.province=newVal
// },
// deep:true
// }
},
created() {
this.id = this.$route.query.objectID
this.getList()
this.getCommon()
this.getFile()
this.getHistoryList()
},
methods: {
getList() {
console.log('objectId', this.id)
this.loading = true
getCustomer({ objectID: this.id }).then((resp) => {
this.loading = false
this.formData = resp.results[0]
const app = { provinceCode: resp.results[0].ExtProvince_SDK }
this.$request(Country.searchCity, app).then((resp) => {
this.province = resp.results
})
})
},
getHistoryList() {
processHistory({ businessObjectID: this.id }).then((resp) => {
this.tableData = resp.results
})
},
handleSuccess() {
// this.$message.success('创建成功')
},
approve() {
this.dialogFormVisible = true
this.status = 1
},
reject() {
this.dialogFormVisible = true
this.status = 2
},
handleUpload() {
},
getFile() {
const page = {
currentPage: 1,
pageSize: 10,
businessObjectID: this.id
}
getOneModel(page).then(resp => {
this.tableData2 = resp.results
})
},
btnLink(row) {
window.open(row.FileURL)
},
getCommon() {
const adata = { code: 'ExtChannelType_SDK', module: 'Customer', content: 'RSP' }
this.$request(Common.searchUrl, adata).then((resp) => {
this.aOptions = resp
})
const bdata = { code: 'ExtProductGroup_KUT', module: 'Customer' }
this.$request(Common.searchUrl, bdata).then((resp) => {
this.bOptions = resp
})
const cdata = { code: 'ExtTotalAgent_KUT', module: 'Customer' }
this.$request(Common.searchUrl, cdata).then((resp) => {
this.cOptions = resp
})
},
handSelect2(value) {
let cont = []
let val = []
this.bOptions.forEach((el) => {
value.forEach((item) => {
if (el.keyword == item) {
cont.push(el.content)
val.push(el.keyword)
}
})
})
this.formData.extProductGroup_SDK = cont//获取的 name
this.formData.extProductGroup_KUT = val//获取的 id
},
handSelect3(value) {
let cont = []
let val = []
this.cOptions.forEach((el) => {
value.forEach((item) => {
if (el.keyword == item) {
cont.push(el.content)
val.push(el.keyword)
}
})
})
this.formData.extTotalAgent_SDK = cont//获取的 name
this.formData.extTotalAgent_KUT = val//获取的 id
},
handleApprove() {
if (this.formData.ExtLeader_SDK == null || this.formData.ExtLeader_SDK == '') {
this.$message.warning('请输入必填信息')
} else if (this.formData.ExtLeaderPhone_SDK == null || this.formData.ExtLeaderPhone_SDK == '') {
this.$message.warning('请输入必填信息')
} else if (this.formData.ExtLeaderEmail_SDK == null || this.formData.ExtLeaderEmail_SDK == '') {
this.$message.warning('请输入必填信息')
} else if (this.formData.ExtUnis_SDK == null || this.formData.ExtUnis_SDK == '') {
this.$message.warning('请输入必填信息')
} else if (this.formData.ExtUnisPhone_SDK == null || this.formData.ExtUnisPhone_SDK == '') {
this.$message.warning('请输入必填信息')
} else if (this.formData.ExtUnisEmail_SDK == null || this.formData.ExtUnisEmail_SDK == '') {
this.$message.warning('请输入必填信息')
} else {
this.formData.objectID = this.id
this.btnloading = true
let arr = this.$translateToC4CData(this.formData)
arr.extProductGroup_SDK = arr.extProductGroup_SDK.toString()
arr.extProductGroup_KUT = arr.extProductGroup_KUT.toString()
arr.extTotalAgent_SDK = arr.extTotalAgent_SDK.toString()
arr.extTotalAgent_KUT = arr.extTotalAgent_KUT.toString()
this.$request(customer.updataAppUrl, arr).then((resp) => {
this.btnloading = false
this.$message.success('提交成功!')
this.$router.back()
}).catch((err) => {
this.btnloading = false
})
}
},
// 对象格式转化为键值对
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 {
display: none;
}
}
}
.btn {
margin-left: 45%;
margin-bottom: 8px;
}
.table-contain {
padding: 0 80px 0 20px;
margin-left: 65px;
background: #fff;
border-radius: 2px;
}
.div_list {
display: flex;
margin-right: 10px;
justify-content: center;
align-items: center;
}
.div_txt {
text-align: center;
line-height: 75px;
}
.div_txt2 {
height: 80px;
margin-top: 12px;
}
.triangle_right {
width: 0;
height: 0;
border-top: 20px solid transparent;
border-left: 20px solid #a22796;
border-bottom: 20px solid transparent;
}
.bgcolor {
background: #a22796 !important;
}
#parallelogram {
width: 115px;
height: 90px;
background: #fff;
margin-right: 10px;
border: 2px solid #a22796;
-webkit-transform: skew(0deg);
-moz-transform: skew(0deg);
-o-transform: skew(0deg);
transform: skew(0deg);
}
.parallelogram1 {
width: 45px;
height: 20px;
background: #a22796;
border: 2px solid #a22796;
-webkit-transform: skew(0deg);
-moz-transform: skew(0deg);
-o-transform: skew(0deg);
transform: skew(0deg);
}
.parallelogram2 {
width: 80px;
height: 30px;
margin-right: 10px;
background: #a22796;
border: 2px solid #a22796;
-webkit-transform: skew(0deg);
-moz-transform: skew(0deg);
-o-transform: skew(0deg);
transform: skew(0deg);
}
.parallelogram3 {
width: 80px;
height: 30px;
margin-right: 10px;
background: #fff;
border: 2px solid #a22796;
-webkit-transform: skew(0deg);
-moz-transform: skew(0deg);
-o-transform: skew(0deg);
transform: skew(0deg);
}
</style>
......@@ -7,6 +7,7 @@
<el-form id="registerForm"
:model="formData"
status-icon
v-loading="btnloading"
ref="formData"
:rules="supplierBaseRules"
label-position="right">
......@@ -17,10 +18,9 @@
<el-col :span="13"
class="padding-bottom">
<el-form-item label="公司全称:"
prop="Name"
label-width="150px"
>
<el-input v-model="formData.Name"
label-width="150px">
<el-input v-model="formData.name"
readonly
placeholder='请选择公司'
style="width: 100%">
<i slot="suffix"
......@@ -46,8 +46,7 @@
class="padding-bottom">
<el-form-item label="统一社会信用代码:"
label-width="150px"
prop="extSocialUnifiedCreditCode_SDK"
>
prop="extSocialUnifiedCreditCode_SDK">
<template>
<el-input v-model="formData.extSocialUnifiedCreditCode_SDK"
placeholder="企查查获取"
......@@ -100,48 +99,53 @@
:offset="1"
class="padding-bottom">
<el-form-item label="省份:"
prop="extProvinceName_SDK"
label-width="80px"
>
<el-select v-model="formData.extProvinceCode_SDK" style="width: 91%" filterable placeholder="请选择省份" no-match-text="无匹配数据" @change="handleSelect">
<el-option
v-for="item in countryOptions"
:key="item.Code"
:label="item.Name"
:value="item.Code"
/>
prop="extProvince_SDK"
label-width="80px">
<el-select v-model="formData.extProvince_SDK"
style="width: 91%"
filterable
placeholder="请选择省份"
no-match-text="无匹配数据"
@change="handleSelect($event)">
<el-option v-for="item in countryOptions"
:key="item.Code"
:label="item.Name"
:value="item.Code" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="7"
class="padding-bottom">
<el-form-item label="市:"
prop="extCityName_SDK"
label-width="80px"
>
<el-select v-model="formData.extCityCode_SDK" style="width: 91%" filterable placeholder="请选择市" @change="handleSelectCity" >
<el-option
v-for="item in cityOptions"
:key="item.Code"
:label="item.Name"
:value="item.Code"
/>
prop="extCity_SDK"
label-width="80px">
<el-select v-model="formData.extCity_SDK"
style="width: 91%"
filterable
placeholder="请选择市"
@change="handleSelectCity">
<el-option v-for="item in cityOptions"
:key="item.Code"
:label="item.Name"
:value="item.Code" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="7"
class="padding-bottom">
<el-form-item label="区:"
prop="extDistrictName_SDK"
label-width="80px"
>
<el-select v-model="formData.extDistrictCode_SDK" style="width: 91%" filterable placeholder="请选择区" no-match-text="无匹配数据">
<el-option
v-for="item in disOptions"
:key="item.Code"
:label="item.Name"
:value="item.Code"
/>
prop="extDistrict_SDK"
label-width="80px">
<el-select v-model="formData.extDistrict_SDK"
style="width: 91%"
filterable
placeholder="请选择区"
no-match-text="无匹配数据"
@change="handleSelectDis">
<el-option v-for="item in disOptions"
:key="item.Code"
:label="item.Name"
:value="item.Code" />
</el-select>
</el-form-item>
</el-col>
......@@ -152,7 +156,7 @@
label-width="150px"
prop="extAddressDetail_SDK">
<el-input v-model="formData.extAddressDetail_SDK"
placeholder=""
placeholder="街道,道路,小区楼栋"
autocomplete="off"
style="width: 80%"
clearable />
......@@ -168,8 +172,7 @@
class="padding-bottom">
<el-form-item label="公司负责人姓名:"
prop="extLeader_SDK"
label-width="150px"
>
label-width="150px">
<el-input v-model="formData.extLeader_SDK"
placeholder=""
style="width: 80%"
......@@ -182,8 +185,7 @@
<el-form-item label="公司负责人联系电话:"
prop="extLeaderPhone_SDK"
label-width="160px"
class="filter-icon-none"
>
class="filter-icon-none">
<el-input v-model="formData.extLeaderPhone_SDK"
placeholder=""
style="width: 80%"
......@@ -202,8 +204,7 @@
<el-form-item label="公司负责人邮箱:"
prop="extLeaderEmail_SDK"
label-width="150px"
class="filter-icon-none"
>
class="filter-icon-none">
<el-input v-model="formData.extLeaderEmail_SDK"
placeholder=""
style="width: 52%"
......@@ -217,8 +218,7 @@
class="padding-bottom">
<el-form-item label="Unis业务负责人姓名:"
prop="extUnis_SDK"
label-width="160px"
>
label-width="160px">
<el-input v-model="formData.extUnis_SDK"
placeholder=""
style="width: 80%"
......@@ -230,8 +230,7 @@
class="padding-bottom">
<el-form-item label="Unis业务负责人电话:"
prop="extUnisPhone_SDK"
label-width="160px"
>
label-width="160px">
<el-input v-model="formData.extUnisPhone_SDK"
placeholder=""
style="width: 90%"
......@@ -245,8 +244,7 @@
<el-form-item label="Unis业务负责人邮箱:"
prop="extUnisEmail_SDK"
label-width="160px"
class="filter-icon-none"
>
class="filter-icon-none">
<el-input v-model="formData.extUnisEmail_SDK"
placeholder=""
style="width: 80%"
......@@ -254,59 +252,104 @@
clearable />
</el-form-item>
</el-col>
<el-col :span="11" :offset="1" class="padding-bottom">
<el-form-item label="商务负责人姓名:" prop="extBusiness_SDK" label-width="150px" >
<el-input v-model="formData.extBusiness_SDK" placeholder="" style="width: 80%" class="filter-item" clearable />
<el-col :span="12"
:offset="1"
class="padding-bottom">
<el-form-item label="商务负责人姓名:"
prop="extBusiness_SDK"
label-width="150px">
<el-input v-model="formData.extBusiness_SDK"
placeholder=""
style="width: 80%"
class="filter-item"
clearable />
</el-form-item>
</el-col>
<el-col :span="11" class="padding-bottom">
<el-form-item label="商务负责人电话:" prop="extBusinessPhone_SDK" label-width="150px" >
<el-input v-model="formData.extBusinessPhone_SDK" placeholder="" style="width: 90%" class="filter-item" clearable />
<el-col :span="10"
class="padding-bottom">
<el-form-item label="商务负责人电话:"
prop="extBusinessPhone_SDK"
label-width="140px">
<el-input v-model="formData.extBusinessPhone_SDK"
placeholder=""
style="width: 90%"
class="filter-item"
clearable />
</el-form-item>
</el-col>
<el-col :span="11" :offset="1" class="padding-bottom" >
<el-form-item label="商务负责人邮箱:" prop="extBusinessEmail_SDK" label-width="160px" class="filter-icon-none" >
<el-input v-model="formData.extBusinessEmail_SDK" placeholder="" style="width: 80%" class="filter-item" clearable />
<el-col :span="11"
:offset="1"
class="padding-bottom">
<el-form-item label="商务负责人邮箱:"
prop="extBusinessEmail_SDK"
label-width="160px"
class="filter-icon-none">
<el-input v-model="formData.extBusinessEmail_SDK"
placeholder=""
style="width: 80%"
class="filter-item"
clearable />
</el-form-item>
</el-col>
</el-row>
<el-row class="border-bottom">
<el-row class="border-bottom">
<el-col :span="24">
<el-form-item label="签约信息" />
</el-col>
<el-col :span="11" :offset="1" class="padding-bottom">
<el-form-item label="签约渠道类型:" prop="ExtChannelType_SDK" label-width="120px" >
<el-select v-model="formData.ExtChannelType_SDK" style="width: 91%" filterable placeholder="请选择" no-match-text="无匹配数据">
<el-option
v-for="item in aOptions"
:key="item.id"
:label="item.content"
:value="item.keyword"
/>
<el-col :span="11"
:offset="1"
class="padding-bottom">
<el-form-item label="签约渠道类型:"
prop="extChannelType_SDK"
label-width="120px">
<el-select v-model="formData.extChannelType_SDK"
style="width: 91%"
filterable
placeholder="请选择"
no-match-text="无匹配数据">
<el-option v-for="item in aOptions"
:key="item.id"
:label="item.content"
:value="item.keyword" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="padding-bottom">
<el-form-item label="签约产品组:" prop="ExtProductGroup_SDK" label-width="120px" >
<el-select v-model="formData.ExtProductGroup_SDK" style="width: 91%" multiple filterable placeholder="请选择" no-match-text="无匹配数据">
<el-option
v-for="item in bOptions"
:key="item.id"
:label="item.content"
:value="item.keyword"
/>
<el-col :span="12"
class="padding-bottom">
<el-form-item label="签约产品组:"
prop="extProductGroup_KUT"
label-width="120px">
<el-select v-model="formData.extProductGroup_KUT"
style="width: 91%"
multiple
filterable
placeholder="请选择"
no-match-text="无匹配数据"
@change="handSelect2">
<el-option v-for="item in bOptions"
:key="item.id"
:label="item.content"
:value="item.keyword" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="11" :offset="1" class="padding-bottom">
<el-form-item label="签约总代:" prop="extTotalAgent_SDK" label-width="100px" >
<el-select v-model="formData.extTotalAgent_SDK" style="width: 91%" multiple filterable placeholder="请选择" no-match-text="无匹配数据">
<el-option
v-for="item in cOptions"
:key="item.id"
:label="item.content"
:value="item.keyword"
/>
<el-col :span="11"
:offset="1"
class="padding-bottom">
<el-form-item label="签约总代:"
prop="extTotalAgent_KUT"
label-width="100px">
<el-select v-model="formData.extTotalAgent_KUT"
style="width: 91%"
multiple
filterable
placeholder="请选择"
no-match-text="无匹配数据"
@change="handSelect3">
<el-option v-for="item in cOptions"
:key="item.id"
:label="item.content"
:value="item.keyword" />
</el-select>
</el-form-item>
</el-col>
......@@ -320,27 +363,29 @@
:offset="1"
class="padding-bottom">
<el-form-item label="营业执照:"
prop="financerMobile"
prop="file"
:show-message='false'
label-width="100px"
class="filter-icon-none"
required>
<el-upload
ref="uploadExcel"
action="https://jsonplaceholder.typicode.com/posts/"
:limit='1'
:auto-upload="false"
:on-change="fileChange"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
class="filter-icon-none">
<el-upload ref="uploadExcel"
action="false"
:limit='1'
:auto-upload= 'false'
:on-remove="handleRemoveFile"
:on-change="fileChange">
<el-button size="small"
type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col align="center">
<el-button type="primary" @click="handleApprove(formData)">提交</el-button>
</el-col>
</el-row>
<el-row>
<el-col align="center">
<el-button type="primary"
:loading="btnloading"
@click="handleApprove()">提交</el-button>
</el-col>
</el-row>
</el-form>
<el-dialog title="请选择公司"
:visible.sync="dialogTableVisible"
......@@ -385,18 +430,17 @@
:limit.sync="page.pageSize"
@pagination="getList" />
</el-dialog>
</div>
</div>
</template>
<script>
import { Qcc,Country,Customer,Common } from '@/api/qcc'
import { Qcc, Country, Customer, Common } from '@/api/qcc'
import Pagination from '@/components/Pagination'
export default {
name: 'city-register',
components: {
components: {
Pagination
},
data() {
......@@ -404,41 +448,44 @@ export default {
formData: {},
inputEnter: false,
countryArea: '',
loading: false,
formInline: {},
recordList: [],
tableData: [],
fileList:[],
countryOptions:[],
cityOptions:[],
disOptions:[],
aOptions:[],
bOptions:[],
cOptions:[],
btnloading: false,
fileList: [],
countryOptions: [],
cityOptions: [],
disOptions: [],
aOptions: [],
bOptions: [],
cOptions: [],
supplierBaseRules: {
Name: [{ required: true, message: '请选择公司名称', trigger: ['change', 'blur'] }],
extSocialUnifiedCreditCode_SDK: [{ required: true, message: '请输入统一社会信用代码', trigger: 'blur' }],
extRegisteredCapital_SDK: [{ required: true, message: '请输入注册资本(万元)', trigger: 'blur' }],
extCorporateName_SDK: [{ required: true, message: '请输入法人', trigger: 'blur' }],
extProvinceName_SDK: [{ required: true, message: '请选择省份', trigger: 'blur' }],
extCityName_SDK: [{ required: true, message: '请选择市', trigger: 'blur' }],
extDistrictName_SDK: [{ required: true, message: '请选择区', trigger: 'blur' }],
extAddressDetail_SDK: [{ required: true, message: '请输入详细经营地址', trigger: 'blur' }],
extLeader_SDK: [{ required: true, message: '请输入公司负责人姓名', trigger: 'blur' }],
extLeaderPhone_SDK: [{ required: true, message: '请输入公司负责人联系电话', trigger: 'blur' }],
extLeaderEmail_SDK: [{ required: true, message: '请输入公司负责人邮箱', trigger: 'blur' }],
extUnis_SDK: [{ required: true, message: '请输入Unis业务负责人姓名', trigger: 'blur' }],
extUnisPhone_SDK: [{ required: true, message: '请输入Unis业务负责人电话', trigger: 'blur' }],
extUnisEmail_SDK: [{ required: true, message: '请输入Unis业务负责人邮箱', trigger: 'blur' }],
extBusiness_SDK: [{ required: true, message: '请输入商务负责人姓名', trigger: 'blur' }],
extBusinessPhone_SDK: [{ required: true, message: '请输入商务负责人电话', trigger: 'blur' }],
extBusinessEmail_SDK: [{ required: true, message: '请输入商务负责人邮箱', trigger: 'blur' }],
ExtChannelType_SDK: [{ required: true, message: '请选择签约渠道类型', trigger: 'blur' }],
ExtProductGroup_SDK: [{ required: true, message: '请选择签约产品组', trigger: 'blur' }],
extTotalAgent_SDK: [{ required: true, message: '请选择签约总代', trigger: 'blur' }],
extSocialUnifiedCreditCode_SDK: [{ required: true, message: '请输入统一社会信用代码' }],
extRegisteredCapital_SDK: [{ required: true, message: '请输入注册资本(万元)' }],
extCorporateName_SDK: [{ required: true, message: '请输入法人' }],
extProvince_SDK: [{ required: true, message: '请选择省份' }],
extCity_SDK: [{ required: true, message: '请选择市' }],
extDistrict_SDK: [{ required: true, message: '请选择区' }],
extAddressDetail_SDK: [{ required: true, message: '请输入详细经营地址', trigger: 'blur' }],
extLeader_SDK: [{ required: true, message: '请输入公司负责人姓名', trigger: 'blur' }],
extLeaderPhone_SDK: [{ required: true, message: '请输入公司负责人联系电话', trigger: 'blur' }],
extLeaderEmail_SDK: [{ required: true, message: '请输入公司负责人邮箱', trigger: 'blur' },
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
extUnis_SDK: [{ required: true, message: '请输入Unis业务负责人姓名', trigger: 'blur' }],
extUnisPhone_SDK: [{ required: true, message: '请输入Unis业务负责人电话', trigger: 'blur' }],
extUnisEmail_SDK: [{ required: true, message: '请输入Unis业务负责人邮箱', trigger: 'blur' },
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
extBusiness_SDK: [{ required: true, message: '请输入商务负责人姓名', trigger: 'blur' }],
extBusinessPhone_SDK: [{ required: true, message: '请输入商务负责人电话', trigger: 'blur' }],
extBusinessEmail_SDK: [{ required: true, message: '请输入商务负责人邮箱', trigger: 'blur' },
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
extChannelType_SDK: [{ required: true, message: '请选择签约渠道类型' }],
extProductGroup_KUT: [{ required: true, message: '请选择签约产品组' }],
extTotalAgent_KUT: [{ required: true, message: '请选择签约总代' }],
file: [{ required: true, message: '请上传附件' }],
},
dialogTableVisible: false,
TotalRecords:0,
TotalRecords: 0,
page: {
currentPage: 0,
pageSize: 0
......@@ -449,7 +496,7 @@ export default {
watch: {
},
computed:{
computed: {
visitedViews() {
return this.$store.state.tagsView.visitedViews
},
......@@ -459,75 +506,150 @@ export default {
this.getCommon()
},
methods: {
getList() {
this.page.searchKey=this.formInline.Name
this.page.searchKey = this.formInline.Name
this.$request(Qcc.searchUrl, this.page).then((resp) => {
this.tableData = resp.results.Result
if(resp.results.Result){
this.tableData = resp.results.Result
this.page = resp.results.Paging
this.TotalRecords=resp.results.Paging.TotalRecords
this.TotalRecords = resp.results.Paging.TotalRecords
}else{
this.$message.warning('无相关公司!')
}
})
},
selectCountry(){
selectCountry() {
this.$request(Country.searchPro, this.page).then((resp) => {
this.countryOptions=resp.results
this.countryOptions = resp.results
})
},
getCommon(){
const adata={code:'ExtChannelType_SDK',module:'Customer'}
this.$request(Common.searchUrl, adata).then((resp) => {
this.aOptions=resp
getCommon() {
const adata = { code: 'ExtChannelType_SDK', module: 'Customer', content: 'RSP' }
this.$request(Common.searchUrl, adata).then((resp) => {
this.aOptions = resp
})
const bdata={code:'ExtProductGroup_SDK',module:'Customer'}
this.$request(Common.searchUrl, bdata).then((resp) => {
this.bOptions=resp
const bdata = { code: 'ExtProductGroup_KUT', module: 'Customer' }
this.$request(Common.searchUrl, bdata).then((resp) => {
this.bOptions = resp
})
const cdata={code:'ExtTotalAgent_SDK',module:'Customer'}
this.$request(Common.searchUrl, cdata).then((resp) => {
this.cOptions=resp
const cdata = { code: 'ExtTotalAgent_KUT', module: 'Customer' }
this.$request(Common.searchUrl, cdata).then((resp) => {
this.cOptions = resp
})
},
handleSelect(value){
const app={provinceCode:value}
this.$request(Country.searchCity,app).then((resp) => {
this.cityOptions=resp.results
handleSelect(value) {
const app = { provinceCode: value }
this.$request(Country.searchCity, app).then((resp) => {
this.cityOptions = resp.results
})
},
handleSelectCity(value){
const app={cityCode:value}
this.$request(Country.searchDis,app).then((resp) => {
this.disOptions=resp.results
let obj = {};
obj = this.countryOptions.find((item) => {//这里的userList就是上面遍历的数据源
return item.Code === value;//筛选出匹配数据
});
this.formData.extProvinceName_SDK = obj.Name//获取的 name
this.formData.extProvince_SDK = value//获取的 id
},
handleSelectCity(value) {
const app = { cityCode: value }
this.$request(Country.searchDis, app).then((resp) => {
this.disOptions = resp.results
})
let obj = {};
obj = this.cityOptions.find((item) => {//这里的userList就是上面遍历的数据源
return item.Code === value;//筛选出匹配数据
});
this.formData.extCityName_SDK = obj.Name//获取的 name
this.formData.extCity_SDK = value//获取的 id
},
handleSelectDis(value) {
let obj = {};
obj = this.disOptions.find((item) => {//这里的userList就是上面遍历的数据源
return item.Code === value;//筛选出匹配数据
});
this.formData.extDistrictName_SDK = obj.Name//获取的 name
this.formData.extDistrict_SDK = value//获取的 id
},
handSelect2(value) {
let cont = []
let val = []
this.bOptions.forEach((el) => {
value.forEach((item) => {
if (el.keyword == item) {
cont.push(el.content)
val.push(el.keyword)
}
})
})
this.formData.extProductGroup_SDK = cont//获取的 name
this.formData.extProductGroup_KUT = val//获取的 id
},
handSelect3(value) {
let cont = []
let val = []
this.cOptions.forEach((el) => {
value.forEach((item) => {
if (el.keyword == item) {
cont.push(el.content)
val.push(el.keyword)
}
})
})
},
this.formData.extTotalAgent_SDK = cont//获取的 name
this.formData.extTotalAgent_KUT = val//获取的 id
},
createLovTable() {
this.dialogTableVisible = true
},
select(row, column, event) {
this.page.searchKey=row.CreditCode
this.page.searchKey = row.CreditCode
this.$request(Qcc.detailUrl, this.page).then((resp) => {
this.formData.extCorporateName_SDK = row.OperName
this.formData.extSocialUnifiedCreditCode_SDK = row.CreditCode
this.formData.Name = row.Name
this.formData.extRegisteredCapital_SDK=resp.results.Result.RegistCapi
this.dialogTableVisible = false
this.formData.extSocialUnifiedCreditCode_SDK = row.CreditCode
this.formData.name = row.Name
this.formData.extRegisteredCapital_SDK = resp.results.Result.RegistCapi
this.dialogTableVisible = false
})
},
handleApprove(formName){
// this.$refs[formName].validate((valid) => {
// if (valid) {
// alert('submit!');
// } else {
// console.log('error submit!!');
// return false;
// }
// });
this.formData. ExtCustomerType_SDK=101
this.$request(Customer.searchUrl,this.paramsToFormData(this.formData)).then((resp) => {
this.$message.success('提交成功!')
// this.handleClickGoBack()
})
handleApprove() {
this.$refs.formData.validate((valid) => {
if (valid) {
if (this.formData.file == null || this.formData.file == '' || this.formData.file == []) {
return this.$message.warning('请上传附件')
}
this.formData.extCustomerType_SDK = 101
const ExtProductGroup_KUT = this.formData.extProductGroup_KUT.toString()
const ExtProductGroup_SDK = this.formData.extProductGroup_SDK.toString()
const ExtTotalAgent_KUT = this.formData.extTotalAgent_KUT.toString()
const ExtTotalAgent_SDK = this.formData.extTotalAgent_SDK.toString()
this.formData.extProductGroup_KUT = ExtProductGroup_KUT
this.formData.extProductGroup_SDK = ExtProductGroup_SDK
this.formData.extTotalAgent_KUT = ExtTotalAgent_KUT
this.formData.extTotalAgent_SDK = ExtTotalAgent_SDK
this.btnloading = true
this.$request(Customer.searchUrl, this.paramsToFormData(this.formData)).then((resp) => {
this.btnloading = false
this.$message.success('提交成功!')
this.$router.back()
}).catch((err) => {
this.btnloading = false
// this.$message({
// type: 'warning',
// message: err
// })
})
} else {
this.btnloading = false
this.$message.warning('请输入必填信息!')
}
});
},
handleClickGoBack() {
handleClickGoBack() {
// const visitedViews = this.$store.state.tagsView.visitedViews
// const path = this.$route.path
// visitedViews.forEach(function(item, index) {
......@@ -539,32 +661,33 @@ export default {
this.$router.back()
})
},
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;
},
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;
},
reSet() {
this.formInline.Name=''
this.formInline.Name = ''
},
handleClose() {
this.dialogTableVisible = false
},
myHeader(){
return {'Content-Type': 'multipart/form-data'}
fileChange(res, file) {
this.formData.file = res.raw
this.supplierBaseRules.file=[]
},
fileChange(res,file){
this.formData.file=(res.raw)
handleRemoveFile(res,file){
this.supplierBaseRules.file = [{ required: true, message: '请上传附件', trigger: ['blur', 'change'] }]
},
onSubmit() {},
onSubmit() { },
handlePreview() { },
handleRemove() { },
beforeRemove() { },
......
<template>
<div class="app-container">
<div class="table-container">
<el-table :data="tableData"
v-loading='btnloading'
border
style="width: 100%">
<el-table-column prop="FileName"
label="名称">
</el-table-column>
<el-table-column prop="CreateOn_SDK"
label="时间">
</el-table-column>
<el-table-column
label="操作">
<el-link slot-scope="{ row }" type="primary" @click="btnLink(row)">下载</el-link>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
import { getModels } from '@/api/customers'
export default {
data () {
return {
tableData:[],
btnloading:false,
page:{
currentPage:1,
pageSize:10
}
}
},
created(){
this.getList()
},
methods:{
getList(){
this.page.typeCode='121'
this.btnloading=true
getModels(this.page).then((resp)=>{
this.btnloading=false
this.tableData=resp.results
})
},
btnLink(row){
window.location.href = row.FileURL
}
}
}
</script>
<template>
<div class="app-container">
<div class="table-container">
<el-table :data="tableData"
v-loading='btnloading'
border
style="width: 100%">
<el-table-column prop="FileName"
label="名称">
</el-table-column>
<el-table-column prop="CreateOn_SDK"
label="时间">
</el-table-column>
<el-table-column
label="操作">
<el-link slot-scope="{ row }" type="primary" @click="btnLink(row)">下载</el-link>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
import { getModels } from '@/api/customers'
export default {
data () {
return {
tableData:[],
btnloading:false,
page:{
currentPage:1,
pageSize:10
}
}
},
created(){
this.getList()
},
methods:{
getList(){
this.page.typeCode='121'
this.page.fileLabel='3'
this.btnloading=true
getModels(this.page).then((resp)=>{
this.btnloading=false
this.tableData=resp.results
})
},
btnLink(row){
window.location.href = row.FileURL
}
}
}
</script>
<template>
<div class="app-container">
<div class="table-container">
<el-table :data="tableData"
v-loading='btnloading'
border
style="width: 100%">
<el-table-column prop="FileName"
label="名称">
</el-table-column>
<el-table-column prop="CreateOn_SDK"
label="时间">
</el-table-column>
<el-table-column
label="操作">
<el-link slot-scope="{ row }" type="primary" @click="btnLink(row)">下载</el-link>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
import { getModels } from '@/api/customers'
export default {
data () {
return {
tableData:[],
btnloading:false,
page:{
currentPage:1,
pageSize:10
}
}
},
created(){
this.getList()
},
methods:{
getList(){
this.page.typeCode='121'
this.page.fileLabel='2'
this.btnloading=true
getModels(this.page).then((resp)=>{
this.btnloading=false
this.tableData=resp.results
})
},
btnLink(row){
window.location.href = row.FileURL
}
}
}
</script>
<template>
<div class="app-container">
<div class="table-container">
<el-table :data="tableData"
border
v-loading='btnloading'
style="width: 100%">
<el-table-column prop="FileName"
label="名称">
</el-table-column>
<el-table-column prop="CreateOn_SDK"
label="时间">
</el-table-column>
<el-table-column
label="操作">
<el-link slot-scope="{ row }" type="primary" @click="btnLink(row)">下载</el-link>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
import { getModels } from '@/api/customers'
export default {
data () {
return {
tableData:[],
btnloading:false,
page:{
currentPage:1,
pageSize:10
}
}
},
created(){
this.getList()
},
methods:{
getList(){
this.page.typeCode='121'
this.page.fileLabel='1'
this.btnloading=true
getModels(this.page).then((resp)=>{
this.btnloadin=false
this.tableData=resp.results
})
},
btnLink(row){
window.location.href = row.FileURL
}
}
}
</script>
......@@ -3,6 +3,7 @@ import { file } from '@/api/customers'
const tableConfig = {
tableTitle: '附件信息',
url: file.searchUrl,
// url: '',
isSearch: true,
defaultColumns: {
minWidth: 120,
......@@ -10,43 +11,39 @@ const tableConfig = {
align: 'center'
},
columns: {
Title: {
label: '标题'
},
TypeCode: {
label: '类型',
value: 'TypeCodeText'
},
CreateName: {
label: '创建人'
},
CreateOn: {
CreateOn_SDK: {
label: '创建时间'
},
Note: {
label: '备注'
},
URL: {
label: '附件'
FileName: {
label: '文件名'
},
handle: {
label: '操作',
hideInFilter: true,
fixed: 'right',
renderItem: (h, scope, listeners) => {
return h(
'el-button',
{
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.handleEdit(scope.row, scope.$index)
click: (e) => listeners.handleDownload(scope.row, 'takeEffect')
},
class: 'el-icon-edit',
props: {
icon: 'el-icon-circle-check',
type: 'text'
}
},
'编辑')
}
}, '下载'),
])
},
}
}
}
......@@ -56,27 +53,28 @@ const formConfig = {
isShowBackBtn: false,
isShowSubmitBtn: false,
formDesc: {
Title: {
type: 'input',
label: '标题',
layout: 24
},
TypeCode: {
vif: false,
label: '类型'
},
Path: {
vif: false,
label: '编码'
},
// Title: {
// type: 'input',
// label: '标题',
// layout: 24
// },
// TypeCode: {
// vif: false,
// label: '类型'
// },
// Path: {
// vif: false,
// label: '编码'
// },
TypeCode: {
vif: false,
label: '类型'
},
Note: {
label: '备注',
type: 'textarea'
label: '类型',
default: ''
},
// Note: {
// label: '备注',
// type: 'textarea'
// },
FileDetails: {
label: '附件'
}
......
......@@ -20,9 +20,9 @@
:listeners="tableListeners"
v-bind="tableConfig"
:expand-params="expandParams"
:url="url"
@handleSelectionChange="handleSelectionChange"
/>
<el-dialog
:title="dialogTitle"
:visible.sync="dialogFormVisible"
......@@ -37,6 +37,7 @@
<upload-btn
:objectID="formData.ObjectID"
:fileDetails="formData.FileDetails"
:file-list="fileList"
@change="changeFileList"
/>
</template>
......@@ -49,6 +50,7 @@
<el-button
type="primary"
@click="handleSave"
:loading="savaLoading"
>保存</el-button>
</div>
</el-dialog>
......@@ -77,10 +79,10 @@ export default {
type: String,
default: ''
},
path: {
type: String,
required: true
},
// path: {
// type: String,
// required: true
// },
objectID: {
type: String,
default: ''
......@@ -100,7 +102,9 @@ export default {
current: null,
dialogFormVisible: false,
dialogTitle: '',
loading: false
loading: false,
savaLoading: false,
url: ''
}
},
watch: {
......@@ -118,10 +122,17 @@ export default {
constant.tableConfig.initialParams.ModuleType = this.moduleType
}
constant.formConfig.formDesc.TypeCode.default = this.typeCode
constant.formConfig.formDesc.Path.default = this.path
// constant.formConfig.formDesc.Path.default = this.path
this.tableListeners = {
handleEdit: this.handleEdit,
handleDelete: this.handleDelete
// handleEdit: this.handleEdit,
handleDownload: this.handleDownload
}
if (this.$attrs['form-data'] && this.$attrs['form-data'].BusinessObjectID) {
this.tableConfig.initialParams = {
BusinessObjectID: this.$attrs['form-data'].BusinessObjectID,
}
} else {
this.tableConfig.url = ''
}
},
methods: {
......@@ -134,25 +145,26 @@ export default {
},
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.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)
console.log(fd)
if (Object.keys(fd).length < 2 && this.fileList.length === 0) {
this.dialogFormVisible = false
return
......@@ -165,23 +177,30 @@ export default {
formData.append('moduleType', this.moduleType)
}
this.fileList.forEach((item) => {
formData.append('files', item.raw)
formData.append('file', item.raw)
})
if (this.fileList.length > 0) {
formData.path = this.path
}
// if (this.fileList.length > 0) {
// formData.path = this.path
// }
if (!this.formData.ObjectID) {
const accountID =
const businessObjectID =
this.$route.query.objectID || this.tableConfig.initialParams.objectID
formData.append('accountID', accountID)
formData.append('businessObjectID', businessObjectID)
formData.delete('objectID')
this.loading = true
this.savaLoading = true
// console.log(formData)
this.$request(file.createUrl, formData).then(() => {
this.savaLoading = false
this.loading = false
this.dialogFormVisible = false
this.fileList = []
this.$message.success('添加成功!')
this.$refs.eleTable.url = file.searchUrl
this.$refs.eleTable.handleSearch()
}).catch(() => {
this.$message.error('添加失败')
this.savaLoading = false
this.loading = false
})
} else {
......@@ -190,6 +209,8 @@ export default {
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
......@@ -200,7 +221,7 @@ export default {
this.current = selection.length > 0 ? selection[0] : null
},
handleDelete() {
if (this.selection.length === 0) {
if (this.current === null) {
this.$message.warning('请先选择一行数据')
return
}
......@@ -209,12 +230,16 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$request(file.deleteUrl, { objectID: current.ObjectID }).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)
}
}
}
......
......@@ -13,11 +13,11 @@
>
<el-button size="small" type="primary">上传文件</el-button>
</el-upload>
<upload-list
<!-- <upload-list
v-if="objectID"
v-bind="config"
:files="fileDetails"
@remove="handleRemoveReq" />
@remove="handleRemoveReq" /> -->
</div>
</template>
......@@ -48,22 +48,33 @@ export default {
default: true
},
// 已上传到服务器的文件列表
fileDetails: {
type: Array,
default: function() {
return []
}
},
// fileDetails: {
// type: Array,
// default: function() {
// return []
// }
// },
config: {
type: Object,
default: function() {
return {}
}
},
fileList: {
type: Array,
default: function() {
return []
}
}
},
data() {
return {
fileList: [],
return {}
},
watch: {
fileList: {
handler(newVal){},
deep: true,
immediate: true
}
},
created() {
......@@ -80,13 +91,13 @@ export default {
this.$emit('change', fileList)
},
// 删除文件
handleRemoveReq(index, item) {
this.$request(file.deleteDetailUrl, [{ objectID: item.ObjectID }]).then(() => {
this.$message.success('删除成功!')
this.fileDetails.splice(index, 1)
}
)
}
// handleRemoveReq(index, item) {
// this.$request(file.deleteDetailUrl, [{ objectID: item.ObjectID }]).then(() => {
// this.$message.success('删除成功!')
// this.fileDetails.splice(index, 1)
// }
// )
// }
}
}
</script>
......
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