init(projects): 供应商模块更改,logo更改

master
xushilin 12 months ago
parent 6f85f6bcd6
commit 56b17e1451

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 81 KiB

@ -6,7 +6,7 @@
<icon-local-ak-logo v-else /> --> <icon-local-ak-logo v-else /> -->
<!-- 加载图标 --> <!-- 加载图标 -->
<div> <div>
<img src="../../assets/img/sys.png" alt="" style="width: 64px; height: 34px" /> <img src="../../assets/img/sys.png" alt="" style="max-width: 200px" />
</div> </div>
</template> </template>

@ -1,15 +1,15 @@
<template> <template>
<router-link :to="routeHomePath" class="flex-center w-full nowrap-hidden"> <router-link :to="routeHomePath" class="flex-center w-full nowrap-hidden">
<system-logo class="text-60px text-primary" /> <system-logo class="text-60px text-primary" />
<h2 v-show="showTitle" class="pl-8px text-16px font-bold text-primary transition duration-300 ease-in-out"> <!-- <h2 v-show="showTitle" class="pl-8px text-16px font-bold text-primary transition duration-300 ease-in-out">
{{ $t('system.title') }} {{ $t('system.title') }}
</h2> </h2> -->
</router-link> </router-link>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { routePath } from '@/router'; import { routePath } from '@/router';
import { $t } from '@/locales'; // import { $t } from '@/locales';
defineOptions({ name: 'GlobalLogo' }); defineOptions({ name: 'GlobalLogo' });

@ -0,0 +1,21 @@
import { request } from '~/src/service/request';
// 获取供应商注册列表
export function getAllSupplier(params: any) {
return request.get('/md/mes/md/mdVendor/list', { params });
}
// 新增供应商注册
export function addSupplier(data: any) {
return request.post('/md/mes/md/mdVendor', data);
}
// 修改供应商注册
export function updateSupplier(data: any) {
return request.put('/md/mes/md/mdVendor', data);
}
// 删除供应商注册
export function deleteSupplier(id: number | string) {
return request.delete(`/md/mes/md/mdVendor/${id}`);
}

@ -48,3 +48,18 @@ declare namespace contactPerson {
dutyBy: string; dutyBy: string;
} }
} }
declare namespace scm {
namespace register {
interface TableList {
id: number;
vendorName: string;
vendorNick: string;
bank: string;
address: string;
product: string;
totalTax: string;
taxRate: string;
}
}
}

@ -1,7 +1,7 @@
<template> <template>
<div id="screen-wrapper" class="screen-wrapper"> <div id="screen-wrapper" class="screen-wrapper">
<div id="screen" class="screen"> <div id="screen" class="screen">
<div class="title">新东眼镜智慧工厂</div> <div class="title">领秀镜智慧工厂</div>
<!-- // --> <!-- // -->
<div class="left_area left_top_area"> <div class="left_area left_top_area">
<div class="left_top_div"> <div class="left_top_div">

@ -3,10 +3,10 @@
<my-card title="搜索"> <my-card title="搜索">
<n-form inline> <n-form inline>
<n-form-item label="供应商全称"> <n-form-item label="供应商全称">
<n-input v-model:value="searchForm.supplierName" placeholder="请输入供应商全称" /> <n-input v-model:value="searchForm.vendorName" placeholder="请输入供应商全称" />
</n-form-item> </n-form-item>
<n-form-item label="名称"> <n-form-item label="名称">
<n-input v-model:value="searchForm.name" placeholder="请输入名称" /> <n-input v-model:value="searchForm.vendorNick" placeholder="请输入名称" />
</n-form-item> </n-form-item>
<n-form-item> <n-form-item>
<n-button type="primary" class="mr-10px" @click="handleSearch"> <n-button type="primary" class="mr-10px" @click="handleSearch">
@ -37,6 +37,7 @@
:columns="columns" :columns="columns"
:scroll-x="dataTableConfig.scrollWidth(columns)" :scroll-x="dataTableConfig.scrollWidth(columns)"
></n-data-table> ></n-data-table>
<my-pagination v-model:search-form="searchForm" @init="init"></my-pagination>
</my-card> </my-card>
<my-dialog <my-dialog
@ -57,11 +58,11 @@
label-width="120px" label-width="120px"
> >
<n-grid :cols="2" :x-gap="20"> <n-grid :cols="2" :x-gap="20">
<n-form-item-grid-item label="供应商全称" path="supplierName"> <n-form-item-grid-item label="供应商全称" path="vendorName">
<n-input v-model:value="addOrEditForm.supplierName" placeholder="请输入供应商全称" /> <n-input v-model:value="addOrEditForm.vendorName" placeholder="请输入供应商全称" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item label="名称" path="name"> <n-form-item-grid-item label="名称" path="vendorNick">
<n-input v-model:value="addOrEditForm.name" placeholder="请输入名称" /> <n-input v-model:value="addOrEditForm.vendorNick" placeholder="请输入名称" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item label="开户行" path="bank"> <n-form-item-grid-item label="开户行" path="bank">
<n-input v-model:value="addOrEditForm.bank" placeholder="请输入开户行" /> <n-input v-model:value="addOrEditForm.bank" placeholder="请输入开户行" />
@ -90,108 +91,25 @@
import type { Ref } from 'vue'; import type { Ref } from 'vue';
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import type { FormInst, DataTableColumns } from 'naive-ui'; import type { FormInst, DataTableColumns } from 'naive-ui';
// import { useDialog } from 'naive-ui'; import { useDialog } from 'naive-ui';
import { createRequiredFormRule } from '@/utils'; import { createRequiredFormRule } from '@/utils';
import { dataTableConfig } from '@/config/dataTableConfig'; import { dataTableConfig } from '@/config/dataTableConfig';
import { useResetSearch } from '~/src/utils/common/searchReset'; import { useResetSearch } from '~/src/utils/common/searchReset';
import { useLoading } from '~/src/hooks/index'; import { useLoading } from '~/src/hooks/index';
import { getAllSupplier, addSupplier, updateSupplier, deleteSupplier } from '~/src/service/api/scm/register/index';
const linkmanList = ref<Array<any>>([
{
id: 1,
supplierName: '江西中爱',
name: '江西中爱',
address: '江西省鹰潭市余江区',
bank: '中国银行',
product: '五金配件',
totalTax: '增值税',
taxRate: '13%'
},
{
id: 2,
supplierName: '金亮',
name: '金亮',
address: '安徽省淮南市寿县大顺镇工业集中区',
bank: '中国建设银行',
product: '汇川变频器',
totalTax: '印花税,增值税',
taxRate: '13%'
},
{
id: 3,
supplierName: '金余',
name: '金余',
address: '江西省鹰潭市',
bank: '中国银行',
product: '拉丝模具、镀锡模、绞线模',
totalTax: '印花税,土地使用税,车船使用税',
taxRate: '13%'
},
{
id: 4,
supplierName: '集美',
name: '集美',
address: '上海市',
bank: '浦发银行',
product: '单孔模具、I型模具维修',
totalTax: '增值税,土地使用税',
taxRate: '13%'
},
{
id: 5,
supplierName: '温州启诚',
name: '温州启诚',
address: '浙江省温州市',
bank: '中国工商银行',
product: '5寸、8寸、9寸线轴',
totalTax: '印花税,土地使用税',
taxRate: '13%'
},
{
id: 6,
supplierName: '华意',
name: '华意',
address: '浙江省杭州市',
bank: '中国银行',
product: '拉丝模具租赁、钻石镀锡模',
totalTax: '印花税,土地使用税,车船使用税',
taxRate: '13%'
},
{
id: 7,
supplierName: '中奥',
name: '中奥',
address: '浙江省杭州市',
bank: '‌中国建设银行',
product: '5寸、8寸、9寸线轴',
totalTax: '增值税普通发票',
taxRate: '9%'
},
{
id: 8,
supplierName: '玉环凯达',
name: '玉环凯达',
address: '浙江省玉环市',
bank: '‌中国建设银行',
product: '5寸、8寸、9寸线轴',
totalTax: '400#线盘',
taxRate: '13%'
}
]);
const { searchForm, reset } = useResetSearch({ const { searchForm, reset } = useResetSearch({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
supplierName: '', vendorName: '',
name: '' vendorNick: ''
}); });
const addOrEditForm = ref({ const addOrEditForm = ref({
id: null, id: null,
supplierName: '', vendorName: '',
name: '', vendorNick: '',
address: '', address: '',
bank: '', bank: '',
product: '', product: '',
@ -200,8 +118,8 @@ const addOrEditForm = ref({
}); });
const rules = { const rules = {
supplierName: createRequiredFormRule('请输入供应商全称'), vendorName: createRequiredFormRule('请输入供应商全称'),
name: createRequiredFormRule('请输入名称') vendorNick: createRequiredFormRule('请输入名称')
}; };
const formModel = ref<FormInst | null>(null); const formModel = ref<FormInst | null>(null);
@ -210,11 +128,13 @@ const addOrEditType = ref<number>(0); // 0 : 添加, 1 : 编辑
const show = ref<boolean>(false); const show = ref<boolean>(false);
const dialog = useDialog();
const { loading, startLoading, endLoading } = useLoading(); const { loading, startLoading, endLoading } = useLoading();
const data = ref<contactPerson.TableList[]>([]); const data = ref<scm.register.TableList[]>([]);
const columns: Ref<DataTableColumns<contactPerson.TableList>> = ref([ const columns: Ref<DataTableColumns<scm.register.TableList>> = ref([
{ {
title: '序号', title: '序号',
key: 'index', key: 'index',
@ -224,7 +144,7 @@ const columns: Ref<DataTableColumns<contactPerson.TableList>> = ref([
}, },
{ {
title: '供应商全称', title: '供应商全称',
key: 'supplierName', key: 'vendorName',
align: 'center', align: 'center',
width: 180, width: 180,
ellipsis: { ellipsis: {
@ -233,7 +153,7 @@ const columns: Ref<DataTableColumns<contactPerson.TableList>> = ref([
}, },
{ {
title: '简称', title: '简称',
key: 'name', key: 'vendorNick',
align: 'center', align: 'center',
width: 180, width: 180,
ellipsis: { ellipsis: {
@ -253,25 +173,34 @@ const columns: Ref<DataTableColumns<contactPerson.TableList>> = ref([
title: '地址', title: '地址',
key: 'address', key: 'address',
align: 'center', align: 'center',
width: 120 width: 180,
ellipsis: {
tooltip: true
}
}, },
{ {
title: '主要供应产品', title: '主要供应产品',
key: 'product', key: 'product',
align: 'center', align: 'center',
width: 120 width: 180,
ellipsis: {
tooltip: true
}
}, },
{ {
title: '稅种', title: '稅种',
key: 'totalTax', key: 'totalTax',
align: 'center', align: 'center',
width: 120 width: 180,
ellipsis: {
tooltip: true
}
}, },
{ {
title: '税率', title: '税率',
key: 'taxRate', key: 'taxRate',
align: 'center', align: 'center',
width: 120 width: 180
}, },
{ {
title: '操作', title: '操作',
@ -294,13 +223,7 @@ const columns: Ref<DataTableColumns<contactPerson.TableList>> = ref([
编辑 编辑
</n-button> </n-button>
<n-button <n-button type="error" size={'small'} onClick={() => handleDeleteItemType(row.id)}>
type="error"
size={'small'}
onClick={() => {
console.log('1');
}}
>
<icon-mdi-delete /> <icon-mdi-delete />
删除 删除
</n-button> </n-button>
@ -310,19 +233,13 @@ const columns: Ref<DataTableColumns<contactPerson.TableList>> = ref([
} }
]); ]);
// function handleUpdateValue(val, option) { function addOrEdit(num: number, row?: scm.register.TableList) {
// console.log('val ==>', val);
// addOrEditForm.value.clientName = option.clientName;
// addOrEditForm.value.clientCode = option.clientCode;
// }
function addOrEdit(num: number, row?: contactPerson.TableList) {
addOrEditType.value = num; addOrEditType.value = num;
show.value = true; show.value = true;
addOrEditForm.value = { addOrEditForm.value = {
id: null, id: null,
supplierName: '', vendorName: '',
name: '', vendorNick: '',
address: '', address: '',
bank: '', bank: '',
product: '', product: '',
@ -332,54 +249,42 @@ function addOrEdit(num: number, row?: contactPerson.TableList) {
if (num === 1) { if (num === 1) {
if (!row) return; if (!row) return;
for (const key in addOrEditForm.value) { for (const key in addOrEditForm.value) {
if (row[key] || row[key] === '0') { if (row[key] || row[key] === '0' || row[key] === 0) {
addOrEditForm.value[key] = row[key]; addOrEditForm.value[key] = row[key];
} }
} }
} }
} }
// function handleDeleteItemType(id: number) { function handleDeleteItemType(id: number) {
// const d = dialog.warning({ const d = dialog.warning({
// title: '', title: '删除',
// content: '?', content: '确认要删除吗?',
// positiveText: '', positiveText: '确认',
// negativeText: '', negativeText: '取消',
// onPositiveClick: () => { onPositiveClick: () => {
// d.loading = true; d.loading = true;
// return new Promise(resolve => { return new Promise(resolve => {
// deleteCrmContactPerson(id).then(res => { deleteSupplier(id).then(res => {
// if (res.code === 200) {
// init();
// window.$message?.success('');
// }
// resolve(true);
// });
// });
// }
// });
// }
function submitSame(func: any, msg: string): void {
func(addOrEditForm.value).then(res => {
if (res.code === 200) { if (res.code === 200) {
linkmanList.value.unshift(addOrEditForm.value);
show.value = false;
window.$message?.success(msg);
init(); init();
window.$message?.success('删除成功');
} }
resolve(true);
}); });
} });
}
function add() {
console.log('add');
return new Promise(reslove => {
reslove({ code: 200 });
}); });
} }
function edit() { function submitSame<T>(func: (params: any) => Promise<T>, msg: string): void {
console.log('edit'); func(addOrEditForm.value).then((res: any) => {
if (res.code === 200) {
show.value = false;
window.$message?.success(msg);
init();
}
});
} }
function submit(): void { function submit(): void {
@ -387,9 +292,9 @@ function submit(): void {
formModel.value.validate(errors => { formModel.value.validate(errors => {
if (!errors) { if (!errors) {
if (addOrEditType.value === 0) { if (addOrEditType.value === 0) {
submitSame(add, '添加成功'); submitSame(addSupplier, '添加成功');
} else { } else {
submitSame(edit, '编辑成功'); submitSame(updateSupplier, '编辑成功');
} }
} }
}); });
@ -405,15 +310,13 @@ function handleReset() {
function init() { function init() {
startLoading(); startLoading();
setTimeout(() => { getAllSupplier(searchForm.value).then(res => {
// for (const key in addOrEditForm.value) {
// if (Object.hasOwn(addOrEditForm.value, key)) {
// if ()
// }
// }
data.value = linkmanList.value;
endLoading(); endLoading();
}, 300); if (res.code === 200) {
data.value = res.rows;
searchForm.value.total = res.total;
}
});
} }
onMounted(() => { onMounted(() => {

Loading…
Cancel
Save