Commit a823b3b8 authored by zhengke's avatar zhengke

修改

parent 024155b8
...@@ -136,7 +136,8 @@ export default { ...@@ -136,7 +136,8 @@ export default {
WeChatName: "", WeChatName: "",
WeChatPhoto: "", WeChatPhoto: "",
CustomerType: 1, CustomerType: 1,
EnterpriseName: "" EnterpriseName: "",
CategoryId:''
}, },
//员工列表 //员工列表
employeeList: [], employeeList: [],
...@@ -186,6 +187,7 @@ export default { ...@@ -186,6 +187,7 @@ export default {
this.detailData.WeChatPhoto = tempData.WeChatPhoto; this.detailData.WeChatPhoto = tempData.WeChatPhoto;
this.detailData.CustomerType = tempData.CustomerType; this.detailData.CustomerType = tempData.CustomerType;
this.detailData.EnterpriseName = tempData.EnterpriseName; this.detailData.EnterpriseName = tempData.EnterpriseName;
this.detailData.CategoryId = tempData.CategoryId;
} }
}); });
} else { } else {
...@@ -207,6 +209,7 @@ export default { ...@@ -207,6 +209,7 @@ export default {
this.detailData.WeChatPhoto = ""; this.detailData.WeChatPhoto = "";
this.detailData.CustomerType = 1; this.detailData.CustomerType = 1;
this.detailData.EnterpriseName = ""; this.detailData.EnterpriseName = "";
this.detailData.CategoryId = "";
} }
}, },
saveBaseInfo(obj) { saveBaseInfo(obj) {
......
...@@ -86,15 +86,36 @@ ...@@ -86,15 +86,36 @@
<q-btn size="sm" color="primary" label="确定" class="q-ml-sm" @click="save('CustomerType',Data.CustomerType)"></q-btn> <q-btn size="sm" color="primary" label="确定" class="q-ml-sm" @click="save('CustomerType',Data.CustomerType)"></q-btn>
</div> </div>
</div> </div>
<q-select outlined dense v-model="Data.CustomerType" map-options emit-value :options="options" <q-select outlined dense stack-label label="类型" @input="getCustomList(Data.CustomerType)" option-value="Id" option-label="Name"
:rules="[val => !!val || '请选择类型']" /> :rules="[val => !!val || '请选择类型']" :options="options" v-model="Data.CustomerType" emit-value map-options />
</div> </div>
<div class="flex justify-between items-center q-my-lg" v-else @click="showEdit('CustomerType')"> <div class="flex justify-between items-center q-my-lg" v-else @click="showEdit('CustomerType')">
<span>类型</span> <span>类型</span>
<span v-if="Data.CustomerType==1">企业</span> <span v-if="Data.CustomerType==1">企业</span>
<span v-if="Data.CustomerType==2">学校</span> <span v-if="Data.CustomerType==2">学校</span>
<span v-if="Data.CustomerType==3">个人</span>
<span v-if="Data.CustomerType==4">其他</span>
</div> </div>
<!-- 客户 -->
<template v-if="Data.CustomerType!=4">
<div class="q-my-sm" v-if="editField=='CategoryId'">
<div class="flex justify-between items-center q-mb-sm">
<span>客户</span>
<div>
<q-btn size="sm" text-color="primary" label="取消" @click="showEdit('')"></q-btn>
<q-btn size="sm" color="primary" label="确定" class="q-ml-sm" @click="save('CategoryId',Data.CategoryId)"></q-btn>
</div>
</div>
<q-select outlined dense stack-label label="客户" option-value="CategoryId" option-label="CategoryName"
:options="customList" v-model="Data.CategoryId" emit-value map-options />
</div>
<div class="flex justify-between items-center q-my-lg" v-else @click="showEdit('CategoryId')">
<span>客户</span>
<span>{{getName(Data.CategoryId)}}</span>
</div>
</template>
<!-- 企业/学校名称 --> <!-- 企业/学校名称 -->
<template v-if="Data.CustomerType==4">
<div class="q-my-sm" v-if="editField=='EnterpriseName'"> <div class="q-my-sm" v-if="editField=='EnterpriseName'">
<div class="flex justify-between items-center q-mb-sm"> <div class="flex justify-between items-center q-mb-sm">
<span>企业/学校名称</span> <span>企业/学校名称</span>
...@@ -109,6 +130,7 @@ ...@@ -109,6 +130,7 @@
<span>企业/学校名称</span> <span>企业/学校名称</span>
<span>{{Data.EnterpriseName}}</span> <span>{{Data.EnterpriseName}}</span>
</div> </div>
</template>
<!-- 详细地址 --> <!-- 详细地址 -->
<div class="q-my-sm" v-if="editField=='Address'"> <div class="q-my-sm" v-if="editField=='Address'">
<div class="flex justify-between items-center q-mb-sm"> <div class="flex justify-between items-center q-mb-sm">
...@@ -142,6 +164,11 @@ ...@@ -142,6 +164,11 @@
</div> </div>
</template> </template>
<script> <script>
import {
GetCatetoryTypeList,
queryCustomerCategoryList
} from "../../../api/users/user";
export default { export default {
components: {}, components: {},
props: { props: {
...@@ -153,21 +180,22 @@ ...@@ -153,21 +180,22 @@
data() { data() {
return { return {
editField: "", editField: "",
options: [{ options: [],
label: "企业",
value: 1,
}, {
label: "学校",
value: 2,
}],
sexOptions: [{ sexOptions: [{
label: "男", label: "男",
value: 1, value: 1,
}, { }, {
label: "女", label: "女",
value: 2, value: 2,
}] }],
customList:[]
}
},
mounted(){
if(this.Data.CustomerType){
this.getCustomList(this.Data.CustomerType);
} }
this.getTypeList();
}, },
methods: { methods: {
showEdit(field) { showEdit(field) {
...@@ -185,7 +213,35 @@ ...@@ -185,7 +213,35 @@
this.$emit("confirm",obj) this.$emit("confirm",obj)
this.editField ='' this.editField =''
}, },
getTypeList() {
GetCatetoryTypeList({}).then(res => {
if (res.Code == 1) {
this.options = res.Data;
}
})
}, },
getCustomList(Type){
let msg = {
CategoryName:"",
CatetoryType:Type
}
this.Data.CategoryId='';
queryCustomerCategoryList(msg).then(res => {
if (res.Code == 1) {
this.customList = res.Data;
}
})
},
getName(Id){
let Name=''
this.customList.forEach(x=>{
if(x.CategoryId==Id){
Name = x.CategoryName
}
})
return Name;
}
}
} }
</script> </script>
......
...@@ -122,20 +122,20 @@ ...@@ -122,20 +122,20 @@
return { return {
columns: [{ columns: [{
name: "CustomerName", name: "CustomerName",
label: "同业名称", label: "联系人名称",
field: "CustomerName", field: "CustomerName",
align: "left" align: "left"
}, },
{ {
name: "CustomerType", name: "CustomerTypeName",
label: "类型", label: "类型",
field: "CustomerType", field: "CustomerTypeName",
align: "left" align: "left"
}, },
{ {
name: "EnterpriseName", name: "CategoryName",
label: "企业/学校名称", label: "同业名称",
field: "EnterpriseName", field: "CategoryName",
align: "left" align: "left"
}, },
{ {
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
</style> </style>
<template> <template>
<div class="b2bcustomlist"> <div class="b2bcustomlist">
<q-table :pagination="pageMsg" :loading="loading" no-data-label="暂无相关数据" flat selection="multiple" <q-table :pagination="pageMsg" :loading="loading" no-data-label="暂无相关数据" flat
separator="none" :data="dataList" :columns="columns" row-key="CustomerId"> class="sticky-column-table" separator="none" :data="dataList" :columns="columns" row-key="CustomerId">
<template v-slot:top> <template v-slot:top>
<q-space /> <q-space />
<div class="page-option"> <div class="page-option">
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<div class="row wrap"> <div class="row wrap">
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.CustomerName" <q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.CustomerName"
ref="CustomerName" class="col-6 q-pb-lg q-pr-lg" label="客户名称" :rules="[val => !!val || '请输入客户名称']" /> ref="CustomerName" class="col-6 q-pb-lg q-pr-lg" label="联系人名称" :rules="[val => !!val || '请输入联系人名称']" />
</div> </div>
<div class="col-6"> <div class="col-6">
<q-radio v-model="objOption.Sex" :val="1" label="男" /> <q-radio v-model="objOption.Sex" :val="1" label="男" />
...@@ -116,17 +116,16 @@ ...@@ -116,17 +116,16 @@
ref="ContactNumber" class="col-6 q-pr-lg q-pb-lg" label="联系电话" /> ref="ContactNumber" class="col-6 q-pr-lg q-pb-lg" label="联系电话" />
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="40" v-model="objOption.EnterpriseName" :label="EnterpriseLabelName"> <q-select stack-label color="primary" filled label="类型" @input="getCustomList(objOption.CustomerType)" option-value="Id" option-label="Name"
<template v-slot:before> :options="typeOptions" class="q-pb-lg" v-model="objOption.CustomerType" emit-value map-options />
<q-select stack-label color="primary" filled label="类型" option-value="Id" option-label="TypeName"
:options="typeOptions" v-model="objOption.CustomerType" emit-value map-options
style="border-right:1px solid #999;min-width:90px;" @input='CustomerTypeChange' />
</template>
</q-input>
<!-- <q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.Fax" ref="Fax"
class="col-6 q-pb-lg" label="传真" /> -->
</div> </div>
</div> </div>
<div class="row wrap">
<q-input filled v-if="objOption.CustomerType==4" stack-label maxlength="20" :dense="false" v-model="objOption.EnterpriseName" lazy-rules
ref="EnterpriseName" class="col-6 q-pr-lg q-pb-lg" />
<q-select stack-label color="primary" v-else filled label="客户" option-value="CategoryId" option-label="CategoryName"
:options="customList" class="col-6 q-pr-lg q-pb-lg" v-model="objOption.CategoryId" emit-value map-options />
</div>
<div class="row wrap"> <div class="row wrap">
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="20" :dense="false" v-model:number="objOption.QQ" ref="QQ" <q-input filled stack-label maxlength="20" :dense="false" v-model:number="objOption.QQ" ref="QQ"
...@@ -134,7 +133,7 @@ ...@@ -134,7 +133,7 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.WeChatNo" ref="wechat" <q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.WeChatNo" ref="wechat"
class="col-6 q-pr-lg q-pb-lg" label="微信" /> class="col-6 q-pb-lg" label="微信" />
</div> </div>
<!-- <div class="col-6"> <!-- <div class="col-6">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.Email" ref="Email" <q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.Email" ref="Email"
...@@ -142,14 +141,11 @@ ...@@ -142,14 +141,11 @@
</div> --> </div> -->
</div> </div>
<div class="row wrap"> <div class="row wrap">
<div class="col-6"> <div class="col-12">
<!-- <q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.Account" ref="Account" <!-- <q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.Account" ref="Account"
class="col-6 q-pr-lg q-pb-lg" label="账号" /> --> class="col-6 q-pr-lg q-pb-lg" label="账号" /> -->
<q-input filled stack-label :dense="false" v-model="objOption.Address" ref="Address" <q-input filled stack-label :dense="false" v-model="objOption.Address" ref="Address"
class="col-6 q-pr-lg q-pb-lg" label="详细地址" /> class="col-12 q-pb-lg" label="详细地址" />
</div>
<div class="col-6">
</div> </div>
</div> </div>
<div class="row wrap"> <div class="row wrap">
...@@ -195,6 +191,11 @@ ...@@ -195,6 +191,11 @@
SetCustomer, SetCustomer,
GetCustomer GetCustomer
} from "../../api/sale/peemanagement"; } from "../../api/sale/peemanagement";
import {
GetCatetoryTypeList,
queryCustomerCategoryList
} from "../../api/users/user";
import { import {
validateTel validateTel
} from '../../utils/validate' } from '../../utils/validate'
...@@ -236,6 +237,7 @@ ...@@ -236,6 +237,7 @@
WeChatPhoto: '', WeChatPhoto: '',
CustomerType: 1, //同业类型 1企业 2学校 CustomerType: 1, //同业类型 1企业 2学校
EnterpriseName: "", //企业名称 EnterpriseName: "", //企业名称
CategoryId:''
}, },
EnterpriseLabelName: "企业名称", EnterpriseLabelName: "企业名称",
saveCustomLoading: false, saveCustomLoading: false,
...@@ -244,18 +246,15 @@ ...@@ -244,18 +246,15 @@
regionList: [], //区 regionList: [], //区
CustomerBrandList: [], //所属品牌下拉 CustomerBrandList: [], //所属品牌下拉
optionTitle: '', optionTitle: '',
typeOptions: [{ typeOptions: [],
Id: 1, customList:[]
TypeName: "企业",
}, {
Id: 2,
TypeName: "学校",
}]
} }
}, },
created() {}, created() {},
mounted() { mounted() {
this.getTypeList();
this.initObj() this.initObj()
this.getCustomList(1);
}, },
methods: { methods: {
//初始化表单 //初始化表单
...@@ -360,8 +359,27 @@ ...@@ -360,8 +359,27 @@
} else { } else {
this.EnterpriseLabelName = '学校名称' this.EnterpriseLabelName = '学校名称'
} }
},
getTypeList() {
GetCatetoryTypeList({}).then(res => {
if (res.Code == 1) {
this.typeOptions = res.Data;
} }
})
}, },
getCustomList(Type){
let msg = {
CategoryName:"",
CatetoryType:Type
}
this.objOption.CategoryId = '';
queryCustomerCategoryList(msg).then(res => {
if (res.Code == 1) {
this.customList = res.Data;
}
})
}
}
} }
</script> </script>
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
</style> </style>
<template> <template>
<div class="page-body"> <div class="page-body">
<div class="page-content"> <div class="page-content">
<div> <div>
<q-tabs style="margin-bottom:20px;" v-model="tabCheck" @input="resetSearch()" narrow-indicator dense <q-tabs style="margin-bottom:20px;" v-model="tabCheck" @input="resetSearch()" narrow-indicator dense
...@@ -95,8 +94,8 @@ ...@@ -95,8 +94,8 @@
loading: false, loading: false,
visibleColumns: [ visibleColumns: [
"CustomerName", "CustomerName",
"CustomerType", "CustomerTypeName",
"EnterpriseName", "CategoryName",
"ContactNumber", "ContactNumber",
"StuNum", "StuNum",
"OrderNum", "OrderNum",
...@@ -132,6 +131,7 @@ ...@@ -132,6 +131,7 @@
CategoryName: "", //客户名称 CategoryName: "", //客户名称
CatetoryType: "", //类型 CatetoryType: "", //类型
pageCount: 0, pageCount: 0,
IsQueryAll: 0
}, },
}; };
}, },
...@@ -163,7 +163,6 @@ ...@@ -163,7 +163,6 @@
if (this.tabCheck == 1) { if (this.tabCheck == 1) {
GetCustomerPage_v2(this.msg) GetCustomerPage_v2(this.msg)
.then(res => { .then(res => {
console.log("GetCustomerPage_v2", res);
this.dataList = res.Data.PageData; this.dataList = res.Data.PageData;
this.loading = false; this.loading = false;
this.pageCount = res.Data.PageCount; this.pageCount = res.Data.PageCount;
...@@ -173,7 +172,6 @@ ...@@ -173,7 +172,6 @@
}); });
} else if (this.tabCheck == 2) { } else if (this.tabCheck == 2) {
queryCustomerCategoryPage(this.categoryMsg).then(res => { queryCustomerCategoryPage(this.categoryMsg).then(res => {
console.log("queryCustomerCategoryPage", res);
this.dataList = res.Data.PageData; this.dataList = res.Data.PageData;
this.loading = false; this.loading = false;
this.categoryMsg.pageCount = res.Data.PageCount; this.categoryMsg.pageCount = res.Data.PageCount;
......
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