Commit cd081268 authored by 黄奎's avatar 黄奎

页面修改

parent 7fb42d73
......@@ -3,71 +3,27 @@
<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"
clearable
filled
v-model="msg.StuName"
label="昵称"
maxlength="20"
/>
<q-input @input="resetSearch" clearable filled v-model="msg.StuName" label="昵称" maxlength="20" />
</div>
<div class="col-3">
<q-input
@input="resetSearch"
clearable
filled
v-model="msg.StuTel"
label="电话"
maxlength="20"
/>
<q-input @input="resetSearch" clearable filled v-model="msg.StuTel" label="电话" maxlength="20" />
</div>
<div class="col-3">
<q-select
@input="resetSearch"
filled
v-model="msg.StuStage"
:options="customState"
option-label="Name"
option-value="Id"
emit-value
map-options
label="客户状态"
clearable
/>
<q-select @input="resetSearch" filled v-model="msg.StuStage" :options="customState" option-label="Name"
option-value="Id" emit-value map-options label="客户状态" clearable />
</div>
<div class="col-3">
<q-field filled>
<template v-slot:control>
<el-date-picker
v-model="dateArray"
@change="resetSearch"
value-format="yyyy-MM-dd"
type="daterange"
style="border:none;"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
/>
<el-date-picker v-model="dateArray" @change="resetSearch" value-format="yyyy-MM-dd" type="daterange"
style="border:none;" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" />
</template>
</q-field>
</div>
<div class="col-3">
<q-select
@input="resetSearch"
v-model="msg.CustomerId"
:options="myCustomerList"
filled
use-input
label="同行"
option-label="CustomerName"
option-value="CustomerId"
ref="CustomerName"
class="col-6 q-pb-lg"
emit-value
map-options
@filter="cusfilterFn"
>
<q-select @input="resetSearch" v-model="msg.CustomerId" :options="myCustomerList" filled use-input label="同行"
option-label="CustomerName" option-value="CustomerId" ref="CustomerName" class="col-6 q-pb-lg" emit-value
map-options @filter="cusfilterFn">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
......@@ -77,149 +33,168 @@
</template>
</q-select>
</div>
<div class="col-3">
<q-select @input="resetSearch" standout="bg-primary text-white" option-value="Id" option-label="Name"
v-model="msg.BelongType" :options="BelongTypeList" emit-value map-options label="归属类型" />
</div>
</div>
</div>
<div class="page-content">
<stulist :dataList="data" @success="refreshPage" ref="stuList"> </stulist>
<div class="row" style="justify-content: flex-end;padding: 5px 20px">
<q-pagination
v-model="msg.pageIndex"
:max="pageCount"
@input="changePage"
class="full-width justify-end"
color="primary"
:input="true"
>
<q-pagination v-model="msg.pageIndex" :max="pageCount" @input="changePage" class="full-width justify-end"
color="primary" :input="true">
</q-pagination>
</div>
</div>
</div>
</template>
<script>
import {
getStudentPage,
getSchoolDropdown,
deleteStudent,
createStudentAccount,
queryStuStageList
} from "../../api/school/index";
import { queryEmployee } from "../../api/users/user";
import { resetPassword } from "../../api/users/user.js";
import {
getStudentPage,
getSchoolDropdown,
deleteStudent,
createStudentAccount,
queryStuStageList
} from "../../api/school/index";
import {
queryEmployee
} from "../../api/users/user";
import {
resetPassword
} from "../../api/users/user.js";
import stulist from "../../components/school/student/stulist";
import { getMyCustomerList } from "../../api/sale/sale";
export default {
meta: {
title: "客户管理"
},
components: {
stulist
},
data() {
return {
currentUrl: "",
data: [],
loading: true,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
StuName: "",
StuTel: "",
Status: "-1",
CreateBy: "",
IsQueryMyStu: 1,
StuStage: "", //客户阶段
StartTime: "", //开始时间
EndTime: "", //结束时间
CustomerId: 0
},
dateArray: [], //日期数组
pageCount: 0,
//客户阶段状态列表
customState: [],
myCustomerList: [], //同行列表
allCustomerList: [] //所有同行列表
};
},
created() {
this.getSchool();
this.getStuStageList();
},
mounted() {
this.currentUrl = this.$route.path;
this.getStudent();
this.getCustomerList();
},
methods: {
//获取客户阶段列表
getStuStageList() {
queryStuStageList().then(res => {
this.customState = res.Data;
});
import stulist from "../../components/school/student/stulist";
import {
getMyCustomerList
} from "../../api/sale/sale";
export default {
meta: {
title: "客户管理"
},
resetSearch() {
this.msg.pageIndex = 1;
this.getStudent();
components: {
stulist
},
changePage(val) {
this.msg.pageIndex = val;
this.getStudent();
data() {
return {
currentUrl: "",
data: [],
loading: true,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
StuName: "",
StuTel: "",
Status: "-1",
CreateBy: "",
IsQueryMyStu: 1,
StuStage: "", //客户阶段
StartTime: "", //开始时间
EndTime: "", //结束时间
CustomerId: 0,
BelongType: 1, //归属类型
},
dateArray: [], //日期数组
pageCount: 0,
//客户阶段状态列表
customState: [],
myCustomerList: [], //同行列表
allCustomerList: [], //所有同行列表
//归属类型列表
BelongTypeList: [{
Id: 1,
Name: "全部"
},
{
Id: 2,
Name: "我负责的"
},
{
Id: 3,
Name: "我协同的"
},
],
};
},
getSchool() {
getSchoolDropdown({}).then(res => {
this.schoolList = res.Data;
});
created() {
this.getSchool();
this.getStuStageList();
},
getStudent() {
if (this.dateArray && this.dateArray.length > 0) {
this.msg.StartTime = this.dateArray[0];
this.msg.EndTime = this.dateArray[1];
} else {
this.msg.StartTime = "";
this.msg.EndTime = "";
}
this.loading = true;
getStudentPage(this.msg)
.then(res => {
this.loading = false;
this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount;
})
.catch(() => {
this.loading = false;
});
},
refreshPage() {
mounted() {
this.currentUrl = this.$route.path;
this.getStudent();
this.getCustomerList();
},
getCustomerList() {
getMyCustomerList({}).then(res => {
this.myCustomerList = res.Data;
this.allCustomerList = res.Data;
this.myCustomerList.unshift({
CustomerName:"不限",
CustomerId:0,
})
});
},
cusfilterFn(val, update) {
update(() => {
if (val === "") {
this.myCustomerList = JSON.parse(
JSON.stringify(this.allCustomerList)
);
methods: {
//获取客户阶段列表
getStuStageList() {
queryStuStageList().then(res => {
this.customState = res.Data;
});
},
resetSearch() {
this.msg.pageIndex = 1;
this.getStudent();
},
changePage(val) {
this.msg.pageIndex = val;
this.getStudent();
},
getSchool() {
getSchoolDropdown({}).then(res => {
this.schoolList = res.Data;
});
},
getStudent() {
if (this.dateArray && this.dateArray.length > 0) {
this.msg.StartTime = this.dateArray[0];
this.msg.EndTime = this.dateArray[1];
} else {
const needle = val.toLowerCase();
this.myCustomerList = this.allCustomerList.filter(
v => v.CustomerName.toLowerCase().indexOf(needle) > -1
);
this.msg.StartTime = "";
this.msg.EndTime = "";
}
});
this.loading = true;
getStudentPage(this.msg)
.then(res => {
this.loading = false;
this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount;
})
.catch(() => {
this.loading = false;
});
},
refreshPage() {
this.getStudent();
},
getCustomerList() {
getMyCustomerList({}).then(res => {
this.myCustomerList = res.Data;
this.allCustomerList = res.Data;
this.myCustomerList.unshift({
CustomerName: "不限",
CustomerId: 0,
})
});
},
cusfilterFn(val, update) {
update(() => {
if (val === "") {
this.myCustomerList = JSON.parse(
JSON.stringify(this.allCustomerList)
);
} else {
const needle = val.toLowerCase();
this.myCustomerList = this.allCustomerList.filter(
v => v.CustomerName.toLowerCase().indexOf(needle) > -1
);
}
});
}
}
}
};
};
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
@import url('~assets/css/table.sass')
</style>
\ No newline at end of file
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