sc
This commit is contained in:
@@ -12,14 +12,17 @@
|
||||
<el-button type="primary" @click="handleAdd">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="tableData">
|
||||
<el-table v-loading="loading" :data="tableData" max-height="calc(100vh - 200px)">
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="phone" label="手机号" />
|
||||
<el-table-column prop="name" label="姓名" />
|
||||
<el-table-column prop="mark" label="标记" />
|
||||
<el-table-column label="小程序码" align="center" width="140px">
|
||||
<el-table-column label="小程序码" align="center" width="120px">
|
||||
<template #default="{ row }">
|
||||
<img :src="row.qrCode" style="width: 100px; height: 100px" />
|
||||
<img
|
||||
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.appletUrl}`"
|
||||
style="width: 80px; height: 80px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120px">
|
||||
@@ -60,11 +63,13 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Resell">
|
||||
import { getResellList, addResell, updateResell } from '@/api/xjapplet/resell'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const searchForm = ref({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 50,
|
||||
phone: '',
|
||||
name: ''
|
||||
})
|
||||
@@ -72,6 +77,7 @@ const searchForm = ref({
|
||||
const tableData = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
const loading = ref(false)
|
||||
const showDialog = ref(false)
|
||||
|
||||
const form = ref({
|
||||
@@ -85,13 +91,22 @@ const rules = {
|
||||
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
searchList()
|
||||
})
|
||||
|
||||
function searchList() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
function getList() {
|
||||
console.log(searchForm.value)
|
||||
loading.value = true
|
||||
getResellList(searchForm.value).then((response) => {
|
||||
tableData.value = response.list
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
@@ -109,9 +124,19 @@ async function handleSave() {
|
||||
if (!valid) return
|
||||
|
||||
// 调用接口
|
||||
showDialog.value = false
|
||||
message.success('成功')
|
||||
searchList()
|
||||
if (form.value.id) {
|
||||
updateResell(form.value).then(() => {
|
||||
message.success('修改成功')
|
||||
showDialog.value = false
|
||||
searchList()
|
||||
})
|
||||
} else {
|
||||
addResell(form.value).then(() => {
|
||||
message.success('新增成功')
|
||||
showDialog.value = false
|
||||
searchList()
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user