zhouwx
2025-05-19 457f9c817adef8b003ee6379f493798bae5cbb69
src/views/Admin/components/sameLevelMod.vue
@@ -52,7 +52,7 @@
      </a-form-model-item>
      <a-form-model-item label="选择分组" prop="peerRecipientGroupId">
        <a-select v-model="form.peerRecipientGroupId"  style="width: 100%">
          <a-select-option v-for="item in groupData" :value="item.id" :key="item.id">{{item.name}}</a-select-option>
          <a-select-option v-for="(item,index) in groupData" :value="item.id" :key="index">{{item.name}}</a-select-option>
        </a-select>
      </a-form-model-item>
    </a-form-model>
@@ -85,12 +85,7 @@
      labelCol: { span: 4 },
      wrapperCol: { span: 14 },
      areaData: [],
      groupData: [
        {
          id: '',
          name: '未分类'
        }
      ],
      groupData: [],
      replaceFields: {
        children:'children',
        title:'name',
@@ -105,7 +100,7 @@
        phone: '',
        unittype: null,
        districtId: null,
        peerRecipientGroupId: null
        peerRecipientGroupId: ''
      },
      rules: {
        recipientName: [{ required: true, message: '请输入姓名或称呼', trigger: 'blur'}],
@@ -116,11 +111,17 @@
  },
  created() {
    const t = this
    t.getGroupList();
  },
  methods:{
    openDialog(type,data){
    openDialog(type,data,group){
      const t = this
      group.forEach(item => {
        if(item.name === '未分类'){
          item.id = ''
        }
      })
      t.groupData = group
      console.log(t.groupData,'data222')
      if(type == 'add'){
        t.title = '新增用户'
        t.form = {
@@ -130,7 +131,7 @@
          phone: '',
          unittype: null,
          districtId: null,
          peerRecipientGroupId: null
          peerRecipientGroupId: ''
        }
      }else{
        t.title = '编辑用户'
@@ -147,15 +148,7 @@
    isValidKey(key, object){
      return key in object;
    },
    async  getGroupList () {
      const t = this
      const res = await getSameLevelGroupList();
      if(res.data.code == 100){
        t.groupData = t.groupData.concat(res.data.data)
      }else{
        this.$message.error(res.data.msg)
      }
    },
    clearMod(){
      this.$refs.ruleForm.clearValidate()
      this.$refs.ruleForm.resetFields()