doubleHistoricalWeeklyDetils.vue 19 KB

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