a5a6fcca by 杨威
2 parents 07d85266 e3520832
import request from '@/plugin/axios'
/**
* 保存面积分摊表
* @param data
* @constructor
*/
export function savemjft(data) {
return request({
url: '/zd/qjGygyzdmjft/insertQjGygyzdmjft',
method: 'post',
data: data,
})
}
......@@ -78,12 +78,6 @@ const constantRoutes = [
component: () => import("@/views/basic/h/index"),
},
{
path: "/mjft",
name: "面积分摊",
code: "1-4",
component: () => import("@/views/basic/mjft/index"),
},
{
path: "/zd",
name: "宗地",
code: "1-5",
......
......@@ -108,7 +108,7 @@ export default {
{
path:'/zd',
name:'宗地'
},
}
],
// 上导航选中id
indId: undefined,
......
<template>
<div class="main">
<table border="1">
<tr>
<td colspan="2">土地面积</td>
<td colspan="3"><input type="text" class="formInput" v-model="mjftData.tdmj"/></td>
</tr>
<tr>
<td colspan="2">宗地代码</td>
<td colspan="3"><input type="text" class="formInput" v-model="mjftData.zdbsm "/></td>
</tr>
<tr>
<td colspan="2">宗地面积(㎡)</td>
<td><input type="text" class="formInput" v-model="mjftData.zjmj"/></td>
<td>定着物数量</td>
<td><input type="text" class="formInput" v-model="mjftData.dzwsl"/></td>
</tr>
<tr>
<td colspan="2">备注</td>
<td colspan="3"><input type="text" class="formInput" v-model="mjftData.bz"/></td>
</tr>
</table>
<table border="1">
<tr>
<td @click="addRow">+</td>
<td>定着物代码</td>
<td>土地所有权/使用权面积(㎡)</td>
<td>独有独用土地面积(㎡)</td>
<td>分摊土地面积(㎡)</td>
</tr>
<tr v-for="(item,i) in mjftData.addQjZdftdzwRequestList">
<td @click="delRow(i)">-</td>
<td><input type="text" class="formInput" v-model="item.dzwdm"/></td>
<td><input type="number" class="formInput" v-model="item.tdsyqsyqmj"/></td>
<td><input type="text" class="formInput" v-model="item.dydytdmj"/></td>
<td><input type="text" class="formInput" v-model="item.fttdmj"/></td>
</tr>
<tr>
<td></td>
<td>统计</td>
<td>{{sumTdsyqsyqmj}}</td>
<td>{{sumDydytdmj}}</td>
<td>{{sumFttdmj}}</td>
</tr>
</table>
</div>
</template>
<script>
export default {
name: "index",
data() {
return {
mjftData: {
zdbsm: '',
tdsyqsyqmjhj: '',
fttdmjhj: '',
dzwdys: '',
dydytdmjhj: '',
bz: '',
tdmj: '',
zjmj: '',
dzwsl: '',
addQjZdftdzwRequestList: [
{
dydytdmj: '',
dzwdm: '',
fttdmj: '',
gygyzdmjftbsm: '',
tdsyqsyqmj: ''
}
]
}
}
},
created: {},
methods: {
addRow() {
this.mjftData.addQjZdftdzwRequestList.push({
dydytdmj: '',
dzwdm: '',
fttdmj: '',
gygyzdmjftbsm: '',
tdsyqsyqmj: ''
})
},
delRow(index) {
this.mjftData.addQjZdftdzwRequestList.splice(index, 1)
}
},
computed: {
sumTdsyqsyqmj: function () {
let sum = 0;
let data = this.mjftData.addQjZdftdzwRequestList;
for (let i = 0; i < data.length; i++) {
if (isNaN(parseFloat(data[i].tdsyqsyqmj))) {
continue;
}
sum += parseFloat(data[i].tdsyqsyqmj)
}
return isNaN(sum) ? '' : sum;
},
sumDydytdmj: function () {
let sum = 0;
let data = this.mjftData.addQjZdftdzwRequestList;
for (let i = 0; i < data.length; i++) {
if (isNaN(parseFloat(data[i].dydytdmj))) {
continue;
}
sum += parseFloat(data[i].dydytdmj)
}
return isNaN(sum) ? '' : sum;
},
sumFttdmj: function () {
let sum = 0;
let data = this.mjftData.addQjZdftdzwRequestList;
for (let i = 0; i < data.length; i++) {
if (isNaN(parseFloat(data[i].fttdmj))) {
continue;
}
sum += parseFloat(data[i].fttdmj)
}
return isNaN(sum) ? '' : sum;
}
},
mounted() {
}
}
</script>
<style scoped>
.main {
box-sizing: border-box;
padding: 18px;
height: auto;
width: 80%;
}
table {
margin-top: 10px;
background-color: #fff;
font-size: 14px;
width: 100%;
}
td {
text-align: center;
height: 36px;
}
table .formInput {
margin: 0;
height: 36px;
outline: none;
border: none;
color: #606764;
overflow: visible;
text-align: center;
cursor: text;
}
</style>
<template>
<div class="">面积分摊表</div>
<div class="main">
<table border="1">
<tr>
<td colspan="2">土地坐落</td>
<td colspan="3"><input type="text" class="formInput" v-model="mjftData.tdzl" disabled/></td>
</tr>
<tr>
<td colspan="2">宗地代码</td>
<td colspan="3"><input type="text" class="formInput" v-model="mjftData.zdbsm " disabled/></td>
</tr>
<tr>
<td colspan="2">宗地面积(㎡)</td>
<td><input type="number" class="formInput" v-model.number="mjftData.zdmj" disabled/></td>
<td>定着物数量</td>
<td class="dzwsl">{{dzwdsl}}</td>
</tr>
<tr>
<td colspan="2">备注</td>
<td colspan="3"><input type="text" class="formInput" v-model="mjftData.bz"/></td>
</tr>
</table>
<table border="1">
<tr>
<td @click="addRow">+</td>
<td>定着物代码</td>
<td>土地所有权/使用权面积(㎡)</td>
<td>独有独用土地面积(㎡)</td>
<td>分摊土地面积(㎡)</td>
</tr>
<tr v-for="(item,i) in mjftData.addQjZdftdzwRequestList" :key="i">
<td @click="delRow(i)">-</td>
<td><input type="text" class="formInput" v-model="item.dzwdm"/></td>
<td><input type="number" class="formInput" v-model="item.tdsyqsyqmj" @keydown="oninput"/></td>
<td><input type="number" class="formInput" v-model="item.dydytdmj" @keydown="oninput"/></td>
<td><input type="number" class="formInput" v-model="item.fttdmj" @keydown="oninput"/></td>
</tr>
<tr>
<td></td>
<td>统计</td>
<td>{{sumTdsyqsyqmj}}</td>
<td>{{sumDydytdmj}}</td>
<td>{{sumFttdmj}}</td>
</tr>
</table>
<div class="pers">
<el-button @click="save" type="primary">保存</el-button>
</div>
</div>
</template>
<script>
export default {
name:"",
components:{},
props:{},
data(){
return {
}
},
created(){},
mounted(){},
methods:{},
computed: {},
watch: {},
}
import {savemjft} from '../../../api/basic'
import {Message} from 'element-ui'
export default {
name: "index",
data() {
return {
mjftData: {
zdbsm: '', // 宗地标识码 继承获取
tdsyqsyqmjhj: '',// 土地所有权/使用权面积合计
fttdmjhj: '', // 分摊土地面积合计
dzwdys: '', // 表示同一宗地内所有的定着物单元数
dydytdmjhj: '', // 根据该宗地下共有/共用定着物量自动计算。 ,
bz: '', // 备注
tdzl: '', // 土地坐落 继承获取
zdmj: '', // 宗地面积 继承获取
addQjZdftdzwRequestList: [
{
dydytdmj: '', // 独有独用土地面积
dzwdm: '', // 定着物代码
fttdmj: '', // 分摊土地面积
gygyzdmjftbsm: '',// 共有公用面积分摊标识码 ,
tdsyqsyqmj: '' // 土地所有权/使用权面积
}
]
}
}
},
methods: {
save() {
console.log(this.mjftData);
for (let val of this.mjftData.addQjZdftdzwRequestList){
if (val.dzwdm == '') {
Message.error("定着物代码不能为空")
return
}
}
savemjft(this.mjftData).then(res => {
console.log(res)
}).catch(error => {
console.log(error)
})
},
oninput(e) {
e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
},
addRow() {
this.mjftData.addQjZdftdzwRequestList.push({
dydytdmj: '',
dzwdm: '',
fttdmj: '',
gygyzdmjftbsm: '',
tdsyqsyqmj: ''
})
},
delRow(index) {
this.mjftData.addQjZdftdzwRequestList.splice(index, 1)
}
},
computed: {
sumTdsyqsyqmj: function () {
let self = this;
let sum = 0;
let data = this.mjftData.addQjZdftdzwRequestList;
for (let i = 0; i < data.length; i++) {
if (isNaN(parseFloat(data[i].tdsyqsyqmj))) {
continue;
}
sum += parseFloat(data[i].tdsyqsyqmj)
}
let num = isNaN(sum) ? '' : sum.toFixed(3);
self.mjftData.tdsyqsyqmjhj = num;
return num;
},
sumDydytdmj: function () {
let self = this;
let sum = 0;
let data = this.mjftData.addQjZdftdzwRequestList;
for (let i = 0; i < data.length; i++) {
if (isNaN(parseFloat(data[i].dydytdmj))) {
continue;
}
sum += parseFloat(data[i].dydytdmj)
}
let num = isNaN(sum) ? '' : sum.toFixed(3);
self.mjftData.dydytdmjhj = num;
return num;
},
sumFttdmj: function () {
let self = this;
let sum = 0;
let data = this.mjftData.addQjZdftdzwRequestList;
for (let i = 0; i < data.length; i++) {
if (isNaN(parseFloat(data[i].fttdmj))) {
continue;
}
sum += parseFloat(data[i].fttdmj)
}
let num = isNaN(sum) ? '' : sum.toFixed(3);
self.mjftData.fttdmjhj = num;
return num;
},
dzwdsl: function () {
let self = this
let num = this.mjftData.addQjZdftdzwRequestList.length
self.mjftData.dzwdys = num
return num;
}
},
created() {
console.log("create init...")
},
mounted() {
// 暂时随机生成 后续从调查表继承过来
this.mjftData.zdbsm = 'ZDDM' + parseInt(Math.random() * 100)
this.mjftData.zdmj = (Math.random() * 1000).toFixed(3)
let zl = ['西安', '咸阳', '雁塔区', '高新区', '未央区', '莲湖区', '临潼区']
let i = parseInt(Math.random() * 7, 10);
this.mjftData.tdzl = zl[i]
console.log("mounted init...")
}
}
</script>
<style scoped lang="less">
</style>
\ No newline at end of file
<style scoped>
.main {
box-sizing: border-box;
padding: 18px;
height: auto;
width: 80%;
}
table {
margin-top: 10px;
background-color: #fff;
font-size: 14px;
width: 100%;
}
td {
text-align: center;
height: 36px;
}
table .formInput {
margin: 0;
height: 36px;
outline: none;
border: none;
color: #606764;
overflow: visible;
text-align: center;
cursor: text;
}
.pers {
text-align: center;
margin-top: 10px;
}
.pers .el-button {
width: 150px;
}
.dzwsl {
width: 200px;
}
</style>
......
......@@ -26,12 +26,12 @@ module.exports = {
}
},
configureWebpack: { // webpack 配置,避免缓存js
output: { // 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】
output: { // 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】
filename: `js/[name].${Timestamp}.js`,
chunkFilename: `js/[name].${Timestamp}.js`
},
// plugins: [
// new FileManagerPlugin({ //初始化 filemanager-webpack-plugin 插件实例
// onEnd: {
// mkdir: ['./zip','./dist'], //初始化生产zip和dist文件夹
......@@ -43,8 +43,8 @@ module.exports = {
// ]
},
devServer: {
host: "0.0.0.0",
port: 8083,
host: "127.0.0.1",
port: 8006,
https: false,
hotOnly: false,
proxy: {
......@@ -60,4 +60,4 @@ module.exports = {
console.log(app);
},
},
}
\ No newline at end of file
}
......