36176622 by renchao@pashanhoo.com

style:table组件完成

1 parent baaf0b60
{
"TITLE": "不动产登记系统",
"SERVERAPI": "/bdcdj",
"SERVERAPI": "/bdcdj-th",
"IDCARDURL": "http://127.0.0.1:33088/function=get_idcard&readnew=0"
}
......
......@@ -4,12 +4,12 @@
* @Author: sakuya
* @Date: 2021年6月10日10:04:07
* @LastEditors: Please set LastEditors
* @LastEditTime: 2023-06-29 11:14:11
* @LastEditTime: 2023-07-05 10:39:17
-->
<template>
<el-select ref="select" v-model="defaultValue" :size="size" :clearable="clearable" :multiple="multiple" :collapse-tags="collapseTags"
:collapse-tags-tooltip="collapseTagsTooltip" :filterable="filterable" :placeholder="placeholder" :disabled="disabled" :filter-method="filterMethod"
:collapse-tags-tooltip="collapseTagsTooltip" :filterable="filterable" :placeholder="placeholder" :disabled="disabled"
@remove-tag="removeTag" @visible-change="visibleChange" @clear="clear">
<template #empty>
<div class="sc-table-select__table" :style="{width: tableWidth+'px'}" v-loading="loading">
......@@ -19,14 +19,10 @@
<el-table ref="table" :data="tableData" :height="245" :highlight-current-row="!multiple" @row-click="click" @select="select" @select-all="selectAll">
<el-table-column v-if="multiple" type="selection" width="45"></el-table-column>
<el-table-column v-else type="index" width="45">
<template #default="scope"><span>{{scope.$index+(currentPage - 1) * pageSize + 1}}</span></template>
<template #default="scope"><span>{{scope.$index +1 }}</span></template>
</el-table-column>
<slot></slot>
</el-table>
<div class="sc-table-select__page">
<el-pagination small background layout="prev, pager, next" :total="total" :page-size="pageSize" v-model:currentPage="currentPage"
@current-change="reload"></el-pagination>
</div>
</div>
</template>
</el-select>
......@@ -48,29 +44,23 @@
disabled: { type: Boolean, default: false },
tableWidth: { type: Number, default: 400 },
mode: { type: String, default: "popover" },
props: { type: Object, default: () => { } }
props: { type: Object, default: () => { } },
// 表格数据
tableData: { type: Array, default: () => { [] } },
},
data () {
return {
loading: false,
keyword: null,
defaultValue: [],
tableData: [],
pageSize: config.pageSize,
total: 0,
currentPage: 1,
defaultProps: {
label: config.props.label,
value: config.props.value,
page: config.request.page,
pageSize: config.request.pageSize,
keyword: config.request.keyword
value: config.props.value
},
formData: {}
}
},
computed: {
},
watch: {
modelValue: {
......@@ -90,8 +80,6 @@
//表格显示隐藏回调
visibleChange (visible) {
if (visible) {
this.currentPage = 1
this.keyword = null
this.formData = {}
this.getData()
} else {
......@@ -100,36 +88,7 @@
},
//获取表格数据
async getData () {
this.loading = true;
var reqData = {
[this.defaultProps.page]: this.currentPage,
[this.defaultProps.pageSize]: this.pageSize,
[this.defaultProps.keyword]: this.keyword
}
Object.assign(reqData, this.formData)
// var res = await this.apiObj.get(reqData);
let res = {
code: 200,
data: {
total: 2, rows: [
{
user: 11111111111,
id: 111111111111
},
{
user: 2222222222222,
id: 22222222222
}
]
},
message: ""
}
var parseData = config.parseData(res)
this.tableData = parseData.rows;
this.total = parseData.total;
this.loading = false;
//表格默认赋值
this.$nextTick(() => {
if (this.multiple) {
this.defaultValue.forEach(row => {
var setrow = this.tableData.filter(item => item[this.defaultProps.value] === row[this.defaultProps.value])
......@@ -138,20 +97,15 @@
}
})
} else {
if (this.defaultValue) {
var setrow = this.tableData.filter(item => item[this.defaultProps.value] === this.defaultValue[this.defaultProps.value])
this.$refs.table.setCurrentRow(setrow[0]);
// this.$refs.table.setCurrentRow(setrow[0]);
}
this.$refs.table.setScrollTop(0)
})
}
// this.$refs.table.setScrollTop(0)
},
//插糟表单提交
formSubmit () {
this.currentPage = 1
this.keyword = null
this.getData()
},
//分页刷新表格
reload () {
this.getData()
},
//自动模拟options赋值
......@@ -162,8 +116,10 @@
item.currentLabel = item.value[this.defaultProps.label]
})
} else {
if (this.defaultValue) {
this.$refs.select.selectedLabel = this.defaultValue[this.defaultProps.label]
}
}
})
},
//表格勾选事件
......@@ -207,6 +163,7 @@
this.defaultValue = row
this.$refs.select.blur()
this.autoCurrentLabel()
this.$refs.table.setCurrentRow(row);
this.$emit('update:modelValue', this.defaultValue);
this.$emit('change', this.defaultValue);
}
......@@ -225,14 +182,6 @@
findRowByKey (value) {
return this.tableData.find(item => item[this.defaultProps.value] === value)
},
filterMethod (keyword) {
if (!keyword) {
this.keyword = null;
return false;
}
this.keyword = keyword;
this.getData()
},
// 触发select隐藏
blur () {
this.$refs.select.blur();
......@@ -244,7 +193,6 @@
}
}
</script>
<style scoped>
.sc-table-select__table {
padding: 12px;
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-06-29 11:05:49
* @LastEditTime: 2023-07-05 09:48:23
*/
//表格选择器配置
......@@ -9,17 +9,12 @@ export default {
pageSize: 10, //表格每一页条数
parseData: function (res) {
return {
data: res.data,
rows: res.data.rows, //分析行数据字段结构
total: res.data.total, //分析总数字段结构
msg: res.message, //分析描述字段结构
code: res.code //分析状态字段结构
data: res.data
}
},
request: {
page: 'page', //规定当前分页字段
pageSize: 'pageSize', //规定一页条数字段
keyword: 'keyword' //规定搜索字段
},
props: {
label: 'label', //映射label显示字段
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-06-25 15:52:42
* @LastEditTime: 2023-07-05 10:05:46
-->
<template>
<!-- 受理信息 -->
......@@ -13,8 +13,7 @@
ref="ruleForm"
:label-position="flag ? 'top' : ''"
:inline="flag"
label-width="145px"
>
label-width="145px">
<div class="slxx_con" v-if="isShow" :class="flag ? 'formMarginBot0' : ''">
<div class="slxx_title title-block">
补录信息
......@@ -39,17 +38,35 @@
</el-row>
<div class="slxx_title title-block">
抵押不动产情况
<div>
请选择抵押不动产信息,
<select-table v-model="value2" :table-width="600" :props="props" @change="change">
<el-table-column prop="qllxmc" label="权利类型" width="180"></el-table-column>
<el-table-column prop="bdcqzh" label="不动产权证书"></el-table-column>
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="抵押不动产信息:">
<select-table v-model="ruleForm.ztQlxx" :table-width="550" :tableData="ztQlxxList"
:props="props" @change="ztQlxxchange">
<el-table-column prop="qllxmc" width="130" label="权利类型"></el-table-column>
<el-table-column prop="bdcqzh" width="160" label="不动产权证书"></el-table-column>
<el-table-column prop="qlrmc" label="权利人"></el-table-column>
<el-table-column prop="mjmc" label="面积"></el-table-column>
<el-table-column prop="ytmc" label="用途"></el-table-column>
<el-table-column prop="zl" label="坐落"></el-table-column>
</select-table>请选择上手权利信息
</div>
</select-table>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="上手权利信息:">
<select-table v-model="ruleForm.ssQlxx" :table-width="550" :tableData="ssQlxxList"
:props="props" @change="ssQlxxchange">
<el-table-column prop="qllxmc" width="130" label="权利类型"></el-table-column>
<el-table-column prop="bdcqzh" width="160" label="不动产权证书"></el-table-column>
<el-table-column prop="qlrmc" label="权利人"></el-table-column>
<el-table-column prop="mjmc" label="面积"></el-table-column>
<el-table-column prop="ytmc" label="用途"></el-table-column>
<el-table-column prop="zl" label="坐落"></el-table-column>
</select-table>
</el-form-item>
</el-col>
</el-row>
<div class="triangle"></div>
</div>
<el-row :gutter="10" v-if="ruleForm.ztQlxx!=null">
......@@ -137,8 +154,7 @@
v-for="item in djlxlist"
:key="item.dcode"
:label="item.dname"
:value="item.dcode"
></el-option>
:value="item.dcode"></el-option>
</el-select>
</el-form-item>
</el-col>
......@@ -149,8 +165,7 @@
v-for="item in qsztlist"
:key="item.dcode"
:label="item.dname"
:value="item.dcode"
></el-option>
:value="item.dcode"></el-option>
</el-select>
</el-form-item>
</el-col>
......@@ -199,8 +214,7 @@
v-for="item in dictData['A27']"
:key="item.dcode"
:label="item.dname"
:value="item.dcode"
></el-option>
:value="item.dcode"></el-option>
</el-select>
</el-form-item>
</el-col>
......@@ -236,8 +250,7 @@
v-for="item in dictData['A6']"
:key="item.dcode"
:label="item.dname"
:value="item.dcode"
></el-option>
:value="item.dcode"></el-option>
</el-select>
</el-form-item>
</el-col>
......@@ -257,15 +270,13 @@
<el-input
v-model="ruleForm.diyaq.dymj"
style="width: 500%"
oninput="value=value.replace(/[^\d.]/g,'')"
></el-input>
oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
<el-select v-model="ruleForm.diyaq.mjdw">
<el-option
v-for="item in dictData['A7']"
:key="item.dcode"
:label="item.dname"
:value="item.dcode"
></el-option>
:value="item.dcode"></el-option>
</el-select>
</div>
</el-form-item>
......@@ -276,15 +287,13 @@
<el-input
v-model="ruleForm.diyaq.zgzqse"
style="width: 500%"
oninput="value=value.replace(/[^\d.]/g,'')"
></el-input>
oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
<el-select v-model="ruleForm.diyaq.jedw">
<el-option
v-for="item in dictData['A57']"
:key="item.dcode"
:label="item.dname"
:value="item.dcode"
></el-option>
:value="item.dcode"></el-option>
</el-select>
</div>
</el-form-item>
......@@ -295,15 +304,13 @@
<el-input
v-model="ruleForm.diyaq.bdbzzqse"
style="width: 500%"
oninput="value=value.replace(/[^\d.]/g,'')"
></el-input>
oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
<el-select v-model="ruleForm.diyaq.jedw">
<el-option
v-for="item in dictData['A57']"
:key="item.dcode"
:label="item.dname"
:value="item.dcode"
></el-option>
:value="item.dcode"></el-option>
</el-select>
</div>
</el-form-item>
......@@ -394,8 +401,7 @@
:tableData="ruleForm.qlrData"
@upDateQlrxxList="upDateQlrxxList"
:key="key"
:gyfs="ruleForm.qlxx.gyfs"
/>
:gyfs="ruleForm.qlxx.gyfs" />
<div>
<div class="slxx_title title-block">
......@@ -406,8 +412,7 @@
v-if="ruleForm.ywrData"
:tableData="ruleForm.ywrData"
:key="key"
@upDateQlrxxList="upDateYwrxxList"
/>
@upDateQlrxxList="upDateYwrxxList" />
</div>
</div>
<el-row class="btn">
......@@ -419,24 +424,22 @@
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { init, getSsQlxx, getZtQlxx, save } from "@/api/djbbl.js";
import qlrCommonTable from "@/views/djbworkflow/components/qlrCommonTable";
import ywrCommonTable from "@/views/djbworkflow/components/ywrCommonTable";
import selectTable from "@/components/selectTable/index.vue";
import tdytTable from "@/views/workflow/components/tdytTable";
export default {
import { mapGetters } from "vuex";
import { init, getSsQlxx, getZtQlxx, save } from "@/api/djbbl.js";
import qlrCommonTable from "@/views/djbworkflow/components/qlrCommonTable";
import ywrCommonTable from "@/views/djbworkflow/components/ywrCommonTable";
import selectTable from "@/components/selectTable/index.vue";
import tdytTable from "@/views/workflow/components/tdytTable";
export default {
components: { qlrCommonTable, ywrCommonTable, tdytTable, selectTable },
computed: {
...mapGetters(["dictData", "flag"]),
},
data() {
data () {
return {
value2: "",
props: {
label: "user",
value: "id",
keyword: "keyword",
label: "bdcqzh",
value: "bdcdyid"
},
//表单是否可操作
propsParam: this.$attrs,
......@@ -445,7 +448,7 @@ export default {
disabled: true,
czrOptions: [],
ruleForm: {},
//传递参数\
//传递参数
rules: {},
// 权属状态
qsztlist: [
......@@ -490,12 +493,17 @@ export default {
ztQlxxList: [],
};
},
created() {
created () {
this.loadData();
},
mounted() {},
methods: {
loadData() {
ztQlxxchange (val) {
this.ruleForm.ztQlxx = val
},
ssQlxxchange (val) {
this.ruleForm.ssQlxx = val
},
loadData () {
this.propsParam.isEdit = this.$parent.isEdit;
init(this.propsParam).then((res) => {
if (res.code == 200) {
......@@ -504,39 +512,36 @@ export default {
}
});
//获取主体信息
getSsQlxx({ bdcdyid: this.propsParam.bdcdyid, qllx: this.propsParam.qllx}).then((res) => {
getSsQlxx({ bdcdyid: this.propsParam.bdcdyid, qllx: this.propsParam.qllx }).then((res) => {
if (res.code == 200) {
this.ssQlxxList = res.result;
}
});
//获取上手信息
getZtQlxx({bdcdyid: this.propsParam.bdcdyid}).then((res) => {
getZtQlxx({ bdcdyid: this.propsParam.bdcdyid }).then((res) => {
if (res.code == 200) {
this.ztQlxxList = res.result;
}
});
},
// 更新土地用途信息
upDateTdytxxList(val) {
console.log("VAL", val);
upDateTdytxxList (val) {
this.ruleForm.tdytqxList && (this.ruleForm.tdytqxList = _.cloneDeep(val));
this.key++;
},
// 更新权利人信息
upDateQlrxxList(val) {
console.log("val", val);
upDateQlrxxList (val) {
this.ruleForm.qlrData && (this.ruleForm.qlrData = _.cloneDeep(val));
console.log("this.ruleForm.qlrData", this.ruleForm.qlrData);
this.czrOptions = this.ruleForm.qlrData;
this.key++;
},
// 更新义务人信息
upDateYwrxxList(val) {
upDateYwrxxList (val) {
this.ruleForm.ywrData && (this.ruleForm.ywrData = _.cloneDeep(val));
this.key++;
},
onSubmit() {
console.log("this.ruleForm大信息", this.ruleForm);
onSubmit () {
if (this.ruleForm.qlrData.length == 0) {
this.$message({
showClose: true,
......@@ -571,7 +576,7 @@ export default {
} else {
item.sfczr = "0";
}
});
})
}
}
save(this.ruleForm).then((res) => {
......@@ -589,12 +594,12 @@ export default {
type: "error",
});
}
});
},
},
};
})
}
}
};
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
@import "~@/styles/slxx/slxx.scss";
@import "~@/styles/public.scss";
@import "~@/styles/slxx/slxx.scss";
</style>
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-04 16:08:03
* @LastEditTime: 2023-07-05 09:55:42
-->
<template>
<div class="clxx">
......@@ -67,7 +67,7 @@
...mapGetters(["dictData"])
},
created () {
this.ableOperation = this.$parent.currentSelectTab.ableOperation
this.ableOperation = this.$parent?.currentSelectTab?.ableOperation || false
this.clmlInitList(1)
},
methods: {
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-05-24 14:42:24
* @LastEditTime: 2023-07-05 09:58:31
*/
import { getForm } from "../flowform";
import { getHomeNoticeList } from "@/api/home.js"
......@@ -38,6 +38,7 @@ export default {
for (let item of this.tabList) {
if (item.value === tabname) {
this.currentSelectTab = item
console.log(item, 'item11111111111');
break;
}
}
......