xy 2 years ago
parent db4587c4ae
commit 477bb55874

@ -4,10 +4,10 @@ NODE_ENV = production
ENV = 'staging' ENV = 'staging'
# base api # base api
VUE_APP_BASE_API=http://wuxiwuye.ali251.langye.net/ #VUE_APP_BASE_API=http://wuxiwuye.ali251.langye.net/
VUE_APP_UPLOAD_API=http://wuxiwuye.ali251.langye.net/api/admin/upload-file #VUE_APP_UPLOAD_API=http://wuxiwuye.ali251.langye.net/api/admin/upload-file
VUE_APP_PREVIEW=//view.langye.net:8012/onlinePreview #VUE_APP_PREVIEW=//view.langye.net:8012/onlinePreview
# base api # base api
#VUE_APP_BASE_API=http://192.168.221.31:9001/ VUE_APP_BASE_API=http://192.168.221.31:9001/
#VUE_APP_UPLOAD_API=http://192.168.221.31:9001/api/admin/upload-file VUE_APP_UPLOAD_API=http://192.168.221.31:9001/api/admin/upload-file
#VUE_APP_PREVIEW=http://192.168.221.31:8012/onlinePreview VUE_APP_PREVIEW=http://192.168.221.31:8012/onlinePreview

@ -27,8 +27,8 @@ export default {
if(!newVal) return if(!newVal) return
let info = { let info = {
...newVal, ...newVal,
latitude: newVal.latitude, latitude: newVal.location?.lat || newVal.latitude,
longitude: newVal.longitude, longitude: newVal.location?.lng || newVal.longitude,
} }
let res = '' let res = ''
if(typeof this.resultFormat === 'string') { if(typeof this.resultFormat === 'string') {

@ -146,6 +146,7 @@ export class CreateDialog {
: "编辑", : "编辑",
visible: that.dialogVisible, visible: that.dialogVisible,
width: this.options?.width ? this.options.width : "800px", width: this.options?.width ? this.options.width : "800px",
"close-on-click-modal": false
}, },
on: { on: {
"update:visible": (val) => { "update:visible": (val) => {

@ -40,6 +40,12 @@ export default {
table_name: "houses", table_name: "houses",
}, },
tableItem: [ tableItem: [
{
type: "selection",
reserveSelection: true,
fixed: "left",
width: 56
},
{ {
label: "名称", label: "名称",
prop: "name", prop: "name",
@ -89,31 +95,41 @@ export default {
["loaded"]: (_) => { ["loaded"]: (_) => {
this.setCurrentRow(); this.setCurrentRow();
}, },
["row-click"]: ({ row }) => { ["select"]: (selection, row) => {
if (row.land_id && row.land_id !== this.id) { if (row.land_id && row.land_id !== this.id) {
this.$message({ this.$message({
type: "warning", type: "warning",
message: "当前房产已有绑定土地", message: "当前房产已有绑定土地",
}); });
this.$refs["houseTable"].setCurrentRow(); this.$refs["houseTable"].toggleRowSelection(row, false);
return; return;
} }
this.form["ruzhangshijian"] = row.ruzhangshijian;
this.form["zhangmianyuanzhi"] = row.zhangmianyuanzhi;
this.pickHouseRow = deepCopy(row);
delete this.pickHouseRow.id_his_evolutions_house_id_relation;
let copyRow = deepCopy(row);
delete copyRow.id;
copyRow.land_id = this.id;
this.form["id_house_properties_land_id_relation"] = [
Object.assign(
this.originalForm?.id_house_properties_land_id_relation
? this.originalForm.id_house_properties_land_id_relation
: {},
copyRow
),
];
}, },
// ["row-click"]: ({ row }) => {
// if (row.land_id && row.land_id !== this.id) {
// this.$message({
// type: "warning",
// message: "",
// });
// this.$refs["houseTable"].setCurrentRow();
// return;
// }
// this.form["ruzhangshijian"] = row.ruzhangshijian;
// this.form["zhangmianyuanzhi"] = row.zhangmianyuanzhi;
// this.pickHouseRow = deepCopy(row);
// delete this.pickHouseRow.id_his_evolutions_house_id_relation;
// let copyRow = deepCopy(row);
// delete copyRow.id;
// copyRow.land_id = this.id;
// this.form["id_house_properties_land_id_relation"] = [
// Object.assign(
// this.originalForm?.id_house_properties_land_id_relation
// ? this.originalForm.id_house_properties_land_id_relation
// : {},
// copyRow
// ),
// ];
// },
}, },
}), }),
}, },

@ -343,12 +343,12 @@
<atlas ref="atlas"></atlas> <atlas ref="atlas"></atlas>
<files ref="files"></files> <files ref="files"></files>
<addHandle ref="addHandle"></addHandle> <addHandle ref="addHandle"></addHandle>
<!-- <imports--> <imports
<!-- :table-name="customForm.tableName"--> :table-name="customForm.tableName"
<!-- :form-info="form"--> :form-info="form"
<!-- ref="imports"--> ref="imports"
<!-- @refresh="$refs['xyTable'].getTableData()"--> @refresh="$refs['xyTable'].getTableData()"
<!-- ></imports>--> ></imports>
<!-- <atlas ref="atlas"></atlas>--> <!-- <atlas ref="atlas"></atlas>-->
<!-- <assetsHistoryList ref="assetsHistoryList"></assetsHistoryList>--> <!-- <assetsHistoryList ref="assetsHistoryList"></assetsHistoryList>-->
</div> </div>
@ -376,7 +376,7 @@ import history from '@/views/assets/history.vue'
import files from "@/views/assets/files.vue"; import files from "@/views/assets/files.vue";
import addHandle from '@/views/assets/component/addHandle.vue' import addHandle from '@/views/assets/component/addHandle.vue'
// import drawer from "@/views/component/drawer.vue"; // import drawer from "@/views/component/drawer.vue";
// import imports from "./imports.vue"; import imports from "@/views/component/imports.vue";
// import atlas from "@/views/assets/atlas.vue"; // import atlas from "@/views/assets/atlas.vue";
// import assetsHistoryList from '@/views/assets/assetsHistoryList.vue' // import assetsHistoryList from '@/views/assets/assetsHistoryList.vue'
export default { export default {
@ -391,7 +391,7 @@ export default {
files, files,
addHandle, addHandle,
// drawer, // drawer,
// imports, imports,
// atlas, // atlas,
// assetsHistoryList // assetsHistoryList
@ -753,7 +753,7 @@ export default {
} }
}); });
this.table.unshift({ this.table.unshift({
type: "index", prop: "id",
width: 60, width: 60,
label: "序号", label: "序号",
}); });

@ -741,7 +741,7 @@ export default {
} }
}); });
this.table.unshift({ this.table.unshift({
type: "index", prop: "id",
width: 60, width: 60,
label: "序号", label: "序号",
}); });

@ -179,7 +179,7 @@
安全检查 安全检查
</div> </div>
<xy-table :is-page="false" :height="300" :list="/\/land/g.test(this.$route.path) ? detail.id_asset_safety_inspections_land_id_relation : detail.id_asset_safety_inspections_house_id_relation" :table-item="inspectionTable" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" ></xy-table> <xy-table :is-page="false" :height="300" :list="inspections" :table-item="inspectionTable" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" ></xy-table>
</el-card> </el-card>
<el-card id="detail-contract"> <el-card id="detail-contract">
@ -195,7 +195,7 @@
维修保养 维修保养
</div> </div>
<xy-table :is-page="false" :height="300" :list="/\/land/g.test(this.$route.path) ? detail.id_asset_safety_keeps_land_id_relation : detail.id_asset_safety_keeps_house_id_relation" :table-item="keepTable" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" ></xy-table> <xy-table :is-page="false" :height="300" :list="keeps" :table-item="keepTable" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" ></xy-table>
</el-card> </el-card>
<el-card id="detail-files"> <el-card id="detail-files">
@ -288,7 +288,7 @@
<el-card v-show="isShowSearch" class="search-container"> <el-card v-show="isShowSearch" class="search-container">
<template #header> <template #header>
<div style="display:flex;align-items: center;"> <div style="display:flex;align-items: center;">
<p>搜索</p> <p>搜索附件</p>
<i class="el-icon-close" style="margin-left: auto;" @click="isShowSearch = false"></i> <i class="el-icon-close" style="margin-left: auto;" @click="isShowSearch = false"></i>
</div> </div>
@ -304,13 +304,13 @@
</el-input> </el-input>
<ul class="search-file-list"> <ul class="search-file-list">
<li v-for="(item, index) in searchFiles" :key="item.id"> <li v-for="(item, index) in myFiles" :key="item.id">
<div style="display: flex;justify-content: space-between;align-items: center;"> <div style="display: flex;justify-content: space-between;align-items: center;">
<a style="flex-basis: 50%;" :download="item.url">{{index+1}}.{{ item.original_name }}</a> <a style="flex-basis: 50%;" :download="item.url">{{index+1}}.{{ item.original_name }}</a>
<p style="flex-basis: 25%;flex-shrink: 0;"> <!-- <p style="flex-basis: 25%;flex-shrink: 0;">-->
{{ item.land.name ? `[土地]${item.land.name}` : `[房产]${item.house.name}` }} <!-- {{ item.land.name ? `[土地]${item.land.name}` : `[房产]${item.house.name}` }}-->
</p> <!-- </p>-->
<div> <div>
<el-button <el-button
@ -365,6 +365,8 @@ export default {
}, },
histories: [], histories: [],
inspections: [],
keeps: [],
units: new Map([ units: new Map([
["dengjimianji", "m²"], ["dengjimianji", "m²"],
["shijimianji", "m²"], ["shijimianji", "m²"],
@ -483,6 +485,8 @@ export default {
searchKeyword: "", searchKeyword: "",
searchFiles: [], searchFiles: [],
searchFileTotal: 0, searchFileTotal: 0,
myFiles: [],
}; };
}, },
methods: { methods: {
@ -629,6 +633,10 @@ export default {
}); });
this.detail = detail; this.detail = detail;
this.init(); this.init();
this.myFiles.push(...detail.id_asset_file_files_land_id_relation);
this.myFiles.push(...detail.id_asset_picture_files_land_id_relation);
this.myFiles.push(...detail.id_assets_atlas_files_land_id_relation);
}, },
@ -647,6 +655,50 @@ export default {
] ]
}) })
this.histories = res.data; this.histories = res.data;
res.data.forEach(i => {
this.myFiles.push(...i.tupian_detail)
})
},
async getKeeps () {
const res = await index({
table_name: 'asset_safety_keeps',
page: 1,
page_size: 999,
filter:[
{
key: /\/land/g.test(this.$route.path) ? 'land_id' : 'house_id',
op: 'eq',
value: this.$route.params.id
}
]
})
this.keeps = res.data;
res.data.forEach(i => {
this.myFiles.push(...i.fujian_detail)
})
},
async getInspections () {
const res = await index({
table_name: 'asset_safety_inspections',
page: 1,
page_size: 999,
filter:[
{
key: /\/land/g.test(this.$route.path) ? 'land_id' : 'house_id',
op: 'eq',
value: this.$route.params.id
}
]
})
this.inspections = res.data;
res.data.forEach(i => {
this.myFiles.push(...i.fujian_detail)
})
}, },
print () { print () {
@ -749,6 +801,8 @@ export default {
created() { created() {
this.getFields().then(res => { this.getFields().then(res => {
this.getHistories() this.getHistories()
this.getKeeps()
this.getInspections()
}) })
}, },
}; };

@ -458,24 +458,28 @@ export default {
this.formInfo.forEach((i) => { this.formInfo.forEach((i) => {
if (i && (i.edit_input === "file" || i.edit_input === "files")) { if (i && (i.edit_input === "file" || i.edit_input === "files")) {
res[i._relations.link_with_name] if (i._relations && i._relations.link_with_name) {
? (this.file[i.field] = res[i._relations.link_with_name]
res[i._relations.link_with_name] instanceof Array ? (this.file[i.field] =
? res[i._relations.link_with_name].map((i) => { res[i._relations.link_with_name] instanceof Array
return { ? res[i._relations.link_with_name].map((i) => {
name: i?.original_name, return {
url: i?.url, name: i?.original_name,
response: i, url: i?.url,
}; response: i,
}) };
: [ })
{ : [
name: res[i._relations.link_with_name]?.original_name, {
url: res[i._relations.link_with_name]?.url, name: res[i._relations.link_with_name]?.original_name,
response: res[i._relations.link_with_name], url: res[i._relations.link_with_name]?.url,
}, response: res[i._relations.link_with_name],
]) },
: (this.file[i.field] = []); ])
: (this.file[i.field] =[]);
} else {
this.file[i.field] = res[`${i.field}_upload_details`]
}
return return
} }
@ -529,22 +533,16 @@ export default {
info._relations?.link_relation === "newHasMany" || info._relations?.link_relation === "newHasMany" ||
info._relations?.link_relation === "hasMany" info._relations?.link_relation === "hasMany"
) { ) {
if (info.edit_input === "files") { copyForm[info._relations.link_with_name] = copyForm[
copyForm[info.field] = this.file[ info.field
info.field ] instanceof Array ? copyForm[
]?.map((i) => i?.response?.id); info.field
} else { ]?.map((i) => {
copyForm[info._relations.link_with_name] = copyForm[ return {
info.field [info._relations.custom_form_field]: i,
] instanceof Array ? copyForm[ //...copyRelation,
info.field };
]?.map((i) => { }) : '';
return {
[info._relations.custom_form_field]: i,
//...copyRelation,
};
}) : '';
}
delete copyForm[info.field]; delete copyForm[info.field];
} }
@ -579,6 +577,11 @@ export default {
if (!copyForm[info._relations?.link_with_name]) { if (!copyForm[info._relations?.link_with_name]) {
delete copyForm[info._relations?.link_with_name]; delete copyForm[info._relations?.link_with_name];
} }
if (info.edit_input === "files") {
copyForm[info.field] = this.file[
info.field
]?.map((i) => i?.response?.id);
}
// if (info._relations?.link_with_name) { // if (info._relations?.link_with_name) {
// if (info.edit_input === "files" || info.edit_input === "file") { // if (info.edit_input === "files" || info.edit_input === "file") {
// this.form[info._relations.link_with_name] = this.file[info.field].map(i => i?.response); // this.form[info._relations.link_with_name] = this.file[info.field].map(i => i?.response);

@ -598,7 +598,7 @@ export default {
); );
}); });
this.table.unshift({ this.table.unshift({
type: "index", prop: "id",
width: 60, width: 60,
label: "序号", label: "序号",
}); });

Loading…
Cancel
Save