前台页面整体保存功能完善和后台读取社区列表和读取幢列表的功能开发

This commit is contained in:
范露尧
2023-06-29 20:11:20 +08:00
parent 352c658960
commit 0032956dbe
32 changed files with 1184 additions and 159 deletions

View File

@@ -42,8 +42,8 @@
<el-input v-model="form.hangye"></el-input>
</el-form-item>*@
<el-form-item label="3.外墙结构:" prop="outsidewallstructurefiles">
@*:on-change="fileChange"*@
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" multiple :auto-upload="true" :on-preview="handlePreview" :on-remove="(file, fileList)=>{return handleRemove(file, fileList)}" :file-list="fileList" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList)}">
@*:on-change="fileChange" multiple *@
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" :auto-upload="true" :on-preview="handlePreview" :on-remove="(file, fileList)=>{return handleRemove(file, fileList)}" :file-list="fileList" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList)}">
<i class="el-icon-upload"></i>
<div class="el-upload__text"><em>上传外墙照片</em></div>
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件且不超过500kb</div>
@@ -165,22 +165,22 @@
</el-form-item>
<el-form-item>
8.7 问题照片:@* :on-change="fileChange1"*@
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" multiple :auto-upload="true" :on-preview="(file)=>{return handlePreview(file,props,1)}" :on-remove="(file, fileList)=>{return handleRemove(file, fileList,props)}" :file-list="childFileList[props.$index].filelist1" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList, props,1,'东')}">
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" :auto-upload="true" :on-preview="(file)=>{return handlePreview(file,props,1)}" :on-remove="(file, fileList)=>{return handleRemove(file, fileList,props)}" :file-list="childFileList[props.$index].filelist1" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList, props,1,'东')}">
<i class="el-icon-upload"></i>
<div class="el-upload__text"><em>上传东面照片</em></div>
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" multiple :auto-upload="true" :on-preview="(file)=>{return handlePreview(file,props,2)}" :on-remove="(file, fileList)=>{return handleRemove(file, fileList,props)}" :file-list="childFileList[props.$index].filelist2" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList, props,2,'西')}">
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" :auto-upload="true" :on-preview="(file)=>{return handlePreview(file,props,2)}" :on-remove="(file, fileList)=>{return handleRemove(file, fileList,props)}" :file-list="childFileList[props.$index].filelist2" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList, props,2,'西')}">
<i class="el-icon-upload"></i>
<div class="el-upload__text"><em>上传西面照片</em></div>
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" multiple :auto-upload="true" :on-preview="(file)=>{return handlePreview(file,props,3)}" :on-remove="(file, fileList)=>{return handleRemove(file, fileList,props)}" :file-list="childFileList[props.$index].filelist3" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList, props,3,'南')}">
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" :auto-upload="true" :on-preview="(file)=>{return handlePreview(file,props,3)}" :on-remove="(file, fileList)=>{return handleRemove(file, fileList,props)}" :file-list="childFileList[props.$index].filelist3" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList, props,3,'南')}">
<i class="el-icon-upload"></i>
<div class="el-upload__text"><em>上传南面照片</em></div>
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" multiple :auto-upload="true" :on-preview="(file)=>{return handlePreview(file,props,4)}" :on-remove="(file, fileList)=>{return handleRemove(file, fileList,props)}" :file-list="childFileList[props.$index].filelist4" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList, props,4,'北')}">
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" :auto-upload="true" :on-preview="(file)=>{return handlePreview(file,props,4)}" :on-remove="(file, fileList)=>{return handleRemove(file, fileList,props)}" :file-list="childFileList[props.$index].filelist4" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList, props,4,'北')}">
<i class="el-icon-upload"></i>
<div class="el-upload__text"><em>上传北面照片</em></div>
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件且不超过500kb</div>
@@ -689,42 +689,59 @@
this.$refs[formName].validate((valid) => {
if (valid) {
if (_this.form.isExistProblem == '0') {
_this.submit2();
this.$confirm('确定提交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
_this.submit2();
}).catch(() => {
});
} else {
if (this.$refs[formNameChild])
if (this.$refs[formNameChild]) {
this.$refs[formNameChild].validate((valid) => {
if (valid) {
debugger
_this.submit2();
this.$confirm('确定提交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
_this.submit2();
}).catch(() => {
});
} else {
this.$message({
message: '幢信息问卷未填写完整',
type: 'warning'
});
}
});
} else {
this.$message({
message: '存在问题请展开幢信息进行问卷填写',
type: 'warning'
});
}
}
} else {
this.$message({
message: '社区信息问卷未填写完整',
type: 'warning'
});
}
});
},
submit2() {
debugger;
const loading = this.$loading({
lock: true,
text: '提交中...请稍候',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
let _this = this;
//let config = {
// //formData 提交请求头有两种 multipart/form-data 和 application/x-www-form-urlencoded
// // multipart/form-data 用于type=file 的input提交
// headers: {
// "Content-Type": "multipart/form-data"
// }
//};
//const fd = new FormData()
//fd.append('appid', "123")
//fd.append('wall', _this.form)
//for (let _i in _this.fileList) {
// fd.append('file', _i)
//}
//axios.post('/gb/yjb/api/outsidewall/submit', fd, config).then(res => {
// debugger
//}).catch(error => {
// console.log(error);
//});
axios({
headers: { 'Content-Type': 'multipart/form-data' },
method: 'post',
@@ -732,10 +749,9 @@
data: _this.form,
responseType: "json",
}).then(async response => {
if (response.data?.data?.success == true) {
let token = response.data.data.token;
localStorage.setItem("_token", token)
_this.$alert(`<div>提交成功</div>`, '成功', {
debugger;
if (response.data?.success == true) {
_this.$alert(`<div>提交成功,您的提交码是:` + response.data?.data + `<br/>请牢记提交码。</div>`, '提交成功', {
confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
}).then(a => { }).catch(err => { console.log(err) });
} else {
@@ -743,14 +759,14 @@
confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
}).then(a => { }).catch(err => { console.log(err) });
}
_this.loading = false;
loading.close();
}).catch(async error => {
console.log(error)
_this.$message({
type: 'error',
message: error.message
})
_this.loading = false;
loading.close();
})
},
getFormData(object) {