VisitSummary.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. <template>
  2. <div class="bgcolor VisitSummary">
  3. <!-- 顶部条-->
  4. <van-nav-bar class="navBar" title="主管任务查询" left-arrow @click-left="onClickLeft" />
  5. <div class="container contentpd16">
  6. <van-row gutter="20">
  7. <van-col span="12">
  8. <van-cell :title="companyName" is-link arrow-direction="down" @click="regionClick" />
  9. </van-col>
  10. <van-col span="12">
  11. <van-cell :title="regionName" is-link @click="SalesRegionClick" arrow-direction="down" />
  12. </van-col>
  13. <van-col span="24">
  14. <van-cell
  15. :title="deptName"
  16. is-link
  17. @click="SalesDepartmentClick"
  18. arrow-direction="down" />
  19. </van-col>
  20. <!-- <van-col span="12">-->
  21. <!-- <van-cell :title="userName" is-link @click="StaffClick" arrow-direction="down"/>-->
  22. <!-- </van-col>-->
  23. <van-col span="12">
  24. <van-cell :title="formData.startTime" is-link @click="StartTimeClick">
  25. <template #right-icon>
  26. <van-icon :name="timeico" class="search-icon" />
  27. </template>
  28. </van-cell>
  29. </van-col>
  30. <van-col span="12">
  31. <van-cell :title="formData.endTime" is-link @click="EndTimeClick">
  32. <template #right-icon>
  33. <van-icon :name="timeico" class="search-icon" />
  34. </template>
  35. </van-cell>
  36. </van-col>
  37. <van-col span="24">
  38. <van-cell class="inputSearch">
  39. <van-field v-model="formData.summaryTaskName" placeholder="请输入任务名称" />
  40. </van-cell>
  41. </van-col>
  42. <van-col span="12">
  43. <van-cell
  44. :title="approvalStatus.text"
  45. is-link
  46. @click="approvalStatusShow = true"
  47. arrow-direction="down" />
  48. </van-col>
  49. <van-col span="12">
  50. <van-cell
  51. :title="storageStatus.text"
  52. is-link
  53. @click="storageStatusShow = true"
  54. arrow-direction="down" />
  55. </van-col>
  56. </van-row>
  57. <br />
  58. <van-button type="info" size="small" plain class="Btn100" @click="searchBtn">查找</van-button>
  59. </div>
  60. <!-- <div class="container">-->
  61. <!-- <div class="cellcontent brud" style="padding: 16px 16px;background-color: #fff;">-->
  62. <!-- <el-table class="elTreeTableLsiy" style="text-align: center;" :data="tableList" row-key="id" border lazy :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">-->
  63. <!-- <el-table-column prop="month" label="月份" width="60" />-->
  64. <!-- <el-table-column prop="commitRate" label="提交率%" />-->
  65. <!-- <el-table-column prop="approvalRate" label="审批率%" />-->
  66. <!-- </el-table>-->
  67. <!-- </div>-->
  68. <!-- </div>-->
  69. <div class="container">
  70. <van-list
  71. v-model="loading"
  72. :finished="finished"
  73. @load="onLoad"
  74. finished-text="--已经到底了--">
  75. <div class="cellcontent brud" v-for="(item, index) in list" :key="index">
  76. <van-cell>
  77. <div class="cardContent" @click="dailyFn(item)">
  78. <div class="title">
  79. <p class="textLeft">{{ item.nickName }}的{{ item.summaryTaskName }}</p>
  80. <div class="approvalStatusBtn" v-if="item.approvalStatus">
  81. <span class="approvalStatusBtn1" v-if="item.approvalStatus == '2'">审批通过</span>
  82. <span class="approvalStatusBtn2" v-if="item.approvalStatus == '1'">
  83. 提交待审批
  84. </span>
  85. <span class="approvalStatusBtn3" v-if="item.approvalStatus == '3'">
  86. 拒绝待提交
  87. </span>
  88. </div>
  89. <div class="approvalStatusBtn" v-if="item.status">
  90. <span class="status1" v-if="item.status == '1'">已提交</span>
  91. <span class="status0" v-if="item.status == '0'">暂存</span>
  92. </div>
  93. </div>
  94. <div class="info">部门:{{ item.deptName }}</div>
  95. <div class="info">提交时间:{{ item.createTime }}</div>
  96. </div>
  97. </van-cell>
  98. </div>
  99. <van-empty v-if="list.length == 0" />
  100. </van-list>
  101. </div>
  102. <br />
  103. <br />
  104. <van-popup v-model="RegionShow" capture position="bottom">
  105. <van-picker
  106. show-toolbar
  107. :columns="companyList"
  108. value-key="deptName"
  109. @confirm="onregionConfirm"
  110. @cancel="RegionShow = false" />
  111. </van-popup>
  112. <van-popup v-model="SalesRegionShow" capture position="bottom">
  113. <van-picker
  114. show-toolbar
  115. :columns="regionList"
  116. value-key="deptName"
  117. @confirm="onSalesRegionConfirm"
  118. @cancel="SalesRegionShow = false" />
  119. </van-popup>
  120. <van-popup v-model="SalesDepartmentShow" capture position="bottom">
  121. <van-picker
  122. show-toolbar
  123. :columns="deptList"
  124. value-key="deptName"
  125. @confirm="onSalesDepartmentConfirm"
  126. @cancel="SalesDepartmentShow = false" />
  127. </van-popup>
  128. <van-popup v-model="StaffShow" capture position="bottom">
  129. <van-picker
  130. show-toolbar
  131. :columns="userList"
  132. @confirm="onStaffConfirm"
  133. value-key="nickName"
  134. @cancel="StaffShow = false" />
  135. </van-popup>
  136. <van-popup v-model="StartTimeShow" capture position="bottom">
  137. <van-datetime-picker
  138. v-model="strtcurrentDate"
  139. type="date"
  140. title="选择查找开始时间"
  141. :min-date="strtminDate"
  142. :max-date="strtmaxDate"
  143. @confirm="onStartTimeConfirm"
  144. @cancel="StartTimeShow = false" />
  145. </van-popup>
  146. <van-popup v-model="EndTimeShow" capture position="bottom">
  147. <van-datetime-picker
  148. v-model="endcurrentDate"
  149. type="date"
  150. title="选择查找结束时间"
  151. :min-date="endminDate"
  152. :max-date="endmaxDate"
  153. @confirm="onEndTimeConfirm"
  154. @cancel="EndTimeShow = false" />
  155. </van-popup>
  156. <!-- approvalStatus:审批状态:1-待审批 2-审批通过 3-拒绝待提交 -->
  157. <van-popup v-model="approvalStatusShow" capture position="bottom">
  158. <van-picker
  159. show-toolbar
  160. :columns="approvalStatusList"
  161. @confirm="onSalesApprovalStatus"
  162. @cancel="approvalStatusShow = false" />
  163. </van-popup>
  164. <!-- status:状态:1-待审批 2-审批通过 3-拒绝待提交 -->
  165. <van-popup v-model="storageStatusShow" capture position="bottom">
  166. <van-picker
  167. show-toolbar
  168. :columns="storageStatusList"
  169. @confirm="onStorageStatus"
  170. @cancel="storageStatusShow = false" />
  171. </van-popup>
  172. </div>
  173. </template>
  174. <script>
  175. import timeico from '@/assets/Icon/datatims.png';
  176. import { getDeptInfo, getSummaryMobileDeptInfo, queryHistorySummaryList } from '@/api/index';
  177. export default {
  178. name: 'MyHistoricalWeekly',
  179. data() {
  180. return {
  181. timeico: timeico,
  182. RegionShow: false,
  183. SalesRegionShow: false,
  184. SalesDepartmentShow: false,
  185. StaffShow: false,
  186. StartTimeShow: false,
  187. EndTimeShow: false,
  188. PhotoTypeList: [{ text: '009', value: '09' }],
  189. strtminDate: new Date(2022, 0, 1),
  190. endminDate: new Date(2022, 0, 1),
  191. strtmaxDate: new Date(),
  192. endmaxDate: new Date(),
  193. strtcurrentDate: new Date(),
  194. endcurrentDate: new Date(),
  195. companyName: '全部公司',
  196. deptName: '全部销售部',
  197. regionName: '全部大区',
  198. userName: '全部业务员',
  199. companyCode: '',
  200. deptCode: '',
  201. regionCode: '',
  202. userCode: '',
  203. companyList: [],
  204. deptList: [],
  205. regionList: [],
  206. userList: [],
  207. deptForm: { type: '', parentId: '' },
  208. list: [],
  209. loading: false,
  210. finished: true,
  211. formData: {
  212. type: '1', // 汇报类型或入口 1-下属业务员日报 2-下属销售部主管周报 3-下属大区主管半月报
  213. companyId: '', // 公司id,必传 Long类型
  214. regionId: '', // 大区id,必传 Long类型
  215. deptId: '', // 部门id,如果为周报或日报为必传 Long类型
  216. userId: '', // 业务员id,如果为日报为必传 Long类型
  217. startTime: '', // 开始时间,必传 格式:yyyy-MM-dd String类型
  218. endTime: '', // 结束时间,必传 格式:yyyy-MM-dd String类型
  219. pageNum: 1, // 当前页码 int类型
  220. pageSize: 10, // 当前每页条数 int类型
  221. },
  222. tableList: [],
  223. approvalStatusShow: false,
  224. approvalStatusList: [
  225. //1-待审批 2-审批通过 3-拒绝待提交
  226. { text: '审批状态(全部)', value: '' },
  227. { text: '待审批', value: '1' },
  228. { text: '审批通过', value: '2' },
  229. { text: '拒绝待提交', value: '3' },
  230. ],
  231. approvalStatus: { text: '审批状态(全部)', value: '' },
  232. storageStatus: { text: '已提交', value: '1' },
  233. storageStatusList: [
  234. // 0-暂存,1-已提交
  235. { text: '已提交', value: '1' },
  236. { text: '暂存', value: '0' },
  237. ],
  238. storageStatusShow: false,
  239. };
  240. },
  241. activated() {
  242. this.approvalStatus = this.approvalStatusList[0];
  243. this.storageStatus = this.storageStatusList[0];
  244. this.userList = [];
  245. this.formData.startTime = this.getThreeDaysAgo();
  246. // this.formData.startTime = this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'),2)
  247. // this.strtcurrentDate=new Date(this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'),2))
  248. this.strtcurrentDate = new Date(this.getThreeDaysAgo());
  249. this.formData.endTime = this.parseTime(new Date(), '{y}-{m}-{d}') + '';
  250. this.endminDate = new Date(this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'), 2));
  251. this.powerGrade = localStorage.getItem('powerGrade');
  252. // userDeptLevel用户部门等级字段,0-总部,1-公司,2-大区,3-销售部,4-业务员
  253. this.userDeptLevel = localStorage.getItem('userDeptLevel');
  254. this.getDeptInfo('dept');
  255. if (this.userDeptLevel == 0) {
  256. setTimeout(() => {
  257. if (this.$route.query.userCode == undefined) {
  258. this.companyName = this.companyList[0].deptName;
  259. this.companyCode = this.companyList[0].deptId;
  260. }
  261. this.getDeptInfo('dept', 1);
  262. }, 1000);
  263. }
  264. if (this.userDeptLevel == 1) {
  265. setTimeout(() => {
  266. this.getDeptInfo('dept', 1);
  267. }, 1000);
  268. }
  269. if (this.userDeptLevel == 2) {
  270. setTimeout(() => {
  271. this.getDeptInfo('dept', 2);
  272. }, 1000);
  273. }
  274. if (this.userDeptLevel == 3 || this.userDeptLevel == 4) {
  275. setTimeout(() => {
  276. this.getDeptInfo('user');
  277. }, 2000);
  278. }
  279. if (this.$route.query.userCode != undefined) {
  280. this.companyName = this.$route.query.companyName;
  281. this.companyCode = this.$route.query.companyCode;
  282. this.regionName = this.$route.query.regionName;
  283. this.regionCode = this.$route.query.regionCode;
  284. this.userCode = this.$route.query.userCode;
  285. this.userName = this.$route.query.userName;
  286. this.deptName = this.$route.query.deptName;
  287. this.deptCode = this.$route.query.deptCode;
  288. this.formData.startTime = this.$route.query.startTime;
  289. this.formData.endTime = this.$route.query.endTime;
  290. this.searchBtn();
  291. this.getDeptInfo('dept', 2);
  292. this.getDeptInfo('user');
  293. } else {
  294. setTimeout(() => {
  295. this.searchBtn();
  296. }, 1000);
  297. }
  298. },
  299. watch: {
  300. $route(to, from) {
  301. // if(to.path=="/VisitSummary"&&from.path!="/My/index"){
  302. // this.userList=[]
  303. // this.formData.pageNum=1
  304. // this.list = [];
  305. // this.tableList=[];
  306. // this.regionName="全部大区"
  307. // this.regionCode=""
  308. // this.deptName="全部销售部"
  309. // this.deptCode=""
  310. // this.userCode=""
  311. // this.userName="全部业务员"
  312. // this.powerGrade = localStorage.getItem("powerGrade")
  313. // this.getDeptInfo("dept")
  314. // if(this.powerGrade==5){
  315. // setTimeout(()=>{
  316. // if(this.$route.query.userCode==undefined){
  317. // this.companyName=this.companyList[0].deptName;
  318. // this.companyCode=this.companyList[0].deptId;}
  319. // this.getDeptInfo("dept",1)
  320. // },1000)
  321. // }
  322. // if(this.powerGrade==4){
  323. // setTimeout(()=>{
  324. // this.getDeptInfo("dept",1)
  325. // },1000)
  326. // }
  327. // if(this.powerGrade==3){
  328. // setTimeout(()=>{
  329. // this.getDeptInfo("dept",2)
  330. // },1000)
  331. // }
  332. // if(this.powerGrade==2||this.powerGrade==1){
  333. // setTimeout(()=>{
  334. // this.getDeptInfo("user")
  335. // },2000)
  336. // }
  337. // setTimeout(()=>{
  338. // this.searchBtn()
  339. // },1000)
  340. // }
  341. },
  342. },
  343. methods: {
  344. dateFn(val) {
  345. return val.slice(0, 4) + '-' + val.slice(4, 6) + '-' + val.slice(6, 8);
  346. },
  347. onLoad() {
  348. this.querySubReport();
  349. },
  350. searchBtn() {
  351. // if(this.userCode==""){
  352. // this.$toast("业务员未选择")
  353. // }else{
  354. this.formData.pageNum = 1;
  355. this.list = [];
  356. this.querySubReport();
  357. // }
  358. },
  359. querySubReport() {
  360. let loading1 = this.$toast.loading({
  361. duration: 0,
  362. message: '加载中...',
  363. forbidClick: true,
  364. });
  365. if (this.refreshing) {
  366. this.list = [];
  367. this.refreshing = false;
  368. }
  369. this.formData.companyId = this.companyCode; // 公司id,必传 Long类型
  370. this.formData.regionId = this.regionCode; // 大区id,必传 Long类型
  371. this.formData.deptId = this.deptCode; // 部门id,如果为周报或日报为必传 Long类型
  372. this.formData.userId = this.userCode; // 业务员id,如果为日报为必传 Long类型
  373. this.formData.approvalStatus = this.approvalStatus.value;
  374. this.formData.status = this.storageStatus.value;
  375. queryHistorySummaryList(this.formData).then((res) => {
  376. loading1.clear();
  377. if (res.code == 200) {
  378. this.loading = false;
  379. this.list = this.list.concat(res.data);
  380. if (this.list.length >= res.total) {
  381. this.finished = true;
  382. } else {
  383. this.finished = false;
  384. }
  385. this.formData.pageNum = this.formData.pageNum + 1;
  386. // this.tableList=res.data.rates
  387. }
  388. });
  389. },
  390. getThreeDaysAgo() {
  391. let myDate = new Date();
  392. let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 7); //最后一个数字30可改,30天的意思
  393. let lastY = lw.getFullYear();
  394. let lastM = lw.getMonth() + 1;
  395. let lastD = lw.getDate();
  396. let startData =
  397. lastY + '-' + (lastM < 10 ? '0' + lastM : lastM) + '-' + (lastD < 10 ? '0' + lastD : lastD); //三十天之前日期
  398. return startData;
  399. },
  400. GetPreMonthDay(date, monthNum, type) {
  401. var dateArr = date.split('-');
  402. var year = dateArr[0]; //获取当前日期的年份
  403. var month = dateArr[1]; //获取当前日期的月份
  404. var day = dateArr[2]; //获取当前日期的日
  405. var days = new Date(year, month, 0);
  406. days = days.getDate(); //获取当前日期中月的天数
  407. var year2 = year;
  408. var month2 = parseInt(month) - monthNum;
  409. if (month2 <= 0) {
  410. var absM = Math.abs(month2);
  411. year2 = parseInt(year2) - Math.ceil(absM / 12 == 0 ? 1 : parseInt(absM) / 12);
  412. month2 = 12 - (absM % 12);
  413. }
  414. var day2 = day;
  415. var days2 = new Date(year2, month2, 0);
  416. days2 = days2.getDate();
  417. if (day2 > days2) {
  418. day2 = days2;
  419. }
  420. if (month2 < 10) {
  421. month2 = '0' + month2;
  422. }
  423. var t2 = '';
  424. if (monthNum > 0) {
  425. t2 = year2 + '-' + month2 + '-01';
  426. } else {
  427. if (type == 'end') {
  428. var Months = new Date().getMonth() + 1;
  429. var days111 = new Date().getDate();
  430. if (Months < 10) {
  431. Months = '0' + Months;
  432. }
  433. if (days111 < 10) {
  434. days111 = '0' + days111;
  435. }
  436. if (new Date().getFullYear() == year) {
  437. if (parseInt(month2) >= new Date().getMonth() + 1) {
  438. t2 = year2 + '-' + Months + '-' + days111;
  439. } else {
  440. var daysd = this.getMonthDays(year2, month2);
  441. t2 = year2 + '-' + month2 + '-' + daysd;
  442. }
  443. } else {
  444. var daysd = this.getMonthDays(year2, month2);
  445. t2 = year2 + '-' + month2 + '-' + daysd;
  446. }
  447. } else {
  448. t2 = year2 + '-' + month2 + '-' + day2;
  449. }
  450. }
  451. return t2;
  452. },
  453. getMonthDays(year, month) {
  454. var stratDate = new Date(year, month - 1, 1),
  455. endData = new Date(year, month, 1);
  456. var days = (endData - stratDate) / (1000 * 60 * 60 * 24);
  457. return days;
  458. },
  459. getDeptInfo(type, grade) {
  460. this.deptForm.type = type;
  461. if (type == 'dept') {
  462. if (grade == '1') {
  463. this.deptForm.parentId = this.companyCode;
  464. } else if (grade == '2') {
  465. this.deptForm.parentId = this.regionCode;
  466. } else {
  467. this.deptForm.type = '';
  468. this.deptForm.parentId = '';
  469. }
  470. } else if (type == 'user') {
  471. this.deptForm.parentId = this.deptCode;
  472. }
  473. getSummaryMobileDeptInfo(this.deptForm).then((res) => {
  474. if (type == 'dept') {
  475. if (grade == '1') {
  476. if (res.data.region != null) {
  477. this.regionList = [{ deptName: '全部大区', deptId: '' }].concat(res.data.region);
  478. }
  479. } else if (grade == '2') {
  480. if (res.data.dept != null) {
  481. this.deptList = [{ deptName: '全部销售部', deptId: '' }].concat(res.data.dept);
  482. }
  483. } else {
  484. if (this.userDeptLevel == 0) {
  485. this.companyList = [{ deptName: '全部公司', deptId: '' }].concat(res.data.company);
  486. } else {
  487. this.companyList = res.data.company;
  488. }
  489. if (this.$route.query.userCode == undefined) {
  490. this.companyName = res.data.company[0].deptName;
  491. this.companyCode = res.data.company[0].deptId;
  492. }
  493. if (res.data.dept != null) {
  494. this.deptName = res.data.dept[0].deptName;
  495. this.deptCode = res.data.dept[0].deptId;
  496. this.deptList = res.data.dept;
  497. }
  498. if (res.data.region != null) {
  499. this.regionName = res.data.region[0].deptName;
  500. this.regionCode = res.data.region[0].deptId;
  501. this.regionList = res.data.region;
  502. }
  503. if (res.data.user != null) {
  504. this.userList = res.data.user;
  505. this.userCode = '';
  506. }
  507. }
  508. } else if (type == 'user') {
  509. if (res.data.user != null) {
  510. this.userList = [{ nickName: '全部业务员', userId: '' }].concat(res.data.user);
  511. }
  512. }
  513. });
  514. },
  515. dailyFn(row) {
  516. if (row.status == '0') {
  517. this.$router.push({
  518. path: '/VisitSummaryStorageDetail',
  519. query: { userSummaryId: row.userSummaryId },
  520. });
  521. } else {
  522. this.$router.push({
  523. path: '/VisitSummaryDetail',
  524. query: { userSummaryId: row.userSummaryId, source: 'VisitSummary' },
  525. });
  526. }
  527. },
  528. onClickLeft() {
  529. this.$router.go(-1);
  530. },
  531. regionClick() {
  532. // if(this.powerGrade>4){
  533. this.RegionShow = true;
  534. // }
  535. },
  536. SalesRegionClick(val) {
  537. // if(this.powerGrade>3){
  538. this.SalesRegionShow = true;
  539. // }
  540. },
  541. SalesDepartmentClick() {
  542. // if(this.powerGrade>2){
  543. this.SalesDepartmentShow = true;
  544. // }
  545. },
  546. StaffClick() {
  547. this.StaffShow = true;
  548. },
  549. StartTimeClick() {
  550. this.StartTimeShow = true;
  551. },
  552. EndTimeClick() {
  553. this.EndTimeShow = true;
  554. },
  555. onregionConfirm(val) {
  556. this.RegionShow = false;
  557. this.companyName = val.deptName;
  558. this.companyCode = val.deptId;
  559. this.regionName = '全部大区';
  560. this.regionCode = '';
  561. this.deptName = '全部销售部';
  562. this.deptCode = '';
  563. this.userName = '全部业务员';
  564. this.userCode = '';
  565. this.getDeptInfo('dept', 1);
  566. },
  567. onSalesRegionConfirm(val) {
  568. this.SalesRegionShow = false;
  569. this.regionName = val.deptName;
  570. this.regionCode = val.deptId;
  571. if (val.deptId != '') {
  572. this.getDeptInfo('dept', 2);
  573. }
  574. this.deptName = '全部销售部';
  575. this.deptCode = '';
  576. this.userName = '全部业务员';
  577. this.userCode = '';
  578. this.userList = [];
  579. },
  580. onSalesDepartmentConfirm(val) {
  581. this.SalesDepartmentShow = false;
  582. this.deptName = val.deptName;
  583. this.deptCode = val.deptId;
  584. if (val.deptId != '') {
  585. this.getDeptInfo('user');
  586. }
  587. this.userName = '全部业务员';
  588. this.userCode = '';
  589. },
  590. onStaffConfirm(val) {
  591. this.StaffShow = false;
  592. this.userName = val.nickName;
  593. this.userCode = val.userId;
  594. },
  595. onStartTimeConfirm(val) {
  596. this.formData.startTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
  597. this.StartTimeShow = false;
  598. this.endminDate = new Date(val);
  599. this.endmaxDate = new Date(this.GetPreMonthDay(this.formData.startTime, -2, 'end'));
  600. if (
  601. new Date(this.formData.startTime).getTime() > new Date(this.formData.endTime).getTime() ||
  602. new Date(this.endmaxDate).getTime() < new Date(this.formData.endTime).getTime()
  603. ) {
  604. this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
  605. this.endcurrentDate = this.GetPreMonthDay(this.formData.startTime, -2);
  606. }
  607. },
  608. onEndTimeConfirm(val) {
  609. this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}');
  610. this.strtmaxDate = new Date(val);
  611. if (new Date(this.formData.startTime).getTime() > new Date(this.formData.endTime).getTime()) {
  612. this.formData.startTime = this.formData.endTime;
  613. }
  614. this.EndTimeShow = false;
  615. },
  616. onSalesApprovalStatus(val) {
  617. this.approvalStatus = val;
  618. this.approvalStatusShow = false;
  619. },
  620. onStorageStatus(val) {
  621. this.storageStatus = val;
  622. this.storageStatusShow = false;
  623. },
  624. },
  625. };
  626. </script>
  627. <style lang="scss">
  628. .VisitSummary {
  629. .cardContent {
  630. padding: 0;
  631. box-sizing: border-box;
  632. }
  633. .cardContent .title {
  634. font-size: 15px;
  635. font-weight: bold;
  636. color: #333;
  637. line-height: 22px;
  638. display: flex;
  639. justify-content: space-between;
  640. }
  641. .cardContent .title p {
  642. padding: 0;
  643. margin: 0;
  644. }
  645. .cardContent .title .textLeft {
  646. display: inline-block;
  647. padding-bottom: 10px;
  648. }
  649. .cardContent .title .textRight {
  650. float: right;
  651. color: #0057ba;
  652. }
  653. .cardContent .info {
  654. font-size: 14px;
  655. color: #666;
  656. line-height: 26px;
  657. }
  658. .search-icon {
  659. font-size: 16px;
  660. line-height: inherit;
  661. margin-top: 4px;
  662. }
  663. .brud {
  664. margin: 16px;
  665. border-radius: 8px;
  666. overflow: hidden;
  667. }
  668. .contentpd16 {
  669. padding: 16px;
  670. background-color: white;
  671. }
  672. .Btn100 {
  673. margin: 0 auto 10px;
  674. display: block;
  675. width: 100%;
  676. border-radius: 5px;
  677. color: #fff !important;
  678. background-color: #0057ba;
  679. border: 1px solid #0057ba;
  680. height: 36px;
  681. }
  682. .contentpd16 .van-cell {
  683. background-color: #ebf4ff;
  684. margin: 8px 0;
  685. border-radius: 5px;
  686. padding: 4px 16px;
  687. }
  688. .elTreeTableLsiy th.el-table__cell > .cell {
  689. text-align: center;
  690. }
  691. .elTreeTableLsiy td.el-table__cell div {
  692. text-align: right;
  693. }
  694. .elTreeTableLsiy .el-table__cell {
  695. padding: 2px 0;
  696. }
  697. .elTreeTableLsiy .el-table__cell:first-child .cell {
  698. text-align: center;
  699. }
  700. .contentpd16 .inputSearch .van-cell {
  701. padding: 0;
  702. margin: 4px 0;
  703. }
  704. }
  705. </style>
  706. <style lang="scss">
  707. .VisitSummary {
  708. .brud {
  709. position: relative;
  710. }
  711. .approvalStatusBtn {
  712. span {
  713. color: #fff;
  714. border-radius: 5px;
  715. display: inline-block;
  716. padding: 3px 5px;
  717. font-size: 14px;
  718. width: 80px;
  719. text-align: center;
  720. }
  721. .approvalStatusBtn1 {
  722. background-color: #12ea7a;
  723. }
  724. .approvalStatusBtn2 {
  725. background-color: rgb(112, 33, 239);
  726. }
  727. .approvalStatusBtn3 {
  728. background-color: red;
  729. }
  730. .status1 {
  731. background-color: #07c160;
  732. }
  733. .status0 {
  734. background-color: #ff976a;
  735. }
  736. }
  737. .van-cell__title {
  738. overflow: hidden;
  739. text-overflow: ellipsis;
  740. white-space: nowrap;
  741. span {
  742. overflow: hidden;
  743. text-overflow: ellipsis;
  744. white-space: nowrap;
  745. }
  746. }
  747. }
  748. </style>