|
|
@ -122,7 +122,7 @@ |
|
|
|
<el-button type="text" |
|
|
|
style="color:#D51010;text-decoration: underline;" |
|
|
|
size="small" |
|
|
|
@click="handleDelete(scope.row)">删除</el-button> |
|
|
|
@click="handleDelete(scope.row,scope.$index)">删除</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
@ -190,16 +190,17 @@ export default { |
|
|
|
//点击分队切换人员 |
|
|
|
async hancleChangeTeam (row, index, tableIndex) { |
|
|
|
this.tableData[tableIndex].inspectorArray = [...[]] |
|
|
|
await this.loadInspectors(index, tableIndex) |
|
|
|
let teamId = this.teamsList[index].teamId |
|
|
|
await this.loadInspectors(teamId, tableIndex) |
|
|
|
}, |
|
|
|
|
|
|
|
//加载分队下人员 |
|
|
|
async loadInspectors (index, tableIndex) { |
|
|
|
async loadInspectors (teamId, tableIndex) { |
|
|
|
|
|
|
|
const url = '/gov/org/placepatrolteamstaff/getlist' |
|
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolteamstaff/getlist' |
|
|
|
let params = { |
|
|
|
teamId: this.teamsList[index].teamId |
|
|
|
teamId: teamId |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
@ -231,6 +232,7 @@ export default { |
|
|
|
if (data.list && data.list.length > 0) { |
|
|
|
data.list.forEach(item => { |
|
|
|
item.isEdit = false |
|
|
|
item.isNew = false |
|
|
|
let array = item.inspectors.split(',') |
|
|
|
item.inspectorArray = [...array] |
|
|
|
|
|
|
@ -264,10 +266,15 @@ export default { |
|
|
|
this.tableData.push(obj) |
|
|
|
}, |
|
|
|
|
|
|
|
handleEdit (row, index) { |
|
|
|
|
|
|
|
this.loadInspectors(index) |
|
|
|
async handleEdit (row, tableIndex) { |
|
|
|
let teamId = row.placePatrolTeamId |
|
|
|
await this.loadInspectors(teamId, tableIndex) |
|
|
|
|
|
|
|
let params = JSON.parse(JSON.stringify(row)) |
|
|
|
params.isEdit = true |
|
|
|
params.isNew = false |
|
|
|
params.inspectorArray = params.inspectors.split(',') |
|
|
|
this.tableData[tableIndex] = { ...params } |
|
|
|
}, |
|
|
|
|
|
|
|
async handleComfirm (row, tableIndex) { |
|
|
@ -326,7 +333,7 @@ export default { |
|
|
|
return message |
|
|
|
}, |
|
|
|
|
|
|
|
async handleDelete (row) { |
|
|
|
async handleDelete (row, tableIndex) { |
|
|
|
|
|
|
|
this.$confirm("确认删除?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
@ -334,7 +341,12 @@ export default { |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
this.deleteRecord(row) |
|
|
|
if (row.placePatrolReviewRecordId) {//存在id,调用服务删除 |
|
|
|
this.deleteRecord(row, tableIndex) |
|
|
|
} else {//不存在id,直接删除数组数据 |
|
|
|
this.tableData.splice(tableIndex, 1); |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
if (err == "cancel") { |
|
|
@ -344,7 +356,8 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async deleteRecord (row) { |
|
|
|
async deleteRecord (row, tableIndex) { |
|
|
|
|
|
|
|
const url = "/gov/org/placepatrolrecord/delreview" |
|
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolrecord/delreview" |
|
|
|
|
|
|
@ -360,15 +373,13 @@ export default { |
|
|
|
message: "删除成功" |
|
|
|
}); |
|
|
|
|
|
|
|
this.loadTable() |
|
|
|
this.tableData.splice(tableIndex, 1); |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleCancle () { |
|
|
|
|
|
|
|
|
|
|
|
this.$emit('dialogCancle') |
|
|
|
|
|
|
|
}, |
|
|
|