update 建档登记页面完善
This commit is contained in:
@@ -18,10 +18,10 @@
|
||||
<!-- ... -->
|
||||
<a-row :gutter="16" type="flex">
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="外立面照片" prop="facadePhoto">
|
||||
<a-form-model-item class="ant-row-flex" label="外立面照片" prop="houseInfo.facadePhoto">
|
||||
<a-upload
|
||||
:custom-request="onFileUpload"
|
||||
:file-list="form.facadePhoto"
|
||||
:file-list="form.houseInfo.facadePhoto"
|
||||
:preview-file="onPreviewFile"
|
||||
@change="onFileChange"
|
||||
@preview="onFilePreview"
|
||||
@@ -47,7 +47,9 @@ import PhotoSwipe from '@/components/photoSwipe';
|
||||
/* 表单内容默认值 */
|
||||
const defaultForm = {
|
||||
/* ... */
|
||||
facadePhoto: [],
|
||||
houseInfo: {
|
||||
facadePhoto: [],
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -63,11 +65,13 @@ export default {
|
||||
wrapperCol: { flex: '1' },
|
||||
|
||||
/** 表单数据 */
|
||||
form: {},
|
||||
form: {
|
||||
...defaultForm,
|
||||
},
|
||||
/** 验证格式 */
|
||||
rules: {
|
||||
/* ... */
|
||||
facadePhoto: [{ required: true, message: '请上传外立面照片' }],
|
||||
'houseInfo.facadePhoto': [{ required: true, message: '请上传外立面照片' }],
|
||||
},
|
||||
|
||||
/** 加载异步数据状态 */
|
||||
@@ -81,7 +85,6 @@ export default {
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.onInit();
|
||||
this.onFillData();
|
||||
},
|
||||
|
||||
@@ -91,33 +94,33 @@ export default {
|
||||
* 在打开编辑页时允许填充数据
|
||||
*/
|
||||
async onFillData() {
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record,
|
||||
facadePhoto = [];
|
||||
this.loading = true;
|
||||
{
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record,
|
||||
facadePhoto = [];
|
||||
|
||||
// 从数据中的文件id转换成uploader所需的格式
|
||||
if (record) {
|
||||
const fileList = record.facadePhoto.split(',');
|
||||
for (let i = 0; i < fileList.length; i++) {
|
||||
const file = await PreviewFile(fileList[i]);
|
||||
const base64 = await BlobToBase64(file);
|
||||
facadePhoto.push({
|
||||
uid: fileList[i],
|
||||
response: fileList[i], // 用于和新上传的文件一同回传
|
||||
name: file.name,
|
||||
url: base64,
|
||||
status: 'done',
|
||||
});
|
||||
// 从数据中的文件id转换成uploader所需的格式
|
||||
if (record) {
|
||||
const fileList = !!record.facadePhoto ? record.facadePhoto.split(',') : [];
|
||||
for (let i = 0; i < fileList.length; i++) {
|
||||
const file = await PreviewFile(fileList[i]);
|
||||
const base64 = await BlobToBase64(file);
|
||||
facadePhoto.push({
|
||||
uid: fileList[i],
|
||||
response: fileList[i], // 用于和新上传的文件一同回传
|
||||
name: file.name,
|
||||
url: base64,
|
||||
status: 'done',
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.form = this.$_.cloneDeep({
|
||||
...defaultForm,
|
||||
...record,
|
||||
/** 在此处添加其他默认数据转换 */
|
||||
/* ... */
|
||||
facadePhoto,
|
||||
});
|
||||
this.form = this.$_.cloneDeep({
|
||||
...defaultForm,
|
||||
});
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -126,7 +129,7 @@ export default {
|
||||
*/
|
||||
onGetData() {
|
||||
return new Promise((reslove, reject) => {
|
||||
this.$refs.form.validate((valid) => {
|
||||
this.$refs.form.validate((valid, err) => {
|
||||
if (valid) {
|
||||
const record = this.$_.cloneDeep(this.form);
|
||||
|
||||
@@ -136,20 +139,12 @@ export default {
|
||||
|
||||
reslove(record);
|
||||
} else {
|
||||
reject();
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口进行保存时调用表单验证
|
||||
*/
|
||||
onValidate(callback) {
|
||||
this.$refs.form.validate(callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口关闭或重置时对表单验证进行初始化
|
||||
@@ -163,23 +158,12 @@ export default {
|
||||
}, 300);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 加载当前表单中所需要的异步数据
|
||||
*/
|
||||
async onInit() {
|
||||
this.loading = true;
|
||||
/** 可以在这里await获取一些异步数据 */
|
||||
/* ... */
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/** 当前组件的其他方法 */
|
||||
/* ... */
|
||||
|
||||
/* 上传图片相关 Begin */
|
||||
onFileChange({ fileList }) {
|
||||
this.form.facadePhoto = fileList;
|
||||
this.form.houseInfo.facadePhoto = fileList;
|
||||
},
|
||||
onPreviewFile(file) {
|
||||
return new Promise((resolve) => {
|
||||
@@ -200,8 +184,8 @@ export default {
|
||||
},
|
||||
onFilePreview(file) {
|
||||
const items = [];
|
||||
for (let i = 0; i < this.form.facadePhoto.length; i++) {
|
||||
const _file = this.form.facadePhoto[i];
|
||||
for (let i = 0; i < this.form.houseInfo.facadePhoto.length; i++) {
|
||||
const _file = this.form.houseInfo.facadePhoto[i];
|
||||
const img = new Image();
|
||||
const src = _file.url || _file.thumbUrl;
|
||||
img.src = src;
|
||||
@@ -212,7 +196,7 @@ export default {
|
||||
});
|
||||
}
|
||||
this.$refs['photo-swipe'].initPhotoSwipe(items, {
|
||||
index: this.form.facadePhoto.indexOf(file),
|
||||
index: this.form.houseInfo.facadePhoto.indexOf(file),
|
||||
});
|
||||
},
|
||||
/* 上传图片相关 End */
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
<!-- ... -->
|
||||
<a-row :gutter="16" type="flex">
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="立项文件" prop="anEntryDocument">
|
||||
<a-form-model-item class="ant-row-flex" label="立项文件" prop="houseInfo.anEntryDocument">
|
||||
<a-upload
|
||||
:custom-request="onFileUpload"
|
||||
:file-list="form.anEntryDocument"
|
||||
:file-list="form.houseInfo.anEntryDocument"
|
||||
:showUploadList=" { showRemoveIcon: true, showDownloadIcon: true }"
|
||||
@change="(data) => onFileChange(data, 'anEntryDocument')"
|
||||
@download="onFileDownload"
|
||||
@@ -32,10 +32,10 @@
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="规划许可" prop="planningPermission">
|
||||
<a-form-model-item class="ant-row-flex" label="规划许可" prop="houseInfo.planningPermission">
|
||||
<a-upload
|
||||
:custom-request="onFileUpload"
|
||||
:file-list="form.planningPermission"
|
||||
:file-list="form.houseInfo.planningPermission"
|
||||
:showUploadList=" { showRemoveIcon: true, showDownloadIcon: true }"
|
||||
@change="(data) => onFileChange(data, 'planningPermission')"
|
||||
@download="onFileDownload"
|
||||
@@ -46,10 +46,10 @@
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="竣工验收备案" prop="completedRecord">
|
||||
<a-form-model-item class="ant-row-flex" label="竣工验收备案" prop="houseInfo.completedRecord">
|
||||
<a-upload
|
||||
:custom-request="onFileUpload"
|
||||
:file-list="form.completedRecord"
|
||||
:file-list="form.houseInfo.completedRecord"
|
||||
:showUploadList=" { showRemoveIcon: true, showDownloadIcon: true }"
|
||||
@change="(data) => onFileChange(data, 'completedRecord')"
|
||||
@download="onFileDownload"
|
||||
@@ -60,10 +60,10 @@
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="监理文件" prop="monitorDocument">
|
||||
<a-form-model-item class="ant-row-flex" label="监理文件" prop="houseInfo.monitorDocument">
|
||||
<a-upload
|
||||
:custom-request="onFileUpload"
|
||||
:file-list="form.monitorDocument"
|
||||
:file-list="form.houseInfo.monitorDocument"
|
||||
:showUploadList=" { showRemoveIcon: true, showDownloadIcon: true }"
|
||||
@change="(data) => onFileChange(data, 'monitorDocument')"
|
||||
@download="onFileDownload"
|
||||
@@ -74,10 +74,14 @@
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="鉴定报告" prop="identificationReport">
|
||||
<a-form-model-item
|
||||
class="ant-row-flex"
|
||||
label="鉴定报告"
|
||||
prop="houseInfo.identificationReport"
|
||||
>
|
||||
<a-upload
|
||||
:custom-request="onFileUpload"
|
||||
:file-list="form.identificationReport"
|
||||
:file-list="form.houseInfo.identificationReport"
|
||||
:showUploadList=" { showRemoveIcon: true, showDownloadIcon: true }"
|
||||
@change="(data) => onFileChange(data, 'identificationReport')"
|
||||
@download="onFileDownload"
|
||||
@@ -88,10 +92,10 @@
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="其他附件" prop="otherDocument">
|
||||
<a-form-model-item class="ant-row-flex" label="其他附件" prop="houseInfo.otherDocument">
|
||||
<a-upload
|
||||
:custom-request="onFileUpload"
|
||||
:file-list="form.otherDocument"
|
||||
:file-list="form.houseInfo.otherDocument"
|
||||
:showUploadList=" { showRemoveIcon: true, showDownloadIcon: true }"
|
||||
@change="(data) => onFileChange(data, 'otherDocument')"
|
||||
@download="onFileDownload"
|
||||
@@ -110,12 +114,20 @@ import { GetFileName } from '@/util/file';
|
||||
/* 表单内容默认值 */
|
||||
const defaultForm = {
|
||||
/* ... */
|
||||
anEntryDocument: [],
|
||||
planningPermission: [],
|
||||
completionRecord: [],
|
||||
monitor: [],
|
||||
identificationReport: [],
|
||||
otherDocument: [],
|
||||
// anEntryDocument: [],
|
||||
// planningPermission: [],
|
||||
// completionRecord: [],
|
||||
// monitor: [],
|
||||
// identificationReport: [],
|
||||
// otherDocument: [],
|
||||
houseInfo: {
|
||||
anEntryDocument: [],
|
||||
planningPermission: [],
|
||||
completionRecord: [],
|
||||
monitor: [],
|
||||
identificationReport: [],
|
||||
otherDocument: [],
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -127,7 +139,9 @@ export default {
|
||||
wrapperCol: { flex: '1' },
|
||||
|
||||
/** 表单数据 */
|
||||
form: {},
|
||||
form: {
|
||||
...defaultForm,
|
||||
},
|
||||
/** 验证格式 */
|
||||
rules: {
|
||||
/* ... */
|
||||
@@ -142,7 +156,6 @@ export default {
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.onInit();
|
||||
this.onFillData();
|
||||
},
|
||||
|
||||
@@ -151,25 +164,28 @@ export default {
|
||||
* 必要的方法
|
||||
* 在打开编辑页时允许填充数据
|
||||
*/
|
||||
onFillData() {
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
async onFillData() {
|
||||
this.loading = true;
|
||||
{
|
||||
// await this.onLoadCodes();
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
const form = this.$_.cloneDeep(defaultForm);
|
||||
|
||||
this.form = this.$_.cloneDeep({
|
||||
...defaultForm,
|
||||
...record,
|
||||
/** 在此处添加其他默认数据转换 */
|
||||
/* ... */
|
||||
});
|
||||
if (record) {
|
||||
this.$_.giveDeep(form, record);
|
||||
}
|
||||
this.form = form;
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 验证表单并获取表单数据
|
||||
*/
|
||||
onGetData() {
|
||||
return new Promise((reslove, reject) => {
|
||||
this.$refs.form.validate((valid) => {
|
||||
this.$refs.form.validate((valid, err) => {
|
||||
if (valid) {
|
||||
const record = this.$_.cloneDeep(this.form);
|
||||
|
||||
@@ -178,20 +194,12 @@ export default {
|
||||
|
||||
reslove(record);
|
||||
} else {
|
||||
reject();
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口进行保存时调用表单验证
|
||||
*/
|
||||
onValidate(callback) {
|
||||
this.$refs.form.validate(callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口关闭或重置时对表单验证进行初始化
|
||||
@@ -205,17 +213,6 @@ export default {
|
||||
}, 300);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 加载当前表单中所需要的异步数据
|
||||
*/
|
||||
async onInit() {
|
||||
this.loading = true;
|
||||
/** 可以在这里await获取一些异步数据 */
|
||||
/* ... */
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/** 当前组件的其他方法 */
|
||||
/* ... */
|
||||
|
||||
@@ -232,7 +229,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onFileChange({ fileList }, key) {
|
||||
this.form[key] = fileList;
|
||||
this.form.houseInfo[key] = fileList;
|
||||
},
|
||||
onFileDownload(file) {
|
||||
this.$api.sysFileInfoDownload({ id: file.response }).then((res) => {
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<!-- ... -->
|
||||
<a-row :gutter="16" type="flex">
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="图纸资料存档处" prop="drawingMaterial">
|
||||
<a-checkbox-group v-model="form.drawingMaterial">
|
||||
<a-form-model-item class="ant-row-flex" label="图纸资料存档处" prop="houseInfo.drawingMaterial">
|
||||
<a-checkbox-group v-model="form.houseInfo.drawingMaterial">
|
||||
<a-checkbox
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
@@ -29,8 +29,8 @@
|
||||
<a-input
|
||||
class="w-300"
|
||||
placeholder="请输入其他图纸资料存档处"
|
||||
v-if="form.drawingMaterial && form.drawingMaterial.indexOf(codes.houseStorageOfDrawings[codes.houseStorageOfDrawings.length - 1].code) >= 0"
|
||||
v-model="form.drawingMaterialText"
|
||||
v-if="form.houseInfo.drawingMaterial && form.houseInfo.drawingMaterial.indexOf(codes.houseStorageOfDrawings[codes.houseStorageOfDrawings.length - 1].code) >= 0"
|
||||
v-model="form.houseInfo.drawingMaterialText"
|
||||
/>
|
||||
</a-checkbox-group>
|
||||
</a-form-model-item>
|
||||
@@ -43,6 +43,10 @@
|
||||
/* 表单内容默认值 */
|
||||
const defaultForm = {
|
||||
/* ... */
|
||||
houseInfo: {
|
||||
drawingMaterial: null,
|
||||
drawingMaterialText: null,
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -54,11 +58,13 @@ export default {
|
||||
wrapperCol: { flex: '1' },
|
||||
|
||||
/** 表单数据 */
|
||||
form: {},
|
||||
form: {
|
||||
...defaultForm,
|
||||
},
|
||||
/** 验证格式 */
|
||||
rules: {
|
||||
/* ... */
|
||||
drawingMaterial: [{ required: true, message: '请选择图纸资料存档处' }],
|
||||
'houseInfo.drawingMaterial': [{ required: true, message: '请选择图纸资料存档处' }],
|
||||
},
|
||||
|
||||
/** 加载异步数据状态 */
|
||||
@@ -73,7 +79,6 @@ export default {
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.onInit();
|
||||
this.onFillData();
|
||||
},
|
||||
|
||||
@@ -82,16 +87,20 @@ export default {
|
||||
* 必要的方法
|
||||
* 在打开编辑页时允许填充数据
|
||||
*/
|
||||
onFillData() {
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
async onFillData() {
|
||||
this.loading = true;
|
||||
{
|
||||
await this.onLoadCodes();
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
const form = this.$_.cloneDeep(defaultForm);
|
||||
|
||||
this.form = this.$_.cloneDeep({
|
||||
...defaultForm,
|
||||
...record,
|
||||
/** 在此处添加其他默认数据转换 */
|
||||
/* ... */
|
||||
});
|
||||
if (record) {
|
||||
this.$_.giveDeep(form, record);
|
||||
}
|
||||
this.form = form;
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -100,7 +109,7 @@ export default {
|
||||
*/
|
||||
onGetData() {
|
||||
return new Promise((reslove, reject) => {
|
||||
this.$refs.form.validate((valid) => {
|
||||
this.$refs.form.validate((valid, err) => {
|
||||
if (valid) {
|
||||
const record = this.$_.cloneDeep(this.form);
|
||||
|
||||
@@ -109,20 +118,12 @@ export default {
|
||||
|
||||
reslove(record);
|
||||
} else {
|
||||
reject();
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口进行保存时调用表单验证
|
||||
*/
|
||||
onValidate(callback) {
|
||||
this.$refs.form.validate(callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口关闭或重置时对表单验证进行初始化
|
||||
@@ -136,18 +137,6 @@ export default {
|
||||
}, 300);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 加载当前表单中所需要的异步数据
|
||||
*/
|
||||
async onInit() {
|
||||
this.loading = true;
|
||||
/** 可以在这里await获取一些异步数据 */
|
||||
/* ... */
|
||||
await this.onLoadCodes();
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/** 当前组件的其他方法 */
|
||||
/* ... */
|
||||
onLoadCodes() {
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<!-- ... -->
|
||||
<a-row :gutter="16" type="flex">
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="鉴定等级" prop="identification">
|
||||
<a-radio-group button-style="solid" v-model="form.identification">
|
||||
<!-- <a-form-model-item class="ant-row-flex" label="鉴定等级" prop="houseInfo.identification">
|
||||
<a-radio-group button-style="solid" v-model="form.houseInfo.identification">
|
||||
<a-radio-button
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
@@ -27,8 +27,8 @@
|
||||
>{{ item.value }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item class="ant-row-flex" label="治理改造措施" prop="government">
|
||||
<a-radio-group button-style="solid" v-model="form.government">
|
||||
<a-form-model-item class="ant-row-flex" label="治理改造措施" prop="houseInfo.government">
|
||||
<a-radio-group button-style="solid" v-model="form.houseInfo.government">
|
||||
<a-radio-button
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
@@ -36,24 +36,24 @@
|
||||
>{{ item.value }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item class="ant-row-flex" label="是否已通过解危鉴定" prop="fireproofGrade">
|
||||
<a-form-model-item class="ant-row-flex" label="是否已通过解危鉴定" prop="houseInfo.fireproofGrade">
|
||||
<a-switch />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item class="ant-row-flex" label="房屋使用状态" prop="usedStatus">
|
||||
<a-radio-group button-style="solid" v-model="form.usedStatus">
|
||||
</a-form-model-item>-->
|
||||
<a-form-model-item class="ant-row-flex" label="房屋使用状态" prop="houseInfo.houseUsedStatus">
|
||||
<a-radio-group button-style="solid" v-model="form.houseInfo.houseUsedStatus">
|
||||
<a-radio-button
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
v-for="item in codes.usedStatus"
|
||||
v-for="item in codes.houseUsedStatus"
|
||||
>{{ item.value }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item class="ant-row-flex" label="综合等级" prop="houseLevel">
|
||||
<a-radio-group button-style="solid" v-model="form.houseLevel">
|
||||
<a-form-model-item class="ant-row-flex" label="综合等级" prop="houseInfo.houseGrade">
|
||||
<a-radio-group button-style="solid" v-model="form.houseInfo.houseGrade">
|
||||
<a-radio-button
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
v-for="item in codes.houseLevel"
|
||||
v-for="item in codes.houseGrade"
|
||||
>{{ item.value }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
@@ -66,6 +66,11 @@
|
||||
/* 表单内容默认值 */
|
||||
const defaultForm = {
|
||||
/* ... */
|
||||
houseInfo: {
|
||||
// identification: null,
|
||||
houseUsedStatus: null,
|
||||
houseGrade: null,
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -77,13 +82,15 @@ export default {
|
||||
wrapperCol: { flex: '1' },
|
||||
|
||||
/** 表单数据 */
|
||||
form: {},
|
||||
form: {
|
||||
...defaultForm,
|
||||
},
|
||||
/** 验证格式 */
|
||||
rules: {
|
||||
/* ... */
|
||||
identification: [{ required: true, message: '请选择鉴定等级' }],
|
||||
houseStatus: [{ required: true, message: '请选择房屋使用状态' }],
|
||||
comprehensiveGrade: [{ required: true, message: '请选择综合等级' }],
|
||||
// 'houseInfo.identification': [{ required: true, message: '请选择鉴定等级' }],
|
||||
'houseInfo.houseUsedStatus': [{ required: true, message: '请选择房屋使用状态' }],
|
||||
'houseInfo.houseGrade': [{ required: true, message: '请选择综合等级' }],
|
||||
},
|
||||
|
||||
/** 加载异步数据状态 */
|
||||
@@ -94,14 +101,13 @@ export default {
|
||||
codes: {
|
||||
houseIdentification: [],
|
||||
houseGovernment: [],
|
||||
houseStatus: [],
|
||||
houseComprehensiveGrade: [],
|
||||
houseUsedStatus: [],
|
||||
houseGrade: [],
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.onInit();
|
||||
this.onFillData();
|
||||
},
|
||||
|
||||
@@ -110,16 +116,20 @@ export default {
|
||||
* 必要的方法
|
||||
* 在打开编辑页时允许填充数据
|
||||
*/
|
||||
onFillData() {
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
async onFillData() {
|
||||
this.loading = true;
|
||||
{
|
||||
await this.onLoadCodes();
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
const form = this.$_.cloneDeep(defaultForm);
|
||||
|
||||
this.form = this.$_.cloneDeep({
|
||||
...defaultForm,
|
||||
...record,
|
||||
/** 在此处添加其他默认数据转换 */
|
||||
/* ... */
|
||||
});
|
||||
if (record) {
|
||||
this.$_.giveDeep(form, record);
|
||||
}
|
||||
this.form = form;
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -128,7 +138,7 @@ export default {
|
||||
*/
|
||||
onGetData() {
|
||||
return new Promise((reslove, reject) => {
|
||||
this.$refs.form.validate((valid) => {
|
||||
this.$refs.form.validate((valid, err) => {
|
||||
if (valid) {
|
||||
const record = this.$_.cloneDeep(this.form);
|
||||
|
||||
@@ -137,20 +147,12 @@ export default {
|
||||
|
||||
reslove(record);
|
||||
} else {
|
||||
reject();
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口进行保存时调用表单验证
|
||||
*/
|
||||
onValidate(callback) {
|
||||
this.$refs.form.validate(callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口关闭或重置时对表单验证进行初始化
|
||||
@@ -164,39 +166,20 @@ export default {
|
||||
}, 300);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 加载当前表单中所需要的异步数据
|
||||
*/
|
||||
async onInit() {
|
||||
this.loading = true;
|
||||
/** 可以在这里await获取一些异步数据 */
|
||||
/* ... */
|
||||
await this.onLoadCodes();
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/** 当前组件的其他方法 */
|
||||
/* ... */
|
||||
onLoadCodes() {
|
||||
return this.$api
|
||||
.sysDictTypeDropDowns({
|
||||
code: [
|
||||
'dic_house_identification',
|
||||
'dic_house_government',
|
||||
'dic_house_status',
|
||||
'dic_house_comprehensive_grade',
|
||||
],
|
||||
code: ['dic_house_identification', 'dic_house_government', 'dic_house_used_status', 'dic_house_grade'],
|
||||
})
|
||||
.then(
|
||||
({
|
||||
data: { dic_house_identification, dic_house_government, dic_house_status, dic_house_comprehensive_grade },
|
||||
}) => {
|
||||
({ data: { dic_house_identification, dic_house_government, dic_house_used_status, dic_house_grade } }) => {
|
||||
this.codes = {
|
||||
houseIdentification: dic_house_identification,
|
||||
houseGovernment: dic_house_government,
|
||||
houseStatus: dic_house_status,
|
||||
houseComprehensiveGrade: dic_house_comprehensive_grade,
|
||||
houseUsedStatus: dic_house_used_status,
|
||||
houseGrade: dic_house_grade,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
@@ -59,34 +59,34 @@ export default {
|
||||
// title: '管理情况',
|
||||
// component: () => import('./manager'),
|
||||
// },
|
||||
// {
|
||||
// title: '调查情况',
|
||||
// component: () => import('./investigation'),
|
||||
// },
|
||||
// {
|
||||
// title: '鉴定治理',
|
||||
// component: () => import('./identification'),
|
||||
// },
|
||||
// {
|
||||
// title: '图纸资料存档处',
|
||||
// component: () => import('./drawing'),
|
||||
// },
|
||||
// {
|
||||
// title: '相关附件资料',
|
||||
// component: () => import('./attachments'),
|
||||
// },
|
||||
{
|
||||
title: '调查情况',
|
||||
component: () => import('./investigation'),
|
||||
},
|
||||
{
|
||||
title: '鉴定治理',
|
||||
component: () => import('./identification'),
|
||||
},
|
||||
{
|
||||
title: '图纸资料存档处',
|
||||
component: () => import('./drawing'),
|
||||
},
|
||||
{
|
||||
title: '相关附件资料',
|
||||
component: () => import('./attachments'),
|
||||
},
|
||||
// {
|
||||
// title: '物业维修资金',
|
||||
// component: () => import('./fund'),
|
||||
// },
|
||||
// {
|
||||
// title: '建筑概貌',
|
||||
// component: () => import('./aspect'),
|
||||
// },
|
||||
// {
|
||||
// title: '调查单位',
|
||||
// component: () => import('./unit'),
|
||||
// },
|
||||
{
|
||||
title: '建筑概貌',
|
||||
component: () => import('./aspect'),
|
||||
},
|
||||
{
|
||||
title: '调查单位',
|
||||
component: () => import('./unit'),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<!-- ... -->
|
||||
<a-row :gutter="16" type="flex">
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="房屋场地" prop="houseSite">
|
||||
<a-checkbox-group v-model="form.houseSite">
|
||||
<a-form-model-item class="ant-row-flex" label="房屋场地" prop="houseInfo.houseSite">
|
||||
<a-checkbox-group v-model="form.houseInfo.houseSite">
|
||||
<a-checkbox
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
@@ -30,8 +30,12 @@
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="相邻施工" prop="adjacentConstruction">
|
||||
<a-checkbox-group v-model="form.adjacentConstruction">
|
||||
<a-form-model-item
|
||||
class="ant-row-flex"
|
||||
label="相邻施工"
|
||||
prop="houseInfo.adjacentConstruction"
|
||||
>
|
||||
<a-checkbox-group v-model="form.houseInfo.adjacentConstruction">
|
||||
<a-checkbox
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
@@ -42,8 +46,8 @@
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="化学侵蚀" prop="chemicalErosion">
|
||||
<a-checkbox-group v-model="form.chemicalErosion">
|
||||
<a-form-model-item class="ant-row-flex" label="化学侵蚀" prop="houseInfo.chemicalErosion">
|
||||
<a-checkbox-group v-model="form.houseInfo.chemicalErosion">
|
||||
<a-checkbox
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
@@ -54,8 +58,12 @@
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="结构拆改" prop="structuralDismantling">
|
||||
<a-radio-group button-style="solid" v-model="form.structuralDismantling">
|
||||
<a-form-model-item
|
||||
class="ant-row-flex"
|
||||
label="结构拆改"
|
||||
prop="houseInfo.structuralDismantling"
|
||||
>
|
||||
<a-radio-group button-style="solid" v-model="form.houseInfo.structuralDismantling">
|
||||
<a-radio-button
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
@@ -65,8 +73,8 @@
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="加层改造" prop="addingLayer">
|
||||
<a-radio-group button-style="solid" v-model="form.addingLayer">
|
||||
<a-form-model-item class="ant-row-flex" label="加层改造" prop="houseInfo.addingLayer">
|
||||
<a-radio-group button-style="solid" v-model="form.houseInfo.addingLayer">
|
||||
<a-radio-button
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
@@ -76,8 +84,8 @@
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="修缮加固" prop="repairAndReinforce">
|
||||
<a-checkbox-group v-model="form.repairAndReinforce">
|
||||
<a-form-model-item class="ant-row-flex" label="修缮加固" prop="houseInfo.repairAndReinforce">
|
||||
<a-checkbox-group v-model="form.houseInfo.repairAndReinforce">
|
||||
<a-checkbox
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
@@ -88,8 +96,8 @@
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="历史灾害" prop="historicalCalamity">
|
||||
<a-checkbox-group v-model="form.historicalCalamity">
|
||||
<a-form-model-item class="ant-row-flex" label="历史灾害" prop="houseInfo.historicalCalamity">
|
||||
<a-checkbox-group v-model="form.houseInfo.historicalCalamity">
|
||||
<a-checkbox
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
@@ -100,8 +108,8 @@
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="使用功能变更" prop="functionalChange">
|
||||
<a-checkbox-group v-model="form.functionalChange">
|
||||
<a-form-model-item class="ant-row-flex" label="使用功能变更" prop="houseInfo.functionalChange">
|
||||
<a-checkbox-group v-model="form.houseInfo.functionalChange">
|
||||
<a-checkbox
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
@@ -112,8 +120,8 @@
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="其他调查内容" prop="otherContents">
|
||||
<a-textarea auto-size placeholder="请输入其他调查内容" v-model="form.otherContents" />
|
||||
<a-form-model-item class="ant-row-flex" label="其他调查内容" prop="houseInfo.otherContents">
|
||||
<a-textarea auto-size placeholder="请输入其他调查内容" v-model="form.houseInfo.otherContents" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -124,6 +132,17 @@
|
||||
/* 表单内容默认值 */
|
||||
const defaultForm = {
|
||||
/* ... */
|
||||
houseInfo: {
|
||||
houseSite: null,
|
||||
adjacentConstruction: null,
|
||||
chemicalErosion: null,
|
||||
structuralDismantling: null,
|
||||
addingLayer: null,
|
||||
repairAndReinforce: null,
|
||||
historicalCalamity: null,
|
||||
functionalChange: null,
|
||||
otherContents: null,
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -135,18 +154,20 @@ export default {
|
||||
wrapperCol: { flex: '1' },
|
||||
|
||||
/** 表单数据 */
|
||||
form: {},
|
||||
form: {
|
||||
...defaultForm,
|
||||
},
|
||||
/** 验证格式 */
|
||||
rules: {
|
||||
/* ... */
|
||||
houseSite: [{ required: true, message: '请选择房屋场地' }],
|
||||
adjacentConstruction: [{ required: true, message: '请选择相邻施工' }],
|
||||
chemicalErosion: [{ required: true, message: '请选择化学侵蚀' }],
|
||||
structuralDismantling: [{ required: true, message: '请选择结构拆改' }],
|
||||
addingLayer: [{ required: true, message: '请选择加层改造' }],
|
||||
repairAndReinforce: [{ required: true, message: '请选择修缮加固' }],
|
||||
historicalCalamity: [{ required: true, message: '请选择历史灾害' }],
|
||||
functionalChange: [{ required: true, message: '请选择使用功能变更' }],
|
||||
'houseInfo.houseSite': [{ required: true, message: '请选择房屋场地' }],
|
||||
'houseInfo.adjacentConstruction': [{ required: true, message: '请选择相邻施工' }],
|
||||
'houseInfo.chemicalErosion': [{ required: true, message: '请选择化学侵蚀' }],
|
||||
'houseInfo.structuralDismantling': [{ required: true, message: '请选择结构拆改' }],
|
||||
'houseInfo.addingLayer': [{ required: true, message: '请选择加层改造' }],
|
||||
'houseInfo.repairAndReinforce': [{ required: true, message: '请选择修缮加固' }],
|
||||
'houseInfo.historicalCalamity': [{ required: true, message: '请选择历史灾害' }],
|
||||
'houseInfo.functionalChange': [{ required: true, message: '请选择使用功能变更' }],
|
||||
},
|
||||
|
||||
/** 加载异步数据状态 */
|
||||
@@ -168,25 +189,24 @@ export default {
|
||||
},
|
||||
|
||||
watch: {
|
||||
'form.adjacentConstruction'(value, oldValue) {
|
||||
'form.houseInfo.adjacentConstruction'(value, oldValue) {
|
||||
this.onCheckedNone(value, oldValue, 'adjacentConstruction');
|
||||
},
|
||||
'form.chemicalErosion'(value, oldValue) {
|
||||
'form.houseInfo.chemicalErosion'(value, oldValue) {
|
||||
this.onCheckedNone(value, oldValue, 'chemicalErosion');
|
||||
},
|
||||
'form.repairAndReinforce'(value, oldValue) {
|
||||
'form.houseInfo.repairAndReinforce'(value, oldValue) {
|
||||
this.onCheckedNone(value, oldValue, 'repairAndReinforce');
|
||||
},
|
||||
'form.historicalCalamity'(value, oldValue) {
|
||||
'form.houseInfo.historicalCalamity'(value, oldValue) {
|
||||
this.onCheckedNone(value, oldValue, 'historicalCalamity');
|
||||
},
|
||||
'form.functionalChange'(value, oldValue) {
|
||||
'form.houseInfo.functionalChange'(value, oldValue) {
|
||||
this.onCheckedNone(value, oldValue, 'functionalChange');
|
||||
},
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.onInit();
|
||||
this.onFillData();
|
||||
},
|
||||
|
||||
@@ -195,16 +215,21 @@ export default {
|
||||
* 必要的方法
|
||||
* 在打开编辑页时允许填充数据
|
||||
*/
|
||||
onFillData() {
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
async onFillData() {
|
||||
this.loading = true;
|
||||
{
|
||||
await this.onLoadCodes();
|
||||
|
||||
this.form = this.$_.cloneDeep({
|
||||
...defaultForm,
|
||||
...record,
|
||||
/** 在此处添加其他默认数据转换 */
|
||||
/* ... */
|
||||
});
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
const form = this.$_.cloneDeep(defaultForm);
|
||||
|
||||
if (record) {
|
||||
this.$_.giveDeep(form, record);
|
||||
}
|
||||
this.form = form;
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -213,7 +238,7 @@ export default {
|
||||
*/
|
||||
onGetData() {
|
||||
return new Promise((reslove, reject) => {
|
||||
this.$refs.form.validate((valid) => {
|
||||
this.$refs.form.validate((valid, err) => {
|
||||
if (valid) {
|
||||
const record = this.$_.cloneDeep(this.form);
|
||||
|
||||
@@ -222,20 +247,12 @@ export default {
|
||||
|
||||
reslove(record);
|
||||
} else {
|
||||
reject();
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口进行保存时调用表单验证
|
||||
*/
|
||||
onValidate(callback) {
|
||||
this.$refs.form.validate(callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口关闭或重置时对表单验证进行初始化
|
||||
@@ -249,18 +266,6 @@ export default {
|
||||
}, 300);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 加载当前表单中所需要的异步数据
|
||||
*/
|
||||
async onInit() {
|
||||
this.loading = true;
|
||||
/** 可以在这里await获取一些异步数据 */
|
||||
/* ... */
|
||||
await this.onLoadCodes();
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/** 当前组件的其他方法 */
|
||||
/* ... */
|
||||
onLoadCodes() {
|
||||
@@ -306,10 +311,10 @@ export default {
|
||||
|
||||
onCheckedNone(value, oldValue, key) {
|
||||
// 选中"无"时全不选,反之取消选择"无"
|
||||
if (value.indexOf('0') >= 0 && oldValue.indexOf('0') === -1) {
|
||||
this.form[key] = ['0'];
|
||||
if (value.indexOf('0') >= 0 && (!oldValue || oldValue.indexOf('0') === -1)) {
|
||||
this.form.houseInfo[key] = ['0'];
|
||||
} else if (value.indexOf('0') >= 0 && value.length > 1) {
|
||||
this.form[key].splice(value.indexOf('0'), 1);
|
||||
this.form.houseInfo[key].splice(value.indexOf('0'), 1);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<!-- ... -->
|
||||
<a-row :gutter="16" type="flex">
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="产权性质" prop="propertyRights">
|
||||
<a-radio-group button-style="solid" v-model="form.propertyRights">
|
||||
<a-form-model-item class="ant-row-flex" label="产权性质" prop="houseInfo.propertyRights">
|
||||
<a-radio-group button-style="solid" v-model="form.houseInfo.propertyRights">
|
||||
<a-radio-button
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
@@ -35,7 +35,7 @@
|
||||
:colon="false"
|
||||
class="ant-row-flex"
|
||||
label="直管公房"
|
||||
prop="straightHouseCount"
|
||||
prop="houseInfo.straightHouseCount"
|
||||
>
|
||||
<a-row type="flex">
|
||||
<a-col flex="1">
|
||||
@@ -43,7 +43,7 @@
|
||||
:min="0"
|
||||
:step="1"
|
||||
placeholder="几"
|
||||
v-model="form.straightHouseCount"
|
||||
v-model="form.houseInfo.straightHouseCount"
|
||||
/>
|
||||
</a-col>
|
||||
<a-col>
|
||||
@@ -55,7 +55,7 @@
|
||||
:colon="false"
|
||||
class="ant-row-flex"
|
||||
label="单位自管公房"
|
||||
prop="selfHouseCount"
|
||||
prop="houseInfo.selfHouseCount"
|
||||
>
|
||||
<a-row type="flex">
|
||||
<a-col flex="1">
|
||||
@@ -63,7 +63,7 @@
|
||||
:min="0"
|
||||
:step="1"
|
||||
placeholder="几"
|
||||
v-model="form.selfHouseCount"
|
||||
v-model="form.houseInfo.selfHouseCount"
|
||||
/>
|
||||
</a-col>
|
||||
<a-col>
|
||||
@@ -74,7 +74,12 @@
|
||||
<a-form-model-item :colon="false" class="ant-row-flex" label="其他" props="otherCount">
|
||||
<a-row type="flex">
|
||||
<a-col flex="1">
|
||||
<a-input-number :min="0" :step="1" placeholder="几" v-model="form.otherCount" />
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:step="1"
|
||||
placeholder="几"
|
||||
v-model="form.houseInfo.otherCount"
|
||||
/>
|
||||
</a-col>
|
||||
<a-col>
|
||||
<span class="yo-addon">套</span>
|
||||
@@ -87,7 +92,7 @@
|
||||
:colon="false"
|
||||
class="ant-row-flex"
|
||||
label="商品房"
|
||||
prop="businessCount"
|
||||
prop="houseInfo.businessCount"
|
||||
>
|
||||
<a-row type="flex">
|
||||
<a-col flex="1">
|
||||
@@ -95,7 +100,7 @@
|
||||
:min="0"
|
||||
:step="1"
|
||||
placeholder="几"
|
||||
v-model="form.businessCount"
|
||||
v-model="form.houseInfo.businessCount"
|
||||
/>
|
||||
</a-col>
|
||||
<a-col>
|
||||
@@ -107,7 +112,7 @@
|
||||
:colon="false"
|
||||
class="ant-row-flex"
|
||||
label="房改房"
|
||||
prop="changeHouseCount"
|
||||
prop="houseInfo.changeHouseCount"
|
||||
>
|
||||
<a-row type="flex">
|
||||
<a-col flex="1">
|
||||
@@ -115,7 +120,7 @@
|
||||
:min="0"
|
||||
:step="1"
|
||||
placeholder="几"
|
||||
v-model="form.changeHouseCount"
|
||||
v-model="form.houseInfo.changeHouseCount"
|
||||
/>
|
||||
</a-col>
|
||||
<a-col>
|
||||
@@ -127,7 +132,7 @@
|
||||
:colon="false"
|
||||
class="ant-row-flex"
|
||||
label="拆迁安置房"
|
||||
prop="resettlementHouseCount"
|
||||
prop="houseInfo.resettlementHouseCount"
|
||||
>
|
||||
<a-row type="flex">
|
||||
<a-col flex="1">
|
||||
@@ -135,7 +140,7 @@
|
||||
:min="0"
|
||||
:step="1"
|
||||
placeholder="几"
|
||||
v-model="form.resettlementHouseCount"
|
||||
v-model="form.houseInfo.resettlementHouseCount"
|
||||
/>
|
||||
</a-col>
|
||||
<a-col>
|
||||
@@ -149,7 +154,7 @@
|
||||
:colon="false"
|
||||
class="ant-row-flex"
|
||||
label="私房"
|
||||
prop="privateHouseCount"
|
||||
prop="houseInfo.privateHouseCount"
|
||||
>
|
||||
<a-row type="flex">
|
||||
<a-col flex="1">
|
||||
@@ -157,7 +162,7 @@
|
||||
:min="0"
|
||||
:step="1"
|
||||
placeholder="几"
|
||||
v-model="form.privateHouseCount"
|
||||
v-model="form.houseInfo.privateHouseCount"
|
||||
/>
|
||||
</a-col>
|
||||
<a-col>
|
||||
@@ -165,10 +170,20 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :colon="false" class="ant-row-flex" label="总共" prop="houseCount">
|
||||
<a-form-model-item
|
||||
:colon="false"
|
||||
class="ant-row-flex"
|
||||
label="总共"
|
||||
prop="houseInfo.houseCount"
|
||||
>
|
||||
<a-row type="flex">
|
||||
<a-col flex="1">
|
||||
<a-input-number :min="0" :step="1" placeholder="几" v-model="form.houseCount" />
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:step="1"
|
||||
placeholder="几"
|
||||
v-model="form.houseInfo.houseCount"
|
||||
/>
|
||||
</a-col>
|
||||
<a-col>
|
||||
<span class="yo-addon">套</span>
|
||||
@@ -179,28 +194,36 @@
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="产权单位" prop="propertyUnit">
|
||||
<a-input placeholder="请输入产权单位" v-model="form.propertyUnit" />
|
||||
<a-form-model-item class="ant-row-flex" label="产权单位" prop="houseInfo.propertyUnit">
|
||||
<a-input placeholder="请输入产权单位" v-model="form.houseInfo.propertyUnit" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-model-item class="ant-row-flex" label="负责人" prop="propertyUnitUser">
|
||||
<a-input placeholder="请输入负责人" v-model="form.propertyUnitUser" />
|
||||
<a-form-model-item class="ant-row-flex" label="负责人" prop="houseInfo.propertyUnitUser">
|
||||
<a-input placeholder="请输入负责人" v-model="form.houseInfo.propertyUnitUser" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-model-item class="ant-row-flex" label="负责人电话" prop="propertyUnitUserTel">
|
||||
<a-input placeholder="请输入负责人电话" v-model="form.propertyUnitUserTel" />
|
||||
<a-form-model-item
|
||||
class="ant-row-flex"
|
||||
label="负责人电话"
|
||||
prop="houseInfo.propertyUnitUserTel"
|
||||
>
|
||||
<a-input placeholder="请输入负责人电话" v-model="form.houseInfo.propertyUnitUserTel" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-model-item class="ant-row-flex" label="联系人" prop="propertyUnitConent">
|
||||
<a-input placeholder="请输入联系人" v-model="form.propertyUnitConent" />
|
||||
<a-form-model-item class="ant-row-flex" label="联系人" prop="houseInfo.propertyUnitConent">
|
||||
<a-input placeholder="请输入联系人" v-model="form.houseInfo.propertyUnitConent" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-model-item class="ant-row-flex" label="联系人电话" prop="propertyUnitConentTel">
|
||||
<a-input placeholder="请输入联系人电话" v-model="form.propertyUnitConentTel" />
|
||||
<a-form-model-item
|
||||
class="ant-row-flex"
|
||||
label="联系人电话"
|
||||
prop="houseInfo.propertyUnitConentTel"
|
||||
>
|
||||
<a-input placeholder="请输入联系人电话" v-model="form.houseInfo.propertyUnitConentTel" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -211,6 +234,22 @@
|
||||
/* 表单内容默认值 */
|
||||
const defaultForm = {
|
||||
/* ... */
|
||||
houseInfo: {
|
||||
propertyRights: null,
|
||||
straightHouseCount: null,
|
||||
selfHouseCount: null,
|
||||
otherCount: null,
|
||||
businessCount: null,
|
||||
changeHouseCount: null,
|
||||
resettlementHouseCount: null,
|
||||
privateHouseCount: null,
|
||||
houseCount: null,
|
||||
propertyUnit: null,
|
||||
propertyUnitUser: null,
|
||||
propertyUnitUserTel: null,
|
||||
propertyUnitConent: null,
|
||||
propertyUnitConentTel: null,
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -222,17 +261,19 @@ export default {
|
||||
wrapperCol: { flex: '1' },
|
||||
|
||||
/** 表单数据 */
|
||||
form: {},
|
||||
form: {
|
||||
...defaultForm,
|
||||
},
|
||||
/** 验证格式 */
|
||||
rules: {
|
||||
/* ... */
|
||||
propertyRights: [{ required: true, message: '请选择产权性质' }],
|
||||
straightHouseCount: [{ required: true, message: '请输入直管公房' }],
|
||||
selfHouseCount: [{ required: true, message: '请输入单位自管公房' }],
|
||||
otherCount: [{ required: true, message: '请输入其他' }],
|
||||
businessCount: [{ required: true, message: '请输入商品房' }],
|
||||
changeHouseCount: [{ required: true, message: '请输入房改房' }],
|
||||
resettlementHouseCount: [{ required: true, message: '请输入拆迁安置房' }],
|
||||
'houseInfo.propertyRights': [{ required: true, message: '请选择产权性质' }],
|
||||
'houseInfo.straightHouseCount': [{ required: true, message: '请输入直管公房' }],
|
||||
'houseInfo.selfHouseCount': [{ required: true, message: '请输入单位自管公房' }],
|
||||
'houseInfo.otherCount': [{ required: true, message: '请输入其他' }],
|
||||
'houseInfo.businessCount': [{ required: true, message: '请输入商品房' }],
|
||||
'houseInfo.changeHouseCount': [{ required: true, message: '请输入房改房' }],
|
||||
'houseInfo.resettlementHouseCount': [{ required: true, message: '请输入拆迁安置房' }],
|
||||
},
|
||||
|
||||
/** 加载异步数据状态 */
|
||||
@@ -247,7 +288,6 @@ export default {
|
||||
},
|
||||
|
||||
async created() {
|
||||
this.form = this.$_.cloneDeep(defaultForm);
|
||||
this.onFillData();
|
||||
},
|
||||
|
||||
|
||||
@@ -18,23 +18,23 @@
|
||||
<!-- ... -->
|
||||
<a-row :gutter="16" type="flex">
|
||||
<a-col :span="12">
|
||||
<a-form-model-item class="ant-row-flex" label="调查登记机构" prop="investigateAgency">
|
||||
<a-input placeholder="请输入登记机构" v-model="form.investigateAgency" />
|
||||
<a-form-model-item class="ant-row-flex" label="调查登记机构" prop="houseInfo.investigateAgency">
|
||||
<a-input placeholder="请输入登记机构" v-model="form.houseInfo.investigateAgency" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-model-item class="ant-row-flex" label="调查人员" prop="investigateUser">
|
||||
<a-input placeholder="请输入调查人员" v-model="form.investigateUser" />
|
||||
<a-form-model-item class="ant-row-flex" label="调查人员" prop="houseInfo.investigateUser">
|
||||
<a-input placeholder="请输入调查人员" v-model="form.houseInfo.investigateUser" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-model-item class="ant-row-flex" label="审核人员" prop="offlineAuditor">
|
||||
<a-input placeholder="请输入审核人员" v-model="form.offlineAuditor" />
|
||||
<a-form-model-item class="ant-row-flex" label="审核人员" prop="houseInfo.offlineAuditor">
|
||||
<a-input placeholder="请输入审核人员" v-model="form.houseInfo.offlineAuditor" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-model-item class="ant-row-flex" label="主管部门" prop="competentDepartment">
|
||||
<a-input placeholder="请输入主管部门" v-model="form.competentDepartment" />
|
||||
<a-form-model-item class="ant-row-flex" label="主管部门" prop="houseInfo.competentDepartment">
|
||||
<a-input placeholder="请输入主管部门" v-model="form.houseInfo.competentDepartment" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -45,6 +45,12 @@
|
||||
/* 表单内容默认值 */
|
||||
const defaultForm = {
|
||||
/* ... */
|
||||
houseInfo: {
|
||||
investigateAgency: null,
|
||||
investigateUser: null,
|
||||
offlineAuditor: null,
|
||||
competentDepartment: null,
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -56,14 +62,16 @@ export default {
|
||||
wrapperCol: { flex: '1' },
|
||||
|
||||
/** 表单数据 */
|
||||
form: {},
|
||||
form: {
|
||||
...defaultForm,
|
||||
},
|
||||
/** 验证格式 */
|
||||
rules: {
|
||||
/* ... */
|
||||
investigateAgency: [{ required: true, message: '请输入调查登记机构' }],
|
||||
investigateUser: [{ required: true, message: '请输入调查人员' }],
|
||||
offlineAuditor: [{ required: true, message: '请输入审核人员' }],
|
||||
competentDepartment: [{ required: true, message: '请输入主管部门' }],
|
||||
'houseInfo.investigateAgency': [{ required: true, message: '请输入调查登记机构' }],
|
||||
'houseInfo.investigateUser': [{ required: true, message: '请输入调查人员' }],
|
||||
'houseInfo.offlineAuditor': [{ required: true, message: '请输入审核人员' }],
|
||||
'houseInfo.competentDepartment': [{ required: true, message: '请输入主管部门' }],
|
||||
},
|
||||
|
||||
/** 加载异步数据状态 */
|
||||
@@ -75,7 +83,6 @@ export default {
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.onInit();
|
||||
this.onFillData();
|
||||
},
|
||||
|
||||
@@ -84,25 +91,28 @@ export default {
|
||||
* 必要的方法
|
||||
* 在打开编辑页时允许填充数据
|
||||
*/
|
||||
onFillData() {
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
async onFillData() {
|
||||
this.loading = true;
|
||||
{
|
||||
// await this.onLoadCodes();
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
const form = this.$_.cloneDeep(defaultForm);
|
||||
|
||||
this.form = this.$_.cloneDeep({
|
||||
...defaultForm,
|
||||
...record,
|
||||
/** 在此处添加其他默认数据转换 */
|
||||
/* ... */
|
||||
});
|
||||
if (record) {
|
||||
this.$_.giveDeep(form, record);
|
||||
}
|
||||
this.form = form;
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 验证表单并获取表单数据
|
||||
*/
|
||||
onGetData() {
|
||||
return new Promise((reslove, reject) => {
|
||||
this.$refs.form.validate((valid) => {
|
||||
this.$refs.form.validate((valid, err) => {
|
||||
if (valid) {
|
||||
const record = this.$_.cloneDeep(this.form);
|
||||
|
||||
@@ -111,20 +121,12 @@ export default {
|
||||
|
||||
reslove(record);
|
||||
} else {
|
||||
reject();
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口进行保存时调用表单验证
|
||||
*/
|
||||
onValidate(callback) {
|
||||
this.$refs.form.validate(callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口关闭或重置时对表单验证进行初始化
|
||||
@@ -138,17 +140,6 @@ export default {
|
||||
}, 300);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 加载当前表单中所需要的异步数据
|
||||
*/
|
||||
async onInit() {
|
||||
this.loading = true;
|
||||
/** 可以在这里await获取一些异步数据 */
|
||||
/* ... */
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/** 当前组件的其他方法 */
|
||||
/* ... */
|
||||
},
|
||||
|
||||
@@ -49,7 +49,9 @@ export default {
|
||||
wrapperCol: { flex: '1' },
|
||||
|
||||
/** 表单数据 */
|
||||
form: {},
|
||||
form: {
|
||||
...defaultForm,
|
||||
},
|
||||
/** 验证格式 */
|
||||
rules: {
|
||||
/* ... */
|
||||
@@ -65,9 +67,6 @@ export default {
|
||||
},
|
||||
|
||||
async created() {
|
||||
this.form = this.$_.cloneDeep(defaultForm);
|
||||
|
||||
await this.onInit();
|
||||
this.onFillData();
|
||||
},
|
||||
|
||||
@@ -76,28 +75,31 @@ export default {
|
||||
* 必要的方法
|
||||
* 在打开编辑页时允许填充数据
|
||||
*/
|
||||
onFillData() {
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
async onFillData() {
|
||||
this.loading = true;
|
||||
{
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
|
||||
const form = this.$_.cloneDeep(defaultForm);
|
||||
const form = this.$_.cloneDeep(defaultForm);
|
||||
|
||||
if (record) {
|
||||
// 此处因业务复杂, 所有数据必定包裹在单独节点中, 所以需要两层循环
|
||||
Object.keys(form).forEach((p) => {
|
||||
if (record.hasOwnProperty(p) && record[p]) {
|
||||
const _form = form[p],
|
||||
_record = record[p];
|
||||
Object.keys(form[p]).forEach((q) => {
|
||||
if (_record.hasOwnProperty(q) && (_record[q] !== null) & (_record[q] !== undefined)) {
|
||||
_form[q] = _record[q];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
if (record) {
|
||||
// 此处因业务复杂, 所有数据必定包裹在单独节点中, 所以需要两层循环
|
||||
Object.keys(form).forEach((p) => {
|
||||
if (record.hasOwnProperty(p) && record[p]) {
|
||||
const _form = form[p],
|
||||
_record = record[p];
|
||||
Object.keys(form[p]).forEach((q) => {
|
||||
if (_record.hasOwnProperty(q) && (_record[q] !== null) & (_record[q] !== undefined)) {
|
||||
_form[q] = _record[q];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
this.form = form;
|
||||
}
|
||||
|
||||
this.form = form;
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -121,14 +123,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口进行保存时调用表单验证
|
||||
*/
|
||||
onValidate(callback) {
|
||||
this.$refs.form.validate(callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口关闭或重置时对表单验证进行初始化
|
||||
@@ -142,63 +136,8 @@ export default {
|
||||
}, 300);
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 加载当前表单中所需要的异步数据
|
||||
*/
|
||||
async onInit() {
|
||||
this.loading = true;
|
||||
/** 可以在这里await获取一些异步数据 */
|
||||
/* ... */
|
||||
await this.onLoadCodes();
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/** 当前组件的其他方法 */
|
||||
/* ... */
|
||||
onLoadCodes() {
|
||||
return this.$api
|
||||
.sysDictTypeDropDowns({
|
||||
code: [
|
||||
'dic_land_attribute',
|
||||
'dic_house_structure_type',
|
||||
'dic_house_aseismic_grade',
|
||||
'dic_house_base_info',
|
||||
'dic_house_insulation_material',
|
||||
'dic_house_wall_material',
|
||||
'dic_house_fireproof_grade',
|
||||
'dic_house_building_curtain_wall',
|
||||
'dic_house_elevator',
|
||||
],
|
||||
})
|
||||
.then(
|
||||
({
|
||||
data: {
|
||||
dic_land_attribute,
|
||||
dic_house_structure_type,
|
||||
dic_house_aseismic_grade,
|
||||
dic_house_base_info,
|
||||
dic_house_insulation_material,
|
||||
dic_house_wall_material,
|
||||
dic_house_fireproof_grade,
|
||||
dic_house_building_curtain_wall,
|
||||
dic_house_elevator,
|
||||
},
|
||||
}) => {
|
||||
this.codes = {
|
||||
landAttribute: dic_land_attribute,
|
||||
houseStructureType: dic_house_structure_type,
|
||||
houseSseismicGrade: dic_house_aseismic_grade,
|
||||
houseBaseInfo: dic_house_base_info,
|
||||
houseInsulationMaterial: dic_house_insulation_material,
|
||||
houseWallMaterial: dic_house_wall_material,
|
||||
houseFireproofGrade: dic_house_fireproof_grade,
|
||||
houseBuildingCurtainWall: dic_house_building_curtain_wall,
|
||||
houseElevator: dic_house_elevator,
|
||||
};
|
||||
}
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
177
Web/src/pages/business/house/info/form/patrol/grade.vue
Normal file
177
Web/src/pages/business/house/info/form/patrol/grade.vue
Normal file
@@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<!--
|
||||
整页表单的分片表单
|
||||
v 1.0
|
||||
2021-05-12
|
||||
Lufthafen
|
||||
-->
|
||||
<a-form-model
|
||||
:label-col="labelCol"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:wrapper-col="wrapperCol"
|
||||
ref="form"
|
||||
>
|
||||
<a-spin :spinning="loading">
|
||||
<a-icon slot="indicator" spin type="loading" />
|
||||
<!-- 表单控件 -->
|
||||
<!-- ... -->
|
||||
<a-row :gutter="16" type="flex">
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="初始等级" prop="patrolInfo.initGrade">
|
||||
<a-radio-group button-style="solid" v-model="form.patrolInfo.initGrade">
|
||||
<a-radio-button
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
v-for="item in codes.houseInitGrade"
|
||||
>{{ item.value }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="损坏等级" prop="patrolInfo.damageGrade">
|
||||
<a-radio-group button-style="solid" v-model="form.patrolInfo.damageGrade">
|
||||
<a-radio-button
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
v-for="item in codes.houseDamageGrade"
|
||||
>{{ item.value }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="综合等级" prop="patrolInfo.comprehensiveGrade">
|
||||
<a-radio-group button-style="solid" v-model="form.patrolInfo.comprehensiveGrade">
|
||||
<a-radio-button
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
v-for="item in codes.houseGrade"
|
||||
>{{ item.value }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-spin>
|
||||
</a-form-model>
|
||||
</template>
|
||||
<script>
|
||||
/* 表单内容默认值 */
|
||||
const defaultForm = {
|
||||
/* ... */
|
||||
patrolInfo: {
|
||||
initGrade: '1',
|
||||
damageGrade: '1',
|
||||
comprehensiveGrade: '1',
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
props: ['param'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
labelCol: { flex: '150px' },
|
||||
wrapperCol: { flex: '1' },
|
||||
|
||||
/** 表单数据 */
|
||||
form: {
|
||||
...defaultForm,
|
||||
},
|
||||
/** 验证格式 */
|
||||
rules: {
|
||||
/* ... */
|
||||
'patrolInfo.initGrade': [{ required: true, message: '请选择初始等级' }],
|
||||
'patrolInfo.damageGrade': [{ required: true, message: '请选择损坏等级' }],
|
||||
'patrolInfo.comprehensiveGrade': [{ required: true, message: '请选择综合等级' }],
|
||||
},
|
||||
|
||||
/** 加载异步数据状态 */
|
||||
loading: false,
|
||||
|
||||
/** 其他成员属性 */
|
||||
/* ... */
|
||||
codes: {
|
||||
houseInitGrade: [],
|
||||
houseDamageGrade: [],
|
||||
houseGrade: [],
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
async created() {
|
||||
this.onFillData();
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在打开编辑页时允许填充数据
|
||||
*/
|
||||
async onFillData() {
|
||||
this.loading = true;
|
||||
{
|
||||
await this.onLoadCodes();
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
const form = this.$_.cloneDeep(defaultForm);
|
||||
|
||||
if (record) {
|
||||
this.$_.giveDeep(form, record);
|
||||
}
|
||||
this.form = form;
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 验证表单并获取表单数据
|
||||
*/
|
||||
onGetData() {
|
||||
return new Promise((reslove, reject) => {
|
||||
this.$refs.form.validate((valid, err) => {
|
||||
if (valid) {
|
||||
const record = this.$_.cloneDeep(this.form);
|
||||
|
||||
/** 验证通过后可以对数据进行转换得到想要提交的格式 */
|
||||
/* ... */
|
||||
|
||||
reslove(record);
|
||||
} else {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口关闭或重置时对表单验证进行初始化
|
||||
*/
|
||||
onResetFields() {
|
||||
setTimeout(() => {
|
||||
this.$refs.form.resetFields();
|
||||
|
||||
/** 在这里可以初始化当前组件中其他属性 */
|
||||
/* ... */
|
||||
}, 300);
|
||||
},
|
||||
|
||||
/** 当前组件的其他方法 */
|
||||
/* ... */
|
||||
onLoadCodes() {
|
||||
return this.$api
|
||||
.sysDictTypeDropDowns({
|
||||
code: ['dic_house_patrol_init_grade', 'dic_house_patrol_damage_grade', 'dic_house_grade'],
|
||||
})
|
||||
.then(({ data: { dic_house_patrol_init_grade, dic_house_patrol_damage_grade, dic_house_grade } }) => {
|
||||
this.codes = {
|
||||
houseInitGrade: dic_house_patrol_init_grade,
|
||||
houseDamageGrade: dic_house_patrol_damage_grade,
|
||||
houseGrade: dic_house_grade,
|
||||
};
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
189
Web/src/pages/business/house/info/form/patrol/handling.vue
Normal file
189
Web/src/pages/business/house/info/form/patrol/handling.vue
Normal file
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<!--
|
||||
整页表单的分片表单
|
||||
v 1.0
|
||||
2021-05-12
|
||||
Lufthafen
|
||||
-->
|
||||
<a-form-model
|
||||
:label-col="labelCol"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:wrapper-col="wrapperCol"
|
||||
ref="form"
|
||||
>
|
||||
<a-spin :spinning="loading">
|
||||
<a-icon slot="indicator" spin type="loading" />
|
||||
<!-- 表单控件 -->
|
||||
<!-- ... -->
|
||||
<a-row :gutter="16" type="flex">
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="处理建议" prop="patrolInfo.handlingOpinion">
|
||||
<a-radio-group button-style="solid" v-model="form.patrolInfo.handlingOpinion">
|
||||
<a-radio-button
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
v-for="item in codes.handlingOpinion"
|
||||
>{{ item.value }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item
|
||||
class="ant-row-flex"
|
||||
label="处理建议备注"
|
||||
prop="patrolInfo.handlingOpinionRemark"
|
||||
>
|
||||
<a-textarea
|
||||
:auto-size="{ minRows: 3 }"
|
||||
placeholder="请输入处理建议备注"
|
||||
v-model="form.patrolInfo.handlingOpinionRemark"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="整改情况" prop="patrolInfo.rectifyAndReform">
|
||||
<a-radio-group button-style="solid" v-model="form.patrolInfo.rectifyAndReform">
|
||||
<a-radio-button
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
v-for="item in codes.rectifyAndReform"
|
||||
>{{ item.value }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item
|
||||
class="ant-row-flex"
|
||||
label="整改情况备注"
|
||||
prop="patrolInfo.rectifyAndReformRemark"
|
||||
>
|
||||
<a-textarea
|
||||
:auto-size="{ minRows: 3 }"
|
||||
placeholder="请输入整改情况备注"
|
||||
v-model="form.patrolInfo.rectifyAndReformRemark"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-spin>
|
||||
</a-form-model>
|
||||
</template>
|
||||
<script>
|
||||
/* 表单内容默认值 */
|
||||
const defaultForm = {
|
||||
/* ... */
|
||||
patrolInfo: {
|
||||
handlingOpinion: '0',
|
||||
handlingOpinionRemark: null,
|
||||
rectifyAndReform: '1',
|
||||
rectifyAndReformRemark: null,
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
props: ['param'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
labelCol: { flex: '150px' },
|
||||
wrapperCol: { flex: '1' },
|
||||
|
||||
/** 表单数据 */
|
||||
form: {
|
||||
...defaultForm,
|
||||
},
|
||||
/** 验证格式 */
|
||||
rules: {
|
||||
/* ... */
|
||||
'patrolInfo.handlingOpinion': [{ required: true, message: '请选择处理建议' }],
|
||||
},
|
||||
|
||||
/** 加载异步数据状态 */
|
||||
loading: false,
|
||||
|
||||
/** 其他成员属性 */
|
||||
/* ... */
|
||||
codes: {
|
||||
handlingOpinion: [],
|
||||
rectifyAndReform: [],
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
async created() {
|
||||
this.onFillData();
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在打开编辑页时允许填充数据
|
||||
*/
|
||||
async onFillData() {
|
||||
this.loading = true;
|
||||
{
|
||||
await this.onLoadCodes();
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
const form = this.$_.cloneDeep(defaultForm);
|
||||
|
||||
if (record) {
|
||||
this.$_.giveDeep(form, record);
|
||||
}
|
||||
this.form = form;
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 验证表单并获取表单数据
|
||||
*/
|
||||
onGetData() {
|
||||
return new Promise((reslove, reject) => {
|
||||
this.$refs.form.validate((valid, err) => {
|
||||
if (valid) {
|
||||
const record = this.$_.cloneDeep(this.form);
|
||||
|
||||
/** 验证通过后可以对数据进行转换得到想要提交的格式 */
|
||||
/* ... */
|
||||
|
||||
reslove(record);
|
||||
} else {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口关闭或重置时对表单验证进行初始化
|
||||
*/
|
||||
onResetFields() {
|
||||
setTimeout(() => {
|
||||
this.$refs.form.resetFields();
|
||||
|
||||
/** 在这里可以初始化当前组件中其他属性 */
|
||||
/* ... */
|
||||
}, 300);
|
||||
},
|
||||
|
||||
/** 当前组件的其他方法 */
|
||||
/* ... */
|
||||
onLoadCodes() {
|
||||
return this.$api
|
||||
.sysDictTypeDropDowns({
|
||||
code: ['dic_house_patrol_handling_opinion', 'dic_house_patrol_rectify_Reform'],
|
||||
})
|
||||
.then(({ data: { dic_house_patrol_handling_opinion, dic_house_patrol_rectify_Reform } }) => {
|
||||
this.codes = {
|
||||
handlingOpinion: dic_house_patrol_handling_opinion,
|
||||
rectifyAndReform: dic_house_patrol_rectify_Reform,
|
||||
};
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -52,42 +52,22 @@ export default {
|
||||
title: '巡查基本情况',
|
||||
component: () => import('./base'),
|
||||
},
|
||||
// {
|
||||
// title: '权属情况',
|
||||
// component: () => import('./ownership'),
|
||||
// },
|
||||
// {
|
||||
// title: '管理情况',
|
||||
// component: () => import('./manager'),
|
||||
// },
|
||||
// {
|
||||
// title: '调查情况',
|
||||
// component: () => import('./investigation'),
|
||||
// },
|
||||
// {
|
||||
// title: '鉴定治理',
|
||||
// component: () => import('./identification'),
|
||||
// },
|
||||
// {
|
||||
// title: '图纸资料存档处',
|
||||
// component: () => import('./drawing'),
|
||||
// },
|
||||
// {
|
||||
// title: '相关附件资料',
|
||||
// component: () => import('./attachments'),
|
||||
// },
|
||||
// {
|
||||
// title: '物业维修资金',
|
||||
// component: () => import('./fund'),
|
||||
// },
|
||||
// {
|
||||
// title: '建筑概貌',
|
||||
// component: () => import('./aspect'),
|
||||
// },
|
||||
// {
|
||||
// title: '调查单位',
|
||||
// component: () => import('./unit'),
|
||||
// },
|
||||
{
|
||||
title: '房屋检查',
|
||||
component: () => import('./inspection'),
|
||||
},
|
||||
{
|
||||
title: '等级划分',
|
||||
component: () => import('./grade'),
|
||||
},
|
||||
{
|
||||
title: '处理情况',
|
||||
component: () => import('./handling'),
|
||||
},
|
||||
{
|
||||
title: '本期巡查结果',
|
||||
component: () => import('./result'),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
221
Web/src/pages/business/house/info/form/patrol/inspection.vue
Normal file
221
Web/src/pages/business/house/info/form/patrol/inspection.vue
Normal file
@@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<!--
|
||||
整页表单的分片表单
|
||||
v 1.0
|
||||
2021-05-12
|
||||
Lufthafen
|
||||
-->
|
||||
<a-form-model
|
||||
:label-col="labelCol"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:wrapper-col="wrapperCol"
|
||||
ref="form"
|
||||
>
|
||||
<a-spin :spinning="loading">
|
||||
<a-icon slot="indicator" spin type="loading" />
|
||||
<!-- 表单控件 -->
|
||||
<!-- ... -->
|
||||
<a-row :gutter="16" type="flex">
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="沉降倾斜情况" prop="patrolInfo.settlementTilt">
|
||||
<a-textarea
|
||||
:auto-size="{ minRows: 3 }"
|
||||
placeholder="请输入沉降倾斜情况"
|
||||
v-model="form.patrolInfo.settlementTilt"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item
|
||||
class="ant-row-flex"
|
||||
label="沉降倾斜情况照片"
|
||||
prop="patrolInfo.settlementTiltFiles"
|
||||
>
|
||||
<a-upload
|
||||
:custom-request="onFileUpload"
|
||||
:file-list="form.patrolInfo.settlementTiltFiles"
|
||||
:preview-file="onPreviewFile"
|
||||
@change="onFileChange"
|
||||
@preview="onFilePreview"
|
||||
list-type="picture-card"
|
||||
>
|
||||
<div>
|
||||
<a-icon type="plus" />
|
||||
<div class="ant-upload-text">沉降倾斜照片</div>
|
||||
</div>
|
||||
</a-upload>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="其他情况" prop="patrolInfo.otherInfo">
|
||||
<a-textarea
|
||||
:auto-size="{ minRows: 3 }"
|
||||
placeholder="请输入其他情况"
|
||||
v-model="form.patrolInfo.otherInfo"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="其他情况照片" prop="patrolInfo.otherInfoFiles">
|
||||
<a-upload
|
||||
:custom-request="onFileUpload"
|
||||
:file-list="form.patrolInfo.otherInfoFiles"
|
||||
:preview-file="onPreviewFile"
|
||||
@change="onFileChange"
|
||||
@preview="onFilePreview"
|
||||
list-type="picture-card"
|
||||
>
|
||||
<div>
|
||||
<a-icon type="plus" />
|
||||
<div class="ant-upload-text">其他情况照片</div>
|
||||
</div>
|
||||
</a-upload>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="主要安全隐患综述" prop="patrolInfo.MainSafety">
|
||||
<a-textarea
|
||||
:auto-size="{ minRows: 3 }"
|
||||
placeholder="请输入主要安全隐患综述"
|
||||
v-model="form.patrolInfo.MainSafety"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-spin>
|
||||
<PhotoSwipe ref="photo-swipe" />
|
||||
</a-form-model>
|
||||
</template>
|
||||
<script>
|
||||
import { PreviewFile, BlobToBase64 } from '@/util/file';
|
||||
|
||||
import PhotoSwipe from '@/components/photoSwipe';
|
||||
/* 表单内容默认值 */
|
||||
const defaultForm = {
|
||||
patrolInfo: {
|
||||
settlementTilt: null,
|
||||
settlementTiltFiles: [],
|
||||
otherInfo: null,
|
||||
otherInfoFiles: [],
|
||||
MainSafety: null,
|
||||
},
|
||||
};
|
||||
export default {
|
||||
components: {
|
||||
PhotoSwipe,
|
||||
},
|
||||
props: ['param'],
|
||||
data() {
|
||||
return {
|
||||
labelCol: { flex: '150px' },
|
||||
wrapperCol: { flex: '1' },
|
||||
form: {
|
||||
...defaultForm,
|
||||
},
|
||||
rules: {},
|
||||
/** 加载异步数据状态 */
|
||||
loading: false,
|
||||
|
||||
/** 其他成员属性 */
|
||||
codes: {},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async onFillData() {
|
||||
this.loading = true;
|
||||
{
|
||||
await this.onLoadCodes();
|
||||
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
const form = this.$_.cloneDeep(defaultForm);
|
||||
|
||||
if (record) {
|
||||
this.$_.giveDeep(form, record);
|
||||
}
|
||||
this.form = form;
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 验证表单并获取表单数据
|
||||
*/
|
||||
onGetData() {
|
||||
return new Promise((reslove, reject) => {
|
||||
this.$refs.form.validate((valid, err) => {
|
||||
if (valid) {
|
||||
const record = this.$_.cloneDeep(this.form);
|
||||
|
||||
/** 验证通过后可以对数据进行转换得到想要提交的格式 */
|
||||
/* ... */
|
||||
record.facadePhoto = record.facadePhoto.map((p) => p.response).join(',');
|
||||
|
||||
reslove(record);
|
||||
} else {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口关闭或重置时对表单验证进行初始化
|
||||
*/
|
||||
onResetFields() {
|
||||
setTimeout(() => {
|
||||
this.$refs.form.resetFields();
|
||||
|
||||
/** 在这里可以初始化当前组件中其他属性 */
|
||||
/* ... */
|
||||
}, 300);
|
||||
},
|
||||
|
||||
/** 当前组件的其他方法 */
|
||||
/* ... */
|
||||
|
||||
/* 上传图片相关 Begin */
|
||||
onFileChange({ fileList }) {
|
||||
this.form.patrolInfo.settlementTiltFiles = fileList;
|
||||
},
|
||||
onPreviewFile(file) {
|
||||
return new Promise((resolve) => {
|
||||
const base64 = BlobToBase64(file);
|
||||
resolve(base64);
|
||||
});
|
||||
},
|
||||
async onFileUpload({ file, onProgress, onSuccess, onError }) {
|
||||
onProgress();
|
||||
const fd = new FormData();
|
||||
fd.append('file', file);
|
||||
try {
|
||||
const { data: fileId } = await this.$api.sysFileInfoUpload(fd);
|
||||
onSuccess(fileId);
|
||||
} catch {
|
||||
onError();
|
||||
}
|
||||
},
|
||||
onFilePreview(file) {
|
||||
const items = [];
|
||||
for (let i = 0; i < this.form.patrolInfo.settlementTiltFiles.length; i++) {
|
||||
const _file = this.form.patrolInfo.settlementTiltFiles[i];
|
||||
const img = new Image();
|
||||
const src = _file.url || _file.thumbUrl;
|
||||
img.src = src;
|
||||
items.push({
|
||||
src,
|
||||
w: img.naturalWidth,
|
||||
h: img.naturalHeight,
|
||||
});
|
||||
}
|
||||
this.$refs['photo-swipe'].initPhotoSwipe(items, {
|
||||
index: this.form.patrolInfo.settlementTiltFiles.indexOf(file),
|
||||
});
|
||||
},
|
||||
/* 上传图片相关 End */
|
||||
},
|
||||
};
|
||||
</script>
|
||||
142
Web/src/pages/business/house/info/form/patrol/result.vue
Normal file
142
Web/src/pages/business/house/info/form/patrol/result.vue
Normal file
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<!--
|
||||
整页表单的分片表单
|
||||
v 1.0
|
||||
2021-05-12
|
||||
Lufthafen
|
||||
-->
|
||||
<a-form-model
|
||||
:label-col="labelCol"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:wrapper-col="wrapperCol"
|
||||
ref="form"
|
||||
>
|
||||
<a-spin :spinning="loading">
|
||||
<a-icon slot="indicator" spin type="loading" />
|
||||
<!-- 表单控件 -->
|
||||
<!-- ... -->
|
||||
<a-row :gutter="16" type="flex">
|
||||
<a-col :span="24">
|
||||
<a-form-model-item class="ant-row-flex" label="正常与否" prop="patrolInfo.patrolResult">
|
||||
<a-radio-group button-style="solid" v-model="form.patrolInfo.patrolResult">
|
||||
<a-radio-button value="0">正常</a-radio-button>
|
||||
<a-radio-button value="-1">异常</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-model-item
|
||||
class="ant-row-flex"
|
||||
label="异常情况描述"
|
||||
prop="patrolInfo.patrolResultRemark"
|
||||
>
|
||||
<a-textarea
|
||||
:auto-size="{ minRows: 3 }"
|
||||
placeholder="请输入异常情况描述"
|
||||
v-model="form.patrolInfo.patrolResultRemark"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-spin>
|
||||
</a-form-model>
|
||||
</template>
|
||||
<script>
|
||||
/* 表单内容默认值 */
|
||||
const defaultForm = {
|
||||
/* ... */
|
||||
patrolInfo: {
|
||||
patrolResult: '0',
|
||||
patrolResultRemark: null,
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
props: ['param'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
labelCol: { flex: '150px' },
|
||||
wrapperCol: { flex: '1' },
|
||||
|
||||
/** 表单数据 */
|
||||
form: {
|
||||
...defaultForm,
|
||||
},
|
||||
/** 验证格式 */
|
||||
rules: {
|
||||
/* ... */
|
||||
'patrolInfo.patrolResult': [{ required: true, message: '请选择本期巡查结果' }],
|
||||
},
|
||||
|
||||
/** 加载异步数据状态 */
|
||||
loading: false,
|
||||
|
||||
/** 其他成员属性 */
|
||||
/* ... */
|
||||
codes: {},
|
||||
};
|
||||
},
|
||||
|
||||
async created() {
|
||||
this.onFillData();
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在打开编辑页时允许填充数据
|
||||
*/
|
||||
async onFillData() {
|
||||
this.loading = true;
|
||||
{
|
||||
// await this.onLoadCodes();
|
||||
/** 将默认数据覆盖到form */
|
||||
const record = this.param && this.param.record;
|
||||
const form = this.$_.cloneDeep(defaultForm);
|
||||
|
||||
if (record) {
|
||||
this.$_.giveDeep(form, record);
|
||||
}
|
||||
this.form = form;
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要方法
|
||||
* 验证表单并获取表单数据
|
||||
*/
|
||||
onGetData() {
|
||||
return new Promise((reslove, reject) => {
|
||||
this.$refs.form.validate((valid, err) => {
|
||||
if (valid) {
|
||||
const record = this.$_.cloneDeep(this.form);
|
||||
|
||||
/** 验证通过后可以对数据进行转换得到想要提交的格式 */
|
||||
/* ... */
|
||||
|
||||
reslove(record);
|
||||
} else {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 必要的方法
|
||||
* 在外部窗口关闭或重置时对表单验证进行初始化
|
||||
*/
|
||||
onResetFields() {
|
||||
setTimeout(() => {
|
||||
this.$refs.form.resetFields();
|
||||
|
||||
/** 在这里可以初始化当前组件中其他属性 */
|
||||
/* ... */
|
||||
}, 300);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user