reportingRate.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. <template>
  2. <div>
  3. <div class="navBarTOP">
  4. <van-nav-bar
  5. class="navBar"
  6. left-arrow
  7. title="下属汇报率审批率统计"
  8. @click-left="onClickLeft" />
  9. </div>
  10. <!-- 主体内容-->
  11. <div class="lineGrey"></div>
  12. <div class="lineGrey"></div>
  13. <div class="lineGrey"></div>
  14. <div class="lineGrey"></div>
  15. <div class="lineGrey"></div>
  16. <div class="container contentpd16 containers">
  17. <van-row gutter="20">
  18. <van-col span="12">
  19. <van-cell
  20. :disabled="powerGrade < 5"
  21. :title="companyName"
  22. arrow-direction="down"
  23. is-link
  24. @click="regionClick" />
  25. </van-col>
  26. <van-col span="12">
  27. <van-cell :title="regionName" arrow-direction="down" is-link @click="SalesRegionClick" />
  28. </van-col>
  29. <van-col span="12">
  30. <van-cell :title="seacherForm.startTime" is-link @click="StartTimeClick">
  31. <template #right-icon>
  32. <van-icon :name="timeico" class="search-icon" />
  33. </template>
  34. </van-cell>
  35. </van-col>
  36. <van-col span="12">
  37. <van-cell :title="seacherForm.endTime" is-link @click="EndTimeClick">
  38. <template #right-icon>
  39. <van-icon :name="timeico" class="search-icon" />
  40. </template>
  41. </van-cell>
  42. </van-col>
  43. </van-row>
  44. </div>
  45. <el-table
  46. :data="tableList"
  47. :load="load"
  48. :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
  49. border
  50. class="elTreeTable"
  51. lazy
  52. row-key="id">
  53. <el-table-column class="firstName" label="组织名称/业务员(单位%)" prop="deptName" width="120">
  54. <template slot-scope="scope">
  55. <span v-if="scope.row.reportType == 1">{{ scope.row.userName }}</span>
  56. <span v-if="scope.row.reportType != 1">{{ scope.row.deptName }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="半月报" width="46">
  60. <el-table-column label="提交率%" prop="name" width="46">
  61. <template slot-scope="scope">
  62. <span v-if="scope.row.reportType != 3" class="spanNum"
  63. >{{ scope.row.doubleWeekCommitRate }}
  64. </span>
  65. <div v-if="scope.row.reportType == 3 && scope.row.doubleWeekCommitRate != null">
  66. <span
  67. v-if="scope.row.doubleWeekCommitRate != '-'"
  68. class="linkSpan"
  69. @click="linKReportHistory(scope.row, 3)"
  70. >{{ scope.row.doubleWeekCommitRate }}</span
  71. >
  72. <span
  73. v-if="scope.row.doubleWeekCommitRate == '-'"
  74. style="text-align: center; display: block"
  75. >{{ scope.row.doubleWeekCommitRate }}</span
  76. >
  77. </div>
  78. </template>
  79. </el-table-column>
  80. </el-table-column>
  81. <el-table-column label="周报" width="46">
  82. <el-table-column label="提交率%" prop="address" width="46">
  83. <template slot-scope="scope">
  84. <span v-if="scope.row.reportType != 2" class="spanNum"
  85. >{{ scope.row.weekCommitRate }}
  86. </span>
  87. <div v-if="scope.row.reportType == 2 && scope.row.weekCommitRate != null">
  88. <span
  89. v-if="scope.row.weekCommitRate != '-'"
  90. class="linkSpan"
  91. @click="linKReportHistory(scope.row, 2)"
  92. >{{ scope.row.weekCommitRate }}</span
  93. >
  94. <span
  95. v-if="scope.row.weekCommitRate == '-'"
  96. style="text-align: right; display: block"
  97. >{{ scope.row.weekCommitRate }}</span
  98. >
  99. </div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="审批率%" prop="weekApprovalRate" width="46">
  103. <template slot-scope="scope">
  104. <span v-if="scope.row.reportType != 2" class="spanNum"
  105. >{{ scope.row.weekApprovalRate }}
  106. </span>
  107. <div v-if="scope.row.reportType == 2 && scope.row.weekApprovalRate !== null">
  108. <span
  109. v-if="scope.row.weekApprovalRate != '-'"
  110. class="linkSpan"
  111. @click="linKReportHistory(scope.row, 2)"
  112. >{{ scope.row.weekApprovalRate }}</span
  113. >
  114. <span
  115. v-if="scope.row.weekApprovalRate == '-'"
  116. style="text-align: right; display: block"
  117. >{{ scope.row.weekApprovalRate }}</span
  118. >
  119. </div>
  120. </template>
  121. </el-table-column>
  122. </el-table-column>
  123. <el-table-column label="日报" width="46">
  124. <el-table-column label="提交率%" prop="address" width="46">
  125. <template slot-scope="scope">
  126. <span v-if="scope.row.reportType != 1" class="spanNum"
  127. >{{ scope.row.dayCommitRate }}
  128. </span>
  129. <div v-if="scope.row.reportType == 1 && scope.row.dayCommitRate != null">
  130. <span
  131. v-if="scope.row.dayCommitRate != '-'"
  132. class="linkSpan"
  133. @click="linKReportHistory(scope.row, 1)"
  134. >{{ scope.row.dayCommitRate }}</span
  135. >
  136. <span
  137. v-if="scope.row.dayCommitRate == '-'"
  138. style="text-align: right; display: block"
  139. >{{ scope.row.dayCommitRate }}</span
  140. >
  141. </div>
  142. </template>
  143. </el-table-column>
  144. <el-table-column label="审批率%" prop="address" width="46">
  145. <template slot-scope="scope">
  146. <span v-if="scope.row.reportType != 1" class="spanNum"
  147. >{{ scope.row.dayApprovalRate }}
  148. </span>
  149. <div v-if="scope.row.reportType == 1 && scope.row.dayApprovalRate != null">
  150. <span
  151. v-if="scope.row.dayApprovalRate != '-'"
  152. class="linkSpan"
  153. @click="linKReportHistory(scope.row, 1)"
  154. >{{ scope.row.dayApprovalRate }}</span
  155. >
  156. <span
  157. v-if="scope.row.dayApprovalRate == '-'"
  158. style="text-align: right; display: block"
  159. >{{ scope.row.dayApprovalRate }}</span
  160. >
  161. </div>
  162. </template>
  163. </el-table-column>
  164. </el-table-column>
  165. </el-table>
  166. <van-popup v-model="RegionShow" capture position="bottom">
  167. <van-picker
  168. :columns="companyList"
  169. show-toolbar
  170. value-key="deptName"
  171. @cancel="RegionShow = false"
  172. @confirm="onregionConfirm" />
  173. </van-popup>
  174. <van-popup v-model="SalesRegionShow" capture position="bottom">
  175. <van-picker
  176. :columns="regionList"
  177. show-toolbar
  178. value-key="deptName"
  179. @cancel="SalesRegionShow = false"
  180. @confirm="onSalesRegionConfirm" />
  181. </van-popup>
  182. <van-popup v-model="SalesDepartmentShow" capture position="bottom">
  183. <van-picker
  184. :columns="deptList"
  185. show-toolbar
  186. value-key="deptName"
  187. @cancel="SalesDepartmentShow = false"
  188. @confirm="onSalesDepartmentConfirm" />
  189. </van-popup>
  190. <van-popup v-model="StaffShow" capture position="bottom">
  191. <van-picker
  192. :columns="userList"
  193. show-toolbar
  194. value-key="nickName"
  195. @cancel="StaffShow = false"
  196. @confirm="onStaffConfirm" />
  197. </van-popup>
  198. <van-popup v-model="StartTimeShow" capture position="bottom">
  199. <van-datetime-picker
  200. v-model="strtcurrentDate"
  201. :max-date="strtmaxDate"
  202. :min-date="strtminDate"
  203. title="选择查找开始时间"
  204. type="date"
  205. @cancel="StartTimeShow = false"
  206. @confirm="onStartTimeConfirm" />
  207. </van-popup>
  208. <van-popup v-model="EndTimeShow" capture position="bottom">
  209. <van-datetime-picker
  210. v-model="endcurrentDate"
  211. :max-date="endmaxDate"
  212. :min-date="endminDate"
  213. title="选择查找结束时间"
  214. type="date"
  215. @cancel="EndTimeShow = false"
  216. @confirm="onEndTimeConfirm" />
  217. </van-popup>
  218. </div>
  219. </template>
  220. <script>
  221. import request from '@/utils/request';
  222. import { queryRates, getDeptInfo } from '@/api/index';
  223. import timeico from '@/assets/Icon/datatims.png';
  224. export default {
  225. data() {
  226. return {
  227. timeico: timeico,
  228. RegionShow: false,
  229. SalesRegionShow: false,
  230. SalesDepartmentShow: false,
  231. StaffShow: false,
  232. StartTimeShow: false,
  233. EndTimeShow: false,
  234. PhotoTypeList: [{ text: '009', value: '09' }],
  235. strtminDate: new Date(2022, 0, 1),
  236. endminDate: new Date(2022, 0, 1),
  237. strtmaxDate: new Date(),
  238. endmaxDate: new Date(),
  239. strtcurrentDate: new Date(),
  240. endcurrentDate: new Date(),
  241. companyName: '全部',
  242. deptName: '全部',
  243. regionName: '全部',
  244. userName: '全部',
  245. companyCode: '',
  246. deptCode: '',
  247. regionCode: '',
  248. userCode: '',
  249. companyList: [],
  250. deptList: [],
  251. regionList: [],
  252. userList: [],
  253. deptForm: {
  254. type: '',
  255. parentId: '',
  256. },
  257. list: [],
  258. tableList: [],
  259. seacherFormload: {
  260. companyId: '',
  261. regionId: '',
  262. parentId: '',
  263. startTime: '',
  264. endTime: '',
  265. },
  266. seacherForm: {
  267. companyId: '',
  268. regionId: '',
  269. parentId: '',
  270. startTime: '',
  271. endTime: '',
  272. },
  273. };
  274. },
  275. created() {
  276. this.seacherForm.startTime = this.parseTime(new Date(), '{y}-{m}-{d}');
  277. this.seacherFormload.startTime = this.parseTime(new Date(), '{y}-{m}-{d}');
  278. this.strtcurrentDate = new Date(this.parseTime(new Date(), '{y}-{m}-{d}'));
  279. this.seacherForm.endTime = this.parseTime(new Date(), '{y}-{m}-{d}') + '';
  280. this.seacherFormload.endTime = this.parseTime(new Date(), '{y}-{m}-{d}') + '';
  281. this.endminDate = new Date(this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'), 2));
  282. this.powerGrade = localStorage.getItem('powerGrade');
  283. this.getDeptInfo('dept');
  284. if (this.powerGrade > 3) {
  285. setTimeout(() => {
  286. this.getDeptInfo('dept', 1);
  287. }, 1000);
  288. }
  289. },
  290. watch: {
  291. $route(to, from) {
  292. if (to.path == '/reportingRate' && from.path == '/My/index') {
  293. this.seacherForm.startTime = this.parseTime(new Date(), '{y}-{m}-{d}');
  294. this.seacherFormload.startTime = this.parseTime(new Date(), '{y}-{m}-{d}');
  295. this.strtcurrentDate = new Date(this.parseTime(new Date(), '{y}-{m}-{d}'));
  296. this.seacherForm.endTime = this.parseTime(new Date(), '{y}-{m}-{d}') + '';
  297. this.seacherFormload.endTime = this.parseTime(new Date(), '{y}-{m}-{d}') + '';
  298. this.endminDate = new Date(
  299. this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'), 2)
  300. );
  301. this.deptCode = '';
  302. this.userCode = '';
  303. this.regionCode = '';
  304. this.seacherForm.parentId = '';
  305. this.seacherFormload.parentId = '';
  306. this.regionName = '全部';
  307. this.powerGrade = localStorage.getItem('powerGrade');
  308. this.getDeptInfo('dept');
  309. if (this.powerGrade > 3) {
  310. setTimeout(() => {
  311. this.getDeptInfo('dept', 1);
  312. }, 1000);
  313. }
  314. }
  315. },
  316. },
  317. methods: {
  318. GetPreMonthDay(date, monthNum, type) {
  319. var dateArr = date.split('-');
  320. var year = dateArr[0]; //获取当前日期的年份
  321. var month = dateArr[1]; //获取当前日期的月份
  322. var day = dateArr[2]; //获取当前日期的日
  323. var days = new Date(year, month, 0);
  324. days = days.getDate(); //获取当前日期中月的天数
  325. var year2 = year;
  326. var month2 = parseInt(month) - monthNum;
  327. if (month2 <= 0) {
  328. var absM = Math.abs(month2);
  329. year2 = parseInt(year2) - Math.ceil(absM / 12 == 0 ? 1 : parseInt(absM) / 12);
  330. month2 = 12 - (absM % 12);
  331. }
  332. var day2 = day;
  333. var days2 = new Date(year2, month2, 0);
  334. days2 = days2.getDate();
  335. if (day2 > days2) {
  336. day2 = days2;
  337. }
  338. if (month2 < 10) {
  339. month2 = '0' + month2;
  340. }
  341. var t2 = '';
  342. if (monthNum > 0) {
  343. t2 = year2 + '-' + month2 + '-01';
  344. } else {
  345. if (type == 'end') {
  346. var Months = new Date().getMonth() + 1;
  347. var days111 = new Date().getDate();
  348. if (Months < 10) {
  349. Months = '0' + Months;
  350. }
  351. if (days111 < 10) {
  352. days111 = '0' + days111;
  353. }
  354. if (parseInt(month2) >= new Date().getMonth() + 1) {
  355. t2 = year2 + '-' + Months + '-' + days111;
  356. } else {
  357. var daysd = this.getMonthDays(year2, month2);
  358. t2 = year2 + '-' + month2 + '-' + daysd;
  359. }
  360. } else {
  361. t2 = year2 + '-' + month2 + '-' + day2;
  362. }
  363. }
  364. return t2;
  365. },
  366. getMonthDays(year, month) {
  367. var stratDate = new Date(year, month - 1, 1),
  368. endData = new Date(year, month, 1);
  369. var days = (endData - stratDate) / (1000 * 60 * 60 * 24);
  370. return days;
  371. },
  372. getDeptInfo(type, grade) {
  373. this.deptForm.type = type;
  374. if (type == 'dept') {
  375. if (grade == '1') {
  376. this.deptForm.parentId = this.companyCode;
  377. } else if (grade == '2') {
  378. this.deptForm.parentId = this.regionCode;
  379. } else {
  380. this.deptForm.type = '';
  381. this.deptForm.parentId = '';
  382. }
  383. } else if (type == 'user') {
  384. this.deptForm.parentId = this.deptCode;
  385. }
  386. getDeptInfo(this.deptForm).then((res) => {
  387. if (type == 'dept') {
  388. if (grade == '1') {
  389. if (res.data.region != null) {
  390. this.regionList = [{ deptName: '全部', deptId: '' }].concat(res.data.region);
  391. }
  392. } else if (grade == '2') {
  393. if (res.data.dept != null) {
  394. this.deptList = [{ deptName: '全部', deptId: '' }].concat(res.data.dept);
  395. }
  396. } else {
  397. this.companyList = res.data.company;
  398. this.companyName = res.data.company[0].deptName;
  399. this.companyCode = res.data.company[0].deptId;
  400. if (res.data.region != null) {
  401. this.regionName = res.data.region[0].deptName;
  402. this.regionCode = res.data.region[0].deptId;
  403. this.regionList = res.data.region;
  404. }
  405. if (res.data.user != null) {
  406. this.userList = res.data.user;
  407. this.userCode = '';
  408. }
  409. this.queryRates();
  410. }
  411. } else if (type == 'user') {
  412. if (res.data.user != null) {
  413. this.userList = [{ nickName: '全部', userId: '' }].concat(res.data.user);
  414. }
  415. }
  416. });
  417. },
  418. dailyFn() {
  419. this.$router.push('/dailyDetails');
  420. },
  421. onClickLeft() {
  422. this.$router.go(-1);
  423. },
  424. regionClick() {
  425. this.RegionShow = true;
  426. },
  427. SalesRegionClick(val) {
  428. this.SalesRegionShow = true;
  429. },
  430. SalesDepartmentClick() {
  431. this.SalesDepartmentShow = true;
  432. },
  433. StaffClick() {
  434. this.StaffShow = true;
  435. },
  436. StartTimeClick() {
  437. this.StartTimeShow = true;
  438. },
  439. EndTimeClick() {
  440. this.EndTimeShow = true;
  441. },
  442. onregionConfirm(val) {
  443. this.tableList = [];
  444. this.RegionShow = false;
  445. this.companyName = val.deptName;
  446. this.companyCode = val.deptId;
  447. this.regionName = '全部';
  448. this.regionCode = '';
  449. this.deptName = '全部';
  450. this.deptCode = '';
  451. this.userName = '全部';
  452. this.userCode = '';
  453. this.seacherForm.parentId = '';
  454. this.seacherFormload.parentId = '';
  455. this.getDeptInfo('dept', 1);
  456. this.queryRates();
  457. },
  458. onSalesRegionConfirm(val) {
  459. this.tableList = [];
  460. this.SalesRegionShow = false;
  461. this.regionName = val.deptName;
  462. this.seacherForm.parentId = '';
  463. this.seacherFormload.parentId = '';
  464. if (val.deptId != '') {
  465. this.regionCode = val.deptId;
  466. this.getDeptInfo('dept', 2);
  467. this.deptName = '全部';
  468. this.deptCode = '';
  469. } else {
  470. this.regionCode = '';
  471. this.deptName = '全部';
  472. this.deptCode = '';
  473. this.userName = '全部';
  474. this.userCode = '';
  475. }
  476. this.queryRates();
  477. },
  478. onSalesDepartmentConfirm(val) {
  479. this.tableList = [];
  480. this.SalesDepartmentShow = false;
  481. this.deptName = val.deptName;
  482. if (val.deptId != '') {
  483. this.deptCode = val.deptId;
  484. this.getDeptInfo('user');
  485. } else {
  486. this.userName = '全部';
  487. this.userCode = '';
  488. }
  489. },
  490. onStaffConfirm(val) {
  491. this.StaffShow = false;
  492. this.userName = val.nickName;
  493. this.userCode = val.userId;
  494. },
  495. onStartTimeConfirm(val) {
  496. this.seacherForm.startTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
  497. this.seacherForm.parentId = '';
  498. this.seacherFormload.startTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
  499. this.seacherFormload.parentId = '';
  500. this.tableList = [];
  501. this.StartTimeShow = false;
  502. if (
  503. new Date(val).getTime() <
  504. new Date(this.GetPreMonthDay(this.seacherForm.startTime, -2, 'end')).getTime()
  505. ) {
  506. this.endminDate = new Date(this.GetPreMonthDay(this.seacherForm.startTime, -2, 'end'));
  507. this.endmaxDate = new Date(this.GetPreMonthDay(this.seacherForm.startTime, -2, 'end'));
  508. } else {
  509. this.endminDate = new Date(val);
  510. this.endmaxDate = new Date(this.GetPreMonthDay(this.seacherForm.startTime, -2, 'end'));
  511. }
  512. if (
  513. new Date(this.seacherForm.startTime).getTime() >
  514. new Date(this.seacherForm.endTime).getTime() ||
  515. new Date(this.endmaxDate).getTime() < new Date(this.seacherForm.endTime).getTime()
  516. ) {
  517. // this.seacherForm.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
  518. this.seacherFormload.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
  519. this.endcurrentDate = this.GetPreMonthDay(this.seacherForm.startTime, -2);
  520. }
  521. this.queryRates();
  522. },
  523. onEndTimeConfirm(val) {
  524. this.tableList = [];
  525. this.seacherForm.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}');
  526. this.seacherForm.parentId = '';
  527. this.seacherFormload.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}');
  528. this.seacherFormload.parentId = '';
  529. this.strtmaxDate = new Date(val);
  530. if (
  531. new Date(this.seacherForm.startTime).getTime() >
  532. new Date(this.seacherForm.endTime).getTime()
  533. ) {
  534. this.seacherForm.startTime = this.seacherForm.endTime;
  535. this.seacherFormload.startTime = this.seacherForm.endTime;
  536. }
  537. this.queryRates();
  538. this.EndTimeShow = false;
  539. },
  540. queryRates() {
  541. this.toastLoading(0, '加载中...', true);
  542. this.seacherForm.companyId = this.companyCode;
  543. this.seacherFormload.companyId = this.companyCode;
  544. this.seacherForm.regionId = this.regionCode;
  545. this.seacherFormload.regionId = this.regionCode;
  546. queryRates(this.seacherForm).then((res) => {
  547. if (res.code == 200) {
  548. for (var i = 0; i < res.data.length; i++) {
  549. if (res.data[i].reportType > 1) {
  550. res.data[i].hasChildren = true;
  551. }
  552. }
  553. this.tableList = res.data;
  554. } else {
  555. this.$toast.fail('数据获取失败');
  556. }
  557. this.toastLoading().clear();
  558. });
  559. },
  560. linKReportHistory(row, type) {
  561. if (type == 1) {
  562. var userId = '';
  563. var userName = '全部';
  564. if (row.userId == 'null') {
  565. userId = '';
  566. userName = '全部';
  567. } else {
  568. userId = row.userId;
  569. userName = row.userName;
  570. }
  571. this.$router.push({
  572. path: '/subordinateHistoricalDaily',
  573. query: {
  574. companyCode: this.companyCode,
  575. companyName: this.companyName,
  576. regionCode: row.regionId,
  577. regionName: row.regionName,
  578. deptCode: row.deptId,
  579. deptName: row.deptName + '销售部',
  580. userCode: userId,
  581. userName: userName,
  582. startTime: this.seacherForm.startTime,
  583. endTime: this.seacherForm.endTime,
  584. },
  585. });
  586. } else if (type == 2) {
  587. this.$router.push({
  588. path: '/subordinateHistoricalWeekly',
  589. query: {
  590. companyCode: this.companyCode,
  591. companyName: this.companyName,
  592. regionCode: row.regionId,
  593. regionName: row.regionName,
  594. deptCode: row.deptId,
  595. deptName: row.deptName + '销售部',
  596. startTime: this.seacherForm.startTime,
  597. endTime: this.seacherForm.endTime,
  598. },
  599. });
  600. } else {
  601. this.$router.push({
  602. path: '/doubleWeeklyHistorical',
  603. query: {
  604. companyCode: this.companyCode,
  605. companyName: this.companyName,
  606. regionCode: row.deptId,
  607. regionName: row.deptName + '销售大区',
  608. startTime: this.seacherForm.startTime,
  609. endTime: this.seacherForm.endTime,
  610. },
  611. });
  612. }
  613. },
  614. load(tree, treeNode, resolve) {
  615. this.toastLoading(0, '加载中...', true);
  616. if (tree.reportType == 2) {
  617. this.seacherFormload.parentId = tree.deptId;
  618. } else if (tree.reportType == 3) {
  619. // this.regionCode=tree.deptId
  620. // this.regionName=tree.deptName+"销售大区"
  621. this.seacherFormload.parentId = '';
  622. this.seacherFormload.regionId = tree.deptId;
  623. } else {
  624. this.seacherFormload.parentId = '';
  625. }
  626. request({
  627. url: 'mobile/reportMobile/queryRates',
  628. method: 'get',
  629. params: this.seacherFormload,
  630. }).then((res) => {
  631. if (res.code == 200) {
  632. for (var i = 0; i < res.data.length; i++) {
  633. if (res.data[i].reportType > 1) {
  634. res.data[i].hasChildren = true;
  635. } else {
  636. res.data[i].hasChildren = false;
  637. }
  638. }
  639. resolve(res.data);
  640. } else {
  641. this.$toast.fail('数据获取失败');
  642. }
  643. this.toastLoading().clear();
  644. });
  645. },
  646. },
  647. };
  648. </script>
  649. <style>
  650. body {
  651. margin: 0;
  652. }
  653. .elTreeTable table {
  654. width: 100% !important;
  655. }
  656. .elTreeTable .el-table__cell:first-child .cell {
  657. padding-left: 2px !important;
  658. }
  659. .elTreeTable .el-table__cell {
  660. padding: 0px;
  661. }
  662. .elTreeTable .el-table__body td.el-table__cell {
  663. padding: 2px;
  664. }
  665. .elTreeTable table col {
  666. text-align: center;
  667. }
  668. .elTreeTable th.el-table__cell > .cell {
  669. padding: 1px !important;
  670. }
  671. .elTreeTable {
  672. font-size: 12px !important;
  673. }
  674. .elTreeTable th.el-table__cell {
  675. padding: 1px !important;
  676. }
  677. .elTreeTable th.el-table__cell > .cell {
  678. text-align: center;
  679. }
  680. .elTreeTable .el-table__header tr:first-child th.el-table__cell:first-child .cell {
  681. width: 98px;
  682. }
  683. .elTreeTable .linkSpan {
  684. text-decoration: underline;
  685. color: #0057ba;
  686. display: block;
  687. text-align: right;
  688. padding: 6px 10px;
  689. }
  690. .elTreeTable td.el-table__cell div {
  691. padding: 0px;
  692. }
  693. .elTreeTable .cell .spanNum {
  694. display: block;
  695. text-align: right;
  696. padding: 6px 10px;
  697. }
  698. .elTreeTable .el-table__expand-icon {
  699. float: right;
  700. }
  701. .search-icon {
  702. font-size: 16px;
  703. line-height: inherit;
  704. margin-top: 4px;
  705. }
  706. .contentpd16 {
  707. padding: 16px;
  708. background-color: white;
  709. }
  710. .contentpd16 .van-cell {
  711. background-color: #ebf4ff;
  712. margin: 8px 0;
  713. border-radius: 5px;
  714. padding: 4px 16px;
  715. }
  716. </style>