zouyu
2026-05-07 b0d4df5f39525ae7fe252e8ee65d85fd71dca721
手动下单:检验中订单撤销报错问题修复
已修改2个文件
126 ■■■■■ 文件已修改
src/components/Table/lims-table.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/productOrder/index.vue 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Table/lims-table.vue
@@ -39,7 +39,7 @@
          <div v-else-if="item.dataType == 'tag'">
            <el-tag v-if="
              typeof dataTypeFn(scope.row[item.prop], item.formatData) ==
              'string'
              'string' && item.formatType!=null
            " :title="scope.row[item.prop] | formatters(item.formatData)"
              :type="formatType(scope.row[item.prop], item.formatType)">{{ scope.row[item.prop] |
                formatters(item.formatData) }}</el-tag>
@@ -48,7 +48,7 @@
              item.formatData
            )" v-else-if="
              typeof dataTypeFn(scope.row[item.prop], item.formatData) ==
              'object'
              'object' && item.formatType!=null
            " :key="index" :title="scope.row[item.prop] | formatters(item.formatData)"
              :type="formatType(tag, item.formatType)">{{
                item.tagGroup
@@ -57,9 +57,10 @@
                    : tag
                  : tag
              }}</el-tag>
            <el-tag v-else :title="scope.row[item.prop] | formatters(item.formatData)"
            <el-tag v-else-if="item.formatType!=null" :title="scope.row[item.prop] | formatters(item.formatData)"
              :type="formatType(scope.row[item.prop], item.formatType)">{{ scope.row[item.prop] |
                formatters(item.formatData) }}</el-tag>
            <span v-else>{{item.formatData}}</span>
          </div>
          <!-- 按钮 -->
src/views/business/productOrder/index.vue
@@ -33,7 +33,8 @@
        </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>
                     @click="more = !more">{{ !more ? '更多' : '收起' }}
          </el-button>
          <el-button size="mini" type="primary" @click="refreshTable()">查询</el-button>
          <el-button size="mini" @click="refresh()">重置</el-button>
        </el-form-item>
@@ -43,21 +44,36 @@
      <div class="table-tab">
        <div>
          <ul class="tab">
            <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>
            <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>
          <el-button v-if="tabIndex === 2 || tabIndex === 3 || tabIndex === 6" size="small"
                     @click="downLoad">导出</el-button>
                     @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 v-if="checkPermi(['add:insOrder'])" 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">
@@ -114,7 +130,8 @@
            <el-col class="search_thing" style="width: 95%;">
              <div class="search_label"><span class="required-span">* </span>约定时间:</div>
              <div class="search_input">
                <el-date-picker v-model="distributeData.appointed" format="yyyy-MM-dd" placeholder="选择日期" size="small"
                <el-date-picker v-model="distributeData.appointed" format="yyyy-MM-dd" placeholder="选择日期"
                                size="small"
                  style="width: 100%;" type="date" value-format="yyyy-MM-dd">
                </el-date-picker>
              </div>
@@ -152,26 +169,35 @@
      <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"
                      :height="100" key="tableDataLook" :page="tableDataLookPage"
            :tableLoading="tableDataLookTableLoading"></lims-table>
        </div>
      </el-dialog>
      <el-dialog :visible.sync="filesDialogVisible" title="附件查看" width="80%">
        <div v-if="filesDialogVisible">
          <lims-table :tableData="tableDataFile" :column="columnFile" @pagination="paginationFile" height="500px"
          <lims-table :tableData="tableDataFile" :column="columnFile" @pagination="paginationFile" :height="100"
            key="tableDataFile" :page="pageFile" :tableLoading="tableLoadingFile"></lims-table>
        </div>
      </el-dialog>
      <!--      撤销&撤销审核-->
      <el-dialog :title="deleteTilte" :visible.sync="deleteDialogVisible" width="80%">
        <div v-if="deleteDialogVisible" style="height: 70vh;overflow-y: auto;">
          <lims-table :tableData="componentDataDelete" :column="columnDelete" :isSelection="true"
            :handleSelectionChange="selectDelete" @pagination="paginationDelete" height="500px"
            key="componentDataDelete" :page="pageDelete" :tableLoading="tableLoadingDelete"></lims-table>
        </div>
        <lims-table
          v-if="deleteDialogVisible"
          :tableData="componentDataDelete"
          :column="columnDelete"
          :isSelection="deleteTilte==='撤销'"
          :handleSelectionChange="selectDelete"
          @pagination="paginationDelete"
          :height="150"
          key="componentDataDelete"
          :page="pageDelete"
          :tableLoading="tableLoadingDelete">
        </lims-table>
        <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>
@@ -180,7 +206,8 @@
      <div v-loading="loadPint" style="width:100%;height: 400px;overflow-y: auto;">
        <div class="dia_body">
          <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" style="margin: 10px 5px;"
            @change="handleCheckAllChange">全选</el-checkbox>
                       @change="handleCheckAllChange">全选
          </el-checkbox>
          <el-checkbox-group v-model="checkIndexList" @change="changePrintCode()">
            <el-card v-for="(item, i) in qrData" :key="i + 'wwwww'" class="box-card"
              style="margin-bottom: 15px; font-size: 16px !important;">
@@ -197,8 +224,10 @@
                  </div>
                  <div style="margin-left: 50px;width: 100%;">
                    <el-row>
                      <el-col style="font-weight: bold;font-size: 14px;"><span>样品编号:&nbsp; </span>{{ item.sampleCode
                        }}</el-col>
                      <el-col style="font-weight: bold;font-size: 14px;"><span>样品编号:&nbsp; </span>{{
                          item.sampleCode
                        }}
                      </el-col>
                    </el-row>
                    <el-row style="margin-top: 1px;font-size: 14px;">
                      <el-col style="font-weight: bold;"><span>委托单号:&nbsp; </span>{{ item.code }}</el-col>
@@ -218,8 +247,11 @@
                          <el-radio :label="0" style="font-weight: bold;margin-right: 7px;">待检</el-radio>
                          <el-radio :label="1" style="font-weight: bold;margin-right: 7px;">在检</el-radio>
                          <el-radio :label="2" style="font-weight: bold;margin-right: 7px;">已检</el-radio>
                        </el-radio-group><el-radio v-model="item.isLeave" :label="1" disabled
                          style="font-weight: bold;margin-top: 7px;">留样</el-radio></el-col>
                        </el-radio-group>
                        <el-radio v-model="item.isLeave" :label="1" disabled
                                  style="font-weight: bold;margin-top: 7px;">留样
                        </el-radio>
                      </el-col>
                    </el-row>
                  </div>
                </div>
@@ -249,7 +281,9 @@
            <div style="margin-left: 0.32cm;line-height: 0.22cm;">
              <el-row>
                <el-col class="single-line-ellipsis" style="font-size: 0.20cm;width: 4cm;"><span>样品编号:&nbsp; </span>{{
                  item.sampleCode }}</el-col>
                    item.sampleCode
                  }}
                </el-col>
              </el-row>
              <el-row style="font-size: 0.20cm;">
                <el-col><span>委托单号:&nbsp; </span>{{ item.code }}</el-col>
@@ -266,11 +300,13 @@
              <el-row style="margin-top: 0.01cm;font-size: 0.20cm;">
                <el-col style="display: flex;align-items: center;"><span>样品状态:&nbsp;
                  </span>
                  <span style="white-space: nowrap;"><span v-if="item.insState == 0">√</span><span v-if="item.insState != 0"
                  <span style="white-space: nowrap;"><span v-if="item.insState == 0">√</span><span
                    v-if="item.insState != 0"
                      class="scor"></span>待检
                    <span v-if="item.insState == 1">√</span><span v-if="item.insState != 1" class="scor"></span>在检
                    <span v-if="item.insState == 2">√</span><span v-if="item.insState != 2" class="scor"></span>已检
                    <span v-if="item.isLeave == 1">√</span><span v-if="item.isLeave != 1" class="scor"></span>留样</span>
                    <span v-if="item.isLeave == 1">√</span><span v-if="item.isLeave != 1"
                                                                 class="scor"></span>留样</span>
                  <!-- <el-radio-group :value="item.insState" style="margin-top: 3px;margin-left: 1px;" disabled>
                  <el-radio :label="0" style="margin-right: 3px;font-size: 6px;">待检</el-radio>
                  <el-radio :label="1" style="margin-right: 3px;font-size: 6px;">在检</el-radio>
@@ -337,6 +373,7 @@
import { selectUserCondition } from "@/api/performance/class";
import { downFile, getFileList, selectSampleAndProductByOrderId } from "@/api/business/rawMaterialOrder";
import {mapGetters} from "vuex";
export default {
  name: 'ProductOrder',
  components: {
@@ -501,10 +538,10 @@
                this.handlEquash(row);
              },
              disabled: (row, index) => {
                return row.state != 1 && row.state != 0
                return (row.state !== 1 && row.state !== 0) || row.isRevocation !== 0
              },
              showHide: (row) => {
                return this.tabIndex === 0 || this.tabIndex === 1
                return (this.tabIndex === 0 || this.tabIndex === 1)
              }
            },
            {
@@ -514,7 +551,7 @@
                this.handlEquashCheck(row);
              },
              disabled: (row, index) => {
                return (row.state != 1 && row.state != 0) || (this.tabIndex != 1) || row.isRevocation != 1
                return (row.state !== 1 && row.state !== 0) || (this.tabIndex !== 1) || row.isRevocation !== 1
              },
              showHide: (row) => {
                return this.tabIndex === 1
@@ -1108,7 +1145,7 @@
    },
    // 撤销
    handlEquash(row) {
      if (this.tabIndex != 1) {
      if (this.tabIndex !== 1) {
        this.quashDialogVisible = true;
        this.insOrderRow = row
      } else {
@@ -1121,7 +1158,11 @@
    },
    getDeleteList() {
      this.tableLoadingDelete = true
      selectNoProducts({ orderId: this.orderId, revocationInsProductIds: this.revocationInsProductIds, ...this.pageDelete }).then(res => {
      selectNoProducts({
        orderId: this.orderId,
        revocationInsProductIds: this.revocationInsProductIds,
        ...this.pageDelete
      }).then(res => {
        this.tableLoadingDelete = false
        this.componentDataDelete = res.data.records
        this.pageDelete.total = res.data.total
@@ -1137,12 +1178,12 @@
      this.deleteList = arr;
    },
    submitDelete() {
      if (this.deleteTilte == '撤销') {
        if (this.deleteList.length == 0) {
          this.$message.error('请选择要撤销的项')
      if (this.deleteTilte === '撤销') {
        if (this.deleteList.length === 0) {
          this.$message.error('请选择要撤销的检验项')
          return
        }
        let ids = this.deleteList.map(m => m.id).join(',')
        let ids = this.deleteList.map(m => m.id)
        this.printLoading = true;
        updateInspected({ ids: ids, orderId: this.orderId }).then(res => {
          if (res.code === 200) {
@@ -1167,7 +1208,10 @@
      this.orderId = row.id
      this.revocationInsProductIds = row.revocationInsProductIds
      this.deleteTilte = '撤销审核'
      this.getDeleteList()
      this.$nextTick(() => {
      this.deleteDialogVisible = true;
      })
    },
    handleNo() {
      if (this.deleteTilte == '撤销') {
@@ -1337,7 +1381,8 @@
        }).catch(e => {
          this.$message.error('删除失败')
        })
      }).catch(() => { })
      }).catch(() => {
      })
    }
  }
}