|
|
@@ -16,6 +16,16 @@
|
|
|
show-word-limit
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <div class="form-footer">
|
|
|
+ <el-button type="primary" :loading="loading" @click="submitForm">
|
|
|
+ <i class="el-icon-check"></i> 保 存
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="clearAndSave">
|
|
|
+ <i class="el-icon-delete"></i> 清空备注并保存
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -26,6 +36,7 @@
|
|
|
name: "AddRemark",
|
|
|
data() {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
form: {
|
|
|
customerId:null,
|
|
|
remark:null,
|
|
|
@@ -51,15 +62,38 @@
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
+ this.loading = true;
|
|
|
updateCustomer(this.form).then(response => {
|
|
|
+ this.loading = false;
|
|
|
if (response.code === 200) {
|
|
|
this.$message.success("操作成功");
|
|
|
this.$emit('close');
|
|
|
}
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false;
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ clearAndSave() {
|
|
|
+ this.$confirm('确定要清空备注内容并保存吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true;
|
|
|
+ this.form.remark = '';
|
|
|
+ updateCustomer(this.form).then(response => {
|
|
|
+ this.loading = false;
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.$message.success("备注已清空");
|
|
|
+ this.$emit('close');
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
@@ -84,5 +118,16 @@
|
|
|
color: #303133;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .form-footer {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ gap: 12px;
|
|
|
+ padding-top: 10px;
|
|
|
+
|
|
|
+ .el-button {
|
|
|
+ min-width: 100px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|