gaoluyang
2025-03-16 e8f6ef1f20770838b37d7a739d108c09831a34ab
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">
@@ -41,13 +30,24 @@
            @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>
    <div class="table-tab">
      <div>
        <ul class="tab">
          <li v-for="(m, i) in tabList" :key="i + 'afgh'" :class="{ active: i == tabIndex }" @click="handleTab(m, i)">{{ m.label }}
          </li>
          <li :class="{ active: tabIndex === 0 }" v-if="checkPermi(['get:insOrder:reviewed'])" @click="handleTab(0)">待审核</li>
          <li :class="{ active: tabIndex === 1 }" v-if="checkPermi(['get:insOrder:checkout'])" @click="handleTab(1)">检验中</li>
          <li :class="{ active: tabIndex === 2 }" v-if="checkPermi(['get:insOrder:customerOrdered'])" @click="handleTab(2)">委托已检</li>
          <li :class="{ active: tabIndex === 3 }" v-if="checkPermi(['get:insOrder:spotCheck'])" @click="handleTab(3)">抽样已检</li>
          <li :class="{ active: tabIndex === 4 }" v-if="checkPermi(['get:insOrder:sendBack'])" @click="handleTab(4)">退回</li>
          <li :class="{ active: tabIndex === 5 }" v-if="checkPermi(['get:insOrder:revocation'])" @click="handleTab(5)">撤销</li>
          <li :class="{ active: tabIndex === 6 }" v-if="checkPermi(['get:insOrder:all'])" @click="handleTab(6)">全部</li>
        </ul>
      </div>
      <div>
@@ -55,7 +55,7 @@
          @click="downLoad">导出</el-button>
        <el-button v-if="tabIndex === 1" size="small" type="primary" @click="openAddIns">添加检验项</el-button>
        <el-button size="small" type="primary" @click="openPrint">标签打印</el-button>
        <el-button size="small" type="primary" @click="playOrder(1)">下单</el-button>
        <el-button v-if="checkPermi(['add:insOrder'])" size="small" type="primary" @click="playOrder(1)">下单</el-button>
      </div>
    </div>
    <div class="table">
@@ -146,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"
@@ -168,8 +168,7 @@
        <span slot="footer" class="dialog-footer">
          <el-row>
            <el-button @click="handleNo">{{ deleteTilte == '撤销' ? '取 消' : '不通过' }}</el-button>
            <el-button :loading="printLoading" type="primary" @click="submitDelete">{{ deleteTilte == '撤销' ? '确 定' : '通
              过'}}</el-button>
            <el-button :loading="printLoading" type="primary" @click="submitDelete">{{ deleteTilte == '撤销' ? '确 定' : '通过'}}</el-button>
          </el-row>
        </span>
      </el-dialog>
@@ -303,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";
@@ -316,8 +314,9 @@
} from "@/api/business/productOrder";
import { selectUserCondition } from "@/api/performance/class";
import { downFile, getFileList, selectSampleAndProductByOrderId } from "@/api/business/rawMaterialOrder";
// import Inspection from "../do/b1-inspect-order-plan/Inspection.vue";
import {mapGetters} from "vuex";
export default {
  name: 'ProductOrder',
  components: {
    limsTable,
    AddInspectionDia,
@@ -542,6 +541,7 @@
      quashDialogVisible: false,
      issuedDialogVisible: false,
      dataDialogVisible: false, // 数据查看弹框
      currentRow: {}, // 数据查看弹框
      tableDataLookTableLoading: false, // 数据查看弹框
      tableDataLook: [],
      tableDataLookPage: {
@@ -684,7 +684,7 @@
          label: '待审核',
          value: 0
        }, {
          label: '待检验',
          label: '检验中',
          value: 1
        },
        {
@@ -736,9 +736,15 @@
      }
    }
  },
  computed: {
    ...mapGetters(["nickName"]),
  },
  mounted() {
    this.refreshTable()
    this.getAuthorizedPerson()
  },
  activated() {
    this.refreshTable()
  },
  methods: {
    // 查询列表数据
@@ -754,7 +760,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) {
@@ -868,9 +874,10 @@
    },
    // 导出记录
    downLoad() {
      rawAllInsOrderExport({ ...this.entity }).then(res => {
        let url = this.javaApi + '/word/' + res.data
        this.$download.saveAs(url, '委托检测信息导出.xlsx');
      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 => {
        console.log('err---', err);
      })
@@ -933,12 +940,13 @@
    // 数据查看
    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
@@ -950,7 +958,15 @@
    },
    tableDataLookPagination(page) {
      this.tableDataLookPage.size = page.limit
      this.getDataTableList()
      this.getDataTableList(this.currentRow)
    },
    closeDia () {
      this.tableDataLookPage = {
        total: 0,
        size: 10,
        current: 1
      }
      this.dataDialogVisible = false
    },
    // 附件查看
    handleFileLook(row) {
@@ -978,25 +994,16 @@
      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 => {
      })
    },
    // 下载报告
    download(row) {
      let url = this.javaApi + '/word/' + row.urlS ? row.urlS : row.url;
      let url = row.urlS ? row.urlS : row.url;
      if (url) {
        this.$download.saveAs(url, this.downLoadInfo.fileName);
        this.$download.saveAs(url, row.entrustCode);
      }
    },
    // 撤销
@@ -1123,10 +1130,6 @@
        userId: this.distributeData.userId,
        sonLaboratory: this.distributeData.sonLaboratory,
      }).then(res => {
        if (res.code === 201) {
          this.upLoad = false
          return
        }
        this.$message.success('修改成功')
        this.upLoad = false
        this.issuedDialogVisible = false
@@ -1172,7 +1175,7 @@
    handleVerify(row) {
      this.$router.push({ path: "/productOrder/add", query: { examine: 1, active: 3, currentId: row.id } });
    },
    handleTab(m, i) {
    handleTab(i) {
      this.tabIndex = i;
      this.refreshTable()
    },
@@ -1183,15 +1186,17 @@
      if (row.userName) {
        inspectorList = row.userName.split(',')
      }
      let user = JSON.parse(localStorage.getItem('user'))
      if (user) {
        inspectorList.push(user.name)
      }
      this.inspectorList = inspectorList
      this.sonLaboratory = row.sonLaboratory
      this.state = 3;
      this.typeSource = row.typeSource
      this.orderId = row.id
      inspectorList.push(this.nickName)
      this.$router.push({
        path: "/inspectionTask/inspection",
        query: {
          sonLaboratory: row.sonLaboratory,
          state: 3,
          typeSource: row.typeSource,
          orderId: row.id,
          inspectorList: inspectorList,
        },
      })
    },
    goback() {
      this.state = 0