skyouc
2025-08-09 9bb2e38751eda3271844d6b2b27231d0d98ebd6c
zy-asrs-admin/src/components/order/order/orderIn.vue
@@ -14,10 +14,12 @@
  UploadOutlined,
  DownloadOutlined,
} from "@ant-design/icons-vue";
import { filters } from 'pixi.js';
const context = getCurrentInstance()?.appContext.config.globalProperties;
const router = useRouter();
const orderBy = ref({});
const order = ref("")
const props = defineProps({
  ioModel: null
})
@@ -60,6 +62,7 @@
    dataIndex: 'orderTime',
    width: 180,
    ellipsis: true,
    sorter: true,
    ...getColumnSearchProps('orderTime'),
  },
  {
@@ -145,14 +148,26 @@
    state.selectedRowKeys = [];
  }, 1000);
};
const onSelectChange = selectedRowKeys => {
  // console.log('selectedRowKeys changed: ', selectedRowKeys);
  state.selectedRowKeys = selectedRowKeys;
};
const handleTableChange = (pagination, filters, sorter) => {
  if (sorter != null) {
    if (sorter?.order == "ascend") {
      orderBy.__v_raw = { order: "asc", field: sorter.field }
    } else if (sorter?.order == "descend") {
      orderBy.__v_raw = { order: "desc", field: sorter.field }
    }
  }
  getPage()
}
function getPage() {
  state.loading = true;
  let apiUrl = '/api/order/page';
  if (props.ioModel == 'in') {
    apiUrl = '/api/order/in/page';
@@ -161,6 +176,7 @@
  }
  post(apiUrl, {
    orderBy: orderBy?.__v_raw,
    current: currentPage,
    pageSize: pageSize,
    condition: searchInput.value,
@@ -343,13 +359,15 @@
      <div>
        <a-input v-model:value="searchParam.orderNo" :placeholder="formatMessage('page.order.orderNo.input', '请输入订单编号')"
          style="width: 140px;margin-right: 10px;" />
        <a-select v-model:value="searchParam.orderSettle" :placeholder="formatMessage('page.order.orderSettle.select', '请选择单据状态')"
          style="width: 140px;margin-right: 10px;" show-search allowClear :options="orderSettleQueryList" optionFilterProp="label"
          optionLabelProp="label">
        <a-select v-model:value="searchParam.orderSettle"
          :placeholder="formatMessage('page.order.orderSettle.select', '请选择单据状态')"
          style="width: 140px;margin-right: 10px;" show-search allowClear :options="orderSettleQueryList"
          optionFilterProp="label" optionLabelProp="label">
        </a-select>
        <a-select v-model:value="searchParam.orderType" :placeholder="formatMessage('page.order.orderType.select', '请选择单据类型')"
          style="width: 140px;margin-right: 10px;" show-search allowClear :options="orderTypeQueryList" optionFilterProp="label"
          optionLabelProp="label">
        <a-select v-model:value="searchParam.orderType"
          :placeholder="formatMessage('page.order.orderType.select', '请选择单据类型')"
          style="width: 140px;margin-right: 10px;" show-search allowClear :options="orderTypeQueryList"
          optionFilterProp="label" optionLabelProp="label">
        </a-select>
        <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')"
@@ -386,7 +404,7 @@
    </div>
    <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
      :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
      :pagination="{ total: tableData.total, onChange: onPageChange }"
      @change="handleTableChange" :pagination="{ total: tableData.total, onChange: onPageChange }"
      :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn"
      :loading="state.loading">
      <template #bodyCell="{ column, text, record }">