liding
2025-04-09 efdd02d3d80253bf93f1c58e3ae25016db2d6b31
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">
@@ -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,6 +148,17 @@
            <el-option :value="1" label="过期物料"></el-option>
          </el-select>
        </el-form-item>
        <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">
        <el-row>
@@ -169,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"
@@ -235,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' },
@@ -266,6 +303,7 @@
        {
          dataType: 'action',
          label: '操作',
          fixed: 'right',
          operation: [
            {
              name: '报检',
@@ -287,16 +325,16 @@
                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
            //   },
            // },
          ]
        }
      ],
@@ -459,6 +497,8 @@
        receiverDate: '', // 接收时间
        buyUnitMeas: '', // 单位
        isExpire: '', // 单位
        supplierNumber: '', // 供应商批号
        inspectionType: '', // 报检类型
      },
      componentData: { // 表格数据
        updateBatchNo: null,
@@ -504,6 +544,9 @@
        buyUnitMeas: [
          { required: false, message: '请填写单位', trigger: 'blur' }
        ],
        inspectionType: [
          { required: true, message: '请填写报检类型', trigger: 'change' }
        ],
      },
      tabList: [
        {
@@ -536,7 +579,8 @@
        { label: '未下单', value: 3 },
        { label: '让步放行', value: 4 },
      ],
      outLoading: false
      outLoading: false,
      ifsDialogVisible: false, // 添加 IFS 选择弹框显示控制
    }
  },
  mounted() {
@@ -676,7 +720,7 @@
    },
    // 提前入库
    advancedGodown(row) {
      this.$confirm('当前原辅料是否提前入库?', '提示', {
      this.$confirm('当前原辅材是否提前入库?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
@@ -809,8 +853,13 @@
    },
    // 获取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
@@ -829,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() {
@@ -846,6 +895,8 @@
        receiverDate: '', // 接收时间
        buyUnitMeas: '', // 单位
        isExpire: '', // 单位
        supplierNumber: '', // 供应商批号
        inspectionType: '', // 报检类型
      }
    }
  },