|
@@ -6,7 +6,6 @@
|
|
|
v-dialogDrag
|
|
|
width="1000px"
|
|
|
@close="close"
|
|
|
- @keyup.enter.native="doSubmit"
|
|
|
:visible.sync="visible">
|
|
|
<el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'"
|
|
|
label-width="125px" @submit.native.prevent>
|
|
@@ -15,7 +14,7 @@
|
|
|
<el-form-item label="姓名" prop="rosterId"
|
|
|
:rules="[{required: true, message: '姓名不能为空', trigger: 'blur'}]"
|
|
|
>
|
|
|
- <el-select v-model="inputForm.rosterId" style="width:100%" placeholder="请选择姓名">
|
|
|
+ <el-select :disabled="method === 'sure'" v-model="inputForm.rosterId" style="width:100%" placeholder="请选择姓名">
|
|
|
<el-option
|
|
|
v-for="item in supervisorList"
|
|
|
:key="item.id"
|
|
@@ -29,6 +28,7 @@
|
|
|
<el-form-item label="申请日期" prop="requestDate"
|
|
|
:rules="[{required: true, message: '申请日期不能为空', trigger: 'blur'}]">
|
|
|
<el-date-picker
|
|
|
+ :disabled="method === 'sure'"
|
|
|
placement="bottom-start"
|
|
|
style="width: 100%"
|
|
|
v-model="inputForm.requestDate"
|
|
@@ -116,9 +116,12 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
+ <!-- 附件-->
|
|
|
+ <UpLoadComponent v-if="method === 'sure'" ref="uploadComponent"></UpLoadComponent>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
|
|
|
- <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
|
|
|
+ <el-button size="small" type="primary" v-if="method !== 'view' && method !== 'sure'" @click="doSubmit('1')" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
|
|
|
+ <el-button size="small" type="primary" v-if="method === 'sure'" @click="doSubmit('2')" icon="el-icon-circle-check" v-noMoreClick>确认归档</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -127,6 +130,7 @@
|
|
|
<script>
|
|
|
import DimissionService from '@/api/changes/dimission/DimissionService'
|
|
|
import RosterService from '@/api/roster/RosterService'
|
|
|
+ import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
@@ -147,7 +151,8 @@
|
|
|
status: '',
|
|
|
payrollSettlementDate: '',
|
|
|
requestDate: '',
|
|
|
- reaTypeList: []
|
|
|
+ reaTypeList: [],
|
|
|
+ changesDimissionFilesDTOList: []
|
|
|
},
|
|
|
supervisorList: []
|
|
|
}
|
|
@@ -159,6 +164,7 @@
|
|
|
this.rosterService = new RosterService()
|
|
|
},
|
|
|
components: {
|
|
|
+ UpLoadComponent
|
|
|
},
|
|
|
methods: {
|
|
|
init (method, id) {
|
|
@@ -177,7 +183,8 @@
|
|
|
status: '',
|
|
|
payrollSettlementDate: '',
|
|
|
requestDate: '',
|
|
|
- reaTypeList: []
|
|
|
+ reaTypeList: [],
|
|
|
+ changesDimissionFilesDTOList: []
|
|
|
}
|
|
|
this.inputForm.id = id
|
|
|
if (method === 'add') {
|
|
@@ -186,27 +193,47 @@
|
|
|
this.title = '修改'
|
|
|
} else if (method === 'view') {
|
|
|
this.title = '离职详情'
|
|
|
+ } else if (method === 'sure') {
|
|
|
+ this.title = '确认离职'
|
|
|
}
|
|
|
this.visible = true
|
|
|
this.loading = false
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
- if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
|
+ if (method === 'edit' || method === 'view' || method === 'sure') { // 修改或者查看
|
|
|
this.loading = true
|
|
|
this.dimissionService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
|
this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
|
+ if (method === 'sure') {
|
|
|
+ this.$refs.uploadComponent.newUpload(method, this.inputForm.changesDimissionFilesDTOList, 'dimission')
|
|
|
+ }
|
|
|
this.loading = false
|
|
|
})
|
|
|
}
|
|
|
+ if (method !== 'edit' && method !== 'view') {
|
|
|
+ if (method === 'sure') {
|
|
|
+ this.$refs.uploadComponent.newUpload(method, [], 'dimission')
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
// 表单提交
|
|
|
- doSubmit () {
|
|
|
+ doSubmit (status) {
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true
|
|
|
+ if (this.method === 'sure') {
|
|
|
+ if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
this.checkMoment()
|
|
|
+ if (this.method === 'sure') {
|
|
|
+ this.inputForm.changesDimissionFilesDTOList = this.$refs.uploadComponent.getDataList()
|
|
|
+ }
|
|
|
+ this.inputForm.status = status
|
|
|
this.dimissionService.save(this.inputForm).then(({data}) => {
|
|
|
this.close()
|
|
|
this.$message.success(data)
|
|
@@ -219,6 +246,9 @@
|
|
|
})
|
|
|
},
|
|
|
close () {
|
|
|
+ if (this.method === 'sure') {
|
|
|
+ this.$refs.uploadComponent.clearUpload()
|
|
|
+ }
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
this.visible = false
|
|
|
},
|