初始化
This commit is contained in:
1027
ruoyi-ui/src/views/bas/BasProductCode/index.vue
Normal file
1027
ruoyi-ui/src/views/bas/BasProductCode/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
371
ruoyi-ui/src/views/bas/basCustomer/index.vue
Normal file
371
ruoyi-ui/src/views/bas/basCustomer/index.vue
Normal file
@@ -0,0 +1,371 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="客户编号" prop="customerNo">
|
||||
<el-input v-model="queryParams.customerNo" placeholder="请输入客户编号" clearable
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="queryParams.customerName" 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>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-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="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['bas:BasCustomer: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:BasCustomer: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:BasCustomer: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:BasCustomer:export']">导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="BasCustomerList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column width="120" label="客户编号" align="left" prop="customerNo"/>
|
||||
<el-table-column width="120" label="客户类别" align="left" prop="customerGroupNo"/>
|
||||
<el-table-column width="220" label="客户名称" align="left" prop="customerName"/>
|
||||
<el-table-column width="120" label="简称" align="left" prop="simpleName"/>
|
||||
<el-table-column width="120" label="是否可用" align="left" prop="useable">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.is_available" :value="scope.row.useable"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="120" label="备注" align="left" prop="remark"/>
|
||||
<el-table-column width="120" label="业务部门" align="left" prop="businessDepartment"/>
|
||||
<el-table-column width="120" label="业务员" align="left" prop="salesman"/>
|
||||
<el-table-column width="120" label="助记码" align="left" prop="mnemonicCode"/>
|
||||
<el-table-column width="120" label="客户类型" align="left" prop="type"/>
|
||||
<el-table-column width="120" label="纳税人识别号" align="left" prop="taxpayerRegistrationNumber"/>
|
||||
<el-table-column width="120" label="财务组织" align="left" prop="organization"/>
|
||||
<el-table-column width="120" label="上级客户" align="left" prop="supCustomer"/>
|
||||
<el-table-column width="120" label="个人客户" align="left" prop="retailInvestor"/>
|
||||
<el-table-column width="120" label="国家/地区" align="left" prop="country"/>
|
||||
<el-table-column width="120" label="时区" align="left" prop="timeZone"/>
|
||||
<el-table-column width="120" label="数据格式" align="left" prop="dataFormat"/>
|
||||
<el-table-column width="120" label="联系人" align="left" prop="contactName"/>
|
||||
<el-table-column width="120" label="装运国家" align="left" prop="shipment"/>
|
||||
<el-table-column width="120" label="税种" align="left" prop="taxCategory"/>
|
||||
<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="['bas:BasCustomer:edit']">修改
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:BasCustomer: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-item label="客户编号" prop="customerNo">
|
||||
<el-input v-model="form.customerNo" placeholder="请输入客户编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="form.customerName" 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="请选择是否可用">
|
||||
<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" type="textarea" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务部门" prop="businessDepartment">
|
||||
<el-input v-model="form.businessDepartment" placeholder="请输入业务部门"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务员" prop="salesman">
|
||||
<el-input v-model="form.salesman" placeholder="请输入业务员"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="助记码" prop="mnemonicCode">
|
||||
<el-input v-model="form.mnemonicCode" placeholder="请输入助记码"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户类型" prop="type">
|
||||
<el-input v-model="form.type" 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="organization">
|
||||
<el-input v-model="form.organization" placeholder="请输入财务组织"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="上级客户" prop="supCustomer">
|
||||
<el-input v-model="form.supCustomer" placeholder="请输入上级客户"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="个人客户" prop="retailInvestor">
|
||||
<el-input v-model="form.retailInvestor" 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="contactName">
|
||||
<el-input v-model="form.contactName" placeholder="请输入联系人"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="装运国家" prop="shipment">
|
||||
<el-input v-model="form.shipment" placeholder="请输入装运国家"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="税种" prop="taxCategory">
|
||||
<el-input v-model="form.taxCategory" 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 {listBasCustomer, getBasCustomer, delBasCustomer, addBasCustomer, updateBasCustomer} from "@/api/bas/BasCustomer"
|
||||
|
||||
export default {
|
||||
name: "BasCustomer",
|
||||
dicts: ['is_available'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 客户管理表格数据
|
||||
BasCustomerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
customerNo: null,
|
||||
customerGroupNo: null,
|
||||
customerName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
businessDepartment: null,
|
||||
salesman: null,
|
||||
mnemonicCode: null,
|
||||
type: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
organization: null,
|
||||
supCustomer: null,
|
||||
retailInvestor: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
contactName: null,
|
||||
shipment: null,
|
||||
taxCategory: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{required: true, message: "ID不能为空", trigger: "blur"}
|
||||
],
|
||||
customerNo: [
|
||||
{required: true, message: "客户编号不能为空", trigger: "blur"}
|
||||
],
|
||||
customerName: [
|
||||
{required: true, message: "客户名称不能为空", trigger: "blur"}
|
||||
],
|
||||
useable: [
|
||||
{required: true, message: "是否可用不能为空", trigger: "blur"}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询客户管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listBasCustomer(this.queryParams).then(response => {
|
||||
this.BasCustomerList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
customerNo: null,
|
||||
customerGroupNo: null,
|
||||
customerName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
remark: null,
|
||||
businessDepartment: null,
|
||||
salesman: null,
|
||||
mnemonicCode: null,
|
||||
type: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
organization: null,
|
||||
supCustomer: null,
|
||||
retailInvestor: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
contactName: null,
|
||||
shipment: null,
|
||||
taxCategory: 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
|
||||
getBasCustomer(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) {
|
||||
updateBasCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addBasCustomer(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 delBasCustomer(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/BasCustomer/export', {
|
||||
...this.queryParams
|
||||
}, `BasCustomer_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
888
ruoyi-ui/src/views/bas/basProduct/index.vue
Normal file
888
ruoyi-ui/src/views/bas/basProduct/index.vue
Normal file
@@ -0,0 +1,888 @@
|
||||
<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="productId">
|
||||
<el-input
|
||||
v-model="queryParams.productId"
|
||||
placeholder="请输入品号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="产品分类" prop="parentId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.parentId"-->
|
||||
<!-- placeholder="请输入产品分类"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="品号描述" prop="price">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.price"-->
|
||||
<!-- placeholder="请输入品号描述"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="英文描述" prop="cargoNo">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.cargoNo"-->
|
||||
<!-- placeholder="请输入英文描述"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="图号" prop="unit">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.unit"-->
|
||||
<!-- placeholder="请输入图号"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="规格" prop="spec">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spec"-->
|
||||
<!-- placeholder="请输入规格"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="型号" prop="spare1">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare1"-->
|
||||
<!-- placeholder="请输入型号"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="单件净重" prop="spare2">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare2"-->
|
||||
<!-- placeholder="请输入单件净重"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="颜色" prop="spare3">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare3"-->
|
||||
<!-- placeholder="请输入颜色"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="序列号" prop="spare4">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare4"-->
|
||||
<!-- placeholder="请输入序列号"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="电压" prop="spare5">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare5"-->
|
||||
<!-- placeholder="请输入电压"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="功率" prop="spare6">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare6"-->
|
||||
<!-- placeholder="请输入功率"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="品名" prop="productName">
|
||||
<el-input
|
||||
v-model="queryParams.productName"
|
||||
placeholder="请输入品名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="相位" prop="spare7">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare7"-->
|
||||
<!-- placeholder="请输入相位"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="毛重" prop="spare8">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare8"-->
|
||||
<!-- placeholder="请输入毛重"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="NC号" prop="spare9">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare9"-->
|
||||
<!-- placeholder="请输入NC号"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="托盘尺寸" prop="spare10">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare10"-->
|
||||
<!-- placeholder="请输入托盘尺寸"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="插头" prop="spare11">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare11"-->
|
||||
<!-- placeholder="请输入插头"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="接嘴" prop="spare12">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare12"-->
|
||||
<!-- placeholder="请输入接嘴"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="快捷码" prop="spare13">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare13"-->
|
||||
<!-- placeholder="请输入快捷码"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="库存单位编号" prop="spare14">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare14"-->
|
||||
<!-- placeholder="请输入库存单位编号"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="库存单位名称" prop="spare15">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare15"-->
|
||||
<!-- placeholder="请输入库存单位名称"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="品号群组" prop="spare16">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare16"-->
|
||||
<!-- placeholder="请输入品号群组"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="归类品" prop="spare17">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare17"-->
|
||||
<!-- placeholder="请输入归类品"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="计量体系" prop="spare18">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare18"-->
|
||||
<!-- placeholder="请输入计量体系"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="群组名称" prop="spare19">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare19"-->
|
||||
<!-- placeholder="请输入群组名称"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="批号管理" prop="spare20">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare20"-->
|
||||
<!-- placeholder="请输入批号管理"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="状态" prop="spare21">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare21"-->
|
||||
<!-- placeholder="请输入状态"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="产品大类" prop="spare22">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare22"-->
|
||||
<!-- placeholder="请输入产品大类"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="产品二类" prop="spare23">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare23"-->
|
||||
<!-- placeholder="请输入产品二类"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="产品线/产品系列" prop="spare24">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare24"-->
|
||||
<!-- placeholder="请输入产品线/产品系列"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="BOM状态" prop="spare25">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare25"-->
|
||||
<!-- placeholder="请输入BOM状态"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="产品定位" prop="spare26">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare26"-->
|
||||
<!-- placeholder="请输入产品定位"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="电脑板型号" prop="spare27">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare27"-->
|
||||
<!-- placeholder="请输入电脑板型号"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="非标要求" prop="spare28">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare28"-->
|
||||
<!-- placeholder="请输入非标要求"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="品牌" prop="spare29">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare29"-->
|
||||
<!-- placeholder="请输入品牌"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="非标颜色" prop="spare30">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare30"-->
|
||||
<!-- placeholder="请输入非标颜色"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="主颜色" prop="spare31">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare31"-->
|
||||
<!-- placeholder="请输入主颜色"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="辅助颜色" prop="spare32">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare32"-->
|
||||
<!-- placeholder="请输入辅助颜色"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="是否标准款" prop="spare33">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare33"-->
|
||||
<!-- placeholder="请输入是否标准款"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="包装方式" prop="spare34">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare34"-->
|
||||
<!-- placeholder="请输入包装方式"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="主要包装方式" prop="spare35">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare35"-->
|
||||
<!-- placeholder="请输入主要包装方式"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="长" prop="spare36">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare36"-->
|
||||
<!-- placeholder="请输入长"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="宽" prop="spare37">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare37"-->
|
||||
<!-- placeholder="请输入宽"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="高" prop="spare38">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare38"-->
|
||||
<!-- placeholder="请输入高"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="包装材积" prop="spare39">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare39"-->
|
||||
<!-- placeholder="请输入包装材积"-->
|
||||
<!-- 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:BasProduct: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:BasProduct: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:BasProduct: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:BasProduct:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="BasProductList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="主键" align="center" prop="productGuid" />-->
|
||||
<el-table-column label="品号" align="center" prop="productId" />
|
||||
<el-table-column label="NC号" align="center" prop="spare9" />
|
||||
<el-table-column label="品名" align="center" prop="productName" />
|
||||
<el-table-column label="规格" align="center" prop="spec" />
|
||||
<el-table-column label="品号描述" align="center" prop="price" />
|
||||
<el-table-column label="英文描述" align="center" prop="cargoNo" />
|
||||
<el-table-column label="图号" align="center" prop="unit" />
|
||||
<el-table-column label="电压" align="center" prop="spare5" />
|
||||
<el-table-column label="托盘尺寸" align="center" prop="spare10" />
|
||||
<el-table-column label="插头" align="center" prop="spare11" />
|
||||
<el-table-column label="接嘴" align="center" prop="spare12" />
|
||||
<el-table-column label="快捷码" align="center" prop="spare13" />
|
||||
<el-table-column label="库存单位编号" align="center" prop="spare14" />
|
||||
<el-table-column label="库存单位名称" align="center" prop="spare15" />
|
||||
<el-table-column label="品号群组" align="center" prop="spare16" />
|
||||
<el-table-column label="归类品" align="center" prop="spare17" />
|
||||
<el-table-column label="计量体系" align="center" prop="spare18" />
|
||||
<el-table-column label="群组名称" align="center" prop="spare19" />
|
||||
<el-table-column label="批号管理" align="center" prop="spare20" />
|
||||
<el-table-column label="状态" align="center" prop="spare21" />
|
||||
<el-table-column label="产品大类" align="center" prop="spare22" />
|
||||
<el-table-column label="产品二类" align="center" prop="spare23" />
|
||||
<el-table-column label="产品线/产品系列" align="center" prop="spare24" />
|
||||
<el-table-column label="BOM状态" align="center" prop="spare25" />
|
||||
<el-table-column label="产品定位" align="center" prop="spare26" />
|
||||
<el-table-column label="电脑板型号" align="center" prop="spare27" />
|
||||
<el-table-column label="非标要求" align="center" prop="spare28" />
|
||||
<el-table-column label="品牌" align="center" prop="spare29" />
|
||||
<el-table-column label="非标颜色" align="center" prop="spare30" />
|
||||
<el-table-column label="主颜色" align="center" prop="spare31" />
|
||||
<el-table-column label="辅助颜色" align="center" prop="spare32" />
|
||||
<el-table-column label="是否标准款" align="center" prop="spare33" />
|
||||
<el-table-column label="包装方式" align="center" prop="spare34" />
|
||||
<el-table-column label="主要包装方式" align="center" prop="spare35" />
|
||||
<el-table-column label="描述" align="center" prop="remark" />
|
||||
<el-table-column label="长" align="center" prop="spare36" />
|
||||
<el-table-column label="宽" align="center" prop="spare37" />
|
||||
<el-table-column label="高" align="center" prop="spare38" />
|
||||
<el-table-column label="包装材积" align="center" prop="spare39" />
|
||||
<!-- <el-table-column label="产品分类" align="center" prop="parentId" />-->
|
||||
<!-- <el-table-column label="型号" align="center" prop="spare1" />-->
|
||||
<!-- <el-table-column label="单件净重" align="center" prop="spare2" />-->
|
||||
<!-- <el-table-column label="颜色" align="center" prop="spare3" />-->
|
||||
<!-- <el-table-column label="序列号" align="center" prop="spare4" />-->
|
||||
<!-- <el-table-column label="功率" align="center" prop="spare6" />-->
|
||||
<!-- <el-table-column label="相位" align="center" prop="spare7" />-->
|
||||
<!-- <el-table-column label="毛重" align="center" prop="spare8" />-->
|
||||
|
||||
<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="['bas:BasProduct:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:BasProduct: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-item label="品号" prop="productId">
|
||||
<el-input v-model="form.productId" placeholder="请输入品号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品名" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入品名" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="产品分类" prop="parentId">-->
|
||||
<!-- <el-input v-model="form.parentId" placeholder="请输入产品分类" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="品号描述" prop="price">
|
||||
<el-input v-model="form.price" placeholder="请输入品号描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="英文描述" prop="cargoNo">
|
||||
<el-input v-model="form.cargoNo" 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="spec">
|
||||
<el-input v-model="form.spec" placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="型号" prop="spare1">-->
|
||||
<!-- <el-input v-model="form.spare1" placeholder="请输入型号" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="单件净重" prop="spare2">-->
|
||||
<!-- <el-input v-model="form.spare2" placeholder="请输入单件净重" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="颜色" prop="spare3">-->
|
||||
<!-- <el-input v-model="form.spare3" placeholder="请输入颜色" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="序列号" prop="spare4">-->
|
||||
<!-- <el-input v-model="form.spare4" placeholder="请输入序列号" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="电压" prop="spare5">
|
||||
<el-input v-model="form.spare5" placeholder="请输入电压" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="功率" prop="spare6">-->
|
||||
<!-- <el-input v-model="form.spare6" placeholder="请输入功率" />-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<!-- <el-form-item label="相位" prop="spare7">-->
|
||||
<!-- <el-input v-model="form.spare7" placeholder="请输入相位" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="毛重" prop="spare8">-->
|
||||
<!-- <el-input v-model="form.spare8" placeholder="请输入毛重" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="NC号" prop="spare9">
|
||||
<el-input v-model="form.spare9" placeholder="请输入NC号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘尺寸" prop="spare10">
|
||||
<el-input v-model="form.spare10" placeholder="请输入托盘尺寸" />
|
||||
</el-form-item>
|
||||
<el-form-item label="插头" prop="spare11">
|
||||
<el-input v-model="form.spare11" placeholder="请输入插头" />
|
||||
</el-form-item>
|
||||
<el-form-item label="接嘴" prop="spare12">
|
||||
<el-input v-model="form.spare12" placeholder="请输入接嘴" />
|
||||
</el-form-item>
|
||||
<el-form-item label="快捷码" prop="spare13">
|
||||
<el-input v-model="form.spare13" placeholder="请输入快捷码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="库存单位编号" prop="spare14">
|
||||
<el-input v-model="form.spare14" placeholder="请输入库存单位编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="库存单位名称" prop="spare15">
|
||||
<el-input v-model="form.spare15" placeholder="请输入库存单位名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品号群组" prop="spare16">
|
||||
<el-input v-model="form.spare16" placeholder="请输入品号群组" />
|
||||
</el-form-item>
|
||||
<el-form-item label="归类品" prop="spare17">
|
||||
<el-input v-model="form.spare17" placeholder="请输入归类品" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计量体系" prop="spare18">
|
||||
<el-input v-model="form.spare18" placeholder="请输入计量体系" />
|
||||
</el-form-item>
|
||||
<el-form-item label="群组名称" prop="spare19">
|
||||
<el-input v-model="form.spare19" placeholder="请输入群组名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批号管理" prop="spare20">
|
||||
<el-input v-model="form.spare20" placeholder="请输入批号管理" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="spare21">
|
||||
<el-input v-model="form.spare21" placeholder="请输入状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品大类" prop="spare22">
|
||||
<el-input v-model="form.spare22" placeholder="请输入产品大类" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品二类" prop="spare23">
|
||||
<el-input v-model="form.spare23" placeholder="请输入产品二类" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品线/产品系列" prop="spare24">
|
||||
<el-input v-model="form.spare24" placeholder="请输入产品线/产品系列" />
|
||||
</el-form-item>
|
||||
<el-form-item label="BOM状态" prop="spare25">
|
||||
<el-input v-model="form.spare25" placeholder="请输入BOM状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品定位" prop="spare26">
|
||||
<el-input v-model="form.spare26" placeholder="请输入产品定位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电脑板型号" prop="spare27">
|
||||
<el-input v-model="form.spare27" placeholder="请输入电脑板型号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="非标要求" prop="spare28">
|
||||
<el-input v-model="form.spare28" placeholder="请输入非标要求" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌" prop="spare29">
|
||||
<el-input v-model="form.spare29" placeholder="请输入品牌" />
|
||||
</el-form-item>
|
||||
<el-form-item label="非标颜色" prop="spare30">
|
||||
<el-input v-model="form.spare30" placeholder="请输入非标颜色" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主颜色" prop="spare31">
|
||||
<el-input v-model="form.spare31" placeholder="请输入主颜色" />
|
||||
</el-form-item>
|
||||
<el-form-item label="辅助颜色" prop="spare32">
|
||||
<el-input v-model="form.spare32" placeholder="请输入辅助颜色" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否标准款" prop="spare33">
|
||||
<el-input v-model="form.spare33" placeholder="请输入是否标准款" />
|
||||
</el-form-item>
|
||||
<el-form-item label="包装方式" prop="spare34">
|
||||
<el-input v-model="form.spare34" placeholder="请输入包装方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主要包装方式" prop="spare35">
|
||||
<el-input v-model="form.spare35" placeholder="请输入主要包装方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="长" prop="spare36">
|
||||
<el-input v-model="form.spare36" placeholder="请输入长" />
|
||||
</el-form-item>
|
||||
<el-form-item label="宽" prop="spare37">
|
||||
<el-input v-model="form.spare37" placeholder="请输入宽" />
|
||||
</el-form-item>
|
||||
<el-form-item label="高" prop="spare38">
|
||||
<el-input v-model="form.spare38" placeholder="请输入高" />
|
||||
</el-form-item>
|
||||
<el-form-item label="包装材积" prop="spare39">
|
||||
<el-input v-model="form.spare39" 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 { listBasProduct, getBasProduct, delBasProduct, addBasProduct, updateBasProduct } from "@/api/bas/BasProduct"
|
||||
|
||||
export default {
|
||||
name: "BasProduct",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 物料管理表格数据
|
||||
BasProductList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
productId: null,
|
||||
parentId: null,
|
||||
price: null,
|
||||
cargoNo: null,
|
||||
unit: null,
|
||||
spec: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null,
|
||||
spare4: null,
|
||||
spare5: null,
|
||||
spare6: null,
|
||||
productName: null,
|
||||
spare7: null,
|
||||
spare8: null,
|
||||
spare9: null,
|
||||
spare10: null,
|
||||
spare11: null,
|
||||
spare12: null,
|
||||
spare13: null,
|
||||
spare14: null,
|
||||
spare15: null,
|
||||
spare16: null,
|
||||
spare17: null,
|
||||
spare18: null,
|
||||
spare19: null,
|
||||
spare20: null,
|
||||
spare21: null,
|
||||
spare22: null,
|
||||
spare23: null,
|
||||
spare24: null,
|
||||
spare25: null,
|
||||
spare26: null,
|
||||
spare27: null,
|
||||
spare28: null,
|
||||
spare29: null,
|
||||
spare30: null,
|
||||
spare31: null,
|
||||
spare32: null,
|
||||
spare33: null,
|
||||
spare34: null,
|
||||
spare35: null,
|
||||
spare36: null,
|
||||
spare37: null,
|
||||
spare38: null,
|
||||
spare39: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
productId: [
|
||||
{ required: true, message: "品号不能为空", trigger: "blur" }
|
||||
],
|
||||
productName: [
|
||||
{ required: true, message: "品名不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询物料管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listBasProduct(this.queryParams).then(response => {
|
||||
this.BasProductList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
productGuid: null,
|
||||
productId: null,
|
||||
parentId: null,
|
||||
price: null,
|
||||
cargoNo: null,
|
||||
unit: null,
|
||||
spec: null,
|
||||
remark: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null,
|
||||
spare4: null,
|
||||
spare5: null,
|
||||
spare6: null,
|
||||
productName: null,
|
||||
spare7: null,
|
||||
spare8: null,
|
||||
spare9: null,
|
||||
spare10: null,
|
||||
spare11: null,
|
||||
spare12: null,
|
||||
spare13: null,
|
||||
spare14: null,
|
||||
spare15: null,
|
||||
spare16: null,
|
||||
spare17: null,
|
||||
spare18: null,
|
||||
spare19: null,
|
||||
spare20: null,
|
||||
spare21: null,
|
||||
spare22: null,
|
||||
spare23: null,
|
||||
spare24: null,
|
||||
spare25: null,
|
||||
spare26: null,
|
||||
spare27: null,
|
||||
spare28: null,
|
||||
spare29: null,
|
||||
spare30: null,
|
||||
spare31: null,
|
||||
spare32: null,
|
||||
spare33: null,
|
||||
spare34: null,
|
||||
spare35: null,
|
||||
spare36: null,
|
||||
spare37: null,
|
||||
spare38: null,
|
||||
spare39: 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.productGuid)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加物料管理"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const productGuid = row.productGuid || this.ids
|
||||
getBasProduct(productGuid).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改物料管理"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.productGuid != null) {
|
||||
updateBasProduct(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addBasProduct(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const productGuids = row.productGuid || this.ids
|
||||
this.$modal.confirm('是否确认删除物料管理编号为"' + productGuids + '"的数据项?').then(function() {
|
||||
return delBasProduct(productGuids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/BasProduct/export', {
|
||||
...this.queryParams
|
||||
}, `BasProduct_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
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>
|
||||
1207
ruoyi-ui/src/views/bas/basstandPosition/index.vue
Normal file
1207
ruoyi-ui/src/views/bas/basstandPosition/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
544
ruoyi-ui/src/views/bas/cargoSpace/index.vue
Normal file
544
ruoyi-ui/src/views/bas/cargoSpace/index.vue
Normal file
@@ -0,0 +1,544 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||
:label-width="labelWidthForSearch">
|
||||
<!-- 货位ID -->
|
||||
<el-form-item label="货位编号" prop="cargoSpaceId">
|
||||
<el-input
|
||||
v-model="queryParams.cargoSpaceId"
|
||||
placeholder="请输入货位编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 排 -->
|
||||
<el-form-item label="货位-排" prop="thePlatoon">
|
||||
<el-input
|
||||
v-model="queryParams.thePlatoon"
|
||||
placeholder="请输入货位-排"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 列 -->
|
||||
<el-form-item label="货位-列" prop="theColumn">
|
||||
<el-input
|
||||
v-model="queryParams.theColumn"
|
||||
placeholder="请输入货位-列"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 层 -->
|
||||
<el-form-item label="货位-层" prop="theFloor">
|
||||
<el-input
|
||||
v-model="queryParams.theFloor"
|
||||
placeholder="请输入货位-层"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 货位状态 -->
|
||||
<el-form-item label="货位状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择货位状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.cargo_space_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 是否锁定 -->
|
||||
<el-form-item label="锁定状态" prop="locked">
|
||||
<el-select v-model="queryParams.locked" placeholder="请选择锁定状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.cargo_space_lock_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 托盘编码 -->
|
||||
<el-form-item label="序列号" prop="trayCode">
|
||||
<el-input
|
||||
v-model="queryParams.trayCode"
|
||||
placeholder="请输入序列号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 货位高度 -->
|
||||
<!-- <el-form-item :label="$t('cargoSpace.cargoHeight')" prop="cargoHight">
|
||||
<el-input
|
||||
v-model="queryParams.cargoHight"
|
||||
:placeholder="$t('cargoSpace.cargoHeight')"
|
||||
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:cargoSpace: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:cargoSpace: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:cargoSpace: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:cargoSpace:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="cargoSpaceList" @selection-change="handleSelectionChange" max-height="650">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<!-- 货位ID -->
|
||||
<el-table-column label="货位编号" align="left" prop="cargoSpaceId"/>
|
||||
<!-- 仓库名称 -->
|
||||
<!-- <el-table-column label="仓库名称" align="left" prop="warehouseName" />-->
|
||||
<el-table-column label="巷道ID" align="left" prop="roadwayId"/>
|
||||
<!-- 货位名称 -->
|
||||
<el-table-column label="货位名称" align="center" prop="cargoSpaceName"/>
|
||||
<!-- 排 -->
|
||||
<el-table-column label="排" align="left" prop="thePlatoon"/>
|
||||
<!-- 列 -->
|
||||
<el-table-column label="列" align="left" prop="theColumn"/>
|
||||
<!-- 层 -->
|
||||
<el-table-column label="层" align="left" prop="theFloor"/>
|
||||
<!-- 货位编码 -->
|
||||
<el-table-column label="货位状态" align="left" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.cargo_space_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 是否锁定 -->
|
||||
<el-table-column label="锁定状态" align="left" prop="locked">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.cargo_space_lock_status" :value="scope.row.locked"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 托盘编码 -->
|
||||
<el-table-column label="序列号" align="left" prop="trayCode"/>
|
||||
<!-- 货物高度 -->
|
||||
<!-- <el-table-column label="货物高度" align="right" prop="cargoHight" />-->
|
||||
<!-- 人工操作 -->
|
||||
<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="['bas:cargoSpace:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<!-- 人工操作---【删除】按钮 -->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-hasPermi="['bas:cargoSpace: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="100px">
|
||||
<!-- 货位ID -->
|
||||
<el-form-item label="货位编号" prop="cargoSpaceId">
|
||||
<el-input v-model="form.cargoSpaceId" placeholder="请输入货位编号" disabled/>
|
||||
</el-form-item>
|
||||
<!-- 仓库 -->
|
||||
<!-- <el-form-item label="仓库名称" prop="warehouseId">-->
|
||||
<!-- <el-select v-model="queryParams.warehouseId" placeholder="请选择仓库名称">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in warehouseOptions"-->
|
||||
<!-- :key="item.warehouseId"-->
|
||||
<!-- :label="item.warehouseName"-->
|
||||
<!-- :value="item.warehouseId"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- 巷道号 -->
|
||||
<el-form-item label="巷道编号" prop="roadwayId">
|
||||
<el-input v-model="form.roadwayId" placeholder="请输入巷道编号" disabled/>
|
||||
</el-form-item>
|
||||
<!-- 货区编码 -->
|
||||
<!-- <el-form-item label="货区编号" prop="cargoAreaId">-->
|
||||
<!-- <el-input v-model="form.cargoAreaId" placeholder="请输入货区编号" disabled/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- 货位类型 -->
|
||||
<!-- <el-form-item label="货位类型" prop="theTypeName">-->
|
||||
<!-- <el-input v-model="form.theTypeName" placeholder="请输入货位类型" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- 货位名称 -->
|
||||
<el-form-item label="货位名称" prop="cargoSpaceName">
|
||||
<el-input v-model="form.cargoSpaceName" placeholder="请输入货位名称" disabled/>
|
||||
</el-form-item>
|
||||
<!-- 排 -->
|
||||
<!-- <el-form-item label="排" prop="thePlatoon">-->
|
||||
<!-- <el-input v-model="form.thePlatoon" placeholder="请输入排号" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- 列 -->
|
||||
<!-- <el-form-item label="列" prop="theColumn">-->
|
||||
<!-- <el-input v-model="form.theColumn" placeholder="请输入列号" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- 层 -->
|
||||
<!-- <el-form-item label="层" prop="theFloor">-->
|
||||
<!-- <el-input v-model="form.theFloor" placeholder="请输入层号" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- 货位状态 -->
|
||||
<el-form-item label="货位状态" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择货位状态">
|
||||
<el-option
|
||||
v-for="dict in dict.type.cargo_space_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 是否锁定 -->
|
||||
<el-form-item label="锁定状态" prop="locked">
|
||||
<el-select v-model="form.locked" placeholder="请选择锁定状态">
|
||||
<el-option
|
||||
v-for="dict in dict.type.cargo_space_lock_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 托盘编码 -->
|
||||
<el-form-item label="序列号" prop="trayCode">
|
||||
<el-input v-model="form.trayCode" placeholder="请输入序列号"/>
|
||||
</el-form-item>
|
||||
<!-- 货位高度 -->
|
||||
<!-- <el-form-item label="货物高度" prop="cargoHight">-->
|
||||
<!-- <el-input v-model="form.cargoHight" 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 {listCargoSpace, getCargoSpace, delCargoSpace, addCargoSpace, updateCargoSpace} from "@/api/bas/cargoSpace"
|
||||
import {listWarehouse} from "@/api/bas/warehouse"
|
||||
|
||||
export default {
|
||||
name: "CargoSpace",
|
||||
dicts: ['cargo_space_status', 'cargo_space_lock_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 库存信息表格数据
|
||||
cargoSpaceList: [],
|
||||
warehouseOptions: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
warehouseId: null,
|
||||
roadwayId: null,
|
||||
cargoAreaId: null,
|
||||
theType: null,
|
||||
theTypeName: null,
|
||||
cargoSpaceName: null,
|
||||
cargoSpaceId: null,
|
||||
thePlatoon: null,
|
||||
theColumn: null,
|
||||
theFloor: null,
|
||||
status: null,
|
||||
locked: null,
|
||||
trayCode: null,
|
||||
cargoHight: null,
|
||||
issDouble: null,
|
||||
groupCodingNo: null,
|
||||
groupCoding: null,
|
||||
cargoSpaceLogo: null,
|
||||
thisCargoArea: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
cargoSpaceId: [
|
||||
// 校验---货位ID是否为空
|
||||
{required: true, message: "请输入货位编号", trigger: "blur"}
|
||||
],
|
||||
warehouseId: [
|
||||
// 校验---仓库是否为空
|
||||
{required: true, message: "请选择仓库", trigger: "change"}
|
||||
],
|
||||
cargoSpaceName: [
|
||||
// 校验---货位名称是否为空
|
||||
{required: true, message: "请输入货位名称", trigger: "blur"}
|
||||
],
|
||||
thePlatoon: [
|
||||
// 校验---排是否为空
|
||||
{required: true, message: "请输入排号", trigger: "blur"}
|
||||
],
|
||||
theColumn: [
|
||||
// 校验---列是否为空
|
||||
{required: true, message: "请输入列号", trigger: "blur"}
|
||||
],
|
||||
theFloor: [
|
||||
// 校验---层是否为空
|
||||
{required: true, message: "请输入层号", trigger: "blur"}
|
||||
],
|
||||
status: [
|
||||
// 校验---货位状态是否为空
|
||||
{required: true, message: "请选择货位状态", trigger: "change"}
|
||||
],
|
||||
locked: [
|
||||
// 校验---锁定状态是否为空
|
||||
{required: true, message: "请选择锁定状态", trigger: "change"}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getWarehouseList();
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse().then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询库存信息列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listCargoSpace(this.queryParams).then(response => {
|
||||
this.cargoSpaceList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
cargoSpaceId: null,
|
||||
warehouseId: null,
|
||||
roadwayId: null,
|
||||
cargoAreaId: null,
|
||||
theType: null,
|
||||
theTypeName: null,
|
||||
cargoSpaceName: null,
|
||||
thePlatoon: null,
|
||||
theColumn: null,
|
||||
theFloor: null,
|
||||
status: null,
|
||||
locked: null,
|
||||
trayCode: null,
|
||||
cargoHight: null,
|
||||
issDouble: null,
|
||||
groupCodingNo: null,
|
||||
groupCoding: null,
|
||||
cargoSpaceLogo: null,
|
||||
thisCargoArea: 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.cargoSpaceId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "新增货位"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const cargoSpaceId = row.cargoSpaceId || this.ids
|
||||
getCargoSpace(cargoSpaceId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改货位"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
// 检查cargoSpaceId是否存在且不为空
|
||||
if (this.form.cargoSpaceId && this.form.cargoSpaceId.trim() !== '') {
|
||||
// 检查数据库中是否存在该ID的记录
|
||||
getCargoSpace(this.form.cargoSpaceId).then(response => {
|
||||
// 检查返回的数据是否为null或空对象
|
||||
if (response.data && response.data.cargoSpaceId) {
|
||||
// 如果能获取到有效数据,说明记录存在,调用修改方法
|
||||
updateCargoSpace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
// 如果返回数据为空,说明记录不存在,调用新增方法
|
||||
addCargoSpace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}).catch(() => {
|
||||
// 如果请求失败,调用新增方法
|
||||
addCargoSpace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
} else {
|
||||
// 如果cargoSpaceId为空,直接调用新增方法
|
||||
addCargoSpace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const cargoSpaceIds = row.cargoSpaceId || this.ids
|
||||
this.$modal.confirm('确认要删除货位编号为 "' + cargoSpaceIds + '" 的货位吗?').then(function () {
|
||||
return delCargoSpace(cargoSpaceIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/cargoSpace/export', {
|
||||
...this.queryParams
|
||||
}, `cargoSpace_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
labelWidthForSearch() {
|
||||
const lang = this.$i18n.locale;
|
||||
return lang.startsWith('en') ? '84px' : '68px';
|
||||
},
|
||||
labelWidthForFunction() {
|
||||
const lang = this.$i18n.locale;
|
||||
return lang.startsWith('en') ? '150px' : '120px';
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
411
ruoyi-ui/src/views/bas/container/index.vue
Normal file
411
ruoyi-ui/src/views/bas/container/index.vue
Normal file
@@ -0,0 +1,411 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- Container ID -->
|
||||
<el-form-item label="容器编号" prop="containerId">
|
||||
<el-input
|
||||
v-model="queryParams.containerId"
|
||||
placeholder="请输入容器编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- Port Name -->
|
||||
<el-form-item label="点位名称" prop="portName">
|
||||
<el-select v-model="queryParams.portName" placeholder="请选择点位名称" clearable>
|
||||
<el-option
|
||||
v-for="(item, index) in portNameOptions"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 物料种类 -->
|
||||
<!-- <el-form-item :label="$t('bas_ContainerManagement.productTypeQuantity')" prop="productTypeQuantity">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.productTypeQuantity"-->
|
||||
<!-- :placeholder="$t('bas_ContainerManagement.placeholderProductTypeQuantity')"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- 操作人 -->
|
||||
<!-- <el-form-item :label="$t('bas_ContainerManagement.operationMan')" prop="operationMan">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.operationMan"-->
|
||||
<!-- :placeholder="$t('bas_ContainerManagement.placeholderOperationMan')"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item>
|
||||
<!-- Search button -->
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<!-- Reset 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">
|
||||
<!-- Add/Bind button -->
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['bas:container:add']"
|
||||
>新增/绑定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- Edit button -->
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['bas:container:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- Delete/Unbind button -->
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['bas:container:remove']"
|
||||
>删除/解绑</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="containerList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- Container ID -->
|
||||
<el-table-column label="容器编号" align="left" prop="containerId" />
|
||||
<!-- Port Name -->
|
||||
<el-table-column label="点位名称" align="left" prop="portName" />
|
||||
<!-- Container Status -->
|
||||
<el-table-column label="容器状态" align="left" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.stock_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- Product Type -->
|
||||
<el-table-column label="物料种类" align="right" prop="productTypeQuantity" />
|
||||
<!-- Capacity -->
|
||||
<el-table-column label="容量" align="right" prop="capacity" />
|
||||
<!-- Create Time -->
|
||||
<el-table-column label="创建时间" align="left" prop="createTime" />
|
||||
<!-- Status Update Time -->
|
||||
<el-table-column label="状态更新时间" align="left" prop="updateTime" />
|
||||
<!-- Operator -->
|
||||
<el-table-column label="操作人" align="left" prop="operationMan" />
|
||||
<!-- 操作 -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<!-- Details button -->
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleDetails(scope.row)"
|
||||
v-hasPermi="['bas:container:edit']"
|
||||
>详情</el-button>
|
||||
<!-- Edit button -->
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['bas:container:edit']"
|
||||
>修改</el-button>
|
||||
<!-- Delete button -->
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:container: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"
|
||||
/>
|
||||
|
||||
<!-- Add or Edit Container Dialog -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<!-- Container ID -->
|
||||
<el-form-item label="容器编号" prop="containerId">
|
||||
<el-input v-model="form.containerId" placeholder="请输入容器编号" :disabled="!containerIdIsEnabled"/>
|
||||
</el-form-item>
|
||||
<!-- Port Name -->
|
||||
<el-form-item label="点位名称" prop="portName">
|
||||
<el-select v-model="form.portName" placeholder="请选择点位名称" clearable>
|
||||
<el-option
|
||||
v-for="(item, index) in portNameOptions"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- Status -->
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择状态" clearable>
|
||||
<el-option
|
||||
v-for="status in dict.type.stock_status.slice(0, 2)"
|
||||
:key="status.value"
|
||||
:label="status.label"
|
||||
:value="status.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- Operator field removed, automatically obtained from current logged-in user -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<!-- OK button -->
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
<!-- Cancel button -->
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listContainer, getContainer, delContainer, addContainer, updateContainer, getPortNames } from "@/api/bas/container"
|
||||
import { get } from "sortablejs"
|
||||
|
||||
export default {
|
||||
name: "Container",
|
||||
dicts: ['stock_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// Container management table data
|
||||
containerList: [],
|
||||
// Dialog title
|
||||
title: "",
|
||||
// Show dialog
|
||||
open: false,
|
||||
// Show details dialog
|
||||
openView: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
containerId: null,
|
||||
portName: null,
|
||||
status: null,
|
||||
productTypeQuantity: null,
|
||||
updateTime: null,
|
||||
operationMan: null,
|
||||
},
|
||||
portNameOptions: [],
|
||||
// statusOptions: ['空', '有货'],
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
containerId: [
|
||||
{ required: true, message: "容器编号不能为空", trigger: "blur" }
|
||||
],
|
||||
portName: [
|
||||
{ required: true, message: "点位名称不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "容器状态不能为空", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
// Whether container ID is editable in dialog
|
||||
containerIdIsEnabled: true,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
// this.getPortNames()
|
||||
},
|
||||
methods: {
|
||||
/** 查询容器管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listContainer(this.queryParams).then(response => {
|
||||
this.containerList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
|
||||
//@@@
|
||||
getPortNames().then(res => {
|
||||
if (res.code === 200) {
|
||||
// this.portNameOptions = res.data || [];
|
||||
this.portNameOptions = Array.isArray(res.data) ? [...res.data] : [];
|
||||
// console.log(this.portNameOptions);
|
||||
} else {
|
||||
// 获取点位名称失败
|
||||
this.$message.error("获取点位名称失败");
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
// Request exception
|
||||
this.$message.error("请求异常");
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
containerId: null,
|
||||
portName: null,
|
||||
status: null,
|
||||
productTypeQuantity: null,
|
||||
capacity: null,
|
||||
createTime: null,
|
||||
updateTime: null,
|
||||
operationMan: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: 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.containerId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.containerIdIsEnabled = true
|
||||
this.open = true
|
||||
// Title: Add Container
|
||||
this.title = "新增容器"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const containerId = row.containerId || this.ids
|
||||
getContainer(containerId).then(response => {
|
||||
this.form = response.data
|
||||
this.containerIdIsEnabled = false
|
||||
this.open = true
|
||||
// Title: Edit Container
|
||||
this.title = "修改容器"
|
||||
})
|
||||
},
|
||||
/** 详情按钮操作 */
|
||||
handleDetails(row){
|
||||
const containerId = row.containerId
|
||||
// this.$router.push("/bas/containerDetails/index/" + containerId)
|
||||
this.$router.push({
|
||||
name: 'ContainerDetails',
|
||||
params: { containerId: containerId }
|
||||
})
|
||||
// console.log(containerId)
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
// Title: Edit Container
|
||||
if (this.title === "修改容器") {
|
||||
// Remove operator field, automatically obtained from current logged-in user
|
||||
delete this.form.operationMan;
|
||||
updateContainer(this.form).then(response => {
|
||||
// Success message: Modified successfully
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
//@@@
|
||||
this.form.productTypeQuantity = '3';
|
||||
this.form.capacity = 10;
|
||||
// Remove operator field, automatically obtained from current logged-in user
|
||||
delete this.form.operationMan;
|
||||
addContainer(this.form).then(response => {
|
||||
// Success message: Added successfully
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const containerIds = row.containerId || this.ids
|
||||
// Confirmation message: Are you sure you want to delete the container with ID containerIds?
|
||||
this.$modal.confirm('是否确认删除容器编号为"' + containerIds + '"的容器?').then(function() {
|
||||
return delContainer(containerIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
// Success message: Deleted successfully
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/container/export', {
|
||||
...this.queryParams
|
||||
}, `container_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
401
ruoyi-ui/src/views/bas/containerDetails/index.vue
Normal file
401
ruoyi-ui/src/views/bas/containerDetails/index.vue
Normal file
@@ -0,0 +1,401 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- Container ID -->
|
||||
<el-form-item label="容器编号" prop="containerId">
|
||||
<el-input
|
||||
v-model="queryParams.containerId"
|
||||
placeholder="请输入容器编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- Product ID -->
|
||||
<el-form-item label="品号" prop="productId">
|
||||
<el-input
|
||||
v-model="queryParams.productId"
|
||||
placeholder="请输入品号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- Product Name -->
|
||||
<el-form-item label="品名" prop="productName">
|
||||
<el-input
|
||||
v-model="queryParams.productName"
|
||||
placeholder="请输入品名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 数量 -->
|
||||
<!-- <el-form-item :label="$t('bas_ContainerManagement.quantity')" prop="quantity">
|
||||
<el-input
|
||||
v-model="queryParams.quantity"
|
||||
:placeholder="$t('bas_ContainerManagement.placeholderQuantity')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- 单位 -->
|
||||
<!-- <el-form-item :label="$t('bas_ContainerManagement.unit')" prop="unit">
|
||||
<el-input
|
||||
v-model="queryParams.unit"
|
||||
:placeholder="$t('bas_ContainerManagement.placeholderUnit')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="备用" prop="spare1">
|
||||
<el-input
|
||||
v-model="queryParams.spare1"
|
||||
:placeholder="请输入备用"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="备用" prop="spare2">
|
||||
<el-input
|
||||
v-model="queryParams.spare2"
|
||||
:placeholder="请输入备用"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="备用" prop="spare3">
|
||||
<el-input
|
||||
v-model="queryParams.spare3"
|
||||
:placeholder="请输入备用"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<!-- Search button -->
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<!-- Reset 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">
|
||||
<!-- Add button -->
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['bas:containerDetails:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- Edit button -->
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['bas:containerDetails:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- Delete button -->
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['bas:containerDetails:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- Export button -->
|
||||
<!-- <el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['bas:containerDetails:export']"
|
||||
>{{ $t('bas_ContainerManagement.btnExport') }}</el-button> -->
|
||||
<!-- Close button -->
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-close"
|
||||
size="mini"
|
||||
@click="handleClose"
|
||||
>关闭</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="containerDetailsList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- ID -->
|
||||
<el-table-column width="120" label="ID" align="left" prop="id" />
|
||||
<!-- Container ID -->
|
||||
<el-table-column width="120" label="容器编号" align="left" prop="containerId" />
|
||||
<!-- Product ID -->
|
||||
<el-table-column width="120" label="品号" align="left" prop="productId" />
|
||||
<!-- Product Name -->
|
||||
<el-table-column width="120" label="品名" align="left" prop="productName" />
|
||||
<!-- Quantity -->
|
||||
<el-table-column width="120" label="数量" align="right" prop="quantity" />
|
||||
<!-- Unit -->
|
||||
<el-table-column width="120" label="单位" align="left" prop="unit" />
|
||||
<!-- Operations -->
|
||||
<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="['bas:containerDetails:edit']"
|
||||
>修改</el-button>
|
||||
<!-- Delete button -->
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:containerDetails: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"
|
||||
/>
|
||||
|
||||
<!-- Add or Edit Container Details Dialog -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<!-- Container ID -->
|
||||
<el-form-item label="容器编号" prop="containerId">
|
||||
<el-input v-model="form.containerId" placeholder="请输入容器编号" disabled/>
|
||||
</el-form-item>
|
||||
<!-- Product ID -->
|
||||
<el-form-item label="品号" prop="productId">
|
||||
<el-input v-model="form.productId" placeholder="请输入品号" />
|
||||
</el-form-item>
|
||||
<!-- Product Name -->
|
||||
<el-form-item label="品名" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入品名" />
|
||||
</el-form-item>
|
||||
<!-- Quantity -->
|
||||
<el-form-item label="数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
<!-- Unit -->
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="备用" prop="spare1">
|
||||
<el-input v-model="form.spare1" :placeholder="请输入备用" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="备用" prop="spare2">
|
||||
<el-input v-model="form.spare2" :placeholder="请输入备用" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="备用" prop="spare3">
|
||||
<el-input v-model="form.spare3" :placeholder="请输入备用" />
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<!-- OK button -->
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
<!-- Cancel button -->
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listContainerDetails, getContainerDetails, delContainerDetails, addContainerDetails, updateContainerDetails } from "@/api/bas/containerDetails"
|
||||
|
||||
export default {
|
||||
name: "ContainerDetails",
|
||||
data() {
|
||||
return {
|
||||
// Loading overlay
|
||||
loading: true,
|
||||
// Selected IDs
|
||||
ids: [],
|
||||
// Single selection disabled
|
||||
single: true,
|
||||
// Multiple selection disabled
|
||||
multiple: true,
|
||||
// Show search conditions
|
||||
showSearch: true,
|
||||
// Total count
|
||||
total: 0,
|
||||
// Container details table data
|
||||
containerDetailsList: [],
|
||||
// Dialog title
|
||||
title: "",
|
||||
// Show dialog
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
containerId: null,
|
||||
productId: null,
|
||||
productName: null,
|
||||
quantity: null,
|
||||
unit: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
// 容器明细中的容器编号是否可更改
|
||||
containerIdIsEnabled: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询容器物料明细列表 */
|
||||
// getList() {
|
||||
// this.loading = true
|
||||
// listContainerDetails(this.queryParams).then(response => {
|
||||
// this.containerDetailsList = response.rows
|
||||
// this.total = response.total
|
||||
// this.loading = false
|
||||
// })
|
||||
// },
|
||||
/** @@@ 查询某个容器物料明细列表 */
|
||||
getList() {
|
||||
const containerId = this.$route.params.containerId
|
||||
this.loading = true
|
||||
listContainerDetails(this.queryParams).then(response => {
|
||||
// console.log('1111111111111111111111')
|
||||
// console.log(response)
|
||||
this.containerDetailsList = response.rows.filter(item => item.containerId === containerId)
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
containerId: null,
|
||||
productId: null,
|
||||
productName: null,
|
||||
quantity: null,
|
||||
unit: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
// 返回按钮
|
||||
handleClose() {
|
||||
const obj = { path: "/bas/container" }
|
||||
this.$tab.closeOpenPage(obj)
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
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.form.containerId = this.$route.params.containerId
|
||||
this.open = true
|
||||
// Title: Add Container Details
|
||||
this.title = "新增容器明细"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getContainerDetails(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
// Title: Edit Container Details
|
||||
this.title = "修改容器明细"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateContainerDetails(this.form).then(response => {
|
||||
// Success message: Modified successfully
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addContainerDetails(this.form).then(response => {
|
||||
// Success message: Added successfully
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
// Confirmation message: Are you sure you want to delete the container details with ID "ids"?
|
||||
this.$modal.confirm('是否确认删除容器明细编号为"' + ids + '"的数据?').then(function() {
|
||||
return delContainerDetails(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
// Success message: Deleted successfully
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/containerDetails/export', {
|
||||
...this.queryParams
|
||||
}, `containerDetails_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
337
ruoyi-ui/src/views/bas/knowledge/index.vue
Normal file
337
ruoyi-ui/src/views/bas/knowledge/index.vue
Normal file
@@ -0,0 +1,337 @@
|
||||
<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="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入知识库名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createdAt">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.createdAt"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择创建时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedAt">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.updatedAt"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否激活" prop="isActive">
|
||||
<el-select v-model="queryParams.isActive" placeholder="请选择是否激活" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.kw_active"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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:knowledge: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:knowledge: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:knowledge: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:knowledge:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="knowledgeList" @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="name" />
|
||||
<el-table-column label="知识库描述" align="center" prop="description" />
|
||||
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" align="center" prop="updatedAt" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否激活" align="center" prop="isActive">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.kw_active" :value="scope.row.isActive"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="['bas:knowledge:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:knowledge: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-item label="知识库名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入知识库名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="知识库描述" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="创建时间" prop="createdAt">
|
||||
<el-date-picker clearable
|
||||
v-model="form.createdAt"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择创建时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedAt">
|
||||
<el-date-picker clearable
|
||||
v-model="form.updatedAt"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="是否激活" prop="isActive">
|
||||
<el-select v-model="form.isActive" placeholder="请选择是否激活">
|
||||
<el-option
|
||||
v-for="dict in dict.type.kw_active"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="parseInt(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</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 { listKnowledge, getKnowledge, delKnowledge, addKnowledge, updateKnowledge } from "@/api/bas/knowledge"
|
||||
|
||||
export default {
|
||||
name: "Knowledge",
|
||||
dicts: ['kw_active'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 知识库主表格数据
|
||||
knowledgeList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
description: null,
|
||||
createdAt: null,
|
||||
updatedAt: null,
|
||||
isActive: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "知识库名称不能为空", trigger: "blur" }
|
||||
],
|
||||
createdAt: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
updatedAt: [
|
||||
{ required: true, message: "更新时间不能为空", trigger: "blur" }
|
||||
],
|
||||
isActive: [
|
||||
{ required: true, message: "是否激活不能为空", trigger: "change" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询知识库主列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listKnowledge(this.queryParams).then(response => {
|
||||
this.knowledgeList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
description: null,
|
||||
createdAt: null,
|
||||
updatedAt: null,
|
||||
isActive: 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
|
||||
getKnowledge(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) {
|
||||
updateKnowledge(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addKnowledge(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 delKnowledge(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/knowledge/export', {
|
||||
...this.queryParams
|
||||
}, `knowledge_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
462
ruoyi-ui/src/views/bas/model/index.vue
Normal file
462
ruoyi-ui/src/views/bas/model/index.vue
Normal file
@@ -0,0 +1,462 @@
|
||||
<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="tenantId">
|
||||
<el-input
|
||||
v-model="queryParams.tenantId"
|
||||
placeholder="请输入租户编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模型分类" prop="category">
|
||||
<el-select v-model="queryParams.category" placeholder="请选择模型分类" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.model_category"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="模型名称" prop="modelName">
|
||||
<el-input
|
||||
v-model="queryParams.modelName"
|
||||
placeholder="请输入模型名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模型描述" prop="modelDescribe">
|
||||
<el-input
|
||||
v-model="queryParams.modelDescribe"
|
||||
placeholder="请输入模型描述"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模型价格" prop="modelPrice">
|
||||
<el-input
|
||||
v-model="queryParams.modelPrice"
|
||||
placeholder="请输入模型价格"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计费类型" prop="modelType">
|
||||
<el-select v-model="queryParams.modelType" placeholder="请选择计费类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.model_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否显示" prop="modelShow">
|
||||
<el-select v-model="queryParams.modelShow" placeholder="请选择是否显示" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.model_show"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="系统提示词" prop="systemPrompt">
|
||||
<el-input
|
||||
v-model="queryParams.systemPrompt"
|
||||
placeholder="请输入系统提示词"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="请求地址" prop="apiHost">
|
||||
<el-input
|
||||
v-model="queryParams.apiHost"
|
||||
placeholder="请输入请求地址"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="密钥" prop="apiKey">
|
||||
<el-input
|
||||
v-model="queryParams.apiKey"
|
||||
placeholder="请输入密钥"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="请求后缀" prop="apiUrl">
|
||||
<el-input
|
||||
v-model="queryParams.apiUrl"
|
||||
placeholder="请输入请求后缀"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建部门" prop="createDept">
|
||||
<el-input
|
||||
v-model="queryParams.createDept"
|
||||
placeholder="请输入创建部门"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模型优先级(值越大优先级越高)" prop="priority">
|
||||
<el-input
|
||||
v-model="queryParams.priority"
|
||||
placeholder="请输入模型优先级(值越大优先级越高)"
|
||||
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:model: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:model: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:model: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:model:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="modelList" @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="tenantId" />
|
||||
<el-table-column label="模型分类" align="center" prop="category">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.model_category" :value="scope.row.category"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="模型名称" align="center" prop="modelName" />
|
||||
<el-table-column label="模型描述" align="center" prop="modelDescribe" />
|
||||
<el-table-column label="模型价格" align="center" prop="modelPrice" />
|
||||
<el-table-column label="计费类型" align="center" prop="modelType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.model_type" :value="scope.row.modelType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否显示" align="center" prop="modelShow">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.model_show" :value="scope.row.modelShow"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="系统提示词" align="center" prop="systemPrompt" />
|
||||
<el-table-column label="请求地址" align="center" prop="apiHost" />
|
||||
<el-table-column label="密钥" align="center" prop="apiKey" />
|
||||
<el-table-column label="请求后缀" align="center" prop="apiUrl" />
|
||||
<el-table-column label="创建部门" align="center" prop="createDept" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="模型优先级(值越大优先级越高)" align="center" prop="priority" />
|
||||
<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="['bas:model:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:model: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-item label="租户编号" prop="tenantId">
|
||||
<el-input v-model="form.tenantId" placeholder="请输入租户编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模型分类" prop="category">
|
||||
<el-select v-model="form.category" placeholder="请选择模型分类">
|
||||
<el-option
|
||||
v-for="dict in dict.type.model_category"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="模型名称" prop="modelName">
|
||||
<el-input v-model="form.modelName" placeholder="请输入模型名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模型描述" prop="modelDescribe">
|
||||
<el-input v-model="form.modelDescribe" placeholder="请输入模型描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模型价格" prop="modelPrice">
|
||||
<el-input v-model="form.modelPrice" placeholder="请输入模型价格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计费类型" prop="modelType">
|
||||
<el-select v-model="form.modelType" placeholder="请选择计费类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.model_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否显示" prop="modelShow">
|
||||
<el-select v-model="form.modelShow" placeholder="请选择是否显示">
|
||||
<el-option
|
||||
v-for="dict in dict.type.model_show"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="系统提示词" prop="systemPrompt">
|
||||
<el-input v-model="form.systemPrompt" placeholder="请输入系统提示词" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请求地址" prop="apiHost">
|
||||
<el-input v-model="form.apiHost" placeholder="请输入请求地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="密钥" prop="apiKey">
|
||||
<el-input v-model="form.apiKey" placeholder="请输入密钥" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请求后缀" prop="apiUrl">
|
||||
<el-input v-model="form.apiUrl" placeholder="请输入请求后缀" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建部门" prop="createDept">
|
||||
<el-input v-model="form.createDept" placeholder="请输入创建部门" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模型优先级(值越大优先级越高)" prop="priority">
|
||||
<el-input v-model="form.priority" 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 { listModel, getModel, delModel, addModel, updateModel } from "@/api/bas/model"
|
||||
|
||||
export default {
|
||||
name: "Model",
|
||||
dicts: ['model_show', 'model_type', 'model_category'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 聊天模型表格数据
|
||||
modelList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
tenantId: null,
|
||||
category: null,
|
||||
modelName: null,
|
||||
modelDescribe: null,
|
||||
modelPrice: null,
|
||||
modelType: null,
|
||||
modelShow: null,
|
||||
systemPrompt: null,
|
||||
apiHost: null,
|
||||
apiKey: null,
|
||||
apiUrl: null,
|
||||
createDept: null,
|
||||
priority: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询聊天模型列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listModel(this.queryParams).then(response => {
|
||||
this.modelList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
tenantId: null,
|
||||
category: null,
|
||||
modelName: null,
|
||||
modelDescribe: null,
|
||||
modelPrice: null,
|
||||
modelType: null,
|
||||
modelShow: null,
|
||||
systemPrompt: null,
|
||||
apiHost: null,
|
||||
apiKey: null,
|
||||
apiUrl: null,
|
||||
createDept: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
priority: 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
|
||||
getModel(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) {
|
||||
updateModel(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addModel(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 delModel(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/model/export', {
|
||||
...this.queryParams
|
||||
}, `model_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
502
ruoyi-ui/src/views/bas/port/index.vue
Normal file
502
ruoyi-ui/src/views/bas/port/index.vue
Normal file
@@ -0,0 +1,502 @@
|
||||
<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="portName">
|
||||
<el-input
|
||||
v-model="queryParams.portName"
|
||||
placeholder="请输入点位名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位分类" prop="portType">
|
||||
<el-select v-model="queryParams.portType" placeholder="请选择点位分类" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.port_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位描述" prop="portDesc">
|
||||
<el-input
|
||||
v-model="queryParams.portDesc"
|
||||
placeholder="请输入点位描述"
|
||||
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:port: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:port: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:port: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:port:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="portList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="ID" align="left" prop="id" />
|
||||
<el-table-column label="点位名称" align="left" prop="portName" />
|
||||
<el-table-column label="点位类型" align="left" prop="portType" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.port_type" :value="scope.row.portType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="点位描述" align="left" prop="portDesc" />
|
||||
<el-table-column label="创建人" align="left" prop="createMan" />
|
||||
<el-table-column label="创建时间" align="left" prop="createTime" />
|
||||
<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="['bas:port:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:port:remove']"
|
||||
>删除</el-button>
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-plus"
|
||||
@click="handleBindProduct(scope.row)"
|
||||
v-hasPermi="['bas:portProductRel:list']"
|
||||
>绑定物料</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-item label="点位名称" prop="portName">
|
||||
<el-input v-model="form.portName" placeholder="请输入点位名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="点位类型" prop="portType">
|
||||
<el-select v-model="form.portType" placeholder="请选择点位类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.port_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位描述" prop="portDesc">
|
||||
<el-input v-model="form.portDesc" 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>
|
||||
|
||||
<!-- 选择物料对话框 -->
|
||||
<el-dialog title="选择物料" :visible.sync="productSelectVisible" width="1300px" append-to-body>
|
||||
<el-form :model="queryProductParams" :inline="true" label-width="80px">
|
||||
<el-form-item label="品号" prop="productId">
|
||||
<el-input
|
||||
v-model="queryProductParams.productId"
|
||||
placeholder="请输入品号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="品名" prop="productName">
|
||||
<el-input
|
||||
v-model="queryProductParams.productName"
|
||||
placeholder="请输入品名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="绑定状态" prop="bindStatus">
|
||||
<el-select v-model="queryProductParams.bindStatus" placeholder="请选择绑定状态" clearable @change="handleProductQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.product_port_rel_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" v-hasPermi="['bas:portProdcutRel:list']" @click="handleProductQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetProductQuery">重置</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"
|
||||
v-if="queryProductParams.bindStatus === '0'"
|
||||
:disabled="selectedProducts.length === 0"
|
||||
@click="handleBatchBindProduct"
|
||||
v-hasPermi="['bas:portProductRel:add']"
|
||||
>批量绑定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
v-if="queryProductParams.bindStatus === '1'"
|
||||
:disabled="selectedProducts.length === 0"
|
||||
@click="handleBatchUnbindProduct"
|
||||
v-hasPermi="['bas:portProductRel:remove']"
|
||||
>批量解绑</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="productOptions" border @selection-change="handleProductSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="品号" align="left" prop="productId" />
|
||||
<el-table-column label="品名" align="left" prop="productName" />
|
||||
<el-table-column label="英文描述" align="left" prop="spare1"/>
|
||||
<el-table-column label="单位" align="left" prop="unit" />
|
||||
<el-table-column label="净重" align="right" prop="spare2" />
|
||||
<el-table-column label="箱号" align="left" prop="spare3" />
|
||||
<el-table-column label="包装方式" align="left" prop="spare4" />
|
||||
<el-table-column label="长度" align="right" prop="spare5" />
|
||||
<el-table-column label="宽度" align="right" prop="spare6" />
|
||||
<el-table-column label="高度" align="right" prop="spare7" />
|
||||
<el-table-column label="体积" align="right" prop="spare8" />
|
||||
<el-table-column label="价格" align="right" prop="price" />
|
||||
<el-table-column label="描述" align="left" prop="remark" />
|
||||
<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-plus"
|
||||
@click="handleBatchBindProduct(scope.row)"
|
||||
v-hasPermi="['bas:portProductRel:add']"
|
||||
v-if="queryProductParams.bindStatus === '0'"
|
||||
>绑定物料</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleBatchUnbindProduct(scope.row)"
|
||||
v-hasPermi="['bas:portProductRel:remove']"
|
||||
v-if="queryProductParams.bindStatus === '1'"
|
||||
>解绑物料</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="productTotal>0"
|
||||
:total="productTotal"
|
||||
:page.sync="queryProductParams.pageNum"
|
||||
:limit.sync="queryProductParams.pageSize"
|
||||
@pagination="getProductList"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPort, getPort, delPort, addPort, updatePort } from "@/api/bas/port"
|
||||
import {listPortProductRel, addPortProductRel, delPortProductRel} from "@/api/bas/portProductRel";
|
||||
|
||||
export default {
|
||||
name: "Port",
|
||||
dicts:['product_port_rel_status','port_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 物料选择对话框
|
||||
productSelectVisible: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
id:null,
|
||||
productIds:[],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
productMultiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
productTotal: 0,
|
||||
// 基础点位表格数据
|
||||
portList: [],
|
||||
// 物料信息表
|
||||
productOptions: [],
|
||||
// 已选物料
|
||||
selectedProducts: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
portName: null,
|
||||
portType: null,
|
||||
portDesc: null
|
||||
},
|
||||
queryProductParams:{
|
||||
pageNum: 1,
|
||||
pageSize: 5,
|
||||
bindStatus: null
|
||||
},
|
||||
|
||||
handleBindProduct(row){
|
||||
this.queryProductParams.bindStatus = '1';
|
||||
this.id = row.id;
|
||||
this.queryProductParams.portId = this.id;
|
||||
this.getProductList();
|
||||
this.productSelectVisible = true;
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
portName: [
|
||||
{ required: true, message: "点位名称不能为空", trigger: "blur" }
|
||||
],
|
||||
portType: [
|
||||
{ required: true, message: "点位分类不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询基础点位列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listPort(this.queryParams).then(response => {
|
||||
this.portList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
portName: null,
|
||||
portType: null,
|
||||
portDesc: null,
|
||||
createMan: null,
|
||||
createTime: 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
|
||||
getPort(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) {
|
||||
updatePort(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPort(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 delPort(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/port/export', {
|
||||
...this.queryParams
|
||||
}, `port_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 物料选择变更 */
|
||||
handleProductSelectionChange(selection) {
|
||||
this.selectedProducts = selection;
|
||||
this.productIds = selection.map(item => item.productId);
|
||||
this.productMultiple = !selection.length
|
||||
},
|
||||
/** 获取物料列表 */
|
||||
getProductList() {
|
||||
listPortProductRel(this.queryProductParams).then(response => {
|
||||
this.productOptions = response.rows;
|
||||
this.productTotal = response.total;
|
||||
});
|
||||
},
|
||||
/** 搜索物料按钮操作 */
|
||||
handleProductQuery() {
|
||||
this.queryProductParams.pageNum = 1;
|
||||
this.getProductList();
|
||||
},
|
||||
/** 重置物料查询操作 */
|
||||
resetProductQuery() {
|
||||
this.queryProductParams.bindStatus = '1';
|
||||
this.handleProductQuery();
|
||||
},
|
||||
/** 批量绑定物料按钮操作 */
|
||||
handleBatchBindProduct(row) {
|
||||
const productIds = row.productId || this.productIds
|
||||
let ids = [];
|
||||
if (Array.isArray(productIds)) {
|
||||
ids = productIds;
|
||||
} else {
|
||||
ids.push(productIds);
|
||||
}
|
||||
const data = {
|
||||
portId: this.id,
|
||||
productIds: ids
|
||||
}
|
||||
addPortProductRel(data).then(response => {
|
||||
this.$modal.msgSuccess("绑定成功")
|
||||
this.getProductList()
|
||||
});
|
||||
},
|
||||
/** 批量删除物料按钮操作 */
|
||||
handleBatchUnbindProduct(row){
|
||||
const productIds = row.productId || this.productIds
|
||||
let ids = [];
|
||||
if (Array.isArray(productIds)) {
|
||||
ids = productIds;
|
||||
} else {
|
||||
ids.push(productIds);
|
||||
}
|
||||
const data = {
|
||||
portId: this.id,
|
||||
productIds: ids
|
||||
}
|
||||
delPortProductRel(data).then(response => {
|
||||
this.$modal.msgSuccess("解绑成功")
|
||||
this.getProductList()
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
360
ruoyi-ui/src/views/bas/roadway/index.vue
Normal file
360
ruoyi-ui/src/views/bas/roadway/index.vue
Normal file
@@ -0,0 +1,360 @@
|
||||
<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="roadwayId">
|
||||
<el-input
|
||||
v-model="queryParams.roadwayId"
|
||||
placeholder="请输入巷道号"
|
||||
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:roadway: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:roadway: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:roadway: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:roadway:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="roadwayList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="巷道号" align="center" prop="roadwayId" />
|
||||
<!-- <el-table-column label="仓库id" align="center" prop="warehouseId" />-->
|
||||
<el-table-column label="巷道名称" align="center" prop="roadwayName" />
|
||||
<!-- <el-table-column label="设备id" align="center" prop="deviceId" />-->
|
||||
<el-table-column label="一层入库" align="center" prop="inLocked">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.roadway_lock" :value="scope.row.inLocked"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="一层出库" align="center" prop="outLocked">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.roadway_lock" :value="scope.row.outLocked"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="二层入库" align="center" prop="inLocked2">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.roadway_lock" :value="scope.row.inLocked2"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="二层出库" align="center" prop="outLocked2">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.roadway_lock" :value="scope.row.outLocked2"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="['bas:roadway:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:roadway: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-item label="巷道号" prop="roadwayId">
|
||||
<el-input v-model="form.roadwayId" placeholder="请输入巷道号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库id" prop="warehouseId">
|
||||
<el-input v-model="form.warehouseId" placeholder="请输入仓库id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="巷道名称" prop="roadwayName">
|
||||
<el-input v-model="form.roadwayName" placeholder="请输入巷道名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备id" prop="deviceId">
|
||||
<el-input v-model="form.deviceId" placeholder="请输入设备id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="一层入库" prop="inLocked">
|
||||
<el-select v-model="form.inLocked" placeholder="请选择一层入库锁">
|
||||
<el-option
|
||||
v-for="dict in dict.type.roadway_lock"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="一层出库" prop="outLocked">
|
||||
<el-select v-model="form.outLocked" placeholder="请选择一层出库锁">
|
||||
<el-option
|
||||
v-for="dict in dict.type.roadway_lock"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="二层入库" prop="inLocked2">
|
||||
<el-select v-model="form.inLocked2" placeholder="请选择二层入库锁">
|
||||
<el-option
|
||||
v-for="dict in dict.type.roadway_lock"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="二层出库" prop="outLocked2">
|
||||
<el-select v-model="form.outLocked2" placeholder="请选择二层出库锁">
|
||||
<el-option
|
||||
v-for="dict in dict.type.roadway_lock"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</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 { listRoadway, getRoadway, delRoadway, addRoadway, updateRoadway } from "@/api/bas/roadway"
|
||||
|
||||
export default {
|
||||
name: "Roadway",
|
||||
dicts: ['roadway_lock'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 巷道管理表格数据
|
||||
roadwayList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
roadwayId: null,
|
||||
warehouseId: null,
|
||||
roadwayName: null,
|
||||
deviceId: null,
|
||||
inLocked: null,
|
||||
outLocked: null,
|
||||
inLocked2: null,
|
||||
outLocked2: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "id不能为空", trigger: "blur" }
|
||||
],
|
||||
roadwayId: [
|
||||
{ required: true, message: "巷道号不能为空", trigger: "blur" }
|
||||
],
|
||||
warehouseId: [
|
||||
{ required: true, message: "仓库id不能为空", trigger: "blur" }
|
||||
],
|
||||
inLocked: [
|
||||
{ required: true, message: "一层入库锁不能为空", trigger: "change" }
|
||||
],
|
||||
outLocked: [
|
||||
{ required: true, message: "一层出库锁不能为空", trigger: "change" }
|
||||
],
|
||||
inLocked2: [
|
||||
{ required: true, message: "二层入库锁不能为空", trigger: "change" }
|
||||
],
|
||||
outLocked2: [
|
||||
{ required: true, message: "二层出库锁不能为空", trigger: "change" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询巷道管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listRoadway(this.queryParams).then(response => {
|
||||
this.roadwayList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
roadwayId: null,
|
||||
warehouseId: null,
|
||||
roadwayName: null,
|
||||
deviceId: null,
|
||||
inLocked: null,
|
||||
outLocked: null,
|
||||
inLocked2: null,
|
||||
outLocked2: 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
|
||||
getRoadway(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) {
|
||||
updateRoadway(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addRoadway(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 delRoadway(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/roadway/export', {
|
||||
...this.queryParams
|
||||
}, `roadway_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
429
ruoyi-ui/src/views/bas/traycode/index.vue
Normal file
429
ruoyi-ui/src/views/bas/traycode/index.vue
Normal file
@@ -0,0 +1,429 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" >
|
||||
<!-- <el-form-item label="格式ID" prop="formatId">-->
|
||||
<!--<!– <el-input-->
|
||||
<!-- v-model="queryParams.formatId"-->
|
||||
<!-- placeholder="请输入格式ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />–>-->
|
||||
<!-- <el-select v-model="queryParams.formatId" placeholder="请选择格式ID">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in traycodeFormatList"-->
|
||||
<!-- :key="item.id"-->
|
||||
<!-- :label="item.remarks"-->
|
||||
<!-- :value="item.id"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="条码" prop="trayCode">
|
||||
<el-input
|
||||
v-model="queryParams.trayCode"
|
||||
placeholder="请输入条码"
|
||||
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:traycode: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:traycode: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:traycode: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:traycode:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleBatchPrint"
|
||||
v-hasPermi="['bas:traycode:print']"
|
||||
>批量打印</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table ref="table" v-loading="loading" :data="traycodeList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="left" prop="id" width="120" />
|
||||
<!-- <el-table-column label="格式ID" align="left" prop="formatName" />-->
|
||||
<el-table-column label="条码" align="left" prop="trayCode" />
|
||||
<el-table-column label="Spare Field 1" align="center" prop="spare1" />
|
||||
<el-table-column label="Spare Field 2" align="center" prop="spare2" />
|
||||
<el-table-column label="Spare Field 3" align="center" prop="spare3" />
|
||||
<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="['bas:traycode:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:traycode:remove']"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-printer"
|
||||
@click="printBarcode(scope.row)"
|
||||
v-hasPermi="['bas:traycode:print']"
|
||||
>打印</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="100px">
|
||||
<!-- <el-form-item label="格式ID" prop="formatId">
|
||||
<el-select v-model="form.formatId" placeholder="请选择格式ID">
|
||||
<el-option
|
||||
v-for="item in traycodeFormatList"
|
||||
:key="item.id"
|
||||
:label="item.remarks"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="托盘编码" prop="trayCode">
|
||||
|
||||
<el-input v-model="form.trayCode" placeholder="请输入托盘编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Spare Field 1" prop="spare1">
|
||||
<el-input v-model="form.spare1" placeholder="Enter spare field 1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Spare Field 2" prop="spare2">
|
||||
<el-input v-model="form.spare2" placeholder="Enter spare field 2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Spare Field 3" prop="spare3">
|
||||
<el-input v-model="form.spare3" placeholder="Enter spare field 3" />
|
||||
</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>
|
||||
|
||||
|
||||
<!-- 打印模板 -->
|
||||
<vue-easy-print v-show="true" ref="easyPrint2">
|
||||
<div v-for="item in printData" :key="item.id" style="page-break-after:always" class="vue-easy-print">
|
||||
<vue-qr :text='item.trayCode' :size="150" :margin="10" :align-item="center" :correctLevel="2"></vue-qr>
|
||||
<div>
|
||||
<span class="num">{{ item.trayCode }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</vue-easy-print>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listTraycode, getTraycode, delTraycode, addTraycode, updateTraycode } from "@/api/bas/traycode"
|
||||
import { listTraycodeFormat } from "@/api/bas/traycodeFormat"
|
||||
import vueEasyPrint from 'vue-easy-print'
|
||||
import VueQr from 'vue-qr'
|
||||
|
||||
|
||||
export default {
|
||||
name: "Traycode",
|
||||
components: {
|
||||
vueEasyPrint,
|
||||
VueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 设置标题
|
||||
title: this.$t('traycode.title'),
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 条码信息表格数据
|
||||
traycodeList: [],
|
||||
traycodeFormatList: [],
|
||||
printData:[],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
formatId: null,
|
||||
trayCode: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null
|
||||
},
|
||||
queryTrayCodeFormatParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 99,
|
||||
},
|
||||
// Form parameters
|
||||
form: {},
|
||||
// Form validation
|
||||
rules: {
|
||||
formatId: [
|
||||
{ required: true, message: "请输入格式ID", trigger: "blur" }
|
||||
],
|
||||
trayCode: [
|
||||
{ required: true, message: "请输入托盘编码", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTrayCodeFormatList()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询条码信息列表 */
|
||||
getTrayCodeFormatList() {
|
||||
this.loading = true
|
||||
listTraycodeFormat(this.queryTrayCodeFormatParams).then(response => {
|
||||
this.traycodeFormatList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/** 查询条码信息列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listTraycode(this.queryParams).then(response => {
|
||||
this.traycodeList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
formatId: null,
|
||||
trayCode: null,
|
||||
createTime: null,
|
||||
updateTime: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: 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
|
||||
getTraycode(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) {
|
||||
updateTraycode(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addTraycode(this.form).then(response => {
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除选中的数据项?').then(function() {
|
||||
return delTraycode(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/traycode/export', {
|
||||
...this.queryParams
|
||||
}, `traycode_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 打印条码 */
|
||||
printBarcode: function (row) {
|
||||
this.printData = [row]
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.$refs.easyPrint2.print()
|
||||
}, 100)
|
||||
})
|
||||
},
|
||||
/** 批量打印按钮操作 */
|
||||
handleBatchPrint() {
|
||||
const selection = this.$refs.table.selection;
|
||||
if (selection.length === 0) {
|
||||
this.$modal.msgError("请选择要打印的数据项");
|
||||
return;
|
||||
}
|
||||
this.printData = selection;
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.$refs.easyPrint2.print()
|
||||
}, 100)
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 打印样式 */
|
||||
.vue-easy-print {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.num {
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
margin-top: 15px;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
.vue-qr {
|
||||
display: block;
|
||||
margin: 20px auto;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
@media print {
|
||||
@page {
|
||||
size: A4;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.vue-easy-print {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 14px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.vue-qr {
|
||||
margin: 10px auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
449
ruoyi-ui/src/views/bas/traycodeFormat/index.vue
Normal file
449
ruoyi-ui/src/views/bas/traycodeFormat/index.vue
Normal file
@@ -0,0 +1,449 @@
|
||||
<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="barcodeFormat">
|
||||
<el-input
|
||||
v-model="queryParams.barcodeFormat"
|
||||
placeholder="请输入条码格式"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="序列规则" prop="serialRule">
|
||||
<el-input
|
||||
v-model="queryParams.serialRule"
|
||||
placeholder="请输入序列规则"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="Serial Example" prop="serialExample">
|
||||
<el-input
|
||||
v-model="queryParams.serialExample"
|
||||
placeholder="Enter serial example"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input
|
||||
v-model="queryParams.remarks"
|
||||
placeholder="请输入备注"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="最小值" prop="minNum">
|
||||
<el-input
|
||||
v-model="queryParams.minNum"
|
||||
placeholder="请输入最小值"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大值" prop="maxNum">
|
||||
<el-input
|
||||
v-model="queryParams.maxNum"
|
||||
placeholder="请输入最大值"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="Spare 1" prop="spare1">
|
||||
<el-input
|
||||
v-model="queryParams.spare1"
|
||||
placeholder="Enter spare 1"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="Spare 2" prop="spare2">
|
||||
<el-input
|
||||
v-model="queryParams.spare2"
|
||||
placeholder="Enter spare 2"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="Spare 3" prop="spare3">
|
||||
<el-input
|
||||
v-model="queryParams.spare3"
|
||||
placeholder="Enter spare 3"
|
||||
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:traycodeFormat: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:traycodeFormat: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:traycodeFormat: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:traycodeFormat:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handlePrint"
|
||||
v-hasPermi="['bas:traycodeFormat:createPrintData']"
|
||||
>打印</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="traycodeFormatList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="left" prop="id" />
|
||||
<el-table-column label="条码格式" align="left" prop="barcodeFormat" />
|
||||
<el-table-column label="序列示例" align="left" prop="serialExample" />
|
||||
<el-table-column label="备注" align="left" prop="remarks" />
|
||||
<el-table-column label="序列规则" align="right" prop="serialRule" />
|
||||
<el-table-column label="最小值" align="right" prop="minNum" />
|
||||
<el-table-column label="最大值" align="right" prop="maxNum" />
|
||||
<el-table-column label="备用1" align="right" prop="spare1" />
|
||||
<!-- <el-table-column label="Spare 2" align="center" prop="spare2" /> -->
|
||||
<!-- <el-table-column label="Spare 3" align="center" prop="spare3" /> -->
|
||||
<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="['bas:traycodeFormat:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:traycodeFormat: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="100px">
|
||||
<el-form-item label="条码格式" prop="barcodeFormat">
|
||||
<el-input v-model="form.barcodeFormat" placeholder="请输入条码格式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="序列规则" prop="serialRule">
|
||||
<el-input v-model="form.serialRule" placeholder="请输入序列规则" />
|
||||
</el-form-item>
|
||||
<el-form-item label="序列示例" prop="serialExample">
|
||||
<el-input v-model="form.serialExample" placeholder="请输入序列示例" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input v-model="form.remarks" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="最小值" prop="minNum">
|
||||
<el-input v-model="form.minNum" placeholder="请输入最小值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="最大值" prop="maxNum">
|
||||
<el-input v-model="form.maxNum" placeholder="请输入最大值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用1" prop="spare1">
|
||||
<el-input v-model="form.spare1" placeholder="请输入备用1" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="Spare 2" prop="spare2">
|
||||
<el-input v-model="form.spare2" placeholder="Enter spare 2" />
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="Spare 3" prop="spare3">
|
||||
<el-input v-model="form.spare3" placeholder="Enter spare 3" />
|
||||
</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>
|
||||
<!-- 打印条码数量输入对话框 -->
|
||||
<el-dialog title="打印条码" :visible.sync="printDialogVisible" width="400px" append-to-body>
|
||||
<el-form ref="printForm" :model="printForm" label-width="100px">
|
||||
<el-form-item label="打印数量" prop="printCount">
|
||||
<el-input-number v-model="printForm.printCount" :min="1" :max="maxPrintCount" placeholder="请输入打印数量" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitPrint">确定</el-button>
|
||||
<el-button @click="cancelPrint">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listTraycodeFormat, getTraycodeFormat, delTraycodeFormat, addTraycodeFormat, updateTraycodeFormat } from "@/api/bas/traycodeFormat"
|
||||
import {getLodop} from "@/plugins/LodopFuncs.js"
|
||||
export default {
|
||||
name: "TraycodeFormat",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 条码生成规则表格数据
|
||||
traycodeFormatList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
barcodeFormat: null,
|
||||
serialRule: null,
|
||||
serialExample: null,
|
||||
remarks: null,
|
||||
minNum: null,
|
||||
maxNum: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
barcodeFormat: [
|
||||
{ required: true, message: this.$t('traycodeFormat.placeholder.barcodeFormat'), trigger: "blur" }
|
||||
],
|
||||
remarks: [
|
||||
{ required: true, message: this.$t('traycodeFormat.placeholder.remarks'), trigger: "blur" }
|
||||
],
|
||||
minNum: [
|
||||
{ required: true, message: this.$t('traycodeFormat.placeholder.minNum'), trigger: "blur" }
|
||||
],
|
||||
maxNum: [
|
||||
{ required: true, message: this.$t('traycodeFormat.placeholder.maxNum'), trigger: "blur" }
|
||||
]
|
||||
},
|
||||
// 打印对话框显示状态
|
||||
printDialogVisible: false,
|
||||
// 打印表单参数
|
||||
printForm: {
|
||||
printCount: 1,
|
||||
},
|
||||
selectData:{
|
||||
|
||||
},
|
||||
// 最大可打印数量
|
||||
maxPrintCount: 1000,
|
||||
// 当前选中的条码规则
|
||||
currentRule: null,
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询条码生成规则列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listTraycodeFormat(this.queryParams).then(response => {
|
||||
this.traycodeFormatList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
barcodeFormat: null,
|
||||
serialRule: null,
|
||||
serialExample: null,
|
||||
remarks: null,
|
||||
minNum: null,
|
||||
maxNum: null,
|
||||
createTime: null,
|
||||
updateTime: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: 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
|
||||
this.selectData = selection
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = '新增条码格式'
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getTraycodeFormat(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) {
|
||||
updateTraycodeFormat(this.form).then(response => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addTraycodeFormat(this.form).then(response => {
|
||||
this.$modal.msgSuccess('添加成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('删除条码格式', { id: ids }).then(function() {
|
||||
return delTraycodeFormat(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/traycodeFormat/export', {
|
||||
...this.queryParams
|
||||
}, `traycodeFormat_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 打印按钮操作 */
|
||||
handlePrint(row) {
|
||||
this.printDialogVisible = true;
|
||||
},
|
||||
// 取消打印
|
||||
cancelPrint() {
|
||||
this.printDialogVisible = false;
|
||||
this.printForm.printCount = 0;
|
||||
},
|
||||
// 提交打印
|
||||
submitPrint() {
|
||||
|
||||
var printData = {
|
||||
id: this.selectData[0].id,
|
||||
serialRule: Number(this.selectData[0].serialRule) + Number(this.printForm.printCount),
|
||||
};
|
||||
|
||||
if (Number(this.printForm.printCount)+Number(this.selectData[0].serialRule)-1>this.selectData[0].maxNum){
|
||||
this.$modal.msgError('生成打印数据失败')
|
||||
return
|
||||
}
|
||||
updateTraycodeFormat(printData).then(response => {
|
||||
this.$modal.msgSuccess('生成打印数据成功')
|
||||
this.printDialogVisible = false;
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</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>
|
||||
465
ruoyi-ui/src/views/bas/warehouse/index.vue
Normal file
465
ruoyi-ui/src/views/bas/warehouse/index.vue
Normal file
@@ -0,0 +1,465 @@
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" :label-width="labelWidthForSearch">
|
||||
<!-- 仓库编号 -->
|
||||
<el-form-item label="仓库编号" prop="warehouseNo">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseNo"
|
||||
placeholder="请输入仓库编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 项目编号 -->
|
||||
<el-form-item label="项目编号" prop="projectNo">
|
||||
<el-input
|
||||
v-model="queryParams.projectNo"
|
||||
placeholder="请输入项目编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 仓库名称 -->
|
||||
<el-form-item label="仓库名称" prop="warehouseName">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseName"
|
||||
placeholder="请输入仓库名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 仓库地址 -->
|
||||
<!-- <el-form-item :label="$t('warehouse.address')" prop="address">
|
||||
<el-input
|
||||
v-model="queryParams.address"
|
||||
:placeholder="$t('warehouse.placeholderAddress')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- 备注 -->
|
||||
<!-- <el-form-item :label="$t('warehouse.cDesc')" prop="cDesc">
|
||||
<el-input
|
||||
v-model="queryParams.cDesc"
|
||||
:placeholder="$t('warehouse.placeholderCDesc')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- 仓库级别 -->
|
||||
<!-- <el-form-item :label="$t('warehouse.warehouseKind')" prop="warehouseKind">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseKind"
|
||||
:placeholder="$t('warehouse.placeholderWarehouseKind')"
|
||||
clearable
|
||||
maxlength="2"
|
||||
show-word-limit
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- 仓库是否可用 -->
|
||||
<el-form-item label="是否可用" prop="isCurrent">
|
||||
<el-select v-model="queryParams.isCurrent" placeholder="请选择是否可用" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="仓库类型" prop="warehouseType">
|
||||
<el-select v-model="queryParams.warehouseType" placeholder="请选择仓库类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.warehouse_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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:warehouse: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:warehouse: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:warehouse: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:warehouse:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="warehouseList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- 仓库ID(序号) -->
|
||||
<el-table-column label="仓库ID" align="left" prop="warehouseId" width="120"/>
|
||||
<!-- 仓库编号 -->
|
||||
<el-table-column label="仓库编号" align="left" prop="warehouseNo" />
|
||||
<!-- 项目编号 -->
|
||||
<el-table-column label="项目编号" align="left" prop="projectNo" />
|
||||
<!-- 仓库名称 -->
|
||||
<el-table-column label="仓库名称" align="left" prop="warehouseName" />
|
||||
<!-- 仓库地址 -->
|
||||
<el-table-column label="仓库地址" align="left" prop="address" />
|
||||
<!-- 备注 -->
|
||||
<el-table-column label="备注" align="left" prop="cdesc" />
|
||||
<!-- 仓库级别 -->
|
||||
<el-table-column label="仓库级别" align="left" prop="warehouseKind" />
|
||||
<!-- 仓库类型 -->
|
||||
<el-table-column label="仓库类型" align="left" prop="warehouseType" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.warehouse_type" :value="scope.row.warehouseType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 仓库是否可用 -->
|
||||
<el-table-column label="是否可用" align="left" prop="isCurrent">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isCurrent"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 操作 -->
|
||||
<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="['bas:warehouse:edit']"
|
||||
>修改</el-button>
|
||||
<!-- 操作---【删除】按钮 -->
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:warehouse: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="labelWidthForFunction">
|
||||
<!-- 仓库ID(序号) -->
|
||||
<el-form-item label="仓库ID" prop="warehouseId">
|
||||
<el-input v-model="form.warehouseId" placeholder="请输入仓库ID" :disabled="isDisabledForId"/>
|
||||
</el-form-item>
|
||||
<!-- 仓库编号 -->
|
||||
<el-form-item label="仓库编号" prop="warehouseNo">
|
||||
<el-input v-model="form.warehouseNo" placeholder="请输入仓库编号" />
|
||||
</el-form-item>
|
||||
<!-- 项目编号 -->
|
||||
<el-form-item label="项目编号" prop="projectNo">
|
||||
<el-input v-model="form.projectNo" placeholder="请输入项目编号" />
|
||||
</el-form-item>
|
||||
<!-- 仓库名称 -->
|
||||
<el-form-item label="仓库名称" prop="warehouseName">
|
||||
<el-input v-model="form.warehouseName" 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="cDesc">
|
||||
<el-input v-model="form.cdesc" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<!-- 仓库级别 -->
|
||||
<el-form-item label="仓库级别" prop="warehouseKind">
|
||||
<el-input
|
||||
v-model="form.warehouseKind"
|
||||
placeholder="请输入仓库级别"
|
||||
maxlength="2"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 仓库类型 -->
|
||||
<el-form-item label="仓库类型" prop="warehouseType">
|
||||
<el-select v-model="form.warehouseType" placeholder="请选择仓库类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.warehouse_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 仓库是否可用 -->
|
||||
<el-form-item label="是否可用" prop="isCurrent">
|
||||
<el-select v-model="form.isCurrent" placeholder="请选择是否可用">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</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 { listWarehouse, getWarehouse, delWarehouse, addWarehouse, updateWarehouse } from "@/api/bas/warehouse"
|
||||
|
||||
export default {
|
||||
name: "Warehouse",
|
||||
dicts: ['sys_yes_no','warehouse_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 仓库管理表格数据
|
||||
warehouseList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
warehouseId: null,
|
||||
warehouseNo: null,
|
||||
projectNo: null,
|
||||
warehouseName: null,
|
||||
address: null,
|
||||
cDesc: null,
|
||||
warehouseKind: null,
|
||||
warehouseType: null,
|
||||
isCurrent: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
warehouseId: [
|
||||
// 校验---序号是否为空
|
||||
{ required: true, message: "仓库ID不能为空", trigger: "blur" }
|
||||
],
|
||||
warehouseNo: [
|
||||
// 校验---仓库编号是否为空
|
||||
{ required: true, message: "仓库编号不能为空", trigger: "blur" }
|
||||
],
|
||||
warehouseName: [
|
||||
// 校验---仓库名称是否为空
|
||||
{ required: true, message: "仓库名称不能为空", trigger: "blur" }
|
||||
],
|
||||
isCurrent: [
|
||||
// 校验---仓库是否可用选项是否为空
|
||||
{ required: true, message: "是否可用不能为空", trigger: "change" }
|
||||
],
|
||||
warehouseKind: [
|
||||
// 校验---仓库级别长度限制
|
||||
{ max: 2, message: "仓库级别不能超过2个字符", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
|
||||
//修改【仓库管理】界面id文本框是否可交互
|
||||
isDisabledForId: false,
|
||||
// 打开窗口标题
|
||||
// boxAddTitle: $t('warehouse.addWarehouseItem'),
|
||||
// // 功能框标签尺寸
|
||||
// labelWidthForFunction: "120px"
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询仓库管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listWarehouse(this.queryParams).then(response => {
|
||||
this.warehouseList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
warehouseId: null,
|
||||
warehouseNo: null,
|
||||
projectNo: null,
|
||||
warehouseName: null,
|
||||
address: null,
|
||||
cdesc: null,
|
||||
warehouseKind: null,
|
||||
warehouseType: null,
|
||||
isCurrent: 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.warehouseId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
//---------------------------------
|
||||
this.isDisabledForId = false
|
||||
this.open = true
|
||||
this.title = "添加仓库"
|
||||
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
//---------------------------------
|
||||
this.isDisabledForId = true
|
||||
|
||||
this.reset()
|
||||
const warehouseId = row.warehouseId || this.ids
|
||||
getWarehouse(warehouseId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改仓库"
|
||||
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.title === "修改仓库") {
|
||||
updateWarehouse(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
if (this.title === "添加仓库") {
|
||||
addWarehouse(this.form).then(response => {
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const warehouseIds = row.warehouseId || this.ids
|
||||
this.$modal.confirm('是否确认删除仓库编号为"' + warehouseIds + '"的数据项?').then(function() {
|
||||
return delWarehouse(warehouseIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/warehouse/export', {
|
||||
...this.queryParams
|
||||
}, `warehouse_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user