fix: BUG修改

This commit is contained in:
kun 2023-09-15 14:34:02 +08:00
parent 1a11fa06cc
commit 7cc79f85a7
11 changed files with 119 additions and 56 deletions

View File

@ -6,7 +6,7 @@
<img src="@/assets/images/tableIcon/look.png" alt="" /> <img src="@/assets/images/tableIcon/look.png" alt="" />
<span>查看危大工程信息</span> <span>查看危大工程信息</span>
<el-icon> <el-icon>
<close @click="closeMain" /> <close @click="visible1 = false" />
</el-icon> </el-icon>
</div> </div>
</template> </template>
@ -496,7 +496,7 @@ const props = defineProps({
activeValue: String, activeValue: String,
relativeId: String relativeId: String
}); });
const emits = defineEmits(["update:detailsVisible"]); const emits = defineEmits(["update:detailsVisible", "confirm"]);
const arrOne = ref<any>([]); const arrOne = ref<any>([]);
const arrFive = ref<any>([]); const arrFive = ref<any>([]);
const arrSeven = ref<any>([]); const arrSeven = ref<any>([]);
@ -585,6 +585,29 @@ const confirmAdd = async (row: any, index: any) => {
} }
break; break;
default: default:
if (tabPosition.value == 5) {
if (!requestData.currentProgress || !requestData.imageUrl) {
ElMessage.error("请完善表格信息");
break;
}
} else if (tabPosition.value == 6) {
if (
!requestData.inspectResult ||
!requestData.inspectUser ||
!requestData.inspectTime ||
typeof requestData.question != "number" ||
!requestData.solveUser ||
!requestData.questionDesc
) {
ElMessage.error("请完善表格信息");
break;
}
} else if (tabPosition.value == 7) {
if (!requestData.type || !requestData.result || !requestData.state || !requestData.imageUrl || !requestData.acceptTime) {
ElMessage.error("请完善表格信息");
break;
}
}
row.isEdit = false; row.isEdit = false;
if (row.id) { if (row.id) {
const res2 = await updateOperation[tabPosition.value - 4](requestData); const res2 = await updateOperation[tabPosition.value - 4](requestData);
@ -866,15 +889,13 @@ const getTypeDicMainList = async () => {
typeList.value.push(...arr); typeList.value.push(...arr);
} }
}; };
// //
const closeMain = () => { const closeMain = () => {
visible1.value = false; visible1.value = false;
emits("update:detailsVisible", false);
}; };
watch( watch(
() => props.detailsVisible, () => props.detailsVisible,
n => { n => {
if (n) {
if (n) { if (n) {
getAcceptTypeList(); getAcceptTypeList();
getTypeDicMainList(); getTypeDicMainList();
@ -883,15 +904,18 @@ watch(
setTimeout(function () { setTimeout(function () {
formRef.value?.clearValidate(); formRef.value?.clearValidate();
}, 200); }, 200);
}
visible1.value = n; visible1.value = n;
tabPosition.value = 0;
} }
} }
); );
watch( watch(
() => visible1, () => visible1.value,
n => { n => {
emits("update:detailsVisible", n); emits("update:detailsVisible", n);
if (!n) {
emits("confirm");
}
} }
); );
onMounted(() => {}); onMounted(() => {});

View File

@ -76,6 +76,7 @@
:relativeId="relativeId" :relativeId="relativeId"
:searchSn="searchSn" :searchSn="searchSn"
:activeValue="activeValue" :activeValue="activeValue"
@confirm="confirmAdd"
></engineerDetails> ></engineerDetails>
<!-- 侧边栏选择 --> <!-- 侧边栏选择 -->

View File

@ -1379,9 +1379,11 @@ onMounted(() => {
border-radius: 8px; border-radius: 8px;
padding: 20px; padding: 20px;
position: relative; position: relative;
overflow-y: scroll;
.list-content { .list-content {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); // grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(auto-fit, minmax(530px, 1fr));
grid-gap: 20px; grid-gap: 20px;
&-item { &-item {
width: 530px; width: 530px;
@ -1395,7 +1397,6 @@ onMounted(() => {
margin: 0 22px; margin: 0 22px;
> div:nth-child(1) { > div:nth-child(1) {
width: 126px; width: 126px;
min-width: 78px;
height: 26px; height: 26px;
line-height: 26px; line-height: 26px;
text-align: center; text-align: center;

View File

@ -14,9 +14,7 @@
:onReset="true" :onReset="true"
> >
<template #formButton="scope"> <template #formButton="scope">
<el-button v-auth="'monthly_report_add'" class="addButtonStyle" :disabled="!searchSn" @click="handleAddItem" <el-button v-auth="'monthly_report_add'" class="addButtonStyle" @click="handleAddItem">新增</el-button>
>新增</el-button
>
</template> </template>
<template #annexFile="{ row }"> <template #annexFile="{ row }">
<span>{{ row.annexFile ? JSON.parse(row.annexFile).name : "" }}</span> <span>{{ row.annexFile ? JSON.parse(row.annexFile).name : "" }}</span>
@ -244,6 +242,7 @@ const getTableList = (params: any) => {
}; };
// //
const handleAddItem = () => { const handleAddItem = () => {
if (!searchSn.value) return ElMessage.error("请先选择工程");
addVisible.value = true; addVisible.value = true;
}; };
// //

View File

@ -483,7 +483,6 @@ const closeMain = () => {
watch( watch(
() => props.detailsVisible, () => props.detailsVisible,
n => { n => {
if (n) {
if (n) { if (n) {
getAcceptTypeList(); getAcceptTypeList();
getTypeDicMainList(); getTypeDicMainList();
@ -492,13 +491,13 @@ watch(
setTimeout(function () { setTimeout(function () {
formRef.value?.clearValidate(); formRef.value?.clearValidate();
}, 200); }, 200);
}
visible1.value = n; visible1.value = n;
tabPosition.value = 0;
} }
} }
); );
watch( watch(
() => visible1, () => visible1.value,
n => { n => {
emits("update:detailsVisible", n); emits("update:detailsVisible", n);
} }

View File

@ -1201,9 +1201,11 @@ onMounted(() => {
border-radius: 8px; border-radius: 8px;
padding: 20px; padding: 20px;
position: relative; position: relative;
overflow-y: scroll;
.list-content { .list-content {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); // grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(auto-fit, minmax(530px, 1fr));
grid-gap: 20px; grid-gap: 20px;
&-item { &-item {
width: 530px; width: 530px;

View File

@ -6,7 +6,7 @@
<img src="@/assets/images/tableIcon/look.png" alt="" /> <img src="@/assets/images/tableIcon/look.png" alt="" />
<span>查看危大工程信息</span> <span>查看危大工程信息</span>
<el-icon> <el-icon>
<close @click="closeMain" /> <close @click="visible1 = false" />
</el-icon> </el-icon>
</div> </div>
</template> </template>
@ -100,7 +100,7 @@
<el-form-item label="安全技术交底:" prop="devName"> <el-form-item label="安全技术交底:" prop="devName">
<div class="switch-box"> <div class="switch-box">
<el-switch v-model="formData.technicalDisclosureType" :active-value="2" :inactive-value="1" disabled /> <el-switch v-model="formData.technicalDisclosureType" :active-value="2" :inactive-value="1" disabled />
<span>未完成</span> <span>{{ formData.technicalDisclosureType == 2 ? "已完成" : "未完成" }}</span>
<el-button type="primary" @click="onDownLoad('technicalDisclosureFile')">点击下载</el-button> <el-button type="primary" @click="onDownLoad('technicalDisclosureFile')">点击下载</el-button>
</div> </div>
</el-form-item> </el-form-item>
@ -109,7 +109,7 @@
<el-form-item label="安全专项施工方案及附件:" prop="devNumber"> <el-form-item label="安全专项施工方案及附件:" prop="devNumber">
<div class="switch-box"> <div class="switch-box">
<el-switch v-model="formData.securityConstructionSchemeType" :active-value="2" :inactive-value="1" disabled /> <el-switch v-model="formData.securityConstructionSchemeType" :active-value="2" :inactive-value="1" disabled />
<span>未完成</span> <span>{{ formData.securityConstructionSchemeType == 2 ? "已完成" : "未完成" }}</span>
<el-button type="primary" @click="onDownLoad('securityConstructionSchemeFile')">点击下载</el-button> <el-button type="primary" @click="onDownLoad('securityConstructionSchemeFile')">点击下载</el-button>
</div> </div>
</el-form-item> </el-form-item>
@ -120,7 +120,7 @@
<el-form-item label="专项施工方案交底:" prop="devName"> <el-form-item label="专项施工方案交底:" prop="devName">
<div class="switch-box"> <div class="switch-box">
<el-switch v-model="formData.specialConstructionSchemeType" :active-value="2" :inactive-value="1" disabled /> <el-switch v-model="formData.specialConstructionSchemeType" :active-value="2" :inactive-value="1" disabled />
<span>未完成</span> <span>{{ formData.specialConstructionSchemeType == 2 ? "已完成" : "未完成" }}</span>
<el-button type="primary" @click="onDownLoad('specialConstructionSchemeFile')">点击下载</el-button> <el-button type="primary" @click="onDownLoad('specialConstructionSchemeFile')">点击下载</el-button>
</div> </div>
</el-form-item> </el-form-item>
@ -496,7 +496,7 @@ const props = defineProps({
activeValue: String, activeValue: String,
relativeId: String relativeId: String
}); });
const emits = defineEmits(["update:detailsVisible"]); const emits = defineEmits(["update:detailsVisible", "confirm"]);
const arrOne = ref<any>([]); const arrOne = ref<any>([]);
const arrFive = ref<any>([]); const arrFive = ref<any>([]);
const arrSeven = ref<any>([]); const arrSeven = ref<any>([]);
@ -585,6 +585,30 @@ const confirmAdd = async (row: any, index: any) => {
} }
break; break;
default: default:
if (tabPosition.value == 5) {
if (!requestData.currentProgress || !requestData.imageUrl) {
ElMessage.error("请完善表格信息");
break;
}
} else if (tabPosition.value == 6) {
if (
!requestData.inspectResult ||
!requestData.inspectUser ||
!requestData.inspectTime ||
typeof requestData.question != "number" ||
!requestData.solveUser ||
!requestData.questionDesc
) {
ElMessage.error("请完善表格信息");
break;
}
} else if (tabPosition.value == 7) {
if (!requestData.type || !requestData.result || !requestData.state || !requestData.imageUrl || !requestData.acceptTime) {
ElMessage.error("请完善表格信息");
break;
}
}
row.isEdit = false; row.isEdit = false;
if (row.id) { if (row.id) {
const res2 = await updateOperation[tabPosition.value - 4](requestData); const res2 = await updateOperation[tabPosition.value - 4](requestData);
@ -866,15 +890,13 @@ const getTypeDicMainList = async () => {
typeList.value.push(...arr); typeList.value.push(...arr);
} }
}; };
// //
const closeMain = () => { const closeMain = () => {
visible1.value = false; visible1.value = false;
emits("update:detailsVisible", false);
}; };
watch( watch(
() => props.detailsVisible, () => props.detailsVisible,
n => { n => {
if (n) {
if (n) { if (n) {
getAcceptTypeList(); getAcceptTypeList();
getTypeDicMainList(); getTypeDicMainList();
@ -883,15 +905,18 @@ watch(
setTimeout(function () { setTimeout(function () {
formRef.value?.clearValidate(); formRef.value?.clearValidate();
}, 200); }, 200);
}
visible1.value = n; visible1.value = n;
tabPosition.value = 0;
} }
} }
); );
watch( watch(
() => visible1, () => visible1.value,
n => { n => {
emits("update:detailsVisible", n); emits("update:detailsVisible", n);
if (!n) {
emits("confirm");
}
} }
); );
onMounted(() => {}); onMounted(() => {});

View File

@ -76,6 +76,7 @@
:relativeId="relativeId" :relativeId="relativeId"
:searchSn="searchSn" :searchSn="searchSn"
:activeValue="activeValue" :activeValue="activeValue"
@confirm="confirmAdd"
></engineerDetails> ></engineerDetails>
<!-- 侧边栏选择 --> <!-- 侧边栏选择 -->
@ -232,7 +233,7 @@ const getTypeDicMainList = async () => {
typeList.value.push(...result); typeList.value.push(...result);
} }
}; };
// //
const confirmAdd = () => { const confirmAdd = () => {
proTable.value.getTableList(); proTable.value.getTableList();
}; };

View File

@ -1044,9 +1044,11 @@ onMounted(() => {
border-radius: 8px; border-radius: 8px;
padding: 20px; padding: 20px;
position: relative; position: relative;
overflow-y: scroll;
.list-content { .list-content {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); // grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(auto-fit, minmax(530px, 1fr));
grid-gap: 20px; grid-gap: 20px;
&-item { &-item {
width: 530px; width: 530px;

View File

@ -389,11 +389,15 @@ const formData = ref<any>({
const visible1 = ref(false); const visible1 = ref(false);
// //
const getDetails = async () => { const getDetails = async () => {
if (props.activeValue == "eng") {
const res = await engineerMainDetails({ id: props.relativeId }); const res = await engineerMainDetails({ id: props.relativeId });
console.log(res); console.log(res);
if (res && res.result) { if (res && res.result) {
engineerData.value = { ...res.result }; engineerData.value = { ...res.result };
} }
} else {
engineerData.value = {};
}
}; };
// //
const submitPrint = async () => { const submitPrint = async () => {

View File

@ -14,9 +14,7 @@
:onReset="true" :onReset="true"
> >
<template #formButton="scope"> <template #formButton="scope">
<el-button v-auth="'monthly_report_add'" class="addButtonStyle" :disabled="!searchSn" @click="handleAddItem" <el-button v-auth="'monthly_report_add'" class="addButtonStyle" @click="handleAddItem">新增</el-button>
>新增</el-button
>
</template> </template>
<template #annexFile="{ row }"> <template #annexFile="{ row }">
<span>{{ row.annexFile ? JSON.parse(row.annexFile).name : "" }}</span> <span>{{ row.annexFile ? JSON.parse(row.annexFile).name : "" }}</span>
@ -246,6 +244,7 @@ const getTableList = (params: any) => {
}; };
// //
const handleAddItem = () => { const handleAddItem = () => {
if (!searchSn.value) return ElMessage.error("请先选择工程/项目");
addVisible.value = true; addVisible.value = true;
}; };
// //
@ -288,6 +287,9 @@ const getProject = async () => {
if (res.result) { if (res.result) {
searchSn.value = res.result.projectSn; searchSn.value = res.result.projectSn;
searchId.value = res.result.id; searchId.value = res.result.id;
} else {
searchSn.value = "";
searchId.value = "";
} }
proTable.value.getTableList(); proTable.value.getTableList();
console.log(res); console.log(res);
@ -299,6 +301,9 @@ const getengineering = async () => {
if (res.result && res.result.length > 0) { if (res.result && res.result.length > 0) {
searchSn.value = res.result[0].engineeringSn; searchSn.value = res.result[0].engineeringSn;
searchId.value = res.result[0].id; searchId.value = res.result[0].id;
} else {
searchSn.value = "";
searchId.value = "";
} }
proTable.value.getTableList(); proTable.value.getTableList();
console.log(res); console.log(res);