weeklyHistoricalDetils.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  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 class="lineGrey"></div>
  13. <div class="lineGrey"></div>
  14. <p style="font-size: 16px; margin: 10px 0">{{ title }}</p>
  15. <van-collapse v-model="activeNames">
  16. <template v-if="!YFQuota">
  17. <!-- YFQuota:应用服务平台 不显示各项指标 -->
  18. <template v-if="reportTarget.postType == 'GZ' || reportTarget.postType == 'BMD'">
  19. <!-- 0-历史指标 1-动态指标,String类型 -->
  20. <template v-if="reportTarget.targetType == '1'">
  21. <target :homePageIndicatorDate="homePageIndicatorList"></target>
  22. </template>
  23. <template v-if="reportTarget.targetType == '0'">
  24. <Atarget :reportInfo="reportTarget"></Atarget>
  25. <Btarget :reportInfo="reportTarget"></Btarget>
  26. </template>
  27. </template>
  28. <template v-else>
  29. <Atarget :reportInfo="reportTarget"></Atarget>
  30. <Btarget :reportInfo="reportTarget"></Btarget>
  31. </template>
  32. </template>
  33. <div class="contentContainer" v-if="reportTarget.isHistory == '0'">
  34. <!-- isHistory 是否为历史汇报:0-新汇报 1-历史汇报 -->
  35. <reportCustom
  36. ref="reportCustom"
  37. :disabled="true"
  38. :reportCustomData="reportTarget.customTaskList"></reportCustom>
  39. </div>
  40. <template v-else>
  41. <van-collapse-item title="上周工作成果" name="8">
  42. <div style="margin-top: -10px">
  43. <div v-for="(item2, index2) in reportContentsList2" :key="index2">
  44. <div v-if="index2 < 7">
  45. <p class="texttitle">
  46. <span class="opint"></span
  47. ><span v-if="!reportTarget.hideWeekDate">{{
  48. weeklyTimeDivision(item2.contentTime, 0)
  49. }}</span
  50. ><span>{{ weeklyTimeDivision(item2.contentTime, 1) }}</span>
  51. </p>
  52. <p>
  53. <span class="colorbalck">上午:</span
  54. >{{ reportContentsList1[index2].weekContentAm }}
  55. </p>
  56. <p>
  57. <span class="colorbalck">下午:</span
  58. >{{ reportContentsList1[index2].weekContentPm }}
  59. </p>
  60. <p class="texttitle texttitle2">实际工作进度</p>
  61. <p><span class="colorbalck">上午:</span>{{ item2.weekContentAm }}</p>
  62. <p><span class="colorbalck">下午:</span>{{ item2.weekContentPm }}</p>
  63. </div>
  64. <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作重点</p>
  65. <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
  66. <van-field
  67. v-model="reportContentsList1[index2].weekContentSummary"
  68. rows="4"
  69. autosize
  70. readonly
  71. type="textarea" />
  72. </div>
  73. <p v-if="index2 == 7" class="texttitle"><span class="opint"></span>上周工作成果</p>
  74. <div v-if="index2 == 7" style="padding: 10px 0" class="contentContainer">
  75. <van-field
  76. v-model="item2.weekContentSummary"
  77. rows="4"
  78. autosize
  79. readonly
  80. type="textarea" />
  81. </div>
  82. </div>
  83. </div>
  84. </van-collapse-item>
  85. <van-collapse-item title="本周工作规划" name="9">
  86. <div style="margin-top: -10px">
  87. <div v-for="(item, index) in reportContentsList3" :key="index">
  88. <p v-if="index < 7" class="texttitle">
  89. <span class="opint"></span
  90. ><span v-if="!reportTarget.hideWeekDate">{{
  91. weeklyTimeDivision(item.contentTime, 0)
  92. }}</span
  93. ><span>{{ weeklyTimeDivision(item.contentTime, 1) }}</span>
  94. </p>
  95. <p v-if="index < 7">
  96. <span class="colorbalck">上午:</span>{{ item.weekContentAm }}
  97. </p>
  98. <p v-if="index < 7">
  99. <span class="colorbalck">下午:</span>{{ item.weekContentPm }}
  100. </p>
  101. <p v-if="index == 7" class="texttitle"><span class="opint"></span>本周工作重点</p>
  102. <div v-if="index == 7" style="padding: 10px 0" class="contentContainer">
  103. <van-field
  104. v-model="item.weekContentSummary"
  105. rows="4"
  106. autosize
  107. readonly
  108. type="textarea" />
  109. </div>
  110. </div>
  111. </div>
  112. </van-collapse-item>
  113. </template>
  114. </van-collapse>
  115. <div
  116. class="contentContainer"
  117. v-if="reportTarget.status > 1 || reportTarget.reportRemarks != null">
  118. <p class="texttitle texttitledaily" style="margin-top: 6px">
  119. <span class="opint"></span>
  120. <span v-if="reportTarget.status == 1">待审批</span>
  121. <span v-if="reportTarget.status == 3">审批完成</span>
  122. <span v-if="reportTarget.status == 2">退回重写</span>
  123. <span v-if="reportTarget.status == -1">过期未汇报</span>
  124. <span v-if="reportTarget.status > 1"><{{ ptitle }}审批></span>
  125. </p>
  126. <div style="padding: 10px 0" v-if="reportTarget.status > 1">
  127. <van-rate
  128. v-model="reportTarget.number"
  129. :size="25"
  130. color="#ffd21e"
  131. void-icon="star"
  132. void-color="#eee"
  133. readonly />
  134. <span class="rateText">&nbsp;&nbsp;&nbsp;&nbsp;{{ reportTarget.number }}分</span>
  135. </div>
  136. <div style="padding: 10px 0" v-if="reportTarget.status > 1">
  137. <van-field v-model="successContent" rows="4" autosize readonly type="textarea" />
  138. </div>
  139. </div>
  140. <div class="contentContainer" v-if="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. </p>
  147. <div style="padding: 10px 0">
  148. <van-field v-model="item.remarkContent" rows="4" autosize readonly type="textarea" />
  149. </div>
  150. <!-- <p style="text-align: right">点评时间:{{ item.createTime }}</p> -->
  151. </div>
  152. </div>
  153. </div>
  154. <div class="contentContainer">
  155. <p class="contentContainerTitle">点评</p>
  156. <div style="padding: 10px 0">
  157. <van-field
  158. v-model="managerRemarkContent"
  159. rows="4"
  160. autosize
  161. maxlength="800"
  162. show-word-limit
  163. type="textarea"
  164. :formatter="formatter" />
  165. </div>
  166. </div>
  167. </div>
  168. <div class="lineGrey"></div>
  169. <div class="contentborder">
  170. <van-button type="info" size="small" plain class="Btn1" @click="submint">提交点评</van-button>
  171. </div>
  172. <br /><br />
  173. <!-- <div class="envelopes" @click="openEnterpriseChat" >-->
  174. <!-- <img :src="envelopes">-->
  175. <!-- <p>红包奖励</p>-->
  176. <!-- </div>-->
  177. <br /><br />
  178. <br /><br />
  179. </div>
  180. </template>
  181. <script>
  182. import history from '@/assets/Icon/history.png';
  183. import { loginLog, insertRemark, getDetailById, updateReport } from '@/api/index';
  184. import envelopes from '@/assets/envelopes.png';
  185. import axios from 'axios';
  186. import createStoreBJ from '@/views/componentsTarget/createStoreBJ';
  187. import ZYPlaceOrder from '@/views/componentsTarget/ZYPlaceOrder';
  188. import performanceSAP from '@/views/componentsTarget/performanceSAP';
  189. import ZYSAP from '@/views/componentsTarget/ZYSAP';
  190. import veryGoodPlaceOrder from '@/views/componentsTarget/veryGoodPlaceOrder';
  191. import neiwaiqiangpingtu from '@/views/componentsTarget/neiwaiqiangpingtu';
  192. import zhiganwaiqiangSAP from '@/views/componentsTarget/zhiganwaiqiangSAP';
  193. import cizhuanjiaoSAP from '@/views/componentsTarget/cizhuanjiaoSAP';
  194. import neiqiangzhonggaoduanSAP from '@/views/componentsTarget/neiqiangzhonggaoduanSAP';
  195. import moshouqiSAP from '@/views/componentsTarget/moshouqiSAP';
  196. import fangshuiSAP from '@/views/componentsTarget/fangshuiSAP';
  197. import Atarget from '@/views/home/Atarget.vue';
  198. import Btarget from '@/views/home/Btarget.vue';
  199. import reportCustom from './reportCustom.vue';
  200. import target from './target.vue';
  201. export default {
  202. name: 'home',
  203. components: {
  204. createStoreBJ,
  205. ZYPlaceOrder,
  206. performanceSAP,
  207. ZYSAP,
  208. veryGoodPlaceOrder,
  209. neiwaiqiangpingtu,
  210. zhiganwaiqiangSAP,
  211. cizhuanjiaoSAP,
  212. neiqiangzhonggaoduanSAP,
  213. moshouqiSAP,
  214. fangshuiSAP,
  215. Atarget,
  216. Btarget,
  217. reportCustom,
  218. target,
  219. },
  220. data() {
  221. return {
  222. envelopes: envelopes,
  223. show: true,
  224. num: 0,
  225. todayGoal: {},
  226. title: '',
  227. ptitle: '',
  228. progressWidth: 0,
  229. history: history,
  230. imgArr: [],
  231. activeNames: [
  232. '1',
  233. '2',
  234. '3',
  235. '4',
  236. '5',
  237. '6',
  238. '7',
  239. '8',
  240. '9',
  241. '11',
  242. '12',
  243. '16',
  244. '17',
  245. '27',
  246. '28',
  247. '29',
  248. ],
  249. powerGrade: '',
  250. value: 2,
  251. timeList: [],
  252. reportTargetAll: {},
  253. Content: '',
  254. number: '',
  255. successContent: '',
  256. reportContentsList1: [],
  257. reportContentsList2: [],
  258. reportContentsList3: [],
  259. updateReport: {},
  260. reportTarget: {},
  261. managerRemarkContent: '',
  262. isDiy: false,
  263. type: '-1',
  264. JZQuota: false,
  265. YFQuota: false, //应用服务
  266. GZdata: false,
  267. homePageIndicatorList: null,
  268. };
  269. },
  270. created() {
  271. this.powerGrade = localStorage.getItem('powerGrade');
  272. this.isDiy = localStorage.getItem('isDiy');
  273. this.getDetailById();
  274. },
  275. watch: {
  276. $route(to, from) {
  277. this.powerGrade = localStorage.getItem('powerGrade');
  278. this.isDiy = localStorage.getItem('isDiy');
  279. if (to.path == '/weeklyHistoricalDetils') {
  280. this.getDetailById();
  281. }
  282. },
  283. },
  284. methods: {
  285. openEnterpriseChat(val) {
  286. let loading1 = this.$toast.loading({
  287. duration: 0,
  288. message: '加载中...',
  289. forbidClick: true,
  290. });
  291. let url = window.location.href;
  292. let that = this;
  293. let wx = this.wx;
  294. let qiyeData;
  295. var userIds = this.reportTarget.reportContents[0].createBy;
  296. const instance = axios.create();
  297. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  298. instance
  299. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  300. params: {
  301. url: url,
  302. },
  303. })
  304. .then((response) => {
  305. if (response.status == 200) {
  306. loading1.clear();
  307. qiyeData = response.data.data;
  308. wx.config({
  309. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  310. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  311. appId: qiyeData.appId, // 必填,企业微信的corpID
  312. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  313. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  314. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  315. jsApiList: ['ready', 'openEnterpriseChat'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  316. });
  317. wx.ready(function () {
  318. wx.openEnterpriseChat({
  319. userIds: userIds,
  320. groupName: '我的红包群', // 会话名称。单聊时该参数传入空字符串""即可。localStorage.getItem("loginName")
  321. chatId: '', //CHATID 若要打开已有会话,需指定此参数。如果是新建会话,chatId必须为空串
  322. success: function (res) {
  323. var chatId = res.chatId; //返回当前群聊ID,仅当使用agentConfig注入该接口权限时才返回chatId
  324. },
  325. fail: function (res) {
  326. if (res.errMsg.indexOf('function not exist') > -1) {
  327. alert('版本过低请升级');
  328. }
  329. },
  330. });
  331. });
  332. } else {
  333. this.$toast.fail(dataList.msg);
  334. }
  335. });
  336. },
  337. formatter(value) {
  338. return value.replace(
  339. /[\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,
  340. '',
  341. );
  342. },
  343. submint() {
  344. let loading1 = this.$toast.loading({
  345. duration: 0,
  346. message: '数据提交中...',
  347. forbidClick: true,
  348. });
  349. if (this.managerRemarkContent.trim() == '') {
  350. this.$toast('点评内容未填写');
  351. return false;
  352. }
  353. if (this.managerRemarkContent.length > 800) {
  354. this.$toast('点评内容超过800字');
  355. return false;
  356. }
  357. var remak = {
  358. remarkContent: this.managerRemarkContent,
  359. reportId: this.$route.query.reportId,
  360. };
  361. insertRemark(remak).then((res) => {
  362. loading1.clear();
  363. if (res.code == 200) {
  364. this.$dialog
  365. .alert({
  366. title: '系统提示',
  367. message: '提交成功',
  368. })
  369. .then(() => {
  370. this.managerRemarkContent = '';
  371. this.getDetailById();
  372. });
  373. } else {
  374. this.$toast.fail(res.msg);
  375. }
  376. });
  377. },
  378. getDetailById() {
  379. let loading1 = this.$toast.loading({
  380. duration: 0,
  381. message: '加载中...',
  382. forbidClick: true,
  383. });
  384. getDetailById({ reportId: this.$route.query.reportId }).then((res) => {
  385. loading1.clear();
  386. if (res.code == 200) {
  387. this.YFQuota = res.data.postType == 'YF' ? true : false;
  388. this.JZQuota = false;
  389. if (res.data.postType == 'JZ') {
  390. this.JZQuota = true;
  391. }
  392. if (res.data.postType == 'GZ') {
  393. this.GZdata = true;
  394. } else {
  395. this.GZdata = false;
  396. }
  397. this.homePageIndicatorList = res.data.homePageIndicatorList || null;
  398. var dayTime = res.data.date;
  399. this.type = res.data.userType;
  400. this.title =
  401. res.data.deptName + '-' + res.data.postName + '-' + res.data.nickName + '的周报';
  402. this.ptitle = res.data.pdeptName + '-' + res.data.ppostName + '-' + res.data.pnickName;
  403. this.timeList = this.parseTimeParagraph(
  404. dayTime.slice(0, 4) + '-' + dayTime.slice(4, 6) + '-' + dayTime.slice(6, 8),
  405. );
  406. this.reportTargetAll = res.data.reportTargetAll;
  407. this.reportTarget = res.data;
  408. this.reportContents = res.data.reportContents;
  409. var reportContentsList1 = [];
  410. var reportContentsList2 = [];
  411. var reportContentsList3 = [];
  412. var reportContentsdata = res.data.reportContents;
  413. if (res.data.status == 3) {
  414. this.successContent = res.data.successContent;
  415. } else {
  416. this.successContent = res.data.failContent;
  417. }
  418. for (var i = 0; i < reportContentsdata.length; i++) {
  419. if (reportContentsdata[i].type == '1') {
  420. reportContentsList1.push(reportContentsdata[i]);
  421. }
  422. if (reportContentsdata[i].type == '2') {
  423. reportContentsList2.push(reportContentsdata[i]);
  424. }
  425. if (reportContentsdata[i].type == '3') {
  426. reportContentsList3.push(reportContentsdata[i]);
  427. }
  428. }
  429. var ln1 = reportContentsList1.length;
  430. var ln2 = reportContentsList2.length;
  431. if (reportContentsList1.length < reportContentsList2.length) {
  432. var len2 = ln2 - ln1;
  433. for (var x = 0; x < len2; x++) {
  434. reportContentsList1.push({
  435. contentTime: '',
  436. weekContentAm: '',
  437. weekContentPm: '',
  438. });
  439. }
  440. }
  441. this.reportContentsList1 = reportContentsList1;
  442. this.reportContentsList2 = reportContentsList2;
  443. this.reportContentsList3 = reportContentsList3;
  444. }
  445. });
  446. },
  447. onClickLeft() {
  448. this.$router.go(-1);
  449. },
  450. },
  451. };
  452. </script>
  453. <style scoped>
  454. .container {
  455. margin: 10px;
  456. }
  457. .container .van-collapse-item {
  458. margin-bottom: 10px;
  459. border-radius: 6px;
  460. overflow: hidden;
  461. }
  462. .linep p {
  463. margin: 14px 0 0 0;
  464. font-size: 14px;
  465. color: #666;
  466. padding-left: 6px;
  467. }
  468. .linep .texttitle {
  469. color: #0057ba;
  470. position: relative;
  471. padding-left: 10px;
  472. margin-top: 16px;
  473. }
  474. .linep .texttitledaily {
  475. color: #000;
  476. position: relative;
  477. padding-left: 10px;
  478. }
  479. .linep .texttitle2 {
  480. padding-left: 6px;
  481. }
  482. .linep .texttitle .opint {
  483. position: absolute;
  484. left: 0px;
  485. top: 6px;
  486. margin-right: 6px;
  487. display: inline-block;
  488. width: 6px;
  489. height: 6px;
  490. border-radius: 10px;
  491. background-color: #0057ba;
  492. }
  493. .linep .texttitledaily .opint {
  494. position: absolute;
  495. left: 0px;
  496. top: 6px;
  497. margin-right: 6px;
  498. display: inline-block;
  499. width: 6px;
  500. height: 6px;
  501. border-radius: 10px;
  502. background-color: #0057ba;
  503. }
  504. .leftTitle {
  505. background-color: #a6c9f1;
  506. color: #fff;
  507. display: inline-block;
  508. padding: 0 4px;
  509. border-radius: 2px;
  510. }
  511. .Btn1 {
  512. display: block;
  513. width: 100%;
  514. border-radius: 6px;
  515. color: #fff !important;
  516. background-color: #0057ba;
  517. border: 1px solid #0057ba;
  518. height: 44px;
  519. }
  520. .rightTitle {
  521. background-color: #ffb5bb;
  522. color: #fff;
  523. display: inline-block;
  524. padding: 0 4px;
  525. border-radius: 2px;
  526. }
  527. </style>
  528. <style>
  529. .linep .van-cell__title {
  530. color: #1e5398;
  531. font-weight: 500;
  532. }
  533. .linep .contentContainer {
  534. background-color: white;
  535. border-radius: 8px;
  536. padding: 10px 16px;
  537. margin-bottom: 10px;
  538. }
  539. .linep .contentContainer .contentContainerTitle {
  540. color: #222;
  541. margin-top: 10px;
  542. }
  543. .linep .contentContainer .contentContainerTitle span {
  544. font-size: 12px;
  545. color: #333;
  546. }
  547. .linep .contentContainer .van-field__control {
  548. background-color: #ebf4ff;
  549. padding: 10px;
  550. border-radius: 8px;
  551. }
  552. .linep .contentContainer .van-cell {
  553. padding: 0;
  554. }
  555. .van-dialog__confirm,
  556. .van-dialog__confirm:active {
  557. color: #0057ba;
  558. }
  559. </style>