1、添加业务功能;2、更新element-plus
parent
71b45504bd
commit
90ef7b5ac9
@ -0,0 +1,44 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询客户信息列表
|
||||
export function listCustomer(query) {
|
||||
return request({
|
||||
url: "/business/customer/list",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询客户信息详细
|
||||
export function getCustomer(id) {
|
||||
return request({
|
||||
url: "/business/customer/" + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 新增客户信息
|
||||
export function addCustomer(data) {
|
||||
return request({
|
||||
url: "/business/customer",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改客户信息
|
||||
export function updateCustomer(data) {
|
||||
return request({
|
||||
url: "/business/customer",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除客户信息
|
||||
export function delCustomer(id) {
|
||||
return request({
|
||||
url: "/business/customer/" + id,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询客户人员信息列表
|
||||
export function listCustomerStaff(query) {
|
||||
return request({
|
||||
url: "/business/customerStaff/list",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询客户人员信息详细
|
||||
export function getCustomerStaff(id) {
|
||||
return request({
|
||||
url: "/business/customerStaff/" + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 新增客户人员信息
|
||||
export function addCustomerStaff(data) {
|
||||
return request({
|
||||
url: "/business/customerStaff",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改客户人员信息
|
||||
export function updateCustomerStaff(data) {
|
||||
return request({
|
||||
url: "/business/customerStaff",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除客户人员信息
|
||||
export function delCustomerStaff(id) {
|
||||
return request({
|
||||
url: "/business/customerStaff/" + id,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询产品品类列表
|
||||
export function listProductsCategory(query) {
|
||||
return request({
|
||||
url: "/business/productsCategory/list",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询产品品类详细
|
||||
export function getProductsCategory(id) {
|
||||
return request({
|
||||
url: "/business/productsCategory/" + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 新增产品品类
|
||||
export function addProductsCategory(data) {
|
||||
return request({
|
||||
url: "/business/productsCategory",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改产品品类
|
||||
export function updateProductsCategory(data) {
|
||||
return request({
|
||||
url: "/business/productsCategory",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除产品品类
|
||||
export function delProductsCategory(id) {
|
||||
return request({
|
||||
url: "/business/productsCategory/" + id,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询产品归档列表
|
||||
export function listProductsRecord(query) {
|
||||
return request({
|
||||
url: "/business/products/list",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询产品归档详细
|
||||
export function getProductsRecord(id) {
|
||||
return request({
|
||||
url: "/business/products/" + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 新增产品归档
|
||||
export function addProductsRecord(data) {
|
||||
return request({
|
||||
url: "/business/products",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改产品归档
|
||||
export function updateProductsRecord(data) {
|
||||
return request({
|
||||
url: "/business/products",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除产品归档
|
||||
export function delProductsRecord(id) {
|
||||
return request({
|
||||
url: "/business/products/" + id,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询产品类型列表
|
||||
export function listProductsType(query) {
|
||||
return request({
|
||||
url: "/business/productsType/list",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询产品类型详细
|
||||
export function getProductsType(id) {
|
||||
return request({
|
||||
url: "/business/productsType/" + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 新增产品类型
|
||||
export function addProductsType(data) {
|
||||
return request({
|
||||
url: "/business/productsType",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改产品类型
|
||||
export function updateProductsType(data) {
|
||||
return request({
|
||||
url: "/business/productsType",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除产品类型
|
||||
export function delProductsType(id) {
|
||||
return request({
|
||||
url: "/business/productsType/" + id,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询供应商档案信息列表
|
||||
export function listSupplierRecord(query) {
|
||||
return request({
|
||||
url: "/business/supplier/list",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询供应商档案信息详细
|
||||
export function getSupplierRecord(id) {
|
||||
return request({
|
||||
url: "/business/supplier/" + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 新增供应商档案信息
|
||||
export function addSupplierRecord(data) {
|
||||
return request({
|
||||
url: "/business/supplier",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改供应商档案信息
|
||||
export function updateSupplierRecord(data) {
|
||||
return request({
|
||||
url: "/business/supplier",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除供应商档案信息
|
||||
export function delSupplierRecord(id) {
|
||||
return request({
|
||||
url: "/business/supplier/" + id,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
import { reactive, ref } from "vue";
|
||||
|
||||
function useRemote() {
|
||||
const loading = ref(false);
|
||||
|
||||
async function remoteMethod(query, callback) {
|
||||
if (!query) return;
|
||||
|
||||
loading.value = true;
|
||||
await callback(query);
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
return { loading, remoteMethod };
|
||||
}
|
||||
|
||||
export default useRemote;
|
@ -0,0 +1,307 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="客户名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入客户名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属类别">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择" style="width: 200px;">
|
||||
<el-option
|
||||
v-for="item in customer_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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="['business:customer:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['business:customer:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['business:customer:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['business:customer:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="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="客户编码" align="center" prop="code" />
|
||||
<el-table-column label="客户名称" align="center" prop="name" />
|
||||
<el-table-column label="所属类别" align="center" prop="type" />
|
||||
<el-table-column label="业务状态" align="center" prop="businessStatus" />
|
||||
<el-table-column label="联系人姓名" align="center" prop="contactsName" />
|
||||
<el-table-column label="联系人电话" align="center" prop="contactsPhone" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
size="mini"
|
||||
icon="edit"
|
||||
type="primary"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['business:customer:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
link
|
||||
size="mini"
|
||||
icon="delete"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:customer:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改客户信息对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="90px">
|
||||
<el-form-item label="客户编码" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入客户编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="code">
|
||||
<el-input v-model="form.name" placeholder="请输入客户名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属类别" prop="code">
|
||||
<el-select v-model="form.type" placeholder="请选择所属类别">
|
||||
<el-option
|
||||
v-for="item in customer_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务状态" prop="businessStatus">
|
||||
<el-select v-model="form.businessStatus" placeholder="请选择业务状态">
|
||||
<el-option
|
||||
v-for="item in customer_business_status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人姓名" prop="contactsName">
|
||||
<el-input v-model="form.contactsName" placeholder="请输入联系人姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人电话" prop="contactsPhone">
|
||||
<el-input v-model="form.contactsPhone" placeholder="请输入联系人电话" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer } from "@/api/customer/info";
|
||||
import useForm from '@/hooks/useForm.js';
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
code: null,
|
||||
name: null,
|
||||
contactsName: null,
|
||||
contactsPhone: null,
|
||||
type: null,
|
||||
businessStatus: null,
|
||||
}
|
||||
|
||||
const defaultParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
contactsName: null,
|
||||
type: null
|
||||
}
|
||||
|
||||
const formRef = ref(null);
|
||||
const queryRef = ref(null);
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const data = reactive({
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 分类表格数据
|
||||
customerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
})
|
||||
|
||||
const { loading, ids, single, multiple, showSearch, total, customerList, title, open, rules, typeOptions } = toRefs(data);
|
||||
|
||||
const { form, validateForm, resetForm } = useForm(formRef, defaultForm)
|
||||
const { form: queryParams, resetForm: resetQueryForm } = useForm(queryRef, defaultParams)
|
||||
|
||||
|
||||
const { customer_business_status, customer_type } = proxy.useDict('customer_business_status', 'customer_type');
|
||||
getList();
|
||||
|
||||
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() {
|
||||
resetForm();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
resetQueryForm();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids = selection.map(item => item.id)
|
||||
single = 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;
|
||||
open.value = true;
|
||||
title.value = "修改客户信息";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
validateForm.then(() => {
|
||||
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 handleExport() {
|
||||
proxy.download('business/customer/export', {
|
||||
...queryParams.value
|
||||
}, `customer_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
@ -0,0 +1,311 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="所属客户" prop="customerId">
|
||||
<el-input
|
||||
v-model="queryParams.customerId"
|
||||
placeholder="请输入所属客户"
|
||||
clearable
|
||||
@keyup.enter.native="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="['business:customer-staff:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['business:customer-staff:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['business:customer-staff:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['business:customer-staff:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="memberList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="所属客户" align="center" prop="customerId" />
|
||||
<el-table-column label="员工姓名" align="center" prop="name" />
|
||||
<el-table-column label="性别" align="center" prop="sex" />
|
||||
<el-table-column label="员工职位" align="center" prop="post" />
|
||||
<el-table-column label="员工电话" align="center" prop="phone" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['business:customer-staff:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:customer-staff:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改客户人员信息对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="所属客户" prop="customerId">
|
||||
<el-select
|
||||
v-model="form.customerId"
|
||||
filterable
|
||||
remote
|
||||
placeholder="请输入关键词搜索"
|
||||
remote-show-suffix
|
||||
:remote-method="($event) => remoteMethod($event, remoteCustomer)"
|
||||
:loading="remoteLoading"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in customerList"
|
||||
:key="item.id"
|
||||
:label="item.contactsName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="员工姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入员工姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="员工性别" prop="sex">
|
||||
<el-select v-model="form.type" placeholder="请选择性别">
|
||||
<el-option
|
||||
v-for="item in customer_sex"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="员工职位" prop="post">
|
||||
<el-input v-model="form.name" placeholder="请输入员工职位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="员工电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入员工电话" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { listCustomerStaff, getCustomerStaff, delCustomerStaff, addCustomerStaff, updateCustomerStaff } from "@/api/customer/member";
|
||||
import { listCustomer } from "@/api/customer/info";
|
||||
import useForm from '@/hooks/useForm.js';
|
||||
import useRemote from '@/hooks/useRemote.js';
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
code: null,
|
||||
name: null,
|
||||
contactsName: null,
|
||||
contactsPhone: null,
|
||||
type: null,
|
||||
businessStatus: null,
|
||||
}
|
||||
|
||||
const defaultParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
contactsName: null,
|
||||
type: null
|
||||
}
|
||||
|
||||
const formRef = ref(null);
|
||||
const queryRef = ref(null);
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const data = reactive({
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 分类表格数据
|
||||
memberList: [],
|
||||
customerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
})
|
||||
|
||||
const { loading, ids, single, multiple, showSearch, total, memberList, title, open, rules, customerList } = toRefs(data);
|
||||
|
||||
const { form, validateForm, resetForm } = useForm(formRef, defaultForm)
|
||||
const { form: queryParams, resetForm: resetQueryForm } = useForm(queryRef, defaultParams)
|
||||
|
||||
const { customer_sex } = proxy.useDict('customer_sex')
|
||||
getList();
|
||||
|
||||
const { loading: remoteLoading, remoteMethod } = useRemote();
|
||||
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listCustomerStaff(queryParams.value).then(response => {
|
||||
memberList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function remoteCustomer (query) {
|
||||
const params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
contactsName: query
|
||||
}
|
||||
return listCustomer(params).then(resp => {
|
||||
return customerList.value = resp.rows;
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
resetForm();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
resetQueryForm();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids = selection.map(item => item.id)
|
||||
single = 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
|
||||
getCustomerStaff(id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改人员信息";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
validateForm.then(() => {
|
||||
if (form.value.id != null) {
|
||||
updateCustomerStaff(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addCustomerStaff(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 delCustomerStaff(ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('business/customer-staff/export', {
|
||||
...queryParams.value
|
||||
}, `customer_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
</script>
|
@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="分类名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入分类名称"
|
||||
clearable
|
||||
@keyup.enter.native="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="['business:products-category:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['business:products-category:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['business:products-category:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['business:products-category:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="categoryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="分类名称" align="center" prop="name" />
|
||||
<el-table-column label="分类编码" align="center" prop="code" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<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="['business:products-category:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:products-category:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改产品品类对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="分类名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入分类名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分类编码" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入分类编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { listProductsCategory, getProductsCategory, delProductsCategory, addProductsCategory, updateProductsCategory } from "@/api/product/productsCategory";
|
||||
|
||||
import useForm from '@/hooks/useForm.js';
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
name: null,
|
||||
code: null,
|
||||
remark: null
|
||||
}
|
||||
|
||||
const defaultParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
code: null
|
||||
}
|
||||
|
||||
const formRef = ref(null);
|
||||
const queryRef = ref(null);
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const data = reactive({
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 分类表格数据
|
||||
categoryList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
})
|
||||
|
||||
const { loading, ids, single, multiple, showSearch, total, categoryList, title, open, rules } = toRefs(data);
|
||||
|
||||
const { form, validateForm, resetForm } = useForm(formRef, defaultForm)
|
||||
const { form: queryParams, resetForm: resetQueryForm } = useForm(queryRef, defaultParams)
|
||||
|
||||
getList();
|
||||
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listProductsCategory(queryParams.value).then(response => {
|
||||
categoryList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
resetForm();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
resetQueryForm();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids = selection.map(item => item.id)
|
||||
single = 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
|
||||
getProductsCategory(id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改品类";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
validateForm.then(() => {
|
||||
if (form.value.id != null) {
|
||||
updateProductsCategory(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addProductsCategory(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 delProductsCategory(ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('business/products-category/export', {
|
||||
...queryParams.value
|
||||
}, `products-category_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
</script>
|
@ -0,0 +1,294 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="产品名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入产品名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品别名" prop="alias">
|
||||
<el-input
|
||||
v-model="queryParams.alias"
|
||||
placeholder="请输入产品别名"
|
||||
clearable
|
||||
@keyup.enter.native="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="['business:products:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['business:products:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['business:products:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['business:products:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="产品名称" align="center" prop="name" />
|
||||
<el-table-column label="产品别名" align="center" prop="alias" />
|
||||
<el-table-column label="产品编码" align="center" prop="code" />
|
||||
<el-table-column label="规格" align="center" prop="specs" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="标签" align="center" prop="label" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<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="['business:products:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:products:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改产品归档对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="产品名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品别名" prop="alias">
|
||||
<el-input v-model="form.alias" placeholder="请输入产品别名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编码" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入产品编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="specs">
|
||||
<el-input v-model="form.specs" placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标签" prop="label">
|
||||
<el-input v-model="form.label" placeholder="请输入标签" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { listProductsRecord, getProductsRecord, delProductsRecord, addProductsRecord, updateProductsRecord } from "@/api/product/productsRecord";
|
||||
|
||||
import useForm from '@/hooks/useForm.js';
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
name: null,
|
||||
alias: null,
|
||||
code: null,
|
||||
specs: null,
|
||||
unit: null,
|
||||
label: null,
|
||||
remark: null
|
||||
}
|
||||
|
||||
const defaultParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
alias: null,
|
||||
code: null,
|
||||
specs: null,
|
||||
unit: null,
|
||||
label: null,
|
||||
}
|
||||
|
||||
const formRef = ref(null);
|
||||
const queryRef = ref(null);
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const data = reactive({
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 分类表格数据
|
||||
recordList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
})
|
||||
|
||||
const { loading, ids, single, multiple, showSearch, total, recordList, title, open, rules } = toRefs(data);
|
||||
|
||||
const { form, validateForm, resetForm } = useForm(formRef, defaultForm)
|
||||
const { form: queryParams, resetForm: resetQueryForm } = useForm(queryRef, defaultParams)
|
||||
|
||||
getList();
|
||||
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listProductsRecord(queryParams.value).then(response => {
|
||||
recordList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
resetForm();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
resetQueryForm();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids = selection.map(item => item.id)
|
||||
single = 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
|
||||
getProductsRecord(id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改档案";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
validateForm.then(() => {
|
||||
if (form.value.id != null) {
|
||||
updateProductsRecord(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addProductsRecord(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 delProductsRecord(ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('business/products/export', {
|
||||
...queryParams.value
|
||||
}, `products-record_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
</script>
|
@ -0,0 +1,278 @@
|
||||
<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="deptId">
|
||||
<el-input
|
||||
v-model="queryParams.deptId"
|
||||
placeholder="请输入部门ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入分类名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类编码" prop="code">
|
||||
<el-input
|
||||
v-model="queryParams.code"
|
||||
placeholder="请输入分类编码"
|
||||
clearable
|
||||
@keyup.enter.native="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="['business:products-type:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['business:products-type:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['business:products-type:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['business:products-type:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="分类名称" align="center" prop="name" />
|
||||
<el-table-column label="分类编码" align="center" prop="code" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['business:products-type:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:products-type:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改产品类型对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="分类名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入分类名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分类编码" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入分类编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { listProductsType, getProductsType, delProductsType, addProductsType, updateProductsType } from "@/api/product/productsType";
|
||||
|
||||
import useForm from '@/hooks/useForm.js';
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
name: null,
|
||||
code: null,
|
||||
remark: null
|
||||
}
|
||||
|
||||
const defaultParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
code: null
|
||||
}
|
||||
|
||||
const formRef = ref(null);
|
||||
const queryRef = ref(null);
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const data = reactive({
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 分类表格数据
|
||||
typeList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
})
|
||||
|
||||
const { loading, ids, single, multiple, showSearch, total, typeList, title, open, rules } = toRefs(data);
|
||||
|
||||
const { form, validateForm, resetForm } = useForm(formRef, defaultForm)
|
||||
const { form: queryParams, resetForm: resetQueryForm } = useForm(queryRef, defaultParams)
|
||||
|
||||
getList();
|
||||
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listProductsType(queryParams.value).then(response => {
|
||||
typeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
resetForm();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
resetQueryForm();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids = selection.map(item => item.id)
|
||||
single = 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
|
||||
getProductsType(id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改类型";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
validateForm.then(() => {
|
||||
if (form.value.id != null) {
|
||||
updateProductsType(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addProductsType(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 delProductsType(ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('system/products-type/export', {
|
||||
...queryParams.value
|
||||
}, `products-type_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
</script>
|
@ -0,0 +1,479 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="110px">
|
||||
<el-form-item label="供应商名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入供应商名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商法人类型" prop="corporationType">
|
||||
<el-select
|
||||
v-model="queryParams.corporationType"
|
||||
placeholder="请选择类型"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
style="width: 200px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in supplier_corporation_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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="['business:supplier:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['business:supplier:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['business:supplier:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['business:supplier:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="供应商名称" align="center" prop="name" />
|
||||
<el-table-column label="供应商评分" align="center" prop="score" />
|
||||
<el-table-column label="供应商规模" align="center" prop="scale" />
|
||||
<el-table-column label="供应商经营开始时间" align="center" prop="startTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商法人类型" align="center" prop="corporationType" />
|
||||
<el-table-column label="供应商股票名称" align="center" prop="stockName" />
|
||||
<el-table-column label="是否小微企业" align="center" prop="smallVendors" />
|
||||
<el-table-column label="供应商注册号" align="center" prop="registNo" />
|
||||
<el-table-column label="供应商注册资本" align="center" prop="registCapital" />
|
||||
<el-table-column label="供应商登记机关" align="center" prop="registAuthority" />
|
||||
<el-table-column label="营业执照" align="center" prop="businessLicense" />
|
||||
<el-table-column label="营业地址" align="center" prop="businessAddress" />
|
||||
<el-table-column label="供应商注册行业" align="center" prop="registSector" />
|
||||
<el-table-column label="供应商核准时间" align="center" prop="approvalTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.approvalTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="中标信息" align="center" prop="winBidInfo" />
|
||||
<el-table-column label="合同信息" align="center" prop="contractInfo" />
|
||||
<el-table-column label="合同有效期" align="center" prop="expirationTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.expirationTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="['business:supplier:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:supplier:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改供应商档案信息对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="1000px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="160px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入供应商名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商评分" prop="score">
|
||||
<el-input v-model="form.score" placeholder="请输入供应商评分" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商规模" prop="scale">
|
||||
<el-select
|
||||
v-model="form.scale"
|
||||
placeholder="请选择规模"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in supplier_scale"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商经营开始时间" prop="startTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.startTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择供应商经营开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商股票名称" prop="stockName">
|
||||
<el-input v-model="form.stockName" placeholder="请输入供应商股票名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商法人类型" prop="corporationType">
|
||||
<el-select
|
||||
v-model="form.corporationType"
|
||||
placeholder="请选择类型"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in supplier_corporation_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否小商企业" prop="smallVendors">
|
||||
<el-select
|
||||
v-model="form.smallVendors"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in [{ value: 0, label: '否' }, { value: 1, label: '是' }]"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商注册号" prop="registNo">
|
||||
<el-input v-model="form.registNo" placeholder="请输入供应商注册号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="股票曾用名" prop="stockNameUsed">
|
||||
<el-input v-model="form.stockNameUsed" placeholder="请输入供应商股票曾用名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商注册资本" prop="registCapital">
|
||||
<el-input v-model="form.registCapital" placeholder="请输入供应商注册资本" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商登记机关" prop="registAuthority">
|
||||
<el-input v-model="form.registAuthority" placeholder="请输入供应商登记机关" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商注册行业" prop="registSector">
|
||||
<el-input v-model="form.registSector" placeholder="请输入供应商注册行业" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商核准时间" prop="approvalTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.approvalTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择供应商核准时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="中标信息" prop="winBidInfo">
|
||||
<el-input v-model="form.winBidInfo" placeholder="请输入中标信息" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同信息" prop="contractInfo">
|
||||
<el-input v-model="form.contractInfo" placeholder="请输入合同信息" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同有效期" prop="expirationTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.expirationTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择合同有效期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="营业执照" prop="businessLicense">
|
||||
<el-input v-model="form.businessLicense" placeholder="请输入营业执照" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="营业地址" prop="businessAddress">
|
||||
<el-input v-model="form.businessAddress" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="附件是否上传" prop="attachment">
|
||||
<el-select
|
||||
v-model="form.attachment"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in [{ value: 0, label: '否' }, { value: 1, label: '是' }]"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.attachment">
|
||||
<el-form-item label="执照相片" prop="licenseImg">
|
||||
<image-upload
|
||||
:limit="1"
|
||||
>
|
||||
</image-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { listSupplierRecord, getSupplierRecord, delSupplierRecord, addSupplierRecord, updateSupplierRecord } from "@/api/supplier/record";
|
||||
import ImageUpload from "@/components/ImageUpload";
|
||||
|
||||
import useForm from '@/hooks/useForm.js';
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
name: null,
|
||||
score: null,
|
||||
scale: null,
|
||||
stockName: null,
|
||||
stockNameUsed: null,
|
||||
startTime: null,
|
||||
corporationType: null,
|
||||
smallVendors: null,
|
||||
registNo: null,
|
||||
registCapital: null,
|
||||
registAuthority: null,
|
||||
registSector: null,
|
||||
approvalTime: null,
|
||||
winBidInfo: null,
|
||||
contractInfo: null,
|
||||
expirationTime: null,
|
||||
businessLicense: null,
|
||||
businessAddress: null,
|
||||
attachment: 0,
|
||||
licenseImg: null,
|
||||
}
|
||||
|
||||
const defaultParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
corporationType: null
|
||||
}
|
||||
|
||||
const formRef = ref(null);
|
||||
const queryRef = ref(null);
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const data = reactive({
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 分类表格数据
|
||||
recordList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
})
|
||||
|
||||
const { loading, ids, single, multiple, showSearch, total, recordList, title, open, rules } = toRefs(data);
|
||||
|
||||
const { form, validateForm, resetForm } = useForm(formRef, defaultForm)
|
||||
const { form: queryParams, resetForm: resetQueryForm } = useForm(queryRef, defaultParams)
|
||||
|
||||
const { supplier_scale, supplier_corporation_type } = proxy.useDict('supplier_scale', 'supplier_corporation_type')
|
||||
|
||||
getList();
|
||||
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listSupplierRecord(queryParams.value).then(response => {
|
||||
recordList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
resetForm();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
resetQueryForm();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids = selection.map(item => item.id)
|
||||
single = 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
|
||||
getSupplierRecord(id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改档案";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
validateForm.then(() => {
|
||||
if (form.value.id != null) {
|
||||
updateSupplierRecord(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addSupplierRecord(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 delSupplierRecord(ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('business/supplier/export', {
|
||||
...queryParams.value
|
||||
}, `supplier-record_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
</script>
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue