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

修改工时管理

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