Crunchy
2025-03-17 0a26d58a3906b9e13946c7cb46fae51a0de98920
src/views/business/productOrder/index.vue
@@ -15,17 +15,6 @@
          <el-input v-model="entity.sampleModel" clearable placeholder="请输入" size="small"
            @keyup.enter.native="refreshTable()"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button :icon="!more ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" style="color: #3A7BFA;" type="text"
            @click="more = !more">{{ !more ? '更多' : '收起' }}</el-button>
          <el-button size="small" @click="refresh()">重 置</el-button>
          <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
        </el-form-item>
        <el-form-item label="样品编号" prop="sampleCode" v-if="more">
          <el-input v-model="entity.sampleCode" clearable placeholder="请输入" size="small"
            @keyup.enter.native="refreshTable">
          </el-input>
        </el-form-item>
        <el-form-item label="下单时间" prop="createTime" v-if="more">
          <el-date-picker v-model="entity.createTime" clearable format="yyyy-MM-dd" placeholder="选择日期" size="small"
            style="width:100%" type="date" value-format="yyyy-MM-dd HH:mm:ss">
@@ -40,6 +29,12 @@
          <el-input v-model="entity.company" clearable placeholder="请输入" size="small"
            @keyup.enter.native="refreshTable">
          </el-input>
        </el-form-item>
        <el-form-item>
          <el-button :icon="!more ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" style="color: #3A7BFA;" type="text"
                     @click="more = !more">{{ !more ? '更多' : '收起' }}</el-button>
          <el-button size="small" @click="refresh()">重 置</el-button>
          <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
        </el-form-item>
      </el-form>
    </div>
@@ -151,7 +146,7 @@
          </el-row>
        </span>
      </el-dialog>
      <el-dialog :visible.sync="dataDialogVisible" title="数据查看" width="80%">
      <el-dialog :visible.sync="dataDialogVisible" title="数据查看" width="80%" @close="closeDia">
        <div v-if="dataDialogVisible">
          <lims-table :tableData="tableDataLook" :column="tableDataLookColumn" @pagination="tableDataLookPagination"
            height="500px" key="tableDataLook" :page="tableDataLookPage"
@@ -307,7 +302,6 @@
<script>
import vueQr from 'vue-qr'
import PrintJS from 'print-js'
import file from "@/utils/file";
import PrintDialog from "@/views/business/productOrder/components/printDialog.vue";
import AddInspectionDia from "@/views/business/productOrder/components/addInspectionDia.vue";
import limsTable from "@/components/Table/lims-table.vue";
@@ -321,8 +315,8 @@
import { selectUserCondition } from "@/api/performance/class";
import { downFile, getFileList, selectSampleAndProductByOrderId } from "@/api/business/rawMaterialOrder";
import {mapGetters} from "vuex";
// import Inspection from "../do/b1-inspect-order-plan/Inspection.vue";
export default {
  name: 'ProductOrder',
  components: {
    limsTable,
    AddInspectionDia,
@@ -339,9 +333,21 @@
      tableData: [],
      tableLoading: false,
      column: [
        { label: '委托编号', prop: 'entrustCode', width: '160px' },
        {
          label: "委托编号",
          prop: "entrustCode",
          width: "160px",
          dataType: "link",
          linkMethod: "changeEntrustCode",
        },
        { label: '委托单位', prop: 'company' },
        { label: '样品名称', prop: 'sampleName' },
        {
          label: "样品名称",
          prop: "sampleName",
          width: "160px",
          dataType: "link",
          linkMethod: "selectAllByOne",
        },
        { label: '样品型号', prop: 'sampleModel' },
        { label: '样品数量', prop: 'sampleNum' },
        { label: '检验人', prop: 'testingName' },
@@ -523,7 +529,7 @@
      ],
      page: {
        total: 0,
        size: 10,
        size: 20,
        current: 1
      },
      state: 0,// 0:台账页,1:检验页面,2检验页面(复核),默认为0,3数据查看
@@ -547,11 +553,12 @@
      quashDialogVisible: false,
      issuedDialogVisible: false,
      dataDialogVisible: false, // 数据查看弹框
      currentRow: {}, // 数据查看弹框
      tableDataLookTableLoading: false, // 数据查看弹框
      tableDataLook: [],
      tableDataLookPage: {
        total: 0,
        size: 10,
        size: 20,
        current: 1
      },
      tableDataLookColumn: [
@@ -642,7 +649,7 @@
      ],
      pageFile: {
        total: 0,
        size: 10,
        size: 20,
        current: 1
      },
      formData: {},
@@ -679,7 +686,7 @@
      ],
      pageDelete: {
        total: 0,
        size: 10,
        size: 20,
        current: 1
      },
      deleteDialogVisible: false,
@@ -748,6 +755,9 @@
    this.refreshTable()
    this.getAuthorizedPerson()
  },
  activated() {
    this.refreshTable()
  },
  methods: {
    // 查询列表数据
    refreshTable() {
@@ -762,7 +772,7 @@
      }
      const params = { ...this.entity, state: this.tabList[this.tabIndex].value }
      this.tableLoading = true
      selectInsOrderParameter(params).then(res => {
      selectInsOrderParameter({...this.page,...params}).then(res => {
        this.upIndex++
        this.tableLoading = false
        if (res.code === 200) {
@@ -783,6 +793,9 @@
    },
    // 打开修改委托编号弹框
    changeEntrustCode(row) {
      if (this.tabIndex !== 1) {
        return
      }
      this.entrustCodeVisible = true
      this.entrustCodeInfo = { ...row }
    },
@@ -876,7 +889,8 @@
    },
    // 导出记录
    downLoad() {
      rawAllInsOrderExport({ ...this.entity }).then(res => {
      const params = { ...this.entity, state: this.tabList[this.tabIndex].value }
      rawAllInsOrderExport({ ...params }).then(res => {
        const blob = new Blob([res], { type: 'application/octet-stream' });
        this.$download.saveAs(blob, '委托检测信息导出.xlsx');
      }).catch(err => {
@@ -928,25 +942,24 @@
    },
    // 详情
    selectAllByOne(row) {
      this.active = 2;
      // console.log(row);
      // //打开弹框
      // this.dialogVisible = true;
      // //row = 点击对应行值
      // //复制给formData
      // this.formData = this.HaveJson(row);
      this.currentId = row.id
      this.examine = 1
      this.$router.push({
        path: "/productOrder/add", query: {
          examine: 1,
          active: 2,
          currentId: row.id
        }
      });
    },
    // 数据查看
    handleDataLook(row) {
      this.dataDialogVisible = true;
      this.getDataTableList(row)
      this.currentRow = row;
      this.getDataTableList(this.currentRow)
    },
    // 查询数据查看列表数据
    getDataTableList(row) {
      this.tableDataLookTableLoading = true
      selectSampleAndProductByOrderId({ id: row.id }).then(res => {
      selectSampleAndProductByOrderId({ id: row.id, ...this.tableDataLookPage }).then(res => {
        this.tableDataLookTableLoading = false
        if (res.code === 200) {
          this.tableDataLook = res.data.records
@@ -958,7 +971,15 @@
    },
    tableDataLookPagination(page) {
      this.tableDataLookPage.size = page.limit
      this.getDataTableList()
      this.getDataTableList(this.currentRow)
    },
    closeDia () {
      this.tableDataLookPage = {
        total: 0,
        size: 20,
        current: 1
      }
      this.dataDialogVisible = false
    },
    // 附件查看
    handleFileLook(row) {
@@ -994,8 +1015,13 @@
    // 下载报告
    download(row) {
      let url = row.urlS ? row.urlS : row.url;
      if (url) {
        this.$download.saveAs(url, row.entrustCode);
      if(url){
        url = url.split('.')[0]+'.pdf'
        const link = document.createElement('a');
        link.href = this.javaApi + url;
        link.target = '_blank';
        document.body.appendChild(link);
        link.click();
      }
    },
    // 撤销