This commit is contained in:
shilixia 2021-11-17 15:13:55 +08:00
parent e68f7fdb15
commit 6e2e80e77b
7 changed files with 755 additions and 297 deletions

View File

@ -95,3 +95,12 @@ export function createTestrecord(data) {
data data
}) })
} }
//半成品库存
export function getiproductList(query) {
return request({
url: '/inm/iproduct/',
method: 'get',
params: query
})
}

View File

@ -15,6 +15,15 @@ export function getwmaterialList(query) {
params: query params: query
}) })
} }
//车间生产计划
export function getsubplanList(query) {
return request({
url: '/wpm/subplan/',
method: 'get',
params: query
})
}
//车间操作 //车间操作
export function createWork(data) { export function createWork(data) {
return request({ return request({
@ -40,6 +49,23 @@ export function getwproductList(query) {
}) })
} }
//半成品检验
export function wproductTest(data) {
return request({
url: '/wpm/wproduct/test/',
method: 'post',
data
})
}
//半成品入库
export function wproductPutin(id, data) {
return request({
url: `/wpm/wproduct/${id}/putin/`,
method: 'post',
data
})
}

View File

@ -316,8 +316,13 @@ export const asyncRoutes = [
component: () => import('@/views/inm/fifodetail'), component: () => import('@/views/inm/fifodetail'),
meta: { title: '仓库物料', perms: ['vendor_manage'] }, meta: { title: '仓库物料', perms: ['vendor_manage'] },
hidden: true hidden: true
} },
{
path: 'wproduct',
name: 'wproduct',
component: () => import('@/views/inm/wproduct'),
meta: { title: '半成品', icon: 'example', perms: ['index_manage'] }
},
] ]
}, },

View File

@ -0,0 +1,87 @@
<template>
<div class="app-container">
<el-card style="margin-top: 2px">
<el-table
v-loading="listLoading"
:data="iproductData.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.number }}</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_.name }}</template>
</el-table-column>
<el-table-column label="所在仓库">
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
</el-table-column>
</el-table>
<pagination
v-show="iproductData.count > 0"
:total="iproductData.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script>
import {
getiproductList,
} from "@/api/inm";
import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
export default {
components: { Pagination },
data() {
return {
iproductData: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
};
},
computed: {},
watch: {},
created() {
this.getList();
},
methods: {
checkPermission,
//半成品列表
getList() {
this.listLoading = true;
getiproductList(this.listQuery).then((response) => {
if (response.data) {
this.iproductData= response.data;
}
this.listLoading = false;
});
},
},
};
</script>

View File

@ -261,6 +261,13 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination
v-show="fieldList.count > 0"
:total="fieldList.count"
:page.sync="listQueryfield.page"
:limit.sync="listQueryfield.page_size"
@pagination="fieldLists"
/>
<el-dialog <el-dialog
:visible.sync="dialogVisible1" :visible.sync="dialogVisible1"
:title="dialogType1 === 'edit' ? '编辑表格字段' : '新增表格字段'" :title="dialogType1 === 'edit' ? '编辑表格字段' : '新增表格字段'"

View File

@ -1,32 +1,8 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-tabs type="border-card">
<div> <el-tab-pane label="待检半成品">
<el-input <el-card style="margin-top: 2px">
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: 2px">
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="wproductList.results" :data="wproductList.results"
@ -46,11 +22,11 @@
</el-table-column> </el-table-column>
<el-table-column label="检测状态"> <el-table-column label="检测状态">
<template slot-scope="scope"> <template slot-scope="scope">
{{actstate_[scope.row.act_state]}} {{ actstate_[scope.row.act_state] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所在子工序"> <el-table-column label="所在子工序">
<template slot-scope="scope">{{ scope.row.p_state_.name }}</template> <template slot-scope="scope">{{ scope.row.p_state_.name }}</template>
</el-table-column> </el-table-column>
@ -61,7 +37,6 @@
@click="handleInspection(scope)" @click="handleInspection(scope)"
>检验</el-link >检验</el-link
> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -73,52 +48,246 @@
@pagination="getList" @pagination="getList"
/> />
</el-card> </el-card>
<el-dialog </el-tab-pane>
:visible.sync="dialogVisible" <el-tab-pane label="已检半成品">
:title="dialogType === 'edit' ? '编辑项目' : '新增项目'" <el-card style="margin-top: 2px">
> <el-table
<el-form v-loading="listLoading"
ref="Form" :data="wproductList1.results"
:model="testitem" border
label-width="80px" fit
label-position="right" stripe
:rules="rule1" highlight-current-row
max-height="600"
> >
<el-form-item label="项目名称" prop="name"> <el-table-column type="index" width="50" />
<el-input v-model="testitem.name" placeholder="项目名称" /> <el-table-column label="半成品名称">
</el-form-item> <template slot-scope="scope">{{ scope.row.m_state_.name }}</template>
<el-form-item label="条款号" prop="term_number"> </el-table-column>
<el-input v-model="testitem.term_number" placeholder="条款号" />
</el-form-item> <el-table-column label="半成品编号">
<el-form-item label="标准" prop="standard"> <template slot-scope="scope">{{ scope.row.number }}</template>
<el-select </el-table-column>
style="width: 100%" <el-table-column label="检测状态">
v-model="testitem.standard" <template slot-scope="scope">
placeholder="请选择" {{ actstate_[scope.row.act_state] }}
> </template>
<el-option </el-table-column>
v-for="item in options"
:key="item.value" <el-table-column label="所在子工序">
:label="item.label" <template slot-scope="scope">{{ scope.row.p_state_.name }}</template>
:value="item.value" </el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
@click="handlePutin(scope)"
>入库</el-link
> >
</el-option> </template>
</el-select> </el-table-column>
</el-form-item> </el-table>
</el-form> <pagination
<div style="text-align: right"> v-show="wproductList1.count > 0"
<el-button type="danger" @click="dialogVisible = false">取消</el-button> :total="wproductList1.count"
<el-button type="primary" @click="confirm('Form')">确认</el-button> :page.sync="listQuery1.page"
:limit.sync="listQuery1.page_size"
@pagination="getList1"
/>
</el-card>
</el-tab-pane>
</el-tabs>
<el-dialog title="物料检查表" :visible.sync="outerVisible">
<el-select style="width: 100%" v-model="recordform" placeholder="请选择">
<el-option
v-for="item in recordformList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
<el-dialog
width="50%"
title="检查项目"
:visible.sync="innerVisible"
append-to-body
>
<el-form label-width="100px" label-position="right">
<el-row
:gutter="24"
v-for="(item, $index) in fieldList"
:key="$index"
>
<el-col :span="12">
<el-form-item
v-if="item.field_type === 'string'"
:label="item.field_name"
>
<el-input placeholder="请输入" v-model="item.sort" />
</el-form-item>
<el-form-item
v-else-if="item.field_type === 'int'"
:label="item.field_name"
>
<el-input
width="120"
type="number"
placeholder="请输入"
v-model="item.sort"
/>
</el-form-item>
<el-form-item
v-else-if="item.field_type === 'float'"
:label="item.field_name"
>
<el-input
type="number"
placeholder="请输入"
v-model="item.sort"
/>
</el-form-item>
<el-form-item
v-else-if="item.field_type === 'date'"
:label="item.field_name"
>
<el-date-picker
v-model="item.create_time"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width: 100%"
>
</el-date-picker>
</el-form-item>
<el-form-item
v-else-if="item.field_type === 'datetime'"
:label="item.field_name"
>
<el-date-picker
v-model="item.create_time"
type="datetime"
placeholder="选择日期"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%"
>
</el-date-picker>
</el-form-item>
<el-form-item
v-else-if="item.field_type === 'select'"
:label="item.field_name"
>
<el-select
style="width: 100%"
v-model="item.sort"
placeholder="请选择"
>
<el-option
v-for="item1 in item.field_choice"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
v-else-if="item.field_type === 'selects'"
:label="item.field_name"
>
<el-select
style="width: 100%"
v-model="optio"
multiple
placeholder="请选择"
>
<el-option
v-for="item1 in item.field_choice"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否检验合格" width="50px">
<el-select
style="width: 100%"
v-model="item.is_testok"
placeholder="请选择"
>
<el-option
v-for="item in choice"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="是否合格" prop="sort_str">
<el-radio v-model="is_testok" label="true">检查合格</el-radio>
<el-radio v-model="is_testok" label="false">检查不合格</el-radio>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="innerVisible = false"> </el-button>
<el-button type="primary" @click="submitfield"
>提交检查项目</el-button
>
</div>
</el-dialog>
<div slot="footer" class="dialog-footer">
<el-button @click="outerVisible = false"> </el-button>
<el-button type="primary" @click="submitrecordform"
>填写检查项目</el-button
>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="半成品入库" :visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label="仓库" :label-width="formLabelWidth">
<el-select
style="width: 100%"
v-model="form.warehouse"
placeholder="请选择仓库"
>
<el-option
v-for="item in WarehouseData"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" :label-width="formLabelWidth">
<el-input v-model="form.remark" ></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="putin"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import { getwproductList ,wproductTest,wproductPutin} from "@/api/wpm";
getwproductList,
} from "@/api/wpm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { getWarehouseList } from "@/api/inm";
import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm";
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 defaultetestitem = {}; const defaultetestitem = {};
@ -127,35 +296,60 @@ export default {
data() { data() {
return { return {
testitem: defaultetestitem, testitem: defaultetestitem,
form:{},
wproductList: { wproductList: {
count: 0, count: 0,
},
wproductList1: {
count: 0,
}, },
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
actstate_:{ listQuery1: {
page: 1,
page_size: 20,
1:'生产中',
2:'待检测',
3:'已合格',
4:'库存中',
}, },
actstate_: {
1: "生产中",
2: "待检测",
3: "已合格",
4: "库存中",
},
choice: [
{
value: true,
label: "合格",
},
{
value: false,
label: "不合格",
},
],
options: [], options: [],
listLoading: true, listLoading: true,
dialogVisible: false, fieldList: "",
dialogType: "new", is_testok: "true",
rule1: { field: [],
name: [{ required: true, message: "请输入", trigger: "blur" }], recordformList: [],
term_number: [{ required: true, message: "请输入", trigger: "blur" }], recordform: "",
fifo_detail: "",
listQueryrecordform: {
page: 0,
}, },
outerVisible: false,
innerVisible: false,
dialogFormVisible:false,
testrecord: {},
WarehouseData:"",
}; };
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
this.getList(); this.getList();
this.getList1();
this.getLists(); this.getLists();
}, },
methods: { methods: {
@ -163,7 +357,7 @@ export default {
//半成品列表 //半成品列表
getList() { getList() {
this.listLoading = true; this.listLoading = true;
this.listQuery.act_state=2 this.listQuery.act_state = 2;
getwproductList(this.listQuery).then((response) => { getwproductList(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
this.wproductList = response.data; this.wproductList = response.data;
@ -171,83 +365,89 @@ export default {
this.listLoading = false; this.listLoading = false;
}); });
}, },
getList1() {
this.listQuery1.act_state = 3;
getwproductList(this.listQuery1).then((response) => {
if (response.data) {
this.wproductList1 = response.data;
}
getLists() {
getStandardList({ pageoff: true }).then((response) => {
this.options = genTree(response.data);
}); });
}, },
//仓库列表
getWarehouseLists(){
getWarehouseList({page:0}).then((response) => {
if (response.data) {
this.WarehouseData = response.data;
}
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
handleCreate() {
this.testitem = Object.assign({}, defaultetestitem);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
}); });
}, },
handleInspection(scope) {
handleEdit(scope) { //调该物料对应的检查表
this.testitem = Object.assign({}, scope.row); // copy obj this.outerVisible = true;
this.dialogType = "edit"; this.wproduct=scope.row.id;//半成品ID
this.dialogVisible = true; this.listQueryrecordform.material = scope.row.m_state;//
this.$nextTick(() => { this.listQueryrecordform.type = 2;
this.$refs["Form"].clearValidate(); getrecordformList(this.listQueryrecordform).then((response) => {
}); if (response.data) {
}, this.recordformList = response.data;
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteTestitem(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateTestitem(this.testitem.id, this.testitem).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createTestitem(this.testitem).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
} }
}); });
}, },
//根据选择的表渲染检查项目
submitrecordform() {
if (this.recordform != "") {
getrffieldList({ form: this.recordform, page: 0 }).then((response) => {
if (response.data) {
this.fieldList = response.data;
this.innerVisible = true;
}
});
} else this.$message.error("请选择检查表!");
},
//提交检查项目
submitfield() {
let _this = this;
_this.field = []; //检查项目
this.fieldList.forEach((item) => {
_this.field.push({
form_field:item.id,
field_value:item.sort,
is_testok:item.is_testok//单项检查结果
});
});
console.log(this.recordform);
this.testrecord.form = this.recordform;//检查表
this.testrecord.record_data = _this.field;//检查项列表
this.testrecord.is_testok = this.is_testok;//检查表检查结果
this.testrecord.wproduct = this.wproduct;//半成品ID
wproductTest(this.testrecord).then((res) => {
if (res.code >= 200) {
this.innerVisible = false;
this.outerVisible = false;
this.getList();
}
});
},
//半成品入库
handlePutin(scope){
this.dialogFormVisible=true;
this.getWarehouseLists();//仓库
this.id=scope.row.id;//半成品id
},
putin(){
wproductPutin(this.id,this.form).then((res) => {
if (res.code >= 200) {
this.$message.success("入库成功!");
this.dialogFormVisible=false;
}
});
}
}, },
}; };
</script> </script>

View File

@ -11,7 +11,6 @@
<el-table <el-table
:data="subproductionplanList.results" :data="subproductionplanList.results"
border border
stripe stripe
style="width: 100%" style="width: 100%"
height="300" height="300"
@ -32,9 +31,6 @@
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="子工序" width="160"> <el-table-column label="子工序" width="160">
<template slot-scope="scope" v-if="scope.row.steps"> <template slot-scope="scope" v-if="scope.row.steps">
<el-tag <el-tag
@ -63,14 +59,18 @@
<el-tag v-else>已领料</el-tag> <el-tag v-else>已领料</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="生产主产品"> <el-table-column label="生产主产品">
<template slot-scope="scope" v-if="main_product">{{ <template slot-scope="scope" v-if="main_product">{{
scope.row.main_product_.name scope.row.main_product_.name
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="生产进度"> <el-table-column label="生产进度">
<template slot-scope="scope">{{ scope.row.main_count_real }}/{{scope.row.main_count}}</template> <template slot-scope="scope"
</el-table-column> >{{ scope.row.main_count_real }}/{{
scope.row.main_count
}}</template
>
</el-table-column>
<el-table-column align="center" label="操作" width="130px"> <el-table-column align="center" label="操作" width="130px">
<template slot-scope="scope"> <template slot-scope="scope">
@ -103,6 +103,12 @@
@click="handlework(item)" @click="handlework(item)"
>{{ item.name }}</el-button >{{ item.name }}</el-button
> >
<el-button
type="primary"
@click="handleAll()"
style="float: right"
>显示全部子计划</el-button
>
</el-card> </el-card>
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
@ -188,8 +194,7 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-dialog :visible.sync="dialogVisiblenw" width="80%" title="领料">
<el-dialog :visible.sync="dialogVisiblenw" title="领料">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>生产所需领料表</span> <span>生产所需领料表</span>
@ -251,10 +256,54 @@
</el-table-column> </el-table-column>
<el-table-column prop="material_.unit" label="物料单位"> <el-table-column prop="material_.unit" label="物料单位">
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
@click="handlewproduct(scope)"
>选择半成品</el-link
>
</template>
</el-table-column>
</el-table> </el-table>
</template> </template>
</el-card> </el-card>
</el-dialog> </el-dialog>
<el-dialog title="半成品列表" :visible.sync="dialogTableVisible">
<el-table
:data="iproductData"
border
fit
stripe
highlight-current-row
max-height="600"
@selection-change="handleSelectionChanges"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column type="index" width="50" />
<el-table-column label="半成品编号">
<template slot-scope="scope">{{ scope.row.number }}</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_.name }}</template>
</el-table-column>
<el-table-column label="所在仓库">
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogTableVisible = false"> </el-button>
<el-button type="primary" @click="iproductsSubmit"> </el-button>
</div>
</el-dialog>
<el-dialog <el-dialog
:visible.sync="dialogVisiblework" :visible.sync="dialogVisiblework"
:fullscreen="true" :fullscreen="true"
@ -276,94 +325,103 @@
</el-step> </el-step>
</el-steps> </el-steps>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="12"> <el-col :span="14">
<el-card class="box-card" v-if="showPrise1&&values === 0"> <el-card class="box-card" v-if="showPrise1 && values === 0">
<div slot="header" class="clearfix" > <div slot="header" class="clearfix">
<span>消耗物料表</span> <span>消耗物料表</span>
<el-table :data="input" border style="width: 100%"> <el-table :data="input" border style="width: 100%">
<el-table-column
prop="material__name" <el-table-column
label="物料名称" prop="subproduction_plan"
width="180" label="子计划编号"
> width="180"
</el-table-column> >
<el-table-column </el-table-column>
prop="batch" <el-table-column
label="物料批次" prop="material_.name"
width="180" label="物料名称"
> width="180"
</el-table-column> >
<el-table-column prop="count" label="可用数量" width="180"> </el-table-column>
</el-table-column> <el-table-column prop="batch" label="物料批次" width="150">
<el-table-column prop="count_input" label="使用数量" width="180"> </el-table-column>
<template slot-scope="scope"> <el-table-column prop="count" label="可用数量" width="80">
<el-form :model="scope.row"> </el-table-column>
<el-form-item size="mini"> <el-table-column
<el-input-number prop="count_input"
v-model="scope.row.count_input" label="使用数量"
:min="0" width="180"
:value="0" >
></el-input-number> <template slot-scope="scope">
</el-form-item> <el-form :model="scope.row">
</el-form> <el-form-item size="mini">
</template> <el-input-number
</el-table-column> v-model="scope.row.count_input"
</el-table> :min="0"
</div> :value="0"
></el-input-number>
</el-form-item>
</el-form>
</template>
</el-table-column>
</el-table>
</div>
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="10">
<el-card class="box-card" v-if="values === 0&&showPrise"> <el-card class="box-card" v-if="values === 0 && showPrise">
<div slot="header" class="clearfix" > <div slot="header" class="clearfix">
<span>产出物料表</span> <span>产出物料表</span>
<el-table <el-table :data="output" border style="width: 100%">
:data="output" <el-table-column
prop="subproduction_plan"
label="子计划编号"
width="180"
>
</el-table-column>
<el-table-column
prop="material__name"
label="物料名称"
width="180"
>
</el-table-column>
border <el-table-column
style="width: 100%" prop="count_output"
> label="产出数量"
<el-table-column width="180"
prop="material__name" >
label="物料名称" <template slot-scope="scope">
width="180" <el-form :model="scope.row">
> <el-form-item size="mini">
</el-table-column> <el-input-number
v-model="scope.row.count_output"
<el-table-column prop="count_output" label="产出数量" width="180"> :min="0"
<template slot-scope="scope"> :value="0"
<el-form :model="scope.row"> ></el-input-number>
<el-form-item size="mini"> </el-form-item>
<el-input-number </el-form>
v-model="scope.row.count_output" </template>
:min="0" </el-table-column>
:value="0" </el-table>
></el-input-number> </div>
</el-form-item>
</el-form>
</template>
</el-table-column>
</el-table>
</div>
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
<el-card class="box-card" v-if="values === 0"> <el-card class="box-card" v-if="values === 0">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>备注</span> <span>备注</span>
</div> </div>
<el-form ref="form" label-width="80px"> <el-form ref="form" label-width="80px">
<el-form-item label="操作备注"> <el-form-item label="操作备注">
<el-input v-model="remark" width="300"></el-input> <el-input v-model="remark" width="300"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button <el-button style="margin-top: 12px" @click="next" v-if="values == 0"
style="margin-top: 12px" >下一步</el-button
@click="next" >
v-if="values == 0 "
>下一步</el-button
>
</el-card> </el-card>
<el-card <el-card
class="box-card" class="box-card"
@ -467,23 +525,21 @@
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
<el-button
style="margin-top: 12px"
@click="next"
v-if=" values == $index+2"
>下一步</el-button
>
<el-button <el-button
style="margin-top: 12px" style="margin-top: 12px"
@click="prev" @click="next"
v-if="values == $index+1" v-if="values == $index + 2"
>上一步</el-button >下一步</el-button
> >
<el-button
style="margin-top: 12px"
@click="prev"
v-if="values == $index + 1"
>上一步</el-button
>
</el-card> </el-card>
<div style="text-align: right; position: sticky">
<div style="text-align: right;position:sticky">
<el-button type="danger" @click="dialogVisiblework = false" <el-button type="danger" @click="dialogVisiblework = false"
>取消</el-button >取消</el-button
> >
@ -495,14 +551,15 @@
<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 { getProcessList, getStepLists } from "@/api/mtm";
import { import {
createPick, createPick,
getwmaterialList, getwmaterialList,
submitWork, submitWork,
getwproductList, getwproductList,
getsubplanList
} from "@/api/wpm"; } from "@/api/wpm";
import { getWarehouseList } from "@/api/inm"; import { getiproductList } from "@/api/inm";
import { createWork } from "@/api/wpm"; import { createWork } from "@/api/wpm";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteneed = {}; const defaulteneed = {};
@ -520,6 +577,7 @@ export default {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
iproductData:"",
remark: "", remark: "",
values: 0, values: 0,
active: 0, active: 0,
@ -527,7 +585,7 @@ export default {
havewl: "", havewl: "",
needwl: "", needwl: "",
showPrise: false, showPrise: false,
showPrise1:false, showPrise1: false,
state_: { state_: {
0: "制定中", 0: "制定中",
1: "已下达", 1: "已下达",
@ -538,7 +596,7 @@ export default {
listLoading: true, listLoading: true,
listLoading: true, listLoading: true,
id: "", id: "",
dialogTableVisible:false,
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
dialogVisiblework: false, dialogVisiblework: false,
@ -567,6 +625,9 @@ export default {
wproducts: [], wproducts: [],
otherforms: [], otherforms: [],
from: [], from: [],
workdata: {},
wproductdata: {},
iproducts: []
}; };
}, },
process: "", process: "",
@ -583,7 +644,7 @@ export default {
this.process = tab.name; this.process = tab.name;
this.listQuery.process = tab.name; this.listQuery.process = tab.name;
this.steps = []; this.steps = [];
getsubproductionplanList(this.listQuery).then((response) => { getsubplanList(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
this.subproductionplanList = response.data; this.subproductionplanList = response.data;
} }
@ -598,11 +659,22 @@ export default {
} }
this.listLoading = false; this.listLoading = false;
}); });
//子工序列表
getStepLists(tab.name).then((response) => {
if (response.data) {
this.steps = response.data;
}
this.listLoading = false;
});
this.getwproductLists();
}, },
//工序对应的子计划弹出对应的车间物料 //工序对应的子计划弹出对应的车间物料
handleCurrentChange(row) { handleCurrentChange(row) {
this.steps = row.steps; //调出子工序 // this.steps = row.steps; //调出子工序
this.subproduction_plan = row.id; //子计划Id this.subproduction_plan = row.id; //子计划Id
this.getwproductLists();
getwmaterialList({ getwmaterialList({
subproduction_plan__process: this.process, subproduction_plan__process: this.process,
subproduction_plan: row.id, subproduction_plan: row.id,
@ -613,7 +685,7 @@ export default {
} }
this.listLoading = false; this.listLoading = false;
}); });
this.getwproductLists();
}, },
//工序渲染 //工序渲染
getProcessList() { getProcessList() {
@ -625,7 +697,71 @@ export default {
}); });
}, },
//显示全部子计划
handleAll() {
this.listQuery.process = this.process;
this.subproduction_plan = "";
//子计划
getsubproductionplanList(this.listQuery).then((response) => {
if (response.data) {
this.subproductionplanList = response.data;
}
this.listLoading = false;
});
//车间物料表
getwmaterialList({
subproduction_plan__process: this.process,
page: 0,
}).then((response) => {
if (response.data) {
this.wmaterialList = response.data;
}
this.listLoading = false;
});
//半成品
getwproductList({page:0,p_state__process:this.process}).then((response) => {
if (response.data) {
this.wproductData = response.data;
//console.log( this.wproductData)
}
});
},
//大工序下子工序产出的半成品
getwproductLists() {
this.wproductdata.page = 0;
this.wproductdata.p_state__process = this.process;
if (this.subproduction_plan != "") {
this.wproductdata.subproduction_plan = this.subproduction_plan;
}
getwproductList(this.wproductdata).then((response) => {
if (response.data) {
this.wproductData = response.data;
//console.log( this.wproductData)
}
});
},
//调出该批次该仓库的所有半成品
handlewproduct(scope){
this.dialogTableVisible = true;
getiproductList({page:0,material:scope.row.material,warehouse:scope.row.warehouse,batch:scope.row.batch}).then((response) => {
if (response.data) {
this.iproductData= response.data;
}
this.listLoading = false;
});
},
//勾选半成品
handleSelectionChanges(val){
let _this = this;
_this.wpID = [];
val.forEach((item) => {
_this.wpID.push(item.id);
});
},
//领料 //领料
handleNeed(scope) { handleNeed(scope) {
this.need = Object.assign({}, defaulteneed); this.need = Object.assign({}, defaulteneed);
@ -641,7 +777,6 @@ export default {
//确认领料 //确认领料
handlePick() { handlePick() {
this.pickData.subproduction_plan = this.id; this.pickData.subproduction_plan = this.id;
this.pickData.picks = this.havewl; this.pickData.picks = this.havewl;
@ -673,12 +808,14 @@ export default {
handlework(item) { handlework(item) {
this.step = item.id; this.step = item.id;
// console.log(this.wpID); // console.log(this.wpID);
this.values=0; this.values = 0;
createWork({ this.workdata.step = item.id;
step: item.id, this.workdata.wproducts = this.wpID;
wproducts: this.wpID, if (this.subproduction_plan != "") {
subproduction_plan: this.subproduction_plan, this.workdata.subproduction_plan = this.subproduction_plan;
}).then((res) => { }
createWork(this.workdata).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.dialogVisiblework = true; this.dialogVisiblework = true;
this.forms = res.data.forms; this.forms = res.data.forms;
@ -686,26 +823,25 @@ export default {
this.otherforms.shift(); this.otherforms.shift();
//console.log(this.otherforms) //console.log(this.otherforms)
if ( res.data.forms[0].input !== undefined && res.data.forms[0].input.length > 0 ) if (
{ res.data.forms[0].input !== undefined &&
res.data.forms[0].input.length > 0
) {
this.input = res.data.forms[0].input; //消耗 this.input = res.data.forms[0].input; //消耗
this.showPrise1 = true; this.showPrise1 = true;
} } else {
else
{
this.showPrise1 = false; this.showPrise1 = false;
} }
if ( res.data.forms[0].output !== undefined && res.data.forms[0].output.length > 0 ) if (
{ res.data.forms[0].output !== undefined &&
res.data.forms[0].output.length > 0
) {
this.output = res.data.forms[0].output; //产出 this.output = res.data.forms[0].output; //产出
this.showPrise = true; this.showPrise = true;
} } else {
else
{
this.showPrise = false; this.showPrise = false;
} }
this.wproducts = res.data.forms[0].wproducts; this.wproducts = res.data.forms[0].wproducts;
} }
}); });
@ -748,19 +884,7 @@ export default {
} }
}); });
}, },
//大工序下子工序产出的半成品
getwproductLists() {
getwproductList({
page: 0,
subproduction_plan: this.subproduction_plan,
p_state__process: this.process,
}).then((response) => {
if (response.data) {
this.wproductData = response.data;
//console.log( this.wproductData)
}
});
},
}, },
}; };
</script> </script>