更新
This commit is contained in:
65
src/views/asrs/warehouseStorehouseStorage/SmallTitle.vue
Normal file
65
src/views/asrs/warehouseStorehouseStorage/SmallTitle.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 15:27:31
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-08-01 16:25:54
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :class="[className, { 'p-0': noPadding }]">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
size: {
|
||||
// 取值范围: xl lg md sm
|
||||
type: String,
|
||||
default: 'de',
|
||||
validator: function (val) {
|
||||
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
|
||||
},
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
className: function () {
|
||||
return `${this.size}-title`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
|
||||
$mgr: 8px;
|
||||
@each $size, $height in $pxls {
|
||||
.#{$size}-title {
|
||||
font-size: 18px;
|
||||
line-height: $height;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: $height + 2px;
|
||||
border-radius: 1px;
|
||||
margin-right: $mgr;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
375
src/views/asrs/warehouseStorehouseStorage/add-or-updata.vue
Normal file
375
src/views/asrs/warehouseStorehouseStorage/add-or-updata.vue
Normal file
@@ -0,0 +1,375 @@
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">仓库信息</small-title>
|
||||
|
||||
<div class="content">
|
||||
<div class="visual-part">
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
label-width="100px"
|
||||
label-position="top"
|
||||
@keyup.enter.native="dataFormSubmit">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓库编码" prop="code">
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
readonly
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入仓库编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓库名" prop="name">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
readonly
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入仓库名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工序" prop="processId">
|
||||
<el-select
|
||||
v-model="dataForm.processId"
|
||||
style="width: 100%"
|
||||
:disabled="isdetail"
|
||||
placeholder="请选择工序">
|
||||
<el-option
|
||||
v-for="item in processArr"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
产品信息
|
||||
</small-title>
|
||||
|
||||
<div class="attr-list">
|
||||
<base-table
|
||||
:table-props="
|
||||
propType === 1 ? [...tableProps, ...tableProps1] : tableProps
|
||||
"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:add-button-show="addButtonShow"
|
||||
@emitButtonClick="addNew"
|
||||
:table-data="productAttributeList">
|
||||
<method-btn
|
||||
v-if="!isdetail"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="position: absolute; bottom: 24px; right: 24px">
|
||||
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
|
||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
<span v-if="!isdetail">
|
||||
<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
|
||||
<!-- <el-button
|
||||
v-if="dataForm.id && !isdetail"
|
||||
type="primary"
|
||||
@click="addNew()">
|
||||
添加属性
|
||||
</el-button> -->
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<product-attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:warehouse-id="dataForm.id"
|
||||
@refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
updateProduct,
|
||||
} from '@/api/core/base/product';
|
||||
|
||||
import {
|
||||
getWarehouseStorehouseGoodsSpecificationPage,
|
||||
deleteWarehouseStorehouseGoodsSpecification,
|
||||
} from '@/api/asrs/warehouseStorehouseGoodsSpecification';
|
||||
import productAttrAdd from './attr-add';
|
||||
import { parseTime } from '../mixins/code-filter';
|
||||
import codeFilter from '../mixins/code-filter';
|
||||
import SmallTitle from './SmallTitle';
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'goodSpecificationName',
|
||||
label: '产品名',
|
||||
},
|
||||
{
|
||||
prop: 'goodSpecificationCode',
|
||||
label: '产品编码',
|
||||
},
|
||||
{
|
||||
prop: 'goodSpecificationName1',
|
||||
label: '产品规格',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'number',
|
||||
label: '数量',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'quality',
|
||||
label: '品质',
|
||||
align: 'center',
|
||||
filter: codeFilter('quality'),
|
||||
},
|
||||
{
|
||||
prop: 'cureTime',
|
||||
label: '需要熟化时间(小时)',
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps1 = [
|
||||
{
|
||||
prop: 'number',
|
||||
label: '数量',
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
const processArr = [
|
||||
{
|
||||
name: '开始',
|
||||
id: 0,
|
||||
},
|
||||
{
|
||||
name: '一次分切后',
|
||||
id: 1,
|
||||
},
|
||||
{
|
||||
name: '一次分拣后',
|
||||
id: 2,
|
||||
},
|
||||
{
|
||||
name: '二次分切后',
|
||||
id: 3,
|
||||
},
|
||||
{
|
||||
name: '二次分拣后',
|
||||
id: 4,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
components: { productAttrAdd, SmallTitle },
|
||||
props: {
|
||||
propType: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
addOrUpdateVisible: false,
|
||||
tableBtn,
|
||||
tableProps,
|
||||
tableProps1,
|
||||
productAttributeList: [],
|
||||
addButtonShow: '新增',
|
||||
processArr,
|
||||
dataForm: {
|
||||
id: null,
|
||||
name: '',
|
||||
code: '',
|
||||
processId: '',
|
||||
},
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
},
|
||||
dataRule: {
|
||||
// name: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: '产品名称不能为空',
|
||||
// trigger: 'blur',
|
||||
// },
|
||||
// ],
|
||||
},
|
||||
isdetail: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
this.productAttributeList.splice(0);
|
||||
},
|
||||
init(val, isdetail) {
|
||||
this.dataForm.name = val.warehouseName
|
||||
this.dataForm.code = val.warehouseCode
|
||||
this.dataForm.processId = val.process
|
||||
let id = val.id
|
||||
this.initData();
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || null;
|
||||
this.visible = true;
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取产品详情
|
||||
// 获取产品的属性列表
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getList() {
|
||||
// 获取产品的属性列表
|
||||
const params = {
|
||||
pageSize: 100,
|
||||
pageNo: 1,
|
||||
warehouseStorehouseId: this.dataForm.id,
|
||||
};
|
||||
getWarehouseStorehouseGoodsSpecificationPage(params).then((response) => {
|
||||
this.productAttributeList = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.name
|
||||
? '[名称=' + raw.data.name + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteWarehouseStorehouseGoodsSpecification(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateProduct(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
goEdit() {
|
||||
this.isdetail = false;
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
this.initData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.drawer >>> .content {
|
||||
padding: 0 24px 30px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 76vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
}
|
||||
|
||||
.drawer >>> .el-form,
|
||||
.drawer >>> .attr-list {
|
||||
padding: 0 16px;
|
||||
}
|
||||
</style>
|
||||
134
src/views/asrs/warehouseStorehouseStorage/attr-add.vue
Normal file
134
src/views/asrs/warehouseStorehouseStorage/attr-add.vue
Normal file
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:visible.sync="visible"
|
||||
:width="'35%'"
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="false"
|
||||
class="dialog">
|
||||
<template #title>
|
||||
<slot name="title">
|
||||
<div class="titleStyle">
|
||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||
</div>
|
||||
</slot>
|
||||
</template>
|
||||
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
label-width="100px"
|
||||
@keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item label="产品" prop="productId">
|
||||
<el-select
|
||||
v-model="dataForm.productId"
|
||||
style="width: 100%"
|
||||
@change="setProduct"
|
||||
placeholder="请选择产品">
|
||||
<el-option
|
||||
v-for="item in productArr"
|
||||
:key="item.id"
|
||||
:label="item.goodSpecificationName"
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row style="text-align: right">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createWarehouseStorehouseGoodsSpecification } from '@/api/asrs/warehouseStorehouseGoodsSpecification';
|
||||
import { getGoodSpecificationPage } from '@/api/asrs/goodSpecification';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
warehouseId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
productId: '',
|
||||
value: '',
|
||||
},
|
||||
productArr: [],
|
||||
dataRule: {
|
||||
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
const params = {
|
||||
pageSize: 100,
|
||||
pageNo: 1,
|
||||
};
|
||||
getGoodSpecificationPage(params).then((response) => {
|
||||
this.productArr = response.data.list;
|
||||
});
|
||||
});
|
||||
},
|
||||
setProduct(val) {
|
||||
let data = this.productArr.find((item) => {
|
||||
return (item.id === val);
|
||||
});
|
||||
const { id, ...newData } = data;
|
||||
this.dataForm.value = newData;
|
||||
this.dataForm.value.goodSpecificationId = id;
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 添加的提交
|
||||
createWarehouseStorehouseGoodsSpecification({
|
||||
...this.dataForm.value,
|
||||
warehouseStorehouseId: this.warehouseId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('添加成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog >>> .el-dialog__body {
|
||||
padding: 30px 24px;
|
||||
}
|
||||
.dialog >>> .el-dialog__header {
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
padding: 13px 24px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
}
|
||||
.dialog >>> .el-dialog__header .titleStyle::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0b58ff;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
</style>
|
||||
307
src/views/asrs/warehouseStorehouseStorage/index.vue
Normal file
307
src/views/asrs/warehouseStorehouseStorage/index.vue
Normal file
@@ -0,0 +1,307 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:isFold="true"
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266',
|
||||
}"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%"
|
||||
ref="dataList">
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="scope">
|
||||
<product :warehouse-id="scope.row.id" :prop-type="2"></product>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouseName" label="仓库名"></el-table-column>
|
||||
<el-table-column prop="warehouseCode" label="仓库编码"></el-table-column>
|
||||
<el-table-column
|
||||
prop="warehouseStorehouseName"
|
||||
label="库位名"></el-table-column>
|
||||
<el-table-column
|
||||
prop="warehouseStorehouseCode"
|
||||
label="库位编码"></el-table-column>
|
||||
<el-table-column prop="trayCode" label="托盘编码"></el-table-column>
|
||||
<el-table-column prop="process" label="工序">
|
||||
<template slot-scope="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.process >= 0 ? processArr[scope.row.process].name : ''
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cacheLocation" label="缓存库位">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.cacheLocation === 0 ? '否' : '是' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouseStorehouseState" label="仓库状态">
|
||||
<template slot-scope="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.warehouseStorehouseState >= 0
|
||||
? warehouseStorehouseState[scope.row.warehouseStorehouseState]
|
||||
.name
|
||||
: ''
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
v-if="scope.row.warehouseStorehouseState === 0"
|
||||
type="text"
|
||||
@click="handleClick({ data: { id: scope.row }, type: 'in' })"
|
||||
v-hasPermi="['asrs:warehouse-storehouse-storage:update']">
|
||||
入库
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
v-else-if="scope.row.warehouseStorehouseState === 1"
|
||||
type="text"
|
||||
@click="handleClick({ data: scope.row, type: 'out' })"
|
||||
v-hasPermi="['asrs:warehouse-storehouse-storage:update']">
|
||||
出库
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
v-else-if="scope.row.warehouseStorehouseState === 2"
|
||||
type="text"
|
||||
@click="handleClick({ data: scope.row, type: 'move' })"
|
||||
v-hasPermi="['asrs:warehouse-storehouse-storage:update']">
|
||||
移库
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<add-or-update
|
||||
v-if="drawerVisible"
|
||||
ref="drawerRef"
|
||||
:prop-type="2"
|
||||
@refreshDataList="getDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<out-or-move
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></out-or-move>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import outOrMove from './out-or-move';
|
||||
import product from '../product-mini';
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import { parseTime } from '../mixins/code-filter';
|
||||
|
||||
import { getWarehouseStorehousePage } from '@/api/asrs/warehouseStorehouse';
|
||||
|
||||
const processArr = [
|
||||
{
|
||||
name: '开始',
|
||||
id: 0,
|
||||
},
|
||||
{
|
||||
name: '一次分切后',
|
||||
id: 1,
|
||||
},
|
||||
{
|
||||
name: '一次分拣后',
|
||||
id: 2,
|
||||
},
|
||||
{
|
||||
name: '二次分切后',
|
||||
id: 3,
|
||||
},
|
||||
{
|
||||
name: '二次分拣后',
|
||||
id: 4,
|
||||
},
|
||||
];
|
||||
const warehouseStorehouseState = [
|
||||
{
|
||||
name: '空',
|
||||
id: 0,
|
||||
},
|
||||
{
|
||||
name: '锁定',
|
||||
id: 1,
|
||||
},
|
||||
{
|
||||
name: '满',
|
||||
id: 2,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getWarehouseStorehousePage,
|
||||
},
|
||||
tableData: [],
|
||||
processArr,
|
||||
drawerVisible: false,
|
||||
warehouseStorehouseState,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '库位名',
|
||||
placeholder: '库位名',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '库位编码',
|
||||
placeholder: '库位编码',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品名',
|
||||
placeholder: '产品名',
|
||||
param: 'pname',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品编码',
|
||||
placeholder: '产品编码',
|
||||
param: 'pcode',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '工序',
|
||||
selectOptions: processArr,
|
||||
param: 'processId',
|
||||
defaultSelect: '',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '库位状态',
|
||||
selectOptions: warehouseStorehouseState,
|
||||
param: 'warehouseStorehouseStateId',
|
||||
defaultSelect: '',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '重置',
|
||||
name: 'reset',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
product,
|
||||
outOrMove,
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.warehouseStorehouseName = val.name;
|
||||
this.listQuery.warehouseStorehouseCode = val.code;
|
||||
this.listQuery.goodName = val.pname;
|
||||
this.listQuery.goodCode = val.pcode;
|
||||
this.listQuery.process = val.processId;
|
||||
this.listQuery.warehouseStorehouseState =
|
||||
val.warehouseStorehouseStateId;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
this.drawerVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.drawerRef.init(id);
|
||||
});
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
otherMethods(val) {
|
||||
if (val.type === 'out') {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '出库';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id, 0);
|
||||
});
|
||||
} else if (val.type === 'move') {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '移库';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id, 1);
|
||||
});
|
||||
} else if (val.type === 'in') {
|
||||
this.drawerVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.drawerRef.init(val.data.id);
|
||||
});
|
||||
} else {
|
||||
console.log(11);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.app-container .el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
||||
310
src/views/asrs/warehouseStorehouseStorage/indexb.vue
Normal file
310
src/views/asrs/warehouseStorehouseStorage/indexb.vue
Normal file
@@ -0,0 +1,310 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:isFold="true"
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266',
|
||||
}"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%"
|
||||
ref="dataList">
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="scope">
|
||||
<product :warehouse-id="scope.row.id" :prop-type="2"></product>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouseName" label="仓库名"></el-table-column>
|
||||
<el-table-column prop="warehouseCode" label="仓库编码"></el-table-column>
|
||||
<el-table-column
|
||||
prop="warehouseStorehouseName"
|
||||
label="库位名"></el-table-column>
|
||||
<el-table-column
|
||||
prop="warehouseStorehouseCode"
|
||||
label="库位编码"></el-table-column>
|
||||
<el-table-column prop="trayCode" label="托盘编码"></el-table-column>
|
||||
<el-table-column prop="process" label="工序">
|
||||
<template slot-scope="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.process >= 0 ? processArr[scope.row.process].name : ''
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cacheLocation" label="缓存库位">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.cacheLocation === 0 ? '否' : '是' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouseStorehouseState" label="仓库状态">
|
||||
<template slot-scope="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.warehouseStorehouseState >= 0
|
||||
? warehouseStorehouseState[scope.row.warehouseStorehouseState]
|
||||
.name
|
||||
: ''
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
v-if="scope.row.warehouseStorehouseState === 0"
|
||||
type="text"
|
||||
@click="handleClick({ data: { id: scope.row }, type: 'in' })"
|
||||
v-hasPermi="['asrs:warehouse-storehouse-storage:update']">
|
||||
入库
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
v-else-if="scope.row.warehouseStorehouseState === 1"
|
||||
type="text"
|
||||
@click="handleClick({ data: scope.row, type: 'out' })"
|
||||
v-hasPermi="['asrs:warehouse-storehouse-storage:update']">
|
||||
出库
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
v-else-if="scope.row.warehouseStorehouseState === 2"
|
||||
type="text"
|
||||
@click="handleClick({ data: scope.row, type: 'move' })"
|
||||
v-hasPermi="['asrs:warehouse-storehouse-storage:update']">
|
||||
移库
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<add-or-update
|
||||
v-if="drawerVisible"
|
||||
ref="drawerRef"
|
||||
:prop-type="2"
|
||||
@refreshDataList="getDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<out-or-move
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></out-or-move>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import outOrMove from './out-or-move';
|
||||
import product from '../product-mini';
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import { parseTime } from '../mixins/code-filter';
|
||||
|
||||
import { getWarehouseStorehousePage } from '@/api/asrs/warehouseStorehouse';
|
||||
|
||||
const processArr = [
|
||||
{
|
||||
name: '开始',
|
||||
id: 0,
|
||||
},
|
||||
{
|
||||
name: '一次分切后',
|
||||
id: 1,
|
||||
},
|
||||
{
|
||||
name: '一次分拣后',
|
||||
id: 2,
|
||||
},
|
||||
{
|
||||
name: '二次分切后',
|
||||
id: 3,
|
||||
},
|
||||
{
|
||||
name: '二次分拣后',
|
||||
id: 4,
|
||||
},
|
||||
];
|
||||
const warehouseStorehouseState = [
|
||||
{
|
||||
name: '空',
|
||||
id: 0,
|
||||
},
|
||||
{
|
||||
name: '锁定',
|
||||
id: 1,
|
||||
},
|
||||
{
|
||||
name: '满',
|
||||
id: 2,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getWarehouseStorehousePage,
|
||||
},
|
||||
tableData: [],
|
||||
processArr,
|
||||
drawerVisible: false,
|
||||
bPage: true,
|
||||
warehouseStorehouseState,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '库位名',
|
||||
placeholder: '库位名',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '库位编码',
|
||||
placeholder: '库位编码',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品名',
|
||||
placeholder: '产品名',
|
||||
param: 'pname',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品编码',
|
||||
placeholder: '产品编码',
|
||||
param: 'pcode',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '工序',
|
||||
selectOptions: processArr,
|
||||
param: 'processId',
|
||||
defaultSelect: '',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '库位状态',
|
||||
selectOptions: warehouseStorehouseState,
|
||||
param: 'warehouseStorehouseStateId',
|
||||
defaultSelect: '',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '重置',
|
||||
name: 'reset',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
product,
|
||||
outOrMove,
|
||||
},
|
||||
created() {
|
||||
this.listQuery.warehouseId = this.bId;
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.warehouseStorehouseName = val.name;
|
||||
this.listQuery.warehouseStorehouseCode = val.code;
|
||||
this.listQuery.goodName = val.pname;
|
||||
this.listQuery.goodCode = val.pcode;
|
||||
this.listQuery.process = val.processId;
|
||||
this.listQuery.warehouseStorehouseState =
|
||||
val.warehouseStorehouseStateId;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
this.drawerVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.drawerRef.init(id);
|
||||
});
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
otherMethods(val) {
|
||||
if (val.type === 'out') {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '出库';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id, 0);
|
||||
});
|
||||
} else if (val.type === 'move') {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '移库';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id, 1);
|
||||
});
|
||||
} else if (val.type === 'in') {
|
||||
this.drawerVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.drawerRef.init(val.data.id);
|
||||
});
|
||||
} else {
|
||||
console.log(11);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.app-container .el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
||||
82
src/views/asrs/warehouseStorehouseStorage/out-or-move.vue
Normal file
82
src/views/asrs/warehouseStorehouseStorage/out-or-move.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-09-04 15:47:46
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="150px">
|
||||
<el-form-item :label="type?'选择移库位置':'选择出库到货位置'" prop="targetId">
|
||||
<el-select
|
||||
v-model="dataForm.targetId"
|
||||
style="width: 100%"
|
||||
placeholder="请选择位置">
|
||||
<el-option
|
||||
v-for="item in potArr"
|
||||
:key="item.id"
|
||||
:label="item.warehouseName"
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '../mixins/basic-add';
|
||||
import { getWarehouseStorehousePage,moveStorehouse } from "@/api/asrs/warehouseStorehouse";
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
},
|
||||
dataForm: {
|
||||
sourceId: undefined,
|
||||
targetId: undefined,
|
||||
},
|
||||
potArr: [],
|
||||
type: 0,
|
||||
dataRule: {
|
||||
targetId: [{ required: true, message: "位置不能为空", trigger: "blur" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id,type) {
|
||||
this.dataForm.sourceId = id || "";
|
||||
this.type = type
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
const params = {
|
||||
pageSize: 100,
|
||||
pageNo: 1,
|
||||
};
|
||||
getWarehouseStorehousePage(params).then((response) => {
|
||||
this.potArr = response.data.list;
|
||||
});
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
moveStorehouse(this.dataForm.sourceId,this.dataForm.targetId).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user