|
|
@@ -0,0 +1,799 @@
|
|
|
+<template>
|
|
|
+ <van-overlay class="backgroundSty20250425" z-index="2002" :show="showPop" :lock-scroll="false">
|
|
|
+ <div style="height:5%">
|
|
|
+ <van-sticky>
|
|
|
+ <van-nav-bar
|
|
|
+ :title="
|
|
|
+ '补卡记录 ' +
|
|
|
+ (typeValue == '3'
|
|
|
+ ? '编制'
|
|
|
+ : typeValue == '4'
|
|
|
+ ? '重新申请'
|
|
|
+ : typeValue == '1'
|
|
|
+ ? '详情'
|
|
|
+ : '')
|
|
|
+ "
|
|
|
+ :right-text="typeValue == '4' ? '退回原因' : ''"
|
|
|
+ @click-left="closePop()"
|
|
|
+ @click-right="getBack()"
|
|
|
+ >
|
|
|
+ <template #left>
|
|
|
+ <van-icon name="cross" class="ibps-nav-bar__close-icon" />
|
|
|
+ </template>
|
|
|
+ </van-nav-bar>
|
|
|
+ </van-sticky>
|
|
|
+ </div>
|
|
|
+ <div class="scrollView">
|
|
|
+ <van-form @submit="onSubmit">
|
|
|
+ <van-field
|
|
|
+ required
|
|
|
+ label="补卡日期:"
|
|
|
+ placeholder="请选择补卡日期"
|
|
|
+ label-width="6em"
|
|
|
+ :value="form.buKaRiQi"
|
|
|
+ :readonly="typeValue != 3 || openType != 'reissue' ? true : false"
|
|
|
+ @click="typeValue == 3 && openType == 'reissue' ? buKaRiQiClick(form.buKaRiQi):''"
|
|
|
+ />
|
|
|
+ <van-popup v-model="dateShow" position="bottom">
|
|
|
+ <van-datetime-picker
|
|
|
+ v-model="xuanzeDate"
|
|
|
+ type="date"
|
|
|
+ :min-date="minDate"
|
|
|
+ :max-date = "maxDate"
|
|
|
+ @confirm="dateShowCallback"
|
|
|
+ @cancel="dateShow = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+ <van-field
|
|
|
+ required
|
|
|
+ label="补卡班次:"
|
|
|
+ placeholder="请选择补卡班次"
|
|
|
+ label-width="6em"
|
|
|
+ :value="form.buKaBanCi"
|
|
|
+ :readonly="list.length===0 || typeValue != 3 || openType != 'reissue' ? true : false"
|
|
|
+ @click="list.length>0 && typeValue == 3 && openType == 'reissue'? sheetShow = true:''"
|
|
|
+ />
|
|
|
+ <van-popup v-model="sheetShow" position="bottom">
|
|
|
+ <van-picker
|
|
|
+ show-toolbar
|
|
|
+ :columns="list"
|
|
|
+ @confirm="actionSheetCallback"
|
|
|
+ @cancel="sheetShow = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+ <van-field
|
|
|
+ required
|
|
|
+ label="补卡类型:"
|
|
|
+ :placeholder="form.buKaBanCi!=''&&typeList.length>0&&(typeValue == 3 || typeValue == 4)?'请选择补卡类型':'请先选择补卡班次'"
|
|
|
+ label-width="6em"
|
|
|
+ :value="form.buKaLeiXing"
|
|
|
+ :readonly="form.buKaBanCi==''||typeList.length===0 || typeValue != 3|| openType != 'reissue' ? true : false"
|
|
|
+ @click="form.buKaBanCi!=''&&typeList.length>0&&typeValue == 3&& openType == 'reissue' ? typeShow = true:''"
|
|
|
+ />
|
|
|
+ <van-popup v-model="typeShow" position="bottom">
|
|
|
+ <van-picker
|
|
|
+ show-toolbar
|
|
|
+ :columns="typeList"
|
|
|
+ @confirm="actionTypeCallback"
|
|
|
+ @cancel="typeShow = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+ <van-field
|
|
|
+ required
|
|
|
+ label="补卡时间:"
|
|
|
+ :placeholder="form.buKaLeiXing!=''&&(typeValue == 3 || typeValue == 4) ? '请选择补卡时间':'请先选择补卡类型'"
|
|
|
+ label-width="6em"
|
|
|
+ :value="form.buKaShiJian"
|
|
|
+ :readonly="form.buKaLeiXing==''||(typeValue != 3 && typeValue != 4) ? true : false"
|
|
|
+ @click="form.buKaLeiXing!=''&&(typeValue == 3 || typeValue == 4) ?buKaShiJianClick(form.buKaShiJian):''"
|
|
|
+ />
|
|
|
+ <van-popup v-model="timeShow" position="bottom">
|
|
|
+ <van-datetime-picker
|
|
|
+ v-model="xuanzeTime"
|
|
|
+ type="datetime"
|
|
|
+ :min-date="minTime"
|
|
|
+ :max-date = "maxTime"
|
|
|
+ @confirm="timeShowCallback"
|
|
|
+ @cancel="timeShow = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+ <van-cell-group>
|
|
|
+ <div class="verticalLine" style="width:6em;padding: 1em 0;">
|
|
|
+ 补卡事由
|
|
|
+ </div>
|
|
|
+ <van-field
|
|
|
+ v-model="form.buKaShiYou"
|
|
|
+ autosize
|
|
|
+ type="textarea"
|
|
|
+ label=""
|
|
|
+ placeholder="请输入补卡事由"
|
|
|
+ label-width="0"
|
|
|
+ clearable
|
|
|
+ :readonly="typeValue != 3 && typeValue != 4 ? true : false"
|
|
|
+ />
|
|
|
+ </van-cell-group>
|
|
|
+ </van-form>
|
|
|
+
|
|
|
+ <ibps-uploader
|
|
|
+ v-model="form.fuJian"
|
|
|
+ label="说明附件"
|
|
|
+ download
|
|
|
+ placeholder="请上传附件"
|
|
|
+ :have-padding="false"
|
|
|
+ multiple
|
|
|
+ clearable
|
|
|
+ :readonly="typeValue != 3 && typeValue != 4 ? true : false"
|
|
|
+ />
|
|
|
+ <div v-if="typeValue == '3'" class="padding flex flex-direction">
|
|
|
+ <van-button
|
|
|
+ type="success"
|
|
|
+ class="btn btn-back-color"
|
|
|
+ @click="onSubmit"
|
|
|
+ >
|
|
|
+ 提交
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ <div v-if="typeValue == '2'" class="padding flex flex-direction">
|
|
|
+ <van-button
|
|
|
+ type="success"
|
|
|
+ class="btn btn-back-color"
|
|
|
+ @click="onAgree('已完成', '同意', '确定')"
|
|
|
+ >
|
|
|
+ 同意
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ <div v-if="typeValue == '4'" class="padding flex flex-direction">
|
|
|
+ <van-button
|
|
|
+ type="success"
|
|
|
+ class="btn btn-back-color"
|
|
|
+ @click="onAgree('待审核', '重新提交', '申请')"
|
|
|
+ >
|
|
|
+ 重新申请
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-overlay>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import random from '@/mixins/random'
|
|
|
+import bpmnStatus from '@/mixins/bpmnStatus'
|
|
|
+import IbpsUploader from '@/business/platform/file/uploader'
|
|
|
+import { Toast } from 'vant'
|
|
|
+import { saveReissue } from '@/api/platform/feature/clockReissue'
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ IbpsUploader
|
|
|
+ },
|
|
|
+ mixins: [random, bpmnStatus],
|
|
|
+ props: {
|
|
|
+ showPop: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ typeValue: {
|
|
|
+ type: String,
|
|
|
+ default: '3'
|
|
|
+ },
|
|
|
+ id: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ openType: {
|
|
|
+ type: String,
|
|
|
+ default: 'reissue'
|
|
|
+ },
|
|
|
+ reissueData: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {}
|
|
|
+ },
|
|
|
+ selectDate: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ reissueType: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ const { userId, userInfo } = this.$store.getters
|
|
|
+ return {
|
|
|
+ userId,
|
|
|
+ userInfo,
|
|
|
+ show: this.showPop,
|
|
|
+ sheetShow: false,
|
|
|
+ typeShow: false,
|
|
|
+ taskId: '',
|
|
|
+ form: {
|
|
|
+ buKaBanCi: '',
|
|
|
+ buKaShiYou: '',
|
|
|
+ buKaShiJian: '',
|
|
|
+ buKaRiQi: '',
|
|
|
+ fuJian: ''
|
|
|
+ },
|
|
|
+ list: [],
|
|
|
+ typeList: [
|
|
|
+ { text: '上班' },
|
|
|
+ { text: '下班' }
|
|
|
+ ],
|
|
|
+ backShow: false,
|
|
|
+ option: '',
|
|
|
+ content: '',
|
|
|
+ dateShow: false,
|
|
|
+ timeShow: false,
|
|
|
+ level: null,
|
|
|
+ mainPosition: {
|
|
|
+ id: ''
|
|
|
+ },
|
|
|
+ xuanzeDate: null,
|
|
|
+ xuanzeTime: null,
|
|
|
+ maxDate: new Date(),
|
|
|
+ minTime: new Date(),
|
|
|
+ maxTime: new Date(),
|
|
|
+ approver: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ rightText() {
|
|
|
+ return this.checkMode
|
|
|
+ ? this.$t('common.button.cancel')
|
|
|
+ : this.$t('common.button.manage')
|
|
|
+ },
|
|
|
+ selectedIds() {
|
|
|
+ return this.checkedIds.join(',')
|
|
|
+ },
|
|
|
+ minDate() {
|
|
|
+ const today = new Date()
|
|
|
+ const last = new Date(today)
|
|
|
+ last.setMonth(last.getMonth() - 1)
|
|
|
+ return last
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ showPop: {
|
|
|
+ handler: function(val, oldVal) {
|
|
|
+ if (val === true) {
|
|
|
+ this.form = {
|
|
|
+ buKaBanCi: '',
|
|
|
+ buKaShiYou: '',
|
|
|
+ buKaShiJian: '',
|
|
|
+ buKaRiQi: '',
|
|
|
+ fuJian: '',
|
|
|
+ buKaLeiXing: ''
|
|
|
+ }
|
|
|
+ this.getInit()
|
|
|
+ this.level = this.$store.getters.level
|
|
|
+ const mid = JSON.parse(localStorage.getItem('mainPosition'))
|
|
|
+ const mainPosition = mid || (this.userInfo && this.userInfo.mainPosition ? this.userInfo.mainPosition : null)
|
|
|
+ this.mainPosition = mainPosition
|
|
|
+
|
|
|
+ if (this.id && this.id !== '') {
|
|
|
+ this.getInfo(this.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ xuanzeDate: {
|
|
|
+ handler: async function(val, oldVal) {
|
|
|
+ // console.log(val, 'valvalval')
|
|
|
+ if (val !== null && this.openType === 'reissue') {
|
|
|
+ const scheduleData = await this.schedule(val)
|
|
|
+ const midData = []
|
|
|
+ this.list = []
|
|
|
+ scheduleData.forEach((item, i) => {
|
|
|
+ const diff = this.getDaysDifference(item.start_date_, val)
|
|
|
+ const dateName = item['d' + diff + '_']
|
|
|
+
|
|
|
+ const dateArr = dateName.split(',')
|
|
|
+
|
|
|
+ if (dateArr.length > 1) {
|
|
|
+ dateArr.forEach((x, y) => {
|
|
|
+ const midObj = this.isValidJSON(item.config_) ? JSON.parse(item.config_).scheduleShift.find(d => d.alias === x) : ''
|
|
|
+ const approver = this.isValidJSON(item.config_) ? JSON.parse(item.config_).approver : ''
|
|
|
+ midData.push({ name: x, config: midObj, approver: approver })
|
|
|
+ this.list.push({ text: x, config: midObj, approver: approver })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ const midObj = this.isValidJSON(item.config_) ? JSON.parse(item.config_).scheduleShift.find(d => d.alias === dateArr[0]) : ''
|
|
|
+ const approver = this.isValidJSON(item.config_) ? JSON.parse(item.config_).approver : ''
|
|
|
+ midData.push({ name: dateArr[0], config: midObj, approver: approver })
|
|
|
+ this.list.push({ text: dateArr[0], config: midObj, approver: approver })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(midData)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ 'form.buKaBanCi': {
|
|
|
+ handler: async function(val, oldVal) {
|
|
|
+ if (val === '') {
|
|
|
+ this.xuanzeTime = null
|
|
|
+ this.form.buKaShiJian = ''
|
|
|
+ this.typeList = [
|
|
|
+ { text: '上班' },
|
|
|
+ { text: '下班' }
|
|
|
+ ]
|
|
|
+ } else {
|
|
|
+ const reissueDataIn = await this.reissue()
|
|
|
+ if (reissueDataIn.length > 0) {
|
|
|
+ const up = reissueDataIn.filter(t => t.bu_ka_ban_ci_.includes('上班'))
|
|
|
+ const down = reissueDataIn.filter(t => t.bu_ka_ban_ci_.includes('下班'))
|
|
|
+ if (up.length > 0 && down.length > 0) {
|
|
|
+ this.typeList = []
|
|
|
+ } else if (up.length > 0) {
|
|
|
+ this.typeList = [{ text: '下班' }]
|
|
|
+ } else if (down.length > 0) {
|
|
|
+ this.typeList = [{ text: '上班' }]
|
|
|
+ } else {
|
|
|
+ this.typeList = [
|
|
|
+ { text: '上班' },
|
|
|
+ { text: '下班' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.typeList = [
|
|
|
+ { text: '上班' },
|
|
|
+ { text: '下班' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ closePop(val = '2') {
|
|
|
+ this.$emit('updataSet', false, val)
|
|
|
+ },
|
|
|
+ actionSheetCallback(e) {
|
|
|
+ this.form.buKaBanCi = e.text
|
|
|
+ const midStr = this.$common.getFormatDate('string', 10, this.xuanzeDate)
|
|
|
+ const midDate = new Date(midStr)
|
|
|
+ const midMax = this.$common.getFormatDate('string', 10, midDate.setDate(midDate.getDate() + 1))
|
|
|
+
|
|
|
+ if (e.config.dateRange[0].isSecondDay === 'Y') {
|
|
|
+ this.minTime = new Date(midStr + ' 00:00:00')
|
|
|
+ this.maxTime = new Date(midMax + ' 23:59:59')
|
|
|
+ } else {
|
|
|
+ this.minTime = new Date(midStr + ' 00:00:00')
|
|
|
+ this.maxTime = new Date(midStr + ' 23:59:59')
|
|
|
+ }
|
|
|
+ this.sheetShow = false
|
|
|
+ this.approver = e.approver
|
|
|
+ },
|
|
|
+ actionTypeCallback(e) {
|
|
|
+ this.form.buKaLeiXing = e.text
|
|
|
+ this.typeShow = false
|
|
|
+ },
|
|
|
+ async schedule(val) {
|
|
|
+ const date = this.$common.getFormatDate('string', 10, val)
|
|
|
+ const sql = `select a.id_ AS fid,a.start_date_,a.end_date_,a.config_,a.overview_,b.* FROM t_schedule_detail b JOIN t_schedule a ON a.id_ = b.parent_id_ WHERE a.status_ = '已发布' AND b.user_id_ = '${this.userId}' AND ('${date}' BETWEEN CAST( a.start_date_ AS DATE ) AND CAST( a.end_date_ AS DATE ))`
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
+ const data = res.variables.data || []
|
|
|
+ resolve(data)
|
|
|
+ }).catch(error => {
|
|
|
+ reject(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async reissue() {
|
|
|
+ const sql = `select * FROM t_attendance_reissue WHERE bian_zhi_ren_ = '${this.userId}' AND bu_ka_ri_qi_ like '%${this.form.buKaRiQi}%' and bu_ka_ban_ci_ like '%${this.form.buKaBanCi}%' and zhuang_tai_ != '已撤销'`
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
+ const data = res.variables.data || []
|
|
|
+ resolve(data)
|
|
|
+ }).catch(error => {
|
|
|
+ reject(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async clockIn() {
|
|
|
+ const sql = `select * FROM t_attendance_detail WHERE yong_hu_id_ = '${this.userId}' AND ri_qi_ like '%${this.form.buKaRiQi}%' and ban_ci_bie_ming_ like '%${this.form.buKaBanCi}%' order by create_time_ desc`
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
+ const data = res.variables.data || []
|
|
|
+ resolve(data)
|
|
|
+ }).catch(error => {
|
|
|
+ reject(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ isValidJSON(text) {
|
|
|
+ try {
|
|
|
+ JSON.parse(text)
|
|
|
+ return true
|
|
|
+ } catch (error) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dateShowCallback(e) {
|
|
|
+ // const nowDate = new Date(e.getTime() + 8 * 60 * 60 * 1000)
|
|
|
+ const time = this.$common.getFormatDate('string', 10, e)
|
|
|
+ this.form.buKaRiQi = time
|
|
|
+ this.dateShow = false
|
|
|
+ },
|
|
|
+ timeShowCallback(e) {
|
|
|
+ // const nowDate = new Date(e.getTime() + 8 * 60 * 60 * 1000)
|
|
|
+ const time = this.$common.getFormatDate('string', 16, e)
|
|
|
+ this.form.buKaShiJian = time
|
|
|
+ this.timeShow = false
|
|
|
+ },
|
|
|
+ buKaRiQiClick(e) {
|
|
|
+ this.dateShow = true
|
|
|
+ },
|
|
|
+ buKaShiJianClick() {
|
|
|
+ this.timeShow = true
|
|
|
+ },
|
|
|
+ getDaysDifference(date1, date2) {
|
|
|
+ const d1 = new Date(date1)
|
|
|
+ const d2 = new Date(date2)
|
|
|
+ const diffTime = Math.abs(d2.getTime() - d1.getTime())
|
|
|
+ const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))
|
|
|
+
|
|
|
+ return diffDays
|
|
|
+ },
|
|
|
+ getInit() {
|
|
|
+ if (this.openType === 'reissue') {
|
|
|
+ this.form.buKaBanCi = ''
|
|
|
+ this.form.buKaRiQi = this.$methCommon.time(10)
|
|
|
+ // this.form.buKaShiJian = this.$methCommon.time(16)
|
|
|
+ // this.xuanzeTime = new Date()
|
|
|
+ this.xuanzeDate = new Date()
|
|
|
+ } else {
|
|
|
+ this.form.buKaBanCi = this.reissueData.name
|
|
|
+ this.form.buKaRiQi = this.selectDate
|
|
|
+ this.form.buKaLeiXing = this.reissueType === '' ? '' : this.reissueType
|
|
|
+ // this.form.buKaShiJian = this.$methCommon.time(16)
|
|
|
+ // this.xuanzeTime = new Date()
|
|
|
+ this.xuanzeDate = new Date(this.selectDate)
|
|
|
+ const midStr = this.$common.getFormatDate('string', 10, this.xuanzeDate)
|
|
|
+ const midDate = new Date(midStr)
|
|
|
+ const midMax = this.$common.getFormatDate('string', 10, midDate.setDate(midDate.getDate() + 1))
|
|
|
+ if (this.reissueData.config.dateRange[0].isSecondDay === 'Y') {
|
|
|
+ this.minTime = new Date(midStr + ' 00:00:00')
|
|
|
+ this.maxTime = new Date(midMax + ' 23:59:59')
|
|
|
+ } else {
|
|
|
+ this.minTime = new Date(midStr + ' 00:00:00')
|
|
|
+ this.maxTime = new Date(midStr + ' 23:59:59')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getInfo(id) {
|
|
|
+ const sql = `select * from t_attendance_reissue where id_ = ${id}`
|
|
|
+
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
+ if (res.state === 200) {
|
|
|
+ const data = res.variables.data[0]
|
|
|
+ this.form = {
|
|
|
+ id: data.id_,
|
|
|
+ buKaBanCi: data.bu_ka_ban_ci_.split('-')[0],
|
|
|
+ buKaLeiXing: data.bu_ka_ban_ci_.split('-')[1] || '',
|
|
|
+ buKaShiYou: data.bu_ka_shi_you_,
|
|
|
+ buKaRiQi: data.bu_ka_ri_qi_,
|
|
|
+ buKaShiJian: data.bu_ka_shi_jian_,
|
|
|
+ fuJian: data.fu_jian_,
|
|
|
+ bianZhiRen: data.bian_zhi_ren_,
|
|
|
+ bianZhiShiJian: data.bian_zhi_shi_jian,
|
|
|
+ // bianZhiBuMen: data.fu_jian_,
|
|
|
+ zhuangTai: '待审核',
|
|
|
+ diDian: data.di_dian_,
|
|
|
+ paiBanId: data.pai_ban_id_,
|
|
|
+ paiBanJiLuId: data.pai_ban_ji_lu_id_,
|
|
|
+ kaoQinId: data.kao_qin_id_,
|
|
|
+ shenHeRen: data.shen_he_ren_
|
|
|
+ }
|
|
|
+ // if (this.typeValue === '2' || this.typeValue === '4') {
|
|
|
+ // this.updateData(data.id_)
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async onSubmit() {
|
|
|
+ if (!this.getYanZheng()) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const clockInData = await this.clockIn()
|
|
|
+ if (clockInData.length <= 0) {
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
+ const toast = Toast({
|
|
|
+ duration: 2000, // 持续展示 toast
|
|
|
+ message: '没有对应的考勤数据,请联系相关人员反馈!'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ } else if (this.form.buKaLeiXing === '上班' && clockInData[0].hasOwnProperty('da_ka_shi_jian_2_')) {
|
|
|
+ const ciDate = new Date(clockInData[0].da_ka_shi_jian_2_).getTime()
|
|
|
+ const bkDate = new Date(this.form.buKaShiJian).getTime()
|
|
|
+ if (bkDate >= ciDate) {
|
|
|
+ this.$toast('上班打卡时间大于等于考勤记录中的下班时间,请重新选择!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else if (this.form.buKaLeiXing === '下班' && clockInData[0].hasOwnProperty('da_ka_shi_jian_1_')) {
|
|
|
+ const ciDate = new Date(clockInData[0].da_ka_shi_jian_1_).getTime()
|
|
|
+ const bkDate = new Date(this.form.buKaShiJian).getTime()
|
|
|
+ if (bkDate <= ciDate) {
|
|
|
+ this.$toast('下班打卡时间小于等于考勤记录中的上班时间,请重新选择!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const info = this.$store.getters.userInfo
|
|
|
+ const useId = info.user.id
|
|
|
+ // const detpId = info.employee.positions
|
|
|
+ const transmitData = {
|
|
|
+ bianZhiRen: useId,
|
|
|
+ bianZhiShiJian: this.$methCommon.time(16),
|
|
|
+ // bianZhiBuMen: this.mainPosition === null ? detpId : this.mainPosition.id,
|
|
|
+ zhuangTai: '待审核',
|
|
|
+ diDian: this.level.second || this.level.first,
|
|
|
+ buKaBanCi: this.form.buKaBanCi + '-' + this.form.buKaLeiXing,
|
|
|
+ buKaShiYou: this.form.buKaShiYou,
|
|
|
+ buKaRiQi: this.form.buKaRiQi,
|
|
|
+ buKaShiJian: this.form.buKaShiJian,
|
|
|
+ fuJian: this.form.fuJian,
|
|
|
+ paiBanId: clockInData[0].pai_ban_id_,
|
|
|
+ paiBanJiLuId: clockInData[0].pai_ban_ji_lu_id_,
|
|
|
+ kaoQinId: clockInData[0].id_,
|
|
|
+ shenHeRen: this.approver.join(',')
|
|
|
+ }
|
|
|
+ const that = this
|
|
|
+
|
|
|
+ saveReissue(transmitData)
|
|
|
+ .then(res => {
|
|
|
+ if (res.state === 200) {
|
|
|
+ that.$toast.success('提交成功!')
|
|
|
+ setTimeout(() => {
|
|
|
+ that.closePop('1')
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ },
|
|
|
+ onAgree(shiFouGuoShen, opinion, type) {
|
|
|
+ if (this.typeValue !== '2' && !this.getYanZheng()) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ this.form.shiFouGuoShen = shiFouGuoShen
|
|
|
+ this.form.diDian = this.level.second
|
|
|
+ this.form.shiFouGuoShen = shiFouGuoShen
|
|
|
+ const editData = {
|
|
|
+ data: JSON.stringify(this.form),
|
|
|
+ opinion: opinion,
|
|
|
+ taskId: this.taskId
|
|
|
+ }
|
|
|
+ // agree(editData).then(res => {
|
|
|
+ // if (res.state === 200) {
|
|
|
+ // if (this.typeValue === '2') {
|
|
|
+ // } else {
|
|
|
+ // this.$toast.success(type + '成功!')
|
|
|
+ // this.closePop()
|
|
|
+ // }
|
|
|
+ // this.$toast.success(type + '成功!')
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.closePop()
|
|
|
+ // }, 1000)
|
|
|
+ // } else {
|
|
|
+ // this.$toast.fail(type + '异常!')
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ updateData(id, fileId) {
|
|
|
+ const pp = {
|
|
|
+ updList: [
|
|
|
+ {
|
|
|
+ where: {
|
|
|
+ id_: id
|
|
|
+ },
|
|
|
+ param: {
|
|
|
+ shi_fou_guo_shen_: '待审核'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ tableName: 't_attendance_reissue'
|
|
|
+ }
|
|
|
+ const data = this.$sig(pp)
|
|
|
+ this.$common.request('update', data).then(res => {
|
|
|
+ this.$methCommon.getPrompt('提交成功', 'success')
|
|
|
+ setTimeout(() => {
|
|
|
+ this.closePop()
|
|
|
+ }, 1000)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getYanZheng() {
|
|
|
+ const suList = [
|
|
|
+ 'buKaShiYou'
|
|
|
+ ]
|
|
|
+ const suListName = [
|
|
|
+ '补卡事由'
|
|
|
+ ]
|
|
|
+ for (const item in suList) {
|
|
|
+ if (!this.form[suList[item]]) {
|
|
|
+ this.$toast({
|
|
|
+ duration: 2000, // 持续展示 toast
|
|
|
+ message: '请输入' + suListName[item]
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const selList = ['buKaRiQi', 'buKaBanCi', 'buKaShiJian', 'buKaLeiXing']
|
|
|
+ const selListName = ['补卡日期', '补卡班次', '补卡时间', '补卡类型']
|
|
|
+ for (const item in selList) {
|
|
|
+ if (!this.form[selList[item]]) {
|
|
|
+ this.$toast({
|
|
|
+ duration: 2000, // 持续展示 toast
|
|
|
+ message: '请选择' + selListName[item]
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return true
|
|
|
+ },
|
|
|
+ // 退回原因
|
|
|
+ getBack() {
|
|
|
+ this.content = this.option
|
|
|
+ this.backShow = true
|
|
|
+ this.$dialog
|
|
|
+ .alert({
|
|
|
+ title: '退回原因',
|
|
|
+ message: this.option,
|
|
|
+ theme: 'round-button',
|
|
|
+ confirmButtonColor: '#1989fa'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ // on close
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.backShow = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+
|
|
|
+.backgroundSty20250425 {
|
|
|
+ height: 100%;
|
|
|
+ background-color: #f8f8f8;
|
|
|
+ ::v-deep .van-cell__title {
|
|
|
+ width: 65%;
|
|
|
+
|
|
|
+ .van-cell__label {
|
|
|
+ overflow-wrap: break-word;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .sectionBox {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 2px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: rgba(128, 138, 135, 0.9);
|
|
|
+
|
|
|
+ .left {
|
|
|
+ width: 90px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .sectionBox::before {
|
|
|
+ content: '';
|
|
|
+ width: 5px;
|
|
|
+ height: 14px;
|
|
|
+ border-radius: 2px;
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+ .btn-back-color {
|
|
|
+ background-color: #1989fa !important;
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+ .btn-sty {
|
|
|
+ padding: 0 13px;
|
|
|
+ border-radius: 5px;
|
|
|
+ }
|
|
|
+ .u-m-r-15 {
|
|
|
+ margin-right: 8px !important;
|
|
|
+ }
|
|
|
+ .verticalLine {
|
|
|
+ color: #000;
|
|
|
+ font-size: 13px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+ .verticalLine::before {
|
|
|
+ content: '';
|
|
|
+ width: 5px;
|
|
|
+ height: 14px;
|
|
|
+ background-color: #2979ff;
|
|
|
+ border-radius: 2px;
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+ .suspensionBtn {
|
|
|
+ width: 80px;
|
|
|
+ height: 80px;
|
|
|
+ position: fixed;
|
|
|
+ top: 75%;
|
|
|
+ right: 2%;
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .cu-form-group .title {
|
|
|
+ min-width: 180px;
|
|
|
+ }
|
|
|
+ .padding {
|
|
|
+ padding-bottom: 15px;
|
|
|
+ padding-top: 5px;
|
|
|
+ background-color: #f8f8f8;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ .btn {
|
|
|
+ width: 90%;
|
|
|
+ padding: 15px;
|
|
|
+ border-radius: 5px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .fileBox {
|
|
|
+ line-height: 50px;
|
|
|
+ color: #888888;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ border: 1px solid #dddddd;
|
|
|
+ border-radius: 8px;
|
|
|
+ padding: 5px;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .u-update-content {
|
|
|
+ font-size: 26px;
|
|
|
+ // color: $u-content-color;
|
|
|
+ line-height: 1.7;
|
|
|
+ padding: 30px;
|
|
|
+ }
|
|
|
+ .verticalLine {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ font-size: 14px;
|
|
|
+ color: rgb(51, 51, 51);
|
|
|
+ }
|
|
|
+ .verticalLine::before {
|
|
|
+ content: '';
|
|
|
+ width: 5px;
|
|
|
+ height: 14px;
|
|
|
+ background-color: #2979ff;
|
|
|
+ border-radius: 2px;
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+ .scrollView {
|
|
|
+ overflow-y: scroll;
|
|
|
+ height: 95%;
|
|
|
+ }
|
|
|
+ .scrollView::-webkit-scrollbar {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ ::v-deep .yonghu .van-cell--borderless {
|
|
|
+ padding-left: 8px;
|
|
|
+ }
|
|
|
+ ::v-deep .yonghu .van-cell .van-field__label {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: left;
|
|
|
+ font-size: 14px;
|
|
|
+ color: rgb(51, 51, 51);
|
|
|
+ }
|
|
|
+ ::v-deep .yonghu .van-cell .van-field__label::before {
|
|
|
+ content: '';
|
|
|
+ width: 5px;
|
|
|
+ height: 14px;
|
|
|
+ background-color: #2979ff;
|
|
|
+ border-radius: 2px;
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|