|
@@ -10,24 +10,25 @@
|
|
|
<CusForm labelWidth="100px" @handleEnter="onSearch">
|
|
|
<CusFormColumn
|
|
|
label="席位编号:"
|
|
|
- v-model:param="queryForm.shipId"/>
|
|
|
+ v-model:param="queryForm.seatSerialNumber"/>
|
|
|
<CusFormColumn
|
|
|
label="单位:"
|
|
|
- link="dept"
|
|
|
- v-model:param="queryForm.shipId"/>
|
|
|
+ link="select"
|
|
|
+ v-model:param="queryForm.unitId"
|
|
|
+ :options="$store.state.dictionary.deptList"/>
|
|
|
<CusFormColumn
|
|
|
label="提交人员:"
|
|
|
- v-model:param="queryForm.shipId"/>
|
|
|
+ v-model:param="queryForm.submitter"/>
|
|
|
<CusFormColumn
|
|
|
- label="周报时间:"
|
|
|
- link="datetime"
|
|
|
- type="datetimerange"
|
|
|
- v-model:param="queryForm.shipId"/>
|
|
|
+ label="日志日期:"
|
|
|
+ link="date"
|
|
|
+ type="daterange"
|
|
|
+ v-model:param="queryForm.dutyDate"/>
|
|
|
<CusFormColumn
|
|
|
label="提交时间:"
|
|
|
link="datetime"
|
|
|
type="datetimerange"
|
|
|
- v-model:param="queryForm.shipId"/>
|
|
|
+ v-model:param="queryForm.submitDate"/>
|
|
|
<CusSearchButtons
|
|
|
@handleReset="handleReset"
|
|
|
@handleSearch="onSearch"
|
|
@@ -49,7 +50,6 @@
|
|
|
:page="queryPage.pageNum"
|
|
|
:pageSize="queryPage.pageSize"
|
|
|
@handlePage="handlePage"
|
|
|
- @handleSort="handleSort"
|
|
|
>
|
|
|
<template #do-column-value="{ scope }">
|
|
|
<div class="__cus-table_do">
|
|
@@ -59,7 +59,7 @@
|
|
|
<div class="__cus-table_do-blue __hover" @click="onEdit(scope.row)">
|
|
|
<SvgIcon name="edit" size="16"/>编辑
|
|
|
</div>
|
|
|
- <div class="__cus-table_do-red __hover">
|
|
|
+ <div class="__cus-table_do-red __hover" @click="onDel(scope.row)">
|
|
|
<SvgIcon name="del" size="16"/>删除
|
|
|
</div>
|
|
|
</div>
|
|
@@ -68,7 +68,7 @@
|
|
|
</template>
|
|
|
</CusContent>
|
|
|
</div>
|
|
|
- <DetailCom v-model:show="showDetail" :transfer="transfer"/>
|
|
|
+ <DetailCom v-model:show="showDetail" :transfer="transfer" @refresh="handleSearch()"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -88,6 +88,8 @@ import {
|
|
|
import {useStore} from 'vuex'
|
|
|
import {useRouter, useRoute} from 'vue-router'
|
|
|
import DetailCom from './detail.vue'
|
|
|
+import {ElMessage, ElMessageBox} from 'element-plus'
|
|
|
+import {delDailyReportDelete, getDailyReportList} from "@/api/modules/daily";
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: '',
|
|
@@ -116,16 +118,14 @@ export default defineComponent({
|
|
|
queryForm: <any>{},
|
|
|
// 查询表单参数备份
|
|
|
back_queryForm: {},
|
|
|
- // 查询表格排序
|
|
|
- querySort: {},
|
|
|
// 表格表头
|
|
|
tableHead: [
|
|
|
- {value: "p1", label: "周报标题", show: true},
|
|
|
- {value: "p1", label: "席位编号", show: true},
|
|
|
- {value: "p1", label: "单位", show: true},
|
|
|
- {value: "p1", label: "提交人员", show: true},
|
|
|
- {value: "p1", label: "周报时间", show: true},
|
|
|
- {value: "p1", label: "提交时间", show: true},
|
|
|
+ {value: "title", label: "日志标题", show: true},
|
|
|
+ {value: "seatSerialNumber", label: "席位编号", show: true},
|
|
|
+ {value: "unitName", label: "单位", show: true},
|
|
|
+ {value: "submitter", label: "提交人员", show: true},
|
|
|
+ {value: "dutyTime", label: "日志日期", show: true},
|
|
|
+ {value: "submitTime", label: "提交时间", show: true},
|
|
|
{value: "do", label: "操作", show: true, popover: true, width: 260},
|
|
|
],
|
|
|
showDetail: false,
|
|
@@ -134,6 +134,7 @@ export default defineComponent({
|
|
|
const ref_cusTable = ref()
|
|
|
// 获取字典
|
|
|
const initDictionary = () => {
|
|
|
+ store.dispatch('dictionary/LOAD_DEPT')
|
|
|
}
|
|
|
// 查询分页参数改变处理方法
|
|
|
const handlePage = ({page, pageSize}: any) => {
|
|
@@ -141,11 +142,6 @@ export default defineComponent({
|
|
|
state.queryPage.pageSize = pageSize
|
|
|
handleSearch(page, pageSize)
|
|
|
}
|
|
|
- // 查询排序参数改变处理方法
|
|
|
- const handleSort = ({key, value}: any) => {
|
|
|
- state.querySort = key ? {key: value} : {}
|
|
|
- handleSearch()
|
|
|
- }
|
|
|
// 重置查询表单方法
|
|
|
const handleReset = () => {
|
|
|
state.queryForm = {}
|
|
@@ -154,50 +150,38 @@ export default defineComponent({
|
|
|
}
|
|
|
// 查询方法
|
|
|
const handleSearch = (page = 1, pageSize = 10) => {
|
|
|
- // 添加分页参数
|
|
|
const queryParams: any = {
|
|
|
pageNum: page,
|
|
|
pageSize: pageSize,
|
|
|
- sort: {},
|
|
|
- text: ''
|
|
|
- }
|
|
|
- // 添加排序参数
|
|
|
- for (const [k, v] of Object.entries(state.querySort)) {
|
|
|
- that.$util.isValue(v) ? (queryParams.sort[k] = v) : null;
|
|
|
}
|
|
|
// 添加表单参数
|
|
|
for (const [k, v] of Object.entries(state.back_queryForm)) {
|
|
|
- that.$util.isValue(v) ? (queryParams[k] = v) : null;
|
|
|
+ if (that.$util.isValue(v)) {
|
|
|
+ if (k === 'unitId') {
|
|
|
+ queryParams['unitName'] = store.state.dictionary.deptMap.get(v).organizationName
|
|
|
+ } else if (k === 'dutyDate') {
|
|
|
+ queryParams['beginDutyTime'] = v[0]
|
|
|
+ queryParams['endDutyTime'] = v[1]
|
|
|
+ } else if (k === 'submitDate') {
|
|
|
+ queryParams['beginTime'] = v[0]
|
|
|
+ queryParams['endTime'] = v[1]
|
|
|
+ } else {
|
|
|
+ queryParams[k] = v
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- // 添加复合查询参数
|
|
|
state.loading = true
|
|
|
-
|
|
|
- // mock
|
|
|
- const arr: any = []
|
|
|
- for (let i = 0; i < 77; i++) {
|
|
|
- arr.push({
|
|
|
- p1: '阿三顶顶顶顶顶顶顶顶顶顶顶顶顶' + i,
|
|
|
- fileList: [
|
|
|
- { "url": "http://8.140.240.182:18085/profile/upload/2023/10/23/6b7bf3b4-592a-4e2f-ba92-11923671ce3b.doc", "name": "迁移案例.doc"},
|
|
|
- ],
|
|
|
- })
|
|
|
- }
|
|
|
- state.queryResult.tableData = arr
|
|
|
- state.queryResult.total = arr.length
|
|
|
- state.loading = false
|
|
|
- // that.$api.patrolBoatList(that.$util.formatGetParam(queryParams)).then((res: { code: number; rows: never[]; total: number; }) => {
|
|
|
- // if (res.code === 200) {
|
|
|
- // state.queryResult.tableData = res.rows
|
|
|
- // state.queryResult.total = res.total
|
|
|
- // }
|
|
|
- // setTimeout(() => {
|
|
|
- // state.loading = false
|
|
|
- // }, 1000)
|
|
|
- // }).catch(() => {
|
|
|
- // setTimeout(() => {
|
|
|
- // state.loading = false
|
|
|
- // }, 1000)
|
|
|
- // })
|
|
|
+ that.$api.getDailyReportList(queryParams).then((res: any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ state.queryResult.tableData = res.rows
|
|
|
+ state.queryResult.total = res.total
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.message)
|
|
|
+ }
|
|
|
+ state.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ state.loading = false
|
|
|
+ })
|
|
|
}
|
|
|
// 点击查询按钮后
|
|
|
const onSearch = () => {
|
|
@@ -226,6 +210,26 @@ export default defineComponent({
|
|
|
}
|
|
|
state.showDetail = true
|
|
|
}
|
|
|
+ const onDel = (val) => {
|
|
|
+ ElMessageBox.confirm(`是否删除${val.title}?`, "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ state.loading = true
|
|
|
+ that.$api.delDailyReportDelete({id: val.id}).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ ElMessage.success(res.message)
|
|
|
+ handleSearch()
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.message)
|
|
|
+ state.loading = false
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ state.loading = false
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
+ }
|
|
|
onMounted(() => {
|
|
|
state.back_queryForm = JSON.parse(JSON.stringify(state.queryForm))
|
|
|
initDictionary()
|
|
@@ -236,12 +240,12 @@ export default defineComponent({
|
|
|
...toRefs(state),
|
|
|
handleSearch,
|
|
|
handlePage,
|
|
|
- handleSort,
|
|
|
handleReset,
|
|
|
onSearch,
|
|
|
onAdd,
|
|
|
onEdit,
|
|
|
onView,
|
|
|
+ onDel
|
|
|
}
|
|
|
},
|
|
|
})
|