|
@@ -7,103 +7,57 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
- <el-table :row-class-name="tableRowClassName" v-show="initLoadingCompleted" v-loading="listLoading" :border="true" :data="examKindList" class="order-version" :cell-style="cellStyle" >
|
|
|
|
|
|
|
+ <el-table v-show="initLoadingCompleted" v-loading="listLoading" :border="true" :data="examKindList" class="order-version" >
|
|
|
<el-table-column align="center" header-align="center" label="AM" prop="AM" min-width="44">
|
|
<el-table-column align="center" header-align="center" label="AM" prop="AM" min-width="44">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <template v-if="scope.row.isNewRow">
|
|
|
|
|
- <input v-model="scope.row.AM" class="no-border-input" ></input>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-else>
|
|
|
|
|
{{ scope.row.AM }}
|
|
{{ scope.row.AM }}
|
|
|
- </template>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="線便" header-align="center">
|
|
<el-table-column label="線便" header-align="center">
|
|
|
<el-table-column align="center" header-align="center" label="発" prop="departureCode" min-width="72">
|
|
<el-table-column align="center" header-align="center" label="発" prop="departureCode" min-width="72">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <template v-if="scope.row.isNewRow">
|
|
|
|
|
- <input v-model="scope.row.departureCode" class="no-border-input" ></input>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-else>
|
|
|
|
|
{{ scope.row.departureCode }}
|
|
{{ scope.row.departureCode }}
|
|
|
- </template>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column align="center" header-align="center" label="着" prop="arrivalCode" min-width="72">
|
|
<el-table-column align="center" header-align="center" label="着" prop="arrivalCode" min-width="72">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <template v-if="scope.row.isNewRow">
|
|
|
|
|
- <input v-model="scope.row.arrivalCode" class="no-border-input" ></input>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-else>
|
|
|
|
|
{{ scope.row.arrivalCode }}
|
|
{{ scope.row.arrivalCode }}
|
|
|
- </template>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column align="center" header-align="center" label="系統" prop="systemCode" min-width="51">
|
|
<el-table-column align="center" header-align="center" label="系統" prop="systemCode" min-width="51">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <template v-if="scope.row.isNewRow">
|
|
|
|
|
- <input v-model="scope.row.systemCode" class="no-border-input" ></input>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-else>
|
|
|
|
|
{{ scope.row.systemCode }}
|
|
{{ scope.row.systemCode }}
|
|
|
- </template>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column align="center" header-align="center" label="線便名" prop="lineName" min-width="100">
|
|
<el-table-column align="center" header-align="center" label="線便名" prop="lineName" min-width="100">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <template v-if="scope.row.isNewRow">
|
|
|
|
|
- <input v-model="scope.row.lineName" class="no-border-input" ></input>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-else>
|
|
|
|
|
{{ scope.row.lineName }}
|
|
{{ scope.row.lineName }}
|
|
|
- </template>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column align="center" header-align="center" label="入庫場所" prop="wareHouseLocation" min-width="81">
|
|
<el-table-column align="center" header-align="center" label="入庫場所" prop="wareHouseLocation" min-width="81">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <template v-if="scope.row.isNewRow">
|
|
|
|
|
- <input v-model="scope.row.wareHouseLocation" class="no-border-input" ></input>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-else>
|
|
|
|
|
{{ scope.row.wareHouseLocation }}
|
|
{{ scope.row.wareHouseLocation }}
|
|
|
- </template>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column align="center" header-align="center" label="入庫時間" prop="wareHouseTime" min-width="77">
|
|
<el-table-column align="center" header-align="center" label="入庫時間" prop="wareHouseTime" min-width="77">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <template v-if="scope.row.isNewRow">
|
|
|
|
|
- <input v-model="scope.row.wareHouseTime" class="no-border-input" ></input>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-else>
|
|
|
|
|
{{ scope.row.wareHouseTime }}
|
|
{{ scope.row.wareHouseTime }}
|
|
|
- </template>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column align="right" header-align="center" label="使用車両(トン)" prop="vehicleTon" min-width="77">
|
|
<el-table-column align="right" header-align="center" label="使用車両(トン)" prop="vehicleTon" min-width="77">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <template v-if="scope.row.isNewRow">
|
|
|
|
|
- <input v-model="scope.row.vehicleTon" class="right-aligned-input" ></input>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-else>
|
|
|
|
|
{{ scope.row.vehicleTon }}
|
|
{{ scope.row.vehicleTon }}
|
|
|
- </template>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" header-align="center" v-for="(num, index) in originalDataLength" :key="index" :label="num" >
|
|
|
|
|
|
|
+ <el-table-column align="center" header-align="center" v-for="(num, index) in 31" :key="index" :label="num" >
|
|
|
<el-table-column align="center" header-align="center" :label="getElement(num)" :prop="'num_' + num" min-width="40" >
|
|
<el-table-column align="center" header-align="center" :label="getElement(num)" :prop="'num_' + num" min-width="40" >
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <template v-if="scope.row.isNewRow">
|
|
|
|
|
- <input v-model="scope.row[`num_${num}`]" class="no-border-input" ></input>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-else>
|
|
|
|
|
<span
|
|
<span
|
|
|
- @click="open(scope.row, num)"
|
|
|
|
|
style="display: block; min-height: 24px;"
|
|
style="display: block; min-height: 24px;"
|
|
|
>
|
|
>
|
|
|
{{ getDataByIndex(index) || ' ' }}
|
|
{{ getDataByIndex(index) || ' ' }}
|
|
|
</span>
|
|
</span>
|
|
|
- </template>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -117,72 +71,87 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script name="OrderInstruction" setup>
|
|
<script name="OrderInstruction" setup>
|
|
|
-import { listOrder, getOrder, delOrder, addOrder, updateOrder,getOrderCompilation } from "@/api/bbib/order"
|
|
|
|
|
-import {formatMsg, parseAlphabetNumeric} from "@/utils/yamato";
|
|
|
|
|
-import {delay} from "@/utils/index.js";
|
|
|
|
|
-import {encryptField} from "@/utils/encrypt.js";
|
|
|
|
|
|
|
+import { getOrder, addOrder, getOrderCompilation } from "@/api/bbib/order"
|
|
|
import { useRoute } from 'vue-router'
|
|
import { useRoute } from 'vue-router'
|
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
|
|
|
-const {proxy} = getCurrentInstance();
|
|
|
|
|
-
|
|
|
|
|
|
|
+// テーブル表示用のデータリスト
|
|
|
const examKindList = ref([]);
|
|
const examKindList = ref([]);
|
|
|
|
|
+// 元データのリスト(日付ごとのデータ)
|
|
|
const originalDataList = ref([]);
|
|
const originalDataList = ref([]);
|
|
|
|
|
|
|
|
-const canAddNewRow = ref(true);
|
|
|
|
|
-const originalDataLength = ref(0);
|
|
|
|
|
-
|
|
|
|
|
|
|
+// ルートパラメータ取得
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
const orderId = route.params.orderId
|
|
const orderId = route.params.orderId
|
|
|
const version = route.params.version
|
|
const version = route.params.version
|
|
|
|
|
+// 選択中のバージョン
|
|
|
const selectedVersion = ref(route.params.version || '');
|
|
const selectedVersion = ref(route.params.version || '');
|
|
|
|
|
+// 新規フラグ(1:新規作成モード)
|
|
|
const newFlag = Number(route.query.newFlag);
|
|
const newFlag = Number(route.query.newFlag);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 編集ボタンクリック時の処理
|
|
|
|
|
+ * 注文編集画面に遷移します
|
|
|
|
|
+ */
|
|
|
const handleEdit = () => {
|
|
const handleEdit = () => {
|
|
|
router.push({
|
|
router.push({
|
|
|
name: 'OrderCompilation',
|
|
name: 'OrderCompilation',
|
|
|
- params: {
|
|
|
|
|
|
|
+ params: {
|
|
|
orderId: orderId,
|
|
orderId: orderId,
|
|
|
version: version
|
|
version: version
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * インデックスに基づいてデータを取得するコンピューテッドプロパティ
|
|
|
|
|
+ * 新規作成モードかどうかに応じてデータ取得方法を切り替えます
|
|
|
|
|
+ */
|
|
|
const getDataByIndex = computed(() => {
|
|
const getDataByIndex = computed(() => {
|
|
|
- return (index) => {
|
|
|
|
|
- return newFlag === 1
|
|
|
|
|
- ? getNewDataByIndex(index)
|
|
|
|
|
- : getOriginalDataByIndex(index);
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ return (index) => {
|
|
|
|
|
+ return newFlag === 1
|
|
|
|
|
+ ? getNewDataByIndex(index)
|
|
|
|
|
+ : getOriginalDataByIndex(index);
|
|
|
|
|
+ };
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * データを初期化する関数
|
|
|
|
|
+ * 元データを加工し、編集用のフィールドを追加します
|
|
|
|
|
+ */
|
|
|
const initializeData = (data) => {
|
|
const initializeData = (data) => {
|
|
|
return data.map(row => {
|
|
return data.map(row => {
|
|
|
const originalData = {};
|
|
const originalData = {};
|
|
|
|
|
+ // 1〜31日分のデータを初期化
|
|
|
for (let i = 1; i <= 31; i++) {
|
|
for (let i = 1; i <= 31; i++) {
|
|
|
- originalData[`num_${i}`] = row[`num_${i}`] || ''; // 确保原始值非 null
|
|
|
|
|
|
|
+ originalData[`num_${i}`] = row[`num_${i}`] || ''; // 値がない場合は空文字を設定
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
|
...row,
|
|
...row,
|
|
|
__originalData: originalData,
|
|
__originalData: originalData,
|
|
|
- __modifiedFields: [], // 初始化修改标记数组
|
|
|
|
|
|
|
+ __modifiedFields: [], // 変更フラグ管理用配列
|
|
|
isNewRow: false
|
|
isNewRow: false
|
|
|
- }; // 标记非新行
|
|
|
|
|
|
|
+ };
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 注文ページへ遷移する処理
|
|
|
|
|
+ * 選択した指示書で注文を作成します
|
|
|
|
|
+ */
|
|
|
const handleGoToOrderPage = async () => {
|
|
const handleGoToOrderPage = async () => {
|
|
|
- // 定义要传递给后端的参数
|
|
|
|
|
|
|
+ // バックエンドに送信するパラメータ
|
|
|
const actionType = 14
|
|
const actionType = 14
|
|
|
const actionCode = orderId
|
|
const actionCode = orderId
|
|
|
|
|
|
|
|
- // 调用API
|
|
|
|
|
|
|
+ // API呼び出し
|
|
|
await addOrder({
|
|
await addOrder({
|
|
|
actionType,
|
|
actionType,
|
|
|
actionCode
|
|
actionCode
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ // 注文詳細ページに遷移
|
|
|
router.push({
|
|
router.push({
|
|
|
name: 'OrderDetail',
|
|
name: 'OrderDetail',
|
|
|
query: {
|
|
query: {
|
|
@@ -191,55 +160,7 @@ const handleGoToOrderPage = async () => {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-watch(examKindList, () => {
|
|
|
|
|
- checkAddButtonState();
|
|
|
|
|
-}, { deep: true });
|
|
|
|
|
-
|
|
|
|
|
-function checkAddButtonState() {
|
|
|
|
|
- const lastRow = examKindList.value[examKindList.value.length - 1];
|
|
|
|
|
- if (lastRow && lastRow.isNewRow) {
|
|
|
|
|
- canAddNewRow.value = lastRow.発 && lastRow.着 && lastRow.系統;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-//増便
|
|
|
|
|
-const addNewRow = () => {
|
|
|
|
|
- const newRow = {
|
|
|
|
|
- AM: '',
|
|
|
|
|
- departureCode: '',
|
|
|
|
|
- arrivalCode: '',
|
|
|
|
|
- systemCode: '',
|
|
|
|
|
- lineName: '',
|
|
|
|
|
- wareHouseLocation: '',
|
|
|
|
|
- wareHouseTime: '',
|
|
|
|
|
- vehicleTon: '',
|
|
|
|
|
- isNewRow: true,
|
|
|
|
|
- highlightRow: true // 新增高亮标记
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- for (let i = 1; i <= 31; i++) {
|
|
|
|
|
- newRow[`num_${i}`] = ''
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- examKindList.value.push(newRow);
|
|
|
|
|
- checkAddButtonState();
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const tableRowClassName = ({row}) => {
|
|
|
|
|
- return row.highlightRow ? 'highlight-row' : ''
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 控制对话框显示
|
|
|
|
|
-const dialogVisible = ref(false);
|
|
|
|
|
-// 下拉框选项数据
|
|
|
|
|
-const reasonOptions = ref([
|
|
|
|
|
- { value: 'option1', label: '选项1' },
|
|
|
|
|
- { value: 'option2', label: '选项2' },
|
|
|
|
|
- { value: 'option3', label: '选项3' }
|
|
|
|
|
-])
|
|
|
|
|
-
|
|
|
|
|
|
|
+// バージョン選択用のオプションリスト
|
|
|
const versionOptions = ref([
|
|
const versionOptions = ref([
|
|
|
{ value: '1', label: 'ver-1' },
|
|
{ value: '1', label: 'ver-1' },
|
|
|
{ value: '2', label: 'ver-2' },
|
|
{ value: '2', label: 'ver-2' },
|
|
@@ -249,150 +170,71 @@ const versionOptions = ref([
|
|
|
{ value: '6', label: 'ver-6' },
|
|
{ value: '6', label: 'ver-6' },
|
|
|
{ value: '7', label: 'ver-7' },
|
|
{ value: '7', label: 'ver-7' },
|
|
|
])
|
|
])
|
|
|
-// 绑定下拉框的值
|
|
|
|
|
-const selectedReason = ref('');
|
|
|
|
|
-// 绑定文本框的值
|
|
|
|
|
-const changedValue = ref('');
|
|
|
|
|
-
|
|
|
|
|
-const currentRow = ref(null)
|
|
|
|
|
-const currentNum = ref(null)
|
|
|
|
|
-
|
|
|
|
|
-const cellStyle = ({ row, column }) => {
|
|
|
|
|
- const prop = column.property;
|
|
|
|
|
- if (!prop?.startsWith('num_') || row.isNewRow) return {}; // 跳过非 num_ 列和新行
|
|
|
|
|
-
|
|
|
|
|
- const originalValue = row.__originalData[prop];
|
|
|
|
|
- const currentValue = row[prop] || ''; // 处理 null 为 ''
|
|
|
|
|
-
|
|
|
|
|
- // 新增:检查是否有修改标记
|
|
|
|
|
- return row.__modifiedFields?.includes(prop)
|
|
|
|
|
- ? {
|
|
|
|
|
- backgroundColor: '#f0f7ff',
|
|
|
|
|
- }
|
|
|
|
|
- : {};
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-const open = (row, num) => {
|
|
|
|
|
- currentRow.value = row
|
|
|
|
|
- currentNum.value = num
|
|
|
|
|
- selectedReason.value = reasonOptions.value[0].value
|
|
|
|
|
- changedValue.value = ''
|
|
|
|
|
- dialogVisible.value = true
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-// 处理回车键事件
|
|
|
|
|
-const handleEnter = () => {
|
|
|
|
|
- const valueToUpdate = changedValue.value;
|
|
|
|
|
-
|
|
|
|
|
- if (currentRow.value && currentNum.value) {
|
|
|
|
|
- const prop = `num_${currentNum.value}`;
|
|
|
|
|
- const originalValue = currentRow.value.__originalData[prop];
|
|
|
|
|
-
|
|
|
|
|
- // 判断原始值是否为空且输入值不为空
|
|
|
|
|
- if (!originalValue && valueToUpdate) {
|
|
|
|
|
- currentRow.value[prop] = '〇';
|
|
|
|
|
- } else if (valueToUpdate === originalValue) {
|
|
|
|
|
- // 保持原值,不做任何修改
|
|
|
|
|
- } else {
|
|
|
|
|
- // 否则更新空值
|
|
|
|
|
- currentRow.value[prop] = '';
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 记录修改状态
|
|
|
|
|
- if (!currentRow.value.__modifiedFields) {
|
|
|
|
|
- currentRow.value.__modifiedFields = [];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 如果新值与原始值不同,则添加到修改列表
|
|
|
|
|
- if (valueToUpdate !== originalValue) {
|
|
|
|
|
- if (!currentRow.value.__modifiedFields.includes(prop)) {
|
|
|
|
|
- currentRow.value.__modifiedFields.push(prop);
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- // 如果相同且已在修改列表中,则移除
|
|
|
|
|
- const index = currentRow.value.__modifiedFields.indexOf(prop);
|
|
|
|
|
- if (index !== -1) {
|
|
|
|
|
- currentRow.value.__modifiedFields.splice(index, 1);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- dialogVisible.value = false;
|
|
|
|
|
-};
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-const openDialog = ref(false);
|
|
|
|
|
|
|
+// 初期ロード完了フラグ
|
|
|
const initLoadingCompleted = ref(false);
|
|
const initLoadingCompleted = ref(false);
|
|
|
|
|
+// リストロード中フラグ
|
|
|
const listLoading = ref(false);
|
|
const listLoading = ref(false);
|
|
|
-const submitFormLoading = ref(false);
|
|
|
|
|
-
|
|
|
|
|
-const listTotalCnt = ref(0);
|
|
|
|
|
-const dialogTitle = ref("");
|
|
|
|
|
|
|
|
|
|
-const data = reactive({
|
|
|
|
|
- form: {},
|
|
|
|
|
- queryParams: {
|
|
|
|
|
- pageNum: 1,
|
|
|
|
|
- pageSize: 10,
|
|
|
|
|
- certificationType: null,
|
|
|
|
|
- examName: null,
|
|
|
|
|
- },
|
|
|
|
|
- rules: {
|
|
|
|
|
- certificationType: [{required: true, message: formatMsg('E0003', "検定種類"), trigger: 'blur'}],
|
|
|
|
|
- examName: [{required: true, message: formatMsg('E0003', "試験名"), trigger: 'blur'}],
|
|
|
|
|
- }
|
|
|
|
|
-});
|
|
|
|
|
|
|
+// フォームデータ
|
|
|
|
|
+const data = reactive({});
|
|
|
|
|
|
|
|
|
|
+// フォームデータの参照
|
|
|
const {queryParams, form, rules} = toRefs(data);
|
|
const {queryParams, form, rules} = toRefs(data);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 日付に対応する曜日文字列を取得する関数
|
|
|
|
|
+ */
|
|
|
const getElement = (num) => {
|
|
const getElement = (num) => {
|
|
|
const index = num - 1;
|
|
const index = num - 1;
|
|
|
return originalDataList.value[index]?.runWeekDayStr || '';
|
|
return originalDataList.value[index]?.runWeekDayStr || '';
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 検定種類マスタリストを取得
|
|
|
|
|
|
|
+ * 注文指示書データを取得する関数
|
|
|
|
|
+ * APIからデータを取得し、テーブルに表示するための加工を行います
|
|
|
*/
|
|
*/
|
|
|
const getList = () => {
|
|
const getList = () => {
|
|
|
listLoading.value = true;
|
|
listLoading.value = true;
|
|
|
const data = { orderId };
|
|
const data = { orderId };
|
|
|
getOrderCompilation(data).then(response => {
|
|
getOrderCompilation(data).then(response => {
|
|
|
const originalData = response.data;
|
|
const originalData = response.data;
|
|
|
- const filteredData = originalData.filter(item => {
|
|
|
|
|
|
|
+ // monthPlanIdが存在するデータのみを抽出
|
|
|
|
|
+ const filteredData = originalData.filter(item => {
|
|
|
return item.monthPlanId !== undefined && item.monthPlanId !== null && item.monthPlanId !== '';
|
|
return item.monthPlanId !== undefined && item.monthPlanId !== null && item.monthPlanId !== '';
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- originalDataLength.value = filteredData.length;
|
|
|
|
|
originalDataList.value = filteredData;
|
|
originalDataList.value = filteredData;
|
|
|
|
|
+ // 重複データを除外
|
|
|
const uniqueData = Array.from(
|
|
const uniqueData = Array.from(
|
|
|
new Map(originalData.map(item => [item.orderId, item])).values()
|
|
new Map(originalData.map(item => [item.orderId, item])).values()
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- // 初始化处理后的数据
|
|
|
|
|
|
|
+ // データを初期化して表示用リストにセット
|
|
|
examKindList.value = initializeData(uniqueData);
|
|
examKindList.value = initializeData(uniqueData);
|
|
|
listLoading.value = false;
|
|
listLoading.value = false;
|
|
|
initLoadingCompleted.value = true;
|
|
initLoadingCompleted.value = true;
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 元データから指定インデックスのデータを取得する関数
|
|
|
|
|
+ */
|
|
|
const getOriginalDataByIndex = (index) => {
|
|
const getOriginalDataByIndex = (index) => {
|
|
|
return originalDataList.value[index]?.originalData || '';
|
|
return originalDataList.value[index]?.originalData || '';
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 新規データから指定インデックスのデータを取得する関数
|
|
|
|
|
+ */
|
|
|
const getNewDataByIndex = (index) => {
|
|
const getNewDataByIndex = (index) => {
|
|
|
return originalDataList.value[index]?.newData || '';
|
|
return originalDataList.value[index]?.newData || '';
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+// コンポーネント初期化時にデータを取得
|
|
|
getList();
|
|
getList();
|
|
|
</script>
|
|
</script>
|
|
|
<style>
|
|
<style>
|
|
|
-.eikin-dialog-edit {
|
|
|
|
|
- .el-form-item:not(.is-required) {
|
|
|
|
|
- .el-form-item__label {
|
|
|
|
|
- text-indent: 13px;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
.custom-add-btn {
|
|
.custom-add-btn {
|
|
|
position: relative; top: 5px;
|
|
position: relative; top: 5px;
|
|
|
color: #0066cc;
|
|
color: #0066cc;
|