Commit 172ca21d authored by rencs's avatar rencs

8.28 bug

parent 8560d93a
...@@ -98,7 +98,11 @@ ...@@ -98,7 +98,11 @@
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="add_edit_dialog = false">取 消</el-button> <el-button @click="add_edit_dialog = false">取 消</el-button>
<el-button type="primary" @click="add_company_ok('company_form')">确 定</el-button> <el-button
type="primary"
:disabled="btn_disable"
@click="add_company_ok('company_form')"
>确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -193,6 +197,7 @@ export default { ...@@ -193,6 +197,7 @@ export default {
mobile: "", mobile: "",
businessLicense: "", businessLicense: "",
}, },
btn_disable: null,
}; };
}, },
created() { created() {
...@@ -208,7 +213,9 @@ export default { ...@@ -208,7 +213,9 @@ export default {
add_company_ok(formname) { add_company_ok(formname) {
this.$refs[formname].validate((valid) => { this.$refs[formname].validate((valid) => {
if (valid) { if (valid) {
this.btn_disable = true;
if (this.title_text == "编辑公司") { if (this.title_text == "编辑公司") {
let that = this;
upd_company(this.company_form).then((res) => { upd_company(this.company_form).then((res) => {
if (res.status == 200) { if (res.status == 200) {
this.$message({ this.$message({
...@@ -216,12 +223,14 @@ export default { ...@@ -216,12 +223,14 @@ export default {
type: "success", type: "success",
}); });
this.add_edit_dialog = false; this.add_edit_dialog = false;
this.handleFilter(); this.handleFilter();
} else { } else {
this.$error({ this.$error({
message: res.message, message: res.message,
}); });
} }
that.btn_disable = null;
}); });
return; return;
} }
...@@ -310,11 +319,16 @@ export default { ...@@ -310,11 +319,16 @@ export default {
this.add_edit_dialog = true; this.add_edit_dialog = true;
this.title_text = "添加公司"; this.title_text = "添加公司";
this.form_clear(); this.form_clear();
this.$nextTick(() => {
this.$refs["company_form"].clearValidate();
});
}, },
edit_item(row) { edit_item(row) {
this.add_edit_dialog = true; this.add_edit_dialog = true;
this.title_text = "编辑公司"; this.title_text = "编辑公司";
this.$nextTick(() => {
this.$refs["company_form"].clearValidate();
});
this.company_form = { this.company_form = {
id: row.id, id: row.id,
name: row.name, name: row.name,
......
...@@ -360,6 +360,7 @@ export default { ...@@ -360,6 +360,7 @@ export default {
keyword: "", keyword: "",
location: "", location: "",
clientHeight: 500, // 屏幕高度 clientHeight: 500, // 屏幕高度
btn_disable: null,
}; };
}, },
...@@ -457,6 +458,7 @@ export default { ...@@ -457,6 +458,7 @@ export default {
add_store_ok(formname) { add_store_ok(formname) {
this.$refs[formname].validate((valid) => { this.$refs[formname].validate((valid) => {
if (valid) { if (valid) {
this.btn_disable = true;
let addr_province = undefined; let addr_province = undefined;
let addr_city = undefined; let addr_city = undefined;
let addr_county = undefined; let addr_county = undefined;
...@@ -493,6 +495,7 @@ export default { ...@@ -493,6 +495,7 @@ export default {
latitude: this.store_form.latitude, //纬度 latitude: this.store_form.latitude, //纬度
longitude: this.store_form.longitude, //经度 longitude: this.store_form.longitude, //经度
}; };
let that = this;
add_store(data).then((res) => { add_store(data).then((res) => {
if (res.status == 200) { if (res.status == 200) {
this.$message({ this.$message({
...@@ -507,6 +510,7 @@ export default { ...@@ -507,6 +510,7 @@ export default {
message: res.message, message: res.message,
}); });
} }
that.btn_disable = null;
}); });
} else { } else {
return false; return false;
...@@ -657,6 +661,8 @@ export default { ...@@ -657,6 +661,8 @@ export default {
let _this = this; let _this = this;
gc.getLocation(point, function (rs) { gc.getLocation(point, function (rs) {
var addComp = rs.addressComponents; var addComp = rs.addressComponents;
_this.changeProvince(rs.addressComponents.province);
_this.changeCity(rs.addressComponents.city);
_this.store_form.province = rs.addressComponents.province; _this.store_form.province = rs.addressComponents.province;
_this.store_form.city = rs.addressComponents.city; _this.store_form.city = rs.addressComponents.city;
if (rs.addressComponents && rs.addressComponents != "") { if (rs.addressComponents && rs.addressComponents != "") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment