From 83e34f69b7b5edf713d25bbec164e47f924edb31 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期二, 10 九月 2024 13:30:32 +0800
Subject: [PATCH] #
---
zy-asrs-admin/src/components/orderOut/orderOutBatchPreview/index.vue | 62 ++++++++++++++++++++++++++++++-
1 files changed, 60 insertions(+), 2 deletions(-)
diff --git a/zy-asrs-admin/src/components/orderOut/orderOutBatchPreview/index.vue b/zy-asrs-admin/src/components/orderOut/orderOutBatchPreview/index.vue
index 301cca5..d7d3b2d 100644
--- a/zy-asrs-admin/src/components/orderOut/orderOutBatchPreview/index.vue
+++ b/zy-asrs-admin/src/components/orderOut/orderOutBatchPreview/index.vue
@@ -20,6 +20,8 @@
let currentOrder = ref(null);
let searchInput = ref(null);
let tableData = ref([]);
+const operationPortList = ref([])
+const globalOperationPort = ref(null)
const open = ref(false);
const showWidth = ref("60%")
const records = ref([])
@@ -105,6 +107,14 @@
})
tmp.push({
+ title: formatMessage('db.man_order_detl.operationPort', '浣滀笟鍙�'),
+ dataIndex: 'operationPort',
+ width: 140,
+ ellipsis: true,
+ fixed: 'right',
+ })
+
+ tmp.push({
title: '',
dataIndex: 'handleStatus',
width: 100,
@@ -140,16 +150,48 @@
})
}
-const handleOrderOutPreview = () => {
+async function getOperationPort() {
+ let resp = await post('/api/operationPort/list', {})
+ let result = resp.data;
+ if (result.code == 200) {
+ let data = result.data;
+ let tmp = []
+ data.forEach((item) => {
+ tmp.push({
+ label: item.flag,
+ value: item.id
+ })
+ })
+ operationPortList.value = tmp;
+ } else if (result.code === 401) {
+ message.error(result.msg);
+ logout()
+ } else {
+ message.error(result.msg);
+ }
+}
+
+const handleOrderOutPreview = async () => {
+ await getOperationPort();
loading.value = true;
tableData.value = []
+
+ let defaultOperationPort = "";
+ if (operationPortList.value.length > 0) {
+ defaultOperationPort = operationPortList.value[0].value;
+ globalOperationPort.value = defaultOperationPort;
+ }
post('/api/out/orderOut/batch/preview', {
orderDetlIds: records.value,
}).then((resp) => {
let result = resp.data;
if (result.code == 200) {
- tableData.value = result.data;
+ let tmp = result.data;
+ tmp.forEach((item) => {
+ item.operationPort = defaultOperationPort;
+ })
+ tableData.value = tmp;
loading.value = false;
}
})
@@ -189,6 +231,14 @@
})
}
+const handleGlobalOperationPortChange = () => {
+ if(tableData.value.length > 0) {
+ tableData.value.forEach((item) => {
+ item.operationPort = globalOperationPort.value;
+ })
+ }
+}
+
defineExpose({
open,
showWidth,
@@ -207,6 +257,10 @@
<div>
<a-modal v-model:open="open" :width="showWidth" :title="formatMessage('page.orderOutPreview.preview', '棰勮璁㈠崟鍑哄簱')"
@ok="handleOk">
+ <div>
+ <span>浣滀笟鍙o細</span>
+ <a-select v-model:value="globalOperationPort" :options="operationPortList" @change="handleGlobalOperationPortChange"></a-select>
+ </div>
<a-table :data-source="tableData" :loading="loading" :defaultExpandAllRows="false" :key="TABLE_KEY"
rowKey="id" :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns">
<template #bodyCell="{ column, text, record, index }">
@@ -228,6 +282,10 @@
</div>
</div>
</template>
+
+ <template v-if="column.dataIndex === 'operationPort'">
+ <a-select v-model:value="record.operationPort" :options="operationPortList"></a-select>
+ </template>
</template>
</a-table>
</a-modal>
--
Gitblit v1.9.1