Browse Source

任务报表获取路径参数 2022年11月24日 sxm

master
[li_she] 3 years ago
parent
commit
860f0b1c90
  1. 478
      src/views/modules/taskmanage/taskReport.vue
  2. 2
      src/views/modules/taskmanage/tasklist-add-or-update.vue

478
src/views/modules/taskmanage/taskReport.vue

@ -45,257 +45,259 @@
</template> </template>
<script> <script>
import {getTaskDetailList} from '@/api/taskmanage/tasklist.js'
import {getTaskDetailList} from '@/api/taskmanage/tasklist.js'
let domTimer = '' //
let dataTimer = '' //
export default {
data() {
return {
height: 200,
dataForm: {
site: this.$store.state.user.site ? this.$store.state.user.site : 1,
customer: '',
taskHeader: '',
project: '',
taskDescription: '',
taskInitiator: '',
finalStatus: '未完成',
department: '',
responsiblePerson: '',
startDate: '',
endDate: '',
finishStartDate: '',
finishEndDate: '',
status: '',
let domTimer = '' //
let dataTimer = '' //
export default {
data() {
return {
height: 200,
dataForm: {
site: this.$store.state.user.site ? this.$store.state.user.site : 1,
customer: '',
taskHeader: '',
project: '',
taskDescription: '',
taskInitiator: '',
finalStatus: '未完成',
department: '',
responsiblePerson: '',
startDate: '',
endDate: '',
finishStartDate: '',
finishEndDate: '',
status: '',
ipAddress: this.$route.query.ip
},
//
columnList: [
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "customer",
columnLabel: "客户",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 100,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "project",
columnLabel: "项目",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 100,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "taskHeader",
columnLabel: "任务主题",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: null,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "taskStartDate",
columnLabel: "发起日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 100,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "requiredCompletionDate",
columnLabel: "要求完成日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 100,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
}, },
//
columnList: [
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "customer",
columnLabel: "客户",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 100,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "project",
columnLabel: "项目",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 100,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "taskHeader",
columnLabel: "任务主题",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: null,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "taskStartDate",
columnLabel: "发起日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 100,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "requiredCompletionDate",
columnLabel: "要求完成日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 100,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "depUserName",
columnLabel: "责任部门|责任人",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "status",
columnLabel: "状态",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 80,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
],
dataList: [],
//
refreshTime: 5,
rollTime: 5,
rollPx: 1,
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "depUserName",
columnLabel: "责任部门|责任人",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
{
tableId: "ProjectInfo",
tableName: this.$route.meta.title,
columnProp: "status",
columnLabel: "状态",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 80,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: null
},
],
dataList: [],
//
refreshTime: 5,
rollTime: 5,
rollPx: 1,
}
},
activated() {
// this.getDataList()
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 30;
})
},
methods: {
//
getDataList() {
getTaskDetailList(this.dataForm).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.data
} else {
this.dataList = []
}
this.dataListLoading = false
})
},
tableRowClassName({row, rowIndex}) {
if (row.status == '未受理' && this.dayjs(this.dayjs()).diff(row.createdDate, 'minutes') / 60 >= 12) {
return 'finish'
}
if (row.status == '未受理') {
return 'not-processing'
}
if (row.status == '已受理') {
return 'processing'
} }
// return ''
}, },
activated() {
// this.getDataList()
//
mouseEnter(time) {
//
this.autoRoll(true)
}, },
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 30;
})
//
mouseLeave() {
//
this.autoRoll()
}, },
methods: {
//
getDataList() {
getTaskDetailList(this.dataForm).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.data
} else {
this.dataList = []
//
autoRoll(stop) {
if (stop) {
clearInterval(domTimer)
return
}
this.$nextTick(() => {
// DOM
const table = this.$refs.task_table
// div
const divData = table.bodyWrapper
//
domTimer = setInterval(() => {
//
divData.scrollTop = this.decimalUtil.add(Number(divData.scrollTop), Number(this.rollPx))
// (+=)
if (divData.clientHeight + divData.scrollTop + 1 >= divData.scrollHeight) {
// table
divData.scrollTop = 0
} }
this.dataListLoading = false
})
},
tableRowClassName({row, rowIndex}) {
if (row.status == '未受理' && this.dayjs(this.dayjs()).diff( row.createdDate,'minutes')/60>=12) {
return 'finish'
}
if (row.status == '未受理') {
return 'not-processing'
}
if (row.status == '已受理') {
return 'processing'
}
// return ''
},
//
mouseEnter(time) {
//
this.autoRoll(true)
},
//
mouseLeave() {
//
this.autoRoll()
},
//
autoRoll(stop) {
if (stop) {
clearInterval(domTimer)
return
}
this.$nextTick(() => {
// DOM
const table = this.$refs.task_table
// div
const divData = table.bodyWrapper
//
domTimer = setInterval(() => {
//
divData.scrollTop = this.decimalUtil.add(Number(divData.scrollTop), Number(this.rollPx))
// (+=)
if (divData.clientHeight + divData.scrollTop + 1 >= divData.scrollHeight) {
// table
divData.scrollTop = 0
}
}, this.rollTime * 10)
})
}, this.rollTime * 10)
})
},
},
created() {
this.autoRoll()
dataTimer = setInterval(() => {
this.getDataList()
}, 3000)
}, },
beforeUnmount() {
clearInterval(dataTimer)
clearInterval(domTimer)
}
},
created() {
this.autoRoll()
dataTimer = setInterval(() => {
this.getDataList()
}, 3000)
},
beforeUnmount() {
clearInterval(dataTimer)
clearInterval(domTimer)
} }
}
</script> </script>
<style> <style>
.mod-config .not-processing {
background-color: #ffff00;
}
.mod-config .not-processing {
background-color: #ffff00;
}
.mod-config .processing {
// background-color: #5f0e3f;
}
.mod-config .processing {
/ / background-color: #5f0e3f;
}
.mod-config .finish {
background-color:orangered;
}
.mod-config .finish {
background-color: orangered;
color: #f2f6fc;
}
</style> </style>

2
src/views/modules/taskmanage/tasklist-add-or-update.vue

@ -271,7 +271,7 @@
'status': this.dataForm.status, 'status': this.dataForm.status,
'finalStatus': this.dataForm.finalStatus, 'finalStatus': this.dataForm.finalStatus,
'taskStartDate': this.dataForm.taskStartDate, 'taskStartDate': this.dataForm.taskStartDate,
'createdDate': this.dayjs().format("YYYY-MM-DD HH:mm:ss"),
// 'createdDate': this.dayjs().format("YYYY-MM-DD HH:mm:ss"),
'createdBy': this.$store.state.user.name, 'createdBy': this.$store.state.user.name,
'site': this.$store.state.user.site, 'site': this.$store.state.user.site,
'taskHeader': this.dataForm.taskHeader, 'taskHeader': this.dataForm.taskHeader,

Loading…
Cancel
Save