|
@@ -8,15 +8,16 @@
|
|
|
<el-row>
|
|
|
<el-col :span="3" class="col-txt"><span>小区-分期</span></el-col>
|
|
|
<el-col :span="9" class="col-input">
|
|
|
- <el-form-item prop="roomUse">
|
|
|
- <el-select v-model="form.roomUse" filterable placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in dc_data.HOUSE_USAGE"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
+ <el-form-item>
|
|
|
+ <el-cascader
|
|
|
+ ref="findids"
|
|
|
+ v-model="form.findids"
|
|
|
+ class="full"
|
|
|
+ :append-to-body="false"
|
|
|
+ :options="options"
|
|
|
+ clearable
|
|
|
+ @change="handleChange"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="3" class="col-txt"><span>选房日</span></el-col>
|
|
@@ -45,7 +46,66 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
+ <el-row>
|
|
|
+ <!-- 特殊表单 -->
|
|
|
+ <div v-for="(item, index) in form.dynamicItem" :key="index">
|
|
|
+ <el-row style="margin-top: 10px">
|
|
|
+ <el-col :span="2" class="col-txt"><span>购房人{{ index + 1 }}</span></el-col>
|
|
|
+ <el-col :span="4" class="col-input">
|
|
|
+ <el-form-item :prop="'dynamicItem.' + index + '.name'">
|
|
|
+ <el-input
|
|
|
+ v-model="item.name"
|
|
|
+ placeholder="请填写姓名"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4" class="col-input">
|
|
|
+ <el-form-item :prop="'dynamicItem.' + index + '.identityCard'">
|
|
|
+ <el-input
|
|
|
+ v-model="item.identityCard"
|
|
|
+ placeholder="请填写身份证号"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4" class="col-input">
|
|
|
+ <el-form-item :prop="'dynamicItem.' + index + '.phone'">
|
|
|
+ <el-input
|
|
|
+ v-model="item.phone"
|
|
|
+ placeholder="请填写手机号"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col v-if="index !== 0" :span="6" class="col-input">
|
|
|
+ <el-form-item :prop="'dynamicItem.' + index + '.relationship'">
|
|
|
+ <el-select
|
|
|
+ v-model="item.relationship"
|
|
|
+ placeholder="与1的关系"
|
|
|
+ filterable
|
|
|
+ :popper-append-to-body="false"
|
|
|
+ popper-class="statistic_base"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="relationship in dc_data.RELATIONSHIP"
|
|
|
+ :key="relationship.value"
|
|
|
+ :label="relationship.label"
|
|
|
+ :value="relationship.value"
|
|
|
+ :popper-append-to-body="false"
|
|
|
+ popper-class="statistic_base"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2" class="col-input">
|
|
|
+ <el-button v-if="index !== 0" type="danger" size="mini" @click="deleteItem(item, index)">-</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="2" class="col-txt">
|
|
|
+ <el-button size="small" type="text" @click="addItem">+继续添加</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -68,31 +128,60 @@ export default {
|
|
|
mixins: [Base, BaseData],
|
|
|
data() {
|
|
|
return {
|
|
|
- dc_key: [],
|
|
|
- form: {},
|
|
|
+ dc_key: ['RELATIONSHIP'],
|
|
|
+ form: {
|
|
|
+ dynamicItem: [
|
|
|
+ {
|
|
|
+ id: '',
|
|
|
+ customerManagementId: '',
|
|
|
+ name: '',
|
|
|
+ identityCard: '',
|
|
|
+ phone: '',
|
|
|
+ relationship: ''
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
rules: {
|
|
|
|
|
|
},
|
|
|
- addLoading: false
|
|
|
+ addLoading: false,
|
|
|
+ options: []
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.getTreeSelectData()
|
|
|
},
|
|
|
methods: {
|
|
|
initData(data) {
|
|
|
this.initDict(this.dc_key).then(res => {
|
|
|
-
|
|
|
+ this.getById(data.id)
|
|
|
})
|
|
|
},
|
|
|
+ handleChange(value) {
|
|
|
|
|
|
+ },
|
|
|
+ getById(val) {
|
|
|
+ this.baseRequest('getById', { id: val }).then(res => {
|
|
|
+ this.form = res.data
|
|
|
+ this.form.findids = [res.data.groupId, res.data.discId]
|
|
|
+ const json = JSON.parse(res.data.buyerJson)
|
|
|
+ })
|
|
|
+ },
|
|
|
confirmSubmit: function() {
|
|
|
const _this = this
|
|
|
this.$refs.form.validate(valid => {
|
|
|
if (valid) {
|
|
|
- const soaUrl = 'billAdd'
|
|
|
- const extraData = {}
|
|
|
+ let soaUrl = 'add'
|
|
|
+ if (_this.form.id) {
|
|
|
+ soaUrl = 'edit'
|
|
|
+ }
|
|
|
+ const extraData = {
|
|
|
+ groupId: _this.form.findids[0],
|
|
|
+ discId: _this.form.findids[1],
|
|
|
+ buyerJson: JSON.stringify(_this.form.dynamicItem)
|
|
|
+ }
|
|
|
const postData = Object.assign({}, _this.form, extraData)
|
|
|
- // this.opRecord(postData, soaUrl)
|
|
|
+ console.log('postData', postData)
|
|
|
this.baseRequest(soaUrl, postData).then(res => {
|
|
|
if (res.data.code == '200') {
|
|
|
_this.$message({
|
|
@@ -100,6 +189,11 @@ export default {
|
|
|
type: 'success'
|
|
|
})
|
|
|
_this.cancel()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
_this.$message({
|
|
@@ -116,8 +210,31 @@ export default {
|
|
|
cancel() {
|
|
|
this.$emit('cancel')
|
|
|
},
|
|
|
+ getTreeSelectData: function() {
|
|
|
+ this.baseInfoRequest('getTreeData3', {}).then((res) => {
|
|
|
+ this.options = res.data.data
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addItem(length) {
|
|
|
+ this.form.dynamicItem.push({
|
|
|
+ id: '',
|
|
|
+ customerManagementId: '',
|
|
|
+ name: '',
|
|
|
+ identityCard: '',
|
|
|
+ phone: '',
|
|
|
+ relationship: ''
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 删除方法
|
|
|
+ deleteItem(item, index) {
|
|
|
+ this.form.dynamicItem.splice(index, 1)
|
|
|
+ },
|
|
|
baseRequest(opUrl, postData) {
|
|
|
- return this.$channel.globeRequest('BillManagementController', opUrl, postData, 'project')
|
|
|
+ return this.$channel.globeRequest('CustomerManagementController', opUrl, postData, 'project')
|
|
|
+ },
|
|
|
+ baseInfoRequest: function(opUrl, postData) {
|
|
|
+ return this.$channel.baseRequest('ParkInfoController', opUrl, postData, 'User')
|
|
|
}
|
|
|
|
|
|
}
|