|
@@ -5,7 +5,7 @@
|
|
|
:show-close="false"
|
|
|
:close-on-click-modal="false"
|
|
|
:visible.sync="isShow"
|
|
|
- :title="curObj.id ? '编辑成交价' : '新增成交价'"
|
|
|
+ :title="curObj.id ? '编辑轮值记录' : '新增轮值记录'"
|
|
|
:fullscreen="false"
|
|
|
width="800px"
|
|
|
custom-class="xl-dialog"
|
|
@@ -48,48 +48,15 @@ export default {
|
|
|
methods: {
|
|
|
getDef (str) {
|
|
|
let params = { ...this.curObj }
|
|
|
- if (str === 'price') {
|
|
|
- params = {...this.$refs.ruleForm.baseForm}
|
|
|
- if (params.area && params.unit_price) {
|
|
|
- params.price = (params.area * params.unit_price / 10000).toFixed(1)
|
|
|
- if (params.price.charAt(params.price.length - 1) === '0') {
|
|
|
- params.price = parseInt(params.price)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // if (!params.company) params.company = '贝壳'
|
|
|
this.formData = [
|
|
|
- { label: '面积', key: 'area', class: 'c-3', type: 'inputFont', appendFont: '㎡', changeHandle: this.priceChange, rules: 1},
|
|
|
- { label: '层数', class: 'c-3', key: 'cur_layer', rules: [
|
|
|
- { validator: (rule, value, callback) => {
|
|
|
- if (Number(value) < 0 || isNaN(Number(value))) {
|
|
|
- callback(new Error('请输入数字'))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
- }
|
|
|
- }, trigger: 'blur' },
|
|
|
- { required: true, message: '请输入层数', trigger: 'blur' },
|
|
|
- ] },
|
|
|
- { label: '总层数', class: 'c-3', key: 'layer', rules: [
|
|
|
- { validator: (rule, value, callback) => {
|
|
|
- if (Number(value) < 0 || isNaN(Number(value))) {
|
|
|
- callback(new Error('请输入数字'))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
- }
|
|
|
- }, trigger: 'blur' },
|
|
|
- { required: true, message: '请输入总层数', trigger: 'blur' },
|
|
|
- ] },
|
|
|
- { label: '签约中介', key: 'company', class: 'c-3', type: 'select', options: this.$dictData.zjjg, rules: 1},
|
|
|
- { label: '签约日期', key: 'sign_at', type: 'datePicker', type2: 'date', class: 'c-3', rules: 1},
|
|
|
- { label: '单价', key: 'unit_price', class: 'c-3', type: 'inputFont', appendFont: '元', changeHandle: this.priceChange, rules: 1},
|
|
|
- { label: '总价', key: 'price', class: 'c-3', type: 'inputFont', appendFont: '万元', rules: 1},
|
|
|
+ { label: '客户信息', key: 'remark', type: 'textarea' },
|
|
|
+ { label: '关联客户', key: 'customer_id', type: 'selectRemote',
|
|
|
+ remoteParams: { skey: 'name', api: `user.admcustomerlist`, opKey: 'name', opVal: 'id' },
|
|
|
+ remoteOptions: [{ keyRO: params.customer_name, valRO: params.customer_id }],
|
|
|
+ },
|
|
|
]
|
|
|
this.setDefaultValue(params)
|
|
|
},
|
|
|
- priceChange () {
|
|
|
- this.getDef('price')
|
|
|
- },
|
|
|
close (str) {
|
|
|
if (str === 'confirm') {
|
|
|
this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
|
|
@@ -97,10 +64,7 @@ export default {
|
|
|
const oldform = this.$refs.ruleForm.baseForm
|
|
|
const newForm = { ...oldform }
|
|
|
if (this.curObj.id) newForm.id = this.curObj.id
|
|
|
- newForm.estate_id = this.parentData.searchForm.estate_id
|
|
|
- if (this.imagesArr && this.imagesArr.length > 0) newForm.images = this.imagesArr.join(',')
|
|
|
- let apiStr = 'admpriceadd'
|
|
|
- if (this.curObj.id) apiStr = 'admpriceedit'
|
|
|
+ let apiStr = 'admreceptbindcustomer'
|
|
|
this.$api.house[apiStr](newForm).then(data => {
|
|
|
this.$msgs(newForm.estate_id ? '编辑成功' : '新增成功')
|
|
|
this.$emit('close', newForm)
|
|
@@ -123,8 +87,5 @@ export default {
|
|
|
::v-deep .el-date-editor.el-input {
|
|
|
width: 100%;
|
|
|
}
|
|
|
- ::v-deep .el-textarea__inner {
|
|
|
- height: 300px;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|