mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-06 07:21:24 +08:00
temp 2023/5/3
This commit is contained in:
@@ -2,22 +2,14 @@
|
||||
<div class="main">
|
||||
<div class="main-table">
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column fixed prop="id" label="工作事项ID" width="150" />
|
||||
<el-table-column prop="publisherId" label="发布者ID" width="120" />
|
||||
<el-table-column fixed prop="publisherName" label="发布者" width="120" />
|
||||
<el-table-column prop="content" label="内容" width="800" />
|
||||
<el-table-column prop="worker" label="工作人员" width="200">
|
||||
<template #default="{ row }">
|
||||
<span v-for="item in row.worker" :key="item.userID">
|
||||
{{ item.userName }},
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deadline" label="结束时间" width="200">
|
||||
<template #default="scope">
|
||||
{{ formatDate(scope.row.deadline) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="240">
|
||||
<el-table-column fixed="right" label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" size="large">查看</el-button>
|
||||
<el-popconfirm
|
||||
@@ -26,7 +18,7 @@
|
||||
cancel-button-text="否"
|
||||
:icon="InfoFilled"
|
||||
icon-color="#00d4ff"
|
||||
title="是否确认完成?"
|
||||
title="是否修改为未完成?"
|
||||
@confirm="todoConfirmEvent(scope.row)"
|
||||
@cancel="todoCancelEvent"
|
||||
>
|
||||
@@ -57,34 +49,37 @@ export default {
|
||||
return new Date(deadline).toLocaleString()
|
||||
},
|
||||
todoConfirmEvent(row) {
|
||||
console.log(row)
|
||||
this.setTaskTodo(row)
|
||||
console.log('complete confirm!')
|
||||
location.reload()
|
||||
const userWork = {
|
||||
workId: '',
|
||||
userId: '1652714496280469506',
|
||||
status: 1
|
||||
}
|
||||
userWork.workId = row.id
|
||||
userWork.status = 0
|
||||
this.setTaskStatus(userWork)
|
||||
},
|
||||
todoCancelEvent() {
|
||||
console.log('complete cancel!')
|
||||
},
|
||||
getTableData() {
|
||||
axios
|
||||
.get('http://localhost:8080/work/complete')
|
||||
.get('http://localhost:8621/work/complete/1652714496280469506')
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.tableData = response.data
|
||||
console.log(response.data.data)
|
||||
this.tableData = response.data.data
|
||||
console.log(this.tableData)
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
},
|
||||
setTaskTodo(row) {
|
||||
var workDo = new Object()
|
||||
workDo.id = row.id
|
||||
workDo.status = false
|
||||
setTaskStatus(userWork) {
|
||||
console.log(userWork)
|
||||
axios
|
||||
.put('http://localhost:8080/work', workDo)
|
||||
.put('http://localhost:8621/work/setStatus', userWork)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
console.log(response.data.data)
|
||||
this.getTableData()
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="main-table">
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column prop="content" label="内容" width="800" />
|
||||
<el-table-column prop="publisherName" label="发布者ID" width="120" />
|
||||
<el-table-column prop="publisherName" label="发布者" width="120" />
|
||||
<el-table-column prop="worker" label="工作人员" width="200">
|
||||
<template #default="{ row }">
|
||||
<span v-for="item in row.worker" :key="item.userId">
|
||||
@@ -25,16 +25,15 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="200">
|
||||
<el-table-column fixed="right" label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" size="large" @click="handleClick"
|
||||
<el-button link type="primary" size="large" @click="handleClick(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-popconfirm
|
||||
width="220"
|
||||
confirm-button-text="是"
|
||||
cancel-button-text="否"
|
||||
:icon="InfoFilled"
|
||||
icon-color="#00d4ff"
|
||||
title="是否确定删除?"
|
||||
@confirm="deleteConfirmEvent(scope.row)"
|
||||
@@ -44,36 +43,29 @@
|
||||
<el-button link type="primary" size="default">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
<!-- <el-popconfirm-->
|
||||
<!-- width="220"-->
|
||||
<!-- confirm-button-text="是"-->
|
||||
<!-- cancel-button-text="否"-->
|
||||
<!-- :icon="InfoFilled"-->
|
||||
<!-- icon-color="#00d4ff"-->
|
||||
<!-- title="是否确认完成?"-->
|
||||
<!-- @confirm="completeConfirmEvent"-->
|
||||
<!-- @cancel="completeCancelEvent"-->
|
||||
<!-- >-->
|
||||
<!-- <template #reference>-->
|
||||
<!-- <el-button link type="primary" size="default">完成</el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-popconfirm>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="main-add-content">
|
||||
<div class="main-add-box">
|
||||
<el-button @click="dialogFormVisible = true">添加</el-button>
|
||||
<el-button size="large" @click="addVisible = true">添加</el-button>
|
||||
</div>
|
||||
<el-dialog v-model="dialogFormVisible" width="60%">
|
||||
<edit-work @setDialogVisible="setDialogVisible"></edit-work>
|
||||
<el-dialog v-model="addVisible" width="60%">
|
||||
<edit-work @setDialogVisible="setDialogVisible" @addWork="addWork"></edit-work>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="editVisible" width="60%">
|
||||
<edit-work
|
||||
:editForm="rowData"
|
||||
@setDialogVisible="setDialogVisible"
|
||||
@updateWork="updateWork"
|
||||
></edit-work>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import axios from 'axios'
|
||||
import EditWork from '@/components/EditWork.vue'
|
||||
|
||||
@@ -82,7 +74,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
dialogFormVisible: false
|
||||
rowData: [],
|
||||
addVisible: false,
|
||||
editVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -90,12 +84,13 @@ export default {
|
||||
console.log(new Date(deadline).toLocaleString())
|
||||
return new Date(deadline).toLocaleString()
|
||||
},
|
||||
handleClick() {
|
||||
handleClick(row) {
|
||||
this.rowData = row
|
||||
this.editVisible = true
|
||||
console.log('click')
|
||||
},
|
||||
deleteConfirmEvent(row) {
|
||||
this.deleteTableData(row)
|
||||
location.reload()
|
||||
console.log('delete confirm!')
|
||||
},
|
||||
deleteCancelEvent() {
|
||||
@@ -123,6 +118,7 @@ export default {
|
||||
axios
|
||||
.delete('http://localhost:8621/work/' + row.id)
|
||||
.then((response) => {
|
||||
this.getTableData()
|
||||
console.log(response.data.data)
|
||||
})
|
||||
.catch((reportError) => {
|
||||
@@ -131,8 +127,33 @@ export default {
|
||||
},
|
||||
setDialogVisible(dialogVisible) {
|
||||
console.log(dialogVisible)
|
||||
this.dialogFormVisible = dialogVisible
|
||||
location.reload()
|
||||
this.addVisible = dialogVisible
|
||||
this.editVisible = dialogVisible
|
||||
this.getTableData()
|
||||
},
|
||||
updateWork(form) {
|
||||
axios
|
||||
.put('http://localhost:8621/work', form)
|
||||
.then((response) => {
|
||||
this.editVisible = false
|
||||
this.getTableData()
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
},
|
||||
addWork(form) {
|
||||
console.log(form)
|
||||
axios
|
||||
.post('http://localhost:8621/work', form)
|
||||
.then((response) => {
|
||||
this.addVisible = false
|
||||
this.getTableData()
|
||||
console.log(response.data)
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -1,15 +1,7 @@
|
||||
<template>
|
||||
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal">
|
||||
<el-menu-item index="1"
|
||||
><router-link to="/todo" style="text-decoration: none"
|
||||
>待办工作</router-link
|
||||
></el-menu-item
|
||||
>
|
||||
<el-menu-item index="2"
|
||||
><router-link to="complete" style="text-decoration: none"
|
||||
>已办工作</router-link
|
||||
></el-menu-item
|
||||
>
|
||||
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" router>
|
||||
<el-menu-item index="1" route="/work/task/todo">待办工作</el-menu-item>
|
||||
<el-menu-item index="2" route="/work/task/complete">已办工作</el-menu-item>
|
||||
</el-menu>
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
@@ -21,9 +13,6 @@ export default {
|
||||
return {
|
||||
activeIndex: '1'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$router.push('/todo')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,22 +2,14 @@
|
||||
<div class="main">
|
||||
<div class="main-table">
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column fixed prop="id" label="工作事项ID" width="150" />
|
||||
<el-table-column prop="publisherId" label="发布者ID" width="120" />
|
||||
<el-table-column fixed prop="publisherName" label="发布者" width="150" />
|
||||
<el-table-column prop="content" label="内容" width="800" />
|
||||
<el-table-column prop="worker" label="工作人员" width="200">
|
||||
<template #default="{ row }">
|
||||
<span v-for="item in row.worker" :key="item.userID">
|
||||
{{ item.userName }},
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deadline" label="结束时间" width="200">
|
||||
<template #default="scope">
|
||||
{{ formatDate(scope.row.deadline) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="240">
|
||||
<el-table-column fixed="right" label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" size="large">查看</el-button>
|
||||
<el-popconfirm
|
||||
@@ -56,34 +48,38 @@ export default {
|
||||
return new Date(deadline).toLocaleString()
|
||||
},
|
||||
completeConfirmEvent(row) {
|
||||
console.log(row)
|
||||
this.setTaskComplete(row)
|
||||
const userWork = {
|
||||
workId: '',
|
||||
userId: '1652714496280469506',
|
||||
status: 0
|
||||
}
|
||||
userWork.workId = row.id
|
||||
userWork.status = 1
|
||||
this.setTaskStatus(userWork)
|
||||
console.log('complete confirm!')
|
||||
location.reload()
|
||||
},
|
||||
completeCancelEvent() {
|
||||
console.log('complete cancel!')
|
||||
},
|
||||
getTableData() {
|
||||
axios
|
||||
.get('http://localhost:8080/work/todo')
|
||||
.get('http://localhost:8621/work/todo/1652714496280469506')
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.tableData = response.data
|
||||
console.log(response.data.data)
|
||||
this.tableData = response.data.data
|
||||
console.log(this.tableData)
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
},
|
||||
setTaskComplete(row) {
|
||||
var workDo = new Object()
|
||||
workDo.id = row.id
|
||||
workDo.status = true
|
||||
setTaskStatus(userWork) {
|
||||
console.log(userWork)
|
||||
axios
|
||||
.put('http://localhost:8080/work', workDo)
|
||||
.put('http://localhost:8621/work/setStatus', userWork)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
console.log(response.data.data)
|
||||
this.getTableData()
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
|
||||
Reference in New Issue
Block a user