2025-08-07 19:22:17 +08:00
|
|
|
|
<template>
|
|
|
|
|
<div class="p-2">
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<!-- 流程分类树 -->
|
|
|
|
|
<el-col style="" :span="5">
|
|
|
|
|
<el-card shadow="hover">
|
|
|
|
|
<el-input v-model="queryParams.batchNumber" placeholder="请输入批次号" @input="getBatchList" prefix-icon="Search" clearable />
|
|
|
|
|
<el-tree
|
|
|
|
|
ref="batchTreeRef"
|
|
|
|
|
class="mt-2"
|
|
|
|
|
node-key="batchNumber"
|
|
|
|
|
:data="batchOptions"
|
|
|
|
|
:props="{ label: 'batchNumber', children: 'children' }"
|
|
|
|
|
:expand-on-click-node="false"
|
|
|
|
|
highlight-current
|
|
|
|
|
default-expand-all
|
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
|
></el-tree>
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total > 0"
|
|
|
|
|
:total="total"
|
|
|
|
|
v-model:page="queryParams.pageNum"
|
|
|
|
|
v-model:limit="queryParams.pageSize"
|
|
|
|
|
@pagination="getBatchList"
|
|
|
|
|
layout="prev, pager, next,jumper"
|
|
|
|
|
/>
|
|
|
|
|
</el-card>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="19">
|
|
|
|
|
<el-card shadow="never">
|
|
|
|
|
<el-table v-loading="loading" :data="cailiaoshebeiList" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-table-column label="设备材料名称" align="center" prop="name" width="110" />
|
2025-08-07 19:22:17 +08:00
|
|
|
|
<el-table-column label="规格型号" align="center" prop="specification" />
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-table-column label="需求数量" align="center" prop="demandQuantity" />
|
2025-08-07 19:22:17 +08:00
|
|
|
|
<el-table-column label="物料编码" align="center" prop="materialCode" width="200" />
|
|
|
|
|
<el-table-column label="计量单位" align="center" prop="unit" />
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-table-column label="计划到场时间" align="center" prop="arrivalTime" width="110" />
|
|
|
|
|
<el-table-column label="订货数量" align="center" prop="orderQuantity" />
|
|
|
|
|
<el-table-column label="预计到货时间" align="center" prop="expectedArrival" width="110" />
|
|
|
|
|
<el-table-column label="预计生产完成时间" align="center" prop="productionTime" width="130" />
|
|
|
|
|
<el-table-column label="验收数量" align="center" prop="acceptanceQuantity" />
|
|
|
|
|
<el-table-column label="实际到货时间" align="center" prop="actualArrival" width="110" />
|
|
|
|
|
<el-table-column label="需求提交时间" align="center" prop="requiredTime" width="110" />
|
|
|
|
|
<el-table-column label="订货时间" align="center" prop="orderTime" width="110" />
|
|
|
|
|
<el-table-column label="验收时间" align="center" prop="receptionTime" width="110" />
|
|
|
|
|
<el-table-column label="物资执行状态" align="center" prop="materialStatus" width="110">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="material_status" :value="scope.row.materialStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="物资逾期类型" align="center" prop="overdueType" width="110">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="overdue_type" :value="scope.row.overdueType" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="逾期原因" align="center" prop="cause" />
|
|
|
|
|
<el-table-column label="签收单据" align="center" prop="signature" />
|
|
|
|
|
<el-table-column label="退货单据" align="center" prop="returnedSalesReport" />
|
2025-08-07 19:22:17 +08:00
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-table-column label="操作" align="center" width="150" fixed="right">
|
2025-08-07 19:22:17 +08:00
|
|
|
|
<template #default="scope">
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['cailiaoshebei:cailiaoshebei:edit']"
|
|
|
|
|
>修改</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['cailiaoshebei:cailiaoshebei:remove']"
|
|
|
|
|
>删除</el-button
|
|
|
|
|
>
|
2025-08-07 19:22:17 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-card>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改物资-材料设备对话框 -->
|
|
|
|
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-form ref="cailiaoshebeiFormRef" :model="form" :rules="rules" label-width="130px">
|
|
|
|
|
<el-form-item label="物资执行状态" prop="materialStatus">
|
|
|
|
|
<el-select v-model="form.bo.materialStatus" placeholder="请选择物资执行状态" clearable filterable @change="handleChange">
|
|
|
|
|
<el-option v-for="item in material_status" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
|
</el-select>
|
2025-08-07 19:22:17 +08:00
|
|
|
|
</el-form-item>
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-form-item label="物资逾期类型" prop="overdueType" v-if="form.bo.materialStatus == 3">
|
|
|
|
|
<el-select v-model="form.bo.overdueType" placeholder="请选择物资逾期类型" clearable filterable>
|
|
|
|
|
<el-option v-for="item in overdue_type" :key="item.value" :label="item.label" :value="item.value" />
|
2025-08-07 19:22:17 +08:00
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-form-item label="逾期原因" prop="cause" v-if="form.bo.materialStatus == 3">
|
|
|
|
|
<el-input v-model="form.bo.cause" placeholder="请输入逾期原因" />
|
2025-08-07 19:22:17 +08:00
|
|
|
|
</el-form-item>
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-form-item label="实际到货时间" prop="actualArrival" v-if="form.bo.materialStatus < 4">
|
|
|
|
|
<el-date-picker clearable v-model="form.bo.actualArrival" type="date" value-format="YYYY-MM-DD" placeholder="请选择实际到货时间" />
|
2025-08-07 19:22:17 +08:00
|
|
|
|
</el-form-item>
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-form-item label="验收时间" prop="receptionTime" v-if="form.bo.materialStatus < 4">
|
|
|
|
|
<el-date-picker clearable v-model="form.bo.receptionTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择验收时间" />
|
2025-08-07 19:22:17 +08:00
|
|
|
|
</el-form-item>
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-form-item label="验收数量" prop="acceptanceQuantity" v-if="form.bo.materialStatus < 4">
|
|
|
|
|
<el-input v-model="form.bo.acceptanceQuantity" type="number" placeholder="请输入验收数量" />
|
2025-08-07 19:22:17 +08:00
|
|
|
|
</el-form-item>
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-form-item label="需求提交时间" prop="requiredTime">
|
|
|
|
|
<el-date-picker clearable v-model="form.bo.requiredTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择需求提交时间" />
|
2025-08-07 19:22:17 +08:00
|
|
|
|
</el-form-item>
|
2025-08-08 20:03:00 +08:00
|
|
|
|
|
|
|
|
|
<el-form-item label="订货时间" prop="orderTime">
|
|
|
|
|
<el-date-picker clearable v-model="form.bo.orderTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择订货时间" />
|
2025-08-07 19:22:17 +08:00
|
|
|
|
</el-form-item>
|
2025-08-08 20:03:00 +08:00
|
|
|
|
|
|
|
|
|
<el-form-item label="操作状态" prop="operationStatus" v-if="form.bo.materialStatus <= 4 || form.bo.materialStatus == 10">
|
|
|
|
|
<el-select v-model="form.bo.operationStatus" placeholder="请选择物资执行状态" clearable filterable @change="handleChange">
|
|
|
|
|
<el-option v-for="item in operation_s" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="单据类型" prop="billType" v-if="form.bo.materialStatus < 4 || form.bo.materialStatus == 10">
|
|
|
|
|
<el-select v-model="form.bo.billType" placeholder="请选择单据类型" clearable filterable>
|
|
|
|
|
<el-option label="签收单" value="1" />
|
|
|
|
|
<el-option label="退货单" value="2" />
|
|
|
|
|
</el-select>
|
2025-08-07 19:22:17 +08:00
|
|
|
|
</el-form-item>
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-form-item label="上传文件" prop="file" v-if="form.bo.materialStatus < 4 || form.bo.materialStatus == 10">
|
|
|
|
|
<file-upload
|
|
|
|
|
v-model="form.file"
|
|
|
|
|
:fileType="['doc', 'docx']"
|
|
|
|
|
:autoUpload="false"
|
|
|
|
|
ref="fileUploadRef"
|
|
|
|
|
:data="{ ...form.bo }"
|
|
|
|
|
uploadUrl="/cailiaoshebei/materialsorder/changeTheStatusOfTheMaterials"
|
|
|
|
|
:onUploadError="
|
|
|
|
|
(err, file, fileList) => {
|
|
|
|
|
buttonLoading = false;
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
:limit="1"
|
|
|
|
|
:onUploadSuccess="handleUploadSuccess"
|
|
|
|
|
showFileList
|
|
|
|
|
/>
|
2025-08-07 19:22:17 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="备注" prop="remark">
|
2025-08-08 20:03:00 +08:00
|
|
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
2025-08-07 19:22:17 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
2025-08-08 20:03:00 +08:00
|
|
|
|
|
2025-08-07 19:22:17 +08:00
|
|
|
|
<template #footer>
|
|
|
|
|
<div class="dialog-footer">
|
|
|
|
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup name="Cailiaoshebei" lang="ts">
|
|
|
|
|
import {
|
|
|
|
|
listCailiaoshebei,
|
|
|
|
|
getCailiaoshebei,
|
|
|
|
|
delCailiaoshebei,
|
|
|
|
|
addCailiaoshebei,
|
|
|
|
|
updateCailiaoshebei,
|
|
|
|
|
listBatch,
|
|
|
|
|
getBatch,
|
|
|
|
|
delBatch
|
|
|
|
|
} from '@/api/materials/orderMaterials';
|
|
|
|
|
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;
|
2025-08-08 20:03:00 +08:00
|
|
|
|
const { supply, overdue_type, material_status, operation_status } = toRefs<any>(
|
|
|
|
|
proxy?.useDict('supply', 'material_status', 'overdue_type', 'operation_status')
|
|
|
|
|
);
|
2025-08-07 19:22:17 +08:00
|
|
|
|
// 获取用户 store
|
|
|
|
|
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);
|
|
|
|
|
const showSearch = ref(true);
|
|
|
|
|
const ids = ref<Array<string | number>>([]);
|
|
|
|
|
const single = ref(true);
|
|
|
|
|
const multiple = ref(true);
|
|
|
|
|
const total = ref(0);
|
|
|
|
|
const batchOptions = ref<any[]>([]);
|
2025-08-08 20:03:00 +08:00
|
|
|
|
const fileUploadRef = ref();
|
2025-08-07 19:22:17 +08:00
|
|
|
|
|
|
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
|
|
|
const cailiaoshebeiFormRef = ref<ElFormInstance>();
|
|
|
|
|
|
|
|
|
|
const dialog = reactive<DialogOption>({
|
|
|
|
|
visible: false,
|
|
|
|
|
title: ''
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const initFormData: CailiaoshebeiForm = {
|
|
|
|
|
id: undefined,
|
|
|
|
|
batchNumber: undefined,
|
|
|
|
|
supplierId: undefined,
|
|
|
|
|
supplier: undefined,
|
|
|
|
|
name: undefined,
|
|
|
|
|
supply: undefined,
|
|
|
|
|
specification: undefined,
|
|
|
|
|
signalment: undefined,
|
|
|
|
|
materialCode: undefined,
|
|
|
|
|
arrivalTime: undefined,
|
|
|
|
|
finishTime: undefined,
|
|
|
|
|
unit: undefined,
|
|
|
|
|
plan: undefined,
|
|
|
|
|
realQuantity: undefined,
|
2025-08-08 20:03:00 +08:00
|
|
|
|
file: undefined,
|
2025-08-07 19:22:17 +08:00
|
|
|
|
projectId: currentProject.value.id,
|
2025-08-08 20:03:00 +08:00
|
|
|
|
bo: {
|
|
|
|
|
requiredTime: undefined,
|
|
|
|
|
orderTime: undefined,
|
|
|
|
|
receptionTime: undefined,
|
|
|
|
|
materialStatus: undefined,
|
|
|
|
|
overdueType: undefined,
|
|
|
|
|
cause: undefined,
|
|
|
|
|
billType: undefined,
|
|
|
|
|
remark: undefined
|
|
|
|
|
},
|
2025-08-07 19:22:17 +08:00
|
|
|
|
remark: undefined
|
|
|
|
|
};
|
|
|
|
|
const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({
|
|
|
|
|
form: { ...initFormData },
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
batchNumber: undefined,
|
|
|
|
|
supplierId: undefined,
|
|
|
|
|
supplier: undefined,
|
|
|
|
|
name: undefined,
|
|
|
|
|
projectId: currentProject.value.id,
|
|
|
|
|
supply: undefined,
|
|
|
|
|
specification: undefined,
|
|
|
|
|
signalment: undefined,
|
|
|
|
|
materialCode: undefined,
|
|
|
|
|
arrivalTime: undefined,
|
|
|
|
|
finishTime: undefined,
|
|
|
|
|
unit: undefined,
|
|
|
|
|
plan: undefined,
|
|
|
|
|
realQuantity: undefined,
|
|
|
|
|
params: {}
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }]
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { queryParams, form, rules } = toRefs(data);
|
|
|
|
|
|
|
|
|
|
/** 查询物资-材料设备列表 */
|
|
|
|
|
const getList = async () => {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
const res = await listCailiaoshebei(queryParams.value);
|
|
|
|
|
cailiaoshebeiList.value = res.rows;
|
|
|
|
|
|
|
|
|
|
loading.value = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//查询批次列表
|
|
|
|
|
const getBatchList = async () => {
|
|
|
|
|
const res = await listBatch(queryParams.value);
|
|
|
|
|
console.log('🚀 ~ getBatchList ~ res:', res);
|
|
|
|
|
batchOptions.value = res.rows;
|
|
|
|
|
total.value = res.total;
|
|
|
|
|
try {
|
|
|
|
|
batchTreeRef.value.setCurrentKey(res.rows[0].batchNumber);
|
|
|
|
|
form.value.batchNumber = res.rows[0].batchNumber;
|
|
|
|
|
} catch (error) {
|
|
|
|
|
form.value.batchNumber = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getList();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 节点单击事件 */
|
|
|
|
|
const handleNodeClick = (data: any) => {
|
|
|
|
|
queryParams.value.batchNumber = data.batchNumber;
|
|
|
|
|
form.value.batchNumber = data.batchNumber;
|
|
|
|
|
console.log('🚀 ~ handleNodeClick ~ form.value:', form.value);
|
|
|
|
|
if (data.batchNumber === '0') {
|
|
|
|
|
queryParams.value.batchNumber = '';
|
|
|
|
|
}
|
|
|
|
|
getList();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 取消按钮 */
|
|
|
|
|
const cancel = () => {
|
|
|
|
|
reset();
|
|
|
|
|
dialog.visible = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 表单重置 */
|
|
|
|
|
const reset = () => {
|
|
|
|
|
const preservedBatchId = form.value.batchNumber; // 先保存当前的 batchNumber
|
|
|
|
|
form.value = { ...initFormData, batchNumber: preservedBatchId }; // 重置但保留
|
|
|
|
|
cailiaoshebeiFormRef.value?.resetFields();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
const handleQuery = () => {
|
|
|
|
|
queryParams.value.pageNum = 1;
|
|
|
|
|
getList();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
const resetQuery = () => {
|
|
|
|
|
queryFormRef.value?.resetFields();
|
|
|
|
|
handleQuery();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 多选框选中数据 */
|
|
|
|
|
const handleSelectionChange = (selection: CailiaoshebeiVO[]) => {
|
|
|
|
|
ids.value = selection.map((item) => item.id);
|
|
|
|
|
single.value = selection.length != 1;
|
|
|
|
|
multiple.value = !selection.length;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
const handleAdd = () => {
|
|
|
|
|
reset();
|
|
|
|
|
dialog.visible = true;
|
|
|
|
|
dialog.title = '添加物资-材料设备';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 修改按钮操作 */
|
2025-08-08 20:03:00 +08:00
|
|
|
|
const operation_s = ref([]);
|
2025-08-07 19:22:17 +08:00
|
|
|
|
const handleUpdate = async (row?: CailiaoshebeiVO) => {
|
|
|
|
|
reset();
|
2025-08-08 20:03:00 +08:00
|
|
|
|
operation_s.value = operation_status.value.slice(0, 2);
|
|
|
|
|
Object.assign(form.value.bo, row);
|
|
|
|
|
console.log('🚀 ~ handleUpdate ~ form.value:', form.value);
|
|
|
|
|
// selectValue.value = (form.value.supplierId as string).split(',');
|
2025-08-07 19:22:17 +08:00
|
|
|
|
dialog.visible = true;
|
|
|
|
|
dialog.title = '修改物资-材料设备';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
const submitForm = () => {
|
|
|
|
|
console.log('🚀 ~ submitForm ~ form.value:', form.value);
|
|
|
|
|
cailiaoshebeiFormRef.value?.validate(async (valid: boolean) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
buttonLoading.value = true;
|
2025-08-08 20:03:00 +08:00
|
|
|
|
fileUploadRef.value!.submitUpload();
|
2025-08-07 19:22:17 +08:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 新增批次 */
|
|
|
|
|
const addBatch = async () => {
|
|
|
|
|
await proxy?.$modal.confirm('是否确认新增批次?').finally(() => (loading.value = false));
|
|
|
|
|
const res = await getBatch({ projectId: currentProject.value.id });
|
|
|
|
|
console.log('🚀 ~ addBatch ~ res:', res);
|
|
|
|
|
await getBatchList();
|
|
|
|
|
|
|
|
|
|
proxy?.$modal.msgSuccess('新增成功');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 删除批次 */
|
|
|
|
|
const handleDeleteBatch = async () => {
|
|
|
|
|
const _ids = batchTreeRef.value.getCurrentNode()?.id;
|
|
|
|
|
await proxy?.$modal.confirm('是否确认删除批次编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
|
|
|
|
await delBatch(_ids);
|
|
|
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
|
|
|
queryParams.value.batchNumber = '';
|
|
|
|
|
|
|
|
|
|
await getBatchList();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
const handleDelete = async (row?: CailiaoshebeiVO) => {
|
|
|
|
|
const _ids = row?.id || ids.value;
|
|
|
|
|
await proxy?.$modal.confirm('是否确认删除物资-材料设备编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
|
|
|
|
await delCailiaoshebei(_ids);
|
|
|
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
|
|
|
await getList();
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-08 20:03:00 +08:00
|
|
|
|
const handleUploadSuccess = () => {
|
|
|
|
|
proxy?.$modal.msgSuccess('操作成功');
|
|
|
|
|
dialog.visible = false;
|
|
|
|
|
buttonLoading.value = false;
|
|
|
|
|
getList();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleChange = (value: number) => {
|
|
|
|
|
if (!(value < 4 || value == 10)) {
|
|
|
|
|
form.value.bo.billType = '';
|
|
|
|
|
form.value.file = '';
|
|
|
|
|
} else if (value == 3) {
|
|
|
|
|
form.value.bo.overdueType = '';
|
|
|
|
|
form.value.bo.cause = '';
|
|
|
|
|
}
|
2025-08-07 19:22:17 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 查询供货商列表 */
|
|
|
|
|
const supplierOptions = ref([]);
|
|
|
|
|
const getSupplierList = async () => {
|
|
|
|
|
const res = await listContractor({
|
|
|
|
|
projectId: currentProject.value.id,
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10000
|
|
|
|
|
});
|
|
|
|
|
supplierOptions.value = res.rows;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 中间数组变量供 el-select 使用
|
|
|
|
|
const selectValue = ref<string[]>([]);
|
|
|
|
|
|
|
|
|
|
// 监听 selectValue,每次变化时同步更新 form.supplierId 和 form.supplier
|
|
|
|
|
watch(
|
|
|
|
|
selectValue,
|
|
|
|
|
(newVal) => {
|
|
|
|
|
form.value.supplierId = newVal.join(',');
|
|
|
|
|
const selectedNames = supplierOptions.value.filter((opt) => newVal.includes(opt.id)).map((opt) => opt.name);
|
|
|
|
|
form.value.supplier = selectedNames.join(',');
|
|
|
|
|
},
|
|
|
|
|
{ immediate: true }
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getBatchList();
|
|
|
|
|
getSupplierList();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//监听项目id刷新数据
|
|
|
|
|
const listeningProject = watch(
|
|
|
|
|
() => currentProject.value.id,
|
|
|
|
|
(nid, oid) => {
|
|
|
|
|
queryParams.value.projectId = nid;
|
|
|
|
|
form.value.projectId = nid;
|
|
|
|
|
getBatchList();
|
|
|
|
|
getSupplierList();
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
listeningProject();
|
|
|
|
|
});
|
|
|
|
|
</script>
|