Commit f0ade724 authored by 许珑标's avatar 许珑标

导入考勤数据功能

parent aed919bd
......@@ -334,20 +334,20 @@
<el-col :span="7">
<el-form-item label="岗位工资" :prop="formData.calculaType == 1 ? 'postWage' : ''">
<el-input-number @change="postcalculateShow = true" v-model="formData.postWage" placeholder="请输入请输入岗位工资"
:precision="2" :step="1" :min="0" controls-position="right"
:step="1" :min="0" controls-position="right"
:disabled="formData.calculaType == 2"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="应发工资" :prop="formData.calculaType == 2 ? 'salaryPayable' : ''">
<el-input-number @change="postcalculateShow = true" v-model="formData.salaryPayable"
placeholder="请输入请输入应发工资" :precision="2" :step="1" :min="0" controls-position="right"
placeholder="请输入请输入应发工资" :step="1" :min="0" controls-position="right"
:disabled="formData.calculaType == 1"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="实发工资">
<el-input-number v-model="formData.actualPayable" placeholder="请输入请输入实发工资:" :precision="2" :step="1"
<el-input-number v-model="formData.actualPayable" placeholder="请输入请输入实发工资:" :step="1"
:min="0" controls-position="right" :disabled="true"></el-input-number>
</el-form-item>
</el-col>
......@@ -556,6 +556,7 @@ export default {
// 计算方法
postcalculateFN() {
let obj = {
wagesPoint: this.formData.wagesPoint,
sybxBase: this.formData.sybxBase,
sybxCompanyRate: this.formData.sybxCompanyRate,
sybxPersonalRate: this.formData.sybxPersonalRate,
......@@ -622,6 +623,7 @@ export default {
this.formData.providentFundBase = res.data.providentFundBase
this.formData.providentFundCompanyRate = res.data.providentFundCompanyRate
this.formData.providentFundPersonalRate = res.data.providentFundPersonalRate
this.formData.wagesPoint = res.data.wagesPoint
this.ylbxBaseChange()
this.gsbxBaseChange()
this.ysbxBaseChange()
......@@ -688,6 +690,7 @@ export default {
this.formData = res.data
this.formData.contractId = this.$route.query.contractId
this.formData.contractName = this.$route.query.contractName
this.formData.wagesPoint = res.data.wagesPoint
this.ylbxBaseChange()
this.gsbxBaseChange()
this.ysbxBaseChange()
......
......@@ -40,6 +40,10 @@
v-hasPermi="['business:payOutDetail:export']">导出
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="info" icon="el-icon-upload2" @click="upload.open = true"
v-hasPermi="['business:payOutDetail:add']">导入考勤</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
......@@ -320,8 +324,8 @@
<!-- 调整薪资 -->
<el-dialog title="调整薪资" :visible.sync="checkWorkOpen" width="1000px" append-to-body>
<el-form label-width="120px">
<el-form-item label="原实发金额">
<el-input v-model="preForm.actualPayableNormal" disabled />
<el-form-item label="原应发金额">
<el-input v-model="preForm.payableNormal" disabled />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="newAdjustItem">新增调整项</el-button>
......@@ -360,7 +364,7 @@
<el-button type="primary" size="small" @click="doAdjustCalculate">预览</el-button>
</el-form-item>
<el-form-item v-show="adjustView.open">
<span>合计调整: {{adjustView.adjustSalary}}, 最终实发: {{adjustView.finalSalary}}</span>
<span>合计调整: {{adjustView.adjustSalary}}, 最终应发: {{adjustView.finalSalary}}, 最终实发: {{adjustView.actualPayable}}</span>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -368,6 +372,25 @@
<el-button @click="checkWorkOpen = false">取 消</el-button>
</div>
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog title="导入考勤信息" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:action="upload.url + '?templateType=' + upload.uploadRadio" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xls、xlsx格式文件。</span>
<a style="color:#1890ff;margin:0px;line-height:14px" class="download" download="考勤导入模板"
href="/考勤数据模板.xlsx" target="_blank">下载模板</a>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="importByExcel">确 定</el-button>
<el-button @click="upload.open = false">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
......@@ -381,15 +404,31 @@ import {
} from '@/api/business/payOutDetail'
import { adjustCalculate, listAllAdjustInfo } from '@/api/business/adjustInfo'
import { saveAdjustCalculate } from '@/api/business/payOutRecord'
import { getToken } from '@/utils/auth'
export default {
name: 'PayOutDetail',
dicts: ['pay_status', 'bx_bear_type', 'payee_acc_type'],
data() {
return {
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
uploadRadio: 1,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/business/payOutRecord/attendance/importByExcel/" + this.$route.query.batchNo
},
adjustItem: [],
preForm: {
actualPayableNormal: 0,
payableNormal: 0,
},
preFormOpen: false,
checkWorkOpen: false,
......@@ -438,6 +477,7 @@ export default {
adjustView: {
open: false,
finalSalary: 0,
actualPayable: 0,
adjustSalary: '',
},
// 表单参数
......@@ -752,13 +792,11 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('business/payOutDetail/export', {
...this.queryParams
}, `payOutDetail_${new Date().getTime()}.xlsx`)
this.download('business/payOutDetail/export', ...this.queryParams, `payOutDetail_${new Date().getTime()}.xlsx`)
},
async checkWork(row) {
this.preForm.salaryPayDetailId = row.id
this.preForm.actualPayableNormal = row.actualPayableNormal
this.preForm.payableNormal = row.payableNormal
await listAllAdjustInfo({
salaryPayDetailId: row.id
}).then(resp => {
......@@ -812,11 +850,29 @@ export default {
this.adjustView = {
open: true,
adjustSalary: resp.data.adjustSalary + "",
actualPayable: resp.data.actualPayable + "",
finalSalary: resp.data.finalSalary + ""
}
}
})
},
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
importByExcel() {
this.$refs.upload.submit();
}
}
}
</script>
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