feige
2025-03-03 f5edbc080d696fbd55de84f6a906aeb2cde3b1b6
ruoyi-ui/src/views/doctor/doctorInfo.vue
@@ -13,11 +13,43 @@
    </div>
    <div>
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-position="left" label-width="100px">
      <!--      <el-form-item label="id" prop="id">-->
      <!--        <el-input v-model="formData.id" placeholder="请输入id" :maxlength="11" show-word-limit :disabled="true"-->
      <!--                  clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input>-->
      <!--      </el-form-item>-->
      <el-container>
      <el-form-item label="类别" prop="type" label-width="55px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
        <el-select v-model="formData.type" placeholder="请选择类别" clearable :style="{width: '100%'}"   :disabled="dsb">
          <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value"
          ></el-option>
        </el-select>
        <el-input v-model="newOption" v-if="showInput" placeholder="若未在上述选项中找到对应类别,请在此输入新的类别" @change="addNewOption"></el-input>
      </el-form-item>
      <el-form-item label="症状" prop="symptom" label-width="50px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
        <el-input v-if="!dsb" v-model="formData.symptom" placeholder="请输入症状" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
        <el-input v-if="dsb" v-model="formData.symptom" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
      </el-form-item>
      <el-form-item label="持续时间" prop="duration" label-width="68px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
        <el-input v-model="formData.duration" placeholder="请输入持续时间" type="number" clearable :style="{width: '100%'}" :disabled="dsb">
        </el-input>
      </el-form-item>
      <el-form-item label="功效" prop="effect" label-width="50px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
        <el-input v-model="formData.effect" placeholder="请输入功效" clearable :style="{width: '100%'}" :disabled="dsb">
        </el-input>
      </el-form-item>
      <el-form-item label="适用人" prop="suitable" label-width="65px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
        <el-input v-model="formData.suitable" placeholder="请输入适用人" clearable :style="{width: '100%'}" :disabled="dsb">
        </el-input>
      </el-form-item>
      <el-form-item label="中医处方" prop="cmedical" label-width="68px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
        <el-input v-model="formData.cmedical" placeholder="请输入中医处方"  clearable :style="{width: '100%'}" :disabled="dsb" type="textarea">
        </el-input>
      </el-form-item>
      <el-form-item label="西医处方" prop="wmedical" label-width="68px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
          <el-input v-if="!dsb" v-model="formData.wmedical" placeholder="请输入西医处方" clearable :style="{width: '100%'}" :disabled="dsb" type="textarea"></el-input>
          <el-input v-if="dsb" v-model="formData.wmedical" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb" type="textarea"></el-input>
      </el-form-item>
      <el-form-item label="备注" prop="remark" label-width="45px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
        <el-input v-if="!dsb" v-model="formData.remark" placeholder="请输入备注" clearable :style="{width: '100%'}" :disabled="dsb" type="textarea"></el-input>
        <el-input v-if="dsb" v-model="formData.remark" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb" type="textarea"></el-input>
      </el-form-item>
      <!-- <el-container>
      <div>
        <el-container>
          <el-row>
@@ -32,13 +64,13 @@
            </el-cow>
            <el-cow :span="8">
              <el-form-item label="症状" prop="symptom" label-width="50px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
                <el-input v-model="formData.symptom" placeholder="请输入症状" clearable :style="{width: '100%'}" :disabled="dsb">
                </el-input>
                <el-input v-if="!dsb" v-model="formData.symptom" placeholder="请输入症状" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
                <el-input v-if="dsb" v-model="formData.symptom" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
              </el-form-item>
            </el-cow>
            <el-cow :span="8">
              <el-form-item label="持续时间" prop="duration" label-width="68px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
                <el-input v-model="formData.duration" placeholder="请输入持续时间" clearable :style="{width: '100%'}" :disabled="dsb">
                <el-input v-model="formData.duration" placeholder="请输入持续时间" type="number" clearable :style="{width: '100%'}" :disabled="dsb">
                </el-input>
              </el-form-item>
            </el-cow>
@@ -56,7 +88,8 @@
            </el-cow>
            <el-cow :span="8">
              <el-form-item label="备注" prop="remark" label-width="45px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
          <el-input v-model="formData.remark" placeholder="请输入备注" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
          <el-input v-if="!dsb" v-model="formData.remark" placeholder="请输入备注" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
          <el-input v-if="dsb" v-model="formData.remark" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
        </el-form-item>
            </el-cow>
          </el-row>
@@ -73,14 +106,15 @@
            </el-cow>
            <el-cow :span="8">
              <el-form-item label="西医处方" prop="wmedical" label-width="68px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
            <el-input v-model="formData.wmedical" placeholder="请输入西医处方" clearable :style="{width: '100%'}" :disabled="dsb">
            </el-input>
              <el-input v-if="!dsb" v-model="formData.wmedical" placeholder="请输入西医处方" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
              <el-input v-if="dsb" v-model="formData.wmedical" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
          </el-form-item>
            </el-cow>
          </el-row>
        </el-container>
      </div>
      </el-container>
      </el-container> -->
      <h4 class="form-header">相关图片 </h4>
      <el-upload
        action="#"
@@ -170,7 +204,7 @@
        ></video>
        <img v-else
             class="el-upload-list__item-thumbnail"
             src="../../assets/401_images/401.gif"
             src="../../assets/images/deviceLis.png"
             alt=""
             style="width: 147px; height: 147px"
             fit="cover">
@@ -349,6 +383,8 @@
      this.loading = true;
      getDoctor(id).then((response) => {
        this.formData = response.data;
      console.log(response.data.url)
      if(response.data.url!=null){
        let paths = response.data.url.split(",");
        for(let i = 0; i < paths.length; i++)
        {
@@ -357,12 +393,26 @@
              let pth = paths[i].substr(paths[i].length - 4, paths[i].length)
          //   alert(pth)
              if (_this.fot.includes(pth) === true)
             {
                if(paths[i][0]=="/")
                _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false})
               else
                  _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false})
               }
             // {
             //    if(paths[i][0]=="/")
           //      _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false})
             //   else
             //      _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false})
             //   }
            {
              if(paths[i].includes(process.env.VUE_APP_BASE_TRUE_API)){
                if(paths[i][0]=="/")
                      _this.fileList.push({name:paths[i],url: paths[i].substr(1),res:false})
                else
                   _this.fileList.push({name:paths[i],url: paths[i],res:false})
              }else{
                if(paths[i][0]=="/")
                      _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false})
                else
                   _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false})
              }
              }
              else {
                // alert(paths[i])
              // alert()
@@ -376,6 +426,10 @@
             }
            }
        }
      }
      else{
         this.formData.url = ""
      }
        this.loading = false;
      });
      listType(this.queryParams).then(response => {
@@ -400,6 +454,8 @@
        this.loading = true;
        getDoctor(id).then((response) => {
          this.formData = response.data;
        console.log(response.data.url)
        if(response.data.url!=null){
          let paths = response.data.url.split(",");
          for(let i = 0; i < paths.length; i++)
          {
@@ -422,6 +478,7 @@
               }
              }
          }
        }
          _this.fileListOther = _this.fileListOther1
          this.loading = false;
        });
@@ -463,10 +520,7 @@
    },
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (valid) {
          if (this.formData.id != undefined) {
            updateDoctor(this.formData).then(response => {
@@ -652,6 +706,8 @@
          this.uploading = true;
          uploadPic(formData).then(response => {
          _this.uploadFileList1 = []
         // alert(response.fileNames)
         // alert(_this.formData.url)
            _this.formData.url = _this.formData.url+","+response.fileNames
              updateDoctor(_this.formData).then(response => {
                this.$modal.msgSuccess("文档上传成功");
@@ -760,4 +816,7 @@
.form{
  background:center/11% no-repeat url('../../assets/icons/form.png') ;
}
/* /deep/ .el-input__inner{
          height: 72px;
        } */
</style>