weeklyApprovalDetils.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. <template>
  2. <div>
  3. <!-- 顶部条-->
  4. <div class="navBarTOP">
  5. <van-nav-bar class="navBar" title="周报详情" left-arrow @click-left="onClickLeft" />
  6. </div>
  7. <!-- 主体内容-->
  8. <div class="container linep">
  9. <div class="lineGrey"></div>
  10. <div class="lineGrey"></div>
  11. <div class="lineGrey"></div>
  12. <div style="height: 4px"></div>
  13. <van-collapse v-model="activeNames">
  14. <template v-if="!YFQuota">
  15. <!-- YFQuota:应用服务平台 不显示各项指标 -->
  16. <van-collapse-item title="业绩目标SAP(千元)" name="1" v-if="type != 3 && type != 4">
  17. <performanceSAP :reportTargetAll="reportTargetAll" :JZQuota="JZQuota"></performanceSAP>
  18. </van-collapse-item>
  19. <van-collapse-item title="质感外墙SAP(千元)" name="4">
  20. <zhiganwaiqiangSAP :reportTargetAll="reportTargetAll"></zhiganwaiqiangSAP>
  21. </van-collapse-item>
  22. <van-collapse-item v-if="powerGrade != 1" name="3" title="魔术漆SAP(千元)">
  23. <moshouqiSAP :reportTargetAll="reportTargetAll"></moshouqiSAP>
  24. </van-collapse-item>
  25. <van-collapse-item v-if="powerGrade != 1" name="28" title="防水+背胶SAP(千元)">
  26. <fangshuiSAP :reportTargetAll="reportTargetAll"></fangshuiSAP>
  27. </van-collapse-item>
  28. <van-collapse-item
  29. v-if="powerGrade != 1 && !JZQuota && !GZdata"
  30. name="27"
  31. title="内墙中高端SAP(千元)">
  32. <neiqiangzhonggaoduanSAP :reportTargetAll="reportTargetAll"></neiqiangzhonggaoduanSAP>
  33. </van-collapse-item>
  34. <!-- 内外墙平涂SAP -->
  35. <van-collapse-item v-if="powerGrade != 1" name="2" title="内外墙平涂SAP(千元)">
  36. <neiwaiqiangpingtu :reportTargetAll="reportTargetAll"></neiwaiqiangpingtu>
  37. </van-collapse-item>
  38. <van-collapse-item
  39. v-if="[1, 4, 5].indexOf(powerGrade) !== -1"
  40. name="11"
  41. title="专业时时丽SAP(千元)">
  42. <ZYSAP :reportTargetAll="reportTargetAll"></ZYSAP>
  43. </van-collapse-item>
  44. <van-collapse-item
  45. v-if="[1, 4, 5].indexOf(powerGrade) !== -1"
  46. name="29"
  47. :title="'瓷砖胶SAP(千元)'">
  48. <cizhuanjiaoSAP :reportTargetAll="reportTargetAll"></cizhuanjiaoSAP>
  49. </van-collapse-item>
  50. <van-collapse-item title="建店布机" name="2">
  51. <createStoreBJ :reportTargetAll="reportTargetAll"></createStoreBJ>
  52. </van-collapse-item>
  53. <van-collapse-item name="16" title="专业时时丽分销店下单">
  54. <ZYPlaceOrder :reportTargetAll="reportTargetAll"></ZYPlaceOrder>
  55. </van-collapse-item>
  56. <van-collapse-item name="17" title="超好贴分销店下单">
  57. <veryGoodPlaceOrder :reportTargetAll="reportTargetAll"></veryGoodPlaceOrder>
  58. </van-collapse-item>
  59. </template>
  60. <van-collapse-item title="上周工作成果" name="8">
  61. <div style="margin-top: -10px">
  62. <div v-for="(item2, index2) in reportContentsList2" :key="index2">
  63. <div v-if="index2 < 7">
  64. <p class="texttitle">
  65. <span class="opint"></span
  66. ><span v-if="!reportTarget.hideWeekDate">{{
  67. weeklyTimeDivision(item2.contentTime, 0)
  68. }}</span
  69. ><span>{{ weeklyTimeDivision(item2.contentTime, 1) }}</span>
  70. </p>
  71. <p>
  72. <span class="colorbalck">上午:</span
  73. >{{ reportContentsList1[index2].weekContentAm }}
  74. </p>
  75. <p>
  76. <span class="colorbalck">下午:</span
  77. >{{ reportContentsList1[index2].weekContentPm }}
  78. </p>
  79. <p class="texttitle texttitle2">实际工作进度</p>
  80. <p><span class="colorbalck">上午:</span>{{ item2.weekContentAm }}</p>
  81. <p><span class="colorbalck">下午:</span>{{ item2.weekContentPm }}</p>
  82. </div>
  83. <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作重点</p>
  84. <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
  85. <van-field
  86. v-model="reportContentsList1[index2].weekContentSummary"
  87. rows="4"
  88. autosize
  89. readonly
  90. type="textarea" />
  91. </div>
  92. <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作成果</p>
  93. <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
  94. <van-field
  95. v-model="item2.weekContentSummary"
  96. rows="4"
  97. autosize
  98. readonly
  99. type="textarea" />
  100. </div>
  101. </div>
  102. </div>
  103. </van-collapse-item>
  104. <van-collapse-item title="本周工作规划" name="9">
  105. <div style="margin-top: -10px">
  106. <div v-for="(item, index) in reportContentsList3" :key="index">
  107. <p v-if="index < 7" class="texttitle">
  108. <span class="opint"></span
  109. ><span v-if="!reportTarget.hideWeekDate">{{
  110. weeklyTimeDivision(item.contentTime, 0)
  111. }}</span
  112. ><span>{{ weeklyTimeDivision(item.contentTime, 1) }}</span>
  113. </p>
  114. <p v-if="index < 7"><span class="colorbalck">上午:</span>{{ item.weekContentAm }}</p>
  115. <p v-if="index < 7"><span class="colorbalck">下午:</span>{{ item.weekContentPm }}</p>
  116. <p v-if="index == 7" class="texttitle"><span class="opint"></span>本周工作重点</p>
  117. <div v-if="index == 7" style="padding: 10px 0" class="contentContainer">
  118. <van-field
  119. v-model="item.weekContentSummary"
  120. rows="4"
  121. autosize
  122. readonly
  123. type="textarea" />
  124. </div>
  125. </div>
  126. </div>
  127. </van-collapse-item>
  128. <div
  129. class="contentContainer"
  130. v-if="reportTarget.status > 1 || reportTarget.reportRemarks != null">
  131. <p class="texttitle texttitledaily">
  132. <span class="opint"></span>
  133. <span v-if="reportTarget.status == 1">待审批</span>
  134. <span v-if="reportTarget.status == 3">审批完成</span>
  135. <span v-if="reportTarget.status == 2">退回重写</span>
  136. <span v-if="reportTarget.status == -1">过期未汇报</span>
  137. <span v-if="reportTarget.status > 1"><{{ ptitle }}审批></span>
  138. </p>
  139. <div style="padding: 10px 0" v-if="reportTarget.status > 1">
  140. <van-rate
  141. v-model="reportTarget.number"
  142. :size="25"
  143. color="#ffd21e"
  144. void-icon="star"
  145. void-color="#eee"
  146. readonly />
  147. <span class="rateText">&nbsp;&nbsp;&nbsp;&nbsp;{{ reportTarget.number }}分</span>
  148. </div>
  149. <p class="contentContainerTitle" v-if="reportTarget.status > 1">评语</p>
  150. <div style="padding: 10px 0" v-if="reportTarget.status > 1">
  151. <van-field v-model="successContent" rows="4" autosize readonly type="textarea" />
  152. </div>
  153. </div>
  154. <div
  155. class="contentContainer"
  156. v-if="reportTarget.status > 1 || reportTarget.reportRemarks != null">
  157. <div>
  158. <div v-for="(item, index) in reportTarget.reportRemarks" :key="index">
  159. <p class="contentContainerTitle">
  160. <template v-if="item.deptName">{{ item.deptName }}-</template>{{ item.postName }}-{{
  161. item.nickName
  162. }}点评
  163. </p>
  164. <div style="padding: 10px 0">
  165. <van-field
  166. v-model="item.remarkContent"
  167. rows="4"
  168. autosize
  169. readonly
  170. type="textarea" />
  171. </div>
  172. <!-- <p style="text-align: right">点评时间:{{ item.createTime }}</p> -->
  173. </div>
  174. </div>
  175. </div>
  176. </van-collapse>
  177. </div>
  178. <br />
  179. <div class="lineGrey"></div>
  180. <div class="contentborder" v-if="reportTarget.status == 2">
  181. <van-button type="info" size="small" plain class="Btn1" @click="submint">重新填写</van-button>
  182. </div>
  183. <br /><br />
  184. </div>
  185. </template>
  186. <script>
  187. import history from '@/assets/Icon/history.png';
  188. import { userTodayPlanNum, loginLog, homeImge, getDetailById } from '@/api/index';
  189. import createStoreBJ from '@/views/componentsTarget/createStoreBJ';
  190. import ZYPlaceOrder from '@/views/componentsTarget/ZYPlaceOrder';
  191. import performanceSAP from '@/views/componentsTarget/performanceSAP';
  192. import ZYSAP from '@/views/componentsTarget/ZYSAP';
  193. import veryGoodPlaceOrder from '@/views/componentsTarget/veryGoodPlaceOrder';
  194. import neiwaiqiangpingtu from '@/views/componentsTarget/neiwaiqiangpingtu';
  195. import zhiganwaiqiangSAP from '@/views/componentsTarget/zhiganwaiqiangSAP';
  196. import cizhuanjiaoSAP from '@/views/componentsTarget/cizhuanjiaoSAP';
  197. import neiqiangzhonggaoduanSAP from '@/views/componentsTarget/neiqiangzhonggaoduanSAP';
  198. import moshouqiSAP from '@/views/componentsTarget/moshouqiSAP';
  199. import fangshuiSAP from '@/views/componentsTarget/fangshuiSAP';
  200. export default {
  201. name: 'home',
  202. components: {
  203. createStoreBJ,
  204. ZYPlaceOrder,
  205. performanceSAP,
  206. ZYSAP,
  207. veryGoodPlaceOrder,
  208. neiwaiqiangpingtu,
  209. zhiganwaiqiangSAP,
  210. cizhuanjiaoSAP,
  211. neiqiangzhonggaoduanSAP,
  212. moshouqiSAP,
  213. fangshuiSAP,
  214. },
  215. data() {
  216. return {
  217. show: true,
  218. num: 0,
  219. todayGoal: {},
  220. progressWidth: 0,
  221. history: history,
  222. imgArr: [],
  223. message: '8d98s90d890s8d',
  224. activeNames: [
  225. '1',
  226. '2',
  227. '3',
  228. '4',
  229. '5',
  230. '6',
  231. '7',
  232. '8',
  233. '9',
  234. '11',
  235. '12',
  236. '16',
  237. '17',
  238. '27',
  239. '28',
  240. '29',
  241. ],
  242. powerGrade: '',
  243. value: 2,
  244. timeList: [],
  245. reportTargetAll: {},
  246. Content: '',
  247. number: '',
  248. successContent: '',
  249. reportContentsList1: [],
  250. reportContentsList2: [],
  251. reportContentsList3: [],
  252. updateReport: {},
  253. reportTarget: {},
  254. type: '-1',
  255. ptitle: '',
  256. JZQuota: false,
  257. YFQuota: false, //应用服务
  258. GZdata: false,
  259. };
  260. },
  261. created() {
  262. this.powerGrade = localStorage.getItem('powerGrade');
  263. this.getDetailById();
  264. },
  265. watch: {
  266. $route(to, from) {
  267. this.powerGrade = localStorage.getItem('powerGrade');
  268. if (to.path == '/weeklyApprovalDetils') {
  269. this.getDetailById();
  270. }
  271. },
  272. },
  273. methods: {
  274. submint() {
  275. this.$router.push({
  276. path: '/weekly',
  277. query: { reportId: this.$route.query.reportId, temporaryShow: 'N' },
  278. });
  279. },
  280. getDetailById() {
  281. let loading1 = this.$toast.loading({
  282. duration: 0,
  283. message: '加载中...',
  284. forbidClick: true,
  285. });
  286. getDetailById({ reportId: this.$route.query.reportId }).then((res) => {
  287. loading1.clear();
  288. if (res.code == 200) {
  289. this.YFQuota = res.data.postType == 'YF' ? true : false;
  290. this.JZQuota = false;
  291. if (res.data.postType == 'JZ') {
  292. this.JZQuota = true;
  293. }
  294. if (res.data.postType == 'GZ') {
  295. this.GZdata = true;
  296. } else {
  297. this.GZdata = false;
  298. }
  299. var dayTime = res.data.date;
  300. this.type = res.data.userType;
  301. this.ptitle = res.data.pdeptName + '-' + res.data.ppostName + '-' + res.data.pnickName;
  302. this.timeList = this.parseTimeParagraph(
  303. dayTime.slice(0, 4) + '-' + dayTime.slice(4, 6) + '-' + dayTime.slice(6, 8)
  304. );
  305. this.reportTargetAll = res.data.reportTargetAll;
  306. this.reportTarget = res.data;
  307. this.reportContents = res.data.reportContents;
  308. var reportContentsList1 = [];
  309. var reportContentsList2 = [];
  310. var reportContentsList3 = [];
  311. var reportContentsdata = res.data.reportContents;
  312. if (res.data.status == 3) {
  313. this.successContent = res.data.successContent;
  314. } else {
  315. this.successContent = res.data.failContent;
  316. }
  317. for (var i = 0; i < reportContentsdata.length; i++) {
  318. if (
  319. reportContentsdata[i].type == '1' &&
  320. reportContentsdata[i].contentTime.split(' ')[1] != undefined
  321. ) {
  322. reportContentsList1.push(reportContentsdata[i]);
  323. }
  324. if (
  325. reportContentsdata[i].type == '2' &&
  326. reportContentsdata[i].contentTime.split(' ')[1] != undefined
  327. ) {
  328. reportContentsList2.push(reportContentsdata[i]);
  329. }
  330. if (
  331. reportContentsdata[i].type == '3' &&
  332. reportContentsdata[i].contentTime.split(' ')[1] != undefined
  333. ) {
  334. reportContentsList3.push(reportContentsdata[i]);
  335. }
  336. }
  337. for (var p = 0; p < reportContentsdata.length; p++) {
  338. if (
  339. reportContentsdata[p].type == '2' &&
  340. reportContentsdata[p].contentTime.split(' ')[1] == undefined
  341. ) {
  342. reportContentsList2.push(reportContentsdata[p]);
  343. }
  344. if (
  345. reportContentsdata[p].type == '1' &&
  346. reportContentsdata[p].contentTime.split(' ')[1] == undefined
  347. ) {
  348. reportContentsList1.push(reportContentsdata[p]);
  349. }
  350. if (
  351. reportContentsdata[p].type == '3' &&
  352. reportContentsdata[p].contentTime.split(' ')[1] == undefined
  353. ) {
  354. reportContentsList3.push(reportContentsdata[p]);
  355. }
  356. }
  357. var ln1 = reportContentsList1.length;
  358. var ln2 = reportContentsList2.length;
  359. if (reportContentsList1.length < reportContentsList2.length) {
  360. var len2 = ln2 - ln1;
  361. for (var x = 0; x < len2; x++) {
  362. reportContentsList1.push({
  363. contentTime: '',
  364. weekContentAm: '',
  365. weekContentPm: '',
  366. weekContentSummary: null,
  367. });
  368. }
  369. }
  370. if (reportContentsList1.length == 7) {
  371. reportContentsList1.push({
  372. contentTime: this.parseTime(new Date(), '{y}-{m}-{d}'),
  373. weekContentAm: '',
  374. weekContentPm: '',
  375. weekContentSummary: null,
  376. type: 1,
  377. });
  378. }
  379. if (reportContentsList2.length == 7) {
  380. reportContentsList2.push({
  381. contentTime: this.parseTime(new Date(), '{y}-{m}-{d}'),
  382. weekContentAm: '',
  383. weekContentPm: '',
  384. weekContentSummary: null,
  385. type: 2,
  386. });
  387. }
  388. if (reportContentsList3.length == 7) {
  389. reportContentsList3.push({
  390. contentTime: this.parseTime(new Date(), '{y}-{m}-{d}'),
  391. weekContentAm: '',
  392. weekContentPm: '',
  393. weekContentSummary: null,
  394. type: 3,
  395. });
  396. }
  397. this.reportContentsList1 = reportContentsList1;
  398. this.reportContentsList2 = reportContentsList2;
  399. this.reportContentsList3 = reportContentsList3;
  400. }
  401. });
  402. },
  403. onClickLeft() {
  404. this.$router.go(-1);
  405. },
  406. },
  407. };
  408. </script>
  409. <style scoped>
  410. .container {
  411. margin: 10px;
  412. }
  413. .container .van-collapse-item {
  414. margin-bottom: 10px;
  415. border-radius: 6px;
  416. overflow: hidden;
  417. }
  418. .linep p {
  419. margin: 14px 0 0 0;
  420. font-size: 14px;
  421. color: #666;
  422. padding-left: 6px;
  423. }
  424. .linep .texttitle {
  425. color: #0057ba;
  426. position: relative;
  427. padding-left: 10px;
  428. margin-top: 16px;
  429. }
  430. .linep .texttitledaily {
  431. color: #000;
  432. position: relative;
  433. padding-left: 10px;
  434. }
  435. .linep .texttitle2 {
  436. padding-left: 6px;
  437. }
  438. .linep .texttitle .opint {
  439. position: absolute;
  440. left: 0px;
  441. top: 6px;
  442. margin-right: 6px;
  443. display: inline-block;
  444. width: 6px;
  445. height: 6px;
  446. border-radius: 10px;
  447. background-color: #0057ba;
  448. }
  449. .linep .texttitledaily .opint {
  450. position: absolute;
  451. left: 0px;
  452. top: 6px;
  453. margin-right: 6px;
  454. display: inline-block;
  455. width: 6px;
  456. height: 6px;
  457. border-radius: 10px;
  458. background-color: #0057ba;
  459. }
  460. .leftTitle {
  461. background-color: #a6c9f1;
  462. color: #fff;
  463. display: inline-block;
  464. padding: 0 4px;
  465. border-radius: 2px;
  466. }
  467. .Btn1 {
  468. display: block;
  469. width: 100%;
  470. border-radius: 6px;
  471. color: #fff !important;
  472. background-color: #0057ba;
  473. border: 1px solid #0057ba;
  474. height: 44px;
  475. }
  476. .rightTitle {
  477. background-color: #ffb5bb;
  478. color: #fff;
  479. display: inline-block;
  480. padding: 0 4px;
  481. border-radius: 2px;
  482. }
  483. </style>
  484. <style>
  485. .linep .van-cell__title {
  486. color: #1e5398;
  487. font-weight: 500;
  488. }
  489. .linep .contentContainer {
  490. background-color: white;
  491. border-radius: 8px;
  492. padding: 10px 16px;
  493. margin-bottom: 10px;
  494. }
  495. .linep .contentContainer .contentContainerTitle {
  496. color: #222;
  497. margin-top: 10px;
  498. }
  499. .linep .contentContainer .contentContainerTitle span {
  500. font-size: 12px;
  501. color: #333;
  502. }
  503. .linep .contentContainer .van-field__control {
  504. background-color: #ebf4ff;
  505. padding: 10px;
  506. border-radius: 8px;
  507. }
  508. .linep .contentContainer .van-cell {
  509. padding: 0;
  510. }
  511. </style>