doubleWeekly.vue 28 KB

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