Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop
This commit is contained in:
commit
f7a48ecfa7
|
@ -133,7 +133,7 @@
|
|||
<el-row v-show="hasPicture">
|
||||
<el-form-item label="图表">
|
||||
<div>
|
||||
<img id="canvasImg" :src="img" style="width:500px;height: 300px;position: absolute;top: -1000px;">
|
||||
<img id="canvasImg" :src="img" alt="tupian">
|
||||
<div style="position: relative;display: flex;flex-direction: column;
|
||||
border: 1px solid #DCDFE6;">
|
||||
<canvas id="canvas" width="500" height="300">
|
||||
|
@ -170,6 +170,7 @@
|
|||
|
||||
<script>
|
||||
import {upFile} from "@/api/file";
|
||||
|
||||
let preDrawAry = [];
|
||||
export default {
|
||||
name: "index",
|
||||
|
@ -178,7 +179,8 @@
|
|||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}} ,
|
||||
}
|
||||
},
|
||||
formID: {
|
||||
type: Number,
|
||||
default: 0
|
||||
|
@ -244,11 +246,11 @@
|
|||
if (imag.length > 0) {
|
||||
that.img = new Image();
|
||||
that.img.crossOrigin = 'anonymous';
|
||||
let value = imag[0].field_value?imag[0].field_value:imag[0].draw_template;
|
||||
that.img = value;
|
||||
let value = imag[0].field_value!==null&&imag[0].field_value!==undefined&&imag[0].field_value!=='' ? imag[0].field_value : imag[0].draw_template;
|
||||
that.img =process.env.VUE_APP_BASE_API.replace('/api','')+ value;
|
||||
setTimeout(function () {
|
||||
that.canvasInit();
|
||||
},500);
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -434,10 +436,9 @@
|
|||
},
|
||||
//画布添加背景模板图
|
||||
draw() {
|
||||
this.ctx = document.getElementById('canvas').getContext('2d');
|
||||
let canvasImg = document.getElementById("canvasImg");
|
||||
canvasImg.setAttribute("crossOrigin",'anonymous');
|
||||
// canvasImg.style.width = '500px';
|
||||
// canvasImg.style.height = '300px';
|
||||
// canvasImg.setAttribute("crossOrigin", 'anonymous');
|
||||
this.ctx.drawImage(canvasImg, 0, 0, 500, 300);
|
||||
},
|
||||
// 叉号
|
||||
|
@ -757,6 +758,7 @@
|
|||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
@ -795,11 +797,13 @@
|
|||
#res {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.helpText {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
left: 100px;
|
||||
}
|
||||
|
||||
.adoptTip {
|
||||
position: absolute;
|
||||
top: 38px;
|
||||
|
@ -807,6 +811,7 @@
|
|||
font-size: 12px;
|
||||
color: #46ce7a;
|
||||
}
|
||||
|
||||
.failTip {
|
||||
position: absolute;
|
||||
top: 38px;
|
||||
|
@ -814,4 +819,11 @@
|
|||
font-size: 12px;
|
||||
color: #ff0000;
|
||||
}
|
||||
#canvasImg{
|
||||
width:500px;
|
||||
height: 300px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%)
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -329,8 +329,8 @@
|
|||
});
|
||||
that.img = new Image();
|
||||
that.img.crossOrigin = '';
|
||||
that.img = imag[0].field_value;
|
||||
that.originImg = imag[0].origin_value;
|
||||
that.img = process.env.VUE_APP_BASE_API.replace('/api','')+imag[0].field_value;
|
||||
that.originImg = process.env.VUE_APP_BASE_API.replace('/api','')+ imag[0].origin_value;
|
||||
listJudge.forEach(item => {
|
||||
let obj = new Object();
|
||||
obj = item;
|
||||
|
@ -383,7 +383,7 @@
|
|||
let that = this;
|
||||
if(rule!==''&&rule!==null&&rule!==undefined){
|
||||
let reg = /\{(.+?)\}/g;
|
||||
debugger;
|
||||
// debugger;
|
||||
if(rule.indexOf('||')>-1||rule.indexOf('&&')>-1){
|
||||
let tam = '', arr = [];
|
||||
if(rule.indexOf('||')>-1){
|
||||
|
|
|
@ -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'] }
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -53,8 +53,9 @@
|
|||
v-if="this.$route.params.pu_order != null"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.is_testok == false">不合格</el-tag>
|
||||
<el-tag v-else>合格</el-tag>
|
||||
<el-tag v-if="scope.row.is_testok">合格</el-tag>
|
||||
<el-tag v-else-if="scope.row.is_testok===null">未复验</el-tag>
|
||||
<el-tag v-else>不合格</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -86,7 +87,7 @@
|
|||
复验记录
|
||||
</el-link>
|
||||
<el-link
|
||||
v-else-if="scope.row.need_test&&scope.row.test==[]"
|
||||
v-if="scope.row.need_test&&scope.row.test.length===0"
|
||||
type="primary"
|
||||
@click="handleMaterial(scope)"
|
||||
>
|
||||
|
|
|
@ -154,7 +154,8 @@
|
|||
:title="tableForm.name"
|
||||
>
|
||||
<customForm
|
||||
:results="fieldList.results"
|
||||
v-if="dialogVisibleForm"
|
||||
:results="dialogFieldList"
|
||||
:hasPicture="hasPicture"
|
||||
:formID="formID"
|
||||
:isDisabled="isDisabled"
|
||||
|
@ -549,12 +550,13 @@
|
|||
};
|
||||
const defaultrecordform = {enabled: false};
|
||||
export default {
|
||||
components: {Pagination, vueJsonEditor, Treeselect, customForm, faceLogin},
|
||||
components: {Pagination,customForm, faceLogin},
|
||||
data() {
|
||||
return {
|
||||
item:{},
|
||||
step: defaultstep,
|
||||
stepList: [],
|
||||
dialogFieldList: [],
|
||||
upHeaders: upHeaders(),
|
||||
upUrl: upUrl(),
|
||||
fileList: [],
|
||||
|
@ -835,7 +837,7 @@
|
|||
}
|
||||
},
|
||||
checkValue() {
|
||||
this.field.field_key = this.field.field_key.replace(/[^a-zA-Z]/g, '');
|
||||
this.field.field_key = this.field.field_key.replace(/[^0-9a-zA-Z]/g, '');
|
||||
},
|
||||
//添加字段选项
|
||||
addDomain() {
|
||||
|
@ -845,16 +847,23 @@
|
|||
removeDomain(index) {
|
||||
this.field_choice.splice(index, 1);
|
||||
},
|
||||
handleLook(scope) {
|
||||
async handleLook(scope) {
|
||||
debugger;
|
||||
let that = this;
|
||||
this.dialogFieldList=[];
|
||||
that.tableForm = Object.assign({}, scope.row); // copy obj
|
||||
that.formID = that.tableForm.id;
|
||||
that.listQueryfield.form = that.formID;
|
||||
getrffieldList(that.listQueryfield).then((response) => {
|
||||
if (response.data) {
|
||||
this.hasPicture = false;
|
||||
that.fieldList = response.data;
|
||||
let list = response.data.results;
|
||||
}
|
||||
});
|
||||
await getrffieldList({page:0,form:that.formID}).then((response) => {
|
||||
if (response.data) {
|
||||
this.hasPicture = false;
|
||||
let list = response.data;
|
||||
this.dialogFieldList= response.data;
|
||||
let arr = list.filter(item => {
|
||||
return item.field_type === 'draw'
|
||||
});
|
||||
|
@ -877,12 +886,8 @@
|
|||
that.$set(that.checkForm, key, '')
|
||||
}
|
||||
that.dialogVisibleForm = true;
|
||||
/* setTimeout(function () {
|
||||
that.canvasInit();
|
||||
}, 500);*/
|
||||
}
|
||||
});
|
||||
that.fieldLists();
|
||||
},
|
||||
checkPermission,
|
||||
handleCurrentChange(row) {
|
||||
|
|
|
@ -268,7 +268,14 @@
|
|||
},
|
||||
//检查表
|
||||
handlebind(scope) {
|
||||
this.$router.push({name: "MaterialDO", params: {id: scope.row.id},})
|
||||
let materialItem = sessionStorage.getItem('materialItem');
|
||||
if(materialItem){
|
||||
sessionStorage.removeItem('materialItem');
|
||||
sessionStorage.setItem('materialItem',JSON.stringify(scope.row));
|
||||
}else{
|
||||
sessionStorage.setItem('materialItem',JSON.stringify(scope.row));
|
||||
}
|
||||
this.$router.push({name: "MaterialDO", params: {id: scope.row.id}})
|
||||
},
|
||||
handleFilter() {
|
||||
this.listQuery.page = 1;
|
||||
|
|
|
@ -121,8 +121,12 @@
|
|||
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"
|
||||
|
@ -135,8 +139,9 @@
|
|||
@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 label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="关联产品">
|
||||
<template slot-scope="scope" v-if="scope.row.material_">{{ scope.row.material_.name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态">
|
||||
<template slot-scope="scope">
|
||||
|
@ -153,19 +158,16 @@
|
|||
>
|
||||
<template slot-scope="scope">
|
||||
<el-link
|
||||
v-if="checkPermission(['material_update'])"
|
||||
type="primary"
|
||||
@click="handleLook(scope)"
|
||||
>查看
|
||||
</el-link>
|
||||
<el-link
|
||||
v-if="checkPermission(['material_update'])"
|
||||
type="primary"
|
||||
@click="handleEdit(scope)"
|
||||
>编辑
|
||||
</el-link>
|
||||
<el-link
|
||||
v-if="checkPermission(['material_delete'])"
|
||||
type="danger"
|
||||
@click="handleDelete(scope)"
|
||||
>删除
|
||||
|
@ -184,30 +186,54 @@
|
|||
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="引用表单" v-if="dialogType === 'new'">
|
||||
<el-select
|
||||
v-model="recordform.form"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in formList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联产品">
|
||||
<el-select style="width: 100%" v-model="recordform.material" clearable 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>
|
||||
|
@ -220,22 +246,22 @@
|
|||
:visible.sync="dialogVisibleForm"
|
||||
:title="tableForm.name">
|
||||
<el-form
|
||||
label-width="80px"
|
||||
label-width="180px"
|
||||
label-position="right"
|
||||
>
|
||||
<el-row v-for="(item,$index) in fieldList.results" :key="$index">
|
||||
<el-row v-for="(item,$index) in dialogFieldList" :key="$index">
|
||||
<el-form-item v-if="item.field_type==='string'" :label="item.field_name">
|
||||
<el-input placeholder="请输入" v-model="item.sort"/>
|
||||
<el-input placeholder="请输入" v-model="item.low_limit"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-else-if="item.field_type==='int'" :label="item.field_name">
|
||||
<el-input type="number" placeholder="请输入" v-model="item.sort"/>
|
||||
<el-input type="number" placeholder="请输入" v-model="item.low_limit"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-else-if="item.field_type==='float'" :label="item.field_name">
|
||||
<el-input type="number" placeholder="请输入" v-model="item.sort"/>
|
||||
<el-input type="number" placeholder="请输入" v-model="item.low_limit"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-else-if="item.field_type==='date'" :label="item.field_name">
|
||||
<el-date-picker
|
||||
v-model="item.create_time"
|
||||
v-model="item.low_limit"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
|
@ -245,7 +271,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item v-else-if="item.field_type==='datetime'" :label="item.field_name">
|
||||
<el-date-picker
|
||||
v-model="item.create_time"
|
||||
v-model="item.low_limit"
|
||||
type="datetime"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
|
@ -254,8 +280,9 @@
|
|||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item v-else-if="item.field_type==='select'" :label="item.field_name">
|
||||
<el-select style="width: 100%" v-model="item.sort" placeholder="请选择">
|
||||
<el-select style="width: 100%" placeholder="请选择">
|
||||
<el-option
|
||||
v-model="item.low_limit"
|
||||
v-for="item1 in item.field_choice"
|
||||
:key="item1"
|
||||
:label="item1"
|
||||
|
@ -264,8 +291,9 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-else-if="item.field_type==='selects'" :label="item.field_name">
|
||||
<el-select style="width: 100%" v-model="optio" multiple placeholder="请选择">
|
||||
<el-select style="width: 100%" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-model="item.low_limit"
|
||||
v-for="item1 in item.field_choice"
|
||||
:key="item1"
|
||||
:label="item1"
|
||||
|
@ -275,10 +303,6 @@
|
|||
</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>
|
||||
|
@ -289,11 +313,14 @@
|
|||
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 +328,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 +385,21 @@
|
|||
</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(/[^0-9A-Za-z]/g,'')"
|
||||
/>
|
||||
</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 label="字段说明">
|
||||
<el-input v-model="field.help_text" placeholder="字段说明"/>
|
||||
</el-form-item>
|
||||
<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 +432,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 +465,8 @@
|
|||
return {
|
||||
step: defaultstep,
|
||||
stepList: [],
|
||||
dialogFieldList: [],
|
||||
productOptions: [],
|
||||
upHeaders: upHeaders(),
|
||||
upUrl: upUrl(),
|
||||
fileList: {
|
||||
|
@ -501,6 +526,7 @@
|
|||
'datetime': '日期时间',
|
||||
'select': '单选',
|
||||
'selects': '多选',
|
||||
'draw': '绘图模板',
|
||||
},
|
||||
typeoption: [{
|
||||
value: 1,
|
||||
|
@ -547,6 +573,7 @@
|
|||
label: '多选'
|
||||
}
|
||||
],
|
||||
formList:[],
|
||||
typeoptions: [{
|
||||
value: 10,
|
||||
label: '生产记录'
|
||||
|
@ -559,9 +586,20 @@
|
|||
this.step.process = this.$route.params.id;
|
||||
this.getList();
|
||||
this.getequipments()
|
||||
|
||||
},
|
||||
mounted(){
|
||||
this.step.process = this.$route.params.id;
|
||||
this.getProductList();
|
||||
this.getFormList();
|
||||
},
|
||||
methods: {
|
||||
getProductList(){
|
||||
getMaterialList({page:0,type:1}).then((response) => {
|
||||
if (response.data) {
|
||||
this.productOptions = response.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
//添加字段选项
|
||||
addDomain(){
|
||||
this.field_choice.push('')
|
||||
|
@ -571,12 +609,15 @@
|
|||
this.field_choice.splice(index, 1)
|
||||
},
|
||||
handleLook(scope) {
|
||||
debugger;
|
||||
console.log(scope);
|
||||
this.dialogVisibleForm = true;
|
||||
this.tableForm = Object.assign({}, scope.row); // copy obj
|
||||
this.dialogFieldList = [];
|
||||
this.tableForm = Object.assign({}, scope.row);
|
||||
this.formID = this.tableForm.id;
|
||||
this.fieldLists();
|
||||
getrffieldList({page:0,form:this.formID}).then((response) => {
|
||||
if (response.data) {
|
||||
this.dialogFieldList = response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
checkPermission,
|
||||
//子工序列表
|
||||
|
@ -611,7 +652,6 @@
|
|||
this.step.instruction = null;
|
||||
},
|
||||
|
||||
|
||||
handleFilter() {
|
||||
this.listQuery.page = 1;
|
||||
this.getList();
|
||||
|
@ -632,8 +672,8 @@
|
|||
this.$refs["Form"].clearValidate();
|
||||
});
|
||||
},
|
||||
rowClick(row) {
|
||||
|
||||
rowClick(row) {
|
||||
this.stepid = row.id;
|
||||
this.recordformLists();
|
||||
},
|
||||
|
@ -647,6 +687,7 @@
|
|||
this.$refs["Form"].clearValidate();
|
||||
});
|
||||
},
|
||||
|
||||
handleDeleteStep(scope) {
|
||||
this.$confirm("确认删除?", "警告", {
|
||||
confirmButtonText: "确认",
|
||||
|
@ -677,7 +718,6 @@
|
|||
}
|
||||
});
|
||||
} else {
|
||||
console.log(this.step)
|
||||
createStep(this.step).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.getList();
|
||||
|
@ -691,11 +731,12 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleCurrentChange(row) {
|
||||
this.formID = row.id;
|
||||
this.fieldLists();
|
||||
|
||||
},
|
||||
|
||||
recordformLists() {
|
||||
this.listQueryrecordform.step = this.stepid;
|
||||
this.listQueryrecordform.type = 10;
|
||||
|
@ -703,32 +744,45 @@
|
|||
if (response.data) {
|
||||
this.recordformList = response.data;
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
getFormList(){
|
||||
getrecordformList({page:0,type:10}).then((response) => {
|
||||
if (response.data) {
|
||||
this.formList = response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
fieldLists() {
|
||||
this.listQueryfield.form = this.formID
|
||||
this.listQueryfield.form = this.formID;
|
||||
getrffieldList(this.listQueryfield).then((response) => {
|
||||
if (response.data) {
|
||||
this.fieldList = response.data;
|
||||
debugger;
|
||||
console.log(this.fieldList)
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
//新增记录表
|
||||
handleCreate() {
|
||||
if(this.stepid!==''&&this.stepid!==null&&this.stepid!==undefined){
|
||||
this.recordform = Object.assign({}, defaultrecordform);
|
||||
this.dialogType = "new";
|
||||
this.dialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["Forms"].clearValidate();
|
||||
});
|
||||
}else{
|
||||
this.$confirm("请选择子工序", "警告", {
|
||||
confirmButtonText: "确认",
|
||||
type: "error",
|
||||
}) .then(async () => {
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
//新增字段
|
||||
handlefieldCreate() {
|
||||
|
||||
this.field_choice = [''];
|
||||
this.field = Object.assign({}, defaultfield);
|
||||
this.dialogType1 = "new";
|
||||
|
@ -762,7 +816,7 @@
|
|||
})
|
||||
.then(async () => {
|
||||
await deleterecordform(scope.row.id);
|
||||
this.recordformLists()
|
||||
this.recordformLists();
|
||||
this.$message.success("成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
|
@ -777,7 +831,7 @@
|
|||
})
|
||||
.then(async () => {
|
||||
await deleterffield(scope.row.id);
|
||||
this.fieldLists()
|
||||
this.fieldLists();
|
||||
this.$message.success("成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
|
@ -789,21 +843,19 @@
|
|||
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("成功");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.recordform.step = this.stepid
|
||||
|
||||
this.recordform.step = this.stepid;
|
||||
createrecordform(this.recordform).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.recordformLists()
|
||||
this.recordformLists();
|
||||
this.dialogVisible = false;
|
||||
this.$message.success("成功");
|
||||
}
|
||||
|
@ -823,7 +875,7 @@
|
|||
this.field.field_choice = this.field_choice;
|
||||
updaterffield(this.field.id, this.field).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.fieldLists()
|
||||
this.fieldLists();
|
||||
this.dialogVisible1 = false;
|
||||
this.$message.success("成功");
|
||||
}
|
||||
|
@ -833,7 +885,7 @@
|
|||
this.field.field_choice = this.field_choice;
|
||||
createrffield(this.field).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.fieldLists()
|
||||
this.fieldLists();
|
||||
this.dialogVisible1 = false;
|
||||
this.$message.success("成功");
|
||||
}
|
||||
|
|
|
@ -241,7 +241,14 @@
|
|||
},
|
||||
//检查表
|
||||
handlebind(scope) {
|
||||
this.$router.push({name: "MaterialDO", params: {id: scope.row.id},})
|
||||
let materialItem = sessionStorage.getItem('materialItem');
|
||||
if(materialItem){
|
||||
sessionStorage.removeItem('materialItem');
|
||||
sessionStorage.setItem('materialItem',JSON.stringify(scope.row));
|
||||
}else{
|
||||
sessionStorage.setItem('materialItem',JSON.stringify(scope.row));
|
||||
}
|
||||
this.$router.push({name: "MaterialDO", params: {id: scope.row.id}})
|
||||
},
|
||||
handleFilter() {
|
||||
this.listQuery.page = 1;
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
<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.brand }}</template>
|
||||
</el-table-column>-->
|
||||
<el-table-column label="采购数量">
|
||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||
</el-table-column>
|
||||
|
@ -90,6 +93,9 @@
|
|||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="物料品牌">
|
||||
<el-input v-model="puorderTtem.brand" placeholder="规格型号"/>
|
||||
</el-form-item>-->
|
||||
</el-form>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||
|
|
|
@ -24,6 +24,13 @@
|
|||
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>
|
||||
</el-table-column>
|
||||
|
@ -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="创建时间">
|
||||
|
|
|
@ -10,7 +10,23 @@
|
|||
>查看作业指导书
|
||||
</el-button>
|
||||
</div>
|
||||
<el-form
|
||||
<el-descriptions :column="3" border style="margin-bottom: 20px">
|
||||
<el-descriptions-item label="任务编号" v-if="operationData.number">{{operationData.number}}</el-descriptions-item>
|
||||
<el-descriptions-item label="产品名称" v-if="operationData.name">{{operationData.name}}</el-descriptions-item>
|
||||
<el-descriptions-item label="规格型号" v-if="operationData.specification">{{operationData.specification}}</el-descriptions-item>
|
||||
<el-descriptions-item label="子工序">{{operationData.step_.name}}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{operationData.create_time}}</el-descriptions-item>
|
||||
<el-descriptions-item label="操作人">{{operationData.user}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-button
|
||||
v-if="operationData.is_submited == false"
|
||||
type="primary"
|
||||
style="float: right"
|
||||
@click="handlesubmit()"
|
||||
>
|
||||
提交本次操作
|
||||
</el-button>
|
||||
<!-- <el-form
|
||||
ref="form"
|
||||
inline="true"
|
||||
:model="operationData"
|
||||
|
@ -22,6 +38,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"
|
||||
|
@ -35,16 +69,9 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
v-if="operationData.is_submited == false"
|
||||
type="primary"
|
||||
style="float: right"
|
||||
@click="handlesubmit()"
|
||||
>
|
||||
提交本次操作
|
||||
</el-button>
|
||||
|
||||
</el-form-item>
|
||||
<!--
|
||||
<!–
|
||||
<el-form-item label="边角料">
|
||||
<el-radio-group v-model="operationData.use_scrap">
|
||||
<el-radio border
|
||||
|
@ -58,7 +85,7 @@
|
|||
<el-form-item label="备注" v-if="operationData.use_scrap">
|
||||
<el-input type="textarea" v-model="operationData.remark"></el-input>
|
||||
</el-form-item>
|
||||
!-->
|
||||
!–>
|
||||
<el-form-item v-if="operationData.use_scrap">
|
||||
<el-button
|
||||
type="primary"
|
||||
|
@ -68,7 +95,7 @@
|
|||
</el-button>
|
||||
<el-button>取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-form>-->
|
||||
<el-drawer
|
||||
title="作业指导书查看!"
|
||||
:visible.sync="drawer"
|
||||
|
@ -814,7 +841,7 @@
|
|||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
mounted() {
|
||||
this.id = this.$route.params.id; //操作ID
|
||||
this.readbook();
|
||||
this.getList(); //边角料
|
||||
|
@ -892,6 +919,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 = numbers;
|
||||
this.operationData.name = names;
|
||||
this.operationData.specification = specification;
|
||||
|
||||
if (response.data.is_submited) {
|
||||
this.operationData.user = response.data.create_by_.name;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue