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

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

parent 3c2ce6e6
...@@ -22,45 +22,9 @@ export default { ...@@ -22,45 +22,9 @@ export default {
name: "Dept", name: "Dept",
mixins: [table], mixins: [table],
components: { Treeselect, dialogShow }, 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() { data() {
return { return {
// 表格配置项
config: { config: {
/** 树表是否默认展开 */ /** 树表是否默认展开 */
expand: true, expand: true,
...@@ -107,6 +71,44 @@ export default { ...@@ -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> </script>
<style lang="scss"> <style lang="scss">
......
...@@ -91,33 +91,65 @@ export default { ...@@ -91,33 +91,65 @@ export default {
BarCharts, BarCharts,
}, },
mixins: [table], mixins: [table],
created() { data() {
this.getData(); return {
depChartsData: [],
personChartsData: [],
ruleChartsData: [],
/** 子表列元素 */
columnSet: [
{ label: "申诉Id", prop: "appealId", formatter: this.formatter },
{ label: "文件名称", prop: "fileName" },
{ label: "文件地址", prop: "filePath" },
],
config: {
isshowTabPane: false,
search: [
{
name: "checkStatus",
type: "select",
label: "核查情况",
fuzzy: false,
}, },
methods: { {
handleCellClick(row, column, event, cell) { name: "irregularOtherType",
if (column.label == "图片凭证") { type: "select",
const suffix = `(bmp|jpg|png|tif|gif|pcx|tga|exif|fpx|svg|psd|cdr|pcd|dxf|ufo|eps|ai|raw|WMF|webp|jpeg)`; label: "全部类型",
const regular = new RegExp(`.*\.${suffix}`); fuzzy: false,
regular.test(row.filePaths);
if (!regular.test(row.filePaths)) {
downloadFile(row.filePaths, row.fileName);
}
}
}, },
handleClick() { {
this.query.page = 1; name: "salaId",
this.query.size = 10; type: "selectSalaId",
console.log(this.tableConfig); label: "大厅",
this.activeName == 1 fuzzy: false,
? "" },
: (this.tableConfig.columns = [ {
name: "deptId",
type: "selectDeptId",
label: "部门",
fuzzy: false,
},
{
name: "yearmonth",
type: "month",
label: "请选择申诉时间",
fuzzy: false,
},
{
name: "staffName",
type: "text",
label: "员工姓名搜索",
fuzzy: true,
},
],
columns: [
{ type: "selection", width: 60 }, { type: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 }, { type: "index", label: "序号", width: 50 },
{ {
label: "窗口首席代表", label: "窗口首席代表",
prop: "appealPerson", prop: "appealPerson",
formatter: this.formatter,
}, },
{ label: "姓名", prop: "staffName", formatter: this.formatter }, { label: "姓名", prop: "staffName", formatter: this.formatter },
{ {
...@@ -172,16 +204,16 @@ export default { ...@@ -172,16 +204,16 @@ export default {
prop: "appealPerson", prop: "appealPerson",
formatter: this.formatter, formatter: this.formatter,
}, },
{ // {
label: "处理时间", // label: "处理时间",
prop: "processTime", // prop: "processTime",
formatter: this.formatterDate, // formatter: this.formatterDate,
}, // },
{ // {
label: "处理人员", // label: "处理人员",
prop: "processPerson", // prop: "processPerson",
formatter: this.formatter, // formatter: this.formatter,
}, // },
{ {
label: "是否核查", label: "是否核查",
prop: "checkStatus", prop: "checkStatus",
...@@ -236,151 +268,89 @@ export default { ...@@ -236,151 +268,89 @@ export default {
); );
}, },
}, },
]); ],
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) { activeName: "1",
return ( optionsMonths: [
<el-table stripe data={tableData} class="total-table"> {
{this.columnSet.map((item) => this.renderTableColumn(item))} value: "2024-01-01 00:00:00",
</el-table> label: "1月",
);
}, },
renderTableColumn(options) { {
return ( value: "2024-02-01 00:00:00",
<el-table-column label: "2月",
prop={options.prop}
label={options.label}
width={options.width}
formatter={options.formatter}
></el-table-column>
);
}, },
/** 重写新增方法 */ {
toAdd(row) { value: "2024-03-01 00:00:00",
this.$refs.drawerform.add(row); label: "3月",
}, },
/** 重写编辑方法 */ {
toEdit(row) { value: "2024-04-01 00:00:00",
this.$refs.drawerform.edit(row); label: "4月",
}, },
/** 重写查看方法 */ {
toView(row) { value: "2024-05-01 00:00:00",
this.$refs.drawerform.view(row); label: "5月",
}, },
{
value: "2024-06-01 00:00:00",
label: "6月",
}, },
data() {
return {
depChartsData: [],
personChartsData: [],
ruleChartsData: [],
/** 子表列元素 */
columnSet: [
{ label: "申诉Id", prop: "appealId", formatter: this.formatter },
{ label: "文件名称", prop: "fileName" },
{ label: "文件地址", prop: "filePath" },
],
config: {
isshowTabPane: false,
search: [
{ {
name: "checkStatus", value: "2024-07-01 00:00:00",
type: "select", label: "7月",
label: "核查情况",
fuzzy: false,
}, },
{ {
name: "irregularOtherType", value: "2024-08-01 00:00:00",
type: "select", label: "8月",
label: "全部类型",
fuzzy: false,
}, },
{ {
name: "salaId", value: "2024-09-01 00:00:00",
type: "selectSalaId", label: "9月",
label: "大厅",
fuzzy: false,
}, },
{ {
name: "deptId", value: "2024-10-01 00:00:00",
type: "selectDeptId", label: "10月",
label: "部门",
fuzzy: false,
}, },
{ {
name: "yearmonth", value: "2024-11-01 00:00:00",
type: "month", label: "11月",
label: "请选择申诉时间",
fuzzy: false,
}, },
{ {
name: "staffName", value: "2024-12-01 00:00:00",
type: "text", label: "12月",
label: "员工姓名搜索",
fuzzy: true,
}, },
], ],
columns: [ 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: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 }, { type: "index", label: "序号", width: 50 },
{ {
label: "窗口首席代表", label: "窗口首席代表",
prop: "appealPerson", prop: "appealPerson",
formatter: this.formatter,
}, },
{ label: "姓名", prop: "staffName", formatter: this.formatter }, { label: "姓名", prop: "staffName", formatter: this.formatter },
{ {
...@@ -435,16 +405,16 @@ export default { ...@@ -435,16 +405,16 @@ export default {
prop: "appealPerson", prop: "appealPerson",
formatter: this.formatter, formatter: this.formatter,
}, },
// { {
// label: "处理时间", label: "处理时间",
// prop: "processTime", prop: "processTime",
// formatter: this.formatterDate, formatter: this.formatterDate,
// }, },
// { {
// label: "处理人员", label: "处理人员",
// prop: "processPerson", prop: "processPerson",
// formatter: this.formatter, formatter: this.formatter,
// }, },
{ {
label: "是否核查", label: "是否核查",
prop: "checkStatus", prop: "checkStatus",
...@@ -499,61 +469,91 @@ export default { ...@@ -499,61 +469,91 @@ export default {
); );
}, },
}, },
], ]);
}, this.getData();
activeName: "1",
optionsMonths: [
{
value: "2024-01-01 00:00:00",
label: "1月",
},
{
value: "2024-02-01 00:00:00",
label: "2月",
},
{
value: "2024-03-01 00:00:00",
label: "3月",
},
{
value: "2024-04-01 00:00:00",
label: "4月",
},
{
value: "2024-05-01 00:00:00",
label: "5月",
}, },
{ getData() {
value: "2024-06-01 00:00:00", let obj = {
label: "6月", 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() {
value: "2024-07-01 00:00:00", this.$post("/perform/attend/appeal/stat", {
label: "7月", 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) {
value: "2024-08-01 00:00:00", return (
label: "8月", <el-table stripe data={tableData} class="total-table">
{this.columnSet.map((item) => this.renderTableColumn(item))}
</el-table>
);
}, },
{ renderTableColumn(options) {
value: "2024-09-01 00:00:00", return (
label: "9月", <el-table-column
prop={options.prop}
label={options.label}
width={options.width}
formatter={options.formatter}
></el-table-column>
);
}, },
{ /** 重写新增方法 */
value: "2024-10-01 00:00:00", toAdd(row) {
label: "10月", this.$refs.drawerform.add(row);
}, },
{ /** 重写编辑方法 */
value: "2024-11-01 00:00:00", toEdit(row) {
label: "11月", this.$refs.drawerform.edit(row);
}, },
{ /** 重写查看方法 */
value: "2024-12-01 00:00:00", toView(row) {
label: "12月", this.$refs.drawerform.view(row);
}, },
],
dateValue: "2024-03-01 00:00:00",
};
}, },
}; };
</script> </script>
......
...@@ -79,85 +79,6 @@ export default { ...@@ -79,85 +79,6 @@ export default {
drawerShow, drawerShow,
}, },
mixins: [table], 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() { data() {
return { return {
// 用户导入参数 // 用户导入参数
...@@ -173,7 +94,9 @@ export default { ...@@ -173,7 +94,9 @@ export default {
// 上传的地址 // 上传的地址
url: "/attendance/perform/attend/record/importData", url: "/attendance/perform/attend/record/importData",
}, },
// 导出按钮加载状态
isExport: false, isExport: false,
// 表格配置项
config: { config: {
isshowTabPane: true, isshowTabPane: true,
search: [ search: [
...@@ -319,5 +242,85 @@ export default { ...@@ -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> </script>
...@@ -327,7 +327,11 @@ export default { ...@@ -327,7 +327,11 @@ export default {
v.value = v.name + "--" + v.content; 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 = [];
this.form.remarkAdd.push({ this.form.remarkAdd.push({
name: "", 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