Commit c518da1b authored by 何远江's avatar 何远江

修改弹窗单选

parent 3121cfd4
......@@ -22,7 +22,7 @@
</el-form>
<vxe-table ref="xTable" border :data="tableData" :loading="loading" size="small" height="400">
<vxe-column type="checkbox" width="40"></vxe-column>
<vxe-column type="radio" width="40"></vxe-column>
<!-- <vxe-column field="customerId" title="客户id"></vxe-column> -->
<vxe-column field="customerName" title="客户名称"></vxe-column>
<vxe-column field="customerNickName" title="客户简称"></vxe-column>
......@@ -50,6 +50,7 @@
import { defineComponent, ref, onMounted, reactive, watch } from 'vue'
import { getCustomerPage } from '@/api/customer'
import type { VxeTableInstance } from 'vxe-table'
import { ElMessage } from 'element-plus'
export default defineComponent({
name: 'CustomerModal',
......@@ -97,8 +98,11 @@ export default defineComponent({
}
const confirmModal = () => {
const list = xTable.value?.getCheckboxRecords()
emit('confirm', list)
const list = xTable.value?.getRadioRecord()
if (list == null) {
return ElMessage.warning('请选择一条数据!')
}
emit('confirm', [list])
emit('update:visible', false)
}
......
......@@ -15,7 +15,7 @@
</el-form>
<vxe-table ref="xTable" border :data="tableData" :loading="loading" size="mini" height="400">
<vxe-column type="checkbox" width="40"></vxe-column>
<vxe-column type="radio" width="40"></vxe-column>
<vxe-column field="productCode" title="产品编码" width="200"></vxe-column>
<vxe-column field="productName" title="产品名称"></vxe-column>
<vxe-column field="productCategoryId_dictText" title="产品类型" width="200"></vxe-column>
......@@ -43,6 +43,7 @@
import { defineComponent, ref, onMounted, reactive, watch } from 'vue'
import { getProductList } from '@/api/product'
import type { VxeTableInstance } from 'vxe-table'
import { ElMessage } from 'element-plus'
export default defineComponent({
name: 'ProductModal',
......@@ -87,8 +88,12 @@
}
const confirmModal = () => {
const list = xTable.value?.getCheckboxRecords()
emit('confirm', list)
const list = xTable.value?.getRadioRecord()
if (list == null) {
return ElMessage.warning('请选择一条数据!')
}
emit('confirm', [list])
emit('update:visible', false)
}
......
......@@ -22,7 +22,7 @@
</el-form>
<vxe-table ref="xTable" border :data="tableData" :loading="loading" size="small" height="400">
<vxe-column type="checkbox" width="40"></vxe-column>
<vxe-column type="radio" width="40"></vxe-column>
<vxe-column field="nickName" title="用户名称"></vxe-column>
<vxe-column field="phonenumber" title="联系电话"></vxe-column>
<vxe-column field="email" title="邮箱"></vxe-column>
......@@ -50,6 +50,7 @@
import { defineComponent, ref, onMounted, reactive, watch } from 'vue'
import { getUserList } from '@/api/customer'
import type { VxeTableInstance } from 'vxe-table'
import { ElMessage } from 'element-plus'
export default defineComponent({
name: 'UserModal',
......@@ -79,9 +80,7 @@ export default defineComponent({
}
)
const resetForm = () => {
}
const resetForm = () => {}
const queryUser = async () => {
loading.value = true
try {
......@@ -93,8 +92,11 @@ export default defineComponent({
}
const confirmModal = () => {
const list = xTable.value?.getCheckboxRecords()
emit('confirm', list)
const list = xTable.value?.getRadioRecord()
if (list == null) {
return ElMessage.warning('请选择一条数据!')
}
emit('confirm', [list])
emit('update:visible', false)
}
......
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