仓库-毛坯仓库功能完成
This commit is contained in:
82
src/api/wmsManagement/wmBlankRecord.js
Normal file
82
src/api/wmsManagement/wmBlankRecord.js
Normal file
@@ -0,0 +1,82 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 毛坯库存库存变动记录表分页查询
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function listWmBlankRecord(query) {
|
||||
return request({
|
||||
url: '/mes/wm/WmBlankRecord/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增毛坯库存库存变动记录表
|
||||
* @param data
|
||||
*/
|
||||
export function addWmBlankRecord(data) {
|
||||
return request({
|
||||
url: '/mes/wm/WmBlankRecord',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 修改毛坯库存库存变动记录表
|
||||
* @param data
|
||||
*/
|
||||
export function updateWmBlankRecord(data) {
|
||||
return request({
|
||||
url: '/mes/wm/WmBlankRecord',
|
||||
method: 'PUT',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 获取毛坯库存库存变动记录表详情
|
||||
* @param {Id}
|
||||
*/
|
||||
export function getWmBlankRecord(id) {
|
||||
return request({
|
||||
url: '/mes/wm/WmBlankRecord/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除毛坯库存库存变动记录表
|
||||
* @param {主键} pid
|
||||
*/
|
||||
export function delWmBlankRecord(pid) {
|
||||
return request({
|
||||
url: '/mes/wm/WmBlankRecord/' + pid,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 毛坯库存增加数量
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function addInventoryNum(query) {
|
||||
return request({
|
||||
url: '/mes/wm/WmBlankRecord/add_inventory',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 毛坯库存减少数量
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function reduceInventoryNum(query) {
|
||||
return request({
|
||||
url: '/mes/wm/WmBlankRecord/delete_inventory',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
@@ -146,7 +146,7 @@
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<TheWmBlankRecord :ItemData="detailData" :visible.sync="TheWmBlankRecordShow" @refresh="getList"></TheWmBlankRecord>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -158,9 +158,12 @@
|
||||
getWmBlankInventory,
|
||||
synchronousMaterial,
|
||||
} from '@/api/wmsManagement/wmBlankInventory.js';
|
||||
|
||||
import TheWmBlankRecord from './components/TheWmBlankRecord/TheWmBlankRecord.vue'
|
||||
export default {
|
||||
name: "wmblankinventory",
|
||||
name: "wmBlankInventory",
|
||||
components: {
|
||||
TheWmBlankRecord
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
labelWidth: "100px",
|
||||
@@ -190,6 +193,7 @@
|
||||
opertype: 0,
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
TheWmBlankRecordShow: false,
|
||||
// 表单参数
|
||||
form: {},
|
||||
columns: [
|
||||
@@ -233,6 +237,10 @@
|
||||
{ required: true, message: "库存数量不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
// 详情数据
|
||||
detailData: {
|
||||
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -358,7 +366,7 @@
|
||||
this.$message.success(res.msg);
|
||||
this.handleQuery();
|
||||
this.loading = false;
|
||||
}else{
|
||||
} else {
|
||||
this.loading = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -366,8 +374,11 @@
|
||||
})
|
||||
},
|
||||
// 毛坯数据详情
|
||||
handleDetail() {
|
||||
handleDetail(row) {
|
||||
console.log(row);
|
||||
this.detailData = row;
|
||||
|
||||
this.TheWmBlankRecordShow = true;
|
||||
},
|
||||
// 类别字典翻译
|
||||
typeFormat(row, column) {
|
||||
|
||||
@@ -387,7 +387,7 @@
|
||||
console.log(res);
|
||||
this.msgSuccess('新增成功')
|
||||
|
||||
this.reset();
|
||||
// this.reset();
|
||||
// this.open = false
|
||||
this.getList()
|
||||
})
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
<!-- 物料信息 -->
|
||||
<div>
|
||||
<div class="action-box flex-row flex-row-right">
|
||||
<el-button :disabled="form.type === 2" size="medium" type="success" icon="el-icon-plus" @click="handlerOpenChouseMaterial">添加物料</el-button>
|
||||
<el-button :disabled="opertype === 2" size="medium" type="success" icon="el-icon-plus" @click="handlerOpenChouseMaterial">添加物料</el-button>
|
||||
<!-- <el-button
|
||||
size="medium"
|
||||
type="danger"
|
||||
@@ -170,13 +170,13 @@
|
||||
> -->
|
||||
</div>
|
||||
<div>
|
||||
<el-table :disabled="form.type === 2" :data="form.materialList" v-loading="materialLoading" ref="table" border highlight-current-row @selection-change="handleMaterialSelectionChange">
|
||||
<el-table :disabled="opertype === 2" :data="form.materialList" v-loading="materialLoading" ref="table" border highlight-current-row @selection-change="handleMaterialSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="50" align="center" /> -->
|
||||
<el-table-column prop="partnumber" label="物料号" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="u8InventoryCode" label="U8编码" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="需求量" prop="requireOutNum" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input :disabled="form.type === 2" v-model.number="scope.row.requireOutNum" placeholder="请输入物料需求量" />
|
||||
<el-input :disabled="opertype === 2" v-model.number="scope.row.requireOutNum" placeholder="请输入物料需求量" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stockQuantity" label="现有库存" align="center" :show-overflow-tooltip="true" />
|
||||
@@ -186,7 +186,7 @@
|
||||
<el-table-column prop="remarks" label="备注" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-button :disabled="form.type === 2" size="mini" v-hasPermi="['business:wmmaterial:delete']" type="danger" icon="el-icon-delete" @click="handlerDeleteMaterial([scope.row.id])">移除此物料</el-button>
|
||||
<el-button :disabled="opertype === 2" size="mini" v-hasPermi="['business:wmmaterial:delete']" type="danger" icon="el-icon-delete" @click="handlerDeleteMaterial([scope.row.id])">移除此物料</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
},
|
||||
// 不关闭弹窗
|
||||
endAction(){
|
||||
this.$refs['elForm'].resetFields()
|
||||
// this.$refs['elForm'].resetFields()
|
||||
this.$emit("refresh");
|
||||
this.dataList = [];
|
||||
this.total = 0;
|
||||
|
||||
@@ -0,0 +1,265 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-bind="$attrs" v-on="$listeners" @open="onOpen" @close="onClose" title="库存记录" width="70%">
|
||||
<el-form ref="elForm" inline :model="queryParams" :rules="rules" size="medium" :label-width="labelWidth">
|
||||
<el-form-item label="类别" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择类别">
|
||||
<el-option label="全部" :value="0"></el-option>
|
||||
<el-option v-for="item in typeOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="createdTime">
|
||||
<el-date-picker v-model="queryParams.createdTimeStart" type="datetime" placeholder="选择记录开始日期时间" :clearable="true"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="updatedTime">
|
||||
<el-date-picker v-model="queryParams.createdTimeEnd" type="datetime" placeholder="选择记录结束日期时间" :clearable="true"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 工具区域 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" v-hasPermi="['business:wmblankrecord:add']" icon="el-icon-plus" size="mini" @click="handleAdd(1)">增加库存</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" v-hasPermi="['business:wmblankrecord:add']" icon="el-icon-minus" size="mini" @click="handleAdd(2)">减少库存</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 数据区域 -->
|
||||
<el-table :data="dataList" v-loading="loading" ref="table" border highlight-current-row>
|
||||
<el-table-column prop="blankNum" label="毛坯号" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="description" label="产品描述" align="center" width="280" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="specification" label="规格" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="changeQuantity" label="变动数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span style="font-weight: 700;">{{scope.row.type === 1? scope.row.changeQuantity : scope.row.changeQuantity * -1}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="类别" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag effect="dark" v-if="scope.row.type === 1" type="success">增加</el-tag>
|
||||
<el-tag effect="dark" v-if="scope.row.type === 2" type="danger">减少</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注原因" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="createdTime" label="创建时间" align="center" :show-overflow-tooltip="true" />
|
||||
<!-- <el-table-column label="操作" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" v-hasPermi="['business:wmblankrecord:delete']" type="danger" icon="el-icon-delete" title="删除" @click="handleDelete(scope.row)"></el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<pagination class="mt10" background :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<div slot="footer">
|
||||
<el-button @click="close">取消</el-button>
|
||||
<el-button type="primary" @click="handelConfirm">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :title="addDialogTitle" :lock-scroll="false" :visible.sync="addDialogOpen">
|
||||
<el-form ref="form" :model="formAdd" :rules="addDialogRules" :label-width="formLabelWidth">
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="毛坯号" prop="blankNum">
|
||||
{{formAdd.blankNum}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="描述" prop="description">
|
||||
{{formAdd.description + " " + formAdd.specification}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="变动类别" prop="type">
|
||||
<el-tag effect="dark" v-if="formAdd.type === 1" type="primary">毛坯</el-tag>
|
||||
<el-tag effect="dark" v-if="formAdd.type === 2" type="warning">返工件</el-tag>
|
||||
<span style="margin-right: 10px;"></span>
|
||||
<el-tag effect="dark" v-if="formAdd.actionType === 1" type="success">增加库存</el-tag>
|
||||
<el-tag effect="dark" v-if="formAdd.actionType === 2" type="danger">减少库存</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="变动数量" prop="changeQuantity">
|
||||
<el-input v-model.number="formAdd.changeQuantity" placeholder="请输入变动数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input :autosize="{ minRows: 2, maxRows: 6}" type="textarea" maxlength="240" v-model="formAdd.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
listWmBlankRecord,
|
||||
addWmBlankRecord,
|
||||
delWmBlankRecord,
|
||||
updateWmBlankRecord,
|
||||
getWmBlankRecord,
|
||||
addInventoryNum,
|
||||
reduceInventoryNum
|
||||
} from '@/api/wmsManagement/wmBlankRecord.js';
|
||||
export default {
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
'ItemData': {
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
labelWidth: "100px",
|
||||
formLabelWidth: "100px",
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 添加对话框
|
||||
addDialogOpen: false,
|
||||
addDialogTitle: '',
|
||||
// 数据列表
|
||||
dataList: [],
|
||||
// 总记录数
|
||||
total: 0,
|
||||
// 添加表单
|
||||
formAdd: {
|
||||
fkBlankInventoryId: "",
|
||||
blankNum: "",
|
||||
description: "",
|
||||
specification: "",
|
||||
type: 0,
|
||||
actionType: 1,
|
||||
changeQuantity: 0,
|
||||
remark: ""
|
||||
},
|
||||
addDialogRules: {
|
||||
changeQuantity: [
|
||||
{ required: true, message: "数量不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
fkBlankInventoryId: '',
|
||||
type:0,
|
||||
createTime: null,
|
||||
updateTime: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
rules: {},
|
||||
typeOptions: [
|
||||
{ dictLabel: '增加', dictValue: 1 },
|
||||
{ dictLabel: '减少', dictValue: 2 },
|
||||
],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 查询数据
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.fkBlankInventoryId = this.ItemData.id;
|
||||
// this.queryParams.blankNum = this.ItemData.blankNum;
|
||||
listWmBlankRecord(this.queryParams).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.dataList = res.data.result;
|
||||
this.total = res.data.totalNum;
|
||||
this.loading = false;
|
||||
} else {
|
||||
this.loading = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
onOpen() {
|
||||
this.dataList = [];
|
||||
this.getList();
|
||||
},
|
||||
onClose() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
emitRefresh(){
|
||||
this.$emit("refresh");
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleAdd(type = 0) {
|
||||
if (type === 1) {
|
||||
this.addDialogTitle = "增加库存";
|
||||
} else {
|
||||
this.addDialogTitle = "减少库存";
|
||||
}
|
||||
this.formAdd.fkBlankInventoryId = this.ItemData.id;
|
||||
this.formAdd.blankNum = this.ItemData.blankNum;
|
||||
this.formAdd.description = this.ItemData.description;
|
||||
this.formAdd.specification = this.ItemData.specification;
|
||||
this.formAdd.type = this.ItemData.type;
|
||||
this.formAdd.actionType = type;
|
||||
this.formAdd.changeQuantity = 0;
|
||||
this.formAdd.remark = "";
|
||||
this.addDialogOpen = true;
|
||||
},
|
||||
handelConfirm() {
|
||||
this.$refs['elForm'].validate(valid => {
|
||||
if (!valid) return
|
||||
this.close()
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.addDialogOpen = false;
|
||||
},
|
||||
submitForm() {
|
||||
const data = this.formAdd;
|
||||
if (this.formAdd.actionType === 1) {
|
||||
// 增加
|
||||
addInventoryNum(data).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success("手动添加记录成功!");
|
||||
this.getList();
|
||||
this.emitRefresh();
|
||||
this.addDialogOpen = false;
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 减少
|
||||
reduceInventoryNum(data).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.data != 1) {
|
||||
this.$message.error("添加记录失败!无此毛坯号记录或填写数据异常");
|
||||
return;
|
||||
}
|
||||
this.$message.success("手动添加记录成功!");
|
||||
this.getList();
|
||||
this.emitRefresh();
|
||||
this.addDialogOpen = false;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user