feat(供应商管理): 初始化

This commit is contained in:
LJW 2024-11-20 15:00:25 +08:00
parent 0e7187dd58
commit 7a9ac420bc
2 changed files with 288 additions and 0 deletions

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询供应商基础信息列表
export function listWmsSupplier(query) {
return request({
url: '/wm/wmsSupplier/list',
method: 'get',
params: query
})
}
// 查询供应商基础信息详细
export function getWmsSupplier(id) {
return request({
url: '/wm/wmsSupplier/' + id,
method: 'get'
})
}
// 新增供应商基础信息
export function addWmsSupplier(data) {
return request({
url: '/wm/wmsSupplier',
method: 'post',
data: data
})
}
// 修改供应商基础信息
export function updateWmsSupplier(data) {
return request({
url: '/wm/wmsSupplier',
method: 'put',
data: data
})
}
// 删除供应商基础信息
export function delWmsSupplier(id) {
return request({
url: '/wm/wmsSupplier/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,244 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @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="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['wm:wmsSupplier:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['wm:wmsSupplier:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['wm:wmsSupplier:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['wm:wmsSupplier:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="wmsSupplierList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="供应商名称" align="center" prop="supplierName" />
<el-table-column label="供应商类型名称" align="center" prop="supplierTypeName" />
<el-table-column label="供应商类型编码" align="center" prop="supplierTypeCode" />
<el-table-column label="主要联系人姓名" align="center" prop="contactName" />
<el-table-column label="联系人电话" align="center" prop="contactPhone" />
<el-table-column label="联系人电子邮箱" align="center" prop="contactEmail" />
<el-table-column label="联系地址" align="center" prop="contactAddress" />
<el-table-column label="供应商所在地理位置/地区" align="center" prop="region" />
<el-table-column label="供应商公司官网" align="center" prop="website" />
<el-table-column label="供应商公司官网" align="center" prop="createBy" />
<el-table-column label="供应商公司官网" align="center" prop="createTime" />
<el-table-column label="供应商公司官网" align="center" prop="updateBy" />
<el-table-column label="供应商公司官网" align="center" prop="updateTime" />
<el-table-column label="供应商公司官网" align="center" prop="isDelete" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['wm:wmsSupplier:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['wm:wmsSupplier: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" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
</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>
import { listWmsSupplier, getWmsSupplier, delWmsSupplier, addWmsSupplier, updateWmsSupplier } from "@/api/mes/wm/wmsSupplier";
export default {
name: "WmsSupplier",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
wmsSupplierList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
supplierName: null, supplierTypeName: null, supplierTypeCode: null, contactName: null, contactPhone: null, contactEmail: null, contactAddress: null, region: null, website: null, createBy: null, createTime: null, updateBy: null, updateTime: null, isDelete: null },
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询供应商基础信息列表 */
getList() {
this.loading = true;
listWmsSupplier(this.queryParams).then(response => {
this.wmsSupplierList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null, supplierName: null, supplierTypeName: null, supplierTypeCode: null, contactName: null, contactPhone: null, contactEmail: null, contactAddress: null, region: null, website: null, createBy: null, createTime: null, updateBy: null, updateTime: null, isDelete: null };
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加供应商基础信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getWmsSupplier(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改供应商基础信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateWmsSupplier(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addWmsSupplier(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除供应商基础信息编号为"' + ids + '"的数据项?').then(function() {
return delWmsSupplier(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('wm/wmsSupplier/export', {
...this.queryParams
}, `wmsSupplier_${new Date().getTime()}.xlsx`)
}
}
};
</script>