chejiancaozuo

This commit is contained in:
shilixia 2021-11-10 09:07:35 +08:00
parent d5336df9fc
commit 1665ee1f76
13 changed files with 1419 additions and 691 deletions

View File

@ -2,8 +2,8 @@
ENV = 'development' ENV = 'development'
# base api # base api
VUE_APP_BASE_API = 'http://127.0.0.1:8000/api' #VUE_APP_BASE_API = 'http://127.0.0.1:8000/api'
#VUE_APP_BASE_API = 'http://47.95.0.242:2222/api' VUE_APP_BASE_API = 'http://47.95.0.242:2222/api'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,

View File

@ -69,3 +69,13 @@ export function getmaterialbatchList(query) {
params: query params: query
}) })
} }
//库存审核
export function audit(id, data) {
return request({
url: `/inm/fifo/${id}/audit/`,
method: 'post',
data
})
}

View File

@ -57,3 +57,11 @@ export function deleteTestitem(id, data) {
data data
}) })
} }
//提交物料检查项目
export function createTestrecord(data) {
return request({
url: '/qm/testrecord/',
method: 'post',
data
})
}

View File

@ -14,4 +14,29 @@ export function getwmaterialList(query) {
method: 'get', method: 'get',
params: query params: query
}) })
} }
//车间操作
export function createWork(data) {
return request({
url: '/wpm/do/init/',
method: 'post',
data
})
}
//提交
export function submitWork(data) {
return request({
url: '/wpm/do/submit/',
method: 'post',
data
})
}
//子工序半成品
export function getwproductList(query) {
return request({
url: '/wpm/wproduct/',
method: 'get',
params: query
})
}

View File

@ -2,35 +2,35 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="仓库名称/仓库编号" placeholder="仓库名称/仓库编号"
style="width: 300px" style="width: 300px"
class="filter-item" class="filter-item"
@keyup.enter.native="handleFilter" @keyup.enter.native="handleFilter"
/> />
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button >搜索</el-button
> >
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button >重置</el-button
> >
</div> </div>
</el-card> </el-card>
<el-card style="margin-top: 2px"> <el-card style="margin-top: 2px">
<div style="margin-top: 2px"> <div style="margin-top: 2px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增物料</el-button >新增物料</el-button
> >
</div> </div>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="fifoList.results" :data="fifoList.results"
@ -40,34 +40,42 @@
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="仓库"> <el-table-column label="仓库">
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template> <template slot-scope="scope">{{
scope.row.warehouse_.name
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="出库入人员"> <el-table-column label="出库入人员">
<template slot-scope="scope">{{ scope.row.operator_.username }}</template> <template slot-scope="scope">{{
scope.row.operator_.username
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="出入库时间"> <el-table-column label="出入库时间">
<template slot-scope="scope">{{ scope.row.inout_date }}</template> <template slot-scope="scope">{{ scope.row.inout_date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="出入库类型"> <el-table-column label="出入库类型">
<template slot-scope="scope">{{ types_[scope.row.type] }}</template> <template slot-scope="scope">{{ types_[scope.row.type] }}</template>
</el-table-column> </el-table-column>
<el-table-column label="是否审核">
<el-table-column <template slot-scope="scope">
align="center" <el-tag v-if="scope.row.is_audited == false">未审核</el-tag>
label="操作" <el-tag v-else>已审核</el-tag>
width="220px" </template>
> </el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['warehouse_update'])"
@click="handleDetail(scope)" @click="handleDetail(scope)"
>查看详情</el-link >查看</el-link
>
<el-link
v-if="scope.row.is_audited == false"
@click="handleAudit(scope)"
>审核</el-link
> >
<el-link <el-link
v-if="checkPermission(['warehouse_delete'])" v-if="checkPermission(['warehouse_delete'])"
@ -86,7 +94,7 @@
@pagination="getList" @pagination="getList"
/> />
</el-card> </el-card>
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:title="dialogType === 'edit' ? '编辑仓库' : '新增仓库'" :title="dialogType === 'edit' ? '编辑仓库' : '新增仓库'"
> >
@ -98,66 +106,132 @@
:rules="rule1" :rules="rule1"
> >
<el-form-item label="仓库" prop="warehouse"> <el-form-item label="仓库" prop="warehouse">
<el-select v-model="inventory.warehouse" placeholder="请选择" filterable > <el-select
<el-option v-for="item in warehouseData" :key="item.value" :label="item.label" :value="item.value" /> v-model="inventory.warehouse"
</el-select> placeholder="请选择"
</el-form-item> filterable
<el-form-item label="操作人" prop="operator"> >
<el-select v-model="inventory.operator" placeholder="请选择" filterable > <el-option
<el-option v-for="item in userData" :key="item.value" :label="item.label" :value="item.value" /> v-for="item in warehouseData"
</el-select> :key="item.value"
</el-form-item> :label="item.label"
<el-form-item label="入库时间" prop="inout_date"> :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 <el-date-picker
v-model="inventory.inout_date" v-model="inventory.inout_date"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width:100%" style="width: 100%"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<div v-for="(item,index) in inventory.details" :key="index"> <div v-for="(item, index) in inventory.details" :key="index">
<el-row> <el-row>
<el-col :span="8" style="margin-right:10px;"> <el-col :span="8" style="margin-right: 10px">
<el-form-item class="material" label="物料:" :prop="'details.'+index+'.material'" > <el-form-item
<el-select v-model="item.material" size="small" > class="material"
<el-option v-for="item in materialoptions" label="物料:"
:key="item.value" :prop="'details.' + index + '.material'"
:value="item.value" >
:label="item.label"> <el-select v-model="item.material" size="small">
</el-option> <el-option
</el-select> v-for="item in materialoptions"
</el-form-item> :key="item.value"
</el-col> :value="item.value"
<el-col :span="8" style="margin-right:10px;"> :label="item.label"
<el-form-item class="count" label="数量" :prop="'details.'+index+'.count'" > >
<el-input-number v-model="item.count" :min="0"></el-input-number> </el-option>
</el-form-item> </el-select>
</el-col> </el-form-item>
<el-col :span="6" style="margin-right:10px;"> </el-col>
<el-form-item class="batch" label="批次" :prop="'details.'+index+'.batch'" > <el-col :span="8" style="margin-right: 10px">
<el-input v-model="item.batch" placeholder="批次号" ></el-input> <el-form-item
</el-form-item> class="count"
</el-col> label="数量"
<!-- 删除按钮 --> :prop="'details.' + index + '.count'"
<el-col :span="1" > >
<el-tooltip class="item" effect="dark" content="删除" placement="top"> <el-input-number
<el-button @click="deleteItem(index)" style='border:none;background:none;padding:0px;margin-top:4px;'> v-model="item.count"
<i class="el-icon-remove-outline" style='font-size:20px;'></i> :min="0"
</el-button> ></el-input-number>
</el-tooltip> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="6" style="margin-right: 10px">
</div> <el-form-item
<div> class="batch"
<el-tooltip class="item" effect="dark" content="添加条件" placement="top"> label="批次"
<el-button @click="addConditions" style='cursor:pointer;width:95%;color:#fe000c;border:1px dashed #fe000c;height:40px;padding:0px;margin-top: 2px;margin-left:20px;font-size:26px'> :prop="'details.' + index + '.batch'"
+ >
</el-button> <el-input v-model="item.batch" placeholder="批次号"></el-input>
</el-tooltip> </el-form-item>
</div> </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: 2px;
margin-left: 20px;
font-size: 26px;
"
>
+
</el-button>
</el-tooltip>
</div>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button> <el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -167,140 +241,151 @@
</div> </div>
</template> </template>
<script> <script>
import {getfifoList,createInventory,getWarehouseList} from "@/api/inm"; import {
getfifoList,
createInventory,
getWarehouseList,
audit,
} from "@/api/inm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { getMaterialList} from "@/api/mtm"; import { getMaterialList } from "@/api/mtm";
import { getUserList} from "@/api/user"; 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 defaulteinventory = { const defaulteinventory = {
details:[ details: [
{ {
material:'', // 物料 material: "", // 物料
count:'',//数量 count: "", //数量
batch:'',//批次 batch: "", //批次
},
} ],
],
}; };
export default { export default {
components: { Pagination }, components: { Pagination },
data() { data() {
return { return {
inventory: defaulteinventory, inventory: defaulteinventory,
fifoList: { fifoList: {
count: 0, count: 0,
}, },
types_:{ types_: {
1: "生产领料",
1:'生产领料', 2: "销售提货",
2:'销售提货', 3: "采购入库",
3:'采购入库', 4: "生产入库",
4:'生产入库',
}, },
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
warehouseData:[], warehouseData: [],
materialoptions:[], materialoptions: [],
userData:[], userData: [],
listLoading: true, listLoading: true,
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
rule1: { rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }], name: [{ required: true, message: "请输入", trigger: "blur" }],
}, },
}; };
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
this.getlists() this.getlists();
this.getList(); this.getList();
this.getUser(); this.getUser();
this.getmaterialList(); this.getmaterialList();
}, },
methods: { methods: {
checkPermission, checkPermission,
getList() { getList() {
this.listLoading = true; this.listLoading = true;
getfifoList(this.listQuery).then((response) => { getfifoList(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
this.fifoList = response.data; this.fifoList = response.data;
} }
this.listLoading = false; this.listLoading = false;
}); });
}, },
//出入库详情 //出入库详情
handleDetail(scope){ handleDetail(scope) {
this.$router.push({name: "fifodetail", params: { id: scope.row.id }, }) this.$router.push({ name: "fifodetail", params: { id: scope.row.id } });
}, },
getlists(){ getlists() {
getWarehouseList({page:0}).then((response) => { getWarehouseList({ page: 0 }).then((response) => {
if (response.data) { if (response.data) {
this.warehouseData = genTree(response.data); this.warehouseData = genTree(response.data);
} }
this.listLoading = false; 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)
}, },
//物料 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() { getmaterialList() {
this.listLoading = true; this.listLoading = true;
getMaterialList({pageoff:true}).then((response) => { getMaterialList({ pageoff: true }).then((response) => {
if (response.data) { if (response.data) {
this.materialoptions = genTree(response.data); this.materialoptions = genTree(response.data);
} }
this.listLoading = false; this.listLoading = false;
}); });
}, },
handleCreate() handleCreate() {
{ this.inventory.details = [
this.inventory.details=[ {
{ material: "", // 物料
material:'', // 物料 count: "", //数量
count:'',//数量 batch: "", //批次
batch:'',//批次 },
];
} this.inventory = Object.assign({}, defaulteinventory);
];
this.inventory = Object.assign({}, defaulteinventory);
this.dialogType = "new"; this.dialogType = "new";
this.dialogVisible = true; this.dialogVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
//审核
handleAudit(scope) {
this.$confirm("是否通过?", "提示", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await audit(scope.row.id);
this.getList();
this.$message.success("已审核");
})
.catch((err) => {
console.error(err);
});
},
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
@ -309,25 +394,21 @@ export default {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
} };
this.getList(); this.getList();
}, },
async confirm(form) { async confirm(form) {
console.log(this.inventory) console.log(this.inventory);
createInventory(this.inventory).then((res) => { createInventory(this.inventory).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.getList(); this.getList();
this.dialogVisible = false; this.dialogVisible = false;
this.$message.success("成功"); this.$message.success("成功");
} }
}); });
}, },
}, },
}; };
</script> </script>

View File

@ -1,32 +1,6 @@
<template> <template>
<div class="app-container"> <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-card style="margin-top: 2px">
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="fifodetailList.results" :data="fifodetailList.results"
@ -36,30 +10,53 @@
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="物料名称"> <el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template> <template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="物料批次"> <el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</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.material_.number }}</template> <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.material_.unit }}</template> <template slot-scope="scope">{{ scope.row.material_.unit }}</template>
</el-table-column> </el-table-column>
<el-table-column label="物料型号"> <el-table-column label="物料型号">
<template slot-scope="scope">{{ scope.row.material_.specification }}</template> <template slot-scope="scope">{{
scope.row.material_.specification
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="入库数量">
<el-table-column label="入库数量">
<template slot-scope="scope">{{ scope.row.count }}</template> <template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column> </el-table-column>
<el-table-column label="是否检查">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_tested == false">未检查</el-tag>
<el-tag v-else>已检查</el-tag>
</template>
</el-table-column>
<el-table-column label="检查是否合格">
<template slot-scope="scope" v-if="scope.row.is_tested == true">
<el-tag v-if="scope.row.is_testok == false">不合格</el-tag>
<el-tag v-else>合格</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="scope.row.is_tested == false"
@click="handleMaterial(scope)"
>检查</el-link
>
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="fifodetailList.count > 0" v-show="fifodetailList.count > 0"
@ -69,14 +66,146 @@
@pagination="getList" @pagination="getList"
/> />
</el-card> </el-card>
<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="30%"
title="检查项目"
:visible.sync="innerVisible"
append-to-body
>
<el-form label-width="80px" label-position="right">
<el-row v-for="(item, $index) in fieldList" :key="$index">
<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
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-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>
</div> </div>
</template> </template>
<script> <script>
import { getfifodetailList } from "@/api/inm"; import { getfifodetailList } from "@/api/inm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { getMaterialList} from "@/api/mtm"; import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm";
import { getUserList} from "@/api/user"; import { createTestrecord } from "@/api/qm";
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
@ -84,22 +213,32 @@ export default {
components: { Pagination }, components: { Pagination },
data() { data() {
return { return {
InventoryList: {
InventoryList: { count: 0,
},
fifodetailList: {
count: 0, count: 0,
}, },
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
fieldList: {
listLoading: true, count: 0,
dialogVisible: false, },
dialogType: "new", is_testok: "true",
field: [],
recordformList: [],
recordform: "",
fifo_detail: "",
listQueryrecordform: {
page: 0,
},
outerVisible: false,
innerVisible: false,
testrecord: {},
rule1: { rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }], name: [{ required: true, message: "请输入", trigger: "blur" }],
}, },
}; };
}, },
@ -110,22 +249,67 @@ export default {
}, },
methods: { methods: {
checkPermission, checkPermission,
getList() { getList() {
this.listLoading = true; this.listLoading = true;
this.listQuery.fifo=this.$route.params.id; this.listQuery.fifo = this.$route.params.id;
getfifodetailList(this.listQuery).then((response) => { getfifodetailList(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
this.fifodetailList = response.data; this.fifodetailList = response.data;
} }
this.listLoading = false; this.listLoading = false;
}); });
}, },
handleMaterial(scope) {
//调该物料对应的检查表
this.outerVisible = true;
this.fifo_detail = scope.row.id;
this.listQueryrecordform.material = scope.row.material;
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
});
});
console.log(this.recordform);
this.testrecord.form = this.recordform;
this.testrecord.record_data = _this.field;
this.testrecord.fifo_item = this.fifo_detail;
this.testrecord.is_testok = this.is_testok;
createTestrecord(this.testrecord).then((res) => {
if (res.code >= 200) {
this.innerVisible = false;
this.outerVisible = false;
this.getList();
}
});
},
}, },
}; };
</script> </script>

View File

@ -2,31 +2,30 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="仓库名称/仓库编号" placeholder="仓库名称/仓库编号"
style="width: 300px" style="width: 300px"
class="filter-item" class="filter-item"
@keyup.enter.native="handleFilter" @keyup.enter.native="handleFilter"
/> />
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button >搜索</el-button
> >
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button >重置</el-button
> >
</div> </div>
</el-card> </el-card>
<el-card style="margin-top: 2px"> <el-card style="margin-top: 2px">
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="InventoryList.results" :data="InventoryList.results"
@ -36,32 +35,32 @@
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="物料批次"> <el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</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.material_.name }}</template> <template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="物料编号"> <el-table-column label="物料编号">
<template slot-scope="scope">{{ scope.row.material_.number }}</template> <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.warehouse_.name }}</template> <template slot-scope="scope">{{
scope.row.warehouse_.name
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="仓库编号"> <el-table-column label="仓库编号">
<template slot-scope="scope">{{ scope.row.warehouse_.number }}</template> <template slot-scope="scope">{{
scope.row.warehouse_.number
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="物料总存量"> <el-table-column label="物料总存量">
<template slot-scope="scope">{{ scope.row.count }}</template> <template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="InventoryList.count > 0" v-show="InventoryList.count > 0"
@ -71,14 +70,19 @@
@pagination="getList" @pagination="getList"
/> />
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import { getInventoryList,getfifoList,getmaterialbatchList,createInventory,getWarehouseList } 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 { getMaterialList } from "@/api/mtm";
import { getUserList} from "@/api/user"; 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
@ -86,46 +90,39 @@ export default {
components: { Pagination }, components: { Pagination },
data() { data() {
return { return {
InventoryList: {
InventoryList: {
count: 0, count: 0,
}, },
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
rule1: { rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }], name: [{ 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;
getmaterialbatchList(this.listQuery).then((response) => { getmaterialbatchList(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
this.InventoryList = response.data; this.InventoryList = response.data;
} }
this.listLoading = false; this.listLoading = false;
}); });
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
@ -134,13 +131,9 @@ export default {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
} };
this.getList(); this.getList();
}, },
}, },
}; };
</script> </script>

View File

@ -2,33 +2,33 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="仓库名称/仓库编号" placeholder="仓库名称/仓库编号"
style="width: 300px" style="width: 300px"
class="filter-item" class="filter-item"
@keyup.enter.native="handleFilter" @keyup.enter.native="handleFilter"
/> />
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button >搜索</el-button
> >
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button >重置</el-button
> >
</div> </div>
<div style="margin-top: 2px"> <div style="margin-top: 2px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增仓库</el-button >新增仓库</el-button
> >
</div> </div>
</el-card> </el-card>
<el-card style="margin-top: 2px"> <el-card style="margin-top: 2px">
<el-table <el-table
@ -44,24 +44,20 @@
<el-table-column label="仓库名称"> <el-table-column label="仓库名称">
<template slot-scope="scope">{{ scope.row.name }}</template> <template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </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.number }}</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.place }}</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.create_time }}</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center" label="操作" width="220px">
align="center"
label="操作"
width="220px"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['warehouse_update'])"
@click="handleMaterial(scope)" @click="handleMaterial(scope)"
>查看物料</el-link >查看物料</el-link
@ -105,10 +101,9 @@
<el-form-item label="仓库编号" prop="number"> <el-form-item label="仓库编号" prop="number">
<el-input v-model="warehouse.number" placeholder="仓库编号" /> <el-input v-model="warehouse.number" placeholder="仓库编号" />
</el-form-item> </el-form-item>
<el-form-item label="具体地点" prop="place"> <el-form-item label="具体地点" prop="place">
<el-input v-model="warehouse.place" placeholder="具体地点" /> <el-input v-model="warehouse.place" placeholder="具体地点" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button> <el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -118,45 +113,52 @@
</div> </div>
</template> </template>
<script> <script>
import { getWarehouseList, createWarehouse,updateWarehouse,deleteWarehouse } from "@/api/inm"; import {
getWarehouseList,
createWarehouse,
updateWarehouse,
deleteWarehouse,
} from "@/api/inm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
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 = { const defaultewarehouse = {};
};
export default { export default {
components: { Pagination }, components: { Pagination },
data() { data() {
return { return {
warehouse: defaultewarehouse, warehouse: defaultewarehouse,
warehouseList: { warehouseList: {
count: 0, count: 0,
}, },
options: [{ options: [
{
value: 0, value: 0,
label: '运转正常' label: "运转正常",
}, { },
{
value: 1, value: 1,
label: '停用' label: "停用",
}, { },
{
value: 2, value: 2,
label: '报废' label: "报废",
}], },
],
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
keeperOptions:[], keeperOptions: [],
depOptions:[], depOptions: [],
listLoading: true, listLoading: true,
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
rule1: { rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }], name: [{ required: true, message: "请输入", trigger: "blur" }],
number: [{ required: true, message: "请输入", trigger: "blur" }], number: [{ required: true, message: "请输入", trigger: "blur" }],
place: [{ required: true, message: "请输入", trigger: "blur" }], place: [{ required: true, message: "请输入", trigger: "blur" }],
}, },
}; };
}, },
@ -177,9 +179,9 @@ export default {
this.listLoading = false; this.listLoading = false;
}); });
}, },
//跳转到该仓库的物料表 //跳转到该仓库的物料表
handleMaterial(scope){ handleMaterial(scope) {
this.$router.push({name: "inventory", 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;
@ -189,7 +191,7 @@ export default {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
} };
this.getList(); this.getList();
}, },
handleCreate() { handleCreate() {
@ -200,7 +202,7 @@ export default {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
handleEdit(scope) { handleEdit(scope) {
this.warehouse = Object.assign({}, scope.row); // copy obj this.warehouse = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit"; this.dialogType = "edit";
@ -224,7 +226,7 @@ export default {
console.error(err); console.error(err);
}); });
}, },
async confirm(form) { async confirm(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid) { if (valid) {
@ -241,7 +243,7 @@ export default {
createWarehouse(this.warehouse).then((res) => { createWarehouse(this.warehouse).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.getList(); this.getList();
this.dialogVisible = false; this.dialogVisible = false;
this.$message.success("成功"); this.$message.success("成功");
} }
}); });

View File

@ -8,7 +8,7 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span style="font-size: 16px; <span style="font-size: 16px;
font-weight: 700; font-weight: 700;
">过程记录表</span> ">物料检验记录表</span>
</div> </div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增</el-button> >新增</el-button>
@ -187,7 +187,7 @@
<el-table-column label="是否判定"> <el-table-column label="是否判定">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.need_judge==true"></el-tag> <el-tag v-if="scope.row.need_judge==true"></el-tag>
<el-tag v-else></el-tag> <el-tag v-else></el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -251,10 +251,10 @@
<el-switch v-model="field.need_judge"></el-switch> <el-switch v-model="field.need_judge"></el-switch>
</el-form-item> </el-form-item>
<el-form-item label="上限值" prop="high_limit"> <el-form-item label="上限值" v-if="field.need_judge==true" prop="high_limit">
<el-input-number v-model="field.high_limit" :precision="2" :min="0"></el-input-number> <el-input-number v-model="field.high_limit" :precision="2" :min="0"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="上限规则" prop="high_rule"> <el-form-item label="上限规则" v-if="field.need_judge==true" prop="high_rule">
<el-select style="width: 100%" v-model="field.high_rule" placeholder="请选择"> <el-select style="width: 100%" v-model="field.high_rule" placeholder="请选择">
<el-option <el-option
v-for="item in highoptions" v-for="item in highoptions"
@ -264,10 +264,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="下限值" prop="low_limit"> <el-form-item label="下限值" v-if="field.need_judge==true" prop="low_limit">
<el-input-number v-model="field.low_limit" :precision="2" :min="0"></el-input-number> <el-input-number v-model="field.low_limit" :precision="2" :min="0"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="下限规则" prop="low_rule"> <el-form-item label="下限规则" v-if="field.need_judge==true" prop="low_rule">
<el-select style="width: 100%" v-model="field.low_rule" placeholder="请选择"> <el-select style="width: 100%" v-model="field.low_rule" placeholder="请选择">
<el-option <el-option
v-for="item in lowoptions" v-for="item in lowoptions"
@ -429,7 +429,7 @@
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
this.step.process = this.$route.params.id; this.material = this.$route.params.id;
this.recordformLists(); this.recordformLists();
}, },
@ -461,7 +461,7 @@
}, },
recordformLists() recordformLists()
{ {
this.listQueryrecordform.step=this.stepid; this.listQueryrecordform.material=this.material;
this.listQueryrecordform.type=2; this.listQueryrecordform.type=2;
getrecordformList(this.listQueryrecordform).then((response) => { getrecordformList(this.listQueryrecordform).then((response) => {
if (response.data) { if (response.data) {
@ -476,8 +476,7 @@
getrffieldList(this.listQueryfield).then((response) => { getrffieldList(this.listQueryfield).then((response) => {
if (response.data) { if (response.data) {
this.fieldList = response.data; this.fieldList = response.data;
debugger;
console.log(this.fieldList)
} }
}); });

View File

@ -33,6 +33,11 @@
:value="item.number">{{item.name}}</el-tag> :value="item.number">{{item.name}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="子工序类型">
<template slot-scope="scope"> {{ type_[scope.row.type] }}</template>
</el-table-column>
<el-table-column label="排序"> <el-table-column label="排序">
<template slot-scope="scope">{{ scope.row.sort }}</template> <template slot-scope="scope">{{ scope.row.sort }}</template>
</el-table-column> </el-table-column>
@ -88,6 +93,18 @@
<el-input type="textarea" :rows="3" v-model="step.instruction_content" placeholder="指导书内容" /> <el-input type="textarea" :rows="3" v-model="step.instruction_content" placeholder="指导书内容" />
</el-form-item> </el-form-item>
<el-form-item label="子工序类型" prop="type">
<el-select style="width: 100%" v-model="step.type" placeholder="请选择">
<el-option
v-for="item in typeoption"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="排序" prop="sort"> <el-form-item label="排序" prop="sort">
<el-input-number <el-input-number
v-model="step.sort" v-model="step.sort"
@ -428,6 +445,12 @@
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
type_: {
1:'普通',
2:'分割',
3:'结合',
},
options_: { options_: {
'string':'文本', 'string':'文本',
'int':'整数', 'int':'整数',
@ -437,6 +460,18 @@
'select': '单选', 'select': '单选',
'selects': '多选', 'selects': '多选',
}, },
typeoption: [{
value: '1',
label: '普通'
},
{
value: '2',
label: '分割'
},
{
value: '3',
label: '结合'
}],
fieldtypeoptions: [{ fieldtypeoptions: [{
value: 'string', value: 'string',
label: '文本' label: '文本'

View File

@ -12,13 +12,16 @@
fit fit
stripe stripe
style="width: 100%" style="width: 100%"
max-height="400" max-height="700"
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="分解产品名称">
<template slot-scope="scope">{{ scope.row.subproduction_.name }}</template>
</el-table-column>
<el-table-column label="生产子计划名"> <el-table-column label="生产车间">
<template slot-scope="scope">{{ scope.row.workshop_.name }}</template> <template slot-scope="scope">{{ scope.row.workshop_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="工序名"> <el-table-column label="工序名">
@ -36,6 +39,9 @@
</template> </template>
</el-table-column>
<el-table-column label="生产个数">
<template slot-scope="scope">{{ scope.row.main_count }}</template>
</el-table-column> </el-table-column>
<el-table-column label="开工时间"> <el-table-column label="开工时间">
<template slot-scope="scope">{{ scope.row.start_date }}</template> <template slot-scope="scope">{{ scope.row.start_date }}</template>

View File

@ -2,33 +2,33 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="项目名称" placeholder="项目名称"
style="width: 300px" style="width: 300px"
class="filter-item" class="filter-item"
@keyup.enter.native="handleFilter" @keyup.enter.native="handleFilter"
/> />
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button >搜索</el-button
> >
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button >重置</el-button
> >
</div> </div>
<div style="margin-top: 2px"> <div style="margin-top: 2px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增项目</el-button >新增项目</el-button
> >
</div> </div>
</el-card> </el-card>
<el-card style="margin-top: 2px"> <el-card style="margin-top: 2px">
<el-table <el-table
@ -44,27 +44,24 @@
<el-table-column label="项目名称"> <el-table-column label="项目名称">
<template slot-scope="scope">{{ scope.row.name }}</template> <template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="条款号"> <el-table-column label="条款号">
<template slot-scope="scope">{{ scope.row.term_number }}</template> <template slot-scope="scope">{{ scope.row.term_number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="标准名称"> <el-table-column label="标准名称">
<template slot-scope="scope">{{ scope.row.standard_.name }}</template> <template slot-scope="scope">{{ scope.row.standard_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="标准编号"> <el-table-column label="标准编号">
<template slot-scope="scope">{{ scope.row.standard_.number }}</template> <template slot-scope="scope">{{
scope.row.standard_.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.create_time }}</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center" label="操作" width="220px">
align="center"
label="操作"
width="220px"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['warehouse_update'])"
@click="handleEdit(scope)" @click="handleEdit(scope)"
@ -104,18 +101,21 @@
<el-form-item label="条款号" prop="term_number"> <el-form-item label="条款号" prop="term_number">
<el-input v-model="testitem.term_number" placeholder="条款号" /> <el-input v-model="testitem.term_number" placeholder="条款号" />
</el-form-item> </el-form-item>
<el-form-item label="标准" prop="standard"> <el-form-item label="标准" prop="standard">
<el-select style="width: 100%" v-model="testitem.standard" placeholder="请选择"> <el-select
<el-option style="width: 100%"
v-for="item in options" v-model="testitem.standard"
:key="item.value" placeholder="请选择"
:label="item.label" >
:value="item.value"> <el-option
</el-option> v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button> <el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -125,27 +125,31 @@
</div> </div>
</template> </template>
<script> <script>
import { getTestitemList, createTestitem,updateTestitem,deleteTestitem,getStandardList } from "@/api/qm"; import {
getTestitemList,
createTestitem,
updateTestitem,
deleteTestitem,
getStandardList,
} from "@/api/qm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
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 = {};
};
export default { export default {
components: { Pagination }, components: { Pagination },
data() { data() {
return { return {
testitem: defaultetestitem, testitem: defaultetestitem,
testitemList: { testitemList: {
count: 0, count: 0,
}, },
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
options:[], options: [],
listLoading: true, listLoading: true,
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
@ -159,7 +163,7 @@ export default {
watch: {}, watch: {},
created() { created() {
this.getList(); this.getList();
this.getLists() this.getLists();
}, },
methods: { methods: {
checkPermission, checkPermission,
@ -173,16 +177,13 @@ export default {
this.listLoading = false; this.listLoading = false;
}); });
}, },
getLists() { getLists() {
getStandardList({ pageoff: true }).then((response) => {
getStandardList({pageoff:true}).then((response) => { this.options = genTree(response.data);
this.options = genTree(response.data);
}); });
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
@ -191,7 +192,7 @@ export default {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
} };
this.getList(); this.getList();
}, },
handleCreate() { handleCreate() {
@ -202,7 +203,7 @@ export default {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
handleEdit(scope) { handleEdit(scope) {
this.testitem = Object.assign({}, scope.row); // copy obj this.testitem = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit"; this.dialogType = "edit";
@ -226,7 +227,7 @@ export default {
console.error(err); console.error(err);
}); });
}, },
async confirm(form) { async confirm(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid) { if (valid) {
@ -243,7 +244,7 @@ export default {
createTestitem(this.testitem).then((res) => { createTestitem(this.testitem).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.getList(); this.getList();
this.dialogVisible = false; this.dialogVisible = false;
this.$message.success("成功"); this.$message.success("成功");
} }
}); });

View File

@ -1,130 +1,194 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
<el-tabs v-model="activeName" @tab-click="handleClick" type="border-card"> <el-tab-pane
<el-tab-pane :key="item.name" v-for="item in processOption" :key="item.name"
:label="item.name" v-for="item in processOption"
:label="item.name"
:name="item.id" :name="item.id"
:closable="item.close"
:closable="item.close">
<el-table
:data="subproductionplanList.results"
border
fit
stripe
style="width: 100%"
max-height="400"
> >
<el-table-column type="index" width="50" /> <el-table
:data="subproductionplanList.results"
border
fit
<el-table-column label="生产子计划名"> stripe
<template slot-scope="scope">{{ scope.row.workshop_.name }}</template> style="width: 100%"
</el-table-column> height="300"
<el-table-column label="工序名"> highlight-current-row
<template slot-scope="scope">{{ scope.row.process_.name }}</template> @current-change="handleCurrentChange"
</el-table-column>
<el-table-column label="工序编号">
<template slot-scope="scope">{{ scope.row.process_.number }}</template>
</el-table-column>
<el-table-column label="子工序">
<template slot-scope="scope" v-if="scope.row.steps">
<el-tag v-for="item in scope.row.steps"
:key="item.number"
:label="item.name"
:value="item.number">{{item.name}}</el-tag>
</template>
</el-table-column>
<el-table-column label="开工时间">
<template slot-scope="scope">{{ scope.row.start_date }}</template>
</el-table-column>
<el-table-column label="完工时间">
<template slot-scope="scope">{{ scope.row.end_date }}</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">{{ state_[scope.row.state] }}</template>
</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="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="220px"
> >
<template slot-scope="scope"> <el-table-column type="index" width="50" />
<el-link
v-if="checkPermission(['warehouse_update'])"
@click="handleNeed(scope)"
>领料</el-link
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="subproductionplanList.count > 0"
:total="subproductionplanList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getspList"
/>
<el-table-column label="分解产品名称">
<template slot-scope="scope">{{
scope.row.subproduction_.name
}}</template>
</el-table-column>
<el-card class="box-card"> <el-table-column label="生产车间">
<div slot="header" class="clearfix"> <template slot-scope="scope">{{
<span>车间物料</span> scope.row.workshop_.name
</div> }}</template>
<el-table </el-table-column>
:data="wmaterialList"
<el-table-column label="工序名">
<template slot-scope="scope">{{
scope.row.process_.name
}}</template>
</el-table-column>
<el-table-column label="工序编号">
<template slot-scope="scope">{{
scope.row.process_.number
}}</template>
</el-table-column>
<el-table-column label="子工序">
<template slot-scope="scope" v-if="scope.row.steps">
<el-tag
v-for="item in scope.row.steps"
:key="item.number"
:label="item.name"
:value="item.number"
>{{ item.name }}</el-tag
>
</template>
</el-table-column>
<el-table-column label="开工时间">
<template slot-scope="scope">{{ scope.row.start_date }}</template>
</el-table-column>
<el-table-column label="完工时间">
<template slot-scope="scope">{{ scope.row.end_date }}</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">{{
state_[scope.row.state]
}}</template>
</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="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link v-if="scope.row.state == 1" @click="handleNeed(scope)"
>领料</el-link
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="subproductionplanList.count > 0"
:total="subproductionplanList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="subproductionplanList"
/>
<el-row :gutter="24">
<el-col :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>车间操作</span>
</div>
<el-button
type="primary"
style="margin-left: 50px"
v-for="item in steps"
:key="item.number"
:label="item.name"
:value="item.number"
@click="handlework(item)"
>{{ item.name }}</el-button
>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>半成品</span>
</div>
<el-table
:data="wproductData"
@selection-change="handleSelectionChange"
border border
fit fit
stripe stripe
style="width: 100%" style="width: 100%"
max-height="400" max-height="300"
> >
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column type="index" width="50" /> <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-column label="半成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
<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.p_state_.name }}</template>
</el-table-column>
<el-table-column label="所在子工序执行状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_executed" >已执行</el-tag>
<el-tag v-else >待执行</el-tag>
</template>
</el-table-column>
<el-table-column label="更新时间">
<template slot-scope="scope">{{ scope.row.update_time }}</template>
</el-table-column>
</el-table> </el-table>
</el-card> </el-card>
</el-tab-pane> </el-col>
</el-tabs> <el-col :span="12">
<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-col>
</el-row>
</el-tab-pane>
</el-tabs>
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:title="dialogType === 'edit' ? '编辑领料' : '选择仓库领料'" :title="dialogType === 'edit' ? '编辑领料' : '选择仓库领料'"
@ -134,133 +198,349 @@
:model="need" :model="need"
label-width="80px" label-width="80px"
label-position="right" label-position="right"
> >
<el-form-item label="仓库" prop="warehouse">
<el-form-item label="仓库" prop="warehouse"> <el-select
<el-select style="width: 100%" v-model="need.warehouse" placeholder="请选择"> style="width: 100%"
<el-option v-model="need.warehouse"
v-for="item in warehouseoptions" placeholder="请选择"
:key="item.id" >
:label="item.name" <el-option
:value="item.id"> v-for="item in warehouseoptions"
</el-option> :key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button> <el-button type="danger" @click="dialogVisible = false">取消</el-button>
<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 <el-dialog :visible.sync="dialogVisiblenw" title="领料">
:visible.sync="dialogVisiblenw" <el-card class="box-card">
title="领料" <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>
<el-dialog
:visible.sync="dialogVisiblework"
:fullscreen="true"
title="填写记录"
> >
<el-card class="box-card"> <el-steps
<div slot="header" class="clearfix"> :active="values"
<span>生产所需领料表</span> spac="400px"
align-center=""
</div> finish-status="success"
<template> style="padding-top: 20px"
>
<el-step
:title="item.name"
v-for="(item, index) in forms"
:key="index"
@click.native="stepclick(item.id)"
>
</el-step>
</el-steps>
<el-table :data="needwl" style="width: 100%"> <el-card class="box-card" v-if="values === 0">
<el-table-column prop="material_.name" label="物料名称" > </el-table-column> <div slot="header" class="clearfix">
<el-table-column prop="material_.number" label="物料编号"> </el-table-column> <span>消耗物料表</span>
<el-table-column prop="material_.specification" label="物料规格" > </el-table-column> </div>
<el-table-column prop="material_.unit" label="物料单位" > </el-table-column> <el-table :data="input" border style="width: 100%">
<el-table-column prop="count" label="所需物料数量" > </el-table-column>
<el-table-column prop="count_real" label="已领物料数量" > </el-table-column>
<el-table-column prop="material__name" label="物料名称" width="180">
</el-table> </el-table-column>
<el-table-column prop="material__batch" label="物料批次" width="180">
</template> </el-table-column>
</el-card> <el-table-column prop="count" label="可用数量" width="180">
<el-card class="box-card"> </el-table-column>
<div slot="header" class="clearfix"> <el-table-column prop="count_input" label="使用数量" width="180">
<span>当前仓库物料表</span> <template slot-scope="scope" >
<el-button style="float: right; padding: 3px 0" @click="handlePick" type="text">确认领料</el-button> <el-form :model="scope.row">
</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-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-input-number v-model="scope.row.count_input" :min="0" :value="0"></el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
</el-table-column> </el-table-column>
</el-table>
<el-table-column prop="count_real" label="已领物料数量" > </el-table-column> </el-card>
<el-table-column prop="material_.specification" label="物料规格" > </el-table-column> <el-card class="box-card" v-if="values === 0">
<el-table-column prop="material_.unit" label="物料单位" > </el-table-column> <div slot="header" class="clearfix">
<span>产出物料表</span>
</div>
</el-table> <el-table :data="output" border style="width: 100%">
<el-table-column prop="material__name" label="物料名称" width="180">
</el-table-column>
</template> <el-table-column prop="count_output" label="产出数量" width="180">
</el-card> <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>
</el-card>
<el-card class="box-card" v-for="(itemf,$index) in otherforms" :key="$index" >
<el-form label-width="80px" label-position="right" v-if="values === $index+1">
<el-row v-for="(item, $index) in itemf.form_fields" :key="$index">
<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
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-row>
</el-form>
</el-card>
<el-button
style="margin-top: 12px"
@click="next"
v-if="values == 0 || values == 1 || values == 2"
>下一步</el-button
>
<el-button
style="margin-top: 12px"
@click="prev"
v-if="values == 1 || values == 2 || values == 3"
>上一步</el-button
>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisiblework = false"
>取消</el-button
>
<el-button type="primary" @click="submint()">确认</el-button>
</div>
</el-dialog> </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 { getProcessList } from "@/api/mtm";
import { createPick,getwmaterialList } from "@/api/wpm"; import { createPick, getwmaterialList,submitWork,getwproductList} from "@/api/wpm";
import { getWarehouseList } from "@/api/inm"; import { getWarehouseList } from "@/api/inm";
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 = {};
};
export default { export default {
components: { Pagination }, components: { Pagination },
data() { data() {
return { return {
need: defaulteneed, need: defaulteneed,
subproductionplanList: { subproductionplanList: {
count: 0, count: 0,
}, },
wmaterialList:"", wmaterialList: "",
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
activeName:'0', values: 0,
havewl:"", active: 0,
needwl:"", activeName: "1",
state_:{ havewl: "",
0:'制定中', needwl: "",
1:'已下达', state_: {
2:'已接受', 0: "制定中",
3:'生产中', 1: "已下达",
4:'已完成'}, 2: "已接受",
3: "生产中",
4: "已完成",
},
listLoading: true, listLoading: true,
listLoading: true, listLoading: true,
id:"", id: "",
warehouseoptions:[], warehouseoptions: [],
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
dialogVisiblenw: false, dialogVisiblework: false,
dialogVisiblenw: false,
dialogTypenw: "new", dialogTypenw: "new",
picks:[], picks: [],
pickData:{}, pickData: {},
steps: [],
step:null,
processOption:"",
subproduction_plan: "",
form1: [],
form2: [],
form3: [],
input: [],
output: [],
forms:[],
inputData:[],
outputData:[],
field1:[],
field2:[],
fromData:[],
wproductData:"",
wpID:[],
multipleSelection: [],
wproducts:[],
otherforms:[],
from:[],
}; };
}, },
process: "",
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
@ -269,96 +549,200 @@ export default {
}, },
methods: { methods: {
checkPermission, checkPermission,
//选项卡切换 //选项卡切换
handleClick(tab) handleClick(tab) {
{ this.process = tab.name;
this.listQuery.process = tab.name;
this.listQuery.process=tab.name; this.steps = [];
getsubproductionplanList(this.listQuery).then((response) => { 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) => { getwmaterialList({
subproduction_plan__process: this.process,
page: 0,
}).then((response) => {
if (response.data) { if (response.data) {
this.wmaterialList = response.data; this.wmaterialList = response.data;
} }
this.listLoading = false; this.listLoading = false;
}); });
}, },
//工序对应的子计划弹出对应的车间物料
handleCurrentChange(row) {
this.steps = row.steps; //调出子工序
this.subproduction_plan = row.id; //子计划Id
getwmaterialList({
subproduction_plan__process: this.process,
subproduction_plan: row.id,
page: 0,
}).then((response) => {
if (response.data) {
this.wmaterialList = response.data;
}
this.listLoading = false;
});
this.getwproductLists();
},
//工序渲染 //工序渲染
getProcessList(){ getProcessList() {
getProcessList({page:0}).then((response) => { getProcessList({ page: 0 }).then((response) => {
if (response.data) { if (response.data) {
this.processOption = response.data; this.processOption = response.data;
} }
this.listLoading = false; this.listLoading = false;
}); });
}, },
getWarehouseLists(){ getWarehouseLists() {
getWarehouseList({page:0}).then((response) => { getWarehouseList({ page: 0 }).then((response) => {
if (response.data) { if (response.data) {
this.warehouseoptions = response.data; this.warehouseoptions = response.data;
} }
this.listLoading = false; this.listLoading = false;
}); });
}, },
handleNeed(scope){ handleNeed(scope) {
this.need = Object.assign({}, defaulteneed); this.need = Object.assign({}, defaulteneed);
this.dialogType = "new"; this.dialogType = "new";
this.dialogVisible = true; this.dialogVisible = true;
this.id=scope.row.id; this.id = scope.row.id;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
async confirm(form) { async confirm(form) {
createPick_need(this.id, this.need).then((res) => {
createPick_need( this.id,this.need).then((res) => { if (res.code >= 200) {
if (res.code >= 200) { this.dialogVisible = false;
this.dialogVisible = false; this.dialogVisiblenw = true;
this.dialogVisiblenw = true; this.havewl = res.data.have;
this.havewl=res.data.have; this.needwl = res.data.need;
this.needwl=res.data.need; }
});
}
});
}, },
//确认领料 //确认领料
handlePick() handlePick() {
{ let _this = this;
_this.picks = []; //所需物料
let _this=this this.$refs.multipleTable.selection.forEach((item) => {
_this.picks=[]//所需物料 _this.picks.push({
this.$refs.multipleTable.selection.forEach((item) => { material: item.material,
_this.picks.push({ batch: item.batch,
"material":item.material, pick_count: item.pick_count,
"batch": item.batch,
"pick_count":item.pick_count
}); });
}); });
this.pickData.subproduction_plan = this.id; this.pickData.subproduction_plan = this.id;
this.pickData.warehouse = this.need.warehouse; this.pickData.warehouse = this.need.warehouse;
this.pickData.picks = this.picks; this.pickData.picks = this.picks;
// console.log(this.pickData);
console.log(this.pickData)
createPick(this.pickData).then((res) => { createPick(this.pickData).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.$message.success("领料成功!"); this.$message.success("领料成功!");
}
});
} },
}); prev() {
} --this.values;
if (this.values < 0) this.values = 0;
},
next() {
if (this.values++ > this.forms.length) this.values = 0;
},
handleSelectionChange(val) {
let _this = this;
_this.wpID = [];
val.forEach((item) => {
_this.wpID.push(item.id);
});
},
//车间操作
handlework(item) {
this.step=item.id;
// console.log(this.wpID);
createWork({
step: item.id,
wproducts:this.wpID,
subproduction_plan: this.subproduction_plan,
}).then((res) => {
if (res.code >= 200) {
this.dialogVisiblework = true;
this.forms=res.data.forms;
this.otherforms=res.data.forms.slice(0);//渲染生产表
this.otherforms.shift();
//console.log(this.otherforms)
this.input = res.data.forms[0].input; //消耗
this.output = res.data.forms[0].output; //产出
this.wproducts=res.data.forms[0].wproducts;
}
});
},
//提交
submint(){
this.form = [];
this.otherforms.forEach((item) => {
let _this = this;
_this.field1 = [];
item.form_fields.forEach((items) => {
_this.field1.push({
form_field:items.id,
field_value:items.sort
})
})
this.form.push({
form:item.id,
record_data:_this.field1
})
});
console.log( this.form);
submitWork({
step:this.step,
subproduction_plan:this.subproduction_plan,
wproducts:this.wproducts,
input: this.input,
output: this.output,
forms: this.from
}).then((res) => {
if (res.code >= 200) {
this.dialogVisiblework = false;
this.$message.success("成功!");
this.getwproductLists();
}
});
},
//大工序下子工序产出的半成品
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>