123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453 |
- <template>
- <div v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
- <div class="mcr-box">
- <div class="mcr-head">
- <!-- 预计出团量 -->
- <!-- <div style="display: flex;margin-bottom: 10px;">
- <div style="width:24%">
- 预计出团:<span>{{ preDele }}</span>
- </div>
- <div style="width:24%">
- 预计出团总量:<span>{{ groupNumber.preDeleAll }}</span>
- </div>
- <div style="width:24%">
- 已出团:<span>{{ finlishedDele }}</span>
- </div>
- <div style="width:24%">
- 已出团总量:<span>{{ groupNumber.finlishedDeleAll }}</span>
- </div>
- </div> -->
- <div>
- <el-select v-model="principalSel" :disabled='isSelect' clearable placeholder="负责人" style="width
- :18%">
- <el-option v-for="item in principalList" :key="item.id" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- <el-select v-model="territorySel" clearable placeholder="省 域" style="width
- :18%">
- <el-option v-for="item in territoryList" :key="item.id" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- <el-select v-model="clientLvSel" clearable placeholder="客户级别" style="width
- :18%">
- <el-option v-for="item in clientLvList" :key="item.id" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- <el-select v-model="clientTypeSel" clearable placeholder="客户类别" style="width
- :18%">
- <el-option v-for="item in clientTypeList" :key="item.id" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- <el-select v-model="businessClassSel" clearable placeholder="业务分类" style="width
- :18%">
- <el-option v-for="item in businessClassList" :key="item.id" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </div>
- <!-- textbox框 -->
- <div style="display: flex;margin-top: 10px;position: relative;">
- <div style="width: 31%;">
- <el-input v-model="inputLXR" placeholder="联系人"></el-input>
- </div>
-
- <div style="width: 30%;">
- <el-input v-model="inputDQ" placeholder="地区"></el-input>
- </div>
-
- <div style="width: 29.59%;">
- <el-input v-model="inputDW" placeholder="单位"></el-input>
- </div>
-
- <div class="btnOp">
- <div>
- <el-button type="primary" @click="QueryData">查 询</el-button>
- </div>
- <div style="height: 10px;">
- </div>
- <div>
- <el-button type="primary" @click="Add">新 增</el-button>
- </div>
- </div>
- </div>
- </div>
- <div class="mcr-table">
- <el-table :data="PageList" border @select="handleSelect" style="width: 100%">
- <el-table-column prop="weight" label="权重" width="50">
- <template slot-scope="scope">
- <span v-if="scope.row.weight == '393'">A</span>
- <span v-else-if="scope.row.weight == '392'">B</span>
- <span v-else-if="scope.row.weight == '391'">C</span>
- </template>
- </el-table-column>
- <el-table-column prop="client" label="单位" width="230">
- </el-table-column>
- <el-table-column prop="contact" label="联系人" width="90">
- </el-table-column>
- <el-table-column prop="job" label="职位" width="110">
- </el-table-column>
- <el-table-column prop="telephone" label="手机号" width="120">
- </el-table-column>
- <el-table-column prop="phone" label="座机号" width="120">
- </el-table-column>
- <el-table-column prop="location" label="所在区域" width="130">
- </el-table-column>
- <!-- <el-table-column prop="birthday" label="生日">
- </el-table-column> -->
- <el-table-column prop="ascribedDepartment" label="业务归属" width="80">
- <template slot-scope="scope">
- <el-tooltip class="item" effect="dark" placement="top">
- <span style="color:royalblue">查看</span>
- <div slot="content">
- <div v-for="(yw, index) in scope.row.ascribedDepartment" :key="index"
- style="text-align: center; width: 100px;padding: 5px;">
- {{ yw.name }}
- </div>
- </div>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column prop="ascribedUser" label="负责人" width="85">
- <template slot-scope="scope">
- <!-- <el-tooltip class="item" effect="dark" placement="top">
- <span style="color:royalblue">查看</span>
- <div slot="content">
- <div v-for="yw in scope.row.ascribedUser"
- style="text-align: center; width: 100px;padding: 5px;">
- {{ yw.cnName }}
- </div>
- </div>
- </el-tooltip> -->
- <div v-for="(yw, index) in scope.row.ascribedUser" :key="index" style="text-align: center;">
- {{ yw.cnName }}
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="remark" label="备注">
- <template slot-scope="scope">
- <div id="remark">
- <el-tooltip v-show="scope.row.remark != ''" class="item" effect="dark"
- :content="scope.row.remark" placement="top">
- <span v-if="scope.row.remark.length > 10">{{ scope.row.remark.slice(0, 10) + "..."
- }}</span>
- <span v-else>{{ scope.row.remark }}</span>
- <div slot="content">
- <div style="width: 300px;">
- {{ scope.row.remark }}
- </div>
- </div>
- </el-tooltip>
- </div>
- </template>
- </el-table-column>
- <!-- <el-table-column prop="preDele" label="预计出团">
- </el-table-column>
- <el-table-column prop="finlishedDele" label="已出团">
- </el-table-column> -->
- <el-table-column label="操作" width="200">
- <template slot-scope="scope">
- <el-button type="primary" size="mini" @click="Edit(scope.row)">编
- 辑</el-button>
- <el-button type="danger" size="mini" @click="Del(scope.row)">删
- 除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div class="block">
- <el-pagination align='center' @size-change="handleSizeChange" @current-change="handleCurrentChange"
- :current-page.sync="currentPage" :page-sizes="[10, 20]" :page-size="pageSize"
- layout="total, sizes, prev, pager, next" :total="total">
- </el-pagination>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- total: 0, //总行数
- principalSel: '',
- principalList: [],//负责人数据
- territorySel: '',
- territoryList: [],//省域数据
- clientLvSel: '',
- clientLvList: [],//客户级别数据
- clientTypeSel: '',
- clientTypeList: [],//客户类别数据]
- businessClassSel: '',
- businessClassList: [],//业务分类
- PageList: [], //页面数据
- currentPage: 1, // 当前页码
- pageSize: 10,// 每页的数据条数
- loading: true,
- inputLXR: '', //联系人
- inputDQ: '', //地区
- inputDW: '', //单位
- pageloadData: {
- "portType": 1,
- "pageIndex": 1,
- "pageSize": 10,
- "contact": "",
- "location": "",
- "client": "",
- "userid": "",
- "lvlid": 0,
- "business": "",
- "Range": 0,
- "Category": 0,
- "operationUserId": 0
- },
- groupNumber: {
- preDeleAll: '',
- finlishedDeleAll: ''
- },
- userId: 0,
- token: '',
- isSelect: true
- }
- },
- methods: {
- //每页条数改变时触发 选择一页显示多少行
- handleSizeChange(val) {
- this.currentPage = 1;
- this.pageSize = val;
- this.pageloadData.pageIndex = this.currentPage;
- this.pageloadData.pageSize = this.pageSize;
- this.pageload();
- },
- //当前页改变时触发 跳转其他页
- handleCurrentChange(val) {
- this.loading = true;
- this.pageloadData.pageIndex = val;
- this.pageloadData.pageSize = this.pageSize;
- this.pageload();
- },
- //多选框选中方法
- handleSelect(selection, row) {
- },
- pageload() {
- var that = this;
- if (this.userId == 21) {
- this.isSelect = false;
- }
- that.pageloadData.operationUserId = that.userId
- //初始化界面数据
- console.log(that.pageloadData)
- this.$axios.post('/api/MarketCustomerResources/QueryNewClientData', that.pageloadData, {
- headers: {
- 'Authorization': that.token,
- },
- }).then(resp => {
- if (resp.data.code == 200) {
- if (resp.data.data == null) {
- that.PageList = [];
- that.total = 0;
- this.$message.error(resp.data.msg);
- } else {
- that.principalList = resp.data.data.users; //负责人
- that.clientLvList = resp.data.data.level;//客户级别
- that.clientTypeList = resp.data.data.customerClass;//客户类别
- that.territoryList = resp.data.data.province; //省域数据
- that.businessClassList = resp.data.data.serviceClass; //业务归属
- that.PageList = resp.data.data.clientTableData.pageSource; //table数据
- that.total = resp.data.data.clientTableData.pageCount; //总数
- that.groupNumber = resp.data.data.groupNumber; //团组出团总数
- console.log(that.pageloadData.pageIndex, parseInt(that.pageloadData.pageIndex), 'that.pageloadData.pageIndex')
- that.currentPage = parseInt(that.pageloadData.pageIndex);
- }
- that.loading = false;
- } else if (resp.data.code == 400) {
- that.PageList = [];
- that.total = 0;
- that.loading = false;
- that.$message.error('暂无数据!');
- }
- }).catch(err => {
- this.$message.error('网络异常!');
- this.loading = false;
- })
- },
- //保存权限
- saveData() {
- var that = this;
- },
- QueryData() {
- this.pageloadData.pageIndex = this.currentPage;
- this.pageloadData.pageSize = this.pageSize;
- this.pageloadData.location = this.inputDQ; //地区
- this.pageloadData.client = this.inputDW; //单位
- this.pageloadData.contact = this.inputLXR; //联系人
- this.pageloadData.userid = this.principalSel.toString(); //负责人
- this.pageloadData.Range = this.territorySel == '' ? 0 : this.territorySel;//省域
- this.pageloadData.lvlid = this.clientLvSel == '' ? 0 : this.clientLvSel; //客户级别
- this.pageloadData.Category = this.clientTypeSel == '' ? 0 : this.clientTypeSel;//客户类别
- this.pageloadData.business = this.businessClassSel.toString();//业务分类
- this.pageloadData.operationUserId = this.userId;//
- this.pageload();
- },
- Edit(row) {
- localStorage.setItem("mcrPageData", JSON.stringify({
- inputLXR: this.inputLXR,
- inputDW: this.inputDW,
- inputDQ: this.inputDQ,
- principalSel: this.principalSel,
- territorySel: this.territorySel,
- clientLvSel: this.clientLvSel,
- clientTypeSel: this.clientTypeSel,
- businessClassSel: this.businessClassSel,
- pageSize: this.pageSize,
- currentPage: this.currentPage,
- }));
- this.$router.push('/home/MCROper?id=' + row.id);
- },
- Del(row) {
- var that = this;
- var delData = {
- "portType": 1,
- "id": row.id,
- "deleteUserId": this.userId
- }
- console.log(delData);
- this.$axios.post('/api/MarketCustomerResources/NewClientDel', delData, {
- headers: {
- 'Authorization': that.token,
- }
- }).then(resp => {
- if (resp.data.code == 200) {
- that.$message({
- message: '删除成功!',
- type: 'success'
- });
- } else {
- that.$message.error(resp.data.msg);
- }
- that.pageload();
- });
- },
- Add(row) {
- localStorage.setItem("mcrPageData", JSON.stringify({
- inputLXR: this.inputLXR,
- inputDW: this.inputDW,
- inputDQ: this.inputDQ,
- principalSel: this.principalSel,
- territorySel: this.territorySel,
- clientLvSel: this.clientLvSel,
- clientTypeSel: this.clientTypeSel,
- businessClassSel: this.businessClassSel,
- pageSize: this.pageSize,
- currentPage: this.currentPage,
- }));
- this.$router.push('/home/MCROper?id=' + 0);
- }
- },
- mounted() {
- this.token = JSON.parse(localStorage.getItem('userinif')).token;
- this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
- var mcrPageData = localStorage.getItem("mcrPageData");
- if (mcrPageData) {
- try {
- console.log(mcrPageData);
- var json = JSON.parse(mcrPageData);
- this.inputLXR = json.inputLXR;
- this.inputDW = json.inputDW;
- this.inputDQ = json.inputDQ;
- this.principalSel = json.principalSel;
- this.territorySel = json.territorySel;
- this.clientLvSel = json.clientLvSel;
- this.clientTypeSel = json.clientTypeSel;
- this.businessClassSel = json.businessClassSel;
- this.pageSize = json.pageSize;
- this.currentPage = json.currentPage;
- localStorage.removeItem("mcrPageData");
- this.QueryData();
- } catch (e) {
- this.pageload();
- }
- return;
- }
- this.pageload();
- },
- created() {
- var mcrPageData = localStorage.getItem("mcrPageData");
- if (mcrPageData) {
- var json = JSON.parse(mcrPageData);
- this.currentPage = json.currentPage;
- }
- },
- computed: {
- preDele() {
- var number = 0;
- this.PageList.forEach(element => {
- number += element.preDele;
- });
- return number;
- },
- finlishedDele() {
- var number = 0;
- this.PageList.forEach(element => {
- number += element.finlishedDele;
- });
- return number;
- }
- }
- }
- </script>
- <style>
- body {
- margin: 0;
- padding: 0;
- }
- .mcr-box {
- background-color: #fff;
- padding: 10px;
- border-radius: 10px;
- }
- .mcr-table {
- margin-top: 10px;
- }
- .mcr-table .block {
- margin-top: 10px;
- }
- .mcr-table .el-table--enable-row-transition .el-table__body td.el-table__cell {
- text-align: center;
- }
- .mcr-table .el-table--border .el-table__cell:first-child .cell {
- text-align: center;
- }
- .mcr-input {
- display: flex;
- }
- .mcr-input .el-select {
- margin-right: 5px;
- }
- .btnOp {
- position: absolute;
- right: 6px;
- top: -50px;
- }
- </style>
|