weeklyApprovalDetils.vue 17 KB

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