From bf0ef9e148f2f438b5630c9fc9f6b8943592eeff Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期一, 07 九月 2026 16:55:15 +0800
Subject: [PATCH] fix(排产): 生产状态为已完成的单不再显示0%进度,已完成类型隐藏排产维护按钮

---
 src/views/wls/productissue/components/select-dialog.vue |  106 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 106 insertions(+), 0 deletions(-)

diff --git a/src/views/wls/productissue/components/select-dialog.vue b/src/views/wls/productissue/components/select-dialog.vue
new file mode 100644
index 0000000..09bb732
--- /dev/null
+++ b/src/views/wls/productissue/components/select-dialog.vue
@@ -0,0 +1,106 @@
+<script lang="ts" setup>
+import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import type { MesWmProductIssueLineApi } from '#/api/mes/wm/productissue/line';
+
+import { nextTick, ref } from 'vue';
+
+import { message, Modal } from 'ant-design-vue';
+
+import { useVbenVxeGrid } from '#/adapter/vxe-table';
+import { getReturnableIssueLines } from '#/api/mes/wm/productissue/line';
+
+const props = defineProps<{
+  workOrderId?: number;
+}>();
+
+const emit = defineEmits<{
+  selected: [rows: MesWmProductIssueLineApi.ProductIssueLine[]];
+}>();
+
+const open = ref(false);
+const selectedRows = ref<MesWmProductIssueLineApi.ProductIssueLine[]>([]);
+
+const columns: VxeTableGridOptions<MesWmProductIssueLineApi.ProductIssueLine>['columns'] = [
+  { type: 'radio', width: 60 },
+  { field: 'itemCode', title: '鐗╂枡缂栫爜', minWidth: 120 },
+  { field: 'itemName', title: '鐗╂枡鍚嶇О', minWidth: 140 },
+  { field: 'specification', title: '瑙勬牸鍨嬪彿', minWidth: 120 },
+  { field: 'unitMeasureName', title: '鍗曚綅', width: 80 },
+  { field: 'quantity', title: '鍙��鏁伴噺', width: 100 },
+  { field: 'batchCode', title: '鎵规鍙�', minWidth: 120 },
+];
+
+const [Grid, gridApi] = useVbenVxeGrid({
+  gridOptions: {
+    columns,
+    height: 480,
+    keepSource: true,
+    radioConfig: { highlight: true, trigger: 'row' },
+    proxyConfig: {
+      ajax: {
+        query: async () => {
+          if (!props.workOrderId) {
+            return { list: [], total: 0 };
+          }
+          const list = await getReturnableIssueLines(props.workOrderId);
+          return { list, total: list.length };
+        },
+      },
+    },
+    rowConfig: {
+      keyField: 'id',
+      isHover: true,
+    },
+    toolbarConfig: {
+      refresh: true,
+    },
+  } as VxeTableGridOptions<MesWmProductIssueLineApi.ProductIssueLine>,
+  gridEvents: {
+    radioChange: ({ row }: { row: MesWmProductIssueLineApi.ProductIssueLine }) => {
+      selectedRows.value = [row];
+    },
+    cellDblclick: async ({ row }: { row: MesWmProductIssueLineApi.ProductIssueLine }) => {
+      selectedRows.value = [row];
+      await gridApi.grid.setRadioRow(row);
+      handleConfirm();
+    },
+  },
+});
+
+async function openModal() {
+  open.value = true;
+  selectedRows.value = [];
+  await nextTick();
+  await gridApi.grid.clearRadioRow();
+  await gridApi.query();
+}
+
+function closeModal() {
+  open.value = false;
+  selectedRows.value = [];
+}
+
+function handleConfirm() {
+  if (selectedRows.value.length === 0) {
+    message.warning('璇烽�夋嫨涓�鏉¢鏂欒褰�');
+    return;
+  }
+  emit('selected', selectedRows.value);
+  open.value = false;
+}
+
+defineExpose({ open: openModal });
+</script>
+
+<template>
+  <Modal
+    v-model:open="open"
+    :destroy-on-close="true"
+    title="閫夋嫨棰嗘枡璁板綍"
+    width="70%"
+    @cancel="closeModal"
+    @ok="handleConfirm"
+  >
+    <Grid table-title="鍙��鏂欑殑棰嗘枡璁板綍" />
+  </Modal>
+</template>

--
Gitblit v1.9.3