|
@@ -0,0 +1,349 @@
|
|
|
+<template>
|
|
|
+ <el-button text @click="dialogVisible = true"
|
|
|
+ >{{title}}</el-button
|
|
|
+ >
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialogVisible"
|
|
|
+ title="养老机构选择"
|
|
|
+ width="80%"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <div class="echarts-box">
|
|
|
+ <div class="ssqh">
|
|
|
+ <p class="sxzd">行政区划</p>
|
|
|
+
|
|
|
+ <el-scrollbar wrapClass="scroll-wrap">
|
|
|
+ <el-tree
|
|
|
+ node-key="code"
|
|
|
+ :props="defaultProps"
|
|
|
+ :default-expanded-keys="expands"
|
|
|
+ :expand-on-click-node="false"
|
|
|
+ lazy
|
|
|
+ :load="loadNode"
|
|
|
+ ref="tree"
|
|
|
+ :check-strictly="true"
|
|
|
+ show-checkbox
|
|
|
+ highlight-current
|
|
|
+ @check="checkGroupNode"
|
|
|
+ />
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <div class="jgxz">
|
|
|
+ <el-from :model="formLabelAlign" ref="queryRef">
|
|
|
+ <div class="flex">
|
|
|
+ <el-form-item label="机构名称" prop="jgmc">
|
|
|
+ <el-input v-model="formLabelAlign.jgmc" clearable placeholder="请输入机构名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="机构类型" prop="status">
|
|
|
+ <el-select v-model="formLabelAlign.status" clearable placeholder="请选择机构类型">
|
|
|
+ <el-option v-for="item in DictS.XZ093" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="有无空余床位" prop="cwzs">
|
|
|
+ <el-select v-model="formLabelAlign.cwzs" clearable placeholder="请选择有无空余床位">
|
|
|
+ <el-option v-for="item in DictS.CZ035" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="danger" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button @click="resetQuery()">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-from>
|
|
|
+
|
|
|
+ <el-table stripe :row-height="20" :data="jgList.slice((currentPage-1)*pagesize,currentPage*pagesize)" @selection-change="handleSelectionChange" >
|
|
|
+ <el-table-column v-if="seltype === 'select'" :key="indexMethod" label="选择" width="100px" height="50px" type="selection" align="center"/>
|
|
|
+ <el-table-column label="序号" :width="'90px'" height="50px" type="index" :index="indexMethod" align="center"/>
|
|
|
+ <el-table-column label="机构名称" align="center" prop="jgmc"/>
|
|
|
+ <!--el-table-column label="建立日期" align="center" prop="jlrq"/>
|
|
|
+ <el-table-column label="床位数" align="center" prop="cwzs"/-->
|
|
|
+ <el-table-column label="通信地址" align="center" prop="txdz"/>
|
|
|
+ <el-table-column label="联系方式" align="center" prop="frlxfs"/>
|
|
|
+ <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handlesel(scope.row)"
|
|
|
+ >
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ v-show="totalcount > 0"
|
|
|
+ :total="totalcount"
|
|
|
+ v-model:page="formLabelAlign.pageNum"
|
|
|
+ v-model:limit="formLabelAlign.pageSize"
|
|
|
+ @pagination="handleQuery"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="dialogVisible = false"
|
|
|
+ >关闭</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import {defineComponent,getCurrentInstance,reactive} from "vue";
|
|
|
+import { ElMessageBox } from 'element-plus'
|
|
|
+import {gettreedata,jcxxList} from "@/api/home";
|
|
|
+import {mapState} from 'vuex';
|
|
|
+let MyDict= {};
|
|
|
+export default {
|
|
|
+ setup() {
|
|
|
+ const { proxy } = getCurrentInstance();
|
|
|
+ MyDict = proxy.useDict("XZ093", "CZ035", "CZ015");
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ this.DictS=MyDict;
|
|
|
+ },
|
|
|
+ props:{
|
|
|
+ title:{
|
|
|
+ type:String,
|
|
|
+ default:"qubau",
|
|
|
+ },
|
|
|
+ isJl:{
|
|
|
+ type:Boolean,
|
|
|
+ default:true,
|
|
|
+ },
|
|
|
+ isLoad:{
|
|
|
+ type:Boolean,
|
|
|
+ default:true,
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ dialogVisible:false,
|
|
|
+ defaultProps: {
|
|
|
+ childre: 'children',
|
|
|
+ label: 'label',
|
|
|
+ isLeaf: 'leaf',
|
|
|
+ },
|
|
|
+ formLabelAlign: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ jgmc: "",
|
|
|
+ szxzqh: "",
|
|
|
+ status: "",
|
|
|
+ isChxddjg: "",
|
|
|
+ pddj: "",
|
|
|
+ cwzs: ""
|
|
|
+ },
|
|
|
+ expands:['220000000000'],
|
|
|
+ treenode:[],
|
|
|
+ resolve:{},
|
|
|
+ DictS:{},
|
|
|
+ totalcount:0,
|
|
|
+ pagesize:10,
|
|
|
+ currentPage:1,
|
|
|
+ headerlist: ["a","b","c"],
|
|
|
+ fieldwidths:["100","100","100"],
|
|
|
+ jgList:[],
|
|
|
+ seltype: 'index',
|
|
|
+ single: false,
|
|
|
+ multiple: false,
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+
|
|
|
+ methods:{
|
|
|
+ handlesel(row)
|
|
|
+ {
|
|
|
+ this.$emit('handleNodeClick',row);
|
|
|
+ this.dialogVisible = false;
|
|
|
+ },
|
|
|
+ indexMethod(index)
|
|
|
+ {
|
|
|
+ let curpage=this.currentPage;
|
|
|
+ let limitpage=this.pagesize;
|
|
|
+ return index+1+(curpage-1)*limitpage;
|
|
|
+ },
|
|
|
+ rowClass({row,rowIndex})
|
|
|
+ {
|
|
|
+ return 'background:#c0cefa';
|
|
|
+ },
|
|
|
+ cellClass({row,column,rowIndex,columnIndex})
|
|
|
+ {
|
|
|
+ return 'border-left-color: #40c9c6;border-left-width:20px;';
|
|
|
+ },
|
|
|
+ current_change:function(currentPage){
|
|
|
+ this.currentPage = currentPage;
|
|
|
+ },
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item[0].idx);
|
|
|
+ this.items = selection.map((item, index) => {
|
|
|
+ return {...item, index: this.jgList.map(ite => ite[0].idx).indexOf(item[0].idx)}
|
|
|
+ });
|
|
|
+ this.single = selection.length !== 1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ handleOnclick(idx){
|
|
|
+ const ids = idx;
|
|
|
+ var ret={};
|
|
|
+ for(var j=0;j<this.fields.length;j++) {
|
|
|
+ ret[this.fields[j]]=this.oldtrainingList[ids][j];
|
|
|
+ }
|
|
|
+ this.success(ret);
|
|
|
+ this.close();
|
|
|
+ },
|
|
|
+ updatetree()
|
|
|
+ {
|
|
|
+ if (this.treenode) {
|
|
|
+ this.treenode.childNodes = [] // 清空子节点
|
|
|
+ this.loadNode(this.treenode, this.resolve) // 再次执行 load 的方法
|
|
|
+ }
|
|
|
+ },
|
|
|
+ treeClear(){
|
|
|
+ console.log('重置了');
|
|
|
+ this.$refs.tree.setCheckedKeys([]);
|
|
|
+ },
|
|
|
+ check (data, checked, indeterminate) {
|
|
|
+ this.$refs.tree.setCheckedKeys([data.code])
|
|
|
+ },
|
|
|
+ handleNodeClick(data,node,root) {
|
|
|
+ let retdata=[];
|
|
|
+ retdata.push(node.data);
|
|
|
+ let pp=node.parent;
|
|
|
+ while (pp)
|
|
|
+ {
|
|
|
+ retdata.push(pp.data);
|
|
|
+ pp=pp.parent;
|
|
|
+ }
|
|
|
+ this.$emit('handleNodeClick',retdata);
|
|
|
+ //this.dialogVisible = false;
|
|
|
+ },
|
|
|
+ checkGroupNode(a, b){
|
|
|
+ if (b.checkedKeys.length > 0) {
|
|
|
+ this.$refs.tree.setCheckedKeys([a.code]);
|
|
|
+ this.formLabelAlign.szxzqh=a.code;
|
|
|
+ // this.$emit('handleNodeClick',a)
|
|
|
+ }else {
|
|
|
+ this.formLabelAlign.szxzqh="";
|
|
|
+ //this.$emit('handleNodeClick',{code:null})
|
|
|
+ }
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ async getdata(level, cs2, cs3, resolve) {
|
|
|
+
|
|
|
+ var para = {};
|
|
|
+ para.dictType = "xzqh";
|
|
|
+ para.outType = '0';
|
|
|
+ para.para1 = level;
|
|
|
+ para.para2 = cs2;
|
|
|
+ para.para3 = cs3;
|
|
|
+ let data = await gettreedata(para);
|
|
|
+ var treedata = [];
|
|
|
+ if (data.code == 200) {
|
|
|
+ for (let i = 0; i < data.data[0].recordCount; i++) {
|
|
|
+ treedata[i] = {};
|
|
|
+ for (let j = 0; j < data.data[0].columnLabelList.length; j++) {
|
|
|
+ treedata[i][data.data[0].columnLabelList[j].toLowerCase()] = data.data[0].rowList[i][j];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ;
|
|
|
+ treedata.forEach((item) => {
|
|
|
+ item.isleaf == '0' ? (item.leaf = false) : (item.leaf = true)
|
|
|
+ })
|
|
|
+ resolve(treedata);
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async loadNode(node, resolve) {
|
|
|
+
|
|
|
+ if (node.level === 0) {
|
|
|
+ this.treenode=node;
|
|
|
+ this.resolve=resolve;
|
|
|
+ // if (this.isLoad==false) return ;
|
|
|
+ return this.getdata(node.level, 'sj', '', resolve);
|
|
|
+ } else if (node.level >= 1) {
|
|
|
+ // if (this.isLoad==false) return ;
|
|
|
+ return this.getdata(node.level, node.data.nextlevel, node.data.id, resolve);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // handleNodeClick(data) {
|
|
|
+ // this.$emit('handleNodeClick',data)
|
|
|
+ // },
|
|
|
+ handleQuery() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ resetQuery() {
|
|
|
+ this.formLabelAlign.jgmc = '';
|
|
|
+ this.formLabelAlign.szxzqh = '';
|
|
|
+ this.formLabelAlign.status = '';
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ ,
|
|
|
+ getList(querd) {
|
|
|
+
|
|
|
+ let quer = {}
|
|
|
+ if (querd) {
|
|
|
+ quer = querd
|
|
|
+ } else {
|
|
|
+ quer = {
|
|
|
+ ...this.formLabelAlign,
|
|
|
+ szxzqh: this.formLabelAlign.szxzqh
|
|
|
+ }
|
|
|
+ }
|
|
|
+ jcxxList(quer).then(response => {
|
|
|
+ this.jgList = response.rows;
|
|
|
+ this.totalcount=response.total;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ isLoad(newVal) {
|
|
|
+ this.updatetree();
|
|
|
+ },
|
|
|
+ }
|
|
|
+ ,
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.flex {
|
|
|
+ display: flex;
|
|
|
+ margin-top: 24px;
|
|
|
+}
|
|
|
+.fy{
|
|
|
+ text-align:center;
|
|
|
+ margin-top:10px;
|
|
|
+}
|
|
|
+.echarts-box {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+.ssqh {
|
|
|
+ width: 20%;
|
|
|
+}
|
|
|
+.jgxz {
|
|
|
+ width: 80%;
|
|
|
+}
|
|
|
+.sxzd {
|
|
|
+ font-weight: 600;
|
|
|
+ margin: 10px 15px;
|
|
|
+}
|
|
|
+.dialog-footer button:first-child {
|
|
|
+ margin-right: 10px;
|
|
|
+}
|
|
|
+::v-deep .scroll-wrap{
|
|
|
+ height: 62vh;
|
|
|
+ padding-right: 10px;
|
|
|
+}
|
|
|
+</style>
|