Commit 48b47479 authored by zhengke's avatar zhengke

修改

parent 6f655a0b
<template>
<div class="customform">
<q-table :pagination="pageMsg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-column-table sticky-right-column-table no-bottom-table" separator="none" :data="dataList" :columns="columns"
row-key="name">
<template v-slot:top="props">
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" @click="EditCustom(null)" label="新增客户" />
</div>
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props" style="width:200px;">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditCustom(props.row)" />
<q-btn flat v-if="props.row.ApproveState==0||props.row.ApproveState==2" size="xs" icon="edit" color="accent"
style="font-weight:400" label="客户审批" @click="AuditCustomer(props.row,1)" />
<q-btn flat v-if="props.row.ApproveState==1" size="xs" icon="iconfont icon-View" color="accent"
style="font-weight:400" label="查看" @click="AuditCustomer(props.row,2)" />
<q-btn flat v-if="props.row.ApproveState==0" size="xs" icon="delete" color="negative" style="font-weight:400"
label="删除" @click="RemoveCustomer(props.row)" />
</q-td>
</template>
</q-table>
<perCustomer-form v-if="isShowCustomForm" :customerObj="customerObj" @close="closeCustomForm"
@success="refreshQuestion">
</perCustomer-form>
<customRight-form v-if="isShowRightForm" :customerObj="customerObj" @close="closeCustomForm"
@success="refreshQuestion"></customRight-form>
</div>
</template>
<script>
import perCustomerForm from '../sale/perCustomer-form';
import customRightForm from '../sale/customRight-form';
export default {
props: {
dataList: {
type: Array,
default: null
}
},
components: {
perCustomerForm,
customRightForm
},
data() {
return {
columns: [{
name: 'CustomerName',
label: '姓名',
field: 'CustomerName',
align: 'left'
},
{
name: 'ContactNumber',
label: '联系电话',
field: 'ContactNumber',
align: 'left',
},
{
name: 'Account',
label: '账号',
field: 'Account',
align: 'left'
},
{
name: 'CustomerStateStr',
label: '账号状态',
field: 'CustomerStateStr',
align: 'left'
},
{
name: 'ApproveStateStr',
label: '审核状态',
field: 'ApproveStateStr',
align: 'left'
},
{
name: 'CreateByName',
label: '创建人',
field: 'CreateByName',
align: 'left'
},
{
name: 'CreateTimeStr',
label: '创建时间',
field: 'CreateTimeStr',
align: 'left'
},
{
name: 'optioned',
label: '操作',
field: 'QuestionId'
}
],
pageMsg: {
rowsPerPage: 12,
},
loading: false,
isShowCustomForm: false,
isShowRightForm: false,
customerObj: null, //传入参数
}
},
created() {
},
mounted() {},
methods: {
//新增或者修改客户
EditCustom(obj) {
if (obj) {
this.customerObj = obj
} else {
this.customerObj = null
}
this.isShowCustomForm = true
},
//客户审核
AuditCustomer(obj, Type) {
if (obj) {
this.customerObj = obj
this.customerObj.Type = Type;
} else {
this.customerObj = null
}
this.isShowRightForm = true
},
//删除客户
RemoveCustomer(obj) {
let that = this;
var message = "您正在进行删除【" + obj.CustomerName + "】行为,一旦执行无法找回,是否确认执行?";;
this.$q.dialog({
title: "删除客户",
message: message,
isShowEditClassRoomForm: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
var delMsg = {
CustomerId: obj.CustomerId,
};
RemoveCustomer(delMsg).then(res => {
if (res.Code == 1) {
that.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功',
position: 'top'
})
that.refreshQuestion();
}
})
});
},
//关闭弹窗
closeCustomForm() {
this.isShowCustomForm = false;
this.isShowRightForm = false;
},
refreshQuestion() {
this.$emit('success');
},
}
}
</script>
...@@ -104,8 +104,8 @@ ...@@ -104,8 +104,8 @@
</div> </div>
</div> </div>
<div style="margin:30px 10px 0 0;text-align:right;"> <div style="margin:30px 10px 0 0;text-align:right;">
<q-btn flat color="grey-10" class="q-mr-md" label="取消" @click="closeperForm()" />
<q-btn color="accent" v-if="customerObj.Type==1" class="q-mr-md" label="保存" @click="saveConfig()" /> <q-btn color="accent" v-if="customerObj.Type==1" class="q-mr-md" label="保存" @click="saveConfig()" />
<q-btn color="accent" v-else class="q-mr-md" label="取消" @click="closeperForm()" />
</div> </div>
</q-card> </q-card>
<div class="dialog-out-close" @click="closeperForm" <div class="dialog-out-close" @click="closeperForm"
...@@ -161,6 +161,14 @@ ...@@ -161,6 +161,14 @@
}, },
//保存 //保存
saveConfig() { saveConfig() {
if(this.AuditMsg.ApproveState == 0){
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择审批通过或者驳回`
})
return;
}
if (this.AuditMsg.ApproveState == 2 && this.AuditMsg.ApproveContent == '') { if (this.AuditMsg.ApproveState == 2 && this.AuditMsg.ApproveContent == '') {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
......
<style>
.page-content p {
margin: 0 !important;
}
.quetion_Title {
background: transparent !important;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 400px;
}
</style>
<template>
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @input="resetSearch" filled clearable v-model="msg.CustomerName"
label="客户名称" maxlength="20" />
</div>
<div class="col-3">
<q-input @input="resetSearch" filled clearable v-model="msg.ContactNumber"
label="联系电话" maxlength="20" />
</div>
<div class="col-3">
<q-select @input="resetSearch" clearable filled v-model="msg.ApproveState" :options="ApproveStateList"
emit-value map-options label="审核状态" />
</div>
</div>
</div>
<div class="page-content">
<div>
<q-tabs style="margin-bottom:20px;" v-model="tabCheck" narrow-indicator dense align="left" class="text-primary">
<q-tab :ripple="false" :name="1" label="正式客户" />
<q-tab :ripple="false" :name="2" label="非正式客户" />
<q-tab :ripple="false" :name="3" label="未通过客户" />
<q-tab :ripple="false" :name="4" label="黑名单客户" />
</q-tabs>
</div>
<custom-form :dataList="dataList" :loading="loading" @success="getList"></custom-form>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</div>
</div>
</template>
<script>
import {
GetCustomerPage,
RemoveCustomer
} from '../../api/sale/peemanagement';
import customForm from '../../components/sale/custom-form';
export default {
meta: {
title: "同行管理"
},
components: {
customForm
},
data() {
return {
pageCount: 0,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
CustomerName: '', //客户名称
ContactNumber: "", //联系电话
ApproveState: "", //审核状态
CustomerState: "", //账号状态
},
loading: false,
tabCheck: 1,
//审核状态列表
ApproveStateList: [{
label: "通过",
value: "1",
},
{
label: "拒绝",
value: "2",
},
],
//账号状态
accountStateList: [{
label: "正常",
value: "1",
},
{
label: "禁用",
value: "2",
}, {
label: "删除",
value: "3",
}, {
label: "未激活",
value: "4",
}
],
dataList: [],
}
},
created() {},
mounted() {
this.getList();
},
methods: {
//重新查询
resetSearch() {
this.msg.pageIndex = 1;
this.getList();
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getList()
},
//获取分页数据
getList() {
GetCustomerPage(this.msg).then(res => {
this.dataList = res.Data.PageData;
this.loading = false;
this.pageCount = res.Data.PageCount;
}).catch(() => {
this.loading = false
})
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
\ No newline at end of file
...@@ -32,42 +32,17 @@ ...@@ -32,42 +32,17 @@
</div> </div>
</div> </div>
<div class="page-content"> <div class="page-content">
<div style="display:flex;justify-content:space-between;align-items:center;"> <div>
<q-tabs style="margin-bottom:20px;" v-model="tabCheck" narrow-indicator dense align="left" class="text-primary"> <q-tabs style="margin-bottom:20px;" v-model="tabCheck" narrow-indicator dense 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-tab :ripple="false" :name="3" label="未通过客户" /> <q-tab :ripple="false" :name="3" label="未通过客户" />
<q-tab :ripple="false" :name="4" label="黑名单客户" /> <q-tab :ripple="false" :name="4" label="黑名单客户" />
</q-tabs> </q-tabs>
<div>
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" @click="EditCustom(null)" label="新增客户" />
</div>
</div> </div>
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat <custom-form :dataList="dataList" :loading="loading" @success="getList"></custom-form>
class="sticky-column-table sticky-right-column-table" separator="none" :data="dataList" :columns="columns"
row-key="name">
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount" <q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" /> :input="true" @input="changePage" />
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props" style="width:200px;">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditCustom(props.row)" />
<q-btn flat v-if="props.row.ApproveState==0||props.row.ApproveState==2" size="xs" icon="edit" color="accent"
style="font-weight:400" label="客户审批" @click="AuditCustomer(props.row,1)" />
<q-btn flat v-if="props.row.ApproveState==1" size="xs" icon="iconfont icon-View" color="accent"
style="font-weight:400" label="查看" @click="AuditCustomer(props.row,2)" />
<q-btn flat v-if="props.row.ApproveState==0" size="xs" icon="delete" color="negative"
style="font-weight:400" label="删除" @click="RemoveCustomer(props.row)" />
</q-td>
</template>
</q-table>
<perCustomer-form v-if="isShowCustomForm" :customerObj="customerObj" @close="closeCustomForm"
@success="refreshQuestion">
</perCustomer-form>
<customRight-form v-if="isShowRightForm" :customerObj="customerObj" @close="closeCustomForm"
@success="refreshQuestion"></customRight-form>
</div> </div>
</div> </div>
</template> </template>
...@@ -76,15 +51,13 @@ ...@@ -76,15 +51,13 @@
GetCustomerPage, GetCustomerPage,
RemoveCustomer RemoveCustomer
} from '../../api/sale/peemanagement'; } from '../../api/sale/peemanagement';
import perCustomerForm from '../../components/sale/perCustomer-form'; import customForm from '../../components/sale/custom-form';
import customRightForm from '../../components/sale/customRight-form';
export default { export default {
meta: { meta: {
title: "同行管理" title: "同行管理"
}, },
components: { components: {
perCustomerForm, customForm
customRightForm
}, },
data() { data() {
return { return {
...@@ -99,58 +72,8 @@ ...@@ -99,58 +72,8 @@
CustomerState: "", //账号状态 CustomerState: "", //账号状态
}, },
loading: false, loading: false,
isShowCustomForm: false,
isShowRightForm: false,
customerObj: null, //传入参数
tabCheck: 1, tabCheck: 1,
columns: [{
name: 'CustomerName',
label: '姓名',
field: 'CustomerName',
align: 'left'
},
{
name: 'ContactNumber',
label: '联系电话',
field: 'ContactNumber',
align: 'left',
},
{
name: 'Account',
label: '账号',
field: 'Account',
align: 'left'
},
{
name: 'CustomerStateStr',
label: '账号状态',
field: 'CustomerStateStr',
align: 'left'
},
{
name: 'ApproveStateStr',
label: '审核状态',
field: 'ApproveStateStr',
align: 'left'
},
{
name: 'CreateByName',
label: '创建人',
field: 'CreateByName',
align: 'left'
},
{
name: 'CreateTimeStr',
label: '创建时间',
field: 'CreateTimeStr',
align: 'left'
},
{
name: 'optioned',
label: '操作',
field: 'QuestionId'
}
],
//审核状态列表 //审核状态列表
ApproveStateList: [{ ApproveStateList: [{
label: "通过", label: "通过",
...@@ -195,68 +118,7 @@ ...@@ -195,68 +118,7 @@
this.msg.pageIndex = val; this.msg.pageIndex = val;
this.getList() this.getList()
}, },
//关闭弹窗
closeCustomForm() {
this.isShowCustomForm = false;
this.isShowRightForm = false;
},
//新增或者修改客户
EditCustom(obj) {
if (obj) {
this.customerObj = obj
} else {
this.customerObj = null
}
this.isShowCustomForm = true
},
//客户审核
AuditCustomer(obj,Type) {
if (obj) {
this.customerObj = obj
this.customerObj.Type = Type;
} else {
this.customerObj = null
}
this.isShowRightForm = true
},
refreshQuestion() {
this.getList()
},
//删除客户
RemoveCustomer(obj) {
let that = this;
var message = "您正在进行删除【" + obj.CustomerName + "】行为,一旦执行无法找回,是否确认执行?";;
this.$q.dialog({
title: "删除客户",
message: message,
isShowEditClassRoomForm: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
var delMsg = {
CustomerId: obj.CustomerId,
};
RemoveCustomer(delMsg).then(res => {
if (res.Code == 1) {
that.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功',
position: 'top'
})
that.refreshQuestion();
}
})
});
},
//获取分页数据 //获取分页数据
getList() { getList() {
GetCustomerPage(this.msg).then(res => { GetCustomerPage(this.msg).then(res => {
......
...@@ -858,6 +858,11 @@ const routes = [{ ...@@ -858,6 +858,11 @@ const routes = [{
component: () => component: () =>
import("pages/sale/peerManagement.vue") import("pages/sale/peerManagement.vue")
}, },
{
path: "/sale/peerApproval", //销售 同行审批
component: () =>
import("pages/sale/peerApproval.vue")
},
{ {
path: "/sale/activityList", //销售 活动列表 path: "/sale/activityList", //销售 活动列表
component: () => component: () =>
......
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