审核工作流

This commit is contained in:
Teo
2025-08-09 18:02:06 +08:00
parent b6e4f84570
commit 6bbe8a83f7
16 changed files with 264 additions and 204 deletions

View File

@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源项目管理平台
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
# 开发环境 # 开发环境
VITE_APP_BASE_API = 'http://192.168.110.119:8898' VITE_APP_BASE_API = 'http://192.168.110.159:8898'
# 无人机接口地址 # 无人机接口地址

View File

@ -108,3 +108,16 @@ export const getPcDetail = (id: string | number): AxiosPromise<CailiaoshebeiVO>
method: 'get' method: 'get'
}); });
}; };
/**
* 查询物资-材料设备选择列表
* @param query
* @returns {*}
*/
export const listSelectCailiaoshebei = (query?: any): AxiosPromise<CailiaoshebeiVO[]> => {
return request({
url: '/cailiaoshebei/materialbatchdemandplan/masterDataList',
method: 'get',
params: query
});
};

View File

@ -3,7 +3,7 @@ export interface CailiaoshebeiVO {
* 主键ID * 主键ID
*/ */
id: string | number; id: string | number;
cailiaoshebeiId?: string | number;
/** /**
* 批次ID * 批次ID
*/ */

View File

@ -43,7 +43,6 @@ export interface MonthPlanVO {
* 完成审核状态 * 完成审核状态
*/ */
completeAuditStatus: string; completeAuditStatus: string;
} }
export interface MonthPlanForm extends BaseEntity { export interface MonthPlanForm extends BaseEntity {
@ -51,6 +50,10 @@ export interface MonthPlanForm extends BaseEntity {
* 主键ID * 主键ID
*/ */
id?: string | number; id?: string | number;
/**
* 是否设计
*/
isDesign?: boolean;
/** /**
* 项目ID * 项目ID
@ -91,11 +94,9 @@ export interface MonthPlanForm extends BaseEntity {
* 完成审核状态 * 完成审核状态
*/ */
completeAuditStatus?: string; completeAuditStatus?: string;
} }
export interface MonthPlanQuery extends PageQuery { export interface MonthPlanQuery extends PageQuery {
/** /**
* 项目ID * 项目ID
*/ */
@ -141,6 +142,3 @@ export interface MonthPlanQuery extends PageQuery {
*/ */
params?: any; params?: any;
} }

View File

@ -15,7 +15,7 @@
</el-row> </el-row>
</template> </template>
<el-input v-model="queryParams.batchNumber" placeholder="请输入批次号" @input="getBatchList" prefix-icon="Search" clearable /> <el-input v-model="batchNumber" placeholder="请输入批次号" @input="searchBatchList" prefix-icon="Search" clearable />
<el-tree <el-tree
ref="batchTreeRef" ref="batchTreeRef"
class="mt-2" class="mt-2"
@ -26,7 +26,14 @@
highlight-current highlight-current
default-expand-all default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
></el-tree> >
<template #default="{ node, data }">
<div class="custom-tree-node">
{{node.label }}
<dict-tag :options="wf_business_status" :value="data.approvalProject" />
</div>
</template>
</el-tree>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
@ -41,10 +48,10 @@
<el-card shadow="never"> <el-card shadow="never">
<template #header> <template #header>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5" v-if="form.approvalProject == 'draft'">
<el-button type="primary" plain icon="SemiSelect" @click="handleAdd" v-hasPermi="['cailiaoshebei:cailiaoshebei:add']">选择</el-button> <el-button type="primary" plain icon="SemiSelect" @click="handleAdd" v-hasPermi="['cailiaoshebei:cailiaoshebei:add']">选择</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5" v-if="form.approvalProject == 'draft'">
<el-button type="success" plain icon="Check" @click="submitForm" v-hasPermi="['cailiaoshebei:cailiaoshebei:delete']">保存</el-button> <el-button type="success" plain icon="Check" @click="submitForm" v-hasPermi="['cailiaoshebei:cailiaoshebei:delete']">保存</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -66,21 +73,16 @@
<el-table-column label="供应周期(天)" align="center" prop="estimatedCycle" /> <el-table-column label="供应周期(天)" align="center" prop="estimatedCycle" />
<el-table-column label="需求数量" align="center" prop="demandQuantity"> <el-table-column label="需求数量" align="center" prop="demandQuantity">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.demandQuantity" type="number" /> <el-input v-model="scope.row.demandQuantity" type="number" :disabled="form.approvalProject != 'draft'"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="计划到场时间" align="center" prop="arrivalTime" width="250"> <el-table-column label="计划到场时间" align="center" prop="arrivalTime" width="250">
<template #default="scope"> <template #default="scope">
<div class="flex justify-center w100%"> <div class="flex justify-center w100%">
<el-date-picker v-model="scope.row.arrivalTime" type="date" value-format="YYYY-MM-DD" /> <el-date-picker v-model="scope.row.arrivalTime" type="date" value-format="YYYY-MM-DD" :disabled="form.approvalProject != 'draft'" />
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="流程状态" align="center" prop="planAuditStatus">
<template #default="scope">
<dict-tag :options="wf_business_status" :value="scope.row.planAuditStatus" />
</template>
</el-table-column>
</el-table> </el-table>
</el-card> </el-card>
</el-col> </el-col>
@ -94,9 +96,12 @@
:data="cailiaoshebeiAllList" :data="cailiaoshebeiAllList"
:props="{ :props="{
label: 'name', label: 'name',
key: 'id' key: 'cailiaoshebeiId'
}" }"
/> ><template #default="{ option }">
{{ `${option.specification || ''} ${option.name || ''}` }}1
</template>
</el-transfer>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitTransferForm"> </el-button> <el-button :loading="buttonLoading" type="primary" @click="submitTransferForm"> </el-button>
@ -116,7 +121,8 @@ import {
updateCailiaoshebei, updateCailiaoshebei,
listBatch, listBatch,
getBatch, getBatch,
delBatch delBatch,
listSelectCailiaoshebei
} from '@/api/materials/batchPlan'; } from '@/api/materials/batchPlan';
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types'; import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types';
@ -198,7 +204,7 @@ const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }] id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }]
} }
}); });
const batchNumber = ref('');
const { queryParams, form, rules } = toRefs(data); const { queryParams, form, rules } = toRefs(data);
/** 查询物资-材料设备列表 */ /** 查询物资-材料设备列表 */
@ -241,6 +247,11 @@ const handleNodeClick = (data: any) => {
getList(); getList();
}; };
const searchBatchList = async () => {
queryParams.value.batchNumber = batchNumber.value;
getBatchList();
};
/** 取消按钮 */ /** 取消按钮 */
const cancel = () => { const cancel = () => {
reset(); reset();
@ -250,7 +261,8 @@ const cancel = () => {
/** 表单重置 */ /** 表单重置 */
const reset = () => { const reset = () => {
const preservedBatchId = form.value.batchNumber; // 先保存当前的 batchNumber const preservedBatchId = form.value.batchNumber; // 先保存当前的 batchNumber
form.value = { ...initFormData, batchNumber: preservedBatchId }; // 重置但保留 const status=form.value.approvalProject
form.value = { ...initFormData, batchNumber: preservedBatchId,approvalProject:status }; // 重置但保留
cailiaoshebeiFormRef.value?.resetFields(); cailiaoshebeiFormRef.value?.resetFields();
}; };
@ -276,7 +288,8 @@ const handleSelectionChange = (selection: CailiaoshebeiVO[]) => {
/** 新增按钮操作 */ /** 新增按钮操作 */
const handleAdd = () => { const handleAdd = () => {
reset(); reset();
listCailiaoshebei({
listSelectCailiaoshebei({
projectId: currentProject.value.id projectId: currentProject.value.id
}).then((res) => { }).then((res) => {
cailiaoshebeiAllList.value = res.rows; cailiaoshebeiAllList.value = res.rows;
@ -295,7 +308,8 @@ const submitForm = async () => {
} }
}); });
await addCailiaoshebei({ addDataList: cailiaoshebeiList.value } as any).finally(() => (buttonLoading.value = false)); await addCailiaoshebei({ addDataList: cailiaoshebeiList.value,batchNumber:form.value.batchNumber,projectId:currentProject.value.id } as any).finally(() => (buttonLoading.value = false));
proxy?.$modal.msgSuccess('操作成功'); proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false; dialog.visible = false;
}; };
@ -303,7 +317,7 @@ const submitForm = async () => {
/** 提交穿梭框数据 */ /** 提交穿梭框数据 */
const submitTransferForm = async () => { const submitTransferForm = async () => {
cailiaoshebeiList.value = cailiaoshebeiSelectedList.value.map((id) => { cailiaoshebeiList.value = cailiaoshebeiSelectedList.value.map((id) => {
const item = cailiaoshebeiAllList.value.find((option) => option.id === id); const item = cailiaoshebeiAllList.value.find((option) => option.cailiaoshebeiId === id);
return item; return item;
}); });
dialog.visible = false; dialog.visible = false;
@ -312,8 +326,8 @@ const submitTransferForm = async () => {
/** 新增批次 */ /** 新增批次 */
const addBatch = async () => { const addBatch = async () => {
await proxy?.$modal.confirm('是否确认新增批次?').finally(() => (loading.value = false)); await proxy?.$modal.confirm('是否确认新增批次?').finally(() => (loading.value = false));
const res = await getBatch({ projectId: currentProject.value.id }); await getBatch({ projectId: currentProject.value.id });
console.log('🚀 ~ addBatch ~ res:', res); queryParams.value.batchNumber = '';
await getBatchList(); await getBatchList();
proxy?.$modal.msgSuccess('新增成功'); proxy?.$modal.msgSuccess('新增成功');
@ -384,3 +398,14 @@ onUnmounted(() => {
listeningProject(); listeningProject();
}); });
</script> </script>
<style scoped lang="scss">
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
</style

View File

@ -26,18 +26,8 @@
<el-table-column label="物料编码" align="center" prop="materialCode" width="200" /> <el-table-column label="物料编码" align="center" prop="materialCode" width="200" />
<el-table-column label="计量单位" align="center" prop="unit" width="80" /> <el-table-column label="计量单位" align="center" prop="unit" width="80" />
<el-table-column label="供应周期(天)" align="center" prop="estimatedCycle" /> <el-table-column label="供应周期(天)" align="center" prop="estimatedCycle" />
<el-table-column label="需求数量" align="center" prop="demandQuantity"> <el-table-column label="需求数量" align="center" prop="demandQuantity" />
<template #default="scope"> <el-table-column label="计划到场时间" align="center" prop="arrivalTime" width="250" />
<el-input v-model="scope.row.demandQuantity" type="number" />
</template>
</el-table-column>
<el-table-column label="计划到场时间" align="center" prop="arrivalTime" width="250">
<template #default="scope">
<div class="flex justify-center w100%">
<el-date-picker v-model="scope.row.arrivalTime" type="date" value-format="YYYY-MM-DD" />
</div>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
</el-card> </el-card>

View File

@ -66,7 +66,7 @@
</el-row> </el-row>
</template> </template>
<el-input v-model="queryParams.batchNumber" placeholder="请输入批次号" @input="getBatchList" prefix-icon="Search" clearable /> <el-input v-model="batchNumber" placeholder="请输入批次号" @input="searchBatchList" prefix-icon="Search" clearable />
<el-tree <el-tree
ref="batchTreeRef" ref="batchTreeRef"
class="mt-2" class="mt-2"
@ -77,7 +77,14 @@
highlight-current highlight-current
default-expand-all default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
></el-tree> >
<template #default="{ node, data }">
<div class="custom-tree-node">
{{ node.label }}
<dict-tag :options="wf_business_status" :value="data.approvalDesign" />
</div>
</template>
</el-tree>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
@ -92,10 +99,10 @@
<el-card shadow="never"> <el-card shadow="never">
<template #header> <template #header>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5" v-if="form.approvalDesign == 'draft'">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['cailiaoshebei:cailiaoshebei:add']">新增</el-button> <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['cailiaoshebei:cailiaoshebei:add']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5" v-if="form.approvalDesign == 'draft'">
<el-button <el-button
type="success" type="success"
plain plain
@ -106,7 +113,7 @@
>修改</el-button >修改</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5" v-if="form.approvalDesign == 'draft'">
<el-button <el-button
type="danger" type="danger"
plain plain
@ -117,11 +124,6 @@
>删除</el-button >删除</el-button
> >
</el-col> </el-col>
<!-- <el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['cailiaoshebei:cailiaoshebei:export']"
>导出</el-button
>
</el-col> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button plain type="warning" icon="Finished" @click="handleAudit()" v-hasPermi="['out:monthPlan:remove']">审核</el-button> <el-button plain type="warning" icon="Finished" @click="handleAudit()" v-hasPermi="['out:monthPlan:remove']">审核</el-button>
</el-col> </el-col>
@ -132,30 +134,26 @@
<el-table v-loading="loading" :data="cailiaoshebeiList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="cailiaoshebeiList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="供货商ID" align="center" prop="supplierId" /> --> <!-- <el-table-column label="供货商ID" align="center" prop="supplierId" /> -->
<el-table-column label="供货商" align="center" prop="supplier" /> <el-table-column label="供货商" align="center" prop="supplier" width="237">
<el-table-column label="设备材料名称" align="center" prop="name" /> <template #default="scope">
<div v-for="(item, index) in scope.row.supplier.split(',')" :class="index != 0 ? 'mt-1' : ''">
<el-tag type="primary">{{ item }}</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="供货来源" align="center" prop="supply"> <el-table-column label="供货来源" align="center" prop="supply">
<template #default="scope"> <template #default="scope">
<dict-tag :options="supply" :value="scope.row.supply" /> <dict-tag :options="supply" :value="scope.row.supply" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备材料名称" align="center" prop="name" width="110" />
<el-table-column label="规格型号" align="center" prop="specification" /> <el-table-column label="规格型号" align="center" prop="specification" />
<el-table-column label="特征描述" align="center" prop="signalment" /> <el-table-column label="特征描述" align="center" prop="signalment" />
<el-table-column label="物料编码" align="center" prop="materialCode" width="200" /> <el-table-column label="物料编码" align="center" prop="materialCode" width="200" />
<!-- <el-table-column label="计划到场时间" align="center" prop="arrivalTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.arrivalTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划完成时间" align="center" prop="finishTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.finishTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column> -->
<el-table-column label="计量单位" align="center" prop="unit" /> <el-table-column label="计量单位" align="center" prop="unit" />
<el-table-column label="计划数量" align="center" prop="plan" /> <el-table-column label="计划数量" align="center" prop="plan" />
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="form.approvalDesign == 'draft'">
<template #default="scope"> <template #default="scope">
<el-tooltip content="修改" placement="top"> <el-tooltip content="修改" placement="top">
<el-button <el-button
@ -196,40 +194,29 @@
<el-option v-for="item in supplierOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> <el-option v-for="item in supplierOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备材料名称" prop="name">
<el-input v-model="form.name" placeholder="请输入设备材料名称" />
</el-form-item>
<el-form-item label="供货来源" prop="supply"> <el-form-item label="供货来源" prop="supply">
<el-select v-model="form.supply" value-key="value" placeholder="请选择供货来源" clearable filterable @change=""> <el-select v-model="form.supply" value-key="value" placeholder="请选择供货来源" clearable filterable @change="">
<el-option v-for="item in supply" :key="item.value" :label="item.label" :value="item.value"> </el-option> <el-option v-for="item in supply" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="材料名称" prop="name">
<el-input v-model="form.name" placeholder="请输入设备材料名称" />
</el-form-item>
<el-form-item label="规格型号" prop="specification"> <el-form-item label="规格型号" prop="specification">
<el-input v-model="form.specification" placeholder="请输入规格型号" /> <el-input v-model="form.specification" placeholder="请输入规格型号" />
</el-form-item> </el-form-item>
<el-form-item label="特征描述" prop="signalment"> <el-form-item label="特征描述" prop="signalment">
<el-input v-model="form.signalment" placeholder="请输入特征描述" /> <el-input v-model="form.signalment" placeholder="请输入特征描述" />
</el-form-item> </el-form-item>
<el-form-item label="物料编码" prop="materialCode"> <el-form-item label="物料编码" prop="materialCode" v-if="form.id">
<el-input v-model="form.materialCode" placeholder="请输入物料编码" /> <el-input v-model="form.materialCode" placeholder="请输入物料编码" disabled />
</el-form-item> </el-form-item>
<!-- <el-form-item label="计划到场时间" prop="arrivalTime">
<el-date-picker clearable v-model="form.arrivalTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择计划到场时间">
</el-date-picker>
</el-form-item>
<el-form-item label="计划完成时间" prop="finishTime">
<el-date-picker clearable v-model="form.finishTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择计划完成时间">
</el-date-picker>
</el-form-item> -->
<el-form-item label="计量单位" prop="unit"> <el-form-item label="计量单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入计量单位" /> <el-input v-model="form.unit" placeholder="请输入计量单位" />
</el-form-item> </el-form-item>
<el-form-item label="计划数量" prop="plan"> <el-form-item label="计划数量" prop="plan">
<el-input v-model="form.plan" placeholder="请输入计划数量" type="number" /> <el-input v-model="form.plan" placeholder="请输入计划数量" type="number" />
</el-form-item> </el-form-item>
<!-- <el-form-item label="实际数量" prop="realQuantity">
<el-input v-model="form.realQuantity" placeholder="请输入实际数量" />
</el-form-item> -->
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
@ -258,9 +245,9 @@ import {
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/cailiaoshebei/types'; import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/cailiaoshebei/types';
import { listContractor } from '@/api/project/contractor'; import { listContractor } from '@/api/project/contractor';
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';
const batchNumber = ref('');
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { supply } = toRefs<any>(proxy?.useDict('supply')); const { supply, wf_business_status } = toRefs<any>(proxy?.useDict('supply', 'wf_business_status'));
// 获取用户 store // 获取用户 store
const userStore = useUserStoreHook(); const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目 // 从 store 中获取项目列表和当前选中的项目
@ -268,7 +255,7 @@ const currentProject = computed(() => userStore.selectedProject);
const batchTreeRef = ref<any>(null); const batchTreeRef = ref<any>(null);
const cailiaoshebeiList = ref<CailiaoshebeiVO[]>([]); const cailiaoshebeiList = ref<CailiaoshebeiVO[]>([]);
const buttonLoading = ref(false); const buttonLoading = ref(false);
const loading = ref(true); const loading = ref(false);
const showSearch = ref(true); const showSearch = ref(true);
const ids = ref<Array<string | number>>([]); const ids = ref<Array<string | number>>([]);
const single = ref(true); const single = ref(true);
@ -338,14 +325,19 @@ const getList = async () => {
loading.value = true; loading.value = true;
const res = await listCailiaoshebei(queryParams.value); const res = await listCailiaoshebei(queryParams.value);
cailiaoshebeiList.value = res.rows; cailiaoshebeiList.value = res.rows;
console.log(1111);
loading.value = false; loading.value = false;
}; };
const searchBatchList = async () => {
queryParams.value.batchNumber = batchNumber.value;
getBatchList();
};
//查询批次列表 //查询批次列表
const getBatchList = async () => { const getBatchList = async () => {
const res = await listBatch(queryParams.value); const res = await listBatch(queryParams.value);
console.log('🚀 ~ getBatchList ~ res:', res);
batchOptions.value = res.rows; batchOptions.value = res.rows;
total.value = res.total; total.value = res.total;
try { try {
@ -356,6 +348,8 @@ const getBatchList = async () => {
} catch (error) { } catch (error) {
form.value.batchNumber = ''; form.value.batchNumber = '';
} }
console.log(145615616);
getList(); getList();
}; };
@ -381,6 +375,7 @@ const cancel = () => {
const reset = () => { const reset = () => {
const preservedBatchId = form.value.batchNumber; // 先保存当前的 batchNumber const preservedBatchId = form.value.batchNumber; // 先保存当前的 batchNumber
const approvalDesigndBatchId = form.value.approvalDesign; // 先保存当前的 batchNumber const approvalDesigndBatchId = form.value.approvalDesign; // 先保存当前的 batchNumber
selectValue.value = [];
form.value = { ...initFormData, batchNumber: preservedBatchId, approvalDesign: approvalDesigndBatchId }; // 重置但保留 form.value = { ...initFormData, batchNumber: preservedBatchId, approvalDesign: approvalDesigndBatchId }; // 重置但保留
cailiaoshebeiFormRef.value?.resetFields(); cailiaoshebeiFormRef.value?.resetFields();
@ -458,10 +453,9 @@ const submitForm = () => {
/** 新增批次 */ /** 新增批次 */
const addBatch = async () => { const addBatch = async () => {
await proxy?.$modal.confirm('是否确认新增批次?').finally(() => (loading.value = false)); await proxy?.$modal.confirm('是否确认新增批次?').finally(() => (loading.value = false));
const res = await getBatch({ projectId: currentProject.value.id }); queryParams.value.batchNumber = '';
console.log('🚀 ~ addBatch ~ res:', res); await getBatch({ projectId: currentProject.value.id });
await getBatchList(); await getBatchList();
proxy?.$modal.msgSuccess('新增成功'); proxy?.$modal.msgSuccess('新增成功');
}; };
@ -541,3 +535,14 @@ onUnmounted(() => {
listeningProject(); listeningProject();
}); });
</script> </script>
<style scoped>
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
</style>

View File

@ -4,7 +4,7 @@
<!-- 流程分类树 --> <!-- 流程分类树 -->
<el-col style="" :span="5"> <el-col style="" :span="5">
<el-card shadow="hover"> <el-card shadow="hover">
<el-input v-model="queryParams.batchNumber" placeholder="请输入批次号" @input="getBatchList" prefix-icon="Search" clearable /> <el-input v-model="batchNumber" placeholder="请输入批次号" @input="searchBatchList" prefix-icon="Search" clearable />
<el-tree <el-tree
ref="batchTreeRef" ref="batchTreeRef"
class="mt-2" class="mt-2"
@ -15,7 +15,14 @@
highlight-current highlight-current
default-expand-all default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
></el-tree> >
<template #default="{ node, data }">
<div class="custom-tree-node">
{{ node.label }}
<dict-tag :options="wf_business_status" :value="data.approvalOrder" />
</div>
</template>
</el-tree>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
@ -34,24 +41,32 @@
<el-button type="primary" plain icon="SemiSelect" @click="handleAdd" v-hasPermi="['cailiaoshebei:cailiaoshebei:add']">选择</el-button> <el-button type="primary" plain icon="SemiSelect" @click="handleAdd" v-hasPermi="['cailiaoshebei:cailiaoshebei:add']">选择</el-button>
</el-col> --> </el-col> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="Check" @click="submitForm" v-hasPermi="['cailiaoshebei:cailiaoshebei:delete']">保存</el-button> <el-button
v-if="form.approvalOrder == 'draft'"
type="success"
plain
icon="Check"
@click="submitForm"
v-hasPermi="['cailiaoshebei:cailiaoshebei:delete']"
>保存</el-button
>
<el-button plain type="warning" icon="Finished" @click="handleAudit()" v-hasPermi="['out:monthPlan:remove']">审核</el-button> <el-button plain type="warning" icon="Finished" @click="handleAudit()" v-hasPermi="['out:monthPlan:remove']">审核</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5" v-if="form.approvalOrder == 'draft'">
<el-button type="success" plain icon="Share" @click="onShare" v-hasPermi="['cailiaoshebei:cailiaoshebei:delete']">分享</el-button> <el-button type="success" plain icon="Share" @click="onShare" v-hasPermi="['cailiaoshebei:cailiaoshebei:delete']">分享</el-button>
</el-col> </el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
</template> </template>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8" :offset="0"> <!-- <el-col :span="8" :offset="0">
<el-form-item label="单据号"> <el-form-item label="单据号">
<el-input v-model="form.batchNumbers" placeholder="请输入单据号" @input="getList" prefix-icon="Search" clearable /> <el-input v-model="form.batchNumbers" placeholder="请输入单据号" prefix-icon="Search" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="8" :offset="0"> <el-col :span="8" :offset="0">
<el-form-item label="采购人"> <el-form-item label="采购人">
<el-input v-model="form.purchasingAgent" placeholder="请输入采购人" @input="getList" prefix-icon="Search" clearable /> <el-input v-model="form.purchasingAgent" placeholder="请输入采购人" prefix-icon="Search" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" :offset="0"> <el-col :span="8" :offset="0">
@ -61,25 +76,23 @@
</el-col> </el-col>
<el-col :span="8" :offset="0"> <el-col :span="8" :offset="0">
<el-form-item label="供应商"> <el-form-item label="供应商">
<el-input v-model="form.supplier" placeholder="请输入供应商" @input="getList" prefix-icon="Search" clearable /> <el-input v-model="form.dhSupplier" disabled placeholder="请输入供应商" prefix-icon="Search" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" :offset="0"> <el-col :span="8" :offset="0">
<el-form-item label="合同号"> <el-form-item label="合同号">
<el-input v-model="form.contractNumber" placeholder="请输入合同号" @input="getList" prefix-icon="Search" clearable /> <el-input v-model="form.contractNumber" placeholder="请输入合同号" prefix-icon="Search" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" :offset="0"> <el-col :span="8" :offset="0">
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="form.dhRemark" placeholder="请输入备注" @input="getList" prefix-icon="Search" clearable /> <el-input v-model="form.dhRemark" placeholder="请输入备注" prefix-icon="Search" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="cailiaoshebeiList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="cailiaoshebeiList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="供货商ID" align="center" prop="supplierId" /> -->
<!-- <el-table-column label="供货商" align="center" prop="supplierCompany" /> -->
<el-table-column label="设备材料名称" align="center" prop="name" /> <el-table-column label="设备材料名称" align="center" prop="name" />
<el-table-column label="规格型号" align="center" prop="specification" /> <el-table-column label="规格型号" align="center" prop="specification" />
<el-table-column label="物料编码" align="center" prop="materialCode" width="200" /> <el-table-column label="物料编码" align="center" prop="materialCode" width="200" />
@ -87,45 +100,11 @@
<el-table-column label="验收数量" align="center" prop="acceptanceQuantity" /> <el-table-column label="验收数量" align="center" prop="acceptanceQuantity" />
<el-table-column label="订货量" align="center" prop="orderQuantity"> <el-table-column label="订货量" align="center" prop="orderQuantity">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.orderQuantity" type="number" /> <el-input v-model="scope.row.orderQuantity" type="number" min="0" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="预计到货时间" align="center" prop="expectedArrival" width="250"> <el-table-column label="预计到货时间" align="center" prop="expectedArrival" width="250" />
<template #default="scope"> <el-table-column label="预计生产完成时间" align="center" prop="productionTime" width="250" />
<div class="flex justify-center w100%">
<el-date-picker v-model="scope.row.expectedArrival" type="date" value-format="YYYY-MM-DD" />
</div>
</template>
</el-table-column>
<el-table-column label="预计生产完成时间" align="center" prop="productionTime" width="250">
<template #default="scope">
<div class="flex justify-center w100%">
<el-date-picker v-model="scope.row.productionTime" type="date" value-format="YYYY-MM-DD" />
</div>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button
link
type="primary"
icon="Edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['cailiaoshebei:cailiaoshebei:edit']"
></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button
link
type="primary"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['cailiaoshebei:cailiaoshebei:remove']"
></el-button>
</el-tooltip>
</template>
</el-table-column> -->
</el-table> </el-table>
</el-card> </el-card>
</el-col> </el-col>
@ -169,7 +148,7 @@ import { listContractor } from '@/api/project/contractor';
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { supply } = toRefs<any>(proxy?.useDict('supply')); const { supply, wf_business_status } = toRefs<any>(proxy?.useDict('supply', 'wf_business_status'));
// 获取用户 store // 获取用户 store
const userStore = useUserStoreHook(); const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目 // 从 store 中获取项目列表和当前选中的项目
@ -194,6 +173,7 @@ const dialog = reactive<DialogOption>({
visible: false, visible: false,
title: '' title: ''
}); });
const batchNumber = ref('');
const initFormData: CailiaoshebeiForm = { const initFormData: CailiaoshebeiForm = {
id: undefined, id: undefined,
@ -261,8 +241,11 @@ const getBatchList = async () => {
try { try {
queryParams.value.batchNumber = res.rows[0].batchNumber; queryParams.value.batchNumber = res.rows[0].batchNumber;
batchTreeRef.value.setCurrentKey(res.rows[0].batchNumber); batchTreeRef.value.setCurrentKey(res.rows[0].batchNumber);
form.value.batchNumber = res.rows[0].batchNumber; Object.assign(form.value, res.rows[0]);
form.value.approvalOrder = res.rows[0].approvalOrder; console.log('🚀 ~ getBatchList ~ form.value:', form.value);
// form.value.batchNumber = res.rows[0].batchNumber;
// form.value.approvalOrder = res.rows[0].approvalOrder;
} catch (error) { } catch (error) {
form.value.batchNumber = ''; form.value.batchNumber = '';
} }
@ -342,7 +325,7 @@ const onShare = () => {
console.log(getToken()); console.log(getToken());
// 跳转新的地址 传token // 跳转新的地址 传token
let url = `http://192.168.110.151:7788/indexEquipment?projectId=${encodeURIComponent(currentProject.value.id)}&token=${encodeURIComponent(getToken())}&batchNumber=${encodeURIComponent(form.value.batchNumber)}`; let url = `http://192.168.110.142:7788/indexEquipment?projectId=${encodeURIComponent(currentProject.value.id)}&token=${encodeURIComponent(getToken())}&batchNumber=${encodeURIComponent(form.value.batchNumber)}`;
window.open(url, '_blank'); window.open(url, '_blank');
}; };
/** 提交按钮 */ /** 提交按钮 */
@ -377,6 +360,11 @@ const handleAudit = async () => {
}); });
}; };
const searchBatchList = async () => {
queryParams.value.batchNumber = batchNumber.value;
getBatchList();
};
/** 提交穿梭框数据 */ /** 提交穿梭框数据 */
const submitTransferForm = async () => { const submitTransferForm = async () => {
cailiaoshebeiList.value = cailiaoshebeiSelectedList.value.map((id) => { cailiaoshebeiList.value = cailiaoshebeiSelectedList.value.map((id) => {
@ -447,3 +435,13 @@ onUnmounted(() => {
listeningProject(); listeningProject();
}); });
</script> </script>
<style scoped lang="scss">
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
</style>

View File

@ -19,7 +19,7 @@
<h3 class="text-lg font-semibold text-gray-800">物资-设备订货</h3> <h3 class="text-lg font-semibold text-gray-800">物资-设备订货</h3>
</div> </div>
<div class="p-6"> <div class="p-6">
<el-table v-loading="loading" :data="cailiaoshebeiList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="cailiaoshebeiList">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="供货商ID" align="center" prop="supplierId" /> --> <!-- <el-table-column label="供货商ID" align="center" prop="supplierId" /> -->
<!-- <el-table-column label="供货商" align="center" prop="supplierCompany" /> --> <!-- <el-table-column label="供货商" align="center" prop="supplierCompany" /> -->
@ -231,7 +231,6 @@ const submit = async (status, data) => {
onMounted(() => { onMounted(() => {
nextTick(async () => { nextTick(async () => {
routeParams.value = proxy.$route.query; routeParams.value = proxy.$route.query;
console.log('🚀 ~ proxy.$route.query:', proxy.$route.query);
reset(); reset();
loading.value = false; loading.value = false;
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') { if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {

View File

@ -13,11 +13,11 @@
</el-row> </el-row>
</template> </template>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8" :offset="0"> <!-- <el-col :span="8" :offset="0">
<el-form-item label="单据号"> <el-form-item label="单据号">
<el-input v-model="form.batchNumbers" placeholder="请输入单据号" @input="getList" prefix-icon="Search" clearable /> <el-input v-model="form.batchNumbers" placeholder="请输入单据号" @input="getList" prefix-icon="Search" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="8" :offset="0"> <el-col :span="8" :offset="0">
<el-form-item label="采购人"> <el-form-item label="采购人">
<el-input v-model="form.purchasingAgent" placeholder="请输入采购人" @input="getList" prefix-icon="Search" clearable /> <el-input v-model="form.purchasingAgent" placeholder="请输入采购人" @input="getList" prefix-icon="Search" clearable />
@ -30,7 +30,7 @@
</el-col> </el-col>
<el-col :span="8" :offset="0"> <el-col :span="8" :offset="0">
<el-form-item label="供应商"> <el-form-item label="供应商">
<el-input v-model="form.supplier" placeholder="请输入供应商" @input="getList" prefix-icon="Search" clearable /> <el-input v-model="form.dhSupplier" disabled placeholder="请输入供应商" @input="getList" prefix-icon="Search" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" :offset="0"> <el-col :span="8" :offset="0">
@ -50,11 +50,7 @@
<el-table-column label="物料编码" align="center" prop="materialCode" width="200" /> <el-table-column label="物料编码" align="center" prop="materialCode" width="200" />
<el-table-column label="需求数量" align="center" prop="demandQuantity" width="80" /> <el-table-column label="需求数量" align="center" prop="demandQuantity" width="80" />
<el-table-column label="验收数量" align="center" prop="acceptanceQuantity" /> <el-table-column label="验收数量" align="center" prop="acceptanceQuantity" />
<el-table-column label="订货量" align="center" prop="orderQuantity"> <el-table-column label="订货量" align="center" prop="orderQuantity" />
<template #default="scope">
<el-input v-model="scope.row.orderQuantity" type="number" />
</template>
</el-table-column>
<el-table-column label="预计到货时间" align="center" prop="expectedArrival" width="250"> <el-table-column label="预计到货时间" align="center" prop="expectedArrival" width="250">
<template #default="scope"> <template #default="scope">
<div class="flex justify-center w100%"> <div class="flex justify-center w100%">
@ -84,6 +80,7 @@ const loading = ref(false);
const showSearch = ref(true); const showSearch = ref(true);
const queryFormRef = ref<ElFormInstance>(); const queryFormRef = ref<ElFormInstance>();
const cailiaoshebeiFormRef = ref<ElFormInstance>(); const cailiaoshebeiFormRef = ref<ElFormInstance>();
const { proxy } = getCurrentInstance();
var token = ''; var token = '';
const initFormData: CailiaoshebeiForm = { const initFormData: CailiaoshebeiForm = {
id: undefined, id: undefined,
@ -134,7 +131,7 @@ const { queryParams, form, rules } = toRefs(data);
const getList = async () => { const getList = async () => {
// 请求数据 // 请求数据
axios axios
.get('http://192.168.110.159:8898/cailiaoshebei/materialsorder/trackPcPlanList', { .get('http://192.168.110.159:8898/cailiaoshebei/materialsorder/pcPlanListGHS', {
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`, 'Authorization': `Bearer ${token}`,
@ -147,7 +144,7 @@ const getList = async () => {
}) })
.then((response) => { .then((response) => {
form.value = response.data.rows[0]; form.value = response.data.rows[0];
console.log(form.value); getListAll();
}) })
.catch((error) => { .catch((error) => {
console.error('请求失败:', error); console.error('请求失败:', error);
@ -170,6 +167,8 @@ const getListAll = () => {
}) })
.then((response) => { .then((response) => {
console.log('请求成功:', response.data); console.log('请求成功:', response.data);
cailiaoshebeiList.value = response.data.rows;
loading.value = false; loading.value = false;
}) })
.catch((error) => { .catch((error) => {
@ -179,22 +178,29 @@ const getListAll = () => {
}; };
/** 提交按钮 */ /** 提交按钮 */
const submitForm = async () => { const submitForm = async () => {
cailiaoshebeiList.value.forEach((item) => {
if (item.id) {
delete item.id;
}
});
axios axios
.get('http://192.168.110.159:8898/cailiaoshebei/materialsorder/modifyTheOrderFormGYS', { .put(
'http://192.168.110.159:8898/cailiaoshebei/materialsorder/modifyTheOrderFormGYS',
{ ...form.value, list: cailiaoshebeiList.value, batchNumber: form.value.batchNumber }, // 请求体
{
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`, 'Authorization': `Bearer ${token}`,
'X-Requested-With': 'XMLHttpRequest' 'X-Requested-With': 'XMLHttpRequest'
}, },
params: { params: {
id: '', /* 如果你还要传 URL 查询参数 */
materialstatus: '',
overdueType: '',
cause: ''
} }
}) }
)
.then((response) => { .then((response) => {
console.log('请求成功:', response.data); proxy?.$modal.msgSuccess('操作成功');
loading.value = false; loading.value = false;
}) })
.catch((error) => { .catch((error) => {

View File

@ -4,7 +4,7 @@
<!-- 流程分类树 --> <!-- 流程分类树 -->
<el-col style="" :span="5"> <el-col style="" :span="5">
<el-card shadow="hover"> <el-card shadow="hover">
<el-input v-model="queryParams.batchNumber" placeholder="请输入批次号" @input="getBatchList" prefix-icon="Search" clearable /> <el-input v-model="batchNumber" placeholder="请输入批次号" @input="searchBatchList" prefix-icon="Search" clearable />
<el-tree <el-tree
ref="batchTreeRef" ref="batchTreeRef"
class="mt-2" class="mt-2"
@ -177,7 +177,7 @@ const currentProject = computed(() => userStore.selectedProject);
const batchTreeRef = ref<any>(null); const batchTreeRef = ref<any>(null);
const cailiaoshebeiList = ref<CailiaoshebeiVO[]>([]); const cailiaoshebeiList = ref<CailiaoshebeiVO[]>([]);
const buttonLoading = ref(false); const buttonLoading = ref(false);
const loading = ref(true); const loading = ref(false);
const showSearch = ref(true); const showSearch = ref(true);
const ids = ref<Array<string | number>>([]); const ids = ref<Array<string | number>>([]);
const single = ref(true); const single = ref(true);
@ -250,9 +250,12 @@ const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({
}); });
const { queryParams, form, rules } = toRefs(data); const { queryParams, form, rules } = toRefs(data);
const batchNumber = ref('');
/** 查询物资-材料设备列表 */ /** 查询物资-材料设备列表 */
const getList = async () => { const getList = async () => {
if (!queryParams.value.batchNumber) return;
loading.value = true; loading.value = true;
const res = await listCailiaoshebei(queryParams.value); const res = await listCailiaoshebei(queryParams.value);
cailiaoshebeiList.value = res.rows; cailiaoshebeiList.value = res.rows;
@ -287,6 +290,11 @@ const handleNodeClick = (data: any) => {
getList(); getList();
}; };
const searchBatchList = async () => {
queryParams.value.batchNumber = batchNumber.value;
getBatchList();
};
/** 取消按钮 */ /** 取消按钮 */
const cancel = () => { const cancel = () => {
reset(); reset();

View File

@ -15,7 +15,7 @@
</el-row> </el-row>
</template> --> </template> -->
<el-input v-model="queryParams.batchNumber" placeholder="请输入批次号" @input="getBatchList" prefix-icon="Search" clearable /> <el-input v-model="batchNumber" placeholder="请输入批次号" @input="searchBatchList" prefix-icon="Search" clearable />
<el-tree <el-tree
ref="batchTreeRef" ref="batchTreeRef"
class="mt-2" class="mt-2"
@ -26,6 +26,12 @@
highlight-current highlight-current
default-expand-all default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
>
<template #default="{ node, data }">
<div class="custom-tree-node">
{{ node.label }}
<dict-tag :options="wf_business_status" :value="data.approvalPlan" />
</div> </template
></el-tree> ></el-tree>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
@ -71,12 +77,7 @@
</el-table-column> </el-table-column>
<el-table-column label="计量单位" align="center" prop="unit" /> <el-table-column label="计量单位" align="center" prop="unit" />
<el-table-column label="计划数量" align="center" prop="plan" /> <el-table-column label="计划数量" align="center" prop="plan" />
<el-table-column label="流程状态" align="center" prop="planAuditStatus"> <el-table-column label="操作" align="center" width="150" v-if="form.approvalPlan == 'draft'">
<template #default="scope">
<dict-tag :options="wf_business_status" :value="scope.row.planAuditStatus" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="150">
<template #default="scope" <template #default="scope"
><el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['cailiaoshebei:cailiaoshebei:edit']" ><el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['cailiaoshebei:cailiaoshebei:edit']"
>修改</el-button >修改</el-button
@ -254,7 +255,7 @@ const currentProject = computed(() => userStore.selectedProject);
const batchTreeRef = ref<any>(null); const batchTreeRef = ref<any>(null);
const cailiaoshebeiList = ref<CailiaoshebeiVO[]>([]); const cailiaoshebeiList = ref<CailiaoshebeiVO[]>([]);
const buttonLoading = ref(false); const buttonLoading = ref(false);
const loading = ref(true); const loading = ref(false);
const showSearch = ref(true); const showSearch = ref(true);
const ids = ref<Array<string | number>>([]); const ids = ref<Array<string | number>>([]);
const single = ref(true); const single = ref(true);
@ -262,6 +263,7 @@ const multiple = ref(true);
const total = ref(0); const total = ref(0);
const batchOptions = ref<any[]>([]); const batchOptions = ref<any[]>([]);
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status')); const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
const batchNumber = ref('');
const queryFormRef = ref<ElFormInstance>(); const queryFormRef = ref<ElFormInstance>();
const cailiaoshebeiFormRef = ref<ElFormInstance>(); const cailiaoshebeiFormRef = ref<ElFormInstance>();
@ -357,8 +359,8 @@ const getBatchList = async () => {
/** 节点单击事件 */ /** 节点单击事件 */
const handleNodeClick = (data: any) => { const handleNodeClick = (data: any) => {
console.log('🚀 ~ handleNodeClick ~ data:', data);
queryParams.value.batchNumber = data.batchNumber; queryParams.value.batchNumber = data.batchNumber;
batchNumber.value = '';
form.value.batchNumber = data.batchNumber; form.value.batchNumber = data.batchNumber;
form.value.approvalPlan = data.approvalPlan; form.value.approvalPlan = data.approvalPlan;
console.log('🚀 ~ handleNodeClick ~ form.value:', form.value); console.log('🚀 ~ handleNodeClick ~ form.value:', form.value);
@ -368,6 +370,11 @@ const handleNodeClick = (data: any) => {
getList(); getList();
}; };
const searchBatchList = () => {
queryParams.value.batchNumber = batchNumber.value;
getBatchList();
};
/** 取消按钮 */ /** 取消按钮 */
const cancel = () => { const cancel = () => {
reset(); reset();
@ -506,6 +513,14 @@ onUnmounted(() => {
}); });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.block_box { .block_box {
border: 1px solid #9eccfa; border: 1px solid #9eccfa;
border-radius: 6px; border-radius: 6px;

View File

@ -304,7 +304,6 @@ const selectTime = async (value: string) => {
/** 上报日期选择器改变事件 */ /** 上报日期选择器改变事件 */
const submitTime = async (value: string) => { const submitTime = async (value: string) => {
const data = progressTimeList.value.filter((item) => item.id === value)[0]; const data = progressTimeList.value.filter((item) => item.id === value)[0];
console.log(data);
form.value.uavNum = data?.aiFill; form.value.uavNum = data?.aiFill;
form.value.reportDate = data?.date; form.value.reportDate = data?.date;
form.value.planNum = data?.planNumber; form.value.planNum = data?.planNumber;
@ -342,6 +341,7 @@ const submitForm = () => {
} }
proxy?.$modal.msgSuccess('操作成功'); proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false; dialog.visible = false;
reset();
await getList(); await getList();
} }
}); });

View File

@ -19,22 +19,6 @@
<el-card shadow="never"> <el-card shadow="never">
<template #header> <template #header>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['out:monthPlan:add']">新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['out:monthPlan:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['out:monthPlan:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['out:monthPlan:export']">导出</el-button>
</el-col> -->
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
</template> </template>
@ -57,6 +41,8 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="210"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="210">
<template #default="scope"> <template #default="scope">
<el-button type="primary" link icon="Edit" @click="handleAdd(scope.row)" v-hasPermi="['out:monthPlan:add']">编辑</el-button>
<el-button link type="primary" icon="Finished" @click="handleAudit(scope.row)" v-hasPermi="['out:constructionValue:remove']" <el-button link type="primary" icon="Finished" @click="handleAudit(scope.row)" v-hasPermi="['out:constructionValue:remove']"
>审核</el-button >审核</el-button
> >
@ -70,12 +56,19 @@
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="monthPlanFormRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="monthPlanFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="所属项目" prop="projectId"> <el-form-item label="所属项目" prop="projectId">
<el-select v-model="form.projectId" placeholder="请选择所属项目"> <el-select v-model="form.projectId" placeholder="请选择所属项目" disabled>
<el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="计划月份" prop="planMonth"> <el-form-item label="计划月份" prop="planMonth">
<el-date-picker v-model="form.planMonth" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" @change="handlePlanMonthChange" /> <el-date-picker
v-model="form.planMonth"
type="month"
value-format="YYYY-MM"
disabled
placeholder="请选择计划月份"
@change="handlePlanMonthChange"
/>
</el-form-item> </el-form-item>
<el-form-item label="计划产值" prop="planValue"> <el-form-item label="计划产值" prop="planValue">
<el-input v-model="form.planValue" placeholder="请输入计划产值" disabled /> <el-input v-model="form.planValue" placeholder="请输入计划产值" disabled />
@ -130,6 +123,7 @@ const initFormData: MonthPlanForm = {
planValue: undefined, planValue: undefined,
completeValue: undefined, completeValue: undefined,
differenceValue: undefined, differenceValue: undefined,
isDesign: false,
planMonth: undefined, planMonth: undefined,
valueType: '1', valueType: '1',
planAuditStatus: undefined, planAuditStatus: undefined,
@ -202,8 +196,12 @@ const handleSelectionChange = (selection: MonthPlanVO[]) => {
}; };
/** 新增按钮操作 */ /** 新增按钮操作 */
const handleAdd = () => { const handleAdd = (row?: MonthPlanVO) => {
reset(); reset();
if (row) {
Object.assign(form.value, row);
}
dialog.visible = true; dialog.visible = true;
dialog.title = '添加设计完工产值'; dialog.title = '添加设计完工产值';
}; };
@ -223,6 +221,7 @@ const submitForm = () => {
monthPlanFormRef.value?.validate(async (valid: boolean) => { monthPlanFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.isDesign = false;
await updateMonthPlan(form.value).finally(() => (buttonLoading.value = false)); await updateMonthPlan(form.value).finally(() => (buttonLoading.value = false));
proxy?.$modal.msgSuccess('操作成功'); proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false; dialog.visible = false;

View File

@ -78,7 +78,7 @@
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="monthPlanFormRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="monthPlanFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="计划产值" prop="planValue"> <el-form-item label="计划产值" prop="planValue">
<el-input v-model="form.planValue" placeholder="请输入计划产值" /> <el-input v-model="form.planValue" placeholder="请输入计划产值" type="number" />
</el-form-item> </el-form-item>
<el-form-item label="计划月份" prop="planMonth"> <el-form-item label="计划月份" prop="planMonth">
<el-date-picker v-model="form.planMonth" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" /> <el-date-picker v-model="form.planMonth" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" />
@ -135,6 +135,8 @@ const initFormData: MonthPlanForm = {
completeValue: undefined, completeValue: undefined,
differenceValue: undefined, differenceValue: undefined,
planMonth: undefined, planMonth: undefined,
isDesign: true,
valueType: undefined, valueType: undefined,
planAuditStatus: undefined, planAuditStatus: undefined,
completeAuditStatus: undefined completeAuditStatus: undefined
@ -228,6 +230,8 @@ const submitForm = () => {
monthPlanFormRef.value?.validate(async (valid: boolean) => { monthPlanFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.isDesign = true;
if (form.value.id) { if (form.value.id) {
await updateMonthPlan(form.value).finally(() => (buttonLoading.value = false)); await updateMonthPlan(form.value).finally(() => (buttonLoading.value = false));
} else { } else {

View File

@ -229,7 +229,7 @@ const submit = async (status, data) => {
proxy.$tab.closePage(proxy.$route); proxy.$tab.closePage(proxy.$route);
proxy.$router.go(-1); proxy.$router.go(-1);
} else { } else {
const res = await isSubmit(data[0]?.id); const res = await isSubmit(data[1]?.id);
if (!res.data) { if (!res.data) {
proxy?.$modal.msgError('三种计划产值必须填写'); proxy?.$modal.msgError('三种计划产值必须填写');