src/views/business/productOrder/index.vue
@@ -45,7 +45,7 @@
          <ul class="tab">
            <li :class="{ active: tabIndex === 7 }" v-if="checkPermi(['get:insOrder:all'])" @click="handleTab(7)">全部</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 === 2 }" v-if="checkPermi(['get:insOrder:customerOrdered'])" @click="handleTab(2)">已检</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:revocation'])" @click="handleTab(6)">作废</li>
@@ -288,6 +288,7 @@
} from "@/api/business/productOrder";
import { downFile, getFileList } from "@/api/business/rawMaterialOrder";
import {mapGetters} from "@/utils/store-compat";
import useUserStore from '@/store/modules/user'
export default {
  name: 'ProductOrder',
  components: {
@@ -442,7 +443,7 @@
                this.handleDelete(row);
              },
              showHide: (row) => {
                return this.tabIndex === 4 || this.tabIndex === 5
                return this.checkPermi(['delete:insOrder'])
              }
            },
            {
@@ -573,7 +574,7 @@
          value: 1
        },
        {
          label: '委托已检',
          label: '已检',
          value: 4
        },
        {
@@ -630,25 +631,20 @@
    ...mapGetters(["nickName"]),
  },
  mounted() {
    useUserStore().refreshPermissions().catch(() => {})
    // 免审核后没有待审核页签,默认进入全部
    this.tabIndex = this.checkPermi(['get:insOrder:all']) ? 7 : 1
    this.refreshTable()
  },
  activated() {
    useUserStore().refreshPermissions().catch(() => {})
    this.refreshTable()
  },
  methods: {
    // 查询列表数据
    refreshTable() {
      if (this.tabIndex !== 2 && this.tabIndex !== 3) {
        this.entity.orderType = ''
      } else {
        if (this.tabIndex === 2) {
          this.entity.orderType = 'Customer-ordered test'
        } else {
          this.entity.orderType = '抽检'
        }
      }
      // 已检按报告批准后的订单状态查询,不限制检验类别。
      this.entity.orderType = this.tabIndex === 3 ? '抽检' : ''
      const params = { ...this.entity, state: this.tabList[this.tabIndex].value }
      this.isLoading = true; // 开始加载
      selectInsOrderParameter({...this.page,...params}).then(res => {
@@ -1074,16 +1070,16 @@
      this.InspectionKey++
    },
    handleDelete(row) {
      this.$confirm('是否删除当前数据?', "警告", {
        confirmButtonText: "确定",
      if (!this.checkPermi(['delete:insOrder'])) return
      this.$confirm(`确定永久删除委托单“${row.entrustCode || row.code || row.id}”吗?该委托的样品接收、检验任务、原始记录、报告(含已批准报告)、附件记录及其他关联业务记录将一并删除,删除后无法恢复。`, "删除委托单", {
        confirmButtonText: "确认删除",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        delInsOrder({ insOrderId: row.id }).then(res => {
        return delInsOrder({ insOrderId: row.id }).then(res => {
          this.multipleSelection = this.multipleSelection.filter(item => item.id !== row.id)
          this.$message.success('删除成功')
          this.refreshTable()
        }).catch(e => {
          this.$message.error('删除失败')
        })
      }).catch(() => { })
    }