Commit 49d3369b authored by 15008242619's avatar 15008242619 Committed by jingnan

新增工作包功能(暂不部署正式)

parent 383d9c75
...@@ -194,6 +194,7 @@ export default { ...@@ -194,6 +194,7 @@ export default {
isLeaf: true, isLeaf: true,
disabled: true, disabled: true,
level: 1, level: 1,
modelName: this.froms.modelName,
children: res.items && res.items.content.map((t) => { children: res.items && res.items.content.map((t) => {
// quantity += t.completeCount // quantity += t.completeCount
// total += t.carryCount // total += t.carryCount
...@@ -201,7 +202,8 @@ export default { ...@@ -201,7 +202,8 @@ export default {
serialNo: this.froms.sortieName, serialNo: this.froms.sortieName,
title: t.serialNumber, title: t.serialNumber,
icon: 'c-backups3', icon: 'c-backups3',
id: t.id id: t.id,
modelName: this.froms.modelName
// quantity: t.completeCount, // quantity: t.completeCount,
// total: t.carryCount // total: t.carryCount
} }
......
...@@ -115,6 +115,29 @@ ...@@ -115,6 +115,29 @@
<i v-if="scope.row.countWorkHourLoading" class="el-icon-loading" /> <i v-if="scope.row.countWorkHourLoading" class="el-icon-loading" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
prop="workPackage"
align="center"
label="所属工作包"
:width="150"
>
<template slot="header">
<span>所属工作包</span>
<i v-if="loginUser=== '1'" class="el-icon-edit-outline" />
</template>
<template slot-scope="scope">
<el-select
v-if="scope.row.workPackageSelect"
v-model="scope.row.workPackage"
placeholder="请选择"
@change="saveWorkPackage(scope.row, true)"
@visible-change="visibleChange($event, scope.row)"
>
<el-option v-for="(item, i) in wpOptions" :key="i" :label="item.name" :value="item.id" />
</el-select>
<span v-else>{{ $utils.getParamsFromLists(wpOptions, 'id', scope.row[scope.column.property], 'name') }}</span>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="workHour" prop="workHour"
align="center" align="center"
...@@ -283,6 +306,8 @@ export default { ...@@ -283,6 +306,8 @@ export default {
total: 0, total: 0,
pageSizes: [5, 10, 20, 50] pageSizes: [5, 10, 20, 50]
}, },
// 工作包数据
wpOptions: [],
// 加载中 // 加载中
loading: false, loading: false,
curRowId: null, curRowId: null,
...@@ -318,6 +343,7 @@ export default { ...@@ -318,6 +343,7 @@ export default {
created() { created() {
this.jurisdId = this.$route.query.taskDefinitionKey this.jurisdId = this.$route.query.taskDefinitionKey
this.getTools() this.getTools()
console.log(1)
}, },
mounted() { mounted() {
this.$bus.$on('getPlanData', (data, level) => { this.$bus.$on('getPlanData', (data, level) => {
...@@ -326,6 +352,7 @@ export default { ...@@ -326,6 +352,7 @@ export default {
this.level = level this.level = level
this.tablePagination.currentPage = 1 this.tablePagination.currentPage = 1
this.getTableData(data, level) this.getTableData(data, level)
this.getWPOptions(data)
}) })
}) })
this.getDicListByCode() this.getDicListByCode()
...@@ -338,6 +365,49 @@ export default { ...@@ -338,6 +365,49 @@ export default {
async getDicListByCode() { async getDicListByCode() {
this.stateOption = await this.$utils.getDicListByCode('ObjStatus') this.stateOption = await this.$utils.getDicListByCode('ObjStatus')
}, },
/**
* 工作包选项数据
*/
getWPOptions(data) {
const params = {
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'children': [],
'items': [
{
'fieldName': 'workState',
'operator': 'EQ',
'value': 'Y'
}, {
'fieldName': 'sorties',
'operator': 'EQ',
'value': data.serialNo
}, {
'fieldName': 'planeType',
'operator': 'EQ',
'value': data.modelName
}
],
'operator': 'AND'
},
'openProps': [],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post('/ExtWorkPackage/search', params).then(res => {
this.wpOptions = res.items.content.map(row => {
return {
name: row.name,
id: row.id
}
})
})
},
/** /**
* 工具栏 * 工具栏
*/ */
...@@ -584,7 +654,20 @@ export default { ...@@ -584,7 +654,20 @@ export default {
] ]
}, },
openProps: [], openProps: [
{
'name': 'extWorkPackageLinks',
'pageFrom': 1,
'pageSize': 9999,
'openProps': [
{
'name': 'source',
'pageFrom': 1,
'pageSize': 9999
}
]
}
],
sortItem: [ sortItem: [
{ {
fieldName: 'serialNumber', fieldName: 'serialNumber',
...@@ -625,7 +708,9 @@ export default { ...@@ -625,7 +708,9 @@ export default {
userName: p.noteName, userName: p.noteName,
createTime: p.createTime, createTime: p.createTime,
processTaskId: p.id, processTaskId: p.id,
note: p.note note: p.note,
workPackageSelect: false,
workPackage: p.extWorkPackageLinks && p.extWorkPackageLinks[0].source.id
} }
}) })
that.tableData.length && that.tableData.length &&
...@@ -796,6 +881,8 @@ export default { ...@@ -796,6 +881,8 @@ export default {
} else if (column.property === 'countWorkHour') { } else if (column.property === 'countWorkHour') {
this.countWorkHour = row.countWorkHour this.countWorkHour = row.countWorkHour
row.countWorkHourSelect = true row.countWorkHourSelect = true
} else if (column.property === 'workPackage') {
row.workPackageSelect = true
} else { } else {
return return
} }
...@@ -804,6 +891,8 @@ export default { ...@@ -804,6 +891,8 @@ export default {
row.firstCheckFlagSelect = false row.firstCheckFlagSelect = false
} else if (column.property === 'countWorkHour') { } else if (column.property === 'countWorkHour') {
row.countWorkHourSelect = false row.countWorkHourSelect = false
} else if (column.property === 'workPackage') {
row.workPackageSelect = false
} }
clearTimeout(this.timer) clearTimeout(this.timer)
that.timer = null that.timer = null
...@@ -816,6 +905,7 @@ export default { ...@@ -816,6 +905,7 @@ export default {
} else { } else {
row.firstCheckFlagSelect = false row.firstCheckFlagSelect = false
row.countWorkHourSelect = false row.countWorkHourSelect = false
row.workPackageSelect = false
} }
}, },
visibleWorkProcedureChange(event, row) { visibleWorkProcedureChange(event, row) {
...@@ -851,6 +941,30 @@ export default { ...@@ -851,6 +941,30 @@ export default {
that.workProcedureTimer = null that.workProcedureTimer = null
}, 2000) }, 2000)
}, },
saveWorkPackage(row, status) {
var that = this
const param = {
source: row.workPackage,
target: row.id
}
post('/ExtWorkPackageLink/saveLinks', param)
.then((res) => {
if (res.message.includes('成功')) {
that.$message({
showClose: true,
message: '保存成功',
type: 'success'
})
} else {
that.$message({
showClose: true,
message: '保存失败',
type: 'error'
})
}
})
.catch((err) => console.error(err))
},
deeTableBlur(row, status) { deeTableBlur(row, status) {
var that = this var that = this
const param = { const param = {
......
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