瀏覽代碼

意向金

LAPTOP-FO2T5SIU\35838 8 月之前
父節點
當前提交
6e4f28d70c

+ 241 - 0
src/views/customerManagement/intentionalDeposit/addIntentionalDeposit.vue

@@ -0,0 +1,241 @@
+<template>
+  <div>
+    <el-form ref="form" v-loading="addLoading" :model="form" style="width: 100%;padding: 5px" :rules="rules">
+      <el-row>
+        <el-col style="padding-bottom: 10px">
+          <span class="card_title">意向金登记</span>
+          <el-card shadow="always" style="padding: 15px 5px 5px 15px">
+            <el-row>
+              <el-col :span="3" class="col-txt"><span>意向金编号:</span></el-col>
+              <el-col :span="3" class="col-txt"><span>{{ serialNumber }}</span></el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="3" class="col-txt"><span>*应收定金(元)</span></el-col>
+              <el-col :span="9" class="col-input">
+                <el-form-item>
+                  <el-input v-model="form.receivableMoney" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="3" class="col-txt"><span>*实收金额(元)</span></el-col>
+              <el-col :span="9" class="col-input">
+                <el-form-item>
+                  <el-input v-model="form.receivedAmount" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="3" class="col-txt"><span>*收款方式</span></el-col>
+              <el-col :span="9" class="col-input">
+                <el-form-item>
+                  <el-select
+                    v-model="form.paymentMethod"
+                    :popper-append-to-body="false"
+                    popper-class="statistic_base"
+                    placeholder=""
+                    filterable
+                  >
+                    <el-option
+                      v-for="item in dc_data.PAYMENT_METHODS"
+                      :key="item.value"
+                      popper-class="statistic_base"
+                      :popper-append-to-body="false"
+                      :label="item.label"
+                      :value="item.value"
+                    />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="3" class="col-txt"><span>收款时间</span></el-col>
+              <el-col :span="9" class="col-input">
+                <el-form-item>
+                  <el-date-picker
+                    v-model="form.collectionTime"
+                    type="date"
+                    placeholder="年月日"
+                    value-format="yyyy-MM-dd"
+                  />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="3" class="col-txt"><span>备注</span></el-col>
+              <el-col :span="21" class="col-input">
+                <el-form-item>
+                  <el-input v-model="form.remark" type="textarea" :autosize="{ minRows: 2, maxRows: 100}" placeholder="请输入内容" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="3" class="col-txt"><span>附件</span></el-col>
+              <el-col :span="21" class="col-input">
+                <el-form-item>
+                  <el-upload
+                    class="upload-demo"
+                    action="/server/wx/fileController/uploadImage"
+                    :http-request="uploadPhoto"
+                    :before-remove="beforeRemove"
+                    multiple
+                    :file-list="fileList"
+                  >
+                    <el-button size="small" type="primary">点击上传</el-button>
+                    <div slot="file" slot-scope="{file}" style="overflow:hidden;white-space: nowrap;text-overflow:ellipsis">
+                      <el-tooltip class="item" effect="dark" :content="file.name" placement="top-start">
+                        <a :href="file.url">{{ file.name }}</a>
+                      </el-tooltip>
+                      <span class="el-upload-list__item-actions">
+                        <i class="el-icon-delete" @click="handlePictureRemove(file,fileList)" />
+                      </span>
+                    </div>
+                  </el-upload>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-col>
+      </el-row>
+    </el-form>
+    <div style="text-align: right">
+      <el-button @click="cancel">取 消</el-button>
+      <el-button type="primary" @click="confirmSubmit()">提 交</el-button>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import Base from '@/views/base/base'
+import BaseData from '@/views/base/baseData'
+import { upload } from '@/static/utils/channel'
+
+export default {
+    name: 'AddIntentionalDepositVue',
+    components: { },
+    mixins: [Base, BaseData],
+    data() {
+        return {
+            dc_key: ['PAYMENT_METHODS'],
+            form: {
+
+            },
+            rules: {
+                receivableMoney: [{ required: true, trigger: 'blur', message: '请输入应收定金' }],
+                receivedAmount: [{ required: true, trigger: 'blur', message: '请输入实收金额' }],
+                paymentMethod: [{ required: true, trigger: 'change', message: '请输入实收金额' }],
+                collectionTime: [{ required: true, trigger: 'blur', message: '请选择收款时间' }]
+            },
+            addLoading: false,
+            serialNumber: '',
+            fileList: [],
+            customerManagementId: ''
+        }
+    },
+    mounted() {
+
+    },
+    methods: {
+        initData(data) {
+            this.customerManagementId = data.id
+            this.initDict(this.dc_key).then(res => {
+                this.getByCustomerManagementId(data)
+            })
+        },
+        handleChange(value) {
+
+        },
+        getByCustomerManagementId(val) {
+            const data = {
+                customerManagementId: val.id
+            }
+            this.baseRequest('getByCustomerManagementId', data).then(res => {
+                if (res.data) {
+                    this.form = res.data
+                    this.serialNumber = this.form.serialNumber
+                    this.form.paymentMethod = this.form.paymentMethod + ''
+                    if (this.form.fileList) {
+                        this.fileList = JSON.parse(this.form.fileList)
+                    }
+                } else {
+                    this.getSerialNumber(val)
+                    this.getFQById(val)
+                }
+            })
+        },
+        getSerialNumber(val) {
+            const data = {
+                customerManagementId: val.id
+            }
+            this.baseRequest('getSerialNumber', data).then(res => {
+                this.serialNumber = res.data
+            })
+        },
+        getFQById(val) {
+            const data = {
+                id: val.discId
+            }
+            this.baseFQRequest('getById', data).then(res => {
+                this.$set(this.form, 'receivableMoney', res.data.subscriptionFunds)
+            })
+        },
+        confirmSubmit: function() {
+            const _this = this
+            this.$refs.form.validate(valid => {
+                if (valid) {
+                    let soaUrl = 'add'
+                    // 已收取状态
+                    if (_this.form.id) {
+                        soaUrl = 'edit'
+                    }
+                    const extraData = {
+                        customerManagementId: this.customerManagementId,
+                        serialNumber: _this.serialNumber,
+                        fileList: JSON.stringify(_this.fileList)
+                    }
+                    const postData = Object.assign({}, _this.form, extraData)
+                    this.baseRequest(soaUrl, postData).then(res => {
+                        if (res.data.code === 200) {
+                            _this.$message({
+                                message: '新增成功',
+                                type: 'success'
+                            })
+                            _this.cancel()
+                        } else {
+                            _this.$message({
+                                message: res.msg,
+                                type: 'warning'
+                            })
+                        }
+                    }).catch(err => {
+                        _this.$message({
+                            message: err,
+                            type: 'warning'
+                        })
+                    })
+                } else {
+                    console.log('error submit!!')
+                    return false
+                }
+            })
+        },
+        cancel() {
+            this.$emit('cancel')
+        },
+
+        uploadPhoto: function(param) {
+            upload(param, true).then((res) => {
+                this.fileList.push(res)
+            })
+        },
+        baseRequest(opUrl, postData) {
+            return this.$channel.globeRequest('IntentionalDepositController', opUrl, postData, 'project')
+        },
+        baseFQRequest: function(opUrl, postData) {
+            return this.$channel.baseRequest('ParkFloorDiscController', opUrl, postData, 'User')
+        }
+
+    }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 54 - 1
src/views/customerManagement/numberManagement/index.vue

@@ -109,6 +109,24 @@
                 @click="handleSubscribe(scope.row)"
               >认购
               </el-button>
+              <el-button
+                size="mini"
+                type="text"
+                @click="handleGiveUp(scope.row)"
+              >放弃资格
+              </el-button>
+              <el-button
+                size="mini"
+                type="text"
+                @click="handleIntentionalDeposit(scope.row)"
+              >意向金
+              </el-button>
+              <el-button
+                size="mini"
+                type="text"
+                @click="handleView(scope.row)"
+              >查看
+              </el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -178,6 +196,23 @@
       <subscribe-index v-if="dialogSubscribeVisible" ref="subscribeIndex" @cancel="cancel" />
     </el-dialog>
 
+    <!--意向金-->
+    <el-dialog
+      :visible.sync="dialogIntentionalVisible"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      title=""
+      width="90%"
+      top="20px"
+      class="statistic_base"
+      :append-to-body="true"
+      :modal-append-to-body="true"
+      custom-class="tagdialog"
+      @close="getData"
+    >
+      <add-intentional-deposit v-if="dialogIntentionalVisible" ref="addIntentionalDeposit" @cancel="cancel" />
+    </el-dialog>
+
   </div>
 </template>
 <script>
@@ -187,10 +222,11 @@ import BaseDept from '@/views/base/baseDept.vue'
 import AddCustomer from '@/views/customerManagement/numberManagement/addCustomer.vue'
 import AddHouse from '@/views/customerManagement/roomChose/addHouse.vue'
 import SubscribeIndex from '@/views/customerManagement/subscribe/subscribeIndex.vue'
+import AddIntentionalDeposit from '@/views/customerManagement/intentionalDeposit/addIntentionalDeposit.vue'
 
 export default {
     name: 'NumberManagement',
-    components: { AddHouse, AddCustomer, SubscribeIndex },
+    components: { AddIntentionalDeposit, AddHouse, AddCustomer, SubscribeIndex },
     mixins: [Base, BaseData, BaseDept],
     data() {
         return {
@@ -203,6 +239,7 @@ export default {
             dialogAddVisible: false,
             dialogHouseVisible: false,
             dialogSubscribeVisible: false,
+            dialogIntentionalVisible: false,
             groupOption: [],
             discOption: []
         }
@@ -322,6 +359,21 @@ export default {
             this.$nextTick(() => {
                 this.$refs.subscribeIndex.initData(val)
             })
+        },
+        /* 放弃资格*/
+        handleGiveUp() {
+
+        },
+        // 意向金
+        handleIntentionalDeposit(val) {
+            this.dialogIntentionalVisible = true
+            // 新vue时调用的方法
+            this.$nextTick(() => {
+                this.$refs.addIntentionalDeposit.initData(val)
+            })
+        },
+        handleView() {
+
         },
         downLoad() {
 
@@ -354,6 +406,7 @@ export default {
             this.dialogAddVisible = false
             this.dialogHouseVisible = false
             this.dialogSubscribeVisible = false
+            this.dialogIntentionalVisible = false
         },
         getGroupList() {
             this.groupOption = []

+ 33 - 31
src/views/customerManagement/subscribe/addSubscribe.vue

@@ -77,13 +77,13 @@
                     multiple
                     :file-list="fileList"
                   >
-                    <el-button v-if="!isView" size="small" type="primary">点击上传</el-button>
+                    <el-button size="small" type="primary">点击上传</el-button>
                     <div slot="file" slot-scope="{file}" style="overflow:hidden;white-space: nowrap;text-overflow:ellipsis">
                       <el-tooltip class="item" effect="dark" :content="file.name" placement="top-start">
                         <a :href="file.url">{{ file.name }}</a>
                       </el-tooltip>
                       <span class="el-upload-list__item-actions">
-                        <i v-if="!isView" class="el-icon-delete" @click="handlePictureRemove(file,fileList)" />
+                        <i class="el-icon-delete" @click="handlePictureRemove(file,fileList)" />
                       </span>
                     </div>
                   </el-upload>
@@ -118,7 +118,10 @@ export default {
 
             },
             rules: {
-
+                receivableMoney: [{ required: true, trigger: 'blur', message: '请输入应收定金' }],
+                receivedAmount: [{ required: true, trigger: 'blur', message: '请输入实收金额' }],
+                paymentMethod: [{ required: true, trigger: 'change', message: '请输入实收金额' }],
+                collectionTime: [{ required: true, trigger: 'blur', message: '请选择收款时间' }]
             },
             addLoading: false,
             serialNumber: '',
@@ -126,12 +129,18 @@ export default {
         }
     },
     mounted() {
-        this.getTreeSelectData()
+
     },
     methods: {
         initData(data) {
+            this.form = data
             this.initDict(this.dc_key).then(res => {
-                // this.getById(data.id)
+                if (data.statusStr === '未收取') {
+                    this.getSerialNumber(data)
+                    this.form.receivableMoney = data.receivableMoney
+                } else {
+                    this.getById(data.id)
+                }
             })
         },
         handleChange(value) {
@@ -140,39 +149,37 @@ export default {
         getById(val) {
             this.baseRequest('getById', { id: val }).then(res => {
                 this.form = res.data
-                this.form.findids = [res.data.groupId, res.data.discId]
-                this.form.dynamicItem = []
-                const json = JSON.parse(res.data.buyerJson)
-                if (json) {
-                    json.forEach(item => {
-                        const data = {
-                            name: item.name,
-                            identityCard: item.identityCard,
-                            phone: item.phone,
-                            relationship: item.relationship
-                        }
-                        this.form.dynamicItem.push(data)
-                    })
+                this.serialNumber = this.form.serialNumber
+                this.form.paymentMethod = this.form.paymentMethod + ''
+                if (this.form.fileList) {
+                    this.fileList = JSON.parse(this.form.fileList)
                 }
             })
         },
+        getSerialNumber(val) {
+            const data = {
+                houseId: val.houseId
+            }
+            this.baseRequest('getSerialNumber', data).then(res => {
+                this.serialNumber = res.data
+            })
+        },
         confirmSubmit: function() {
             const _this = this
             this.$refs.form.validate(valid => {
                 if (valid) {
                     let soaUrl = 'add'
-                    if (_this.form.id) {
+                    // 已收取状态
+                    if (_this.form.status === 2) {
                         soaUrl = 'edit'
                     }
                     const extraData = {
-                        groupId: _this.form.findids[0],
-                        discId: _this.form.findids[1],
-                        buyerJson: JSON.stringify(_this.form.dynamicItem)
+                        serialNumber: _this.serialNumber,
+                        fileList: JSON.stringify(_this.fileList)
                     }
                     const postData = Object.assign({}, _this.form, extraData)
-                    console.log('postData', postData)
                     this.baseRequest(soaUrl, postData).then(res => {
-                        if (res.data.code == '200') {
+                        if (res.data.code === 200) {
                             _this.$message({
                                 message: '新增成功',
                                 type: 'success'
@@ -199,19 +206,14 @@ export default {
         cancel() {
             this.$emit('cancel')
         },
-        getTreeSelectData: function() {
-            this.baseInfoRequest('getTreeData3', {}).then((res) => {
-                this.options = res.data.data
-            }).catch(() => {
-            })
-        },
+
         uploadPhoto: function(param) {
             upload(param, true).then((res) => {
                 this.fileList.push(res)
             })
         },
         baseRequest(opUrl, postData) {
-            return this.$channel.globeRequest('CustomerManagementController', opUrl, postData, 'project')
+            return this.$channel.globeRequest('RoomSelectionInfoController', opUrl, postData, 'project')
         },
         baseInfoRequest: function(opUrl, postData) {
             return this.$channel.baseRequest('ParkInfoController', opUrl, postData, 'User')

+ 13 - 5
src/views/customerManagement/subscribe/subscribeIndex.vue

@@ -37,6 +37,7 @@
                 <el-button
                   size="mini"
                   type="text"
+                  :disabled="scope.row.status === 2"
                   @click="handleAdd(scope.row)"
                 >登记
                 </el-button>
@@ -77,7 +78,7 @@
       custom-class="tagdialog"
       @close="getData"
     >
-      <add-subscribe v-if="dialogAddVisible" ref="addSubscribe" @cancel="cancel" />
+      <add-subscribe v-if="dialogAddVisible" ref="addSubscribe" @cancel="addSubscribeCancel" />
     </el-dialog>
 
   </div>
@@ -117,15 +118,19 @@ export default {
                 this.getData(data.id)
             })
         },
-        handleAdd() {
+        handleAdd(val) {
             this.dialogAddVisible = true
             // 新vue时调用的方法
             this.$nextTick(() => {
-                this.$refs.addSubscribe.initData()
+                this.$refs.addSubscribe.initData(val)
             })
         },
-        handleEdit() {
-
+        handleEdit(val) {
+            this.dialogAddVisible = true
+            // 新vue时调用的方法
+            this.$nextTick(() => {
+                this.$refs.addSubscribe.initData(val)
+            })
         },
         getData: function(val) {
             const _this = this
@@ -178,6 +183,9 @@ export default {
         cancel() {
             this.$emit('cancel')
         },
+        addSubscribeCancel() {
+            this.dialogAddVisible = false
+        },
         downLoad() {
 
         },