weeklyHistoricalDetils.vue 17 KB

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