zhouwx
9 天以前 f94b96403234f5927e74f72fc0cbc65d7b426019
src/views/work/selfProblems/plan/components/planDialog.vue
@@ -3,7 +3,7 @@
    <el-dialog
        v-model="dialogVisible"
        :title="title"
        width="50%"
        width="950px"
        :before-close="handleClose"
        :close-on-press-escape="false"
        :close-on-click-modal="false"
@@ -175,10 +175,10 @@
                      <el-form-item :prop="'deptList.' + '[' + $index + ']' + '.checkId'" :rules="state.rules.checkId">
                        <el-select clearable v-model="row.checkId" :disabled="title =='查看'" filterable  style="width: 240px">
                          <el-option
                              v-for="item in state.peopleList"
                              :key="item.id"
                              :label="item.name"
                              :value="item.id"
                              v-for="item in state.interUserList"
                              :key="item.personId"
                              :label="item.personName"
                              :value="item.personId"
                          />
                        </el-select>
                      </el-form-item>
@@ -272,6 +272,7 @@
import {getUser} from "@/api/onlineEducation/user";
import {getDept} from "@/api/qualityObjectives/object";
import {addPlan, editPlan} from "@/api/selfProblems/plan";
import {getPersonPage} from "@/api/selfProblems/nameList";
const dialogVisible = ref(false);
const title = ref("");
@@ -316,6 +317,7 @@
    ratifyId: null, //批准人id
    deptList: []
  },
  interUserList: [],
  formRules:{
    companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }],
    year:  [{ required: true, message: '请输入年份', trigger: 'blur' }],
@@ -397,6 +399,7 @@
      })
    })
  }
  await getUserList()
  await  getPeopleList()
  dialogVisible.value = true;
@@ -420,7 +423,7 @@
const onSubmit = async () => {
  state.form.reviewStart = checkTime.value[0]
  state.form.reviewEnd = checkTime.value[0]
  state.form.reviewEnd = checkTime.value[1]
  state.form.firstStarttime = checkStartTime.value[0]
  state.form.firstEndtime = checkStartTime.value[1]
  state.form.lastStarttime = checkEndTime.value[0]
@@ -542,6 +545,7 @@
  state.form.checkId = null
  state.form.ratifyId = null
  getPeopleList()
  getUserList()
  getDeptList()
}
const reset = () => {
@@ -572,6 +576,25 @@
  checkStartTime.value = []
  checkEndTime.value = []
}
const getUserList = async ()=> {
  if(state.isAdmin && (state.form.companyId == 0 || state.form.companyId == null)){
    return
  }
  const res = await getPersonPage({companyId: state.form.companyId,pageNum: 1,pageSize: 999})
  if(res.code == 200){
    state.userList = res.data.list?res.data.list.map(item=>{
      const user = item.id
      const {id, ...data} = item
      return {
        ...data,
        userId: user
      }
    }):[]
    state.interUserList = state.userList
  }else{
    ElMessage.warning(res.message)
  }
}
defineExpose({
  openDialog
});