From d59ce970d04003b30178b840f3a1facb9734d96b Mon Sep 17 00:00:00 2001
From: zs <zhousong@weben-smart.com>
Date: 周一, 12 5月 2025 08:44:03 +0800
Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo
---
HIAWms/hiawms_web/src/widgets/WmsInOutStockOrder/Controllers/WmsOutOrderCallMaterialDialog.tsx | 215 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 215 insertions(+), 0 deletions(-)
diff --git a/HIAWms/hiawms_web/src/widgets/WmsInOutStockOrder/Controllers/WmsOutOrderCallMaterialDialog.tsx b/HIAWms/hiawms_web/src/widgets/WmsInOutStockOrder/Controllers/WmsOutOrderCallMaterialDialog.tsx
new file mode 100644
index 0000000..97f03d7
--- /dev/null
+++ b/HIAWms/hiawms_web/src/widgets/WmsInOutStockOrder/Controllers/WmsOutOrderCallMaterialDialog.tsx
@@ -0,0 +1,215 @@
+import { computed, defineComponent, onMounted, reactive, ref } from 'vue'
+import type { Ref } from 'vue'
+import BaseTable from '@/components/Table/Table'
+import styles from './WmsInOutStockOrder.module.scss'
+import { useWmsInOutStockOrder } from '../../../Controllers/WmsInOutStockOrder'
+import Search from '@/components/Search/Search'
+import { columns } from './Config'
+import TdButton from '@/components/TdButton/TdButton'
+import { vPermission } from '@/libs/Permission/Permission'
+import { getWmsEnumData } from '@/widgets/WmsInOutStockOrder/Models/Service/WmsInOutStockOrderDrawer'
+import dayjs from 'dayjs'
+import {
+ ElInput,
+ ElSelect,
+ ElOption,
+ ElDatePicker,
+ ElForm,
+ ElFormItem,
+ ElDialog,
+ ElTable,
+ ElTableColumn,
+ ElButton,
+ ElMessage,
+} from 'element-plus'
+import { injectModel } from '@/libs/Provider/Provider'
+
+interface RenderTableType {
+ url?: string
+ dataSource: Ref<any[]>
+ isDrag?: boolean
+ isChecked?: boolean
+ isHidePagination?: boolean
+ params?: Record<string, any>
+ autoHeight?: boolean
+}
+
+export default defineComponent({
+ name: 'WmsInOutStockOrder',
+ directives: {
+ permission: vPermission,
+ },
+ setup(props, ctx) {
+ const {
+ dataSource,
+ contextMenu,
+ tableRef,
+ selection,
+ onRowClick,
+ onCheck,
+ openDetail,
+ } = useWmsInOutStockOrder(props, ctx)
+
+ // 鍙枡寮圭獥鐩稿叧鐘舵��
+ const callMaterialDialog = reactive({
+ visible: false,
+ title: '鍙枡',
+ selectedItems: [] as any[],
+ })
+
+ // 鎵撳紑鍙枡寮圭獥
+ const openCallMaterialDialog = () => {
+ if (selection.value.length === 0) {
+ ElMessage.warning('璇疯嚦灏戦�夋嫨涓�鏉¤褰�')
+ return
+ }
+ callMaterialDialog.selectedItems = [...selection.value]
+ console.log('閫変腑鐨勬暟鎹�:', callMaterialDialog.selectedItems)
+ 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 琛ㄦ牸
+ */
+ const RenderBaseTable = (props: RenderTableType) => {
+ const {
+ url,
+ dataSource,
+ isDrag,
+ isChecked,
+ isHidePagination,
+ params,
+ autoHeight,
+ } = props
+
+ return (
+ <div
+ class={{
+ [styles.wmsInOutStockOrderList]: true,
+ }}
+ >
+ <BaseTable
+ ref={tableRef}
+ url={url}
+ v-model:dataSource={dataSource.value}
+ columns={columns}
+ contextMenu={contextMenu}
+ params={params}
+ isDrag={isDrag}
+ isChecked={isChecked}
+ autoHeight={autoHeight}
+ onCheck={onCheck}
+ onRowClick={onRowClick}
+ isHidePagination={isHidePagination}
+ pageSize={20}
+ v-slots={{
+ operateTime: ({ row }: any) => {
+ return (
+ <div>
+ {row.operateTime != null
+ ? dayjs(row.operateTime).format('YYYY-MM-DD HH:mm:ss')
+ : '-'}
+ </div>
+ )
+ },
+ creationTime: ({ row }: any) => {
+ return (
+ <div>
+ {row.creationTime != null
+ ? dayjs(row.creationTime).format('YYYY-MM-DD HH:mm:ss')
+ : '-'}
+ </div>
+ )
+ },
+ name: ({ row }: any) => {
+ return row?.name ? (
+ <TdButton
+ onClick={() => openDetail(row)}
+ text={<span style="color:#5a84ff">璇︽儏</span>}
+ icon="scale"
+ tip={row?.name}
+ hover
+ >
+ {row?.name}
+ </TdButton>
+ ) : (
+ '-'
+ )
+ },
+ }}
+ ></BaseTable>
+ </div>
+ )
+ }
+
+ return () => {
+ return (
+ <div class={styles.wmsInOutStockOrderContent}>
+ {/* 鍙枡寮圭獥 */}
+ <RenderCallMaterialDialog />
+
+ {/* 鎿嶄綔鎸夐挳鍖哄煙 */}
+ <div class={styles.headerContent}>
+ <div class={styles.header}>
+ <ElButton
+ v-permission="wmsInOutStockOrder-call"
+ type="primary"
+ onClick={openCallMaterialDialog}
+ >
+ 鍙枡
+ </ElButton>
+ </div>
+ </div>
+
+ <RenderBaseTable
+ dataSource={dataSource}
+ isChecked={true}
+ isDrag={true}
+ />
+ </div>
+ )
+ }
+ },
+})
--
Gitblit v1.9.3