Commit 1680c461 authored by 仇晓婷's avatar 仇晓婷

dd

parent 01359636
......@@ -43,7 +43,7 @@
</Col>
<Col :span="12">
<FormItem :label="l('isInform')" prop="isInform">
<Dictionary code="crm.customer.isInform" v-model="entity.isInform" type="radio"></Dictionary>
<Dictionary code="crm.customer.isInform" v-model="entity.isInform" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
......@@ -74,64 +74,66 @@
</Form>
</template>
<script>
import Api from './api'
import Api from "./api";
export default {
name: 'Edit',
name: "Edit",
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
eid: Number
eid: Number,
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.$emit('on-load')
})
this.entity = r.result;
this.$emit("on-load");
});
},
handleSubmit() {
this.disabled = true;
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
Api.update(this.entity)
.then((r) => {
this.disabled = false
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error('保存失败')
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
this.disabled = false;
this.$Message.error("保存失败");
});
} else {
this.disabled = false;
}
})
});
},
handleClose() {
this.$emit('on-close')
this.$emit("on-close");
},
l(key) {
key = 'Customer' + '.' + key
return this.$t(key)
}
key = "Customer" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
this.load(v);
}
}
}
}
},
},
};
</script>
\ No newline at end of file
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