weeklyHistoricalDetils.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  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. };
  268. },
  269. created() {
  270. this.powerGrade = localStorage.getItem('powerGrade');
  271. this.isDiy = localStorage.getItem('isDiy');
  272. this.getDetailById();
  273. },
  274. watch: {
  275. $route(to, from) {
  276. this.powerGrade = localStorage.getItem('powerGrade');
  277. this.isDiy = localStorage.getItem('isDiy');
  278. if (to.path == '/weeklyHistoricalDetils') {
  279. this.getDetailById();
  280. }
  281. },
  282. },
  283. methods: {
  284. openEnterpriseChat(val) {
  285. let loading1 = this.$toast.loading({
  286. duration: 0,
  287. message: '加载中...',
  288. forbidClick: true,
  289. });
  290. let url = window.location.href;
  291. let that = this;
  292. let wx = this.wx;
  293. let qiyeData;
  294. var userIds = this.reportTarget.reportContents[0].createBy;
  295. const instance = axios.create();
  296. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  297. instance
  298. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  299. params: {
  300. url: url,
  301. },
  302. })
  303. .then((response) => {
  304. if (response.status == 200) {
  305. loading1.clear();
  306. qiyeData = response.data.data;
  307. wx.config({
  308. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  309. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  310. appId: qiyeData.appId, // 必填,企业微信的corpID
  311. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  312. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  313. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  314. jsApiList: ['ready', 'openEnterpriseChat'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  315. });
  316. wx.ready(function () {
  317. wx.openEnterpriseChat({
  318. userIds: userIds,
  319. groupName: '我的红包群', // 会话名称。单聊时该参数传入空字符串""即可。localStorage.getItem("loginName")
  320. chatId: '', //CHATID 若要打开已有会话,需指定此参数。如果是新建会话,chatId必须为空串
  321. success: function (res) {
  322. var chatId = res.chatId; //返回当前群聊ID,仅当使用agentConfig注入该接口权限时才返回chatId
  323. },
  324. fail: function (res) {
  325. if (res.errMsg.indexOf('function not exist') > -1) {
  326. alert('版本过低请升级');
  327. }
  328. },
  329. });
  330. });
  331. } else {
  332. this.$toast.fail(dataList.msg);
  333. }
  334. });
  335. },
  336. formatter(value) {
  337. return value.replace(
  338. /[\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,
  339. '',
  340. );
  341. },
  342. submint() {
  343. let loading1 = this.$toast.loading({
  344. duration: 0,
  345. message: '数据提交中...',
  346. forbidClick: true,
  347. });
  348. if (this.managerRemarkContent.trim() == '') {
  349. this.$toast('点评内容未填写');
  350. return false;
  351. }
  352. if (this.managerRemarkContent.length > 800) {
  353. this.$toast('点评内容超过800字');
  354. return false;
  355. }
  356. var remak = {
  357. remarkContent: this.managerRemarkContent,
  358. reportId: this.$route.query.reportId,
  359. };
  360. insertRemark(remak).then((res) => {
  361. loading1.clear();
  362. if (res.code == 200) {
  363. this.$dialog
  364. .alert({
  365. title: '系统提示',
  366. message: '提交成功',
  367. })
  368. .then(() => {
  369. this.managerRemarkContent = '';
  370. this.getDetailById();
  371. });
  372. } else {
  373. this.$toast.fail(res.msg);
  374. }
  375. });
  376. },
  377. getDetailById() {
  378. let loading1 = this.$toast.loading({
  379. duration: 0,
  380. message: '加载中...',
  381. forbidClick: true,
  382. });
  383. getDetailById({ reportId: this.$route.query.reportId }).then((res) => {
  384. loading1.clear();
  385. if (res.code == 200) {
  386. this.YFQuota = res.data.postType == 'YF' ? true : false;
  387. this.JZQuota = false;
  388. if (res.data.postType == 'JZ') {
  389. this.JZQuota = true;
  390. }
  391. if (res.data.postType == 'GZ') {
  392. this.GZdata = true;
  393. } else {
  394. this.GZdata = false;
  395. }
  396. var dayTime = res.data.date;
  397. this.type = res.data.userType;
  398. this.title =
  399. res.data.deptName + '-' + res.data.postName + '-' + res.data.nickName + '的周报';
  400. this.ptitle = res.data.pdeptName + '-' + res.data.ppostName + '-' + res.data.pnickName;
  401. this.timeList = this.parseTimeParagraph(
  402. dayTime.slice(0, 4) + '-' + dayTime.slice(4, 6) + '-' + dayTime.slice(6, 8),
  403. );
  404. this.reportTargetAll = res.data.reportTargetAll;
  405. this.reportTarget = res.data;
  406. this.reportContents = res.data.reportContents;
  407. var reportContentsList1 = [];
  408. var reportContentsList2 = [];
  409. var reportContentsList3 = [];
  410. var reportContentsdata = res.data.reportContents;
  411. if (res.data.status == 3) {
  412. this.successContent = res.data.successContent;
  413. } else {
  414. this.successContent = res.data.failContent;
  415. }
  416. for (var i = 0; i < reportContentsdata.length; i++) {
  417. if (reportContentsdata[i].type == '1') {
  418. reportContentsList1.push(reportContentsdata[i]);
  419. }
  420. if (reportContentsdata[i].type == '2') {
  421. reportContentsList2.push(reportContentsdata[i]);
  422. }
  423. if (reportContentsdata[i].type == '3') {
  424. reportContentsList3.push(reportContentsdata[i]);
  425. }
  426. }
  427. var ln1 = reportContentsList1.length;
  428. var ln2 = reportContentsList2.length;
  429. if (reportContentsList1.length < reportContentsList2.length) {
  430. var len2 = ln2 - ln1;
  431. for (var x = 0; x < len2; x++) {
  432. reportContentsList1.push({
  433. contentTime: '',
  434. weekContentAm: '',
  435. weekContentPm: '',
  436. });
  437. }
  438. }
  439. this.reportContentsList1 = reportContentsList1;
  440. this.reportContentsList2 = reportContentsList2;
  441. this.reportContentsList3 = reportContentsList3;
  442. }
  443. });
  444. },
  445. onClickLeft() {
  446. this.$router.go(-1);
  447. },
  448. },
  449. };
  450. </script>
  451. <style scoped>
  452. .container {
  453. margin: 10px;
  454. }
  455. .container .van-collapse-item {
  456. margin-bottom: 10px;
  457. border-radius: 6px;
  458. overflow: hidden;
  459. }
  460. .linep p {
  461. margin: 14px 0 0 0;
  462. font-size: 14px;
  463. color: #666;
  464. padding-left: 6px;
  465. }
  466. .linep .texttitle {
  467. color: #0057ba;
  468. position: relative;
  469. padding-left: 10px;
  470. margin-top: 16px;
  471. }
  472. .linep .texttitledaily {
  473. color: #000;
  474. position: relative;
  475. padding-left: 10px;
  476. }
  477. .linep .texttitle2 {
  478. padding-left: 6px;
  479. }
  480. .linep .texttitle .opint {
  481. position: absolute;
  482. left: 0px;
  483. top: 6px;
  484. margin-right: 6px;
  485. display: inline-block;
  486. width: 6px;
  487. height: 6px;
  488. border-radius: 10px;
  489. background-color: #0057ba;
  490. }
  491. .linep .texttitledaily .opint {
  492. position: absolute;
  493. left: 0px;
  494. top: 6px;
  495. margin-right: 6px;
  496. display: inline-block;
  497. width: 6px;
  498. height: 6px;
  499. border-radius: 10px;
  500. background-color: #0057ba;
  501. }
  502. .leftTitle {
  503. background-color: #a6c9f1;
  504. color: #fff;
  505. display: inline-block;
  506. padding: 0 4px;
  507. border-radius: 2px;
  508. }
  509. .Btn1 {
  510. display: block;
  511. width: 100%;
  512. border-radius: 6px;
  513. color: #fff !important;
  514. background-color: #0057ba;
  515. border: 1px solid #0057ba;
  516. height: 44px;
  517. }
  518. .rightTitle {
  519. background-color: #ffb5bb;
  520. color: #fff;
  521. display: inline-block;
  522. padding: 0 4px;
  523. border-radius: 2px;
  524. }
  525. </style>
  526. <style>
  527. .linep .van-cell__title {
  528. color: #1e5398;
  529. font-weight: 500;
  530. }
  531. .linep .contentContainer {
  532. background-color: white;
  533. border-radius: 8px;
  534. padding: 10px 16px;
  535. margin-bottom: 10px;
  536. }
  537. .linep .contentContainer .contentContainerTitle {
  538. color: #222;
  539. margin-top: 10px;
  540. }
  541. .linep .contentContainer .contentContainerTitle span {
  542. font-size: 12px;
  543. color: #333;
  544. }
  545. .linep .contentContainer .van-field__control {
  546. background-color: #ebf4ff;
  547. padding: 10px;
  548. border-radius: 8px;
  549. }
  550. .linep .contentContainer .van-cell {
  551. padding: 0;
  552. }
  553. .van-dialog__confirm,
  554. .van-dialog__confirm:active {
  555. color: #0057ba;
  556. }
  557. </style>