detailItem.vue 28 KB

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