优化逻辑bug

This commit is contained in:
Teo
2025-08-20 19:25:52 +08:00
parent 6cab291522
commit c98e3f72e1
28 changed files with 962 additions and 787 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.180:8899' VITE_APP_BASE_API = 'http://192.168.110.209:8899'
# 无人机接口地址 # 无人机接口地址

View File

@ -19,22 +19,3 @@ onMounted(() => {
}); });
}); });
</script> </script>
<style>
* {
-webkit-touch-callout: none; /*系统默认菜单被禁用*/
-webkit-user-select: none; /*webkit浏览器*/
-khtml-user-select: none; /*早期浏览器*/
-moz-user-select: none; /*火狐*/
-ms-user-select: none; /*IE10*/
user-select: none;
}
input {
-webkit-user-select: auto; /*webkit浏览器*/
user-select: auto;
}
textarea {
user-select: auto;
-webkit-user-select: auto; /*webkit浏览器*/
}
</style>

View File

@ -96,7 +96,8 @@ const props = defineProps({
// 大小限制(MB) // 大小限制(MB)
fileSize: propTypes.number.def(5), fileSize: propTypes.number.def(5),
// 文件类型, 例如['png', 'jpg', 'jpeg'] // 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf', 'png', 'jpg', 'jpeg', 'zip']), // fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf', 'png', 'jpg', 'jpeg', 'zip']),
fileType: propTypes.array.def(['pdf']),
// 是否显示提示 // 是否显示提示
isShowTip: propTypes.bool.def(true), isShowTip: propTypes.bool.def(true),
//是否为施工人员上传 //是否为施工人员上传
@ -310,11 +311,6 @@ const uploadedSuccessfully = (res: any) => {
emit('update:modelValue', listToString(fileList.value)); emit('update:modelValue', listToString(fileList.value));
proxy?.$modal.closeLoading(); proxy?.$modal.closeLoading();
} }
if (props.autoUpload && props.limit === fileList.value.length) {
fileUploadRef.value?.clearFiles();
fileList.value = [];
emit('update:modelValue', ''); // 同步到外部 v-model
}
// if (props.autoUpload && props.limit === fileList.value.length) { // if (props.autoUpload && props.limit === fileList.value.length) {
// fileUploadRef.value?.clearFiles(); // fileUploadRef.value?.clearFiles();
// fileList.value = []; // fileList.value = [];

View File

@ -31,6 +31,7 @@
label="运行时长" label="运行时长"
width="140" width="140"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
:sort-method="sortTime"
sortable sortable
align="center" align="center"
></el-table-column> ></el-table-column>
@ -114,6 +115,25 @@ const handleDownload = (ossId: string) => {
proxy?.$download.oss(ossId); proxy?.$download.oss(ossId);
}; };
// 解析时间字符串,返回秒数
function parseTimeStr(str: string): number {
let total = 0;
const minMatch = str.match(/(\d+)分钟/);
const secMatch = str.match(/(\d+)秒/);
if (minMatch) total += parseInt(minMatch[1]) * 60;
if (secMatch) total += parseInt(secMatch[1]);
return total;
}
// 排序函数,根据时间字符串解析后的秒数排序
function sortTime(a: any, b: any) {
console.log(a, b);
return a.runDurationNum - b.runDurationNum;
// return parseTimeStr(a.runDuration) - parseTimeStr(b.runDuration);
}
/** /**
* 对外暴露子组件方法 * 对外暴露子组件方法
*/ */

View File

@ -4,8 +4,8 @@
<el-form-item label="消息提醒"> <el-form-item label="消息提醒">
<el-checkbox-group v-model="form.messageType"> <el-checkbox-group v-model="form.messageType">
<el-checkbox value="1" name="type" disabled>站内信</el-checkbox> <el-checkbox value="1" name="type" disabled>站内信</el-checkbox>
<el-checkbox value="2" name="type">邮件</el-checkbox> <el-checkbox value="2" name="type" disabled>邮件</el-checkbox>
<el-checkbox value="3" name="type">短信</el-checkbox> <el-checkbox value="3" name="type" disabled>短信</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item label="附件"> <el-form-item label="附件">

View File

@ -10,7 +10,7 @@
@click="isDisabled = false" @click="isDisabled = false"
class="px-8 py-2.5 transition-all duration-300 font-medium" class="px-8 py-2.5 transition-all duration-300 font-medium"
v-if="isDisabled" v-if="isDisabled"
v-hasPermi="['cailiaoshebei:purchaseUser:addOrUpdate']" v-hasPermi="['ailiaoshebei:purchaseUser:byProject']"
> >
点击编辑 点击编辑
</el-button> </el-button>
@ -38,11 +38,16 @@
@click="submitForm" @click="submitForm"
icon="Check" icon="Check"
class="px-8 py-2.5 transition-all duration-300 transform hover:scale-105 bg-blue-500 hover:bg-blue-600 text-white font-medium" class="px-8 py-2.5 transition-all duration-300 transform hover:scale-105 bg-blue-500 hover:bg-blue-600 text-white font-medium"
v-hasPermi="['cailiaoshebei:purchaseUser:addOrUpdate']" v-hasPermi="['ailiaoshebei:purchaseUser:byProject']"
> >
确认提交 确认提交
</el-button> </el-button>
<el-button @click="resetForm" icon="Refresh" class="px-8 py-2.5 transition-all duration-300 border-gray-300 hover:bg-gray-100 font-medium"> <el-button
@click="resetForm"
v-hasPermi="['ailiaoshebei:purchaseUser:byProject']"
icon="Refresh"
class="px-8 py-2.5 transition-all duration-300 border-gray-300 hover:bg-gray-100 font-medium"
>
重置 重置
</el-button> </el-button>
</div> </div>

View File

@ -21,7 +21,7 @@
><el-button ><el-button
type="danger" type="danger"
size="default" size="default"
v-hasPermi="['cailiaoshebei:batchPlan:remove']" v-hasPermi="['cailiaoshebei:materialbatchdemandplan:remove']"
@click="handleDeleteBatch" @click="handleDeleteBatch"
icon="FolderDelete" icon="FolderDelete"
plain plain
@ -65,10 +65,14 @@
<template #header> <template #header>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5" v-if="form.mrpBaseBo.status == 'draft'"> <el-col :span="1.5" v-if="form.mrpBaseBo.status == 'draft'">
<el-button type="primary" plain icon="Edit" @click="handleUpdata" v-hasPermi="['cailiaoshebei:cailiaoshebei:add']">修改</el-button> <el-button type="primary" plain icon="Edit" @click="handleUpdata" v-hasPermi="['cailiaoshebei:materialbatchdemandplan:edit']"
>修改</el-button
>
</el-col> </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="['cailiaoshebei:materialbatchdemandplan:query']"
>审核</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>
@ -82,7 +86,7 @@
<el-table-column label="质量标准" align="center" prop="qs" /> <el-table-column label="质量标准" align="center" prop="qs" />
<el-table-column label="规格型号" align="center" prop="specification" /> <el-table-column label="规格型号" align="center" prop="specification" />
<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="quantity" /> <el-table-column label="需求数量" align="center" prop="demandQuantity" />
<el-table-column label="需求到货时间" align="center" prop="arrivalTime" width="250" /> <el-table-column label="需求到货时间" align="center" prop="arrivalTime" width="250" />
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
</el-table> </el-table>
@ -139,9 +143,9 @@
<el-input v-model="scope.row.unit" placeholder="请输入单位" disabled /> <el-input v-model="scope.row.unit" placeholder="请输入单位" disabled />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="quantity" align="center" label="数量" width="130"> <el-table-column prop="demandQuantity" align="center" label="数量" width="130">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.quantity" placeholder="请输入数量" type="number" min="0" disabled /> <el-input v-model="scope.row.demandQuantity" placeholder="请输入数量" type="number" min="0" disabled />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="qs" align="center" label="质量标准" width="150"> <el-table-column prop="qs" align="center" label="质量标准" width="150">
@ -232,7 +236,8 @@ const initFormData: any = {
name: undefined, name: undefined,
specification: undefined, specification: undefined,
unit: undefined, unit: undefined,
quantity: undefined, suppliespriceId: undefined,
demandQuantity: undefined,
qs: undefined, qs: undefined,
arrivalTime: undefined, arrivalTime: undefined,
remark: undefined remark: undefined
@ -289,7 +294,7 @@ const selectName = (val: any, row: any) => {
row.specification = selected.specification; row.specification = selected.specification;
row.unit = selected.unit; row.unit = selected.unit;
row.qs = selected.qs; row.qs = selected.qs;
row.quantity = selected.quantity; row.demandQuantity = selected.quantity;
row.remark = selected.remark; row.remark = selected.remark;
row.arrivalTime = selected.arrivalTime; row.arrivalTime = selected.arrivalTime;
} }
@ -328,7 +333,7 @@ const addRow = () => {
name: undefined, name: undefined,
specification: undefined, specification: undefined,
unit: undefined, unit: undefined,
quantity: undefined, demandQuantity: undefined,
qs: undefined, qs: undefined,
arrivalTime: undefined, arrivalTime: undefined,
remark: undefined remark: undefined
@ -352,7 +357,9 @@ const reset = () => {
name: undefined, name: undefined,
specification: undefined, specification: undefined,
unit: undefined, unit: undefined,
quantity: undefined, suppliespriceId: undefined,
demandQuantity: undefined,
qs: undefined, qs: undefined,
arrivalTime: undefined, arrivalTime: undefined,
remark: undefined remark: undefined
@ -398,7 +405,7 @@ const handleUpdata = () => {
}, {}); }, {});
}); });
console.log(form.value); console.log(form.value.planList);
}); });
dialog.visible = true; dialog.visible = true;
dialog.title = '修改物资-需求'; dialog.title = '修改物资-需求';

View File

@ -58,10 +58,20 @@
<template #header> <template #header>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5" :offset="0" <el-col :span="1.5" :offset="0"
><el-button type="primary" size="default" @click="addBatch" icon="FolderAdd" plain>新增</el-button></el-col ><el-button type="primary" size="default" v-hasPermi="['cailiaoshebei:cailiaoshebei:add']" @click="addBatch" icon="FolderAdd" plain
>新增</el-button
></el-col
> >
<el-col :span="1.5" :offset="0" <el-col :span="1.5" :offset="0"
><el-button type="danger" size="default" @click="handleDeleteBatch" icon="FolderDelete" plain>删除</el-button></el-col ><el-button
type="danger"
size="default"
v-hasPermi="['cailiaoshebei:cailiaoshebei:remove']"
@click="handleDeleteBatch"
icon="FolderDelete"
plain
>删除</el-button
></el-col
> >
</el-row> </el-row>
</template> </template>
@ -125,7 +135,9 @@
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button plain type="warning" icon="Finished" @click="handleAudit()">审核</el-button> <el-button plain type="warning" v-hasPermi="['cailiaoshebei:cailiaoshebei:query']" icon="Finished" @click="handleAudit()"
>审核</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>

View File

@ -26,8 +26,8 @@
<el-input v-model="queryParams.storageUnit" placeholder="请输入保管单位" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.storageUnit" placeholder="请输入保管单位" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" v-hasPermi="['materials:materialIssue:list']" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button> <el-button icon="Refresh" v-hasPermi="['materials:materialIssue:list']" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>

View File

@ -23,8 +23,9 @@
<el-input v-model="queryParams.supplierUnit" placeholder="请输入供货单位" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.supplierUnit" placeholder="请输入供货单位" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" v-hasPermi="['materials:materialReceive:list']" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
<el-button icon="Refresh" v-hasPermi="['materials:materialReceive:list']" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
@ -183,7 +184,7 @@
:prop="`itemList.${index}.acceptedQuantity`" :prop="`itemList.${index}.acceptedQuantity`"
:rules="{ required: true, message: '验收数量不能为空', trigger: 'blur' }" :rules="{ required: true, message: '验收数量不能为空', trigger: 'blur' }"
> >
<el-input type="number" v-model="item.acceptedQuantity" placeholder="请输入验收" /> <el-input type="number" v-model="item.acceptedQuantity" placeholder="请输入验收" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">

View File

@ -81,10 +81,10 @@
<td colspan="8"> <td colspan="8">
<span>是否附带以下随机资料</span> <span>是否附带以下随机资料</span>
<div class="file_detail"> <div class="file_detail">
<span>(1) 合格证 {{ formData.certCountFile ? formData.certCountFile.length : 0 }} </span> <span>(1) 合格证 {{ formData.certCount ? formData.certCount : 0 }} </span>
<span>(2) 出厂报告 {{ formData.reportCountFileId ? formData.reportCountFileId.length : 0 }} </span> <span>(2) 出厂报告 {{ formData.reportCount ? formData.reportCount : 0 }} </span>
<span>(3) 技术资料文件 {{ formData.techDocCountFileId ? formData.techDocCountFileId.length : 0 }} </span> <span>(3) 技术资料文件 {{ formData.techDocCount ? formData.techDocCount : 0 }} </span>
<span>(4) 厂家资质文件 {{ formData.licenseCountFileId ? formData.licenseCountFileId.length : 0 }} </span> <span>(4) 厂家资质文件 {{ formData.licenseCount ? formData.licenseCount : 0 }} </span>
</div> </div>
</td> </td>
</tr> </tr>

View File

@ -8,8 +8,9 @@
<el-input v-model="queryParams.materialsName" placeholder="请输入材料名称" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.materialsName" placeholder="请输入材料名称" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" v-hasPermi="['materials:materialsInventory:list']" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
<el-button icon="Refresh" v-hasPermi="['materials:materialsInventory:list']" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>

View File

@ -47,13 +47,15 @@
plain plain
icon="Check" icon="Check"
@click="submitForm" @click="submitForm"
v-hasPermi="['cailiaoshebei:cailiaoshebei:delete']" v-hasPermi="['cailiaoshebei:materialsorder:modifyTheOrderForm']"
>保存</el-button >保存</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="['cailiaoshebei:materialsorder:list']"
>审核</el-button
>
</el-col> </el-col>
<el-col :span="1.5" v-if="form.approvalOrder == 'draft'"> <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:materialsorder:list']">分享</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>

View File

@ -65,7 +65,12 @@
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" width="150" fixed="right"> <el-table-column label="操作" align="center" width="150" fixed="right">
<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:materialsorder:changeTheStatusOfTheMaterials']"
>修改</el-button >修改</el-button
> >
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['cailiaoshebei:cailiaoshebei:remove']" <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['cailiaoshebei:cailiaoshebei:remove']"

View File

@ -6,10 +6,10 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-form :inline="true"> <el-form :inline="true">
<el-form-item v-if="state.masterData.status == 'draft'"> <el-form-item v-if="state.masterData.status == 'draft'">
<el-button type="primary" icon="edit" @click="clickApprovalSheet1()">审批</el-button> <el-button type="primary" v-hasPermi="['design:totalsupplyplan:queryList']" icon="edit" @click="clickApprovalSheet1()">审批</el-button>
</el-form-item> </el-form-item>
<el-form-item v-if="state.masterData.status == 'waiting' || state.masterData.status == 'finish'"> <el-form-item v-if="state.masterData.status == 'waiting' || state.masterData.status == 'finish'">
<el-button icon="view" @click="lookApprovalFlow()" type="warning">查看流程</el-button> <el-button icon="view" v-hasPermi="['design:totalsupplyplan:queryList']" @click="lookApprovalFlow()" type="warning">查看流程</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<right-toolbar @queryTable="getMasterDataList"></right-toolbar> <right-toolbar @queryTable="getMasterDataList"></right-toolbar>
@ -46,6 +46,7 @@
<el-button <el-button
:disabled="state.masterData.status == 'waiting' || state.masterData.status == 'finish'" :disabled="state.masterData.status == 'waiting' || state.masterData.status == 'finish'"
type="primary" type="primary"
v-hasPermi="['design:totalsupplyplan:edit']"
@click="editApprovalSheet(row)" @click="editApprovalSheet(row)"
>修改</el-button >修改</el-button
> >

View File

@ -14,8 +14,9 @@
<el-date-picker clearable v-model="queryParams.arrivalDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择到货日期" /> <el-date-picker clearable v-model="queryParams.arrivalDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择到货日期" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" v-hasPermi="['cailiaoshebei:purchaseDoc:list']" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
<el-button icon="Refresh" v-hasPermi="['cailiaoshebei:purchaseDoc:list']" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
@ -49,7 +50,7 @@
<el-table-column label="联系人" align="center" prop="contacts" /> <el-table-column label="联系人" align="center" prop="contacts" />
<el-table-column label="物流单号" align="center" prop="remark" width="150"> <el-table-column label="物流单号" align="center" prop="remark" width="150">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['out:monthPlan:remove']">查看物流单</el-button> <el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['cailiaoshebei:ltn:list']">查看物流单</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="采购经办人" align="center" prop="purchasingAgent" width="90" /> <el-table-column label="采购经办人" align="center" prop="purchasingAgent" width="90" />
@ -76,7 +77,7 @@
v-if="scope.row.status == 'draft' || scope.row.status == 'back'" v-if="scope.row.status == 'draft' || scope.row.status == 'back'"
icon="Finished" icon="Finished"
@click="handleAudit(scope.row)" @click="handleAudit(scope.row)"
v-hasPermi="['cailiaoshebei:purchaseDoc:edit']" v-hasPermi="['cailiaoshebei:purchaseDoc:query']"
> >
审核</el-button 审核</el-button
> >
@ -86,7 +87,7 @@
v-if="scope.row.status != 'draft'" v-if="scope.row.status != 'draft'"
icon="view" icon="view"
@click="handleViewDetail(scope.row)" @click="handleViewDetail(scope.row)"
v-hasPermi="['cailiaoshebei:purchaseDoc:edit']" v-hasPermi="['cailiaoshebei:purchaseDoc:query']"
> >
查看</el-button 查看</el-button
> >
@ -114,7 +115,7 @@
v-if="scope.row.status == 'finish' && scope.row.feedbackUrl" v-if="scope.row.status == 'finish' && scope.row.feedbackUrl"
icon="Share" icon="Share"
@click="handleShare(scope.row)" @click="handleShare(scope.row)"
v-hasPermi="['cailiaoshebei:purchaseDoc:remove']" v-hasPermi="['cailiaoshebei:purchaseDoc:list']"
>物流单分享</el-button >物流单分享</el-button
> >
</template> </template>

View File

@ -8,8 +8,9 @@
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" v-hasPermi="['system:repertoryDetails:list']" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
<el-button icon="Refresh" v-hasPermi="['system:repertoryDetails:list']" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>

View File

@ -8,56 +8,34 @@
<el-input v-model="queryParams.name" placeholder="请输入设备材料名称" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.name" placeholder="请输入设备材料名称" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" v-hasPermi="['cailiaoshebei:repertory:list']" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
<el-button icon="Refresh" v-hasPermi="['cailiaoshebei:repertory:list']" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
</div> </div>
</transition> </transition>
<el-card shadow="never"> <el-card shadow="never">
<!-- <template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:repertory:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:repertory:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:repertory:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:repertory:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template> -->
<el-table v-loading="loading" :data="repertoryList"> <el-table v-loading="loading" :data="repertoryList">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<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="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">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" icon="View" @click="handleUpdate(scope.row)" v-hasPermi="['system:repertory:edit']">详情</el-button> <el-button link type="primary" icon="View" @click="handleUpdate(scope.row)" v-hasPermi="['cailiaoshebei:repertoryDetails:list']"
>详情</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card> </el-card>
</div> </div>
</template> </template>
<script setup name="Repertory" lang="ts"> <script setup name="Repertory" lang="ts">
import { listRepertory, getRepertory, delRepertory, addRepertory, updateRepertory } from '@/api/materials/repertory'; import { listRepertory } from '@/api/materials/repertory';
import { RepertoryVO, RepertoryQuery, RepertoryForm } from '@/api/materials/repertory/types'; import { RepertoryVO, RepertoryQuery, RepertoryForm } from '@/api/materials/repertory/types';
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';

View File

@ -4,17 +4,6 @@
<!-- 流程分类树 --> <!-- 流程分类树 -->
<el-col style="" :span="5"> <el-col style="" :span="5">
<el-card shadow="hover"> <el-card shadow="hover">
<!-- <template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5" :offset="0"
><el-button type="primary" size="default" @click="addBatch" 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-row>
</template> -->
<el-input v-model="batchNumber" placeholder="请输入批次号" @input="searchBatchList" prefix-icon="Search" clearable /> <el-input v-model="batchNumber" placeholder="请输入批次号" @input="searchBatchList" prefix-icon="Search" clearable />
<el-tree <el-tree
ref="batchTreeRef" ref="batchTreeRef"

View File

@ -2,17 +2,27 @@
<div class="p-5"> <div class="p-5">
<!-- 主要内容区 --> <!-- 主要内容区 -->
<el-card class="mb-5"> <el-card class="mb-5">
<el-button icon="Refresh" @click="refreshData" class="transition-all duration-200 hover:shadow-md"> <el-button
icon="Refresh"
v-hasPermi="['cailiaoshebei:physicalsupply:list']"
@click="refreshData"
class="transition-all duration-200 hover:shadow-md"
>
刷新 刷新
</el-button> </el-button>
</el-card> </el-card>
<!-- 数据表格 --> <!-- 数据表格 -->
<div class="bg-white rounded-lg shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md"> <div class="bg-white rounded-lg shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
<el-table v-loading="loading" :data="tableData" border stripe <el-table
v-loading="loading"
:data="tableData"
border
stripe
:header-cell-style="{ 'background-color': '#f5f7fa', 'font-weight': 'bold' }" :header-cell-style="{ 'background-color': '#f5f7fa', 'font-weight': 'bold' }"
style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" 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="id" label="ID" width="180" align="center"></el-table-column>
<el-table-column prop="name" label="材料名称" min-width="150"></el-table-column> <el-table-column prop="name" label="材料名称" min-width="150"></el-table-column>
<el-table-column prop="specification" label="规格" min-width="120"></el-table-column> <el-table-column prop="specification" label="规格" min-width="120"></el-table-column>
@ -39,12 +49,27 @@
<template #default="scope"> <template #default="scope">
<!-- <el-button size="small" icon="Plus" @click="handleAddSon(scope.row)" <!-- <el-button size="small" icon="Plus" @click="handleAddSon(scope.row)"
class="text-blue-600 hover:text-blue-800 transition-colors"></el-button> --> class="text-blue-600 hover:text-blue-800 transition-colors"></el-button> -->
<el-button size="small" icon="Edit" @click="handleEdit(scope.row)" <el-button
class="text-blue-600 hover:text-blue-800 transition-colors"></el-button> size="small"
<el-button size="small" icon="View" @click="jumpRouter(scope.row)" v-hasPermi="['cailiaoshebei:physicalsupply:edit']"
class="text-blue-600 hover:text-blue-800 transition-colors"></el-button> icon="Edit"
<el-button size="small" icon="Delete" @click="handleDelete(scope.row)" @click="handleEdit(scope.row)"
class="text-red-600 hover:text-red-800 transition-colors"></el-button> class="text-blue-600 hover:text-blue-800 transition-colors"
></el-button>
<el-button
size="small"
v-hasPermi="['cailiaoshebei:physicalsupplySon:list']"
icon="View"
@click="jumpRouter(scope.row)"
class="text-blue-600 hover:text-blue-800 transition-colors"
></el-button>
<el-button
size="small"
v-hasPermi="['cailiaoshebei:physicalsupply:remove']"
icon="Delete"
@click="handleDelete(scope.row)"
class="text-red-600 hover:text-red-800 transition-colors"
></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -52,18 +77,27 @@
<!-- 分页 --> <!-- 分页 -->
<div class="flex items-center justify-between p-4 border-t"> <div class="flex items-center justify-between p-4 border-t">
<div class="text-gray-500 text-sm"> <div class="text-gray-500 text-sm">
{{ total }} 条记录当前显示第 {{ (currentPage - 1) * pageSize + 1 }} {{ Math.min(currentPage * {{ total }} 条记录当前显示第 {{ (currentPage - 1) * pageSize + 1 }} {{ Math.min(currentPage * pageSize, total) }}
pageSize, total)
}}
</div> </div>
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 20, 50, 100]" <el-pagination
:total="total" layout="prev, pager, next, jumper, sizes" @size-change="handleSizeChange" v-model:current-page="currentPage"
@current-change="handleCurrentChange"></el-pagination> 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"
></el-pagination>
</div> </div>
</div> </div>
<!-- 新增/编辑对话框 --> <!-- 新增/编辑对话框 -->
<el-dialog v-model="dialogVisible" :title="dialogType === 'add' ? '新增记录' : '编辑记录'" :width="dialogWidth" <el-dialog
:fullscreen="isFullscreen" :before-close="handleDialogClose"> v-model="dialogVisible"
:title="dialogType === 'add' ? '新增记录' : '编辑记录'"
:width="dialogWidth"
:fullscreen="isFullscreen"
:before-close="handleDialogClose"
>
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="120px" class="space-y-4"> <el-form ref="formRef" :model="formData" :rules="formRules" label-width="120px" class="space-y-4">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
@ -107,8 +141,12 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="合同签订时间" prop="contractSigning"> <el-form-item label="合同签订时间" prop="contractSigning">
<el-date-picker v-model="formData.contractSigning" type="datetime" placeholder="选择合同签订时间" <el-date-picker
value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker> v-model="formData.contractSigning"
type="datetime"
placeholder="选择合同签订时间"
value-format="YYYY-MM-DD HH:mm:ss"
></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -137,9 +175,7 @@
<template #footer> <template #footer>
<div class="flex justify-end gap-2"> <div class="flex justify-end gap-2">
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="handleSave" :loading="saveLoading"> <el-button type="primary" @click="handleSave" :loading="saveLoading"> 保存 </el-button>
保存
</el-button>
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
@ -154,7 +190,7 @@ import { useRouter } from 'vue-router';
const userStore = useUserStoreHook(); const userStore = useUserStoreHook();
const router = useRouter(); const router = useRouter();
const currentProject = computed(() => userStore.selectedProject); const currentProject = computed(() => userStore.selectedProject);
import { useMaterialsQueryList, newMaterialsAdd, materialsEdit, materialsDel, queryMaterialsInfo } from "@/api/materials/usageMaterials/index"; import { useMaterialsQueryList, newMaterialsAdd, materialsEdit, materialsDel, queryMaterialsInfo } from '@/api/materials/usageMaterials/index';
// 表格数据相关 // 表格数据相关
const tableData = ref([]); const tableData = ref([]);
const total = ref(0); const total = ref(0);
@ -208,25 +244,23 @@ const formRules = reactive({
{ required: true, message: '请输入供应商', trigger: 'blur' }, { required: true, message: '请输入供应商', trigger: 'blur' },
{ max: 100, message: '供应商名称不能超过100个字符', trigger: 'blur' } { max: 100, message: '供应商名称不能超过100个字符', trigger: 'blur' }
], ],
findType: [ findType: [{ required: true, message: '请选择类型', trigger: 'change' }]
{ required: true, message: '请选择类型', trigger: 'change' }
]
}); });
// 格式化日期 // 格式化日期
const formatDate = (dateString) => { const formatDate = (dateString) => {
if (!dateString) return '-'; if (!dateString) return '-';
const date = new Date(dateString); const date = new Date(dateString);
return date.toLocaleString('zh-CN', { return date
year: 'numeric', .toLocaleString('zh-CN', {
month: '2-digit', year: 'numeric',
day: '2-digit', month: '2-digit',
hour: '2-digit', day: '2-digit',
minute: '2-digit', hour: '2-digit',
second: '2-digit' minute: '2-digit',
}).replace(',', ' '); second: '2-digit'
})
.replace(',', ' ');
}; };
// 表格行样式 // 表格行样式
@ -293,7 +327,7 @@ const handleEdit = (row) => {
resetForm(); resetForm();
// 填充表单数据 // 填充表单数据
Object.keys(formData).forEach(key => { Object.keys(formData).forEach((key) => {
if (row.hasOwnProperty(key)) { if (row.hasOwnProperty(key)) {
formData[key] = row[key]; formData[key] = row[key];
} }
@ -302,55 +336,49 @@ const handleEdit = (row) => {
dialogVisible.value = true; dialogVisible.value = true;
}; };
const handleAddSon = (row) => { const handleAddSon = (row) => {
ElMessageBox.confirm( ElMessageBox.confirm('确认提交', 'Warning', {
'确认提交', confirmButtonText: '确认',
'Warning', cancelButtonText: '取消',
{ type: 'warning'
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
materialsEdit(formData).then(res => {
let { code } = res
if (code === 200) {
ElMessage({
type: 'success',
message: '提交成功',
})
}
})
}).catch(() => {
ElMessage({
type: 'info',
message: '已取消提交',
})
}) })
.then(() => {
materialsEdit(formData).then((res) => {
let { code } = res;
if (code === 200) {
ElMessage({
type: 'success',
message: '提交成功'
});
}
});
})
.catch(() => {
ElMessage({
type: 'info',
message: '已取消提交'
});
});
}; };
// 删除 // 删除
const handleDelete = (row) => { const handleDelete = (row) => {
currentRow.value = row; currentRow.value = row;
ElMessageBox.confirm( ElMessageBox.confirm('确定要删除这条记录吗?此操作不可撤销,请谨慎操作', '提示', {
'确定要删除这条记录吗?此操作不可撤销,请谨慎操作', confirmButtonText: '确认',
'提示', cancelButtonText: '取消',
{ type: 'warning'
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
confirmDelete();
}).catch(() => {
ElMessage({
type: 'info',
message: '已取消删除',
})
}) })
.then(() => {
confirmDelete();
})
.catch(() => {
ElMessage({
type: 'info',
message: '已取消删除'
});
});
}; };
// 确认删除 // 确认删除
const confirmDelete = async () => { const confirmDelete = async () => {
if (!currentRow.value) return; if (!currentRow.value) return;
@ -358,7 +386,7 @@ const confirmDelete = async () => {
deleteLoading.value = true; deleteLoading.value = true;
try { try {
// 模拟API请求 // 模拟API请求
const res = await materialsDel(currentRow.value.id) const res = await materialsDel(currentRow.value.id);
const { code } = res; const { code } = res;
if (code === 200) { if (code === 200) {
ElMessage.success('删除成功'); ElMessage.success('删除成功');
@ -374,9 +402,7 @@ const confirmDelete = async () => {
deleteLoading.value = false; deleteLoading.value = false;
} }
}; };
// //
// 保存 // 保存
const handleSave = async () => { const handleSave = async () => {
@ -390,16 +416,16 @@ const handleSave = async () => {
if (dialogType.value === 'add') { if (dialogType.value === 'add') {
// 新增 // 新增
formData.projectId = currentProject.value?.id; formData.projectId = currentProject.value?.id;
const res = await newMaterialsAdd(formData) const res = await newMaterialsAdd(formData);
let { code } = res let { code } = res;
if (code === 200) { if (code === 200) {
ElMessage.success('新增成功'); ElMessage.success('新增成功');
fetchData(); fetchData();
} }
} else { } else {
// 编辑 // 编辑
const res = await materialsEdit(formData) const res = await materialsEdit(formData);
let { code } = res let { code } = res;
if (code === 200) { if (code === 200) {
ElMessage.success('保存成功'); ElMessage.success('保存成功');
fetchData(); fetchData();
@ -422,7 +448,7 @@ const resetForm = () => {
} }
// 重置表单数据 // 重置表单数据
Object.keys(formData).forEach(key => { Object.keys(formData).forEach((key) => {
formData[key] = ''; formData[key] = '';
}); });
@ -451,8 +477,6 @@ const jumpRouter = (row) => {
onMounted(() => { onMounted(() => {
fetchData(); fetchData();
}); });
</script> </script>
<style scoped> <style scoped></style>
</style>

View File

@ -1,8 +1,24 @@
<template> <template>
<div class="p-5"> <div class="p-5">
<el-card class="mb-5"> <el-card class="mb-5">
<el-button type="primary" icon="Plus" @click="handleAdd" class="transition-all duration-200 hover:shadow-md"> 新增 </el-button> <el-button
<el-button icon="Refresh" @click="refreshData" class="transition-all duration-200 hover:shadow-md"> 刷新 </el-button> type="primary"
icon="Plus"
v-hasPermi="['cailiaoshebei:physicalsupplySon:add']"
@click="handleAdd"
class="transition-all duration-200 hover:shadow-md"
>
新增
</el-button>
<el-button
icon="Refresh"
v-hasPermi="['cailiaoshebei:physicalsupplySon:list']"
@click="refreshData"
class="transition-all duration-200 hover:shadow-md"
>
刷新
</el-button>
</el-card> </el-card>
<div class="bg-white rounded-lg shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md"> <div class="bg-white rounded-lg shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
<!-- 数据表格 --> <!-- 数据表格 -->
@ -138,10 +154,12 @@
icon="Edit" icon="Edit"
@click="handleEdit2(scope.row)" @click="handleEdit2(scope.row)"
class="text-blue-600 hover:text-blue-800 transition-colors" class="text-blue-600 hover:text-blue-800 transition-colors"
v-hasPermi="['cailiaoshebei:physicalsupplySon:edit']"
></el-button> ></el-button>
<el-button <el-button
size="small" size="small"
icon="Delete" icon="Delete"
v-hasPermi="['cailiaoshebei:physicalsupplySon:remove']"
@click="handleDelete2(scope.row)" @click="handleDelete2(scope.row)"
class="text-red-600 hover:text-red-800 transition-colors" class="text-red-600 hover:text-red-800 transition-colors"
></el-button> ></el-button>

View File

@ -1,19 +1,36 @@
<template> <template>
<div style="padding: 20px;"> <div style="padding: 20px">
<el-card class="mb-5"> <el-card class="mb-5">
<el-button type="primary" icon="Plus" @click="handleAdd" class="transition-all duration-200 hover:shadow-md"> <el-button
type="primary"
v-hasPermi="['cailiaoshebei:physicalsupply:add']"
icon="Plus"
@click="handleAdd"
class="transition-all duration-200 hover:shadow-md"
>
新增 新增
</el-button> </el-button>
<el-button icon="Refresh" @click="refreshData" class="transition-all duration-200 hover:shadow-md"> 刷新 <el-button
v-hasPermi="['cailiaoshebei:physicalsupply:list']"
icon="Refresh"
@click="refreshData"
class="transition-all duration-200 hover:shadow-md"
>
刷新
</el-button> </el-button>
</el-card> </el-card>
<!-- 数据表格 --> <!-- 数据表格 -->
<div class="bg-white rounded-lg shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md"> <div class="bg-white rounded-lg shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
<el-table v-loading="loading" :data="tableData" border stripe <el-table
v-loading="loading"
:data="tableData"
border
stripe
style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)"
:header-cell-style="{ 'background-color': '#f5f7fa', 'font-weight': 'bold' }" :header-cell-style="{ 'background-color': '#f5f7fa', 'font-weight': 'bold' }"
: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="id" label="ID" width="180" align="center"></el-table-column>
<el-table-column prop="name" label="材料名称" align="center"></el-table-column> <el-table-column prop="name" label="材料名称" align="center"></el-table-column>
<el-table-column prop="specification" label="规格" align="center"></el-table-column> <el-table-column prop="specification" label="规格" align="center"></el-table-column>
@ -38,14 +55,34 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="240" align="center" fixed="right"> <el-table-column label="操作" width="240" align="center" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button size="small" icon="Plus" @click="handleAddSon(scope.row)" <el-button
class="text-blue-600 hover:text-blue-800 transition-colors"></el-button> v-hasPermi="['cailiaoshebei:physicalsupplySon:add']"
<el-button size="small" icon="Edit" @click="handleEdit(scope.row)" size="small"
class="text-blue-600 hover:text-blue-800 transition-colors"></el-button> icon="Plus"
<el-button size="small" icon="View" @click="jumpRouter(scope.row)" @click="handleAddSon(scope.row)"
class="text-blue-600 hover:text-blue-800 transition-colors"></el-button> class="text-blue-600 hover:text-blue-800 transition-colors"
<el-button size="small" icon="Delete" @click="handleDelete(scope.row)" ></el-button>
class="text-red-600 hover:text-red-800 transition-colors"></el-button> <el-button
v-hasPermi="['cailiaoshebei:physicalsupply:edit']"
size="small"
icon="Edit"
@click="handleEdit(scope.row)"
class="text-blue-600 hover:text-blue-800 transition-colors"
></el-button>
<el-button
v-hasPermi="['cailiaoshebei:physicalsupplySon:list']"
size="small"
icon="View"
@click="jumpRouter(scope.row)"
class="text-blue-600 hover:text-blue-800 transition-colors"
></el-button>
<el-button
v-hasPermi="['cailiaoshebei:physicalsupply:remove']"
size="small"
icon="Delete"
@click="handleDelete(scope.row)"
class="text-red-600 hover:text-red-800 transition-colors"
></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -53,17 +90,27 @@
<!-- 分页 --> <!-- 分页 -->
<div class="flex items-center justify-between p-4 border-t"> <div class="flex items-center justify-between p-4 border-t">
<div class="text-gray-500 text-sm"> <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> </div>
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 20, 50, 100]" <el-pagination
:total="total" layout="prev, pager, next, jumper, sizes" @size-change="handleSizeChange" v-model:current-page="currentPage"
@current-change="handleCurrentChange"></el-pagination> 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"
></el-pagination>
</div> </div>
</div> </div>
<!-- 新增/编辑对话框 --> <!-- 新增/编辑对话框 -->
<el-dialog v-model="dialogVisible" :title="dialogType === 'add' ? '新增记录' : '编辑记录'" :width="dialogWidth" <el-dialog
:fullscreen="isFullscreen" :before-close="handleDialogClose"> v-model="dialogVisible"
:title="dialogType === 'add' ? '新增记录' : '编辑记录'"
:width="dialogWidth"
:fullscreen="isFullscreen"
:before-close="handleDialogClose"
>
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="120px" class="space-y-4"> <el-form ref="formRef" :model="formData" :rules="formRules" label-width="120px" class="space-y-4">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
@ -107,8 +154,12 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="合同签订时间" prop="contractSigning"> <el-form-item label="合同签订时间" prop="contractSigning">
<el-date-picker v-model="formData.contractSigning" type="datetime" placeholder="选择合同签订时间" <el-date-picker
value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker> v-model="formData.contractSigning"
type="datetime"
placeholder="选择合同签订时间"
value-format="YYYY-MM-DD HH:mm:ss"
></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -121,8 +172,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="供货要求" prop="supplyRequirements"> <el-form-item label="供货要求" prop="supplyRequirements">
<el-input v-model="formData.supplyRequirements" placeholder="请输入供货要求" type="textarea" <el-input v-model="formData.supplyRequirements" placeholder="请输入供货要求" type="textarea" :rows="3"></el-input>
:rows="3"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -143,7 +193,6 @@
</template> </template>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script setup> <script setup>
@ -154,7 +203,7 @@ import { useRouter } from 'vue-router';
const userStore = useUserStoreHook(); const userStore = useUserStoreHook();
const router = useRouter(); const router = useRouter();
const currentProject = computed(() => userStore.selectedProject); const currentProject = computed(() => userStore.selectedProject);
import { useMaterialsQueryList, newMaterialsAdd, materialsEdit, materialsDel, queryMaterialsInfo } from '@/api/materials/usageMaterials/index'; import { useMaterialsQueryList, newMaterialsAdd, materialsEdit, materialsDel } from '@/api/materials/usageMaterials/index';
// 表格数据相关 // 表格数据相关
const tableData = ref([]); const tableData = ref([]);
const total = ref(0); const total = ref(0);
@ -251,7 +300,7 @@ const fetchData = async () => {
ElMessage.error('获取数据失败:' + error.message); ElMessage.error('获取数据失败:' + error.message);
console.error(error); console.error(error);
} finally { } finally {
loading.value = false;// loading.value = false; //
} }
}; };
@ -332,22 +381,20 @@ const handleAddSon = (row) => {
// 删除 // 删除
const handleDelete = (row) => { const handleDelete = (row) => {
currentRow.value = row; currentRow.value = row;
ElMessageBox.confirm( ElMessageBox.confirm('确定要删除这条记录吗?此操作不可撤销,请谨慎操作', '提示', {
'确定要删除这条记录吗?此操作不可撤销,请谨慎操作', confirmButtonText: '确认',
'提示', cancelButtonText: '取消',
{ type: 'warning'
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
confirmDelete();
}).catch(() => {
ElMessage({
type: 'info',
message: '已取消删除',
})
}) })
.then(() => {
confirmDelete();
})
.catch(() => {
ElMessage({
type: 'info',
message: '已取消删除'
});
});
}; };
// 确认删除 // 确认删除

File diff suppressed because it is too large Load Diff

View File

@ -208,7 +208,20 @@ const data = reactive<PageData<ConstructionValueForm, ConstructionValueQuery>>({
artificialNum: [{ required: true, message: '人工填报数量不能为空', trigger: 'blur' }], artificialNum: [{ required: true, message: '人工填报数量不能为空', trigger: 'blur' }],
reportDateId: [{ required: true, message: '上报日期不能为空', trigger: 'blur' }], reportDateId: [{ required: true, message: '上报日期不能为空', trigger: 'blur' }],
uavNum: [{ required: true, message: '无人机识别数量不能为空', trigger: 'blur' }], uavNum: [{ required: true, message: '无人机识别数量不能为空', trigger: 'blur' }],
confirmNum: [{ required: true, message: '确认数量不能为空', trigger: 'blur' }], confirmNum: [
{ required: true, message: '确认数量不能为空', trigger: 'blur' },
{
validator: (rule: any, value: any, callback: any) => {
// 判断是否整数
if (!/^\d+$/.test(value)) {
callback(new Error('请输入整数'));
} else {
callback();
}
},
trigger: 'blur'
}
],
outValue: [{ required: true, message: '产值不能为空', trigger: 'blur' }] outValue: [{ required: true, message: '产值不能为空', trigger: 'blur' }]
} }
}); });

View File

@ -73,7 +73,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<div v-if="scope.row.parentId"> <div>
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['progress:progressCategory:edit']"> <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['progress:progressCategory:edit']">
修改 修改
</el-button> </el-button>
@ -88,6 +88,21 @@
<!-- 添加或修改分项工程单价对话框 --> <!-- 添加或修改分项工程单价对话框 -->
<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="progressCategoryFormRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="progressCategoryFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="父类别" prop="parentId">
<el-tree-select
v-model="form.parentId"
:data="progressCategoryOptions"
:props="{ value: 'id', label: 'name', children: 'children' }"
value-key="id"
placeholder="请选择父类别"
check-strictly
/>
</el-form-item>
<el-form-item label="计量方式" prop="unitType">
<el-select v-model="form.unitType" placeholder="请选择关联数据">
<el-option v-for="dict in progress_unit_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="类别名称" prop="name"> <el-form-item label="类别名称" prop="name">
<el-input v-model="form.name" placeholder="请输入类别名称" :disabled="form.id != null" /> <el-input v-model="form.name" placeholder="请输入类别名称" :disabled="form.id != null" />
</el-form-item> </el-form-item>
@ -100,7 +115,14 @@
<el-form-item label="综合单价" prop="unitPrice"> <el-form-item label="综合单价" prop="unitPrice">
<el-input v-model="form.unitPrice" placeholder="请输入综合单价" /> <el-input v-model="form.unitPrice" placeholder="请输入综合单价" />
</el-form-item> </el-form-item>
<el-form-item label="关联数据" prop="workType">
<el-select v-model="form.workType" placeholder="请选择关联数据">
<el-option v-for="dict in progress_work_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<!-- <el-form-item label="总数量/百分比" prop="total"> <!-- <el-form-item label="总数量/百分比" prop="total">
<el-input v-model="form.total" placeholder="请输入总数量/百分比" /> <el-input v-model="form.total" placeholder="请输入总数量/百分比" />
</el-form-item> --> </el-form-item> -->
@ -128,7 +150,7 @@ import { ProgressCategoryVO, ProgressCategoryQuery, ProgressCategoryForm } from
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { progress_unit_type, progress_status } = toRefs<any>(proxy?.useDict('progress_unit_type', 'progress_status')); const { progress_unit_type, progress_work_type } = toRefs<any>(proxy?.useDict('progress_unit_type', 'progress_work_type'));
// 获取用户 store // 获取用户 store
const userStore = useUserStoreHook(); const userStore = useUserStoreHook();
@ -161,7 +183,7 @@ const dialog = reactive<DialogOption>({
const initFormData: ProgressCategoryForm = { const initFormData: ProgressCategoryForm = {
id: undefined, id: undefined,
parentId: undefined, parentId: undefined,
projectId: currentProject.value?.id, projectId: '',
matrixId: undefined, matrixId: undefined,
matrixName: undefined, matrixName: undefined,
name: undefined, name: undefined,
@ -183,6 +205,7 @@ const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({
queryParams: { queryParams: {
parentId: undefined, parentId: undefined,
projectId: currentProject.value?.id, projectId: currentProject.value?.id,
matrixId: undefined, matrixId: undefined,
matrixName: undefined, matrixName: undefined,
name: undefined, name: undefined,
@ -229,7 +252,10 @@ const getList = async () => {
}); });
if (!matrixValue.value) matrixValue.value = matrixList[0].id; if (!matrixValue.value) matrixValue.value = matrixList[0].id;
matrixOptions.value = matrixList; matrixOptions.value = matrixList;
console.log('🚀 ~ getList ~ matrixList:', matrixList);
queryParams.value.matrixId = matrixList[0].children[0].matrixId; queryParams.value.matrixId = matrixList[0].children[0].matrixId;
form.value.projectId = matrixList[0].projectId;
form.value.matrixId = matrixList[0].children[0].matrixId;
} }
} }
loading.value = true; loading.value = true;
@ -262,12 +288,19 @@ const cancel = () => {
// 表单重置 // 表单重置
const reset = () => { const reset = () => {
form.value = { ...initFormData }; const projectId = form.value.projectId;
const matrixId = form.value.matrixId;
form.value = { ...initFormData, projectId, matrixId };
isDisabled.value = false; isDisabled.value = false;
progressCategoryFormRef.value?.resetFields(); progressCategoryFormRef.value?.resetFields();
}; };
/** 级联选择器改变事件 */ /** 级联选择器改变事件 */
const handleChange = (value: number) => { const handleChange = (value: number) => {
form.value.matrixId = value[1];
form.value.projectId = value[0];
queryParams.value.matrixId = value[1]; queryParams.value.matrixId = value[1];
getList(); getList();

View File

@ -9,7 +9,7 @@
</el-form-item> </el-form-item>
<el-form-item label="施工类型" prop="constructionType"> <el-form-item label="施工类型" prop="constructionType">
<el-select v-model="queryParams.constructionType" placeholder="请选择施工类型" clearable @change="getList"> <el-select v-model="queryParams.constructionType" placeholder="请选择施工类型" clearable @change="getList">
<el-option v-for="dict in project_category_type" :key="dict.value" :label="dict.label" :value="dict.value" /> <el-option v-for="dict in project_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -89,7 +89,7 @@
</el-form-item> </el-form-item>
<el-form-item label="施工类型" prop="constructionType"> <el-form-item label="施工类型" prop="constructionType">
<el-select v-model="form.constructionType" placeholder="请选择施工类型" disabled> <el-select v-model="form.constructionType" placeholder="请选择施工类型" disabled>
<el-option v-for="dict in project_category_type" :key="dict.value" :label="dict.label" :value="dict.value" /> <el-option v-for="dict in project_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="计量方式" prop="unitType"> <el-form-item label="计量方式" prop="unitType">
@ -141,8 +141,8 @@ type ProgressCategoryTemplateOption = {
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { progress_work_type, progress_unit_type, project_category_type } = toRefs<any>( const { progress_work_type, progress_unit_type, project_type } = toRefs<any>(
proxy?.useDict('progress_work_type', 'progress_unit_type', 'project_category_type') proxy?.useDict('progress_work_type', 'progress_unit_type', 'project_type')
); );
const progressCategoryTemplateList = ref<ProgressCategoryTemplateVO[]>([]); const progressCategoryTemplateList = ref<ProgressCategoryTemplateVO[]>([]);
const progressCategoryTemplateOptions = ref<ProgressCategoryTemplateOption[]>([]); const progressCategoryTemplateOptions = ref<ProgressCategoryTemplateOption[]>([]);

View File

@ -77,13 +77,13 @@
<!-- 添加或修改进度类别模版对话框 --> <!-- 添加或修改进度类别模版对话框 -->
<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="progressCategoryTemplateFormRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="progressCategoryTemplateFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="父类别id" prop="parentId"> <el-form-item label="父类别" prop="parentId">
<el-tree-select <el-tree-select
v-model="form.parentId" v-model="form.parentId"
:data="progressCategoryTemplateOptions" :data="progressCategoryTemplateOptions"
:props="{ value: 'id', label: 'name', children: 'children' }" :props="{ value: 'id', label: 'name', children: 'children' }"
value-key="id" value-key="id"
placeholder="请选择父类别id" placeholder="请选择父类别"
check-strictly check-strictly
/> />
</el-form-item> </el-form-item>
@ -138,9 +138,7 @@ type ProgressCategoryTemplateOption = {
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { progress_work_type, progress_unit_type, project_category_type } = toRefs<any>( const { progress_work_type, progress_unit_type } = toRefs<any>(proxy?.useDict('progress_work_type', 'progress_unit_type'));
proxy?.useDict('progress_work_type', 'progress_unit_type', 'project_category_type')
);
// 获取用户 store // 获取用户 store
const userStore = useUserStoreHook(); const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目 // 从 store 中获取项目列表和当前选中的项目

View File

@ -324,6 +324,7 @@ const getList = async () => {
if (data) { if (data) {
menuList.value = data; menuList.value = data;
} }
loading.value = false; loading.value = false;
}; };
/** 查询菜单下拉树结构 */ /** 查询菜单下拉树结构 */