分项工程单价添加数量字段,完善物资-物料设备
This commit is contained in:
@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源项目管理平台
|
||||
VITE_APP_ENV = 'development'
|
||||
|
||||
# 开发环境
|
||||
VITE_APP_BASE_API = 'http://192.168.110.180:8899'
|
||||
VITE_APP_BASE_API = 'http://192.168.110.159:8898'
|
||||
|
||||
# 无人机接口地址
|
||||
|
||||
|
@ -57,7 +57,7 @@ export const updateCailiaoshebei = (data: CailiaoshebeiForm) => {
|
||||
*/
|
||||
export const delCailiaoshebei = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/cailiaoshebei/cailiaoshebei/' + id,
|
||||
url: '/cailiaoshebei/cailiaoshebei/remove/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
@ -81,6 +81,8 @@ export interface CailiaoshebeiForm extends BaseEntity {
|
||||
*/
|
||||
id?: string | number;
|
||||
projectId?: string | number;
|
||||
batchNumber?: string | number;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
|
@ -4,8 +4,8 @@
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="批次号" prop="batchId">
|
||||
<el-input v-model="queryParams.batchId" placeholder="请输入批次ID" clearable @keyup.enter="handleQuery" />
|
||||
<el-form-item label="批次号" prop="batchNumber">
|
||||
<el-input v-model="queryParams.batchNumber" placeholder="请输入批次ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供货商ID" prop="supplierId">
|
||||
<el-input v-model="queryParams.supplierId" placeholder="请输入供货商ID" clearable @keyup.enter="handleQuery" />
|
||||
@ -68,7 +68,7 @@
|
||||
<el-tree
|
||||
ref="batchTreeRef"
|
||||
class="mt-2"
|
||||
node-key="id"
|
||||
node-key="batchNumber"
|
||||
:data="batchOptions"
|
||||
:props="{ label: 'batchNumber', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
@ -148,7 +148,6 @@
|
||||
</el-table-column> -->
|
||||
<el-table-column label="计量单位" align="center" prop="unit" />
|
||||
<el-table-column label="计划数量" align="center" prop="plan" />
|
||||
<el-table-column label="实际数量" align="center" prop="realQuantity" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
@ -180,14 +179,16 @@
|
||||
<!-- 添加或修改物资-材料设备对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="cailiaoshebeiFormRef" :model="form" :rules="rules" label-width="110px">
|
||||
<el-form-item label="批次ID" prop="batchId">
|
||||
<el-input v-model="form.batchId" placeholder="请输入批次ID" disabled />
|
||||
<el-form-item label="批次号" prop="batchNumber">
|
||||
<el-input v-model="form.batchNumber" placeholder="请输入批次ID" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="供货商ID" prop="supplierId">
|
||||
<!-- <el-form-item label="供货商ID" prop="supplierId">
|
||||
<el-input v-model="form.supplierId" placeholder="请输入供货商ID" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="供货商" prop="supplier">
|
||||
<el-input v-model="form.supplier" placeholder="请输入供货商" />
|
||||
<el-select v-model="form.supplierId" value-key="id" placeholder="请选择供货商" clearable filterable @change="handleChange">
|
||||
<el-option v-for="item in supplierOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备材料名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入设备材料名称" />
|
||||
@ -218,7 +219,7 @@
|
||||
<el-input v-model="form.unit" placeholder="请输入计量单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划数量" prop="plan">
|
||||
<el-input v-model="form.plan" placeholder="请输入计划数量" />
|
||||
<el-input v-model="form.plan" placeholder="请输入计划数量" type="number" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="实际数量" prop="realQuantity">
|
||||
<el-input v-model="form.realQuantity" placeholder="请输入实际数量" />
|
||||
@ -248,6 +249,7 @@ import {
|
||||
getBatch
|
||||
} from '@/api/materials/cailiaoshebei';
|
||||
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/cailiaoshebei/types';
|
||||
import { listContractor } from '@/api/project/contractor';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@ -256,7 +258,7 @@ const { supply } = toRefs<any>(proxy?.useDict('supply'));
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
|
||||
const batchTreeRef = ref<any>(null);
|
||||
const cailiaoshebeiList = ref<CailiaoshebeiVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
@ -277,7 +279,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: CailiaoshebeiForm = {
|
||||
id: undefined,
|
||||
batchId: undefined,
|
||||
batchNumber: undefined,
|
||||
supplierId: undefined,
|
||||
supplier: undefined,
|
||||
name: undefined,
|
||||
@ -298,12 +300,11 @@ const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
batchId: undefined,
|
||||
batchNumber: undefined,
|
||||
supplierId: undefined,
|
||||
supplier: undefined,
|
||||
name: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
batchNumber: undefined,
|
||||
supply: undefined,
|
||||
specification: undefined,
|
||||
signalment: undefined,
|
||||
@ -337,22 +338,22 @@ const getBatchList = async () => {
|
||||
batchOptions.value = res.rows;
|
||||
total.value = res.total;
|
||||
try {
|
||||
queryParams.value.batchId = res.rows[0].id;
|
||||
form.value.batchId = res.rows[0].id;
|
||||
batchTreeRef.value.setCurrentKey(res.rows[0].batchNumber);
|
||||
form.value.batchNumber = res.rows[0].batchNumber;
|
||||
} catch (error) {
|
||||
queryParams.value.batchId = '';
|
||||
form.value.batchId = '';
|
||||
form.value.batchNumber = '';
|
||||
}
|
||||
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 节点单击事件 */
|
||||
const handleNodeClick = (data: any) => {
|
||||
queryParams.value.batchId = data.id;
|
||||
form.value.batchId = data.id;
|
||||
queryParams.value.batchNumber = data.batchNumber;
|
||||
form.value.batchNumber = data.batchNumber;
|
||||
console.log('🚀 ~ handleNodeClick ~ form.value:', form.value);
|
||||
if (data.id === '0') {
|
||||
queryParams.value.batchId = '';
|
||||
if (data.batchNumber === '0') {
|
||||
queryParams.value.batchNumber = '';
|
||||
}
|
||||
getList();
|
||||
};
|
||||
@ -365,8 +366,8 @@ const cancel = () => {
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
const preservedBatchId = form.value.batchId; // 先保存当前的 batchId
|
||||
form.value = { ...initFormData, batchId: preservedBatchId }; // 重置但保留
|
||||
const preservedBatchId = form.value.batchNumber; // 先保存当前的 batchNumber
|
||||
form.value = { ...initFormData, batchNumber: preservedBatchId }; // 重置但保留
|
||||
cailiaoshebeiFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
@ -455,7 +456,25 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
/** 查询供货商列表 */
|
||||
const supplierOptions = ref([]);
|
||||
const getSupplierList = async () => {
|
||||
const res = await listContractor({
|
||||
projectId: currentProject.value.id,
|
||||
pageNum: 1,
|
||||
pageSize: 10000
|
||||
});
|
||||
supplierOptions.value = res.rows;
|
||||
};
|
||||
|
||||
/** 供货商选择器改变事件 */
|
||||
const handleChange = (value: string) => {
|
||||
const selectedOption = supplierOptions.value.find((item) => item.id === value);
|
||||
form.value.supplier = selectedOption?.name || '';
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getBatchList();
|
||||
getSupplierList();
|
||||
});
|
||||
</script>
|
||||
|
@ -91,6 +91,9 @@
|
||||
<el-form-item label="计量单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入计量单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="total" v-if="isDisabled">
|
||||
<el-input v-model="form.total" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="综合单价" prop="unitPrice">
|
||||
<el-input v-model="form.unitPrice" placeholder="请输入综合单价" />
|
||||
</el-form-item>
|
||||
@ -257,6 +260,7 @@ const cancel = () => {
|
||||
// 表单重置
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
isDisabled.value = false;
|
||||
progressCategoryFormRef.value?.resetFields();
|
||||
};
|
||||
/** 级联选择器改变事件 */
|
||||
@ -305,8 +309,12 @@ const toggleExpandAll = (data: ProgressCategoryVO[], status: boolean) => {
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const isDisabled = ref<boolean>(false);
|
||||
const handleUpdate = async (row: ProgressCategoryVO) => {
|
||||
reset();
|
||||
if (row.unitType == '2') {
|
||||
isDisabled.value = true;
|
||||
}
|
||||
await getTreeselect();
|
||||
if (row != null) {
|
||||
form.value.parentId = row.parentId;
|
||||
|
@ -280,11 +280,42 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="打卡类型" prop="playCardStart" label-width="110px">
|
||||
<!-- <el-time-picker value-format="HH:mm" v-model="form.playCardStart" placeholder="请输入打卡开始时间" /> -->
|
||||
<el-time-select
|
||||
v-model="form.playCardStart"
|
||||
style="width: 100%"
|
||||
class="mr-4"
|
||||
placeholder="请输入打卡开始时间"
|
||||
value-format="HH:mm"
|
||||
start="00:00"
|
||||
step="00:15"
|
||||
end="23:59"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="工作日" prop="playCardEnd" label-width="110px">
|
||||
<!-- <el-time-picker value-format="HH:mm" v-model="form.playCardEnd" placeholder="请输入打卡结束时间" /> -->
|
||||
<el-time-select
|
||||
v-model="form.playCardEnd"
|
||||
style="width: 100%"
|
||||
:min-time="form.playCardStart"
|
||||
class="mr-4"
|
||||
placeholder="请输入打卡结束时间"
|
||||
value-format="HH:mm"
|
||||
start="00:00"
|
||||
step="00:15"
|
||||
end="23:59"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="24" :offset="0">
|
||||
<el-form-item label="安全协议书" prop="securityAgreement">
|
||||
<file-upload v-model="form.securityAgreement" :limit="1" :file-type="['pdf']" :file-size="50" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
Reference in New Issue
Block a user