|
|
@@ -3,21 +3,42 @@
|
|
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
<div v-show="showSearch" class="mb-[10px]">
|
|
|
<el-card shadow="hover">
|
|
|
- <el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
|
|
+ <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px">
|
|
|
<el-form-item label="供应商编号" prop="supplierNo">
|
|
|
- <el-input v-model="queryParams.supplierNo" placeholder="请输入供应商编号" clearable @keyup.enter="handleQuery" />
|
|
|
+ <el-input v-model="queryParams.supplierNo" placeholder="供应商编号" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="企业名称" prop="enterpriseName">
|
|
|
- <el-input v-model="queryParams.enterpriseName" placeholder="请输入企业名称" clearable @keyup.enter="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="供应商联系人姓名" prop="supplierName">
|
|
|
- <el-input v-model="queryParams.supplierName" placeholder="请输入供应商联系人姓名" clearable @keyup.enter="handleQuery" />
|
|
|
+ <el-form-item label="供应商名称" prop="enterpriseName">
|
|
|
+ <el-input v-model="queryParams.enterpriseName" placeholder="供应商名称" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="供应商类型" prop="supplierType">
|
|
|
<el-select v-model="queryParams.supplierType" placeholder="请选择供应商类型" clearable>
|
|
|
<el-option v-for="item in supplierTypeList" :key="item.typeId" :label="item.typeName" :value="item.typeId" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="供应品牌" prop="operatingBrand">
|
|
|
+ <el-input v-model="queryParams.operatingBrand" placeholder="供应品牌" clearable @keyup.enter="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="供应类别" prop="operatingCategory">
|
|
|
+ <el-select v-model="queryParams.operatingCategory" placeholder="请选择供应类别" clearable>
|
|
|
+ <el-option v-for="item in productCategoryList" :key="item.categoryNo" :label="item.categoryName" :value="item.categoryNo" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="供应区域" prop="province">
|
|
|
+ <el-input v-model="queryParams.province" placeholder="供应区域(省)" clearable @keyup.enter="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="供应区域" prop="city">
|
|
|
+ <el-input v-model="queryParams.city" placeholder="供应区域(市)" clearable @keyup.enter="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="产品经理" prop="productManager">
|
|
|
+ <el-select v-model="queryParams.productManager" placeholder="请选择产品经理" clearable>
|
|
|
+ <el-option v-for="item in comStaffList" :key="item.staffCode" :label="item.staffName" :value="item.staffCode" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="采购人员" prop="buyer">
|
|
|
+ <el-select v-model="queryParams.buyer" placeholder="请选择采购人员" clearable>
|
|
|
+ <el-option v-for="item in comStaffList" :key="item.staffCode" :label="item.staffName" :value="item.staffCode" />
|
|
|
+ </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>
|
|
|
@@ -26,59 +47,81 @@
|
|
|
</el-card>
|
|
|
</div>
|
|
|
</transition>
|
|
|
+
|
|
|
<el-card shadow="never">
|
|
|
<template #header>
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5" >
|
|
|
+ 供应商信息列表
|
|
|
+ </el-col>
|
|
|
+
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:info:remove']">删除</el-button>
|
|
|
+ <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['customer:info:add']">新增供应商</el-button>
|
|
|
</el-col>
|
|
|
- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+
|
|
|
</el-row>
|
|
|
</template>
|
|
|
+
|
|
|
<el-table v-loading="loading" border :data="infoList" @selection-change="handleSelectionChange">
|
|
|
+
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="供应商编号" align="center" prop="supplierNo" />
|
|
|
- <el-table-column label="企业名称" align="center" prop="enterpriseName" />
|
|
|
+ <el-table-column label="供应商名称" align="center" prop="enterpriseName" />
|
|
|
<el-table-column label="供应商类型" align="center" prop="supplierType">
|
|
|
<template #default="scope">
|
|
|
<span>{{ getSupplierTypeName(scope.row.supplierType) }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="供应商联系人姓名" align="center" prop="supplierName" />
|
|
|
- <el-table-column label="供应商联系人电话" align="center" prop="supplierPhone" />
|
|
|
- <el-table-column label="供应状态" align="center" prop="supplyStatus" />
|
|
|
- <el-table-column label="创建时间" align="center" prop="created" width="180">
|
|
|
+
|
|
|
+ <el-table-column label="产品经理" align="center" prop="productManager" />
|
|
|
+ <el-table-column label="采购人员" align="center" prop="buyer" />
|
|
|
+ <el-table-column label="上架产品数" align="center" prop="listedNum" />
|
|
|
+ <el-table-column label="供应品牌" align="center" prop="operatingBrand" />
|
|
|
+ <el-table-column label="供应区域(省)" align="center" prop="province" />
|
|
|
+ <el-table-column label="供应区域(市)" align="center" prop="city" />
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-table-column label="审核状态" align="center" prop="supplyStatus">
|
|
|
<template #default="scope">
|
|
|
- <span>{{ parseTime(scope.row.created, '{y}-{m}-{d}') }}</span>
|
|
|
+ <span>{{ getStatusDisplayName(scope.row.supplyStatus) }}</span>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template #default="scope">
|
|
|
- <el-tooltip content="删除" placement="top">
|
|
|
- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:info:remove']"></el-button>
|
|
|
- </el-tooltip>
|
|
|
+ <el-button link type="primary" @click="handleView(scope.row)" v-hasPermi="['customer:info:query']">查看</el-button>
|
|
|
+ <el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['customer:info:edit']">编辑</el-button>
|
|
|
+ <el-button link type="primary" @click="handleStopCooperation(scope.row)" v-hasPermi="['customer:info:edit']">停止合作</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-card>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup name="None" lang="ts">
|
|
|
-import { listInfo, delInfo } from '@/api/customer/info';
|
|
|
-import { InfoVO, InfoQuery } from '@/api/customer/info/types';
|
|
|
+import { getInfoList, getInfo, delInfo, addInfo, updateInfo, getComSupTyList, getProductCategoryList, getComStaffList } from '@/api/customer/info';
|
|
|
+import { InfoVO, InfoQuery, InfoForm } from '@/api/customer/info/types';
|
|
|
+import { getSupplierStatusOptions, getSupplierStatusDisplayName } from '@/enums/supplierStatus';
|
|
|
+import { getSupplierCooperationStatusDisplayName } from '@/enums/supplierCooperationStatus';
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
|
const infoList = ref<InfoVO[]>([]);
|
|
|
+const buttonLoading = ref(false);
|
|
|
const loading = ref(true);
|
|
|
const showSearch = ref(true);
|
|
|
const ids = ref<Array<string | number>>([]);
|
|
|
+const single = ref(true);
|
|
|
const multiple = ref(true);
|
|
|
const total = ref(0);
|
|
|
-const queryFormRef = ref<ElFormInstance>();
|
|
|
const supplierTypeList = ref<{ typeId: string; typeName: string }[]>([]);
|
|
|
+const productCategoryList = ref<{ categoryNo: string; categoryName: string; id?: number }[]>([]);
|
|
|
+const comStaffList = ref<{ staffCode: string; staffName: string }[]>([]);
|
|
|
+
|
|
|
+const queryFormRef = ref<ElFormInstance>();
|
|
|
|
|
|
const data = reactive<{ queryParams: InfoQuery }>({
|
|
|
queryParams: {
|
|
|
@@ -86,43 +129,63 @@ const data = reactive<{ queryParams: InfoQuery }>({
|
|
|
pageSize: 10,
|
|
|
supplierNo: undefined,
|
|
|
enterpriseName: undefined,
|
|
|
- supplierName: undefined,
|
|
|
- supplyStatus: 2,
|
|
|
+ supplierType: undefined,
|
|
|
+ operatingBrand: undefined,
|
|
|
+ operatingCategory: undefined,
|
|
|
+ province: undefined,
|
|
|
+ city: undefined,
|
|
|
+ productManager: undefined,
|
|
|
+ buyer: undefined,
|
|
|
+ supplyStatus: 2, // 固定为2
|
|
|
params: {}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
const { queryParams } = toRefs(data);
|
|
|
|
|
|
+/** 查询供应商信息列表 */
|
|
|
const getList = async () => {
|
|
|
loading.value = true;
|
|
|
- try {
|
|
|
- const res = await listInfo(queryParams.value);
|
|
|
- infoList.value = res.rows;
|
|
|
- total.value = res.total;
|
|
|
- } catch (e) {
|
|
|
- console.error('获取列表失败', e);
|
|
|
- } finally {
|
|
|
- loading.value = false;
|
|
|
- }
|
|
|
+ // 确保 supplyStatus 始终为 2
|
|
|
+ queryParams.value.supplyStatus = 2;
|
|
|
+ const res = await getInfoList(queryParams.value);
|
|
|
+ infoList.value = res.rows;
|
|
|
+ total.value = res.total;
|
|
|
+ loading.value = false;
|
|
|
}
|
|
|
|
|
|
+/** 搜索按钮操作 */
|
|
|
const handleQuery = () => {
|
|
|
queryParams.value.pageNum = 1;
|
|
|
getList();
|
|
|
}
|
|
|
|
|
|
+/** 重置按钮操作 */
|
|
|
const resetQuery = () => {
|
|
|
queryFormRef.value?.resetFields();
|
|
|
+ // 重置后仍然保持 supplyStatus = 2
|
|
|
queryParams.value.supplyStatus = 2;
|
|
|
handleQuery();
|
|
|
}
|
|
|
|
|
|
+/** 多选框选中数据 */
|
|
|
const handleSelectionChange = (selection: InfoVO[]) => {
|
|
|
ids.value = selection.map(item => item.id);
|
|
|
+ single.value = selection.length != 1;
|
|
|
multiple.value = !selection.length;
|
|
|
}
|
|
|
|
|
|
+/** 新增按钮操作 */
|
|
|
+const handleAdd = () => {
|
|
|
+ // 新增逻辑
|
|
|
+}
|
|
|
+
|
|
|
+/** 修改按钮操作 */
|
|
|
+const handleUpdate = async (row?: InfoVO) => {
|
|
|
+ // 修改逻辑
|
|
|
+}
|
|
|
+
|
|
|
+/** 删除按钮操作 */
|
|
|
const handleDelete = async (row?: InfoVO) => {
|
|
|
const _ids = row?.id || ids.value;
|
|
|
await proxy?.$modal.confirm('是否确认删除供应商信息编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
|
|
@@ -131,7 +194,45 @@ const handleDelete = async (row?: InfoVO) => {
|
|
|
await getList();
|
|
|
}
|
|
|
|
|
|
+/** 查看按钮操作 */
|
|
|
+const handleView = (row: InfoVO) => {
|
|
|
+ const router = proxy?.$router;
|
|
|
+ router?.push({
|
|
|
+ path: '/customer/info/detail',
|
|
|
+ query: {
|
|
|
+ id: row.id
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/** 停止合作按钮操作 */
|
|
|
+const handleStopCooperation = async (row: InfoVO) => {
|
|
|
+ await proxy?.$modal.confirm('是否确认停止与供应商"' + row.enterpriseName + '"的合作?');
|
|
|
+ const updateData = { ...row, cooperative: 0 };
|
|
|
+ await updateInfo(updateData);
|
|
|
+ proxy?.$modal.msgSuccess("操作成功");
|
|
|
+ await getList();
|
|
|
+}
|
|
|
+
|
|
|
+/** 获取供应商类型列表 */
|
|
|
+const getSupplierTypeList = async () => {
|
|
|
+ try {
|
|
|
+ const res = await getComSupTyList();
|
|
|
+ supplierTypeList.value = res.data || res;
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取供应商类型失败', e);
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
+/** 获取产品分类列表 */
|
|
|
+const getProductCategoryData = async () => {
|
|
|
+ try {
|
|
|
+ const res = await getProductCategoryList();
|
|
|
+ productCategoryList.value = res.data;
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取产品分类失败', e);
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
/** 根据typeId获取typeName */
|
|
|
const getSupplierTypeName = (typeId: string) => {
|
|
|
@@ -139,7 +240,55 @@ const getSupplierTypeName = (typeId: string) => {
|
|
|
return item ? item.typeName : typeId;
|
|
|
}
|
|
|
|
|
|
-onMounted(() => {
|
|
|
+/** 根据状态码获取状态显示名称 */
|
|
|
+const getStatusDisplayName = (statusCode: number) => {
|
|
|
+ return getSupplierStatusDisplayName(statusCode);
|
|
|
+}
|
|
|
+
|
|
|
+/** 根据合作状态码获取合作状态显示名称 */
|
|
|
+const getCooperationStatusDisplayName = (statusCode: number) => {
|
|
|
+ return getSupplierCooperationStatusDisplayName(statusCode);
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
+ getSupplierTypeList();
|
|
|
+ getProductCategoryData();
|
|
|
+
|
|
|
+ try {
|
|
|
+ const staffRes = await getComStaffList({ pageNum: 1, pageSize: 100000 });
|
|
|
+ comStaffList.value = staffRes.rows || [];
|
|
|
+ } catch (e) {
|
|
|
+ console.error('人员接口调用失败:', e);
|
|
|
+ }
|
|
|
+
|
|
|
getList();
|
|
|
});
|
|
|
</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+:deep(.el-form-item__label) {
|
|
|
+ text-align: left !important;
|
|
|
+ font-size: 16px;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-form-item) {
|
|
|
+ margin-right: 30px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-input__wrapper) {
|
|
|
+ font-size: 15px;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-input__inner) {
|
|
|
+ font-size: 15px;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-select) {
|
|
|
+ font-size: 15px;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-select .el-input__inner) {
|
|
|
+ font-size: 15px;
|
|
|
+}
|
|
|
+</style>
|