MarketCustomerResourcesHome.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. <template>
  2. <div class="mcrh" v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
  3. <el-dialog width="960px" title="日志查询" :visible.sync="mcrhVisible" :close-on-click-modal="false">
  4. <el-form ref="form" :model="form" label-width="40px">
  5. <div class="mcrh-dialog">
  6. <el-form-item label="类型">
  7. <el-select @change="logchange" style="width:200px" multiple collapse-tags
  8. v-model="form.opTypeLabel" placeholder="请选择类型">
  9. <el-option v-for="(item, index) in logtypearr" :key="index" :label="item.text"
  10. :value="item.value"></el-option>
  11. </el-select>
  12. </el-form-item>
  13. <el-form-item label="人员">
  14. <el-select @change="logchange" style="width:200px" multiple collapse-tags
  15. v-model="form.opUserLabel" placeholder="请选择人员">
  16. <el-option v-for="(item, index) in personnelarr" :key="index" :label="item.text"
  17. :value="item.value"></el-option>
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item label="日期">
  21. <el-date-picker @change="logchange" style="width:350px" v-model="form.time" type="daterange"
  22. align="right" unlink-panels range-separator="至" start-placeholder="开始日期"
  23. end-placeholder="结束日期" :picker-options="pickerOptions">
  24. </el-date-picker>
  25. </el-form-item>
  26. </div>
  27. </el-form>
  28. <div>
  29. <el-table height="529px" :data="logtableData" border style="width: 100%">
  30. <el-table-column prop="rowIndex" label="序号" width="150">
  31. </el-table-column>
  32. <el-table-column prop="label" label="具体事件">
  33. </el-table-column>
  34. <el-table-column prop="createTime" label="操作时间" width="180">
  35. </el-table-column>
  36. </el-table>
  37. <div style="text-align: center;">
  38. <el-pagination @size-change="loghandleSizeChange" @current-change="loghandleCurrentChange"
  39. :current-page="logcurrentPage" :page-sizes="[10, 15, 20]" :page-size="logpagesize"
  40. layout="total, sizes, prev, pager, next, jumper" :total="logtotal">
  41. </el-pagination>
  42. </div>
  43. </div>
  44. </el-dialog>
  45. <div class="mcr-box">
  46. <div class="mcr-head">
  47. <!-- 预计出团量 -->
  48. <!-- <div style="display: flex;margin-bottom: 10px;">
  49. <div style="width:24%">
  50. 预计出团:<span>{{ preDele }}</span>
  51. </div>
  52. <div style="width:24%">
  53. 预计出团总量:<span>{{ groupNumber.preDeleAll }}</span>
  54. </div>
  55. <div style="width:24%">
  56. 已出团:<span>{{ finlishedDele }}</span>
  57. </div>
  58. <div style="width:24%">
  59. 已出团总量:<span>{{ groupNumber.finlishedDeleAll }}</span>
  60. </div>
  61. </div> -->
  62. <div>
  63. <el-select v-model="principalSel" :disabled='isSelect' clearable placeholder="负责人" style="width
  64. :18%" @change="QueryData">
  65. <el-option v-for="item in principalList" :key="item.id" :label="item.name" :value="item.id">
  66. </el-option>
  67. </el-select>
  68. <el-select v-model="territorySel" clearable placeholder="省域" style="width
  69. :18%" @change="(val) => { this.clientTypeSel = ''; this.clientLvSel = ''; QueryData(); }">
  70. <el-option v-for="item in territoryList" :key="item.id" :label="item.name" :value="item.id">
  71. </el-option>
  72. </el-select>
  73. <el-select v-model="clientLvSel" clearable placeholder="客户级别" style="width
  74. :18%" @change="(val) => { this.clientTypeSel = ''; QueryData(); }">
  75. <el-option v-for="item in clientLvList" :key="item.id" :label="item.name" :value="item.id">
  76. </el-option>
  77. </el-select>
  78. <el-select v-model="clientTypeSel" clearable placeholder="客户类别" style="width
  79. :18%" @change="QueryData">
  80. <el-option v-for="item in clientTypeList" :key="item.id" :label="item.name" :value="item.id">
  81. </el-option>
  82. </el-select>
  83. <el-select v-model="businessClassSel" clearable placeholder="业务分类" style="width
  84. :16%" @change="QueryData">
  85. <el-option v-for="item in businessClassList" :key="item.id" :label="item.name" :value="item.id">
  86. </el-option>
  87. </el-select>
  88. </div>
  89. <!-- textbox框 -->
  90. <div style="display: flex;margin-top: 10px;position: relative;">
  91. <div style="width: 28%;">
  92. <el-input v-model="inputLXR" placeholder="联系人"></el-input>
  93. </div>
  94. &nbsp;
  95. <div style="width: 26.5%;">
  96. <el-input v-model="inputDQ" placeholder="地区"></el-input>
  97. </div>
  98. &nbsp;
  99. <div style="width: 27%;">
  100. <!-- <el-input v-model="inputDW" placeholder="单位"></el-input> -->
  101. <el-select style="width: 100%;" clearable v-model="inputDW" filterable remote placeholder="单位"
  102. :remote-method="remoteMethod" :loading="selectLoading">
  103. <el-option v-for="item in options" :key="item.id" :label="item.client" :value="item.client">
  104. </el-option>
  105. </el-select>
  106. </div>
  107. &nbsp;
  108. <el-button v-if="userId == 21" type="primary"
  109. @click="NewClientDataAuthorityExcelDownload">按权限导出</el-button>
  110. &nbsp;
  111. <div class="btnOp">
  112. <div>
  113. <el-button type="primary" @click="QueryData">查 询</el-button>
  114. <el-button v-if="userId == 21" type="primary" @click="NewClientDataExcelDownload">导
  115. 出</el-button>
  116. </div>
  117. <div style="height: 10px;">
  118. </div>
  119. <div>
  120. <el-button type="primary" @click="Add">新 增</el-button>
  121. <el-button @click="logquery" v-if="userId == 21" type="primary">日 志</el-button>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <div class="mcr-table">
  127. <el-table :data="PageList" border @select="handleSelect" :cell-class-name="addClass"
  128. style="width: 100%">
  129. <el-table-column prop="weight" label="权重" width="50">
  130. <template slot-scope="scope">
  131. <span v-if="scope.row.weight == '393'">A</span>
  132. <span v-else-if="scope.row.weight == '392'">B</span>
  133. <span v-else-if="scope.row.weight == '391'">C</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column prop="client" label="单位" width="230">
  137. </el-table-column>
  138. <el-table-column prop="contact" label="联系人" width="90">
  139. <template slot-scope="scope">
  140. <span>{{ scope.row.contact == 0 ? '-' : scope.row.contact }}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column prop="job" label="职位" width="110">
  144. <template slot-scope="scope">
  145. <span>{{ scope.row.job == 0 ? '-' : scope.row.job }}</span>
  146. </template>
  147. </el-table-column>
  148. <el-table-column prop="telephone" label="手机号" width="120">
  149. <template slot-scope="scope">
  150. <span>{{ scope.row.telephone == 0 ? '-' : scope.row.telephone }}</span>
  151. </template>
  152. </el-table-column>
  153. <el-table-column prop="phone" label="座机号" width="120">
  154. <template slot-scope="scope">
  155. <span>{{ scope.row.phone == 0 ? '-' : scope.row.phone }}</span>
  156. </template>
  157. </el-table-column>
  158. <el-table-column prop="location" label="所在区域" width="130">
  159. </el-table-column>
  160. <!-- <el-table-column prop="birthday" label="生日">
  161. </el-table-column> -->
  162. <el-table-column prop="ascribedDepartment" label="业务归属" width="80">
  163. <template slot-scope="scope">
  164. <el-tooltip class="item" effect="dark" placement="top">
  165. <span style="text-decoration: underline;">查看</span>
  166. <div slot="content">
  167. <div v-for="(yw, index) in scope.row.ascribedDepartment" :key="index"
  168. style="text-align: center; width: 100px;padding: 5px;">
  169. {{ yw.name + '部' }}<br /><br />
  170. </div>
  171. {{ scope.row.notUpdateDays + '天未修改数据' }}
  172. </div>
  173. </el-tooltip>
  174. </template>
  175. </el-table-column>
  176. <el-table-column prop="ascribedUser" label="负责人" width="85">
  177. <template slot-scope="scope">
  178. <!-- <el-tooltip class="item" effect="dark" placement="top">
  179. <span style="color:royalblue">查看</span>
  180. <div slot="content">
  181. <div v-for="yw in scope.row.ascribedUser"
  182. style="text-align: center; width: 100px;padding: 5px;">
  183. {{ yw.cnName }}
  184. </div>
  185. </div>
  186. </el-tooltip> -->
  187. <div v-for="(yw, index) in scope.row.ascribedUser" :key="index" style="text-align: center;">
  188. {{ yw.cnName }}
  189. </div>
  190. </template>
  191. </el-table-column>
  192. <el-table-column prop="remark" label="备注">
  193. <template slot-scope="scope">
  194. <div id="remark">
  195. <el-tooltip v-show="scope.row.remark != ''" class="item" effect="dark"
  196. :content="scope.row.remark" placement="top">
  197. <span v-if="scope.row.remark.length > 10">{{ scope.row.remark.slice(0, 10) + "..."
  198. }}</span>
  199. <span v-else>{{ scope.row.remark }}</span>
  200. <div slot="content">
  201. <div style="width: 300px;">
  202. {{ scope.row.remark }}
  203. </div>
  204. </div>
  205. </el-tooltip>
  206. </div>
  207. </template>
  208. </el-table-column>
  209. <!-- <el-table-column prop="preDele" label="预计出团">
  210. </el-table-column>
  211. <el-table-column prop="finlishedDele" label="已出团">
  212. </el-table-column> -->
  213. <el-table-column label="操作" width="200">
  214. <template slot-scope="scope">
  215. <el-button type="primary" size="mini" @click="Edit(scope.row)">编
  216. 辑</el-button>
  217. <el-button type="danger" size="mini" @click="Del(scope.row)">删
  218. 除</el-button>
  219. </template>
  220. </el-table-column>
  221. </el-table>
  222. <div class="block">
  223. <el-pagination align='center' @size-change="handleSizeChange" @current-change="handleCurrentChange"
  224. :current-page.sync="currentPage" :page-sizes="[10, 20]" :page-size="pageSize"
  225. layout="total, sizes, prev, pager, next" :total="total">
  226. </el-pagination>
  227. </div>
  228. </div>
  229. </div>
  230. </div>
  231. </template>
  232. <script>
  233. export default {
  234. data() {
  235. return {
  236. pickerOptions: {
  237. shortcuts: [{
  238. text: '最近一周',
  239. onClick(picker) {
  240. const end = new Date();
  241. const start = new Date();
  242. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  243. picker.$emit('pick', [start, end]);
  244. }
  245. }, {
  246. text: '最近一个月',
  247. onClick(picker) {
  248. const end = new Date();
  249. const start = new Date();
  250. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  251. picker.$emit('pick', [start, end]);
  252. }
  253. }, {
  254. text: '最近三个月',
  255. onClick(picker) {
  256. const end = new Date();
  257. const start = new Date();
  258. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  259. picker.$emit('pick', [start, end]);
  260. }
  261. }]
  262. },
  263. total: 0, //总行数
  264. principalSel: '',
  265. principalList: [],//负责人数据
  266. territorySel: '',
  267. territoryList: [],//省域数据
  268. clientLvSel: '',
  269. clientLvList: [],//客户级别数据
  270. clientTypeSel: '',
  271. clientTypeList: [],//客户类别数据]
  272. businessClassSel: '',
  273. businessClassList: [],//业务分类
  274. PageList: [], //页面数据
  275. currentPage: 1, // 当前页码
  276. pageSize: 10,// 每页的数据条数
  277. loading: true,
  278. inputLXR: '', //联系人
  279. inputDQ: '', //地区
  280. inputDW: '', //单位
  281. pageloadData: {
  282. "portType": 1,
  283. "pageIndex": 1,
  284. "pageSize": 10,
  285. "contact": "",
  286. "location": "",
  287. "client": "",
  288. "userid": "",
  289. "lvlid": 0,
  290. "business": "",
  291. "Range": 0,
  292. "Category": 0,
  293. "operationUserId": 0
  294. },
  295. groupNumber: {
  296. preDeleAll: '',
  297. finlishedDeleAll: ''
  298. },
  299. userId: 0,
  300. token: '',
  301. isSelect: true,
  302. mcrhVisible: false,
  303. form: {
  304. opTypeLabel: '',
  305. opUserLabel: '',
  306. time: '',
  307. },
  308. logtypearr: [],
  309. personnelarr: [],
  310. logtableData: [],
  311. logcurrentPage: 1,
  312. logpagesize: 10,
  313. logtotal: 0,
  314. selectLoading: false,
  315. options: [],
  316. }
  317. },
  318. methods: {
  319. //处理日期
  320. datetime(val) {
  321. var date = new Date(val);
  322. var y = date.getFullYear();
  323. var m = date.getMonth() + 1 >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1).toString();
  324. var d = date.getDate() >= 10 ? date.getDate() : '0' + (date.getDate()).toString();
  325. return y + '-' + m + '-' + d
  326. },
  327. loghandleSizeChange(val) {
  328. this.logpagesize = val;
  329. this.logchange();
  330. },
  331. loghandleCurrentChange(val) {
  332. this.logcurrentPage = val;
  333. let opTypeLabels = '';
  334. let opUserLabels = '';
  335. for (let i = 0; i < this.form.opTypeLabel.length; i++) {
  336. opTypeLabels += this.form.opTypeLabel[i] + ','
  337. }
  338. opTypeLabels = opTypeLabels.substring(0, opTypeLabels.length - 1)
  339. for (let j = 0; j < this.form.opUserLabel.length; j++) {
  340. opUserLabels += this.form.opUserLabel[j] + ','
  341. }
  342. opUserLabels = opUserLabels.substring(0, opUserLabels.length - 1)
  343. this.NewClientDataRecord(opTypeLabels, opUserLabels, this.datetime(this.form.time[0]), this.datetime(this.form.time[1]))
  344. // this.logchange();
  345. },
  346. //每页条数改变时触发 选择一页显示多少行
  347. handleSizeChange(val) {
  348. this.currentPage = 1;
  349. this.pageSize = val;
  350. this.pageloadData.pageIndex = this.currentPage;
  351. this.pageloadData.pageSize = this.pageSize;
  352. this.pageload();
  353. },
  354. //当前页改变时触发 跳转其他页
  355. handleCurrentChange(val) {
  356. this.loading = true;
  357. this.pageloadData.pageIndex = val;
  358. this.pageloadData.pageSize = this.pageSize;
  359. this.pageload();
  360. },
  361. //logchange
  362. logchange() {
  363. this.logcurrentPage = 1;
  364. let opTypeLabels = '';
  365. let opUserLabels = '';
  366. for (let i = 0; i < this.form.opTypeLabel.length; i++) {
  367. opTypeLabels += this.form.opTypeLabel[i] + ','
  368. }
  369. opTypeLabels = opTypeLabels.substring(0, opTypeLabels.length - 1)
  370. for (let j = 0; j < this.form.opUserLabel.length; j++) {
  371. opUserLabels += this.form.opUserLabel[j] + ','
  372. }
  373. opUserLabels = opUserLabels.substring(0, opUserLabels.length - 1)
  374. this.NewClientDataRecord(opTypeLabels, opUserLabels, this.datetime(this.form.time[0]), this.datetime(this.form.time[1]))
  375. },
  376. //历史记录
  377. NewClientDataRecord(opTypeLabel, opUserLabel, beginTime, endTime) {
  378. var that = this;
  379. var url = "/api/MarketCustomerResources/NewClientDataRecord"
  380. this.$axios({
  381. method: 'post',
  382. url: url,
  383. data: {
  384. portType: 1,
  385. userId: that.userId,
  386. pageId: 89,
  387. pageIndex: that.logcurrentPage,
  388. pageSize: that.logpagesize,
  389. opTypeLabel: opTypeLabel,
  390. opUserLabel: opUserLabel,
  391. beginTime: beginTime,
  392. endTime: endTime,
  393. }
  394. }).then(function (res) {
  395. if (res.data.code == 200) {
  396. let datalog = res.data.data;
  397. that.logtableData = datalog;
  398. that.logtotal = res.data.count;
  399. } else {
  400. that.$message.error(res.data.msg);
  401. }
  402. })
  403. },
  404. //多选框选中方法
  405. handleSelect(selection, row) {
  406. },
  407. //日志基础数据
  408. NewClientDataRecordInit() {
  409. var that = this;
  410. var url = "/api/MarketCustomerResources/NewClientDataRecordInit"
  411. this.$axios({
  412. method: 'post',
  413. url: url,
  414. data: {
  415. portType: 1,
  416. userId: that.userId,
  417. pageId: 89,
  418. }
  419. }).then(function (res) {
  420. if (res.data.code == 200) {
  421. let datainfo = res.data.data;
  422. that.logtypearr = datainfo.operations;
  423. that.personnelarr = datainfo.userDatas;
  424. } else {
  425. that.$message.error(res.data.msg);
  426. }
  427. })
  428. },
  429. //日志查询
  430. logquery() {
  431. this.mcrhVisible = true;
  432. this.logtableData = [];
  433. this.form = {
  434. opTypeLabel: '',
  435. opUserLabel: '',
  436. time: '',
  437. };
  438. this.logchange();
  439. },
  440. //条件颜色
  441. addClass({ row, column, rowIndex, columnIndex }) {
  442. if (row.notUpdateDays >= 365) {
  443. return 'cell-grey';
  444. }
  445. },
  446. NewClientDataAuthorityExcelDownload() {
  447. var url = "/api/MarketCustomerResources/NewClientDataAuthorityExcelDownload"
  448. var that = this
  449. that.$axios({
  450. method: 'post',
  451. url: url,
  452. headers: {
  453. Authorization: 'Bearer '
  454. },
  455. data: {
  456. portType: 1,
  457. pageIndex: that.pageloadData.pageIndex,
  458. pageSize: that.pageloadData.pageIndex,
  459. operationUserId: that.userId,
  460. contact: that.pageloadData.contact,
  461. location: that.pageloadData.location,
  462. client: that.pageloadData.client,
  463. userid: that.pageloadData.userid,
  464. lvlid: that.pageloadData.lvlid,
  465. business: that.pageloadData.business,
  466. range: that.pageloadData.Range,
  467. category: that.pageloadData.Category,
  468. pageId: 89,
  469. }
  470. }).then(function (res) {
  471. if (res.data.code == 200) {
  472. that.$message({
  473. type: 'success',
  474. message: res.data.msg,
  475. });
  476. window.open(res.data.data)
  477. } else {
  478. that.$message({
  479. message: res.data.msg,
  480. type: 'warning'
  481. });
  482. }
  483. })
  484. },
  485. NewClientDataExcelDownload() {
  486. var url = "api/MarketCustomerResources/NewClientDataExcelDownload"
  487. var that = this
  488. that.$axios({
  489. method: 'post',
  490. url: url,
  491. headers: {
  492. Authorization: 'Bearer '
  493. },
  494. data: {
  495. portType: 1,
  496. pageIndex: that.pageloadData.pageIndex,
  497. pageSize: that.pageloadData.pageIndex,
  498. operationUserId: that.userId,
  499. contact: that.pageloadData.contact,
  500. location: that.pageloadData.location,
  501. client: that.pageloadData.client,
  502. userid: that.pageloadData.userid,
  503. lvlid: that.pageloadData.lvlid,
  504. business: that.pageloadData.business,
  505. range: that.pageloadData.Range,
  506. category: that.pageloadData.Category,
  507. pageId: 89,
  508. }
  509. }).then(function (res) {
  510. if (res.data.code == 200) {
  511. that.$message({
  512. type: 'success',
  513. message: res.data.msg,
  514. });
  515. window.open(res.data.data)
  516. } else {
  517. that.$message({
  518. message: res.data.msg,
  519. type: 'warning'
  520. });
  521. }
  522. })
  523. },
  524. pageload() {
  525. var that = this;
  526. this.$axios.post('/api/MarketCustomerResources/QueryUnlockDropList', {}, {
  527. headers: {
  528. 'Authorization': that.token,
  529. // 'Accept-Encoding': 'gzip'
  530. },
  531. }).then(resp => {
  532. if (resp.data.code == 200) {
  533. if (resp.data.data.includes(that.userId)) {
  534. that.isSelect = false;
  535. }
  536. }
  537. })
  538. that.pageloadData.operationUserId = that.userId;
  539. //初始化界面数据
  540. //console.log(that.pageloadData)
  541. this.$axios.post('/api/MarketCustomerResources/QueryNewClientData', that.pageloadData, {
  542. headers: {
  543. 'Authorization': that.token,
  544. },
  545. }).then(resp => {
  546. if (resp.data.code == 200) {
  547. if (resp.data.data == null) {
  548. that.PageList = [];
  549. that.total = 0;
  550. this.$message.error(resp.data.msg);
  551. } else {
  552. that.principalList = resp.data.data.users; //负责人
  553. that.clientLvList = resp.data.data.level;//客户级别
  554. that.clientTypeList = resp.data.data.customerClass;//客户类别
  555. that.territoryList = resp.data.data.province; //省域数据
  556. that.businessClassList = resp.data.data.serviceClass; //业务归属
  557. that.PageList = resp.data.data.clientTableData.pageSource; //table数据
  558. that.total = resp.data.data.clientTableData.pageCount; //总数
  559. that.groupNumber = resp.data.data.groupNumber; //团组出团总数
  560. console.log(that.pageloadData.pageIndex, parseInt(that.pageloadData.pageIndex), 'that.pageloadData.pageIndex')
  561. that.currentPage = parseInt(that.pageloadData.pageIndex);
  562. }
  563. this.loading = false;
  564. that.territoryChange();
  565. } else if (resp.data.code == 400) {
  566. that.PageList = [];
  567. that.total = 0;
  568. that.$message.error('暂无数据!');
  569. }
  570. }).catch(err => {
  571. this.$message.error('网络异常!');
  572. }).finally(() => {
  573. this.loading = false;
  574. console.log('finally');
  575. })
  576. },
  577. //保存权限
  578. saveData() {
  579. var that = this;
  580. },
  581. QueryData() {
  582. this.loading = true;
  583. this.pageloadData.pageIndex = this.currentPage;
  584. this.pageloadData.pageSize = this.pageSize;
  585. this.pageloadData.location = this.inputDQ; //地区
  586. this.pageloadData.client = this.inputDW; //单位
  587. this.pageloadData.contact = this.inputLXR; //联系人
  588. this.pageloadData.userid = this.principalSel.toString(); //负责人
  589. this.pageloadData.Range = this.territorySel == '' ? 0 : this.territorySel;//省域
  590. this.pageloadData.lvlid = this.clientLvSel == '' ? 0 : this.clientLvSel; //客户级别
  591. this.pageloadData.Category = this.clientTypeSel == '' ? 0 : this.clientTypeSel;//客户类别
  592. this.pageloadData.business = this.businessClassSel.toString();//业务分类
  593. this.pageloadData.operationUserId = this.userId;//
  594. this.pageload();
  595. },
  596. Edit(row) {
  597. localStorage.setItem("mcrPageData", JSON.stringify({
  598. inputLXR: this.inputLXR,
  599. inputDW: this.inputDW,
  600. inputDQ: this.inputDQ,
  601. principalSel: this.principalSel,
  602. territorySel: this.territorySel,
  603. clientLvSel: this.clientLvSel,
  604. clientTypeSel: this.clientTypeSel,
  605. businessClassSel: this.businessClassSel,
  606. pageSize: this.pageSize,
  607. currentPage: this.currentPage,
  608. }));
  609. this.$router.push('/home/MCROper?id=' + row.id);
  610. },
  611. Del(row) {
  612. var that = this;
  613. var delData = {
  614. "portType": 1,
  615. "id": row.id,
  616. "deleteUserId": this.userId
  617. }
  618. console.log(delData);
  619. this.$axios.post('/api/MarketCustomerResources/NewClientDel', delData, {
  620. headers: {
  621. 'Authorization': that.token,
  622. }
  623. }).then(resp => {
  624. if (resp.data.code == 200) {
  625. that.$message({
  626. message: '删除成功!',
  627. type: 'success'
  628. });
  629. } else {
  630. that.$message.error(resp.data.msg);
  631. }
  632. that.pageload();
  633. });
  634. },
  635. Add(row) {
  636. localStorage.setItem("mcrPageData", JSON.stringify({
  637. inputLXR: this.inputLXR,
  638. inputDW: this.inputDW,
  639. inputDQ: this.inputDQ,
  640. principalSel: this.principalSel,
  641. territorySel: this.territorySel,
  642. clientLvSel: this.clientLvSel,
  643. clientTypeSel: this.clientTypeSel,
  644. businessClassSel: this.businessClassSel,
  645. pageSize: this.pageSize,
  646. currentPage: this.currentPage,
  647. }));
  648. this.$router.push('/home/MCROper?id=' + 0);
  649. },
  650. territoryChange() {
  651. var sid = this.territorySel;
  652. if (!sid) {
  653. sid = 0;
  654. }
  655. this.$axios.post('/api/MarketCustomerResources/QueryClientType', {
  656. SetDataIdArr: [sid]
  657. }, {
  658. headers: {
  659. 'Authorization': this.token,
  660. },
  661. }).then(resp => {
  662. if (resp.data.code == 200) {
  663. this.clientTypeList = resp.data.data.typeArr; //客户类别
  664. this.clientLvList = resp.data.data.lvArr; //客户级别
  665. console.log(this.clientLvSel, "clientLvSel---------------");
  666. if (this.clientLvSel) {
  667. this.territoryChangeSecond();
  668. }
  669. } else {
  670. //js抛异常
  671. throw new Error(resp.data.msg);
  672. }
  673. }).catch(err => {
  674. this.$message.error('网络异常!');
  675. })
  676. },
  677. territoryChangeSecond() {
  678. var sid = this.clientLvSel;
  679. if (!sid) {
  680. sid = 0;
  681. }
  682. this.$axios.post('/api/MarketCustomerResources/QueryClientTypeSecond', {
  683. SetDataIdArr: [sid]
  684. }, {
  685. headers: {
  686. 'Authorization': this.token,
  687. },
  688. }).then(resp => {
  689. if (resp.data.code == 200) {
  690. this.clientTypeList = resp.data.data; //客户类别
  691. } else {
  692. //js抛异常
  693. throw new Error(resp.data.msg);
  694. }
  695. }).catch(err => {
  696. this.$message.error('网络异常!');
  697. })
  698. },
  699. remoteMethod(query) {
  700. if (query !== '') {
  701. this.selectLoading = true;
  702. this.$axios.post('/api/MarketCustomerResources/SearchClientByKeyword', {
  703. Keyword: query,
  704. UserId: this.userId
  705. }, {
  706. headers: {
  707. 'Authorization': this.token,
  708. },
  709. }).then(resp => {
  710. if (resp.data.code == 200) {
  711. this.options = resp.data.data;
  712. } else if (resp.data.code == 201) {
  713. this.options = [];
  714. } else {
  715. //js抛异常
  716. throw new Error(resp.data.msg);
  717. }
  718. }).catch(err => {
  719. this.$message.error('网络异常!');
  720. }).finally(() => {
  721. console.log('finally');
  722. this.selectLoading = false;
  723. })
  724. } else {
  725. this.options = [];
  726. }
  727. }
  728. },
  729. mounted() {
  730. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  731. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
  732. this.NewClientDataRecordInit();
  733. var mcrPageData = localStorage.getItem("mcrPageData");
  734. if (mcrPageData) {
  735. try {
  736. console.log(mcrPageData);
  737. var json = JSON.parse(mcrPageData);
  738. this.inputLXR = json.inputLXR;
  739. this.inputDW = json.inputDW;
  740. this.inputDQ = json.inputDQ;
  741. this.principalSel = json.principalSel;
  742. this.territorySel = json.territorySel;
  743. this.clientLvSel = json.clientLvSel;
  744. this.clientTypeSel = json.clientTypeSel;
  745. this.businessClassSel = json.businessClassSel;
  746. this.pageSize = json.pageSize;
  747. this.currentPage = json.currentPage;
  748. localStorage.removeItem("mcrPageData");
  749. this.QueryData();
  750. } catch (e) {
  751. this.pageload();
  752. }
  753. return;
  754. }
  755. this.pageload();
  756. },
  757. created() {
  758. var mcrPageData = localStorage.getItem("mcrPageData");
  759. if (mcrPageData) {
  760. var json = JSON.parse(mcrPageData);
  761. this.currentPage = json.currentPage;
  762. }
  763. },
  764. computed: {
  765. preDele() {
  766. var number = 0;
  767. this.PageList.forEach(element => {
  768. number += element.preDele;
  769. });
  770. return number;
  771. },
  772. finlishedDele() {
  773. var number = 0;
  774. this.PageList.forEach(element => {
  775. number += element.finlishedDele;
  776. });
  777. return number;
  778. }
  779. }
  780. }
  781. </script>
  782. <style>
  783. body {
  784. margin: 0;
  785. padding: 0;
  786. }
  787. .mcr-box {
  788. background-color: #fff;
  789. padding: 10px;
  790. border-radius: 10px;
  791. }
  792. .mcr-table {
  793. margin-top: 10px;
  794. }
  795. .mcr-table .block {
  796. margin-top: 10px;
  797. }
  798. .mcr-table .el-table--enable-row-transition .el-table__body td.el-table__cell {
  799. text-align: center;
  800. }
  801. .mcr-table .el-table--border .el-table__cell:first-child .cell {
  802. text-align: center;
  803. }
  804. .mcr-input {
  805. display: flex;
  806. }
  807. .mcr-input .el-select {
  808. margin-right: 5px;
  809. }
  810. .btnOp {
  811. position: absolute;
  812. right: 6px;
  813. top: -50px;
  814. }
  815. .mcrh .cell-grey {
  816. color: red;
  817. }
  818. .mcrh-dialog {
  819. display: flex;
  820. justify-content: space-between;
  821. }
  822. </style>