Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop

This commit is contained in:
caoqianming 2021-11-04 09:16:18 +08:00
commit 5971e79213
5 changed files with 250 additions and 37 deletions

17
hb_client/src/api/wpm.js Normal file
View File

@ -0,0 +1,17 @@
import request from '@/utils/request'
export function createPick(data) {
return request({
url: '/wpm/wmaterial/pick/',
method: 'post',
data
})
}
export function getwmaterialList(query) {
return request({
url: '/wpm/wmaterial/',
method: 'get',
params: query
})
}

View File

@ -192,9 +192,9 @@ export const asyncRoutes = [
meta: { title: '车间任务', icon: 'example', perms: ['index_manage'] } meta: { title: '车间任务', icon: 'example', perms: ['index_manage'] }
}, },
{ {
path: 'testitem', path: 'need/:id',
name: 'testitem', name: 'need',
component: () => import('@/views/wpm/testitem'), component: () => import('@/views/wpm/need'),
meta: { title: '检测项目', icon: 'example', perms: ['index_manage'] } meta: { title: '检测项目', icon: 'example', perms: ['index_manage'] }
} }
] ]

View File

@ -238,7 +238,7 @@ export default {
//物料计算 //物料计算
handlecount() handlecount()
{ {
console.log()
let _this=this let _this=this
_this.mutipID=[] _this.mutipID=[]
this.$refs.multipleTable.selection.forEach((item) => { this.$refs.multipleTable.selection.forEach((item) => {

View File

@ -1,10 +1,14 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix"> <el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
<span>生产任务列表</span> <el-tab-pane :key="item.name" v-for="item in processOption"
:label="item.name"
</div>
:name="item.id"
:closable="item.close">
<el-table <el-table
:data="subproductionplanList.results" :data="subproductionplanList.results"
@ -47,6 +51,13 @@
<el-table-column label="状态"> <el-table-column label="状态">
<template slot-scope="scope">{{ state_[scope.row.state] }}</template> <template slot-scope="scope">{{ state_[scope.row.state] }}</template>
</el-table-column> </el-table-column>
<el-table-column label="领料状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_picked==false">未领料</el-tag>
<el-tag v-else>已领料</el-tag>
</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>
@ -73,24 +84,70 @@
:limit.sync="listQuery.page_size" :limit.sync="listQuery.page_size"
@pagination="getspList" @pagination="getspList"
/> />
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>车间物料</span>
</div>
<el-table
:data="wmaterialList"
border
fit
stripe
style="width: 100%"
max-height="400"
>
<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_.unit }}</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.count }}</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
</el-tabs>
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:title="dialogType === 'edit' ? '编辑仓库进行领料' : '选择仓库进行领料'" :title="dialogType === 'edit' ? '编辑领料' : '选择仓库领料'"
> >
<el-form <el-form
ref="Form" ref="Form"
:model="warehouse" :model="need"
label-width="80px" label-width="80px"
label-position="right" label-position="right"
:rules="rule1"
> >
<el-form-item label="选择仓库" prop="warehouse">
<el-select v-model="inventory.warehouse" placeholder="请选择" filterable > <el-form-item label="仓库" prop="warehouse">
<el-option v-for="item in warehouseData" :key="item.value" :label="item.label" :value="item.value" /> <el-select style="width: 100%" v-model="need.warehouse" placeholder="请选择">
</el-select> <el-option
</el-form-item> v-for="item in warehouseoptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
@ -98,28 +155,94 @@
<el-button type="primary" @click="confirm('Form')">确认</el-button> <el-button type="primary" @click="confirm('Form')">确认</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog
:visible.sync="dialogVisiblenw"
title="领料"
>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>生产所需领料表</span>
</div>
<template>
<el-table :data="needwl" style="width: 100%">
<el-table-column prop="material_.name" label="物料名称" > </el-table-column>
<el-table-column prop="material_.number" label="物料编号"> </el-table-column>
<el-table-column prop="material_.specification" label="物料规格" > </el-table-column>
<el-table-column prop="material_.unit" label="物料单位" > </el-table-column>
<el-table-column prop="count" label="所需物料数量" > </el-table-column>
<el-table-column prop="count_real" label="已领物料数量" > </el-table-column>
</el-table>
</template>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>当前仓库物料表</span>
<el-button style="float: right; padding: 3px 0" @click="handlePick" type="text">确认领料</el-button>
</div>
<template>
<el-table :data="havewl" style="width: 100%" ref="multipleTable">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column prop="batch" label="物料批次" > </el-table-column>
<el-table-column prop="material_.name" label="物料名称"> </el-table-column>
<el-table-column prop="warehouse_.name" label="物料所在仓库" > </el-table-column>\
<el-table-column prop="count" label="物料总数量" > </el-table-column>
<el-table-column label="输入领料数量" width="140px">
<template slot-scope="scope" >
<el-form :model="scope.row" widht="100px">
<el-form-item size="mini">
<el-input-number v-model="scope.row.pick_count" :min="0" :precision="2" :controls="false" :value="0"></el-input-number>
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column prop="count_real" label="已领物料数量" > </el-table-column>
<el-table-column prop="material_.specification" label="物料规格" > </el-table-column>
<el-table-column prop="material_.unit" label="物料单位" > </el-table-column>
</el-table>
</template>
</el-card>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getsubproductionplanList,createPick_need } from "@/api/pm"; import { getsubproductionplanList,createPick_need } from "@/api/pm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { getProcessList} from "@/api/mtm";
import { createPick,getwmaterialList } from "@/api/wpm";
import { getWarehouseList } from "@/api/inm";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteneed = {
};
export default { export default {
components: { Pagination }, components: { Pagination },
data() { data() {
return { return {
need: defaulteneed,
subproductionplanList: { subproductionplanList: {
count: 0, count: 0,
}, },
wmaterialList:"",
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
warehouseData:[], activeName:'0',
havewl:"",
needwl:"",
state_:{ state_:{
0:'制定中', 0:'制定中',
1:'已下达', 1:'已下达',
@ -128,40 +251,113 @@ export default {
4:'已完成'}, 4:'已完成'},
listLoading: true, listLoading: true,
listLoading: true, listLoading: true,
id:"",
warehouseoptions:[],
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
dialogVisiblenw: false,
dialogTypenw: "new",
picks:[],
pickData:{},
}; };
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
this.getspList(); this.getProcessList();
this.getlists(); this.getWarehouseLists();
}, },
methods: { methods: {
checkPermission, checkPermission,
//订单列表 //选项卡切换
getspList() { handleClick(tab)
this.listLoading = true; {
console.log(this.listQuery)
getsubproductionplanList(this.listQuery).then((response) => { this.listQuery.process=tab.name;
getsubproductionplanList(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
this.subproductionplanList = response.data; this.subproductionplanList = response.data;
} }
this.listLoading = false; this.listLoading = false;
}); });
}, getwmaterialList({process:tab.name,page:0}).then((response) => {
getlists(){
getWarehouseList({page:0}).then((response) => {
if (response.data) { if (response.data) {
this.warehouseData = genTree(response.data); this.wmaterialList = response.data;
} }
this.listLoading = false; this.listLoading = false;
}); });
}, },
//工序渲染
getProcessList(){
getProcessList({page:0}).then((response) => {
if (response.data) {
this.processOption = response.data;
}
this.listLoading = false;
});
},
getWarehouseLists(){
getWarehouseList({page:0}).then((response) => {
if (response.data) {
this.warehouseoptions = response.data;
}
this.listLoading = false;
});
},
handleNeed(scope){ handleNeed(scope){
createPick_need() this.need = Object.assign({}, defaulteneed);
this.dialogType = "new";
this.dialogVisible = true;
this.id=scope.row.id;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
async confirm(form) {
createPick_need( this.id,this.need).then((res) => {
if (res.code >= 200) {
this.dialogVisible = false;
this.dialogVisiblenw = true;
this.havewl=res.data.have;
this.needwl=res.data.need;
}
});
},
//确认领料
handlePick()
{
let _this=this
_this.picks=[]//所需物料
this.$refs.multipleTable.selection.forEach((item) => {
_this.picks.push({
"material":item.material,
"batch": item.batch,
"pick_count":item.pick_count
});
});
this.pickData.subproduction_plan = this.id;
this.pickData.warehouse = this.need.warehouse;
this.pickData.picks = this.picks;
console.log(this.pickData)
createPick(this.pickData).then((res) => {
if (res.code >= 200) {
this.$message.success("领料成功!");
}
});
} }
}, },
}; };