index.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  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="1.22667rem" style="margin-bottom:10px">
  6. <van-cell title="选择日期" :value="selectDateValue" @click="selectShow = true" class="dateSelectCell">
  7. <template #extra>
  8. <van-icon v-if="selectDateValue" name="close" style="line-height:0.64rem;position:relative;left:5px;" @click.stop="selectDateClear"/>
  9. </template>
  10. </van-cell>
  11. <van-calendar v-model="selectShow" :min-date="minDate" type="range" @confirm="selectConfirm" />
  12. <van-cell title="选择人员" :value="userNameValue" @click="selectUserClick" value-class="userNameValue">
  13. <template #extra>
  14. <van-icon v-if="userNameValue" name="close" style="line-height:0.64rem;position:relative;left:5px;" @click.stop="selectUserClear"/>
  15. </template>
  16. <template #default>
  17. <span v-if="user.userNameNeedTranslate == '1'">
  18. <span v-for="item,index in userNameValue.split(',')" :key="item">
  19. <TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText>
  20. <span v-if="index != (userNameValue.split(',').length - 1)">,</span>
  21. </span>
  22. </span>
  23. <span v-else>{{userNameValue}}</span>
  24. </template>
  25. </van-cell>
  26. <van-popup v-model="selectUserShow" position="bottom" style="height: 90%">
  27. <!-- <van-search v-model="searchInputValue" placeholder="输入员工姓名搜索" @search="userListSearch" v-if="user.userNameNeedTranslate != '1'"></van-search>
  28. <div style="minHeight:300px;">
  29. <template v-if="user.userNameNeedTranslate == '1'">
  30. <van-checkbox class="userCheckbox" v-for="(item) in showUserList" :key="item.id" v-model="item.isChecked" >
  31. <TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText>
  32. </van-checkbox>
  33. </template>
  34. <template v-else>
  35. <van-checkbox class="userCheckbox" v-for="(item) in showUserList" :key="item.id" v-model="item.isChecked" >
  36. <span>{{item.name}}</span>
  37. </van-checkbox>
  38. </template>
  39. <van-button style="width:100%;position: -webkit-sticky;position: sticky;bottom: 0;" @click="selectUserConfirm()">确定</van-button>
  40. </div> -->
  41. <div class="popupDiv">
  42. <div class="popupSearch" v-if="user.userNameNeedTranslate != '1'">
  43. <van-search v-model="searchInputValue" placeholder="输入员工姓名搜索" @search="userListSearch" shape="round" background="#F4F4F4"></van-search>
  44. </div>
  45. <div class="popupCon conBorder">
  46. <div class="popupConBox" v-if="user.userNameNeedTranslate == '1'">
  47. <van-checkbox class="popupItem marginNone borderNone" v-for="(item) in showUserList" :key="item.id" v-model="item.isChecked" >
  48. <span class="userNameClass_left">
  49. <TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText>
  50. </span>
  51. <span class="userNameClass_right">
  52. {{ item.jobNumber }}
  53. </span>
  54. </van-checkbox>
  55. </div>
  56. <div class="popupConBox" v-else>
  57. <van-checkbox class="popupItem marginNone borderNone" v-for="(item) in showUserList" :key="item.id" v-model="item.isChecked" >
  58. <span class="userNameClass_left">{{item.name}}</span>
  59. <span class="userNameClass_right">{{ item.jobNumber }}</span>
  60. </van-checkbox>
  61. </div>
  62. </div>
  63. <div class="popupBtn">
  64. <van-button style="width:100%;background: #1989fa;color: #ffffff;" round @click="selectUserConfirm()">确定</van-button>
  65. </div>
  66. </div>
  67. </van-popup>
  68. </van-sticky>
  69. <div class="formBatch">
  70. <van-checkbox v-model="isAllChecked" :disabled="report.length == 0" @click="allChecked" shape="square" style="padding-left:3vw"></van-checkbox>
  71. <div style="padding:1vh 2vw">
  72. <van-button @click="batchAgree(true)" :disabled="!isCanAgree || report.length == 0" type="info" size="small" style="margin-right:6vw">批量通过</van-button>
  73. <van-button @click="batchAgree(false)" :disabled="!isCanAgree || report.length == 0" type="danger" size="small" style="margin-left:2vw">批量驳回</van-button>
  74. </div>
  75. </div>
  76. <van-skeleton v-for="(item,index) in report" :key="index" title avatar :row="3" :loading="false">
  77. <van-panel class="one_report">
  78. <template #header>
  79. <div class="van-cell van-panel__header">
  80. <div class="van-cell__title" style="display:flex;algin-items:center">
  81. <van-checkbox v-model="item.checked" @click="itemChecked" shape="square" style="margin-right:2vw"></van-checkbox>
  82. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  83. <span v-else>{{item.name}}</span>
  84. </div>
  85. <div class="van-cell__value van-panel__header-value">{{item.state==0?(user.company.packageEngineering == 1 ? (item.data[0].departmentAuditState==-1?'待专业审核': (item.data[0].departmentAuditState==0?'待部门审核': '待项目经理审核')) : '待审核'):item.state==1?'已通过':'已驳回'}}</div>
  86. </div>
  87. </template>
  88. <div class="form_text">
  89. <span style="margin-left:5px;">工作日期: {{item.dateStr}}</span>
  90. <span style="float:right;">
  91. <i v-if="parseFloat(item.reportTime)>parseFloat(item.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i>
  92. 总填报:
  93. <span :style="parseFloat(item.reportTime)>parseFloat(item.calculateTime)+0.5?'color:red':''">{{item.reportTime}}h</span>
  94. </span>
  95. <!-- <span>系统智能统计:{{item.calculateTime}}h</span> -->
  96. </div>
  97. <div v-for="(item1,index1) in item.data" :key="index1" class="one_report_data">
  98. <div class="project_title">项目:{{item1.project}}
  99. [
  100. <span v-if="user.timeType.reportAuditType == 7" >
  101. 审核人:<span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName'
  102. :openid='item1.projectAuditorName'></TranslationOpenDataText><span v-if="item1.projectAuditState==1">√</span><span v-if="item1.deptAuditorName">、</span>
  103. <TranslationOpenDataText type='userName'
  104. :openid='item1.deptAuditorName'></TranslationOpenDataText><span v-if="item1.departmentAuditState==1">√</span>
  105. </span>
  106. <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>
  107. </span>
  108. <span v-else>
  109. <span v-if="item1.isDeptAudit==0">
  110. <span v-if="item1.projectAuditState==0">
  111. 待项目审核人<span v-if="item1.projectAuditorName != null">(
  112. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item1.projectAuditorName'></TranslationOpenDataText></span>
  113. <span v-else>{{item1.projectAuditorName}}</span>
  114. )</span>审核
  115. </span>
  116. <span style="color:#32CD32;" v-else-if="item1.projectAuditState==1">
  117. 项目审核人<span v-if="item1.projectAuditorName != null">(
  118. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item1.projectAuditorName'></TranslationOpenDataText></span>
  119. <span v-else>{{item1.projectAuditorName}}</span>
  120. )</span>审核通过
  121. </span>
  122. </span>
  123. <span v-else-if="item1.isDeptAudit==1">
  124. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='item1.auditDeptName'></TranslationOpenDataText></span>
  125. <span v-else>{{item1.auditDeptName}}</span>
  126. 审核
  127. </span>
  128. </span>
  129. ]
  130. </div>
  131. <div class="project_title" v-if="item1.projectCode != null" >项目编号:{{item1.projectCode}}</div>
  132. <div class="project_title" v-if="item1.subProjectName != null && user.companyId != yuzhongCompId" >子项目:{{item1.subProjectName}}</div>
  133. <div class="project_title" v-if="user.companyId == yuzhongCompId" >角色:{{item1.extraField1?roleList.find(r=>r.value==item1.extraField1).label:''}}</div>
  134. <div class="project_title" v-if="user.company.packageProject==1&&item1.groupName != null" >任务分组:{{item1.groupName}}</div>
  135. <div class="project_title" v-if="user.companyId == yuzhongCompId" >工作职责:{{item1.extraField2?item1.extraField2Name:''}}</div>
  136. <div class="project_title" v-if="user.companyId == yuzhongCompId" >工作内容:{{item1.extraField3?item1.extraField3Name:''}}</div>
  137. <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-' && user.companyId != yuzhongCompId" >投入阶段:{{item1.stage}}</div>
  138. <!--自定义维度 -->
  139. <div class="project_title" v-if="user.timeType.customDegreeActive == 1" >{{user.timeType.customDegreeName}}:{{item1.degreeName}}</div>
  140. <div class="project_title" v-if="user.timeType.customDataActive == 1" >{{user.timeType.customDataName}}:{{item1.customData}}</div>
  141. <div class="project_title" v-if="user.timeType.customTextActive == 1" >{{user.timeType.customTextName}}:{{item1.customText}}</div>
  142. <div class="project_title" v-if="user.company.packageEngineering == 1">
  143. 专业进度:
  144. <span style="margin-right:10px;" v-for="progressItem in item1.professionProgressList" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  145. </span>
  146. </div>
  147. <div class="project_title" v-if="item1.taskId != null" >任务:{{item1.taskName}}</div>
  148. <!--根据类型选择使用的模板 -->
  149. <div v-if="item1.multiWorktime == 0">
  150. <div class="project_time">时长:
  151. <span v-if="item1.reportTimeType == 0" style="margin-right:10px;">{{fullDayTxt[item1.timeType]}}</span>
  152. <span v-if="item1.reportTimeType == 2" style="margin-right:10px;">{{item1.startTime+'-'+item1.endTime}}</span>{{item1.time.toFixed(1)}}h
  153. <div class="button" v-if="item1.isOvertime == 1">加班<span v-if="item1.overtimeHours">{{item1.overtimeHours.toFixed(1)}}h</span></div>
  154. </div>
  155. <div class="project_content">事项:<span v-html="item1.content"></span></div>
  156. </div>
  157. <div v-if="item1.multiWorktime == 1">
  158. <div>
  159. 项目时长:<span style="margin-right:10px;">{{item1.time.toFixed(1)}}h</span>
  160. <div class="button" v-if="item1.isOvertime == 1" style="width: 2.3rem">加班<span v-if="item1.overtimeHours">{{item1.overtimeHours.toFixed(1)}}h</span></div>
  161. </div>
  162. <div style="position:relative;border:#ccc 0.5px solid;padding:3px;margin:5px 0px;" v-for="(timeItem, index) in item1.worktimeList" :key="index" >
  163. <div class="project_time">时长:
  164. <!-- <span v-if="timeItem.reportTimeType == 0" style="margin-right:10px;">{{fullDayTxt[item1.timeType]}}</span> -->
  165. <span style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>{{timeItem.time.toFixed(1)}}h
  166. </div>
  167. <div class="project_content">事项:<span v-html="timeItem.content"></span></div>
  168. </div>
  169. </div>
  170. <div style="padding:5px;text-align:center;" v-if="item1.pics != null && item1.pics.length > 0">
  171. <span v-for="(p, index) in item1.pics" :key="p" style="margin-right:10px;">
  172. <img :src="p" style="width:80px; height:80px;" @click="showLargeImg(item1.pics, index)"/>
  173. </span>
  174. </div>
  175. </div>
  176. <div class="form_btn" slot="footer">
  177. <van-button size="small" type="info" @click="approve(item.id, item)" style="margin-right: 4vw;">通过</van-button>
  178. <van-button size="small" type="danger" @click="showDenyDialog(item.id,0,item.dateStr, item)">驳回</van-button>
  179. </div>
  180. <van-popup v-model="imgShow" position="bottom" closeable >
  181. <van-swipe class="my-swipe" indicator-color="white">
  182. <van-swipe-item v-for="(picItem, index) in tmpPics" :key="index">
  183. <img :src="picItem" style="width:100%;" />
  184. </van-swipe-item>
  185. </van-swipe>
  186. </van-popup>
  187. </van-panel>
  188. </van-skeleton>
  189. <van-popup v-model="denyReasonDialog" position="bottom" closeable >
  190. <van-cell>请输入原因</van-cell>
  191. <van-field class="form_input"
  192. v-model="denyForm.reason" name="reason" type="textarea" :placeholder="'请输入您决定'+(denyForm.i==0?'驳回':'撤销')+'的原因'"
  193. rows="3" autosize />
  194. <van-button style="width:100%;" type="info" @click="deny()">提交</van-button>
  195. </van-popup>
  196. <van-popup v-model="approveinDialog" v-if="approveinDialog" position="bottom" closeable >
  197. <van-cell>请输入通过评价</van-cell>
  198. <van-field class="form_input"
  199. v-model="approveinData.evaluate" name="reason" type="textarea" placeholder="请输入您决定通过的评价"
  200. rows="3" autosize />
  201. <van-button style="width:100%;" type="info" @click="batchApproveinfun()" v-if="isbatch">提交</van-button>
  202. <van-button style="width:100%;" type="info" @click="approveinfun()" v-else>提交</van-button>
  203. </van-popup>
  204. </div>
  205. </div>
  206. </template>
  207. <script>
  208. export default {
  209. data() {
  210. return {
  211. yuzhongCompId: 3385,
  212. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  213. isAllChecked: false,
  214. fullDayTxt:['全天','上午','下午'],
  215. denyForm:{reason:null},
  216. denyReasonDialog:false,
  217. tmpPics:[],
  218. imgShow: false,
  219. user: JSON.parse(localStorage.userInfo),
  220. minDate: new Date(2010, 0, 1),
  221. maxDate: new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()),
  222. currentDate: new Date(),
  223. nowTime: this.format(new Date(new Date()),"yyyy-MM-dd"),
  224. showPicker: false,
  225. report: [],
  226. flg: false,
  227. isCanAgree: false,
  228. approveinData: null,
  229. approveinDialog: false,
  230. isbatch: false,
  231. selectDate: [],
  232. selectDateValue: '',
  233. selectShow: false,
  234. userList: [],
  235. showUserList: [],
  236. userIdList: [],
  237. userNameValue: '',
  238. searchInputValue: '',
  239. selectUserShow: false
  240. };
  241. },
  242. created() {
  243. },
  244. methods: {
  245. selectDateClear(){
  246. this.selectDate = []
  247. this.selectDateValue = ''
  248. this.getReport()
  249. },
  250. selectUserClear(){
  251. this.userNameValue = ''
  252. this.userIdList = []
  253. this.userList.forEach(item => {delete item.isChecked})
  254. this.showUserList = this.userList
  255. this.getReport()
  256. },
  257. selectUserClick(){
  258. this.selectUserShow = true
  259. this.searchInputValue = ''
  260. this.showUserList = this.userList
  261. },
  262. selectConfirm(date){
  263. const [start, end] = date;
  264. this.selectShow = false;
  265. this.selectDate = [this.getSelectDateStr(start),this.getSelectDateStr(end)]
  266. this.selectDateValue = `${this.selectDate[0]} 至 ${this.selectDate[1]}`;
  267. this.getReport()
  268. },
  269. getSelectDateStr(date){
  270. return `${date.getFullYear()}-${(date.getMonth() + 1) < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)}-${date.getDate() < 10 ? '0' + date.getDate() : date.getDate()}`;
  271. },
  272. userListSearch(val) {
  273. this.showUserList = [];
  274. this.userList.forEach(u=>{if (u.name.startsWith(val)) {
  275. this.showUserList.push(u);
  276. }})
  277. },
  278. selectUserConfirm(){
  279. this.userNameValue = '';
  280. var that = this;
  281. that.userIdList = '';
  282. this.userList.filter(u=>u.isChecked).forEach(u=>{
  283. that.userNameValue += (u.name+',');
  284. that.userIdList += u.id + ','
  285. });
  286. if (this.userNameValue.length > 0) {
  287. this.userNameValue = this.userNameValue.substring(0, this.userNameValue.length-1);
  288. this.userIdList = this.userIdList.substring(0, this.userIdList.length-1);
  289. }
  290. this.$forceUpdate()
  291. this.selectUserShow = false
  292. this.getReport()
  293. },
  294. getUsers() {
  295. this.$axios.post("/user/getEmployeeList", {
  296. departmentId: -1,
  297. pageIndex: 1,
  298. // pageSize: 99999
  299. pageSize: -1
  300. })
  301. .then(res => {
  302. if(res.code == "ok") {
  303. this.userList = res.data.records;
  304. this.showUserList = res.data.records
  305. } else {
  306. this.$toast.fail('获取失败');
  307. }
  308. }).catch(err=> {this.$toast.clear();});
  309. },
  310. // 批量操作
  311. allChecked(){
  312. if(this.isAllChecked){
  313. for(let i in this.report){
  314. this.report[i].checked = true
  315. }
  316. this.isCanAgree = true
  317. }else{
  318. for(let i in this.report){
  319. this.report[i].checked = false
  320. }
  321. this.isCanAgree = false
  322. }
  323. },
  324. itemChecked(){
  325. let isall = true
  326. let iscan = false
  327. for(let i in this.report){
  328. if(!this.report[i].checked){
  329. isall = false
  330. }else {
  331. iscan = true
  332. }
  333. }
  334. this.isAllChecked = isall
  335. this.isCanAgree = iscan
  336. },
  337. batchAgree(bol){
  338. let ids = ''
  339. for(let i in this.report){
  340. if(this.report[i].checked){
  341. for(let m in this.report[i].data){
  342. ids += this.report[i].data[m].id + ','
  343. }
  344. }
  345. }
  346. if(ids.length > 0){
  347. ids = ids.substring(0, ids.length-1);
  348. }
  349. if(bol){
  350. this.isbatch = true
  351. this.approveinData = {
  352. ids: ids
  353. }
  354. if(this.user.timeType.needEvaluate == 1){
  355. this.$set(this.approveinData,'evaluate','')
  356. this.approveinDialog = true
  357. }else{
  358. const toast = this.$toast.loading({
  359. forbidClick: true,
  360. duration: 0
  361. });
  362. this.batchApproveinfun()
  363. }
  364. }else{
  365. const toast = this.$toast.loading({
  366. forbidClick: true,
  367. duration: 0
  368. });
  369. let that = this
  370. this.$axios.post('/report/batchDenyReport', {
  371. ids: ids
  372. }).then(res => {
  373. if(res.code == "ok") {
  374. this.$toast.clear();
  375. setTimeout(function() {
  376. that.$toast.success('审核成功');
  377. }, 300);
  378. this.getReport();
  379. } else {
  380. this.$toast.clear();
  381. this.$toast.fail('批量操作失败:'+res.msg);
  382. }
  383. }).catch(err=> {this.$toast.clear();});
  384. }
  385. },
  386. batchApproveinfun(){
  387. let that = this
  388. this.$axios.post('/report/batchApproveReport', this.approveinData)
  389. .then(res => {
  390. if(res.code == "ok") {
  391. this.$toast.clear();
  392. setTimeout(function() {
  393. that.$toast.success('审核成功');
  394. }, 300);
  395. this.approveinDialog = false
  396. this.getReport();
  397. } else {
  398. this.$toast.clear();
  399. this.$toast.fail('批量操作失败:'+res.msg);
  400. }
  401. }).catch(err=> {this.$toast.clear();});
  402. },
  403. showLargeImg(item, index) {
  404. this.imgShow = true;
  405. this.tmpPics = item;
  406. },
  407. // 返回
  408. back() {
  409. history.back();
  410. },
  411. // 时间转换
  412. format(date, pattern) {
  413. pattern = pattern || "yyyy-MM-dd";
  414. var _this = this;
  415. return pattern.replace(/([yMdhsm])(\1*)/g, function ($0) {
  416. switch ($0.charAt(0)) {
  417. case 'y': return _this.padding(date.getFullYear(), $0.length);
  418. case 'M': return _this.padding(date.getMonth() + 1, $0.length);
  419. case 'd': return _this.padding(date.getDate(), $0.length);
  420. case 'w': return date.getDay() + 1;
  421. case 'h': return _this.padding(date.getHours(), $0.length);
  422. case 'm': return _this.padding(date.getMinutes(), $0.length);
  423. case 's': return _this.padding(date.getSeconds(), $0.length);
  424. }
  425. });
  426. },
  427. padding(s, len) {
  428. var len = len - (s + '').length;
  429. for (var i = 0; i < len; i++) { s = '0' + s; }
  430. return s;
  431. },
  432. // 改变时间
  433. changeTime(time) {
  434. this.nowTime = this.format(new Date(time),"yyyy-MM-dd");
  435. this.currentDate = time;
  436. this.showPicker = false;
  437. this.getReport();
  438. },
  439. // 获取日报
  440. getReport() {
  441. const toast = this.$toast.loading({
  442. forbidClick: true,
  443. duration: 0
  444. });
  445. let parameter = {
  446. state: 0
  447. }
  448. if(this.selectDate.length != 0){
  449. parameter.startDate = this.selectDate[0]
  450. parameter.endDate = this.selectDate[1]
  451. }
  452. if(this.userIdList){
  453. parameter.userId = this.userIdList
  454. }
  455. this.$axios.post("/report/listByState", parameter)
  456. .then(res => {
  457. if(res.code == "ok") {
  458. this.$toast.clear();
  459. this.report = res.data;
  460. // this.isAllChecked = this.report.length == 0 ? false : true
  461. if(this.report.length == 0){
  462. this.isAllChecked = false
  463. }
  464. for(let i in this.report){
  465. this.$set(this.report[i],'checked',false)
  466. }
  467. } else {
  468. this.$toast.clear();
  469. this.$toast.fail('获取失败:'+res.msg);
  470. }
  471. }).catch(err=> {this.$toast.clear();});
  472. },
  473. approve(id, item) {
  474. var ids = '';
  475. var data = item.data;
  476. data.forEach(element => {
  477. if (element.id != null && element.id != '') {
  478. ids +=(element.id+',');
  479. }
  480. });
  481. this.isbatch = false
  482. this.approveinData = {
  483. id: id,
  484. date: this.nowTime,
  485. reportIds: ids
  486. }
  487. if(this.user.timeType.needEvaluate == 1){
  488. this.$set(this.approveinData,'evaluate','')
  489. this.approveinDialog = true
  490. }else{
  491. const toast = this.$toast.loading({
  492. forbidClick: true,
  493. duration: 0
  494. });
  495. this.approveinfun()
  496. }
  497. },
  498. approveinfun(){
  499. let that = this;
  500. this.$axios.post("/report/approve", this.approveinData)
  501. .then(res => {
  502. if(res.code == "ok") {
  503. this.$toast.clear();
  504. setTimeout(function() {
  505. that.$toast.success('审核成功');
  506. }, 300);
  507. this.approveinDialog = false
  508. this.getReport();
  509. } else {
  510. this.$toast.clear();
  511. setTimeout(function() {
  512. that.$toast.fail('审核失败');
  513. }, 300);
  514. }
  515. }).catch(err=> {this.$toast.clear();});
  516. },
  517. showDenyDialog(id,i,date, item) {
  518. console.log(id, i, date, item)
  519. this.denyReasonDialog = true;
  520. var ids = '';
  521. var data = item.data;
  522. data.forEach(element => {
  523. if (element.id != null && element.id != '') {
  524. ids +=(element.id+',');
  525. }
  526. });
  527. this.denyForm = {id: id ,i:i, date: date, reportIds: ids, reason:null};
  528. console.log(this.denyForm)
  529. },
  530. deny() {
  531. const toast = this.$toast.loading({
  532. forbidClick: true,
  533. duration: 0
  534. });
  535. let that = this;
  536. this.$axios.post("/report/deny", this.denyForm)
  537. .then(res => {
  538. if(res.code == "ok") {
  539. this.$toast.clear();
  540. setTimeout(function() {
  541. that.$toast.success(that.denyForm.i==0?'驳回成功':'撤销成功');
  542. }, 300);
  543. this.getReport();
  544. this.denyReasonDialog = false;
  545. } else {
  546. this.$toast.clear();
  547. setTimeout(function() {
  548. that.$toast.fail(that.denyForm.i==0?'驳回失败':'撤销失败');
  549. }, 300);
  550. }
  551. }).catch(err=> {this.$toast.clear();});
  552. }
  553. },
  554. mounted() {
  555. this.getReport();
  556. this.getUsers()
  557. var list = this.user.functionList
  558. for(var i in list) {
  559. if(list[i].name == '审核全员日报') {
  560. this.flg = true
  561. }
  562. }
  563. }
  564. };
  565. </script>
  566. <style lang="less" scoped>
  567. .dateSelectCell{
  568. display: -webkit-box;
  569. }
  570. .userCheckbox {
  571. padding: 10px;;
  572. }
  573. .userNameValue{
  574. white-space: nowrap;
  575. text-overflow: ellipsis;
  576. }
  577. .formBatch{
  578. position: fixed;
  579. bottom: 0;
  580. width: 100%;
  581. z-index: 2;
  582. background-color: #fff;
  583. display: flex;
  584. justify-content: space-between;
  585. align-items: center;
  586. height: 1.2rem;
  587. border-top: 1px solid #ebebeb;
  588. }
  589. .login_form {
  590. margin-top: 46px;
  591. margin-bottom: 65px;
  592. }
  593. .one_report {
  594. margin-bottom: 15px;
  595. font-size:14px;
  596. }
  597. .form_text {
  598. margin: 10px 0 10px;
  599. padding: 0 12px;
  600. }
  601. .form_btn {
  602. text-align: right;
  603. }
  604. .form_btn button {
  605. margin-left: 10px;
  606. }
  607. .one_report_data {
  608. margin-bottom: 10px;
  609. padding: 0 22px;
  610. div {
  611. line-height: 30px;
  612. }
  613. }
  614. </style>
  615. <style lang="less">
  616. .van-nav-bar .van-icon , .van-nav-bar__text {
  617. color: #20a0ff;
  618. }
  619. // 显示加班样式
  620. .one_span {
  621. width: 40px;
  622. height: 25px;
  623. line-height: 25px;
  624. text-align: center;
  625. box-sizing: border-box;
  626. display: inline-block;
  627. border: 1px solid #fde2e2;
  628. background: #fef0f0;
  629. color: #f56c6c;
  630. font-size: 12px;
  631. border-radius: 5px;
  632. // margin-left: 40px;
  633. float: right;
  634. }
  635. </style>