addoredit.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. <template>
  2. <div class="device-info_install addinstall">
  3. <div class="device_content">
  4. <div class="left_content">
  5. <div class="form_head">
  6. <p>基本信息</p>
  7. </div>
  8. <div class="form_content">
  9. <el-scrollbar class="app-list-scroll" style="height: 100%">
  10. <div class="form_content_disform">
  11. <zz-form :cols="detailCols" :data="formdata" :rules="formrules" labelWidth="98" ref="detailform">
  12. <el-select v-model="formdata.communityId" placeholder="请选择社区名称" slot="communityId">
  13. <el-option
  14. v-for="(item, index) in communityArray"
  15. :label="item.communityName"
  16. :value="item.id"
  17. :key="index"
  18. ></el-option>
  19. </el-select>
  20. <el-select v-model="formdata.buildingType" placeholder="请选择楼栋类型" slot="buildingTypeList">
  21. <el-option label="高层" :value="1"></el-option>
  22. <el-option label="底层" :value="2"></el-option>
  23. </el-select>
  24. <el-select v-model="formdata.buildingPurpose" placeholder="请选择楼栋用途" slot="buildingPurpose">
  25. <el-option
  26. v-for="(item, index) in buildingPurposeType"
  27. :label="item.label"
  28. :value="item.id"
  29. :key="index"
  30. ></el-option>
  31. </el-select>
  32. <el-select v-model="formdata.buildingStructure" placeholder="请选择楼栋用途" slot="buildingStructure">
  33. <el-option
  34. v-for="(item, index) in buildingStructureType"
  35. :label="item.label"
  36. :value="item.id"
  37. :key="index"
  38. ></el-option>
  39. </el-select>
  40. <el-input
  41. type="textarea"
  42. :rows="4"
  43. slot="remarks"
  44. show-word-limit
  45. v-model="formdata.remarks"
  46. maxlength="300"
  47. >
  48. </el-input>
  49. </zz-form>
  50. </div>
  51. </el-scrollbar>
  52. </div>
  53. </div>
  54. <div class="right_content">
  55. <div class="right_content_head">
  56. <span class="head_text">创建房屋</span>
  57. <span class="close" @click="close">
  58. <i class="el-icon-close"></i>
  59. </span>
  60. </div>
  61. <div class="right_content_info">
  62. <div class="head_fr">
  63. <div class="head_content head_add">
  64. <div class="checkbox_style">
  65. <el-checkbox @change="checkedUnit" v-model="initialUnitList.checkedUnit"></el-checkbox>
  66. </div>
  67. <div class="form_content">
  68. <zz-form
  69. :cols="unitCols"
  70. labelposition="left"
  71. :rules="unitrules"
  72. :data="formdata"
  73. :disabled="!isAdd"
  74. labelWidth="50"
  75. ref="unitform"
  76. >
  77. <template slot="unitRule" prop="unitRule">
  78. <div class="row_class">
  79. <el-radio-group
  80. :disabled="!initialUnitList.checkedUnit"
  81. v-model="initialUnitList.unit.type"
  82. @change="radioChange('unit', $event)"
  83. >
  84. <el-radio label="Number">按数字1-20生成</el-radio>
  85. <el-radio label="Letter">按字母A-Z生成</el-radio>
  86. </el-radio-group>
  87. <el-select
  88. :disabled="!initialUnitList.checkedUnit"
  89. class="w120 wfirst"
  90. v-model="initialUnitList.unit.start"
  91. prop="floorstart"
  92. placeholder="起始单元"
  93. >
  94. <el-option
  95. v-for="item in unitOptions"
  96. :key="item.value"
  97. :label="item.label"
  98. :value="item.value"
  99. >
  100. </el-option>
  101. </el-select>
  102. <el-select
  103. class="w120 wsecond"
  104. :disabled="!initialUnitList.checkedUnit"
  105. v-model="initialUnitList.unit.end"
  106. placeholder="单元数"
  107. >
  108. <el-option
  109. v-for="item in unitOptions"
  110. :key="item.value"
  111. :label="item.label"
  112. :value="item.value"
  113. >
  114. </el-option>
  115. </el-select>
  116. </div>
  117. <div class="row_class addfloo">
  118. <div class="last_level">
  119. <label class="label_text">每栋层数</label>
  120. <el-select class="w120" v-model="formdata.floorsNumber" placeholder="请选择楼栋层数">
  121. <el-option
  122. v-for="item in floorlevelOptions"
  123. :key="item.value"
  124. :label="item.label"
  125. :value="item.value"
  126. >
  127. </el-option>
  128. </el-select>
  129. </div>
  130. <div class="last_level">
  131. <label class="label_text">每层户数</label>
  132. <el-select class="w120" v-model="formdata.householdsPerFloor" placeholder="请选择每层户数">
  133. <el-option
  134. v-for="item in unithouseOptions"
  135. :key="item.value"
  136. :label="item.label"
  137. :value="item.value"
  138. >
  139. </el-option>
  140. </el-select>
  141. </div>
  142. <div class="last_level">
  143. <label class="label_text">房屋类型</label>
  144. <el-select class="w120" v-model="formdata.houseType" placeholder="请选择每层户数">
  145. <el-option label="住宅" :value="1"></el-option>
  146. <el-option label="商业" :value="2"></el-option>
  147. </el-select>
  148. </div>
  149. </div>
  150. </template>
  151. </zz-form>
  152. </div>
  153. <div class="btn_unit">
  154. <el-button type="primary" class="el-mgRight-md" :disabled="!isAdd" @click="createDoor"
  155. >{{ doorData.length ? '重新' : '' }}生成房屋</el-button
  156. >
  157. <el-button @click="clearDoor" :disabled="!isAdd">清空房屋</el-button>
  158. </div>
  159. </div>
  160. <div class="title_class">
  161. <span class="title_txt">楼栋信息</span>
  162. <el-tooltip v-if="doorData && doorData.length > 0" class="item text-wrapper" effect="light" placement="right">
  163. <div slot="content">
  164. 双击可对楼栋、单元名称进行自定义修改<br />单击选中楼栋、单元、单元户信息根据选中的楼栋、单元进行展示
  165. </div>
  166. <img src="@/assets/img/menuicon/icon_tishi_zhengchang.png" alt="" />
  167. </el-tooltip>
  168. </div>
  169. </div>
  170. <div class="floorinfo">
  171. <div class="door-wrap door_install">
  172. <div class="top_content" :class="!isAdd ? 'is-disabled' : ''">
  173. <el-scrollbar class="app-list-scroll" style="height: 100%">
  174. <div class="floor_unit" v-if="doorData && doorData.length > 0">
  175. <div class="box clearfix">
  176. <div class="label_left">楼栋</div>
  177. <div class="el-fl-left tags">
  178. <el-tag :disable-transitions="false" data-code="build" class="active">
  179. {{ formdata.buildingName }}
  180. </el-tag>
  181. </div>
  182. </div>
  183. <div
  184. class="box clearfix"
  185. v-if="
  186. initialUnitList.enableUnit &&
  187. doorData[buildingIndex] &&
  188. doorData[buildingIndex].unitFloorList &&
  189. doorData[buildingIndex].unitFloorList.length
  190. "
  191. >
  192. <div class="label_left">单元</div>
  193. <div class="el-fl-left tags">
  194. <el-tag
  195. :key="index2"
  196. v-for="(unit, index2) in doorData"
  197. closable
  198. :disable-transitions="false"
  199. data-code="unit"
  200. @close="handleClose('unit', index2, doorData)"
  201. @click="unitIndex = index2"
  202. :class="{ active: unitIndex === index2 }"
  203. >
  204. <span @dblclick="showInput">{{ unit.unitName }}</span>
  205. <el-input
  206. style="display: none"
  207. v-model="unit.unitName"
  208. @keyup.enter.native="inputConfirm($event, doorData)"
  209. @blur="inputConfirm($event, doorData)"
  210. data-code="unit"
  211. maxlength="20"
  212. ></el-input>
  213. </el-tag>
  214. <el-button class="el-icon-plus button-new-tag" size="small" @click="showInput"></el-button>
  215. <el-input
  216. class="input-new-tag"
  217. style="display: none"
  218. size="small"
  219. placeholder="请输入单元号"
  220. v-model="inputValue.unit"
  221. @keyup.enter.native="handleInputConfirm($event, doorData)"
  222. @blur="handleInputConfirm($event, doorData)"
  223. data-code="unit"
  224. maxlength="20"
  225. >
  226. </el-input>
  227. </div>
  228. </div>
  229. </div>
  230. <div v-else class="empty_floor">
  231. <p>暂无相关信息</p>
  232. </div>
  233. <div class="title_class border_hr">
  234. <span class="title_txt">单元户信息</span>
  235. <el-tooltip
  236. v-if="
  237. doorData[buildingIndex] &&
  238. doorData[buildingIndex].unitFloorList &&
  239. doorData[buildingIndex].unitFloorList.length
  240. "
  241. class="item"
  242. effect="light"
  243. placement="right"
  244. :content="unitMsg"
  245. >
  246. <img src="@/assets/img/menuicon/icon_tishi_zhengchang.png" alt="" />
  247. </el-tooltip>
  248. </div>
  249. <div
  250. class="unit"
  251. v-if="
  252. doorData[buildingIndex] &&
  253. doorData[buildingIndex].unitFloorList &&
  254. doorData[buildingIndex].unitFloorList.length
  255. "
  256. >
  257. <div
  258. class="floor"
  259. v-if="
  260. doorData[buildingIndex].unitFloorList[unitIndex] &&
  261. doorData[buildingIndex].unitFloorList[unitIndex].roomList &&
  262. doorData[buildingIndex].unitFloorList[unitIndex].roomList.length
  263. "
  264. >
  265. <!-- <h2>单元户<span>鼠标双击修改名称; 修改楼层名称后,请自行修改单元户的名称</span></h2> -->
  266. <div
  267. class="box clearfix"
  268. :key="index3"
  269. v-for="(floor, index3) in doorData[buildingIndex].unitFloorList"
  270. >
  271. <!-- <span class="el-fl-left label">楼层:</span> -->
  272. <div class="unit_left">
  273. <el-tag
  274. closable
  275. :disable-transitions="false"
  276. data-code="floor"
  277. @close="handleClose('floor', index3, doorData[buildingIndex].unitFloorList)"
  278. >
  279. <span @dblclick="showInput">{{ floor.floorNumber }}</span>
  280. <el-input
  281. style="display: none"
  282. v-model="floor.floorNumber"
  283. @keyup.enter.native="
  284. inputConfirm($event, doorData[buildingIndex].unitFloorList)
  285. "
  286. @blur="inputConfirm($event, doorData[buildingIndex].unitFloorList)"
  287. data-code="floor"
  288. maxlength="20"
  289. ></el-input>
  290. </el-tag>
  291. <span class="unit_text">层</span>
  292. </div>
  293. <span class="el-fl-left tags">
  294. <div class="door" v-if="floor">
  295. <el-tag
  296. :key="index4"
  297. v-for="(door, index4) in floor.roomList"
  298. closable
  299. :disable-transitions="false"
  300. data-code="door"
  301. @close="handleClose('door', index4, floor.roomList)"
  302. >
  303. <span @dblclick="showInput">{{ door.roomNumber }}</span>
  304. <el-input
  305. style="display: none"
  306. v-model="door.roomNumber"
  307. @keyup.enter.native="inputConfirm($event, floor.roomList)"
  308. @blur="inputConfirm($event, floor.roomList)"
  309. data-code="door"
  310. maxlength="20"
  311. ></el-input>
  312. </el-tag>
  313. <el-button
  314. class="el-icon-plus button-new-tag"
  315. size="small"
  316. @click="showInput"
  317. ></el-button>
  318. <el-input
  319. class="input-new-tag"
  320. style="display: none"
  321. size="small"
  322. placeholder="请输入户号"
  323. v-model="inputValue.door"
  324. @keyup.enter.native="handleInputConfirm($event, floor.roomList)"
  325. @blur="handleInputConfirm($event, floor.roomList)"
  326. data-code="door"
  327. maxlength="20"
  328. >
  329. </el-input>
  330. </div>
  331. </span>
  332. </div>
  333. <div class="add-floor">
  334. <el-button class="el-icon-plus button-new-tag" size="small" @click="showInput"></el-button>
  335. <el-input
  336. class="input-new-tag"
  337. style="display: none"
  338. size="small"
  339. placeholder="请输入楼层号"
  340. v-model="inputValue.floor"
  341. @keyup.enter.native="handleInputConfirm($event, doorData[buildingIndex].unitFloorList)"
  342. @blur="handleInputConfirm($event, doorData[buildingIndex].unitFloorList)"
  343. data-code="floor"
  344. maxlength="20"
  345. >
  346. </el-input>
  347. </div>
  348. </div>
  349. </div>
  350. <div v-else class="unit_empty">
  351. <div class="center_text">
  352. <img src="@assets/img/menuicon/img_wuxiaoxi@2x.png" alt="" />
  353. <span>暂无相关信息</span>
  354. </div>
  355. </div>
  356. </el-scrollbar>
  357. </div>
  358. <div class="btns footer_btn">
  359. <el-button @click="resetForm">重置</el-button>
  360. <el-button @click="close">取消</el-button>
  361. <el-button type="primary" @click="submit">确认</el-button>
  362. </div>
  363. </div>
  364. </div>
  365. </div>
  366. </div>
  367. </div>
  368. </div>
  369. </template>
  370. <script>
  371. import initList from '../mixins/initList';
  372. import { initDoor, calcDoor } from './basedata';
  373. const createContinueData = (type, num) => {
  374. //type--类型,num生成的个数
  375. let objArr = [];
  376. if (type == 'Number') {
  377. [...new Array(num).keys()].map((idx) => {
  378. let obj = { label: Number(idx) + 1, value: Number(idx) + 1 };
  379. objArr.push(obj);
  380. });
  381. } else {
  382. for (let i = 0; i < num; i++) {
  383. let letter = String.fromCharCode(65 + i);
  384. let obj = { label: letter, value: letter };
  385. objArr.push(obj);
  386. }
  387. }
  388. return objArr;
  389. };
  390. const txtI18n = {
  391. build: '楼栋',
  392. unit: '单元',
  393. floor: '楼层',
  394. door: '单元户'
  395. };
  396. export default {
  397. mixins: [initList],
  398. data() {
  399. return {
  400. unitCols: [[{ label: '单元', slot: 'unitRule', prop: 'unitRule' }]],
  401. detailCols: [
  402. [
  403. {
  404. label: '所属社区',
  405. prop: 'communityId',
  406. slot: 'communityId'
  407. },
  408. {
  409. label: '楼栋名称',
  410. prop: 'buildingName',
  411. input: 'true'
  412. },
  413. {
  414. label: '楼栋编号',
  415. prop: 'buildingNumber',
  416. input: 'true'
  417. },
  418. {
  419. label: '楼栋类型',
  420. prop: 'buildingTypeList',
  421. slot: 'buildingTypeList'
  422. },
  423. {
  424. label: '楼栋用途',
  425. prop: 'buildingPurpose',
  426. slot: 'buildingPurpose'
  427. },
  428. {
  429. label: '建筑结构',
  430. prop: 'buildingStructure',
  431. slot: 'buildingStructure'
  432. },
  433. {
  434. label: '建成日期',
  435. prop: 'builtDate',
  436. date: 'true'
  437. },
  438. {
  439. label: '验收日期',
  440. prop: 'acceptanceDate',
  441. date: 'true'
  442. },
  443. {
  444. label: '建筑面积',
  445. prop: 'buildingArea',
  446. input: true
  447. },
  448. {
  449. label: '使用面积',
  450. prop: 'useArea',
  451. input: 'true'
  452. },
  453. {
  454. label: '备注信息',
  455. prop: 'remarks',
  456. slot: 'remarks'
  457. }
  458. ]
  459. ],
  460. formdata: {
  461. communityId: '',
  462. buildingName: '',
  463. buildingNumber: '', //楼栋编号
  464. buildingType: '',
  465. buildingPurpose: '',
  466. buildingStructure: '',
  467. builtDate: '',
  468. acceptanceDate: '',
  469. buildingArea: '',
  470. useArea: '',
  471. remarks: '',
  472. houseType: 1,
  473. floorsNumber: '1', //每栋层数
  474. unitNumber: '2', //单元数
  475. householdsPerFloor: '1' //每层户数
  476. },
  477. initialUnitList: {
  478. checkedUnit: true,
  479. enableUnit: 1, //勾选了复选框
  480. unit: {
  481. type: 'Number', // Number letter
  482. start: '1', // 1 A单元的起始单元
  483. end: '1'
  484. }
  485. },
  486. formrules: {
  487. communityId: this.$valid.selectRequired(['社区']),
  488. buildingName: [this.$valid.inputRequired('楼栋名称')]
  489. },
  490. buildingPurposeType: [
  491. {
  492. label: '住宅楼',
  493. id: 1
  494. },
  495. {
  496. label: '商场',
  497. id: 2
  498. },
  499. {
  500. label: '写字楼',
  501. id: 3
  502. },
  503. {
  504. label: '公寓',
  505. id: 4
  506. },
  507. {
  508. label: '别墅',
  509. id: 5
  510. },
  511. {
  512. label: '自建楼',
  513. id: 6
  514. },
  515. {
  516. label: '其他',
  517. id: 7
  518. }
  519. ],
  520. buildingStructureType: [
  521. {
  522. label: '钢结构',
  523. id: 1
  524. },
  525. {
  526. label: '钢筋混凝土结构',
  527. id: 2
  528. },
  529. {
  530. label: '筋混凝土结构',
  531. id: 3
  532. },
  533. {
  534. label: '混合结构',
  535. id: 4
  536. },
  537. {
  538. label: '砖木结构',
  539. id: 5
  540. },
  541. {
  542. label: '其他结构',
  543. id: 6
  544. }
  545. ]
  546. };
  547. },
  548. props: {
  549. params: {
  550. type: Object
  551. },
  552. isAdd: {
  553. type: Boolean,
  554. default: true
  555. }
  556. },
  557. methods: {
  558. radioChange(type, val) {
  559. let length = val == 'Number' ? '20' : '26';
  560. if (val == 'Letter') {
  561. this.unitOptions = createContinueData(val, length);
  562. this.initialUnitList.unit.type = 'Letter';
  563. this.initialUnitList.unit.start = 'A';
  564. this.initialUnitList.unit.end = 'A';
  565. } else {
  566. this.initialUnitList.unit = this.copyrules.unit;
  567. this.unitOptions = createContinueData(val, length);
  568. }
  569. },
  570. resetForm() {
  571. this.formdata = {};
  572. this.formdata = this.copyformdata;
  573. this.doorData = [];
  574. this.$refs.detailform.validateField('communityId');
  575. },
  576. checkedUnit(val) {
  577. if (val) {
  578. this.initialUnitList.enableUnit = 1;
  579. } else {
  580. this.formdata.unitNumber = 1;
  581. this.initialUnitList.enableUnit = 0;
  582. }
  583. },
  584. createDoor() {
  585. if (this.formdata.buildingName == '') {
  586. this.$message.error('先输入楼栋名称');
  587. return;
  588. }
  589. new Promise((resolve) => {
  590. this.$refs.unitform.validate(resolve);
  591. }).then((v) => {
  592. if (this.initialUnitList.checkedUnit) {
  593. this.initialUnitList.enableUnit = 1;
  594. } else {
  595. this.formdata.unitNumber = 1;
  596. this.initialUnitList.enableUnit = 0;
  597. }
  598. let isNumberUnitFlag = this.initialUnitList.unit.type == 'Number' ? true : false;
  599. let checkUnit = this.initialUnitList.unit.start <= this.initialUnitList.unit.end ? true : false;
  600. if (this.initialUnitList.checkedUnit) {
  601. if (checkUnit && isNumberUnitFlag) {
  602. this.formdata.unitNumber = this.initialUnitList.unit.end - this.initialUnitList.unit.start + 1;
  603. } else if (!isNumberUnitFlag && checkUnit) {
  604. this.formdata.unitNumber =
  605. this.initialUnitList.unit.end.charCodeAt() - this.initialUnitList.unit.start.charCodeAt() + 1;
  606. } else {
  607. this.formdata.unitNumber = 1;
  608. this.$message.error('单元起始和结束设置出错');
  609. return;
  610. }
  611. }
  612. this.doorData = initDoor(this.formdata, this.initialUnitList).generateUnit;
  613. });
  614. },
  615. handleInputConfirm(e, arr) {
  616. const { value, dataset } = e.target;
  617. if (value && dataset) {
  618. const { code } = dataset;
  619. const querySame = () => _.isEmpty(_.filter(arr, (v) => v.name == value));
  620. const generate = {
  621. unit: initDoor(this.formdata, this.initialUnitList).generateUnit,
  622. floor: initDoor(this.formdata, this.initialUnitList).generateFloor,
  623. door: initDoor(this.formdata, this.initialUnitList).generateDoor(value)
  624. };
  625. if (querySame()) {
  626. if (code == 'unit') {
  627. arr.push({
  628. unitName: value,
  629. unitFloorList: code != 'door' ? generate['floor'] : undefined
  630. });
  631. } else if (code == 'door') {
  632. arr.push({
  633. roomNumber: value
  634. });
  635. } else if (code == 'floor') {
  636. arr.push({
  637. floorNumber: value,
  638. roomList: code != 'door' ? generate['door'] : undefined
  639. });
  640. }
  641. this.inputValue[code] = '';
  642. } else {
  643. this.$message.error(`${txtI18n[code]}名称重复,请重新添加`);
  644. }
  645. }
  646. e.target.parentElement.style.display = 'none';
  647. e.target.parentElement.previousElementSibling.style.display = 'inline-block';
  648. e.target.value = '';
  649. },
  650. submit() {
  651. new Promise((resolve) => {
  652. this.$refs.detailform.validate(resolve);
  653. }).then((v) => {
  654. const { buildNumber, unitNumber, floorNumber, doorNumber } = calcDoor(this.doorData, this.initialUnitList.checkedUnit);
  655. const txt = `请检查信息是否填写完整(包含重复名称,名称为空现象)<br>确认提交单元户信息:<br>总楼栋数:${buildNumber}${
  656. this.initialUnitList.enableUnit ? `<br>总单元数:${unitNumber}` : ''
  657. }<br>总楼层数:${floorNumber}<br>总单元户数:${doorNumber}`;
  658. this.__confirm(txt, '提交')
  659. .then((v) => {
  660. this.formdata.buildingUnitList = this.doorData;
  661. console.log(this.formdata);
  662. let url = '/sc-community/assets/building/add';
  663. if (!!this.params.id) {
  664. url = '/sc-community/assets/building/update';
  665. }
  666. this.$http
  667. .post(url, this.formdata)
  668. .then(({ msg, status }) => {
  669. this.$message({
  670. type: status === 0 ? 'success' : 'error',
  671. message: msg
  672. });
  673. if (status === 0) {
  674. this.close();
  675. }
  676. })
  677. .catch(() => {});
  678. })
  679. .catch(() => {});
  680. });
  681. },
  682. getDetailData(id) {
  683. this.$http.get('/sc-community/assets/building/house/find', { id: id }).then(({ status, data, msg }) => {
  684. if (0 === status) {
  685. if (data.buildingUnitList.length !== 0) {
  686. this.formdata = data;
  687. this.formdata.householdsPerFloor = data.buildingUnitList[0].unitFloorList[0].roomList.length;
  688. this.initialUnitList = {
  689. checkedUnit: true,
  690. enableUnit: 1, //勾选了复选框
  691. unit: {
  692. type: 'Number', // Number letter
  693. start: data.buildingUnitList[0]['unitName'], // 1 A单元的起始单元
  694. end: data.buildingUnitList[data.buildingUnitList.length - 1]['unitName']
  695. }
  696. };
  697. this.doorData = data.buildingUnitList;
  698. }
  699. }
  700. });
  701. }
  702. },
  703. mounted() {},
  704. created() {
  705. this.copyformdata = this.deepClone(this.formdata);
  706. if (!!this.params.id) {
  707. this.getDetailData(this.params.id);
  708. }
  709. this.copyrules = JSON.parse(JSON.stringify(this.initialUnitList));
  710. }
  711. };
  712. </script>
  713. <style lang="scss" >
  714. @import './popup.scss';
  715. </style>