Commit 1d48a559 authored by zhengke's avatar zhengke

修改

parent 0d3f8d76
...@@ -356,4 +356,16 @@ export function deleteCustomerCategory(data) { ...@@ -356,4 +356,16 @@ export function deleteCustomerCategory(data) {
method: 'post', method: 'post',
data data
}) })
}
/**
* 获取客户类型列表
* @param {查询参数} data
*/
export function GetCatetoryTypeList(data) {
return request({
url: '/B2BCustomer/GetCatetoryTypeList',
method: 'post',
data
})
} }
\ No newline at end of file
<style scoped>
.CLM-Form .el-input__inner {
background: transparent;
border: 0;
}
.CLM-Form .el-input-group__append {
background: transparent;
border: 0;
}
.common_Style {
display: inline-block;
width: 30px;
height: 30px;
border-radius: 50%;
text-align: center;
line-height: 30px;
}
.classForm_monday {
background-color: #ced9f8;
color: #2961FE;
}
.classForm_tuesday {
background-color: #d9f3ff;
color: #3FC4FF;
}
.classForm_wednesday {
background-color: #f6e2cb;
color: #F28C1D;
}
.classForm_thursday {
background-color: #ccf3eb;
color: #02C499;
}
.classForm_friday {
background-color: #f7cfd6;
color: #F72E52;
}
.classForm_saturday {
background-color: #fff5cc;
color: #FFCC00;
}
.classForm_sunday {
background-color: #e6e3fe;
color: #8175FB;
}
.planTimeLi2 tbody::before {
content: '';
display: table-row;
height: 20px;
}
.customerPhoto {
width: 55px;
height: 55px;
}
.customerPhoto img {
width: 100%;
height: 100%;
}
/deep/ .q-field__before,
/deep/ .q-field__prepend {
padding-right: 0px !important;
}
</style>
<template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale">
<q-card style="width: 400px;max-width:400px;" class="CLM-Form">
<q-card-section>
<div class="text-h6">{{optionTitle}}</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="row wrap">
<div class="col-12">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.CategoryName"
ref="CategoryName" class="col-12 q-pb-lg" label="名称" :rules="[val => !!val || '请填写客户名称']" />
</div>
</div>
<div class="row wrap">
<div class="col-12">
<q-select stack-label color="primary" filled label="类型" option-value="Id" option-label="Name"
:options="typeList" class="q-pb-lg" v-model="objOption.CatetoryType" emit-value map-options />
</div>
</div>
<template v-if="isShowTel">
<div class="row wrap">
<div class="col-12">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.linkMan" ref="linkMan"
class="col-12 q-pb-lg" label="联系人" />
</div>
</div>
<div class="row wrap">
<div class="col-12">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.linkTel" ref="linkTel"
class="col-12 q-pb-lg" label="联系电话" />
</div>
</div>
</template>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeCourseForm" />
<q-btn label="保存" color="accent q-px-md" style="font-weight:400 !important" :loading="saveCustomLoading"
@click="saveCourse">
</q-btn>
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
saveCustomerCategory,
queryCustomerCategory,
GetCatetoryTypeList
} from "../../api/users/user";
export default {
components: {},
props: {
customerObj: {
type: Object,
default: null
}
},
data() {
return {
persistent: true,
objOption: {
CategoryName: "",
CatetoryType: '',
CategoryId: 0,
linkMan: "",
linkTel: ""
},
typeList: [], //类型
saveCustomLoading: false,
optionTitle: '',
isShowTel: true
}
},
created() {},
mounted() {
this.initObj()
this.getTypeList();
},
methods: {
//初始化表单
initObj() {
if (this.customerObj && this.customerObj.CategoryId > 0) {
this.isShowTel = false;
let msg = {
CategoryId: this.customerObj.CategoryId
}
queryCustomerCategory(msg).then(res => {
if (res.Code == 1) {
let tempData = res.Data;
this.objOption.CategoryName = tempData.CategoryName;
this.objOption.CatetoryType = tempData.CatetoryType;
this.objOption.CategoryId = tempData.CategoryId;
}
})
this.optionTitle = "修改客户信息"
} else {
this.objOption.CategoryName = '';
this.objOption.CatetoryType = '';
this.objOption.CategoryId = 0;
this.objOption.linkMan = '';
this.objOption.linkTel = '';
this.optionTitle = "新增客户信息"
this.isShowTel = true;
}
},
//保存
saveCourse() {
this.$refs.CategoryName.validate();
if (!this.$refs.CategoryName.hasError) {
this.saveCustomLoading = true;
saveCustomerCategory(this.objOption).then(res => {
if (res.Code == 1) {
this.saveCustomLoading = false;
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top",
});
this.$emit("success");
this.closeCourseForm()
}
})
}
},
getTypeList() {
GetCatetoryTypeList({}).then(res => {
if (res.Code == 1) {
this.typeList = res.Data;
}
})
},
//关闭弹窗
closeCourseForm() {
this.$emit('close');
this.persistent = false;
}
},
}
</script>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</style> </style>
<template> <template>
<div class="b2bcustomlist"> <div class="b2bcustomlist">
<q-table :pagination="pageMsg" :loading="loading" no-data-label="暂无相关数据" flat selection="multiple" :class="sticky" <q-table :pagination="pageMsg" :loading="loading" no-data-label="暂无相关数据" flat selection="multiple"
separator="none" :data="dataList" :columns="columns" row-key="CustomerId"> separator="none" :data="dataList" :columns="columns" row-key="CustomerId">
<template v-slot:top> <template v-slot:top>
<q-space /> <q-space />
...@@ -47,44 +47,34 @@ ...@@ -47,44 +47,34 @@
</template> </template>
<template v-slot:body-cell-optioned="props"> <template v-slot:body-cell-optioned="props">
<q-td :props="props"> <q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="修改" /> <q-btn flat size="xs" icon="edit" color="accent" @click="EditCustom(props.row)" style="font-weight:400" label="修改" />
<q-btn flat size="xs" icon="delete" @click="RemoveCustomer(props.row)" color="negative" style="font-weight:400" label="删除" />
</q-td> </q-td>
</template> </template>
<template v-slot:bottom> <template v-slot:bottom>
<div></div> <div></div>
</template> </template>
</q-table> </q-table>
<categoryEdit-form v-if="isShowCategoryForm" :customerObj="customerObj" @close="closeCustomForm"
@success="refreshQuestion">
</categoryEdit-form>
</div> </div>
</template> </template>
<script> <script>
import { import {
queryEmployee deleteCustomerCategory
} from "../../api/users/user"; } from "../../api/users/user";
import { import categoryEditForm from "../sale/categoryEdit-form";
setCustomerCareOf
} from "../../api/sale/peemanagement";
import customerEditForm from "../sale/customerEdit-form";
import customerReviewForm from "../sale/customerReview-form";
import customerInfo from "./b2bcustomerinfo/b2bCustomerInfo.vue";
export default { export default {
props: { props: {
dataList: { dataList: {
type: Array, type: Array,
default: null default: null
},
empList: {
type: Array,
default: () => []
},
sticky: {
type: String,
default: ""
} }
}, },
components: { components: {
customerEditForm, categoryEditForm
customerReviewForm,
customerInfo
}, },
data() { data() {
return { return {
...@@ -139,39 +129,16 @@ ...@@ -139,39 +129,16 @@
rowsPerPage: 12 rowsPerPage: 12
}, },
loading: false, loading: false,
isShowCustomForm: false, isShowCategoryForm: false,
isShowRightForm: false, customerObj: null //传入参数
customerObj: null, //传入参数
isShowDetailForm: false,
curRowId: 0,
//权限设置
AuthorityObj: {
isShowEdit: false, //是否显示新增修改按钮
isShowAudit: false, //是否显示审批
isShowBankBook: false, //是否显示幸福存折
isShowRebate: false //是否显示返佣
},
tabId: 1,
TransferMsg: {
CustomerIds: "",
EmpId: ""
},
//员工列表
employeeList: [],
myEmployeeList: [],
isShowTrans: false
}; };
}, },
created() { created() {
this.getEmployeeList();
}, },
mounted() { mounted() {
console.log("this.dataList", this.dataList);
}, },
methods: { methods: {
//新增或者修改客户 //新增或者修改客户
EditCustom(obj) { EditCustom(obj) {
if (obj) { if (obj) {
...@@ -179,31 +146,14 @@ ...@@ -179,31 +146,14 @@
} else { } else {
this.customerObj = null; this.customerObj = null;
} }
this.isShowCustomForm = true; this.isShowCategoryForm = true;
},
//客户审核
AuditCustomer(obj, Type) {
if (obj) {
this.customerObj = obj;
this.customerObj.Type = Type;
} else {
this.customerObj = null;
}
this.isShowRightForm = true;
},
//客户详情
showDetail(row, tabId = 1) {
this.curRowId = row.CustomerId;
this.tabId = tabId;
this.isShowDetailForm = true;
}, },
//删除客户 //删除客户
RemoveCustomer(obj) { RemoveCustomer(obj) {
let that = this; let that = this;
var message = var message =
"您正在进行删除【" + "您正在进行删除【" +
obj.CustomerName + obj.CategoryName +
"】行为,一旦执行无法找回,是否确认执行?"; "】行为,一旦执行无法找回,是否确认执行?";
this.$q this.$q
.dialog({ .dialog({
...@@ -222,9 +172,9 @@ ...@@ -222,9 +172,9 @@
}) })
.onOk(() => { .onOk(() => {
var delMsg = { var delMsg = {
CustomerId: obj.CustomerId CategoryId: obj.CategoryId
}; };
RemoveCustomer(delMsg).then(res => { deleteCustomerCategory(delMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
that.$q.notify({ that.$q.notify({
icon: "iconfont icon-chenggong", icon: "iconfont icon-chenggong",
...@@ -240,61 +190,11 @@ ...@@ -240,61 +190,11 @@
}, },
//关闭弹窗 //关闭弹窗
closeCustomForm() { closeCustomForm() {
this.isShowCustomForm = false; this.isShowCategoryForm = false;
this.isShowRightForm = false;
this.isShowDetailForm = false;
}, },
refreshQuestion() { refreshQuestion() {
this.$emit("success"); this.$emit("success");
}, },
//跳转到幸福存折
gohappyPassbook(item) {
this.OpenNewUrl("/sale/happyPassbook", {
CustomerId: item.CustomerId
});
},
//跳转到返佣管理
gohappyCommisson(item) {
this.OpenNewUrl("/sale/commsionManagement", {
CustomerId: item.CustomerId
});
},
//同业转交
saveTransForm() {
this.$refs.transfer.validate();
if (this.$refs.transfer.hasError) return;
this.TransferMsg.CustomerIds = this.selection
.map(e => e.CustomerId)
.toString();
setCustomerCareOf(this.TransferMsg).then(res => {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "转交成功",
position: "top"
});
this.isShowTrans = false;
this.selection = [];
});
},
//获取员工列表
getEmployeeList() {
queryEmployee({
IsLeave: 1
}).then(res => {
this.employeeList = res.Data;
this.myEmployeeList = res.Data;
});
},
//筛选员工
filterEmployee(val, update, abort) {
update(() => {
this.myEmployeeList = this.employeeList.filter(
v => v.EmployeeName.indexOf(val) > -1
);
});
}
} }
}; };
</script> </script>
\ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<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
align="left" class="text-primary"> align="left" class="text-primary">
<q-tab :ripple="false" :name="1" label="联系人" /> <q-tab :ripple="false" :name="1" label="联系人" />
<!-- <q-tab :ripple="false" :name="2" label="同行管理" /> --> <q-tab :ripple="false" :name="2" label="同行管理" />
</q-tabs> </q-tabs>
</div> </div>
<template v-if="tabCheck==1"> <template v-if="tabCheck==1">
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
:input="true" @input="changePage" /> :input="true" @input="changePage" />
</template> </template>
<template v-if="tabCheck==2"> <template v-if="tabCheck==2">
<!-- <div class="page-search row items-center"> <div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3"> <div class="col-3">
<q-input @input="resetSearch" filled clearable v-model="msg.CategoryName" label="同业名称" maxlength="20" /> <q-input @input="resetSearch" filled clearable v-model="categoryMsg.CategoryName" label="同业名称" maxlength="20" />
</div> </div>
</div> </div>
</div> </div>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
sticky="sticky-tow-column-table sticky-right-column-table"> sticky="sticky-tow-column-table sticky-right-column-table">
</customcategorylist> </customcategorylist>
<q-pagination class="full-width justify-end" v-model="categoryMsg.pageIndex" color="primary" <q-pagination class="full-width justify-end" v-model="categoryMsg.pageIndex" color="primary"
:max="categoryMsg.pageCount" :input="true" @input="changeCategoryPage" /> --> :max="categoryMsg.pageCount" :input="true" @input="changeCategoryPage" />
</template> </template>
</div> </div>
</div> </div>
......
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