index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. <template>
  2. <div>
  3. <van-nav-bar title="查看日报" left-text="返回" @click-left="back" fixed left-arrow />
  4. <div class="login_form">
  5. <van-sticky :offset-top="43">
  6. <van-cell title="时间选择" clickable :value="nowTime" @click="showPicker = true" />
  7. </van-sticky>
  8. <div v-if="user.manageDeptId != 0 || reportsCompany || reportsDept">
  9. <van-sticky :offset-top="85">
  10. <van-cell title="选择部门" clickable :value="departmentText" @click="selectDepartmentShow = true">
  11. <template #extra>
  12. <van-icon v-if="departmentText" name="close" class="clearSeach"
  13. @click.stop="selectUserClear('dept')" />
  14. </template>
  15. <template #default>
  16. <span v-if="user.userNameNeedTranslate == '1'">
  17. <span v-if="departmentText">
  18. <TranslationOpenDataText type='departmentName' :openid='departmentText'></TranslationOpenDataText>
  19. </span>
  20. </span>
  21. <span v-else>{{ departmentText }}</span>
  22. </template>
  23. </van-cell>
  24. </van-sticky>
  25. <van-sticky :offset-top="127" class="one_report_select">
  26. <van-cell title="选择人员" clickable :value="userNameValue" @click="showUserPopu()"
  27. value-class="userNameValue">
  28. <template #extra>
  29. <van-icon v-if="selectPeopleVal.name" name="close" class="clearSeach"
  30. @click.stop="selectUserClear('user')" />
  31. </template>
  32. <template #default>
  33. <span v-if="user.userNameNeedTranslate == '1'">
  34. <span v-if="selectPeopleVal.name">
  35. <TranslationOpenDataText type='userName' :openid='selectPeopleVal.name'></TranslationOpenDataText>
  36. </span>
  37. </span>
  38. <span v-else>{{ selectPeopleVal.name }}</span>
  39. </template>
  40. </van-cell>
  41. </van-sticky>
  42. </div>
  43. <van-popup v-model="showPicker" position="bottom">
  44. <van-datetime-picker v-model="currentDate" type="date" :min-date="minDate" :max-date="maxDate"
  45. @confirm="changeTime" @cancel="showPicker = false" />
  46. </van-popup>
  47. <!--分页,加载更多-->
  48. <van-pull-refresh v-model="isDownloading" @refresh="onDownRefresh">
  49. <van-list v-model="isUpLoading" :finished="upFinished" :immediate-check="false" :offset="100" finished-text="没有更多了" @load="onLoadList">
  50. <van-skeleton :v-if="report.length != 0" v-for="(item, index) in report" title avatar :row="3" :loading="false"
  51. :key="index">
  52. <van-panel class="one_report" :title="item.name" :status="statusTxt[item.state]">
  53. <template #header>
  54. <div class="van-cell van-panel__header">
  55. <div class="van-cell__title">
  56. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName'
  57. :openid='item.name'></TranslationOpenDataText></span>
  58. <span v-else>{{ item.name }}</span>
  59. </div>
  60. <div class="van-cell__value van-panel__header-value">
  61. <span>{{ statusTxt[item.state] }}</span>
  62. </div>
  63. </div>
  64. </template>
  65. <div class="form_text" v-if="user.timeType.onlyShowPercent == 0">
  66. <span style="margin-right:20px;margin-left:5px;font-size:14px;">
  67. <span v-if="user.timeType.showCorpwxCardtime" :style="item.cardTime !=item.reportTime?'color:#ff0000;':''">考勤时长:{{item.cardTime | amounts}}h</span>
  68. 总填报时长:
  69. <span>{{ parseFloat(item.reportTime).toFixed(1) }}h</span>
  70. </span>
  71. </div>
  72. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item.summary != null" style="margin-left:20px;"
  73. v-html="'<b>' + item.summaryTitle + '</b><br>' + item.summary.replace(/\r\n/g, '<br>')">
  74. </div>
  75. <div v-for="(item1, index1) in item.data" class="one_report_data" :key="index1">
  76. <div class="project_title" style="font-weight:bold;">项目:{{ item1.project }} <span
  77. :style="'color:' + statusColor[item1.state]">[
  78. <span v-if="item1.state == 0">
  79. <span v-if="user.timeType.reportAuditType == 7" >
  80. 审核人:<span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName'
  81. :openid='item1.projectAuditorName'></TranslationOpenDataText><span v-if="item1.projectAuditState==1">√</span><span v-if="item1.deptAuditorName">、</span>
  82. <TranslationOpenDataText type='userName'
  83. :openid='item1.deptAuditorName'></TranslationOpenDataText><span v-if="item1.departmentAuditState==1">√</span>
  84. </span>
  85. <span v-else>{{ item1.projectAuditorName }}<span v-if="item1.projectAuditState==1">√</span><span v-if="item1.deptAuditorName">、</span>{{ item1.deptAuditorName }}<span v-if="item1.departmentAuditState==1">√</span></span>
  86. </span>
  87. <span v-else>
  88. <span v-if="item1.isDeptAudit == 0">
  89. <span v-if="item1.projectAuditState == 0">
  90. 待项目审核人<span v-if="item1.projectAuditorName != null">(
  91. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName'
  92. :openid='item1.projectAuditorName'></TranslationOpenDataText></span>
  93. <span v-else>{{ item1.projectAuditorName }}</span>
  94. )</span>审核
  95. </span>
  96. <span style="color:#32CD32;" v-else-if="item1.projectAuditState == 1">
  97. 项目审核人<span v-if="item1.projectAuditorName != null">(
  98. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName'
  99. :openid='item1.projectAuditorName'></TranslationOpenDataText></span>
  100. <span v-else>{{ item1.projectAuditorName }}</span>
  101. )</span>审核通过
  102. </span>
  103. </span>
  104. <span v-else-if="item1.isDeptAudit == 1">
  105. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName'
  106. :openid='item1.auditDeptName'></TranslationOpenDataText></span>
  107. <span v-else>{{ item1.auditDeptName }}</span>
  108. 审核
  109. </span>
  110. </span>
  111. </span>
  112. <span v-else>
  113. {{ statusTxt[item1.state] }}
  114. </span>
  115. <!-- {{statusTxt[item1.state]}} -->
  116. ] </span></div>
  117. <div style="color:red;" v-if="item1.state == 2 && item1.rejectReason != null">原因:{{
  118. item1.rejectReason }}
  119. </div>
  120. <div class="project_title" v-if="item1.subProjectName != null && user.companyId != yuzhongCompId">
  121. 子项目:{{ item1.subProjectName }}</div>
  122. <div class="project_title" v-if="user.companyId == yuzhongCompId">
  123. 角色:{{ item1.extraField1 ? roleList.find(r => r.value == item1.extraField1).label : '' }}</div>
  124. <div class="project_title" v-if="user.company.packageProject == 1 && item1.groupName != null">
  125. 任务分组:{{ item1.groupName }}</div>
  126. <div class="project_title" v-if="user.companyId == yuzhongCompId">
  127. 工作职责:{{ item1.extraField2 ? item1.extraField2Name : '' }}</div>
  128. <div class="project_title" v-if="user.companyId == yuzhongCompId">
  129. 工作内容:{{ item1.extraField3 ? item1.extraField3Name : '' }}</div>
  130. <div class="project_title" v-if="user.company.packageProject == 1 && item1.stage != '-'">
  131. 投入阶段:{{ item1.stage }}</div>
  132. <!--自定义维度 -->
  133. <div class="project_title" v-if="user.timeType.customDegreeActive == 1">
  134. {{ user.timeType.customDegreeName }}:{{ item1.degreeName }}</div>
  135. <div class="project_title" v-if="user.timeType.customDataActive == 1">
  136. {{ user.timeType.customDataName }}:{{ item1.customData }}</div>
  137. <div class="project_title" v-if="user.timeType.customTextActive == 1">
  138. {{ user.timeType.customTextName }}:{{ item1.customText }}</div>
  139. <div class="project_title" v-if="user.company.packageEngineering == 1">
  140. 专业进度:
  141. <span style="margin-right:10px;" v-for="progressItem in item1.professionProgress"
  142. :key="progressItem.id">{{ progressItem.professionName }}({{ progressItem.progress }}%)
  143. </span>
  144. </div>
  145. <div class="project_title" v-if="item1.taskId">任务:{{ item1.taskName }}</div>
  146. <!--根据类型选择使用的模板 -->
  147. <div v-if="item1.multiWorktime == 0">
  148. <div class="project_time" v-if="user.timeType.onlyShowPercent==0">时长:
  149. <span v-if="item1.reportTimeType == 0" style="margin-right:10px;">{{
  150. fullDayTxt[item1.timeType] }}</span>
  151. <span v-if="item1.reportTimeType == 2" style="margin-right:10px;">{{ item1.startTime + '-' +
  152. item1.endTime }}</span>{{ item1.time.toFixed(1) }}h
  153. <div class="button" v-if="item1.isOvertime == 1">加班<span v-if="item1.overtimeHours">{{
  154. item1.overtimeHours.toFixed(1) }}h</span></div>
  155. </div>
  156. <div class="project_time" v-else>用时占比:
  157. {{ item1.progress }}%
  158. </div>
  159. <div class="project_content">事项:<span v-html="item1.content"></span></div>
  160. </div>
  161. <div v-if="item1.multiWorktime == 1">
  162. <div>项目时长:<span style="margin-right:10px;">{{ item1.time.toFixed(1) }}h</span>
  163. <div class="button" v-if="item1.isOvertime == 1">加班<span v-if="item1.overtimeHours">{{
  164. item1.overtimeHours.toFixed(1) }}h</span></div>
  165. </div>
  166. <div style="position:relative;border:#ccc 0.5px solid;padding:3px;margin:5px 0px;"
  167. v-for="(timeItem, index) in item1.worktimeList" :key="index">
  168. <div class="project_time">时长:
  169. <!-- <span v-if="timeItem.reportTimeType == 0" style="margin-right:10px;">{{fullDayTxt[item1.timeType]}}</span> -->
  170. <span style="margin-right:10px;">{{ timeItem.startTime + '-' + timeItem.endTime
  171. }}</span>{{ timeItem.time.toFixed(1) }}h
  172. </div>
  173. <div class="project_content">事项:<span v-html="timeItem.content"></span></div>
  174. </div>
  175. </div>
  176. <div style="padding:5px;text-align:center;" v-if="item1.pics != null && item1.pics.length > 0">
  177. <span v-for="(p, index) in item1.pics" :key="p" style="margin-right:10px;">
  178. <img :src="p" style="width:80px; height:80px;" @click="showLargeImg(item1.pics, index)" />
  179. </span>
  180. </div>
  181. <van-divider />
  182. </div>
  183. <van-popup v-model="imgShow" position="bottom" closeable>
  184. <van-swipe class="my-swipe" indicator-color="white">
  185. <van-swipe-item v-for="(picItem, index) in tmpPics" :key="index">
  186. <img :src="picItem" style="width:100%;" />
  187. </van-swipe-item>
  188. </van-swipe>
  189. </van-popup>
  190. <!-- 编辑 -->
  191. <div slot="footer" class="foot">
  192. <van-button size="small" type="primary" @click="editor(item)"
  193. v-if="item.id == user.id && (item.state == 2 || item.state == 3)">编辑日报</van-button>
  194. </div>
  195. </van-panel>
  196. </van-skeleton>
  197. </van-list>
  198. </van-pull-refresh>
  199. <van-empty v-if="report.length == 0" description="暂无日报">
  200. <van-button round type="primary" class="bottom-button" @click="toWriteReport()">去填写</van-button>
  201. </van-empty>
  202. <!-- 人员选择 -->
  203. <van-popup v-model="selectUserShow" position="bottom" style="height: 90%">
  204. <div class="popupDiv">
  205. <div class="popupSearch">
  206. <van-search v-model.trim="searchInputValue" placeholder="输入员工姓名搜索" @clear="userListSearch"
  207. @search="userListSearch" shape="round" background="#F4F4F4"></van-search>
  208. </div>
  209. <div class="popupCon conBorder" style="flex: 1;background-color: #fff;">
  210. <div class="popupConBox">
  211. <van-radio-group v-model="selectPeopleVal">
  212. <van-radio v-for="uitem in showUserList" :key="uitem.id" :name="uitem" style="padding:10px"
  213. class="popupItem marginNone borderNone">
  214. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName'
  215. :openid='uitem.name'></TranslationOpenDataText></span>
  216. <span v-else>{{ uitem.name ? uitem.name : '' }}</span>
  217. </van-radio>
  218. </van-radio-group>
  219. </div>
  220. </div>
  221. <div class="popupBtn">
  222. <van-button style="width:100%;background: #1989fa;color: #ffffff;" round
  223. @click="selectUserConfirm()">确定</van-button>
  224. </div>
  225. </div>
  226. </van-popup>
  227. <!-- 部门选择 -->
  228. <van-popup v-model="selectDepartmentShow" position="bottom" style="height: 90%">
  229. <div class="popupDiv">
  230. <div class="comPaceholder">
  231. 已选择部门:
  232. <span v-if="user.userNameNeedTranslate != '1'">
  233. {{ selectDepartmentText.length > 0 ? selectDepartmentText[0].label : '请选择部门' }}
  234. </span>
  235. <span v-else>
  236. <span v-if="selectDepartmentText.length > 0">
  237. <TranslationOpenDataText type='departmentName' :openid='selectDepartmentText[0].label'></TranslationOpenDataText>
  238. </span>
  239. <span v-else>请选择部门</span>
  240. </span>
  241. </div>
  242. <div class="popupCon conBorder comTree popupTree" style="flex: 1;">
  243. <el-tree :data="departmentList" :props="defaultProps" @node-click="treeNodeClick">
  244. <span class="custom-tree-node" slot-scope="{ node }">
  245. <span v-if="user.userNameNeedTranslate == '1'">
  246. <span>
  247. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  248. </span>
  249. </span>
  250. <span v-if="user.userNameNeedTranslate != '1'">
  251. {{ node.label }}
  252. </span>
  253. </span>
  254. </el-tree>
  255. </div>
  256. <div class="popupBtn">
  257. <van-button style="width:100%;background: #1989fa;color: #ffffff;" round
  258. @click="treeBtn">确定</van-button>
  259. </div>
  260. </div>
  261. </van-popup>
  262. </div>
  263. </div>
  264. </template>
  265. <script>
  266. export default {
  267. components: {},
  268. data() {
  269. return {
  270. isDownloading: false,
  271. isUpLoading: false, // 上拉加载
  272. upFinished: false, // 上拉加载完毕
  273. pageIndex: 0,
  274. hasMore: true,
  275. yuzhongCompId: 3385,
  276. roleList: [{ value: 1, label: 'CRC&LM' }, { value: 2, label: 'PM' }],
  277. tmpPics: [],
  278. imgShow: false,
  279. hasWaiting: false,
  280. state: 0,
  281. statusColor: ['orange', 'green', 'red'],
  282. user: JSON.parse(localStorage.userInfo),
  283. minDate: new Date(2010, 0, 1),
  284. maxDate: new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()),
  285. currentDate: new Date(),
  286. nowTime: this.format(new Date(new Date()), "yyyy-MM-dd"),
  287. showPicker: false,
  288. report: [],
  289. fullDayTxt: ['全天', '上午', '下午'],
  290. statusTxt: ["待审核", "已通过", "已驳回", "待提交"],
  291. selectUserShow: false,
  292. searchInputValue: '',
  293. userList: [],
  294. showUserList: [],
  295. firstUserList: [],
  296. userIdList: '',
  297. userNameValue: '',
  298. selectPeopleVal: {},
  299. selectDepartmentShow: false,
  300. selectDepartmentText: [],
  301. departmentText: '',
  302. departmentList: [],
  303. defaultProps: {
  304. children: 'children',
  305. label: 'label'
  306. },
  307. reportsCompany: false,
  308. reportsDept: false
  309. };
  310. },
  311. created() {
  312. },
  313. filters:{
  314. // 过滤
  315. amounts(value) {
  316. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  317. return 0
  318. }
  319. var zhi = +value + 0
  320. return zhi.toFixed(1)
  321. },
  322. },
  323. methods: {
  324. onDownRefresh() {
  325. this.pageIndex = 1
  326. this.upFinished = false // 不写这句会导致你上拉到底过后在下拉刷新将不能触发下拉加载事件
  327. this.getReport();
  328. },
  329. onLoadList() {
  330. if(!this.hasMore) {
  331. this.upFinished = true
  332. this.isUpLoading = false
  333. return
  334. }
  335. this.pageIndex++;
  336. this.requestHttpReports();
  337. },
  338. requestHttpReports() {
  339. this.hasWaiting = false;
  340. let pames = {
  341. date: this.nowTime,
  342. }
  343. if (this.selectPeopleVal.id) {
  344. pames.userId = this.selectPeopleVal.id
  345. }
  346. if (this.departmentText && this.selectDepartmentText.length > 0) {
  347. pames.deptId = this.selectDepartmentText[0].id
  348. }
  349. pames.pageIndex = this.pageIndex;
  350. this.$axios.post("/report/getReportList", pames)
  351. .then(res => {
  352. if (res.code == "ok") {
  353. this.report = this.report.concat(res.data.data);
  354. this.hasMore = res.data.hasMore;
  355. this.isUpLoading = false;
  356. this.isDownloading = false;
  357. //计算状态
  358. for (var i = 0; i < this.report.length; i++) {
  359. var item = this.report[i];
  360. if (item.state == 0) {
  361. this.hasWaiting = true;
  362. }
  363. }
  364. } else {
  365. this.$toast.clear();
  366. this.$toast.fail('获取失败:' + res.msg);
  367. }
  368. }).catch(err => { this.$toast.clear(); });
  369. },
  370. showLargeImg(item, index) {
  371. this.imgShow = true;
  372. this.tmpPics = item;
  373. },
  374. // 返回
  375. back() {
  376. history.back();
  377. },
  378. getUsers(flag = true) {
  379. let deptId = this.selectDepartmentText[0] && this.selectDepartmentText[0].id
  380. this.$axios.post("/user/getEmployeeList", {
  381. departmentId: deptId || -1,
  382. pageIndex: 1,
  383. pageSize: -1
  384. })
  385. .then(res => {
  386. if (res.code == "ok") {
  387. if(flag) {
  388. this.userList = res.data.records;
  389. this.showUserList = res.data.records
  390. this.firstUserList = res.data.records
  391. } else {
  392. this.userList = res.data.records;
  393. this.showUserList = res.data.records
  394. }
  395. } else {
  396. this.$toast.fail('获取失败');
  397. }
  398. }).catch(err => { this.$toast.clear(); });
  399. },
  400. getDepartmentList() {
  401. this.$axios.post("/department/list", {})
  402. .then(res => {
  403. if (res.code == "ok") {
  404. this.departmentList = res.data;
  405. } else {
  406. this.$toast.fail('获取失败');
  407. }
  408. }).catch(err => { this.$toast.clear(); });
  409. },
  410. userListSearch(val) {
  411. const { userNameNeedTranslate } = this.user
  412. if (!this.searchInputValue) {
  413. this.showUserList = JSON.parse(JSON.stringify(this.userList))
  414. return
  415. }
  416. if (userNameNeedTranslate != 1) {
  417. const newUserList = JSON.parse(JSON.stringify(this.userList))
  418. this.showUserList = newUserList.filter(item => item.name.indexOf(this.searchInputValue) != -1)
  419. }
  420. if (userNameNeedTranslate == 1) {
  421. let deptId = this.selectDepartmentText[0] && this.selectDepartmentText[0].id
  422. this.$axios.post("/user/getEmployeeList", {
  423. departmentId: deptId || -1,
  424. pageIndex: 1, pageSize: -1,
  425. keyword: this.searchInputValue, status: '',
  426. roleId: '', cursor: '', onlyDirect: 0, matchingType: 0
  427. })
  428. .then(res => {
  429. if (res.code == "ok") {
  430. const dataList = res.data.records
  431. const userNameList = dataList.map(item => item.name)
  432. const newUserList = JSON.parse(JSON.stringify(this.userList))
  433. this.showUserList = newUserList.filter(item => userNameList.some(uItem => uItem.includes(item.name)))
  434. console.log(userNameList)
  435. } else {
  436. this.$toast.fail('搜索失败');
  437. }
  438. }).catch(err => { this.$toast.clear(); });
  439. }
  440. },
  441. selectUserConfirm() {
  442. console.log(this.selectPeopleVal)
  443. this.selectUserShow = false
  444. this.getReport()
  445. },
  446. selectUserClear(str) {
  447. if (str == 'user') {
  448. this.selectPeopleVal = {}
  449. }
  450. if (str == 'dept') {
  451. this.departmentText = ''
  452. this.selectDepartmentText = []
  453. }
  454. this.getReport()
  455. },
  456. showUserPopu() {
  457. if (!this.departmentText) {
  458. this.showUserList = JSON.parse(JSON.stringify(this.firstUserList))
  459. } else {
  460. this.showUserList = JSON.parse(JSON.stringify(this.userList))
  461. }
  462. this.searchInputValue = ''
  463. this.selectUserShow = true
  464. },
  465. treeNodeClick(item) {
  466. this.selectDepartmentText = [item]
  467. },
  468. treeBtn() {
  469. if (this.selectDepartmentText.length <= 0) {
  470. this.$toast('请选择部门');
  471. return
  472. }
  473. this.departmentText = this.selectDepartmentText[0].label
  474. this.selectDepartmentShow = false
  475. this.getUsers(false)
  476. this.getReport()
  477. },
  478. // 时间转换
  479. format(date, pattern) {
  480. pattern = pattern || "yyyy-MM-dd";
  481. var _this = this;
  482. return pattern.replace(/([yMdhsm])(\1*)/g, function ($0) {
  483. switch ($0.charAt(0)) {
  484. case 'y': return _this.padding(date.getFullYear(), $0.length);
  485. case 'M': return _this.padding(date.getMonth() + 1, $0.length);
  486. case 'd': return _this.padding(date.getDate(), $0.length);
  487. case 'w': return date.getDay() + 1;
  488. case 'h': return _this.padding(date.getHours(), $0.length);
  489. case 'm': return _this.padding(date.getMinutes(), $0.length);
  490. case 's': return _this.padding(date.getSeconds(), $0.length);
  491. }
  492. });
  493. },
  494. padding(s, len) {
  495. var len = len - (s + '').length;
  496. for (var i = 0; i < len; i++) { s = '0' + s; }
  497. return s;
  498. },
  499. // 改变时间
  500. changeTime(time) {
  501. this.nowTime = this.format(new Date(time), "yyyy-MM-dd");
  502. this.currentDate = time;
  503. this.showPicker = false;
  504. this.getReport();
  505. },
  506. // 获取日报
  507. getReport() {
  508. this.pageIndex = 0;
  509. this.isUpLoading = false;
  510. this.report = [];
  511. this.requestHttpReports();
  512. },
  513. // 点击编辑
  514. editor(item) {
  515. var path = '/edit';
  516. if (this.user.timeType.enableNewWeeklyfill == 1) {
  517. //物奇要填到按周填报
  518. path = '/weekEdit';
  519. }
  520. this.$router.push({
  521. path: path,
  522. query: {
  523. date: this.nowTime
  524. }
  525. });
  526. },
  527. // 去填写日报
  528. toWriteReport() {
  529. var path = '/edit';
  530. if (this.user.timeType.enableNewWeeklyfill == 1) {
  531. //物奇要填到按周填报
  532. path = '/weekEdit';
  533. }
  534. this.$router.push({
  535. path: path,
  536. query: {
  537. date: this.nowTime
  538. }
  539. });
  540. }
  541. },
  542. mounted() {
  543. if (sessionStorage.targetDate != null) {
  544. this.nowTime = sessionStorage.targetDate;
  545. sessionStorage.removeItem('targetDate');
  546. }
  547. const { functionList } = this.user
  548. for (var i in functionList) {
  549. if (functionList[i].name == '查看全公司工时') {
  550. this.reportsCompany = true
  551. }
  552. if (functionList[i].name == '查看本部门工时') {
  553. this.查看本部门工时 = true
  554. }
  555. }
  556. this.getReport();
  557. this.getUsers()
  558. this.getDepartmentList()
  559. }
  560. };
  561. </script>
  562. <style lang="less" scoped>
  563. .popupTree {
  564. font-size: 20px;
  565. padding: 20px 10px;
  566. /deep/ .el-tree-node {
  567. margin-bottom: 10px;
  568. }
  569. /deep/ .el-tree-node__content>.el-tree-node__expand-icon {
  570. font-size: 20px;
  571. }
  572. }
  573. .login_form {
  574. margin-top: 46px;
  575. }
  576. .one_report {
  577. margin-bottom: 15px;
  578. font-size: 14px;
  579. }
  580. .one_report_select {
  581. margin-bottom: 15px;
  582. }
  583. .form_text {
  584. margin: 15px 0 15px;
  585. padding: 0 12px;
  586. }
  587. .form_btn {
  588. text-align: right;
  589. }
  590. .form_btn button {
  591. margin-left: 10px;
  592. }
  593. .one_report_data {
  594. margin-bottom: 10px;
  595. padding: 0 22px;
  596. div {
  597. line-height: 30px;
  598. }
  599. }
  600. .comPaceholder {
  601. margin: 10px 15px;
  602. background: #fff;
  603. padding: 10px 10px;
  604. border-radius: 6px;
  605. font-size: 20px;
  606. color: #606266;
  607. }
  608. .comTree {
  609. background: #ffffff;
  610. }
  611. </style>
  612. <style lang="less">
  613. .van-nav-bar .van-icon,
  614. .van-nav-bar__text {
  615. color: #20a0ff;
  616. }
  617. .button {
  618. float: right;
  619. width: 80px;
  620. height: 25px;
  621. line-height: 25px;
  622. text-align: center;
  623. border: 1px solid red;
  624. color: red;
  625. box-sizing: border-box;
  626. border-radius: 10px;
  627. font-size: 14px;
  628. display: flex;
  629. justify-content: center;
  630. align-items: center;
  631. }
  632. .foot {
  633. width: 100%;
  634. display: flex;
  635. justify-content: end;
  636. }
  637. .bottom-button {
  638. width: 160px;
  639. height: 40px;
  640. background-color: rgb(53, 130, 245);
  641. border-color: rgb(53, 130, 245);
  642. }
  643. .clearSeach {
  644. line-height: 0.64rem;
  645. position: relative;
  646. left: 5px;
  647. }
  648. .userNameValue {
  649. white-space: nowrap;
  650. text-overflow: ellipsis;
  651. }
  652. </style>