田源
2024-01-11 2165c93769a8b92813fdeaa0ec4f0fa46ac31a93
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTreeform.vue
@@ -6,121 +6,52 @@
    </avue-form>
    <div>
<!--     编码规则-->
      <el-dialog  :visible.sync="MasterdialogVisible"   title="为【编码规则】选取值" append-to-body :before-close="masterEscHandler">
        <template>
          <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px">
            <el-option
              v-for="item in SelectOption"
              :key="item.value"
              :label="item.label"
              :value="item.value"
              style="width: 150px">
            </el-option>
          </el-select>
          <el-input style="width: 260px;margin-left: 15px" placeholder="输入值后进行模糊查询" v-model="SelectFInd"></el-input>
          <el-button size="small"  type="primary" plain @click="SelectFindeHandler" style="margin-left: 20px">查询</el-button>
        </template>
        <avue-crud :data="masterData" :option="attrOption" @row-click="masterSelect">
          <template slot="radio" slot-scope="{row}">
            <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
            </el-radio>
          </template>
        </avue-crud>
        <div style="height: 30px">
          <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >已设置的值为:[{{this.loneTreeNewForm.codeRuleOidName}}]</div>
          <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
            <el-button type="primary" size="small" @click="MasterHandlerClick">确定</el-button>
            <el-button  size="small" @click="masterEscHandler">取消</el-button>
          </div>
        </div>
      </el-dialog>
      <ThemeChildren
        ref="ThemeMasterChildren"
        dialogTitle="编码规则"
        codeName="codeRuleOidName"
        codeType="coderule"
        code-lcstatus="Released"
        :visible.sync="MasterdialogVisible"
        :SelectOption="SelectOption"
        :TreeAddform="loneTreeNewForm"
        @defineHandler="handlerDefine"
      ></ThemeChildren>
<!--      关键属性查询规则-->
      <el-dialog  :visible.sync="KeydialogVisible"   title="为【关键属性查询规则】选取值" append-to-body :before-close="KeyEscHandler">
        <template>
          <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px">
            <el-option
              v-for="item in SelectOption"
              :key="item.value"
              :label="item.label"
              :value="item.value"
              style="width: 150px">
            </el-option>
          </el-select>
          <el-input style="width: 260px;margin-left: 15px" placeholder="输入值后进行模糊查询" v-model="SelectFInd"></el-input>
          <el-button size="small"  type="primary" plain @click="KeySelectFindeHandler" style="margin-left: 20px">查询</el-button>
        </template>
        <avue-crud :data="KeyData" :option="attrOption" @row-click="KeySelect">
          <template slot="radio" slot-scope="{row}">
            <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
            </el-radio>
          </template>
        </avue-crud>
        <div style="height: 30px">
          <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >已设置的值为:[{{this.loneTreeNewForm.codeKeyAttrRepeatOidName}}]</div>
          <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
            <el-button type="primary" size="small" @click="KeyHandlerClick">确定</el-button>
            <el-button  size="small" @click="KeyEscHandler">取消</el-button>
          </div>
        </div>
      </el-dialog>
      <!--      相似项查询规则-->
      <el-dialog  :visible.sync="SimidialogVisible"   title="为【相似项查询规则】选取值" append-to-body :before-close="simEscHandler">
        <template>
          <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px">
            <el-option
              v-for="item in SelectOption"
              :key="item.value"
              :label="item.label"
              :value="item.value"
              style="width: 150px">
            </el-option>
          </el-select>
          <el-input style="width: 260px;margin-left: 15px" placeholder="输入值后进行模糊查询" v-model="SelectFInd"></el-input>
          <el-button size="small"  type="primary" plain @click="SimSelectFindeHandler" style="margin-left: 20px">查询</el-button>
        </template>
        <avue-crud :data="simData" :option="attrOption"@row-click="simSelect">
          <template slot="radio" slot-scope="{row}">
            <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
            </el-radio>
          </template>
        </avue-crud>
        <div style="height: 30px">
          <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >已设置的值为:[{{this.loneTreeNewForm.codeResembleRuleOidName}}]</div>
          <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
            <el-button type="primary" size="small" @click="simHandlerClick">确定</el-button>
            <el-button  size="small" @click="simEscHandler">取消</el-button>
          </div>
        </div>
      </el-dialog>
      <ThemeChildren
        ref="ThemeKeyChildren"
        :SelectOption="SelectOption"
        :TreeAddform="loneTreeNewForm"
        :visible.sync="KeydialogVisible"
        code-lcstatus="Enabled"
        codeName="codeKeyAttrRepeatOidName"
        codeType="codekeyattrrepeat"
        dialogTitle="关键属性查询规则"
        @defineHandler="handlerDefine"
      ></ThemeChildren>
      <!--      相似项查询规则 codeResembleRuleOidName SimidialogVisible-->
      <ThemeChildren
        ref="ThemeSimChildren"
        :SelectOption="SelectOption"
        :TreeAddform="loneTreeNewForm"
        :visible.sync="SimidialogVisible"
        code-lcstatus="Enabled"
        codeName="codeResembleRuleOidName"
        codeType="coderesemblerule"
        dialogTitle="相似项查询规则"
        @defineHandler="handlerDefine"
      ></ThemeChildren>
<!--      存储的业务类型-->
      <el-dialog  :visible.sync="BtmdialogVisible"   title="为【业务类型】选取值" append-to-body :before-close="BtmEscHandler">
        <template>
          <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px !important;">
            <el-option
              v-for="item in masterSelectOption"
              :key="item.value"
              :label="item.label"
              :value="item.value"
              style="width: 130px">
            </el-option>
          </el-select>
          <el-input style="width: 260px;margin-left: 15px" placeholder="输入值后进行模糊查询" v-model="SelectFInd"></el-input>
          <el-button size="small"  type="primary" plain @click="BtmSelectFindeHandler" style="margin-left: 20px">查询</el-button>
        </template>
        <avue-crud :data="BtmData" :option="masterOption" @row-click="btmSelect">
          <template slot="radio" slot-scope="{row}">
            <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
            </el-radio>
          </template>
        </avue-crud>
        <div style="height: 30px">
          <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >已设置的值为:[{{this.loneTreeNewForm.btmTypeName}}]</div>
          <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
            <el-button type="primary" size="small" @click="btmHandlerClick">确定</el-button>
            <el-button  size="small" @click="BtmEscHandler">取消</el-button>
          </div>
        </div>
      </el-dialog>
      <ThemeChildren
        ref="ThemeBtmChildren"
        :SelectOption="btmSelectOption"
        :TreeAddform="loneTreeNewForm"
        :visible.sync="BtmdialogVisible"
        codeName="btmTypeName"
        codeType="btmCode"
        dialogTitle="业务类型"
        @defineHandler="handlerDefine"
      ></ThemeChildren>
    </div>
  </div>
</template>
@@ -128,28 +59,16 @@
<script>
import {defaultReferDataGrid,referDataGrid} from '@/api/MasterData/master'
import {TreeEditSave} from '@/api/template/templateAttr'
import ThemeChildren from '@/components/FormTemplate/ThemeChildren'
export default {
  components: {ThemeChildren},
  name: "classifyTreeform.vue",
  props: ['loneTreeNewForm','flag','Editclose','TreeFlag','nodeClickList'],
  data() {
    return {
      masterRow:null,
      SelectFInd:"",
      masterName:"",
      masterOid:"",
      KeyName:"",
      KeyOid:"",
      simName:"",
      simOid:"",
      btmName:"",
      btmOid:"",
      btmId:"",
      masterInput:'',
      MasterSearchSelects:"",
      masterData:[],
      KeyData:[],
      simData:[],
      BtmData:[],
      SelectOption:[
        {
          value: 'name',
@@ -160,7 +79,7 @@
          label: '英文名称'
        }
      ],
      masterSelectOption:[
      btmSelectOption:[
        {
          value: 'id',
          label: '业务类型编号'
@@ -170,89 +89,6 @@
          label: '业务类型名称'
        },
      ],
      SelectValue:'id',
      btmOption:{
        columnBtn: false,
        refreshBtn:false,
        addBtn:false,
        index:true,
        border:true,
        selection:true,
        menu:false,
        height:380,
        column:[
          {
            label:'业务类型编号',
            prop:'id'
          },
          {
            label:'业务类型名称',
            prop:'name'
          },
          {
            label:'描述',
            prop:'description'
          }
        ]
      },
      attrOption:{
        addBtn:false,
        columnBtn: false,
        refreshBtn:false,
        index:true,
        border:true,
        menu:false,
        height:380,
        column:[
          {
            label: '',
            prop: 'radio',
            width: 60,
            display: false
          },
          {
            label:'英文编号',
            prop:'id'
          },
          {
            label:'中文名称',
            prop:'name'
          },
          {
            label:'描述',
            prop:'description'
          }
        ]
      },
      masterOption:{
        columnBtn: false,
        refreshBtn:false,
        addBtn:false,
        index:true,
        border:true,
        menu:false,
        height:380,
        column:[
          {
            label: '',
            prop: 'radio',
            width: 60,
            display: false
          },
          {
            label:'业务类型编号',
            prop:'id'
          },
          {
            label:'业务类型名称',
            prop:'name'
          },
          {
            label:'描述',
            prop:'description'
          }
        ]
      },
      MasterdialogVisible:false,
      KeydialogVisible:false,
      SimidialogVisible:false,
@@ -396,7 +232,7 @@
              label:"编码规则",
              prop:"codeRuleOidName",
              labelWidth:128,
              focus:this.CodeFoucus,
              focus:this.CodeFocus,
              readonly: true,
            },
            {
@@ -444,6 +280,34 @@
  created() {
  },
  methods: {
    //树编辑参照子组件事件
    handlerDefine(val) {
      const codeTypeMap = {
        coderule: {
          nameKey: 'codeRuleOidName',
          oidKey: 'codeRuleOid'
        },
        codekeyattrrepeat: {
          nameKey: 'codeKeyAttrRepeatOidName',
          oidKey: 'codeKeyAttrRepeatOid'
        },
        coderesemblerule: {
          nameKey: 'codeResembleRuleOidName',
          oidKey: 'codeResembleRuleOid'
        },
        btmCode: {
          nameKey: 'btmTypeName',
          oidKey: 'btmTypeId'
        }
      };
      const codeType = codeTypeMap[val.codeType];
      if (codeType) {
        this.$set(this.loneTreeNewForm, codeType.nameKey, val.crudName);
        this.$set(this.loneTreeNewForm, codeType.oidKey, val.crudOid);
        this.$emit('MasterHandler', this.loneTreeNewForm);
      }
    },
    submits(form,done){
      if(this.TreeFlag){
        TreeEditSave(this.loneTreeNewForm).then(res=>{
@@ -468,204 +332,27 @@
    error(err) {
      this.$message.success(err);
    },
    //编码规则关闭
    masterEscHandler(){
      this.SelectFInd='';
      this.SelectValue='id';
      this.masterRow=null;
      this.MasterdialogVisible=false;
    },
    //关键属性关闭
    KeyEscHandler(){
      this.SelectFInd='';
      this.SelectValue='id';
      this.masterRow=null;
      this.KeydialogVisible=false;
    },
    //相似项关闭
    simEscHandler(){
      this.SelectFInd='';
      this.SelectValue='id';
      this.masterRow=null;
      this.SimidialogVisible=false;
    },
    //存储业务类型关闭
    BtmEscHandler(){
      this.SelectFInd='';
      this.SelectValue='id';
      this.masterRow=null;
      this.BtmdialogVisible=false;
    },
    //编码规则查询
    SelectFindeHandler(){
      const masterParameter = {};
      masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
      this.MasterdefaultRend(masterParameter)
    },
    //编码规则失焦
    CodeFoucus(){
    CodeFocus(){
      this.MasterdialogVisible=true;
      this.MasterdefaultRend()
    },
    //编码规则确定
    MasterHandlerClick(){
      if(this.masterSelectList.length>1){
        this.$message.warning('只能选择一条数据')
      }else if(this.masterSelectList.length<=0){
        this.$message.warning('请选择一条数据')
      }else {
        this.MasterdialogVisible=false;
        this.masterSelectList=[]
        this.$set(this.loneTreeNewForm,'codeRuleOidName',this.masterName)
        this.$set(this.loneTreeNewForm,'codeRuleOid',this.masterOid)
        this.$emit('MasterHandler',this.loneTreeNewForm)
      }
    },
    //编码多选
    masterSelect(row){
      this.masterRow = row.$index;
      this.masterSelectList = row;
      this.masterName = row.name;
      this.masterOid = row.oid;
    },
    //编码接口
    MasterdefaultRend(masterParameter){
      defaultReferDataGrid({
        referType:'coderule',
        isMuti:'false',
        'conditionMap["lcstatus"]':'Released',
        'limit':'-1',
        ...masterParameter
      }).then(res=>{
        this.masterData=res.data.records;
      })
      this.$refs.ThemeMasterChildren.defaultSearchRend()
    },
    //关键属性失焦
    Keyfouce(){
      this.KeydialogVisible=true;
      this.KeydefaultRend()
    },
    //关键属性确定
    KeyHandlerClick(){
      if(this.KeySelectLIst.length>1){
        this.$message.warning('只能选择一条数据')
      }else if(this.KeySelectLIst.length<=0){
        this.$message.warning('请选择一条数据')
      }else {
        this.KeydialogVisible=false;
        this.KeySelectLIst=[]
        this.$set(this.loneTreeNewForm,'codeKeyAttrRepeatOidName',this.KeyName)
        this.$set(this.loneTreeNewForm,'codeKeyAttrRepeatOid',this.KeyOid)
        this.$emit('MasterHandler',this.loneTreeNewForm)
      }
    },
    //关键属性查询
    KeySelectFindeHandler(){
      const masterParameter = {};
      masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
      this.KeydefaultRend(masterParameter)
    },
    //关键属性接口
    KeydefaultRend(masterParameter){
      defaultReferDataGrid({
        referType:'codekeyattrrepeat',
        isMuti:'false',
        'conditionMap["lcstatus"]':'Enabled',
        'limit':'-1',
        ...masterParameter
      }).then(res=>{
        this.KeyData=res.data.records;
      })
    },
    //关键多选
    KeySelect(row){
      this.masterRow = row.$index;
      this.KeySelectLIst = row;
      this.KeyName = row.name;
      this.KeyOid = row.oid;
      this.$refs.ThemeKeyChildren.defaultSearchRend();
    },
    //相似项失焦
    simFouce(){
      this.SimidialogVisible=true;
      this.simdefaultRend()
      this.$refs.ThemeSimChildren.defaultSearchRend();
    },
    //相似项确定
    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)
      }
    },
    //相似项查询
    SimSelectFindeHandler(){
      const masterParameter = {};
      masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
      this.simdefaultRend(masterParameter)
    },
    //相似项多选
    simSelect(row){
      this.masterRow = row.$index;
      this.simSelectList = row;
      this.simName = row.name;
      this.simOid = row.oid;
    },
    //相似项项接口
    simdefaultRend(masterParameter){
      defaultReferDataGrid({
        referType:'coderesemblerule',
        isMuti:'false',
        'conditionMap["lcstatus"]':'Enabled',
        'limit':'-1',
        ...masterParameter
      }).then(res=>{
        this.simData=res.data.records;
      })
    },
    //业务类型失焦
    btmFoucus(){
      this.BtmdialogVisible=true;
      this.btmdefaultRend()
      this.BtmdialogVisible = true;
      this.$refs.ThemeBtmChildren.btmDefaultRend();
    },
    //业务类型确定
    btmHandlerClick(){
      if(this.btmSelectList.length>1){
        this.$message.warning('只能选择一条数据')
      }else if(this.btmSelectList.length<=0){
        this.$message.warning('请选择一条数据')
      }else {
        this.BtmdialogVisible=false;
        this.btmSelectList=[]
        this.$set(this.loneTreeNewForm,'btmTypeName',this.btmName ||this.btmId)
        this.$set(this.loneTreeNewForm,'btmTypeId',this.btmId)
        this.$emit('MasterHandler',this.loneTreeNewForm)
      }
    },
    //业务类型查询
    BtmSelectFindeHandler(){
      const masterParameter = {};
      masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
      this.btmdefaultRend(masterParameter);
    },
    //业务类型多选
    btmSelect(row){
      this.btmSelectList=row;
      this.btmName=row.name;
      this.btmOid=row.oid;
      this.btmId=row.id;
    },
    //业务类型接口
    btmdefaultRend(masterParameter){
      referDataGrid({valueField:'id',isMuti:'false','limit':'-1',...masterParameter}).then(res=>{
        this.BtmData=res.data.data.records
      })
    }
  }
}
</script>