spring
2025-11-19 af4f45eaa2703ecf991bd10f07f6df179f2677d9
src/pages/production/index.vue
@@ -2,7 +2,14 @@
  <view>
    <wd-row>
      <wd-col :span="21">
        <wd-search placeholder-left hide-cancel></wd-search>
        <wd-search
          v-model="searchKeyword"
          placeholder="请输入规格型号"
          placeholder-left
          hide-cancel
          @search="handleSearch"
          @clear="handleClear"
        ></wd-search>
      </wd-col>
      <wd-col :span="3">
        <view class="scan_box" @click="openScan">
@@ -14,16 +21,30 @@
      <wd-tab :title="`待生产(${total.wait})`" class="tab_bg">
        <ProductList
          ref="waitRef"
          :key="`wait-${searchKey}`"
          :api="ManageApi.getProductList"
          state="待完成"
          :model="searchKeyword"
          @ok="changeWait"
        />
      </wd-tab>
      <wd-tab :title="`部分完成(${total.partial})`" class="tab_bg">
        <ProductList
          ref="partialRef"
          :key="`partial-${searchKey}`"
          :api="ManageApi.getProductList"
          state="部分完成"
          :model="searchKeyword"
          @ok="changePartial"
        />
      </wd-tab>
      <wd-tab :title="`已生产(${total.already})`" class="tab_bg">
        <ProductList
          ref="alreadyRef"
          :key="`already-${searchKey}`"
          :api="ManageApi.getProductList"
          state="已完成"
          :model="searchKeyword"
          @ok="changeAlready"
        />
      </wd-tab>
@@ -48,10 +69,14 @@
const toast = useToast();
const waitRef = ref();
const partialRef = ref();
const alreadyRef = ref();
const tab = ref<number>(0);
const searchKeyword = ref("");
const searchKey = ref(0);
const total = reactive({
  wait: 0,
  partial: 0,
  already: 0,
});
@@ -59,10 +84,23 @@
  total.wait = num;
};
const changePartial = (num: number) => {
  total.partial = num;
};
const changeAlready = (num: number) => {
  total.already = num;
};
const handleSearch = () => {
  searchKey.value++;
};
const handleClear = () => {
  searchKeyword.value = "";
  handleSearch();
};
const openScan = () => {
  scanRef.value.triggerScan();
};