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

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

parent 383d9c75
......@@ -194,6 +194,7 @@ export default {
isLeaf: true,
disabled: true,
level: 1,
modelName: this.froms.modelName,
children: res.items && res.items.content.map((t) => {
// quantity += t.completeCount
// total += t.carryCount
......@@ -201,7 +202,8 @@ export default {
serialNo: this.froms.sortieName,
title: t.serialNumber,
icon: 'c-backups3',
id: t.id
id: t.id,
modelName: this.froms.modelName
// quantity: t.completeCount,
// total: t.carryCount
}
......
......@@ -115,6 +115,29 @@
<i v-if="scope.row.countWorkHourLoading" class="el-icon-loading" />
</template>
</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
prop="workHour"
align="center"
......@@ -283,6 +306,8 @@ export default {
total: 0,
pageSizes: [5, 10, 20, 50]
},
// 工作包数据
wpOptions: [],
// 加载中
loading: false,
curRowId: null,
......@@ -318,6 +343,7 @@ export default {
created() {
this.jurisdId = this.$route.query.taskDefinitionKey
this.getTools()
console.log(1)
},
mounted() {
this.$bus.$on('getPlanData', (data, level) => {
......@@ -326,6 +352,7 @@ export default {
this.level = level
this.tablePagination.currentPage = 1
this.getTableData(data, level)
this.getWPOptions(data)
})
})
this.getDicListByCode()
......@@ -338,6 +365,49 @@ export default {
async getDicListByCode() {
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 {
]
},
openProps: [],
openProps: [
{
'name': 'extWorkPackageLinks',
'pageFrom': 1,
'pageSize': 9999,
'openProps': [
{
'name': 'source',
'pageFrom': 1,
'pageSize': 9999
}
]
}
],
sortItem: [
{
fieldName: 'serialNumber',
......@@ -625,7 +708,9 @@ export default {
userName: p.noteName,
createTime: p.createTime,
processTaskId: p.id,
note: p.note
note: p.note,
workPackageSelect: false,
workPackage: p.extWorkPackageLinks && p.extWorkPackageLinks[0].source.id
}
})
that.tableData.length &&
......@@ -796,6 +881,8 @@ export default {
} else if (column.property === 'countWorkHour') {
this.countWorkHour = row.countWorkHour
row.countWorkHourSelect = true
} else if (column.property === 'workPackage') {
row.workPackageSelect = true
} else {
return
}
......@@ -804,6 +891,8 @@ export default {
row.firstCheckFlagSelect = false
} else if (column.property === 'countWorkHour') {
row.countWorkHourSelect = false
} else if (column.property === 'workPackage') {
row.workPackageSelect = false
}
clearTimeout(this.timer)
that.timer = null
......@@ -816,6 +905,7 @@ export default {
} else {
row.firstCheckFlagSelect = false
row.countWorkHourSelect = false
row.workPackageSelect = false
}
},
visibleWorkProcedureChange(event, row) {
......@@ -851,6 +941,30 @@ export default {
that.workProcedureTimer = null
}, 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) {
var that = this
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