feat: 危大工程功能新增以及BUG修改

This commit is contained in:
kun 2023-09-07 18:36:37 +08:00
parent 2776855fd3
commit f34ec01284
11 changed files with 1305 additions and 537 deletions

View File

@ -713,3 +713,82 @@ export const engineerMainDetails = (params: any) => {
export const dangerousEngineerPage = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineering/page`, params);
};
// 新增危大工程
export const dangerousEngineerAdd = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineering/add`, params);
};
// 删除危大工程
export const dangerousEngineerDelete = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineering/delete`, params);
};
// 根据id查询危大工程信息
export const dangerousEngineerDetails = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineering/queryById`, params);
};
// 专项施工方案列表
export const constructionSchemeList = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringProgramme/list`, params);
};
// 专项施工方案添加
export const constructionSchemeAdd = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringProgramme/add`, params);
};
// 专项施工方案删除
export const constructionSchemeDelete = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringProgramme/delete`, params);
};
// 专项施工方案附件信息
export const constructionSchemeFile = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringProgramme/queryAnnexFile`, params);
};
// 施工进度列表
export const constructionProgressList = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringProgress/list`, params);
};
// 施工进度添加
export const constructionProgressAdd = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringProgress/add`, params);
};
// 施工进度编辑
export const constructionProgressEdit = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringProgress/edit`, params);
};
// 施工进度删除
export const constructionProgressDelete = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringProgress/delete`, params);
};
// 现场巡视列表
export const localInspectList = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringInspect/list`, params);
};
// 现场巡视添加
export const localInspectAdd = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringInspect/add`, params);
};
// 现场巡视编辑
export const localInspectEdit = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringInspect/edit`, params);
};
// 现场巡视删除
export const localInspectDelete = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringInspect/delete`, params);
};
// 危大工程验收列表
export const engineerAcceptList = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringCheckAccept/list`, params);
};
// 危大工程验收添加
export const engineerAcceptAdd = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringCheckAccept/add`, params);
};
// 危大工程验收编辑
export const engineerAcceptEdit = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringCheckAccept/edit`, params);
};
// 危大工程验收删除
export const engineerAcceptDelete = (params: any) => {
return http.post(BASEURL + `/project/dangerousEngineeringCheckAccept/delete`, params);
};

View File

@ -371,10 +371,10 @@ const onUpload = async (row: any, index: any) => {
row.fileList.map(item => {
if (item.response) {
arr.push({
response: { ...item.response, url: item.response.fileUrl },
name: item.response.fileName,
url: item.response.fileUrl,
size: +item.response.fileSize,
response: { ...item.response, url: item.response.url },
name: item.response.originalFilename,
url: item.response.url,
size: +item.response.size,
type: item.response.contentType
});
} else {

View File

@ -140,6 +140,19 @@ const columns: ColumnProps[] = [
{ label: "禁用", value: 2 }
]
},
{
prop: "timeLimit",
label: "提交时间",
isShow: false,
search: {
el: "date-picker",
props: {
type: "daterange",
format: "YYYY-MM-DD",
valueFormat: "YYYY-MM-DD"
}
}
},
{ prop: "operation", label: "操作", fixed: "right", width: 260 }
];
//
@ -213,10 +226,10 @@ const transfrom = (arr: Array<any>) => {
// ProTable :requestApi="getUserList"
const getTableList = (params: any) => {
let newParams = JSON.parse(JSON.stringify(params));
if (newParams.installTime) {
newParams.installTime_begin = newParams.installTime[0];
newParams.installTime_end = newParams.installTime[1];
delete newParams.installTime;
if (newParams.timeLimit) {
newParams.createTime_begin = newParams.timeLimit[0];
newParams.createTime_end = newParams.timeLimit[1];
delete newParams.timeLimit;
}
return hoistEquipPage(newParams);
};

View File

@ -148,7 +148,7 @@ const columns: ColumnProps[] = [
label: "监理单位"
},
{
prop: "createBy",
prop: "createByName",
label: "填写人"
},
{

View File

@ -115,7 +115,7 @@ const columns: ColumnProps[] = [
label: "监理单位"
},
{
prop: "createBy",
prop: "createByName",
label: "填写人"
},
{

View File

@ -78,7 +78,7 @@
<div class="switch-box">
<el-switch v-model="formData.technicalDisclosureType" :active-value="2" :inactive-value="1" />
<span>未完成</span>
<el-button type="primary">点击上传</el-button>
<el-button type="primary" @click="onUpload('technicalDisclosureFile')">点击上传</el-button>
</div>
</el-form-item>
</el-col>
@ -87,7 +87,7 @@
<div class="switch-box">
<el-switch v-model="formData.securityConstructionSchemeType" :active-value="2" :inactive-value="1" />
<span>未完成</span>
<el-button type="primary">点击上传</el-button>
<el-button type="primary" @click="onUpload('securityConstructionSchemeFile')">点击上传</el-button>
</div>
</el-form-item>
</el-col>
@ -98,7 +98,7 @@
<div class="switch-box">
<el-switch v-model="formData.specialConstructionSchemeType" :active-value="2" :inactive-value="1" />
<span>未完成</span>
<el-button type="primary">点击上传</el-button>
<el-button type="primary" @click="onUpload('specialConstructionSchemeFile')">点击上传</el-button>
</div>
</el-form-item>
</el-col>
@ -110,15 +110,18 @@
<el-button type="primary" @click="confirm(formRef)"> 保存 </el-button>
</template>
</el-dialog>
<!-- 附件上传 -->
<FilesUploadPlus v-model="showFilesUpload" @update:files="handlechange" :files="current.files" :reset="true" />
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref, watch } from "vue";
import type { FormInstance, UploadProps } from "element-plus";
import type { FormInstance } from "element-plus";
import { ElMessage } from "element-plus";
import { submitMonthlyReport, engineerMainDetails } from "@/api/modules/project";
import { getDicList } from "@/api/modules/jxjview";
import FilesUploadPlus from "@/components/FilesUploadPlus/FilesUpload.vue";
import { dangerousEngineerAdd } from "@/api/modules/project";
const props = defineProps({
addVisible: Boolean,
searchSn: String,
@ -126,6 +129,11 @@ const props = defineProps({
relativeId: String
});
const emits = defineEmits(["update:addVisible", "confirm"]);
const documentDataKey = ref("");
const current = ref({
files: []
});
const showFilesUpload = ref(false);
const typeList = ref([]);
const rules = ref({
engineeringName: [
@ -153,11 +161,55 @@ const rules = ref({
const formRef = ref<FormInstance>();
const fileList = ref([]);
const formData = ref<any>({
technicalDisclosureFile: "",
securityConstructionSchemeFile: "",
specialConstructionSchemeFile: ""
technicalDisclosureFile: [],
securityConstructionSchemeFile: [],
specialConstructionSchemeFile: []
});
const visible1 = ref(false);
//
const handlechange = e => {
console.log(e);
current.value.files = e.map(item => {
item.label = current.value.dictLabel;
return item;
});
console.log(current.value.files);
formData.value[documentDataKey.value] = current.value.files;
};
//
const onUpload = async (key: any) => {
console.log(key);
showFilesUpload.value = true;
documentDataKey.value = key;
console.log(formData.value[key]);
if (formData.value[key].length > 0) {
let arr: any = [];
formData.value[key].map(item => {
if (item.response) {
arr.push({
response: { ...item.response, url: item.response.url },
name: item.response.originalFilename,
url: item.response.url,
size: +item.response.size,
type: item.response.contentType
});
} else {
arr.push({
response: { ...item, url: item.fileUrl },
name: item.fileName,
url: item.fileUrl,
size: +item.fileSize,
type: item.contentType
});
}
delete item.response;
});
current.value.files = arr;
console.log(current.value.files);
} else {
current.value.files = [];
}
};
const getTypeDicMainList = async () => {
//
const { result } = await getDicList({ dictType: "dangerous_engineer_type" });
@ -176,8 +228,40 @@ const getTypeDicMainList = async () => {
//
const confirm = async (formEl: FormInstance | undefined) => {
if (!formEl) return;
await formEl.validate((valid, fields) => {
await formEl.validate(async (valid, fields) => {
if (valid) {
console.log(formData.value);
let requestData = {
...formData.value,
technicalDisclosureFile: "",
securityConstructionSchemeFile: "",
specialConstructionSchemeFile: ""
};
if (props.activeValue == "eng") {
requestData.engineeringSn = props.searchSn;
} else if (props.activeValue == "project") {
requestData.projectSn = props.searchSn;
}
for (let i in requestData) {
if (i == "technicalDisclosureFile" || i == "securityConstructionSchemeFile" || i == "specialConstructionSchemeFile") {
let arr = [] as any;
formData.value[i].map(item => {
if (item.response) {
arr.push({
fileName: item.response.originalFilename,
fileUrl: item.response.url
});
}
});
requestData[i] = JSON.stringify(arr);
}
}
const res = await dangerousEngineerAdd(requestData);
if (res.success) {
ElMessage.success("操作成功");
visible1.value = false;
emits("confirm");
}
} else {
console.log("error submit!", fields);
ElMessage({
@ -200,7 +284,14 @@ watch(
if (n) {
getTypeDicMainList();
fileList.value = [];
formData.value = {};
formData.value = {
technicalDisclosureFile: [],
securityConstructionSchemeFile: [],
specialConstructionSchemeFile: []
};
setTimeout(function () {
formRef.value?.clearValidate();
}, 200);
}
visible1.value = n;
}

View File

@ -1,3 +1,7 @@
@mixin flex {
display: flex;
align-items: center;
}
.type-select {
display: grid;
grid-template-columns: repeat(6, 1fr);
@ -12,10 +16,9 @@
border-radius: 8px 8px 8px 8px;
padding: 24px 0;
&-content {
display: flex;
@include flex;
flex-direction: column;
justify-content: center;
align-items: center;
> img {
width: 44px;
height: 44px;
@ -45,6 +48,32 @@
.table-main {
height: calc(100% - 82px);
}
.type-content {
@include flex;
flex-direction: column;
justify-content: center;
span {
font-size: 12px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
}
span:nth-child(1) {
color: #333333;
}
span:nth-child(2) {
color: #bbbbbb;
}
span:nth-child(3) {
display: inline-block;
width: 32px;
height: 16px;
line-height: 16px;
text-align: center;
background: #e70000;
border-radius: 2px 2px 2px 2px;
color: #ffffff;
}
}
}
}
}

View File

@ -27,8 +27,21 @@
<template #formButton="scope">
<el-button class="addButtonStyle" @click="handleAddItem">新增</el-button>
</template>
<template #type="{ row }">
<div class="type-content">
<span>{{ textTransform(row.type) }}</span>
<span>{{ row.typeDescribe }}</span>
<span v-if="row.dangerType == 1">超危</span>
</div>
</template>
<template #engineering="{ row }">
<div class="type-content">
<span>{{ row.engineeringName }}</span>
<span>{{ row.engineeringSurvey }}</span>
</div>
</template>
<template #operation="{ row }">
<el-button type="danger" style="margin-right: 5px" link :icon="Delete" @click="deleteItem(row)">删除</el-button>
<el-button type="danger" style="margin-right: 5px" link :icon="Delete" @click.stop="deleteItem(row)">删除</el-button>
</template>
</ProTable>
</div>
@ -39,6 +52,13 @@
:activeValue="activeValue"
@confirm="confirmAdd"
></engineerAdd>
<!-- 危大工程详情 -->
<engineerDetails
v-model:detailsVisible="detailsVisible"
:relativeId="relativeId"
:searchSn="searchSn"
:activeValue="activeValue"
></engineerDetails>
<!-- 侧边栏选择 -->
<engineeringEngDrawer v-model="engVisable" :active="activeValue" ref="engDrawer" :engList="engList" @select="tabsSelect">
@ -63,15 +83,17 @@ import { Delete } from "@element-plus/icons-vue";
import { jxj_User } from "@/api/types";
import { useHandleData } from "@/hooks/useHandleData";
import engineerAdd from "./components/engineerAdd.vue";
import engineerDetails from "./components/engineerDetails.vue";
import { getRelevanceList } from "@/api/modules/common";
import engineeringEngDrawer from "@/components/engineeringEngDrawer/index.vue";
import allEngineering from "@/components/allEngineering/index.vue";
import { monthlyReportPage, updateMonthlyReport, dangerousEngineerPage, getEngineeringName } from "@/api/modules/project";
import { dangerousEngineerPage, dangerousEngineerDelete, getEngineeringName } from "@/api/modules/project";
const activeValue = ref("eng");
const engList = ref([]);
const engVisable = ref(false);
const searchSn = ref("");
const addVisible = ref(false);
const detailsVisible = ref(false);
const relativeId = ref("");
const statisticsOption = ref([
{
@ -112,7 +134,7 @@ const statisticsOption = ref([
}
]);
const operateDialog = ref(false);
const hoistEquipType = ref([]);
const typeList = ref([]);
// ProTable 便
const proTable = ref();
@ -125,7 +147,7 @@ const columns: ColumnProps[] = [
search: { el: "input" }
},
{
prop: "model",
prop: "engineering",
label: "危大工程"
},
{
@ -150,6 +172,21 @@ const columns: ColumnProps[] = [
},
{ prop: "operation", label: "操作", fixed: "right", width: 260 }
];
//
const textTransform = (val: any) => {
let findItem: any = typeList.value.find(item => item.dictLabel == val);
return findItem?.dictValue;
};
const getTypeDicMainList = async () => {
//
const { result } = await getDicList({ dictType: "dangerous_engineer_type" });
if (result.length > 0) {
typeList.value.length = 0;
typeList.value = result;
} else {
typeList.value.length = 0;
}
};
//
const confirmAdd = () => {
proTable.value.getTableList();
@ -158,28 +195,16 @@ const confirmAdd = () => {
const handleAddItem = () => {
addVisible.value = true;
};
//
//
const deleteItem = async (params: jxj_User.ResUserList) => {
// await useHandleData(bigStoreDelete, { id: params.id }, `${params.name}`);
await useHandleData(dangerousEngineerDelete, { id: params.id }, `删除【${params.engineeringName}`);
proTable.value.getTableList();
};
//
const rowClick = (row: any, column: ColumnProps) => {
console.log("row", row, "column", column);
};
const getDicMainList = async () => {
//
const { result } = await getDicList({ dictType: "hoist_equip_type" });
if (result.length > 0) {
let arr: any = [];
result.map(item => {
arr.push({
label: item.dictValue,
value: item.dictLabel
});
});
hoistEquipType.value.length = 0;
hoistEquipType.value.push(...arr);
}
relativeId.value = row.id;
detailsVisible.value = true;
};
//
const tableRowClassName = ({ rowIndex }: { row: User.ResUserList; rowIndex: number }) => {
@ -203,10 +228,14 @@ const dataCallback = (data: any) => {
// ProTable :requestApi="getUserList"
const getTableList = (params: any) => {
let newParams = JSON.parse(JSON.stringify(params));
if (newParams.timeLimit) {
newParams.createTime_begin = newParams.timeLimit[0];
newParams.createTime_end = newParams.timeLimit[1];
delete newParams.timeLimit;
if (searchSn.value) {
if (activeValue.value == "eng") {
newParams.engineeringSn = searchSn.value;
} else if (activeValue.value == "project") {
newParams.projectSn = searchSn.value;
}
} else {
return { result: { current: "1", pages: "1", records: [], size: "10", total: "0" } };
}
return dangerousEngineerPage(newParams);
};
@ -252,7 +281,7 @@ const onUpdate = async row => {
};
onMounted(() => {});
onMounted(async () => {
await getDicMainList();
await getTypeDicMainList();
await getengineering();
});
</script>

View File

@ -371,10 +371,10 @@ const onUpload = async (row: any, index: any) => {
row.fileList.map(item => {
if (item.response) {
arr.push({
response: { ...item.response, url: item.response.fileUrl },
name: item.response.fileName,
url: item.response.fileUrl,
size: +item.response.fileSize,
response: { ...item.response, url: item.response.url },
name: item.response.originalFilename,
url: item.response.url,
size: +item.response.size,
type: item.response.contentType
});
} else {
@ -400,6 +400,7 @@ const handlechange = e => {
item.label = current.value.dictLabel;
return item;
});
console.log(current.value.files);
documentData.value[documentDataIndex.value].fileList = current.value.files;
};
// ;

View File

@ -150,7 +150,7 @@ const columns: ColumnProps[] = [
label: "设计单位"
},
{
prop: "createBy",
prop: "createByName",
label: "填写人"
},
{