roomIndex.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998
  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">
  125. <el-button size="small" class="ch-button" style="float: right;margin-top: 4px" @click="handleSearch()"><i class="el-icon-menu" />&nbsp;查询</el-button>
  126. <el-button size="small" class="ch-button-warning" style="float: right;margin-top: 4px" @click="handleReset()"><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. }
  516. },
  517. mounted() {
  518. },
  519. methods: {
  520. initData(data) {
  521. this.roomUse = ['1']
  522. this.saleStatus = ['1']
  523. this.soldStatus = ['1']
  524. this.initDict(this.dc_key).then((res) => {
  525. this.getData()
  526. })
  527. this.getTreeData()
  528. this.getTreeSelectData()
  529. },
  530. handleSearch: function() {
  531. this.getData()
  532. },
  533. // 导出
  534. handleExcel: function() {
  535. const _this = this
  536. _this.AllData = []
  537. _this.queryParam.pageNum = _this.currentPage
  538. _this.queryParam.pageSize = _this.pageSize
  539. _this.queryParam.roomUse = _this.roomUse.join(',')
  540. _this.queryParam.saleStatus = _this.saleStatus.join(',')
  541. _this.queryParam.soldStatus = _this.soldStatus.join(',')
  542. _this.queryParam.decorationSituation = _this.decorationSituation.join(',')
  543. this.OutData = []
  544. const title = ['单元/楼栋号', '所在层', '户室号', '套内面积', '建筑面积', '用途', '装修情况',
  545. '可售状态', '已售状态']
  546. this.OutData.push(title)
  547. const temp = []
  548. this.baseRequest('excelList', _this.queryParam).then(res => {
  549. const data = res.data
  550. data.data.forEach(function(item) {
  551. const json = _this.getItemJson(item)
  552. temp.push(json)
  553. })
  554. temp.forEach(function(item) {
  555. const jsonArray = []
  556. jsonArray.push(item.buildName)
  557. jsonArray.push(item.floor)
  558. jsonArray.push(item.roomNo)
  559. jsonArray.push(item.actualInternalArea)
  560. jsonArray.push(item.actualBuildArea)
  561. jsonArray.push(item.roomUse)
  562. jsonArray.push(item.decorationSituationStr)
  563. jsonArray.push(item.saleStatusStr)
  564. jsonArray.push(item.soldStatusStr)
  565. _this.OutData.push(jsonArray)
  566. })
  567. const OutSize = [{ wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
  568. { wch: 15 }, { wch: 15 }]
  569. const fileName = '房间导出 ' + new Date().Format('yyyyMMddhhmm')
  570. this.$outputXlsxFile(this.OutData, OutSize, fileName)
  571. })
  572. },
  573. handleReset: function() {
  574. this.queryParam = {}
  575. this.roomUse = []
  576. this.saleStatus = []
  577. this.soldStatus = []
  578. this.decorationSituation = []
  579. this.getData()
  580. },
  581. getTreeData: function() {
  582. this.baseInfoRequest('getTreeData1', {}).then((res) => {
  583. this.DeptTree = res.data.data
  584. }).catch(() => {
  585. })
  586. },
  587. getTreeSelectData: function() {
  588. this.baseInfoRequest('getTreeData2', {}).then((res) => {
  589. this.options = res.data.data
  590. }).catch(() => {
  591. })
  592. },
  593. getData: function() {
  594. const _this = this
  595. _this.loading = true
  596. _this.AllData = []
  597. _this.queryParam.pageNum = _this.currentPage
  598. _this.queryParam.pageSize = _this.pageSize
  599. _this.queryParam.roomUse = _this.roomUse.join(',')
  600. _this.queryParam.saleStatus = _this.saleStatus.join(',')
  601. _this.queryParam.soldStatus = _this.soldStatus.join(',')
  602. _this.queryParam.decorationSituation = _this.decorationSituation.join(',')
  603. _this.baseRequest('listByModel', _this.queryParam).then((res) => {
  604. if (res.data.rows) {
  605. res.data.rows.forEach(function(item) {
  606. const json = _this.getItemJson(item)
  607. _this.AllData.push(json)
  608. })
  609. _this.allpage = res.data.total
  610. }
  611. _this.loading = false
  612. }).catch(() => {
  613. })
  614. },
  615. handleAdd: function() {
  616. this.isView = false
  617. this.urlStr = 'add'
  618. this.dialogVisible = true
  619. this.dialogTitle = '新增房间'
  620. },
  621. handleEdit: function(val) {
  622. this.isView = false
  623. this.urlStr = 'edit'
  624. this.houseForm = val
  625. this.fileList = []
  626. this.dialogVisible = true
  627. this.dialogTitle = '编辑房间'
  628. this.loadingFlag = true
  629. },
  630. handleView: function(val) {
  631. this.isView = true
  632. this.houseForm.id = val.id
  633. this.dialogVisible = true
  634. this.dialogTitle = '查看房间'
  635. },
  636. getCheckedNodes(data, node, item) {
  637. console.log('节点====', node)
  638. console.log('节点id====', node.data.id)
  639. console.log('层级====', node.level)
  640. const _this = this
  641. _this.queryParam.nodeId = node.data.id
  642. _this.queryParam.level = node.level
  643. this.getData()
  644. },
  645. dialogChose() {
  646. this.houseForm = {}
  647. this.dialogVisible = false
  648. },
  649. confirmSubmit: function() {
  650. this.$refs.houseForm.validate(valid => {
  651. if (valid) {
  652. const ids = this.houseForm.findids
  653. if (ids != null && ids != [] && ids != '') {
  654. this.houseForm.groupId = ids[0]
  655. this.houseForm.discId = ids[1]
  656. this.houseForm.buildId = ids[2]
  657. }
  658. const extraData = {
  659. }
  660. const postData = Object.assign({}, this.houseForm, extraData)
  661. this.baseRequest(this.urlStr, postData).then((res) => {
  662. this.houseForm = {}
  663. this.dialogVisible = false
  664. this.getData()
  665. this.getTreeData()
  666. this.$message({
  667. message: '提交成功',
  668. type: 'success'
  669. })
  670. }).catch(() => {
  671. })
  672. }
  673. })
  674. },
  675. getItemJson: function(item) {
  676. // 用途
  677. item.roomUseStr = this.dc_map.HOUSE_USAGE[item.roomUse]
  678. // 装修情况
  679. item.decorationSituationStr = this.dc_map.DECORATION_SITUATION[item.decorationSituation]
  680. // 可售状态
  681. item.saleStatusStr = this.dc_map.SALE_STATUS[item.saleStatus]
  682. // 可售状态
  683. item.soldStatusStr = this.dc_map.SOLD_STATUS[item.soldStatus]
  684. return item
  685. },
  686. dlgOpen: function() {
  687. const _this = this
  688. if (_this.houseForm.id) {
  689. const postData = {
  690. id: _this.houseForm.id
  691. }
  692. this.baseRequest('getById', postData)
  693. .then(res => {
  694. if (res.data) {
  695. _this.houseForm = Object.assign({}, _this.houseForm, res.data)
  696. if (res.data.roomUse) {
  697. _this.houseForm.roomUse = res.data.roomUse + ''
  698. }
  699. if (res.data.decorationSituation) {
  700. _this.houseForm.decorationSituation = res.data.decorationSituation + ''
  701. }
  702. if (res.data.houseTypeId) {
  703. _this.houseForm.houseTypeId = res.data.houseTypeId + ''
  704. }
  705. if (res.data.saleStatus) {
  706. _this.houseForm.saleStatus = res.data.saleStatus + ''
  707. }
  708. // 回显户型
  709. _this.houseTypeOption = []
  710. _this.baseHouseTypeRequest('listAll', { discId: _this.houseForm.discId }).then(res => {
  711. if (res.data) {
  712. res.data.forEach(item => {
  713. _this.houseTypeOption.push({
  714. label: item.name + ',建筑面积' + item.buildArea + ',使用面积' + item.useArea,
  715. value: item.id,
  716. files: item.fileList
  717. })
  718. })
  719. // 回显户型图片
  720. const obj = _this.houseTypeOption.find(item =>
  721. item.value === _this.houseForm.houseTypeId
  722. )
  723. if (obj !== undefined) {
  724. this.fileList = []
  725. const files = JSON.parse(obj.files)
  726. files.forEach(v => {
  727. if (v) {
  728. this.fileList.push({
  729. url: constant.BASE_URI + '/FileController/download/' + v.data,
  730. id: v.data
  731. })
  732. }
  733. })
  734. } else {
  735. _this.houseForm.houseTypeId = ''
  736. }
  737. }
  738. })
  739. // 填充父级
  740. this.houseForm.findids = []
  741. if (undefined != this.houseForm.groupId && this.houseForm.groupId != null &&
  742. this.houseForm.groupId != '') {
  743. this.houseForm.findids[0] = this.houseForm.groupId
  744. if (undefined != this.houseForm.discId && this.houseForm.discId != null &&
  745. this.houseForm.discId != '') {
  746. this.houseForm.findids[1] = this.houseForm.discId
  747. if (undefined != this.houseForm.buildId && this.houseForm.buildId != null &&
  748. this.houseForm.buildId != '') {
  749. this.houseForm.findids[2] = this.houseForm.buildId
  750. }
  751. }
  752. }
  753. }
  754. _this.loadingFlag = false
  755. })
  756. .catch(() => {})
  757. }
  758. },
  759. // 上传相关,包括图片、文件
  760. handlePictureCardPreview: function(file) {
  761. this.handlePicturePreview(file.url)
  762. },
  763. handlePicturePreview: function(url) {
  764. this.dialogImageUrl = url
  765. this.dialogImageVisible = true
  766. },
  767. uploadHouseTypePicture: function(param) {
  768. upload(param, true).then((res) => {
  769. this.fileList.push(res)
  770. })
  771. },
  772. buildChange(val) {
  773. const postData = {
  774. discId: val[1]
  775. }
  776. this.getHouseTypeList(postData)
  777. },
  778. getHouseTypeList(val) {
  779. const _this = this
  780. _this.houseTypeOption = []
  781. _this.baseHouseTypeRequest('listAll', val).then(res => {
  782. if (res.data) {
  783. res.data.forEach(item => {
  784. _this.houseTypeOption.push({
  785. label: item.name + ',建筑面积' + item.buildArea + ',使用面积' + item.useArea,
  786. value: item.id,
  787. files: item.fileList
  788. })
  789. })
  790. }
  791. })
  792. },
  793. // 导入
  794. batchImport() {
  795. this.importVisible = true
  796. this.importType = 'roomInsert'
  797. this.importTitle = '房间批量导入'
  798. },
  799. cancelImport(refresh) {
  800. this.importVisible = false
  801. this.importType = ''
  802. this.getTreeData()
  803. this.getData()
  804. },
  805. handleDelete(val) {
  806. this.$confirm('确认删除该数据,删除后将无法恢复,确认删除吗?', '提示', {
  807. confirmButtonText: '确定',
  808. cancelButtonText: '取消',
  809. type: 'warning'
  810. }).then(() => {
  811. this.baseRequest('delete', { id: val }).then(res => {
  812. if (res.data.code == 200) {
  813. this.getData()
  814. this.getTreeData()
  815. this.$message({
  816. type: 'success',
  817. message: '删除成功!'
  818. })
  819. }
  820. }).catch((err) => {
  821. this.$message({
  822. type: 'error',
  823. message: err
  824. })
  825. })
  826. }).catch(() => {
  827. this.$message({
  828. type: 'info',
  829. message: '已取消删除'
  830. })
  831. })
  832. },
  833. houseTypeChange(val) {
  834. const obj = this.houseTypeOption.find(item =>
  835. item.value === val
  836. )
  837. if (obj !== undefined) {
  838. this.fileList = []
  839. const files = JSON.parse(obj.files)
  840. files.forEach(v => {
  841. if (v) {
  842. this.fileList.push({
  843. url: constant.BASE_URI + '/FileController/download/' + v.data,
  844. id: v.data
  845. })
  846. }
  847. })
  848. }
  849. },
  850. handleExceed: function() {
  851. this.$message.info('超过文件个数限制')
  852. },
  853. handleRemove: function(item) {
  854. const id = item.id
  855. const idx = this.fileList.findIndex(item => item.id === id)
  856. this.fileList.splice(idx, 1)
  857. },
  858. handleConnect() {
  859. this.$emit('getChildrenData', this.selectList)
  860. },
  861. handleConnectCancel() {
  862. this.$emit('getChildrenData')
  863. },
  864. // 我的选择
  865. selectable(row, index) {
  866. return true
  867. },
  868. // 选中数据
  869. handleSelectionChange(val) {
  870. this.selectList = this.selectList.filter(item => {
  871. for (let i = 0; i < this.AllData.length; i++) {
  872. if (this.AllData[i].id === item.id) {
  873. return false
  874. }
  875. }
  876. return true
  877. })
  878. val.forEach(element => {
  879. this.selectList.push(element)
  880. })
  881. console.log('共有:', this.selectList)
  882. },
  883. // 请求封装,继承类中调用,必须存在
  884. baseRequest: function(opUrl, postData) {
  885. return this.$channel.baseRequest('ParkRoomController', opUrl, postData, 'User')
  886. },
  887. baseInfoRequest: function(opUrl, postData) {
  888. return this.$channel.baseRequest('ParkInfoController', opUrl, postData, 'User')
  889. },
  890. baseHouseTypeRequest: function(opUrl, postData) {
  891. return this.$channel.baseRequest('HouseTypeController', opUrl, postData, 'Post')
  892. }
  893. }
  894. }
  895. </script>
  896. <style scoped>
  897. .custom-tree-node {
  898. flex: 1;
  899. display: flex;
  900. align-items: center;
  901. justify-content: space-between;
  902. font-size: 16px;
  903. padding-right: 8px;
  904. }
  905. .custom-tree-container{
  906. display: flex;
  907. }
  908. .custom-tree-container .block-l {
  909. /*flex-grow: 2 ;*/
  910. //float: left;
  911. width: 20%;
  912. padding: 0 8px 0 0;
  913. }
  914. .custom-tree-container .block-r {
  915. /*flex-grow: 10;*/
  916. //float: left;
  917. width: 80%;
  918. /*padding: 0 0 0 8px;*/
  919. }
  920. </style>
  921. <style scoped>
  922. .lineheight20{
  923. padding: 7px;
  924. background-color: white;
  925. line-height: 15rpx;
  926. }
  927. .ch-input .el-input__inner {
  928. border-color: #32323A;
  929. }
  930. .ch-input-size {
  931. width: 150px;
  932. }
  933. .ch-button {
  934. border-color: #32323A;
  935. background-color: #32323A;
  936. color: #fff;
  937. }
  938. .ch-button-warning {
  939. margin-left: 10px;
  940. border-color: #E6A23C;
  941. background-color: #E6A23C;
  942. color: #fff;
  943. }
  944. .ch-button-export {
  945. margin-left: 10px;
  946. border-color: #98CC1F;
  947. background-color: #98CC1F;
  948. color: #fff;
  949. }
  950. .listBox{
  951. display: flex;
  952. flex-wrap: wrap;
  953. }
  954. .list {
  955. border: 1px solid #BEC3CB;
  956. padding: 0px 40px;
  957. border-radius: 10px;
  958. margin-right: 20px;
  959. cursor: pointer;
  960. height: 30px;
  961. line-height: 30px;
  962. background: #F2F2F2;
  963. color: #333333;
  964. }
  965. .checked {
  966. color: #FFFFFF;
  967. background: #6600FF;
  968. border: 1px solid #3377FF;
  969. }
  970. </style>