ui: replace tag to spot component

This commit is contained in:
zchengo
2023-01-26 11:22:12 +08:00
parent 8f8ac3dda0
commit 7152cd065d
3 changed files with 29 additions and 12 deletions
+10 -4
View File
@@ -33,8 +33,8 @@
</template></a-button>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag v-if="text == 1" color="green">已成交</a-tag>
<a-tag v-if="text == 2" color="blue">未成交</a-tag>
<Spot v-if="text == 1" type="success" title="已成交" />
<Spot v-if="text == 2" type="danger" title="未成交" />
</template>
<template v-if="column.dataIndex === 'address'">
<span>{{ record.region + " " + record.address }}</span>
@@ -166,6 +166,7 @@ import { SearchOutlined, ExclamationCircleOutlined, ExportOutlined, MailTwoTone
import moment from 'moment'
import { createCustomer, updateCustomer, sendMailToCustomer, queryCustomerList, queryCustomerInfo, deleteCustomer, customerExport } from '../api/customer';
import { message, Modal } from 'ant-design-vue';
import Spot from '../components/Spot.vue';
import regionData from '../assets/region';
// 表格字段
@@ -344,20 +345,25 @@ const onSave = () => {
createCustomer(customer).then((res) => {
if (res.data.code == 0) {
message.success('保存成功')
customerFormRef.value.resetFields()
visible.value = false;
getCustomerList()
}
if (res.data.code == 20001) {
message.error('客户名称已经存在')
}
})
}
if (operation.value == 2) {
updateCustomer(customer).then((res) => {
if (res.data.code == 0) {
message.success('保存成功')
customerFormRef.value.resetFields()
visible.value = false;
getCustomerList()
}
})
}
customerFormRef.value.resetFields()
visible.value = false;
});
};