spring
2025-04-11 9508c11a63737b4b9e80e1223792f07d3151c2e8
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,17 +30,29 @@
            @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="mini" type="primary" @click="refreshTable()">查询</el-button>
          <el-button size="mini" @click="refresh()">重置</el-button>
        </el-form-item>
      </el-form>
    </div>
    <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 === 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>
@@ -91,8 +92,8 @@
      </el-dialog>
      <!-- 撤销 -->
      <el-dialog :before-close="handleClose" :visible.sync="quashDialogVisible" title="下单撤销" width="30%">
        <p v-if="!isQuash" style="font-size:16px;color:#333333">委托编号<span
            style="color:#34BD66">{{ this.insOrderRow.entrustCode }}</span>的信息是否撤销</p>
        <p v-if="!isQuash" style="font-size:16px;color:#333333">委托编号<span style="color:#34BD66">{{
          this.insOrderRow.entrustCode }}</span>的信息是否撤销</p>
        <el-form v-else ref="ruleForm" :label-position="labelPosition" :model="formData" label-width="150px">
          <el-form-item label="请输入撤销原因:">
            <el-input v-model="formData.specificationModel" size="small" style="width:60%"></el-input>
@@ -110,7 +111,7 @@
        </span>
      </el-dialog>
      <!-- 下发 -->
      <el-dialog :before-close="handleClose" :visible.sync="issuedDialogVisible" title="检验分配" width="400px">
      <!-- <el-dialog :before-close="handleClose" :visible.sync="issuedDialogVisible" title="检验分配" width="400px">
        <div class="body" style="max-height: 60vh;">
          <el-row>
            <el-col class="search_thing" style="width: 95%;">
@@ -150,8 +151,8 @@
            <el-button :loading="upLoad" type="primary" @click="submitForm2">确 定</el-button>
          </el-row>
        </span>
      </el-dialog>
      <el-dialog :visible.sync="dataDialogVisible" title="数据查看" width="80%">
      </el-dialog> -->
      <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"
@@ -173,7 +174,8 @@
        <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>
@@ -268,8 +270,8 @@
              <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"
                      class="scor"></span>待检
                  <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>
@@ -298,6 +300,7 @@
      @closePrintDialog="closePrintDialog"></print-dialog>
    <!--添加遗漏检验项弹框-->
    <add-inspection-dia v-if="addInspectionDia" ref="addInspectionDia"></add-inspection-dia>
    <issuedDialog ref="issuedDialog" />
    <!--    <Inspection v-if="state>0" :key="InspectionKey" :inspectorList="inspectorList" :orderId="orderId"-->
    <!--                :sonLaboratory="sonLaboratory" :state="state"-->
    <!--                :typeSource="typeSource" @goback="goback" @refreshView="refreshView"/>-->
@@ -307,10 +310,10 @@
<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";
import issuedDialog from './components/issuedDialog.vue'
import {
  checkUpdate, delInsOrder,
  rawAllInsOrderExport,
@@ -320,14 +323,15 @@
} from "@/api/business/productOrder";
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";
import { mapGetters } from "vuex";
export default {
  name: 'ProductOrder',
  components: {
    limsTable,
    AddInspectionDia,
    PrintDialog,
    vueQr
    vueQr,
    issuedDialog
  },
  data() {
    return {
@@ -339,9 +343,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' },
@@ -492,7 +508,7 @@
                this.handleIssued(row);
              },
              disabled: (row, index) => {
                return row.state != 1 || !!row.assign
                return row.state != 1
              },
              showHide: (row) => {
                return this.tabIndex === 1
@@ -523,7 +539,7 @@
      ],
      page: {
        total: 0,
        size: 10,
        size: 20,
        current: 1
      },
      state: 0,// 0:台账页,1:检验页面,2检验页面(复核),默认为0,3数据查看
@@ -547,11 +563,12 @@
      quashDialogVisible: false,
      issuedDialogVisible: false,
      dataDialogVisible: false, // 数据查看弹框
      currentRow: {}, // 数据查看弹框
      tableDataLookTableLoading: false, // 数据查看弹框
      tableDataLook: [],
      tableDataLookPage: {
        total: 0,
        size: 10,
        size: 20,
        current: 1
      },
      tableDataLookColumn: [
@@ -562,7 +579,7 @@
        { label: '检验子项', prop: 'inspectionItemSubclass' },
        { label: '单位', prop: 'unit' },
        { label: '样品型号', prop: 'model' },
        { label: '条件', prop: 'radius' },
        { label: '试验条件', prop: 'radius' },
        { label: '电缆标识', prop: 'cableTag' },
        { label: '试验要求', prop: 'tell' },
        { label: '检验结果', prop: 'lastValue' },
@@ -593,6 +610,7 @@
            }
          }
        },
        { label: "检验人", prop: "checkUserName" },
      ],
      filesDialogVisible: false, // 附件查看弹框
      tableDataFile: [],
@@ -642,7 +660,7 @@
      ],
      pageFile: {
        total: 0,
        size: 10,
        size: 20,
        current: 1
      },
      formData: {},
@@ -659,7 +677,7 @@
      entrustCodeInfo: {},
      submitCodeLoading: false,
      // 人员列表
      personList: [],
      // personList: [],
      orderId: '',
      revocationInsProductIds: '',
      componentDataDelete: [],
@@ -679,7 +697,7 @@
      ],
      pageDelete: {
        total: 0,
        size: 10,
        size: 20,
        current: 1
      },
      deleteDialogVisible: false,
@@ -746,7 +764,10 @@
  },
  mounted() {
    this.refreshTable()
    this.getAuthorizedPerson()
    // this.getAuthorizedPerson()
  },
  activated() {
    this.refreshTable()
  },
  methods: {
    // 查询列表数据
@@ -762,7 +783,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 +804,9 @@
    },
    // 打开修改委托编号弹框
    changeEntrustCode(row) {
      if (this.tabIndex !== 1) {
        return
      }
      this.entrustCodeVisible = true
      this.entrustCodeInfo = { ...row }
    },
@@ -876,7 +900,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 => {
@@ -900,18 +925,18 @@
      this.printDialog = false
    },
    // 获取指派人员下拉列表
    getAuthorizedPerson() {
      selectUserCondition({ type: 1 }).then(res => {
        let data = []
        res.data.forEach(a => {
          data.push({
            label: a.name,
            value: a.id
          })
        })
        this.personList = data
      })
    },
    // getAuthorizedPerson() {
    //   selectUserCondition({ type: 1 }).then(res => {
    //     let data = []
    //     res.data.forEach(a => {
    //       data.push({
    //         label: a.name,
    //         value: a.id
    //       })
    //     })
    //     this.personList = data
    //   })
    // },
    handleClose() {
      this.verifyDialogVisible = false;
      this.quashDialogVisible = false;
@@ -928,25 +953,25 @@
    },
    // 详情
    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,
          tabIndex: this.tabIndex,
        }
      });
    },
    // 数据查看
    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 +983,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) {
@@ -986,7 +1019,7 @@
      downFile({
        id: row.id,
      }).then(res => {
        this.$download.downloadFileFromUrl(res.data.fileUrl, row.fileName);
        this.$download.saveAs(res.data.fileUrl, row.fileName);
      }).catch(error => {
      })
@@ -995,7 +1028,12 @@
    download(row) {
      let url = row.urlS ? row.urlS : row.url;
      if (url) {
        this.$download.downloadFileFromUrl(url, this.downLoadInfo.fileName);
        url = url.split('.')[0] + '.pdf'
        const link = document.createElement('a');
        link.href = this.javaApi + url;
        link.target = '_blank';
        document.body.appendChild(link);
        link.click();
      }
    },
    // 撤销
@@ -1013,7 +1051,7 @@
    },
    getDeleteList() {
      this.tableLoadingDelete = true
      selectNoProducts({ orderId: this.orderId, revocationInsProductIds: this.revocationInsProductIds }).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
@@ -1077,28 +1115,29 @@
    },
    // 下发
    handleIssued(row) {
      this.issuedDialogVisible = true;
      selectOrderManDay({
        id: row.id
      }).then(res => {
        this.distributeData.orderId = row.id
        this.distributeData.sampleId = row.sampleId
        this.distributeData.appointed = res.data
        this.distributeData.type = row.type
      })
      upPlanUser2({
        orderId: row.id,
      }).then(res => {
        if (res.code === 200 && res.data.length > 0) {
          this.sonLaboratoryList = [];
          res.data.forEach(m => {
            this.sonLaboratoryList.push({
              value: m,
              label: m
            })
          })
        }
      })
      // this.issuedDialogVisible = true;
      this.$refs.issuedDialog.init(row)
      // selectOrderManDay({
      //   id: row.id
      // }).then(res => {
      //   this.distributeData.orderId = row.id
      //   this.distributeData.sampleId = row.sampleId
      //   this.distributeData.appointed = res.data
      //   this.distributeData.type = row.type
      // })
      // upPlanUser2({
      //   orderId: row.id,
      // }).then(res => {
      //   if (res.code === 200 && res.data.length > 0) {
      //     this.sonLaboratoryList = [];
      //     res.data.forEach(m => {
      //       this.sonLaboratoryList.push({
      //         value: m,
      //         label: m
      //       })
      //     })
      //   }
      // })
    },
    submitForm2() {
      if (this.distributeData.appointed == null || this.distributeData.appointed == '') {
@@ -1122,10 +1161,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