Commit 67935d71 authored by 全洪江's avatar 全洪江

客户主数据主页和tab页面修改

parent ef6d89c1
...@@ -133,7 +133,7 @@ export default { ...@@ -133,7 +133,7 @@ export default {
name: 'Account', name: 'Account',
dicts: ['sys_yes_no'], dicts: ['sys_yes_no'],
props: { props: {
clientId: {type: Number | undefined, default: undefined}, clientCode: {type: String | undefined, default: undefined},
}, },
data() { data() {
return { return {
...@@ -159,7 +159,7 @@ export default { ...@@ -159,7 +159,7 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
clientId: this.clientId, bank: null, bankAccount: null, accountName: null, enableFlag: null clientCode: this.clientCode, bank: null, bankAccount: null, accountName: null, enableFlag: null
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -172,7 +172,7 @@ export default { ...@@ -172,7 +172,7 @@ export default {
getList() { getList() {
this.accountList = [] this.accountList = []
this.total = 0 this.total = 0
if (!this.queryParams.clientId) return if (!this.queryParams.clientCode) return
this.loading = true this.loading = true
pageAccount(this.queryParams).then(response => { pageAccount(this.queryParams).then(response => {
this.accountList = response.data.records this.accountList = response.data.records
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
reset() { reset() {
this.form = { this.form = {
id: null, id: null,
clientId: this.clientId, clientCode: this.clientCode,
bank: null, bank: null,
bankAccount: null, bankAccount: null,
accountName: null, accountName: null,
...@@ -235,7 +235,7 @@ export default { ...@@ -235,7 +235,7 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
if (!this.form.clientId) return this.$message.error("请先创建客户") if (!this.form.clientCode) return this.$message.error("请先创建客户")
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
...@@ -246,7 +246,7 @@ export default { ...@@ -246,7 +246,7 @@ export default {
}) })
} else { } else {
addAccount(this.form).then(response => { addAccount(this.form).then(response => {
this.form.clientId = this.clientId this.form.clientCode = this.clientCode
this.$modal.msgSuccess('新增成功') this.$modal.msgSuccess('新增成功')
this.open = false this.open = false
this.getList() this.getList()
...@@ -273,8 +273,8 @@ export default { ...@@ -273,8 +273,8 @@ export default {
}, `account_${new Date().getTime()}.xlsx`) }, `account_${new Date().getTime()}.xlsx`)
}, },
init(form) { init(form) {
if (!form.clientId) return if (!form.clientCode) return
this.queryParams.clientId = form.clientId this.queryParams.clientCode = form.clientCode
this.getList() this.getList()
} }
} }
......
...@@ -137,7 +137,7 @@ import {listBrandByCondition} from '@/api/mes/md/brand' ...@@ -137,7 +137,7 @@ import {listBrandByCondition} from '@/api/mes/md/brand'
export default { export default {
props: { props: {
clientId: {type: Number | undefined, default: undefined}, clientCode: {type: String | undefined, default: undefined},
}, },
data() { data() {
return { return {
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
clientId: null, clientCode: null,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -203,7 +203,7 @@ export default { ...@@ -203,7 +203,7 @@ export default {
/** 查询客户联系人列表 */ /** 查询客户联系人列表 */
getList() { getList() {
this.loading = true this.loading = true
this.queryParams.clientId = this.clientId this.queryParams.clientCode = this.clientCode
listContact(this.queryParams).then(response => { listContact(this.queryParams).then(response => {
console.log(response, 111) console.log(response, 111)
this.contactList = response.rows this.contactList = response.rows
...@@ -219,7 +219,7 @@ export default { ...@@ -219,7 +219,7 @@ export default {
reset() { reset() {
this.form = { this.form = {
id: null, id: null,
clientId: this.clientId, clientCode: this.clientCode,
brandName: null, brandName: null,
position: null, position: null,
...@@ -279,7 +279,7 @@ export default { ...@@ -279,7 +279,7 @@ export default {
this.getList() this.getList()
}) })
} else { } else {
this.form.clientId = this.clientId this.form.clientCode = this.clientCode
addContact(this.form).then(response => { addContact(this.form).then(response => {
this.$modal.msgSuccess('新增成功') this.$modal.msgSuccess('新增成功')
this.open = false this.open = false
...@@ -307,8 +307,8 @@ export default { ...@@ -307,8 +307,8 @@ export default {
}, `contact_${new Date().getTime()}.xlsx`) }, `contact_${new Date().getTime()}.xlsx`)
}, },
init(form) { init(form) {
if (!form.clientId) return if (!form.clientCode) return
this.queryParams.clientId = form.clientId this.queryParams.clientCode = form.clientCode
this.getList() this.getList()
}, },
/** 远程搜索 */ /** 远程搜索 */
......
...@@ -92,7 +92,7 @@ import { listClient } from '@/api/mes/md/client' ...@@ -92,7 +92,7 @@ import { listClient } from '@/api/mes/md/client'
export default { export default {
name: "Relation", name: "Relation",
props: { props: {
clientId: {type: Number | undefined, default: undefined}, clientCode: {type: String | undefined, default: undefined},
}, },
data() { data() {
return { return {
...@@ -118,8 +118,8 @@ export default { ...@@ -118,8 +118,8 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
clientId: null, clientCode: null,
relatedClientId: null, relatedClientCode: null,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
/** 查询客户付款信息关联列表 */ /** 查询客户付款信息关联列表 */
getList() { getList() {
this.loading = true; this.loading = true;
this.queryParams.clientId = this.clientId this.queryParams.clientCode = this.clientCode
listRelation(this.queryParams).then(response => { listRelation(this.queryParams).then(response => {
this.relationList = response.rows; this.relationList = response.rows;
this.total = response.total; this.total = response.total;
...@@ -152,8 +152,8 @@ export default { ...@@ -152,8 +152,8 @@ export default {
reset() { reset() {
this.form = { this.form = {
id: null, id: null,
clientId: this.clientId, clientCode: this.clientCode,
relatedClientId: null, relatedClientCode: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
...@@ -204,7 +204,7 @@ export default { ...@@ -204,7 +204,7 @@ export default {
this.getList(); this.getList();
}); });
} else { } else {
this.form.clientId = this.clientId this.form.clientCode = this.clientCode
addRelation(this.form).then(response => { addRelation(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
...@@ -236,8 +236,8 @@ export default { ...@@ -236,8 +236,8 @@ export default {
listClient({ clientName: key, pageNum: 1, pageSize: 100 }).then(res => this.clientList = res.rows) listClient({ clientName: key, pageNum: 1, pageSize: 100 }).then(res => this.clientList = res.rows)
}, },
init(form) { init(form) {
if (!form.clientId) return if (!form.clientCode) return
this.queryParams.clientId = form.clientId this.queryParams.clientCode = form.clientCode
this.getList() this.getList()
} }
} }
......
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
name: 'Email', name: 'Email',
dicts: ['sys_yes_no'], dicts: ['sys_yes_no'],
props: { props: {
clientId: {type: Number | undefined, default: undefined}, clientCode: {type: String | undefined, default: undefined},
}, },
data() { data() {
return { return {
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
clientId: null, clientCode: null,
email: null, contact: null, enableFlag: null email: null, contact: null, enableFlag: null
}, },
// 表单参数 // 表单参数
...@@ -157,7 +157,7 @@ export default { ...@@ -157,7 +157,7 @@ export default {
/** 查询催货款通知邮箱列表 */ /** 查询催货款通知邮箱列表 */
getList() { getList() {
this.loading = true this.loading = true
this.queryParams.clientId = this.clientId this.queryParams.clientCode = this.clientCode
listEmail(this.queryParams).then(response => { listEmail(this.queryParams).then(response => {
this.emailList = response.rows this.emailList = response.rows
this.total = response.total this.total = response.total
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
reset() { reset() {
this.form = { this.form = {
id: null, id: null,
clientId: this.clientId, clientCode: this.clientCode,
email: null, email: null,
contact: null, contact: null,
enableFlag: null, enableFlag: null,
...@@ -227,7 +227,7 @@ export default { ...@@ -227,7 +227,7 @@ export default {
this.getList() this.getList()
}) })
} else { } else {
this.form.clientId = this.clientId this.form.clientCode = this.clientCode
addEmail(this.form).then(response => { addEmail(this.form).then(response => {
this.$modal.msgSuccess('新增成功') this.$modal.msgSuccess('新增成功')
this.open = false this.open = false
...@@ -255,8 +255,8 @@ export default { ...@@ -255,8 +255,8 @@ export default {
}, `email_${new Date().getTime()}.xlsx`) }, `email_${new Date().getTime()}.xlsx`)
}, },
init(form) { init(form) {
if (!form.clientId) return if (!form.clientCode) return
this.queryParams.clientId = form.clientId this.queryParams.clientCode = form.clientCode
this.getList() this.getList()
} }
} }
......
...@@ -79,7 +79,8 @@ ...@@ -79,7 +79,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['mes:md:client:add']" v-hasPermi="['mes:md:client:add']"
>新增</el-button> >新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -90,7 +91,8 @@ ...@@ -90,7 +91,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['mes:md:client:edit']" v-hasPermi="['mes:md:client:edit']"
>修改</el-button> >修改
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -101,7 +103,8 @@ ...@@ -101,7 +103,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['mes:md:client:remove']" v-hasPermi="['mes:md:client:remove']"
>删除</el-button> >删除
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -111,33 +114,35 @@ ...@@ -111,33 +114,35 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['mes:md:client:export']" v-hasPermi="['mes:md:client:export']"
>导出</el-button> >导出
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="clientList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="clientList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center"/>
<el-table-column label="客户编码" align="center" prop="clientCode" > <el-table-column label="客户编码" align="center" prop="clientCode">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
@click="handleView(scope.row)" @click="handleView(scope.row)"
v-hasPermi="['mes:md:client:query']" v-hasPermi="['mes:md:client:query']"
>{{scope.row.clientCode}}</el-button> >{{ scope.row.clientCode }}
</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="客户名称" width="150px" align="center" prop="clientName" :show-overflow-tooltip="true"/> <el-table-column label="客户名称" width="150px" align="center" prop="clientName" :show-overflow-tooltip="true"/>
<el-table-column label="客户简称" align="center" prop="clientNick" /> <el-table-column label="客户简称" align="center" prop="clientNick"/>
<el-table-column label="客户类型" align="center" prop="clientType" > <el-table-column label="客户类型" align="center" prop="clientType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_client_type" :value="scope.row.clientType"/> <dict-tag :options="dict.type.mes_client_type" :value="scope.row.clientType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="客户电话" align="center" prop="tel" /> <el-table-column label="客户电话" align="center" prop="tel"/>
<el-table-column label="联系人" align="center" prop="contact1" /> <el-table-column label="联系人" align="center" prop="contact1"/>
<el-table-column label="联系人-电话" align="center" prop="contact1Tel" /> <el-table-column label="联系人-电话" align="center" prop="contact1Tel"/>
<el-table-column label="是否启用" align="center" prop="enableFlag" > <el-table-column label="是否启用" align="center" prop="enableFlag">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.enableFlag"/> <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.enableFlag"/>
</template> </template>
...@@ -150,14 +155,16 @@ ...@@ -150,14 +155,16 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['mes:md:client:edit']" v-hasPermi="['mes:md:client:edit']"
>详情</el-button> >详情
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['mes:md:client:remove']" v-hasPermi="['mes:md:client:remove']"
>删除</el-button> >删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -171,36 +178,27 @@ ...@@ -171,36 +178,27 @@
/> />
<!-- 添加或修改客户对话框 --> <!-- 添加或修改客户对话框 -->
<el-dialog :title="title" :visible.sync="open" width="950px"> <el-dialog :title="title" :visible.sync="open" width="1200px" :before-close="handleClose">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="8"> <el-col :span="12">
<el-form-item label="客户编码" prop="clientCode"> <el-form-item label="客户编码" prop="clientCode">
<el-input v-model="form.clientCode" placeholder="请输入客户编码" /> <el-input v-model="form.clientCode" readonly="readonly" maxlength="64"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="80">
<el-switch v-model="autoGenFlag"
active-color="#13ce66"
active-text="自动生成"
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'">
</el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="客户名称" prop="clientName"> <el-form-item label="客户名称" prop="clientName">
<el-input v-model="form.clientName" placeholder="请输入客户名称" /> <el-input v-model="form.clientName" placeholder="请输入客户名称"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="客户简称" prop="clientNick"> <el-form-item label="客户简称" prop="clientNick">
<el-input v-model="form.clientNick" placeholder="请输入客户简称" /> <el-input v-model="form.clientNick" placeholder="请输入客户简称"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="客户英文名称" prop="clientEn"> <el-form-item label="客户英文名称" prop="clientEn">
<el-input v-model="form.clientEn" placeholder="请输入客户英文名称" /> <el-input v-model="form.clientEn" placeholder="请输入客户英文名称"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -210,21 +208,23 @@ ...@@ -210,21 +208,23 @@
v-for="dict in dict.type.sys_yes_no" v-for="dict in dict.type.sys_yes_no"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
>{{dict.label}}</el-radio> >{{ dict.label }}
</el-radio>
</el-radio-group> </el-radio-group>
<el-radio-group v-model="form.enableFlag" v-else> <el-radio-group v-model="form.enableFlag" v-else>
<el-radio <el-radio
v-for="dict in dict.type.sys_yes_no" v-for="dict in dict.type.sys_yes_no"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
>{{dict.label}}</el-radio> >{{ dict.label }}
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" readonly v-if="optType=='view'" /> <el-input v-model="form.remark" type="textarea" readonly v-if="optType=='view'"/>
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" v-else /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" v-else/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
<el-tab-pane label="客户基本信息" name="BaseInfo"> <el-tab-pane label="客户基本信息" name="BaseInfo">
<BaseInfo ref="BaseInfo" :form="form"/> <BaseInfo ref="BaseInfo" :form="form"/>
</el-tab-pane> </el-tab-pane>
<!-- <el-tab-pane label="地址信息" name="AddrInfo"> <!-- <el-tab-pane label="地址信息" name="AddrInfo">
<AddrInfo ref="AddrInfo" :form="form"/> <AddrInfo ref="AddrInfo" :form="form"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="交货信息" name="DeliveryInfo"> <el-tab-pane label="交货信息" name="DeliveryInfo">
...@@ -243,19 +243,19 @@ ...@@ -243,19 +243,19 @@
<FinanceInfo ref="FinanceInfo" :form="form"/> <FinanceInfo ref="FinanceInfo" :form="form"/>
</el-tab-pane>--> </el-tab-pane>-->
<el-tab-pane label="客户联系人" name="ClientContact"> <el-tab-pane label="客户联系人" name="ClientContact">
<ClientContact ref="ClientContact" :clientId="form.clientId"/> <ClientContact ref="ClientContact" :clientCode="form.clientCode"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="银行账号" name="Account"> <el-tab-pane label="银行账号" name="Account">
<Account ref="Account" :clientId="form.clientId"/> <Account ref="Account" :clientCode="form.clientCode"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="产品对照" name="ClientItem"> <el-tab-pane label="产品对照" name="ClientItem">
<ClientItem ref="ClientItem"/> <ClientItem ref="ClientItem"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="催货款通知邮箱" name="UrgeEmail"> <el-tab-pane label="催货款通知邮箱" name="UrgeEmail">
<UrgeEmail ref="UrgeEmail" :clientId="form.clientId"/> <UrgeEmail ref="UrgeEmail" :clientCode="form.clientCode"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="客户关联关系" name="PaymentRelation"> <el-tab-pane label="客户关联关系" name="PaymentRelation">
<PaymentRelation ref="PaymentRelation" :clientId="form.clientId"/> <PaymentRelation ref="PaymentRelation" :clientCode="form.clientCode"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="SAP特性" name="SapProperty"> <el-tab-pane label="SAP特性" name="SapProperty">
<SapPropertyData ref="SapProperty"/> <SapPropertyData ref="SapProperty"/>
...@@ -264,8 +264,8 @@ ...@@ -264,8 +264,8 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType =='view'">返回</el-button> <el-button type="primary" @click="cancel" v-if="optType =='view'"> </el-button>
<el-button type="primary" @click="submitForm" v-else>确 定</el-button> <el-button type="primary" @click="submitForm" v-else>保 存</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
</template> </template>
<script> <script>
import { listClient, getClient, delClient, addClient, updateClient } from "@/api/mes/md/client"; import {listClient, getClient, delClient, addClient, updateClient} from "@/api/mes/md/client";
import BaseInfo from '@/views/mes/md/client/components/BaseInfo' import BaseInfo from '@/views/mes/md/client/components/BaseInfo'
import UrgeEmail from '@/views/mes/md/client/components/UrgeEmail' import UrgeEmail from '@/views/mes/md/client/components/UrgeEmail'
import AddrInfo from '@/views/mes/md/client/components/AddrInfo' import AddrInfo from '@/views/mes/md/client/components/AddrInfo'
...@@ -285,9 +285,10 @@ import FinanceInfo from '@/views/mes/md/client/components/FinanceInfo' ...@@ -285,9 +285,10 @@ import FinanceInfo from '@/views/mes/md/client/components/FinanceInfo'
import PaymentRelation from '@/views/mes/md/client/components/PaymentRelation' import PaymentRelation from '@/views/mes/md/client/components/PaymentRelation'
import {genCode} from "@/api/system/autocode/rule" import {genCode} from "@/api/system/autocode/rule"
export default { export default {
name: "Client", name: "Client",
dicts: ['mes_client_type','sys_yes_no'], dicts: ['mes_client_type', 'sys_yes_no'],
components: { components: {
AddrInfo, BaseInfo, DeliveryInfo, FinanceInfo, UrgeEmail, PaymentRelation, ClientContact, Account, ClientItem AddrInfo, BaseInfo, DeliveryInfo, FinanceInfo, UrgeEmail, PaymentRelation, ClientContact, Account, ClientItem
}, },
...@@ -295,7 +296,7 @@ export default { ...@@ -295,7 +296,7 @@ export default {
return { return {
//自动生成编码 //自动生成编码
activeName: 'BaseInfo', activeName: 'BaseInfo',
autoGenFlag:false, autoGenFlag: true,
optType: undefined, optType: undefined,
// 遮罩层 // 遮罩层
loading: true, loading: true,
...@@ -389,26 +390,26 @@ export default { ...@@ -389,26 +390,26 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
clientCode: [ clientCode: [
{ required: true, message: "客户编码不能为空", trigger: "blur" } {required: true, message: "客户编码不能为空", trigger: "blur"}
], ],
clientName: [ clientName: [
{ required: true, message: "客户名称不能为空", trigger: "blur" } {required: true, message: "客户名称不能为空", trigger: "blur"}
], ],
email:[ email: [
{ {
type: "email", type: "email",
message: "请输入正确的邮箱地址", message: "请输入正确的邮箱地址",
trigger: ["blur", "change"] trigger: ["blur", "change"]
} }
], ],
contact1Email:[ contact1Email: [
{ {
type: "email", type: "email",
message: "请输入正确的邮箱地址", message: "请输入正确的邮箱地址",
trigger: ["blur", "change"] trigger: ["blur", "change"]
} }
], ],
contact2Email:[ contact2Email: [
{ {
type: "email", type: "email",
message: "请输入正确的邮箱地址", message: "请输入正确的邮箱地址",
...@@ -416,7 +417,7 @@ export default { ...@@ -416,7 +417,7 @@ export default {
} }
], ],
enableFlag: [ enableFlag: [
{ required: true, message: "是否启用不能为空", trigger: "blur" } {required: true, message: "是否启用不能为空", trigger: "blur"}
], ],
} }
}; };
...@@ -449,7 +450,7 @@ export default { ...@@ -449,7 +450,7 @@ export default {
licenseNo: null, licenseNo: null,
taxNo: null, taxNo: null,
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
...@@ -465,19 +466,20 @@ export default { ...@@ -465,19 +466,20 @@ export default {
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.clientId) this.ids = selection.map(item => item.clientId)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.handleAutoGenChange(true);
this.open = true; this.open = true;
this.activeName = 'BaseInfo' this.activeName = 'BaseInfo'
this.title = "添加客户"; this.title = "添加客户";
this.optType = "add"; this.optType = "add";
}, },
// 查询明细按钮操作 // 查询明细按钮操作
handleView(row){ handleView(row) {
this.reset(); this.reset();
const clientId = row.clientId || this.ids const clientId = row.clientId || this.ids
getClient(clientId).then(response => { getClient(clientId).then(response => {
...@@ -522,12 +524,13 @@ export default { ...@@ -522,12 +524,13 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const clientIds = row.clientId || this.ids; const clientIds = row.clientId || this.ids;
this.$modal.confirm('是否确认删除客户编号为"' + clientIds + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除客户编号为"' + clientIds + '"的数据项?').then(function () {
return delClient(clientIds); return delClient(clientIds);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
...@@ -536,23 +539,30 @@ export default { ...@@ -536,23 +539,30 @@ export default {
}, `client_${new Date().getTime()}.xlsx`) }, `client_${new Date().getTime()}.xlsx`)
}, },
//自动生成编码 //自动生成编码
handleAutoGenChange(autoGenFlag){ handleAutoGenChange(autoGenFlag) {
if(autoGenFlag){ if (autoGenFlag) {
genCode('CLIENT_CODE').then(response =>{ genCode('CLIENT_CODE').then(response => {
this.form.clientCode = response; this.form.clientCode = response;
this.$forceUpdate() this.$forceUpdate()
}); });
}else{ } else {
this.form.clientCode = null; this.form.clientCode = null;
} }
}, },
onTabClick() { onTabClick() {
if (this.activeName === 'SapProperty') { if (this.activeName === 'SapProperty') {
this.$refs.SapProperty.init(1, null, this.form.clientId, this.form) this.$refs.SapProperty.init(1, null, this.form.clientId, this.form)
} } else {
else {
this.$refs[this.activeName].init && this.$refs[this.activeName].init(this.form) this.$refs[this.activeName].init && this.$refs[this.activeName].init(this.form)
} }
},
handleClose(done) {
this.$confirm('客户信息如已修改还未保存,确认关闭?')
.then(_ => {
done();
})
.catch(_ => {
});
} }
} }
}; };
......
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