zs
2025-05-12 7baa0d978e41f395891753b208d805bc02edee38
HIAWms/hiawms_web/src/widgets/WmsInOutStockOrder/Views/Pages/WmsInOutStockOrder/WmsInOutStockOrder.tsx
@@ -19,6 +19,11 @@
  ElDatePicker,
  ElForm,
  ElFormItem,
  ElDialog,
  ElButton,
  ElTable,
  ElTableColumn,
  ElMessage,
} from 'element-plus'
import { injectModel } from '@/libs/Provider/Provider'
@@ -37,6 +42,7 @@
  directives: {
    permission: vPermission,
  },
  setup(props, ctx) {
    const {
      dataSource,
@@ -46,6 +52,7 @@
      tableRef,
      current,
      search,
      selection,
      sort,
      headers,
      onError,
@@ -173,6 +180,66 @@
      return filteredData
    }
    // 叫料弹窗相关状态
    const callMaterialDialog = reactive({
      visible: false,
      title: '叫料',
      selectedItems: [] as any[],
    })
    // 打开叫料弹窗
    const openCallMaterialDialog = () => {
      console.log('选中的数据:', callMaterialDialog.selectedItems)
      if (selection.value.length === 0) {
        ElMessage.warning('请至少选择一条记录')
        return
      }
      callMaterialDialog.selectedItems = [...selection.value]
      callMaterialDialog.visible = true
    }
    // 确认叫料
    const confirmCallMaterial = () => {
      // 这里添加叫料逻辑
      console.log('叫料数据:', callMaterialDialog.selectedItems)
      ElMessage.success('叫料成功')
      callMaterialDialog.visible = false
    }
    /**
     * @returns 叫料弹窗
     */
    const RenderCallMaterialDialog = () => {
      return (
        <ElDialog
          v-model={callMaterialDialog.visible}
          title={callMaterialDialog.title}
          width="70%"
          v-slots={{
            footer: () => (
              <div class={styles.dialogFooter}>
                <ElButton onClick={() => (callMaterialDialog.visible = false)}>
                  取消
                </ElButton>
                <ElButton type="primary" onClick={confirmCallMaterial}>
                  确认叫料
                </ElButton>
              </div>
            ),
          }}
        >
          <ElTable data={callMaterialDialog.selectedItems} border>
            <ElTableColumn prop="orderNo" label="单据号" width="180" />
            <ElTableColumn prop="materialNo" label="物料编号" width="180" />
            <ElTableColumn prop="materialName" label="物料名称" />
            <ElTableColumn prop="materialModel" label="型号" />
            <ElTableColumn prop="placeNo" label="库位编号" />
            <ElTableColumn prop="quantity" label="数量" />
          </ElTable>
        </ElDialog>
      )
    }
    /**
     * @returns 表格
     */
@@ -273,6 +340,9 @@
          <div class={styles.headerContent}>
            <div class={styles.header}>
              {/* 叫料弹窗 */}
              <RenderCallMaterialDialog />
              <IconButton
                v-permission="wmsInOutStockOrder-add"
                icon="add-p"
@@ -285,7 +355,7 @@
              <IconButton
                v-permission="wmsInOutStockOrder-add"
                icon="add-p"
                onClick={onAddWmsInOutStockOrder}
                onClick={openCallMaterialDialog}
                type="primary"
              >
                叫料