Commit 99bf9250 authored by 姬鋆屾's avatar 姬鋆屾

pref:代码优化对备注2无法显示动态数组得问题做处理

parent 3c2ce6e6
......@@ -22,45 +22,9 @@ export default {
name: "Dept",
mixins: [table],
components: { Treeselect, dialogShow },
created() {},
methods: {
afterRender(data) {
data.data = handleTree(data.data, "id", "parentId");
console.log("tree", data.data);
this.deptOptions = data.data;
this.$refs.layoutTable.showType = "treetable";
},
handleAdd(row) {
this.$refs.dialogform.add(row, this.deptOptions);
},
/** 重写新增方法 */
toAdd(row) {
this.$refs.dialogform.add(row, this.deptOptions);
},
/** 重写编辑方法 */
toEdit(row) {
this.loading = true;
this.$post(this.pageInfo.exclude, { id: row.id })
.then((res) => {
if (res && res.code && res.code == 1) {
this.deptOptions = handleTree(res.data.result);
this.$refs.dialogform.edit(row, this.deptOptions);
this.loading = false;
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row, this.deptOptions);
},
},
data() {
return {
// 表格配置项
config: {
/** 树表是否默认展开 */
expand: true,
......@@ -107,6 +71,44 @@ export default {
},
};
},
created() {},
methods: {
// 获取数据后处理
afterRender(data) {
data.data = handleTree(data.data, "id", "parentId");
console.log("tree", data.data);
this.deptOptions = data.data;
this.$refs.layoutTable.showType = "treetable";
},
// 新增操作
handleAdd(row) {
this.$refs.dialogform.add(row, this.deptOptions);
},
/** 重写新增方法 */
toAdd(row) {
this.$refs.dialogform.add(row, this.deptOptions);
},
/** 重写编辑方法 */
toEdit(row) {
this.loading = true;
this.$post(this.pageInfo.exclude, { id: row.id })
.then((res) => {
if (res && res.code && res.code == 1) {
this.deptOptions = handleTree(res.data.result);
this.$refs.dialogform.edit(row, this.deptOptions);
this.loading = false;
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row, this.deptOptions);
},
},
};
</script>
<style lang="scss">
......
......@@ -91,237 +91,6 @@ export default {
BarCharts,
},
mixins: [table],
created() {
this.getData();
},
methods: {
handleCellClick(row, column, event, cell) {
if (column.label == "图片凭证") {
const suffix = `(bmp|jpg|png|tif|gif|pcx|tga|exif|fpx|svg|psd|cdr|pcd|dxf|ufo|eps|ai|raw|WMF|webp|jpeg)`;
const regular = new RegExp(`.*\.${suffix}`);
regular.test(row.filePaths);
if (!regular.test(row.filePaths)) {
downloadFile(row.filePaths, row.fileName);
}
}
},
handleClick() {
this.query.page = 1;
this.query.size = 10;
console.log(this.tableConfig);
this.activeName == 1
? ""
: (this.tableConfig.columns = [
{ type: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 },
{
label: "窗口首席代表",
prop: "appealPerson",
},
{ label: "姓名", prop: "staffName", formatter: this.formatter },
{
label: "所属大厅",
prop: "salaName",
formatter: this.formatter,
},
{
label: "所属部门",
prop: "deptName",
formatter: this.formatter,
},
{
label: "违规类型",
prop: "irregularType",
formatter: this.formatter,
},
{
label: "绩效规则",
prop: "ruleId",
formatter: this.formatter,
},
{
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
// {
// label: "加分/扣分方式",
// prop: "subAddType",
// formatter: this.formatter,
// },
{
label: "加分/扣分时间",
prop: "deductTime",
formatter: this.formatterDate,
},
{ label: "分值", prop: "score", formatter: this.formatter },
{
label: "申诉时间",
prop: "appealTime",
formatter: this.formatterDate,
},
{
label: "申诉人",
prop: "appealPerson",
formatter: this.formatter,
},
{
label: "处理时间",
prop: "processTime",
formatter: this.formatterDate,
},
{
label: "处理人员",
prop: "processPerson",
formatter: this.formatter,
},
{
label: "是否核查",
prop: "checkStatus",
formatter: this.formatter,
},
{
label: "处理状态",
prop: "processStatus",
formatter: this.formatter,
},
/* {label: "绩效记录申诉附件信息",
width: 120,
prop: "subColumns",
formatter: (row) => {
let widthsize = this.columnSet.reduce((pre, cur) => {
return pre + Number(cur.width);
}, 50);
return (
<el-popover placement="right" width={widthsize} trigger="click">
{this.renderTable(row.performAttendAppealFilesList)}
<el-button type="text" slot="reference">详细</el-button>
</el-popover>
);
},
},*/
{
label: "操作",
formatter: (row) => {
return row.processStatus == 2 ? (
<table-buttons
noAdd
noDel
noEdit
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
) : (
<table-buttons
noAdd
noDel
noView
noEdit
chuli
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
);
},
},
]);
this.getData();
},
getData() {
let obj = {
processStatus: this.activeName == 1 ? "1" : "2",
page: this.query.page,
size: this.query.size,
appealTimeStart: this.query.yearmonth
? this.query.yearmonth + "-01"
: "",
appealTimeEnd: this.query.yearmonth ? this.query.yearmonth + "-31" : "",
staffName: this.query.staffName,
salaId:this.query.salaId,
deptId:this.query.deptId,
checkStatus: this.query.checkStatus,
irregularOtherType: this.query.irregularOtherType,
};
this.activeName == 2
? (obj.appealResult = 1)
: this.activeName == 3
? (obj.appealResult = 2)
: "";
this.activeName == 1 || this.activeName == 2 || this.activeName == 3
? this.$post("/perform/attend/appeal/list", obj).then((res) => {
if (res.code == 1) {
this.tableData = res.data;
this.dict = res.dict;
}
})
: this.getChartsData();
},
getChartsData() {
this.$post("/perform/attend/appeal/stat", {
appealTimeStart: this.dateValue,
statType: 1,
}).then((res) => {
console.log(res);
this.depChartsData = res.data;
});
this.$post("/perform/attend/appeal/stat", {
appealTimeStart: this.dateValue,
statType: 2,
}).then((res) => {
console.log(res);
this.personChartsData = res.data;
});
this.$post("/perform/attend/appeal/stat", {
appealTimeStart: this.dateValue,
statType: 3,
}).then((res) => {
console.log(res);
this.ruleChartsData = res.data;
});
},
renderTable(tableData) {
return (
<el-table stripe data={tableData} class="total-table">
{this.columnSet.map((item) => this.renderTableColumn(item))}
</el-table>
);
},
renderTableColumn(options) {
return (
<el-table-column
prop={options.prop}
label={options.label}
width={options.width}
formatter={options.formatter}
></el-table-column>
);
},
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
data() {
return {
depChartsData: [],
......@@ -555,6 +324,237 @@ export default {
dateValue: "2024-03-01 00:00:00",
};
},
created() {
this.getData();
},
methods: {
handleCellClick(row, column, event, cell) {
if (column.label == "图片凭证") {
const suffix = `(bmp|jpg|png|tif|gif|pcx|tga|exif|fpx|svg|psd|cdr|pcd|dxf|ufo|eps|ai|raw|WMF|webp|jpeg)`;
const regular = new RegExp(`.*\.${suffix}`);
regular.test(row.filePaths);
if (!regular.test(row.filePaths)) {
downloadFile(row.filePaths, row.fileName);
}
}
},
handleClick() {
this.query.page = 1;
this.query.size = 10;
console.log(this.tableConfig);
this.activeName == 1
? ""
: (this.tableConfig.columns = [
{ type: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 },
{
label: "窗口首席代表",
prop: "appealPerson",
},
{ label: "姓名", prop: "staffName", formatter: this.formatter },
{
label: "所属大厅",
prop: "salaName",
formatter: this.formatter,
},
{
label: "所属部门",
prop: "deptName",
formatter: this.formatter,
},
{
label: "违规类型",
prop: "irregularType",
formatter: this.formatter,
},
{
label: "绩效规则",
prop: "ruleId",
formatter: this.formatter,
},
{
label: "加分/扣分方式",
prop: "subMethod",
formatter: this.formatter,
},
// {
// label: "加分/扣分方式",
// prop: "subAddType",
// formatter: this.formatter,
// },
{
label: "加分/扣分时间",
prop: "deductTime",
formatter: this.formatterDate,
},
{ label: "分值", prop: "score", formatter: this.formatter },
{
label: "申诉时间",
prop: "appealTime",
formatter: this.formatterDate,
},
{
label: "申诉人",
prop: "appealPerson",
formatter: this.formatter,
},
{
label: "处理时间",
prop: "processTime",
formatter: this.formatterDate,
},
{
label: "处理人员",
prop: "processPerson",
formatter: this.formatter,
},
{
label: "是否核查",
prop: "checkStatus",
formatter: this.formatter,
},
{
label: "处理状态",
prop: "processStatus",
formatter: this.formatter,
},
/* {label: "绩效记录申诉附件信息",
width: 120,
prop: "subColumns",
formatter: (row) => {
let widthsize = this.columnSet.reduce((pre, cur) => {
return pre + Number(cur.width);
}, 50);
return (
<el-popover placement="right" width={widthsize} trigger="click">
{this.renderTable(row.performAttendAppealFilesList)}
<el-button type="text" slot="reference">详细</el-button>
</el-popover>
);
},
},*/
{
label: "操作",
formatter: (row) => {
return row.processStatus == 2 ? (
<table-buttons
noAdd
noDel
noEdit
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
) : (
<table-buttons
noAdd
noDel
noView
noEdit
chuli
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
);
},
},
]);
this.getData();
},
getData() {
let obj = {
processStatus: this.activeName == 1 ? "1" : "2",
page: this.query.page,
size: this.query.size,
appealTimeStart: this.query.yearmonth
? this.query.yearmonth + "-01"
: "",
appealTimeEnd: this.query.yearmonth ? this.query.yearmonth + "-31" : "",
staffName: this.query.staffName,
salaId: this.query.salaId,
deptId: this.query.deptId,
checkStatus: this.query.checkStatus,
irregularOtherType: this.query.irregularOtherType,
};
this.activeName == 2
? (obj.appealResult = 1)
: this.activeName == 3
? (obj.appealResult = 2)
: "";
this.activeName == 1 || this.activeName == 2 || this.activeName == 3
? this.$post("/perform/attend/appeal/list", obj).then((res) => {
if (res.code == 1) {
this.tableData = res.data;
this.dict = res.dict;
}
})
: this.getChartsData();
},
getChartsData() {
this.$post("/perform/attend/appeal/stat", {
appealTimeStart: this.dateValue,
statType: 1,
}).then((res) => {
console.log(res);
this.depChartsData = res.data;
});
this.$post("/perform/attend/appeal/stat", {
appealTimeStart: this.dateValue,
statType: 2,
}).then((res) => {
console.log(res);
this.personChartsData = res.data;
});
this.$post("/perform/attend/appeal/stat", {
appealTimeStart: this.dateValue,
statType: 3,
}).then((res) => {
console.log(res);
this.ruleChartsData = res.data;
});
},
renderTable(tableData) {
return (
<el-table stripe data={tableData} class="total-table">
{this.columnSet.map((item) => this.renderTableColumn(item))}
</el-table>
);
},
renderTableColumn(options) {
return (
<el-table-column
prop={options.prop}
label={options.label}
width={options.width}
formatter={options.formatter}
></el-table-column>
);
},
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
};
</script>
<style lang="less" scoped>
......
......@@ -79,85 +79,6 @@ export default {
drawerShow,
},
mixins: [table],
created() {},
methods: {
handleCellClick(row, column, event, cell) {
if (column.label == "图片凭证") {
const suffix = `(bmp|jpg|png|tif|gif|pcx|tga|exif|fpx|svg|psd|cdr|pcd|dxf|ufo|eps|ai|raw|WMF|webp|jpeg)`;
const regular = new RegExp(`.*\.${suffix}`);
regular.test(row.filePaths);
if (!regular.test(row.filePaths)) {
downloadFile(row.filePaths, row.fileName);
}
}
},
/** 导入 */
handleImport() {
this.upload.title = "考勤绩效记录信息导入";
this.upload.open = true;
},
/** 下载模板操作 */
downloadTemplate() {
this.isExport = true;
this.$download(
"/perform/attend/record/downloadTemplate",
{},
{ type: "excel" }
)
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
},
/** 文件上传中处理 */
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(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getData();
},
/** 提交上传文件 */
submitFileForm() {
this.$refs.upload.submit();
},
/** 导出Excel */
doExport() {
this.isExport = true;
this.$download(
"/perform/attend/record/exportExcel",
{
page: 1,
size: -1,
},
{ type: "excel", name: "考勤绩效管理" }
)
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
},
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
row.view = "核查";
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
row.view = "查看";
this.$refs.drawerform.view(row);
},
},
data() {
return {
// 用户导入参数
......@@ -173,7 +94,9 @@ export default {
// 上传的地址
url: "/attendance/perform/attend/record/importData",
},
// 导出按钮加载状态
isExport: false,
// 表格配置项
config: {
isshowTabPane: true,
search: [
......@@ -319,5 +242,85 @@ export default {
},
};
},
created() {},
methods: {
// 图片凭证点击操作
handleCellClick(row, column, event, cell) {
if (column.label == "图片凭证") {
const suffix = `(bmp|jpg|png|tif|gif|pcx|tga|exif|fpx|svg|psd|cdr|pcd|dxf|ufo|eps|ai|raw|WMF|webp|jpeg)`;
const regular = new RegExp(`.*\.${suffix}`);
regular.test(row.filePaths);
if (!regular.test(row.filePaths)) {
downloadFile(row.filePaths, row.fileName);
}
}
},
/** 导入 */
handleImport() {
this.upload.title = "考勤绩效记录信息导入";
this.upload.open = true;
},
/** 下载模板操作 */
downloadTemplate() {
this.isExport = true;
this.$download(
"/perform/attend/record/downloadTemplate",
{},
{ type: "excel" }
)
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
},
/** 文件上传中处理 */
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(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getData();
},
/** 提交上传文件 */
submitFileForm() {
this.$refs.upload.submit();
},
/** 导出Excel */
doExport() {
this.isExport = true;
this.$download(
"/perform/attend/record/exportExcel",
{
page: 1,
size: -1,
},
{ type: "excel", name: "考勤绩效管理" }
)
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
},
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
row.view = "核查";
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
row.view = "查看";
this.$refs.drawerform.view(row);
},
},
};
</script>
......@@ -327,7 +327,11 @@ export default {
v.value = v.name + "--" + v.content;
})
: "";
if (!this.form.remarkAdd || this.form.remarkAdd.length == 0) {
if (
!this.form.remarkAdd ||
this.form.remarkAdd.length == 0 ||
this.form.remarkAdd != ""
) {
this.form.remarkAdd = [];
this.form.remarkAdd.push({
name: "",
......
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