index.vue 31 KB

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