weeklyHistoricalDetils.vue 20 KB

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