This commit is contained in:
朱文强 2024-06-13 09:14:50 +08:00
parent 404c5fe121
commit 30ed83a8c2
6 changed files with 639 additions and 0 deletions

View File

@ -0,0 +1,68 @@
/*
* @Author: zwq
* @Date: 2023-08-22 14:50:15
* @LastEditors: zwq
* @LastEditTime: 2024-06-11 14:48:15
* @Description:
*/
import request from '@/utils/request'
// 创建立库仓库
export function createEquipment(data) {
return request({
url: '/asrs/equipment/create',
method: 'post',
data: data
})
}
// 更新立库仓库
export function updateEquipment(data) {
return request({
url: '/asrs/equipment/update',
method: 'put',
data: data
})
}
// 获得仓库code
export function getCode() {
return request({
url: '/asrs/equipment/getCode',
method: 'post'
})
}
// 删除立库仓库
export function deleteEquipment(id) {
return request({
url: '/asrs/equipment/delete?id=' + id,
method: 'delete'
})
}
// 获得立库仓库
export function getEquipment(id) {
return request({
url: '/asrs/equipment/get?id=' + id,
method: 'get'
})
}
// 获得立库仓库分页
export function getEquipmentPage(query) {
return request({
url: '/asrs/equipment/page',
method: 'get',
params: query
})
}
// 导出立库仓库 Excel
export function exportEquipmentExcel(query) {
return request({
url: '/asrs/equipment/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,68 @@
/*
* @Author: zwq
* @Date: 2023-08-22 14:50:15
* @LastEditors: zwq
* @LastEditTime: 2024-06-11 14:48:15
* @Description:
*/
import request from '@/utils/request'
// 创建立库仓库
export function createEquipmentType(data) {
return request({
url: '/asrs/equipment-type/create',
method: 'post',
data: data
})
}
// 更新立库仓库
export function updateEquipmentType(data) {
return request({
url: '/asrs/equipment-type/update',
method: 'put',
data: data
})
}
// 获得仓库code
export function getCode() {
return request({
url: '/asrs/equipment-type/getCode',
method: 'post'
})
}
// 删除立库仓库
export function deleteEquipmentType(id) {
return request({
url: '/asrs/equipment-type/delete?id=' + id,
method: 'delete'
})
}
// 获得立库仓库
export function getEquipmentType(id) {
return request({
url: '/asrs/equipment-type/get?id=' + id,
method: 'get'
})
}
// 获得立库仓库分页
export function getEquipmentTypePage(query) {
return request({
url: '/asrs/equipment-type/page',
method: 'get',
params: query
})
}
// 导出立库仓库 Excel
export function exportEquipmentTypeExcel(query) {
return request({
url: '/asrs/equipment-type/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,108 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2024-06-11 15:14:28
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px">
<el-form-item label="设备名称" prop="equipmentName">
<el-input
v-model="dataForm.equipmentName"
clearable
placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="设备编码" prop="equipmentCode">
<el-input
v-model="dataForm.equipmentCode"
clearable
placeholder="请输入设备编码" />
</el-form-item>
<el-form-item label="设备类型" prop="typeId">
<el-select
v-model="dataForm.typeId"
clearable
@change="setInfo"
placeholder="请选择设备类型">
<el-option
v-for="item in urlOptions.optionArr.arr0"
:key="item.id"
:label="item.typeName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备数量" prop="equipmentNumber">
<el-input-number
v-model="dataForm.equipmentNumber"
:min="0"
placeholder="请输入设备数量" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../mixins/basic-add';
import {
createEquipment,
updateEquipment,
getEquipment,
} from '@/api/oth/equipmentList';
import { getEquipmentTypePage } from '@/api/oth/equipmentType';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
createURL: createEquipment,
updateURL: updateEquipment,
infoURL: getEquipment,
getOption: true,
optionArrUrl: [getEquipmentTypePage],
},
dataForm: {
id: undefined,
equipmentName: undefined,
equipmentCode: undefined,
typeId: undefined,
equipmentNumber: undefined,
remark: undefined,
typeCode: undefined,
typeName: undefined,
},
dataRule: {
equipmentName: [
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
],
equipmentCode: [
{ required: true, message: '设备编码不能为空', trigger: 'blur' },
],
typeId: [
{ required: true, message: '设备类型不能为空', trigger: 'change' },
],
equipmentNumber: [
{ required: true, message: '设备数量不能为空', trigger: 'blur' },
],
},
};
},
methods: {
setInfo(id) {
const info = this.urlOptions.optionArr.arr0.find(
(item) => item.id === id
);
this.dataForm.typeCode = info.typeCode;
this.dataForm.typeName = info.typeName;
},
},
};
</script>

View File

@ -0,0 +1,169 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"/>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import {
deleteEquipment,
getEquipmentPage,
} from '@/api/oth/equipmentList';
const tableProps = [
{
prop: 'equipmentName',
label: '设备名称',
},
{
prop: 'equipmentCode',
label: '设备编码',
},
{
prop: 'typeName',
label: '设备类型',
},
{
prop: 'typeCode',
label: '设备类型编码',
},
{
prop: 'equipmentNumber',
label: '设备数量',
},
{
prop: 'user',
label: '创建人',
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getEquipmentPage,
deleteURL: deleteEquipment,
},
tableProps,
tableBtn: [{
type: 'edit',
btnName: '编辑',
},{
type: 'delete',
btnName: '删除',
},
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '设备名称',
placeholder: '设备名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: 'button',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.equipmentName = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,69 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2024-06-11 14:52:04
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px">
<el-form-item label="设备类型" prop="typeName">
<el-input
v-model="dataForm.typeName"
clearable
placeholder="请输入设备类型" />
</el-form-item>
<el-form-item label="设备类型编码" prop="typeCode">
<el-input
v-model="dataForm.typeCode"
clearable
placeholder="请输入设备类型编码" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../mixins/basic-add';
import {
createEquipmentType,
updateEquipmentType,
getEquipmentType,
getCode,
} from '@/api/oth/equipmentType';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
createURL: createEquipmentType,
updateURL: updateEquipmentType,
infoURL: getEquipmentType,
},
dataForm: {
id: undefined,
typeName: undefined,
typeCode: undefined,
remark: undefined,
},
dataRule: {
typeName: [
{ required: true, message: '设备类型不能为空', trigger: 'blur' },
],
typeCode: [
{ required: true, message: '设备类型编码不能为空', trigger: 'blur' },
],
},
};
},
methods: {},
};
</script>

View File

@ -0,0 +1,157 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"/>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import {
deleteEquipmentType,
getEquipmentTypePage,
} from '@/api/oth/equipmentType';
const tableProps = [
{
prop: 'typeName',
label: '设备类型',
},
{
prop: 'typeCode',
label: '设备类型编码',
},
{
prop: 'user',
label: '创建人',
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getEquipmentTypePage,
deleteURL: deleteEquipmentType,
},
tableProps,
tableBtn: [{
type: 'edit',
btnName: '编辑',
},{
type: 'delete',
btnName: '删除',
},
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '设备类型',
placeholder: '设备类型',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: 'button',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.typeName = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>