perf: 工作报告优化
This commit is contained in:
parent
511c19d5aa
commit
2475ee90ee
@ -1,11 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="report">
|
<div class="report">
|
||||||
<Tabs v-model="reportTabs">
|
<Tabs v-model="reportTabs">
|
||||||
<TabPane :label="$L('填写汇报')" name="edit">
|
|
||||||
<ReportEdit :id="reportId" @saveSuccess="saveSuccess"></ReportEdit>
|
|
||||||
</TabPane>
|
|
||||||
<TabPane :label="$L('我的汇报')" name="my">
|
<TabPane :label="$L('我的汇报')" name="my">
|
||||||
<ReportMy v-if="reportTabs === 'my'" @detail="showDetail" @edit="editReport"></ReportMy>
|
<ReportMy ref="report" v-if="reportTabs === 'my'" @detail="showDetail" @edit="editReport"></ReportMy>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane :label="tabRebder(reportUnreadNumber)" name="receive">
|
<TabPane :label="tabRebder(reportUnreadNumber)" name="receive">
|
||||||
<ReportReceive v-if="reportTabs === 'receive'" @detail="showDetail"></ReportReceive>
|
<ReportReceive v-if="reportTabs === 'receive'" @detail="showDetail"></ReportReceive>
|
||||||
@ -18,6 +15,13 @@
|
|||||||
transfer>
|
transfer>
|
||||||
<ReportDetail :data="detailData"/>
|
<ReportDetail :data="detailData"/>
|
||||||
</DrawerOverlay>
|
</DrawerOverlay>
|
||||||
|
<DrawerOverlay
|
||||||
|
v-model="showEditDrawer"
|
||||||
|
placement="right"
|
||||||
|
:size="1000"
|
||||||
|
transfer>
|
||||||
|
<ReportEdit :id="reportId" @saveSuccess="saveSuccess"/>
|
||||||
|
</DrawerOverlay>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -47,6 +51,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
reportTabs: "my",
|
reportTabs: "my",
|
||||||
showDetailDrawer: false,
|
showDetailDrawer: false,
|
||||||
|
showEditDrawer: false,
|
||||||
detailData: {},
|
detailData: {},
|
||||||
reportId: 0
|
reportId: 0
|
||||||
}
|
}
|
||||||
@ -80,11 +85,13 @@ export default {
|
|||||||
},
|
},
|
||||||
editReport(id) {
|
editReport(id) {
|
||||||
this.reportId = id;
|
this.reportId = id;
|
||||||
this.reportTabs = "edit";
|
this.showEditDrawer = true;
|
||||||
},
|
},
|
||||||
saveSuccess() {
|
saveSuccess() {
|
||||||
this.reportId = 0;
|
this.reportId = 0;
|
||||||
this.reportTabs = "my";
|
this.reportTabs = "my";
|
||||||
|
this.showEditDrawer = false;
|
||||||
|
this.$refs.report.getLists();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,19 +3,19 @@
|
|||||||
<Row class="report-row report-row-header" >
|
<Row class="report-row report-row-header" >
|
||||||
<Col span="2"><p class="report-titles">{{ $L("汇报类型") }}</p></Col>
|
<Col span="2"><p class="report-titles">{{ $L("汇报类型") }}</p></Col>
|
||||||
<Col span="12">
|
<Col span="12">
|
||||||
<RadioGroup type="button" button-style="solid" v-model="reportData.type" @on-change="typeChange" class="report-radiogroup">
|
<RadioGroup type="button" button-style="solid" v-model="reportData.type" @on-change="typeChange" class="report-radiogroup" :readonly="id > 0">
|
||||||
<Radio label="weekly">{{ $L("周报") }}</Radio>
|
<Radio label="weekly" :disabled="id > 0">{{ $L("周报") }}</Radio>
|
||||||
<Radio label="daily">{{ $L("日报") }}</Radio>
|
<Radio label="daily" :disabled="id > 0">{{ $L("日报") }}</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
<ButtonGroup class="report-buttongroup">
|
<ButtonGroup class="report-buttongroup">
|
||||||
<Tooltip class="report-poptip" trigger="hover" :content="prevCycleText" placement="bottom">
|
<Tooltip class="report-poptip" trigger="hover" :disabled="id > 0" :content="prevCycleText" placement="bottom">
|
||||||
<Button type="primary" @click="prevCycle">
|
<Button type="primary" @click="prevCycle" :disabled="id > 0">
|
||||||
<Icon type="ios-arrow-back" />
|
<Icon type="ios-arrow-back" />
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<div class="report-buttongroup-shu"></div>
|
<div class="report-buttongroup-shu"></div>
|
||||||
<Tooltip class="report-poptip" trigger="hover" :disabled="reportData.offset >= 0" :content="nextCycleText" placement="bottom">
|
<Tooltip class="report-poptip" trigger="hover" :disabled="reportData.offset >= 0 || id > 0" :content="nextCycleText" placement="bottom">
|
||||||
<Button type="primary" @click="nextCycle" :disabled="reportData.offset >= 0">
|
<Button type="primary" @click="nextCycle" :disabled="reportData.offset >= 0 || id > 0">
|
||||||
<Icon type="ios-arrow-forward" />
|
<Icon type="ios-arrow-forward" />
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@ -93,7 +93,9 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
id(val) {
|
id(val) {
|
||||||
if (this.id > 0) this.getDetail(val);
|
if (this.id > 0) {
|
||||||
|
this.getDetail(val);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -108,14 +110,32 @@ export default {
|
|||||||
this.nextCycleText = this.$L("下一周");
|
this.nextCycleText = this.$L("下一周");
|
||||||
},
|
},
|
||||||
handleSubmit: function () {
|
handleSubmit: function () {
|
||||||
|
let id = this.reportData.id;
|
||||||
|
if (this.id === 0 && id > 1) {
|
||||||
|
$A.modalConfirm({
|
||||||
|
title: '覆盖提交',
|
||||||
|
content: '是否覆盖提交',
|
||||||
|
loading: true,
|
||||||
|
onOk: () => {
|
||||||
|
this.doSubmit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.doSubmit();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
doSubmit() {
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
url: 'report/store',
|
url: 'report/store',
|
||||||
data: this.reportData,
|
data: this.reportData,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
}).then(({data, msg}) => {
|
}).then(({data, msg}) => {
|
||||||
// data 结果数据
|
// data 结果数据
|
||||||
|
this.reportData.offset = 0;
|
||||||
this.getTemplate();
|
this.getTemplate();
|
||||||
this.disabledType = false;
|
this.disabledType = false;
|
||||||
|
this.$Modal.remove();
|
||||||
// msg 结果描述
|
// msg 结果描述
|
||||||
$A.messageSuccess(msg);
|
$A.messageSuccess(msg);
|
||||||
this.$emit("saveSuccess");
|
this.$emit("saveSuccess");
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="report-list-wrap">
|
<div class="report-list-wrap">
|
||||||
<Row class="reportmy-row report-row-header">
|
<Row class="reportmy-row report-row-header">
|
||||||
|
<Col span="3"><Button type="primary" @click="addReport">{{ $L("新增报告") }}</Button></Col>
|
||||||
<Col span="2"><p class="reportmy-titles">{{ $L("汇报类型") }}</p></Col>
|
<Col span="2"><p class="reportmy-titles">{{ $L("汇报类型") }}</p></Col>
|
||||||
<Col span="6">
|
<Col span="5">
|
||||||
<Select
|
<Select
|
||||||
v-model="reportType"
|
v-model="reportType"
|
||||||
style="width:95%"
|
style="width:95%"
|
||||||
@ -165,6 +166,10 @@ export default {
|
|||||||
searchTab() {
|
searchTab() {
|
||||||
this.getLists();
|
this.getLists();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
addReport() {
|
||||||
|
this.$emit("edit", 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
1
resources/assets/sass/components/report.scss
vendored
1
resources/assets/sass/components/report.scss
vendored
@ -153,6 +153,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
padding: 24px;
|
||||||
|
|
||||||
.report-row-header, .report-row-foot {
|
.report-row-header, .report-row-foot {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user