|
|
|
@ -128,7 +128,7 @@
|
|
|
|
|
width="35%" |
|
|
|
|
:before-close="beforeClose" |
|
|
|
|
append-to-body> |
|
|
|
|
<el-form :disabled="view" ref="form" :model="form" label-width="80px"> |
|
|
|
|
<el-form :disabled="view" ref="form" :model="form" label-width="80px" :rules = 'rules'> |
|
|
|
|
<!-- 表单字段 --> |
|
|
|
|
<el-form-item label="客户名称" prop="clientId"> |
|
|
|
|
<!-- <el-input v-model="form.clientId" placeholder="请选择客户"/>--> |
|
|
|
@ -214,7 +214,7 @@
|
|
|
|
|
<!-- 表单按钮 --> |
|
|
|
|
<template #footer> |
|
|
|
|
<span v-if="!view" class="dialog-footer"> |
|
|
|
|
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit">提 交</el-button> |
|
|
|
|
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit('form')" >提 交</el-button> |
|
|
|
|
<el-button icon="el-icon-circle-close" @click="box = false">取 消</el-button> |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
@ -313,6 +313,36 @@ export default {
|
|
|
|
|
data: [], |
|
|
|
|
optioner:[], |
|
|
|
|
optionser:[], |
|
|
|
|
rules: { |
|
|
|
|
clientId: [ |
|
|
|
|
{ required: true, message: '请选择客户', trigger: 'blur' }, |
|
|
|
|
{ min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
storeCode: [ |
|
|
|
|
{ required: true, message: '输入门店编码', trigger: 'change' } |
|
|
|
|
], |
|
|
|
|
storeName : [ |
|
|
|
|
{ required: true, message: '请输入门店名称', trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
linkman: [ |
|
|
|
|
{ required: true, message: '请输入门店联系人', trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
phone: [ |
|
|
|
|
{ required: true, message: '请输入联系电话', trigger: 'change' } |
|
|
|
|
], |
|
|
|
|
bladeRegionProvinceId: [ |
|
|
|
|
{ required: true, message: '请选择地址', trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
detailedAddress: [ |
|
|
|
|
{ required: true, message: '请填写详细地址', trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
checkInTime: [ |
|
|
|
|
{ type: 'date', required: true, message: '请选择开始时间', trigger: 'change' } |
|
|
|
|
], |
|
|
|
|
postSetTime: [ |
|
|
|
|
{ type: 'date', required: true, message: '请选择结束时间', trigger: 'change' } |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -371,37 +401,44 @@ export default {
|
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
handleSubmit () { |
|
|
|
|
if (!this.form.id) { |
|
|
|
|
console.log("from>>>",this.form); |
|
|
|
|
this.form.bladeRegionCityId = this.form.bladeRegionProvinceId[1]; |
|
|
|
|
this.form.bladeRegionAreaId = this.form.bladeRegionProvinceId[2]; |
|
|
|
|
this.form.bladeRegionProvinceId = this.form.bladeRegionProvinceId[0]; |
|
|
|
|
add(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.form.bladeRegionCityId = this.form.bladeRegionProvinceId[1]; |
|
|
|
|
this.form.bladeRegionAreaId = this.form.bladeRegionProvinceId[2]; |
|
|
|
|
this.form.bladeRegionProvinceId = this.form.bladeRegionProvinceId[0]; |
|
|
|
|
if(JSON.stringify(this.form.clientId).length < 10){ |
|
|
|
|
this.form.clientId = null; |
|
|
|
|
handleSubmit (from) { |
|
|
|
|
this.$refs[from].validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (!this.form.id) { |
|
|
|
|
console.log("from>>>",this.form); |
|
|
|
|
this.form.bladeRegionCityId = this.form.bladeRegionProvinceId[1]; |
|
|
|
|
this.form.bladeRegionAreaId = this.form.bladeRegionProvinceId[2]; |
|
|
|
|
this.form.bladeRegionProvinceId = this.form.bladeRegionProvinceId[0]; |
|
|
|
|
add(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.form.bladeRegionCityId = this.form.bladeRegionProvinceId[1]; |
|
|
|
|
this.form.bladeRegionAreaId = this.form.bladeRegionProvinceId[2]; |
|
|
|
|
this.form.bladeRegionProvinceId = this.form.bladeRegionProvinceId[0]; |
|
|
|
|
if(JSON.stringify(this.form.clientId).length < 10){ |
|
|
|
|
this.form.clientId = null; |
|
|
|
|
} |
|
|
|
|
console.log("this.form.clientId",this.form.clientId,JSON.stringify(this.form.clientId).length); |
|
|
|
|
update(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
console.log("this.form.clientId",this.form.clientId,JSON.stringify(this.form.clientId).length); |
|
|
|
|
update(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
handleAdd () { |
|
|
|
|
this.title = '新增' |
|
|
|
|