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

@ -15,3 +15,28 @@ export function getwmaterialList(query) {
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

@ -40,15 +40,17 @@
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>
@ -56,18 +58,24 @@
<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
align="center"
label="操作"
width="220px"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.is_audited == 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 <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'])"
@ -98,13 +106,31 @@
: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"
placeholder="请选择"
filterable
>
<el-option
v-for="item in warehouseData"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="操作人" prop="operator"> <el-form-item label="操作人" prop="operator">
<el-select v-model="inventory.operator" placeholder="请选择" filterable > <el-select
<el-option v-for="item in userData" :key="item.value" :label="item.label" :value="item.value" /> 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-select>
</el-form-item> </el-form-item>
<el-form-item label="入库时间" prop="inout_date"> <el-form-item label="入库时间" prop="inout_date">
@ -120,40 +146,88 @@
<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
class="material"
label="物料:"
:prop="'details.' + index + '.material'"
>
<el-select v-model="item.material" size="small"> <el-select v-model="item.material" size="small">
<el-option v-for="item in materialoptions" <el-option
v-for="item in materialoptions"
:key="item.value" :key="item.value"
:value="item.value" :value="item.value"
:label="item.label"> :label="item.label"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" style="margin-right:10px;"> <el-col :span="8" style="margin-right: 10px">
<el-form-item class="count" label="数量" :prop="'details.'+index+'.count'" > <el-form-item
<el-input-number v-model="item.count" :min="0"></el-input-number> class="count"
label="数量"
:prop="'details.' + index + '.count'"
>
<el-input-number
v-model="item.count"
:min="0"
></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" style="margin-right:10px;"> <el-col :span="6" style="margin-right: 10px">
<el-form-item class="batch" label="批次" :prop="'details.'+index+'.batch'" > <el-form-item
class="batch"
label="批次"
:prop="'details.' + index + '.batch'"
>
<el-input v-model="item.batch" placeholder="批次号"></el-input> <el-input v-model="item.batch" placeholder="批次号"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 删除按钮 --> <!-- 删除按钮 -->
<el-col :span="1"> <el-col :span="1">
<el-tooltip class="item" effect="dark" content="删除" placement="top"> <el-tooltip
<el-button @click="deleteItem(index)" style='border:none;background:none;padding:0px;margin-top:4px;'> class="item"
<i class="el-icon-remove-outline" style='font-size:20px;'></i> 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-button>
</el-tooltip> </el-tooltip>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div> <div>
<el-tooltip class="item" effect="dark" content="添加条件" placement="top"> <el-tooltip
<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'> 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-button>
</el-tooltip> </el-tooltip>
@ -167,7 +241,12 @@
</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";
@ -176,11 +255,10 @@ import Pagination from "@/components/Pagination"; // secondary package based on
const defaulteinventory = { const defaulteinventory = {
details: [ details: [
{ {
material:'', // 物料 material: "", // 物料
count:'',//数量 count: "", //数量
batch:'',//批次 batch: "", //批次
},
}
], ],
}; };
export default { export default {
@ -192,13 +270,10 @@ export default {
count: 0, count: 0,
}, },
types_: { types_: {
1: "生产领料",
1:'生产领料', 2: "销售提货",
2:'销售提货', 3: "采购入库",
3:'采购入库', 4: "生产入库",
4:'生产入库',
}, },
listQuery: { listQuery: {
page: 1, page: 1,
@ -212,14 +287,13 @@ export default {
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();
@ -236,11 +310,10 @@ export default {
} }
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() {
@ -252,27 +325,25 @@ export default {
}); });
}, },
getUser() { getUser() {
getUserList({page:0}).then(res => { getUserList({ page: 0 }).then((res) => {
if (res.data) { if (res.data) {
this.userData = genTree(res.data); this.userData = genTree(res.data);
} }
}) });
}, },
addConditions() { addConditions() {
if (this.inventory.details.length <= 10) { if (this.inventory.details.length <= 10) {
this.inventory.details.push({ this.inventory.details.push({
material:'', // 物料 material: "", // 物料
count:'', //数量 count: "", //数量
batch:'', // 批次 batch: "", // 批次
}); });
} else { } else {
this.$message('最多可添加十项条件'); this.$message("最多可添加十项条件");
} }
}, },
deleteItem(index) { deleteItem(index) {
this.inventory.details.splice(index, 1) this.inventory.details.splice(index, 1);
}, },
//物料 //物料
getmaterialList() { getmaterialList() {
@ -284,15 +355,13 @@ export default {
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";
@ -301,6 +370,22 @@ export default {
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,13 +394,12 @@ 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) {
@ -324,10 +408,7 @@ export default {
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,8 +10,6 @@
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>
@ -47,19 +19,44 @@
<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"
@ -70,12 +67,144 @@
/> />
</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 { createTestrecord } from "@/api/qm";
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
@ -84,22 +213,32 @@ export default {
components: { Pagination }, components: { Pagination },
data() { data() {
return { return {
InventoryList: { InventoryList: {
count: 0, count: 0,
}, },
fifodetailList: {
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" }],
}, },
}; };
}, },
@ -121,11 +260,56 @@ export default {
} }
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

@ -26,7 +26,6 @@
</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,8 +35,6 @@
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>
@ -47,21 +44,23 @@
</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,11 +70,16 @@
@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";
@ -86,7 +90,6 @@ export default {
components: { Pagination }, components: { Pagination },
data() { data() {
return { return {
InventoryList: { InventoryList: {
count: 0, count: 0,
}, },
@ -98,16 +101,13 @@ export default {
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,
@ -121,9 +121,6 @@ export default {
} }
this.listLoading = false; this.listLoading = false;
}); });
}, },
handleFilter() { handleFilter() {
@ -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

@ -55,11 +55,7 @@
<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'])"
@ -108,7 +104,6 @@
<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,14 +113,17 @@
</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() {
@ -134,16 +132,20 @@ export default {
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,
@ -179,7 +181,7 @@ export default {
}, },
//跳转到该仓库的物料表 //跳转到该仓库的物料表
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() {

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

@ -52,19 +52,16 @@
<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)"
@ -105,17 +102,20 @@
<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
style="width: 100%"
v-model="testitem.standard"
placeholder="请选择"
>
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </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,14 +125,18 @@
</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() {
@ -159,7 +163,7 @@ export default {
watch: {}, watch: {},
created() { created() {
this.getList(); this.getList();
this.getLists() this.getLists();
}, },
methods: { methods: {
checkPermission, checkPermission,
@ -175,11 +179,8 @@ export default {
}, },
getLists() { getLists() {
getStandardList({ pageoff: true }).then((response) => { getStandardList({ pageoff: true }).then((response) => {
this.options = genTree(response.data); this.options = genTree(response.data);
}); });
}, },
@ -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() {

View File

@ -1,45 +1,57 @@
<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 :key="item.name" v-for="item in processOption" <el-tab-pane
:key="item.name"
v-for="item in processOption"
:label="item.name" :label="item.name"
:name="item.id" :name="item.id"
:closable="item.close"
:closable="item.close"> >
<el-table <el-table
:data="subproductionplanList.results" :data="subproductionplanList.results"
border border
fit fit
stripe stripe
style="width: 100%" style="width: 100%"
max-height="400" height="300"
highlight-current-row
@current-change="handleCurrentChange"
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="分解产品名称">
<template slot-scope="scope">{{
<el-table-column label="生产子计划名"> scope.row.subproduction_.name
<template slot-scope="scope">{{ scope.row.workshop_.name }}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="生产车间">
<template slot-scope="scope">{{
scope.row.workshop_.name
}}</template>
</el-table-column>
<el-table-column label="工序名"> <el-table-column label="工序名">
<template slot-scope="scope">{{ scope.row.process_.name }}</template> <template slot-scope="scope">{{
scope.row.process_.name
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="工序编号"> <el-table-column label="工序编号">
<template slot-scope="scope">{{ scope.row.process_.number }}</template> <template slot-scope="scope">{{
scope.row.process_.number
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="子工序"> <el-table-column label="子工序">
<template slot-scope="scope" v-if="scope.row.steps"> <template slot-scope="scope" v-if="scope.row.steps">
<el-tag v-for="item in scope.row.steps" <el-tag
v-for="item in scope.row.steps"
:key="item.number" :key="item.number"
:label="item.name" :label="item.name"
: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="开工时间"> <el-table-column label="开工时间">
@ -49,7 +61,9 @@
<template slot-scope="scope">{{ scope.row.end_date }}</template> <template slot-scope="scope">{{ scope.row.end_date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="状态"> <el-table-column label="状态">
<template slot-scope="scope">{{ state_[scope.row.state] }}</template> <template slot-scope="scope">{{
state_[scope.row.state]
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="领料状态"> <el-table-column label="领料状态">
<template slot-scope="scope"> <template slot-scope="scope">
@ -61,19 +75,11 @@
<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 v-if="scope.row.state == 1" @click="handleNeed(scope)"
<el-link
v-if="checkPermission(['warehouse_update'])"
@click="handleNeed(scope)"
>领料</el-link >领料</el-link
> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -82,10 +88,70 @@
:total="subproductionplanList.count" :total="subproductionplanList.count"
:page.sync="listQuery.page" :page.sync="listQuery.page"
:limit.sync="listQuery.page_size" :limit.sync="listQuery.page_size"
@pagination="getspList" @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
fit
stripe
style="width: 100%"
max-height="300"
>
<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.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-card>
</el-col>
<el-col :span="12">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>车间物料</span> <span>车间物料</span>
@ -98,16 +164,17 @@
style="width: 100%" style="width: 100%"
max-height="400" max-height="400"
> >
<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.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.batch }}</template> <template slot-scope="scope">{{ scope.row.batch }}</template>
@ -115,16 +182,13 @@
<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>
</el-card> </el-card>
</el-col>
</el-row>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:title="dialogType === 'edit' ? '编辑领料' : '选择仓库领料'" :title="dialogType === 'edit' ? '编辑领料' : '选择仓库领料'"
@ -134,98 +198,288 @@
: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 style="width: 100%" v-model="need.warehouse" placeholder="请选择"> <el-select
style="width: 100%"
v-model="need.warehouse"
placeholder="请选择"
>
<el-option <el-option
v-for="item in warehouseoptions" v-for="item in warehouseoptions"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id"
>
</el-option> </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"
title="领料"
>
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>生产所需领料表</span> <span>生产所需领料表</span>
</div> </div>
<template> <template>
<el-table :data="needwl" style="width: 100%"> <el-table :data="needwl" style="width: 100%">
<el-table-column prop="material_.name" label="物料名称" > </el-table-column> <el-table-column prop="material_.name" label="物料名称">
<el-table-column prop="material_.number" label="物料编号"> </el-table-column> </el-table-column>
<el-table-column prop="material_.specification" label="物料规格" > </el-table-column> <el-table-column prop="material_.number" label="物料编号">
<el-table-column prop="material_.unit" label="物料单位" > </el-table-column> </el-table-column>
<el-table-column prop="count" label="所需物料数量" > </el-table-column> <el-table-column prop="material_.specification" label="物料规格">
<el-table-column prop="count_real" label="已领物料数量" > </el-table-column> </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> </el-table>
</template> </template>
</el-card> </el-card>
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>当前仓库物料表</span> <span>当前仓库物料表</span>
<el-button style="float: right; padding: 3px 0" @click="handlePick" type="text">确认领料</el-button> <el-button
style="float: right; padding: 3px 0"
@click="handlePick"
type="text"
>确认领料</el-button
>
</div> </div>
<template> <template>
<el-table :data="havewl" style="width: 100%" ref="multipleTable"> <el-table :data="havewl" style="width: 100%" ref="multipleTable">
<el-table-column <el-table-column type="selection" width="55"> </el-table-column>
type="selection"
width="55">
</el-table-column>
<el-table-column prop="batch" label="物料批次"> </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="material_.name" label="物料名称">
<el-table-column prop="warehouse_.name" label="物料所在仓库" > </el-table-column>\ </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 prop="count" label="物料总数量"> </el-table-column>
<el-table-column label="输入领料数量" width="140px"> <el-table-column label="输入领料数量" width="140px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-form :model="scope.row" widht="100px"> <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.pick_count"
:min="0"
:precision="2"
:controls="false"
: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-column prop="count_real" label="已领物料数量" > </el-table-column> <el-table-column prop="count_real" label="已领物料数量">
<el-table-column prop="material_.specification" label="物料规格" > </el-table-column> </el-table-column>
<el-table-column prop="material_.unit" 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> </el-table>
</template> </template>
</el-card> </el-card>
</el-dialog> </el-dialog>
<el-dialog
:visible.sync="dialogVisiblework"
:fullscreen="true"
title="填写记录"
>
<el-steps
:active="values"
spac="400px"
align-center=""
finish-status="success"
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-card class="box-card" v-if="values === 0">
<div slot="header" class="clearfix">
<span>消耗物料表</span>
</div>
<el-table :data="input" border style="width: 100%">
<el-table-column prop="material__name" label="物料名称" width="180">
</el-table-column>
<el-table-column prop="material__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>
</el-card>
<el-card class="box-card" v-if="values === 0">
<div slot="header" class="clearfix">
<span>产出物料表</span>
</div>
<el-table :data="output" 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>
</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>
</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 },
@ -240,27 +494,53 @@ export default {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
activeName:'0', values: 0,
active: 0,
activeName: "1",
havewl: "", havewl: "",
needwl: "", needwl: "",
state_: { state_: {
0:'制定中', 0: "制定中",
1:'已下达', 1: "已下达",
2:'已接受', 2: "已接受",
3:'生产中', 3: "生产中",
4:'已完成'}, 4: "已完成",
},
listLoading: true, listLoading: true,
listLoading: true, listLoading: true,
id: "", id: "",
warehouseoptions: [], warehouseoptions: [],
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
dialogVisiblework: false,
dialogVisiblenw: 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,25 +549,44 @@ 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) => {
@ -316,49 +615,134 @@ export default {
}); });
}, },
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.picks=[]//所需物料
this.$refs.multipleTable.selection.forEach((item) => { this.$refs.multipleTable.selection.forEach((item) => {
_this.picks.push({ _this.picks.push({
"material":item.material, material: item.material,
"batch": item.batch, batch: item.batch,
"pick_count":item.pick_count 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>