Browse Source

修改土地模块逻辑

develop
王健 4 years ago
parent
commit
2c8a5b649d
  1. 10
      src/views/land/api/noLand.js
  2. 170
      src/views/land/handLand/newLand.vue
  3. 133
      src/views/land/noneHandLand/newLand.vue

10
src/views/land/api/noLand.js

@ -10,10 +10,10 @@ export function fetchNoHandLandList(query) {
}
// 保存、编辑地块
export function saveNoHandLandList(param) {
export function saveNoHandLandList(param, type) {
return request({
url: '/api/landtolist',
method: 'post',
method: type,
headers: {
'Content-Type': 'application/json'
},
@ -91,7 +91,7 @@ export function conductenterList(data) {
return request({
url: '/api/landtolistconductenterprise/page',
method: 'get',
params:data
params: data
})
}
// 通过公告序号经营配件列表查询
@ -99,7 +99,7 @@ export function constructionPlanList(data) {
return request({
url: '/api/landtolistconstructionplan/page',
method: 'get',
params:data
params: data
})
}
// 新增已挂牌地块经纬度
@ -268,6 +268,6 @@ export function allFileUpload(data) {
return request({
url: '/api/landToListAttachment',
method: 'post',
data:data
data: data
})
}

170
src/views/land/handLand/newLand.vue

@ -173,7 +173,7 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商务面积占比(%):">
<el-form-item label="商业商务占比(%):">
<el-input
readonly
v-model="editForm.bizCommerceRate"
@ -1841,12 +1841,10 @@ export default {
newObj[col.prop] = "";
}
this.editForm = newObj;
// console.log(this.$route);
if (this.$route.query.readOnly === "true") {
this.readOnly = true;
let row = this.$route.query.data;
this.onlyId = row;
// this.editForm = row;
queryHandLandObj(row).then((res) => {
this.editForm = res.data.data;
});
@ -1876,14 +1874,10 @@ export default {
return txt;
},
calculate() {
if (
this.editForm.bizSpace &&
this.editForm.commerceSpace &&
this.editForm.commerceSpace != 0
) {
this.editForm.bizCommerceRate = parseFloat(
this.editForm.bizSpace / this.editForm.commerceSpace
);
if (this.editForm.totalConsArea && this.editForm.totalConsArea != 0) {
this.editForm.bizCommerceRate =
((this.editForm.bizSpace + this.editForm.commerceSpace) /
this.editForm.totalConsArea*100).toFixed(2)
}
},
getList(page, params) {
@ -1977,115 +1971,6 @@ export default {
});
},
//
handleSelectionChange(val) {
this.selectedData = val;
},
//
viewItem(row) {
this.dialogTitle = "查看数据";
this.readOnly = true;
this.dialogFormVisible = true;
this.editForm = row;
},
//
editItem(row) {
this.dialogTitle = "编辑数据";
this.readOnly = false;
this.dialogFormVisible = true;
this.editForm = row;
this.onlyId = row.landListedId;
this.queryLonLatList(row.landListedId);
this.queryRecordList(row.landListedId);
this.conductenterList(row.landListedId);
this.getPlanList(row.landListedId);
this.queryFileList(row.landListedId);
},
//
delItem(row) {
let me = this;
let ids = [row.landListedId];
this.$confirm("确认删除?", "系统提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
cancelButtonClass: "btn-custom-cancel",
type: "warning",
})
.then(function () {
delHandLandObj(ids).then((res) => {
if (res.data.success) {
me.$message("删除成功");
me.onSubmit();
} else {
me.$message("删除失败");
}
});
})
.catch(function () {});
},
//
multiDelete() {
if (this.selectedData.length < 1) {
this.$message({
message: "未选中数据",
type: "warning",
});
return;
}
let ids = [];
for (let item of this.selectedData) {
ids.push(item["landListedId"]);
}
multiDeteleList(ids).then((res) => {
if (res.data.success) {
this.$message({
type: "success",
message: "删除成功",
});
this.onSubmit();
} else {
this.$message("删除失败");
}
});
},
//
newItem() {
this.$router.push("/land/handLand/newLand");
// cols
let newObj = {};
for (let col of this.cols) {
newObj[col.prop] = "";
}
this.editForm = newObj;
this.readOnly = false;
this.dialogFormVisible = true;
},
//
downloadTemplate() {
downloadHandLandTemplate().then((res) => {
let url = res.data.data;
downUrlFile(url);
});
},
handleSizeChange(val) {
this.page.pageSize = val;
},
handleCurrentChange(val) {
this.page.currentPage = val;
},
//
clearSelection() {
this.$refs.multipleTable.clearSelection();
},
//
queryLonLatList(landListedId) {
queryLonLatList(landListedId).then((response) => {
@ -2519,7 +2404,7 @@ export default {
//
queryFileList(landListedId) {
// let landListedId = this.editForm.landListedId;
// let landListedId = this.editForm.landListedId;
if (landListedId == undefined) {
return;
}
@ -2643,21 +2528,6 @@ export default {
formData.append("uploadFile", file);
importLonLat(formData).then((res) => {
if (res.data.success) {
// let data=res.data.data;
// data.forEach((item) => {
// item.landListedId=this.onlyId;
// });
// saveLandMulti(data).then(res=>{
// if (res.data.success){
// this.queryRecordList(this.onlyId);
// this.$message({
// type: 'success',
// message: ''
// });
// }else {
// this.$message.error("");
// }
// })
this.queryLonLatList(this.onlyId);
return false;
} else {
@ -2669,18 +2539,18 @@ export default {
},
//
save() {
if (!this.editForm.landCode) {
this.$message.error("请输入地块编号");
return;
}
if (!this.editForm.annoId) {
this.$message.error("请输入公告序号");
return;
}
if (!this.editForm.landPosition) {
this.$message.error("请输入地块位置");
return;
}
// if (!this.editForm.landCode) {
// this.$message.error("");
// return;
// }
// if (!this.editForm.annoId) {
// this.$message.error("");
// return;
// }
// if (!this.editForm.landPosition) {
// this.$message.error("");
// return;
// }
let type = "";
this.$route.query.isEditOr === "true" ? (type = "put") : (type = "post");
saveHandLandList(JSON.stringify(this.editForm), type).then((res) => {
@ -2689,10 +2559,6 @@ export default {
type: "success",
message: "保存成功",
});
this.onlyId = res.data.data;
// window.history.back()
// this.dialogFormVisible = false;
// this.onSubmit();
} else {
this.$message.error("保存失败");
}

133
src/views/land/noneHandLand/newLand.vue

@ -520,7 +520,6 @@
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="大组团:">
<el-select
@ -555,7 +554,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="6">
<el-form-item label="奥维定位:">
<el-select
v-model="editForm.ovePosition"
@ -581,7 +580,7 @@
<el-row>
<el-col :span="8"> </el-col>
<el-col :span="8"> </el-col>
<el-col :span="8" style="text-align: right;">
<el-col :span="8" style="text-align: right">
<el-button v-show="!readOnly" @click="save" type="primary"
>保存</el-button
>
@ -809,7 +808,7 @@
<el-input v-model="editForm.partner"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="6">
<el-form-item label="经营企业:">
<el-input v-model="editForm.conductEnterprise"></el-input>
</el-form-item>
@ -1741,14 +1740,12 @@ export default {
return txt;
},
calculate() {
if (
this.editForm.bizSpace &&
this.editForm.commerceSpace &&
this.editForm.commerceSpace != 0
) {
this.editForm.bizCommerceRate = parseFloat(
this.editForm.bizSpace / this.editForm.commerceSpace
);
if (this.editForm.totalConsArea && this.editForm.totalConsArea != 0) {
this.editForm.bizCommerceRate = (
((this.editForm.bizSpace + this.editForm.commerceSpace) /
this.editForm.totalConsArea) *
100
).toFixed(2);
}
},
getList(page, params) {
@ -1842,99 +1839,29 @@ export default {
this.selectedData = val;
},
//
viewItem(row) {
let data = JSON.stringify(row);
this.$router.push({
path: "/land/noneHandLand/newLand",
query: { readOnly: "true", isEditOr: "false", data: data },
});
// this.dialogTitle = "";
// this.readOnly = true;
// this.dialogFormVisible = true;
// this.editForm = row;
},
//
editItem(row) {
let data = JSON.stringify(row);
this.$router.push({
path: "/land/noneHandLand/newLand",
query: { readOnly: "false", isEditOr: "true", data: data },
});
// this.dialogTitle = "";
// this.readOnly = false;
// this.dialogFormVisible = true;
// this.editForm = row;
// this.onlyId = row.proposedseriaId;
// this.queryLonLatList(row.proposedseriaId);
// this.queryFileList();
},
//
delItem(row) {
let me = this;
let ids = [row.proposedseriaId];
this.$confirm("确认删除?", "系统提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
cancelButtonClass: "btn-custom-cancel",
type: "warning",
})
.then(function () {
delNoHandLandObj(ids).then((res) => {
if (res.data.success) {
me.$message("删除成功");
me.onSubmit();
} else {
me.$message("删除失败");
}
});
})
.catch(function () {});
},
//
newItem() {
this.$router.push({
path: "/land/noneHandLand/newLand",
query: { readOnly: "false", isEditOr: "false" },
});
// cols
// let newObj = {};
// for (let col of this.cols) {
// newObj[col.prop] = "";
// }
// this.editForm = newObj;
// this.readOnly = false;
// this.dialogFormVisible = true;
},
//
save() {
if (!this.editForm.landCode) {
this.$message.error("请输入地块编号");
return;
}
if (!this.editForm.annoId) {
this.$message.error("请输入公告序号");
return;
}
if (!this.editForm.landPosition) {
this.$message.error("请输入地块位置");
return;
}
if (!this.editForm.proposedseriaId) {
this.$message.error("请输入拟出让序号");
return;
}
saveNoHandLandList(JSON.stringify(this.editForm)).then((res) => {
// if (!this.editForm.landCode) {
// this.$message.error("");
// return;
// }
// if (!this.editForm.annoId) {
// this.$message.error("");
// return;
// }
// if (!this.editForm.landPosition) {
// this.$message.error("");
// return;
// }
// if (!this.editForm.proposedseriaId) {
// this.$message.error("");
// return;
// }
let type = "";
this.$route.query.isEditOr === "true" ? (type = "put") : (type = "post");
saveNoHandLandList(JSON.stringify(this.editForm), type).then((res) => {
if (res.data.success) {
this.$message("保存成功");
this.onlyId = res.data.data;
// window.history.back()
// this.dialogFormVisible = false;
// this.onSubmit();
this.$message.success("保存成功");
} else {
this.$message.error("保存失败");
}
@ -2255,7 +2182,7 @@ export default {
//
queryFileList(proposedseriaId) {
// let proposedseriaId = this.editForm.proposedseriaId;
// let proposedseriaId = this.editForm.proposedseriaId;
if (proposedseriaId == undefined) {
return;
}

Loading…
Cancel
Save