huminmin
17 小时以前 7d1924d1924e2cafd77ca1ce3b7d5ca9336edb9c
src/views/inventoryManagement/dispatchLog/Record.vue
@@ -12,6 +12,16 @@
               clearable
               @change="handleQuery"
            />
        <span class="search_title ml10">来源:</span>
        <el-select v-model="searchForm.recordType"
                   style="width: 240px"
                   placeholder="请选择"
                   clearable>
          <el-option v-for="item in stockRecordTypeOptions"
                     :key="item.value"
                     :label="item.label"
                     :value="item.value"/>
        </el-select>
            <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
            >搜索</el-button
            >
@@ -19,7 +29,7 @@
         <div>
            <el-button @click="handleOut">导出</el-button>
            <el-button type="danger" plain @click="handleDelete">删除</el-button>
            <el-button type="primary" plain @click="handlePrint">打印</el-button>
            <!-- <el-button type="primary" plain @click="handlePrint">打印</el-button> -->
         </div>
      </div>
      <div class="table_list">
@@ -35,12 +45,30 @@
         >
            <el-table-column align="center" type="selection" width="55" />
            <el-table-column align="center" label="序号" type="index" width="60" />
        <el-table-column
        <!-- <el-table-column
            label="出库批次"
            prop="outboundBatches"
            min-width="100"
            show-overflow-tooltip
        />
        /> -->
        <el-table-column
            label="批号"
            min-width="120"
            show-overflow-tooltip
        >
          <template #default="scope">
            {{ scope.row.batchNo || "" }}
          </template>
        </el-table-column>
        <el-table-column
            label="供应商"
            min-width="160"
            show-overflow-tooltip
        >
          <template #default="scope">
            {{ scope.row.supplierName || scope.row.customer || "" }}
          </template>
        </el-table-column>
            <el-table-column
               label="出库日期"
               prop="createTime"
@@ -56,6 +84,9 @@
               prop="model"
               show-overflow-tooltip
            />
        <el-table-column label="UID码"
                         prop="uidNO"
                         show-overflow-tooltip/>
            <el-table-column
               label="单位"
               prop="unit"
@@ -71,6 +102,13 @@
               prop="createBy"
               show-overflow-tooltip
            />
        <el-table-column label="来源"
                         prop="recordType"
                         show-overflow-tooltip>
          <template #default="scope">
            {{ getRecordType(scope.row.recordType) }}
          </template>
        </el-table-column>
         </el-table>
         <pagination
            v-show="total > 0"
@@ -94,12 +132,17 @@
   getStockOutPage,
   delStockOut,
} from "@/api/inventoryManagement/stockOut.js";
import {
  findAllQualifiedStockOutRecordTypeOptions, findAllUnQualifiedStockOutRecordTypeOptions,
} from "@/api/basicData/enum.js";
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
const tableData = ref([]);
const selectedRows = ref([]);
const tableLoading = ref(false);
// 来源类型选项
const stockRecordTypeOptions = ref([]);
const page = reactive({
   current: 1,
   size: 100,
@@ -123,26 +166,8 @@
   searchForm: {
      supplierName: "",
      timeStr: "",
   },
   form: {
      supplierId: null,
      supplierName: '',
      productId: null,
      productName: '',
      userId: userStore.userId,
      nickName: '',
      model: '',
      productModelId: null,
      unit: '',
      productrecordId: null,
      taxInclusiveUnitPrice: '',
      taxInclusiveTotalPrice: '',
      taxRate: '',
      taxExclusiveTotalPrice: '',
      inboundTime: '',
      inboundBatch: '',
      inboundQuantity: ''
   },
    recordType: "",
   }
});
const { searchForm } = toRefs(data);
@@ -173,6 +198,25 @@
      });
};
const getRecordType = (recordType) => {
  return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
}
// 获取来源类型选项
const fetchStockRecordTypeOptions = () => {
  if (props.type === '0') {
    findAllQualifiedStockOutRecordTypeOptions()
        .then(res => {
          stockRecordTypeOptions.value = res.data;
        })
    return
  }
  findAllUnQualifiedStockOutRecordTypeOptions()
      .then(res => {
        stockRecordTypeOptions.value = res.data;
      })
}
// 表格选择数据
const handleSelectionChange = (selection) => {
   // 过滤掉子数据
@@ -189,7 +233,7 @@
      type: "warning",
   })
      .then(() => {
         proxy.download("/stockmanagement/export", {}, "出库台账.xlsx");
         proxy.download("/stockOutRecord/exportStockOutRecord", {type: props.type}, props.type === '0' ? "合格出库台账.xlsx" : "不合格出库台账.xlsx");
      })
      .catch(() => {
         proxy.$modal.msg("已取消");
@@ -398,8 +442,14 @@
              </div>
            </div>
            <div class="info-row">
              <span class="label">单号:</span>
              <span class="value">${item.code || ''}</span>
              <div>
                <span class="label">批号:</span>
                <span class="value">${item.batchNo || item.outboundBatches || ''}</span>
              </div>
              <div>
                <span class="label">单号:</span>
                <span class="value">${item.code || ''}</span>
              </div>
            </div>
          </div>
@@ -512,6 +562,7 @@
};
onMounted(() => {
   getList();
  fetchStockRecordTypeOptions();
});
</script>