Tcsm
2023-08-18 dad56aa7392c7c914b38e4297b2e2ff4d062fab8
ruoyi-ui/src/views/clean/cleanInfo.vue
@@ -2,7 +2,7 @@
  <div class="app-container">
    <div class="form-header mt">
      <h4 class="dt h4">保洁收纳信息 </h4>
      <el-button type="primary" class="pt"  icon="el-icon-edit" @click="handleEdit()" :disabled="btn">编辑</el-button>
<!--      <el-button type="primary" class="pt"  icon="el-icon-edit" @click="handleEdit()" :disabled="btn">编辑</el-button>-->
    </div>
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px">
@@ -34,7 +34,7 @@
        </el-input>
      </el-form-item>
      <el-form-item label="时间" prop="happenTime">
        <el-input v-model="formData.happenTime" placeholder="请输入时间" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
        <el-input v-model="formData.happenTime" placeholder="请输入时间" type="date" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
      </el-form-item>
      <el-form-item label="备注" prop="remark">
        <el-input v-model="formData.remark" placeholder="请输入备注" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
@@ -49,7 +49,8 @@
        :http-request="requestUpload"
        :file-list="fileList"
      >
        <i slot="default" class="el-icon-plus"></i>
        <div v-if="uploading" class="upload-status">正在上传...</div>
        <i v-if="!uploading" slot="default" class="el-icon-plus"></i>
        <div slot="file" slot-scope="{file}">
          <img
            class="el-upload-list__item-thumbnail"
@@ -67,14 +68,14 @@
            <i class="el-icon-zoom-in"></i>
          </span>
          <span
            v-if="!disabled"
            class="el-upload-list__item-delete"
            @click="handleDownload(file.url)"
          >
            <i class="el-icon-download"></i>
          </span>
          <span
            v-if="!disabled"
            v-if="isShow"
            class="el-upload-list__item-delete"
            @click="handleRemove(file)"
          >
@@ -92,23 +93,54 @@
        :file-list="fileListOther"
        class="upload-demo"
        multiple
        :on-preview="handlePreview"
        :on-remove="handleRemove"
        list-type="picture-card"
        :on-preview="handleFileCardPreview"
        :on-remove="handleRemoveFile"
        :http-request="requestUpload"
        :show-file-list="true"
      >
        <el-button type="primary">Click to upload</el-button>
        <template #tip>
          <div class="el-upload__tip">
          </div>
        </template>
        <div v-if="uploading" class="upload-status">正在上传...</div>
        <i v-if="!uploading" slot="default" class="el-icon-plus"></i>
        <div slot="file" slot-scope="{file}">
          <img
            class="el-upload-list__item-thumbnail"
            src="../../assets/401_images/401.gif"
            alt=""
            style="width: 147px; height: 147px"
            fit="cover"
          >
          <span class="el-upload-list__item-actions">
                <span
                  class="el-upload-list__item-preview"
                  @click="handleFileCardPreview(file)"
                >
                  <i class="el-icon-zoom-in"></i>
                </span>
                <span
                  class="el-upload-list__item-delete"
                  @click="handleDownload(file.url)"
                >
                 <i class="el-icon-download"></i>
                 </span>
                <span
                  v-if="isShow"
                  class="el-upload-list__item-delete"
                  @click="handleRemoveFile(file)"
                >
                  <i class="el-icon-delete"></i>
                </span>
              </span>
        </div>
      </el-upload>
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm" :disabled="dsb">修改</el-button>
        <el-button v-if="isShow" type="primary" @click="submitForm" :disabled="dsb">修改</el-button>
      </el-form-item>
    </el-form>
@@ -139,6 +171,8 @@
      ],
      dsb:true,
      btn:false,
      isShow:true,
      uploading: false,
      formData: {
        type: undefined,
        kind: undefined,
@@ -210,12 +244,14 @@
      jd =  this.$route.query.detail
      this.btn= jd
      this.dsb = !jd
      this.isShow=true
      document.title = "修改保洁收纳详细信息";
      this.$route.meta.title = "修改保洁收纳详细信息";//列表的名称
    }
    else{
      document.title = "保洁收纳详细信息";
      this.$route.meta.title = "保洁收纳详细信息";//列表的名称
      this.isShow=false
    }
    let _this = this
@@ -263,6 +299,13 @@
        return '自动扣划'
      }
    },
    handleRemove(file) {
      for(let i = 0; i < this.fileList.length; i++)
      {
        if(this.fileList[i].url==file.url)
          this.$delete(this.fileList,i);
      }
    },
    submitForm() {
      let ul = this.fileList.map(function (elem){
@@ -274,7 +317,6 @@
      this.formData.url = ul+","+uls
      this.$refs['elForm'].validate(valid => {
        if (valid) {
          if (this.formData.id != undefined) {
@@ -310,11 +352,14 @@
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    handleFileCardPreview(file){
      this.dialogFileUrl = file.url;
      const Base64 = require('js-base64').Base64
      this.desurl = process.env.VUE_APP_BASE_OTHER_API+'onlinePreview?url='+encodeURIComponent(Base64.encode(this.dialogFileUrl));
      myWindow=window.open(this.desurl,'','width=1200,height=800,top=150,left=300');
    },
    //删除图片
    handleRemoveFile(file,) {
@@ -349,10 +394,11 @@
      var formData = new FormData();
      formData.append('uploadFile', file);
      let _this = this
      this.uploading = true;
      uploadPic(formData).then(response => {
        let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
        this.uploading = false;
        this.$modal.msgSuccess("上传成功");
        if(_this.fot.includes(pth) === true)
        {
          _this.fileList.push({name:response.data.fileName, "url":response.data.url})