qinxianzhangyao
2023-12-20 16ad3d3ac0e7d477ce6d001cc7adc17ecc5d8879
src/views/system/dept/index.vue
@@ -227,7 +227,7 @@
        label-width="110px"
        :inline="true"
      >
        <el-form-item label="上级科室" prop="parentName">
        <el-form-item label="上级科室" prop="parentId">
          <el-select
            v-model="form.parentId"
            placeholder="请选择上级科室"
@@ -255,9 +255,9 @@
        <el-form-item label="显示顺序" prop="orderNum">
          <el-input v-model="form.orderNum" placeholder="请输入显示顺序" />
        </el-form-item>
        <el-form-item label="所属医院" prop="hospName">
        <el-form-item label="所属医院" prop="hospId">
          <el-select
            v-model="form.hospName"
            v-model="form.hospId"
            placeholder="请选择所属医院"
            clearable
            filterable
@@ -478,7 +478,7 @@
        departmentCode: [
          { required: true, validator: checkPhoneNum, trigger: "blur" },
        ],
        hospName: [
        hospId: [
          { required: true, validator: checkPhoneNum, trigger: "blur" },
        ],
        // email: [
@@ -656,8 +656,14 @@
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      // console.log(11111)
      // this.reset();
      this.form = row;
      console.log(this.form )
      // this.form.parentId = this.form.parentId.toString()
      if(this.form.parentId == 0){
        this.deptOption.push({ "id": 0, "label": "主类目", });
      }
      this.open = true;
      this.title = "科室信息维护  ";
      // getDept(row.deptId).then((response) => {
@@ -682,11 +688,16 @@
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.deptId != undefined) {
            updateDept(this.form).then((response) => {
            if(this.form.hospId && this.form.hospCode){
              updateDept(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
            }else{
              this.$modal.msgError("请填写带星号");
            }
          } else {
            this.hospList.forEach((element) => {
              if (this.form.hospName == element.hospAreaName) {