|
@@ -52,6 +52,7 @@ const { push } = useRouter()
|
|
|
const { ZmTable, ZmTableColumn } = useTableComponents<ProjectTaskRow>()
|
|
const { ZmTable, ZmTableColumn } = useTableComponents<ProjectTaskRow>()
|
|
|
|
|
|
|
|
const COMPLETED_STATUS = 'wg'
|
|
const COMPLETED_STATUS = 'wg'
|
|
|
|
|
+const REPORT_DEPT_ID = 163
|
|
|
|
|
|
|
|
const initQuery: QueryParams = {
|
|
const initQuery: QueryParams = {
|
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
@@ -87,6 +88,10 @@ const planList = ref<PlanRow[]>([])
|
|
|
const saveLoading = ref(false)
|
|
const saveLoading = ref(false)
|
|
|
const currentRow = ref<ProjectTaskRow | null>(null)
|
|
const currentRow = ref<ProjectTaskRow | null>(null)
|
|
|
const workProgressDictOptions = ref<any[]>([])
|
|
const workProgressDictOptions = ref<any[]>([])
|
|
|
|
|
+const generateReportDialogVisible = ref(false)
|
|
|
|
|
+const generateReportLoading = ref(false)
|
|
|
|
|
+const generateReportRow = ref<ProjectTaskRow | null>(null)
|
|
|
|
|
+const reportDate = ref('')
|
|
|
|
|
|
|
|
const getWorkProgressDictOptions = () => {
|
|
const getWorkProgressDictOptions = () => {
|
|
|
workProgressDictOptions.value = getStrDictOptions(DICT_TYPE.PMS_PROJECT_TASK_SCHEDULE)
|
|
workProgressDictOptions.value = getStrDictOptions(DICT_TYPE.PMS_PROJECT_TASK_SCHEDULE)
|
|
@@ -187,6 +192,37 @@ const savePlan = async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const openGenerateReportDialog = (row: ProjectTaskRow) => {
|
|
|
|
|
+ generateReportRow.value = row
|
|
|
|
|
+ reportDate.value = ''
|
|
|
|
|
+ generateReportDialogVisible.value = true
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const submitGenerateReport = async () => {
|
|
|
|
|
+ if (!generateReportRow.value?.id) {
|
|
|
|
|
+ message.error('未找到任务信息')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!reportDate.value) {
|
|
|
|
|
+ message.error('请选择日报日期')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ generateReportLoading.value = true
|
|
|
|
|
+ await IotProjectTaskApi.generateReport({
|
|
|
|
|
+ id: generateReportRow.value.id,
|
|
|
|
|
+ reportDate: dayjs(reportDate.value).valueOf()
|
|
|
|
|
+ })
|
|
|
|
|
+ message.success('生成日报成功')
|
|
|
|
|
+ generateReportDialogVisible.value = false
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ message.error('生成日报失败')
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ generateReportLoading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
try {
|
|
try {
|
|
@@ -395,7 +431,7 @@ onMounted(async () => {
|
|
|
{{ dateFormatter(row, null, row.createTime) }}
|
|
{{ dateFormatter(row, null, row.createTime) }}
|
|
|
</template>
|
|
</template>
|
|
|
</ZmTableColumn>
|
|
</ZmTableColumn>
|
|
|
- <ZmTableColumn label="操作" width="170" fixed="right" action>
|
|
|
|
|
|
|
+ <ZmTableColumn label="操作" width="220" fixed="right" action>
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<el-button
|
|
<el-button
|
|
|
link
|
|
link
|
|
@@ -405,6 +441,14 @@ onMounted(async () => {
|
|
|
>
|
|
>
|
|
|
计划
|
|
计划
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="Number(row.deptId) === REPORT_DEPT_ID"
|
|
|
|
|
+ link
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="openGenerateReportDialog(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 生成日报
|
|
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
link
|
|
link
|
|
|
type="primary"
|
|
type="primary"
|
|
@@ -519,6 +563,35 @@ onMounted(async () => {
|
|
|
</span>
|
|
</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog v-model="generateReportDialogVisible" title="生成日报" width="420px">
|
|
|
|
|
+ <el-form size="default" label-width="80px">
|
|
|
|
|
+ <el-form-item label="日报日期" required>
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="reportDate"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ placeholder="请选择日期"
|
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
|
|
+ format="YYYY-MM-DD"
|
|
|
|
|
+ class="w-full!"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <span class="dialog-footer">
|
|
|
|
|
+ <el-button size="default" @click="generateReportDialogVisible = false">取消</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="default"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :loading="generateReportLoading"
|
|
|
|
|
+ @click="submitGenerateReport"
|
|
|
|
|
+ >
|
|
|
|
|
+ 确定
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|