工资总表页面修改

master
wanglei 7 months ago
parent 54b80684d4
commit 0163406e31

@ -9,23 +9,6 @@ export function listSalaryReport(query) {
}) })
} }
// 查询工资明细总详细
export function getSalaryReport(id) {
return request({
url: '/pay/salaryReport/' + id,
method: 'get'
})
}
// 新增工资明细总
export function addSalaryReport(data) {
return request({
url: '/pay/salaryReport',
method: 'post',
data: data
})
}
// 修改工资明细总 // 修改工资明细总
export function updateSalaryReport(data) { export function updateSalaryReport(data) {
return request({ return request({
@ -35,14 +18,6 @@ export function updateSalaryReport(data) {
}) })
} }
// 删除工资明细总
export function delSalaryReport(id) {
return request({
url: '/pay/salaryReport/' + id,
method: 'delete'
})
}
//生成报表 //生成报表
export function generate(data) { export function generate(data) {
return request({ return request({
@ -51,3 +26,11 @@ export function generate(data) {
params: data params: data
}) })
} }
export function editQuerysal(data) {
return request({
url: '/pay/salaryReport/onoff',
method: 'put',
data: data,
})
}

@ -199,7 +199,7 @@
</template> </template>
<script> <script>
import { listSalaryReport, getSalaryReport, delSalaryReport, generate, updateSalaryReport } from "@/api/pay/salaryReport"; import { listSalaryReport, editQuerysal, generate, updateSalaryReport } from "@/api/pay/salaryReport";
import { listTenant } from "@/api/pay/tenant"; import { listTenant } from "@/api/pay/tenant";
export default { export default {
@ -432,50 +432,6 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
tenantId: undefined,
year: undefined,
month: undefined,
deptId: undefined,
deptName: undefined,
employeeId: undefined,
employeeName: undefined,
basicSalary: undefined,
actuallyDays: undefined,
actuallyHours: undefined,
dayWorkHours: undefined,
workOrderHours: undefined,
overtimeWorkHours: undefined,
rigongHelpHours: undefined,
dayWorkPay: undefined,
workOrderPay: undefined,
overtime: undefined,
banggongPay: undefined,
zhibanOrLahuo: undefined,
holiday: undefined,
post: undefined,
phoneCharge: undefined,
contract: undefined,
fullTime: undefined,
diffOfLastMonth: undefined,
shoudPayMoney: undefined,
late: undefined,
insurance: undefined,
actuallyPayMoney: undefined,
allButieData: undefined,
note: undefined,
empQuery: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
@ -486,68 +442,10 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加工资明细总";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const id = row.id || this.ids
getSalaryReport(id).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改工资明细总";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.tenantId = this.gsInfo.active_id;
this.buttonLoading = true;
if (this.form.id != null) {
updateSalaryReport(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addSalaryReport(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除工资明细总编号为"' + ids + '"的数据项?').then(() => {
this.loading = true;
return delSalaryReport(ids);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('pay/salaryReport/export', { this.download('pay/salaryReport/export', {
tenantId:this.gsInfo.active_id,
...this.queryParams ...this.queryParams
}, `salaryReport_${new Date().getTime()}.xlsx`) }, `salaryReport_${new Date().getTime()}.xlsx`)
}, },
@ -560,7 +458,7 @@ export default {
this.editQuery.month = myDate.getMonth() + 1 + ''; this.editQuery.month = myDate.getMonth() + 1 + '';
if ((this.editQuery.month).toString().length == 1) { if ((this.editQuery.month).toString().length == 1) {
this.editQuery.month = "0" + this.editQuery.month; this.editQuery.month = "0" + this.editQuery.month;
listSalary(this.editQuery).then(response => { listSalaryReport(this.editQuery).then(response => {
var empSalar = response.rows var empSalar = response.rows
empSalar.forEach(item => { empSalar.forEach(item => {
this.editSwic.empQuery = (item.empQuery).toString(); this.editSwic.empQuery = (item.empQuery).toString();
@ -569,7 +467,7 @@ export default {
}) })
}); });
} else { } else {
listSalary(this.editQuery).then(response => { listSalaryReport(this.editQuery).then(response => {
var empSalar = response.rows var empSalar = response.rows
empSalar.forEach(item => { empSalar.forEach(item => {
this.editSwic.empQuery = (item.empQuery).toString(); this.editSwic.empQuery = (item.empQuery).toString();
@ -585,6 +483,19 @@ export default {
this.editSwic.empQuery = text === "启用" ? "1" : "0"; this.editSwic.empQuery = text === "启用" ? "1" : "0";
this.getEditQuery(); this.getEditQuery();
}, },
getEditQuery() {
editQuerysal({
tenantId:this.gsInfo.active_id,
...this.editSwic
}).then(response => {
if (response.code === 200) {
this.$message({
message: '修改成功',
type: 'success'
});
}
});
},
/** 生成报表选择月份 */ /** 生成报表选择月份 */
selectMonth(val) { selectMonth(val) {
if(val === null || val === ''){ if(val === null || val === ''){

Loading…
Cancel
Save