9a28e7ca by xiaomiao

选择不动产根据申请业务单一流向状态判断单选还是多选

1 parent 692e4005
......@@ -57,7 +57,7 @@
</div>
<div class="from-clues-content loadingtext">
<lb-table ref="table" @row-click="handleRowClick" :page-size="pageData.pageSize" :calcHeight="300"
:current-page.sync="pageData.currentPage" :total="zrztableData.total" @size-change="handleSizeChange"
:current-page.sync="pageData.currentPage" :total="zrztableData.total" @size-change="handleSizeChange" @select="select"
@p-current-change="handleCurrentChange" @selection-change="handleSelectionChange" :column="zrztableData.columns"
:data="zrztableData.data">
</lb-table>
......@@ -100,15 +100,15 @@
<el-col :span="3" class="btnColRight">
<el-form-item>
<el-button type="primary" @click="resetForm(true)">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" @click="handleSearch">查询11</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="from-clues-content loadingtext">
<lb-table ref="table" @row-dblclick="handleRowClick" :page-size="pageData.pageSize" :calcHeight="400"
:current-page.sync="pageData.currentPage" :total="dztableData.total" @size-change="handleSizeChange"
<lb-table ref="table" @row-click="handleRowClick" :page-size="pageData.pageSize" :calcHeight="400"
:current-page.sync="pageData.currentPage" :total="dztableData.total" @size-change="handleSizeChange" @select="select"
@p-current-change="handleCurrentChange" @selection-change="handleSelectionChange" :column="dztableData.columns"
:data="dztableData.data">
</lb-table>
......@@ -276,7 +276,57 @@
djqxmc: this.sqywInfo.nodetype == "djqx" ? this.sqywInfo.nodename : "",
}
})
}
},
select(selection, row){
if(this.sqywInfo.sqywdylx=="1"){
// 清除 所有勾选项
this.$refs.table.clearSelection()
// 当表格数据都没有被勾选的时候 就返回
// 主要用于将当前勾选的表格状态清除
if(selection.length == 0) return
this.$refs.table.toggleRowSelection(row, true);
}
},
handleRowClick(row){
if(this.sqywInfo.sqywdylx=="1"){
const bdcdysz = this.bdcdysz
this.$refs.table.clearSelection()
if( bdcdysz.length == 1 ) {
bdcdysz.forEach(item => {
// 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中
if (item == row) {
this.$refs.table.toggleRowSelection(row, false);
}
// 不然就让当前的一行勾选
else {
this.$refs.table.toggleRowSelection(row, true);
}
})
}
else {
this.$refs.table.toggleRowSelection(row, true);
}
}else{
const bdcdysz = this.bdcdysz
this.$refs.table.clearSelection()
if( bdcdysz.length >=1 ) {
bdcdysz.forEach(item => {
// 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中
if (item == row) {
this.$refs.table.toggleRowSelection(row, false);
}
// 不然就让当前的一行勾选
else {
this.$refs.table.toggleRowSelection(row, true);
}
})
}
else {
this.$refs.table.toggleRowSelection(row, true);
}
}
},
}
}
</script>
......
......@@ -28,7 +28,7 @@
<!-- 表格 -->
<div class="from-clues-content loadingtext">
<lb-table ref="table" @row-click="handleRowClick" :page-size="pageData.pageSize" :calcHeight="300"
:current-page.sync="pageData.currentPage" :total="tableData.total" @size-change="handleSizeChange"
:current-page.sync="pageData.currentPage" :total="tableData.total" @size-change="handleSizeChange" @select="select"
@p-current-change="handleCurrentChange" @selection-change="handleSelectionChange" :column="tableData.columns"
:data="tableData.data">
</lb-table>
......@@ -61,7 +61,6 @@
columns: datas.columns(),
data: [],
},
radioVal: "",
bdcdysz: [],
bsmSqyw:
this.sqywInfo.nodetype === "djlx"
......@@ -74,6 +73,7 @@
},
methods: {
queryClick () {
console.log("国有建设用地使用权首次登记",this.sqywInfo.sqywdylx);
this.$startLoading();
this.queryForm.sqywbm = this.sqywInfo.djywbm;
selectZdjbxx({ ...this.queryForm, ...this.pageData }).then((res) => {
......@@ -82,19 +82,6 @@
let { total, records } = res.result;
this.tableData.total = total;
this.tableData.data = records;
// this.tableData.columns.splice(0, 1,{
// label: '选择',
// width: '50px',
// render: (h, scope) => {
// return (
// <div class="orgColumn">
// <el-radio v-model={this.radioVal} label={scope.row.bdcdyh}>
// &ensp;
// </el-radio>
// </div>
// )
// }
// })
}
});
},
......@@ -130,6 +117,37 @@
handleSelectionChange (val) {
this.bdcdysz = val;
},
select(selection, row){
if(this.sqywInfo.sqywdylx=="1"){
// 清除 所有勾选项
this.$refs.table.clearSelection()
// 当表格数据都没有被勾选的时候 就返回
// 主要用于将当前勾选的表格状态清除
if(selection.length == 0) return
this.$refs.table.toggleRowSelection(row, true);
}
},
handleRowClick(row, column){
if(this.sqywInfo.sqywdylx=="1"){
const bdcdysz = this.bdcdysz
this.$refs.table.clearSelection()
if( bdcdysz.length == 1 ) {
bdcdysz.forEach(item => {
// 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中
if (item == row) {
this.$refs.table.toggleRowSelection(row, false);
}
// 不然就让当前的一行勾选
else {
this.$refs.table.toggleRowSelection(row, true);
}
})
}
else {
this.$refs.table.toggleRowSelection(row, true);
}
}
},
},
};
......