weekly.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. <template>
  2. <div>
  3. <!-- 顶部条-->
  4. <div class="navBarTOP">
  5. <van-nav-bar class="navBar" title="填写周报" left-arrow @click-left="onClickLeft">
  6. <template #right>
  7. <span
  8. v-if="temporaryShow != 'N'"
  9. @click="tsContentsFn"
  10. style="
  11. color: white;
  12. background: #74a4d9;
  13. display: block;
  14. padding: 6px 10px;
  15. border-radius: 6px;
  16. "
  17. >暂存</span
  18. >
  19. </template>
  20. </van-nav-bar>
  21. </div>
  22. <div class="lineGrey"></div>
  23. <!-- 主体内容-->
  24. <div class="container linepAdd">
  25. <div class="lineGrey"></div>
  26. <div class="lineGrey"></div>
  27. <div class="lineGrey"></div>
  28. <div style="height: 8px"></div>
  29. <van-collapse v-model="activeNames" style="margin-top: -3px">
  30. <template v-if="!YFQuota">
  31. <!-- YFQuota:应用服务平台 不显示各项指标 -->
  32. <van-collapse-item title="业绩目标SAP(千元)" name="1" v-if="type != 3 && type != 4">
  33. <performanceSAP :reportTargetAll="reportTargetAll" :JZQuota="JZQuota"></performanceSAP>
  34. </van-collapse-item>
  35. <van-collapse-item title="质感外墙SAP(千元)" name="4">
  36. <zhiganwaiqiangSAP :reportTargetAll="reportTargetAll"></zhiganwaiqiangSAP>
  37. </van-collapse-item>
  38. <van-collapse-item v-if="powerGrade != 1" name="3" title="魔术漆SAP(千元)">
  39. <moshouqiSAP :reportTargetAll="reportTargetAll"></moshouqiSAP>
  40. </van-collapse-item>
  41. <van-collapse-item v-if="powerGrade != 1" name="28" title="防水+背胶SAP(千元)">
  42. <fangshuiSAP :reportTargetAll="reportTargetAll"></fangshuiSAP>
  43. </van-collapse-item>
  44. <van-collapse-item
  45. v-if="powerGrade != 1 && !JZQuota && !GZdata"
  46. name="27"
  47. title="内墙中高端SAP(千元)">
  48. <neiqiangzhonggaoduanSAP :reportTargetAll="reportTargetAll"></neiqiangzhonggaoduanSAP>
  49. </van-collapse-item>
  50. <!-- 内外墙平涂SAP -->
  51. <van-collapse-item v-if="powerGrade != 1" name="2" title="内外墙平涂SAP(千元)">
  52. <neiwaiqiangpingtu :reportTargetAll="reportTargetAll"></neiwaiqiangpingtu>
  53. </van-collapse-item>
  54. <van-collapse-item
  55. v-if="[1, 4, 5].indexOf(powerGrade) !== -1"
  56. name="11"
  57. title="专业时时丽SAP(千元)">
  58. <ZYSAP :reportTargetAll="reportTargetAll"></ZYSAP>
  59. </van-collapse-item>
  60. <van-collapse-item
  61. v-if="[1, 4, 5].indexOf(powerGrade) !== -1"
  62. name="29"
  63. :title="'瓷砖胶SAP(千元)'">
  64. <cizhuanjiaoSAP :reportTargetAll="reportTargetAll"></cizhuanjiaoSAP>
  65. </van-collapse-item>
  66. <van-collapse-item title="建店布机" name="2">
  67. <createStoreBJ :reportTargetAll="reportTargetAll"></createStoreBJ>
  68. </van-collapse-item>
  69. <van-collapse-item name="16" title="专业时时丽分销店下单">
  70. <ZYPlaceOrder :reportTargetAll="reportTargetAll"></ZYPlaceOrder>
  71. </van-collapse-item>
  72. <van-collapse-item name="17" title="超好贴分销店下单">
  73. <veryGoodPlaceOrder :reportTargetAll="reportTargetAll"></veryGoodPlaceOrder>
  74. </van-collapse-item>
  75. </template>
  76. <van-collapse-item title="上周工作成果" name="8">
  77. <div style="margin-top: -10px">
  78. <div v-for="(item2, index2) in reportContentsList2" :key="index2">
  79. <div v-if="index2 < 7">
  80. <p class="texttitle">
  81. <span class="opint"></span
  82. ><span v-if="!reportTarget.hideWeekDate">{{
  83. weeklyTimeDivision(item2.contentTime, 0)
  84. }}</span
  85. ><span>{{ weeklyTimeDivision(item2.contentTime, 1) }}</span
  86. ><span v-if="index2 < 5" class="colorRed">(必填)</span>
  87. </p>
  88. <p>
  89. <span class="blackcolor">上午:</span
  90. >{{ reportContentsList3[index2].weekContentAm }}
  91. </p>
  92. <p>
  93. <span class="blackcolor">下午:</span
  94. >{{ reportContentsList3[index2].weekContentPm }}
  95. </p>
  96. <p class="texttitle texttitle2">实际工作进度</p>
  97. <p>
  98. <van-field
  99. class="weeklyinput"
  100. v-model="item2.weekContentAm"
  101. label="上午:"
  102. placeholder="请输入" />
  103. <van-field
  104. class="weeklyinput"
  105. v-model="item2.weekContentPm"
  106. label="下午:"
  107. placeholder="请输入" />
  108. </p>
  109. </div>
  110. <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作重点</p>
  111. <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer1">
  112. <van-field
  113. v-model="reportContentsList3[index2].weekContentSummary"
  114. rows="4"
  115. autosize
  116. readonly
  117. type="textarea" />
  118. </div>
  119. <p v-if="index2 == 7" class="texttitle">
  120. <span class="opint"></span>上周工作成果<span class="colorRed">(必填)</span>
  121. </p>
  122. <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
  123. <van-field
  124. v-model="item2.weekContentSummary"
  125. rows="4"
  126. autosize
  127. maxlength="800"
  128. show-word-limit
  129. type="textarea" />
  130. </div>
  131. </div>
  132. </div>
  133. </van-collapse-item>
  134. <van-collapse-item title="本周工作规划" name="9">
  135. <div style="margin-top: -10px">
  136. <div v-for="(item, index) in reportContentsList1" :key="index">
  137. <p class="texttitle" v-if="index < 7">
  138. <span class="opint"></span
  139. ><span v-if="!reportTarget.hideWeekDate">{{
  140. weeklyTimeDivision(item.contentTime, 0)
  141. }}</span
  142. ><span>{{ weeklyTimeDivision(item.contentTime, 1) }}</span
  143. ><span v-if="index < 5" class="colorRed">(必填)</span>
  144. </p>
  145. <p v-if="index < 7">
  146. <van-field
  147. class="weeklyinput"
  148. label="上午:"
  149. placeholder="请输入"
  150. v-model="item.weekContentAm" />
  151. <van-field
  152. class="weeklyinput"
  153. label="下午:"
  154. placeholder="请输入"
  155. v-model="item.weekContentPm" />
  156. </p>
  157. <p v-if="index == 7" class="texttitle">
  158. <span class="opint"></span>本周工作重点<span class="colorRed">(必填)</span>
  159. </p>
  160. <div v-if="index == 7" style="padding: 10px 0" class="contentContainer">
  161. <van-field
  162. v-model="item.weekContentSummary"
  163. rows="4"
  164. autosize
  165. maxlength="800"
  166. show-word-limit
  167. type="textarea" />
  168. </div>
  169. </div>
  170. </div>
  171. </van-collapse-item>
  172. </van-collapse>
  173. <br />
  174. <br />
  175. <van-button type="info" size="small" plain class="Btn1" @click="submint">提交周报</van-button>
  176. </div>
  177. <br />
  178. <br />
  179. <br />
  180. </div>
  181. </template>
  182. <script>
  183. import { updateReport, getReportInfo, getDetailById, tsContents } from '@/api/index';
  184. import createStoreBJ from '@/views/componentsTarget/createStoreBJ';
  185. import ZYPlaceOrder from '@/views/componentsTarget/ZYPlaceOrder';
  186. import performanceSAP from '@/views/componentsTarget/performanceSAP';
  187. import ZYSAP from '@/views/componentsTarget/ZYSAP';
  188. import veryGoodPlaceOrder from '@/views/componentsTarget/veryGoodPlaceOrder';
  189. import neiwaiqiangpingtu from '@/views/componentsTarget/neiwaiqiangpingtu';
  190. import zhiganwaiqiangSAP from '@/views/componentsTarget/zhiganwaiqiangSAP';
  191. import cizhuanjiaoSAP from '@/views/componentsTarget/cizhuanjiaoSAP';
  192. import neiqiangzhonggaoduanSAP from '@/views/componentsTarget/neiqiangzhonggaoduanSAP';
  193. import moshouqiSAP from '@/views/componentsTarget/moshouqiSAP';
  194. import fangshuiSAP from '@/views/componentsTarget/fangshuiSAP';
  195. export default {
  196. name: 'home',
  197. components: {
  198. createStoreBJ,
  199. ZYPlaceOrder,
  200. performanceSAP,
  201. ZYSAP,
  202. veryGoodPlaceOrder,
  203. neiwaiqiangpingtu,
  204. zhiganwaiqiangSAP,
  205. cizhuanjiaoSAP,
  206. neiqiangzhonggaoduanSAP,
  207. moshouqiSAP,
  208. fangshuiSAP,
  209. },
  210. data() {
  211. return {
  212. activeNames: [
  213. '1',
  214. '2',
  215. '3',
  216. '4',
  217. '5',
  218. '6',
  219. '7',
  220. '8',
  221. '9',
  222. '11',
  223. '12',
  224. '16',
  225. '17',
  226. '27',
  227. '28',
  228. '29',
  229. ],
  230. powerGrade: '',
  231. value: '2',
  232. timeList: [],
  233. isclick: true,
  234. reportTargetAll: {},
  235. reportTarget: {},
  236. reportContentsList1: [],
  237. reportContentsList2: [],
  238. reportContentsList3: [],
  239. temporaryShow: '',
  240. type: '-1',
  241. JZQuota: false,
  242. YFQuota: false, //应用服务
  243. GZdata: false,
  244. };
  245. },
  246. created() {
  247. this.temporaryShow = this.$route.query.temporaryShow;
  248. if (this.$route.query.reportId != undefined) {
  249. this.getDetailById();
  250. } else {
  251. this.getReportInfo();
  252. }
  253. this.powerGrade = localStorage.getItem('powerGrade');
  254. },
  255. watch: {
  256. $route(to, from) {
  257. this.temporaryShow = this.$route.query.temporaryShow;
  258. this.powerGrade = localStorage.getItem('powerGrade');
  259. if (to.path == '/weekly') {
  260. if (this.$route.query.reportId != undefined) {
  261. this.getDetailById();
  262. } else {
  263. this.getReportInfo();
  264. }
  265. }
  266. },
  267. },
  268. methods: {
  269. getDetailById() {
  270. let loading1 = this.$toast.loading({
  271. duration: 0,
  272. message: '加载中...',
  273. forbidClick: true,
  274. });
  275. getDetailById({ reportId: this.$route.query.reportId }).then((res) => {
  276. loading1.clear();
  277. if (res.code == 200) {
  278. this.YFQuota = res.data.postType == 'YF' ? true : false;
  279. this.JZQuota = false;
  280. if (res.data.postType == 'JZ') {
  281. this.JZQuota = true;
  282. }
  283. if (res.data.postType == 'GZ') {
  284. this.GZdata = true;
  285. } else {
  286. this.GZdata = false;
  287. }
  288. var dayTime = res.data.date;
  289. this.type = res.data.userType;
  290. this.timeList = this.parseTimeParagraph(
  291. dayTime.slice(0, 4) + '-' + dayTime.slice(4, 6) + '-' + dayTime.slice(6, 8)
  292. );
  293. if (res.data.status != '0' && res.data.status != '2') {
  294. this.$dialog
  295. .alert({
  296. title: '系统提示',
  297. message: '周报已提交或过期',
  298. })
  299. .then(() => {
  300. window.location.replace(window.location.origin + '/mobile/home');
  301. });
  302. } else {
  303. this.reportTargetAll = res.data.reportTargetAll;
  304. this.reportTarget = res.data;
  305. this.reportContents = res.data.reportContents;
  306. var reportContentsList1 = [];
  307. var reportContentsList2 = [];
  308. var reportContentsList3 = [];
  309. if (res.data.reportContents == null) {
  310. res.data.reportContents = [];
  311. }
  312. var reportContentsdata = res.data.reportContents;
  313. // var reportContentsdata=[]
  314. for (var i = 0; i < reportContentsdata.length; i++) {
  315. if (reportContentsdata[i].type == '1') {
  316. reportContentsList1.push(reportContentsdata[i]);
  317. }
  318. if (reportContentsdata[i].type == '2') {
  319. reportContentsList2.push(reportContentsdata[i]);
  320. }
  321. if (reportContentsdata[i].type == '3') {
  322. reportContentsList3.push(reportContentsdata[i]);
  323. }
  324. }
  325. if (reportContentsList3.length < 7) {
  326. var lentype3 = 7 - reportContentsList3.length;
  327. for (var x1 = 0; x1 < lentype3; x1++) {
  328. reportContentsList3.push({
  329. contentTime: this.timeList[7 + x1],
  330. weekContentAm: '',
  331. weekContentPm: '',
  332. type: 3,
  333. });
  334. }
  335. }
  336. if (reportContentsList2.length < 7) {
  337. var lentype2 = 7 - reportContentsList2.length;
  338. for (var x2 = 0; x2 < lentype2; x2++) {
  339. reportContentsList2.push({
  340. contentTime: this.timeList[0 + x2],
  341. weekContentAm: '',
  342. weekContentPm: '',
  343. type: 2,
  344. });
  345. }
  346. }
  347. var ln1 = reportContentsList1.length;
  348. var ln2 = reportContentsList2.length;
  349. if (reportContentsList2.length > reportContentsList1.length) {
  350. var len = ln2 - ln1;
  351. for (var x = 0; x < len; x++) {
  352. reportContentsList1.push({
  353. contentTime: '',
  354. weekContentAm: '',
  355. weekContentPm: '',
  356. type: 1,
  357. });
  358. }
  359. }
  360. if (reportContentsList2.length == 7) {
  361. reportContentsList2.push({
  362. contentTime: this.parseTime(new Date(), '{y}-{m}-{d}'),
  363. weekContentAm: '',
  364. weekContentPm: '',
  365. weekContentSummary: null,
  366. type: 2,
  367. });
  368. }
  369. if (reportContentsList1.length == 7) {
  370. reportContentsList1.push({
  371. contentTime: this.parseTime(new Date(), '{y}-{m}-{d}'),
  372. weekContentAm: '',
  373. weekContentPm: '',
  374. weekContentSummary: null,
  375. type: 1,
  376. });
  377. }
  378. if (reportContentsList3.length == 7) {
  379. reportContentsList3.push({
  380. contentTime: this.parseTime(new Date(), '{y}-{m}-{d}'),
  381. weekContentAm: '',
  382. weekContentPm: '',
  383. weekContentSummary: null,
  384. type: 3,
  385. });
  386. }
  387. this.reportContentsList1 = reportContentsList3; //1
  388. this.reportContentsList2 = reportContentsList2; //2
  389. this.reportContentsList3 = reportContentsList1; //3
  390. }
  391. } else {
  392. this.$toast(res.msg);
  393. }
  394. });
  395. },
  396. tsContentsFn() {
  397. let loading1 = this.$toast.loading({
  398. duration: 0,
  399. message: '数据提交中...',
  400. forbidClick: true,
  401. });
  402. if (this.isclick) {
  403. this.reportTarget.reportContents = [];
  404. this.reportTarget.reportContents = this.reportContentsList2
  405. .concat(this.reportContentsList1)
  406. .concat(this.reportContentsList3);
  407. this.reportTarget.status = '1';
  408. console.log(this.reportContentsList1);
  409. console.log(this.reportContentsList2);
  410. console.log(this.reportContentsList3);
  411. console.log(this.reportTarget.reportContents);
  412. this.isclick = false;
  413. tsContents(this.reportTarget).then((res) => {
  414. loading1.clear();
  415. this.isclick = true;
  416. if (res.code == 200) {
  417. this.$dialog
  418. .alert({
  419. title: '系统提示',
  420. message: '暂存成功',
  421. })
  422. .then(() => {
  423. // if(this.$route.query.reportId!=undefined){
  424. // window.location.replace(window.location.origin+"/mobile/myHistoricalDaily")
  425. // }else{
  426. // window.location.replace(window.location.origin+"/mobile/home")
  427. // }
  428. });
  429. } else {
  430. this.$toast.fail(res.msg);
  431. }
  432. });
  433. }
  434. },
  435. // 提交日报
  436. submint() {
  437. let loading1 = this.$toast.loading({
  438. duration: 0,
  439. message: '数据提交中...',
  440. forbidClick: true,
  441. });
  442. if (this.isclick) {
  443. this.reportTarget.reportContents = [];
  444. for (var j = 0; j < 5; j++) {
  445. if (
  446. this.reportContentsList1[j].weekContentAm.trim() == '' ||
  447. this.reportContentsList1[j].weekContentPm.trim() == ''
  448. ) {
  449. this.$toast('请完善本周规划内容!');
  450. return false;
  451. }
  452. }
  453. for (var x = 0; x < 5; x++) {
  454. if (
  455. this.reportContentsList2[x].weekContentAm.trim() == '' ||
  456. this.reportContentsList2[x].weekContentPm.trim() == ''
  457. ) {
  458. this.$toast('请完善上周周报内容!');
  459. return false;
  460. }
  461. }
  462. if (this.reportContentsList2[7].weekContentSummary.trim() == '') {
  463. this.$toast('请完善上周工作成果!');
  464. return false;
  465. }
  466. if (this.reportContentsList1[7].weekContentSummary.trim() == '') {
  467. this.$toast('请完善本周工作重点!');
  468. return false;
  469. }
  470. if (this.reportContentsList1[7].weekContentSummary.length > 800) {
  471. this.$toast('上周工作重点超过800字');
  472. return false;
  473. }
  474. if (this.reportContentsList2[7].weekContentSummary.length > 800) {
  475. this.$toast('上周工作成果超过800字!');
  476. return false;
  477. }
  478. this.reportTarget.reportContents = this.reportContentsList2
  479. .concat(this.reportContentsList1)
  480. .concat(this.reportTarget.reportContents);
  481. this.reportTarget.status = '1';
  482. this.isclick = false;
  483. updateReport(this.reportTarget).then((res) => {
  484. loading1.clear();
  485. this.isclick = true;
  486. if (res.code == 200) {
  487. this.$dialog
  488. .alert({
  489. title: '系统提示',
  490. message: '提交成功',
  491. })
  492. .then(() => {
  493. if (this.$route.query.reportId != undefined) {
  494. window.location.replace(window.location.origin + '/mobile/myHistoricalDaily');
  495. } else {
  496. this.onClickLeft();
  497. // window.location.replace(window.location.origin + '/mobile/home');
  498. }
  499. });
  500. } else {
  501. this.$toast.fail(res.msg);
  502. }
  503. });
  504. }
  505. },
  506. getReportInfo() {
  507. let loading1 = this.$toast.loading({
  508. duration: 0,
  509. message: '加载中...',
  510. forbidClick: true,
  511. });
  512. getReportInfo({ isContent: true }).then((res) => {
  513. loading1.clear();
  514. localStorage.setItem('powerGrade', res.data.positionId);
  515. localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
  516. this.type = res.data.userType;
  517. var dayTime = res.data.date;
  518. this.YFQuota = res.data.postType == 'YF' ? true : false;
  519. this.timeList = this.parseTimeParagraph(
  520. dayTime.slice(0, 4) + '-' + dayTime.slice(4, 6) + '-' + dayTime.slice(6, 8)
  521. );
  522. this.powerGrade = res.data.positionId;
  523. this.showButton = res.data.showButton;
  524. this.reportTargetAll = res.data.reportTargetAll;
  525. this.reportTarget = res.data;
  526. if (res.data.reportContents == null) {
  527. res.data.reportContents = [];
  528. }
  529. var reportContentsList1 = [];
  530. var reportContentsList2 = [];
  531. var reportContentsList3 = [];
  532. if (res.data.reportContents.length == '0') {
  533. for (var i = 0; i < 7; i++) {
  534. reportContentsList1.push({
  535. weekContentAm: '',
  536. weekContentPm: '',
  537. contentTime: this.timeList[i + 7],
  538. weekContentSummary: null,
  539. type: 3,
  540. });
  541. reportContentsList3.push({
  542. weekContentAm: '',
  543. weekContentPm: '',
  544. contentTime: this.timeList[i],
  545. weekContentSummary: null,
  546. type: 1,
  547. });
  548. reportContentsList2.push({
  549. weekContentAm: '',
  550. weekContentPm: '',
  551. contentTime: this.timeList[i],
  552. weekContentSummary: null,
  553. type: 2,
  554. });
  555. }
  556. reportContentsList1.push({
  557. weekContentAm: '',
  558. weekContentPm: '',
  559. contentTime: this.parseTime(new Date(), '{y}-{m}-{d}'),
  560. weekContentSummary: null,
  561. type: 3,
  562. });
  563. reportContentsList2.push({
  564. weekContentAm: '',
  565. weekContentPm: '',
  566. contentTime: this.parseTime(new Date(), '{y}-{m}-{d}'),
  567. weekContentSummary: null,
  568. type: 2,
  569. });
  570. reportContentsList3.push({
  571. weekContentAm: '',
  572. weekContentPm: '',
  573. contentTime: this.parseTime(new Date(), '{y}-{m}-{d}'),
  574. weekContentSummary: null,
  575. type: 1,
  576. });
  577. this.reportContentsList2 = reportContentsList2;
  578. this.reportContentsList1 = reportContentsList1;
  579. this.reportContentsList3 = reportContentsList3;
  580. if (res.data.reportContents.length == '0') {
  581. this.reportContentsList3 = reportContentsList3;
  582. } else {
  583. var reportContentsLength = res.data.reportContents.length;
  584. if (reportContentsLength < 7) {
  585. var reportContentsListList = res.data.reportContents;
  586. for (var p = 0; p < 7 - reportContentsLength; p++) {
  587. reportContentsListList.push(reportContentsList3[p]);
  588. }
  589. this.reportContentsList3 = reportContentsListList;
  590. } else {
  591. this.reportContentsList3 = res.data.reportContents;
  592. }
  593. }
  594. } else {
  595. var reportContentsdata = res.data.reportContents;
  596. for (var i = 0; i < reportContentsdata.length; i++) {
  597. if (reportContentsdata[i].type == '1') {
  598. reportContentsList1.push(reportContentsdata[i]);
  599. }
  600. if (reportContentsdata[i].type == '2') {
  601. reportContentsList2.push(reportContentsdata[i]);
  602. }
  603. if (reportContentsdata[i].type == '3') {
  604. reportContentsList3.push(reportContentsdata[i]);
  605. }
  606. }
  607. if (reportContentsList3.length < 7) {
  608. var lentype3 = 7 - reportContentsList3.length;
  609. for (var x1 = 0; x1 < lentype3; x1++) {
  610. reportContentsList3.push({
  611. contentTime: this.timeList[7 + x1],
  612. weekContentAm: '',
  613. weekContentPm: '',
  614. weekContentSummary: null,
  615. type: 3,
  616. });
  617. }
  618. }
  619. if (reportContentsList2.length < 7) {
  620. var lentype2 = 7 - reportContentsList2.length;
  621. for (var x2 = 0; x2 < lentype2; x2++) {
  622. reportContentsList2.push({
  623. contentTime: this.timeList[0 + x2],
  624. weekContentAm: '',
  625. weekContentPm: '',
  626. weekContentSummary: null,
  627. type: 2,
  628. });
  629. }
  630. }
  631. if (reportContentsList2.length == 7) {
  632. reportContentsList2.push({
  633. contentTime: this.parseTime(new Date(), '{y}-{m}-{d}'),
  634. weekContentAm: '',
  635. weekContentPm: '',
  636. weekContentSummary: null,
  637. type: 2,
  638. });
  639. }
  640. if (reportContentsList3.length == 7) {
  641. reportContentsList3.push({
  642. contentTime: this.parseTime(new Date(), '{y}-{m}-{d}'),
  643. weekContentAm: '',
  644. weekContentPm: '',
  645. weekContentSummary: null,
  646. type: 3,
  647. });
  648. }
  649. var ln1 = reportContentsList1.length;
  650. var ln2 = reportContentsList2.length;
  651. if (reportContentsList2.length > reportContentsList1.length) {
  652. var len = ln2 - ln1;
  653. for (var x = 0; x < len; x++) {
  654. reportContentsList1.push({
  655. contentTime: '',
  656. weekContentAm: '',
  657. weekContentPm: '',
  658. weekContentSummary: null,
  659. type: 1,
  660. });
  661. }
  662. }
  663. this.reportContentsList1 = reportContentsList3; //1
  664. this.reportContentsList2 = reportContentsList2; //2
  665. this.reportContentsList3 = reportContentsList1; //3
  666. }
  667. console.log(this.reportContentsList2);
  668. console.log(this.reportContentsList1);
  669. console.log(this.reportContentsList3);
  670. });
  671. },
  672. onClickLeft() {
  673. this.$router.go(-1);
  674. },
  675. },
  676. };
  677. </script>
  678. <style scoped>
  679. .container {
  680. margin: 10px;
  681. }
  682. .container .van-collapse-item {
  683. margin-bottom: 10px;
  684. border-radius: 6px;
  685. overflow: hidden;
  686. }
  687. .linepAdd p {
  688. margin: 10px 0 0 0;
  689. font-size: 14px;
  690. color: #666;
  691. }
  692. .linepAdd .texttitle {
  693. color: #0057ba;
  694. position: relative;
  695. padding-left: 10px;
  696. }
  697. .linepAdd .texttitle2 {
  698. padding-left: 0;
  699. }
  700. .linepAdd .texttitle .opint {
  701. position: absolute;
  702. left: 0px;
  703. top: 6px;
  704. margin-right: 6px;
  705. display: inline-block;
  706. width: 6px;
  707. height: 6px;
  708. border-radius: 10px;
  709. background-color: #004d8c;
  710. }
  711. .leftTitle {
  712. background-color: #74a4d9;
  713. color: #fff;
  714. display: inline-block;
  715. padding: 0 4px;
  716. border-radius: 2px;
  717. }
  718. .rightTitle {
  719. background-color: #e7b4bb;
  720. color: #fff;
  721. display: inline-block;
  722. padding: 0 4px;
  723. border-radius: 2px;
  724. }
  725. </style>
  726. <style>
  727. .homeTitle .van-cell__title {
  728. color: #333;
  729. font-size: 14px;
  730. font-weight: bold;
  731. padding-left: 4px;
  732. line-height: 32px;
  733. }
  734. .linepAdd .van-cell__title {
  735. color: #1e5398;
  736. font-weight: 500;
  737. }
  738. .Btn1 {
  739. display: block;
  740. width: 100%;
  741. border-radius: 6px;
  742. color: #fff !important;
  743. background-color: #0057ba;
  744. border: 1px solid #0057ba;
  745. height: 44px;
  746. }
  747. .linepAdd .contentContainer {
  748. background-color: white;
  749. border-radius: 8px;
  750. padding: 10px 16px;
  751. margin-bottom: 10px;
  752. }
  753. .linepAdd .contentContainer .contentContainerTitle {
  754. color: #222;
  755. }
  756. .linepAdd .contentContainer .contentContainerTitle span {
  757. font-size: 12px;
  758. color: #666;
  759. }
  760. .linepAdd .contentContainer .van-field__control {
  761. background-color: #f1f1f1;
  762. padding: 10px;
  763. border-radius: 8px;
  764. }
  765. .linepAdd .contentContainer .van-cell {
  766. padding: 0;
  767. }
  768. .weeklyinput {
  769. padding: 0 0 10px 0;
  770. }
  771. .weeklyinput .van-field__control {
  772. background-color: #f8f8f8;
  773. padding: 4px 10px;
  774. border-radius: 5px;
  775. }
  776. .weeklyinput .van-field__label {
  777. width: 40px;
  778. margin: 0;
  779. color: #333;
  780. }
  781. .blackcolor {
  782. color: #333;
  783. }
  784. .colorRed {
  785. color: red;
  786. }
  787. .van-dialog__confirm,
  788. .van-dialog__confirm:active {
  789. color: #0057ba;
  790. }
  791. </style>