合并
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
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Upload"
|
||||
@click="handleUpload(scope.row)"
|
||||
v-hasPermi="['formalities:formalitiesAreConsolidated:edit']"
|
||||
>上传</el-button
|
||||
>
|
||||
<el-button link type="primary" icon="Upload" @click="handleUpload(scope.row)">上传</el-button>
|
||||
<el-button
|
||||
link
|
||||
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>
|
||||
<p class="text-blue-100 mt-2 opacity-90">请配置采购专员信息</p>
|
||||
<!-- ,带 <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>
|
||||
|
||||
<!-- 表单内容区域 -->
|
||||
@ -31,6 +38,7 @@
|
||||
@click="submitForm"
|
||||
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"
|
||||
v-hasPermi="['cailiaoshebei:purchaseUser:addOrUpdate']"
|
||||
>
|
||||
确认提交
|
||||
</el-button>
|
||||
|
@ -7,10 +7,26 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<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-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>
|
||||
</template>
|
||||
@ -159,17 +175,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Cailiaoshebei" lang="ts">
|
||||
import {
|
||||
listCailiaoshebei,
|
||||
getCailiaoshebei,
|
||||
delCailiaoshebei,
|
||||
addCailiaoshebei,
|
||||
updateCailiaoshebei,
|
||||
listBatch,
|
||||
getBatch,
|
||||
delBatch,
|
||||
listSelectCailiaoshebei
|
||||
} from '@/api/materials/batchPlan';
|
||||
import { getCailiaoshebei, updateCailiaoshebei, listBatch, getBatch, delBatch, listSelectCailiaoshebei } from '@/api/materials/batchPlan';
|
||||
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
|
||||
@ -374,23 +380,6 @@ const handleUpdata = () => {
|
||||
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 result = validateAndClean(form.value.planList);
|
||||
|
@ -1,20 +1,19 @@
|
||||
<template>
|
||||
<div class="p-5">
|
||||
<el-card class="mb-5">
|
||||
<el-button type="primary" icon="Plus" @click="handleAdd"
|
||||
class="transition-all duration-200 hover:shadow-md">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button icon="Refresh" @click="refreshData" class="transition-all duration-200 hover:shadow-md">
|
||||
刷新
|
||||
</el-button>
|
||||
<el-button type="primary" icon="Plus" @click="handleAdd" class="transition-all duration-200 hover:shadow-md"> 新增 </el-button>
|
||||
<el-button icon="Refresh" @click="refreshData" class="transition-all duration-200 hover:shadow-md"> 刷新 </el-button>
|
||||
</el-card>
|
||||
<div class="bg-white rounded-lg shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
|
||||
<!-- 数据表格 -->
|
||||
<el-table v-loading="loading" :data="tableData" stripe
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
stripe
|
||||
:header-cell-style="{ 'background-color': '#f5f7fa', 'font-weight': 'bold' }"
|
||||
style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)"
|
||||
:row-class-name="tableRowClassName">
|
||||
:row-class-name="tableRowClassName"
|
||||
>
|
||||
<!-- 基础信息列 -->
|
||||
<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>
|
||||
@ -52,14 +51,12 @@
|
||||
<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">
|
||||
<template #default="scope">
|
||||
<span
|
||||
:class="scope.row.differenceQuantity && parseFloat(scope.row.differenceQuantity) !== 0 ? 'text-red-500' : ''">
|
||||
<span :class="scope.row.differenceQuantity && parseFloat(scope.row.differenceQuantity) !== 0 ? 'text-red-500' : ''">
|
||||
{{ scope.row.differenceQuantity || '-' }}
|
||||
</span>
|
||||
</template>
|
||||
</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">
|
||||
@ -124,14 +121,10 @@
|
||||
<el-button size="small" type="text">查看详情</el-button>
|
||||
</template>
|
||||
<div class="space-y-2 text-sm">
|
||||
<p><span class="font-medium">采购备注:</span>{{ scope.row.cgRemark || '-' }}
|
||||
</p>
|
||||
<p><span class="font-medium">到货备注:</span>{{ scope.row.dhRemark || '-' }}
|
||||
</p>
|
||||
<p><span class="font-medium">供应商备注:</span>{{ scope.row.gysRemark || '-'
|
||||
}}</p>
|
||||
<p><span class="font-medium">结算备注:</span>{{ scope.row.jsRemark || '-' }}
|
||||
</p>
|
||||
<p><span class="font-medium">采购备注:</span>{{ scope.row.cgRemark || '-' }}</p>
|
||||
<p><span class="font-medium">到货备注:</span>{{ scope.row.dhRemark || '-' }}</p>
|
||||
<p><span class="font-medium">供应商备注:</span>{{ scope.row.gysRemark || '-' }}</p>
|
||||
<p><span class="font-medium">结算备注:</span>{{ scope.row.jsRemark || '-' }}</p>
|
||||
</div>
|
||||
</el-popover>
|
||||
</template>
|
||||
@ -140,28 +133,48 @@
|
||||
<!-- 操作列 -->
|
||||
<el-table-column label="操作" min-width="120" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button size="small" icon="Edit" @click="handleEdit2(scope.row)"
|
||||
class="text-blue-600 hover:text-blue-800 transition-colors"></el-button>
|
||||
<el-button size="small" icon="Delete" @click="handleDelete2(scope.row)"
|
||||
class="text-red-600 hover:text-red-800 transition-colors"></el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
icon="Edit"
|
||||
@click="handleEdit2(scope.row)"
|
||||
class="text-blue-600 hover:text-blue-800 transition-colors"
|
||||
></el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
icon="Delete"
|
||||
@click="handleDelete2(scope.row)"
|
||||
class="text-red-600 hover:text-red-800 transition-colors"
|
||||
></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<div class="flex flex-wrap items-center justify-between p-4 border-t gap-4">
|
||||
<div class="text-gray-500 text-sm">
|
||||
共 {{ total }} 条记录,当前显示第 {{ (currentPage - 1) * pageSize + 1 }} 至 {{
|
||||
Math.min(currentPage * pageSize, total)
|
||||
}} 条
|
||||
共 {{ total }} 条记录,当前显示第 {{ (currentPage - 1) * pageSize + 1 }} 至 {{ Math.min(currentPage * pageSize, total) }} 条
|
||||
</div>
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]" :total="total" layout="prev, pager, next, jumper, sizes"
|
||||
@size-change="handleSizeChange" @current-change="handleCurrentChange" small></el-pagination>
|
||||
<el-pagination
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:total="total"
|
||||
layout="prev, pager, next, jumper, sizes"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
small
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="dialogVisible2" :title="dialogType2 === 'addSon' ? '新增采购信息' : '编辑采购信息'" :width="dialogWidth"
|
||||
:fullscreen="isFullscreen" :close-on-click-modal="false" :before-close="handleClose" destroy-on-close>
|
||||
<el-dialog
|
||||
v-model="dialogVisible2"
|
||||
:title="dialogType2 === 'addSon' ? '新增采购信息' : '编辑采购信息'"
|
||||
:width="dialogWidth"
|
||||
:fullscreen="isFullscreen"
|
||||
:close-on-click-modal="false"
|
||||
:before-close="handleClose"
|
||||
destroy-on-close
|
||||
>
|
||||
<!-- 表单内容 -->
|
||||
<el-form ref="formRef" :model="form" :rules="formRules" label-width="140px" class="space-y-4">
|
||||
<!-- 第一行 -->
|
||||
@ -173,8 +186,12 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系单下达时间" prop="issuanceTime">
|
||||
<el-date-picker v-model="form.issuanceTime" type="datetime" placeholder="选择联系单下达时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="form.issuanceTime"
|
||||
type="datetime"
|
||||
placeholder="选择联系单下达时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -188,8 +205,12 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="要求到货时间" prop="requireDelivery">
|
||||
<el-date-picker v-model="form.requireDelivery" type="datetime" placeholder="选择要求到货时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="form.requireDelivery"
|
||||
type="datetime"
|
||||
placeholder="选择要求到货时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -203,8 +224,12 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划到货时间" prop="scheduledDelivery">
|
||||
<el-date-picker v-model="form.scheduledDelivery" type="datetime" placeholder="选择计划到货时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="form.scheduledDelivery"
|
||||
type="datetime"
|
||||
placeholder="选择计划到货时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -218,8 +243,12 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实际到货时间" prop="actualDelivery">
|
||||
<el-date-picker v-model="form.actualDelivery" type="datetime" placeholder="选择实际到货时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="form.actualDelivery"
|
||||
type="datetime"
|
||||
placeholder="选择实际到货时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -242,8 +271,12 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="验收移交时间" prop="acceptanceCheck">
|
||||
<el-date-picker v-model="form.acceptanceCheck" type="datetime" placeholder="选择验收移交时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="form.acceptanceCheck"
|
||||
type="datetime"
|
||||
placeholder="选择验收移交时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -321,8 +354,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="到货要求" prop="deliveryRequirements">
|
||||
<el-input v-model="form.deliveryRequirements" placeholder="请输入到货要求" type="textarea"
|
||||
rows="3"></el-input>
|
||||
<el-input v-model="form.deliveryRequirements" placeholder="请输入到货要求" type="textarea" rows="3"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -358,11 +390,8 @@
|
||||
<!-- 底部按钮 -->
|
||||
<template #footer>
|
||||
<div class="flex justify-end gap-3">
|
||||
<el-button @click="handleCancel" class="transition-all duration-200">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handleSubmit" :loading="submitLoading"
|
||||
class="transition-all duration-200">
|
||||
<el-button @click="handleCancel" class="transition-all duration-200"> 取消 </el-button>
|
||||
<el-button type="primary" @click="handleSubmit" :loading="submitLoading" class="transition-all duration-200">
|
||||
{{ dialogType2 === 'addSon' ? '新增' : '保存' }}
|
||||
</el-button>
|
||||
</div>
|
||||
@ -371,7 +400,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
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';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const dialogVisible2 = ref(false);
|
||||
@ -381,7 +410,7 @@ const currentRow2 = ref(null);
|
||||
const tableData = ref([]);
|
||||
const loading = ref(false);
|
||||
const submitLoading = ref(false);
|
||||
const routeParams = ref({})
|
||||
const routeParams = ref({});
|
||||
const currentPage = ref(1);
|
||||
const total = ref(0);
|
||||
const pageSize = ref(10);
|
||||
@ -427,14 +456,14 @@ const handleAdd = () => {
|
||||
dialogVisible2.value = true;
|
||||
dialogType2.value = 'addSon';
|
||||
resetForm();
|
||||
}
|
||||
};
|
||||
const resetForm = () => {
|
||||
if (formRef.value) {
|
||||
formRef.value.resetFields();
|
||||
}
|
||||
|
||||
// 重置表单数据
|
||||
Object.keys(form).forEach(key => {
|
||||
Object.keys(form).forEach((key) => {
|
||||
form[key] = '';
|
||||
});
|
||||
|
||||
@ -449,7 +478,7 @@ const handleEdit2 = (row) => {
|
||||
resetForm();
|
||||
|
||||
// 填充表单数据
|
||||
Object.keys(form).forEach(key => {
|
||||
Object.keys(form).forEach((key) => {
|
||||
if (row.hasOwnProperty(key)) {
|
||||
form[key] = row[key];
|
||||
}
|
||||
@ -459,22 +488,20 @@ const handleEdit2 = (row) => {
|
||||
};
|
||||
const handleDelete2 = (row) => {
|
||||
currentRow2.value = row;
|
||||
ElMessageBox.confirm(
|
||||
'确定要删除这条记录吗?此操作不可撤销,请谨慎操作',
|
||||
'提示',
|
||||
{
|
||||
ElMessageBox.confirm('确定要删除这条记录吗?此操作不可撤销,请谨慎操作', '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
confirmDelete();
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage({
|
||||
type: 'info',
|
||||
message: '已取消删除',
|
||||
})
|
||||
})
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
};
|
||||
const confirmDelete = async () => {
|
||||
if (!currentRow2.value) return;
|
||||
@ -482,7 +509,7 @@ const confirmDelete = async () => {
|
||||
deleteLoading.value = true;
|
||||
try {
|
||||
// 模拟API请求
|
||||
const res = await materialsSonDel(currentRow2.value.id)
|
||||
const res = await materialsSonDel(currentRow2.value.id);
|
||||
const { code } = res;
|
||||
if (code === 200) {
|
||||
ElMessage.success('删除成功');
|
||||
@ -512,15 +539,15 @@ const handleSubmit = async () => {
|
||||
|
||||
// 如果是新增,清除id
|
||||
if (dialogType2.value === 'addSon') {
|
||||
submitData.physicalsupplyId = routeParams.value.id
|
||||
const res = await materialsSonAdd(submitData)
|
||||
submitData.physicalsupplyId = routeParams.value.id;
|
||||
const res = await materialsSonAdd(submitData);
|
||||
const { code } = res;
|
||||
if (code === 200) {
|
||||
ElMessage.success('新增成功');
|
||||
materialsUsageDetails1();
|
||||
}
|
||||
} else {
|
||||
const res = await materialsSonEdit(submitData)
|
||||
const res = await materialsSonEdit(submitData);
|
||||
const { code } = res;
|
||||
if (code === 200) {
|
||||
ElMessage.success('保存成功');
|
||||
@ -538,26 +565,31 @@ const handleSubmit = async () => {
|
||||
};
|
||||
const materialsUsageDetails1 = () => {
|
||||
loading.value = true;
|
||||
materialsUsageDetails({ physicalsupplyId: routeParams.value.id }).then(res => {
|
||||
tableData.value = res.rows
|
||||
}).catch(() => {
|
||||
loading.value = false;
|
||||
}).finally(() => {
|
||||
materialsUsageDetails({ physicalsupplyId: routeParams.value.id })
|
||||
.then((res) => {
|
||||
tableData.value = res.rows;
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
})
|
||||
}
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
// 格式化日期
|
||||
const formatDate = (dateString) => {
|
||||
if (!dateString) return '-';
|
||||
const date = new Date(dateString);
|
||||
return date.toLocaleString('zh-CN', {
|
||||
return date
|
||||
.toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit'
|
||||
}).replace(',', ' ');
|
||||
})
|
||||
.replace(',', ' ');
|
||||
};
|
||||
function handleCancel() {
|
||||
dialogVisible2.value = false;
|
||||
@ -572,6 +604,5 @@ onMounted(() => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
console.log('routeParams.value', routeParams.value);
|
||||
materialsUsageDetails1();
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user