doubleWeekly.vue 31 KB

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