detailItem.vue 28 KB

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