zhaojiale
2022-08-04 aeef44031f90e5a7b0cb05da884b38f5047e7d21
src/views/contingencyManagement/contingency/component/openAdd.vue
@@ -12,17 +12,17 @@
               <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                  <el-form-item label="队伍级别" prop="teamLevel">
                     <el-select v-model="ruleForm.teamLevel" class="w100" placeholder="请选择">
                        <el-option label="公司" value="admin"></el-option>
                        <el-option label="分厂-车间" value="common"></el-option>
                        <el-option label="工序-班组等" value="shang"></el-option>
                        <el-option label="公司" value="公司"></el-option>
                        <el-option label="分厂-车间" value="分厂-车间"></el-option>
                        <el-option label="工序-班组等" value="工序-班组等"></el-option>
                     </el-select>
                  </el-form-item>
               </el-col>
               <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                  <el-form-item label="队伍负责人" prop="principalUid">
                     <el-input v-model="ruleForm.principalUid" placeholder="请选择" class="input-with-select" disabled>
                     <el-input v-model="ruleForm.principalUid" placeholder="请选择" class="input-with-select">
                        <template #append>
                           <el-button :icon="Search" @click="openUser" disabled/>
                           <el-button :icon="Search" @click="openUser"/>
                        </template>
                     </el-input>
                  </el-form-item>
@@ -158,16 +158,7 @@
            fileName: 'name',
          }
        ],
        // memberList: [
        //   {
        //     userUid: '',
        //     gender: '',
        //     jobNumber: '',
        //     name: '',
        //     phone: '',
        //     position: '',
        //   }
        // ]
        memberList: []
      });
    const titles = ref();
    const disabled = ref();
@@ -212,65 +203,14 @@
    onMounted(() => {
      department();
    });
    // const data = [
    //   {
    //     value: '1',
    //     label: '广汇能源综合物流发展有限责任公司',
    //     children: [
    //       {
    //         value: '11',
    //         label: '经营班子',
    //         children: [],
    //       },
    //     ],
    //   },
    //   {
    //     value: '2',
    //     label: '生产运行部',
    //     children: [
    //       {
    //         value: '21',
    //         label: '灌装一班',
    //         children: []
    //       },
    //       {
    //         value: '22',
    //         label: '工艺四班',
    //         children: [],
    //       },
    //     ],
    //   },
    //   {
    //     value: '3',
    //     label: '设备部',
    //     children: [
    //       {
    //         value: '31',
    //         label: '仪表班',
    //         children: [],
    //       },
    //       {
    //         value: '32',
    //         label: '机修班',
    //         children: [],
    //       },
    //     ],
    //   },
    // ]
    // 打开用户选择弹窗
    const userRef = ref();
    const openUser = () => {
      userRef.value.openDailog();
    };
    const nameC = ref();
    const onUser = (e:any) => {
      ruleForm.value.principalUid = e.uid
      nameC.value=e.realName
      ruleForm.value.principalUid = e.username
    };
    // const onUser = (e:any) => {
    //
    //   ruleForm.value.principalUid=e.id
    // };
    //定义tabs切换
    const activeName = ref('first')
    const handleClick = (tab: TabsPaneContext, event: Event) => {
@@ -405,16 +345,7 @@
              fileName: 'name',
            }
          ],
          // memberList: [
          //   {
          //     userUid: '',
          //     gender: '',
          //     jobNumber: '',
          //     name: '',
          //     phone: '',
          //     position: '',
          //   }
          // ]
          memberList: []
        };
      }
    };
@@ -423,45 +354,6 @@
      if (!formEl) return;
      formEl.resetFields();
    };
    // 列表参数
    // const listQuery = ref ({
    //   teamId: ''
    // });
    // 列表数据请求
    // const listApi = async (title: string, formEl: FormInstance | undefined) => {
    //   if (!formEl) return;
    //   await formEl.validate((valid, fields) => {
    //     if (valid) {
    //       isShowDialog.value = false;
    //       contingencyApi()
    //           .getEmergencyTeamPersonnelList(listQuery)
    //           .then((res) => {
    //             if (res.data.code == 200) {
    //               ElMessage({
    //                 showClose: true,
    //                 message: res.data.msg,
    //                 type: 'success',
    //               });
    //               emit('myAdd', true);
    //             } else {
    //               ElMessage({
    //                 showClose: true,
    //                 message: res.data.msg,
    //                 type: 'error',
    //               });
    //               emit('myAdd', true);
    //             }
    //             formEl.resetFields();
    //           });
    //     } else {
    //       console.log('error submit!', fields);
    //     }
    //   });
    //   formEl.resetFields();
    //   const listQuery = {
    //     teamId: ''
    //   };
    // };
    // 定义表格数据
    const tableData = ref([]);
    //添加队伍负责人弹窗
@@ -539,7 +431,6 @@
      FullScreen,
      full,
      onUser,
      nameC,
      onMyAdd,
      // listApi,
      onEdit,