瀏覽代碼

房源管理

LAPTOP-FO2T5SIU\35838 9 月之前
父節點
當前提交
14e3f51c7b
共有 1 個文件被更改,包括 60 次插入48 次删除
  1. 60 48
      src/views/parkAssets/parkFloorDisc/index.vue

+ 60 - 48
src/views/parkAssets/parkFloorDisc/index.vue

@@ -368,7 +368,7 @@
                   <el-row style="margin-top: 10px">
                     <el-col :span="2" class="col-txt"><span>户型</span></el-col>
                     <el-col :span="5" class="col-input">
-                      <el-form-item prop="'dynamicItem.' + index + '.name'">
+                      <el-form-item :prop="'dynamicItem.' + index + '.name'">
                         <el-input
                           v-model="item.name"
 
@@ -377,7 +377,7 @@
                       </el-form-item>
                     </el-col>
                     <el-col :span="5" class="col-input">
-                      <el-form-item prop="'dynamicItem.' + index + '.area'">
+                      <el-form-item :prop="'dynamicItem.' + index + '.area'">
                         <el-input
                           v-model="item.buildArea"
 
@@ -386,7 +386,7 @@
                       </el-form-item>
                     </el-col>
                     <el-col :span="5" class="col-input">
-                      <el-form-item prop="'dynamicItem.' + index + '.area'">
+                      <el-form-item :prop="'dynamicItem.' + index + '.area'">
                         <el-input
                           v-model="item.useArea"
 
@@ -396,7 +396,7 @@
                     </el-col>
                     <el-col :span="2" class="col-txt"><span>*户型图</span></el-col>
                     <el-col :span="3" class="col-input">
-                      <el-form-item prop="'dynamicItem.' + index + '.fileList'">
+                      <el-form-item :prop="'dynamicItem.' + index + '.fileList'">
                         <el-upload
                           class="upload-demo"
                           action="/server/wx/fileController/uploadImage"
@@ -409,7 +409,7 @@
                           <div slot="file" slot-scope="{file}">
                             <a :href="file.url">{{ file.name }}</a>
                             <span class="el-upload-list__item-actions">
-                              <i class="el-icon-delete" @click="handlePictureRemove(file,contractOtherList)" />
+                              <i class="el-icon-delete" @click="handlePictureRemove(file,item.fileList)" />
                             </span>
                           </div>
                         </el-upload>
@@ -431,8 +431,8 @@
         </el-row>
       </el-form>
       <div slot="footer">
-        <el-button @click="cancelLP">取 消</el-button>
-        <el-button type="primary" @click="confirmLPSubmit()">确 定</el-button>
+        <el-button @click="cancelFQ">取 消</el-button>
+        <el-button type="primary" @click="confirmFQSubmit()">确 定</el-button>
       </div>
     </el-dialog>
 
@@ -488,7 +488,8 @@ export default {
             },
             companyOptions: [],
             dialogVisible: false,
-            dialogFQVisible: false
+            dialogFQVisible: false,
+            isView: false
         }
     },
     mounted() {
@@ -533,7 +534,7 @@ export default {
                 cancelButtonText: '取消',
                 type: 'warning'
             }).then(() => {
-                _this.baseLPRequest('remove/' + val.id, '').then((res) => {
+                _this.baseFQRequest('remove/' + val.id, '').then((res) => {
                     if (res.data.code == 200) {
                         this.getData()
                         this.getTreeData()
@@ -559,7 +560,7 @@ export default {
             _this.AllData = []
             _this.queryParam.pageNum = _this.currentPage
             _this.queryParam.pageSize = _this.pageSize
-            _this.baseLPRequest('listByModel', _this.queryParam).then((res) => {
+            _this.baseFQRequest('listByModel', _this.queryParam).then((res) => {
                 if (res.data.rows) {
                     res.data.rows.forEach(function(item) {
                         const json = _this.getItemJson(item)
@@ -623,7 +624,7 @@ export default {
         },
 
         handleEdit: function(val) {
-            this.formLP = val
+            this.getFQById(val)
             this.dialogFQVisible = true
             this.dialogTitle = '编辑楼盘'
         },
@@ -657,38 +658,34 @@ export default {
                 }
             })
         },
-        cancelLP() {
+        cancelFQ() {
             this.dialogFQVisible = false
             this.getData()
         },
-        confirmLPSubmit: function() {
-            if (this.formLP.id != null && this.formLP.id != '' && undefined != this.formLP.id) {
-                this.baseLPRequest('edit', this.formLP).then((res) => {
-                    if (res.data.code == 200) {
-                        this.dialogFQVisible = false
-                        this.getData()
-                        this.getTreeData()
-                        this.$message({
-                            message: '提交成功',
-                            type: 'success'
-                        })
-                    }
-                }).catch(() => {
-                })
+        confirmFQSubmit: function() {
+            const _this = this
+            const extraData = {
+                houseTypeStr: JSON.stringify(_this.formLP.dynamicItem)
+            }
+            const postData = Object.assign({}, _this.formLP, extraData)
+            let url
+            if (_this.formLP.id) {
+                url = 'edit'
             } else {
-                this.baseLPRequest('add', this.formLP).then((res) => {
-                    if (res.data.code == 200) {
-                        this.dialogFQVisible = false
-                        this.getData()
-                        this.getTreeData()
-                        this.$message({
-                            message: '提交成功',
-                            type: 'success'
-                        })
-                    }
-                }).catch(() => {
-                })
+                url = 'add'
             }
+            this.baseFQRequest(url, postData).then((res) => {
+                if (res.data.code == 200) {
+                    this.dialogFQVisible = false
+                    this.getData()
+                    this.getTreeData()
+                    this.$message({
+                        message: '提交成功',
+                        type: 'success'
+                    })
+                }
+            }).catch(() => {
+            })
         },
 
         handleSelectionChange(val) {
@@ -699,13 +696,24 @@ export default {
             this.selectId = this.selectId.substring(0, this.selectId.length - 1)
         },
         getItemJson: function(item) {
-            item.parkType = this.dc_map.parkType[item.parkType]
+            item.natureStr = this.dc_map.GROUP_NATURE[item.nature]
             return item
         },
         getBaseForm: function() {
             const baseForm = {
+                id: '',
+                houseTypeStr: '',
+                maintenanceFunds: '',
+                name: '',
+                paymentMethods: '',
+                propertyUnitPrice: '',
+                proportion: '',
+                subscriptionFunds: '',
+                unitPrice: '',
                 dynamicItem: [
                     {
+                        id: '',
+                        discId: '',
                         fileList: [],
                         name: '',
                         buildArea: '',
@@ -740,8 +748,6 @@ export default {
             this.groupfrom = {}
         },
         addItem(length) {
-            console.log('2222', this.formLP)
-            console.log('111', this.formLP.dynamicItem)
             this.formLP.dynamicItem.push({
                 fileList: [],
                 name: '',
@@ -754,23 +760,29 @@ export default {
             this.formLP.dynamicItem.splice(index, 1)
         },
         uploadHouseTypeList: function(param) {
+            console.log('param', param)
             upload(param, true).then((res) => {
                 this.formLP.dynamicItem[param].fileList.push(res)
             })
         },
-        // 字典项
-        generateDcMap: function() {
-            this.dc_map['dc_gender'] = this.$common.transDcMap(this.dc_gender)
+        // 获取分期详情
+        getFQById(val) {
+            const _this = this
+            _this.baseFQRequest('getById', { id: val.id }).then((res) => {
+                _this.formLP = res.data
+                _this.formLP.paymentMethods = res.data.paymentMethods + ''
+                // res.data.houseTypeStr.forEach(item => {
+                //     console.log('item', item)
+                // })
+                _this.$set(_this.formLP, 'dynamicItem', JSON.parse(res.data.houseTypeStr))
+            })
         },
         // 请求封装,继承类中调用,必须存在
         baseRequest: function(opUrl, postData) {
             return this.$channel.baseRequest('ParkInfoController', opUrl, postData, 'User')
         },
-        baseLPRequest: function(opUrl, postData) {
+        baseFQRequest: function(opUrl, postData) {
             return this.$channel.baseRequest('ParkFloorDiscController', opUrl, postData, 'User')
-        },
-        postRequest: function(opUrl, postData) {
-            return this.$channel.baseRequest('PostController', opUrl, postData, 'Post')
         }
     }
 }