deslrey
4 天以前 0bc622c089cd253ae8e779caae57e236644e8489
src/views/business/reportPreparation/index.vue
@@ -2,6 +2,11 @@
  <div class="app-container">
    <div>
      <el-form :model="entity" ref="entity" size="small" :inline="true">
        <el-form-item label="批号" prop="updateBatchNo">
          <el-input v-model="entity.updateBatchNo" clearable placeholder="请输入" size="small"
            @keyup.enter.native="refreshTable()">
          </el-input>
        </el-form-item>
        <el-form-item label="报告编号" prop="code">
          <el-input v-model="entity.code" clearable placeholder="请输入" size="small"
            @keyup.enter.native="refreshTable()"></el-input>
@@ -16,21 +21,43 @@
            <el-option v-for="(a, i) in typeSourceList" :key="i" :label="a.label" :value="a.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="检验类别" prop="orderType">
          <el-select v-model="entity.orderType" clearable size="small" @change="refreshTable()">
            <el-option v-for="(a, i) in orderTypeList" :key="i" :label="a.label" :value="a.value"></el-option>
          </el-select>
        <el-form-item label="物料属性" prop="materialProp">
          <el-select clearable size="small" v-model="entity.materialProp" style="width: 100%">
            <el-option v-for="dict in dict.type.material_prop_type" :key="dict.value" :label="dict.label"
              :value="dict.value"">
              </el-option>
            </el-select>
          </el-form-item>
        <el-form-item label=" 检验类别" prop="orderType">
              <el-select v-model="entity.orderType" clearable size="small" @change="refreshTable()">
                <el-option v-for="(a, i) in orderTypeList" :key="i" :label="a.label" :value="a.value"></el-option>
              </el-select>
        </el-form-item>
        <el-form-item label="零件描述" prop="partDesc">
          <el-input v-model="entity.partDesc" clearable placeholder="请输入" size="small"
            @keyup.enter.native="refreshTable">
          </el-input>
        </el-form-item>
        <el-form-item label="供应商名称" prop="supplierName">
          <el-input v-model="entity.supplierName" clearable placeholder="请输入" size="small"
            @keyup.enter.native="refreshTable">
          </el-input>
        </el-form-item>
        <el-form-item>
          <el-button size="mini" @click="refresh()">重置</el-button>
          <el-button size="mini" type="primary" @click="refreshTable()">查询</el-button>
          <el-button :loading="outLoading" size="mini" type="primary" @click="handleDowns">批量下载</el-button>
          <el-button size="mini" @click="refresh()">重置</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div style="text-align: right;margin-bottom: 10px">
      <el-button :loading="outLoading" size="mini" type="primary" @click="handleDowns">批量下载</el-button>
      <el-button :loading="outExportLoading" size="mini" type="primary" @click="handleExport">报表导出</el-button>
    </div>
    <div>
      <lims-table :tableData="valueTableData" :column="column" :page="page" :tableLoading="tableLoading"
        :isSelection="true" :handleSelectionChange="handleChange" :height="'calc(100vh - 290px)'"
        :isSelection="true" :handleSelectionChange="handleChange" :height="'calc(100vh - 320px)'"
        @pagination="pagination" key="valueTableData">
        <div slot="action" slot-scope="scope">
          <el-button size="small" type="text" @click="viewIssued(scope.row)">查看报告</el-button>
@@ -184,8 +211,8 @@
          <el-button size="small" style="height: 38px" type="primary">附件上传</el-button>
        </el-upload>
      </div>
      <lims-table :tableData="tableDataFile" :column="columnFile" height="500px"
        key="tableDataFile" :tableLoading="tableLoadingFile"></lims-table>
      <lims-table :tableData="tableDataFile" :column="columnFile" height="600px" key="tableDataFile"
        :tableLoading="tableLoadingFile"></lims-table>
    </el-dialog>
  </div>
</template>
@@ -200,20 +227,25 @@
  ratifyReport,
  sendBackTask,
  upReportUrl,
  writeReport
  writeReport,
  reportAllExport
} from "@/api/business/insReport";
import { mapGetters } from "vuex";
import { selectUserCondition } from "@/api/business/inspectionTask";
import limsTable from "@/components/Table/lims-table.vue";
import {delFile, downFile, getFileList} from "@/api/business/rawMaterialOrder";
import { delFile, downFile, getFileList } from "@/api/business/rawMaterialOrder";
export default {
  name: 'ReportPreparation',
  components: { limsTable, onlyoffice },
  dicts: ['material_prop_type'],
  data() {
    return {
      entity: {
        queryStatus: null,
        code: null,
        typeSource: null,
        orderType: null,
        materialProp: null
      },
      page: {
        current: 1,
@@ -238,6 +270,7 @@
      option: null,
      mutiList: [],
      outLoading: false,
      outExportLoading: false,
      inLoading: false,
      addApproverDia: false, // 指定审批人员弹框
      approver: '', // 审批人员
@@ -247,7 +280,8 @@
      verifyUser: null, // 审核人员
      loadingVerify: false, // 审核人员
      typeSourceList: [
        { label: '成品下单', value: 0 },
        { label: '委托下单', value: -1 },
        { label: '外购下单', value: 0 },
        { label: '原材料下单', value: 1 },
      ],
      orderTypeList: [
@@ -333,6 +367,21 @@
      valueTableData: [],
      column: [
        {
          label: "批号",
          prop: "updateBatchNo",
          width: "120px",
        },
        {
          label: "零件描述",
          prop: "partDesc",
          width: "120px",
        },
        {
          label: "供应商名称",
          prop: "supplierName",
          width: "120px",
        },
        {
          label: "报告编号",
          prop: "code",
          width: "160px",
@@ -346,11 +395,28 @@
          dataType: "tag",
          formatData: (params) => {
            if (params == 0) {
              return "成品下单";
            } else {
              return "外购下单";
            } else if (params == 1) {
              return "原材料下单";
            } else {
              return "委托下单";
            }
          },
        },
        {
          label: '物料属性',
          prop: 'materialProp',
          formatData: (params) => {
            if (!params) return null
            for (let i = 0; i < this.dict.type.material_prop_type.length; i++) {
              const item = this.dict.type.material_prop_type[i]
              if (item.value == params) {
                return item.label
              }
            }
            return null
          }
        },
        {
          label: "检验类型",
@@ -518,7 +584,7 @@
    // 查询附件查看列表回调
    getFileList() {
      this.tableLoadingFile = true
      getFileList({ insOrderId: this.filesLookInfo.insOrderId }).then(res => {
      getFileList({ insOrderId: this.filesLookInfo.insOrderId, current: -1, size: -1 }).then(res => {
        this.tableLoadingFile = false
        if (res.code === 200) {
          this.tableDataFile = res.data.records
@@ -547,16 +613,7 @@
      downFile({
        id: row.id,
      }).then(res => {
        if (res.code === 200) {
          let url = '';
          if (res.data.type == 1) {
            url = this.javaApi + '/img/' + res.data.fileUrl
            this.$download.saveAs(url, row.fileName);
          } else {
            url = this.javaApi + '/word/' + res.data.fileUrl
            this.$download.saveAs(url, row.fileName);
          }
        }
        this.$download.saveAs(res.data.fileUrl, row.fileName);
      }).catch(error => {
      })
@@ -606,6 +663,17 @@
      })
    },
    // 报表导出
    handleExport() {
      this.outExportLoading = true
      reportAllExport({
        ...this.entity
      }).then(res => {
        this.outExportLoading = false
        const blob = new Blob([res], { type: 'application/octet-stream' });
        this.$download.saveAs(blob, "报告报表导出.xlsx");
      })
    },
    beforeUpload(file) {
      const isZip = file.type === 'application/zip' || file.name.endsWith('.zip');
      if (!isZip) {
@@ -618,6 +686,7 @@
    },
    fileBeforeUpload(file) {
      let flag = true
      console.log('file----', file)
      if (file.size > 1024 * 1024 * 10) {
        this.$message.error('上传文件不超过10M');
        this.$refs.upload.clearFiles()
@@ -669,7 +738,7 @@
        case 0:
          // 原材料
          this.$router.push({
            path: "/materialOrder/customsInspection", query: {
            path: "/materialOrder/customsInspectionView", query: {
              customsInspection: row,
              active: this.activeFace,
              currentId: row.insOrderId,
@@ -680,7 +749,7 @@
        case null:
          // 成品
          this.$router.push({
            path: "/productOrder/add", query: {
            path: "/productOrder/addView", query: {
              examine: this.examine,
              active: this.activeFace,
              currentId: row.insOrderId
@@ -690,7 +759,7 @@
        case 1:
          // 铜材
          this.$router.push({
            path: "/materialOrder/copperOrder", query: {
            path: "/materialOrder/CopperView", query: {
              active: this.activeFace,
              currentId: row.insOrderId
            }
@@ -743,6 +812,7 @@
    },
    // 查看报告
    viewIssued(row) {
      console.log('this.javaApi', this.javaApi)
      this.currentInfo = row;
      let fileName = (row.urlS === null || row.urlS === '') ? row.url : row.urlS
      let fileType = "docx"
@@ -821,7 +891,7 @@
    },
    // 获取人员列表
    getAuthorizedPerson() {
      selectUserCondition({ type: 0 }).then((res) => {
      selectUserCondition({ type: 1 }).then((res) => {
        let data = [];
        res.data.forEach((a) => {
          data.push({