Commit 5b5a059d authored by daywrite's avatar daywrite

修复考勤记录说明

parent 44730865
......@@ -7,4 +7,11 @@
border-color: #dc3545;
color: #dc3545;
}
.el-dialog__title {
color:white;
}
.ec-page-wrapper .el-form-item__label {
color: white;
}
}
......@@ -146,6 +146,14 @@ export default {
return methods[params].call(this, id)
},
getPunchEdit (id) {
return requestAPI(api.getpunchEdit, { id })
.then((res) => {
this.retNewArray = res.options
return res.model
})
},
getServiceEdit (id) {
return requestAPI(api.getserviceEdit, { id })
.then((res) => {
......
<template>
<section class="ec-page-wrapper" style="overflow: hidden; padding-bottom: 0px;">
<el-form label-width="120px" ref="form" :rules="rules" :model="model" class="ec-create-form">
<el-form-item label="日期:" class="ec-form-item ec-clear-left is-required">
{{ model.day_at}}
</el-form-item>
<el-form-item label="签到时间:" class="ec-clear-left ec-form-item-lg">
{{ model.in_at ? model.in_at : model.in_status_display }}
</el-form-item>
<el-form-item label="签到说明:" prop="in_description" class="ec-clear-left is-required">
<el-input
class="ec-input-normal"
type="textarea"
:rows="3"
v-model.trim="model.in_description">
</el-input>
</el-form-item>
<el-form-item label="签退时间:" class="ec-clear-left is-required">
{{ model.out_at ? model.out_at : model.out_status_display }}
</el-form-item>
<el-form-item label="签退说明:" prop="out_description" class="ec-clear-left is-required">
<el-input
class="ec-input-normal"
type="textarea"
:rows="3"
v-model.trim="model.out_description">
</el-input>
</el-form-item>
</el-form>
</section>
</template>
<script>
import settingMixin from '../common/settingMixin'
export default {
name: 'punchEditForm',
mixins: [settingMixin],
props: {
model: Object
},
data () {
return {
rules: {},
query: {}
}
},
created () {
},
mounted () {
},
computed: {
},
methods: {
getEdit (id) {
return this.initEditSetting('getPunchEdit', id)
},
_validate (cb) {
this.$refs['form'].validate((valid) => {
if (valid) {
cb && cb()
}
})
},
_resetFields () {
this.$refs['form'].resetFields()
}
}
}
</script>
<style lang="scss" scoped>
.ec-create-form .el-form-item {
width: 70%;
}
// .ec-create-form .el-form-item {
// width: 100%;
// }
</style>
<template>
<section>
<sidePopup ref="sidePopup" title="修改考勤" :width="50" @update:close="() => btnClose()">
<EditForm
ref="docForm"
:model="model">
</EditForm>
<div class="mt20" style="margin-left: 150px;">
<el-button type="confirm" @click.stop.prevent="save" size="mini">保存修改</el-button>
</div>
</sidePopup>
</section>
</template>
<script>
import {
requestAPI,
api,
UTIL
} from '@/lib/commonMixin'
import EditForm from './editForm'
import { setModule } from '@/lib/viewHelper'
export default {
components: {
EditForm
},
data () {
return {
diaVis: false,
model: {
id: '',
day_at: '',
in_at: '',
in_status_display: '',
out_at: '',
out_status_display: '',
in_description: '',
out_description: ''
}
}
},
methods: {
show (model) {
if (model) {
this.$refs.docForm.getEdit(model.id)
.then((_model) => {
UTIL.flatten(this.model, _model)
})
}
this.$refs.sidePopup.show()
},
handleClose () {
this.$refs.sidePopup.close(() => {
this.$refs.docForm._resetFields()
})
},
btnClose () {
this.$refs.docForm._resetFields()
},
save () {
let _model = Object.assign({}, this.model)
let _params = Object.assign({}, setModule({
id: _model.id,
in_description: _model.in_description,
out_description: _model.out_description
}, 'Punch'))
let _apiUrl = api.savepunchEdit
this.$refs['docForm']._validate(() => {
requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params)
.then((res) => {
this.$refs.sidePopup.close()
this.$message.success('操作成功')
this.$parent._reload()
}) // save
}) // validate
}
}
}
</script>
<style lang="scss" scoped>
</style>
......@@ -54,6 +54,7 @@
:total="result.pagenation.totalcount">
</Pagenation>
</div>
<editModal ref="editModal"></editModal>
</div>
</section>
</template>
......@@ -63,10 +64,11 @@ import SearchHeader from '../common/searchHeader'
import SearchForm from '../common/SearchForm'
import Item from './punchItem'
import Pagenation from './punchPagenation'
import clickOutside from '@/lib/bind'
import SetParams from '../common/setParams'
import singleRadioTool from '../common/singleRadioTool'
import countArr from './countArr'
import editModal from '../punch/editModal'
import clickOutside from '@/lib/bind'
import {
requestAPI,
api
......@@ -82,7 +84,8 @@ export default {
Item,
Pagenation,
singleRadioTool,
countArr
countArr,
editModal
},
directives: {
......@@ -225,6 +228,11 @@ export default {
this.getList(ret)
},
// 6.2编辑
editSch (item) {
this.$refs.editModal.show(item)
},
// 7.操作
// 修改密码
changePasswordEvent () {},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment