cangku
This commit is contained in:
parent
fd371532f5
commit
3481e13e44
|
@ -38,22 +38,34 @@ export function getInventoryList(query) {
|
||||||
}
|
}
|
||||||
export function createInventory(data) {
|
export function createInventory(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/inm/inventory/',
|
url: '/inm/fifo/in_pur/',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export function updateInventory(id, data) {
|
//仓库对应的物料
|
||||||
|
export function getfifodetailList(query) {
|
||||||
return request({
|
return request({
|
||||||
url: `/inm/inventory/${id}/`,
|
url: '/inm/fifodetail/',
|
||||||
method: 'put',
|
method: 'get',
|
||||||
data
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export function deleteInventory(id, data) {
|
|
||||||
|
//出入库记录
|
||||||
|
export function getfifoList(query) {
|
||||||
return request({
|
return request({
|
||||||
url: `/inm/inventory/${id}/`,
|
url: '/inm/fifo/',
|
||||||
method: 'delete',
|
method: 'get',
|
||||||
data
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//物料批次
|
||||||
|
export function getmaterialbatchList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/inm/materialbatch/',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -293,32 +293,34 @@ export const asyncRoutes = [
|
||||||
meta: { title: '仓库', icon: 'example', perms: ['index_manage'] }
|
meta: { title: '仓库', icon: 'example', perms: ['index_manage'] }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'materialbatch/:id',
|
path: 'inventory/:id',
|
||||||
name: 'MaterialBatch',
|
name: 'inventory',
|
||||||
component: () => import('@/views/inm/materialbatch'),
|
component: () => import('@/views/inm/inventory'),
|
||||||
meta: { title: '仓库物料', perms: ['vendor_manage'] },
|
meta: { title: '仓库物料', perms: ['vendor_manage'] },
|
||||||
hidden: true
|
hidden: true
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
path: 'warehouse',
|
path: 'materialbatch',
|
||||||
name: 'warehouse',
|
name: 'materialbatch',
|
||||||
component: () => import('@/views/inm/warehouse'),
|
component: () => import('@/views/inm/materialbatch'),
|
||||||
meta: { title: '物料库存', icon: 'example', perms: ['index_manage'] }
|
meta: { title: '物料批次', icon: 'example', perms: ['index_manage'] }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'warehouse',
|
path: 'fifo',
|
||||||
name: 'warehouse',
|
name: 'fifo',
|
||||||
component: () => import('@/views/inm/warehouse'),
|
component: () => import('@/views/inm/fifo'),
|
||||||
meta: { title: '半成品库存', icon: 'example', perms: ['index_manage'] }
|
meta: { title: '出入库记录', icon: 'example', perms: ['index_manage'] }
|
||||||
}
|
},
|
||||||
,
|
|
||||||
{
|
{
|
||||||
path: 'warehouse',
|
path: 'fifodetail/:id',
|
||||||
name: 'warehouse',
|
name: 'fifodetail',
|
||||||
component: () => import('@/views/inm/warehouse'),
|
component: () => import('@/views/inm/fifodetail'),
|
||||||
meta: { title: '成品库存', icon: 'example', perms: ['index_manage'] }
|
meta: { title: '仓库物料', perms: ['vendor_manage'] },
|
||||||
|
hidden: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,324 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery.search"
|
||||||
|
placeholder="仓库名称/仓库编号"
|
||||||
|
style="width: 300px"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="handleFilter"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleFilter"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh-left"
|
||||||
|
@click="resetFilter"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card style="margin-top: 10px">
|
||||||
|
<div style="margin-top: 10px">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
||||||
|
>新增物料</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="fifoList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
highlight-current-row
|
||||||
|
max-height="600"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column label="仓库">
|
||||||
|
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="出库入人员">
|
||||||
|
<template slot-scope="scope">{{ scope.row.operator_.username }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="出入库时间">
|
||||||
|
<template slot-scope="scope">{{ scope.row.inout_date }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="出入库类型">
|
||||||
|
<template slot-scope="scope">{{ types_[scope.row.type] }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
width="220px"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['warehouse_update'])"
|
||||||
|
@click="handleDetail(scope)"
|
||||||
|
>查看详情</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['warehouse_delete'])"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope)"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="fifoList.count > 0"
|
||||||
|
:total="fifoList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:title="dialogType === 'edit' ? '编辑仓库' : '新增仓库'"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Form"
|
||||||
|
:model="inventory"
|
||||||
|
label-width="80px"
|
||||||
|
label-position="right"
|
||||||
|
:rules="rule1"
|
||||||
|
>
|
||||||
|
<el-form-item label="仓库" prop="warehouse">
|
||||||
|
<el-select v-model="inventory.warehouse" placeholder="请选择" filterable >
|
||||||
|
<el-option v-for="item in warehouseData" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="操作人" prop="operator">
|
||||||
|
<el-select v-model="inventory.operator" placeholder="请选择" filterable >
|
||||||
|
<el-option v-for="item in userData" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="入库时间" prop="inout_date">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="inventory.inout_date"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择日期"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
style="width:100%"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<div v-for="(item,index) in inventory.details" :key="index">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8" style="margin-right:10px;">
|
||||||
|
<el-form-item class="material" label="物料:" :prop="'details.'+index+'.material'" >
|
||||||
|
<el-select v-model="item.material" size="small" >
|
||||||
|
<el-option v-for="item in materialoptions"
|
||||||
|
:key="item.value"
|
||||||
|
:value="item.value"
|
||||||
|
:label="item.label">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" style="margin-right:10px;">
|
||||||
|
<el-form-item class="count" label="数量" :prop="'details.'+index+'.count'" >
|
||||||
|
<el-input-number v-model="item.count" :min="0"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6" style="margin-right:10px;">
|
||||||
|
<el-form-item class="batch" label="批次" :prop="'details.'+index+'.batch'" >
|
||||||
|
<el-input v-model="item.batch" placeholder="批次号" ></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<!-- 删除按钮 -->
|
||||||
|
<el-col :span="1" >
|
||||||
|
<el-tooltip class="item" effect="dark" content="删除" placement="top">
|
||||||
|
<el-button @click="deleteItem(index)" style='border:none;background:none;padding:0px;margin-top:4px;'>
|
||||||
|
<i class="el-icon-remove-outline" style='font-size:20px;'></i>
|
||||||
|
</el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-tooltip class="item" effect="dark" content="添加条件" placement="top">
|
||||||
|
<el-button @click="addConditions" style='cursor:pointer;width:95%;color:#fe000c;border:1px dashed #fe000c;height:40px;padding:0px;margin-top:10px;margin-left:20px;font-size:26px'>
|
||||||
|
+
|
||||||
|
</el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {getfifoList,createInventory,getWarehouseList} from "@/api/inm";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
import { getMaterialList} from "@/api/mtm";
|
||||||
|
import { getUserList} from "@/api/user";
|
||||||
|
import { genTree } from "@/utils";
|
||||||
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
|
const defaulteinventory = {
|
||||||
|
details:[
|
||||||
|
{
|
||||||
|
material:'', // 物料
|
||||||
|
count:'',//数量
|
||||||
|
batch:'',//批次
|
||||||
|
|
||||||
|
}
|
||||||
|
],
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
components: { Pagination },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
inventory: defaulteinventory,
|
||||||
|
fifoList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
types_:{
|
||||||
|
|
||||||
|
1:'生产领料',
|
||||||
|
2:'销售提货',
|
||||||
|
3:'采购入库',
|
||||||
|
4:'生产入库',
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
warehouseData:[],
|
||||||
|
materialoptions:[],
|
||||||
|
userData:[],
|
||||||
|
listLoading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogType: "new",
|
||||||
|
rule1: {
|
||||||
|
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.getlists()
|
||||||
|
this.getList();
|
||||||
|
this.getUser();
|
||||||
|
this.getmaterialList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
|
||||||
|
getList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
|
||||||
|
getfifoList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.fifoList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
//出入库详情
|
||||||
|
handleDetail(scope){
|
||||||
|
this.$router.push({name: "fifodetail", params: { id: scope.row.id }, })
|
||||||
|
},
|
||||||
|
|
||||||
|
getlists(){
|
||||||
|
getWarehouseList({page:0}).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.warehouseData = genTree(response.data);
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getUser() {
|
||||||
|
getUserList({page:0}).then(res => {
|
||||||
|
if (res.data) {
|
||||||
|
this.userData = genTree(res.data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addConditions () {
|
||||||
|
if(this.inventory.details.length<=10) {
|
||||||
|
this.inventory.details.push({
|
||||||
|
material:'', // 物料
|
||||||
|
count:'', //数量
|
||||||
|
batch:'', // 批次
|
||||||
|
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message('最多可添加十项条件');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deleteItem (index) {
|
||||||
|
this.inventory.details.splice(index, 1)
|
||||||
|
},
|
||||||
|
//物料
|
||||||
|
getmaterialList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
getMaterialList({pageoff:true}).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.materialoptions = genTree(response.data);
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleCreate()
|
||||||
|
{
|
||||||
|
this.inventory = Object.assign({}, defaulteinventory);
|
||||||
|
this.dialogType = "new";
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleFilter() {
|
||||||
|
this.listQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
resetFilter() {
|
||||||
|
this.listQuery = {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
async confirm(form) {
|
||||||
|
console.log(this.inventory)
|
||||||
|
|
||||||
|
createInventory(this.inventory).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getList();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,131 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery.search"
|
||||||
|
placeholder="仓库名称/仓库编号"
|
||||||
|
style="width: 300px"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="handleFilter"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleFilter"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh-left"
|
||||||
|
@click="resetFilter"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card style="margin-top: 10px">
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="fifodetailList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
highlight-current-row
|
||||||
|
max-height="600"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column label="物料名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="物料批次">
|
||||||
|
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料单位">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料型号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="入库数量">
|
||||||
|
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="fifodetailList.count > 0"
|
||||||
|
:total="fifodetailList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getfifodetailList } from "@/api/inm";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
import { getMaterialList} from "@/api/mtm";
|
||||||
|
import { getUserList} from "@/api/user";
|
||||||
|
import { genTree } from "@/utils";
|
||||||
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { Pagination },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
InventoryList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
|
||||||
|
listLoading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogType: "new",
|
||||||
|
rule1: {
|
||||||
|
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
|
||||||
|
getList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
|
||||||
|
this.listQuery.fifo=this.$route.params.id;
|
||||||
|
getfifodetailList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.fifodetailList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,137 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery.search"
|
||||||
|
placeholder="仓库名称/仓库编号"
|
||||||
|
style="width: 300px"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="handleFilter"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleFilter"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh-left"
|
||||||
|
@click="resetFilter"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card style="margin-top: 10px">
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="InventoryList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
highlight-current-row
|
||||||
|
max-height="600"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column label="物料名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="物料编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料单位">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料型号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料存量">
|
||||||
|
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="InventoryList.count > 0"
|
||||||
|
:total="InventoryList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getInventoryList,getfifoList,getfifodetailList,createInventory,getWarehouseList } from "@/api/inm";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
import { getMaterialList} from "@/api/mtm";
|
||||||
|
import { getUserList} from "@/api/user";
|
||||||
|
import { genTree } from "@/utils";
|
||||||
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { Pagination },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
InventoryList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
|
||||||
|
listLoading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogType: "new",
|
||||||
|
rule1: {
|
||||||
|
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
|
||||||
|
getList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
if(this.$route.params.id!="")
|
||||||
|
{
|
||||||
|
this.listQuery.warehouse=this.$route.params.id;
|
||||||
|
getInventoryList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.InventoryList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
getInventoryList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.InventoryList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -26,52 +26,46 @@
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card style="margin-top: 10px">
|
<el-card style="margin-top: 10px">
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="warehouseList.results"
|
:data="InventoryList.results"
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
max-height="600"
|
max-height="600"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="物料名称">
|
|
||||||
<template slot-scope="scope">{{ scope.row.name }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column label="物料批次">
|
<el-table-column label="物料批次">
|
||||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="入库数量">
|
<el-table-column label="物料名称">
|
||||||
<template slot-scope="scope">{{ scope.row.place }}</template>
|
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="物料有效期">
|
|
||||||
<template slot-scope="scope">{{ scope.row.place }}</template>
|
<el-table-column label="物料编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.number }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="入库时间">
|
<el-table-column label="仓库名称">
|
||||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="仓库编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.warehouse_.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料总存量">
|
||||||
|
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
|
||||||
align="center"
|
|
||||||
label="操作"
|
|
||||||
width="220px"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
|
|
||||||
|
|
||||||
<el-link
|
|
||||||
v-if="checkPermission(['warehouse_delete'])"
|
|
||||||
type="danger"
|
|
||||||
@click="handleDelete(scope)"
|
|
||||||
>删除</el-link
|
|
||||||
>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination
|
<pagination
|
||||||
v-show="warehouseList.count > 0"
|
v-show="InventoryList.count > 0"
|
||||||
:total="warehouseList.count"
|
:total="InventoryList.count"
|
||||||
:page.sync="listQuery.page"
|
:page.sync="listQuery.page"
|
||||||
:limit.sync="listQuery.page_size"
|
:limit.sync="listQuery.page_size"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
|
@ -81,69 +75,57 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getWarehouseList, deleteWarehouse } from "@/api/inm";
|
import { getInventoryList,getfifoList,getmaterialbatchList,createInventory,getWarehouseList } from "@/api/inm";
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
|
import { getMaterialList} from "@/api/mtm";
|
||||||
|
import { getUserList} from "@/api/user";
|
||||||
import { genTree } from "@/utils";
|
import { genTree } from "@/utils";
|
||||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
const defaultewarehouse = {
|
|
||||||
};
|
|
||||||
export default {
|
export default {
|
||||||
components: { Pagination },
|
components: { Pagination },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
warehouse: defaultewarehouse,
|
|
||||||
warehouseList: {
|
InventoryList: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
options: [{
|
|
||||||
value: 0,
|
|
||||||
label: '运转正常'
|
|
||||||
}, {
|
|
||||||
value: 1,
|
|
||||||
label: '停用'
|
|
||||||
}, {
|
|
||||||
value: 2,
|
|
||||||
label: '报废'
|
|
||||||
}],
|
|
||||||
listQuery: {
|
listQuery: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
keeperOptions:[],
|
|
||||||
depOptions:[],
|
|
||||||
listLoading: true,
|
|
||||||
dialogVisible: false,
|
|
||||||
dialogType: "new",
|
|
||||||
rule1: {
|
rule1: {
|
||||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
|
||||||
place: [{ required: true, message: "请输入", trigger: "blur" }],
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
watch: {},
|
watch: {},
|
||||||
created() {
|
created() {
|
||||||
|
|
||||||
this.getList();
|
this.getList();
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkPermission,
|
checkPermission,
|
||||||
//设备列表
|
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
getWarehouseList(this.listQuery).then((response) => {
|
|
||||||
|
getmaterialbatchList(this.listQuery).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.warehouseList = response.data;
|
this.InventoryList = response.data;
|
||||||
}
|
}
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleMaterial(scope){
|
|
||||||
alert(1)
|
|
||||||
},
|
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.page = 1;
|
this.listQuery.page = 1;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
@ -156,21 +138,7 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
|
|
||||||
handleDelete(scope) {
|
|
||||||
this.$confirm("确认删除?", "警告", {
|
|
||||||
confirmButtonText: "确认",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "error",
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
await deleteWarehouse(scope.row.id);
|
|
||||||
this.getList();
|
|
||||||
this.$message.success("成功");
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error(err);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
@ -179,7 +179,7 @@ export default {
|
||||||
},
|
},
|
||||||
//跳转到该仓库的物料表
|
//跳转到该仓库的物料表
|
||||||
handleMaterial(scope){
|
handleMaterial(scope){
|
||||||
this.$router.push({name: "MaterialBatch", params: { id: scope.row.id }, })
|
this.$router.push({name: "inventory", params: { id: scope.row.id }, })
|
||||||
},
|
},
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.page = 1;
|
this.listQuery.page = 1;
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
>计算物料</el-button>
|
>计算物料</el-button>
|
||||||
<el-table
|
<el-table
|
||||||
:data="orderList.results"
|
:data="orderList.results"
|
||||||
border
|
|
||||||
ref="multipleTable"
|
ref="multipleTable"
|
||||||
|
border
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@selection-change="handleSelectionChange">
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
type="selection"
|
type="selection"
|
||||||
width="55">
|
width="55">
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
<template slot-scope="scope" >
|
<template slot-scope="scope" >
|
||||||
<el-form :model="scope.row">
|
<el-form :model="scope.row">
|
||||||
<el-form-item size="mini">
|
<el-form-item size="mini">
|
||||||
<el-input-number v-model="scope.row.pgcount" :min="0"></el-input-number>
|
<el-input-number v-model="scope.row.pgcount" :min="0" :value="0"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
@ -234,29 +234,20 @@ export default {
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleSelectionChange(rows) {
|
|
||||||
|
//物料计算
|
||||||
|
handlecount()
|
||||||
|
{
|
||||||
|
console.log()
|
||||||
let _this=this
|
let _this=this
|
||||||
_this.mutipID=[]
|
_this.mutipID=[]
|
||||||
row.forEach((item) => {
|
this.$refs.multipleTable.selection.forEach((item) => {
|
||||||
_this.mutipID.push({
|
_this.mutipID.push({
|
||||||
"id":item.product_.id,
|
"id":item.product_.id,
|
||||||
"count": item.pgcount
|
"count": item.pgcount
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
|
||||||
rows.forEach(row => {
|
|
||||||
this.$refs.multipleTable.toggleRowSelection(row);
|
|
||||||
});
|
|
||||||
}, 1)
|
|
||||||
|
|
||||||
},
|
|
||||||
//物料计算
|
|
||||||
handlecount()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
createresource(this.mutipID).then((res) => {
|
createresource(this.mutipID).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
<el-table-column label="工序编号">
|
<el-table-column label="工序编号">
|
||||||
<template slot-scope="scope">{{ scope.row.process_.number }}</template>
|
<template slot-scope="scope">{{ scope.row.process_.number }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="子工序">
|
<el-table-column label="子工序">
|
||||||
<template slot-scope="scope" v-if="scope.row.steps">
|
<template slot-scope="scope" v-if="scope.row.steps">
|
||||||
<el-tag v-for="item in scope.row.steps"
|
<el-tag v-for="item in scope.row.steps"
|
||||||
|
@ -43,7 +44,9 @@
|
||||||
<el-table-column label="完工时间">
|
<el-table-column label="完工时间">
|
||||||
<template slot-scope="scope">{{ scope.row.end_date }}</template>
|
<template slot-scope="scope">{{ scope.row.end_date }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="状态">
|
||||||
|
<template slot-scope="scope">{{ state_[scope.row.state] }}</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="创建时间">
|
<el-table-column label="创建时间">
|
||||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -79,7 +82,12 @@ export default {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
|
state_:{
|
||||||
|
0:'制定中',
|
||||||
|
1:'已下达',
|
||||||
|
2:'已接受',
|
||||||
|
3:'生产中',
|
||||||
|
4:'已完成'},
|
||||||
listLoading: true
|
listLoading: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue