ludc
2023-07-06 abe9f2de85ff402a4c989dbc1427807b4e3a59f4
Source/UBCS-WEB/src/components/Tree/classifyTreeform.vue
@@ -1,13 +1,14 @@
<template>
  <div>
    <avue-form v-model="loneTreeNewForm" :option="option" @submit="submit" v-if="flag == 'renonly'">
    <avue-form v-model="loneTreeNewForm" :option="option" v-if="flag == 'renonly'">
    </avue-form>
    <avue-form v-model="loneTreeNewForm" :option="options" @submit="submits" v-else-if="flag == 'edit'">
    </avue-form>
    <div>
<!--      为【编码规则】选取值-->
      <el-dialog  :visible.sync="MasterdialogVisible"   title="为【编码规则】选取值" append-to-body>
        <avue-crud :data="masterData" :option="masterOption" @select="masterSelect"></avue-crud>
<!--     存储业务类型-->
      <el-dialog  :visible.sync="BtmdialogVisible"   title="为【存储业务类型】选取值" append-to-body>
        <avue-crud :data="BtmData" :option="btmOption" @select="btmSelect"></avue-crud>
        <div style="padding-top: 10px;display: flex; justify-content: flex-end" >
          <el-button type="primary" size="small" @click="MasterHandlerClick">确定</el-button>
          <el-button  size="small" @click="MasterdialogVisible=false">取消</el-button>
@@ -15,7 +16,7 @@
      </el-dialog>
<!--      关键属性查询规则-->
      <el-dialog  :visible.sync="KeydialogVisible"   title="为【关键属性查询规则】选取值" append-to-body>
        <avue-crud :data="KeyData" :option="masterOption" @select="masterSelect"></avue-crud>
        <avue-crud :data="KeyData" :option="masterOption" @select="KeySelect"></avue-crud>
        <div style="padding-top: 10px;display: flex; justify-content: flex-end" >
          <el-button type="primary" size="small" @click="KeyHandlerClick">确定</el-button>
          <el-button  size="small" @click="KeydialogVisible=false">取消</el-button>
@@ -23,7 +24,7 @@
      </el-dialog>
      <!--      相似项查询规则-->
      <el-dialog  :visible.sync="SimidialogVisible"   title="为【相似项查询规则】选取值" append-to-body>
        <avue-crud :data="simData" :option="masterOption" @select="masterSelect"></avue-crud>
        <avue-crud :data="simData" :option="masterOption" @select="simSelect"></avue-crud>
        <div style="padding-top: 10px;display: flex; justify-content: flex-end" >
          <el-button type="primary" size="small" @click="simHandlerClick">确定</el-button>
          <el-button  size="small" @click="SimidialogVisible=false">取消</el-button>
@@ -34,20 +35,49 @@
</template>
<script>
import {defaultReferDataGrid} from '@/api/MasterData/master'
import {defaultReferDataGrid,referDataGrid} from '@/api/MasterData/master'
import {TreeEditSave} from '@/api/template/templateAttr'
export default {
  name: "classifyTreeform.vue",
  props: ['loneTreeNewForm','flag'],
  props: ['loneTreeNewForm','flag','Editclose'],
  data() {
    return {
      name:"",
      oid:"",
      masterName:"",
      masterOid:"",
      KeyName:"",
      KeyOid:"",
      simName:"",
      simOid:"",
      btmName:"",
      btmOid:"",
      masterInput:'',
      MasterSearchSelects:"",
      masterData:[],
      KeyData:[],
      simData:[],
      BtmData:[],
      btmOption:{
        addBtn:false,
        index:true,
        border:true,
        selection:true,
        menu:false,
        height:380,
        column:[
          {
            label:'业务类型编号',
            prop:'id'
          },
          {
            label:'业务类型名称',
            prop:'name'
          },
          {
            label:'描述',
            prop:'description'
          }
        ]
      },
      masterOption:{
        addBtn:false,
        index:true,
@@ -73,6 +103,7 @@
      MasterdialogVisible:false,
      KeydialogVisible:false,
      SimidialogVisible:false,
      BtmdialogVisible:false,
      form: {
        name: "哈哈",
        sex: "男"
@@ -172,6 +203,7 @@
            label: '存储的业务类型',
            prop: 'btmtypename',
            labelWidth:128,
            focus:this.btmFoucus,
            rules: [{
              required: true,
              message: "存储的业务类型",
@@ -200,20 +232,21 @@
        ]
      },
      FormList: {},
      masterSelectList:[]
      masterSelectList:[],
      KeySelectLIst:[],
      simSelectList:[],
      btmSelectList:[]
    }
  },
  created() {
  },
  methods: {
    submits(form,done){
      console.log(this.loneTreeNewForm)
      TreeEditSave(this.loneTreeNewForm).then(res=>{
        this.$message.success('修改成功');
      }).catch(res=>{
        this.$message.error(res)
        this.Editclose()
        done()
      })
      done()
    },
    error(err) {
      this.$message.success('请查看控制台');
@@ -233,17 +266,17 @@
      }else {
        this.MasterdialogVisible=false;
        this.masterSelectList=[]
        this.loneTreeNewForm.codeRuleOidName=this.name;
        this.loneTreeNewForm.codeRuleOid=this.oid;
        console.log(this.masterSelectList)
        this.$set(this.loneTreeNewForm,'coderuleoidName',this.masterName)
        this.$set(this.loneTreeNewForm,'coderuleOid',this.masterOid)
        this.$emit('MasterHandler',this.loneTreeNewForm)
        console.log(this.loneTreeNewForm)
      }
    },
    //编码多选
    masterSelect(row){
      console.log(row)
      this.masterSelectList=row;
      this.name=row[0].name;
      this.oid=row[0].oid;
      this.masterName=row[0].name;
      this.masterOid=row[0].oid;
      console.log('oid',this.oid)
    },
    //编码接口
@@ -253,10 +286,7 @@
        isMuti:'false',
        'conditionMap["lcstatus"]':'Released'
      }).then(res=>{
        console.log('---',res)
        this.masterData=res.data.records;
        console.log('masterData',this.masterData)
      })
    },
    // 关键属性失焦
@@ -266,31 +296,86 @@
    },
    //关键属性确定
    KeyHandlerClick(){
      if(this.masterSelectList.length>1){
      if(this.KeySelectLIst.length>1){
        this.$message.warning('只能选择一条数据')
      }else if(this.masterSelectList.length<=0){
      }else if(this.KeySelectLIst.length<=0){
        this.$message.warning('请选择一条数据')
      }else {
        this.KeydialogVisible=false;
        this.KeySelectLIst=[]
        this.$set(this.loneTreeNewForm,'codeResembleRuleOidName',this.simName)
        this.$set(this.loneTreeNewForm,'codeResembleRuleOid',this.simOid)
        this.$emit('MasterHandler',this.loneTreeNewForm)
      }
    },
    //关键属性接口
    KeydefaultRend(){
      defaultReferDataGrid({
        referType:'codekeyattrrepeat',
        isMuti:'false',
        'conditionMap["lcstatus"]':'Enabled'
      }).then(res=>{
        this.keyData=res.data.records;
        console.log('key',this.keyData)
        this.KeyData=res.data.records;
      })
    },
    // 关键多选
    KeySelect(row){
      this.KeySelectLIst=row;
      this.KeyName=row[0].name;
      this.KeyOid=row[0].oid;
    },
    // 相似项失焦
    simFouce(){
      this.SimidialogVisible=true;
      this.simdefaultRend()
    },
    //相似项确定
    simHandlerClick(){
      if(this.simSelectList.length>1){
        this.$message.warning('只能选择一条数据')
      }else if(this.simSelectList.length<=0){
        this.$message.warning('请选择一条数据')
      }else {
        this.SimidialogVisible=false;
        this.simSelectList=[]
        this.$set(this.loneTreeNewForm,'codeResembleRuleOidName',this.simName)
        this.$set(this.loneTreeNewForm,'codeResembleRuleOid',this.simOid)
        this.$emit('MasterHandler',this.loneTreeNewForm)
      }
    },
  //  相似项多选
    simSelect(row){
      this.simSelectList=row;
      this.simName=row[0].name;
      this.simOid=row[0].oid;
      console.log('oid',this.oid)
    },
    //相似项项接口
    simdefaultRend(){
      defaultReferDataGrid({
        referType:'coderesemblerule',
        isMuti:'false',
        'conditionMap["lcstatus"]':'Enabled'
      }).then(res=>{
        this.simData=res.data.records;
      })
    },
    //业务类型失焦
    btmFoucus(){
      this.BtmdialogVisible=true;
      this.btmdefaultRend()
    },
  //  业务类型多选
    btmSelect(row){
      this.btmSelectList=row;
      this.btmName=row[0].name;
      this.btmOid=row[0].oid;
    },
    //业务类型接口
    btmdefaultRend(){
      referDataGrid({valueField:'id',isMuti:'false'}).then(res=>{
        console.log(res)
      })
    }
  }
}
@@ -299,6 +384,3 @@
<style scoped>
</style>
<!--uiDataController/defaultReferDataGrid?referBo=coderule&isMuti=false&conditionMap%5B%22lcstatus%22%5D=Released-->
<!--uiDataController/defaultReferDataGrid?conditionMap%5B%22lcstatus%22%5D=Released&referBo=coderule&isMuti=false&_=1687831291212-->