优化工作报告前端

This commit is contained in:
kuaifan 2022-01-21 21:49:27 +08:00
parent c33be22057
commit da39739fb5
4 changed files with 43 additions and 47 deletions

View File

@ -11,7 +11,7 @@
<UserAvatar :userid="userId" :size="36" tooltipDisabled/>
</div>
<span>{{userInfo.nickname}}</span>
<Badge v-if="reportUnreadNumber > 0" class="manage-box-top-report" :count="reportUnreadNumber"/>
<Badge class="manage-box-top-report" :count="reportUnreadNumber"/>
<div class="manage-box-arrow">
<Icon type="ios-arrow-up" />
<Icon type="ios-arrow-down" />
@ -24,7 +24,7 @@
:divided="!!item.divided"
:name="item.path">
{{$L(item.name)}}
<Badge v-if="item.path === 'workReport'" @click.native="openReceiveReport" class="manage-menu-report-badge" :count="reportUnreadNumber"/>
<Badge v-if="item.path === 'workReport'" class="manage-menu-report-badge" :count="reportUnreadNumber"/>
</DropdownItem>
<Dropdown placement="right-start" @on-click="setTheme">
<DropdownItem divided>
@ -528,6 +528,9 @@ export default {
this.archivedProjectShow = true;
return;
case 'workReport':
if (this.reportUnreadNumber > 0) {
this.reportTabs = "receive";
}
this.workReportShow = true;
return;
case 'clearCache':
@ -742,7 +745,6 @@ export default {
},
getReportUnread() {
this.reportTabs = "my";
this.$store.dispatch("call", {
url: 'report/unread',
method: 'get',
@ -750,10 +752,6 @@ export default {
this.reportUnreadNumber = data.total ? data.total : 0;
}).catch(() => {});
},
openReceiveReport(){
this.reportTabs = "receive";
}
}
}
</script>

View File

@ -10,17 +10,17 @@
<Radio label="daily" :disabled="id > 0 && reportData.type =='weekly'">{{ $L("日报") }}</Radio>
</RadioGroup>
<ButtonGroup class="report-buttongroup" v-if="id === 0">
<Tooltip class="report-poptip" trigger="hover" :content="prevCycleText" placement="bottom">
<Button type="primary" @click="prevCycle">
<ETooltip class="report-poptip" :content="prevCycleText" placement="bottom">
<Button type="primary" @click="prevCycle">
<Icon type="ios-arrow-back" />
</Button>
</Tooltip>
</ETooltip>
<div class="report-buttongroup-vertical"></div>
<Tooltip class="report-poptip" trigger="hover" :disabled="reportData.offset >= 0" :content="nextCycleText" placement="bottom">
<Button type="primary" @click="nextCycle" :disabled="reportData.offset >= 0">
<ETooltip class="report-poptip" :disabled="reportData.offset >= 0" :content="nextCycleText" placement="bottom">
<Button type="primary" @click="nextCycle" :disabled="reportData.offset >= 0">
<Icon type="ios-arrow-forward" />
</Button>
</Tooltip>
</ETooltip>
</ButtonGroup>
</Col>
</Row>
@ -62,7 +62,7 @@
<Row class="report-row report-row-foot">
<Col span="2"></Col>
<Col span="4">
<Button type="primary" @click="handleSubmit" class="report-bottom">提交</Button>
<Button type="primary" @click="handleSubmit" class="report-bottom">{{$L(id > 0 ? '修改' : '提交')}}</Button>
</Col>
</Row>
</Form>
@ -124,15 +124,14 @@ export default {
},
handleSubmit: function () {
let id = this.reportData.id;
if (this.reportData.receive.length === 0) {
$A.messageError(this.$L("请选择接收人"));
return false;
}
if (this.id === 0 && id > 1) {
if (this.id === 0 && this.reportData.id > 1) {
$A.modalConfirm({
title: '覆盖提交',
content: '是否覆盖提交',
content: '你已提交过此日期的报告,是否覆盖提交',
loading: true,
zIndex: 2000,
onOk: () => {
@ -142,7 +141,6 @@ export default {
} else {
this.doSubmit();
}
},
doSubmit() {

View File

@ -114,8 +114,8 @@ export default {
align: 'center',
width: 100,
minWidth: 100,
render: (h, params) => {
if (!params.row.id) {
render: (h, {column, row}) => {
if (!row.id) {
return null;
}
const vNodes = [
@ -126,7 +126,7 @@ export default {
style: {margin: '0 3px', cursor: 'pointer'},
on: {
click: () => {
this.$emit("edit", params.row.id);
this.$emit("edit", row.id);
}
}
})]),
@ -138,14 +138,14 @@ export default {
style: {margin: '0 3px', cursor: 'pointer'},
on: {
click: () => {
this.$emit("detail", params.row);
this.$emit("detail", row);
}
}
})]),
];
return h('TableAction', {
props: {
column: params.column
column
}
}, vNodes);
},

View File

@ -103,13 +103,13 @@ export default {
initLanguage() {
this.noDataText = this.noDataText || "数据加载中.....";
this.columns = [{
"title": this.$L("标题"),
"key": 'title',
"sortable": true,
"minWidth": 120,
render: (h, params) => {
title: this.$L("标题"),
key: 'title',
sortable: true,
minWidth: 120,
render: (h, {row}) => {
let arr = []
const myUser = params.row.receives_user.find(({userid}) => userid == this.userId)
const myUser = row.receives_user.find(({userid}) => userid == this.userId)
if (myUser && myUser.pivot.read == 0) {
arr.push(
h('Tag', {
@ -117,35 +117,35 @@ export default {
color: "orange",
}
}, this.$L("未读")),
h('span', params.row.title)
h('span', row.title)
)
} else {
arr.push(
h('span', params.row.title)
h('span', row.title)
)
}
return h('div', arr)
}
}, {
"title": this.$L("类型"),
"key": 'type',
"align": 'center',
"sortable": true,
"maxWidth": 80,
title: this.$L("类型"),
key: 'type',
align: 'center',
sortable: true,
maxWidth: 80,
}, {
"title": this.$L("接收时间"),
"key": 'receive_time',
"align": 'center',
"sortable": true,
"maxWidth": 180,
title: this.$L("接收时间"),
key: 'receive_time',
align: 'center',
sortable: true,
maxWidth: 180,
}, {
title: this.$L("操作"),
align: 'center',
width: 100,
minWidth: 100,
render: (h, params) => {
if (!params.row.id) {
render: (h, {column, row}) => {
if (!row.id) {
return null;
}
const vNodes = [
@ -157,10 +157,10 @@ export default {
style: {margin: '0 3px', cursor: 'pointer'},
on: {
click: () => {
this.$emit("detail", params.row)
const myUser = params.row.receives_user.find(({userid}) => userid == this.userId)
this.$emit("detail", row)
const myUser = row.receives_user.find(({userid}) => userid == this.userId)
if (myUser) {
this.$set(myUser, 'pivot.read', 1)
this.$set(myUser.pivot, 'read', 1)
}
}
}
@ -168,7 +168,7 @@ export default {
];
return h('TableAction', {
props: {
column: params.column
column: column
}
}, vNodes);
},