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

This commit is contained in:
caoqianming 2022-01-21 16:13:39 +08:00
commit 07c6f4ae53
14 changed files with 1210 additions and 1032 deletions

View File

@ -36,34 +36,34 @@ export function deleteEquipment(id, data) {
}
export function getEquipmentrecordList(query) {
return request({
url: '/em/equipmentrecord/',
url: '/em/echeck_record/',
method: 'get',
params: query
})
}
export function getEquipmentrecordAll() {
return request({
url: '/em/equipmentrecord/',
url: '/em/echeck_record/',
method: 'get'
})
}
export function createEquipmentrecord(data) {
return request({
url: '/em/equipmentrecord/',
url: '/em/echeck_record/',
method: 'post',
data
})
}
export function updateEquipmentrecord(id, data) {
return request({
url: `/em/equipmentrecord/${id}/`,
url: `/em/echeck_record/${id}/`,
method: 'put',
data
})
}
export function deleteEquipmentrecord(id, data) {
return request({
url: `/em/equipmentrecord/${id}/`,
url: `/em/echeck_record/${id}/`,
method: 'delete',
data
})

View File

@ -358,3 +358,13 @@ export function getCard(id) {
method: 'GET',
})
}
//指派发货订单
export function toorder(data) {
return request({
url: '/wpm/wproduct/to_order/',
method: 'post',
data
})
}

View File

@ -273,12 +273,6 @@ export const asyncRoutes = [
name: 'record',
component: () => import('@/views/em/record'),
meta: { title: '校准检定记录', icon: 'example', perms: ['em_record'] }
},
{
path: 'detection ',
name: 'detection ',
component: () => import('@/views/em/detection'),
meta: { title: '运维记录', icon: 'example', perms: ['em_detection'] }
}
]
},
@ -399,6 +393,12 @@ export const asyncRoutes = [
name: 'producttest',
component: () => import('@/views/qm/producttest'),
meta: { title: '成品检验', icon: 'example', perms: ['index_manage'] }
},
{
path: 'unproduct',
name: 'unproduct',
component: () => import('@/views/qm/unproduct'),
meta: { title: '不合格品', icon: 'example', perms: ['index_manage'] }
}
]

View File

@ -27,18 +27,17 @@
>重置</el-button
>
</div>
</el-card>
<el-card >
<el-card>
<el-table
v-loading="listLoading"
:data="equipmentList.results"
:cell-style="tableRowClassName"
border
fit
stripe
highlight-current-row
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
v-el-height-adaptive-table="{ bottomOffset: 42 }"
>
<el-table-column type="index" width="50" />
<el-table-column label="设备编号">
@ -46,17 +45,28 @@
</el-table-column>
<el-table-column label="管理类别">
<template slot-scope="scope">{{ mgmtype_[scope.row.mgmtype] }}</template>
<template slot-scope="scope">{{
mgmtype_[scope.row.mgmtype]
}}</template>
</el-table-column>
<el-table-column label="校/检方式">
<el-table-column label="校/检方式" width="100">
<template slot-scope="scope">{{ waytype_[scope.row.way] }}</template>
</el-table-column>
<el-table-column label="标准/依据">
<el-table-column label="标准/依据" width="100">
<template slot-scope="scope">{{ scope.row.standard }}</template>
</el-table-column>
<el-table-column label="校/检周期">
<el-table-column label="校/检周期" width="100">
<template slot-scope="scope">{{ scope.row.cycle }}</template>
</el-table-column>
<el-table-column label="最近一次校准日期" width="140">
<template slot-scope="scope">{{ scope.row.check_date }}</template>
</el-table-column>
<el-table-column label="下次校准日期" width="130">
<template slot-scope="scope">
{{ scope.row.next_check_date }}</template
>
</el-table-column>
<el-table-column label="设备名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
@ -70,38 +80,35 @@
<el-table-column label="使用类别">
<template slot-scope="scope">{{ usetype_[scope.row.way] }}</template>
</el-table-column>
<el-table-column label="校/检状态">
<template slot-scope="scope">{{ state_[scope.row.statedm] }}</template>
<el-table-column label="校/检状态" width="100">
<template slot-scope="scope">{{ state_[scope.row.state] }}</template>
</el-table-column>
<el-table-column label="保管人">
<template slot-scope="scope" v-if="scope.row.keeper_">{{ scope.row.keeper_.username }}</template>
<template slot-scope="scope" v-if="scope.row.keeper_">{{
scope.row.keeper_.username
}}</template>
</el-table-column>
<el-table-column label="存放位置">
<template slot-scope="scope">{{ scope.row.place }}</template>
</el-table-column>
<el-table-column label="绑定工序">
<template slot-scope="scope" v-if="scope.row.step_">
<el-tag v-for="item in scope.row.step_"
<el-tag
v-for="item in scope.row.step_"
:key="item.number"
:label="item.name"
:value="item.number">{{item.name}}</el-tag>
:value="item.number"
>{{ item.name }}</el-tag
>
</template>
</el-table-column>
<el-table-column label="备注">
<template slot-scope="scope">{{ scope.row.description }}</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="120px"
>
<el-table-column align="center" label="操作" fixed="right" width="120px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['equipment_update'])"
type="primary"
@ -157,33 +164,45 @@
</el-col>
<el-col :span="12">
<el-form-item label="标准/依据" prop="standard">
<el-input v-model="equipment.standard" placeholder="溯源标准或依据" />
<el-input
v-model="equipment.standard"
placeholder="溯源标准或依据"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="校/检状态" prop="statedm">
<el-select style="width: 100%" v-model="equipment.statedm" placeholder="请选择">
<el-form-item label="校/检状态" prop="state">
<el-select
style="width: 100%"
v-model="equipment.state"
placeholder="请选择"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="管理类别" prop="mgmtype">
<el-select style="width: 100%" v-model="equipment.mgmtype" placeholder="请选择">
<el-select
style="width: 100%"
v-model="equipment.mgmtype"
placeholder="请选择"
>
<el-option
v-for="item in mgmoptions"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
@ -197,35 +216,39 @@
</el-col>
<el-col :span="12">
<el-form-item label="责任人" prop="keeper">
<el-select
v-model="equipment.keeper"
filterable
style="width: 100%"
allow-create
default-first-option
placeholder="请选择">
placeholder="请选择"
>
<el-option
v-for="item in keeperOptions"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="校/检方式" prop="way">
<el-select style="width: 100%" v-model="equipment.way" placeholder="请选择">
<el-select
style="width: 100%"
v-model="equipment.way"
placeholder="请选择"
>
<el-option
v-for="item in wayoptions"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
@ -239,20 +262,27 @@
<el-row>
<el-col :span="12">
<el-form-item label="使用类别" prop="usetype">
<el-select style="width: 100%" v-model="equipment.usetype" placeholder="请选择">
<el-select
style="width: 100%"
v-model="equipment.usetype"
placeholder="请选择"
>
<el-option
v-for="item in useoptions"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="校/检周期" prop="cycle">
<el-input v-model="equipment.cycle" placeholder="校准或检定周期" />
<el-input
v-model="equipment.cycle"
placeholder="校准或检定周期"
/>
</el-form-item>
</el-col>
</el-row>
@ -269,14 +299,6 @@
placeholder="备注"
/>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -285,13 +307,19 @@
</el-dialog>
</div>
</template>
<style>
</style>
<script>
import { getpEquipmentList, createEquipment,updateEquipment,deleteEquipment } from "@/api/equipment";
import {
getpEquipmentList,
createEquipment,
updateEquipment,
deleteEquipment,
} from "@/api/equipment";
import { getUserList } from "@/api/user";
import { getOrgList } from "@/api/org";
import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultequipment = {
@ -307,78 +335,73 @@ export default {
count: 0,
},
mgmtype_: {
'1':'A',
'2':'B',
'3':'C',
1: "A",
2: "B",
3: "C",
},
mgmoptions: [{
mgmoptions: [
{
value: 1,
label: 'A'
}, {
label: "A",
},
{
value: 2,
label: 'B'
label: "B",
},
{
value: 3,
label: 'C'
}],
label: "C",
},
],
waytype_: {
'1':'外检',
'2':'自检',
1: "外检",
2: "自检",
},
wayoptions: [{
wayoptions: [
{
value: 1,
label: '外检'
}, {
value: 2,
label: '自检'
}],
usetype_:{
'1':'专用',
'2':'公用',
},
useoptions: [{
value: 1,
label: '专用'
}, {
value: 2,
label: '公用'
}],
state_:{
0:'合格',
1:'准用',
2:'限用',
3:'禁用',
4:'停用',
5:'封存',
},
options: [{
value: 0,
label: '合格'
}, {
value: 1,
label: '准用'
}, {
value: 2,
label: '限用'
label: "外检",
},
{
value: 3,
label: '禁用'
}, {
value: 4,
label: '停用'
}, {
value: 5,
label: '封存'
}],
value: 2,
label: "自检",
},
],
usetype_: {
1: "专用",
2: "公用",
},
useoptions: [
{
value: 1,
label: "专用",
},
{
value: 2,
label: "公用",
},
],
state_: {
10: "合格",
40: "禁用",
},
options: [
{
value: 10,
label: "合格",
},
{
value: 40,
label: "禁用",
},
],
listQuery: {
page: 1,
page_size: 20,
},
keeperOptions:[],
depOptions:[],
keeperOptions: [],
depOptions: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
@ -388,23 +411,26 @@ export default {
type: [{ required: true, message: "请输入", trigger: "blur" }],
model: [{ required: true, message: "请输入", trigger: "blur" }],
state: [{ required: true, message: "请选择", trigger: "blur" }],
belong_dept:[{ required: true, message: "请选择", trigger: "blur" }]
belong_dept: [{ required: true, message: "请选择", trigger: "blur" }],
},
datatime: null,
};
},
computed: {},
watch: {},
created() {
this.getList();
this.getUserList();
this.getOrgList();
},
methods: {
checkPermission,
//设备列表
getList() {
this.listLoading = true;
this.listQuery.type=2;
this.listQuery.type = 2;
getpEquipmentList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentList = response.data;
@ -412,20 +438,51 @@ export default {
this.listLoading = false;
});
},
//校准时间提醒
tableRowClassName(row, column, rowIndex, columnIndex) {
if(row.row.next_check_date!=null)
{
var adata = new Date(); //获取当前时间
const date = {
year: adata.getFullYear(),
month: adata.getMonth() + 1,
date: adata.getDate(),
};
const newmonth = date.month > 10 ? date.month : "0" + date.month;
const day = date.date > 10 ? date.date : "0" + date.date;
var updateTime = date.year + "-" + newmonth + "-" + day;
var dateBegin = row.row.next_check_date;
var a =
(new Date(dateBegin).getTime() - new Date(updateTime).getTime()) /1000/60/60/24; //计算出相差的毫秒数
console.log(a);
if (4>a&&a>0 && row.column.label==='下次校准日期') {
return "background:yellow";
}
else if (a<0 && row.column.label==='下次校准日期') {
return "background:red";
}
return "";
}
},
//组员列表
getUserList() {
getUserList({pageoff:true}).then((res) => {
getUserList({ page: 0 }).then((res) => {
this.keeperOptions = genTree(res.data);
});
},
//部门列表
getOrgList() {
getOrgList({pageoff:true}).then((res) => {
getOrgList({ page: 0 }).then((res) => {
this.depOptions = genTree(res.data);
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
@ -434,7 +491,7 @@ export default {
this.listQuery = {
page: 1,
page_size: 20,
}
};
this.getList();
},
handleCreate() {
@ -483,7 +540,7 @@ export default {
}
});
} else {
this.equipment.type=2;
this.equipment.type = 2;
createEquipment(this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();

View File

@ -298,22 +298,22 @@ export default {
count: 0,
},
state_:{
0:'完好',
1:'限用',
2:'在修',
3:'禁用',
10:'完好',
20:'限用',
30:'在修',
40:'禁用',
},
options: [{
value: 0,
value: 10,
label: '完好'
}, {
value: 1,
value: 20,
label: '限用'
}, {
value: 2,
value: 30,
label: '在修'
}, {
value: 3,
value: 40,
label: '禁用'
}],
listQuery: {

View File

@ -52,13 +52,10 @@
<template slot-scope="scope">{{ scope.row.equipment_.model }}</template>
</el-table-column>
<el-table-column label="设备状态">
<template slot-scope="scope">{{ state_[scope.row.equipment_.statedm] }}</template>
<template slot-scope="scope">{{ state_[scope.row.equipment_.state] }}</template>
</el-table-column>
<el-table-column label="最近一次校准/检定日期">
<template slot-scope="scope">{{ scope.row.recentlydate }}</template>
</el-table-column>
<el-table-column label="下次应校准或检定日期">
<template slot-scope="scope">{{ scope.row.nextdate }}</template>
<el-table-column label="校准检查日期">
<template slot-scope="scope">{{ scope.row.check_date }}</template>
</el-table-column>
<el-table-column label="备注">
<template slot-scope="scope">{{ scope.row.description }}</template>
@ -107,7 +104,7 @@
:rules="rule1"
>
<el-form-item label="校准检定设备" prop="equipment">
<el-form-item label="校准检定设备" prop="equipment">
<el-select style="width: 100%" v-model="equipmentrecord.equipment" placeholder="请选择">
<el-option
v-for="item in equipmentoptions"
@ -117,22 +114,11 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="校准或检定状态" prop="state">
<el-select style="width: 100%" v-model="equipmentrecord.state" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="最近一次校准或检定日期" prop="recentlydate">
<el-form-item label="校准检查日期" prop="check_date">
<el-date-picker
v-model="equipmentrecord.recentlydate"
v-model="equipmentrecord.check_date"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
@ -141,21 +127,7 @@
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="下次应校准或检定日期" prop="nextdate">
<el-date-picker
v-model="equipmentrecord.nextdate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width: 100%"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="description">
<el-input
type="textarea"
@ -176,7 +148,7 @@
</div>
</template>
<script>
import { getpEquipmentList, createEquipment,updateEquipment,deleteEquipment,
import { getpEquipmentList,
getEquipmentrecordList, createEquipmentrecord,updateEquipmentrecord,deleteEquipmentrecord } from "@/api/equipment";
import { getUserList } from "@/api/user";
import { getOrgList } from "@/api/org";
@ -202,39 +174,18 @@ export default {
},
equipmentoptions:[],
state_:{
0:'合格',
1:'准用',
2:'限用',
3:'禁用',
4:'停用',
5:'封存',
10:'合格',
40:'禁用',
},
options: [{
value: 0,
label: '合格'
}, {
value: 1,
label: '准用'
}, {
value: 2,
label: '限用'
},
{
value: 3,
label: '禁用'
}, {
value: 4,
label: '停用'
}, {
value: 5,
label: '封存'
}],
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
equipment: [{ required: true, message: "请输入", trigger: "blur" }],
state: [{ required: true, message: "请输入", trigger: "blur" }],
},
};

View File

@ -77,6 +77,12 @@
</el-table-column>
<el-table-column label="工序">
<template slot-scope="scope">{{ scope.row.process_.name }}</template>
</el-table-column>
<el-table-column label="是否质检">
<template slot-scope="scope">
<el-tag v-if="scope.row.need_combtest==true"> </el-tag>
<el-tag v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="排序">
<template slot-scope="scope">{{ scope.row.sort }}</template>
@ -131,6 +137,9 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否质检" prop="need_combtest">
<el-switch v-model="subproducation.need_combtest"></el-switch>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number
@ -554,7 +563,7 @@
<el-table-column align="center" label="文件">
<template slot-scope="scope" v-if="scope.row.file_">
<el-link :href="scope.row.file_.path" >{{scope.row.file_.name}}</el-link>
<el-link :href="scope.row.file_.file" >{{scope.row.file_.name}}</el-link>
</template>
</el-table-column>
<el-table-column
@ -659,7 +668,7 @@ const defaultusedstep = {
};
const defaulttechdoc = {enabled:false};
const defaultsubproducation = {
need_combtest:false,
};
export default {

View File

@ -149,86 +149,7 @@
:limit.sync="listQuery2.page_size"
@pagination="getList2"
/>
<!--不合格半成品重审-->
<el-dialog title="不合格半成品重审" :close-on-click-modal="false" :visible.sync="limitedRetrial">
<el-form label-width="130px" label-position="right">
<el-form-item :label="item.field_name" v-for="item in customfieldList.ticket_data_" :key="item.id" v-show="!item.is_hidden">
<template v-if="item.field_type=='string'">
<el-input v-model="item.default_value" :placeholder="item.description" />
</template>
<template v-if="item.field_type==='int'">
<el-input v-model="item.default_value" type="number" :placeholder="item.description" oninput="value=value.replace(/[^\d]/g,'')" />
</template>
<template v-if="item.field_type==='float'">
<el-input v-model="item.default_value" type="number" :placeholder="item.description" />
</template>
<template v-if="item.field_type==='date'">
<el-date-picker
v-model="item.default_value"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width: 100%"
>
</el-date-picker>
</template>
<template v-if="item.field_type==='datetime'">
<el-date-picker
v-model="item.default_value"
type="datetime"
placeholder="选择日期"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%"
>
</el-date-picker>
</template>
<template v-if="item.field_type==='select'">
<el-select style="width: 100%" v-model="item.default_value" placeholder="请选择">
<el-option
v-for="item1 in item.field_choice"
:key="item1.id"
:label="item1.name"
:value="item1.id"
>
</el-option>
</el-select>
</template>
<template v-if="item.field_type==='selects'">
<el-select style="width: 100%" multiple v-model="item.default_value" placeholder="请选择">
<el-option
v-for="item1 in item.field_choice"
:key="item1.id"
:label="item1.name"
:value="item1.id"
>
</el-option>
</el-select>
</template>
<template v-if="item.field_type==='textarea'">
<el-input type="textarea" :rows="3" v-model="item.default_value" placeholder="内容" />
</template>
<template v-if="item.field_type==='file'">
<el-upload
ref="upload"
:action="upUrl"
:on-preview="handlePreview"
:on-success="handleUpSuccess"
:on-remove="handleRemove"
:headers="upHeaders"
:file-list="fileList"
:limit="1"
accept=".doc,.docx,.xls,.xlsx,.ppt,.pptx"
>
<el-button size="small" type="primary">上传文件</el-button>
</el-upload>
</template>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="limitedRetrial = false"> </el-button>
</div>
</el-dialog>
</el-tab-pane>
</el-tabs>
</el-card>

View File

@ -136,7 +136,7 @@ export default {
//半成品列表
getList() {
this.listLoading = true;
this.listQuery.type=1;
this.listQuery.material__type=1;
getiproductList(this.listQuery).then((response) => {
if (response.data) {
this.iproductData= response.data;

View File

@ -0,0 +1,294 @@
<template>
<div class="app-container">
<el-card style="margin-top: 2px">
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="成品不合格" name="1">
<el-table
:data="wproductList.results"
border
fit
stripe
highlight-current-row
max-height="600"
>
<el-table-column type="index" label="序号" 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" v-if="scope.row.subproduction_plan_">{{ scope.row.subproduction_plan_.number }}
</template>
</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" v-if="scope.row.material_">{{ scope.row.material_.specification }}</template>
</el-table-column>
<el-table-column label="军检状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_mtested==false">未军检</el-tag>
<el-tag v-if="scope.row.is_mtested==true">已军检</el-tag>
</template>
</el-table-column>
<el-table-column label="军检结论">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_mtestok==false">不合格</el-tag>
<el-tag v-if="scope.row.is_mtestok==true">合格</el-tag>
</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-column label="检查表">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
<el-table-column label="检查状态">
<template slot-scope="scope">{{ actstate_[scope.row.act_state]}}</template>
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])&&scope.row.act_state==30&&scope.row.is_mtested==false"
@click="handleMtest(scope)"
>军检
</el-link>
<el-link
@click="checkRecord(scope)"
>检验记录
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="wproductList.count > 0"
:total="wproductList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-tab-pane>
<el-tab-pane label="过程不合格品" name="2">
<el-table
:data="wproductticket.results"
border
fit
stripe
highlight-current-row
height="620"
v-el-height-adaptive-table="{ bottomOffset: 40 }"
>
<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" v-if="scope.row.order_">{{
scope.row.order_.number
}}</template>
</el-table-column>
<el-table-column label="产品名称">
<template slot-scope="scope" v-if="scope.row.product_">{{
scope.row.product_.name
}}</template>
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope" v-if="scope.row.product_">{{
scope.row.product_.specification
}}</template>
</el-table-column>
<el-table-column label="责任工序">
<template slot-scope="scope" v-if="scope.row.resp_process_">{{
scope.row.resp_process_.name
}}</template>
</el-table-column>
<el-table-column label="处理结果">
<template slot-scope="scope">{{
decision_[scope.row.decision]
}}</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{
scope.row.create_time
}}</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['material_update'])"
type="primary"
@click="handledetailbhg(scope)"
>查看</el-link
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="wproductticket.count > 0"
:total="wproductticket.count"
:page.sync="listQuery2.page"
:limit.sync="listQuery2.page_size"
@pagination="getList2"
/>
</el-tab-pane>
<el-tab-pane label="入场不合格" name="4">
<el-table
v-loading="listLoading"
:data="fifodetailList4.results"
border
fit
stripe
highlight-current-row
height="620"
v-el-height-adaptive-table="{bottomOffset: 40}"
>
<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-column label="物料单位">
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
</el-table>
<pagination
v-show="fifodetailList4.count > 0"
:total="fifodetailList4.count"
:page.sync="listQuery4.page"
:limit.sync="listQuery4.page_size"
@pagination="getList4"
/>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</template>
<script>
import { getProductionplanList } from "@/api/pm";
import { getwproductticketList,getwproductList } from "@/api/wpm";
import { ticketread } from "@/api/workflow";
import { getfifodetailList} from "@/api/inm";
import checkPermission from "@/utils/permission";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
export default {
components: { Pagination },
data() {
return {
wproductList: {
count: 0,
},
actstate_: {
6: "待复检",
10: "操作进行中",
20: "待检验",
30: "已合格",
40: "库存中",
50: "不合格",
60: "待成品检验",
8: "操作准备中",
26: "待夹层检验",
70: "报废",
},
listQuery: {
page: 1,
page_size: 20,
},
wproductticket: {
count: 0,
},
listQuery2: {
page: 1,
page_size: 20,
},
customfieldList: [],
activeName: "1",
decision_: {
10: "返工",
20: "返修",
30: "报废",
40: "让步接受",
50: "偏离许可",
60: "降级使用",
70: "退回供方",
80: "召回",
},
listQuery4: {
page: 1,
page_size: 20,
},
fifodetailList4:{
count: 0,
},
};
},
computed: {},
watch: {},
created() {
this.getList(); //成品不合格
this.getList2(); //过程
this.getList4();//入场不合格
},
methods: {
checkPermission,
//不合格成品
getList() {
this.listLoading = true;
this.listQuery.material__type = 1;
this.listQuery.tag='ok';
getwproductList(this.listQuery).then((response) => {
if (response.data) {
this.wproductList = response.data;
}
});
},
//不合格玻璃审批工单列表
getList2() {
getwproductticketList(this.listQuery2).then((response) => {
if (response.data) {
this.wproductticket = response.data;
}
});
},
//不合格玻璃审理单查看
handledetailbhg(scope)
{
this.$router.push({name:"ticketDetail",params:{ticketId:scope.row.ticket}})
},
//入场检验不合格
//不合格物料
getList4() {
this.listLoading = true;
this.listQuery4.fifo__type = 3;
this.listQuery4.is_testok = false;
this.listQuery4.is_tested = true;
getfifodetailList(this.listQuery4).then((response) => {
if (response.data) {
this.fifodetailList4 = response.data;
}
this.listLoading = false;
});
},
},
};
</script>

View File

@ -206,8 +206,8 @@ export default {
dialogVisible: false,
dialogType: "new",
rule1: {
number: [{ required: true, message: "请输入", trigger: "blur" }],
customer: [{ required: true, message: "请输入", trigger: "blur" }],
product: [{ required: true, message: "请输入", trigger: "blur" }],
delivery_date: [{ required: true, message: "请输入", trigger: "blur" }],
},

View File

@ -262,7 +262,7 @@ export default {
if (response.data) {
this.sale.customer = response.data.customer;
this.sale.product = response.data.product;
getiproductList({page:0,material__type:1,material:this.sale.product}).then((response) => {
getiproductList({page:0,to_order:response.data.id}).then((response) => {
if (response.data) {
this.iproductoptions=response.data;
}

View File

@ -4,7 +4,9 @@
<div slot="header" class="clearfix">
<span>基本信息</span>
<el-button style="float: right; padding: 3px 0" @click="readbook()" type="text">查看作业指导书</el-button>
<el-button style="float: right; padding: 3px 0" @click="getWordText()" type="text">查看作业指导书</el-button>
</div>
<el-form
ref="form"
@ -57,18 +59,13 @@
</el-form-item>
</el-form>
<el-drawer
title="作业指导书点击下载查看!"
title="作业指导书查看!"
:visible.sync="drawer"
direction="rtl"
size="10%">
<el-table :data="techdocList">
<el-table-column label="表名称" width="150">
<template slot-scope="scope">
<el-link type="primary" :href="scope.row.file_.file" target="_blank">{{ scope.row.file_.name }}</el-link>
</template>
</el-table-column>
</el-table>
size="70%">
<div class="word-wrap">
<div id="wordView" v-html="wordText" />
</div>
</el-drawer>
</el-card>
<el-row gutter="2">
@ -602,7 +599,7 @@ import {
createOutputs,
deleteOperationeinput
} from "@/api/wpm";
import mammoth from "mammoth";
import { getrffieldList,gettechdocList } from "@/api/mtm";
import checkPermission from "@/utils/permission";
import { getprogressList } from "@/api/pm";
@ -731,13 +728,15 @@ export default {
outputData: [],
tprogressData: [],
tool:"",
wordText: "",
};
},
computed: {},
watch: {},
created() {
this.id = this.$route.params.id; //操作ID
this.readbook();
this.getList(); //边角料
this.getpwpList(); //半成品
this.getequList(); //设备
@ -752,11 +751,35 @@ export default {
checkPermission,
//作业指导书
readbook(){
getWordText() {
this.drawer=true;
const xhr = new XMLHttpRequest();
xhr.open("get", this.techdocList, true);
xhr.responseType = "arraybuffer";
xhr.onload = () => {
if (xhr.status == 200) {
mammoth.convertToHtml({ arrayBuffer: new Uint8Array(xhr.response) }).then((resultObject) => {
this.$nextTick(() => {
this.wordText = resultObject.value;
});
});
}
};
xhr.send();
},
readbook(){
gettechdocList({operation:this.id,page:0}).then((response) => {
if (response.data) {
this.techdocList= response.data;
this.techdocList= response.data[0].file_.file;
console.log( this.techdocList);
}
});
},

View File

@ -12,9 +12,11 @@
highlight-current-row
max-height="600"
>
<el-table-column type="index" width="50"/>
<el-table-column type="index" width="50" />
<el-table-column label="成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
<template slot-scope="scope">{{
scope.row.material_.name
}}</template>
</el-table-column>
<el-table-column label="成品编号">
@ -33,12 +35,15 @@
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])&&scope.row.test===null"
v-if="
checkPermission(['warehouse_update']) &&
scope.row.test === null
"
@click="handleInspection(scope)"
>检验
</el-link>
<el-link
v-if="scope.row.test!==null"
v-if="scope.row.test !== null"
@click="checkRecord(scope)"
>检验记录
</el-link>
@ -59,8 +64,11 @@
<el-card style="margin-top: 2px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>批量入库
</el-button
>
</el-button>
<el-button type="primary" icon="el-icon-plus" @click="handleorder"
>批量选择订单
</el-button>
<el-table
v-loading="listLoading"
:data="wproductList1.results"
@ -71,13 +79,12 @@
highlight-current-row
max-height="600"
>
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column type="index" width="50"/>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column type="index" width="50" />
<el-table-column label="成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
<template slot-scope="scope">{{
scope.row.material_.name
}}</template>
</el-table-column>
<el-table-column label="成品编号">
@ -88,10 +95,24 @@
{{ actstate_[scope.row.act_state] }}
</template>
</el-table-column>
<el-table-column label="所在子工序">
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
<el-table-column label="指派订单">
<template slot-scope="scope" v-if="scope.row.to_order_">
{{scope.row.to_order_.number }}
</template>
</el-table-column>
<el-table-column label="客户">
<template slot-scope="scope" v-if="scope.row.to_order_.customer_">
{{scope.row.to_order_.customer_.name }}
</template>
</el-table-column>
<el-table-column label="合同">
<template slot-scope="scope" v-if="scope.row.to_order_.contract_">
{{scope.row.to_order_.contract_.name }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
@ -99,8 +120,7 @@
v-if="checkPermission(['warehouse_update'])"
@click="handlePutin(scope)"
>入库
</el-link
>
</el-link>
</template>
</el-table-column>
</el-table>
@ -115,8 +135,17 @@
</el-tab-pane>
</el-tabs>
<!--物料检查表&&-->
<el-dialog title="物料检查表" :close-on-click-modal="false" :visible.sync="outerVisible">
<el-select style="width: 100%" v-model="recordform" placeholder="请选择" @change="recordformChange">
<el-dialog
title="物料检查表"
:close-on-click-modal="false"
:visible.sync="outerVisible"
>
<el-select
style="width: 100%"
v-model="recordform"
placeholder="请选择"
@change="recordformChange"
>
<el-option
v-for="item in recordformList"
:key="item.name"
@ -125,45 +154,12 @@
>
</el-option>
</el-select>
<!-- &lt;!&ndash;第一次操作时的展示&ndash;&gt;
<el-dialog
width="60%"
:title="formName"
:visible.sync="innerVisible"
append-to-body
>
<customForm
:results="fieldList"
:hasPicture="hasPicture"
:formID="recordform"
:wproduct="wproduct"
:recordId="recordId"
@recordSubmit="recordSubmit"
@recordSave="recordSave"
/>
</el-dialog>
&lt;!&ndash;复检检验表单&ndash;&gt;
<el-dialog
width="60%"
:title="formName"
:visible.sync="limitedReview"
append-to-body
>
<reviewForm
:results="fieldList"
:originList="originList"
:formID="recordform"
:hasPicture="hasPicture"
:wproduct="wproduct"
:origintest="origintest"
@formFunc="formFunc"
/>
</el-dialog>-->
<div slot="footer" class="dialog-footer">
<el-button @click="outerVisible = false">
</el-button>
<el-button type="primary" @click="submitrecordform()">填写检查项目</el-button>
<el-button @click="outerVisible = false"> </el-button>
<el-button type="primary" @click="submitrecordform()"
>填写检查项目</el-button
>
</div>
</el-dialog>
<!--检查表显示-->
@ -187,18 +183,20 @@
/>
</el-dialog>
<!--检验记录-->
<el-dialog title="检验记录" :close-on-click-modal="false" :visible.sync="limitedCheckRecord">
<el-table
:data="recordList"
border
height="400"
<el-dialog
title="检验记录"
:close-on-click-modal="false"
:visible.sync="limitedCheckRecord"
>
<el-table-column type="index" width="50"/>
<el-table :data="recordList" border height="400">
<el-table-column type="index" width="50" />
<el-table-column label="表单名称">
<template slot-scope="scope">{{ scope.row.form_.name }}</template>
</el-table-column>
<el-table-column label="检查类型">
<template slot-scope="scope">{{ checkTypes[scope.row.type] }}</template>
<template slot-scope="scope">{{
checkTypes[scope.row.type]
}}</template>
</el-table-column>
<el-table-column label="是否提交">
<template slot-scope="scope">
@ -213,15 +211,8 @@
@click="handleInspectionRecord(scope)"
>检验
</el-link>
<el-link
v-else
@click="handleRecordDetail(scope)"
>查看
</el-link>
<el-link
@click="delTestRecord(scope)"
>删除
</el-link>
<el-link v-else @click="handleRecordDetail(scope)">查看 </el-link>
<el-link @click="delTestRecord(scope)">删除 </el-link>
</template>
</el-table-column>
</el-table>
@ -230,164 +221,11 @@
<el-button type="primary" @click="putin"> </el-button>
</div>
</el-dialog>
<!--<el-dialog title="物料检查表" :close-on-click-modal="false" :visible.sync="outerVisible">
<el-select style="width: 100%" v-model="recordform" placeholder="请选择">
<el-option
v-for="item in recordformList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
<el-dialog
width="50%"
title="检查项目"
:visible.sync="innerVisible"
append-to-body
title="成品入库"
:close-on-click-modal="false"
:visible.sync="dialogFormVisible"
>
<el-form label-width="100px" label-position="right">
<el-row
:gutter="2"
v-for="(item, $index) in fieldList"
:key="$index"
>
<el-col :span="12">
<el-form-item
v-if="item.field_type === 'string'"
:label="item.field_name"
>
<el-input placeholder="请输入" v-model="item.sort"/>
</el-form-item>
<el-form-item
v-else-if="item.field_type === 'int'"
:label="item.field_name"
>
<el-input
width="120"
type="number"
placeholder="请输入"
v-model="item.sort"
/>
</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-form-item>
<el-form-item
v-else-if="item.field_type === 'date'"
:label="item.field_name"
>
<el-date-picker
v-model="item.create_time"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width: 100%"
>
</el-date-picker>
</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"
type="datetime"
placeholder="选择日期"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%"
>
</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-option
v-for="item1 in item.field_choice"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</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-option
v-for="item1 in item.field_choice"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否检验合格" width="50px">
<el-select
style="width: 100%"
v-model="item.is_testok"
placeholder="请选择"
>
<el-option
v-for="item in choice"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="是否合格" prop="sort_str">
<el-radio v-model="is_testok" label="true">检查合格</el-radio>
<el-radio v-model="is_testok" label="false">检查不合格</el-radio>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="innerVisible = false"> </el-button>
<el-button type="primary" @click="submitfield"
>提交检查项目
</el-button
>
</div>
</el-dialog>
<div slot="footer" class="dialog-footer">
<el-button @click="outerVisible = false"> </el-button>
<el-button type="primary" @click="submitrecordform"
>填写检查项目
</el-button
>
</div>
</el-dialog>-->
<el-dialog title="成品入库" :close-on-click-modal="false" :visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label="仓库">
<el-select
@ -407,14 +245,17 @@
<el-form-item label="备注">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="putin"> </el-button>
</div>
</el-dialog>
<el-dialog title="半成品批量入库" :close-on-click-modal="false" :visible.sync="dialogFormVisibles">
<el-dialog
title="成品批量入库"
:close-on-click-modal="false"
:visible.sync="dialogFormVisibles"
>
<el-form :model="form">
<el-form-item label="仓库">
<el-select
@ -434,32 +275,72 @@
<el-form-item label="备注">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisibles = false"> </el-button>
<el-button type="primary" @click="putins"> </el-button>
</div>
</el-dialog>
<el-dialog
title="指定发货订单"
:close-on-click-modal="false"
:visible.sync="dialogFormVisibleorder"
>
<el-form :model="form">
<el-form-item label="订单">
<el-select
style="width: 100%"
v-model="form.order"
placeholder="请选择订单"
>
<el-option
v-for="item in orderList"
:key="item.id"
:label="item.number"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisibleorder = false"> </el-button>
<el-button type="primary" @click="toorders"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {testInit} from "@/api/wpm";
import checkPermission from "@/utils/permission";
import {getWarehouseList} from "@/api/inm";
import {getMaterialList, getrecordformList, getrffieldList} from "@/api/mtm";
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import customForm from '@/components/customForm/index';
import {getwproductList, wproductTest, wproductPutin, createputins} from "@/api/wpm";
import {getTestRecord,getTestRecordItem,putTestRecordItem,delTestRecordItem,subTestRecordItem} from "@/api/qm";
const defaultetestitem = {};
export default {
components: {Pagination,customForm},
import { getOrderList } from "@/api/sam";
import checkPermission from "@/utils/permission";
import { getWarehouseList } from "@/api/inm";
import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import customForm from "@/components/customForm/index";
import {
getwproductList,
wproductTest,
wproductPutin,
createputins,
testInit,
toorder,
} from "@/api/wpm";
import {
getTestRecord,
getTestRecordItem,
putTestRecordItem,
delTestRecordItem,
subTestRecordItem,
} from "@/api/qm";
const defaultetestitem = {};
export default {
components: { Pagination, customForm },
data() {
return {
testitem: defaultetestitem,
form: {remark: "", warehouse: ""},
form: { remark: "", warehouse: "" },
wproductList: {
count: 0,
},
@ -490,12 +371,12 @@
50: "不合格",
60: "待成品检验",
},
checkTypes:{
10:"子工序检验",
20:"工序检验",
30:"工序复检",
36:"夹层检验",
40:"成品检验",
checkTypes: {
10: "子工序检验",
20: "工序检验",
30: "工序复检",
36: "夹层检验",
40: "成品检验",
},
choice: [
{
@ -530,6 +411,11 @@
testrecord: {},
formName: "检验表",
WarehouseData: "",
dialogFormVisibleorder: false,
orderList: [],
mutipID1: [],
mutipID: [],
mtmId: [],
};
},
computed: {},
@ -557,37 +443,63 @@
//已合格成品
getList1() {
this.listQuery1.act_state = 30;
this.listQuery1.material__type = 1;
getwproductList(this.listQuery1).then((response) => {
if (response.data) {
this.wproductList1 = response.data;
}
});
},
//半成品批量入库
//批量选择成品发给谋订单
handleorder() {
this.dialogFormVisibleorder = true;
let _this = this;
_this.mutipID1 = [];
_this.mtmId = [];
this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID1.push(item.id);
_this.mtmId.push(item.material_.id);
});
getOrderList({ page: 0, material: _this.mtmId[0] }).then((response) => {
if (response.data) {
this.orderList = response.data;
}
this.listLoading = false;
});
},
//提交批量产品选择的订单
toorders() {
toorder({
order: this.form.order,
wproducts: this.mutipID1,
}).then((res) => {
if (res.code >= 200) {
this.$message.success("成功!");
this.dialogFormVisibleorder = false;
this.getList1();
}
});
},
//成品批量入库
handleCreate() {
this.dialogFormVisibles = true;
this.getWarehouseLists();//仓库
this.getWarehouseLists(); //仓库
},
//批量入库
putins() {
let _this = this
_this.mutipID = []
let _this = this;
_this.mutipID = [];
this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID.push(item.id);
});
console.log(_this.mutipID);
createputins({
warehouse: this.form.warehouse,
wproducts: _this.mutipID,
remark: this.form.remark
remark: this.form.remark,
}).then((res) => {
if (res.code >= 200) {
this.$message.success("批量入库成功!");
@ -598,12 +510,10 @@
},
//仓库列表
getWarehouseLists() {
getWarehouseList({page: 0}).then((response) => {
getWarehouseList({ page: 0 }).then((response) => {
if (response.data) {
this.WarehouseData = response.data;
}
});
},
//提交检查项目
@ -611,20 +521,18 @@
let _this = this;
_this.field = []; //检查项目
this.fieldList.forEach((item) => {
_this.field.push({
form_field: item.id,
field_value: item.sort,
is_testok: item.is_testok//单项检查结果
is_testok: item.is_testok, //单项检查结果
});
});
console.log(this.recordform);
this.testrecord.form = this.recordform;//检查表
this.testrecord.record_data = _this.field;//检查项列表
this.testrecord.is_testok = this.is_testok;//检查表检查结果
this.testrecord.wproduct = this.wproduct;//半成品ID
this.testrecord.form = this.recordform; //检查表
this.testrecord.record_data = _this.field; //检查项列表
this.testrecord.is_testok = this.is_testok; //检查表检查结果
this.testrecord.wproduct = this.wproduct; //半成品ID
wproductTest(this.testrecord).then((res) => {
if (res.code >= 200) {
@ -632,17 +540,14 @@
this.outerVisible = false;
this.getList();
this.getList1();
}
});
},
//半成品入库
handlePutin(scope) {
this.dialogFormVisible = true;
this.getWarehouseLists();//仓库
this.id = scope.row.id;//半成品id
this.getWarehouseLists(); //仓库
this.id = scope.row.id; //半成品id
},
putin() {
wproductPutin(this.id, this.form).then((res) => {
@ -658,18 +563,18 @@
handleInspection(scope) {
let that = this;
//调该物料对应的检查表
this.wproduct = scope.row.id;//成品ID
this.listQueryrecordform.material = scope.row.material;//
this.wproduct = scope.row.id; //成品ID
this.listQueryrecordform.material = scope.row.material; //
this.listQueryrecordform.type = 2;
this.recordform = null;
getrecordformList(this.listQueryrecordform).then((response) => {
if (response.data) {
this.recordformList = response.data;
if(response.data.length===1){
if (response.data.length === 1) {
that.recordform = response.data[0].id;
that.formName = response.data[0].name;
that.submitrecordform();
}else{
} else {
//弹出列表选择框
this.outerVisible = true;
}
@ -680,7 +585,8 @@
submitrecordform() {
let that = this;
if (this.recordform != "") {
testInit({ wproduct: that.wproduct,form: that.recordform}).then((response) => {
testInit({ wproduct: that.wproduct, form: that.recordform }).then(
(response) => {
if (response.data) {
that.hasPicture = false;
that.recordId = response.data.id;
@ -688,66 +594,68 @@
that.formName = res.data.form_.name;
let fieldList = res.data.record_data;
that.fieldList = [...fieldList];
let arr = fieldList.filter(item => {
return item.field_type === 'draw'
let arr = fieldList.filter((item) => {
return item.field_type === "draw";
});
if (arr.length > 0) {
that.hasPicture = true;
}
that.$nextTick(()=>{
that.$nextTick(() => {
that.innerVisible = true;
});
})
}
});
}
}
);
} else this.$message.error("请选择检查表!");
},
//选择物料检查表
recordformChange() {
let that = this;
let arr = this.recordformList.filter(item => {
let arr = this.recordformList.filter((item) => {
return item.id === that.recordform;
});
that.formName = arr[0].name;
},
//更新检验记录列表
refreshRecord(){
refreshRecord() {
let that = this;
getTestRecord({wproduct:that.wproduct,page:0}).then(res=>{
if(res.code==200){
getTestRecord({ wproduct: that.wproduct, page: 0 }).then((res) => {
if (res.code == 200) {
that.recordList = res.data;
}else{
} else {
this.$message.error(res.msg);
}
})
});
},
//检验记录
checkRecord(scope){
checkRecord(scope) {
let that = this;
that.wproduct = scope.row.id;//半成品ID
that.wproduct = scope.row.id; //半成品ID
that.limitedCheckRecord = true;
getTestRecord({wproduct:scope.row.id,page:0}).then(res=>{
if(res.code==200){
getTestRecord({ wproduct: scope.row.id, page: 0 }).then((res) => {
if (res.code == 200) {
that.recordList = res.data;
}else{
} else {
this.$message.error(res.msg);
}
})
});
},
//点击记录里的检验
handleInspectionRecord(scope){
let that =this;
handleInspectionRecord(scope) {
let that = this;
that.innerVisible = false;
that.recordId = scope.row.id;
that.recordform = scope.row.form;
that.formName = scope.row.form_.name;
getrffieldList({form: this.recordform, page: 1, page_size: 100}).then((response) => {
getrffieldList({ form: this.recordform, page: 1, page_size: 100 }).then(
(response) => {
if (response.data) {
that.hasPicture = false;
let fieldList = response.data.results;
that.fieldList = [...fieldList];
let arr = fieldList.filter(item => {
return item.field_type === 'draw'
let arr = fieldList.filter((item) => {
return item.field_type === "draw";
});
if (arr.length > 0) {
that.hasPicture = true;
@ -755,27 +663,28 @@
getTestRecordItem(scope.row.id).then((res) => {
let arr = [];
let fieldList = res.data.record_data;
for(let i=0;i<that.fieldList.length;i++){
for (let i = 0; i < that.fieldList.length; i++) {
let obj = that.fieldList[i];
obj.is_testok = null;
for(let j=0;j<fieldList.length;j++){
if(that.fieldList[i].field_key===fieldList[j].field_key){
for (let j = 0; j < fieldList.length; j++) {
if (that.fieldList[i].field_key === fieldList[j].field_key) {
obj.id = parseInt(fieldList[j].id);
obj.is_testok = fieldList[j].is_testok;
obj.field_value = fieldList[j].field_value;
}
}
arr.push(obj)
arr.push(obj);
}
that.fieldList = arr;
that.$nextTick(()=>{
that.$nextTick(() => {
that.innerVisible = true;
});
})
}
});
}
}
);
},
delTestRecord(scope){
delTestRecord(scope) {
let that = this;
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
@ -783,13 +692,13 @@
type: "error",
})
.then(async () => {
await delTestRecordItem(scope.row.id).then(res=>{
if(res.code>=200){
await delTestRecordItem(scope.row.id).then((res) => {
if (res.code >= 200) {
that.$message.success("成功");
that.refreshRecord();
this.getList();
this.getList1();
}else{
} else {
this.$message.error(res.msg);
}
});
@ -805,17 +714,19 @@
let params = {};
params.record_data = value.record_data;
params.is_testok = value.is_testok;
putTestRecordItem(id,params).then((res) => {
putTestRecordItem(id, params)
.then((res) => {
if (res.code >= 200) {
that.innerVisible = false;
that.limitedReview = false;
that.getList();
that.getList1();
that.refreshRecord();
}else{
this.$message.error(res.msg)
} else {
this.$message.error(res.msg);
}
}) .catch((err) => {
})
.catch((err) => {
console.error(err);
});
},
@ -826,9 +737,10 @@
let params = {};
params.record_data = value.record_data;
params.is_testok = value.is_testok;
putTestRecordItem(id,params).then((res) => {
putTestRecordItem(id, params)
.then((res) => {
if (res.code >= 200) {
subTestRecordItem(id,params).then((res) => {
subTestRecordItem(id, params).then((res) => {
if (res.code >= 200) {
that.innerVisible = false;
that.limitedReview = false;
@ -838,10 +750,11 @@
that.refreshRecord();
}
});
}else{
this.$message.error(res.msg)
} else {
this.$message.error(res.msg);
}
}) .catch((err) => {
})
.catch((err) => {
console.error(err);
});
},
@ -851,5 +764,5 @@
this.innerVisible = false;
},
},
};
};
</script>