wentixiugai
This commit is contained in:
parent
b580f858eb
commit
7f4658cef2
|
@ -24,7 +24,7 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: 'Django Vue Admin',
|
title: '航玻生产管理系统',
|
||||||
logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
|
logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 10px">
|
<div style="margin-top: 10px">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
||||||
>新增设备</el-button
|
>新增仓库</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
|
@ -2,7 +2,12 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="6" >
|
<el-col :span="6" >
|
||||||
<el-card style="margin-top: 10px">
|
<el-card >
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span style="font-size: 16px;
|
||||||
|
font-weight: 700;
|
||||||
|
">产品列表</span>
|
||||||
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="materialList.results"
|
:data="materialList.results"
|
||||||
|
@ -29,8 +34,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="18" >
|
<el-col :span="18" >
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
|
|
||||||
<el-descriptions class="margin-top" title="产品信息" :column="3" border>
|
<el-descriptions class="margin-top" title="产品信息" :column="3" border>
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,11 +54,15 @@
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
<el-steps :active="values" spac="400px" align-center="" style="padding-top: 40px;">
|
<span style="font-size: 16px;
|
||||||
|
font-weight: 700;
|
||||||
|
">工艺流程</span>
|
||||||
|
</div>
|
||||||
|
<el-steps :active="values" spac="400px" align-center="" style="padding-top: 20px;">
|
||||||
<el-step :title="item.name" v-for="(item,index) in processoptions " :key="index" @click.native=stepclick(item.id)>
|
<el-step :title="item.name" v-for="(item,index) in processoptions " :key="index" @click.native=stepclick(item.id)>
|
||||||
|
|
||||||
</el-step>
|
</el-step>
|
||||||
|
@ -268,8 +276,9 @@
|
||||||
|
|
||||||
<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
|
<el-table-column
|
||||||
align="center"
|
align="center"
|
||||||
label="操作"
|
label="操作"
|
||||||
|
@ -452,7 +461,7 @@ export default {
|
||||||
stepclick(id)
|
stepclick(id)
|
||||||
{
|
{
|
||||||
this.process = id;
|
this.process = id;
|
||||||
alert(this.process)
|
// alert(this.process)
|
||||||
this.getInputmaterialLists();
|
this.getInputmaterialLists();
|
||||||
|
|
||||||
this.getmaterialList();
|
this.getmaterialList();
|
||||||
|
@ -651,7 +660,7 @@ export default {
|
||||||
|
|
||||||
handlesearch(scope) {
|
handlesearch(scope) {
|
||||||
|
|
||||||
this.$router.push({name: "StepDo", params: { id: scope.row.step_.id }, })
|
this.$router.push({name: "Step", params: { id: scope.row.step_.id }, })
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,16 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card>
|
<el-card>
|
||||||
|
|
||||||
<div style="margin-top: 10px">
|
<div slot="header" class="clearfix">
|
||||||
|
<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-button
|
||||||
>
|
>
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
<el-card style="margin-top: 10px">
|
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="stepList"
|
:data="stepList"
|
||||||
|
@ -17,6 +20,7 @@
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
max-height="600"
|
max-height="600"
|
||||||
|
@row-click="rowClick"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="工序步骤名称">
|
<el-table-column label="工序步骤名称">
|
||||||
|
@ -34,11 +38,6 @@
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
|
||||||
<el-link
|
|
||||||
type="primary"
|
|
||||||
@click="handlesearch(scope)"
|
|
||||||
>查看</el-link
|
|
||||||
>
|
|
||||||
<el-link
|
<el-link
|
||||||
v-if="checkPermission(['step_update'])"
|
v-if="checkPermission(['step_update'])"
|
||||||
@click="handleEdit(scope)"
|
@click="handleEdit(scope)"
|
||||||
|
@ -54,10 +53,10 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
</el-card>
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisibles"
|
||||||
:title="dialogType === 'edit' ? '编辑工序' : '新增工序'"
|
:title="dialogTypes === 'edit' ? '编辑工序' : '新增工序'"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
ref="Form"
|
ref="Form"
|
||||||
|
@ -97,26 +96,254 @@
|
||||||
|
|
||||||
</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="dialogVisibles = 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-card>
|
||||||
|
<el-card>
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="6" >
|
||||||
|
<el-card >
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span style="font-size: 16px;
|
||||||
|
font-weight: 700;
|
||||||
|
">过程记录表</span>
|
||||||
|
</div>
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
||||||
|
>新增</el-button>
|
||||||
|
<el-table
|
||||||
|
|
||||||
|
:data="recordformList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
highlight-current-row
|
||||||
|
height="100"
|
||||||
|
v-el-height-adaptive-table="{bottomOffset: 50}"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
>
|
||||||
|
|
||||||
|
<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
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_update'])"
|
||||||
|
@click="handleEdit(scope)"
|
||||||
|
>编辑</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_delete'])"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope)"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:title="dialogType === 'edit' ? '编辑记录表格' : '新增记录表格'"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Forms"
|
||||||
|
:model="recordform"
|
||||||
|
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="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">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="recordformconfirm('Forms')">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="18" >
|
||||||
|
<el-card >
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span style="font-size: 16px;
|
||||||
|
font-weight: 700;
|
||||||
|
">记录字段</span>
|
||||||
|
</div>
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handlefieldCreate"
|
||||||
|
>新增</el-button>
|
||||||
|
<el-table
|
||||||
|
|
||||||
|
:data="fieldList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
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.boolean_field_display }}</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'])"
|
||||||
|
@click="handlefieldEdit(scope)"
|
||||||
|
>编辑</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_delete'])"
|
||||||
|
type="danger"
|
||||||
|
@click="handlefieldDelete(scope)"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisible1"
|
||||||
|
:title="dialogType1 === 'edit' ? '编辑表格字段' : '新增表格字段'"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Form"
|
||||||
|
:model="field"
|
||||||
|
label-width="80px"
|
||||||
|
label-position="right"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-form-item label="字段类型" prop="field_type">
|
||||||
|
<el-select style="width: 100%" v-model="field.field_type" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in fieldtypeoptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="字段标识" prop="field_key">
|
||||||
|
<el-input v-model="field.field_key" placeholder="字段标识" />
|
||||||
|
</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="布尔类型显示名" prop="boolean_field_display">
|
||||||
|
<vue-json-editor
|
||||||
|
v-model="field.boolean_field_display"
|
||||||
|
:showBtns="false"
|
||||||
|
:mode="'code'"
|
||||||
|
lang="zh"
|
||||||
|
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="选项" prop="field_choice">
|
||||||
|
|
||||||
|
<vue-json-editor
|
||||||
|
v-model="field.field_choice"
|
||||||
|
:showBtns="false"
|
||||||
|
:mode="'code'"
|
||||||
|
lang="zh"
|
||||||
|
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排序" prop="sort">
|
||||||
|
<el-input v-model="field.sort" placeholder="排序" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisible1 = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="fieldconfirm('Form')">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getStepList, createStep,updateStep,deleteStep } from "@/api/mtm";
|
import { getStepList, createStep,updateStep,deleteStep } 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 { getStep,getrecordformList,createrecordform,updaterecordform,deleterecordform,getrffieldList,createrffield,updaterffield,
|
||||||
|
deleterffield} from "@/api/mtm";
|
||||||
|
|
||||||
|
import vueJsonEditor from 'vue-json-editor'
|
||||||
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 defaultstep = {
|
const defaultstep = {
|
||||||
name: "",
|
name: "",
|
||||||
number: "",
|
number: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const defaultrecordform = {
|
||||||
|
|
||||||
|
};
|
||||||
|
const defaultfield = {
|
||||||
|
|
||||||
|
};
|
||||||
export default {
|
export default {
|
||||||
components: { Pagination },
|
components: { Pagination,vueJsonEditor },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
step: defaultstep,
|
step: defaultstep,
|
||||||
|
@ -125,14 +352,97 @@ export default {
|
||||||
upUrl: upUrl(),
|
upUrl: upUrl(),
|
||||||
fileList:[],
|
fileList:[],
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
dialogVisible: false,
|
dialogVisibles: false,
|
||||||
dialogType: "new",
|
dialogTypes: "new",
|
||||||
options:[],
|
options:[],
|
||||||
|
|
||||||
rule1: {
|
rule1: {
|
||||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
recordform: defaultrecordform,
|
||||||
|
field: defaultfield,
|
||||||
|
dialogType: "new",
|
||||||
|
dialogVisible:false,
|
||||||
|
dialogType1: "new",
|
||||||
|
dialogVisible1:false,
|
||||||
|
listQueryrecordform: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
recordformList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
fieldList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
listQueryfield: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
options_: {
|
||||||
|
'string':'字符串',
|
||||||
|
'int':'整型',
|
||||||
|
'float': '浮点',
|
||||||
|
'boolean':'布尔',
|
||||||
|
'date': '日期',
|
||||||
|
'datetime': '日期时间',
|
||||||
|
'radio': '单选',
|
||||||
|
'checkbox': '多选',
|
||||||
|
'select': '单选下拉',
|
||||||
|
'selects': '多选下拉',
|
||||||
|
'textarea': '文本域'
|
||||||
|
},
|
||||||
|
fieldtypeoptions: [{
|
||||||
|
value: 'string',
|
||||||
|
label: '字符串'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'int',
|
||||||
|
label: '整型'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'float',
|
||||||
|
label: '浮点'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'boolean',
|
||||||
|
label: '布尔'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'date',
|
||||||
|
label: '日期'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'datetime',
|
||||||
|
label: '日期时间'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'radio',
|
||||||
|
label: '单选'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'checkbox',
|
||||||
|
label: '多选'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'select',
|
||||||
|
label: '单选下拉'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'selects',
|
||||||
|
label: '多选下拉'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'textarea',
|
||||||
|
label: '文本域'
|
||||||
|
}],
|
||||||
|
typeoptions: [{
|
||||||
|
value: 1,
|
||||||
|
label: '生产记录'
|
||||||
|
}],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
|
@ -193,22 +503,22 @@ export default {
|
||||||
},
|
},
|
||||||
handleCreate() {
|
handleCreate() {
|
||||||
this.step = Object.assign({}, defaultstep);
|
this.step = Object.assign({}, defaultstep);
|
||||||
this.dialogType = "new";
|
this.dialogTypes = "new";
|
||||||
this.dialogVisible = true;
|
this.dialogVisibles = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs["Form"].clearValidate();
|
this.$refs["Form"].clearValidate();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handlesearch(scope) {
|
rowClick(row) {
|
||||||
|
|
||||||
this.$router.push({name: "StepDo", params: { id: scope.row.id }, })
|
|
||||||
|
|
||||||
|
this.stepid= row.id ;
|
||||||
|
this.recordformLists();
|
||||||
},
|
},
|
||||||
|
|
||||||
handleEdit(scope) {
|
handleEdit(scope) {
|
||||||
this.step = Object.assign({}, scope.row); // copy obj
|
this.step = Object.assign({}, scope.row); // copy obj
|
||||||
this.dialogType = "edit";
|
this.dialogTypes = "edit";
|
||||||
this.dialogVisible = true;
|
this.dialogVisibles = true;
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs["Form"].clearValidate();
|
this.$refs["Form"].clearValidate();
|
||||||
|
@ -233,13 +543,13 @@ export default {
|
||||||
async confirm(form) {
|
async confirm(form) {
|
||||||
this.$refs[form].validate((valid) => {
|
this.$refs[form].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const isEdit = this.dialogType === "edit";
|
const isEdit = this.dialogTypes === "edit";
|
||||||
|
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
updateStep(this.step.id, this.step).then((res) => {
|
updateStep(this.step.id, this.step).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisibles = false;
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -248,6 +558,126 @@ export default {
|
||||||
createStep(this.step).then((res) => {
|
createStep(this.step).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.dialogVisibles = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
handleCurrentChange(row){
|
||||||
|
this.formID=row.id;
|
||||||
|
this.fieldLists();
|
||||||
|
|
||||||
|
},
|
||||||
|
recordformLists()
|
||||||
|
{
|
||||||
|
this.listQueryrecordform.step=this.stepid;
|
||||||
|
|
||||||
|
getrecordformList(this.listQueryrecordform).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.recordformList = response.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fieldLists()
|
||||||
|
{
|
||||||
|
this.listQueryfield.form=this.formID
|
||||||
|
getrffieldList(this.listQueryfield).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.fieldList = response.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleCreate() {
|
||||||
|
this.recordform = Object.assign({}, defaultrecordform);
|
||||||
|
this.dialogType = "new";
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Forms"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handlefieldCreate() {
|
||||||
|
this.field = Object.assign({}, defaultfield);
|
||||||
|
this.dialogType1 = "new";
|
||||||
|
this.dialogVisible1 = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleEdit(scope) {
|
||||||
|
this.recordform = Object.assign({}, scope.row); // copy obj
|
||||||
|
this.dialogType = "edit";
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Forms"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handlefieldEdit(scope) {
|
||||||
|
this.field = Object.assign({}, scope.row); // copy obj
|
||||||
|
this.dialogType1 = "edit";
|
||||||
|
this.dialogVisible1 = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDelete(scope) {
|
||||||
|
this.$confirm("确认删除?", "警告", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await deleterecordform(scope.row.id);
|
||||||
|
this.recordformLists()
|
||||||
|
this.$message.success("成功");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handlefieldDelete(scope) {
|
||||||
|
this.$confirm("确认删除?", "警告", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await deleterffield(scope.row.id);
|
||||||
|
this.fieldLists()
|
||||||
|
this.$message.success("成功");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async recordformconfirm(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const isEdit = this.dialogType === "edit";
|
||||||
|
if (isEdit) {
|
||||||
|
this.recordform.step=this.stepid
|
||||||
|
|
||||||
|
updaterecordform(this.recordform.id, this.recordform).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.recordformLists()
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.recordform.step=this.stepid
|
||||||
|
|
||||||
|
createrecordform(this.recordform).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.recordformLists()
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
}
|
}
|
||||||
|
@ -258,6 +688,45 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
async fieldconfirm(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const isEdit = this.dialogType1 === "edit";
|
||||||
|
if (isEdit) {
|
||||||
|
this.field.form=this.formID
|
||||||
|
|
||||||
|
updaterffield(this.field.id, this.field).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.fieldLists()
|
||||||
|
this.dialogVisible1 = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.field.form=this.formID
|
||||||
|
|
||||||
|
createrffield(this.field).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.fieldLists()
|
||||||
|
this.dialogVisible1 = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style>
|
||||||
|
.my-label {
|
||||||
|
background: #E1F3D8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-content {
|
||||||
|
background: #FDE2E2;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -3,10 +3,10 @@
|
||||||
<el-card>
|
<el-card>
|
||||||
|
|
||||||
<el-descriptions title="子工序详情" :column="2" border>
|
<el-descriptions title="子工序详情" :column="2" border>
|
||||||
<el-descriptions-item label="工序名称" label-class-name="my-label" content-class-name="my-content">{{step.name}}</el-descriptions-item>
|
<el-descriptions-item label="工序名称" label-class-name="my-label" content-class-name="my-content">{{stepDO.name}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="步骤编号" label-class-name="my-label" content-class-name="my-content">{{step.number}}</el-descriptions-item>
|
<el-descriptions-item label="步骤编号" label-class-name="my-label" content-class-name="my-content">{{stepDO.number}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="相关设备" label-class-name="my-label" :contentStyle="{'text-align': 'left'}">
|
<el-descriptions-item label="相关设备" label-class-name="my-label" :contentStyle="{'text-align': 'left'}">
|
||||||
<el-tag v-for="item in step.equipments_"
|
<el-tag v-for="item in stepDO.equipments_"
|
||||||
: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>
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
>
|
>
|
||||||
|
|
||||||
<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.name }}</template>
|
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||||
|
|
||||||
|
|
||||||
|
@ -158,11 +158,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
<el-dialog
|
||||||
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-dialog
|
|
||||||
:visible.sync="dialogVisible1"
|
:visible.sync="dialogVisible1"
|
||||||
:title="dialogType1 === 'edit' ? '编辑表格字段' : '新增表格字段'"
|
:title="dialogType1 === 'edit' ? '编辑表格字段' : '新增表格字段'"
|
||||||
>
|
>
|
||||||
|
@ -220,6 +216,11 @@
|
||||||
<el-button type="primary" @click="fieldconfirm('Form')">确认</el-button>
|
<el-button type="primary" @click="fieldconfirm('Form')">确认</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
|
@ -241,9 +242,12 @@ const defaultfield = {
|
||||||
};
|
};
|
||||||
export default {
|
export default {
|
||||||
components: { vueJsonEditor },
|
components: { vueJsonEditor },
|
||||||
|
name: "stepdo",
|
||||||
|
|
||||||
|
props: ["stepid"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
step:"",
|
stepDO:"",
|
||||||
recordform: defaultrecordform,
|
recordform: defaultrecordform,
|
||||||
field: defaultfield,
|
field: defaultfield,
|
||||||
dialogType: "new",
|
dialogType: "new",
|
||||||
|
@ -328,7 +332,9 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
watch: {},
|
watch: {
|
||||||
|
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
||||||
this.getStepD();
|
this.getStepD();
|
||||||
|
@ -339,9 +345,10 @@ export default {
|
||||||
checkPermission,
|
checkPermission,
|
||||||
getStepD()
|
getStepD()
|
||||||
{
|
{
|
||||||
getStep(this.$route.params.id).then((response) => {
|
|
||||||
|
getStep(this.stepid).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.step = response.data;
|
this.stepDO = response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -354,7 +361,7 @@ export default {
|
||||||
},
|
},
|
||||||
recordformLists()
|
recordformLists()
|
||||||
{
|
{
|
||||||
this.listQueryrecordform.step=this.$route.params.id;
|
this.listQueryrecordform.step=this.stepid;
|
||||||
getrecordformList(this.listQueryrecordform).then((response) => {
|
getrecordformList(this.listQueryrecordform).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.recordformList = response.data;
|
this.recordformList = response.data;
|
||||||
|
@ -439,7 +446,7 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const isEdit = this.dialogType === "edit";
|
const isEdit = this.dialogType === "edit";
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
this.recordform.step=this.$route.params.id
|
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) {
|
||||||
|
@ -449,7 +456,7 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.recordform.step=this.$route.params.id
|
this.recordform.step=this.stepid
|
||||||
|
|
||||||
createrecordform(this.recordform).then((res) => {
|
createrecordform(this.recordform).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
<el-form
|
<el-form
|
||||||
ref="Form"
|
ref="Form"
|
||||||
:model="vendor"
|
:model="vendor"
|
||||||
label-width="80px"
|
label-width="120px"
|
||||||
label-position="right"
|
label-position="right"
|
||||||
:rules="rule1"
|
:rules="rule1"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue