doubleWeeklyDetils.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. <template>
  2. <div>
  3. <!-- 顶部条-->
  4. <div class="navBarTOP">
  5. <van-nav-bar class="navBar" title="半月报详情" left-arrow @click-left="onClickLeft" />
  6. </div>
  7. <div class="lineGrey"></div>
  8. <div class="lineGrey"></div>
  9. <div class="lineGrey"></div>
  10. <div class="lineGrey"></div>
  11. <div class="lineGrey"></div>
  12. <!-- 主体内容-->
  13. <div class="container linep">
  14. <van-collapse v-model="activeNames">
  15. <template v-if="reportTarget.postType == 'GZ' || reportTarget.postType == 'BMD'">
  16. <!-- 0-历史指标 1-动态指标,String类型 -->
  17. <template v-if="reportTarget.targetType == '1'">
  18. <target :homePageIndicatorDate="homePageIndicatorList"></target>
  19. </template>
  20. <template v-if="reportTarget.targetType == '0'">
  21. <Atarget :reportInfo="reportTarget"></Atarget>
  22. <Btarget :reportInfo="reportTarget"></Btarget>
  23. </template>
  24. </template>
  25. <template v-else>
  26. <Atarget :reportInfo="reportTarget"></Atarget>
  27. <Btarget :reportInfo="reportTarget"></Btarget>
  28. </template>
  29. <div class="contentContainer" v-if="reportTarget.isHistory == '0'">
  30. <!-- isHistory 是否为历史汇报:0-新汇报 1-历史汇报 -->
  31. <reportCustom
  32. ref="reportCustom"
  33. :disabled="true"
  34. :reportCustomData="reportTarget.customTaskList"></reportCustom>
  35. </div>
  36. <template v-else>
  37. <van-collapse-item title="上期工作成果" name="7">
  38. <div style="margin-top: -10px">
  39. <div v-for="(item, index) in reportContentsList2" :key="index">
  40. <p class="texttitle texttitle2">计划工作进度</p>
  41. <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
  42. <van-field
  43. v-model="reportContentsList1[index].doubleWeekContent"
  44. rows="4"
  45. autosize
  46. readonly
  47. type="textarea" />
  48. </div>
  49. <p class="texttitle texttitle2">实际工作进度</p>
  50. <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
  51. <van-field
  52. v-model="item.doubleWeekContent"
  53. rows="4"
  54. autosize
  55. readonly
  56. type="textarea" />
  57. </div>
  58. </div>
  59. </div>
  60. </van-collapse-item>
  61. <van-collapse-item title="本期工作规划" name="8">
  62. <div style="margin-top: -10px">
  63. <div v-for="(item2, index2) in reportContentsList3" :key="index2">
  64. <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
  65. <van-field
  66. v-model="item2.doubleWeekContent"
  67. rows="4"
  68. autosize
  69. readonly
  70. type="textarea" />
  71. </div>
  72. </div>
  73. </div>
  74. </van-collapse-item>
  75. <van-collapse-item title="本期工作规划" name="8">
  76. <div style="margin-top: -10px">
  77. <div v-for="(item2, index2) in reportContentsList3" :key="index2">
  78. <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
  79. <van-field
  80. v-model="item2.doubleWeekContent"
  81. rows="4"
  82. autosize
  83. readonly
  84. type="textarea" />
  85. </div>
  86. </div>
  87. </div>
  88. </van-collapse-item>
  89. </template>
  90. <div
  91. class="contentContainer"
  92. v-if="reportTarget.status > 1 || reportTarget.reportRemarks != null">
  93. <p class="texttitle texttitledaily">
  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. readonly
  106. color="#ffd21e"
  107. void-icon="star"
  108. void-color="#eee" /><span class="rateText"
  109. >&nbsp;&nbsp;&nbsp;&nbsp;{{ reportTarget.number }}分</span
  110. >
  111. </div>
  112. <div style="padding: 10px 0" v-if="reportTarget.status > 1">
  113. <van-field v-model="successContent" rows="4" autosize readonly type="textarea" />
  114. </div>
  115. </div>
  116. <div class="contentContainer" v-if="reportTarget.reportRemarks != null">
  117. <div>
  118. <div v-for="(item, index) in reportTarget.reportRemarks" :key="index">
  119. <p class="contentContainerTitle">
  120. <template v-if="item.deptName">{{ item.deptName }}-</template>{{ item.postName }}-{{
  121. item.nickName
  122. }}的点评
  123. </p>
  124. <div style="padding: 10px 0">
  125. <van-field
  126. v-model="item.remarkContent"
  127. rows="4"
  128. autosize
  129. readonly
  130. type="textarea" />
  131. </div>
  132. <!-- <p style="text-align: right">点评时间:{{ item.createTime }}</p> -->
  133. </div>
  134. </div>
  135. </div>
  136. </van-collapse>
  137. </div>
  138. <br />
  139. <div class="contentborder" v-if="reportTarget.status == 2">
  140. <van-button type="info" size="small" plain class="Btn1" @click="submint">重新填写</van-button>
  141. </div>
  142. <br />
  143. </div>
  144. </template>
  145. <script>
  146. import history from '@/assets/Icon/history.png';
  147. import { userTodayPlanNum, loginLog, homeImge, getDetailById, double_week_type } from '@/api/index';
  148. import createStoreBJ from '@/views/componentsTarget/createStoreBJ';
  149. import ZYPlaceOrder from '@/views/componentsTarget/ZYPlaceOrder';
  150. import performanceSAP from '@/views/componentsTarget/performanceSAP';
  151. import ZYSAP from '@/views/componentsTarget/ZYSAP';
  152. import veryGoodPlaceOrder from '@/views/componentsTarget/veryGoodPlaceOrder';
  153. import neiwaiqiangpingtu from '@/views/componentsTarget/neiwaiqiangpingtu';
  154. import zhiganwaiqiangSAP from '@/views/componentsTarget/zhiganwaiqiangSAP';
  155. import Atarget from '@/views/home/Atarget.vue';
  156. import Btarget from '@/views/home/Btarget.vue';
  157. import reportCustom from './reportCustom.vue';
  158. import target from './target.vue';
  159. export default {
  160. name: 'home',
  161. components: {
  162. createStoreBJ,
  163. ZYPlaceOrder,
  164. performanceSAP,
  165. ZYSAP,
  166. veryGoodPlaceOrder,
  167. neiwaiqiangpingtu,
  168. zhiganwaiqiangSAP,
  169. Atarget,
  170. Btarget,
  171. reportCustom,
  172. target,
  173. },
  174. data() {
  175. return {
  176. show: true,
  177. num: 0,
  178. title: '',
  179. deptName: '',
  180. pnickName: '',
  181. pdeptName: '',
  182. todayGoal: {},
  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. type: '-1',
  214. ptitle: '',
  215. JZQuota: false,
  216. homePageIndicatorList: null,
  217. //
  218. };
  219. },
  220. created() {
  221. this.powerGrade = localStorage.getItem('powerGrade');
  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.getReportInfo()
  231. if (to.path == '/doubleWeeklyDetils') {
  232. this.getDetailById();
  233. }
  234. // &&from.path=="/myHistoricalDaily"
  235. // if(to.path=="/weeklyApprovalDetils"&&from.path=="/dailyApprovalList"){
  236. // this.getDetailById()
  237. // }
  238. },
  239. },
  240. // activated() {
  241. // this.num = 0;
  242. // this.homeImgeFn()
  243. // this.userTodayPlanNum()
  244. // this.loginLogFn()
  245. // },
  246. methods: {
  247. submint() {
  248. this.$router.push({
  249. path: '/doubleWeekly',
  250. query: { reportId: this.$route.query.reportId, temporaryShow: 'N' },
  251. });
  252. },
  253. getDetailById() {
  254. let loading1 = this.$toast.loading({
  255. duration: 0,
  256. message: '加载中...',
  257. forbidClick: true,
  258. });
  259. getDetailById({ reportId: this.$route.query.reportId }).then((res) => {
  260. this.JZQuota = false;
  261. if (res.data.postType == 'JZ') {
  262. this.JZQuota = true;
  263. }
  264. loading1.clear();
  265. this.homePageIndicatorList = res.data.homePageIndicatorList;
  266. this.title = res.data.deptName + ' ' + res.data.nickName;
  267. this.reportTargetAll = res.data.reportTargetAll;
  268. this.reportTarget = res.data;
  269. this.type = res.data.userType;
  270. this.reportContents = res.data.reportContents;
  271. this.ptitle = res.data.pdeptName + '-' + res.data.ppostName + '-' + res.data.pnickName;
  272. var reportContentsList1 = [];
  273. var reportContentsList2 = [];
  274. var reportContentsList3 = [];
  275. var reportContentsdata = res.data.reportContents;
  276. if (res.data.status == 3) {
  277. this.successContent = res.data.successContent;
  278. } else {
  279. this.successContent = res.data.failContent;
  280. }
  281. for (var i = 0; i < res.data.reportContents.length; i++) {
  282. if (res.data.reportContents[i].type == '1') {
  283. reportContentsList1.push(reportContentsdata[i]);
  284. }
  285. if (res.data.reportContents[i].type == '2') {
  286. reportContentsList2.push(reportContentsdata[i]);
  287. }
  288. if (res.data.reportContents[i].type == '3') {
  289. reportContentsList3.push(reportContentsdata[i]);
  290. }
  291. }
  292. var ln1 = reportContentsList1.length;
  293. var ln2 = reportContentsList2.length;
  294. if (reportContentsList1.length < reportContentsList2.length) {
  295. var len2 = ln2 - ln1;
  296. for (var x = 0; x < len2; x++) {
  297. reportContentsList1.push({
  298. doubleWeekContent: '',
  299. });
  300. }
  301. }
  302. this.reportContentsList1 = reportContentsList1;
  303. this.reportContentsList2 = reportContentsList2;
  304. this.reportContentsList3 = reportContentsList3;
  305. });
  306. },
  307. login() {
  308. if (this.num > 4) {
  309. this.$router.push('/login');
  310. } else {
  311. this.num = this.num + 1;
  312. }
  313. },
  314. homeImgeFn() {
  315. homeImge({}).then((res) => {
  316. var imgArr = res.msg;
  317. var imgReg = /<img.*?(?:>|\/>)/gi;
  318. var arr = imgArr.match(imgReg); // arr 为包含所有img标签的数组
  319. this.imgArr = arr;
  320. });
  321. },
  322. userTodayPlanNum() {
  323. userTodayPlanNum().then((res) => {
  324. if (res.code == 200) {
  325. this.todayGoal = res.data;
  326. this.progressWidth = (this.todayGoal.finishNum / this.todayGoal.planNum) * 100 + '%';
  327. localStorage.setItem('nickName', res.data.user.nickName);
  328. localStorage.setItem('storeType', res.data.user.type);
  329. } else {
  330. this.$toast.fail(res.msg);
  331. }
  332. });
  333. },
  334. loginLogFn() {
  335. // 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();
  336. // console.log(ua)
  337. // var ua= window.navigator.userAgent.toLowerCase();
  338. // // .toLowerCase();
  339. // if( (ua.match(/MicroMessenger/i) == 'micromessenger') && (ua.match(/wxwork/i) == 'wxwork') ){
  340. //
  341. // }else{
  342. // this.$router.push("/err")
  343. // }
  344. var appVersion = navigator.appVersion;
  345. var Logapp = appVersion.split('(')[1].split(';');
  346. var arrLog = '';
  347. if (Logapp[0] == 'Linux') {
  348. arrLog = {
  349. browser: navigator.appCodeName,
  350. os: Logapp[1],
  351. phoneBrand: Logapp[2].split('/')[1],
  352. phoneModel: Logapp[2].split('/')[0],
  353. };
  354. } else {
  355. arrLog = {
  356. browser: navigator.appCodeName,
  357. os: Logapp[0],
  358. phoneBrand: '',
  359. phoneModel: '',
  360. };
  361. }
  362. loginLog(arrLog).then((res) => {
  363. if (res.code == 200) {
  364. console.log('设备记录成功');
  365. }
  366. });
  367. },
  368. onClickLeft() {
  369. this.$router.go(-1);
  370. },
  371. configFn() {
  372. this.show = false;
  373. },
  374. },
  375. };
  376. </script>
  377. <style scoped>
  378. .container {
  379. margin: 10px;
  380. }
  381. .container .van-collapse-item {
  382. margin-bottom: 10px;
  383. border-radius: 6px;
  384. overflow: hidden;
  385. }
  386. .linep p {
  387. margin: 14px 0 0 0;
  388. font-size: 14px;
  389. color: #666;
  390. padding-left: 6px;
  391. }
  392. .linep .texttitle {
  393. color: #0057ba;
  394. position: relative;
  395. padding-left: 10px;
  396. margin-top: 16px;
  397. }
  398. .linep .texttitledaily {
  399. color: #000;
  400. position: relative;
  401. padding-left: 10px;
  402. }
  403. .linep .texttitle2 {
  404. padding-left: 6px;
  405. }
  406. .linep .texttitle .opint {
  407. position: absolute;
  408. left: 0px;
  409. top: 6px;
  410. margin-right: 6px;
  411. display: inline-block;
  412. width: 6px;
  413. height: 6px;
  414. border-radius: 10px;
  415. background-color: #0057ba;
  416. }
  417. .linep .texttitledaily .opint {
  418. position: absolute;
  419. left: 0px;
  420. top: 6px;
  421. margin-right: 6px;
  422. display: inline-block;
  423. width: 6px;
  424. height: 6px;
  425. border-radius: 10px;
  426. background-color: #0057ba;
  427. }
  428. .leftTitle {
  429. background-color: #a6c9f1;
  430. color: #fff;
  431. display: inline-block;
  432. padding: 0 4px;
  433. border-radius: 2px;
  434. }
  435. .rightTitle {
  436. background-color: #ffb5bb;
  437. color: #fff;
  438. display: inline-block;
  439. padding: 0 4px;
  440. border-radius: 2px;
  441. }
  442. </style>
  443. <style>
  444. .linep .van-cell__title {
  445. color: #1e5398;
  446. font-weight: 500;
  447. }
  448. .linep .contentContainer {
  449. background-color: white;
  450. border-radius: 8px;
  451. padding: 10px 16px;
  452. margin-bottom: 10px;
  453. }
  454. .linep .contentContainer .contentContainerTitle {
  455. color: #222;
  456. margin-top: 10px;
  457. }
  458. .linep .contentContainer .contentContainerTitle span {
  459. font-size: 12px;
  460. color: #333;
  461. }
  462. .linep .contentContainer .van-field__control {
  463. background-color: #ebf4ff;
  464. padding: 10px;
  465. border-radius: 8px;
  466. }
  467. .linep .contentContainer .van-cell {
  468. padding: 0;
  469. }
  470. </style>