zhouwx
4 天以前 812f2afdb6f9ca500a10806ad25641288dcd9cfd
src/views/work/qualityManage/qualityInformationPage/internal/components/editDialog.vue
@@ -3,7 +3,7 @@
    <el-dialog
        v-model="dialogVisible"
        :title="title"
        width="850px"
        width="1100px"
        :before-close="handleClose"
        :close-on-press-escape="false"
        :close-on-click-modal="false"
@@ -11,7 +11,7 @@
      <el-form :model="state.form" size="default" ref="busRef" :rules="state.formRules"   label-width="150" label-position="right">
        <el-row :gutter="24">
          <el-col :span="24">
            <el-form-item label="企业名称:" prop="companyId" v-if="state.isAdmin">
            <el-form-item label="单位名称:" prop="companyId" v-if="state.isAdmin">
              <el-select v-model="state.form.companyId" placeholder="请选择" filterable clearable style="width: 100%" :disabled="title == '查看' || title == '编辑' || !state.isAdmin"  @change="selectValueCom" >
                <el-option
                    v-for="item in state.companyList"
@@ -24,12 +24,12 @@
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="12">
          <el-col :span="8">
            <el-form-item label="反馈单名称:" prop="feedForm" >
              <el-input  :disabled="title === '查看'" v-model="state.form.feedForm" placeholder="反馈单名称"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
          <el-col :span="8">
            <el-form-item label="编号:" prop="number" >
              <el-input  :disabled="title === '查看'" v-model="state.form.number" placeholder="编号"></el-input>
            </el-form-item>
@@ -53,24 +53,25 @@
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="12">
          <el-col :span="8">
            <el-form-item label="责任单位:" prop="dutyUnitId" >
              <el-select
                  :disabled="title === '查看'"
                  v-model="state.form.dutyUnitId"
                  placeholder="请选择部门"
                  style="width: 240px;margin-bottom: 5px"
              >
                <el-option
                    v-for="item in state.deptList"
                    :key="item.deptId"
                    :label="item.deptName"
                    :value="item.deptId"
                />
              </el-select>
              <el-input  :disabled="title === '查看'" v-model="state.form.dutyUnitId" placeholder="责任单位"></el-input>
<!--              <el-select-->
<!--                  :disabled="title === '查看'"-->
<!--                  v-model="state.form.dutyUnitId"-->
<!--                  placeholder="请选择部门"-->
<!--                  style="width: 240px;margin-bottom: 5px"-->
<!--              >-->
<!--                <el-option-->
<!--                    v-for="item in state.deptList"-->
<!--                    :key="item.deptId"-->
<!--                    :label="item.deptName"-->
<!--                    :value="item.deptId"-->
<!--                />-->
<!--              </el-select>-->
            </el-form-item>
          </el-col>
          <el-col :span="12">
          <el-col :span="8">
            <el-form-item label="产品件号:" prop="partNum" >
              <el-input  :disabled="title === '查看'" v-model="state.form.partNum" placeholder="产品件号"></el-input>
            </el-form-item>
@@ -79,31 +80,33 @@
        <el-row :gutter="24">
          <el-col :span="8">
            <el-form-item label="反馈单位:" prop="feedUnitId" >
              <el-select
                  :disabled="title === '查看'"
                  v-model="state.form.feedUnitId"
                  placeholder="请选择部门"
                  style="width: 240px;margin-bottom: 5px"
              >
                <el-option
                    v-for="item in state.deptList"
                    :key="item.deptId"
                    :label="item.deptName"
                    :value="item.deptId"
                />
              </el-select>
              <el-input  :disabled="title === '查看'" v-model="state.form.feedUnitId" placeholder="责任单位"></el-input>
<!--              <el-select-->
<!--                  :disabled="title === '查看'"-->
<!--                  v-model="state.form.feedUnitId"-->
<!--                  placeholder="请选择部门"-->
<!--                  style="width: 240px;margin-bottom: 5px"-->
<!--              >-->
<!--                <el-option-->
<!--                    v-for="item in state.deptList"-->
<!--                    :key="item.deptId"-->
<!--                    :label="item.deptName"-->
<!--                    :value="item.deptId"-->
<!--                />-->
<!--              </el-select>-->
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="反馈人:" prop="feedUserId" >
              <el-select clearable v-model="state.form.feedUserId" :disabled="title =='查看'" filterable  style="width: 240px;margin-bottom: 5px">
                <el-option
                    v-for="item in state.peopleList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id"
                />
              </el-select>
              <el-input  :disabled="title === '查看'" v-model="state.form.feedUserId" placeholder="反馈人"></el-input>
<!--              <el-select clearable v-model="state.form.feedUserId" :disabled="title =='查看'" filterable  style="width: 240px;margin-bottom: 5px">-->
<!--                <el-option-->
<!--                    v-for="item in state.peopleList"-->
<!--                    :key="item.id"-->
<!--                    :label="item.name"-->
<!--                    :value="item.id"-->
<!--                />-->
<!--              </el-select>-->
            </el-form-item>
          </el-col>
          <el-col :span="8">
@@ -135,7 +138,7 @@
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="处置人:" prop="disposeId" >
              <el-select clearable v-model="state.form.disposeId" :disabled="title =='查看'" filterable  style="width: 240px;margin-bottom: 5px">
              <el-select clearable v-model="state.form.disposeId" :disabled="title =='查看'" filterable  style="width: 100%;margin-bottom: 5px">
                <el-option
                    v-for="item in state.peopleList"
                    :key="item.id"
@@ -148,6 +151,7 @@
          <el-col :span="12">
            <el-form-item label="日期:" prop="disposeTime" >
              <el-date-picker
                  style="width: 100%"
                  :disabled="title === '查看'"
                  v-model="state.form.disposeTime"
                  type="date"
@@ -160,7 +164,7 @@
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="检验员:" prop="checkOutId" >
              <el-select clearable v-model="state.form.checkOutId" :disabled="title =='查看'" filterable  style="width: 240px;margin-bottom: 5px">
              <el-select clearable v-model="state.form.checkOutId" :disabled="title =='查看'" filterable  style="width: 100%;margin-bottom: 5px">
                <el-option
                    v-for="item in state.peopleList"
                    :key="item.id"
@@ -173,6 +177,7 @@
          <el-col :span="12">
            <el-form-item label="日期:" prop="checkOutTime" >
              <el-date-picker
                  style="width: 100%"
                  :disabled="title === '查看'"
                  v-model="state.form.checkOutTime"
                  type="date"
@@ -185,7 +190,7 @@
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="反馈单位复查人:" prop="reviewId" >
              <el-select clearable v-model="state.form.reviewId" :disabled="title =='查看'" filterable  style="width: 240px;margin-bottom: 5px">
              <el-select clearable v-model="state.form.reviewId" :disabled="title =='查看'" filterable  style="width: 100%;margin-bottom: 5px">
                <el-option
                    v-for="item in state.peopleList"
                    :key="item.id"
@@ -198,6 +203,7 @@
          <el-col :span="12">
            <el-form-item label="日期:" prop="reviewTime" >
              <el-date-picker
                  style="width: 100%"
                  :disabled="title === '查看'"
                  v-model="state.form.reviewTime"
                  type="date"
@@ -234,7 +240,7 @@
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="检验组长:" prop="teamId" >
              <el-select clearable v-model="state.form.teamId" :disabled="title =='查看'" filterable  style="width: 240px;margin-bottom: 5px">
              <el-select clearable v-model="state.form.teamId" :disabled="title =='查看'" filterable  style="width: 100%;margin-bottom: 5px">
                <el-option
                    v-for="item in state.peopleList"
                    :key="item.id"
@@ -247,6 +253,7 @@
          <el-col :span="12">
            <el-form-item label="日期:" prop="teamTime" >
              <el-date-picker
                  style="width: 100%"
                  :disabled="title === '查看'"
                  v-model="state.form.teamTime"
                  type="date"
@@ -259,7 +266,7 @@
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="责任单位领导:" prop="dutyLeaderId" >
              <el-select clearable v-model="state.form.dutyLeaderId" :disabled="title =='查看'" filterable  style="width: 240px;margin-bottom: 5px">
              <el-select clearable v-model="state.form.dutyLeaderId" :disabled="title =='查看'" filterable  style="width: 100%;margin-bottom: 5px">
                <el-option
                    v-for="item in state.peopleList"
                    :key="item.id"
@@ -272,6 +279,7 @@
          <el-col :span="12">
            <el-form-item label="日期:" prop="dutyLeaderTime" >
              <el-date-picker
                  style="width: 100%"
                  :disabled="title === '查看'"
                  v-model="state.form.dutyLeaderTime"
                  type="date"
@@ -346,7 +354,7 @@
    dutyUnitId: [{ required: true, message: '请输入责任单位', trigger: 'blur' }],
    partNum: [{ required: true, message: '请输入产品件号', trigger: 'blur' }],
    feedUnitId: [{ required: true, message: '请输入反馈单位', trigger: 'blur' }],
    feedUserId: [{ required: true, message: '请选择反馈人', trigger: 'blur' }],
    feedUserId: [{ required: true, message: '请输入反馈人', trigger: 'blur' }],
    feedTime: [{ required: true, message: '请选择反馈日期', trigger: 'blur' }],
    feedQuestion: [{ required: true, message: '请输入反馈问题描述', trigger: 'blur' }],
    // disposeId: [{ required: true, message: '请选择处置人', trigger: 'blur' }],
@@ -384,6 +392,13 @@
  title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ;
  if(type === 'edit' || type === 'review') {
    state.form = JSON.parse(JSON.stringify(value));
    state.form.disposeId =  state.form.disposeId ?state.form.disposeId:null
    state.form.checkOutId =  state.form.checkOutId ?state.form.checkOutId:null
    state.form.reviewId =  state.form.reviewId ?state.form.reviewId:null
    state.form.teamId =  state.form.teamId ?state.form.teamId:null
    state.form.rework =  state.form.teamId ?state.form.rework:null
    state.form.delay =  state.form.delay ?state.form.delay:null
    if(state.isAdmin){
      state.form.companyId = value.companyId
      state.form.companyName = value.companyName