index.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  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="1" style="text-align:center">-->
  109. <!-- <div style="margin-top: 6px">至</div>-->
  110. <!-- </el-col>-->
  111. <!-- <el-col :span="4">-->
  112. <!-- <el-input v-model="queryParam.sizeEnd" size="small" placeholder="请输入面积" class="ch-input-size" @keyup.enter.native="handleSearch()" />-->
  113. <!-- </el-col>-->
  114. <el-col :span="4">
  115. <div style="margin-top: 6px">建筑面积(㎡):</div>
  116. </el-col>
  117. <el-col :span="4">
  118. <el-input v-model="queryParam.actualBuildArea" size="small" placeholder="请输入面积" class="ch-input-size" @keyup.enter.native="handleSearch()" />
  119. </el-col>
  120. </el-row>
  121. <el-row class="lineheight20">
  122. <el-col :span="2">
  123. <div style="margin-top: 6px">关键字:</div>
  124. </el-col>
  125. <el-col :span="4">
  126. <el-input v-model="queryParam.roomNo" size="small" placeholder="请输入房号" class="ch-input-size" @keyup.enter.native="handleSearch()" />
  127. </el-col>
  128. </el-row>
  129. <el-row class="lineheight20">
  130. <el-col :span="24">
  131. <el-button size="small" class="ch-button-export" style="float: right; margin-top: 4px" @click="handleExcel"><i class="el-icon-menu" />&nbsp;导出EXCEL</el-button>
  132. <el-button size="small" class="ch-button-export" style="float: right;margin-top: 4px" @click="batchImport()"><i class="el-icon-menu" />&nbsp;批量导入</el-button>
  133. <el-button size="small" class="ch-button" style="float: right; margin-right: 10px; margin-top: 4px" @click="handleAdd()"><i class="el-icon-menu" />&nbsp;新增房间</el-button>
  134. <el-button size="small" class="ch-button" style="float: right;margin-top: 4px" @click="handleSearch()"><i class="el-icon-menu" />&nbsp;查询</el-button>
  135. <el-button size="small" class="ch-button-warning" style="float: right;margin-top: 4px" @click="handleReset()"><i class="el-icon-menu" />&nbsp;重置</el-button>
  136. </el-col>
  137. </el-row>
  138. </div>
  139. <el-row class="lineheight20">
  140. <el-col :span="24">
  141. <el-table ref="singleTable" v-loading="loading" :data="AllData" highlight-current-row @current-change="handleRowSelectChange">
  142. <el-table-column label="编号" type="index" width="60" />
  143. <el-table-column label="单元/楼栋号" prop="buildName" />
  144. <el-table-column label="所在层" prop="floor" />
  145. <el-table-column label="户室号" prop="roomNo" />
  146. <el-table-column label="套内面积(㎡)" prop="actualInternalArea" />
  147. <el-table-column label="建筑面积(㎡)" prop="actualBuildArea" />
  148. <el-table-column label="用途" prop="roomUseStr" />
  149. <el-table-column label="装修情况" prop="decorationSituationStr" />
  150. <el-table-column label="可售状态" prop="saleStatusStr" />
  151. <el-table-column label="已售状态" prop="soldStatusStr" />
  152. <el-table-column label="操作" header-align="center" width="250">
  153. <template scope="scope">
  154. <el-button size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
  155. <el-button size="mini" type="text" @click="handleDel(scope.row)">删除</el-button>
  156. <el-button size="mini" type="text" @click="handleView(scope.row)">查看</el-button>
  157. </template>
  158. </el-table-column>
  159. </el-table>
  160. <div class="table-page">
  161. <el-pagination
  162. :current-page.sync="currentPage"
  163. :page-size="pageSize"
  164. background
  165. layout="total, prev, pager, next"
  166. :total="allpage"
  167. @size-change="handleSizeChange"
  168. @current-change="handleCurrentChange"
  169. />
  170. </div>
  171. </el-col>
  172. </el-row>
  173. </div>
  174. </div>
  175. <el-dialog
  176. :title="dialogTitle"
  177. :visible.sync="dialogVisible"
  178. :before-close="dialogChose"
  179. width="75%"
  180. top="50px"
  181. append-to-body
  182. @open="dlgOpen"
  183. >
  184. <el-form ref="houseForm" :model="houseForm" style="width: 100%;padding: 5px" :rules="commitRules">
  185. <el-row>
  186. <el-col style="padding-bottom: 10px">
  187. <!-- <span class="card_title">基本信息</span>-->
  188. <el-card shadow="always" style="padding-top: 10px">
  189. <el-row>
  190. <el-col :span="2" class="col-txt"><span>*父级</span></el-col>
  191. <el-col :span="22" class="col-input">
  192. <el-form-item prop="findids">
  193. <el-cascader v-model="houseForm.findids" :disabled="isView" style="width: 100%;" :options="options" @change="buildChange" />
  194. </el-form-item>
  195. </el-col>
  196. </el-row>
  197. <el-row>
  198. <el-col :span="2" class="col-txt"><span>*户室号</span></el-col>
  199. <el-col :span="10" class="col-input">
  200. <el-form-item prop="roomNo">
  201. <el-input v-model="houseForm.roomNo" :disabled="isView" />
  202. </el-form-item>
  203. </el-col>
  204. <el-col :span="2" class="col-txt"><span>*所在层</span></el-col>
  205. <el-col :span="10" class="col-input">
  206. <el-form-item prop="floor">
  207. <el-input v-model="houseForm.floor" :disabled="isView" />
  208. </el-form-item>
  209. </el-col>
  210. </el-row>
  211. <el-row>
  212. <el-col :span="3" class="col-txt"><span>*预测套内面积(㎡)</span></el-col>
  213. <el-col :span="9" class="col-input">
  214. <el-form-item prop="roomNo">
  215. <el-input v-model="houseForm.predictionInternalArea" :disabled="isView" />
  216. </el-form-item>
  217. </el-col>
  218. <el-col :span="3" class="col-txt"><span>*预测分摊面积(㎡)</span></el-col>
  219. <el-col :span="9" class="col-input">
  220. <el-form-item prop="roomNo">
  221. <el-input v-model="houseForm.predictionShareArea" :disabled="isView" />
  222. </el-form-item>
  223. </el-col>
  224. </el-row>
  225. <el-row>
  226. <el-col :span="3" class="col-txt"><span>*预测建筑面积(㎡)</span></el-col>
  227. <el-col :span="9" class="col-input">
  228. <el-form-item prop="roomNo">
  229. <el-input v-model="houseForm.predictionBuildArea" :disabled="isView" />
  230. </el-form-item>
  231. </el-col>
  232. <el-col :span="3" class="col-txt"><span>*预测土地面积(㎡)</span></el-col>
  233. <el-col :span="9" class="col-input">
  234. <el-form-item prop="roomNo">
  235. <el-input v-model="houseForm.predictionLandArea" :disabled="isView" />
  236. </el-form-item>
  237. </el-col>
  238. </el-row>
  239. <el-row>
  240. <el-col :span="3" class="col-txt"><span>*实测套内面积(㎡)</span></el-col>
  241. <el-col :span="9" class="col-input">
  242. <el-form-item prop="actualInternalArea">
  243. <el-input v-model="houseForm.actualInternalArea" :disabled="isView" />
  244. </el-form-item>
  245. </el-col>
  246. <el-col :span="3" class="col-txt"><span>*实测分摊面积(㎡)</span></el-col>
  247. <el-col :span="9" class="col-input">
  248. <el-form-item prop="actualShareArea">
  249. <el-input v-model="houseForm.actualShareArea" :disabled="isView" />
  250. </el-form-item>
  251. </el-col>
  252. </el-row>
  253. <el-row>
  254. <el-col :span="3" class="col-txt"><span>*实测建筑面积(㎡)</span></el-col>
  255. <el-col :span="9" class="col-input">
  256. <el-form-item prop="actualBuildArea">
  257. <el-input v-model="houseForm.actualBuildArea" :disabled="isView" />
  258. </el-form-item>
  259. </el-col>
  260. <el-col :span="3" class="col-txt"><span>*实测土地面积(㎡)</span></el-col>
  261. <el-col :span="9" class="col-input">
  262. <el-form-item prop="actualLandArea">
  263. <el-input v-model="houseForm.actualLandArea" :disabled="isView" />
  264. </el-form-item>
  265. </el-col>
  266. </el-row>
  267. <el-row>
  268. <el-col :span="2" class="col-txt"><span>用途:</span></el-col>
  269. <el-col :span="10" class="col-input">
  270. <el-form-item prop="roomUse">
  271. <el-select v-model="houseForm.roomUse" placeholder="" filterable :disabled="isView">
  272. <el-option
  273. v-for="item in dc_data.HOUSE_USAGE"
  274. :key="item.value"
  275. :label="item.label"
  276. :value="item.value"
  277. />
  278. </el-select>
  279. </el-form-item>
  280. </el-col>
  281. <el-col :span="2" class="col-txt"><span>*户编号</span></el-col>
  282. <el-col :span="10" class="col-input">
  283. <el-form-item prop="roomNumber">
  284. <el-input v-model="houseForm.roomNumber" :disabled="isView" />
  285. </el-form-item>
  286. </el-col>
  287. </el-row>
  288. <el-row>
  289. <el-col :span="2" class="col-txt"><span>装修情况:</span></el-col>
  290. <el-col :span="10" class="col-input">
  291. <el-form-item>
  292. <el-select v-model="houseForm.decorationSituation" placeholder="" filterable :disabled="isView">
  293. <el-option
  294. v-for="item in dc_data.DECORATION_SITUATION"
  295. :key="item.value"
  296. :label="item.label"
  297. :value="item.value"
  298. />
  299. </el-select>
  300. </el-form-item>
  301. </el-col>
  302. <el-col :span="2" class="col-txt"><span>2.2M以</span></el-col>
  303. <el-col :span="10" class="col-input">
  304. <el-form-item prop="roomNumber">
  305. <el-input v-model="houseForm.twoPointTwo" :disabled="isView" />
  306. </el-form-item>
  307. </el-col>
  308. </el-row>
  309. <el-row>
  310. <el-col :span="2" class="col-txt"><span>户型</span></el-col>
  311. <el-col :span="10" class="col-input">
  312. <el-form-item :disabled="isView">
  313. <el-select v-model="houseForm.houseTypeId" placeholder="" filterable :disabled="isView">
  314. <el-option
  315. v-for="item in houseTypeOption"
  316. :key="item.value"
  317. :label="item.label"
  318. :value="item.value"
  319. />
  320. </el-select>
  321. </el-form-item>
  322. </el-col>
  323. </el-row>
  324. <el-row>
  325. <el-col :span="2" class="col-txt"><span>户型图:</span></el-col>
  326. <el-col :span="20" class="col-input">
  327. <el-form-item>
  328. <el-upload
  329. ref="upload"
  330. action
  331. accept="image/png,image/gif,image/jpg,image/jpeg"
  332. list-type="picture-card"
  333. :file-list="fileList"
  334. :limit="9"
  335. :http-request="uploadHouseTypePicture"
  336. :on-preview="handlePictureCardPreview"
  337. :on-remove="handleRemove"
  338. :on-exceed="handleExceed"
  339. :disabled="isView"
  340. >
  341. <i class="el-icon-plus" />
  342. <div slot="tip" class="el-upload__tip">
  343. 只能上传jpg/png文件,限制上传9张
  344. </div>
  345. </el-upload>
  346. </el-form-item>
  347. </el-col>
  348. </el-row>
  349. <el-row>
  350. <el-col :span="2" class="col-txt"><span>备注:</span></el-col>
  351. <el-col :span="22" class="col-input">
  352. <el-form-item>
  353. <el-input v-model="houseForm.remark" type="textarea" maxlength="2000" show-word-limit :disabled="isView" />
  354. </el-form-item>
  355. </el-col>
  356. </el-row>
  357. <el-row>
  358. <el-col :span="2" class="col-txt"><span>可售状态:</span></el-col>
  359. <el-col :span="22" class="col-input">
  360. <el-form-item>
  361. <el-select v-model="houseForm.saleStatus" placeholder="请选择" size="small" :disabled="isView">
  362. <el-option
  363. v-for="item in dc_data.SALE_STATUS"
  364. :key="item.value"
  365. :label="item.label"
  366. :value="item.value"
  367. />
  368. </el-select>
  369. </el-form-item>
  370. </el-col>
  371. </el-row>
  372. </el-card>
  373. </el-col>
  374. </el-row>
  375. </el-form>
  376. <div slot="footer">
  377. <el-button @click="dialogChose">取 消</el-button>
  378. <el-button type="primary" @click="confirmSubmit()">确 定</el-button>
  379. </div>
  380. </el-dialog>
  381. <el-dialog
  382. :visible.sync="dialogImageVisible"
  383. :close-on-click-modal="false"
  384. :close-on-press-escape="false"
  385. append-to-body
  386. >
  387. <img width="100%" :src="dialogImageUrl" alt="">
  388. </el-dialog>
  389. <!-- 批量导入 -->
  390. <upload-cost
  391. v-if="importVisible"
  392. :dialog-visible="importVisible"
  393. :import-type="importType"
  394. :upload-title="uploadTitle"
  395. :import-title="importTitle"
  396. @cancelUpload="cancelImport"
  397. />
  398. </div>
  399. </template>
  400. <script>
  401. import Base from '@/views/base/base'
  402. import BaseData from '@/views/base/baseData'
  403. import BaseDept from '@/views/base/baseDept'
  404. import Constant from '@/static/utils/constant'
  405. import { upload } from '@/static/utils/channel'
  406. import uploadCost from '@/views/parkAssets/component/uploadCost.vue'
  407. export default {
  408. name: 'User',
  409. components: { uploadCost },
  410. mixins: [Base, BaseData, BaseDept],
  411. data() {
  412. return {
  413. dc_key: ['HOUSE_USAGE', 'DECORATION_SITUATION', 'SALE_STATUS', 'SOLD_STATUS'],
  414. // 查询参数
  415. queryParam: {
  416. nodeId: '',
  417. level: ''
  418. },
  419. options: [],
  420. houseForm: {
  421. },
  422. DeptTree: [],
  423. urlStr: 'add',
  424. AllData: [],
  425. loading: false,
  426. dialogVisible: false,
  427. dialogTitle: '',
  428. isAdd: true,
  429. commitRules: {
  430. findids: [{ required: true, trigger: 'blur', message: '请选择父级' }],
  431. roomNo: [{ required: true, trigger: 'blur', message: '请输入户室号' }],
  432. floor: [{ required: true, trigger: 'blur', message: '请输入所在层' }],
  433. predictionInternalArea: [{ required: true, trigger: 'blur', message: '请输入预测套内面积' }],
  434. predictionShareArea: [{ required: true, trigger: 'blur', message: '请输入预测分摊面积' }],
  435. predictionBuildArea: [{ required: true, trigger: 'blur', message: '请输入预测建筑面积' }],
  436. predictionLandArea: [{ required: true, trigger: 'blur', message: '请输入预测土地面积' }],
  437. actualInternalArea: [{ required: true, trigger: 'blur', message: '请输入实测分摊面积' }],
  438. actualShareArea: [{ required: true, trigger: 'blur', message: '请输入实测分摊面积' }],
  439. actualBuildArea: [{ required: true, trigger: 'blur', message: '请输入实测建筑面积' }],
  440. actualLandArea: [{ required: true, trigger: 'blur', message: '请输入实测土地面积' }],
  441. roomUse: [{ required: true, trigger: 'blur', message: '请输入用途' }],
  442. roomNumber: [{ required: true, trigger: 'blur', message: '请输入户编号' }]
  443. },
  444. roomId: '',
  445. roomUse: [],
  446. saleStatus: [],
  447. soldStatus: [],
  448. decorationSituation: [],
  449. isView: false,
  450. fileList: [],
  451. houseTypeOption: [],
  452. // 图片预览及其他
  453. dialogImageUrl: '',
  454. dialogImageVisible: false,
  455. // 批量导入
  456. importVisible: false,
  457. importType: '',
  458. importTitle: '',
  459. uploadTitle: []
  460. }
  461. },
  462. mounted() {
  463. this.initDict(this.dc_key).then((res) => {
  464. this.getData()
  465. })
  466. this.getTreeData()
  467. this.getTreeSelectData()
  468. },
  469. methods: {
  470. handleSearch: function() {
  471. this.getData()
  472. },
  473. // 导出
  474. handleExcel: function() {
  475. const _this = this
  476. _this.AllData = []
  477. _this.queryParam.pageNum = _this.currentPage
  478. _this.queryParam.pageSize = _this.pageSize
  479. _this.queryParam.roomUse = _this.roomUse.join(',')
  480. _this.queryParam.saleStatus = _this.saleStatus.join(',')
  481. _this.queryParam.soldStatus = _this.soldStatus.join(',')
  482. _this.queryParam.decorationSituation = _this.decorationSituation.join(',')
  483. this.OutData = []
  484. const title = ['单元/楼栋号', '所在层', '户室号', '套内面积', '建筑面积', '用途', '装修情况',
  485. '可售状态', '已售状态']
  486. this.OutData.push(title)
  487. const temp = []
  488. this.baseRequest('excelList', _this.queryParam).then(res => {
  489. const data = res.data
  490. data.data.forEach(function(item) {
  491. const json = _this.getItemJson(item)
  492. temp.push(json)
  493. })
  494. temp.forEach(function(item) {
  495. const jsonArray = []
  496. jsonArray.push(item.buildName)
  497. jsonArray.push(item.floor)
  498. jsonArray.push(item.roomNo)
  499. jsonArray.push(item.actualInternalArea)
  500. jsonArray.push(item.actualBuildArea)
  501. jsonArray.push(item.roomUse)
  502. jsonArray.push(item.decorationSituationStr)
  503. jsonArray.push(item.saleStatusStr)
  504. jsonArray.push(item.soldStatusStr)
  505. _this.OutData.push(jsonArray)
  506. })
  507. const OutSize = [{ wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
  508. { wch: 15 }, { wch: 15 }]
  509. const fileName = '房间导出 ' + new Date().Format('yyyyMMddhhmm')
  510. this.$outputXlsxFile(this.OutData, OutSize, fileName)
  511. })
  512. },
  513. handleReset: function() {
  514. this.queryParam = {}
  515. this.roomUse = []
  516. this.saleStatus = []
  517. this.soldStatus = []
  518. this.decorationSituation = []
  519. this.getData()
  520. },
  521. getTreeData: function() {
  522. this.baseInfoRequest('getTreeData1', {}).then((res) => {
  523. this.DeptTree = res.data.data
  524. }).catch(() => {
  525. })
  526. },
  527. getTreeSelectData: function() {
  528. this.baseInfoRequest('getTreeData2', {}).then((res) => {
  529. this.options = res.data.data
  530. }).catch(() => {
  531. })
  532. },
  533. getData: function() {
  534. const _this = this
  535. _this.loading = true
  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.baseRequest('listByModel', _this.queryParam).then((res) => {
  544. if (res.data.rows) {
  545. res.data.rows.forEach(function(item) {
  546. const json = _this.getItemJson(item)
  547. _this.AllData.push(json)
  548. })
  549. _this.allpage = res.data.total
  550. }
  551. _this.loading = false
  552. }).catch(() => {
  553. })
  554. },
  555. handleAdd: function() {
  556. this.isView = false
  557. this.urlStr = 'add'
  558. this.dialogVisible = true
  559. this.dialogTitle = '新增房间'
  560. },
  561. handleEdit: function(val) {
  562. this.isView = false
  563. this.urlStr = 'edit'
  564. this.houseForm = val
  565. this.dialogVisible = true
  566. this.dialogTitle = '编辑房间'
  567. },
  568. handleView: function(val) {
  569. this.isView = true
  570. this.houseForm.id = val.id
  571. this.dialogVisible = true
  572. this.dialogTitle = '查看房间'
  573. },
  574. getCheckedNodes(data, node, item) {
  575. console.log('节点====', node)
  576. console.log('节点id====', node.data.id)
  577. console.log('层级====', node.level)
  578. const _this = this
  579. _this.queryParam.nodeId = node.data.id
  580. _this.queryParam.level = node.level
  581. this.getData()
  582. },
  583. dialogChose() {
  584. this.houseForm = {}
  585. this.dialogVisible = false
  586. },
  587. confirmSubmit: function() {
  588. this.$refs.houseForm.validate(valid => {
  589. if (valid) {
  590. const ids = this.houseForm.findids
  591. if (ids != null && ids != [] && ids != '') {
  592. this.houseForm.groupId = ids[0]
  593. this.houseForm.discId = ids[1]
  594. this.houseForm.buildId = ids[2]
  595. }
  596. const extraData = {}
  597. const postData = Object.assign({}, this.houseForm, extraData)
  598. this.baseRequest(this.urlStr, postData).then((res) => {
  599. this.houseForm = {}
  600. this.dialogVisible = false
  601. this.getData()
  602. this.getTreeData()
  603. this.$message({
  604. message: '提交成功',
  605. type: 'success'
  606. })
  607. }).catch(() => {
  608. })
  609. }
  610. })
  611. },
  612. getItemJson: function(item) {
  613. // 用途
  614. item.roomUseStr = this.dc_map.HOUSE_USAGE[item.roomUse]
  615. // 装修情况
  616. item.decorationSituationStr = this.dc_map.DECORATION_SITUATION[item.decorationSituation]
  617. // 可售状态
  618. item.saleStatusStr = this.dc_map.SALE_STATUS[item.saleStatus]
  619. // 可售状态
  620. item.soldStatusStr = this.dc_map.SOLD_STATUS[item.soldStatus]
  621. return item
  622. },
  623. handleRowSelectChange(val) {
  624. this.currentRow = val
  625. if (this.currentRow) {
  626. if (this.currentRow.id === '1') {
  627. this.isAdminSelect = true
  628. } else {
  629. this.isAdminSelect = false
  630. }
  631. }
  632. },
  633. dlgOpen: function() {
  634. // 填充父级
  635. this.houseForm.findids = []
  636. if (undefined != this.houseForm.groupId && this.houseForm.groupId != null &&
  637. this.houseForm.groupId != '') {
  638. this.houseForm.findids[0] = this.houseForm.groupId
  639. if (undefined != this.houseForm.discId && this.houseForm.discId != null &&
  640. this.houseForm.discId != '') {
  641. this.houseForm.findids[1] = this.houseForm.discId
  642. if (undefined != this.houseForm.buildId && this.houseForm.buildId != null &&
  643. this.houseForm.buildId != '') {
  644. this.houseForm.findids[2] = this.houseForm.buildId
  645. }
  646. }
  647. }
  648. const _this = this
  649. if (_this.houseForm.id) {
  650. const postData = {
  651. id: _this.houseForm.id
  652. }
  653. this.baseRequest('getById', postData)
  654. .then(res => {
  655. if (res.data) {
  656. _this.houseForm = Object.assign({}, _this.houseForm, res.data)
  657. _this.houseForm.roomUse = res.data.roomUse + ''
  658. _this.houseForm.decorationSituation = res.data.decorationSituation + ''
  659. // 回显户型
  660. _this.getHouseTypeList({ discId: _this.houseForm.discId })
  661. _this.houseForm.houseTypeId = res.data.houseTypeId + ''
  662. // if (res.data.planPicture) {
  663. // res.data.planPicture.split(',').forEach(v => {
  664. // if (v) {
  665. // this.fileList.push({
  666. // url:
  667. // Constant.BASE_URI + '/FileController/download/' + v,
  668. // id: v
  669. // })
  670. // }
  671. // })
  672. // }
  673. }
  674. })
  675. .catch(() => {})
  676. }
  677. },
  678. // 上传相关,包括图片、文件
  679. handlePictureCardPreview: function(file) {
  680. this.handlePicturePreview(file.url)
  681. },
  682. handlePicturePreview: function(url) {
  683. this.dialogImageUrl = url
  684. this.dialogImageVisible = true
  685. },
  686. uploadHouseTypePicture: function(param) {
  687. console.log('param', param)
  688. upload(param, true).then((res) => {
  689. this.fileList.push(res)
  690. })
  691. },
  692. buildChange(val) {
  693. const postData = {
  694. discId: val[1]
  695. }
  696. this.getHouseTypeList(postData)
  697. },
  698. getHouseTypeList(val) {
  699. const _this = this
  700. _this.houseTypeOption = []
  701. _this.baseHouseTypeRequest('listAll', val).then(res => {
  702. if (res.data) {
  703. res.data.forEach(item => {
  704. _this.houseTypeOption.push({
  705. label: item.name,
  706. value: item.id
  707. })
  708. })
  709. }
  710. })
  711. },
  712. // 导入
  713. batchImport() {
  714. this.importVisible = true
  715. this.importType = 'roomInsert'
  716. this.importTitle = '房间批量导入'
  717. },
  718. cancelImport(refresh) {
  719. this.importVisible = false
  720. this.importType = ''
  721. this.getTreeData()
  722. this.getData()
  723. },
  724. // 请求封装,继承类中调用,必须存在
  725. baseRequest: function(opUrl, postData) {
  726. return this.$channel.baseRequest('ParkRoomController', opUrl, postData, 'User')
  727. },
  728. baseInfoRequest: function(opUrl, postData) {
  729. return this.$channel.baseRequest('ParkInfoController', opUrl, postData, 'User')
  730. },
  731. baseHouseTypeRequest: function(opUrl, postData) {
  732. return this.$channel.baseRequest('HouseTypeController', opUrl, postData, 'Post')
  733. }
  734. }
  735. }
  736. </script>
  737. <style scoped>
  738. .custom-tree-node {
  739. flex: 1;
  740. display: flex;
  741. align-items: center;
  742. justify-content: space-between;
  743. font-size: 16px;
  744. padding-right: 8px;
  745. }
  746. .custom-tree-container{
  747. display: flex;
  748. }
  749. .custom-tree-container .block-l {
  750. /*flex-grow: 2 ;*/
  751. //float: left;
  752. width: 20%;
  753. padding: 0 8px 0 0;
  754. }
  755. .custom-tree-container .block-r {
  756. /*flex-grow: 10;*/
  757. //float: left;
  758. width: 80%;
  759. /*padding: 0 0 0 8px;*/
  760. }
  761. </style>
  762. <style scoped>
  763. .lineheight20{
  764. padding: 7px;
  765. background-color: white;
  766. line-height: 15rpx;
  767. }
  768. .ch-input .el-input__inner {
  769. border-color: #32323A;
  770. }
  771. .ch-input-size {
  772. width: 150px;
  773. }
  774. .ch-button {
  775. border-color: #32323A;
  776. background-color: #32323A;
  777. color: #fff;
  778. }
  779. .ch-button-warning {
  780. margin-left: 10px;
  781. border-color: #E6A23C;
  782. background-color: #E6A23C;
  783. color: #fff;
  784. }
  785. .ch-button-export {
  786. margin-left: 10px;
  787. border-color: #98CC1F;
  788. background-color: #98CC1F;
  789. color: #fff;
  790. }
  791. .listBox{
  792. display: flex;
  793. flex-wrap: wrap;
  794. }
  795. .list {
  796. border: 1px solid #BEC3CB;
  797. padding: 0px 40px;
  798. border-radius: 10px;
  799. margin-right: 20px;
  800. cursor: pointer;
  801. height: 30px;
  802. line-height: 30px;
  803. background: #F2F2F2;
  804. color: #333333;
  805. }
  806. .checked {
  807. color: #FFFFFF;
  808. background: #6600FF;
  809. border: 1px solid #3377FF;
  810. }
  811. </style>