diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Amounts/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Amounts/Index.cshtml
index 95f8f4d3f..8432d73b2 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Amounts/Index.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Amounts/Index.cshtml
@@ -10,6 +10,10 @@
+ @{
+ ViewBag.Title = "工资明细信息";
+ Layout = "~/Views/Shared/_Index.cshtml";
+ }
@@ -74,51 +78,13 @@
:total="total">
-
-
-
@@ -146,13 +112,14 @@
data() {
return {
query: {},
- time:null,
+ time: null,
tableData: [],
multipleSelection: [],
currentPage: 1,
pageSize: 30,
total: 0,
- departmentOptions:[],
+ totalSend: '',
+ departmentOptions: [],
//固定列
fixedColumn: [
{ prop: 'DeptCode', label: '部门代码' },
@@ -194,11 +161,12 @@
this.NetRequest('/LR_OrganizationModule/Department/GetTree?companyId=207fa1a9-160c-4943-a89b-8fa4db0547ce&parentId=0', null, 'get').then(res => {
if (res) {
this.departmentOptions = res.map(e => {
- return {value:e.id,label:e.text}
+ return { value: e.id, label: e.text }
})
}
})
])
+ window.getTableData = this.importCallback
this.getTableData()
},
NetRequest(url, data, method = "POST") {
@@ -244,7 +212,7 @@
if (this.time) {
this.query.time1 = this.time[0]
this.query.time2 = this.time[1]
- } else if (this.query['time1']){
+ } else if (this.query['time1']) {
delete this.query['time1']
delete this.query['time2']
}
@@ -276,136 +244,36 @@
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
- }).then(async() => {
+ }).then(async () => {
let res = await this.NetRequest('/PersonnelManagement/Gz_Amounts/DeleteForm', { keyValue: ids })
if (res) {
this.$message.success('删除成功!')
}
})
},
- // 导入
- importantData() {
- this.dialogVisible = true
- },
- initUpload() {
- this.ready = false;
- this.$nextTick(() => {
- this.ready = true;
- });
- },
- beforeAvatarUpload(file) {
- let fileRaw = file.raw;
- let typeArr = fileRaw.name.split(".");
- let type = typeArr[typeArr.length - 1].toLowerCase();
- const isType = this.accept.length ? this.accept.includes(type) : true;
- const isSize = fileRaw.size / 1024 / 1024 < this.size;
- if (!isType || !isSize) {
- if (this.frequently) return false;
- this.frequently = true;
- setTimeout(() => {
- this.frequently = false;
- }, 500);
- if (!isType) {
- // this.$message.error(
- // `上传文件只能是 ${this.accept.join(" / ")} 格式!`
- // );
- this.$message.warning('上传文件格式错误!')
- } else if (!isSize) {
- this.$message.warning('上传文件大小过大!')
- // this.$message.error(`上传文件大小不能超过 ${this.size}MB!`);
- }
- return false;
- }
- return true;
- },
- handleChange(file, fileList) {
- this.initUpload();
- if (!this.beforeAvatarUpload(file)) {
- return;
- }
- this.fileList = [{
- ...fileList[fileList.length - 1],
- originalName: fileList[fileList.length - 1].name,
- }];
- },
- uploadFile(file) {
- return new Promise((resolve) => {
- let formData = new FormData();
- formData.append("file", file.raw);
- NetRequest('learun/nologin/adms/annexes/upload', formData)
- .then((res) => {
- if (res) {
- resolve(res);
- } else {
- resolve(false);
- }
- })
- .catch(() => {
- resolve(false);
- });
- });
- },
- async upload() {
- this.isUploading = true;
- let flag = true;
- for (const index in this.fileList) {
- let file = this.fileList[index];
- if (file.status == "ready") {
- res = await this.uploadFile(file);
- }
- if (file) {
- this.fileList[index].status = "success";
- this.fileList[index].res = res;
- this.fileList.splice(1, 0);
- } else {
- flag = false;
- break;
- }
- }
- this.isUploading = false;
- return flag;
- },
- async confirm() {
- if (!this.month) {
- this.$message.warning('请选择月份!')
- return
- }
- if (!this.fileList.length) {
- this.$message.warning('请选择上传文件!')
- return
- }
- let params = {
- month: this.month,
- }
- console.log('提交数据-----', params)
- const formData = new FormData();
- formData.append('data', JSON.stringify({ strEntity: JSON.stringify(params) }))
- let res = await this.NetRequest('/PersonnelManagement/Gz_Amounts/GzImport', formData)
- if (res) {
- this.$message.success('导入成功!')
- this.handleClose()
- }
- },
- handleClose() {
- this.month = ''
- this.fileList = []
- this.dialogVisible = false
+ // 导入回调
+ importCallback() {
+ this.currentPage = 1
+ this.time = null
+ this.query = {}
+ this.getTableData()
},
// 查看详情
async detailShow() {
- if (this.multipleSelection.length!=1) {
+ if (this.multipleSelection.length != 1) {
this.$message.warning('请选择一条数据进行查看!')
return
}
- this.detailData = JSON.parse(JSON.stringify(this.multipleSelection))
+ this.detailData = []
let result = await this.NetRequest('/PersonnelManagement/Gz_Amounts/GetDetail', $.param({ userNo: this.multipleSelection[0].UserNo, year: this.multipleSelection[0].Year, month: this.multipleSelection[0].Month }), 'get')
if (result) {
let obj = {}
this.trendsColumn = result.map((e, i) => {
obj['trends' + i] = e.Item2
- return { prop: 'trends' + i, label: e.Item1}
+ return { prop: 'trends' + i, label: e.Item1 }
})
- this.detailData[0] = { ...this.detailData[0], ...obj }
+ this.detailData = [{ ...this.multipleSelection[0], ...obj }]
+ console.log(this.detailData)
}
this.dialogVisible1 = true
},
@@ -457,11 +325,14 @@
border: 1px solid transparent;
border-radius: 4px;
}
+
.btn-default {
color: #333;
background-color: #fff;
border-color: #ccc;
}
+
+ @Html.AppendJsFile("/Areas/PersonnelManagement/Views/Gz_Amounts/Index.js")