Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop

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

View File

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

View File

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