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

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

View File

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

View File

@ -22,6 +22,24 @@
disabled="disabled" disabled="disabled"
></el-input> ></el-input>
</el-form-item> </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-form-item label="操作人">
<el-input <el-input
v-model="operationData.user" v-model="operationData.user"
@ -814,7 +832,7 @@
}; };
}, },
created() { mounted() {
this.id = this.$route.params.id; //操作ID this.id = this.$route.params.id; //操作ID
this.readbook(); this.readbook();
this.getList(); //边角料 this.getList(); //边角料
@ -892,6 +910,18 @@
getoperation(this.id).then((response) => { getoperation(this.id).then((response) => {
if (response.data) { if (response.data) {
this.operationData = 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) { if (response.data.is_submited) {
this.operationData.user = response.data.create_by_.name; this.operationData.user = response.data.create_by_.name;
} else { } else {