Commit f0de95cf authored by dlkong's avatar dlkong

12.12

parent a75175ab
...@@ -161,10 +161,11 @@ ...@@ -161,10 +161,11 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="选择隐患清单库" :visible.sync="patrolLibraryOpen" width="60%" append-to-body> <el-dialog title="选择隐患清单库" :visible.sync="patrolLibraryOpen" width="60%" append-to-body>
<el-table :data="libraryList" @selection-change="handleSelectionChange" ref="libraryListTabel" :key="isUpdate"> <el-table :data="libraryList" @selection-change="handleSelectionChange" ref="libraryListTabel" :key="isUpdate" row-key="id">
<el-table-column <el-table-column
type="selection" type="selection"
width="55"> width="55"
:reserve-selection="true">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="场所位置" label="场所位置"
...@@ -361,6 +362,10 @@ export default { ...@@ -361,6 +362,10 @@ export default {
currentRiskTypeList:[] currentRiskTypeList:[]
} }
this.listUserTabel = [] this.listUserTabel = []
this.libraryParams = {
pageNum: 1,
pageSize: 10,
}
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -419,7 +424,7 @@ export default { ...@@ -419,7 +424,7 @@ export default {
}) })
params.list = arr params.list = arr
} }
console.log('params==>>',params) // console.log('params==>>',params)
if (this.form.id != null) { if (this.form.id != null) {
params.id = this.form.id params.id = this.form.id
saveCurrentPost(params).then(response => { saveCurrentPost(params).then(response => {
...@@ -461,7 +466,7 @@ export default { ...@@ -461,7 +466,7 @@ export default {
} }
this.listUserTabel.push(data) this.listUserTabel.push(data)
}) })
console.log('this.listUserTabel==>>',this.listUserTabel) // console.log('this.listUserTabel==>>',this.listUserTabel)
} }
}, },
// 一岗一人巡查模式 清单库 // 一岗一人巡查模式 清单库
...@@ -476,13 +481,45 @@ export default { ...@@ -476,13 +481,45 @@ export default {
item.cycle = '0' item.cycle = '0'
}) })
this.libraryTotal = response.total; this.libraryTotal = response.total;
// if (this.listForm.postState == '0') {
// console.log('翻页postList==>>',this.postList)
// this.$nextTick(()=>{
// for (let i = 0; i < this.libraryList.length; i++) {
// for (let j = 0; j <this.postList.length; j++) {
// //两个数组做比对,选中的做勾选
// if(this.libraryList[i].id===this.postList[j].id)
// {
// this.$refs.libraryListTabel.toggleRowSelection(this.libraryList[i]);
// }
// }
// }
// })
// }else{
// this.$nextTick(()=>{
// for (let i = 0; i < this.libraryList.length; i++) {
// for (let j = 0; j <this.listUserTabel[this.userIndex].postName.length; j++) {
// //两个数组做比对,选中的做勾选
// if(this.libraryList[i].id===this.listUserTabel[this.userIndex].postName[j].id)
// {
// this.$refs.libraryListTabel.toggleRowSelection(this.libraryList[i]);
// }
// }
// }
// })
// }
}); });
}, },
// 选择清单库确定 // 选择清单库确定
patrolLibrarySubmit(){ patrolLibrarySubmit(){
if (this.listForm.postState == '0') {
this.postList = [] this.postList = []
this.listForm.currentRiskTypeList = [] this.listForm.currentRiskTypeList = []
this.patrolLibraryOpen = false }else{
this.listUserTabel[this.userIndex].postName = []
this.listUserTabel[this.userIndex].postNameShow = []
}
console.log('this.multipleSelection==>>',this.multipleSelection)
this.multipleSelection.forEach((item) => { this.multipleSelection.forEach((item) => {
if (this.listForm.postState == '0') { // 一岗一人巡查模式 if (this.listForm.postState == '0') { // 一岗一人巡查模式
let data = { let data = {
...@@ -493,6 +530,7 @@ export default { ...@@ -493,6 +530,7 @@ export default {
if(!this.listForm.currentRiskTypeList.some( items => items.type === item.type)){ if(!this.listForm.currentRiskTypeList.some( items => items.type === item.type)){
this.listForm.currentRiskTypeList.push(item) this.listForm.currentRiskTypeList.push(item)
} }
// console.log('清单库确定postList==>>',this.postList)
}else{ // 一岗多人巡查模式 }else{ // 一岗多人巡查模式
let data = { let data = {
id: item.id, id: item.id,
...@@ -504,9 +542,12 @@ export default { ...@@ -504,9 +542,12 @@ export default {
if(!this.listUserTabel[this.userIndex].postNameShow.some( items => items.type === item.type)){ if(!this.listUserTabel[this.userIndex].postNameShow.some( items => items.type === item.type)){
this.listUserTabel[this.userIndex].postNameShow.push(item) this.listUserTabel[this.userIndex].postNameShow.push(item)
} }
// console.log('清单库确定listUserTabel==>>',this.listUserTabel)
} }
}) })
// console.log('listUserTabel==>>',this.listUserTabel) this.$refs.libraryListTabel.clearSelection()
this.patrolLibraryOpen = false
}, },
// 状态切换 // 状态切换
statusChange(num, e){ statusChange(num, e){
...@@ -527,6 +568,11 @@ export default { ...@@ -527,6 +568,11 @@ export default {
this.userId = row.userId this.userId = row.userId
this.userIndex = index this.userIndex = index
this.userStatus = row.status this.userStatus = row.status
this.multipleSelection = []
this.libraryParams = {
pageNum: 1,
pageSize: 10,
}
this.getlibraryList() this.getlibraryList()
}, },
// tabs切换 // tabs切换
...@@ -550,6 +596,8 @@ export default { ...@@ -550,6 +596,8 @@ export default {
getCurrentRiskPatrol(params).then(response => { getCurrentRiskPatrol(params).then(response => {
if (this.listForm.postState == '0') { // 一岗一人巡查模式 if (this.listForm.postState == '0') { // 一岗一人巡查模式
this.postList = []
this.listForm.currentRiskTypeList = []
response.rows.forEach((item) => { response.rows.forEach((item) => {
let data = { let data = {
id: item.currentRiskId, id: item.currentRiskId,
...@@ -560,8 +608,10 @@ export default { ...@@ -560,8 +608,10 @@ export default {
this.listForm.currentRiskTypeList.push(item) this.listForm.currentRiskTypeList.push(item)
} }
}) })
console.log('==>>',this.listForm.currentRiskTypeList) // console.log('postList==>>',this.postList)
}else{ // 一岗多人巡查模式 }else{ // 一岗多人巡查模式
this.listUserTabel = []
// this.listUserTabel[this.userIndex].postNameShow = []s
let arr = this.form.nickName.split(',') let arr = this.form.nickName.split(',')
arr.forEach((item, index) => { arr.forEach((item, index) => {
let data = { let data = {
......
...@@ -37,10 +37,10 @@ module.exports = { ...@@ -37,10 +37,10 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: "http://192.168.10.137:8080/", // target: "http://192.168.10.137:8080/",
target: `http://192.168.4.232:8080`, //服务器地址 // target: `http://192.168.4.232:8080`, //服务器地址
// target: `http://192.168.15.230:8081`, //晓晋本地地址 // target: `http://192.168.15.230:8081`, //晓晋本地地址
// target: `http://192.168.15.152:8081`, //鲍德本地地址 // target: `http://192.168.15.152:8081`, //鲍德本地地址
// target: `http://127.0.0.1:8080`, //本地地址 target: `http://127.0.0.1:8080`, //本地地址
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "", ["^" + process.env.VUE_APP_BASE_API]: "",
......
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