提交3
This commit is contained in:
parent
9617352bc0
commit
c16c4f80f5
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询客户表列表
|
||||
export function listCustomer(query) {
|
||||
return request({
|
||||
url: '/system/customer/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询客户表详细
|
||||
export function getCustomer(id) {
|
||||
return request({
|
||||
url: '/system/customer/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增客户表
|
||||
export function addCustomer(data) {
|
||||
return request({
|
||||
url: '/system/customer',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改客户表
|
||||
export function updateCustomer(data) {
|
||||
return request({
|
||||
url: '/system/customer',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除客户表
|
||||
export function delCustomer(id) {
|
||||
return request({
|
||||
url: '/system/customer/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询提货二维码列表
|
||||
export function listTwodimension(query) {
|
||||
return request({
|
||||
url: '/system/twodimension/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询提货二维码详细
|
||||
export function getTwodimension(id) {
|
||||
return request({
|
||||
url: '/system/twodimension/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增提货二维码
|
||||
export function addTwodimension(data) {
|
||||
return request({
|
||||
url: '/system/twodimension',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改提货二维码
|
||||
export function updateTwodimension(data) {
|
||||
return request({
|
||||
url: '/system/twodimension',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除提货二维码
|
||||
export function delTwodimension(id) {
|
||||
return request({
|
||||
url: '/system/twodimension/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,291 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="客户名" prop="customername">
|
||||
<el-input
|
||||
v-model="queryParams.customername"
|
||||
placeholder="请输入客户名"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="二维码id" prop="twodimensionid">
|
||||
<el-input
|
||||
v-model="queryParams.twodimensionid"
|
||||
placeholder="请输入二维码id"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:customer:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:customer:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:customer:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:customer:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="customerList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="客户id" align="center" prop="id" />
|
||||
<el-table-column label="客户名" align="center" prop="customername" />
|
||||
<el-table-column label="二维码id" align="center" prop="twodimensionid" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:customer:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:customer:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改客户表对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="customerRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="客户名" prop="customername">
|
||||
<el-input v-model="form.customername" placeholder="请输入客户名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="二维码id" prop="twodimensionid">
|
||||
<el-input v-model="form.twodimensionid" placeholder="请输入二维码id" />
|
||||
</el-form-item>
|
||||
<el-divider content-position="center">提货二维码信息</el-divider>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="Plus" @click="handleAddTwodimension">添加</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" icon="Delete" @click="handleDeleteTwodimension">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="twodimensionList" :row-class-name="rowTwodimensionIndex" @selection-change="handleTwodimensionSelectionChange" ref="twodimension">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Customer">
|
||||
import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer } from "@/api/system/customer";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const customerList = ref([]);
|
||||
const twodimensionList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const checkedTwodimension = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
customername: null,
|
||||
twodimensionid: null
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询客户表列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listCustomer(queryParams.value).then(response => {
|
||||
customerList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
customername: null,
|
||||
twodimensionid: null
|
||||
};
|
||||
twodimensionList.value = [];
|
||||
proxy.resetForm("customerRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加客户表";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getCustomer(_id).then(response => {
|
||||
form.value = response.data;
|
||||
twodimensionList.value = response.data.twodimensionList;
|
||||
open.value = true;
|
||||
title.value = "修改客户表";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["customerRef"].validate(valid => {
|
||||
if (valid) {
|
||||
form.value.twodimensionList = twodimensionList.value;
|
||||
if (form.value.id != null) {
|
||||
updateCustomer(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addCustomer(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除客户表编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delCustomer(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 提货二维码序号 */
|
||||
function rowTwodimensionIndex({ row, rowIndex }) {
|
||||
row.index = rowIndex + 1;
|
||||
}
|
||||
|
||||
/** 提货二维码添加按钮操作 */
|
||||
function handleAddTwodimension() {
|
||||
let obj = {};
|
||||
obj.twodimension1 = "";
|
||||
obj.twodimension2 = "";
|
||||
obj.twodimension3 = "";
|
||||
twodimensionList.value.push(obj);
|
||||
}
|
||||
|
||||
/** 提货二维码删除按钮操作 */
|
||||
function handleDeleteTwodimension() {
|
||||
if (checkedTwodimension.value.length == 0) {
|
||||
proxy.$modal.msgError("请先选择要删除的提货二维码数据");
|
||||
} else {
|
||||
const twodimensions = twodimensionList.value;
|
||||
const checkedTwodimensions = checkedTwodimension.value;
|
||||
twodimensionList.value = twodimensions.filter(function(item) {
|
||||
return checkedTwodimensions.indexOf(item.index) == -1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 复选框选中数据 */
|
||||
function handleTwodimensionSelectionChange(selection) {
|
||||
checkedTwodimension.value = selection.map(item => item.index)
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('system/customer/export', {
|
||||
...queryParams.value
|
||||
}, `customer_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
|
@ -0,0 +1,257 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="客户id" prop="customerid">
|
||||
<el-input
|
||||
v-model="queryParams.customerid"
|
||||
placeholder="请输入客户id"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:twodimension:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:twodimension:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:twodimension:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:twodimension:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="twodimensionList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="二维码id" align="center" prop="id" />
|
||||
<el-table-column label="二维码1" align="center" prop="twodimension1" width="100">
|
||||
<template #default="scope">
|
||||
<image-preview :src="scope.row.twodimension1" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label=" 二维码2" align="center" prop="twodimension2" width="100">
|
||||
<template #default="scope">
|
||||
<image-preview :src="scope.row.twodimension2" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label=" 二维码3" align="center" prop="twodimension3" width="100">
|
||||
<template #default="scope">
|
||||
<image-preview :src="scope.row.twodimension3" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户id" align="center" prop="customerid" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:twodimension:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:twodimension:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改提货二维码对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="twodimensionRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="二维码1" prop="twodimension1">
|
||||
<image-upload v-model="form.twodimension1"/>
|
||||
</el-form-item>
|
||||
<el-form-item label=" 二维码2" prop="twodimension2">
|
||||
<image-upload v-model="form.twodimension2"/>
|
||||
</el-form-item>
|
||||
<el-form-item label=" 二维码3" prop="twodimension3">
|
||||
<image-upload v-model="form.twodimension3"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户id" prop="customerid">
|
||||
<el-input v-model="form.customerid" placeholder="请输入客户id" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Twodimension">
|
||||
import { listTwodimension, getTwodimension, delTwodimension, addTwodimension, updateTwodimension } from "@/api/system/twodimension";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const twodimensionList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
twodimension1: null,
|
||||
twodimension2: null,
|
||||
twodimension3: null,
|
||||
customerid: null
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询提货二维码列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listTwodimension(queryParams.value).then(response => {
|
||||
twodimensionList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
twodimension1: null,
|
||||
twodimension2: null,
|
||||
twodimension3: null,
|
||||
customerid: null
|
||||
};
|
||||
proxy.resetForm("twodimensionRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加提货二维码";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getTwodimension(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改提货二维码";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["twodimensionRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateTwodimension(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addTwodimension(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除提货二维码编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delTwodimension(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('system/twodimension/export', {
|
||||
...queryParams.value
|
||||
}, `twodimension_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
Loading…
Reference in New Issue