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

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

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