componVisitSummary.vue 25 KB

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