roomIndex.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  1. <template>
  2. <div>
  3. <div class="custom-tree-container">
  4. <div class="block-l">
  5. <el-card shadow="hover" style="background: white">
  6. <el-tag class="full space-vertical">当前所选:载体结构</el-tag>
  7. <!-- @node-click="handleDeptNodeClick" -->
  8. <el-tree
  9. ref="selectTree"
  10. :default-expand-all="false"
  11. :data="DeptTree"
  12. node-key="id"
  13. :indent="deptTreeIndent"
  14. accordion
  15. :expand-on-click-node="expandDeptClick"
  16. :default-expanded-keys="expandedDeptKey"
  17. node-click="(data, node, item) => nodeClick(data, node, item)"
  18. @node-click="getCheckedNodes"
  19. >
  20. <span slot-scope="{ node, data }" class="custom-tree-node">
  21. <span>
  22. <i v-if="data.level == 0" class="el-icon-s-home" />
  23. <i v-else-if="data.level == 1" class="el-icon-menu" />
  24. <i v-else class="el-icon-link" />
  25. {{ node.label }}
  26. </span>
  27. <span v-if="data.level == 0">
  28. <el-link class="space" type="primary" @click="() => unFoldAll()">展开</el-link>
  29. <el-link class="space" type="primary" @click="() => collapseAll()">折叠</el-link>
  30. </span>
  31. </span>
  32. </el-tree>
  33. </el-card>
  34. </div>
  35. <div class="block-r">
  36. <div style="width: 100%;padding: 10px;background: white;margin-bottom: 10px;">
  37. <el-row class="lineheight20">
  38. <el-col :span="2">
  39. 用途:
  40. </el-col>
  41. <el-col :span="22">
  42. <el-checkbox-group
  43. v-model="roomUse"
  44. >
  45. <el-checkbox
  46. v-for="item in dc_data.HOUSE_USAGE"
  47. :key="item.value"
  48. :label="item.value"
  49. >{{ item.label }}</el-checkbox>
  50. </el-checkbox-group>
  51. </el-col>
  52. </el-row>
  53. <el-row class="lineheight20">
  54. <el-col :span="2">
  55. 装修情况:
  56. </el-col>
  57. <el-col :span="22">
  58. <el-checkbox-group
  59. v-model="decorationSituation"
  60. >
  61. <el-checkbox
  62. v-for="item in dc_data.DECORATION_SITUATION"
  63. :key="item.value"
  64. :label="item.value"
  65. >{{ item.label }}</el-checkbox>
  66. </el-checkbox-group>
  67. </el-col>
  68. </el-row>
  69. <el-row class="lineheight20">
  70. <el-col :span="2">
  71. 可售状态:
  72. </el-col>
  73. <el-col :span="22">
  74. <el-checkbox-group
  75. v-model="saleStatus"
  76. >
  77. <el-checkbox
  78. v-for="item in dc_data.SALE_STATUS"
  79. :key="item.value"
  80. :label="item.value"
  81. >{{ item.label }}</el-checkbox>
  82. </el-checkbox-group>
  83. </el-col>
  84. </el-row>
  85. <el-row class="lineheight20">
  86. <el-col :span="2">
  87. 已售状态:
  88. </el-col>
  89. <el-col :span="22">
  90. <el-checkbox-group
  91. v-model="soldStatus"
  92. >
  93. <el-checkbox
  94. v-for="item in dc_data.SOLD_STATUS"
  95. :key="item.value"
  96. :label="item.value"
  97. >{{ item.label }}</el-checkbox>
  98. </el-checkbox-group>
  99. </el-col>
  100. </el-row>
  101. <el-row class="lineheight20">
  102. <el-col :span="4">
  103. <div style="margin-top: 6px">套内面积(㎡):</div>
  104. </el-col>
  105. <el-col :span="4">
  106. <el-input v-model="queryParam.actualInternalArea" size="small" placeholder="请输入面积" class="ch-input-size" @keyup.enter.native="handleSearch()" />
  107. </el-col>
  108. <el-col :span="4">
  109. <div style="margin-top: 6px">建筑面积(㎡):</div>
  110. </el-col>
  111. <el-col :span="4">
  112. <el-input v-model="queryParam.actualBuildArea" size="small" placeholder="请输入面积" class="ch-input-size" @keyup.enter.native="handleSearch()" />
  113. </el-col>
  114. </el-row>
  115. <el-row class="lineheight20">
  116. <el-col :span="2">
  117. <div style="margin-top: 6px">关键字:</div>
  118. </el-col>
  119. <el-col :span="4">
  120. <el-input v-model="queryParam.roomNo" size="small" placeholder="请输入房号" class="ch-input-size" @keyup.enter.native="handleSearch()" />
  121. </el-col>
  122. </el-row>
  123. <el-row class="lineheight20">
  124. <el-col :span="24" style="text-align: right">
  125. <el-button size="small" class="ch-button-warning" @click="handleReset()"><i class="el-icon-menu" />&nbsp;重置</el-button>
  126. <el-button size="small" class="ch-button" @click="handleSearch()"><i class="el-icon-menu" />&nbsp;查询</el-button>
  127. </el-col>
  128. </el-row>
  129. </div>
  130. <el-row class="lineheight20">
  131. <el-col :span="24">
  132. <el-table
  133. ref="singleTable"
  134. v-loading="loading"
  135. :data="AllData"
  136. highlight-current-row
  137. @selection-change="handleSelectionChange"
  138. >
  139. <el-table-column
  140. type="selection"
  141. :selectable="selectable"
  142. />
  143. <el-table-column label="编号" type="index" width="60" />
  144. <el-table-column label="单元/楼栋号" prop="buildName" />
  145. <el-table-column label="所在层" prop="floor" />
  146. <el-table-column label="户室号" prop="roomNo" />
  147. <el-table-column label="套内面积(㎡)" prop="actualInternalArea" />
  148. <el-table-column label="建筑面积(㎡)" prop="actualBuildArea" />
  149. <el-table-column label="用途" prop="roomUseStr" />
  150. <el-table-column label="装修情况" prop="decorationSituationStr" />
  151. <el-table-column label="可售状态" prop="saleStatusStr" />
  152. <el-table-column label="已售状态" prop="soldStatusStr" />
  153. <el-table-column label="操作" header-align="center" width="250">
  154. <template scope="scope">
  155. <el-button size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
  156. <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除</el-button>
  157. <el-button size="mini" type="text" @click="handleView(scope.row)">查看</el-button>
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. <div class="table-page">
  162. <el-pagination
  163. :current-page.sync="currentPage"
  164. :page-sizes="[10, 20, 50, 100]"
  165. :page-size="pageSize"
  166. background
  167. layout="total, sizes, prev, pager, next, jumper"
  168. :total="allpage"
  169. @size-change="handleSizeChange"
  170. @current-change="handleCurrentChange"
  171. />
  172. </div>
  173. </el-col>
  174. </el-row>
  175. <el-row style="float: right">
  176. <el-button @click="handleConnectCancel">取 消</el-button>
  177. <el-button type="primary" @click="handleConnect()">确 定</el-button>
  178. </el-row>
  179. </div>
  180. </div>
  181. <el-dialog
  182. :title="dialogTitle"
  183. :visible.sync="dialogVisible"
  184. :before-close="dialogChose"
  185. width="75%"
  186. top="50px"
  187. class="statistic_base"
  188. :append-to-body="true"
  189. :modal-append-to-body="true"
  190. custom-class="tagdialog"
  191. @open="dlgOpen"
  192. >
  193. <el-form ref="houseForm" :model="houseForm" style="width: 100%;padding: 5px" :rules="commitRules">
  194. <el-row>
  195. <el-col style="padding-bottom: 10px">
  196. <!-- <span class="card_title">基本信息</span>-->
  197. <el-card shadow="always" style="padding-top: 10px">
  198. <el-row>
  199. <el-col :span="2" class="col-txt"><span>*父级</span></el-col>
  200. <el-col :span="22" class="col-input">
  201. <el-form-item prop="findids">
  202. <el-cascader
  203. v-model="houseForm.findids"
  204. :append-to-body="false"
  205. :disabled="isView"
  206. style="width: 100%;"
  207. :options="options"
  208. @change="buildChange"
  209. />
  210. </el-form-item>
  211. </el-col>
  212. </el-row>
  213. <el-row>
  214. <el-col :span="2" class="col-txt"><span>*户室号</span></el-col>
  215. <el-col :span="10" class="col-input">
  216. <el-form-item prop="roomNo">
  217. <el-input v-model="houseForm.roomNo" :disabled="isView" />
  218. </el-form-item>
  219. </el-col>
  220. <el-col :span="2" class="col-txt"><span>*所在层</span></el-col>
  221. <el-col :span="10" class="col-input">
  222. <el-form-item prop="floor">
  223. <el-input v-model="houseForm.floor" :disabled="isView" />
  224. </el-form-item>
  225. </el-col>
  226. </el-row>
  227. <el-row>
  228. <el-col :span="3" class="col-txt"><span>*预测套内面积(㎡)</span></el-col>
  229. <el-col :span="9" class="col-input">
  230. <el-form-item prop="roomNo">
  231. <el-input v-model="houseForm.predictionInternalArea" :disabled="isView" />
  232. </el-form-item>
  233. </el-col>
  234. <el-col :span="3" class="col-txt"><span>*预测分摊面积(㎡)</span></el-col>
  235. <el-col :span="9" class="col-input">
  236. <el-form-item prop="roomNo">
  237. <el-input v-model="houseForm.predictionShareArea" :disabled="isView" />
  238. </el-form-item>
  239. </el-col>
  240. </el-row>
  241. <el-row>
  242. <el-col :span="3" class="col-txt"><span>*预测建筑面积(㎡)</span></el-col>
  243. <el-col :span="9" class="col-input">
  244. <el-form-item prop="roomNo">
  245. <el-input v-model="houseForm.predictionBuildArea" :disabled="isView" />
  246. </el-form-item>
  247. </el-col>
  248. <el-col :span="3" class="col-txt"><span>*预测土地面积(㎡)</span></el-col>
  249. <el-col :span="9" class="col-input">
  250. <el-form-item prop="roomNo">
  251. <el-input v-model="houseForm.predictionLandArea" :disabled="isView" />
  252. </el-form-item>
  253. </el-col>
  254. </el-row>
  255. <el-row>
  256. <el-col :span="3" class="col-txt"><span>*实测套内面积(㎡)</span></el-col>
  257. <el-col :span="9" class="col-input">
  258. <el-form-item prop="actualInternalArea">
  259. <el-input v-model="houseForm.actualInternalArea" :disabled="isView" />
  260. </el-form-item>
  261. </el-col>
  262. <el-col :span="3" class="col-txt"><span>*实测分摊面积(㎡)</span></el-col>
  263. <el-col :span="9" class="col-input">
  264. <el-form-item prop="actualShareArea">
  265. <el-input v-model="houseForm.actualShareArea" :disabled="isView" />
  266. </el-form-item>
  267. </el-col>
  268. </el-row>
  269. <el-row>
  270. <el-col :span="3" class="col-txt"><span>*实测建筑面积(㎡)</span></el-col>
  271. <el-col :span="9" class="col-input">
  272. <el-form-item prop="actualBuildArea">
  273. <el-input v-model="houseForm.actualBuildArea" :disabled="isView" />
  274. </el-form-item>
  275. </el-col>
  276. <el-col :span="3" class="col-txt"><span>*实测土地面积(㎡)</span></el-col>
  277. <el-col :span="9" class="col-input">
  278. <el-form-item prop="actualLandArea">
  279. <el-input v-model="houseForm.actualLandArea" :disabled="isView" />
  280. </el-form-item>
  281. </el-col>
  282. </el-row>
  283. <el-row>
  284. <el-col :span="2" class="col-txt"><span>*用途:</span></el-col>
  285. <el-col :span="10" class="col-input">
  286. <el-form-item prop="roomUse">
  287. <el-select
  288. v-model="houseForm.roomUse"
  289. :popper-append-to-body="false"
  290. popper-class="statistic_base"
  291. placeholder=""
  292. filterable
  293. :disabled="isView"
  294. >
  295. <el-option
  296. v-for="item in dc_data.HOUSE_USAGE"
  297. :key="item.value"
  298. popper-class="statistic_base"
  299. :popper-append-to-body="false"
  300. :label="item.label"
  301. :value="item.value"
  302. />
  303. </el-select>
  304. </el-form-item>
  305. </el-col>
  306. <el-col :span="2" class="col-txt"><span>*户编号</span></el-col>
  307. <el-col :span="10" class="col-input">
  308. <el-form-item prop="roomNumber">
  309. <el-input v-model="houseForm.roomNumber" :disabled="isView" />
  310. </el-form-item>
  311. </el-col>
  312. </el-row>
  313. <el-row>
  314. <el-col :span="2" class="col-txt"><span>装修情况:</span></el-col>
  315. <el-col :span="10" class="col-input">
  316. <el-form-item>
  317. <el-select
  318. v-model="houseForm.decorationSituation"
  319. placeholder=""
  320. filterable
  321. :disabled="isView"
  322. :popper-append-to-body="false"
  323. popper-class="statistic_base"
  324. >
  325. <el-option
  326. v-for="item in dc_data.DECORATION_SITUATION"
  327. :key="item.value"
  328. :popper-append-to-body="false"
  329. popper-class="statistic_base"
  330. :label="item.label"
  331. :value="item.value"
  332. />
  333. </el-select>
  334. </el-form-item>
  335. </el-col>
  336. <el-col :span="2" class="col-txt"><span>2.2M以</span></el-col>
  337. <el-col :span="10" class="col-input">
  338. <el-form-item>
  339. <el-input v-model="houseForm.twoPointTwo" :disabled="isView" />
  340. </el-form-item>
  341. </el-col>
  342. </el-row>
  343. <el-row>
  344. <el-col :span="2" class="col-txt"><span>户型</span></el-col>
  345. <el-col :span="10" class="col-input">
  346. <el-form-item :disabled="isView">
  347. <el-select
  348. v-model="houseForm.houseTypeId"
  349. placeholder=""
  350. filterable
  351. :disabled="isView"
  352. :popper-append-to-body="false"
  353. popper-class="statistic_base"
  354. @change="houseTypeChange"
  355. >
  356. <el-option
  357. v-for="item in houseTypeOption"
  358. :key="item.value"
  359. :popper-append-to-body="false"
  360. popper-class="statistic_base"
  361. :label="item.label"
  362. :value="item.value"
  363. />
  364. </el-select>
  365. </el-form-item>
  366. </el-col>
  367. </el-row>
  368. <el-row>
  369. <el-col :span="2" class="col-txt"><span>户型图:</span></el-col>
  370. <el-col :span="20" class="col-input">
  371. <el-form-item>
  372. <el-upload
  373. ref="upload"
  374. action
  375. accept="image/png,image/gif,image/jpg,image/jpeg"
  376. list-type="picture-card"
  377. :file-list="fileList"
  378. :limit="9"
  379. :http-request="uploadHouseTypePicture"
  380. :on-preview="handlePictureCardPreview"
  381. :on-remove="handleRemove"
  382. :on-exceed="handleExceed"
  383. disabled
  384. >
  385. <i class="el-icon-plus" />
  386. <div slot="tip" class="el-upload__tip">
  387. 只能上传jpg/png文件,限制上传9张
  388. </div>
  389. </el-upload>
  390. </el-form-item>
  391. </el-col>
  392. </el-row>
  393. <el-row>
  394. <el-col :span="2" class="col-txt"><span>备注:</span></el-col>
  395. <el-col :span="22" class="col-input">
  396. <el-form-item>
  397. <el-input v-model="houseForm.remark" type="textarea" maxlength="2000" show-word-limit :disabled="isView" />
  398. </el-form-item>
  399. </el-col>
  400. </el-row>
  401. <el-row>
  402. <el-col :span="2" class="col-txt"><span>可售状态:</span></el-col>
  403. <el-col :span="22" class="col-input">
  404. <el-form-item>
  405. <el-select
  406. v-model="houseForm.saleStatus"
  407. placeholder="请选择"
  408. size="small"
  409. :disabled="isView"
  410. :popper-append-to-body="false"
  411. popper-class="statistic_base"
  412. >
  413. <el-option
  414. v-for="item in dc_data.SALE_STATUS"
  415. :key="item.value"
  416. :popper-append-to-body="false"
  417. popper-class="statistic_base"
  418. :label="item.label"
  419. :value="item.value"
  420. />
  421. </el-select>
  422. </el-form-item>
  423. </el-col>
  424. </el-row>
  425. </el-card>
  426. </el-col>
  427. </el-row>
  428. </el-form>
  429. <div slot="footer">
  430. <el-button @click="dialogChose">取 消</el-button>
  431. <el-button type="primary" @click="confirmSubmit()">确 定</el-button>
  432. </div>
  433. </el-dialog>
  434. <el-dialog
  435. :visible.sync="dialogImageVisible"
  436. :close-on-click-modal="false"
  437. :close-on-press-escape="false"
  438. append-to-body
  439. >
  440. <img width="100%" :src="dialogImageUrl" alt="">
  441. </el-dialog>
  442. <!-- 批量导入 -->
  443. <upload-cost
  444. v-if="importVisible"
  445. :dialog-visible="importVisible"
  446. :import-type="importType"
  447. :upload-title="uploadTitle"
  448. :import-title="importTitle"
  449. @cancelUpload="cancelImport"
  450. />
  451. </div>
  452. </template>
  453. <script>
  454. import Base from '@/views/base/base.vue'
  455. import BaseData from '@/views/base/baseData.vue'
  456. import BaseDept from '@/views/base/baseDept.vue'
  457. import { upload } from '@/static/utils/channel'
  458. import uploadCost from '@/views/parkAssets/component/uploadCost.vue'
  459. import constant from '@/static/utils/constant'
  460. export default {
  461. name: 'User',
  462. components: { uploadCost },
  463. mixins: [Base, BaseData, BaseDept],
  464. data() {
  465. return {
  466. dc_key: ['HOUSE_USAGE', 'DECORATION_SITUATION', 'SALE_STATUS', 'SOLD_STATUS'],
  467. // 查询参数
  468. queryParam: {
  469. nodeId: '',
  470. level: ''
  471. },
  472. options: [],
  473. houseForm: {
  474. },
  475. DeptTree: [],
  476. urlStr: 'add',
  477. AllData: [],
  478. loading: false,
  479. dialogVisible: false,
  480. dialogTitle: '',
  481. isAdd: true,
  482. commitRules: {
  483. findids: [{ required: true, trigger: 'blur', message: '请选择父级' }],
  484. roomNo: [{ required: true, trigger: 'blur', message: '请输入户室号' }],
  485. floor: [{ required: true, trigger: 'blur', message: '请输入所在层' }],
  486. predictionInternalArea: [{ required: true, trigger: 'blur', message: '请输入预测套内面积' }],
  487. predictionShareArea: [{ required: true, trigger: 'blur', message: '请输入预测分摊面积' }],
  488. predictionBuildArea: [{ required: true, trigger: 'blur', message: '请输入预测建筑面积' }],
  489. predictionLandArea: [{ required: true, trigger: 'blur', message: '请输入预测土地面积' }],
  490. actualInternalArea: [{ required: true, trigger: 'blur', message: '请输入实测分摊面积' }],
  491. actualShareArea: [{ required: true, trigger: 'blur', message: '请输入实测分摊面积' }],
  492. actualBuildArea: [{ required: true, trigger: 'blur', message: '请输入实测建筑面积' }],
  493. actualLandArea: [{ required: true, trigger: 'blur', message: '请输入实测土地面积' }],
  494. roomUse: [{ required: true, trigger: 'blur', message: '请输入用途' }],
  495. roomNumber: [{ required: true, trigger: 'blur', message: '请输入户编号' }]
  496. },
  497. roomId: '',
  498. roomUse: [],
  499. saleStatus: [],
  500. soldStatus: [],
  501. decorationSituation: [],
  502. isView: false,
  503. fileList: [],
  504. houseTypeOption: [],
  505. // 图片预览及其他
  506. dialogImageUrl: '',
  507. dialogImageVisible: false,
  508. // 批量导入
  509. importVisible: false,
  510. importType: '',
  511. importTitle: '',
  512. uploadTitle: [],
  513. loadingFlag: false,
  514. selectList: [],
  515. expandedDeptKey: []
  516. }
  517. },
  518. mounted() {
  519. },
  520. methods: {
  521. initData(data) {
  522. this.roomUse = ['1']
  523. this.saleStatus = ['1']
  524. this.soldStatus = ['1']
  525. this.queryParam.nodeId = data.nodeId
  526. this.queryParam.level = data.level
  527. this.expandedDeptKey = [data.nodeId]
  528. this.initDict(this.dc_key).then((res) => {
  529. this.getData()
  530. })
  531. this.getTreeData()
  532. this.getTreeSelectData()
  533. },
  534. handleSearch: function() {
  535. this.getData()
  536. },
  537. // 导出
  538. handleExcel: function() {
  539. const _this = this
  540. _this.AllData = []
  541. _this.queryParam.pageNum = _this.currentPage
  542. _this.queryParam.pageSize = _this.pageSize
  543. _this.queryParam.roomUse = _this.roomUse.join(',')
  544. _this.queryParam.saleStatus = _this.saleStatus.join(',')
  545. _this.queryParam.soldStatus = _this.soldStatus.join(',')
  546. _this.queryParam.decorationSituation = _this.decorationSituation.join(',')
  547. this.OutData = []
  548. const title = ['单元/楼栋号', '所在层', '户室号', '套内面积', '建筑面积', '用途', '装修情况',
  549. '可售状态', '已售状态']
  550. this.OutData.push(title)
  551. const temp = []
  552. this.baseRequest('excelList', _this.queryParam).then(res => {
  553. const data = res.data
  554. data.data.forEach(function(item) {
  555. const json = _this.getItemJson(item)
  556. temp.push(json)
  557. })
  558. temp.forEach(function(item) {
  559. const jsonArray = []
  560. jsonArray.push(item.buildName)
  561. jsonArray.push(item.floor)
  562. jsonArray.push(item.roomNo)
  563. jsonArray.push(item.actualInternalArea)
  564. jsonArray.push(item.actualBuildArea)
  565. jsonArray.push(item.roomUse)
  566. jsonArray.push(item.decorationSituationStr)
  567. jsonArray.push(item.saleStatusStr)
  568. jsonArray.push(item.soldStatusStr)
  569. _this.OutData.push(jsonArray)
  570. })
  571. const OutSize = [{ wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
  572. { wch: 15 }, { wch: 15 }]
  573. const fileName = '房间导出 ' + new Date().Format('yyyyMMddhhmm')
  574. this.$outputXlsxFile(this.OutData, OutSize, fileName)
  575. })
  576. },
  577. handleReset: function() {
  578. this.queryParam = {}
  579. this.roomUse = []
  580. this.saleStatus = []
  581. this.soldStatus = []
  582. this.decorationSituation = []
  583. this.getData()
  584. },
  585. getTreeData: function() {
  586. this.baseInfoRequest('getTreeData1', {}).then((res) => {
  587. this.DeptTree = res.data.data
  588. }).catch(() => {
  589. })
  590. },
  591. getTreeSelectData: function() {
  592. this.baseInfoRequest('getTreeData2', {}).then((res) => {
  593. this.options = res.data.data
  594. }).catch(() => {
  595. })
  596. },
  597. getData: function() {
  598. const _this = this
  599. _this.loading = true
  600. _this.AllData = []
  601. _this.queryParam.pageNum = _this.currentPage
  602. _this.queryParam.pageSize = _this.pageSize
  603. _this.queryParam.roomUse = _this.roomUse.join(',')
  604. _this.queryParam.saleStatus = _this.saleStatus.join(',')
  605. _this.queryParam.soldStatus = _this.soldStatus.join(',')
  606. _this.queryParam.decorationSituation = _this.decorationSituation.join(',')
  607. _this.baseRequest('listByModel', _this.queryParam).then((res) => {
  608. if (res.data.rows) {
  609. res.data.rows.forEach(function(item) {
  610. const json = _this.getItemJson(item)
  611. _this.AllData.push(json)
  612. })
  613. _this.allpage = res.data.total
  614. }
  615. _this.loading = false
  616. }).catch(() => {
  617. })
  618. },
  619. handleAdd: function() {
  620. this.isView = false
  621. this.urlStr = 'add'
  622. this.dialogVisible = true
  623. this.dialogTitle = '新增房间'
  624. },
  625. handleEdit: function(val) {
  626. this.isView = false
  627. this.urlStr = 'edit'
  628. this.houseForm = val
  629. this.fileList = []
  630. this.dialogVisible = true
  631. this.dialogTitle = '编辑房间'
  632. this.loadingFlag = true
  633. },
  634. handleView: function(val) {
  635. this.isView = true
  636. this.houseForm.id = val.id
  637. this.dialogVisible = true
  638. this.dialogTitle = '查看房间'
  639. },
  640. getCheckedNodes(data, node, item) {
  641. console.log('节点====', node)
  642. console.log('节点id====', node.data.id)
  643. console.log('层级====', node.level)
  644. const _this = this
  645. _this.queryParam.nodeId = node.data.id
  646. _this.queryParam.level = node.level
  647. this.getData()
  648. },
  649. dialogChose() {
  650. this.houseForm = {}
  651. this.dialogVisible = false
  652. },
  653. confirmSubmit: function() {
  654. this.$refs.houseForm.validate(valid => {
  655. if (valid) {
  656. const ids = this.houseForm.findids
  657. if (ids != null && ids != [] && ids != '') {
  658. this.houseForm.groupId = ids[0]
  659. this.houseForm.discId = ids[1]
  660. this.houseForm.buildId = ids[2]
  661. }
  662. const extraData = {
  663. }
  664. const postData = Object.assign({}, this.houseForm, extraData)
  665. this.baseRequest(this.urlStr, postData).then((res) => {
  666. this.houseForm = {}
  667. this.dialogVisible = false
  668. this.getData()
  669. this.getTreeData()
  670. this.$message({
  671. message: '提交成功',
  672. type: 'success'
  673. })
  674. }).catch(() => {
  675. })
  676. }
  677. })
  678. },
  679. getItemJson: function(item) {
  680. // 用途
  681. item.roomUseStr = this.dc_map.HOUSE_USAGE[item.roomUse]
  682. // 装修情况
  683. item.decorationSituationStr = this.dc_map.DECORATION_SITUATION[item.decorationSituation]
  684. // 可售状态
  685. item.saleStatusStr = this.dc_map.SALE_STATUS[item.saleStatus]
  686. // 可售状态
  687. item.soldStatusStr = this.dc_map.SOLD_STATUS[item.soldStatus]
  688. return item
  689. },
  690. dlgOpen: function() {
  691. const _this = this
  692. if (_this.houseForm.id) {
  693. const postData = {
  694. id: _this.houseForm.id
  695. }
  696. this.baseRequest('getById', postData)
  697. .then(res => {
  698. if (res.data) {
  699. _this.houseForm = Object.assign({}, _this.houseForm, res.data)
  700. if (res.data.roomUse) {
  701. _this.houseForm.roomUse = res.data.roomUse + ''
  702. }
  703. if (res.data.decorationSituation) {
  704. _this.houseForm.decorationSituation = res.data.decorationSituation + ''
  705. }
  706. if (res.data.houseTypeId) {
  707. _this.houseForm.houseTypeId = res.data.houseTypeId + ''
  708. }
  709. if (res.data.saleStatus) {
  710. _this.houseForm.saleStatus = res.data.saleStatus + ''
  711. }
  712. // 回显户型
  713. _this.houseTypeOption = []
  714. _this.baseHouseTypeRequest('listAll', { discId: _this.houseForm.discId }).then(res => {
  715. if (res.data) {
  716. res.data.forEach(item => {
  717. _this.houseTypeOption.push({
  718. label: item.name + ',建筑面积' + item.buildArea + ',使用面积' + item.useArea,
  719. value: item.id,
  720. files: item.fileList
  721. })
  722. })
  723. // 回显户型图片
  724. const obj = _this.houseTypeOption.find(item =>
  725. item.value === _this.houseForm.houseTypeId
  726. )
  727. if (obj !== undefined) {
  728. this.fileList = []
  729. const files = JSON.parse(obj.files)
  730. files.forEach(v => {
  731. if (v) {
  732. this.fileList.push({
  733. url: constant.BASE_URI + '/FileController/download/' + v.data,
  734. id: v.data
  735. })
  736. }
  737. })
  738. } else {
  739. _this.houseForm.houseTypeId = ''
  740. }
  741. }
  742. })
  743. // 填充父级
  744. this.houseForm.findids = []
  745. if (undefined != this.houseForm.groupId && this.houseForm.groupId != null &&
  746. this.houseForm.groupId != '') {
  747. this.houseForm.findids[0] = this.houseForm.groupId
  748. if (undefined != this.houseForm.discId && this.houseForm.discId != null &&
  749. this.houseForm.discId != '') {
  750. this.houseForm.findids[1] = this.houseForm.discId
  751. if (undefined != this.houseForm.buildId && this.houseForm.buildId != null &&
  752. this.houseForm.buildId != '') {
  753. this.houseForm.findids[2] = this.houseForm.buildId
  754. }
  755. }
  756. }
  757. }
  758. _this.loadingFlag = false
  759. })
  760. .catch(() => {})
  761. }
  762. },
  763. // 上传相关,包括图片、文件
  764. handlePictureCardPreview: function(file) {
  765. this.handlePicturePreview(file.url)
  766. },
  767. handlePicturePreview: function(url) {
  768. this.dialogImageUrl = url
  769. this.dialogImageVisible = true
  770. },
  771. uploadHouseTypePicture: function(param) {
  772. upload(param, true).then((res) => {
  773. this.fileList.push(res)
  774. })
  775. },
  776. buildChange(val) {
  777. const postData = {
  778. discId: val[1]
  779. }
  780. this.getHouseTypeList(postData)
  781. },
  782. getHouseTypeList(val) {
  783. const _this = this
  784. _this.houseTypeOption = []
  785. _this.baseHouseTypeRequest('listAll', val).then(res => {
  786. if (res.data) {
  787. res.data.forEach(item => {
  788. _this.houseTypeOption.push({
  789. label: item.name + ',建筑面积' + item.buildArea + ',使用面积' + item.useArea,
  790. value: item.id,
  791. files: item.fileList
  792. })
  793. })
  794. }
  795. })
  796. },
  797. // 导入
  798. batchImport() {
  799. this.importVisible = true
  800. this.importType = 'roomInsert'
  801. this.importTitle = '房间批量导入'
  802. },
  803. cancelImport(refresh) {
  804. this.importVisible = false
  805. this.importType = ''
  806. this.getTreeData()
  807. this.getData()
  808. },
  809. handleDelete(val) {
  810. this.$confirm('确认删除该数据,删除后将无法恢复,确认删除吗?', '提示', {
  811. confirmButtonText: '确定',
  812. cancelButtonText: '取消',
  813. type: 'warning'
  814. }).then(() => {
  815. this.baseRequest('delete', { id: val }).then(res => {
  816. if (res.data.code == 200) {
  817. this.getData()
  818. this.getTreeData()
  819. this.$message({
  820. type: 'success',
  821. message: '删除成功!'
  822. })
  823. }
  824. }).catch((err) => {
  825. this.$message({
  826. type: 'error',
  827. message: err
  828. })
  829. })
  830. }).catch(() => {
  831. this.$message({
  832. type: 'info',
  833. message: '已取消删除'
  834. })
  835. })
  836. },
  837. houseTypeChange(val) {
  838. const obj = this.houseTypeOption.find(item =>
  839. item.value === val
  840. )
  841. if (obj !== undefined) {
  842. this.fileList = []
  843. const files = JSON.parse(obj.files)
  844. files.forEach(v => {
  845. if (v) {
  846. this.fileList.push({
  847. url: constant.BASE_URI + '/FileController/download/' + v.data,
  848. id: v.data
  849. })
  850. }
  851. })
  852. }
  853. },
  854. handleExceed: function() {
  855. this.$message.info('超过文件个数限制')
  856. },
  857. handleRemove: function(item) {
  858. const id = item.id
  859. const idx = this.fileList.findIndex(item => item.id === id)
  860. this.fileList.splice(idx, 1)
  861. },
  862. handleConnect() {
  863. this.$emit('getChildrenData', this.selectList)
  864. },
  865. handleConnectCancel() {
  866. this.$emit('getChildrenData')
  867. },
  868. // 我的选择
  869. selectable(row, index) {
  870. return true
  871. },
  872. // 选中数据
  873. handleSelectionChange(val) {
  874. this.selectList = this.selectList.filter(item => {
  875. for (let i = 0; i < this.AllData.length; i++) {
  876. if (this.AllData[i].id === item.id) {
  877. return false
  878. }
  879. }
  880. return true
  881. })
  882. val.forEach(element => {
  883. element.houseId = element.id
  884. this.selectList.push(element)
  885. })
  886. },
  887. // 请求封装,继承类中调用,必须存在
  888. baseRequest: function(opUrl, postData) {
  889. return this.$channel.baseRequest('ParkRoomController', opUrl, postData, 'User')
  890. },
  891. baseInfoRequest: function(opUrl, postData) {
  892. return this.$channel.baseRequest('ParkInfoController', opUrl, postData, 'User')
  893. },
  894. baseHouseTypeRequest: function(opUrl, postData) {
  895. return this.$channel.baseRequest('HouseTypeController', opUrl, postData, 'Post')
  896. }
  897. }
  898. }
  899. </script>
  900. <style scoped>
  901. .custom-tree-node {
  902. flex: 1;
  903. display: flex;
  904. align-items: center;
  905. justify-content: space-between;
  906. font-size: 16px;
  907. padding-right: 8px;
  908. }
  909. .custom-tree-container{
  910. display: flex;
  911. }
  912. .custom-tree-container .block-l {
  913. /*flex-grow: 2 ;*/
  914. //float: left;
  915. width: 20%;
  916. padding: 0 8px 0 0;
  917. }
  918. .custom-tree-container .block-r {
  919. /*flex-grow: 10;*/
  920. //float: left;
  921. width: 80%;
  922. /*padding: 0 0 0 8px;*/
  923. }
  924. </style>
  925. <style scoped>
  926. .lineheight20{
  927. padding: 7px;
  928. background-color: white;
  929. line-height: 15rpx;
  930. }
  931. .ch-input .el-input__inner {
  932. border-color: #32323A;
  933. }
  934. .ch-input-size {
  935. width: 150px;
  936. }
  937. .ch-button {
  938. border-color: #32323A;
  939. background-color: #32323A;
  940. color: #fff;
  941. }
  942. .ch-button-warning {
  943. margin-left: 10px;
  944. border-color: #E6A23C;
  945. background-color: #E6A23C;
  946. color: #fff;
  947. }
  948. .ch-button-export {
  949. margin-left: 10px;
  950. border-color: #98CC1F;
  951. background-color: #98CC1F;
  952. color: #fff;
  953. }
  954. .listBox{
  955. display: flex;
  956. flex-wrap: wrap;
  957. }
  958. .list {
  959. border: 1px solid #BEC3CB;
  960. padding: 0px 40px;
  961. border-radius: 10px;
  962. margin-right: 20px;
  963. cursor: pointer;
  964. height: 30px;
  965. line-height: 30px;
  966. background: #F2F2F2;
  967. color: #333333;
  968. }
  969. .checked {
  970. color: #FFFFFF;
  971. background: #6600FF;
  972. border: 1px solid #3377FF;
  973. }
  974. </style>