车间操作子工序过程检查表及菜单修改

This commit is contained in:
shijing 2022-05-19 17:50:47 +08:00
parent 636c1bd7b4
commit fdd1f1736a
4 changed files with 125 additions and 76 deletions

View File

@ -123,6 +123,19 @@ export const asyncRoutes = [
component: () => import('@/views/mtm/materialDetail.vue'),
meta: { title: '物料详情' },
hidden: true
}
,{
path: 'wproductList',
name: 'wproductList',
component: () => import('@/views/mtm/wproductList'),
meta: { title: '半成品列表', icon: 'material', perms: ['mtm_wproduct'] }
},
{
path: 'productList',
name: 'productList',
component: () => import('@/views/mtm/productList'),
meta: { title: '成品列表', icon: 'material', perms: ['mtm_product'] }
},
{
path: 'process',
@ -151,18 +164,7 @@ export const asyncRoutes = [
component: () => import('@/views/mtm/productprocess'),
meta: { title: '产品管理', icon: 'product', perms: ['mtm_productprocess'] }
}
,{
path: 'productList',
name: 'productList',
component: () => import('@/views/mtm/productList'),
meta: { title: '成品列表', icon: 'material', perms: ['mtm_product'] }
}
,{
path: 'wproductList',
name: 'wproductList',
component: () => import('@/views/mtm/wproductList'),
meta: { title: '半成品列表', icon: 'material', perms: ['mtm_wproduct'] }
}
]
},
{

View File

@ -2,7 +2,7 @@
<div class="app-container">
<el-card>
<div slot="header" class="clearfix">
<span style="font-size: 16px;
<span style="font-size: 16px;
font-weight: 700;
">子工序列表</span>
</div>
@ -117,12 +117,16 @@
<el-col :span="9">
<el-card>
<div slot="header" class="clearfix">
<span style="font-size: 16px;
<span style="font-size: 16px;
font-weight: 700;
">过程记录表</span>
</div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增
<el-button
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增
</el-button>
<el-table
:data="recordformList.results"
@ -184,30 +188,37 @@
label-width="80px"
label-position="right"
>
<el-form-item label="表格名称" prop="name">
<el-input v-model="recordform.name" placeholder="表格名称"/>
</el-form-item>
<el-form-item label="文件号" prop="number">
<el-input v-model="recordform.number" placeholder="文件号"/>
</el-form-item>
<el-form-item label="状态">
<el-switch v-model="recordform.enabled"></el-switch>
</el-form-item>
<el-form-item label="表格类型" prop="type">
<el-select style="width: 100%" v-model="recordform.type" placeholder="请选择">
<el-option
v-for="item in typeoptions"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="关联产品">
<el-select style="width: 100%" v-model="recordform.material" placeholder="请选择">
<el-option
v-for="item in productOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -275,25 +286,24 @@
</el-form-item>
</el-row>
</el-form>
<!--<div style="text-align: right">-->
<!--<el-button type="danger">取消</el-button>-->
<!--<el-button type="primary">确认</el-button>-->
<!--</div>-->
</el-dialog>
</el-card>
</el-col>
<el-col :span="15">
<el-card>
<div slot="header" class="clearfix">
<span style="font-size: 16px;
<span style="font-size: 16px;
font-weight: 700;
">记录字段</span>
</div>
<el-button type="primary" icon="el-icon-plus" @click="handlefieldCreate"
>新增
<el-button
type="primary"
icon="el-icon-plus"
@click="handlefieldCreate"
>
新增
</el-button>
<el-table
:data="fieldList.results"
border
fit
@ -301,51 +311,41 @@
highlight-current-row
height="100"
v-el-height-adaptive-table="{bottomOffset: 50}"
>
<el-table-column type="index" width="50"/>
<el-table-column label="字段类型">
<template slot-scope="scope">{{ options_[scope.row.field_type] }}</template>
</el-table-column>
<el-table-column label="字段名称">
<template slot-scope="scope">{{ scope.row.field_name }}</template>
</el-table-column>
<el-table-column label="字段标识">
<template slot-scope="scope">{{ scope.row.field_key }}</template>
</el-table-column>
<el-table-column label="选项显示名">
<template slot-scope="scope">{{ scope.row.field_choice }}</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['material_update'])"
type="primary"
@click="handlefieldEdit(scope)"
>编辑
</el-link
>
编辑
</el-link>
<el-link
v-if="checkPermission(['material_delete'])"
type="danger"
@click="handlefieldDelete(scope)"
>删除
</el-link
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="fieldList.count > 0"
@ -368,14 +368,18 @@
</el-select>
</el-form-item>
<el-form-item label="字段标识" prop="field_key">
<el-input v-model="field.field_key" placeholder="字段标识"
onkeyup="value=value.replace(/[^A-Za-z_\/]/ig,'')"/>
<el-input
v-model="field.field_key"
placeholder="字段标识"
onkeyup="value=value.replace(/[^A-Za-z_\/]/ig,'')"
/>
</el-form-item>
<el-form-item label="字段名称" prop="field_name">
<el-input v-model="field.field_name" placeholder="字段名称"/>
</el-form-item>
<el-form-item label="选项"
v-show="field.field_type=='radio'||field.field_type=='checkbox'||field.field_type=='select'||field.field_type=='selects'"
<el-form-item
v-show="field.field_type==='radio'||field.field_type==='checkbox'||field.field_type==='select'||field.field_type==='selects'"
label="选项"
>
<el-button @click.prevent="addDomain" style="border: none;">
<i class="el-icon-circle-plus-outline"></i>
@ -408,12 +412,11 @@
</template>
<script>
import {getStepLists, createStep, updateStep, deleteStep} from "@/api/mtm";
import {getStepLists, createStep, updateStep, deleteStep,getMaterialList} from "@/api/mtm";
import checkPermission from "@/utils/permission";
import {getEquipmentAll} from "@/api/equipment";
import {upUrl, upHeaders} from "@/api/file";
import {
getStep,
getrecordformList,
createrecordform,
updaterecordform,
@ -442,6 +445,7 @@
return {
step: defaultstep,
stepList: [],
productOptions: [],
upHeaders: upHeaders(),
upUrl: upUrl(),
fileList: {
@ -561,9 +565,19 @@
this.getequipments()
},
mounted(){
this.getProductList();
},
methods: {
getProductList(){
getMaterialList({page:0,type:1}).then((response) => {
if (response.data) {
this.productOptions = response.data;
}
})
},
//添加字段选项
addDomain() {
addDomain(){
this.field_choice.push('')
},
//删除字段选项
@ -739,6 +753,8 @@
},
handleEdit(scope) {
this.recordform = Object.assign({}, scope.row); // copy obj
debugger;
console.log(this.recordform);
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
@ -789,11 +805,10 @@
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
this.recordform.step = this.stepid
this.recordform.step = this.stepid;
updaterecordform(this.recordform.id, this.recordform).then((res) => {
if (res.code >= 200) {
this.recordformLists()
this.recordformLists();
this.dialogVisible = false;
this.$message.success("成功");
}

View File

@ -24,8 +24,15 @@
v-el-height-adaptive-table="{bottomOffset: 50}"
>
<el-table-column type="index" width="50"/>
<el-table-column label="任务编号">
<template slot-scope="scope">
<div v-for="(item,index) in scope.row.out_detail" :key="index">
{{item.plan.number}}
</div>
</template>
</el-table-column>
<el-table-column label="子工序工序">
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
<template slot-scope="scope">{{scope.row.step_.name }}</template>
</el-table-column>
<el-table-column label="是否提交">
<template slot-scope="scope">
@ -39,30 +46,25 @@
<span v-else>{{scope.row.create_by_.username}}</span>
</template>
</el-table-column>
<el-table-column label="过程记录表">
<template v-if="scope.row.record_" slot-scope="scope">
<el-tag
v-for="item in scope.row.record_"
:key="item.id"
:label="item.name"
:value="item.id"
>
{{item.name}}
</el-tag>
<el-table-column label="产品名称">
<template slot-scope="scope">
<div v-for="(item,index) in scope.row.out_detail" :key="index">
{{item.product.name}}
</div>
</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">
<div v-for="(item,index) in scope.row.out_detail" :key="index">
{{item.product.specification}}
</div>
</template>
</el-table-column>
<el-table-column label="产品数量">
<template slot-scope="scope">
{{ scope.row.count_work }}
</template>
</el-table-column>
<el-table-column label="生产设备">
<template slot-scope="scope" v-if="scope.row.equip_">
<el-tag v-for="item in scope.row.equip_"
:key="item.id"
:label="item.number"
:value="item.id">{{item.number}}
</el-tag>
<div v-for="(item,index) in scope.row.out_detail" :key="index">
{{item.count}}
</div>
</template>
</el-table-column>
<el-table-column label="创建时间">

View File

@ -22,6 +22,24 @@
disabled="disabled"
></el-input>
</el-form-item>
<el-form-item label="任务编号" v-show="operationData.number">
<el-input
v-model="operationData.number"
disabled="disabled"
></el-input>
</el-form-item>
<el-form-item label="产品名称" v-show="operationData.name">
<el-input
v-model="operationData.name"
disabled="disabled"
></el-input>
</el-form-item>
<el-form-item label="规格型号" v-show="operationData.specification">
<el-input
v-model="operationData.specification"
disabled="disabled"
></el-input>
</el-form-item>
<el-form-item label="操作人">
<el-input
v-model="operationData.user"
@ -814,7 +832,7 @@
};
},
created() {
mounted() {
this.id = this.$route.params.id; //操作ID
this.readbook();
this.getList(); //边角料
@ -892,6 +910,18 @@
getoperation(this.id).then((response) => {
if (response.data) {
this.operationData = response.data;
let names = '';
let numbers = '';
let specification = '';
response.data.out_detail.forEach(item=>{
names +=item.product.name;
numbers +=item.plan.number;
specification +=item.product.specification;
});
this.operationData.number = names;
this.operationData.name = numbers;
this.operationData.specification = specification;
if (response.data.is_submited) {
this.operationData.user = response.data.create_by_.name;
} else {