chenrui
2025-04-10 79c983e7fa924e43f9f2a2a11b6f69c546f051a6
src/views/business/rawMaterialInspection/index.vue
@@ -17,6 +17,13 @@
              @keyup.enter.native="refreshTable">
            </el-input>
          </el-form-item>
          <el-form-item label="报检类型" prop="inspectionType">
            <el-select v-model="componentData.inspectionType" clearable placeholder="请选择" size="small"
              @change="refreshTable" style="width: 100%">
              <el-option label="原辅材" value="原辅材"></el-option>
              <el-option label="包材" value="包材"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="供应商" prop="supplierName" v-if="(tabIndex === 3 || tabIndex === 4)">
            <el-input v-model="componentData.supplierName" clearable placeholder="请输入" size="small"
              @keyup.enter.native="refreshTable">
@@ -25,8 +32,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>
@@ -64,7 +71,7 @@
          <el-button v-show="tabIndex === 4" :loading="outLoading" size="small" type="primary"
            @click="handleDown">导出</el-button>
          <el-button v-if="tabIndex === 0" :loading="btnLoading" size="small" type="primary"
            @click="openIFS">获取IFS订单</el-button>
            @click="openIFS">获取订单</el-button>
          <el-button v-if="tabIndex === 0" size="small" type="primary" @click="declareS">报检</el-button>
          <el-button v-if="tabIndex === 0" size="small" type="primary" @click="addDeclare">新增报检信息</el-button>
        </div>
@@ -93,7 +100,7 @@
      </span>
    </el-dialog>
    <!-- 确认报检 -->
    <el-dialog :close-on-click-modal="false" :title="declareType === 'add' ? '新增报检信息' : '原材料报检'"
    <el-dialog :close-on-click-modal="false" :title="declareType === 'add' ? '新增报检信息' : '原辅材报检'"
      :visible.sync="declareDialogVisible" width="800px" @close="resetFormData">
      <el-form ref="declareObj" :inline="true" :model="declareObj" :rules="declareObjRules" label-width="130px"
        label-position="right">
@@ -141,10 +148,16 @@
            <el-option :value="1" label="过期物料"></el-option>
          </el-select>
        </el-form-item>
        <!-- TODO:必填 -->
        <el-form-item class="declareObj-form-item" label="供应商批号:" prop="buyUnitMeas">
          <el-input v-model="declareObj.buyUnitMeas" :disabled="declareType !== 'add'" clearable class="addObj-info"
        <el-form-item class="declareObj-form-item" label="供应商批号:" prop="supplierNumber">
          <el-input v-model="declareObj.supplierNumber" :disabled="declareType !== 'add'" clearable class="addObj-info"
            size="small"></el-input>
        </el-form-item>
        <el-form-item class="declareObj-form-item" label="报检类型:" prop="inspectionType">
          <el-select v-model="declareObj.inspectionType" :disabled="declareType !== 'add'" clearable class="addObj-info"
            size="small" placeholder="请选择报检类型">
            <el-option label="原辅材" value="原辅材"></el-option>
            <el-option label="包材" value="包材"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
@@ -174,6 +187,15 @@
          <el-button :loading="upLoad" type="primary" @click="submitDeclare1">确 定</el-button>
        </el-row>
      </span>
    </el-dialog>
    <!-- IFS 选择弹框 -->
    <el-dialog title="选择类型" :visible.sync="ifsDialogVisible" width="30%" append-to-body>
      <div style="text-align: center;">
        <el-button type="primary" size="medium" style="margin: 0 10px;"
          @click="handleIfsSelect('原辅材')">获取MES原辅材订单</el-button>
        <el-button type="primary" size="medium" style="margin: 0 10px;"
          @click="handleIfsSelect('包材')">获取MES包材订单</el-button>
      </div>
    </el-dialog>
    <!--数据查看弹框-->
    <data-look-visible v-if="dataDialogVisible" ref="dataDialogVisible" :dataDialogVisible="dataDialogVisible"
@@ -240,6 +262,16 @@
            }
          }
        },
        {
          label: '报检类型', prop: 'inspectionType', dataType: 'tag',
          formatType: (params) => {
            if (params == '原辅材') {
              return 'success'
            } else {
              return 'warning'
            }
          }
        },
        { label: '订单号', prop: 'orderNo' },
        { label: '抵达的采购数量', prop: 'qtyArrived', width: '140px', },
        { label: '批号', prop: 'updateBatchNo' },
@@ -271,6 +303,7 @@
        {
          dataType: 'action',
          label: '操作',
          fixed: 'right',
          operation: [
            {
              name: '报检',
@@ -292,28 +325,27 @@
                return this.tabIndex === 0
              },
            },
            {
              name: '撤销报检',
              type: 'text',
              clickFun: (row) => {
                this.cancelDeclare(row);
              },
              showHide: (row) => {
                return this.tabIndex === 1
              },
            },
            // {
            //   name: '撤销报检',
            //   type: 'text',
            //   clickFun: (row) => {
            //     this.cancelDeclare(row);
            //   },
            //   showHide: (row) => {
            //     return this.tabIndex === 1
            //   },
            // },
          ]
        }
      ],
      page: {
        total: 0,
        size: 10,
        size: 20,
        current: 1
      },
      tableData1: [],
      tableLoading1: false,
      column1: [
        { label: '委托编号', prop: 'entrustCode', width: '160px' },
        {
          dataType: 'tag',
          label: '检验状态',
@@ -351,13 +383,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' },
@@ -382,7 +433,7 @@
        },
        { label: '单位', prop: 'buyUnitMeas' },
        { label: '接收时间', prop: 'receiverDate' },
        { label: '报检时间', prop: 'declareDate' },
        { label: '下发时间', prop: 'sendTime' },
        {
          dataType: 'action',
          fixed: 'right',
@@ -429,7 +480,7 @@
      ],
      page1: {
        total: 0,
        size: 10,
        size: 20,
        current: 1
      },
      more: false,
@@ -446,6 +497,8 @@
        receiverDate: '', // 接收时间
        buyUnitMeas: '', // 单位
        isExpire: '', // 单位
        supplierNumber: '', // 供应商批号
        inspectionType: '', // 报检类型
      },
      componentData: { // 表格数据
        updateBatchNo: null,
@@ -491,6 +544,9 @@
        buyUnitMeas: [
          { required: false, message: '请填写单位', trigger: 'blur' }
        ],
        inspectionType: [
          { required: true, message: '请填写报检类型', trigger: 'change' }
        ],
      },
      tabList: [
        {
@@ -523,7 +579,8 @@
        { label: '未下单', value: 3 },
        { label: '让步放行', value: 4 },
      ],
      outLoading: false
      outLoading: false,
      ifsDialogVisible: false, // 添加 IFS 选择弹框显示控制
    }
  },
  mounted() {
@@ -663,7 +720,7 @@
    },
    // 提前入库
    advancedGodown(row) {
      this.$confirm('当前原材料是否提前入库?', '提示', {
      this.$confirm('当前原辅材是否提前入库?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
@@ -796,8 +853,14 @@
    },
    // 获取IFS按钮回调
    openIFS() {
      this.ifsDialogVisible = true
    },
    // 选择处理方法
    handleIfsSelect(type) {
      this.btnLoading = true
      getIfsOrder().then(res => {
      this.ifsDialogVisible = false
      getIfsOrder({ type: type }).then(res => {
        this.resetForm('componentData')
        this.refreshTable()
        this.btnLoading = false
      }).catch(err => {
@@ -815,7 +878,7 @@
      }).then(res => {
        this.outLoading = false
        const blob = new Blob([res], { type: 'application/octet-stream' });
        this.$download.saveAs(blob, "原材料检测信息导出.xlsx");
        this.$download.saveAs(blob, "原辅材检测信息导出.xlsx");
      })
    },
    clear() {
@@ -832,6 +895,8 @@
        receiverDate: '', // 接收时间
        buyUnitMeas: '', // 单位
        isExpire: '', // 单位
        supplierNumber: '', // 供应商批号
        inspectionType: '', // 报检类型
      }
    }
  },