a5a6fcca by 杨威
2 parents 07d85266 e3520832
1 import request from '@/plugin/axios'
2
3 /**
4 * 保存面积分摊表
5 * @param data
6 * @constructor
7 */
8 export function savemjft(data) {
9 return request({
10 url: '/zd/qjGygyzdmjft/insertQjGygyzdmjft',
11 method: 'post',
12 data: data,
13 })
14 }
...@@ -78,12 +78,6 @@ const constantRoutes = [ ...@@ -78,12 +78,6 @@ const constantRoutes = [
78 component: () => import("@/views/basic/h/index"), 78 component: () => import("@/views/basic/h/index"),
79 }, 79 },
80 { 80 {
81 path: "/mjft",
82 name: "面积分摊",
83 code: "1-4",
84 component: () => import("@/views/basic/mjft/index"),
85 },
86 {
87 path: "/zd", 81 path: "/zd",
88 name: "宗地", 82 name: "宗地",
89 code: "1-5", 83 code: "1-5",
......
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
108 { 108 {
109 path:'/zd', 109 path:'/zd',
110 name:'宗地' 110 name:'宗地'
111 }, 111 }
112 ], 112 ],
113 // 上导航选中id 113 // 上导航选中id
114 indId: undefined, 114 indId: undefined,
......
1 <template>
2 <div class="main">
3 <table border="1">
4 <tr>
5 <td colspan="2">土地面积</td>
6 <td colspan="3"><input type="text" class="formInput" v-model="mjftData.tdmj"/></td>
7 </tr>
8 <tr>
9 <td colspan="2">宗地代码</td>
10 <td colspan="3"><input type="text" class="formInput" v-model="mjftData.zdbsm "/></td>
11 </tr>
12 <tr>
13 <td colspan="2">宗地面积(㎡)</td>
14 <td><input type="text" class="formInput" v-model="mjftData.zjmj"/></td>
15 <td>定着物数量</td>
16 <td><input type="text" class="formInput" v-model="mjftData.dzwsl"/></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">
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="item.tdsyqsyqmj"/></td>
35 <td><input type="text" class="formInput" v-model="item.dydytdmj"/></td>
36 <td><input type="text" class="formInput" v-model="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>
47 </template>
48
49 <script>
50 export default {
51 name: "index",
52 data() {
53 return {
54 mjftData: {
55 zdbsm: '',
56 tdsyqsyqmjhj: '',
57 fttdmjhj: '',
58 dzwdys: '',
59 dydytdmjhj: '',
60 bz: '',
61 tdmj: '',
62 zjmj: '',
63 dzwsl: '',
64 addQjZdftdzwRequestList: [
65 {
66 dydytdmj: '',
67 dzwdm: '',
68 fttdmj: '',
69 gygyzdmjftbsm: '',
70 tdsyqsyqmj: ''
71 }
72 ]
73 }
74 }
75 },
76 created: {},
77 methods: {
78 addRow() {
79 this.mjftData.addQjZdftdzwRequestList.push({
80 dydytdmj: '',
81 dzwdm: '',
82 fttdmj: '',
83 gygyzdmjftbsm: '',
84 tdsyqsyqmj: ''
85 })
86 },
87 delRow(index) {
88 this.mjftData.addQjZdftdzwRequestList.splice(index, 1)
89 }
90 },
91 computed: {
92 sumTdsyqsyqmj: function () {
93 let sum = 0;
94 let data = this.mjftData.addQjZdftdzwRequestList;
95 for (let i = 0; i < data.length; i++) {
96 if (isNaN(parseFloat(data[i].tdsyqsyqmj))) {
97 continue;
98 }
99 sum += parseFloat(data[i].tdsyqsyqmj)
100 }
101 return isNaN(sum) ? '' : sum;
102 },
103 sumDydytdmj: function () {
104 let sum = 0;
105 let data = this.mjftData.addQjZdftdzwRequestList;
106 for (let i = 0; i < data.length; i++) {
107 if (isNaN(parseFloat(data[i].dydytdmj))) {
108 continue;
109 }
110 sum += parseFloat(data[i].dydytdmj)
111 }
112 return isNaN(sum) ? '' : sum;
113 },
114 sumFttdmj: function () {
115 let sum = 0;
116 let data = this.mjftData.addQjZdftdzwRequestList;
117 for (let i = 0; i < data.length; i++) {
118 if (isNaN(parseFloat(data[i].fttdmj))) {
119 continue;
120 }
121 sum += parseFloat(data[i].fttdmj)
122 }
123 return isNaN(sum) ? '' : sum;
124 }
125 },
126 mounted() {
127
128 }
129 }
130 </script>
131
132 <style scoped>
133 .main {
134 box-sizing: border-box;
135 padding: 18px;
136 height: auto;
137 width: 80%;
138 }
139
140 table {
141 margin-top: 10px;
142 background-color: #fff;
143 font-size: 14px;
144 width: 100%;
145 }
146
147 td {
148 text-align: center;
149 height: 36px;
150 }
151
152 table .formInput {
153 margin: 0;
154 height: 36px;
155 outline: none;
156 border: none;
157 color: #606764;
158 overflow: visible;
159 text-align: center;
160 cursor: text;
161 }
162
163
164 </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="text" class="formInput" v-model="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.zdmj" disabled/></td>
15 <td>定着物数量</td>
16 <td class="dzwsl">{{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="item.tdsyqsyqmj" @keydown="oninput"/></td>
35 <td><input type="number" class="formInput" v-model="item.dydytdmj" @keydown="oninput"/></td>
36 <td><input type="number" class="formInput" v-model="item.fttdmj" @keydown="oninput"/></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 import {Message} from 'element-ui'
8 components:{}, 55 export default {
9 props:{}, 56 name: "index",
10 data(){ 57 data() {
11 return { 58 return {
59 mjftData: {
60 zdbsm: '', // 宗地标识码 继承获取
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: '' // 土地所有权/使用权面积
12 } 75 }
76 ]
77 }
78 }
79 },
80
81 methods: {
82 save() {
83 console.log(this.mjftData);
84 for (let val of this.mjftData.addQjZdftdzwRequestList){
85 if (val.dzwdm == '') {
86 Message.error("定着物代码不能为空")
87 return
88 }
89 }
90
91 savemjft(this.mjftData).then(res => {
92 console.log(res)
93 }).catch(error => {
94 console.log(error)
95 })
96 },
97 oninput(e) {
98 e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
99 },
100 addRow() {
101 this.mjftData.addQjZdftdzwRequestList.push({
102 dydytdmj: '',
103 dzwdm: '',
104 fttdmj: '',
105 gygyzdmjftbsm: '',
106 tdsyqsyqmj: ''
107 })
108 },
109 delRow(index) {
110 this.mjftData.addQjZdftdzwRequestList.splice(index, 1)
111 }
112 },
113 computed: {
114 sumTdsyqsyqmj: function () {
115 let self = this;
116 let sum = 0;
117 let data = this.mjftData.addQjZdftdzwRequestList;
118 for (let i = 0; i < data.length; i++) {
119 if (isNaN(parseFloat(data[i].tdsyqsyqmj))) {
120 continue;
121 }
122 sum += parseFloat(data[i].tdsyqsyqmj)
123 }
124 let num = isNaN(sum) ? '' : sum.toFixed(3);
125 self.mjftData.tdsyqsyqmjhj = num;
126 return num;
127 },
128 sumDydytdmj: function () {
129 let self = this;
130 let sum = 0;
131 let data = this.mjftData.addQjZdftdzwRequestList;
132 for (let i = 0; i < data.length; i++) {
133 if (isNaN(parseFloat(data[i].dydytdmj))) {
134 continue;
135 }
136 sum += parseFloat(data[i].dydytdmj)
137 }
138 let num = isNaN(sum) ? '' : sum.toFixed(3);
139 self.mjftData.dydytdmjhj = num;
140 return num;
141 },
142 sumFttdmj: function () {
143 let self = this;
144 let sum = 0;
145 let data = this.mjftData.addQjZdftdzwRequestList;
146 for (let i = 0; i < data.length; i++) {
147 if (isNaN(parseFloat(data[i].fttdmj))) {
148 continue;
149 }
150 sum += parseFloat(data[i].fttdmj)
151 }
152 let num = isNaN(sum) ? '' : sum.toFixed(3);
153 self.mjftData.fttdmjhj = num;
154 return num;
13 }, 155 },
14 created(){}, 156 dzwdsl: function () {
15 mounted(){}, 157 let self = this
16 methods:{}, 158 let num = this.mjftData.addQjZdftdzwRequestList.length
17 computed: {}, 159 self.mjftData.dzwdys = num
18 watch: {}, 160 return num;
19 } 161 }
162 },
163 created() {
164 console.log("create init...")
165 },
166 mounted() {
167 // 暂时随机生成 后续从调查表继承过来
168 this.mjftData.zdbsm = 'ZDDM' + parseInt(Math.random() * 100)
169 this.mjftData.zdmj = (Math.random() * 1000).toFixed(3)
170 let zl = ['西安', '咸阳', '雁塔区', '高新区', '未央区', '莲湖区', '临潼区']
171 let i = parseInt(Math.random() * 7, 10);
172 this.mjftData.tdzl = zl[i]
173 console.log("mounted init...")
174 }
175 }
20 </script> 176 </script>
21 <style scoped lang="less"> 177
178 <style scoped>
179 .main {
180 box-sizing: border-box;
181 padding: 18px;
182 height: auto;
183 width: 80%;
184 }
185
186 table {
187 margin-top: 10px;
188 background-color: #fff;
189 font-size: 14px;
190 width: 100%;
191 }
192
193 td {
194 text-align: center;
195 height: 36px;
196 }
197
198 table .formInput {
199 margin: 0;
200 height: 36px;
201 outline: none;
202 border: none;
203 color: #606764;
204 overflow: visible;
205 text-align: center;
206 cursor: text;
207 }
208
209 .pers {
210 text-align: center;
211 margin-top: 10px;
212 }
213
214 .pers .el-button {
215 width: 150px;
216 }
217
218 .dzwsl {
219 width: 200px;
220 }
221
22 </style> 222 </style>
......
...@@ -43,8 +43,8 @@ module.exports = { ...@@ -43,8 +43,8 @@ module.exports = {
43 // ] 43 // ]
44 }, 44 },
45 devServer: { 45 devServer: {
46 host: "0.0.0.0", 46 host: "127.0.0.1",
47 port: 8083, 47 port: 8006,
48 https: false, 48 https: false,
49 hotOnly: false, 49 hotOnly: false,
50 proxy: { 50 proxy: {
......