481ec6a5 by weimo934

fix(mjft):移动面积分摊位置

1 parent 4185f287
...@@ -72,12 +72,6 @@ const constantRoutes = [ ...@@ -72,12 +72,6 @@ const constantRoutes = [
72 component: () => import("@/views/basic/h/index"), 72 component: () => import("@/views/basic/h/index"),
73 }, 73 },
74 { 74 {
75 path: "/mjft",
76 name: "面积分摊",
77 code: "1-4",
78 component: () => import("@/views/basic/mjft/index"),
79 },
80 {
81 path: "/zd", 75 path: "/zd",
82 name: "宗地", 76 name: "宗地",
83 code: "1-5", 77 code: "1-5",
......
...@@ -104,9 +104,6 @@ export default { ...@@ -104,9 +104,6 @@ export default {
104 { 104 {
105 path:'/zd', 105 path:'/zd',
106 name:'宗地' 106 name:'宗地'
107 },{
108 path:'/mjft',
109 name:'面积分摊'
110 } 107 }
111 ], 108 ],
112 // 上导航选中id 109 // 上导航选中id
......
1 <template>
2 <div class="main">
3 <table border="1">
4 <tr>
5 <td colspan="2">土地坐落</td>
6 <td colspan="3"><input type="number" class="formInput" v-model.number="mjftData.tdzl" disabled/></td>
7 </tr>
8 <tr>
9 <td colspan="2">宗地代码</td>
10 <td colspan="3"><input type="text" class="formInput" v-model="mjftData.zdbsm " disabled/></td>
11 </tr>
12 <tr>
13 <td colspan="2">宗地面积(㎡)</td>
14 <td><input type="number" class="formInput" v-model.number="mjftData.zjmj" disabled/></td>
15 <td>定着物数量</td>
16 <td>{{dzwdsl}}</td>
17 </tr>
18 <tr>
19 <td colspan="2">备注</td>
20 <td colspan="3"><input type="text" class="formInput" v-model="mjftData.bz"/></td>
21 </tr>
22 </table>
23 <table border="1">
24 <tr>
25 <td @click="addRow">+</td>
26 <td>定着物代码</td>
27 <td>土地所有权/使用权面积(㎡)</td>
28 <td>独有独用土地面积(㎡)</td>
29 <td>分摊土地面积(㎡)</td>
30 </tr>
31 <tr v-for="(item,i) in mjftData.addQjZdftdzwRequestList" :key="i">
32 <td @click="delRow(i)">-</td>
33 <td><input type="text" class="formInput" v-model="item.dzwdm"/></td>
34 <td><input type="number" class="formInput" v-model.number="item.tdsyqsyqmj"/></td>
35 <td><input type="number" class="formInput" v-model.number="item.dydytdmj"/></td>
36 <td><input type="number" class="formInput" v-model.number="item.fttdmj"/></td>
37 </tr>
38 <tr>
39 <td></td>
40 <td>统计</td>
41 <td>{{sumTdsyqsyqmj}}</td>
42 <td>{{sumDydytdmj}}</td>
43 <td>{{sumFttdmj}}</td>
44 </tr>
45 </table>
46 <div class="pers">
47 <el-button @click="save" type="primary">保存</el-button>
48 </div>
49 </div>
50 </template>
51
52 <script>
53 import {savemjft} from '../../../api/basic'
54
55 export default {
56 name: "index",
57 data() {
58 return {
59 mjftData: {
60 zdbsm: '123', // 宗地标识码 继承获取
61 tdsyqsyqmjhj: '',// 土地所有权/使用权面积合计
62 fttdmjhj: '', // 分摊土地面积合计
63 dzwdys: '', // 表示同一宗地内所有的定着物单元数
64 dydytdmjhj: '', // 根据该宗地下共有/共用定着物量自动计算。 ,
65 bz: '', // 备注
66 tdzl: '', // 土地坐落 继承获取
67 zdmj: '', // 宗地面积 继承获取
68 addQjZdftdzwRequestList: [
69 {
70 dydytdmj: '', // 独有独用土地面积
71 dzwdm: '', // 定着物代码
72 fttdmj: '', // 分摊土地面积
73 gygyzdmjftbsm: '',// 共有公用面积分摊标识码 ,
74 tdsyqsyqmj: '' // 土地所有权/使用权面积
75 }
76 ]
77 }
78 }
79 },
80
81 methods: {
82 save() {
83 console.log(this.mjftData)
84 savemjft(this.mjftData).then(res => {
85 console.log(res)
86 }).catch(error => {
87 console.log(error)
88 })
89 },
90 addRow() {
91 this.mjftData.addQjZdftdzwRequestList.push({
92 dydytdmj: '',
93 dzwdm: '',
94 fttdmj: '',
95 gygyzdmjftbsm: '',
96 tdsyqsyqmj: ''
97 })
98 },
99 delRow(index) {
100 this.mjftData.addQjZdftdzwRequestList.splice(index, 1)
101 }
102 },
103 computed: {
104 sumTdsyqsyqmj: function () {
105 let self = this;
106 let sum = 0;
107 let data = this.mjftData.addQjZdftdzwRequestList;
108 for (let i = 0; i < data.length; i++) {
109 if (isNaN(parseFloat(data[i].tdsyqsyqmj))) {
110 continue;
111 }
112 sum += parseFloat(data[i].tdsyqsyqmj)
113 }
114 let num = isNaN(sum) ? '' : sum;
115 self.mjftData.tdsyqsyqmjhj = num;
116 return num;
117 },
118 sumDydytdmj: function () {
119 let self = this;
120 let sum = 0;
121 let data = this.mjftData.addQjZdftdzwRequestList;
122 for (let i = 0; i < data.length; i++) {
123 if (isNaN(parseFloat(data[i].dydytdmj))) {
124 continue;
125 }
126 sum += parseFloat(data[i].dydytdmj)
127 }
128 let num = isNaN(sum) ? '' : sum;
129 self.mjftData.dydytdmjhj = num;
130 return num;
131 },
132 sumFttdmj: function () {
133 let self = this;
134 let sum = 0;
135 let data = this.mjftData.addQjZdftdzwRequestList;
136 for (let i = 0; i < data.length; i++) {
137 if (isNaN(parseFloat(data[i].fttdmj))) {
138 continue;
139 }
140 sum += parseFloat(data[i].fttdmj)
141 }
142 let num = isNaN(sum) ? '' : sum;
143 self.mjftData.fttdmjhj = num;
144 return num;
145 },
146 dzwdsl: function () {
147 let self = this
148 let num = this.mjftData.addQjZdftdzwRequestList.length
149 self.mjftData.dzwdys = num
150 return num;
151 }
152 },
153 created() {
154 console.log("create init...")
155 },
156 mounted() {
157 console.log("mounted init...")
158 }
159 }
160 </script>
161
162 <style scoped>
163 .main {
164 box-sizing: border-box;
165 padding: 18px;
166 height: auto;
167 width: 80%;
168 }
169
170 table {
171 margin-top: 10px;
172 background-color: #fff;
173 font-size: 14px;
174 width: 100%;
175 }
176
177 td {
178 text-align: center;
179 height: 36px;
180 }
181
182 table .formInput {
183 margin: 0;
184 height: 36px;
185 outline: none;
186 border: none;
187 color: #606764;
188 overflow: visible;
189 text-align: center;
190 cursor: text;
191 }
192
193 .pers {
194 text-align: center;
195 margin-top: 10px;
196 }
197
198 .pers .el-button {
199 width: 150px;
200 }
201
202 </style>
1 <template> 1 <template>
2 <div class="">面积分摊表</div> 2 <div class="main">
3 <table border="1">
4 <tr>
5 <td colspan="2">土地坐落</td>
6 <td colspan="3"><input type="number" class="formInput" v-model.number="mjftData.tdzl" disabled/></td>
7 </tr>
8 <tr>
9 <td colspan="2">宗地代码</td>
10 <td colspan="3"><input type="text" class="formInput" v-model="mjftData.zdbsm " disabled/></td>
11 </tr>
12 <tr>
13 <td colspan="2">宗地面积(㎡)</td>
14 <td><input type="number" class="formInput" v-model.number="mjftData.zjmj" disabled/></td>
15 <td>定着物数量</td>
16 <td>{{dzwdsl}}</td>
17 </tr>
18 <tr>
19 <td colspan="2">备注</td>
20 <td colspan="3"><input type="text" class="formInput" v-model="mjftData.bz"/></td>
21 </tr>
22 </table>
23 <table border="1">
24 <tr>
25 <td @click="addRow">+</td>
26 <td>定着物代码</td>
27 <td>土地所有权/使用权面积(㎡)</td>
28 <td>独有独用土地面积(㎡)</td>
29 <td>分摊土地面积(㎡)</td>
30 </tr>
31 <tr v-for="(item,i) in mjftData.addQjZdftdzwRequestList" :key="i">
32 <td @click="delRow(i)">-</td>
33 <td><input type="text" class="formInput" v-model="item.dzwdm"/></td>
34 <td><input type="number" class="formInput" v-model.number="item.tdsyqsyqmj"/></td>
35 <td><input type="number" class="formInput" v-model.number="item.dydytdmj"/></td>
36 <td><input type="number" class="formInput" v-model.number="item.fttdmj"/></td>
37 </tr>
38 <tr>
39 <td></td>
40 <td>统计</td>
41 <td>{{sumTdsyqsyqmj}}</td>
42 <td>{{sumDydytdmj}}</td>
43 <td>{{sumFttdmj}}</td>
44 </tr>
45 </table>
46 <div class="pers">
47 <el-button @click="save" type="primary">保存</el-button>
48 </div>
49 </div>
3 </template> 50 </template>
4 51
5 <script> 52 <script>
6 export default { 53 import {savemjft} from '../../../api/basic'
7 name:"", 54
8 components:{}, 55 export default {
9 props:{}, 56 name: "index",
10 data(){ 57 data() {
11 return { 58 return {
59 mjftData: {
60 zdbsm: '123', // 宗地标识码 继承获取
61 tdsyqsyqmjhj: '',// 土地所有权/使用权面积合计
62 fttdmjhj: '', // 分摊土地面积合计
63 dzwdys: '', // 表示同一宗地内所有的定着物单元数
64 dydytdmjhj: '', // 根据该宗地下共有/共用定着物量自动计算。 ,
65 bz: '', // 备注
66 tdzl: '', // 土地坐落 继承获取
67 zdmj: '', // 宗地面积 继承获取
68 addQjZdftdzwRequestList: [
69 {
70 dydytdmj: '', // 独有独用土地面积
71 dzwdm: '', // 定着物代码
72 fttdmj: '', // 分摊土地面积
73 gygyzdmjftbsm: '',// 共有公用面积分摊标识码 ,
74 tdsyqsyqmj: '' // 土地所有权/使用权面积
75 }
76 ]
77 }
78 }
79 },
80
81 methods: {
82 save() {
83 console.log(this.mjftData)
84 savemjft(this.mjftData).then(res => {
85 console.log(res)
86 }).catch(error => {
87 console.log(error)
88 })
89 },
90 addRow() {
91 this.mjftData.addQjZdftdzwRequestList.push({
92 dydytdmj: '',
93 dzwdm: '',
94 fttdmj: '',
95 gygyzdmjftbsm: '',
96 tdsyqsyqmj: ''
97 })
98 },
99 delRow(index) {
100 this.mjftData.addQjZdftdzwRequestList.splice(index, 1)
101 }
102 },
103 computed: {
104 sumTdsyqsyqmj: function () {
105 let self = this;
106 let sum = 0;
107 let data = this.mjftData.addQjZdftdzwRequestList;
108 for (let i = 0; i < data.length; i++) {
109 if (isNaN(parseFloat(data[i].tdsyqsyqmj))) {
110 continue;
111 }
112 sum += parseFloat(data[i].tdsyqsyqmj)
113 }
114 let num = isNaN(sum) ? '' : sum;
115 self.mjftData.tdsyqsyqmjhj = num;
116 return num;
117 },
118 sumDydytdmj: function () {
119 let self = this;
120 let sum = 0;
121 let data = this.mjftData.addQjZdftdzwRequestList;
122 for (let i = 0; i < data.length; i++) {
123 if (isNaN(parseFloat(data[i].dydytdmj))) {
124 continue;
125 }
126 sum += parseFloat(data[i].dydytdmj)
12 } 127 }
128 let num = isNaN(sum) ? '' : sum;
129 self.mjftData.dydytdmjhj = num;
130 return num;
13 }, 131 },
14 created(){}, 132 sumFttdmj: function () {
15 mounted(){}, 133 let self = this;
16 methods:{}, 134 let sum = 0;
17 computed: {}, 135 let data = this.mjftData.addQjZdftdzwRequestList;
18 watch: {}, 136 for (let i = 0; i < data.length; i++) {
19 } 137 if (isNaN(parseFloat(data[i].fttdmj))) {
138 continue;
139 }
140 sum += parseFloat(data[i].fttdmj)
141 }
142 let num = isNaN(sum) ? '' : sum;
143 self.mjftData.fttdmjhj = num;
144 return num;
145 },
146 dzwdsl: function () {
147 let self = this
148 let num = this.mjftData.addQjZdftdzwRequestList.length
149 self.mjftData.dzwdys = num
150 return num;
151 }
152 },
153 created() {
154 console.log("create init...")
155 },
156 mounted() {
157 console.log("mounted init...")
158 }
159 }
20 </script> 160 </script>
21 <style scoped lang="less"> 161
162 <style scoped>
163 .main {
164 box-sizing: border-box;
165 padding: 18px;
166 height: auto;
167 width: 80%;
168 }
169
170 table {
171 margin-top: 10px;
172 background-color: #fff;
173 font-size: 14px;
174 width: 100%;
175 }
176
177 td {
178 text-align: center;
179 height: 36px;
180 }
181
182 table .formInput {
183 margin: 0;
184 height: 36px;
185 outline: none;
186 border: none;
187 color: #606764;
188 overflow: visible;
189 text-align: center;
190 cursor: text;
191 }
192
193 .pers {
194 text-align: center;
195 margin-top: 10px;
196 }
197
198 .pers .el-button {
199 width: 150px;
200 }
201
22 </style> 202 </style>
......