Commit d81f1046 authored by “lixuyan”'s avatar “lixuyan”

修改工时管理

parent f07d4d6b
......@@ -30,10 +30,6 @@
</el-form-item>
<el-form-item label="是否确认: ">
<el-select v-model="form.isConfirmCode" clearable placeholder="请选择确认状态" class="input-with-select el-input--small">
<el-option
label="全部"
value=""
/>
<el-option
label="已确认"
value="Y"
......@@ -86,9 +82,8 @@ export default {
aoName: '', // 关键字
actualEnd: '', // 结束时间
isConfirmCode: ''
}
this.$emit('init')
this.$emit('init', this.form)
},
// 查询
onSubmit() {
......
......@@ -90,7 +90,6 @@ export default {
this.setDefaultColums()
},
mounted() {
// this.init()
},
methods: {
// 合计
......@@ -125,7 +124,7 @@ export default {
init(form) {
this.tableData = []
// 设置数据
this.form = form
form ? this.form = form : this.form
this.loading = true
const params = {
'pageFrom': this.tablePagination.currentPage,
......@@ -138,24 +137,29 @@ export default {
'fieldName': 'extProcessSkillUser.dxUserInfoId',
'operator': 'EQ',
'value': localStorage.getItem('userId')
// 'value': 1626782148600
// 'value': 1626781929107
},
{
'fieldName': 'joExecutePlan.extProcessPlan.serialNumber',
'operator': 'LIKE',
'value': form.aoName
// 'value': 'AOR-CAS-CA-53-D2701001-0500-001'
},
{
'fieldName': 'joExecutePlan.state',
'operator': 'EQ',
'value': form.state
},
{
'fieldName': 'isConfirm',
'operator': 'EQ',
'value': form.isConfirmCode
}
// {
// 'fieldName': 'joExecutePlan.jrExecutePlans.actualEnd',
// 'operator': 'BTWN',
// 'value': form.actualEnd[0],
// 'value1': form.actualEnd[1]
// },
// {
// 'fieldName': 'joExecutePlan.state',
// 'operator': 'EQ',
// 'value': form.state
// },
// {
// 'fieldName': 'isConfirm',
// 'operator': 'EQ',
// 'value': form.isConfirmCode
// }
],
'operator': 'AND'
}
......@@ -184,15 +188,27 @@ export default {
],
'toValidateKeys': ''
}
if (form.state) {
params.searchItems.children[0].items.push({
'fieldName': 'joExecutePlan.state',
'operator': 'EQ',
'value': form.state
})
}
if (form.isConfirmCode) {
params.searchItems.children[0].items.push({
'fieldName': 'isConfirm',
'operator': 'EQ',
'value': form.isConfirmCode
})
}
if (form.actualEnd && form.actualEnd.length > 0) {
params.searchItems.children[0].items.push(
{
'fieldName': 'joExecutePlan.jrExecutePlans.actualEnd',
'operator': 'BTWN',
'value': form.actualEnd[0],
'value1': form.actualEnd[1]
}
)
params.searchItems.children[0].items.push({
'fieldName': 'joExecutePlan.jrExecutePlans.actualEnd',
'operator': 'BTWN',
'value': form.actualEnd[0],
'value1': form.actualEnd[1]
})
}
// 发送请求
post(`/ProdTask/listCustomQuery`, params).then(res => {
......
......@@ -26,17 +26,14 @@
</section>
</template>
<script>
// import { post } from '@/utils/http'
// import { getTemp, confirmTempWorkHour } from '@/api/programExecutionManagement.js'
import { post } from '@/utils/http'
export default {
components: {
},
data() {
return {
// 加载中
loading: false,
// 搜索条件
form: [],
form: {},
// 分页
tablePagination: {
currentPage: 1,
......@@ -51,15 +48,36 @@ export default {
// 所有可动态配置的表格列
colums: [
{ minWidth: '100', title: '任务编号', show: true, key: 'tempWorkHour.billNo', sortable: true },
{ minWidth: '100', title: '工时类型', show: true, key: 'tempWorkHour.workType', sortable: true },
{ minWidth: '70', title: '站位', show: true, key: 'tempWorkHour.name', sortable: true },
{ minWidth: '100', title: '工时类型', show: true, key: 'tempWorkHour.workType', sortable: true, fildProp: {
type: 'DictDataVO',
rule: {
dictTypeCode: 'WorkType' }
}
},
{ minWidth: '70', title: '站位', show: true, key: 'tempWorkHour.extStandPosition.extcode', sortable: true },
{ minWidth: '100', title: '工作内容', show: true, key: 'tempWorkHour.workContent', sortable: true },
{ minWidth: '100', title: '开始时间', show: true, key: 'tempWorkHour.startTime', sortable: true },
{ minWidth: '100', title: '结束时间', show: true, key: 'tempWorkHour.endTime', sortable: true },
{ minWidth: '110', title: '本人工时(min)', show: true, key: 'workHour', sortable: true },
{ minWidth: '110', title: '完成工时(min)', show: true, key: 'workHours', sortable: true },
{ minWidth: '120', title: '工时状态', show: true, key: 'tempWorkHour.stateName', sortable: true },
{ minWidth: '120', title: '是否确认', show: true, key: 'tempWorkHour.isConfirmName', sortable: true }
{ minWidth: '110', title: '完成工时(min)', show: true, key: 'tempWorkHour.workHours', sortable: true },
{ minWidth: '120', title: '工时状态', show: true, key: 'tempWorkHour.state', sortable: true, formatter(row, column) {
if (row.tempWorkHour.state === 'Audited') {
return '己审核'
} else if (row.tempWorkHour.state === 'Pending_Review') {
return '待审核'
} else if (row.tempWorkHour.state === 'TF_Reviewing') {
return '审核中'
}
}
},
{ minWidth: '120', title: '是否确认', show: true, key: 'isConfirmCode', sortable: true, formatter(row, column) {
if (row.isConfirmCode === 'Y') {
return '已确认'
} else {
return '未确认'
}
}
}
],
// 默认展示的表格列
tableColums: [],
......@@ -92,13 +110,10 @@ export default {
this.setDefaultColums()
},
mounted() {
this.init()
// this.init()
},
methods: {
getSummaries(param) {
// this.$nextTick(() => {
// this.$refs.table.$refs.deeTable.doLayout()
// })
this.showSummary = true
const { columns, data } = param
const sums = []
......@@ -128,71 +143,83 @@ export default {
},
// 初始化数据
init(form, page) {
page && (this.tablePagination.currentPage = 1)
console.log(form, this.form)
// 设置数据
this.loading = true
this.tableData = []
form && form.length
? this.form = form
: this.form = [{
fieldName: 'state',
operator: 'LIKE',
value: 'Audited'
form ? this.form = form : this.form
const params = {
'pageFrom': this.tablePagination.currentPage,
'pageSize': this.tablePagination.pageSize,
'searchItems': {
'items': [
{
fieldName: 'dxUserInfoId',
operator: 'EQ',
value: localStorage.getItem('userId')
},
{
fieldName: 'tempWorkHour.billNo',
operator: 'LIKE',
value: form.keyWord || ''
}
],
'operator': 'AND'
},
{
fieldName: 'isConfirmCode',
operator: 'LIKE',
value: 'N'
}]
// const params = {
// 'indices': [
// 'TempWorkHourAssign'
// ],
// 'pageFrom': page || this.tablePagination.currentPage,
// 'pageSize': this.tablePagination.pageSize,
// 'searchItems': {
// 'items': [
// ...this.form,
// {
// fieldName: 'dxUserId',
// operator: 'EQ',
// value: localStorage.getItem('userId')
// }
// ],
// 'operator': 'AND'
// },
// 'sortItem': [
// {
// 'fieldName': 'modifyTime',
// 'sortOrder': 'desc'
// }
// ]
// }
// // 发送请求
// getTemp(params).then(res => {
// this.tableData = []
// res.items.content.map(item => {
// item.tempWorkHour.isConfirmName = item.isConfirmName
// this.tableData.push({
// ...item,
// workHours: item.tempWorkHour.workHours
// })
// })
// this.tablePagination.total = res.items.totalElements
// // 清空子表数据
// // this.$emit('clear')
// }).catch(err => console.log(err)).finally(() => {
// this.loading = false
// this.$nextTick(() => {
// this.sumRowShow = true
// })
// })
'openProps': [
{
'name': 'tempWorkHour',
'openProps': [
{
'name': 'extStandPosition'
}
]
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
if (form.state) {
params.searchItems.items.push({
'fieldName': 'tempWorkHour.state',
'operator': 'EQ',
'value': form.state
})
}
if (form.isConfirmCode) {
params.searchItems.items.push({
'fieldName': 'isConfirmCode',
'operator': 'EQ',
'value': form.isConfirmCode
})
}
if (form.actualEnd && form.actualEnd.length > 0) {
params.searchItems.items.push({
'fieldName': 'tempWorkHour.endTime',
'operator': 'BTWN',
'value': form.actualEnd[0],
'value1': form.actualEnd[1]
})
}
// 发送请求
this.$api.searchApi('TempWorkHourAssign', params).then(res => {
this.tableData = res.items.content
this.tablePagination.total = res.items.totalElements
}).catch(err => console.log(err)).finally(() => {
this.loading = false
this.$nextTick(() => {
this.sumRowShow = true
})
})
},
// 确认
confirmHandle() {
if (!this.selectionRow.length) return this.$utils.showMessageWarning('请选择需要操作的数据')
const confirmFlag = this.selectionRow.find(row => (row.isConfirmName === 'Y' || row.isConfirmName === '已确认'))
const confirmFlag = this.selectionRow.find(row => (row.isConfirmCode === 'Y' || row.isConfirmCode === '已确认'))
if (confirmFlag) return this.$utils.showMessageWarning('已确认的数据无法再次进行确认,请重新选择')
this.$confirm('是否对选中的数据进行确认?', '提示', {
confirmButtonText: '确认',
......@@ -200,15 +227,23 @@ export default {
type: 'warning'
}).then(() => {
this.loading = true
// const ids = this.selectionRow.map(row => row.id)
// confirmTempWorkHour(ids).then(res => {
// this.$utils.showMessageSuccess('确认成功')
// this.init('', 1)
// }).catch(err => {
// console.log(err)
// }).finally(() => {
// this.loading = false
// })
const params = []
this.selectionRow.map(row => {
params.push({
id: row.id,
operator: 'MODIFY',
isConfirmCode: 'Y'
})
})
post(`/TempWorkHourAssign/recursions`, params).then(res => {
this.$utils.showMessageSuccess('确认成功')
this.tablePagination.currentPage = 1
this.init(this.form)
}).catch(err => {
console.log(err)
}).finally(() => {
this.loading = false
})
}).catch(() => {
this.$message({
type: 'info',
......
<template>
<section class="time-to-see">
<Search :active-name="activeName" @init="(form)=>tableInit(form) " />
<Search :active-name="activeName" @init="searchData" />
<dee-tools :tools="tools" mode="normal" :collapse="false" />
<el-tabs v-model="activeName" type="card" @tab-click="tableInit(false)">
<el-tabs v-model="activeName" type="card" @tab-click="tabClick">
<el-tab-pane label="生产工时" name="product">
<ProductionTable ref="productTable" />
</el-tab-pane>
......@@ -34,10 +34,18 @@ export default {
handler: {
click: () => this.confirmHandle()
}
}]
}],
initForm: {}
}
},
methods: {
searchData(form) {
this.initForm = form
this.tableInit(this.initForm)
},
tabClick() {
this.tableInit(this.initForm)
},
tableInit(form) {
if (this.activeName === 'product') {
this.$refs.productTable.init(form, 1)
......
......@@ -30,10 +30,6 @@
</el-form-item>
<el-form-item label="是否确认: ">
<el-select v-model="form.isConfirmCode" clearable placeholder="请选择确认状态" class="input-with-select el-input--small">
<el-option
label="全部"
value=""
/>
<el-option
label="已确认"
value="Y"
......@@ -86,9 +82,8 @@ export default {
aoName: '', // 关键字
actualEnd: '', // 结束时间
isConfirmCode: ''
}
this.$emit('init')
this.$emit('init', this.form)
},
// 查询
onSubmit() {
......
......@@ -90,7 +90,6 @@ export default {
this.setDefaultColums()
},
mounted() {
// this.init()
},
methods: {
// 合计
......@@ -125,8 +124,7 @@ export default {
init(form) {
this.tableData = []
// 设置数据
this.form = form
console.log(111, form)
form ? this.form = form : this.form
this.loading = true
const params = {
'pageFrom': this.tablePagination.currentPage,
......@@ -145,24 +143,23 @@ export default {
'fieldName': 'joExecutePlan.extProcessPlan.serialNumber',
'operator': 'LIKE',
'value': form.aoName
// 'value': 'AOR-CAS-CA-53-D2701001-0500-001'
},
}
// {
// 'fieldName': 'joExecutePlan.jrExecutePlans.actualEnd',
// 'operator': 'BTWN',
// 'value': form.actualEnd[0],
// 'value1': form.actualEnd[1]
// },
{
'fieldName': 'joExecutePlan.state',
'operator': 'EQ',
'value': form.state
},
{
'fieldName': 'isConfirm',
'operator': 'EQ',
'value': form.isConfirmCode
}
// {
// 'fieldName': 'joExecutePlan.state',
// 'operator': 'EQ',
// 'value': form.state
// },
// {
// 'fieldName': 'isConfirm',
// 'operator': 'EQ',
// 'value': form.isConfirmCode
// }
],
'operator': 'AND'
}
......@@ -191,6 +188,28 @@ export default {
],
'toValidateKeys': ''
}
if (form.state) {
params.searchItems.children[0].items.push({
'fieldName': 'joExecutePlan.state',
'operator': 'EQ',
'value': form.state
})
}
if (form.isConfirmCode) {
params.searchItems.children[0].items.push({
'fieldName': 'isConfirm',
'operator': 'EQ',
'value': form.isConfirmCode
})
}
if (form.actualEnd && form.actualEnd.length > 0) {
params.searchItems.children[0].items.push({
'fieldName': 'joExecutePlan.jrExecutePlans.actualEnd',
'operator': 'BTWN',
'value': form.actualEnd[0],
'value1': form.actualEnd[1]
})
}
// 发送请求
post(`/ProdTask/listCustomQuery`, params).then(res => {
this.tableData = []
......
......@@ -26,17 +26,14 @@
</section>
</template>
<script>
// import { post } from '@/utils/http'
// import { getTemp, confirmTempWorkHour } from '@/api/programExecutionManagement.js'
import { post } from '@/utils/http'
export default {
components: {
},
data() {
return {
// 加载中
loading: false,
// 搜索条件
form: [],
form: {},
// 分页
tablePagination: {
currentPage: 1,
......@@ -51,15 +48,36 @@ export default {
// 所有可动态配置的表格列
colums: [
{ minWidth: '100', title: '任务编号', show: true, key: 'tempWorkHour.billNo', sortable: true },
{ minWidth: '100', title: '工时类型', show: true, key: 'tempWorkHour.workType', sortable: true },
{ minWidth: '70', title: '站位', show: true, key: 'tempWorkHour.name', sortable: true },
{ minWidth: '100', title: '工时类型', show: true, key: 'tempWorkHour.workType', sortable: true, fildProp: {
type: 'DictDataVO',
rule: {
dictTypeCode: 'WorkType' }
}
},
{ minWidth: '70', title: '站位', show: true, key: 'tempWorkHour.extStandPosition.extcode', sortable: true },
{ minWidth: '100', title: '工作内容', show: true, key: 'tempWorkHour.workContent', sortable: true },
{ minWidth: '100', title: '开始时间', show: true, key: 'tempWorkHour.startTime', sortable: true },
{ minWidth: '100', title: '结束时间', show: true, key: 'tempWorkHour.endTime', sortable: true },
{ minWidth: '110', title: '本人工时(min)', show: true, key: 'workHour', sortable: true },
{ minWidth: '110', title: '完成工时(min)', show: true, key: 'workHours', sortable: true },
{ minWidth: '120', title: '工时状态', show: true, key: 'tempWorkHour.stateName', sortable: true },
{ minWidth: '120', title: '是否确认', show: true, key: 'tempWorkHour.isConfirmName', sortable: true }
{ minWidth: '110', title: '完成工时(min)', show: true, key: 'tempWorkHour.workHours', sortable: true },
{ minWidth: '120', title: '工时状态', show: true, key: 'tempWorkHour.state', sortable: true, formatter(row, column) {
if (row.tempWorkHour.state === 'Audited') {
return '己审核'
} else if (row.tempWorkHour.state === 'Pending_Review') {
return '待审核'
} else if (row.tempWorkHour.state === 'TF_Reviewing') {
return '审核中'
}
}
},
{ minWidth: '120', title: '是否确认', show: true, key: 'isConfirmCode', sortable: true, formatter(row, column) {
if (row.isConfirmCode === 'Y') {
return '已确认'
} else {
return '未确认'
}
}
}
],
// 默认展示的表格列
tableColums: [],
......@@ -92,13 +110,10 @@ export default {
this.setDefaultColums()
},
mounted() {
this.init()
// this.init()
},
methods: {
getSummaries(param) {
// this.$nextTick(() => {
// this.$refs.table.$refs.deeTable.doLayout()
// })
this.showSummary = true
const { columns, data } = param
const sums = []
......@@ -128,71 +143,83 @@ export default {
},
// 初始化数据
init(form, page) {
page && (this.tablePagination.currentPage = 1)
console.log(form, this.form)
// 设置数据
this.loading = true
this.tableData = []
form && form.length
? this.form = form
: this.form = [{
fieldName: 'state',
operator: 'LIKE',
value: 'Audited'
form ? this.form = form : this.form
const params = {
'pageFrom': this.tablePagination.currentPage,
'pageSize': this.tablePagination.pageSize,
'searchItems': {
'items': [
{
fieldName: 'dxUserInfoId',
operator: 'EQ',
value: localStorage.getItem('userId')
},
{
fieldName: 'tempWorkHour.billNo',
operator: 'LIKE',
value: form.keyWord || ''
}
],
'operator': 'AND'
},
{
fieldName: 'isConfirmCode',
operator: 'LIKE',
value: 'N'
}]
// const params = {
// 'indices': [
// 'TempWorkHourAssign'
// ],
// 'pageFrom': page || this.tablePagination.currentPage,
// 'pageSize': this.tablePagination.pageSize,
// 'searchItems': {
// 'items': [
// ...this.form,
// {
// fieldName: 'dxUserId',
// operator: 'EQ',
// value: localStorage.getItem('userId')
// }
// ],
// 'operator': 'AND'
// },
// 'sortItem': [
// {
// 'fieldName': 'modifyTime',
// 'sortOrder': 'desc'
// }
// ]
// }
// // 发送请求
// getTemp(params).then(res => {
// this.tableData = []
// res.items.content.map(item => {
// item.tempWorkHour.isConfirmName = item.isConfirmName
// this.tableData.push({
// ...item,
// workHours: item.tempWorkHour.workHours
// })
// })
// this.tablePagination.total = res.items.totalElements
// // 清空子表数据
// // this.$emit('clear')
// }).catch(err => console.log(err)).finally(() => {
// this.loading = false
// this.$nextTick(() => {
// this.sumRowShow = true
// })
// })
'openProps': [
{
'name': 'tempWorkHour',
'openProps': [
{
'name': 'extStandPosition'
}
]
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
if (form.state) {
params.searchItems.items.push({
'fieldName': 'tempWorkHour.state',
'operator': 'EQ',
'value': form.state
})
}
if (form.isConfirmCode) {
params.searchItems.items.push({
'fieldName': 'isConfirmCode',
'operator': 'EQ',
'value': form.isConfirmCode
})
}
if (form.actualEnd && form.actualEnd.length > 0) {
params.searchItems.items.push({
'fieldName': 'tempWorkHour.endTime',
'operator': 'BTWN',
'value': form.actualEnd[0],
'value1': form.actualEnd[1]
})
}
// 发送请求
this.$api.searchApi('TempWorkHourAssign', params).then(res => {
this.tableData = res.items.content
this.tablePagination.total = res.items.totalElements
}).catch(err => console.log(err)).finally(() => {
this.loading = false
this.$nextTick(() => {
this.sumRowShow = true
})
})
},
// 确认
confirmHandle() {
if (!this.selectionRow.length) return this.$utils.showMessageWarning('请选择需要操作的数据')
const confirmFlag = this.selectionRow.find(row => (row.isConfirmName === 'Y' || row.isConfirmName === '已确认'))
const confirmFlag = this.selectionRow.find(row => (row.isConfirmCode === 'Y' || row.isConfirmCode === '已确认'))
if (confirmFlag) return this.$utils.showMessageWarning('已确认的数据无法再次进行确认,请重新选择')
this.$confirm('是否对选中的数据进行确认?', '提示', {
confirmButtonText: '确认',
......@@ -200,15 +227,23 @@ export default {
type: 'warning'
}).then(() => {
this.loading = true
// const ids = this.selectionRow.map(row => row.id)
// confirmTempWorkHour(ids).then(res => {
// this.$utils.showMessageSuccess('确认成功')
// this.init('', 1)
// }).catch(err => {
// console.log(err)
// }).finally(() => {
// this.loading = false
// })
const params = []
this.selectionRow.map(row => {
params.push({
id: row.id,
operator: 'MODIFY',
isConfirmCode: 'Y'
})
})
post(`/TempWorkHourAssign/recursions`, params).then(res => {
this.$utils.showMessageSuccess('确认成功')
this.tablePagination.currentPage = 1
this.init(this.form)
}).catch(err => {
console.log(err)
}).finally(() => {
this.loading = false
})
}).catch(() => {
this.$message({
type: 'info',
......
<template>
<dee-dialog
v-if="visible"
title="工时查看"
:dialog-visible.sync="visible"
width="90%"
custom-class="mobile-dialog"
>
<section class="statistical-summary-working-hours-com">
<Search :active-name="activeName" @init="(form)=>tableInit(form) " />
<dee-tools :tools="tools" mode="normal" :collapse="false" />
<el-tabs v-model="activeName" type="card" @tab-click="tableInit(false)">
<el-tab-pane label="生产工时" name="product">
<ProductionTable ref="productTable" />
</el-tab-pane>
<el-tab-pane label="临时工时" name="temp">
<TemporaryTable ref="tempTable" />
</el-tab-pane>
</el-tabs>
</section>
</dee-dialog>
<section class="time-to-see">
<Search :active-name="activeName" @init="searchData" />
<dee-tools :tools="tools" mode="normal" :collapse="false" />
<el-tabs v-model="activeName" type="card" @tab-click="tabClick">
<el-tab-pane label="生产工时" name="product">
<ProductionTable ref="productTable" />
</el-tab-pane>
<el-tab-pane label="临时工时" name="temp">
<TemporaryTable ref="tempTable" />
</el-tab-pane>
</el-tabs>
</section>
</template>
<script>
......@@ -35,7 +27,6 @@ export default {
data() {
return {
activeName: 'product',
visible: false,
// 工具栏
tools: [{
name: '确认',
......@@ -43,19 +34,19 @@ export default {
handler: {
click: () => this.confirmHandle()
}
}]
}],
initForm: {}
}
},
methods: {
// 打开弹出框
open() {
this.visible = true
searchData(form) {
this.initForm = form
this.tableInit(this.initForm)
},
handleClose() {
this.visible = false
tabClick() {
this.tableInit(this.initForm)
},
tableInit(form) {
console.log(1212, form)
if (this.activeName === 'product') {
this.$refs.productTable.init(form, 1)
} else {
......@@ -75,7 +66,9 @@ export default {
</script>
<style lang="scss">
.statistical-summary-working-hours-com{
.time-to-see{
padding-top: 10px;
background: #fff;
.dee-tools{
float: right;
position: relative;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment