spring
2025-04-02 b34e4348df3f9f697fcb4da64ee7ff11deca3170
修改检验任务分页和文件预览
已修改3个文件
169 ■■■■ 文件已修改
src/components/do/a8-file-handling/DistributionCollectionRecord.vue 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tool/file-preview.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b1-inspect-order-plan.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a8-file-handling/DistributionCollectionRecord.vue
@@ -4,8 +4,8 @@
    <div class="search">
      <div class="search_thing">
        <div class="search_label">文件编号:</div>
        <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="componentData.entity.documentCode"
            @keyup.enter.native="refreshTable()"></el-input></div>
        <div class="search_input"><el-input size="small" placeholder="请输入" clearable
            v-model="componentData.entity.documentCode" @keyup.enter.native="refreshTable()"></el-input></div>
      </div>
      <div class="search_thing">
        <div class="search_label">文件名称:</div>
@@ -17,7 +17,8 @@
        <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
      </div>
      <div class="btns" style="padding-left: 30px;">
        <el-button size="small" type="primary" @click="addDialogVisible=true,addInfo={},radio='发放'" v-if="addPower">添加发放记录</el-button>
        <el-button size="small" type="primary" @click="addDialogVisible = true, addInfo = {}, radio = '发放'"
          v-if="addPower">添加发放记录</el-button>
        <el-button size="small" type="primary" v-if="outPower" @click="handleOut" :loading="outLoading">导出</el-button>
      </div>
    </div>
@@ -25,20 +26,15 @@
      <ValueTable ref="ValueTable" :url="$api.manageDocumentList.pageManageDocumentIssueRecycle"
        :componentData="componentData" :delUrl="$api.manageDocumentList.delManageDocumentIssueRecycle" :key="upIndex"/>
    </div>
    <el-dialog
      :title="'添加'+radio+'记录'"
      :visible.sync="addDialogVisible"
      width="800px" top="10vh">
    <el-dialog :title="'添加' + radio + '记录'" :visible.sync="addDialogVisible" width="800px" top="10vh">
      <el-row>
        <el-col :span="12" style="margin-bottom: 16px;">
          <div class="search_thing">
            <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>申请编号:</div>
            <div class="search_input">
              <el-select v-model="addInfo.documentCode" size="small" style="width: 100%;" @change="changeFileList" :disabled="radio=='回收'" filterable allow-create clearable>
                <el-option
                  v-for="item in fileList"
                  :key="item.documentCode"
                  :label="item.documentCode"
              <el-select v-model="addInfo.documentCode" size="small" style="width: 100%;" @change="changeFileList"
                :disabled="radio == '回收'" filterable allow-create clearable>
                <el-option v-for="item in fileList" :key="item.documentCode" :label="item.documentCode"
                  :value="item.documentCode">
                </el-option>
              </el-select>
@@ -50,11 +46,7 @@
            <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>发放人:</div>
            <div class="search_input">
              <el-select v-model="addInfo.issueUser" size="small" style="width: 100%;" filterable>
                <el-option
                  v-for="item in personList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </div>
@@ -65,11 +57,7 @@
            <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>回收人:</div>
            <div class="search_input">
              <el-select v-model="addInfo.recycleUser" size="small" style="width: 100%;" filterable>
                <el-option
                  v-for="item in personList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </div>
@@ -79,12 +67,9 @@
          <div class="search_thing">
            <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>审批人:</div>
            <div class="search_input">
              <el-select v-model="addInfo.receiveUser" size="small" style="width: 100%;" :disabled="radio!='发放'" filterable>
                <el-option
                  v-for="item in personList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
              <el-select v-model="addInfo.receiveUser" size="small" style="width: 100%;" :disabled="radio != '发放'"
                filterable>
                <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </div>
@@ -93,13 +78,15 @@
        <el-col :span="12" style="margin-bottom: 16px;">
          <div class="search_thing">
            <div class="search_label">文件名称:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="addInfo.name" :disabled="radio=='回收'"></el-input></div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="addInfo.name"
                :disabled="radio == '回收'"></el-input></div>
          </div>
        </el-col>
        <el-col :span="12" style="margin-bottom: 16px;">
          <div class="search_thing">
            <div class="search_label">文件版本:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="addInfo.version" :disabled="radio=='回收'"></el-input></div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="addInfo.version"
                :disabled="radio == '回收'"></el-input></div>
          </div>
        </el-col>
        <el-col :span="12" style="margin-bottom: 16px;">
@@ -107,7 +94,8 @@
            <div class="search_label">文件状态:</div>
            <div class="search_input">
              <el-select v-model="addInfo.state" size="small" style="width: 100%;" :disabled="radio=='回收'">
                <el-option :label="item.label" :value="item.value" v-for="(item,index) in fileState" :key="index"></el-option>
                <el-option :label="item.label" :value="item.value" v-for="(item, index) in fileState"
                  :key="index"></el-option>
              </el-select>
            </div>
          </div>
@@ -115,26 +103,23 @@
        <el-col :span="12" style="margin-bottom: 16px;" v-if="radio=='发放'">
          <div class="search_thing">
            <div class="search_label">发放编号:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="addInfo.issueCode"></el-input></div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable
                v-model="addInfo.issueCode"></el-input></div>
          </div>
        </el-col>
        <el-col :span="12" style="margin-bottom: 16px;" v-else>
          <div class="search_thing">
            <div class="search_label">回收编号:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="addInfo.recycleCode"></el-input></div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable
                v-model="addInfo.recycleCode"></el-input></div>
          </div>
        </el-col>
        <el-col :span="12" style="margin-bottom: 16px;" v-if="radio=='发放'">
          <div class="search_thing">
            <div class="search_label">发放时间:</div>
            <div class="search_input">
              <el-date-picker
                v-model="addInfo.issueDate"
                type="date"
                size="small"
                placeholder="选择日期"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd" style="width: 100%;">
              <el-date-picker v-model="addInfo.issueDate" type="date" size="small" placeholder="选择日期"
                format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;">
              </el-date-picker>
            </div>
          </div>
@@ -143,13 +128,8 @@
          <div class="search_thing">
            <div class="search_label">回收时间:</div>
            <div class="search_input">
              <el-date-picker
                v-model="addInfo.recycleDate"
                type="date"
                size="small"
                placeholder="选择日期"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd" style="width: 100%;">
              <el-date-picker v-model="addInfo.recycleDate" type="date" size="small" placeholder="选择日期"
                format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;">
              </el-date-picker>
            </div>
          </div>
@@ -157,26 +137,23 @@
        <el-col :span="12" style="margin-bottom: 16px;" v-if="radio=='发放'">
          <div class="search_thing">
            <div class="search_label">发放说明:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="addInfo.issueNote" type="textarea"
              :rows="2"></el-input></div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="addInfo.issueNote"
                type="textarea" :rows="2"></el-input></div>
          </div>
        </el-col>
        <el-col :span="12" style="margin-bottom: 16px;" v-else>
          <div class="search_thing">
            <div class="search_label">回收说明:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="addInfo.recycleNote" type="textarea"
              :rows="2"></el-input></div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="addInfo.recycleNote"
                type="textarea" :rows="2"></el-input></div>
          </div>
        </el-col>
        <el-col :span="12" style="margin-bottom: 16px;" v-if="radio=='发放'">
          <div class="search_thing">
            <div class="search_label">上传附件:</div>
            <div class="search_input"><el-upload
            style="margin: 8px 0 0px 50px;"
              action="#"
              :auto-upload="false"
              :multiple="false"
              accept='.pdf,.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx' :on-change="handleChangeUpload">
            <div class="search_input"><el-upload style="margin: 8px 0 0px 50px;" action="#" :auto-upload="false"
                :multiple="false" accept='.pdf,.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx'
                :on-change="handleChangeUpload">
              <el-button size="small" type="primary">上传附件</el-button>
            </el-upload></div>
          </div>
@@ -187,12 +164,9 @@
        <el-button type="primary" @click="handleAdd" :loading="addLoading">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog
      title="查看附件"
      :visible.sync="lookDialogVisible"
      width="800px" top="5vh" fullscreen>
      <filePreview v-if="lookDialogVisible" :fileUrl="javaApi+'/word/'+currentInfo.url"
      :currentFile="{}" style="height: 90vh;overflow-y: auto;"/>
    <el-dialog title="查看附件" :visible.sync="lookDialogVisible" width="800px" top="5vh" fullscreen>
      <filePreview v-if="lookDialogVisible" :fileUrl="javaApi + '/word/' + currentInfo.url" :currentFile="{}"
        style="height: 90vh;overflow-y: auto;" />
    </el-dialog>
  </div>
</template>
@@ -299,7 +273,7 @@
        requiredAdd: [],
        requiredUp: [],
        needSort: [],
        inputType: ''
        inputType: ''
      },
      entityCopy: {},
      upIndex: 0,
@@ -359,6 +333,7 @@
    },
    refresh() {
      this.componentData.entity = this.HaveJson(this.entityCopy)
      this.page.current = 1
      this.upIndex++
      this.refreshTable()
    },
@@ -397,9 +372,11 @@
          current:-1,
          size:-1
        }
      },{headers: {
      }, {
        headers: {
            'Content-Type': 'application/json'
          }}).then(res=>{
        }
      }).then(res => {
        this.fileList = res.data.body.records
      }).catch(err=>{})
    },
@@ -416,18 +393,22 @@
          current:-1,
          size:-1
        }
      },{headers: {
      }, {
        headers: {
            'Content-Type': 'application/json'
          }}).then(res=>{
        }
      }).then(res => {
        this.fileList0 = res.data.body.records
      }).catch(err=>{})
    },
    // 导出
    handleOut(){
      this.outLoading = true
      this.$axios.post(this.$api.manageDocumentList.exportManageDocumentIssueRecycle, {entity:this.componentData.entity},{headers: {
      this.$axios.post(this.$api.manageDocumentList.exportManageDocumentIssueRecycle, { entity: this.componentData.entity }, {
        headers: {
          'Content-Type': 'application/json'
        },responseType: "blob"},).then(res => {
        }, responseType: "blob"
      },).then(res => {
        this.outLoading = false
        const blob = new Blob([res],{ type: 'application/octet-stream' });
        //将Blob 对象转换成字符串
@@ -619,6 +600,7 @@
    height: 60px;
    line-height: 60px;
  }
  .search {
    background-color: #fff;
    height: 40px;
@@ -649,6 +631,7 @@
    height: calc(100% - 60px - 80px);
    padding: 20px;
  }
  .btns{
    position: absolute;
    right: 20px;
src/components/tool/file-preview.vue
@@ -8,26 +8,17 @@
        <p>您的浏览器不支持 PDF 预览。<a :href="fileUrl">下载 PDF 文件</a></p>
      </object>
    </div>
    <a ref="pdfLink" :href="fileUrl" target="_blank" style="display: none;"></a>
    <div v-if="isDoc">
      <p v-if="!isDocShow">文档无法直接预览,请下载查看。</p>
      <a :href="fileUrl" v-if="!isDocShow">下载文件</a>
      <vue-office-docx v-else
          :src="fileUrl"
          style="height: 100vh;"
          @rendered="renderedHandler"
          @error="errorHandler"
      />
      <vue-office-docx v-else :src="fileUrl" style="height: 100vh;" @rendered="renderedHandler" @error="errorHandler" />
    </div>
    <div v-if="isXls">
      <p v-if="!isDocShow">文档无法直接预览,请下载查看。</p>
      <a :href="fileUrl" v-if="!isDocShow">下载文件</a>
      <vue-office-excel v-else
        :src="fileUrl"
        :options="options"
        style="height: 100vh;"
        @rendered="renderedHandler"
        @error="errorHandler"
    />
      <vue-office-excel v-else :src="fileUrl" :options="options" style="height: 100vh;" @rendered="renderedHandler"
        @error="errorHandler" />
    </div>
    <div v-if="isZipOrRar">
      <p>压缩文件无法直接预览,请下载查看。</p>
@@ -39,7 +30,8 @@
      <el-tabs type="border-card" v-if="csvList.length>0" tab-position="bottom">
        <el-tab-pane :label="item.sheetName" v-for="(item,index) in csvList" :key="index">
          <el-table :data="item.tableData" height="75vh">
            <el-table-column :label="m.label" :prop="m.prop" v-for="(m,i) in item.column" :key="i" min-width="120px" show-overflow-tooltip>
            <el-table-column :label="m.label" :prop="m.prop" v-for="(m, i) in item.column" :key="i" min-width="120px"
              show-overflow-tooltip>
              <template slot-scope="scope" slot="header">
                <div>
                  <el-tooltip  :content="m.label" placement="top">
@@ -108,7 +100,18 @@
      return state;
    },
    isPdf() {
      return /\.pdf$/i.test(this.fileUrl);
      let state = /\.pdf$/i.test(this.fileUrl)
      if (state) {
        this.$nextTick(() => {
          this.$refs.pdfLink.click();
          if (this.$parent.lookDialogVisible) {
            this.$parent.lookDialogVisible = false
          } else if (this.$parent.$parent.lookDialogVisible) {
            this.$parent.$parent.lookDialogVisible = false
          }
        })
      }
      return state;
    },
    isDoc() {
      return /\.(doc|docx)$/i.test(this.fileUrl);
src/components/view/b1-inspect-order-plan.vue
@@ -251,9 +251,9 @@
        </el-table>
        <div style="display: flex;justify-content: flex-end;width: 100%;margin-top: 10px;">
          <span></span>
          <el-pagination @size-change="refreshTable" @current-change="refreshTable" :current-page="page.current"
            :page-sizes="[10, 20, 30, 50, 100]" :page-size="page.size" layout="total, sizes, prev, pager, next, jumper"
            :total="total">
          <el-pagination @size-change="m => refreshTable('size', m)" @current-change="m => refreshTable('current', m)"
            :current-page="page.current" :page-sizes="[10, 20, 30, 50, 100]" :page-size="page.size"
            layout="total, sizes, prev, pager, next, jumper" :total="total">
          </el-pagination>
        </div>
      </div>
@@ -1023,7 +1023,7 @@
          this.loading = false;
          this.$message.success("认领成功")
          this.claimVisible = false
          this.refreshTable('page')
          this.refreshTable()
        } else {
          this.loading = false;
        }
@@ -1032,7 +1032,10 @@
        this.loading = false;
      })
    },
    refreshTable() {
    refreshTable(type, val) {
      if (type && val) {
        this.page[type] = val;
      }
      this.tableLoading = true
      this.$axios.post(this.$api.insOrderPlan.selectInsOrderPlanList, {
        entity: this.componentData.entity,