From 6f35f9dc767e99ad701f7f6e2f5d4c52b6cc1d0f Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 14 十月 2026 14:05:26 +0800
Subject: [PATCH] refactor(wls): 将级联选择组件替换为普通输入框
---
src/views/wls/productissue/data.ts | 47 +------
/dev/null | 127 ---------------------
src/views/wls/itemreceipt/index.vue | 37 ------
company.config.ts | 60 ---------
src/views/wls/itemreceipt/data.ts | 53 ++------
5 files changed, 26 insertions(+), 298 deletions(-)
diff --git a/company.config.ts b/company.config.ts
index 829ae00..97f8850 100644
--- a/company.config.ts
+++ b/company.config.ts
@@ -23,64 +23,10 @@
favicon: '/logos/TEST.ico',
apiUrl: 'http://36.213.90.123:9501/admin-api',
},
- JHHG: {
- name: '瀹佸涔濇硴鍖栧伐',
- logo: '/logos/TEST.png',
- favicon: '/logos/TEST.ico',
- apiUrl: 'http://42.63.70.90:9001/admin-api',
- },
- YZFX: {
- name: '瀹佸鑻辨辰闃查攬',
+ BFKJ: {
+ name: '鏂扮枂鍖楁柟绉戞妧',
logo: '/logos/YZFXLogo.png',
favicon: '/logos/YZFXLogo.ico',
- apiUrl: 'http://42.63.70.231:9001/admin-api',
- },
- WTXC: {
- name: '瀹佸涓囬�氭柊鏉�',
- logo: '/logos/YZFXLogo.png',
- favicon: '/logos/YZFXLogo.ico',
- apiUrl: 'http://42.63.71.140:9001/admin-api',
- },
- YSJX: {
- name: '瀹佸鐜夊北鏈烘',
- logo: '/logos/YZFXLogo.png',
- favicon: '/logos/YZFXLogo.ico',
- apiUrl: 'http://42.63.71.140:9004/admin-api',
- },
- XLZB: {
- name: '瀹佸鍗忓姏瑁呭',
- logo: '/logos/YZFXLogo.png',
- favicon: '/logos/YZFXLogo.ico',
- apiUrl: 'http://42.63.71.140:9004/admin-api',
- },
- ZSJC: {
- name: '瀹佸涓洓寤烘潗绉戞妧鏈夐檺鍏徃',
- logo: '/logos/YZFXLogo.png',
- favicon: '/logos/YZFXLogo.ico',
- apiUrl: 'http://116.172.73.239:9001/admin-api',
- },
- KYZN: {
- name: '搴锋剰鏅鸿兘',
- logo: '/logos/YZFXLogo.png',
- favicon: '/logos/YZFXLogo.ico',
- apiUrl: 'http://36.213.150.237:9004/admin-api',
- },
- CHDL: {
- name: '闀胯緣鐢靛姏',
- logo: '/logos/YZFXLogo.png',
- favicon: '/logos/YZFXLogo.ico',
- apiUrl: 'http://36.213.150.237:9006/admin-api',
- },
- HM: {
- name: '鎯犵墽',
- logo: '/logos/YZFXLogo.png',
- favicon: '/logos/YZFXLogo.ico',
- apiUrl: 'http://36.213.150.237:9013/admin-api',
- },
- TRT: {
- name: '鍖椾含鍚屼粊鍫�',
- logo: '/logos/YZFXLogo.png',
- favicon: '/logos/YZFXLogo.ico',
- apiUrl: 'http://36.213.150.237:9015/admin-api',
+ apiUrl: 'http://36.213.150.237:9026/admin-api',
},
};
diff --git a/src/views/wls/itemreceipt/data.ts b/src/views/wls/itemreceipt/data.ts
index 291714f..f1a8be3 100644
--- a/src/views/wls/itemreceipt/data.ts
+++ b/src/views/wls/itemreceipt/data.ts
@@ -1,6 +1,5 @@
import type { VbenFormApi, VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
-import type { MesWmArrivalNoticeApi } from '#/api/mes/wm/arrivalnotice';
import type { MesWmArrivalNoticeLineApi } from '#/api/mes/wm/arrivalnotice/line';
import type { MesWmItemReceiptApi } from '#/api/mes/wm/itemreceipt';
import type { MesWmItemReceiptDetailApi } from '#/api/mes/wm/itemreceipt/detail';
@@ -8,22 +7,14 @@
import { h, markRaw } from 'vue';
-import {
- DICT_TYPE,
- MesAutoCodeRuleCode,
- MesWmArrivalNoticeStatusEnum,
-} from '@vben/constants';
+import { DICT_TYPE, MesAutoCodeRuleCode } from '@vben/constants';
import { Button } from 'ant-design-vue';
import { generateAutoCode } from '#/api/mes/md/autocode/record';
import { getRangePickerDefaultProps } from '#/utils';
import { MdItemSelect } from '#/views/mes/md/item/components';
-import { ErpSupplierSelect } from '#/views/erp/purchase/supplier/components';
-import {
- WmArrivalNoticeLineSelect,
- WmArrivalNoticeSelect,
-} from '#/views/wls/arrivalnotice/components';
+import { WmArrivalNoticeLineSelect } from '#/views/wls/arrivalnotice/components';
import {
WmWarehouseAreaSelect,
WmWarehouseLocationSelect,
@@ -106,23 +97,15 @@
rules: 'required',
},
{
- fieldName: 'noticeId',
+ fieldName: 'noticeCode',
label: '鍒拌揣閫氱煡鍗�',
- component: markRaw(WmArrivalNoticeSelect),
+ component: 'Input',
componentProps: {
- // 閫夋嫨鍒拌揣閫氱煡鍗曞悗锛岃嚜鍔ㄥ洖濉緵搴斿晢鍜岄噰璐鍗曞彿
- onChange: async (notice?: MesWmArrivalNoticeApi.ArrivalNotice) => {
- await formApi?.setValues({
- purchaseOrderCode: notice?.purchaseOrderCode,
- vendorId: notice?.vendorId,
- vendorName: notice?.vendorName,
- });
- },
- status: MesWmArrivalNoticeStatusEnum.PENDING_RECEIPT,
+ placeholder: '璇疯緭鍏ュ埌璐ч�氱煡鍗曞彿',
},
},
{
- fieldName: 'vendorName',
+ fieldName: 'noticeId',
component: 'Input',
dependencies: {
triggerFields: [''],
@@ -130,22 +113,11 @@
},
},
{
- fieldName: 'vendorId',
+ fieldName: 'vendorName',
label: '渚涘簲鍟�',
- component: markRaw(ErpSupplierSelect),
+ component: 'Input',
componentProps: {
- placeholder: '璇烽�夋嫨渚涘簲鍟�',
- onChange: async (supplier?: any) => {
- await formApi?.setFieldValue('vendorName', supplier?.name);
- },
- },
- rules: 'selectRequired',
- dependencies: {
- triggerFields: ['vendorName'],
- componentProps: (values) => ({
- placeholder: '璇烽�夋嫨渚涘簲鍟�',
- supplierName: values.vendorName as string,
- }),
+ placeholder: '璇疯緭鍏ヤ緵搴斿晢',
},
},
{
@@ -191,11 +163,12 @@
},
},
{
- fieldName: 'vendorId',
+ fieldName: 'vendorName',
label: '渚涘簲鍟�',
- component: markRaw(ErpSupplierSelect),
+ component: 'Input',
componentProps: {
- placeholder: '璇烽�夋嫨渚涘簲鍟�',
+ allowClear: true,
+ placeholder: '璇疯緭鍏ヤ緵搴斿晢',
},
},
{
diff --git a/src/views/wls/itemreceipt/index.vue b/src/views/wls/itemreceipt/index.vue
index 552e77a..b0c812b 100644
--- a/src/views/wls/itemreceipt/index.vue
+++ b/src/views/wls/itemreceipt/index.vue
@@ -13,22 +13,15 @@
cancelItemReceipt,
deleteItemReceipt,
exportItemReceipt,
- generateItemReceiptFromArrivalNotice,
getItemReceiptPage,
} from '#/api/mes/wm/itemreceipt';
import { $t } from '#/locales';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
-import AnSelectDialog from './modules/an-select-dialog.vue';
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: Form,
- destroyOnClose: true,
-});
-
-const [AnSelectModal, anSelectModalApi] = useVbenModal({
- connectedComponent: AnSelectDialog,
destroyOnClose: true,
});
@@ -84,28 +77,6 @@
handleRefresh();
}
-/** 浠庡埌璐ч�氱煡鐢熸垚閲囪喘鍏ュ簱鍗� */
-async function handleGenerateFromAN() {
- anSelectModalApi.open();
-}
-
-/** 鍒拌揣閫氱煡閫夋嫨鍥炶皟 */
-async function handleArrivalNoticeSelected(arrivalNoticeId: number) {
- const hideLoading = message.loading({
- content: '姝e湪鐢熸垚閲囪喘鍏ュ簱鍗�...',
- duration: 0,
- });
- try {
- const id = await generateItemReceiptFromArrivalNotice(arrivalNoticeId);
- message.success('閲囪喘鍏ュ簱鍗曠敓鎴愭垚鍔�');
- // 璺宠浆鍒扮紪杈戦〉
- formModalApi.setData({ formType: 'update', id }).open();
- handleRefresh();
- } finally {
- hideLoading();
- }
-}
-
/** 瀵煎嚭琛ㄦ牸 */
async function handleExport() {
const data = await exportItemReceipt(await gridApi.formApi.getValues());
@@ -146,7 +117,6 @@
<template>
<Page auto-content-height>
<FormModal @success="handleRefresh" />
- <AnSelectModal @selected="handleArrivalNoticeSelected" />
<Grid table-title="閲囪喘鍏ュ簱鍗曞垪琛�">
<template #toolbar-tools>
@@ -158,13 +128,6 @@
icon: ACTION_ICON.ADD,
auth: ['mes:wm-item-receipt:create'],
onClick: handleCreate,
- },
- {
- label: '浠庡埌璐ч�氱煡鐢熸垚',
- type: 'primary',
- icon: ACTION_ICON.ADD,
- auth: ['mes:wm-item-receipt:create'],
- onClick: handleGenerateFromAN,
},
{
label: $t('ui.actionTitle.export'),
diff --git a/src/views/wls/itemreceipt/modules/an-select-dialog.vue b/src/views/wls/itemreceipt/modules/an-select-dialog.vue
deleted file mode 100644
index dfdc0c5..0000000
--- a/src/views/wls/itemreceipt/modules/an-select-dialog.vue
+++ /dev/null
@@ -1,127 +0,0 @@
-<script lang="ts" setup>
-import type { MesWmArrivalNoticeApi } from '#/api/mes/wm/arrivalnotice';
-import type { VxeTableGridOptions } from '#/adapter/vxe-table';
-
-import { Page, useVbenModal } from '@vben/common-ui';
-import { MesWmArrivalNoticeStatusEnum } from '@vben/constants';
-
-import { message } from 'ant-design-vue';
-
-import { useVbenVxeGrid } from '#/adapter/vxe-table';
-import { getArrivalNoticePage } from '#/api/mes/wm/arrivalnotice';
-
-const emit = defineEmits<{
- selected: [arrivalNoticeId: number];
-}>();
-
-const [Grid, gridApi] = useVbenVxeGrid({
- formOptions: {
- schema: [
- {
- fieldName: 'code',
- label: '閫氱煡鍗曞彿',
- component: 'Input',
- componentProps: {
- allowClear: true,
- placeholder: '璇疯緭鍏ラ�氱煡鍗曞彿',
- },
- },
- {
- fieldName: 'vendorName',
- label: '渚涘簲鍟�',
- component: 'Input',
- componentProps: {
- allowClear: true,
- placeholder: '璇疯緭鍏ヤ緵搴斿晢鍚嶇О',
- },
- },
- ],
- },
- gridOptions: {
- columns: [
- {
- type: 'radio',
- width: 60,
- },
- {
- field: 'code',
- title: '閫氱煡鍗曞彿',
- minWidth: 160,
- },
- {
- field: 'name',
- title: '閫氱煡鍗曞悕绉�',
- minWidth: 150,
- },
- {
- field: 'vendorName',
- title: '渚涘簲鍟嗗悕绉�',
- minWidth: 120,
- },
- {
- field: 'purchaseOrderNo',
- title: '閲囪喘璁㈠崟鍙�',
- minWidth: 140,
- },
- {
- field: 'arrivalDate',
- title: '鍒拌揣鏃ユ湡',
- width: 180,
- formatter: 'formatDate',
- },
- {
- field: 'status',
- title: '鐘舵��',
- width: 100,
- cellRender: {
- name: 'CellDict',
- props: { type: 'mes_wm_arrival_notice_status' },
- },
- },
- ],
- height: 460,
- keepSource: true,
- proxyConfig: {
- ajax: {
- query: async ({ page }, formValues) => {
- return await getArrivalNoticePage({
- pageNo: page.currentPage,
- pageSize: page.pageSize,
- status: MesWmArrivalNoticeStatusEnum.PENDING_RECEIPT,
- ...formValues,
- });
- },
- },
- },
- rowConfig: {
- keyField: 'id',
- isHover: true,
- },
- toolbarConfig: {
- refresh: true,
- search: true,
- },
- } as VxeTableGridOptions<MesWmArrivalNoticeApi.ArrivalNotice>,
-});
-
-const [Modal, modalApi] = useVbenModal({
- async onConfirm() {
- const selectedRows = gridApi.grid.getRadioRecord();
- if (!selectedRows) {
- message.warning('璇烽�夋嫨鍒拌揣閫氱煡鍗�');
- return;
- }
- emit('selected', selectedRows.id);
- await modalApi.close();
- },
- async onOpened() {
- await gridApi.query();
- },
-});
-</script>
-
-<template>
- <Modal title="閫夋嫨鍒拌揣閫氱煡鍗�" class="w-2/3">
- <Grid table-title="鍒拌揣閫氱煡鍗曞垪琛�" />
- </Modal>
-</template>
diff --git a/src/views/wls/productissue/data.ts b/src/views/wls/productissue/data.ts
index 5ef003a..910b30d 100644
--- a/src/views/wls/productissue/data.ts
+++ b/src/views/wls/productissue/data.ts
@@ -1,6 +1,5 @@
锘縤mport type { VbenFormApi, VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
-import type { MesProTaskApi } from '#/api/mes/pro/task';
import type { MesWmMaterialStockApi } from '#/api/mes/wm/materialstock';
import type { MesWmProductIssueApi } from '#/api/mes/wm/productissue';
import type { MesWmProductIssueDetailApi } from '#/api/mes/wm/productissue/detail';
@@ -8,11 +7,7 @@
import { h, markRaw } from 'vue';
-import {
- DICT_TYPE,
- MesAutoCodeRuleCode,
- MesProWorkOrderStatusEnum,
-} from '@vben/constants';
+import { DICT_TYPE, MesAutoCodeRuleCode } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Button } from 'ant-design-vue';
@@ -20,9 +15,6 @@
import { generateAutoCode } from '#/api/mes/md/autocode/record';
import { getRangePickerDefaultProps } from '#/utils';
import { MdItemSelect } from '#/views/mes/md/item/components';
-import { MdWorkstationSelect } from '#/views/mes/md/workstation/components';
-import { ProTaskSelect } from '#/views/mes/pro/task/components';
-import { ProWorkOrderSelect } from '#/views/mes/pro/workorder/components';
import { WmMaterialStockSelect } from '#/views/wls/materialstock/components';
import {
WmWarehouseAreaSelect,
@@ -108,46 +100,27 @@
rules: 'required',
},
{
- fieldName: 'workOrderId',
+ fieldName: 'workOrderCode',
label: '鐢熶骇璁㈠崟',
- component: markRaw(ProWorkOrderSelect),
+ component: 'Input',
componentProps: {
- placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟',
- status: MesProWorkOrderStatusEnum.CONFIRMED,
- // 璁㈠崟鍙樻洿锛氭竻绌哄凡閫夌敓浜т换鍔★紝閬垮厤浠诲姟涓庤鍗曚笉涓�鑷�
- onChange: async () => {
- await formApi?.setFieldValue('taskId', undefined);
- },
+ placeholder: '璇疯緭鍏ョ敓浜ц鍗曞彿',
},
- rules: 'selectRequired',
},
{
- fieldName: 'taskId',
+ fieldName: 'taskCode',
label: '鐢熶骇浠诲姟',
- component: markRaw(ProTaskSelect),
+ component: 'Input',
componentProps: {
- placeholder: '璇烽�夋嫨鐢熶骇浠诲姟',
- // 閫変腑浠诲姟鍚庤嚜鍔ㄥ甫鍑哄叾宸ヤ綔绔�
- onChange: async (task?: MesProTaskApi.Task) => {
- await formApi?.setFieldValue('workstationId', task?.workstationId);
- },
+ placeholder: '璇疯緭鍏ョ敓浜т换鍔″彿',
},
- dependencies: {
- triggerFields: ['workOrderId'],
- componentProps: (values) => ({
- disabled: !values.workOrderId,
- placeholder: values.workOrderId ? '璇烽�夋嫨鐢熶骇浠诲姟' : '璇峰厛閫夋嫨鐢熶骇璁㈠崟',
- workOrderId: values.workOrderId,
- }),
- },
- rules: 'selectRequired',
},
{
- fieldName: 'workstationId',
+ fieldName: 'workstationName',
label: '宸ヤ綔绔�',
- component: markRaw(MdWorkstationSelect),
+ component: 'Input',
componentProps: {
- placeholder: '璇烽�夋嫨宸ヤ綔绔�',
+ placeholder: '璇疯緭鍏ュ伐浣滅珯鍚嶇О',
},
},
{
--
Gitblit v1.9.3