doubleWeeklyDetils.vue 14 KB

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