优化逻辑bug
This commit is contained in:
@ -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'
|
||||||
|
|
||||||
# 无人机接口地址
|
# 无人机接口地址
|
||||||
|
|
||||||
|
19
src/App.vue
19
src/App.vue
@ -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>
|
|
||||||
|
@ -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 = [];
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对外暴露子组件方法
|
* 对外暴露子组件方法
|
||||||
*/
|
*/
|
||||||
|
@ -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="附件">
|
||||||
|
@ -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>
|
||||||
|
@ -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 = '修改物资-需求';
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
|
@ -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']"
|
||||||
|
@ -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
|
||||||
>
|
>
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
|
@ -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';
|
||||||
|
|
||||||
|
@ -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"
|
||||||
|
@ -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
|
||||||
|
.toLocaleString('zh-CN', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: '2-digit',
|
month: '2-digit',
|
||||||
day: '2-digit',
|
day: '2-digit',
|
||||||
hour: '2-digit',
|
hour: '2-digit',
|
||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
second: '2-digit'
|
second: '2-digit'
|
||||||
}).replace(',', ' ');
|
})
|
||||||
|
.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', {
|
||||||
'确认提交',
|
|
||||||
'Warning',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning'
|
||||||
}
|
})
|
||||||
).then(() => {
|
.then(() => {
|
||||||
materialsEdit(formData).then(res => {
|
materialsEdit(formData).then((res) => {
|
||||||
let { code } = res
|
let { code } = res;
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '提交成功',
|
message: '提交成功'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
.catch(() => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: '已取消提交',
|
message: '已取消提交'
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
const handleDelete = (row) => {
|
const handleDelete = (row) => {
|
||||||
currentRow.value = row;
|
currentRow.value = row;
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm('确定要删除这条记录吗?此操作不可撤销,请谨慎操作', '提示', {
|
||||||
'确定要删除这条记录吗?此操作不可撤销,请谨慎操作',
|
|
||||||
'提示',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning'
|
||||||
}
|
})
|
||||||
).then(() => {
|
.then(() => {
|
||||||
confirmDelete();
|
confirmDelete();
|
||||||
}).catch(() => {
|
})
|
||||||
|
.catch(() => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: '已取消删除',
|
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('删除成功');
|
||||||
@ -376,8 +404,6 @@ const confirmDelete = async () => {
|
|||||||
};
|
};
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 保存
|
// 保存
|
||||||
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>
|
|
||||||
|
@ -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>
|
||||||
|
@ -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);
|
||||||
@ -332,22 +381,20 @@ const handleAddSon = (row) => {
|
|||||||
// 删除
|
// 删除
|
||||||
const handleDelete = (row) => {
|
const handleDelete = (row) => {
|
||||||
currentRow.value = row;
|
currentRow.value = row;
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm('确定要删除这条记录吗?此操作不可撤销,请谨慎操作', '提示', {
|
||||||
'确定要删除这条记录吗?此操作不可撤销,请谨慎操作',
|
|
||||||
'提示',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning'
|
||||||
}
|
})
|
||||||
).then(() => {
|
.then(() => {
|
||||||
confirmDelete();
|
confirmDelete();
|
||||||
}).catch(() => {
|
})
|
||||||
|
.catch(() => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: '已取消删除',
|
message: '已取消删除'
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 确认删除
|
// 确认删除
|
||||||
|
@ -1,20 +1,34 @@
|
|||||||
<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"
|
<el-button
|
||||||
class="transition-all duration-200 hover:shadow-md">
|
v-hasPermi="['cailiaoshebei:physicalsupplySon:add']"
|
||||||
|
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
|
||||||
|
v-hasPermi="['cailiaoshebei:physicalsupplySon: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="loading2" :data="tableData" stripe
|
<el-table
|
||||||
|
v-loading="loading2"
|
||||||
|
:data="tableData"
|
||||||
|
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="batch" label="批次" align="center"></el-table-column>
|
<el-table-column prop="batch" label="批次" align="center"></el-table-column>
|
||||||
@ -52,14 +66,12 @@
|
|||||||
<el-table-column prop="actualAcceptance" label="实际验收数量" min-width="120" align="right"></el-table-column>
|
<el-table-column prop="actualAcceptance" label="实际验收数量" min-width="120" align="right"></el-table-column>
|
||||||
<el-table-column prop="differenceQuantity" label="差异量" min-width="100" align="right">
|
<el-table-column prop="differenceQuantity" label="差异量" min-width="100" align="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span
|
<span :class="scope.row.differenceQuantity && parseFloat(scope.row.differenceQuantity) !== 0 ? 'text-red-500' : ''">
|
||||||
:class="scope.row.differenceQuantity && parseFloat(scope.row.differenceQuantity) !== 0 ? 'text-red-500' : ''">
|
|
||||||
{{ scope.row.differenceQuantity || '-' }}
|
{{ scope.row.differenceQuantity || '-' }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="dhDifferenceQuantity" label="到货差异量" min-width="120"
|
<el-table-column prop="dhDifferenceQuantity" label="到货差异量" min-width="120" align="right"></el-table-column>
|
||||||
align="right"></el-table-column>
|
|
||||||
|
|
||||||
<!-- 金额相关列 -->
|
<!-- 金额相关列 -->
|
||||||
<el-table-column prop="cargoAmount" label="货物金额" min-width="120" align="right">
|
<el-table-column prop="cargoAmount" label="货物金额" min-width="120" align="right">
|
||||||
@ -124,14 +136,10 @@
|
|||||||
<el-button size="small" type="text">查看详情</el-button>
|
<el-button size="small" type="text">查看详情</el-button>
|
||||||
</template>
|
</template>
|
||||||
<div class="space-y-2 text-sm">
|
<div class="space-y-2 text-sm">
|
||||||
<p><span class="font-medium">采购备注:</span>{{ scope.row.cgRemark || '-' }}
|
<p><span class="font-medium">采购备注:</span>{{ scope.row.cgRemark || '-' }}</p>
|
||||||
</p>
|
<p><span class="font-medium">到货备注:</span>{{ scope.row.dhRemark || '-' }}</p>
|
||||||
<p><span class="font-medium">到货备注:</span>{{ scope.row.dhRemark || '-' }}
|
<p><span class="font-medium">供应商备注:</span>{{ scope.row.gysRemark || '-' }}</p>
|
||||||
</p>
|
<p><span class="font-medium">结算备注:</span>{{ scope.row.jsRemark || '-' }}</p>
|
||||||
<p><span class="font-medium">供应商备注:</span>{{ scope.row.gysRemark || '-'
|
|
||||||
}}</p>
|
|
||||||
<p><span class="font-medium">结算备注:</span>{{ scope.row.jsRemark || '-' }}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
@ -140,23 +148,38 @@
|
|||||||
<!-- 操作列 -->
|
<!-- 操作列 -->
|
||||||
<el-table-column label="操作" min-width="120" align="center" fixed="right">
|
<el-table-column label="操作" min-width="120" align="center" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" icon="Edit" @click="handleEdit2(scope.row)"
|
<el-button
|
||||||
class="text-blue-600 hover:text-blue-800 transition-colors"></el-button>
|
size="small"
|
||||||
<el-button size="small" icon="Delete" @click="handleDelete2(scope.row)"
|
v-hasPermi="['cailiaoshebei:physicalsupplySon:edit']"
|
||||||
class="text-red-600 hover:text-red-800 transition-colors"></el-button>
|
icon="Edit"
|
||||||
|
@click="handleEdit2(scope.row)"
|
||||||
|
class="text-blue-600 hover:text-blue-800 transition-colors"
|
||||||
|
></el-button>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
v-hasPermi="['cailiaoshebei:physicalsupplySon:remove']"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete2(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>
|
||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<div class="flex flex-wrap items-center justify-between p-4 border-t gap-4">
|
<div class="flex flex-wrap items-center justify-between p-4 border-t gap-4">
|
||||||
<div class="text-gray-500 text-sm">
|
<div class="text-gray-500 text-sm">
|
||||||
共 {{ total }} 条记录,当前显示第 {{ (currentPage - 1) * pageSize + 1 }} 至 {{
|
共 {{ total }} 条记录,当前显示第 {{ (currentPage - 1) * pageSize + 1 }} 至 {{ Math.min(currentPage * pageSize, total) }} 条
|
||||||
Math.min(currentPage * pageSize, total)
|
|
||||||
}} 条
|
|
||||||
</div>
|
</div>
|
||||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
|
<el-pagination
|
||||||
:page-sizes="[10, 20, 50, 100]" :total="total" layout="prev, pager, next, jumper, sizes"
|
v-model:current-page="currentPage"
|
||||||
@size-change="handleSizeChange" @current-change="handleCurrentChange" small></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"
|
||||||
|
small
|
||||||
|
></el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 删除确认对话框 -->
|
<!-- 删除确认对话框 -->
|
||||||
@ -171,14 +194,19 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="flex justify-center gap-2">
|
<div class="flex justify-center gap-2">
|
||||||
<el-button @click="deleteDialogVisible2 = false">取消</el-button>
|
<el-button @click="deleteDialogVisible2 = false">取消</el-button>
|
||||||
<el-button type="danger" @click="confirmDelete2" :loading="deleteLoading">
|
<el-button type="danger" @click="confirmDelete2" :loading="deleteLoading"> 确认删除 </el-button>
|
||||||
确认删除
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog v-model="dialogVisible2" :title="dialogType2 === 'addSon' ? '新增采购信息' : '编辑采购信息'" :width="dialogWidth"
|
<el-dialog
|
||||||
:fullscreen="isFullscreen" :close-on-click-modal="false" :before-close="handleClose" destroy-on-close>
|
v-model="dialogVisible2"
|
||||||
|
:title="dialogType2 === 'addSon' ? '新增采购信息' : '编辑采购信息'"
|
||||||
|
:width="dialogWidth"
|
||||||
|
:fullscreen="isFullscreen"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:before-close="handleClose"
|
||||||
|
destroy-on-close
|
||||||
|
>
|
||||||
<!-- 表单内容 -->
|
<!-- 表单内容 -->
|
||||||
<el-form ref="formRef" :model="form" :rules="formRules" label-width="140px" class="space-y-4">
|
<el-form ref="formRef" :model="form" :rules="formRules" label-width="140px" class="space-y-4">
|
||||||
<!-- 第一行 -->
|
<!-- 第一行 -->
|
||||||
@ -190,8 +218,12 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="联系单下达时间" prop="issuanceTime">
|
<el-form-item label="联系单下达时间" prop="issuanceTime">
|
||||||
<el-date-picker v-model="form.issuanceTime" type="datetime" placeholder="选择联系单下达时间"
|
<el-date-picker
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
|
v-model="form.issuanceTime"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择联系单下达时间"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -205,8 +237,12 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="要求到货时间" prop="requireDelivery">
|
<el-form-item label="要求到货时间" prop="requireDelivery">
|
||||||
<el-date-picker v-model="form.requireDelivery" type="datetime" placeholder="选择要求到货时间"
|
<el-date-picker
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
|
v-model="form.requireDelivery"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择要求到货时间"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -220,8 +256,12 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="计划到货时间" prop="scheduledDelivery">
|
<el-form-item label="计划到货时间" prop="scheduledDelivery">
|
||||||
<el-date-picker v-model="form.scheduledDelivery" type="datetime" placeholder="选择计划到货时间"
|
<el-date-picker
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
|
v-model="form.scheduledDelivery"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择计划到货时间"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -235,8 +275,12 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="实际到货时间" prop="actualDelivery">
|
<el-form-item label="实际到货时间" prop="actualDelivery">
|
||||||
<el-date-picker v-model="form.actualDelivery" type="datetime" placeholder="选择实际到货时间"
|
<el-date-picker
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
|
v-model="form.actualDelivery"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择实际到货时间"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -259,8 +303,12 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="验收移交时间" prop="acceptanceCheck">
|
<el-form-item label="验收移交时间" prop="acceptanceCheck">
|
||||||
<el-date-picker v-model="form.acceptanceCheck" type="datetime" placeholder="选择验收移交时间"
|
<el-date-picker
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
|
v-model="form.acceptanceCheck"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择验收移交时间"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -338,8 +386,7 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="到货要求" prop="deliveryRequirements">
|
<el-form-item label="到货要求" prop="deliveryRequirements">
|
||||||
<el-input v-model="form.deliveryRequirements" placeholder="请输入到货要求" type="textarea"
|
<el-input v-model="form.deliveryRequirements" 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>
|
||||||
@ -358,8 +405,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="供应商备注" prop="gysRemark">
|
<el-form-item label="供应商备注" prop="gysRemark">
|
||||||
<el-input v-model="form.gysRemark" placeholder="请输入供应商备注" type="textarea"
|
<el-input v-model="form.gysRemark" placeholder="请输入供应商备注" type="textarea" rows="4"></el-input>
|
||||||
rows="4"></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -376,23 +422,18 @@
|
|||||||
<!-- 底部按钮 -->
|
<!-- 底部按钮 -->
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="flex justify-end gap-3">
|
<div class="flex justify-end gap-3">
|
||||||
<el-button @click="handleCancel" class="transition-all duration-200">
|
<el-button @click="handleCancel" class="transition-all duration-200"> 取消 </el-button>
|
||||||
取消
|
<el-button type="primary" @click="handleSubmit" :loading="submitLoading" class="transition-all duration-200">
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" @click="handleSubmit" :loading="submitLoading"
|
|
||||||
class="transition-all duration-200">
|
|
||||||
{{ dialogType2 === 'addSon' ? '新增' : '保存' }}
|
{{ dialogType2 === 'addSon' ? '新增' : '保存' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, toRaw, getCurrentInstance } from 'vue';
|
import { ref, reactive, onMounted, toRaw, getCurrentInstance } from 'vue';
|
||||||
import { materialsUsageDetails, materialsSonAdd, materialsSonDel, materialsSonEdit } from "@/api/materials/usageMaterials/index";
|
import { materialsUsageDetails, materialsSonAdd, materialsSonDel, materialsSonEdit } from '@/api/materials/usageMaterials/index';
|
||||||
import { routerRename } from '@/api/air';
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const dialogVisible2 = ref(false);
|
const dialogVisible2 = ref(false);
|
||||||
const dialogType2 = ref('addSon'); // add 或 edit
|
const dialogType2 = ref('addSon'); // add 或 edit
|
||||||
@ -401,7 +442,7 @@ const currentRow2 = ref(null);
|
|||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
const loading2 = ref(false);
|
const loading2 = ref(false);
|
||||||
const submitLoading = ref(false);
|
const submitLoading = ref(false);
|
||||||
const routeParams = ref({})
|
const routeParams = ref({});
|
||||||
const currentPage = ref(1);
|
const currentPage = ref(1);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const pageSize = ref(10);
|
const pageSize = ref(10);
|
||||||
@ -447,14 +488,14 @@ const handleAdd = () => {
|
|||||||
dialogVisible2.value = true;
|
dialogVisible2.value = true;
|
||||||
dialogType2.value = 'addSon';
|
dialogType2.value = 'addSon';
|
||||||
resetForm();
|
resetForm();
|
||||||
}
|
};
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
if (formRef.value) {
|
if (formRef.value) {
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重置表单数据
|
// 重置表单数据
|
||||||
Object.keys(form).forEach(key => {
|
Object.keys(form).forEach((key) => {
|
||||||
form[key] = '';
|
form[key] = '';
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -469,7 +510,7 @@ const handleEdit2 = (row) => {
|
|||||||
resetForm();
|
resetForm();
|
||||||
|
|
||||||
// 填充表单数据
|
// 填充表单数据
|
||||||
Object.keys(form).forEach(key => {
|
Object.keys(form).forEach((key) => {
|
||||||
if (row.hasOwnProperty(key)) {
|
if (row.hasOwnProperty(key)) {
|
||||||
form[key] = row[key];
|
form[key] = row[key];
|
||||||
}
|
}
|
||||||
@ -479,22 +520,20 @@ const handleEdit2 = (row) => {
|
|||||||
};
|
};
|
||||||
const handleDelete2 = (row) => {
|
const handleDelete2 = (row) => {
|
||||||
currentRow2.value = row;
|
currentRow2.value = row;
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm('确定要删除这条记录吗?此操作不可撤销,请谨慎操作', '提示', {
|
||||||
'确定要删除这条记录吗?此操作不可撤销,请谨慎操作',
|
|
||||||
'提示',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning'
|
||||||
}
|
})
|
||||||
).then(() => {
|
.then(() => {
|
||||||
confirmDelete2();
|
confirmDelete2();
|
||||||
}).catch(() => {
|
})
|
||||||
|
.catch(() => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: '已取消删除',
|
message: '已取消删除'
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
const confirmDelete2 = async () => {
|
const confirmDelete2 = async () => {
|
||||||
if (!currentRow2.value) return;
|
if (!currentRow2.value) return;
|
||||||
@ -502,7 +541,7 @@ const confirmDelete2 = async () => {
|
|||||||
deleteLoading.value = true;
|
deleteLoading.value = true;
|
||||||
try {
|
try {
|
||||||
// 模拟API请求
|
// 模拟API请求
|
||||||
const res = await materialsSonDel(currentRow2.value.id)
|
const res = await materialsSonDel(currentRow2.value.id);
|
||||||
const { code } = res;
|
const { code } = res;
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
ElMessage.success('删除成功');
|
ElMessage.success('删除成功');
|
||||||
@ -532,15 +571,15 @@ const handleSubmit = async () => {
|
|||||||
|
|
||||||
// 如果是新增,清除id
|
// 如果是新增,清除id
|
||||||
if (dialogType2.value === 'addSon') {
|
if (dialogType2.value === 'addSon') {
|
||||||
submitData.physicalsupplyId = routeParams.value.id
|
submitData.physicalsupplyId = routeParams.value.id;
|
||||||
const res = await materialsSonAdd(submitData)
|
const res = await materialsSonAdd(submitData);
|
||||||
const { code } = res;
|
const { code } = res;
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
ElMessage.success('新增成功');
|
ElMessage.success('新增成功');
|
||||||
materialsUsageDetails1();
|
materialsUsageDetails1();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const res = await materialsSonEdit(submitData)
|
const res = await materialsSonEdit(submitData);
|
||||||
const { code } = res;
|
const { code } = res;
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
ElMessage.success('保存成功');
|
ElMessage.success('保存成功');
|
||||||
@ -557,22 +596,24 @@ const handleSubmit = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const materialsUsageDetails1 = () => {
|
const materialsUsageDetails1 = () => {
|
||||||
materialsUsageDetails({ physicalsupplyId: routeParams.value.id }).then(res => {
|
materialsUsageDetails({ physicalsupplyId: routeParams.value.id }).then((res) => {
|
||||||
tableData.value = res.rows
|
tableData.value = res.rows;
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
// 格式化日期
|
// 格式化日期
|
||||||
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
|
||||||
|
.toLocaleString('zh-CN', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: '2-digit',
|
month: '2-digit',
|
||||||
day: '2-digit',
|
day: '2-digit',
|
||||||
hour: '2-digit',
|
hour: '2-digit',
|
||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
second: '2-digit'
|
second: '2-digit'
|
||||||
}).replace(',', ' ');
|
})
|
||||||
|
.replace(',', ' ');
|
||||||
};
|
};
|
||||||
function handleCancel() {
|
function handleCancel() {
|
||||||
dialogVisible2.value = false;
|
dialogVisible2.value = false;
|
||||||
@ -587,5 +628,5 @@ onMounted(() => {
|
|||||||
routeParams.value = proxy.$route.query;
|
routeParams.value = proxy.$route.query;
|
||||||
console.log('routeParams.value', routeParams.value);
|
console.log('routeParams.value', routeParams.value);
|
||||||
materialsUsageDetails1();
|
materialsUsageDetails1();
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
@ -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' }]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -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();
|
||||||
|
@ -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[]>([]);
|
||||||
|
@ -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 中获取项目列表和当前选中的项目
|
||||||
|
@ -324,6 +324,7 @@ const getList = async () => {
|
|||||||
if (data) {
|
if (data) {
|
||||||
menuList.value = data;
|
menuList.value = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
/** 查询菜单下拉树结构 */
|
/** 查询菜单下拉树结构 */
|
||||||
|
Reference in New Issue
Block a user