jianyan
This commit is contained in:
parent
e68f7fdb15
commit
6e2e80e77b
|
@ -95,3 +95,12 @@ export function createTestrecord(data) {
|
|||
data
|
||||
})
|
||||
}
|
||||
|
||||
//半成品库存
|
||||
export function getiproductList(query) {
|
||||
return request({
|
||||
url: '/inm/iproduct/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
|
@ -15,6 +15,15 @@ export function getwmaterialList(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
//车间生产计划
|
||||
export function getsubplanList(query) {
|
||||
return request({
|
||||
url: '/wpm/subplan/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
//车间操作
|
||||
export function createWork(data) {
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -316,8 +316,13 @@ export const asyncRoutes = [
|
|||
component: () => import('@/views/inm/fifodetail'),
|
||||
meta: { title: '仓库物料', perms: ['vendor_manage'] },
|
||||
hidden: true
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
path: 'wproduct',
|
||||
name: 'wproduct',
|
||||
component: () => import('@/views/inm/wproduct'),
|
||||
meta: { title: '半成品', icon: 'example', perms: ['index_manage'] }
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
|
|
@ -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>
|
|
@ -261,6 +261,13 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="fieldList.count > 0"
|
||||
:total="fieldList.count"
|
||||
:page.sync="listQueryfield.page"
|
||||
:limit.sync="listQueryfield.page_size"
|
||||
@pagination="fieldLists"
|
||||
/>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisible1"
|
||||
:title="dialogType1 === 'edit' ? '编辑表格字段' : '新增表格字段'"
|
||||
|
|
|
@ -1,32 +1,8 @@
|
|||
<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: 2px">
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="待检半成品">
|
||||
<el-card style="margin-top: 2px">
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="wproductList.results"
|
||||
|
@ -46,11 +22,11 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="检测状态">
|
||||
<template slot-scope="scope">
|
||||
{{actstate_[scope.row.act_state]}}
|
||||
{{ actstate_[scope.row.act_state] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="所在子工序">
|
||||
<el-table-column label="所在子工序">
|
||||
<template slot-scope="scope">{{ scope.row.p_state_.name }}</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -61,7 +37,6 @@
|
|||
@click="handleInspection(scope)"
|
||||
>检验</el-link
|
||||
>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -73,52 +48,246 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
:title="dialogType === 'edit' ? '编辑项目' : '新增项目'"
|
||||
>
|
||||
<el-form
|
||||
ref="Form"
|
||||
:model="testitem"
|
||||
label-width="80px"
|
||||
label-position="right"
|
||||
:rules="rule1"
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="已检半成品">
|
||||
<el-card style="margin-top: 2px">
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="wproductList1.results"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
max-height="600"
|
||||
>
|
||||
<el-form-item label="项目名称" prop="name">
|
||||
<el-input v-model="testitem.name" placeholder="项目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="条款号" prop="term_number">
|
||||
<el-input v-model="testitem.term_number" placeholder="条款号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准" prop="standard">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="testitem.standard"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="半成品名称">
|
||||
<template slot-scope="scope">{{ scope.row.m_state_.name }}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="半成品编号">
|
||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检测状态">
|
||||
<template slot-scope="scope">
|
||||
{{ actstate_[scope.row.act_state] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="所在子工序">
|
||||
<template slot-scope="scope">{{ scope.row.p_state_.name }}</template>
|
||||
</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>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="wproductList1.count > 0"
|
||||
:total="wproductList1.count"
|
||||
: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>
|
||||
</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>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getwproductList,
|
||||
} from "@/api/wpm";
|
||||
import { getwproductList ,wproductTest,wproductPutin} from "@/api/wpm";
|
||||
import checkPermission from "@/utils/permission";
|
||||
|
||||
import { getWarehouseList } from "@/api/inm";
|
||||
import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm";
|
||||
import { genTree } from "@/utils";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
const defaultetestitem = {};
|
||||
|
@ -127,35 +296,60 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
testitem: defaultetestitem,
|
||||
form:{},
|
||||
wproductList: {
|
||||
count: 0,
|
||||
},
|
||||
wproductList1: {
|
||||
count: 0,
|
||||
},
|
||||
listQuery: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
},
|
||||
actstate_:{
|
||||
|
||||
|
||||
1:'生产中',
|
||||
2:'待检测',
|
||||
3:'已合格',
|
||||
4:'库存中',
|
||||
listQuery1: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
},
|
||||
actstate_: {
|
||||
1: "生产中",
|
||||
2: "待检测",
|
||||
3: "已合格",
|
||||
4: "库存中",
|
||||
},
|
||||
choice: [
|
||||
{
|
||||
value: true,
|
||||
label: "合格",
|
||||
},
|
||||
{
|
||||
value: false,
|
||||
label: "不合格",
|
||||
},
|
||||
],
|
||||
options: [],
|
||||
listLoading: true,
|
||||
dialogVisible: false,
|
||||
dialogType: "new",
|
||||
rule1: {
|
||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
term_number: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
fieldList: "",
|
||||
is_testok: "true",
|
||||
field: [],
|
||||
recordformList: [],
|
||||
recordform: "",
|
||||
fifo_detail: "",
|
||||
listQueryrecordform: {
|
||||
page: 0,
|
||||
},
|
||||
outerVisible: false,
|
||||
innerVisible: false,
|
||||
dialogFormVisible:false,
|
||||
testrecord: {},
|
||||
WarehouseData:"",
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getList1();
|
||||
this.getLists();
|
||||
},
|
||||
methods: {
|
||||
|
@ -163,7 +357,7 @@ export default {
|
|||
//半成品列表
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
this.listQuery.act_state=2
|
||||
this.listQuery.act_state = 2;
|
||||
getwproductList(this.listQuery).then((response) => {
|
||||
if (response.data) {
|
||||
this.wproductList = response.data;
|
||||
|
@ -171,83 +365,89 @@ export default {
|
|||
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();
|
||||
});
|
||||
},
|
||||
|
||||
handleEdit(scope) {
|
||||
this.testitem = Object.assign({}, scope.row); // copy obj
|
||||
this.dialogType = "edit";
|
||||
this.dialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["Form"].clearValidate();
|
||||
});
|
||||
},
|
||||
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;
|
||||
},
|
||||
handleInspection(scope) {
|
||||
//调该物料对应的检查表
|
||||
this.outerVisible = true;
|
||||
this.wproduct=scope.row.id;//半成品ID
|
||||
this.listQueryrecordform.material = scope.row.m_state;//
|
||||
this.listQueryrecordform.type = 2;
|
||||
getrecordformList(this.listQueryrecordform).then((response) => {
|
||||
if (response.data) {
|
||||
this.recordformList = response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
//根据选择的表,渲染检查项目
|
||||
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>
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
<el-table
|
||||
:data="subproductionplanList.results"
|
||||
border
|
||||
|
||||
stripe
|
||||
style="width: 100%"
|
||||
height="300"
|
||||
|
@ -32,9 +31,6 @@
|
|||
}}</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column label="子工序" width="160">
|
||||
<template slot-scope="scope" v-if="scope.row.steps">
|
||||
<el-tag
|
||||
|
@ -63,14 +59,18 @@
|
|||
<el-tag v-else>已领料</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生产主产品">
|
||||
<el-table-column label="生产主产品">
|
||||
<template slot-scope="scope" v-if="main_product">{{
|
||||
scope.row.main_product_.name
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生产进度">
|
||||
<template slot-scope="scope">{{ scope.row.main_count_real }}/{{scope.row.main_count}}</template>
|
||||
</el-table-column>
|
||||
<template slot-scope="scope"
|
||||
>{{ scope.row.main_count_real }}/{{
|
||||
scope.row.main_count
|
||||
}}</template
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="操作" width="130px">
|
||||
<template slot-scope="scope">
|
||||
|
@ -103,6 +103,12 @@
|
|||
@click="handlework(item)"
|
||||
>{{ item.name }}</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleAll()"
|
||||
style="float: right"
|
||||
>显示全部子计划</el-button
|
||||
>
|
||||
</el-card>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
|
@ -188,8 +194,7 @@
|
|||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
<el-dialog :visible.sync="dialogVisiblenw" title="领料">
|
||||
<el-dialog :visible.sync="dialogVisiblenw" width="80%" title="领料">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>生产所需领料表</span>
|
||||
|
@ -251,10 +256,54 @@
|
|||
</el-table-column>
|
||||
<el-table-column prop="material_.unit" label="物料单位">
|
||||
</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>
|
||||
</template>
|
||||
</el-card>
|
||||
</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
|
||||
:visible.sync="dialogVisiblework"
|
||||
:fullscreen="true"
|
||||
|
@ -276,94 +325,103 @@
|
|||
</el-step>
|
||||
</el-steps>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-card class="box-card" v-if="showPrise1&&values === 0">
|
||||
<div slot="header" class="clearfix" >
|
||||
<el-col :span="14">
|
||||
<el-card class="box-card" v-if="showPrise1 && values === 0">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>消耗物料表</span>
|
||||
|
||||
<el-table :data="input" border style="width: 100%">
|
||||
<el-table-column
|
||||
prop="material__name"
|
||||
label="物料名称"
|
||||
width="180"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="batch"
|
||||
label="物料批次"
|
||||
width="180"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column prop="count" label="可用数量" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="count_input" label="使用数量" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-form :model="scope.row">
|
||||
<el-form-item size="mini">
|
||||
<el-input-number
|
||||
v-model="scope.row.count_input"
|
||||
:min="0"
|
||||
:value="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-table :data="input" border style="width: 100%">
|
||||
|
||||
<el-table-column
|
||||
prop="subproduction_plan"
|
||||
label="子计划编号"
|
||||
width="180"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="material_.name"
|
||||
label="物料名称"
|
||||
width="180"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column prop="batch" label="物料批次" width="150">
|
||||
</el-table-column>
|
||||
<el-table-column prop="count" label="可用数量" width="80">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="count_input"
|
||||
label="使用数量"
|
||||
width="180"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-form :model="scope.row">
|
||||
<el-form-item size="mini">
|
||||
<el-input-number
|
||||
v-model="scope.row.count_input"
|
||||
:min="0"
|
||||
:value="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card class="box-card" v-if="values === 0&&showPrise">
|
||||
<div slot="header" class="clearfix" >
|
||||
<el-col :span="10">
|
||||
<el-card class="box-card" v-if="values === 0 && showPrise">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>产出物料表</span>
|
||||
|
||||
<el-table
|
||||
:data="output"
|
||||
<el-table :data="output" border style="width: 100%">
|
||||
<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
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
prop="material__name"
|
||||
label="物料名称"
|
||||
width="180"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="count_output" label="产出数量" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-form :model="scope.row">
|
||||
<el-form-item size="mini">
|
||||
<el-input-number
|
||||
v-model="scope.row.count_output"
|
||||
:min="0"
|
||||
:value="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-table-column
|
||||
prop="count_output"
|
||||
label="产出数量"
|
||||
width="180"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-form :model="scope.row">
|
||||
<el-form-item size="mini">
|
||||
<el-input-number
|
||||
v-model="scope.row.count_output"
|
||||
:min="0"
|
||||
:value="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-card class="box-card" v-if="values === 0">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>备注</span>
|
||||
</div>
|
||||
<el-form ref="form" label-width="80px">
|
||||
<el-form-item label="操作备注">
|
||||
<el-input v-model="remark" width="300"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button
|
||||
style="margin-top: 12px"
|
||||
@click="next"
|
||||
v-if="values == 0 "
|
||||
>下一步</el-button
|
||||
>
|
||||
</div>
|
||||
<el-form ref="form" label-width="80px">
|
||||
<el-form-item label="操作备注">
|
||||
<el-input v-model="remark" width="300"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button style="margin-top: 12px" @click="next" v-if="values == 0"
|
||||
>下一步</el-button
|
||||
>
|
||||
</el-card>
|
||||
<el-card
|
||||
class="box-card"
|
||||
|
@ -467,23 +525,21 @@
|
|||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-button
|
||||
style="margin-top: 12px"
|
||||
@click="next"
|
||||
v-if=" values == $index+2"
|
||||
>下一步</el-button
|
||||
>
|
||||
<el-button
|
||||
style="margin-top: 12px"
|
||||
@click="prev"
|
||||
v-if="values == $index+1"
|
||||
>上一步</el-button
|
||||
>
|
||||
style="margin-top: 12px"
|
||||
@click="next"
|
||||
v-if="values == $index + 2"
|
||||
>下一步</el-button
|
||||
>
|
||||
<el-button
|
||||
style="margin-top: 12px"
|
||||
@click="prev"
|
||||
v-if="values == $index + 1"
|
||||
>上一步</el-button
|
||||
>
|
||||
</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
|
||||
>
|
||||
|
@ -495,14 +551,15 @@
|
|||
<script>
|
||||
import { getsubproductionplanList, createPick_need } from "@/api/pm";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import { getProcessList } from "@/api/mtm";
|
||||
import { getProcessList, getStepLists } from "@/api/mtm";
|
||||
import {
|
||||
createPick,
|
||||
getwmaterialList,
|
||||
submitWork,
|
||||
getwproductList,
|
||||
getsubplanList
|
||||
} from "@/api/wpm";
|
||||
import { getWarehouseList } from "@/api/inm";
|
||||
import { getiproductList } from "@/api/inm";
|
||||
import { createWork } from "@/api/wpm";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
const defaulteneed = {};
|
||||
|
@ -520,6 +577,7 @@ export default {
|
|||
page: 1,
|
||||
page_size: 20,
|
||||
},
|
||||
iproductData:"",
|
||||
remark: "",
|
||||
values: 0,
|
||||
active: 0,
|
||||
|
@ -527,7 +585,7 @@ export default {
|
|||
havewl: "",
|
||||
needwl: "",
|
||||
showPrise: false,
|
||||
showPrise1:false,
|
||||
showPrise1: false,
|
||||
state_: {
|
||||
0: "制定中",
|
||||
1: "已下达",
|
||||
|
@ -538,7 +596,7 @@ export default {
|
|||
listLoading: true,
|
||||
listLoading: true,
|
||||
id: "",
|
||||
|
||||
dialogTableVisible:false,
|
||||
dialogVisible: false,
|
||||
dialogType: "new",
|
||||
dialogVisiblework: false,
|
||||
|
@ -567,6 +625,9 @@ export default {
|
|||
wproducts: [],
|
||||
otherforms: [],
|
||||
from: [],
|
||||
workdata: {},
|
||||
wproductdata: {},
|
||||
iproducts: []
|
||||
};
|
||||
},
|
||||
process: "",
|
||||
|
@ -583,7 +644,7 @@ export default {
|
|||
this.process = tab.name;
|
||||
this.listQuery.process = tab.name;
|
||||
this.steps = [];
|
||||
getsubproductionplanList(this.listQuery).then((response) => {
|
||||
getsubplanList(this.listQuery).then((response) => {
|
||||
if (response.data) {
|
||||
this.subproductionplanList = response.data;
|
||||
}
|
||||
|
@ -598,11 +659,22 @@ export default {
|
|||
}
|
||||
this.listLoading = false;
|
||||
});
|
||||
//子工序列表
|
||||
|
||||
getStepLists(tab.name).then((response) => {
|
||||
if (response.data) {
|
||||
this.steps = response.data;
|
||||
}
|
||||
this.listLoading = false;
|
||||
});
|
||||
this.getwproductLists();
|
||||
},
|
||||
//工序对应的子计划,弹出对应的车间物料
|
||||
handleCurrentChange(row) {
|
||||
this.steps = row.steps; //调出子工序
|
||||
// this.steps = row.steps; //调出子工序
|
||||
|
||||
this.subproduction_plan = row.id; //子计划Id
|
||||
this.getwproductLists();
|
||||
getwmaterialList({
|
||||
subproduction_plan__process: this.process,
|
||||
subproduction_plan: row.id,
|
||||
|
@ -613,7 +685,7 @@ export default {
|
|||
}
|
||||
this.listLoading = false;
|
||||
});
|
||||
this.getwproductLists();
|
||||
|
||||
},
|
||||
//工序渲染
|
||||
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) {
|
||||
this.need = Object.assign({}, defaulteneed);
|
||||
|
@ -641,7 +777,6 @@ export default {
|
|||
|
||||
//确认领料
|
||||
handlePick() {
|
||||
|
||||
this.pickData.subproduction_plan = this.id;
|
||||
this.pickData.picks = this.havewl;
|
||||
|
||||
|
@ -673,12 +808,14 @@ export default {
|
|||
handlework(item) {
|
||||
this.step = item.id;
|
||||
// console.log(this.wpID);
|
||||
this.values=0;
|
||||
createWork({
|
||||
step: item.id,
|
||||
wproducts: this.wpID,
|
||||
subproduction_plan: this.subproduction_plan,
|
||||
}).then((res) => {
|
||||
this.values = 0;
|
||||
this.workdata.step = item.id;
|
||||
this.workdata.wproducts = this.wpID;
|
||||
if (this.subproduction_plan != "") {
|
||||
this.workdata.subproduction_plan = this.subproduction_plan;
|
||||
}
|
||||
|
||||
createWork(this.workdata).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.dialogVisiblework = true;
|
||||
this.forms = res.data.forms;
|
||||
|
@ -686,26 +823,25 @@ export default {
|
|||
this.otherforms.shift();
|
||||
//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.showPrise1 = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
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.showPrise = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.showPrise = false;
|
||||
}
|
||||
|
||||
|
||||
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>
|
Loading…
Reference in New Issue