7ebf2524 by yangwei

代码合并

1 parent b4f32752
1 <template> 1 <template>
2 <div class="lpbContent-wrap" ref="lpbContentWrap"> 2 <div class="lpbContent-wrap" ref="lpbContentWrap">
3 <div class="lpbContent" ref="lpbContent" :style="{ 'height': 'calc(100% - '+ lpbContentHeight +'px)'}"> 3 <div
4 class="lpbContent"
5 ref="lpbContent"
6 :style="{ height: 'calc(100% - ' + lpbContentHeight + 'px)' }"
7 >
4 <!-- 纵向倒序排列 逻辑幢位于独立幢单元和独立层户的上方 --> 8 <!-- 纵向倒序排列 逻辑幢位于独立幢单元和独立层户的上方 -->
5 <div class="ch-zdy-wrap"> 9 <div class="ch-zdy-wrap">
6 <!-- 幢单元 --> 10 <!-- 幢单元 -->
7 <zdy-cpn v-if="lpbData.zdys.length" :zdys="lpbData.zdys" :onlyShow="onlyShow" /> 11 <zdy-cpn
12 v-if="lpbData.zdys.length"
13 :zdys="lpbData.zdys"
14 :onlyShow="onlyShow"
15 />
8 <!-- 独立层户 --> 16 <!-- 独立层户 -->
9 <ch-cpn v-if="lpbData.cs.length" :ch="lpbData.cs" :onlyShow="onlyShow" /> 17 <ch-cpn
18 v-if="lpbData.cs.length"
19 :ch="lpbData.cs"
20 :onlyShow="onlyShow"
21 />
10 </div> 22 </div>
11 <!-- 逻辑幢 --> 23 <!-- 逻辑幢 -->
12 <ljzs-cpn v-if="lpbData.ljzs.length" :ljzs="lpbData.ljzs" :onlyShow="onlyShow" /> 24 <ljzs-cpn
25 v-if="lpbData.ljzs.length"
26 :ljzs="lpbData.ljzs"
27 :onlyShow="onlyShow"
28 />
13 </div> 29 </div>
14 <!-- 自然幢名称 --> 30 <!-- 自然幢名称 -->
15 <p class="lpb-xmmc" v-if="onlyShow" style="border-bottom: 1px solid #e6e6e6">{{ lpbData.xmmc }}</p> 31 <p
16 <p class="lpb-xmmc" v-else :style="{ 'border-bottom':'1px solid #e6e6e6'}"> 32 class="lpb-xmmc"
33 v-if="onlyShow"
34 style="border-bottom: 1px solid #e6e6e6"
35 >
36 {{ lpbData.xmmc }}
37 </p>
38 <p
39 class="lpb-xmmc"
40 v-else
41 :style="{ 'border-bottom': '1px solid #e6e6e6' }"
42 >
17 <el-checkbox @change="zdySelectAll($event)">{{ 43 <el-checkbox @change="zdySelectAll($event)">{{
18 lpbData.xmmc 44 lpbData.xmmc
19 }}</el-checkbox> 45 }}</el-checkbox>
20 </p> 46 </p>
21 <el-button type="primary" class="save-btn" v-if="!onlyShow && showSave" @click="saveLpb">选择确认</el-button> 47 <el-button
22 <el-button type="primary" class="save-btn" v-if="!onlyShow && !showSave" @click="submitForm" :loading="loading">发起申请</el-button> 48 type="primary"
49 class="save-btn"
50 v-if="!onlyShow && showSave"
51 @click="saveLpb"
52 >选择确认</el-button
53 >
54 <el-button
55 type="primary"
56 class="save-btn"
57 v-if="!onlyShow && !showSave"
58 @click="submitForm"
59 :loading="loading"
60 >发起申请</el-button
61 >
23 <!-- 右键菜单 --> 62 <!-- 右键菜单 -->
24 <ul 63 <ul
25 v-show="lpbChVisible" 64 v-show="lpbChVisible"
26 :style="{ left: lpbChLeft + 'px', top: lpbChTop + 'px' }" 65 :style="{ left: lpbChLeft + 'px', top: lpbChTop + 'px' }"
27 class="contextmenu"> 66 class="contextmenu"
67 >
28 <li @click="menuClick">菜单一</li> 68 <li @click="menuClick">菜单一</li>
29 <li @click="menuClick">菜单二</li> 69 <li @click="menuClick">菜单二</li>
30 </ul> 70 </ul>
31 </div> 71 </div>
32 </template> 72 </template>
33 <script> 73 <script>
34 import { getLpb } from "@/api/lpcx.js"; 74 import { getLpb } from "@/api/lpcx.js";
35 import chCpn from "./ch.vue"; 75 import chCpn from "./ch.vue";
36 import zdyCpn from "./zdys.vue"; 76 import zdyCpn from "./zdys.vue";
37 import ljzsCpn from "./ljzs.vue"; 77 import ljzsCpn from "./ljzs.vue";
38 import { startBusinessFlow, choiceBdcdy, againAddSldy } from "@/api/workFlow.js"; 78 import {
39 import jump from "../../ywbl/ywsq/components/mixin/jump"; 79 startBusinessFlow,
40 import store from '@/store/index.js' 80 choiceBdcdy,
41 import { ywPopupCacel } from "@/utils/popup.js"; 81 againAddSldy,
42 export default { 82 } from "@/api/workFlow.js";
83 import jump from "../../ywbl/ywsq/components/mixin/jump";
84 import store from "@/store/index.js";
85 import { ywPopupCacel } from "@/utils/popup.js";
86 export default {
43 mixins: [jump], 87 mixins: [jump],
44 provide () { 88 provide() {
45 return { 89 return {
46 openMenu: this.openMenu, 90 openMenu: this.openMenu,
47 selectAll: this.selectAllObj, 91 selectAll: this.selectAllObj,
48 changeChoosedObj: this.changeChoosedObj, 92 changeChoosedObj: this.changeChoosedObj,
49 clearChangeChoosedObj: this.clearChangeChoosedObj, 93 clearChangeChoosedObj: this.clearChangeChoosedObj,
50 getBsmList: this.getBsmList 94 getBsmList: this.getBsmList,
51 }; 95 };
52 }, 96 },
53 name: "", 97 name: "",
...@@ -79,42 +123,10 @@ ...@@ -79,42 +123,10 @@
79 }, 123 },
80 sqywInfo: { 124 sqywInfo: {
81 type: Object, 125 type: Object,
82 default: () => { } 126 default: () => {},
83 },
84 name: "",
85 components: { chCpn, zdyCpn, ljzsCpn },
86 props: {
87 zrzbsm: {
88 type: String,
89 default: "",
90 },
91 lpbParent: {
92 type: String,
93 default: "isLpb",
94 },
95 isHb: {
96 type: Boolean,
97 default: true,
98 },
99 onlyShow: {
100 type: Boolean,
101 default: true,
102 },
103 showSave: {
104 type: Boolean,
105 default: false,
106 }, 127 },
107 scyclx: {
108 type: Number,
109 default: 0,
110 }, 128 },
111 sqywInfo: { 129 data() {
112 type: Object,
113 default: () => { }
114 },
115 isJump: { type: Boolean, default: false },
116 },
117 data () {
118 return { 130 return {
119 lpbData: { 131 lpbData: {
120 ljzs: [], 132 ljzs: [],
...@@ -133,61 +145,89 @@ ...@@ -133,61 +145,89 @@
133 // 改变户选中状态 145 // 改变户选中状态
134 changeChoosedObj: { 146 changeChoosedObj: {
135 bsms: [], 147 bsms: [],
136 color: '' 148 color: "",
137 }, 149 },
138 // 选中户bsm合集 150 // 选中户bsm合集
139 bsmList: [], 151 bsmList: [],
140 loading: false, 152 loading: false,
141 }; 153 };
142 }, 154 },
143 mounted () { 155 mounted() {
144 this.scyclx ? this.getLpb(this.zrzbsm, this.scyclx) : this.getLpb(this.zrzbsm); 156 this.scyclx
157 ? this.getLpb(this.zrzbsm, this.scyclx)
158 : this.getLpb(this.zrzbsm);
145 window.lpbContent = this; 159 window.lpbContent = this;
146 }, 160 },
161 methods: {
162 /**
163 * @description: 获取当前楼盘表选中户信息
164 * @param {Array} bsmList
165 * @author: renchao
166 */
167 getBsmList(bsmList, compFlag) {
168 // 根据本次传入的组件标识删除之前对应组件标识存入hbsmList的数据
169 this.bsmList = this.bsmList.filter((i) => i.flag != compFlag);
170 // 合并本次数据
171 this.bsmList = this.bsmList.concat([
172 ...new Map(bsmList.map((item) => [item.bdcdyh, item])).values(),
173 ]);
174 // })
175 },
147 /** 176 /**
148 * @description: 保存当前楼盘表 177 * @description: 保存当前楼盘表
149 * @author: renchao 178 * @author: renchao
150 */ 179 */
151 saveLpb () { 180 saveLpb() {
152 if (this.bsmList.length == 0) { 181 if (this.bsmList.length == 0) {
153 this.$message.error("请至少选择一条数据"); 182 this.$message.error("请至少选择一条数据");
154 return; 183 return;
155 } 184 }
156 this.loading = true; 185 this.loading = true;
186 store.dispatch("user/reMenuRefresh", false);
157 againAddSldy({ 187 againAddSldy({
158 bsmSqyw: this.sqywInfo.bsmSqyw, 188 bsmSqyw: this.sqywInfo.bsmSqyw,
159 bsmSlsq: this.sqywInfo.bsmSlsq, 189 bsmSlsq: this.sqywInfo.bsmSlsq,
160 bdcdysz: this.bsmList, 190 bdcdysz: this.bsmList,
161 sjlx: "houses" 191 sjlx: "houses",
162 }).then((res) => { 192 })
163 this.loading = false 193 .then((res) => {
194 this.loading = false;
164 if (res.code == 200) { 195 if (res.code == 200) {
165 this.$message({ 196 this.$message({
166 showClose: true, 197 showClose: true,
167 message: '添加成功', 198 message: "添加成功",
168 type: 'success' 199 type: "success",
169 }) 200 });
170 if (!this.isJump) { 201 if (!this.isJump) {
171 this.jump(res.result, this.sqywInfo.djywbm) 202 this.jump(res.result, this.sqywInfo.djywbm);
172 } else {
173 store.dispatch('user/refreshPage', true);
174 } 203 }
204 store.dispatch("user/refreshPage", true);
175 //this.close(); 205 //this.close();
176 this.$popupCacel(); 206 this.$popupCacel();
177 } else { 207 } else {
178 if (res.result && res.result.length > 0) { 208 if (res.result && res.result.length > 0) {
179 this.$popup("申请错误明细", "components/ywdialog", { width: '36%', formData: { result: res.result } }) 209 this.$popup("申请错误明细", "components/ywdialog", {
210 width: "36%",
211 formData: { result: res.result },
212 });
180 } else { 213 } else {
181 if (res.result && res.result.length > 0) { 214 if (res.result && res.result.length > 0) {
182 this.$popup("申请错误明细", "components/ywdialog", { width: '36%', formData: { result: res.result } }) 215 this.$popup("申请错误明细", "components/ywdialog", {
216 width: "36%",
217 formData: { result: res.result },
218 });
183 } else { 219 } else {
184 this.$popup("申请错误明细", "components/ywdialog", { width: '36%', formData: { message: res.message } }) 220 this.$popup("申请错误明细", "components/ywdialog", {
221 width: "36%",
222 formData: { message: res.message },
223 });
185 } 224 }
186 } 225 }
187 } 226 }
188 }).catch(() => {
189 this.loading = false
190 }) 227 })
228 .catch(() => {
229 this.loading = false;
230 });
191 // todo 调用保存接口 传入参数待定 231 // todo 调用保存接口 传入参数待定
192 //console.log(this.bsmList,'this.bsmList'); 232 //console.log(this.bsmList,'this.bsmList');
193 // 保存成功后关闭弹框 233 // 保存成功后关闭弹框
...@@ -200,7 +240,7 @@ ...@@ -200,7 +240,7 @@
200 * @param {*} color 240 * @param {*} color
201 * @author: renchao 241 * @author: renchao
202 */ 242 */
203 changeChoosed (bsms, color) { 243 changeChoosed(bsms, color) {
204 this.changeChoosedObj.bsms = bsms; 244 this.changeChoosedObj.bsms = bsms;
205 this.changeChoosedObj.color = color; 245 this.changeChoosedObj.color = color;
206 }, 246 },
...@@ -208,7 +248,7 @@ ...@@ -208,7 +248,7 @@
208 * @description: clearChangeChoosedObj 248 * @description: clearChangeChoosedObj
209 * @author: renchao 249 * @author: renchao
210 */ 250 */
211 clearChangeChoosedObj () { 251 clearChangeChoosedObj() {
212 this.changeChoosedObj.bsms = []; 252 this.changeChoosedObj.bsms = [];
213 }, 253 },
214 //全选户 254 //全选户
...@@ -217,7 +257,7 @@ ...@@ -217,7 +257,7 @@
217 * @param {*} val 257 * @param {*} val
218 * @author: renchao 258 * @author: renchao
219 */ 259 */
220 zdySelectAll (val) { 260 zdySelectAll(val) {
221 this.selectAllObj.selectAll = val; 261 this.selectAllObj.selectAll = val;
222 }, 262 },
223 //获取楼盘表数据 263 //获取楼盘表数据
...@@ -228,7 +268,7 @@ ...@@ -228,7 +268,7 @@
228 * @param {*} actual 268 * @param {*} actual
229 * @author: renchao 269 * @author: renchao
230 */ 270 */
231 getLpb (zrzbsm, scyclx, actual) { 271 getLpb(zrzbsm, scyclx, actual) {
232 if (!zrzbsm) { 272 if (!zrzbsm) {
233 this.$message({ 273 this.$message({
234 message: "暂无楼盘表", 274 message: "暂无楼盘表",
...@@ -239,8 +279,11 @@ ...@@ -239,8 +279,11 @@
239 if (res.code == 200) { 279 if (res.code == 200) {
240 if (scyclx) { 280 if (scyclx) {
241 if (res.result.syclx == "1") { 281 if (res.result.syclx == "1") {
242 res.result.lpb.ljzs = res.result.lpb.ljzs.sort(this.compare("place")); 282 res.result.lpb.ljzs = res.result.lpb.ljzs.sort(
243 this.lpbData = res.result.lpb == null ? this.lpbData : res.result.lpb; 283 this.compare("place")
284 );
285 this.lpbData =
286 res.result.lpb == null ? this.lpbData : res.result.lpb;
244 } 287 }
245 } else { 288 } else {
246 this.$message({ 289 this.$message({
...@@ -256,7 +299,6 @@ ...@@ -256,7 +299,6 @@
256 } 299 }
257 }); 300 });
258 } 301 }
259
260 }, 302 },
261 //户右键点击事件 303 //户右键点击事件
262 /** 304 /**
...@@ -266,7 +308,7 @@ ...@@ -266,7 +308,7 @@
266 * @param {*} type 308 * @param {*} type
267 * @author: renchao 309 * @author: renchao
268 */ 310 */
269 openMenu (e, item, type) { 311 openMenu(e, item, type) {
270 this.lpbChLeft = e.pageX - 96; 312 this.lpbChLeft = e.pageX - 96;
271 this.lpbChTop = e.pageY - 23; 313 this.lpbChTop = e.pageY - 23;
272 // this.lpbChVisible = true; 314 // this.lpbChVisible = true;
...@@ -276,7 +318,7 @@ ...@@ -276,7 +318,7 @@
276 * @description: 关闭户右键菜单 318 * @description: 关闭户右键菜单
277 * @author: renchao 319 * @author: renchao
278 */ 320 */
279 closeMenu () { 321 closeMenu() {
280 this.lpbChVisible = false; 322 this.lpbChVisible = false;
281 }, 323 },
282 //右键菜单点击 324 //右键菜单点击
...@@ -284,7 +326,7 @@ ...@@ -284,7 +326,7 @@
284 * @description: 右键菜单点击 326 * @description: 右键菜单点击
285 * @author: renchao 327 * @author: renchao
286 */ 328 */
287 menuClick () { 329 menuClick() {
288 this.closeMenu(); 330 this.closeMenu();
289 }, 331 },
290 /** 332 /**
...@@ -292,7 +334,7 @@ ...@@ -292,7 +334,7 @@
292 * @param {*} property 334 * @param {*} property
293 * @author: renchao 335 * @author: renchao
294 */ 336 */
295 compare (property) { 337 compare(property) {
296 return function (a, b) { 338 return function (a, b) {
297 var value1 = a[property]; 339 var value1 = a[property];
298 var value2 = b[property]; 340 var value2 = b[property];
...@@ -303,7 +345,7 @@ ...@@ -303,7 +345,7 @@
303 * @description: submitForm 345 * @description: submitForm
304 * @author: renchao 346 * @author: renchao
305 */ 347 */
306 submitForm () { 348 submitForm() {
307 if (this.bsmList.length == 0) { 349 if (this.bsmList.length == 0) {
308 this.$message.error("请至少选择一条数据"); 350 this.$message.error("请至少选择一条数据");
309 return; 351 return;
...@@ -312,60 +354,68 @@ ...@@ -312,60 +354,68 @@
312 startBusinessFlow({ 354 startBusinessFlow({
313 bsmSqyw: this.sqywInfo.bsmSqyw, 355 bsmSqyw: this.sqywInfo.bsmSqyw,
314 bdcdysz: this.bsmList, 356 bdcdysz: this.bsmList,
315 }).then((res) => { 357 })
316 this.loading = false 358 .then((res) => {
359 this.loading = false;
317 if (res.code == 200) { 360 if (res.code == 200) {
318 this.$message({ 361 this.$message({
319 showClose: true, 362 showClose: true,
320 message: '发起申请成功', 363 message: "发起申请成功",
321 type: 'success' 364 type: "success",
322 }) 365 });
323 if (!this.isJump) { 366 if (!this.isJump) {
324 this.jump(res.result, this.sqywInfo.djywbm) 367 this.jump(res.result, this.sqywInfo.djywbm);
325 } else { 368 } else {
326 store.dispatch('user/refreshPage', true); 369 store.dispatch("user/refreshPage", true);
327 } 370 }
328 this.close() 371 this.close();
329 } else { 372 } else {
330 if (res.result && res.result.length > 0) { 373 if (res.result && res.result.length > 0) {
331 this.$popup("申请错误明细", "components/ywdialog", { width: '36%', formData: { result: res.result } }) 374 this.$popup("申请错误明细", "components/ywdialog", {
375 width: "36%",
376 formData: { result: res.result },
377 });
332 } else { 378 } else {
333 this.$popup("申请错误明细", "components/ywdialog", { width: '36%', formData: { message: res.message } }) 379 this.$popup("申请错误明细", "components/ywdialog", {
380 width: "36%",
381 formData: { message: res.message },
382 });
334 } 383 }
335 } 384 }
336 }).catch(() => {
337 this.loading = false
338 }) 385 })
386 .catch(() => {
387 this.loading = false;
388 });
339 }, 389 },
340 /** 390 /**
341 * @description: close 391 * @description: close
342 * @param {*} val 392 * @param {*} val
343 * @author: renchao 393 * @author: renchao
344 */ 394 */
345 close () { 395 close() {
346 ywPopupCacel() 396 ywPopupCacel();
347 }, 397 },
348 }, 398 },
349 computed: { 399 computed: {
350 lpbContentHeight () { 400 lpbContentHeight() {
351 return this.onlyShow ? 32 : 76 401 return this.onlyShow ? 32 : 76;
352 // return 76 402 // return 76
353 } 403 },
354 }, 404 },
355 watch: { 405 watch: {
356 //户右键菜单显示时,监听到鼠标点击时关闭户右键菜单 406 //户右键菜单显示时,监听到鼠标点击时关闭户右键菜单
357 lpbChVisible (value) { 407 lpbChVisible(value) {
358 if (value) { 408 if (value) {
359 document.body.addEventListener("click", this.closeMenu); 409 document.body.addEventListener("click", this.closeMenu);
360 } else { 410 } else {
361 document.body.removeEventListener("click", this.closeMenu); 411 document.body.removeEventListener("click", this.closeMenu);
362 } 412 }
363 }
364 }, 413 },
365 }; 414 },
415 };
366 </script> 416 </script>
367 <style scoped lang="scss"> 417 <style scoped lang="scss">
368 .lpbContent-wrap { 418 .lpbContent-wrap {
369 width: 100%; 419 width: 100%;
370 height: 100%; 420 height: 100%;
371 overflow: hidden; 421 overflow: hidden;
...@@ -437,5 +487,5 @@ ...@@ -437,5 +487,5 @@
437 background: #ffffff; 487 background: #ffffff;
438 } 488 }
439 } 489 }
440 } 490 }
441 </style> 491 </style>
......