优化
This commit is contained in:
@ -90,14 +90,7 @@
|
|||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['formalities:formalitiesAreConsolidated:edit']"
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['formalities:formalitiesAreConsolidated:edit']"
|
||||||
>修改</el-button
|
>修改</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button link type="primary" icon="Upload" @click="handleUpload(scope.row)">上传</el-button>
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
icon="Upload"
|
|
||||||
@click="handleUpload(scope.row)"
|
|
||||||
v-hasPermi="['formalities:formalitiesAreConsolidated:edit']"
|
|
||||||
>上传</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
|
@ -6,7 +6,14 @@
|
|||||||
<h2 class="text-2xl font-bold flex items-center"><i class="el-icon-user-circle mr-3"></i>人员配置</h2>
|
<h2 class="text-2xl font-bold flex items-center"><i class="el-icon-user-circle mr-3"></i>人员配置</h2>
|
||||||
<p class="text-blue-100 mt-2 opacity-90">请配置采购专员信息</p>
|
<p class="text-blue-100 mt-2 opacity-90">请配置采购专员信息</p>
|
||||||
<!-- ,带 <span class="text-red-300">*</span> 为必填项 -->
|
<!-- ,带 <span class="text-red-300">*</span> 为必填项 -->
|
||||||
<el-button @click="isDisabled = false" class="px-8 py-2.5 transition-all duration-300 font-medium" v-if="isDisabled"> 点击编辑 </el-button>
|
<el-button
|
||||||
|
@click="isDisabled = false"
|
||||||
|
class="px-8 py-2.5 transition-all duration-300 font-medium"
|
||||||
|
v-if="isDisabled"
|
||||||
|
v-hasPermi="['cailiaoshebei:purchaseUser:addOrUpdate']"
|
||||||
|
>
|
||||||
|
点击编辑
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 表单内容区域 -->
|
<!-- 表单内容区域 -->
|
||||||
@ -31,6 +38,7 @@
|
|||||||
@click="submitForm"
|
@click="submitForm"
|
||||||
icon="Check"
|
icon="Check"
|
||||||
class="px-8 py-2.5 transition-all duration-300 transform hover:scale-105 bg-blue-500 hover:bg-blue-600 text-white font-medium"
|
class="px-8 py-2.5 transition-all duration-300 transform hover:scale-105 bg-blue-500 hover:bg-blue-600 text-white font-medium"
|
||||||
|
v-hasPermi="['cailiaoshebei:purchaseUser:addOrUpdate']"
|
||||||
>
|
>
|
||||||
确认提交
|
确认提交
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -7,10 +7,26 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5" :offset="0"
|
<el-col :span="1.5" :offset="0"
|
||||||
><el-button type="primary" size="default" @click="handleAdd" icon="FolderAdd" plain>新增</el-button></el-col
|
><el-button
|
||||||
|
type="primary"
|
||||||
|
v-hasPermi="['cailiaoshebei:materialbatchdemandplan:add']"
|
||||||
|
size="default"
|
||||||
|
@click="handleAdd"
|
||||||
|
icon="FolderAdd"
|
||||||
|
plain
|
||||||
|
>新增</el-button
|
||||||
|
></el-col
|
||||||
>
|
>
|
||||||
<el-col :span="1.5" :offset="0"
|
<el-col :span="1.5" :offset="0"
|
||||||
><el-button type="danger" size="default" @click="handleDeleteBatch" icon="FolderDelete" plain>删除</el-button></el-col
|
><el-button
|
||||||
|
type="danger"
|
||||||
|
size="default"
|
||||||
|
v-hasPermi="['cailiaoshebei:batchPlan:remove']"
|
||||||
|
@click="handleDeleteBatch"
|
||||||
|
icon="FolderDelete"
|
||||||
|
plain
|
||||||
|
>删除</el-button
|
||||||
|
></el-col
|
||||||
>
|
>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@ -159,17 +175,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Cailiaoshebei" lang="ts">
|
<script setup name="Cailiaoshebei" lang="ts">
|
||||||
import {
|
import { getCailiaoshebei, updateCailiaoshebei, listBatch, getBatch, delBatch, listSelectCailiaoshebei } from '@/api/materials/batchPlan';
|
||||||
listCailiaoshebei,
|
|
||||||
getCailiaoshebei,
|
|
||||||
delCailiaoshebei,
|
|
||||||
addCailiaoshebei,
|
|
||||||
updateCailiaoshebei,
|
|
||||||
listBatch,
|
|
||||||
getBatch,
|
|
||||||
delBatch,
|
|
||||||
listSelectCailiaoshebei
|
|
||||||
} from '@/api/materials/batchPlan';
|
|
||||||
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types';
|
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types';
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
|
||||||
@ -374,23 +380,6 @@ const handleUpdata = () => {
|
|||||||
dialog.title = '修改物资-需求';
|
dialog.title = '修改物资-需求';
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
const submitForm = async () => {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
cailiaoshebeiList.value.forEach((item) => {
|
|
||||||
if (item.id) {
|
|
||||||
delete item.id;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
await addCailiaoshebei({
|
|
||||||
addDataList: cailiaoshebeiList.value,
|
|
||||||
batchNumber: form.value.batchNumber,
|
|
||||||
projectId: currentProject.value?.id
|
|
||||||
} as any).finally(() => (buttonLoading.value = false));
|
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
|
||||||
dialog.visible = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 提交数据 */
|
/** 提交数据 */
|
||||||
const submitTransferForm = async () => {
|
const submitTransferForm = async () => {
|
||||||
const result = validateAndClean(form.value.planList);
|
const result = validateAndClean(form.value.planList);
|
||||||
|
@ -1,120 +1,117 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-5">
|
<div class="p-5">
|
||||||
<el-card class="mb-5">
|
<el-card class="mb-5">
|
||||||
<el-button type="primary" icon="Plus" @click="handleAdd"
|
<el-button type="primary" icon="Plus" @click="handleAdd" class="transition-all duration-200 hover:shadow-md"> 新增 </el-button>
|
||||||
class="transition-all duration-200 hover:shadow-md">
|
<el-button icon="Refresh" @click="refreshData" class="transition-all duration-200 hover:shadow-md"> 刷新 </el-button>
|
||||||
新增
|
</el-card>
|
||||||
</el-button>
|
<div class="bg-white rounded-lg shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
|
||||||
<el-button icon="Refresh" @click="refreshData" class="transition-all duration-200 hover:shadow-md">
|
<!-- 数据表格 -->
|
||||||
刷新
|
<el-table
|
||||||
</el-button>
|
v-loading="loading"
|
||||||
</el-card>
|
:data="tableData"
|
||||||
<div class="bg-white rounded-lg shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
|
stripe
|
||||||
<!-- 数据表格 -->
|
:header-cell-style="{ 'background-color': '#f5f7fa', 'font-weight': 'bold' }"
|
||||||
<el-table v-loading="loading" :data="tableData" stripe
|
style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)"
|
||||||
:header-cell-style="{ 'background-color': '#f5f7fa', 'font-weight': 'bold' }"
|
:row-class-name="tableRowClassName"
|
||||||
style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)"
|
>
|
||||||
:row-class-name="tableRowClassName">
|
<!-- 基础信息列 -->
|
||||||
<!-- 基础信息列 -->
|
<el-table-column prop="id" label="ID" width="180" align="center"></el-table-column>
|
||||||
<el-table-column prop="id" label="ID" width="180" align="center"></el-table-column>
|
<el-table-column prop="batch" label="批次" align="center"></el-table-column>
|
||||||
<el-table-column prop="batch" label="批次" align="center"></el-table-column>
|
<el-table-column prop="physicalsupplyId" label="使用情况ID" width="180" align="center"></el-table-column>
|
||||||
<el-table-column prop="physicalsupplyId" label="使用情况ID" width="180" align="center"></el-table-column>
|
<!-- 时间相关列 -->
|
||||||
<!-- 时间相关列 -->
|
<el-table-column prop="issuanceTime" label="联系单下达时间" min-width="160" align="center">
|
||||||
<el-table-column prop="issuanceTime" label="联系单下达时间" min-width="160" align="center">
|
<template #default="scope">
|
||||||
<template #default="scope">
|
{{ formatDate(scope.row.issuanceTime) }}
|
||||||
{{ formatDate(scope.row.issuanceTime) }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column prop="requireDelivery" label="要求到货时间" min-width="160" align="center">
|
||||||
<el-table-column prop="requireDelivery" label="要求到货时间" min-width="160" align="center">
|
<template #default="scope">
|
||||||
<template #default="scope">
|
{{ formatDate(scope.row.requireDelivery) }}
|
||||||
{{ formatDate(scope.row.requireDelivery) }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column prop="scheduledDelivery" label="计划到货时间" min-width="160" align="center">
|
||||||
<el-table-column prop="scheduledDelivery" label="计划到货时间" min-width="160" align="center">
|
<template #default="scope">
|
||||||
<template #default="scope">
|
{{ formatDate(scope.row.scheduledDelivery) }}
|
||||||
{{ formatDate(scope.row.scheduledDelivery) }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column prop="actualDelivery" label="实际到货时间" min-width="160" align="center">
|
||||||
<el-table-column prop="actualDelivery" label="实际到货时间" min-width="160" align="center">
|
<template #default="scope">
|
||||||
<template #default="scope">
|
{{ formatDate(scope.row.actualDelivery) }}
|
||||||
{{ formatDate(scope.row.actualDelivery) }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column prop="acceptanceCheck" label="验收移交时间" min-width="160" align="center">
|
||||||
<el-table-column prop="acceptanceCheck" label="验收移交时间" min-width="160" align="center">
|
<template #default="scope">
|
||||||
<template #default="scope">
|
{{ formatDate(scope.row.acceptanceCheck) }}
|
||||||
{{ formatDate(scope.row.acceptanceCheck) }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<!-- 数量相关列 -->
|
<!-- 数量相关列 -->
|
||||||
<el-table-column prop="requiredQuantity" label="要求到货数量" min-width="120" align="right"></el-table-column>
|
<el-table-column prop="requiredQuantity" label="要求到货数量" min-width="120" align="right"></el-table-column>
|
||||||
<el-table-column prop="plannedQuantity" label="计划到货数量" min-width="120" align="right"></el-table-column>
|
<el-table-column prop="plannedQuantity" label="计划到货数量" min-width="120" align="right"></el-table-column>
|
||||||
<el-table-column prop="actualAcceptance" label="实际验收数量" min-width="120" align="right"></el-table-column>
|
<el-table-column prop="actualAcceptance" label="实际验收数量" min-width="120" align="right"></el-table-column>
|
||||||
<el-table-column prop="differenceQuantity" label="差异量" min-width="100" align="right">
|
<el-table-column prop="differenceQuantity" label="差异量" min-width="100" align="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span
|
<span :class="scope.row.differenceQuantity && parseFloat(scope.row.differenceQuantity) !== 0 ? 'text-red-500' : ''">
|
||||||
:class="scope.row.differenceQuantity && parseFloat(scope.row.differenceQuantity) !== 0 ? 'text-red-500' : ''">
|
{{ scope.row.differenceQuantity || '-' }}
|
||||||
{{ scope.row.differenceQuantity || '-' }}
|
</span>
|
||||||
</span>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column prop="dhDifferenceQuantity" label="到货差异量" min-width="120" align="right"></el-table-column>
|
||||||
<el-table-column prop="dhDifferenceQuantity" label="到货差异量" min-width="120"
|
|
||||||
align="right"></el-table-column>
|
|
||||||
|
|
||||||
<!-- 金额相关列 -->
|
<!-- 金额相关列 -->
|
||||||
<el-table-column prop="cargoAmount" label="货物金额" min-width="120" align="right">
|
<el-table-column prop="cargoAmount" label="货物金额" min-width="120" align="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.cargoAmount }}
|
{{ scope.row.cargoAmount }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="advance" label="预付款" min-width="100" align="right">
|
<el-table-column prop="advance" label="预付款" min-width="100" align="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.advance }}
|
{{ scope.row.advance }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="feed" label="投料款" min-width="100" align="right">
|
<el-table-column prop="feed" label="投料款" min-width="100" align="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.feed }}
|
{{ scope.row.feed }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="acceptancePayment" label="到货验收款" min-width="120" align="right">
|
<el-table-column prop="acceptancePayment" label="到货验收款" min-width="120" align="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.acceptancePayment }}
|
{{ scope.row.acceptancePayment }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="debugging" label="调试款" min-width="100" align="right">
|
<el-table-column prop="debugging" label="调试款" min-width="100" align="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.debugging }}
|
{{ scope.row.debugging }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="qualityGuarantee" label="质保金" min-width="100" align="right">
|
<el-table-column prop="qualityGuarantee" label="质保金" min-width="100" align="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.qualityGuarantee }}
|
{{ scope.row.qualityGuarantee }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="settlementAmount" label="结算金额" min-width="120" align="right">
|
<el-table-column prop="settlementAmount" label="结算金额" min-width="120" align="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.settlementAmount }}
|
{{ scope.row.settlementAmount }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<!-- 状态和备注列 -->
|
<!-- 状态和备注列 -->
|
||||||
<el-table-column prop="expectedState" label="逾期状态" min-width="100" align="center">
|
<el-table-column prop="expectedState" label="逾期状态" min-width="100" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<!-- :type="getTagType(scope.row.expectedState)" -->
|
<!-- :type="getTagType(scope.row.expectedState)" -->
|
||||||
<el-tag :effect="scope.row.expectedState ? 'dark' : 'plain'">
|
<el-tag :effect="scope.row.expectedState ? 'dark' : 'plain'">
|
||||||
{{ scope.row.expectedState || '-' }}
|
{{ scope.row.expectedState || '-' }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="associate" label="交接方式" min-width="120"></el-table-column>
|
<el-table-column prop="associate" label="交接方式" min-width="120"></el-table-column>
|
||||||
<el-table-column prop="deliveryRequirements" label="到货要求" min-width="150"></el-table-column>
|
<el-table-column prop="deliveryRequirements" label="到货要求" min-width="150"></el-table-column>
|
||||||
<el-table-column prop="transition" label="转换为合同" min-width="120" align="center">
|
<el-table-column prop="transition" label="转换为合同" min-width="120" align="center">
|
||||||
<!-- <template #default="scope"> -->
|
<!-- <template #default="scope"> -->
|
||||||
<!-- <el-switch v-model="scope.row.transition" active-value="是" inactive-value="否"
|
<!-- <el-switch v-model="scope.row.transition" active-value="是" inactive-value="否"
|
||||||
@change="handleTransitionChange(scope.row)"></el-switch> -->
|
@change="handleTransitionChange(scope.row)"></el-switch> -->
|
||||||
<!-- </template> -->
|
<!-- </template> -->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<!-- 备注信息列(可展开) -->
|
<!-- 备注信息列(可展开) -->
|
||||||
<el-table-column label="备注信息" min-width="120">
|
<el-table-column label="备注信息" min-width="120">
|
||||||
@ -137,27 +134,28 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<!-- 操作列 -->
|
<!-- 操作列 -->
|
||||||
<el-table-column label="操作" min-width="120" align="center" fixed="right">
|
<el-table-column label="操作" min-width="120" align="center" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" icon="Edit" @click="handleEdit2(scope.row)"
|
<el-button
|
||||||
class="text-blue-600 hover:text-blue-800 transition-colors"></el-button>
|
size="small"
|
||||||
<el-button size="small" icon="Delete" @click="handleDelete2(scope.row)"
|
icon="Edit"
|
||||||
class="text-red-600 hover:text-red-800 transition-colors"></el-button>
|
@click="handleEdit2(scope.row)"
|
||||||
</template>
|
class="text-blue-600 hover:text-blue-800 transition-colors"
|
||||||
</el-table-column>
|
></el-button>
|
||||||
</el-table>
|
<el-button
|
||||||
<!-- 分页 -->
|
size="small"
|
||||||
<div class="flex flex-wrap items-center justify-between p-4 border-t gap-4">
|
icon="Delete"
|
||||||
<div class="text-gray-500 text-sm">
|
@click="handleDelete2(scope.row)"
|
||||||
共 {{ total }} 条记录,当前显示第 {{ (currentPage - 1) * pageSize + 1 }} 至 {{
|
class="text-red-600 hover:text-red-800 transition-colors"
|
||||||
Math.min(currentPage * pageSize, total)
|
></el-button>
|
||||||
}} 条
|
</template>
|
||||||
</div>
|
</el-table-column>
|
||||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
|
</el-table>
|
||||||
:page-sizes="[10, 20, 50, 100]" :total="total" layout="prev, pager, next, jumper, sizes"
|
<!-- 分页 -->
|
||||||
@size-change="handleSizeChange" @current-change="handleCurrentChange" small></el-pagination>
|
<div class="flex flex-wrap items-center justify-between p-4 border-t gap-4">
|
||||||
</div>
|
<div class="text-gray-500 text-sm">
|
||||||
|
共 {{ total }} 条记录,当前显示第 {{ (currentPage - 1) * pageSize + 1 }} 至 {{ Math.min(currentPage * pageSize, total) }} 条
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="dialogVisible2" :title="dialogType2 === 'addSon' ? '新增采购信息' : '编辑采购信息'" :width="dialogWidth"
|
<el-dialog v-model="dialogVisible2" :title="dialogType2 === 'addSon' ? '新增采购信息' : '编辑采购信息'" :width="dialogWidth"
|
||||||
:fullscreen="isFullscreen" :close-on-click-modal="false" :before-close="handleClose" destroy-on-close>
|
:fullscreen="isFullscreen" :close-on-click-modal="false" :before-close="handleClose" destroy-on-close>
|
||||||
@ -373,7 +371,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, toRaw, getCurrentInstance } from 'vue';
|
import { ref, reactive, onMounted, toRaw, getCurrentInstance } from 'vue';
|
||||||
import { materialsUsageDetails, materialsSonAdd, materialsSonDel, materialsSonEdit } from "@/api/materials/usageMaterials/index";
|
import { materialsUsageDetails, materialsSonAdd, materialsSonDel, materialsSonEdit } from '@/api/materials/usageMaterials/index';
|
||||||
import { routerRename } from '@/api/air';
|
import { routerRename } from '@/api/air';
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const dialogVisible2 = ref(false);
|
const dialogVisible2 = ref(false);
|
||||||
@ -383,162 +381,174 @@ const currentRow2 = ref(null);
|
|||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const submitLoading = ref(false);
|
const submitLoading = ref(false);
|
||||||
const routeParams = ref({})
|
const routeParams = ref({});
|
||||||
const currentPage = ref(1);
|
const currentPage = ref(1);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const pageSize = ref(10);
|
const pageSize = ref(10);
|
||||||
const formRef = ref(null);
|
const formRef = ref(null);
|
||||||
const deleteLoading = ref(false);
|
const deleteLoading = ref(false);
|
||||||
const tableRowClassName = ({ row, rowIndex }) => {
|
const tableRowClassName = ({ row, rowIndex }) => {
|
||||||
return rowIndex % 2 === 0 ? 'bg-white' : 'bg-gray-50';
|
return rowIndex % 2 === 0 ? 'bg-white' : 'bg-gray-50';
|
||||||
};
|
};
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
id: '',
|
id: '',
|
||||||
acceptanceCheck: '',
|
acceptanceCheck: '',
|
||||||
acceptancePayment: '',
|
acceptancePayment: '',
|
||||||
actualAcceptance: '',
|
actualAcceptance: '',
|
||||||
actualDelivery: '',
|
actualDelivery: '',
|
||||||
advance: '',
|
advance: '',
|
||||||
associate: '',
|
associate: '',
|
||||||
batch: '',
|
batch: '',
|
||||||
cargoAmount: '',
|
cargoAmount: '',
|
||||||
cgRemark: '',
|
cgRemark: '',
|
||||||
createTime: '',
|
createTime: '',
|
||||||
debugging: '',
|
debugging: '',
|
||||||
deliveryRequirements: '',
|
deliveryRequirements: '',
|
||||||
dhDifferenceQuantity: '',
|
dhDifferenceQuantity: '',
|
||||||
dhRemark: '',
|
dhRemark: '',
|
||||||
differenceQuantity: '',
|
differenceQuantity: '',
|
||||||
expectedState: '',
|
expectedState: '',
|
||||||
feed: '',
|
feed: '',
|
||||||
gysRemark: '',
|
gysRemark: '',
|
||||||
issuanceTime: '',
|
issuanceTime: '',
|
||||||
jsRemark: '',
|
jsRemark: '',
|
||||||
physicalsupplyId: null,
|
physicalsupplyId: null,
|
||||||
plannedQuantity: '',
|
plannedQuantity: '',
|
||||||
qualityGuarantee: '',
|
qualityGuarantee: '',
|
||||||
requireDelivery: '',
|
requireDelivery: '',
|
||||||
requiredQuantity: '',
|
requiredQuantity: '',
|
||||||
scheduledDelivery: '',
|
scheduledDelivery: '',
|
||||||
settlementAmount: '',
|
settlementAmount: '',
|
||||||
transition: '',
|
transition: '',
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: ''
|
updateTime: ''
|
||||||
});
|
});
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
dialogVisible2.value = true;
|
dialogVisible2.value = true;
|
||||||
dialogType2.value = 'addSon';
|
dialogType2.value = 'addSon';
|
||||||
resetForm();
|
resetForm();
|
||||||
}
|
};
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
if (formRef.value) {
|
if (formRef.value) {
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重置表单数据
|
// 重置表单数据
|
||||||
Object.keys(form).forEach(key => {
|
Object.keys(form).forEach((key) => {
|
||||||
form[key] = '';
|
form[key] = '';
|
||||||
});
|
});
|
||||||
|
|
||||||
// 设置默认值
|
// 设置默认值
|
||||||
form.findType = 1;
|
form.findType = 1;
|
||||||
form.id = '';
|
form.id = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEdit2 = (row) => {
|
const handleEdit2 = (row) => {
|
||||||
dialogType2.value = 'editSon';
|
dialogType2.value = 'editSon';
|
||||||
currentRow2.value = row;
|
currentRow2.value = row;
|
||||||
resetForm();
|
resetForm();
|
||||||
|
|
||||||
// 填充表单数据
|
// 填充表单数据
|
||||||
Object.keys(form).forEach(key => {
|
Object.keys(form).forEach((key) => {
|
||||||
if (row.hasOwnProperty(key)) {
|
if (row.hasOwnProperty(key)) {
|
||||||
form[key] = row[key];
|
form[key] = row[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
dialogVisible2.value = true;
|
dialogVisible2.value = true;
|
||||||
};
|
};
|
||||||
const handleDelete2 = (row) => {
|
const handleDelete2 = (row) => {
|
||||||
currentRow2.value = row;
|
currentRow2.value = row;
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm('确定要删除这条记录吗?此操作不可撤销,请谨慎操作', '提示', {
|
||||||
'确定要删除这条记录吗?此操作不可撤销,请谨慎操作',
|
confirmButtonText: '确认',
|
||||||
'提示',
|
cancelButtonText: '取消',
|
||||||
{
|
type: 'warning'
|
||||||
confirmButtonText: '确认',
|
})
|
||||||
cancelButtonText: '取消',
|
.then(() => {
|
||||||
type: 'warning',
|
confirmDelete();
|
||||||
}
|
|
||||||
).then(() => {
|
|
||||||
confirmDelete();
|
|
||||||
}).catch(() => {
|
|
||||||
ElMessage({
|
|
||||||
type: 'info',
|
|
||||||
message: '已取消删除',
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
.catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消删除'
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const confirmDelete = async () => {
|
const confirmDelete = async () => {
|
||||||
if (!currentRow2.value) return;
|
if (!currentRow2.value) return;
|
||||||
|
|
||||||
deleteLoading.value = true;
|
deleteLoading.value = true;
|
||||||
try {
|
try {
|
||||||
// 模拟API请求
|
// 模拟API请求
|
||||||
const res = await materialsSonDel(currentRow2.value.id)
|
const res = await materialsSonDel(currentRow2.value.id);
|
||||||
const { code } = res;
|
const { code } = res;
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
ElMessage.success('删除成功');
|
ElMessage.success('删除成功');
|
||||||
deleteDialogVisible2.value = false;
|
deleteDialogVisible2.value = false;
|
||||||
materialsUsageDetails1();
|
materialsUsageDetails1();
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error('删除失败');
|
ElMessage.error('删除失败');
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
ElMessage.error('删除失败:' + error.message);
|
|
||||||
console.error(error);
|
|
||||||
} finally {
|
|
||||||
deleteLoading.value = false;
|
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error('删除失败:' + error.message);
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
deleteLoading.value = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
if (!formRef.value) return;
|
if (!formRef.value) return;
|
||||||
// 表单验证
|
// 表单验证
|
||||||
const valid = await formRef.value.validate();
|
const valid = await formRef.value.validate();
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
|
|
||||||
submitLoading.value = true;
|
submitLoading.value = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 准备提交的数据
|
// 准备提交的数据
|
||||||
const submitData = { ...toRaw(form) };
|
const submitData = { ...toRaw(form) };
|
||||||
|
|
||||||
// 如果是新增,清除id
|
// 如果是新增,清除id
|
||||||
if (dialogType2.value === 'addSon') {
|
if (dialogType2.value === 'addSon') {
|
||||||
submitData.physicalsupplyId = routeParams.value.id
|
submitData.physicalsupplyId = routeParams.value.id;
|
||||||
const res = await materialsSonAdd(submitData)
|
const res = await materialsSonAdd(submitData);
|
||||||
const { code } = res;
|
const { code } = res;
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
ElMessage.success('新增成功');
|
ElMessage.success('新增成功');
|
||||||
materialsUsageDetails1();
|
materialsUsageDetails1();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const res = await materialsSonEdit(submitData)
|
const res = await materialsSonEdit(submitData);
|
||||||
const { code } = res;
|
const { code } = res;
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
ElMessage.success('保存成功');
|
ElMessage.success('保存成功');
|
||||||
materialsUsageDetails1();
|
materialsUsageDetails1();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// 重置表单
|
|
||||||
resetForm();
|
|
||||||
} catch (error) {
|
|
||||||
ElMessage.error(`${dialogType2 === 'addSon' ? '新增' : '保存'}失败: ${error.message}`);
|
|
||||||
} finally {
|
|
||||||
submitLoading.value = false;
|
|
||||||
dialogVisible2.value = false;
|
|
||||||
}
|
}
|
||||||
|
// 重置表单
|
||||||
|
resetForm();
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error(`${dialogType2 === 'addSon' ? '新增' : '保存'}失败: ${error.message}`);
|
||||||
|
} finally {
|
||||||
|
submitLoading.value = false;
|
||||||
|
dialogVisible2.value = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const materialsUsageDetails1 = () => {
|
const materialsUsageDetails1 = () => {
|
||||||
|
<<<<<<< HEAD
|
||||||
|
loading.value = true;
|
||||||
|
materialsUsageDetails({ physicalsupplyId: routeParams.value.id })
|
||||||
|
.then((res) => {
|
||||||
|
tableData.value = res.rows;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
loading.value = false;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
=======
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
materialsUsageDetails({ physicalsupplyId: routeParams.value.id }).then(res => {
|
materialsUsageDetails({ physicalsupplyId: routeParams.value.id }).then(res => {
|
||||||
tableData.value = res.rows
|
tableData.value = res.rows
|
||||||
@ -548,32 +558,34 @@ const materialsUsageDetails1 = () => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
>>>>>>> 8f9972343a005ce4424fbf2e3b2388060c854b5f
|
||||||
// 格式化日期
|
// 格式化日期
|
||||||
const formatDate = (dateString) => {
|
const formatDate = (dateString) => {
|
||||||
if (!dateString) return '-';
|
if (!dateString) return '-';
|
||||||
const date = new Date(dateString);
|
const date = new Date(dateString);
|
||||||
return date.toLocaleString('zh-CN', {
|
return date
|
||||||
year: 'numeric',
|
.toLocaleString('zh-CN', {
|
||||||
month: '2-digit',
|
year: 'numeric',
|
||||||
day: '2-digit',
|
month: '2-digit',
|
||||||
hour: '2-digit',
|
day: '2-digit',
|
||||||
minute: '2-digit',
|
hour: '2-digit',
|
||||||
second: '2-digit'
|
minute: '2-digit',
|
||||||
}).replace(',', ' ');
|
second: '2-digit'
|
||||||
|
})
|
||||||
|
.replace(',', ' ');
|
||||||
};
|
};
|
||||||
function handleCancel() {
|
function handleCancel() {
|
||||||
dialogVisible2.value = false;
|
dialogVisible2.value = false;
|
||||||
currentRow2.value = null;
|
currentRow2.value = null;
|
||||||
}
|
}
|
||||||
const refreshData = () => {
|
const refreshData = () => {
|
||||||
materialsUsageDetails1();
|
materialsUsageDetails1();
|
||||||
ElMessage.success('数据已刷新');
|
ElMessage.success('数据已刷新');
|
||||||
};
|
};
|
||||||
function handleSizeChange() { }
|
function handleSizeChange() {}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
routeParams.value = proxy.$route.query;
|
routeParams.value = proxy.$route.query;
|
||||||
console.log('routeParams.value', routeParams.value);
|
console.log('routeParams.value', routeParams.value);
|
||||||
materialsUsageDetails1();
|
materialsUsageDetails1();
|
||||||
})
|
});
|
||||||
|
</script>
|
||||||
</script>
|
|
||||||
|
Reference in New Issue
Block a user