zhouwx
2026-06-17 facea208b2fc7c8c7a0d176df06305b866c6520f
src/views/hazardousChemicals/subscribeApplyManage/record/components/editDialog.vue
@@ -11,34 +11,23 @@
      <el-form :model="state.form" size="default" ref="busRef" :rules="state.formRules" label-width="150px" >
        <el-form-item required label= "危化品列表" >
          <div style="display: flex;width: 100%;margin-top: 5px">
            <el-table :data="state.form.hazardousTargets" :border="true">
            <el-table :data="state.form.subscribeHazmats" :border="true">
              <el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
              <el-table-column label="危化品名称" align="center"  >
                <template #default="{row,$index}">
                  <el-form-item :prop="'hazardousTargets.' + '[' + $index + ']' + '.name'" >
                    <span>{{row.name}}</span>
                  <el-form-item :prop="'subscribeHazmats.' + '[' + $index + ']' + '.hazmatName'" >
                    <span>{{row.hazmatName}}</span>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="数量" align="center"  >
                <template #default="{row,$index}">
                  <el-form-item :prop="'hazardousTargets.' + '[' + $index + ']' + '.num'">
                    <span>{{row.num}}</span>
                  <el-form-item :prop="'subscribeHazmats.' + '[' + $index + ']' + '.hazmatCount'">
                    <span>{{row.hazmatCount}}</span>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="title !== '查看'" >
                <template #default="scope" >
                  <el-button link type="danger"  @click="handleDelete(scope.row)" >删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-button
                v-if="title !== '查看'"
                style="margin-left: 20px"
                type="primary"
                @click="addObject"
            >新增</el-button>
          </div>
        </el-form-item>
        <el-form-item label="申购文件:">
@@ -47,24 +36,18 @@
          </div>
        </el-form-item>
        <el-form-item label="申购人:" >
          <span>{{state.form.people }}</span>
          <span>{{state.form.subscribePersonName }}</span>
        </el-form-item>
        <el-form-item label="审批人:" >
          <span>{{state.form.people }}</span>
          <span>{{state.form.checkName }}</span>
        </el-form-item>
        <el-form-item label="审批状态:" v-if="title === '查看' ">
          <span>{{state.form.state == 1 ? '审批通过' : state.form.state == 2 ?'审批驳回': '未审批' }}</span>
          <span>{{state.form.status == 1 ? '审批通过' : state.form.status == 2 ?'审批驳回': '未审批' }}</span>
        </el-form-item>
        <el-form-item label="审批意见:" v-if="title === '查看' && state.form.state == 2" style="width: 70%">
          <el-input v-model="state.form.regest" type="textarea" :rows="5"></el-input>
        <el-form-item label="审批意见:" v-if="title === '查看' && state.form.status == 2" style="width: 70%">
          <el-input v-model="state.form.opinion" type="textarea" :rows="5"></el-input>
        </el-form-item>
      </el-form>
      <template #footer v-if="title !=='查看'">
        <span class="dialog-footer">
            <el-button @click="handleClose" size="default">取 消</el-button>
            <el-button type="primary"  @click="onSubmit" size="default" v-preReClick>确认</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>
@@ -90,7 +73,7 @@
    major: '',
    phone: '',
    code: '',
    hazardousTargets:[],
    subscribeHazmats:[],
  },
})
@@ -100,8 +83,6 @@
  state.form = JSON.parse(JSON.stringify(value));
  dialogVisible.value = true;
}
const handleClose = () => {
  busRef.value.clearValidate();
@@ -119,23 +100,7 @@
    code: ''
  }
}
const addObject = () => {
  state.form.hazardousTargets.push({name:'',num:null})
}
const handleDelete = (val) => {
  state.form.hazardousTargets = state.form.hazardousTargets.filter(item=> item != val)
}
const selectValue =  (val) => {
  if(!val){
    state.form.userId = null
  }
  state.peopleList.forEach(item => {
    if(item.name === val){
      state.form.userId  = item.id
    }
  })
}
const openFile = async(path)=>{