|
@@ -11,14 +11,13 @@
|
|
|
>
|
|
|
<template #footer>
|
|
|
<a-button @click="handleCancel" style="margin-left: 8px;">取消</a-button>
|
|
|
- <a-button @click="handleOk" type="primary" style="margin-left: 8px;">确认</a-button>
|
|
|
</template>
|
|
|
<div class="table-page-search-wrapper">
|
|
|
<a-form-model layout="inline" ref="form" :model="formState" >
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :md="24" >
|
|
|
- <a-form-model-item label="年月" prop="name">
|
|
|
- <a-month-picker placeholder="请选择" v-model="formState.yearMonth" @change="onChange" style="width:100% !important"/>
|
|
|
+ <a-form-model-item label="年月" prop="yearMonth ">
|
|
|
+ <a-month-picker placeholder="请选择" :allowClear="false" v-model="formState.yearMonth" @change="onChange" style="width:100% !important"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="24">
|
|
@@ -32,7 +31,7 @@
|
|
|
</a-col>
|
|
|
<a-col :md="24">
|
|
|
<a-form-model-item label="文件" >
|
|
|
- <a-upload name="file" :multiple="false" action="https://www.mocky.io/v2/5cc8019d300000980a055e76" :headers="headers" @change="handleChange" >
|
|
|
+ <a-upload name="file" :multiple="false" action="/salary/salaryAttendance/importExcel" :before-upload="beforeUpload" @change="handleUploadChange" :data="{'yearMonth':formState.yearMonth,'type':formState.type}" :headers="headers" >
|
|
|
<a-button> <a-icon type="upload" /> 上 传 </a-button>
|
|
|
</a-upload>
|
|
|
</a-form-model-item>
|
|
@@ -56,7 +55,10 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- formState:{},
|
|
|
+ formState:{
|
|
|
+ type:'考勤表',
|
|
|
+ yearMonth:moment().subtract(1, 'months')
|
|
|
+ },
|
|
|
dataSource: [{}],
|
|
|
visible:false,
|
|
|
loading:false,
|
|
@@ -78,11 +80,16 @@
|
|
|
|
|
|
},
|
|
|
onChange(data){
|
|
|
- console.log(this.formState.yearMonth);
|
|
|
- debugger
|
|
|
- },
|
|
|
- handleChange(){
|
|
|
|
|
|
+ },
|
|
|
+ beforeUpload(){
|
|
|
+ this.formState.yearMonth=moment(this.formState.yearMonth).format('YYYY-MM')
|
|
|
+ },
|
|
|
+ handleUploadChange({ file, fileList }){
|
|
|
+ if (file.status === 'done') {
|
|
|
+ this.$emit('ok')
|
|
|
+ this.handleCancel()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|