This commit is contained in:
shilixia 2022-02-21 13:50:53 +08:00
parent 7585796b19
commit 01ecc2e30e
4 changed files with 509 additions and 267 deletions

View File

@ -377,3 +377,34 @@ export function deletetechdoc(id, data) {
})
}
//装箱
//记录表格字段表
export function getpackitemList(query) {
return request({
url: '/mtm/packitem/',
method: 'get',
params: query
})
}
export function createpackitem(data) {
return request({
url: '/mtm/packitem/',
method: 'post',
data
})
}
export function updatepackitem(id, data) {
return request({
url: `/mtm/packitem/${id}/`,
method: 'put',
data
})
}
export function deletepackitem(id, data) {
return request({
url: `/mtm/packitem/${id}/`,
method: 'delete',
data
})
}

View File

@ -1,223 +1,352 @@
<template>
<div class="app-container">
<el-card>
<el-card >
<el-descriptions title="物料基本信息" direction="vertical" :column="8" border>
<el-descriptions-item label="物料编号"> {{materialdetail.number}}</el-descriptions-item>
<el-descriptions-item label="物料名称"> {{materialdetail.name}}</el-descriptions-item>
<el-descriptions-item label="规格型号" :span="2"> {{materialdetail.specification}}</el-descriptions-item>
<el-descriptions-item label="计量单位"> {{materialdetail.unit}} </el-descriptions-item>
<el-descriptions-item label="数量"> {{materialdetail.count}}</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card>
<el-descriptions
title="物料基本信息"
direction="vertical"
:column="8"
border
>
<el-descriptions-item label="物料编号">
{{ materialdetail.number }}</el-descriptions-item
>
<el-descriptions-item label="物料名称">
{{ materialdetail.name }}</el-descriptions-item
>
<el-descriptions-item label="规格型号" :span="2">
{{ materialdetail.specification }}</el-descriptions-item
>
<el-descriptions-item label="计量单位">
{{ materialdetail.unit }}
</el-descriptions-item>
<el-descriptions-item label="数量">
{{ materialdetail.count }}</el-descriptions-item
>
</el-descriptions>
</el-card>
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="供应商" name="5" v-if="this.type==3||this.type==4">
<el-tabs v-model="activeName" type="card">
<el-tab-pane
label="供应商"
name="5"
v-if="this.type == 3 || this.type == 4"
>
</el-tab-pane>
<el-tab-pane label="批次" name="3">
<el-tab-pane label="批次" name="3">
<el-table
:data="InventoryList"
border
fit
stripe
height="460"
highlight-current-row
>
<el-table-column type="index" width="50" />
<el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="物料名称">
<template slot-scope="scope">{{
scope.row.material_.name
}}</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">{{
scope.row.material_.specification
}}</template>
</el-table-column>
<el-table
:data="InventoryList"
border
fit
stripe
height="460"
highlight-current-row
>
<el-table-column type="index" width="50" />
<el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
</el-table-column>
<el-table-column label="物料编号">
<template slot-scope="scope">{{
scope.row.material_.number
}}</template>
</el-table-column>
<el-table-column label="仓库名称">
<template slot-scope="scope">{{
scope.row.warehouse_.name
}}</template>
</el-table-column>
<el-table-column label="仓库编号">
<template slot-scope="scope">{{
scope.row.warehouse_.number
}}</template>
</el-table-column>
<el-table-column label="物料总存量">
<template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column>
</el-table>
<el-table-column label="物料编号">
<template slot-scope="scope">{{
scope.row.material_.number
}}</template>
</el-table-column>
<el-table-column label="仓库名称">
<template slot-scope="scope">{{
scope.row.warehouse_.name
}}</template>
</el-table-column>
<el-table-column label="仓库编号">
<template slot-scope="scope">{{
scope.row.warehouse_.number
}}</template>
</el-table-column>
<el-table-column label="物料总存量">
<template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane label="关联的订单" name="1">
<el-table
:data="orderlist"
border
fit
stripe
highlight-current-row
height="460"
>
<el-table-column type="index" width="50" />
<el-table-column label="订单编号" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-tab-pane label="关联的订单" name="1">
<el-table
:data="orderlist"
border
fit
stripe
highlight-current-row
height="460"
>
<el-table-column type="index" width="50" />
<el-table-column label="订单编号" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
<el-table-column label="客户" show-overflow-tooltip>
<template slot-scope="scope">{{
scope.row.customer_.name
}}</template>
</el-table-column>
<el-table-column label="所属合同" show-overflow-tooltip>
<template slot-scope="scope">{{
scope.row.contract_.name
}}</template>
</el-table-column>
<el-table-column label="产品名称" show-overflow-tooltip>
<template slot-scope="scope">{{
scope.row.product_.name
}}</template>
</el-table-column>
<el-table-column label="产品型号" show-overflow-tooltip>
<template slot-scope="scope">{{
scope.row.product_.specification
}}</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.delivery_date
}}</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{
scope.row.create_time
}}</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="关联的计划" name="2">
<el-table
:data="productionplanList"
border
fit
stripe
style="width: 100%"
height="460"
>
<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.order_.number
}}</template>
</el-table-column>
<el-table-column label="合同编号">
<template slot-scope="scope">{{
scope.row.order_.contract_.number
}}</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.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">{{
scope.row.order_.delivery_date
}}</template>
</el-table-column>
<el-table-column label="是否生成子计划">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_planed == false"></el-tag>
<el-tag v-if="scope.row.is_planed == true"></el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{
scope.row.create_time
}}</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane
label="物料"
name="4"
v-if="this.type == 1 || this.type == 2"
>
<el-table
:data="wproductList"
border
fit
stripe
style="width: 100%"
height="460"
>
<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.step_.name }}</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">{{
actstate_[scope.row.act_state]
}}</template>
</el-table-column>
<el-table-column label="仓库">
<template slot-scope="scope" v-if="scope.row.warehouse_">{{
scope.row.warehouse_.name
}}</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="装箱单" name="5" v-if="this.type == 1">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">
新增装箱单
</el-button>
<el-table
:data="pickList"
border
fit
stripe
style="width: 100%"
height="460"
>
<el-table-column type="index" width="50" />
<el-table-column label="名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="单位">
<template slot-scope="scope">{{ scope.row.unit }}</template>
</el-table-column>
<el-table-column label="数量">
<template slot-scope="scope" >{{
scope.row.count
}}</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="220px"
>
<template slot-scope="scope">
<el-link
type="primary"
@click="handleEdit(scope)"
>编辑
</el-link>
<el-link
type="danger"
@click="handleDelete(scope)"
>删除
</el-link>
</template>
</el-table-column>
<el-table-column label="客户" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.customer_.name }}</template>
</el-table-column>
<el-table-column label="所属合同" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.contract_.name }}</template>
</el-table-column>
<el-table-column label="产品名称" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.product_.name }}</template>
</el-table-column>
<el-table-column label="产品型号" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.product_.specification }}</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.delivery_date }}</template>
</el-table-column>
<el-table-column label="创建时间" >
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="关联的计划" name="2">
<el-table
:data="productionplanList"
border
fit
stripe
style="width: 100%"
height="460"
>
<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.order_.number }}</template>
</el-table-column>
<el-table-column label="合同编号" >
<template slot-scope="scope">{{ scope.row.order_.contract_.number }}</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.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">{{ scope.row.order_.delivery_date }}</template>
</el-table-column>
<el-table-column label="是否生成子计划" >
<template slot-scope="scope" >
<el-tag v-if="scope.row.is_planed==false"></el-tag>
<el-tag v-if="scope.row.is_planed==true"></el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="物料" name="4" v-if="this.type==1||this.type==2">
<el-table
:data="wproductList"
border
fit
stripe
style="width: 100%"
height="460"
</el-table>
<el-dialog
:visible.sync="dialogVisible"
:close-on-click-modal="false"
:title="dialogType === 'edit' ? '编辑装箱单' : '新增装箱单'"
>
<el-form
ref="Form"
:model="packitem"
label-width="100px"
label-position="right"
:rules="rule1"
>
<el-form-item label="名称" prop="name">
<el-input v-model="packitem.name" placeholder="名称" />
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input v-model="packitem.unit" placeholder="单位" />
</el-form-item>
<el-form-item label="数量" prop="count">
<el-input-number
style="width: 100%"
v-model="packitem.count"
:step="1"
:min="0"
step-strictly
placeholder="数量"
></el-input-number>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number
v-model="packitem.sort"
:min="1"
placeholder="排序"
></el-input-number>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false"
>取消</el-button
>
<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.step_.name
}}</template>
</el-table-column>
<el-table-column label="状态" >
<template slot-scope="scope">{{
actstate_[scope.row.act_state]
}}</template>
</el-table-column>
<el-table-column label="仓库" >
<template slot-scope="scope" v-if=" scope.row.warehouse_">{{ scope.row.warehouse_.name }}</template>
</el-table-column>
warehouse_
</el-table>
</el-tab-pane>
</el-tabs>
<el-button type="primary" @click="confirm('Form')">确认</el-button>
</div>
</el-dialog>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</template>
<script>
import checkPermission from "@/utils/permission";
import vueJsonEditor from "vue-json-editor";
import {upUrl, upHeaders} from "@/api/file";
import {getProductionplanList } from "@/api/pm";
import {getmaterialbatchList} from "@/api/inm";
import {getOrderList } from "@/api/sam";
import {getMaterial } from "@/api/mtm";
import {getwproductList } from "@/api/wpm";
import { upFile } from "@/api/file";
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import checkPermission from "@/utils/permission";
import vueJsonEditor from "vue-json-editor";
import { upUrl, upHeaders } from "@/api/file";
import { getProductionplanList } from "@/api/pm";
import { getmaterialbatchList } from "@/api/inm";
import { getOrderList } from "@/api/sam";
import { getMaterial,getpackitemList,createpackitem,updatepackitem,deletepackitem } from "@/api/mtm";
import { getwproductList } from "@/api/wpm";
export default {
components: {Pagination, vueJsonEditor, Treeselect},
data() {
return {
materialdetail:"",
orderlist:[],
wproductList:[],
productionplanList:[],
InventoryList:[],
activeName:'3',
actstate_: {
import { upFile } from "@/api/file";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
const defaultpackitem = {
};
export default {
components: { Pagination, vueJsonEditor, Treeselect },
data() {
return {
materialdetail: "",
orderlist: [],
wproductList: [],
productionplanList: [],
InventoryList: [],
activeName: "3",
packitem:defaultpackitem,
dialogVisible: false,
dialogType: "new",
pickList:[],
actstate_: {
6: "待复检",
10: "操作进行中",
20: "待检验",
@ -229,67 +358,137 @@
26: "待夹层检验",
70: "报废",
},
};
},
computed: {},
watch: {},
created() {
this.material = this.$route.params.id;
this.type=this.$route.params.type;
this.getMaterial();
rule1: {
name: [{required: true, message: "请输入名称", trigger: "blur"}],
unit: [{required: true, message: "请输入单位", trigger: "blur"}],
},
};
},
computed: {},
watch: {},
created() {
this.material = this.$route.params.id;
this.type = this.$route.params.type;
this.getMaterial();
this.getpickList();
this.getOrderList();
this.getplanList();
this.getmaterialbatchList();
this.getwproductList();
},
methods: {
//新增装箱单
this.getOrderList();
this.getplanList();
this.getmaterialbatchList();
this.getwproductList();
},
methods: {
getMaterial(){
handleCreate() {
this.packitem = Object.assign({}, defaultpackitem);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.packitem = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deletepackitem(scope.row.id);
this.getpickList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updatepackitem(this.packitem.id, this.packitem).then((res) => {
if (res.code >= 200) {
this.getpickList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.packitem.material=this.material;
createpackitem(this.packitem).then((res) => {
if (res.code >= 200) {
this.getpickList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
getpickList()
{
getpackitemList({ material: this.material, page: 0 }).then((response) => {
if (response.data) {
this.pickList = response.data; //zhuangxiang信息
}
});
},
getMaterial() {
getMaterial(this.material).then((response) => {
if (response.data) {
this.materialdetail = response.data;//物料基本信息
}
})
},
getOrderList(){
getOrderList({material:this.material,page:0}).then((response) => {
if (response.data) {
this.orderlist = response.data;//物料关联的订单
}
})
},
getplanList() {
getProductionplanList({material:this.material,page:0}).then((response) => {
if (response.data) {
this.productionplanList = response.data;//物料关联计划
this.materialdetail = response.data; //物料基本信息
}
});
},
getOrderList() {
getOrderList({ material: this.material, page: 0 }).then((response) => {
if (response.data) {
this.orderlist = response.data; //物料关联的订单
}
});
},
getplanList() {
getProductionplanList({ material: this.material, page: 0 }).then(
(response) => {
if (response.data) {
this.productionplanList = response.data; //物料关联计划
}
}
);
},
getmaterialbatchList() {
getmaterialbatchList({material:this.material,page:0}).then((response) => {
if (response.data) {
this.InventoryList = response.data;
getmaterialbatchList() {
getmaterialbatchList({ material: this.material, page: 0 }).then(
(response) => {
if (response.data) {
this.InventoryList = response.data;
}
}
);
},
getwproductList() {
getwproductList({ material: this.material, page: 0 }).then((response) => {
if (response.data) {
this.wproductList = response.data; //半成品
}
});
},
getwproductList(){
getwproductList({material:this.material,page:0}).then((response) => {
if (response.data) {
this.wproductList = response.data;//半成品
}
});
}
},
};
},
};
</script>

View File

@ -94,7 +94,7 @@
</el-form-item>
<el-form-item label="子工序类型" prop="type">
<el-select style="width: 100%" v-model="step.type" placeholder="请选择">
<el-select style="width: 100%" v-model="step.type" placeholder="请选择">
<el-option
v-for="item in typeoption"
:key="item.value"
@ -411,6 +411,7 @@
const defaultstep = {
name: "",
number: "",
type:null,
};
const defaultrecordform = {
@ -486,15 +487,15 @@
'selects': '多选',
},
typeoption: [{
value: '1',
value: 1,
label: '常规'
},
{
value: '2',
value: 2,
label: '分割'
},
{
value: '3',
value: 3,
label: '结合'
}],
fieldtypeoptions: [{
@ -684,7 +685,7 @@
recordformLists()
{
this.listQueryrecordform.step=this.stepid;
this.listQueryrecordform.type=1;
this.listQueryrecordform.type=10;
getrecordformList(this.listQueryrecordform).then((response) => {
if (response.data) {
this.recordformList = response.data;

View File

@ -88,7 +88,10 @@
</el-tab-pane>
<el-tab-pane label="到岗统计">
<div class="container">
<el-row>
<el-col :span="12">
<div class="container">
<span class="demonstration"></span>
@ -99,8 +102,6 @@
</el-date-picker>
<el-button type="primary" @click="submit">查询</el-button>
</div>
<el-row>
<el-col :span="12">
<el-table
:data="atworkList"
@ -110,6 +111,7 @@
height="680"
stripe
border
@current-change="handleCurrentChange"
v-el-height-adaptive-table="{ bottomOffset: 41 }"
>
<el-table-column type="index" width="50" label="序号" />
@ -134,7 +136,7 @@
</el-table>
</el-col>
<el-col :span="12">
<el-calendar >
<el-calendar v-model="value">
<template
slot="dateCell"
@ -211,6 +213,7 @@ value2:null,
{"date":"2022-02-25","content":"去学习vue"}
],
atworkDate:{year:null,month:null},
value:new Date(),
};
},
computed: {},
@ -236,6 +239,13 @@ value2:null,
this.dialogVisible=true;
this.stopworkID=scope.row.id;
},
handleCurrentChange(){
this.resDate= [
{"date":"2022-01-20","content":"放假"},
{"date":"2022-01-26","content":"去交电费"},
{"date":"2022-01-25","content":"去学习vue"}
];
},
//离职备注提交
smtconfirm()
{
@ -256,7 +266,8 @@ value2:null,
this.atworkDate.year=this.value2.getFullYear();
this.atworkDate.month=this.value2.getMonth()+1;
this.value=this.value2;
this.resDate=[],
getatwork(this.atworkDate).then((response) => {
if (response.data) {
this.atworkList = response.data;