doubleWeekly.vue 31 KB

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