fix: BUG修改

This commit is contained in:
kun 2023-08-04 10:43:20 +08:00
parent ac6a848247
commit c4f014fdcf
10 changed files with 125 additions and 76 deletions

View File

@ -77,6 +77,7 @@ const changeTab = (e: MouseEvent, i: number) => {
// width.value = (e.target as HTMLDivElement).offsetWidth; // width.value = (e.target as HTMLDivElement).offsetWidth;
// //
ActiveColor.value = 0; ActiveColor.value = 0;
value.value = "";
emit("update:modelValue", i); emit("update:modelValue", i);
}; };

View File

@ -171,22 +171,22 @@ const formConfig = {
{ {
label: "总工程造价(元)", label: "总工程造价(元)",
prop: "totalAmount", prop: "totalAmount",
type: "input" type: "number"
}, },
{ {
label: "本期完成工程造价(元)", label: "本期完成工程造价(元)",
prop: "completeAmount", prop: "completeAmount",
type: "input" type: "number"
}, },
{ {
label: "至上期末完成工程造价(元)", label: "至上期末完成工程造价(元)",
prop: "lastEndAmount", prop: "lastEndAmount",
type: "input" type: "number"
}, },
{ {
label: "至本期末完成工程造价(元)", label: "至本期末完成工程造价(元)",
prop: "nowEndAmount", prop: "nowEndAmount",
type: "input" type: "number"
} }
// { // {
// label: "(%)", // label: "(%)",
@ -271,12 +271,12 @@ const formConfig2 = {
{ {
label: "合同单价(元)", label: "合同单价(元)",
prop: "contractUnitPrice", prop: "contractUnitPrice",
type: "input" type: "number"
}, },
{ {
label: "合同金额(元)", label: "合同金额(元)",
prop: "contractAmount", prop: "contractAmount",
type: "input" type: "number"
}, },
{ {
label: "至上期末完成工程量", label: "至上期末完成工程量",
@ -286,7 +286,7 @@ const formConfig2 = {
{ {
label: "至上期末完成金额(元)", label: "至上期末完成金额(元)",
prop: "lastAmount", prop: "lastAmount",
type: "input" type: "number"
}, },
{ {
label: "本期完成工程量", label: "本期完成工程量",
@ -296,7 +296,7 @@ const formConfig2 = {
{ {
label: "本期完成金额(元)", label: "本期完成金额(元)",
prop: "nowAmount", prop: "nowAmount",
type: "input" type: "number"
}, },
{ {
label: "截至本期末完成工程量", label: "截至本期末完成工程量",
@ -306,7 +306,7 @@ const formConfig2 = {
{ {
label: "截至本期末完成金额(元)", label: "截至本期末完成金额(元)",
prop: "endAmount", prop: "endAmount",
type: "input" type: "number"
}, },
{ {
label: "备注", label: "备注",

View File

@ -96,7 +96,7 @@
<el-table-column label="隐患照片"> <el-table-column label="隐患照片">
<template #default="scope"> <template #default="scope">
<el-image <el-image
v-if="scope.row.image" v-if="scope.row.image && scope.row.image.length > 0"
style="width: 38px; height: 28px" style="width: 38px; height: 28px"
:src="scope.row.image[0].url" :src="scope.row.image[0].url"
fit="fill" fit="fill"
@ -120,11 +120,11 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="operation-btn" v-if="basicData?.state != 4"> <!-- <div class="operation-btn" v-if="basicData?.state != 4">
<!-- <el-button type="info" style="margin-right: 98px">驳回,请尽快整改</el-button> <el-button type="info" style="margin-right: 98px">驳回,请尽快整改</el-button>
<el-button type="primary">整改完成,全部合格</el-button> --> <el-button type="primary">整改完成,全部合格</el-button>
<el-button type="primary" @click="allSubmit">全部整改完成,提交审核</el-button> <el-button type="primary" @click="allSubmit">全部整改完成,提交审核</el-button>
</div> </div> -->
</div> </div>
<div class="transform-record" v-if="transformDialog"> <div class="transform-record" v-if="transformDialog">
<div class="title-detail"> <div class="title-detail">

View File

@ -96,7 +96,7 @@
<el-table-column label="隐患照片"> <el-table-column label="隐患照片">
<template #default="scope"> <template #default="scope">
<el-image <el-image
v-if="scope.row.image" v-if="scope.row.image && scope.row.image.length > 0"
style="width: 38px; height: 28px" style="width: 38px; height: 28px"
:src="scope.row.image[0].url" :src="scope.row.image[0].url"
fit="fill" fit="fill"
@ -120,11 +120,11 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="operation-btn" v-if="basicData?.state != 4"> <!-- <div class="operation-btn" v-if="basicData?.state != 4">
<!-- <el-button type="info" style="margin-right: 98px">驳回,请尽快整改</el-button> <el-button type="info" style="margin-right: 98px">驳回,请尽快整改</el-button>
<el-button type="primary">整改完成,全部合格</el-button> --> <el-button type="primary">整改完成,全部合格</el-button>
<el-button type="primary" @click="allSubmit">全部整改完成,提交审核</el-button> <el-button type="primary" @click="allSubmit">全部整改完成,提交审核</el-button>
</div> </div> -->
</div> </div>
<div class="transform-record" v-if="transformDialog"> <div class="transform-record" v-if="transformDialog">
<div class="title-detail"> <div class="title-detail">

View File

@ -152,22 +152,22 @@ const formConfig = {
{ {
label: "总工程造价(元)", label: "总工程造价(元)",
prop: "totalAmount", prop: "totalAmount",
type: "input" type: "number"
}, },
{ {
label: "本期完成工程造价(元)", label: "本期完成工程造价(元)",
prop: "completeAmount", prop: "completeAmount",
type: "input" type: "number"
}, },
{ {
label: "至上期末完成工程造价(元)", label: "至上期末完成工程造价(元)",
prop: "lastEndAmount", prop: "lastEndAmount",
type: "input" type: "number"
}, },
{ {
label: "至本期末完成工程造价(元)", label: "至本期末完成工程造价(元)",
prop: "nowEndAmount", prop: "nowEndAmount",
type: "input" type: "number"
} }
// { // {
// label: "(%)", // label: "(%)",
@ -252,12 +252,12 @@ const formConfig2 = {
{ {
label: "合同单价(元)", label: "合同单价(元)",
prop: "contractUnitPrice", prop: "contractUnitPrice",
type: "input" type: "number"
}, },
{ {
label: "合同金额(元)", label: "合同金额(元)",
prop: "contractAmount", prop: "contractAmount",
type: "input" type: "number"
}, },
{ {
label: "至上期末完成工程量", label: "至上期末完成工程量",
@ -267,7 +267,7 @@ const formConfig2 = {
{ {
label: "至上期末完成金额(元)", label: "至上期末完成金额(元)",
prop: "lastAmount", prop: "lastAmount",
type: "input" type: "number"
}, },
{ {
label: "本期完成工程量", label: "本期完成工程量",
@ -277,7 +277,7 @@ const formConfig2 = {
{ {
label: "本期完成金额(元)", label: "本期完成金额(元)",
prop: "nowAmount", prop: "nowAmount",
type: "input" type: "number"
}, },
{ {
label: "截至本期末完成工程量", label: "截至本期末完成工程量",
@ -287,7 +287,7 @@ const formConfig2 = {
{ {
label: "截至本期末完成金额(元)", label: "截至本期末完成金额(元)",
prop: "endAmount", prop: "endAmount",
type: "input" type: "number"
}, },
{ {
label: "备注", label: "备注",

View File

@ -200,7 +200,7 @@
<el-table-column label="隐患照片"> <el-table-column label="隐患照片">
<template #default="scope"> <template #default="scope">
<el-image <el-image
v-if="scope.row.image.length > 0" v-if="scope.row.image && scope.row.image.length > 0"
style="width: 38px; height: 28px" style="width: 38px; height: 28px"
:src="scope.row.image[0].url" :src="scope.row.image[0].url"
fit="fill" fit="fill"
@ -276,6 +276,7 @@
class="face-uploader" class="face-uploader"
:action="`${baseUrl}` + '/xmgl/file/upload'" :action="`${baseUrl}` + '/xmgl/file/upload'"
:show-file-list="false" :show-file-list="false"
:before-upload="handleAvatarUpload"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
accept="image/jpg, image/jpeg, image/png" accept="image/jpg, image/jpeg, image/png"
> >
@ -297,13 +298,13 @@
<div class="content-select"> <div class="content-select">
<div class="member-menu"> <div class="member-menu">
<el-table <el-table
ref="multipleTable" ref="multipleMemberTable"
:data="membertableData" :data="membertableData"
row-key="userId" row-key="userId"
tooltip-effect="dark" tooltip-effect="dark"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="realName" label="检查人员"></el-table-column> <el-table-column prop="realName" label="检查人员"></el-table-column>
<el-table-column prop="account" label="用户名称"></el-table-column> <el-table-column prop="account" label="用户名称"></el-table-column>
<el-table-column prop="userTel" label="手机号码"></el-table-column> <el-table-column prop="userTel" label="手机号码"></el-table-column>
@ -445,7 +446,8 @@ import {
import { GlobalStore } from "@/stores"; import { GlobalStore } from "@/stores";
import { Delete } from "@element-plus/icons-vue"; import { Delete } from "@element-plus/icons-vue";
import { jxj_User } from "@/api/types"; import { jxj_User } from "@/api/types";
const multipleTable = ref(null); const multipleMemberTable = ref();
const multipleTable = ref();
const memberVisible = ref(false); const memberVisible = ref(false);
const store = GlobalStore(); const store = GlobalStore();
const headers = ref({ Authorization: "Bearer " + store.token }); const headers = ref({ Authorization: "Bearer " + store.token });
@ -623,16 +625,18 @@ const getProjectData = async () => {
projectTableData.value = res.result; projectTableData.value = res.result;
console.log(res); console.log(res);
}; };
const selectMember = async () => { const getMemberList = async () => {
const res = await getgovNamelist({}); const res = await getgovNamelist({});
console.log(res); console.log(res);
membertableData.value = res.result; membertableData.value = res.result;
};
const selectMember = async () => {
console.log(membertableData.value); console.log(membertableData.value);
console.log(selectedMemberList.value); console.log(selectedMemberList.value);
selectedMemberList.value.forEach(key => { selectedMemberList.value.forEach(key => {
membertableData.value.forEach(row => { membertableData.value.forEach(row => {
if (row.userId == key.userId) { if (row.userId == key.userId) {
multipleTable.value.toggleRowSelection(row); multipleMemberTable.value.toggleRowSelection(row, true);
} }
}); });
}); });
@ -656,16 +660,20 @@ const uploadSuccess = (response: any, index: number) => {
basicData.value.otherSignature.push({ url: response.result.url }); basicData.value.otherSignature.push({ url: response.result.url });
} }
}; };
// const handleSelectionChange = val => {
// console.log(val);
// let obj = {};
// selectedMemberList.value = val;
// //
// selectedMemberList.value = val.reduce((item, next) => {
// obj[next.userId] ? "" : (obj[next.userId] = true && item.push(next));
// return item;
// }, []);
// console.log(selectedMemberList.value);
// };
const handleSelectionChange = val => { const handleSelectionChange = val => {
console.log(val);
let obj = {};
selectedMemberList.value = val; selectedMemberList.value = val;
// console.log(val);
selectedMemberList.value = val.reduce((item, next) => {
obj[next.userId] ? "" : (obj[next.userId] = true && item.push(next));
return item;
}, []);
console.log(selectedMemberList.value);
}; };
// const handleSelectionAllChange = val => { // const handleSelectionAllChange = val => {
// selectedMemberList.value = val; // selectedMemberList.value = val;
@ -688,6 +696,13 @@ const selectProjectTree = data => {
const deleteDangerImg = (index: number) => { const deleteDangerImg = (index: number) => {
dangerForm.value.image.splice(index, 1); dangerForm.value.image.splice(index, 1);
}; };
//
const handleAvatarUpload = file => {
if (dangerForm.value.image.length == 3) {
ElMessage.error("上传图片不能大于三张");
return false;
}
};
// //
const handleAvatarSuccess: UploadProps["onSuccess"] = response => { const handleAvatarSuccess: UploadProps["onSuccess"] = response => {
dangerForm.value.image.push({ dangerForm.value.image.push({
@ -700,10 +715,10 @@ const submitForm = async () => {
ElMessage.error("请添加隐患问题"); ElMessage.error("请添加隐患问题");
return; return;
} }
if (dangerForm.value.image.length == 0) { // if (dangerForm.value.image.length == 0) {
ElMessage.error("请添加隐患照片"); // ElMessage.error("");
return; // return;
} // }
recordData.value.push({ recordData.value.push({
...dangerForm.value ...dangerForm.value
}); });
@ -769,7 +784,9 @@ watch(
watch(visible1, (n, o) => { watch(visible1, (n, o) => {
emits("update:orderDialog", n); emits("update:orderDialog", n);
}); });
onMounted(() => {}); onMounted(() => {
getMemberList();
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -957,7 +974,9 @@ onMounted(() => {});
.imgList { .imgList {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
position: relative; > div {
position: relative;
}
:deep(.el-icon) { :deep(.el-icon) {
position: absolute; position: absolute;
top: -10px; top: -10px;

View File

@ -200,7 +200,7 @@
<el-table-column label="隐患照片"> <el-table-column label="隐患照片">
<template #default="scope"> <template #default="scope">
<el-image <el-image
v-if="scope.row.image.length > 0" v-if="scope.row.image && scope.row.image.length > 0"
style="width: 38px; height: 28px" style="width: 38px; height: 28px"
:src="scope.row.image[0].url" :src="scope.row.image[0].url"
fit="fill" fit="fill"
@ -276,6 +276,7 @@
class="face-uploader" class="face-uploader"
:action="`${baseUrl}` + '/xmgl/file/upload'" :action="`${baseUrl}` + '/xmgl/file/upload'"
:show-file-list="false" :show-file-list="false"
:before-upload="handleAvatarUpload"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
accept="image/jpg, image/jpeg, image/png" accept="image/jpg, image/jpeg, image/png"
> >
@ -403,7 +404,12 @@
</template> </template>
<div class="content-select"> <div class="content-select">
<div class="member-menu"> <div class="member-menu">
<el-table ref="multipleTable" :data="membertableData" tooltip-effect="dark" @selection-change="handleSelectionChange"> <el-table
ref="multipleMemberTable"
:data="membertableData"
tooltip-effect="dark"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="realName" label="检查人员"></el-table-column> <el-table-column prop="realName" label="检查人员"></el-table-column>
<el-table-column prop="account" label="用户名称"></el-table-column> <el-table-column prop="account" label="用户名称"></el-table-column>
@ -438,6 +444,7 @@ import {
import { GlobalStore } from "@/stores"; import { GlobalStore } from "@/stores";
import { Delete } from "@element-plus/icons-vue"; import { Delete } from "@element-plus/icons-vue";
import { jxj_User } from "@/api/types"; import { jxj_User } from "@/api/types";
const multipleMemberTable = ref();
const memberVisible = ref(false); const memberVisible = ref(false);
const store = GlobalStore(); const store = GlobalStore();
const headers = ref({ Authorization: "Bearer " + store.token }); const headers = ref({ Authorization: "Bearer " + store.token });
@ -615,10 +622,21 @@ const getProjectData = async () => {
projectTableData.value = res.result; projectTableData.value = res.result;
console.log(res); console.log(res);
}; };
const selectMember = async () => { const getMemberList = async () => {
const res = await getgovNamelist({}); const res = await getgovNamelist({});
console.log(res); console.log(res);
membertableData.value = res.result; membertableData.value = res.result;
};
const selectMember = async () => {
console.log(membertableData.value);
console.log(selectedMemberList.value);
selectedMemberList.value.forEach(key => {
membertableData.value.forEach(row => {
if (row.userId == key.userId) {
multipleMemberTable.value.toggleRowSelection(row, true);
}
});
});
memberVisible.value = true; memberVisible.value = true;
}; };
// //
@ -661,6 +679,13 @@ const selectProjectTree = data => {
const deleteDangerImg = (index: number) => { const deleteDangerImg = (index: number) => {
dangerForm.value.image.splice(index, 1); dangerForm.value.image.splice(index, 1);
}; };
//
const handleAvatarUpload = file => {
if (dangerForm.value.image.length == 3) {
ElMessage.error("上传图片不能大于三张");
return false;
}
};
// //
const handleAvatarSuccess: UploadProps["onSuccess"] = response => { const handleAvatarSuccess: UploadProps["onSuccess"] = response => {
dangerForm.value.image.push({ dangerForm.value.image.push({
@ -673,10 +698,10 @@ const submitForm = async () => {
ElMessage.error("请添加隐患问题"); ElMessage.error("请添加隐患问题");
return; return;
} }
if (dangerForm.value.image.length == 0) { // if (dangerForm.value.image.length == 0) {
ElMessage.error("请添加隐患照片"); // ElMessage.error("");
return; // return;
} // }
recordData.value.push({ recordData.value.push({
...dangerForm.value ...dangerForm.value
}); });
@ -741,7 +766,9 @@ watch(
watch(visible1, (n, o) => { watch(visible1, (n, o) => {
emits("update:orderDialog", n); emits("update:orderDialog", n);
}); });
onMounted(() => {}); onMounted(() => {
getMemberList();
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -931,7 +958,9 @@ onMounted(() => {});
.imgList { .imgList {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
position: relative; >div{
position: relative;
}
:deep(.el-icon) { :deep(.el-icon) {
position: absolute; position: absolute;
top: -10px; top: -10px;

View File

@ -171,22 +171,22 @@ const formConfig = {
{ {
label: "总工程造价(元)", label: "总工程造价(元)",
prop: "totalAmount", prop: "totalAmount",
type: "input" type: "number"
}, },
{ {
label: "本期完成工程造价(元)", label: "本期完成工程造价(元)",
prop: "completeAmount", prop: "completeAmount",
type: "input" type: "number"
}, },
{ {
label: "至上期末完成工程造价(元)", label: "至上期末完成工程造价(元)",
prop: "lastEndAmount", prop: "lastEndAmount",
type: "input" type: "number"
}, },
{ {
label: "至本期末完成工程造价(元)", label: "至本期末完成工程造价(元)",
prop: "nowEndAmount", prop: "nowEndAmount",
type: "input" type: "number"
} }
// { // {
// label: "(%)", // label: "(%)",
@ -271,12 +271,12 @@ const formConfig2 = {
{ {
label: "合同单价(元)", label: "合同单价(元)",
prop: "contractUnitPrice", prop: "contractUnitPrice",
type: "input" type: "number"
}, },
{ {
label: "合同金额(元)", label: "合同金额(元)",
prop: "contractAmount", prop: "contractAmount",
type: "input" type: "number"
}, },
{ {
label: "至上期末完成工程量", label: "至上期末完成工程量",
@ -286,7 +286,7 @@ const formConfig2 = {
{ {
label: "至上期末完成金额(元)", label: "至上期末完成金额(元)",
prop: "lastAmount", prop: "lastAmount",
type: "input" type: "number"
}, },
{ {
label: "本期完成工程量", label: "本期完成工程量",
@ -296,7 +296,7 @@ const formConfig2 = {
{ {
label: "本期完成金额(元)", label: "本期完成金额(元)",
prop: "nowAmount", prop: "nowAmount",
type: "input" type: "number"
}, },
{ {
label: "截至本期末完成工程量", label: "截至本期末完成工程量",
@ -306,7 +306,7 @@ const formConfig2 = {
{ {
label: "截至本期末完成金额(元)", label: "截至本期末完成金额(元)",
prop: "endAmount", prop: "endAmount",
type: "input" type: "number"
}, },
{ {
label: "备注", label: "备注",

View File

@ -96,7 +96,7 @@
<el-table-column label="隐患照片"> <el-table-column label="隐患照片">
<template #default="scope"> <template #default="scope">
<el-image <el-image
v-if="scope.row.image" v-if="scope.row.image && scope.row.image.length > 0"
style="width: 38px; height: 28px" style="width: 38px; height: 28px"
:src="scope.row.image[0].url" :src="scope.row.image[0].url"
fit="fill" fit="fill"
@ -120,11 +120,11 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="operation-btn" v-if="basicData?.state != 4"> <!-- <div class="operation-btn" v-if="basicData?.state != 4">
<!-- <el-button type="info" style="margin-right: 98px">驳回,请尽快整改</el-button> <el-button type="info" style="margin-right: 98px">驳回,请尽快整改</el-button>
<el-button type="primary">整改完成,全部合格</el-button> --> <el-button type="primary">整改完成,全部合格</el-button>
<el-button type="primary" @click="allSubmit">全部整改完成,提交审核</el-button> <el-button type="primary" @click="allSubmit">全部整改完成,提交审核</el-button>
</div> </div> -->
</div> </div>
<div class="transform-record" v-if="transformDialog"> <div class="transform-record" v-if="transformDialog">
<div class="title-detail"> <div class="title-detail">

View File

@ -96,7 +96,7 @@
<el-table-column label="隐患照片"> <el-table-column label="隐患照片">
<template #default="scope"> <template #default="scope">
<el-image <el-image
v-if="scope.row.image" v-if="scope.row.image && scope.row.image.length > 0"
style="width: 38px; height: 28px" style="width: 38px; height: 28px"
:src="scope.row.image[0].url" :src="scope.row.image[0].url"
fit="fill" fit="fill"
@ -120,11 +120,11 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="operation-btn" v-if="basicData?.state != 4"> <!-- <div class="operation-btn" v-if="basicData?.state != 4">
<!-- <el-button type="info" style="margin-right: 98px">驳回,请尽快整改</el-button> <el-button type="info" style="margin-right: 98px">驳回,请尽快整改</el-button>
<el-button type="primary">整改完成,全部合格</el-button> --> <el-button type="primary">整改完成,全部合格</el-button>
<el-button type="primary" @click="allSubmit">全部整改完成,提交审核</el-button> <el-button type="primary" @click="allSubmit">全部整改完成,提交审核</el-button>
</div> </div> -->
</div> </div>
<div class="transform-record" v-if="transformDialog"> <div class="transform-record" v-if="transformDialog">
<div class="title-detail"> <div class="title-detail">