Merge branch 'develop' of ssh://git.gezi.vip:6006/gx/dootask into develop
# Conflicts: # resources/assets/js/pages/manage/components/ReportDetail.vue # resources/assets/js/pages/manage/components/ReportEdit.vue
This commit is contained in:
commit
c33be22057
@ -230,6 +230,7 @@ class ReportController extends AbstractController
|
||||
$user = User::auth();
|
||||
$type = trim(Request::input("type"));
|
||||
$offset = abs(intval(Request::input("offset", 0)));
|
||||
$id = intval(Request::input("offset", 0));
|
||||
$now_dt = trim(Request::input("date")) ? Carbon::parse(Request::input("date")) : Carbon::now();
|
||||
// 获取开始时间
|
||||
if ($type === Report::DAILY) {
|
||||
@ -256,7 +257,7 @@ class ReportController extends AbstractController
|
||||
$sign = Report::generateSign($type, 0, Carbon::instance($start_time));
|
||||
$one = Report::query()->whereSign($sign)->first();
|
||||
// 如果已经提交了相关汇报
|
||||
if ($one) {
|
||||
if ($one && $id > 0) {
|
||||
return Base::retSuccess('success', [
|
||||
"content" => $one->content,
|
||||
"title" => $one->title,
|
||||
@ -312,7 +313,7 @@ class ReportController extends AbstractController
|
||||
} else {
|
||||
$title = $user->nickname . "的日报[" . $start_time->format("Y/m/d") . "]";
|
||||
}
|
||||
return Base::retSuccess('success', [
|
||||
$data = [
|
||||
"time" => $start_time->toDateTimeString(),
|
||||
"complete_task" => $complete_task,
|
||||
"unfinished_task" => $unfinished_task,
|
||||
@ -321,7 +322,11 @@ class ReportController extends AbstractController
|
||||
Base::Lang('未完成的工作') . '</h2><ol>' .
|
||||
$unfinishedContent . '</ol>',
|
||||
"title" => $title,
|
||||
]);
|
||||
];
|
||||
if ($one) {
|
||||
$data['id'] = $one->id;
|
||||
}
|
||||
return Base::retSuccess('success', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -31,7 +31,7 @@
|
||||
</Col>
|
||||
<Col span="6">
|
||||
<div class="report-submitter">
|
||||
<UserAvatar v-for="item in data.receives_user" :key="item.userid" :userid="item.userid" :size="28"/>
|
||||
<UserAvatar v-for="(item, key) in data.receives_user" :key="key" :userid="item.userid" :size="28"/>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
|
@ -6,18 +6,18 @@
|
||||
</Col>
|
||||
<Col span="12">
|
||||
<RadioGroup type="button" button-style="solid" v-model="reportData.type" @on-change="typeChange" class="report-radiogroup" :readonly="id > 0">
|
||||
<Radio label="weekly" :disabled="id > 0">{{ $L("周报") }}</Radio>
|
||||
<Radio label="daily" :disabled="id > 0">{{ $L("日报") }}</Radio>
|
||||
<Radio label="weekly" :disabled="id > 0 && reportData.type =='daily'">{{ $L("周报") }}</Radio>
|
||||
<Radio label="daily" :disabled="id > 0 && reportData.type =='weekly'">{{ $L("日报") }}</Radio>
|
||||
</RadioGroup>
|
||||
<ButtonGroup class="report-buttongroup">
|
||||
<Tooltip class="report-poptip" trigger="hover" :disabled="id > 0" :content="prevCycleText" placement="bottom">
|
||||
<Button type="primary" @click="prevCycle" :disabled="id > 0">
|
||||
<ButtonGroup class="report-buttongroup" v-if="id === 0">
|
||||
<Tooltip class="report-poptip" trigger="hover" :content="prevCycleText" placement="bottom">
|
||||
<Button type="primary" @click="prevCycle">
|
||||
<Icon type="ios-arrow-back" />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<div class="report-buttongroup-vertical"></div>
|
||||
<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 || id > 0">
|
||||
<Tooltip class="report-poptip" trigger="hover" :disabled="reportData.offset >= 0" :content="nextCycleText" placement="bottom">
|
||||
<Button type="primary" @click="nextCycle" :disabled="reportData.offset >= 0">
|
||||
<Icon type="ios-arrow-forward" />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
@ -103,6 +103,11 @@ export default {
|
||||
id(val) {
|
||||
if (this.id > 0) {
|
||||
this.getDetail(val);
|
||||
}else{
|
||||
this.reportData.offset = 0;
|
||||
this.reportData.type = "weekly";
|
||||
this.reportData.receive = [];
|
||||
this.getTemplate();
|
||||
}
|
||||
},
|
||||
},
|
||||
@ -120,6 +125,10 @@ 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) {
|
||||
$A.modalConfirm({
|
||||
title: '覆盖提交',
|
||||
@ -144,6 +153,8 @@ export default {
|
||||
}).then(({data, msg}) => {
|
||||
// data 结果数据
|
||||
this.reportData.offset = 0;
|
||||
this.reportData.type = "weekly";
|
||||
this.reportData.receive = [];
|
||||
this.getTemplate();
|
||||
this.disabledType = false;
|
||||
this.$Modal.remove();
|
||||
@ -151,6 +162,7 @@ export default {
|
||||
$A.messageSuccess(msg);
|
||||
this.$emit("saveSuccess");
|
||||
}).catch(({msg}) => {
|
||||
this.$Modal.remove();
|
||||
// msg 错误原因
|
||||
$A.messageError(msg);
|
||||
});
|
||||
@ -161,17 +173,25 @@ export default {
|
||||
url: 'report/template',
|
||||
data: {
|
||||
type: this.reportData.type,
|
||||
offset: this.reportData.offset
|
||||
offset: this.reportData.offset,
|
||||
id: this.id
|
||||
},
|
||||
method: 'get',
|
||||
}).then(({data, msg}) => {
|
||||
// data 结果数据
|
||||
if (data.id) {
|
||||
this.reportData.id = data.id;
|
||||
if(this.id > 0){
|
||||
this.getDetail(data.id);
|
||||
}else{
|
||||
this.reportData.title = data.title;
|
||||
this.reportData.content = data.content;
|
||||
}
|
||||
} else {
|
||||
this.reportData.id = 0;
|
||||
this.reportData.title = data.title;
|
||||
this.reportData.content = data.content;
|
||||
}
|
||||
// msg 结果描述
|
||||
}).catch(({msg}) => {
|
||||
// msg 错误原因
|
||||
@ -189,8 +209,6 @@ export default {
|
||||
this.prevCycleText = this.$L("上一天");
|
||||
this.nextCycleText = this.$L("下一天");
|
||||
}
|
||||
|
||||
if (this.id <= 0)
|
||||
this.getTemplate();
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user