detailItem.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858
  1. <template>
  2. <div class="componVisitSummary">
  3. <van-form ref="tabstoreVal">
  4. <div v-for="(item, index) in collectionItemList" :key="index">
  5. <div v-if="item.answerType == 'sz'" class="formLabel z-cell">
  6. <van-cell>
  7. <template #title>
  8. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
  9. </template>
  10. </van-cell>
  11. <van-field
  12. v-model="item.answerValue"
  13. :placeholder="item.customName"
  14. type="number"
  15. :disabled="true"
  16. @input="numberFn(item, index)"></van-field>
  17. <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  18. {{ item.remark }}
  19. </p>
  20. </div>
  21. <div v-if="item.answerType == 'rq'" class="formLabel z-cell">
  22. <van-cell>
  23. <template #title>
  24. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
  25. </template>
  26. </van-cell>
  27. <van-field
  28. v-model="item.answerValue"
  29. clickable
  30. name="calendar"
  31. placeholder="点击选择日期"
  32. readonly
  33. :disabled="true"
  34. @click="showCalendarClick(index)" />
  35. <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  36. {{ item.remark }}
  37. </p>
  38. </div>
  39. <div v-if="item.answerType == 'zp'" class="formLabel z-cell">
  40. <van-cell>
  41. <template #title>
  42. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
  43. </template>
  44. </van-cell>
  45. <van-row gutter="10" style="margin-bottom: 10px">
  46. <p style="margin-top: 0">
  47. <span style="font-size: 12px; color: #888">{{ item.remark }}</span>
  48. </p>
  49. <delete-upload-img
  50. :isDelete="false"
  51. :imgs="item.fileInfoList"
  52. :isEdit="item.allowWriteAgain"></delete-upload-img>
  53. <upload-img
  54. v-if="false"
  55. :uploadid="uploadid2"
  56. @newimgarr="newimgarr1"
  57. imgText="上传照片"
  58. :indexImg="index"
  59. :customId="item.customId"
  60. :summaryId="item.summaryId"
  61. :allowWriteAgain="false"
  62. @click="imgClick(item, index)"></upload-img>
  63. </van-row>
  64. </div>
  65. <div v-if="item.answerType == 'wb'" class="formLabel z-cell">
  66. <van-cell>
  67. <template #title>
  68. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
  69. </template>
  70. </van-cell>
  71. <van-field
  72. :disabled="true"
  73. v-model="item.answerValue"
  74. :formatter="formatter"
  75. :placeholder="item.customName"></van-field>
  76. <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  77. {{ item.remark }}
  78. </p>
  79. </div>
  80. <div
  81. class="formLabel z-cell z-cells z-celly"
  82. v-if="item.answerType == 'gs' || item.answerType == 'dq' || item.answerType == 'xsb'">
  83. <van-cell>
  84. <template #title
  85. >{{ index + 1 }}.{{ item.customName }}
  86. <span
  87. style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right"
  88. >{{ item.remark }}</span
  89. ></template
  90. >
  91. </van-cell>
  92. <p class="mg0">{{ item.answerValue }}</p>
  93. </div>
  94. <div v-if="item.answerType == 'duox'" class="formLabel z-cell">
  95. <van-cell>
  96. <template #title>
  97. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
  98. </template>
  99. </van-cell>
  100. <z-checkbox
  101. :disabled="true"
  102. :answerType="item.answerType"
  103. :checkboxval="item.answerValue"
  104. :collectionType="item.customOptionList"
  105. :textc="item.customId"
  106. :zCheckboxcolumns="item.customOptionList"
  107. @zSelectVal="zSelectVal"></z-checkbox>
  108. </div>
  109. <div v-if="item.answerType == 'dx'" class="formLabel z-cell">
  110. <van-cell>
  111. <template #title>
  112. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.customName }}
  113. </template>
  114. </van-cell>
  115. <z-radio
  116. :disabled="true"
  117. :answerType="item.answerType"
  118. :collectionType="item.collectionType"
  119. :radio="item.answerValue"
  120. :textc="item.customId"
  121. :zRadiocolumns="item.customOptionList"
  122. @zSelectVal="zSelectVal"></z-radio>
  123. </div>
  124. <br />
  125. </div>
  126. </van-form>
  127. <van-calendar
  128. v-model="showCalendar"
  129. @confirm="onConfirm"
  130. color="#0057ba"
  131. :min-date="minDate"
  132. :max-date="maxDate"
  133. :show-confirm="false" />
  134. <van-popup v-model="RegionShow" capture position="bottom">
  135. <van-picker
  136. :columns="companyList"
  137. show-toolbar
  138. value-key="deptName"
  139. @cancel="RegionShow = false"
  140. @confirm="onregionConfirm" />
  141. </van-popup>
  142. <van-popup v-model="SalesRegionShow" capture position="bottom">
  143. <van-picker
  144. :columns="regionList"
  145. show-toolbar
  146. value-key="deptName"
  147. @cancel="SalesRegionShow = false"
  148. @confirm="onSalesRegionConfirm" />
  149. </van-popup>
  150. <van-popup v-model="SalesDepartmentShow" capture position="bottom">
  151. <van-picker
  152. :columns="deptList"
  153. show-toolbar
  154. value-key="deptName"
  155. @cancel="SalesDepartmentShow = false"
  156. @confirm="onSalesDepartmentConfirm" />
  157. </van-popup>
  158. <van-popup v-model="StartTimeShow" capture position="bottom">
  159. <van-datetime-picker
  160. v-model="strtcurrentDate"
  161. :max-date="strtmaxDate"
  162. :min-date="strtminDate"
  163. title="选择查找开始时间"
  164. type="date"
  165. @cancel="StartTimeShow = false"
  166. @confirm="onStartTimeConfirm" />
  167. </van-popup>
  168. <van-popup v-model="EndTimeShow" capture position="bottom">
  169. <van-datetime-picker
  170. v-model="endcurrentDate"
  171. :max-date="endmaxDate"
  172. :min-date="endminDate"
  173. title="选择查找结束时间"
  174. type="date"
  175. @cancel="EndTimeShow = false"
  176. @confirm="onEndTimeConfirm" />
  177. </van-popup>
  178. </div>
  179. </template>
  180. <script>
  181. import { insertCustomAnswer, getSummaryMobileDeptInfo, getDeptsByUser } from '@/api/index';
  182. import zRadio from '@/components/zRadio2';
  183. import zCheckbox from '@/components/zCheckbox2';
  184. import uploadImg from '@/components/uploadVTask';
  185. import deleteUploadImg from '@/components/deleteUploadImg2';
  186. export default {
  187. name: 'MyHistoricalWeekly',
  188. components: { zRadio, zCheckbox, uploadImg, deleteUploadImg },
  189. props: {
  190. collectionItemLists: {
  191. type: Array,
  192. default() {
  193. return [];
  194. },
  195. },
  196. approvalStatus: {
  197. type: String,
  198. default: '',
  199. },
  200. source: {
  201. type: String,
  202. default: '',
  203. },
  204. },
  205. data() {
  206. return {
  207. RegionShow: false,
  208. SalesRegionShow: false,
  209. SalesDepartmentShow: false,
  210. StaffShow: false,
  211. StartTimeShow: false,
  212. dateIndex: '',
  213. EndTimeShow: false,
  214. uploadid2: 'uploadid2',
  215. PhotoTypeList: [{ text: '009', value: '09' }],
  216. strtminDate: new Date(2022, 0, 1),
  217. endminDate: new Date(2022, 0, 1),
  218. minDate: new Date(2020, 0, 1),
  219. maxDate: new Date(2090, 0, 31),
  220. strtmaxDate: new Date(),
  221. endmaxDate: new Date(),
  222. strtcurrentDate: new Date(),
  223. endcurrentDate: new Date(),
  224. companyName: '全部公司',
  225. deptName: '全部销售部',
  226. regionName: '全部大区',
  227. userName: '全部',
  228. companyCode: '',
  229. deptCode: '',
  230. regionCode: '',
  231. userCode: '',
  232. companyList: [],
  233. title: '',
  234. deptList: [],
  235. regionList: [],
  236. userList: [],
  237. deptForm: { type: '', parentId: '' },
  238. list: [],
  239. loading: false,
  240. finished: true,
  241. showCalendar: false,
  242. formData: {
  243. type: '2', // 汇报类型或入口 1-下属业务员日报 2-下属销售部主管周报 3-下属大区主管半月报
  244. companyId: '', // 公司id,必传 Long类型
  245. regionId: '', // 大区id,必传 Long类型
  246. deptId: '', // 部门id,如果为周报或日报为必传 Long类型
  247. userId: '', // 业务员id,如果为日报为必传 Long类型
  248. startTime: '', // 开始时间,必传 格式:yyyy-MM-dd String类型
  249. endTime: '', // 结束时间,必传 格式:yyyy-MM-dd String类型
  250. pageNum: 1, // 当前页码 int类型
  251. pageSize: 10, // 当前每页条数 int类型
  252. },
  253. tableList: [],
  254. collectionItemList: [],
  255. collectionAnswerlisd: [],
  256. flagclick: true,
  257. index: '',
  258. activaFlag: true,
  259. };
  260. },
  261. created() {
  262. this.formData.startTime = this.getThreeDaysAgo();
  263. this.strtcurrentDate = new Date(this.getThreeDaysAgo());
  264. this.formData.endTime = this.parseTime(new Date(), '{y}-{m}-{d}') + '';
  265. this.endminDate = new Date(this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'), 2));
  266. this.powerGrade = localStorage.getItem('powerGrade');
  267. this.title = this.$route.query.title;
  268. this.regionCode = '';
  269. },
  270. watch: {
  271. collectionItemLists: {
  272. handler(val) {
  273. // this.collectionItemList = JSON.parse(JSON.stringify(this.collectionItemLists));
  274. this.setCollectionItemLists();
  275. },
  276. deep: true,
  277. immediate: true,
  278. },
  279. },
  280. methods: {
  281. showCalendarClick(val) {
  282. if (!val.allowWriteAgain) return;
  283. this.dateIndex = val;
  284. this.showCalendar = true;
  285. },
  286. formatDate(date) {
  287. var Month = date.getMonth() + 1;
  288. var Day = date.getDate();
  289. if (Month < 10) {
  290. Month = '0' + Month;
  291. }
  292. if (Day < 10) {
  293. Day = '0' + Day;
  294. }
  295. return `${date.getFullYear()}-${Month}-${Day}`;
  296. },
  297. onConfirm(date) {
  298. this.showCalendar = false;
  299. this.collectionItemList[this.dateIndex].answerValue = this.formatDate(date);
  300. },
  301. formatter(value) {
  302. return value.replace(
  303. /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,
  304. ''
  305. );
  306. },
  307. numberFn(val, index) {
  308. if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(this.collectionItemList[index].answerValue)) {
  309. this.collectionItemList[index].answerValue = this.collectionItemList[
  310. index
  311. ].answerValue.replace(
  312. /\.\d{2,}$/,
  313. this.collectionItemList[index].answerValue.substr(
  314. this.collectionItemList[index].answerValue.indexOf('.'),
  315. 3
  316. )
  317. );
  318. }
  319. },
  320. zSelectVal(value) {
  321. console.log(value);
  322. var collectionAnswerlisd = this.collectionAnswerlisd;
  323. if (collectionAnswerlisd.length > 0) {
  324. var num = 0;
  325. for (var a = 0; a < collectionAnswerlisd.length; a++) {
  326. if (collectionAnswerlisd[a].id == value.id) {
  327. collectionAnswerlisd[a] = value;
  328. num = 0;
  329. } else {
  330. num = 1;
  331. }
  332. }
  333. if (num > 0) {
  334. collectionAnswerlisd.push(value);
  335. }
  336. } else {
  337. collectionAnswerlisd.push(value);
  338. }
  339. this.collectionAnswerlisd = collectionAnswerlisd;
  340. },
  341. imgClick(val, index) {
  342. this.collectionId = val.collectionId + '';
  343. this.indeximg = index;
  344. this.show = true;
  345. },
  346. newimgarr1(val) {
  347. if (
  348. this.collectionItemList[val.index].fileInfoList == null ||
  349. this.collectionItemList[val.index].fileInfoList == undefined
  350. ) {
  351. this.collectionItemList[val.index].fileInfoList = [];
  352. this.collectionItemList[val.index].fileIdList = [];
  353. }
  354. this.collectionItemList[val.index].fileInfoList.push(val);
  355. this.collectionItemList[val.index].fileIdList.push(val.id);
  356. },
  357. dateFn(val) {
  358. return val.slice(0, 4) + '-' + val.slice(4, 6) + '-' + val.slice(6, 8);
  359. },
  360. onLoad() {},
  361. onSubmit() {
  362. for (var c = 0; c < this.collectionAnswerlisd.length; c++) {
  363. for (var b = 0; b < this.collectionItemList.length; b++) {
  364. if (this.collectionAnswerlisd[c].id == this.collectionItemList[b].customId) {
  365. this.collectionItemList[b].customOptionList = this.collectionAnswerlisd[c].value;
  366. }
  367. }
  368. }
  369. if (this.flagclick) {
  370. this.flagclick = false;
  371. this.timer = null;
  372. this.timer = setTimeout(() => {
  373. this.flagclick = true;
  374. }, 2000);
  375. insertCustomAnswer(this.collectionItemList).then((res) => {
  376. if (res.code == 200) {
  377. this.$router.go(-1);
  378. }
  379. });
  380. }
  381. },
  382. setCollectionItemLists() {
  383. this.collectionItemList = [];
  384. this.collectionAnswerlisd = [];
  385. this.collectionItemList = JSON.parse(JSON.stringify(this.collectionItemLists));
  386. for (var q = 0; q < this.collectionItemList.length; q++) {
  387. this.collectionItemList[q].answerName = undefined;
  388. // 公司
  389. // if (
  390. // (this.collectionItemList[q].answerType == 'gs' ||
  391. // this.collectionItemList[q].answerType == 'dq' ||
  392. // this.collectionItemList[q].answerType == 'xsb') &&
  393. // this.activaFlag
  394. // ) {
  395. // this.activaFlag = false;
  396. // if (this.collectionItemList[q].answerType == 'xsb') {
  397. // this.getDeptsBy(this.collectionItemList[q].answerValue);
  398. // this.getDeptInfo(
  399. // 'dept',
  400. // this.collectionItemList[q].answerType,
  401. // this.collectionItemList[q].answerValue
  402. // );
  403. // } else {
  404. // this.getDeptInfo(
  405. // 'dept',
  406. // this.collectionItemList[q].answerType,
  407. // this.collectionItemList[q].answerValue
  408. // );
  409. // }
  410. // }
  411. // 单选
  412. if (this.collectionItemList[q].answerType == 'dx') {
  413. let findCustom = this.collectionItemList[q].customOptionList.find((item) => item.checked);
  414. if (findCustom) {
  415. this.collectionItemList[q].answerValue = findCustom.customOptionId + '';
  416. }
  417. }
  418. // 多选
  419. if (this.collectionItemList[q].answerType == 'duox') {
  420. let findCustom = [];
  421. this.collectionItemList[q].customOptionList.forEach((item) => {
  422. if (item.checked) {
  423. findCustom.push(item.customOptionId + '');
  424. }
  425. });
  426. if (findCustom) {
  427. this.collectionItemList[q].answerValue = findCustom.join(',');
  428. }
  429. }
  430. // 照片
  431. if (
  432. this.collectionItemList[q].answerType == 'zp' &&
  433. this.collectionItemList[q].fileInfoList
  434. ) {
  435. let fileIdList = [];
  436. this.collectionItemList[q].fileInfoList.forEach((item) => {
  437. fileIdList.push(item.id);
  438. });
  439. this.collectionItemList[q].fileIdList = fileIdList;
  440. }
  441. }
  442. },
  443. getThreeDaysAgo() {
  444. let myDate = new Date();
  445. let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 14); //最后一个数字30可改,30天的意思
  446. let lastY = lw.getFullYear();
  447. let lastM = lw.getMonth() + 1;
  448. let lastD = lw.getDate();
  449. let startData =
  450. lastY + '-' + (lastM < 10 ? '0' + lastM : lastM) + '-' + (lastD < 10 ? '0' + lastD : lastD); //三十天之前日期
  451. return startData;
  452. },
  453. GetPreMonthDay(date, monthNum, type) {
  454. var dateArr = date.split('-');
  455. var year = dateArr[0]; //获取当前日期的年份
  456. var month = dateArr[1]; //获取当前日期的月份
  457. var day = dateArr[2]; //获取当前日期的日
  458. var days = new Date(year, month, 0);
  459. days = days.getDate(); //获取当前日期中月的天数
  460. var year2 = year;
  461. var month2 = parseInt(month) - monthNum;
  462. if (month2 <= 0) {
  463. var absM = Math.abs(month2);
  464. year2 = parseInt(year2) - Math.ceil(absM / 12 == 0 ? 1 : parseInt(absM) / 12);
  465. month2 = 12 - (absM % 12);
  466. }
  467. var day2 = day;
  468. var days2 = new Date(year2, month2, 0);
  469. days2 = days2.getDate();
  470. if (day2 > days2) {
  471. day2 = days2;
  472. }
  473. if (month2 < 10) {
  474. month2 = '0' + month2;
  475. }
  476. var t2 = '';
  477. if (monthNum > 0) {
  478. t2 = year2 + '-' + month2 + '-01';
  479. } else {
  480. if (type == 'end') {
  481. var Months = new Date().getMonth() + 1;
  482. var days111 = new Date().getDate();
  483. if (Months < 10) {
  484. Months = '0' + Months;
  485. }
  486. if (days111 < 10) {
  487. days111 = '0' + days111;
  488. }
  489. if (parseInt(month2) >= new Date().getMonth() + 1) {
  490. t2 = year2 + '-' + Months + '-' + days111;
  491. } else {
  492. var daysd = this.getMonthDays(year2, month2);
  493. t2 = year2 + '-' + month2 + '-' + daysd;
  494. }
  495. } else {
  496. t2 = year2 + '-' + month2 + '-' + day2;
  497. }
  498. }
  499. return t2;
  500. },
  501. getMonthDays(year, month) {
  502. var stratDate = new Date(year, month - 1, 1),
  503. endData = new Date(year, month, 1);
  504. var days = (endData - stratDate) / (1000 * 60 * 60 * 24);
  505. return days;
  506. },
  507. getDeptInfo(type, grade, answerValue) {
  508. this.deptForm.type = type;
  509. if (grade == 'dq') {
  510. this.deptForm.parentId = this.companyCode;
  511. } else if (grade == 'xsb') {
  512. this.deptForm.parentId = this.regionCode;
  513. } else {
  514. this.deptForm.type = '';
  515. this.deptForm.parentId = '';
  516. }
  517. getSummaryMobileDeptInfo(this.deptForm).then((res) => {
  518. if (grade == 'dq') {
  519. if (res.data.region != null) {
  520. this.regionList = res.data.region;
  521. if (answerValue) {
  522. let findCompany = this.companyList.find((item) => item.deptName == answerValue);
  523. // this.onSalesRegionConfirm(findCompany);
  524. } else {
  525. this.onSalesRegionConfirm(this.regionList[0]);
  526. }
  527. }
  528. } else if (grade == 'xsb') {
  529. if (res.data.dept != null) {
  530. this.deptList = res.data.dept;
  531. if (answerValue) {
  532. let findCompany = this.regionList.find((item) => item.deptName == answerValue);
  533. // this.onSalesDepartmentConfirm(findCompany);
  534. } else {
  535. this.onSalesDepartmentConfirm(this.deptList[0]);
  536. }
  537. }
  538. } else if (grade == 'gs') {
  539. this.companyList = res.data.company;
  540. if (answerValue) {
  541. let findCompany = this.companyList.find((item) => item.deptName == answerValue);
  542. // this.onregionConfirm(findCompany);
  543. } else {
  544. this.onregionConfirm(this.companyList[0]);
  545. }
  546. if (res.data.dept != null) {
  547. this.deptList = res.data.dept;
  548. }
  549. if (res.data.region != null) {
  550. this.regionList = res.data.region;
  551. }
  552. }
  553. });
  554. },
  555. getDeptsBy(answerValue) {
  556. getDeptsByUser().then((res) => {
  557. if (res.data && res.code == 200) {
  558. let arr = [];
  559. res.data.forEach((val) => {
  560. arr.push({
  561. ancestors: val.ancestors || '',
  562. deptCode: val.deptCode || '',
  563. deptId: val.deptId || '',
  564. deptLevel: val.deptLevel || '',
  565. deptName: val.deptName || '',
  566. parentId: val.parentId || '',
  567. });
  568. });
  569. this.deptList = arr;
  570. if (answerValue) {
  571. let findCompany = this.regionList.find((item) => item.deptCode == answerValue);
  572. // this.onSalesDepartmentConfirm(findCompany);
  573. } else {
  574. this.onSalesDepartmentConfirm(this.deptList[0]);
  575. }
  576. }
  577. });
  578. },
  579. dailyFn(row) {
  580. if (row.status != '0') {
  581. if (row.status == -1) {
  582. var dayTime = row.showDate;
  583. var times = new Date(
  584. dayTime.slice(0, 4) + '-' + dayTime.slice(4, 6) + '-' + dayTime.slice(6, 8)
  585. ).getTime();
  586. var time = new Date('2022-08-25').getTime();
  587. if (times < time) {
  588. this.$dialog.alert({
  589. title: '系统提示',
  590. message: '非常抱歉,8月25日前历史报告数据不存在',
  591. });
  592. } else {
  593. this.$router.push({
  594. path: '/weeklyHistoricalDetils',
  595. query: { reportId: row.id },
  596. });
  597. }
  598. } else {
  599. this.$router.push({
  600. path: '/weeklyHistoricalDetils',
  601. query: { reportId: row.id },
  602. });
  603. }
  604. }
  605. },
  606. regionClick(val) {
  607. // if(this.powerGrade>4){
  608. this.index = val;
  609. this.RegionShow = true;
  610. // }
  611. },
  612. SalesRegionClick(val) {
  613. this.index = val;
  614. this.SalesRegionShow = true;
  615. },
  616. SalesDepartmentClick(val) {
  617. this.index = val;
  618. this.SalesDepartmentShow = true;
  619. },
  620. StaffClick() {
  621. this.StaffShow = true;
  622. },
  623. StartTimeClick() {
  624. this.StartTimeShow = true;
  625. },
  626. EndTimeClick() {
  627. this.EndTimeShow = true;
  628. },
  629. onSalesRegionConfirm(val) {
  630. this.SalesRegionShow = false;
  631. this.regionCode = val.deptId;
  632. for (var k1 = 0; k1 < this.collectionItemList.length; k1++) {
  633. if (this.collectionItemList[k1].answerType == 'xsb') {
  634. this.collectionItemList[k1].answerName = '';
  635. this.collectionItemList[k1].answerValue = '';
  636. }
  637. if (this.collectionItemList[k1].answerType == 'dq') {
  638. this.collectionItemList[k1].answerName = val.deptCode;
  639. this.collectionItemList[k1].answerValue = val.deptName;
  640. }
  641. if (this.collectionItemList[k1].answerType == 'xsb' && val.deptId != '') {
  642. this.getDeptInfo('dept', 'xsb');
  643. }
  644. }
  645. },
  646. onregionConfirm(val) {
  647. this.RegionShow = false;
  648. this.companyCode = val.deptId;
  649. for (var k1 = 0; k1 < this.collectionItemList.length; k1++) {
  650. if (this.collectionItemList[k1].answerType == 'xsb') {
  651. this.collectionItemList[k1].answerName = '';
  652. this.collectionItemList[k1].answerValue = '';
  653. }
  654. if (this.collectionItemList[k1].answerType == 'xsb') {
  655. this.collectionItemList[k1].answerName = '';
  656. this.collectionItemList[k1].answerValue = '';
  657. }
  658. if (this.collectionItemList[k1].answerType == 'gs') {
  659. this.collectionItemList[k1].answerName = val.deptCode;
  660. this.collectionItemList[k1].answerValue = val.deptName;
  661. }
  662. if (this.collectionItemList[k1].answerType == 'dq') {
  663. this.getDeptInfo('dept', 'dq');
  664. }
  665. }
  666. },
  667. onSalesDepartmentConfirm(val) {
  668. this.SalesDepartmentShow = false;
  669. for (var k1 = 0; k1 < this.collectionItemList.length; k1++) {
  670. if (this.collectionItemList[k1].answerType == 'xsb') {
  671. this.collectionItemList[k1].answerName = val.deptCode;
  672. this.collectionItemList[k1].answerValue = val.deptName;
  673. }
  674. }
  675. },
  676. onStartTimeConfirm(val) {
  677. this.formData.startTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
  678. this.StartTimeShow = false;
  679. this.endminDate = new Date(val);
  680. this.endmaxDate = new Date(this.GetPreMonthDay(this.formData.startTime, -2, 'end'));
  681. if (
  682. new Date(this.formData.startTime).getTime() > new Date(this.formData.endTime).getTime() ||
  683. new Date(this.endmaxDate).getTime() < new Date(this.formData.endTime).getTime()
  684. ) {
  685. this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
  686. this.endcurrentDate = this.GetPreMonthDay(this.formData.startTime, -2);
  687. }
  688. this.list = [];
  689. this.formData.pageNum = 1;
  690. },
  691. onEndTimeConfirm(val) {
  692. this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}');
  693. this.strtmaxDate = new Date(val);
  694. if (new Date(this.formData.startTime).getTime() > new Date(this.formData.endTime).getTime()) {
  695. this.formData.startTime = this.formData.endTime;
  696. }
  697. this.list = [];
  698. this.formData.pageNum = 1;
  699. this.EndTimeShow = false;
  700. },
  701. },
  702. };
  703. </script>
  704. <style scoped lang="scss">
  705. .componVisitSummary {
  706. .van-f-red {
  707. color: red;
  708. width: 8px;
  709. display: inline-block;
  710. line-height: 26px;
  711. }
  712. .formLabel {
  713. margin: 0 16px;
  714. border-bottom: 1px solid #f1f1f1;
  715. }
  716. .formLabel .van-cell {
  717. padding: 10px 0;
  718. }
  719. .formLabel .van-cell::after {
  720. border: 0;
  721. }
  722. .formLabel .van-field {
  723. border: 1px solid #f1f1f1;
  724. padding: 6px;
  725. width: 100%;
  726. border-radius: 4px;
  727. overflow: hidden;
  728. }
  729. .formLabel .van-field__control {
  730. padding: 0 10px;
  731. }
  732. .formLabel .formLabeltitle {
  733. position: absolute;
  734. top: 8px;
  735. }
  736. .lineGrey {
  737. height: 10px;
  738. width: 100%;
  739. background: #f1f1f1;
  740. }
  741. .z-checkbox .van-radio {
  742. padding: 6px 0;
  743. }
  744. .z-cell .van-cell__title {
  745. font-size: 16px;
  746. }
  747. }
  748. </style>
  749. <style>
  750. .table-headermd {
  751. font-size: 12px;
  752. text-align: center;
  753. position: initial;
  754. width: 98% !important;
  755. margin: 0 auto;
  756. border-right: 0;
  757. }
  758. .table-headermd .el-table__header,
  759. .table-headermd .el-table__body {
  760. width: 100% !important;
  761. }
  762. /*.table-headermd col {width: 6.8rem;}*/
  763. .table-headermd col:nth-child(4) {
  764. width: 5.6rem;
  765. }
  766. .table-headermd col:nth-child(2),
  767. .table-headermd col:nth-child(3) {
  768. width: 4.6rem;
  769. }
  770. .table-headermd .van-cell {
  771. padding: 0 4px;
  772. height: 100%;
  773. }
  774. .table-headermd th.el-table__cell > .cell {
  775. padding: 0 4px;
  776. text-align: center;
  777. }
  778. .table-headermd th.el-table__cell:first-child > .cell {
  779. text-align: left;
  780. }
  781. .table-headermd th.el-table__cell {
  782. background-color: #1989fa;
  783. color: #fff;
  784. }
  785. .table-headermd .el-table__cell {
  786. padding: 4px 0;
  787. }
  788. .table-headermd.el-table .cell {
  789. padding: 0;
  790. }
  791. .table-headermd .tipTitle {
  792. overflow: hidden;
  793. text-overflow: ellipsis;
  794. display: -webkit-box;
  795. -webkit-box-orient: vertical;
  796. -webkit-line-clamp: 2;
  797. }
  798. .table-headermd::before {
  799. height: 0;
  800. }
  801. .xing {
  802. color: red;
  803. padding-left: 4px;
  804. }
  805. .formLabel .van-radio__label,
  806. .formLabel .van-checkbox__label {
  807. font-size: 1.4rem;
  808. }
  809. .table-headermd .cell,
  810. .el-table--border .el-table__cell:first-child .cell {
  811. padding: 0 4px;
  812. }
  813. .van-dialog__confirm,
  814. .van-dialog__confirm:active {
  815. color: #1989fa;
  816. }
  817. .navBarTOP {
  818. position: fixed;
  819. width: 100%;
  820. z-index: 2;
  821. top: 0;
  822. }
  823. .isTableMust {
  824. padding: 4px;
  825. color: #999;
  826. margin: 0;
  827. margin-top: -10px;
  828. }
  829. </style>