Crunchy
2025-04-29 e5454b769d44a34af423bf87ac8a740bf8c20341
src/views/business/rawMaterialInspection/index.vue
@@ -25,8 +25,8 @@
          <el-form-item>
            <el-button v-if="tabIndex === 3 || tabIndex === 4" :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" icon="el-icon-search" type="primary" @click="refreshTable()">查 询</el-button>
            <el-button size="mini" @click="refresh()" icon="el-icon-refresh">重 置</el-button>
            <el-button size="mini" type="primary" @click="refreshTable()">查询</el-button>
            <el-button size="mini" @click="refresh()" >重置</el-button>
          </el-form-item>
        </el-row>
        <el-row>
@@ -38,7 +38,7 @@
          </el-form-item>
          <el-form-item label="下发时间" prop="date" v-if="(tabIndex === 3 || tabIndex === 4) && more">
            <el-date-picker v-model="componentData.date" end-placeholder="结束日期" format="yyyy-MM-dd" placeholder="选择日期"
              range-separator="至" size="small" start-placeholder="开始日期" style="width: 100%;" type="daterange"
              range-separator="至" size="small" start-placeholder="开始日期" style="width: 100%;" type="daterange" @change="refreshTable()"
              value-format="yyyy-MM-dd">
            </el-date-picker>
          </el-form-item>
@@ -54,8 +54,10 @@
      <div class="table-tab">
        <div>
          <ul class="tab">
            <li v-for="m in tabList" :key="m.value" :class="{ active: m.value === tabIndex }" @click="handleTab(m)">
              {{ m.label }}</li>
            <li :class="{ active: tabIndex === 0 }" @click="handleTab(0)">待报检</li>
            <li :class="{ active: tabIndex === 1 }" @click="handleTab(1)">待下单</li>
            <li :class="{ active: tabIndex === 3 }" @click="handleTab(3)">已完成</li>
            <li :class="{ active: tabIndex === 4 }" v-if="checkPermi(['get:Ifs:ByAll'])" @click="handleTab(4)">全部</li>
          </ul>
        </div>
        <div>
@@ -92,7 +94,7 @@
    </el-dialog>
    <!-- 确认报检 -->
    <el-dialog :close-on-click-modal="false" :title="declareType === 'add' ? '新增报检信息' : '原材料报检'"
      :visible.sync="declareDialogVisible" width="800px" @close="resetForm">
      :visible.sync="declareDialogVisible" width="800px" @close="resetFormData">
      <el-form ref="declareObj" :inline="true" :model="declareObj" :rules="declareObjRules" label-width="130px"
        label-position="right">
        <el-form-item class="declareObj-form-item" label="订单号:" prop="orderNo">
@@ -142,7 +144,7 @@
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-row>
          <el-button @click="resetForm">取 消</el-button>
          <el-button @click="resetFormData">取 消</el-button>
          <el-button :loading="submitDeclareLoading" type="primary" @click="submitDeclare">确 定</el-button>
        </el-row>
      </span>
@@ -189,6 +191,7 @@
import limsTable from "@/components/Table/lims-table.vue";
export default {
  name: 'RawMaterialInspection',
  // import 引入的组件需要注入到对象中才能使用
  components: { limsTable, DataLookVisible },
  data() {
@@ -262,6 +265,7 @@
        { label: '报检时间', prop: 'declareDate' },
        {
          dataType: 'action',
          fixed: 'right',
          label: '操作',
          operation: [
            {
@@ -299,13 +303,12 @@
      ],
      page: {
        total: 0,
        size: 10,
        size: 20,
        current: 1
      },
      tableData1: [],
      tableLoading1: false,
      column1: [
        { label: '委托编号', prop: 'entrustCode', width: '160px' },
        {
          dataType: 'tag',
          label: '检验状态',
@@ -343,13 +346,32 @@
        },
        { label: '订单号', prop: 'orderNo' },
        { label: '抵达的采购数量', prop: 'qtyArrived' },
        { label: '下发时间', prop: 'sendTime' },
        { label: '报检时间', prop: 'declareDate' },
        { label: '批号', prop: 'updateBatchNo' },
        { label: '零件号', prop: 'partNo' },
        { label: '零件描述', prop: 'partDesc' },
        { label: '供应商名称', prop: 'supplierName' },
        { label: '不合格描述', prop: 'unqualifiedDesc' },
        { label: '免检', prop: 'isExemption' },
        {
          dataType: 'tag',
          label: '免检',
          prop: 'isExemption',
          formatData: (params) => {
            if (params == 1) {
              return '免检'
            } else {
              return null
            }
          },
          formatType: (params) => {
            if (params == 1) {
              return 'success'
            } else {
              return null
            }
          }
        },
        { label: '委托编号', prop: 'entrustCode', width: '160px' },
        { label: '样品名称', prop: 'sampleName' },
        { label: '样品型号', prop: 'sampleModel' },
        { label: '检验人', prop: 'userName' },
@@ -374,7 +396,7 @@
        },
        { label: '单位', prop: 'buyUnitMeas' },
        { label: '接收时间', prop: 'receiverDate' },
        { label: '报检时间', prop: 'declareDate' },
        { label: '下发时间', prop: 'sendTime' },
        {
          dataType: 'action',
          fixed: 'right',
@@ -421,7 +443,7 @@
      ],
      page1: {
        total: 0,
        size: 10,
        size: 20,
        current: 1
      },
      more: false,
@@ -444,7 +466,7 @@
        partNo: null,
        partDesc: null,
        supplierName: null,
        date: '',
        date: null,
        entrustCode: '',
        inspectStatus: '',
      },
@@ -525,7 +547,7 @@
  methods: {
    // 切换tab表格
    handleTab(m) {
      this.tabIndex = m.value;
      this.tabIndex = m;
      this.refreshTable()
    },
    // 查询回调
@@ -558,6 +580,13 @@
    // 已完成部查询
    getIfsByFinishList() {
      this.tableLoading1 = true
      if(null != this.componentData.date){
        this.componentData.beginDeclareDate = this.componentData.date[0]
        this.componentData.endDeclareDate = this.componentData.date[1]
      } else {
        this.componentData.beginDeclareDate = ''
        this.componentData.endDeclareDate = ''
      }
      getIfsByFinish({ ...this.componentData, ...this.page1 }).then(res => {
        this.tableLoading1 = false
        if (res.code === 200) {
@@ -571,6 +600,13 @@
    // 全部查询
    getIfsByAllList() {
      this.tableLoading1 = true
      if(null != this.componentData.date){
        this.componentData.beginDeclareDate = this.componentData.date[0]
        this.componentData.endDeclareDate = this.componentData.date[1]
      } else {
        this.componentData.beginDeclareDate = ''
        this.componentData.endDeclareDate = ''
      }
      getIfsByAll({ ...this.componentData, ...this.page1 }).then(res => {
        this.tableLoading1 = false
        if (res.code === 200) {
@@ -746,7 +782,7 @@
        });
      }
    },
    resetForm() {
    resetFormData() {
      this.$refs['declareObj'].resetFields();
      this.declareDialogVisible = false
    },
@@ -776,6 +812,7 @@
    openIFS() {
      this.btnLoading = true
      getIfsOrder().then(res => {
        this.resetForm('componentData')
        this.refreshTable()
        this.btnLoading = false
      }).catch(err => {
@@ -785,11 +822,9 @@
    },
    // 全部导出
    handleDown() {
      let entity = { ...this.componentData }
      delete entity.orderBy
      this.outLoading = true
      rawAllExport({
        entity: entity
        ...this.componentData
      }).then(res => {
        this.outLoading = false
        const blob = new Blob([res], { type: 'application/octet-stream' });