项目初始化
This commit is contained in:
512
ruoyi-ui/src/views/bas/basSupplier/index.vue
Normal file
512
ruoyi-ui/src/views/bas/basSupplier/index.vue
Normal file
@@ -0,0 +1,512 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="供应商编号" prop="supplierNo">
|
||||
<el-input
|
||||
v-model="queryParams.supplierNo"
|
||||
placeholder="请输入供应商编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="供应商名称" prop="supplierGroupNo">
|
||||
<el-input
|
||||
v-model="queryParams.supplierGroupNo"
|
||||
placeholder="请输入供应商名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="供应商名称" prop="supplierName">
|
||||
<el-input
|
||||
v-model="queryParams.supplierName"
|
||||
placeholder="请输入供应商名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="简称" prop="simpleName">
|
||||
<el-input
|
||||
v-model="queryParams.simpleName"
|
||||
placeholder="请输入简称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="useable">
|
||||
|
||||
<el-select v-model="queryParams.useable" placeholder="请选择是否可用" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.is_available"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('BasSupplier.supplierArae')" prop="supplierArae"> 地区分类
|
||||
<el-input
|
||||
v-model="queryParams.supplierArae"
|
||||
:placeholder="$t('BasSupplier.inputSupplierArae')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('BasSupplier.taxpayerRegistrationNumber')" prop="taxpayerRegistrationNumber"> 纳税人登记号
|
||||
<el-input
|
||||
v-model="queryParams.taxpayerRegistrationNumber"
|
||||
:placeholder="$t('BasSupplier.inputTaxpayerRegistrationNumber')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('BasSupplier.country')" prop="country"> 国家
|
||||
<el-input
|
||||
v-model="queryParams.country"
|
||||
:placeholder="$t('BasSupplier.inputCountry')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('BasSupplier.timeZone')" prop="timeZone"> 时区
|
||||
<el-input
|
||||
v-model="queryParams.timeZone"
|
||||
:placeholder="$t('BasSupplier.inputTimeZone')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('BasSupplier.dataFormat')" prop="dataFormat"> 数据格式
|
||||
<el-input
|
||||
v-model="queryParams.dataFormat"
|
||||
:placeholder="$t('BasSupplier.inputDataFormat')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('BasSupplier.receivingCountry')" prop="receivingCountry"> 收货国家
|
||||
<el-input
|
||||
v-model="queryParams.receivingCountry"
|
||||
:placeholder="$t('BasSupplier.inputReceivingCountry')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('BasSupplier.taxCategory')" prop="taxCategory"> 税类
|
||||
<el-input
|
||||
v-model="queryParams.taxCategory"
|
||||
:placeholder="$t('BasSupplier.inputTaxCategory')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('BasSupplier.legalPerson')" prop="legalPerson"> 法人
|
||||
<el-input
|
||||
v-model="queryParams.legalPerson"
|
||||
:placeholder="$t('BasSupplier.inputLegalPerson')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('BasSupplier.registeredCapital')" prop="registeredCapital"> 注册资金
|
||||
<el-input
|
||||
v-model="queryParams.registeredCapital"
|
||||
:placeholder="$t('BasSupplier.inputRegisteredCapital')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('BasSupplier.address')" prop="address"> 企业地址
|
||||
<el-input
|
||||
v-model="queryParams.address"
|
||||
:placeholder="$t('BasSupplier.inputAddress')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('BasSupplier.contactName')" prop="contactName"> 联系人姓名
|
||||
<el-input
|
||||
v-model="queryParams.contactName"
|
||||
:placeholder="$t('BasSupplier.inputContactName')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('BasSupplier.contactNumber')" prop="contactNumber"> 联系电话
|
||||
<el-input
|
||||
v-model="queryParams.contactNumber"
|
||||
:placeholder="$t('BasSupplier.inputContactNumber')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<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="['bas:BasSupplier: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="['bas:BasSupplier: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="['bas:BasSupplier: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="['bas:BasSupplier:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="BasSupplierList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="供应商编号" align="left" prop="supplierNo" width="120" />
|
||||
<el-table-column label="供应商组" align="left" prop="supplierGroupNo" width="120" />
|
||||
<el-table-column label="供应商名称" align="left" prop="supplierName" width="120" />
|
||||
<el-table-column label="简称" align="left" prop="simpleName" width="120" />
|
||||
<el-table-column label="是否可用" align="left" prop="useable" width="120" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.is_available" :value="scope.row.useable"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="left" prop="remark" width="120" />
|
||||
<el-table-column label="地区" align="left" prop="supplierArae" width="120" />
|
||||
<el-table-column label="纳税人登记号" align="left" prop="taxpayerRegistrationNumber" width="120" />
|
||||
<el-table-column label="国家" align="left" prop="country" width="120" />
|
||||
<el-table-column label="时区" align="left" prop="timeZone" width="120" />
|
||||
<el-table-column label="数据格式" align="left" prop="dataFormat" width="120" />
|
||||
<el-table-column label="收货国家" align="left" prop="receivingCountry" width="120" />
|
||||
<el-table-column label="税收类别" align="left" prop="taxCategory" width="120" />
|
||||
<el-table-column label="法人" align="left" prop="legalPerson" width="120" />
|
||||
<el-table-column label="注册资本" align="right" prop="registeredCapital" width="120" />
|
||||
<el-table-column label="地址" align="left" prop="address" width="120" />
|
||||
<el-table-column label="联系人" align="left" prop="contactName" width="120" />
|
||||
<el-table-column label="联系电话" align="left" prop="contactNumber" width="120" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['bas:BasSupplier:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:BasSupplier: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="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="供应商编号" prop="supplierNo">
|
||||
<el-input v-model="form.supplierNo" placeholder="请输入供应商编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商组编号" prop="supplierGroupNo">
|
||||
<el-input v-model="form.supplierGroupNo" placeholder="请输入供应商组编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商名称" prop="supplierName">
|
||||
<el-input v-model="form.supplierName" placeholder="请输入供应商名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简称" prop="simpleName">
|
||||
<el-input v-model="form.simpleName" placeholder="请输入简称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="useable">
|
||||
<el-select v-model="form.useable" placeholder="请选择是否可用" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.is_available"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="地区" prop="supplierArae">
|
||||
<el-input v-model="form.supplierArae" placeholder="请输入地区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="纳税人登记号" prop="taxpayerRegistrationNumber">
|
||||
<el-input v-model="form.taxpayerRegistrationNumber" placeholder="请输入纳税人登记号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="国家" prop="country">
|
||||
<el-input v-model="form.country" placeholder="请输入国家" />
|
||||
</el-form-item>
|
||||
<el-form-item label="时区" prop="timeZone">
|
||||
<el-input v-model="form.timeZone" placeholder="请输入时区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据格式" prop="dataFormat">
|
||||
<el-input v-model="form.dataFormat" placeholder="请输入数据格式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收货国家" prop="receivingCountry">
|
||||
<el-input v-model="form.receivingCountry" placeholder="请输入收货国家" />
|
||||
</el-form-item>
|
||||
<el-form-item label="税收类别" prop="taxCategory">
|
||||
<el-input v-model="form.taxCategory" placeholder="请输入税收类别" />
|
||||
</el-form-item>
|
||||
<el-form-item label="法人" prop="legalPerson">
|
||||
<el-input v-model="form.legalPerson" placeholder="请输入法人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="注册资本" prop="registeredCapital">
|
||||
<el-input v-model="form.registeredCapital" placeholder="请输入注册资本" />
|
||||
</el-form-item>
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input v-model="form.address" placeholder="请输入地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contactName">
|
||||
<el-input v-model="form.contactName" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="contactNumber">
|
||||
<el-input v-model="form.contactNumber" 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>
|
||||
import { listBasSupplier, getBasSupplier, delBasSupplier, addBasSupplier, updateBasSupplier } from "@/api/bas/BasSupplier"
|
||||
|
||||
export default {
|
||||
name: "BasSupplier",
|
||||
dicts:['is_available'],
|
||||
data() {
|
||||
return {
|
||||
// Loading overlay
|
||||
loading: true,
|
||||
// Selected array
|
||||
ids: [],
|
||||
// Single selection disabled
|
||||
single: true,
|
||||
// Multiple selection disabled
|
||||
multiple: true,
|
||||
// Show search conditions
|
||||
showSearch: true,
|
||||
// Total count
|
||||
total: 0,
|
||||
// Supplier management table data
|
||||
BasSupplierList: [],
|
||||
// Dialog title
|
||||
title: "",
|
||||
// Show dialog
|
||||
open: false,
|
||||
// Query parameters
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
supplierNo: null,
|
||||
supplierGroupNo: null,
|
||||
supplierName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
supplierArae: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
receivingCountry: null,
|
||||
taxCategory: null,
|
||||
legalPerson: null,
|
||||
registeredCapital: null,
|
||||
address: null,
|
||||
contactName: null,
|
||||
contactNumber: null
|
||||
},
|
||||
// Form parameters
|
||||
form: {},
|
||||
// Form validation
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "ID不能为空", trigger: "blur" }
|
||||
],
|
||||
supplierNo: [
|
||||
{ required: true, message: "供应商编号不能为空", trigger: "blur" }
|
||||
],
|
||||
supplierName: [
|
||||
{ required: true, message: "供应商名称不能为空", trigger: "blur" }
|
||||
],
|
||||
useable: [
|
||||
{ required: true, message: "是否可用不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** Get supplier management list */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listBasSupplier(this.queryParams).then(response => {
|
||||
this.BasSupplierList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// Cancel button
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// Reset form
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
supplierNo: null,
|
||||
supplierGroupNo: null,
|
||||
supplierName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
remark: null,
|
||||
supplierArae: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
receivingCountry: null,
|
||||
taxCategory: null,
|
||||
legalPerson: null,
|
||||
registeredCapital: null,
|
||||
address: null,
|
||||
contactName: null,
|
||||
contactNumber: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** Search button operation */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** Reset button operation */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// Multiple selection change
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** Add button operation */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加供应商"
|
||||
},
|
||||
/** Edit button operation */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getBasSupplier(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改供应商"
|
||||
})
|
||||
},
|
||||
/** Submit button */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateBasSupplier(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addBasSupplier(this.form).then(response => {
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** Delete button operation */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm("是否确认删除所选项目?").then(function() {
|
||||
return delBasSupplier(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** Export button operation */
|
||||
handleExport() {
|
||||
this.download('bas/BasSupplier/export', {
|
||||
...this.queryParams
|
||||
}, `BasSupplier_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form-item >>> .el-form-item__label {
|
||||
white-space: nowrap;
|
||||
width: auto;
|
||||
min-width: fit-content;
|
||||
}
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user