{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\applicationPart1\\attendence\\record.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\applicationPart1\\attendence\\record.vue","mtime":1624883381528},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport mixinViewModule from '@/mixins/view-module'\n// import AddOrUpdate from './attendancerecords-add-or-update'\nimport debounce from \"lodash/debounce\";\n// import {getDictDataListAll, getPersonRegion} from \"@/utils\";\n\nexport default {\n mixins: [mixinViewModule],\n data() {\n return {\n mixinViewModuleOptions: {\n getDataListURL: '/system/attendence/attendancerecords/page',\n getDataListIsPage: true,\n deleteURL: '/system/attendence/attendancerecords',\n deleteIsBatch: true,\n createdIsNeed: false,\n activatedIsNeed: false,\n },\n dataForm: {\n id: '',\n studentNumber: this.$store.state.user.username,\n todayDate: \"\",\n },\n dataPost: {\n ...this.dataForm,\n },\n popIsEdit: false,\n }\n },\n created() {\n Date.prototype.myFormat = function (fmt) {\n var o = {\n \"M+\": this.getMonth() + 1, //月份\n \"d+\": this.getDate(), //日\n \"h+\": this.getHours(), //小时\n \"m+\": this.getMinutes(), //分\n \"s+\": this.getSeconds(), //秒\n \"q+\": Math.floor((this.getMonth() + 3) / 3), //季度\n \"S\": this.getMilliseconds() //毫秒\n };\n if (/(y+)/.test(fmt)) {\n fmt = fmt.replace(RegExp.$1, (this.getFullYear() + \"\").substr(4 - RegExp.$1.length));\n }\n for (var k in o) {\n if (new RegExp(\"(\" + k + \")\").test(fmt)) {\n fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : ((\"00\" + o[k]).substr((\"\" + o[k]).length)));\n }\n }\n return fmt;\n }\n\n // var time1 = new Date().myFormat(\"yyyy-MM-dd hh:mm:ss\");\n this.dataForm.todayDate = new Date().myFormat(\"yyyy-MM-dd\");\n this.myQuery()\n },\n // components: {\n // AddOrUpdate\n // },\n methods: {\n myQuery(){\n this.dataListLoading = true\n this.$http.get(\n this.mixinViewModuleOptions.getDataListURL, {\n params: {\n order: this.order,\n orderField: this.orderField,\n page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null,\n limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null,\n ...this.dataForm,\n }\n }\n ).then(({\n data: res\n }) => {\n this.dataListLoading = false\n\n if (res.code !== 0) {\n this.dataList = []\n this.total = 0\n return this.$message.error(res.msg)\n }\n\n this.dataList = this.mixinViewModuleOptions.getDataListIsPage ? res.data.list : res.data\n // 如果没有查询到记录,就增加今天的打卡记录\n // console.log(\"===========\");\n // console.log(this.dataList);\n if(!this.dataList.length){\n this.dataPost.startTime = new Date().myFormat(\"yyyy-MM-dd hh:mm:ss\");\n this.dataPost.studentNumber = this.$store.state.user.username;\n this.dataPost.studentName = this.$store.state.user.realName;\n this.dataPost.todayDate = new Date().myFormat(\"yyyy-MM-dd\");\n this.dataFormSubmitHandle()\n }else {\n // 如果有查询到记录,原则上只能有今天这一条\n this.dataPost = {...this.dataList[0]}\n }\n // 如果查询到多条记录,就删除到只剩一条\n // console.log(\"===========\");\n // console.log(this.dataList);\n // console.log(this.dataList.length > 1);\n if(this.dataList.length>1){\n // console.log(\"this.dataList[this.dataList.length - 1].id\");\n // console.log(this.dataList[this.dataList.length - 1].id);\n this.deleteHandleWapper(this.dataList[this.dataList.length-1].id);\n\n }\n // console.log(\"this.dataPost\");\n // console.log(this.dataPost);\n this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0\n let list = this.checkList[this.page]\n if (this.mixinViewModuleOptions.needCheckRecord && list && list.length > 0) {\n this.$nextTick(() => {\n let func = this.$refs.tableSelect.toggleRowSelection;\n let ids = list.map(item => item.id);\n this.dataList.forEach(item => {\n if (ids.includes(item.id)) {\n func(item, true)\n }\n })\n })\n }\n }).catch(() => {\n this.dataListLoading = false\n })\n },\n updateInfo(scopeRowId) {\n let s = new Date(this.dataPost.startTime);\n let e = new Date();\n // 保留一位小数\n let delta = Math.floor((e-s)/1000/60/60 * 10) / 10\n this.dataPost.endTime = e.myFormat(\"yyyy-MM-dd hh:mm:ss\");\n this.dataPost.duration = delta\n // console.log(this.dataPost.duration);\n this.dataPost.id = scopeRowId\n this.dataFormSubmitHandle()\n },\n // addOrUpdateHandleWapper(scopeRowId) {\n // this.popIsEdit = true;\n // this.addOrUpdateHandle(scopeRowId)\n // },\n deleteHandleWapper(id) {\n this.$http.delete(\n `${this.mixinViewModuleOptions.deleteURL}${this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id}`,\n this.mixinViewModuleOptions.deleteIsBatch ? {\n 'data': id ? [id] : this.dataListSelections.map(item => item[this.mixinViewModuleOptions.deleteIsBatchKey])\n } : {}\n ).then(({\n data: res\n }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.myQuery()\n }).catch(() => {\n })\n },\n\n\n // 表单提交\n dataFormSubmitHandle: debounce(function () {\n this.$http[!this.dataPost.id ? 'post' : 'put']('/system/attendence/attendancerecords/', this.dataPost).then(({data: res}) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.$message({\n message: this.$t('prompt.success'),\n type: 'success',\n duration: 500,\n onClose: () => {\n this.visible = false\n this.myQuery()\n }\n })\n }).catch(() => {\n })\n }, 1000, {'leading': true, 'trailing': false})\n\n }\n}\n",{"version":3,"sources":["record.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA","file":"record.vue","sourceRoot":"src/views/modules/applicationPart1/attendence","sourcesContent":["\n\n\n"]}]}