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) { export function getEquipmentrecordList(query) {
return request({ return request({
url: '/em/equipmentrecord/', url: '/em/echeck_record/',
method: 'get', method: 'get',
params: query params: query
}) })
} }
export function getEquipmentrecordAll() { export function getEquipmentrecordAll() {
return request({ return request({
url: '/em/equipmentrecord/', url: '/em/echeck_record/',
method: 'get' method: 'get'
}) })
} }
export function createEquipmentrecord(data) { export function createEquipmentrecord(data) {
return request({ return request({
url: '/em/equipmentrecord/', url: '/em/echeck_record/',
method: 'post', method: 'post',
data data
}) })
} }
export function updateEquipmentrecord(id, data) { export function updateEquipmentrecord(id, data) {
return request({ return request({
url: `/em/equipmentrecord/${id}/`, url: `/em/echeck_record/${id}/`,
method: 'put', method: 'put',
data data
}) })
} }
export function deleteEquipmentrecord(id, data) { export function deleteEquipmentrecord(id, data) {
return request({ return request({
url: `/em/equipmentrecord/${id}/`, url: `/em/echeck_record/${id}/`,
method: 'delete', method: 'delete',
data data
}) })

View File

@ -358,3 +358,13 @@ export function getCard(id) {
method: 'GET', 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', name: 'record',
component: () => import('@/views/em/record'), component: () => import('@/views/em/record'),
meta: { title: '校准检定记录', icon: 'example', perms: ['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', name: 'producttest',
component: () => import('@/views/qm/producttest'), component: () => import('@/views/qm/producttest'),
meta: { title: '成品检验', icon: 'example', perms: ['index_manage'] } 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,16 +27,15 @@
>重置</el-button >重置</el-button
> >
</div> </div>
</el-card> </el-card>
<el-card> <el-card>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="equipmentList.results" :data="equipmentList.results"
:cell-style="tableRowClassName"
border border
fit fit
stripe stripe
highlight-current-row
height="100" height="100"
v-el-height-adaptive-table="{ bottomOffset: 42 }" v-el-height-adaptive-table="{ bottomOffset: 42 }"
> >
@ -46,17 +45,28 @@
</el-table-column> </el-table-column>
<el-table-column label="管理类别"> <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>
<el-table-column label="校/检方式"> <el-table-column label="校/检方式" width="100">
<template slot-scope="scope">{{ waytype_[scope.row.way] }}</template> <template slot-scope="scope">{{ waytype_[scope.row.way] }}</template>
</el-table-column> </el-table-column>
<el-table-column label="标准/依据"> <el-table-column label="标准/依据" width="100">
<template slot-scope="scope">{{ scope.row.standard }}</template> <template slot-scope="scope">{{ scope.row.standard }}</template>
</el-table-column> </el-table-column>
<el-table-column label="校/检周期"> <el-table-column label="校/检周期" width="100">
<template slot-scope="scope">{{ scope.row.cycle }}</template> <template slot-scope="scope">{{ scope.row.cycle }}</template>
</el-table-column> </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="设备名称"> <el-table-column label="设备名称">
<template slot-scope="scope">{{ scope.row.name }}</template> <template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
@ -70,38 +80,35 @@
<el-table-column label="使用类别"> <el-table-column label="使用类别">
<template slot-scope="scope">{{ usetype_[scope.row.way] }}</template> <template slot-scope="scope">{{ usetype_[scope.row.way] }}</template>
</el-table-column> </el-table-column>
<el-table-column label="校/检状态"> <el-table-column label="校/检状态" width="100">
<template slot-scope="scope">{{ state_[scope.row.statedm] }}</template> <template slot-scope="scope">{{ state_[scope.row.state] }}</template>
</el-table-column> </el-table-column>
<el-table-column label="保管人"> <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>
<el-table-column label="存放位置"> <el-table-column label="存放位置">
<template slot-scope="scope">{{ scope.row.place }}</template> <template slot-scope="scope">{{ scope.row.place }}</template>
</el-table-column> </el-table-column>
<el-table-column label="绑定工序"> <el-table-column label="绑定工序">
<template slot-scope="scope" v-if="scope.row.step_"> <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" :key="item.number"
:label="item.name" :label="item.name"
:value="item.number">{{item.name}}</el-tag> :value="item.number"
>{{ item.name }}</el-tag
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注"> <el-table-column label="备注">
<template slot-scope="scope">{{ scope.row.description }}</template> <template slot-scope="scope">{{ scope.row.description }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="120px">
<el-table-column
align="center"
label="操作"
width="120px"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['equipment_update'])" v-if="checkPermission(['equipment_update'])"
type="primary" type="primary"
@ -157,33 +164,45 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="标准/依据" prop="standard"> <el-form-item label="标准/依据" prop="standard">
<el-input v-model="equipment.standard" placeholder="溯源标准或依据" /> <el-input
v-model="equipment.standard"
placeholder="溯源标准或依据"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="校/检状态" prop="statedm"> <el-form-item label="校/检状态" prop="state">
<el-select
<el-select style="width: 100%" v-model="equipment.statedm" placeholder="请选择"> style="width: 100%"
v-model="equipment.state"
placeholder="请选择"
>
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="管理类别" prop="mgmtype"> <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 <el-option
v-for="item in mgmoptions" v-for="item in mgmoptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -197,35 +216,39 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="责任人" prop="keeper"> <el-form-item label="责任人" prop="keeper">
<el-select <el-select
v-model="equipment.keeper" v-model="equipment.keeper"
filterable filterable
style="width: 100%" style="width: 100%"
allow-create allow-create
default-first-option default-first-option
placeholder="请选择"> placeholder="请选择"
>
<el-option <el-option
v-for="item in keeperOptions" v-for="item in keeperOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="校/检方式" prop="way"> <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 <el-option
v-for="item in wayoptions" v-for="item in wayoptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -239,20 +262,27 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="使用类别" prop="usetype"> <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 <el-option
v-for="item in useoptions" v-for="item in useoptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="校/检周期" prop="cycle"> <el-form-item label="校/检周期" prop="cycle">
<el-input v-model="equipment.cycle" placeholder="校准或检定周期" /> <el-input
v-model="equipment.cycle"
placeholder="校准或检定周期"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -269,14 +299,6 @@
placeholder="备注" placeholder="备注"
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button> <el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -285,13 +307,19 @@
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<style>
</style>
<script> <script>
import { getpEquipmentList, createEquipment,updateEquipment,deleteEquipment } from "@/api/equipment"; import {
getpEquipmentList,
createEquipment,
updateEquipment,
deleteEquipment,
} from "@/api/equipment";
import { getUserList } from "@/api/user"; import { getUserList } from "@/api/user";
import { getOrgList } from "@/api/org"; import { getOrgList } from "@/api/org";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
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 defaultequipment = { const defaultequipment = {
@ -307,72 +335,67 @@ export default {
count: 0, count: 0,
}, },
mgmtype_: { mgmtype_: {
'1':'A', 1: "A",
'2':'B', 2: "B",
'3':'C', 3: "C",
}, },
mgmoptions: [{ mgmoptions: [
{
value: 1, value: 1,
label: 'A' label: "A",
}, { },
{
value: 2, value: 2,
label: 'B' label: "B",
}, },
{ {
value: 3, value: 3,
label: 'C' label: "C",
}], },
],
waytype_: { waytype_: {
'1':'外检', 1: "外检",
'2':'自检', 2: "自检",
}, },
wayoptions: [{ wayoptions: [
{
value: 1, value: 1,
label: '外检' 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: '限用'
}, },
{ {
value: 3, value: 2,
label: '禁用' label: "自检",
}, { },
value: 4, ],
label: '停用' usetype_: {
}, { 1: "专用",
value: 5, 2: "公用",
label: '封存' },
}], useoptions: [
{
value: 1,
label: "专用",
},
{
value: 2,
label: "公用",
},
],
state_: {
10: "合格",
40: "禁用",
},
options: [
{
value: 10,
label: "合格",
},
{
value: 40,
label: "禁用",
},
],
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
@ -388,19 +411,22 @@ export default {
type: [{ required: true, message: "请输入", trigger: "blur" }], type: [{ required: true, message: "请输入", trigger: "blur" }],
model: [{ required: true, message: "请输入", trigger: "blur" }], model: [{ required: true, message: "请输入", trigger: "blur" }],
state: [{ 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: {}, computed: {},
watch: {}, watch: {},
created() { created() {
this.getList(); this.getList();
this.getUserList(); this.getUserList();
this.getOrgList(); this.getOrgList();
}, },
methods: { methods: {
checkPermission, checkPermission,
//设备列表 //设备列表
getList() { getList() {
this.listLoading = true; this.listLoading = true;
@ -412,20 +438,51 @@ export default {
this.listLoading = false; 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() {
getUserList({pageoff:true}).then((res) => { getUserList({ page: 0 }).then((res) => {
this.keeperOptions = genTree(res.data); this.keeperOptions = genTree(res.data);
}); });
}, },
//部门列表 //部门列表
getOrgList() { getOrgList() {
getOrgList({pageoff:true}).then((res) => { getOrgList({ page: 0 }).then((res) => {
this.depOptions = genTree(res.data); this.depOptions = genTree(res.data);
}); });
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
@ -434,7 +491,7 @@ export default {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
} };
this.getList(); this.getList();
}, },
handleCreate() { handleCreate() {

View File

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

View File

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

View File

@ -77,6 +77,12 @@
</el-table-column> </el-table-column>
<el-table-column label="工序"> <el-table-column label="工序">
<template slot-scope="scope">{{ scope.row.process_.name }}</template> <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>
<el-table-column label="排序"> <el-table-column label="排序">
<template slot-scope="scope">{{ scope.row.sort }}</template> <template slot-scope="scope">{{ scope.row.sort }}</template>
@ -131,6 +137,9 @@
</el-option> </el-option>
</el-select> </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>
<el-form-item label="排序" prop="sort"> <el-form-item label="排序" prop="sort">
<el-input-number <el-input-number
@ -554,7 +563,7 @@
<el-table-column align="center" label="文件"> <el-table-column align="center" label="文件">
<template slot-scope="scope" v-if="scope.row.file_"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -659,7 +668,7 @@ const defaultusedstep = {
}; };
const defaulttechdoc = {enabled:false}; const defaulttechdoc = {enabled:false};
const defaultsubproducation = { const defaultsubproducation = {
need_combtest:false,
}; };
export default { export default {

View File

@ -149,86 +149,7 @@
:limit.sync="listQuery2.page_size" :limit.sync="listQuery2.page_size"
@pagination="getList2" @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-tab-pane>
</el-tabs> </el-tabs>
</el-card> </el-card>

View File

@ -136,7 +136,7 @@ export default {
//半成品列表 //半成品列表
getList() { getList() {
this.listLoading = true; this.listLoading = true;
this.listQuery.type=1; this.listQuery.material__type=1;
getiproductList(this.listQuery).then((response) => { getiproductList(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
this.iproductData= 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, dialogVisible: false,
dialogType: "new", dialogType: "new",
rule1: { rule1: {
number: [{ required: true, message: "请输入", trigger: "blur" }],
customer: [{ required: true, message: "请输入", trigger: "blur" }],
product: [{ required: true, message: "请输入", trigger: "blur" }], product: [{ required: true, message: "请输入", trigger: "blur" }],
delivery_date: [{ required: true, message: "请输入", trigger: "blur" }], delivery_date: [{ required: true, message: "请输入", trigger: "blur" }],
}, },

View File

@ -262,7 +262,7 @@ export default {
if (response.data) { if (response.data) {
this.sale.customer = response.data.customer; this.sale.customer = response.data.customer;
this.sale.product = response.data.product; 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) { if (response.data) {
this.iproductoptions=response.data; this.iproductoptions=response.data;
} }

View File

@ -4,7 +4,9 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>基本信息</span> <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> </div>
<el-form <el-form
ref="form" ref="form"
@ -57,18 +59,13 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-drawer <el-drawer
title="作业指导书点击下载查看!" title="作业指导书查看!"
:visible.sync="drawer" :visible.sync="drawer"
direction="rtl" direction="rtl"
size="10%"> size="70%">
<el-table :data="techdocList"> <div class="word-wrap">
<el-table-column label="表名称" width="150"> <div id="wordView" v-html="wordText" />
</div>
<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>
</el-drawer> </el-drawer>
</el-card> </el-card>
<el-row gutter="2"> <el-row gutter="2">
@ -602,7 +599,7 @@ import {
createOutputs, createOutputs,
deleteOperationeinput deleteOperationeinput
} from "@/api/wpm"; } from "@/api/wpm";
import mammoth from "mammoth";
import { getrffieldList,gettechdocList } from "@/api/mtm"; import { getrffieldList,gettechdocList } from "@/api/mtm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { getprogressList } from "@/api/pm"; import { getprogressList } from "@/api/pm";
@ -731,13 +728,15 @@ export default {
outputData: [], outputData: [],
tprogressData: [], tprogressData: [],
tool:"", tool:"",
wordText: "",
}; };
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
this.id = this.$route.params.id; //操作ID this.id = this.$route.params.id; //操作ID
this.readbook();
this.getList(); //边角料 this.getList(); //边角料
this.getpwpList(); //半成品 this.getpwpList(); //半成品
this.getequList(); //设备 this.getequList(); //设备
@ -752,11 +751,35 @@ export default {
checkPermission, checkPermission,
//作业指导书 //作业指导书
readbook(){
getWordText() {
this.drawer=true; 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) => { gettechdocList({operation:this.id,page:0}).then((response) => {
if (response.data) { if (response.data) {
this.techdocList= response.data; this.techdocList= response.data[0].file_.file;
console.log( this.techdocList);
} }
}); });
}, },

View File

@ -14,7 +14,9 @@
> >
<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.material_.name }}</template> <template slot-scope="scope">{{
scope.row.material_.name
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="成品编号"> <el-table-column label="成品编号">
@ -33,7 +35,10 @@
<el-table-column align="center" label="操作" width="220px"> <el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['warehouse_update'])&&scope.row.test===null" v-if="
checkPermission(['warehouse_update']) &&
scope.row.test === null
"
@click="handleInspection(scope)" @click="handleInspection(scope)"
>检验 >检验
</el-link> </el-link>
@ -59,8 +64,11 @@
<el-card style="margin-top: 2px"> <el-card style="margin-top: 2px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>批量入库 >批量入库
</el-button </el-button>
> <el-button type="primary" icon="el-icon-plus" @click="handleorder"
>批量选择订单
</el-button>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="wproductList1.results" :data="wproductList1.results"
@ -71,13 +79,12 @@
highlight-current-row highlight-current-row
max-height="600" max-height="600"
> >
<el-table-column <el-table-column type="selection" width="55"> </el-table-column>
type="selection"
width="55">
</el-table-column>
<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.material_.name }}</template> <template slot-scope="scope">{{
scope.row.material_.name
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="成品编号"> <el-table-column label="成品编号">
@ -88,10 +95,24 @@
{{ actstate_[scope.row.act_state] }} {{ actstate_[scope.row.act_state] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="指派订单">
<el-table-column label="所在子工序"> <template slot-scope="scope" v-if="scope.row.to_order_">
<template slot-scope="scope">{{ scope.row.step_.name }}</template> {{scope.row.to_order_.number }}
</template>
</el-table-column> </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"> <el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope"> <template slot-scope="scope">
@ -99,8 +120,7 @@
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['warehouse_update'])"
@click="handlePutin(scope)" @click="handlePutin(scope)"
>入库 >入库
</el-link </el-link>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -115,8 +135,17 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<!--物料检查表&&--> <!--物料检查表&&-->
<el-dialog title="物料检查表" :close-on-click-modal="false" :visible.sync="outerVisible"> <el-dialog
<el-select style="width: 100%" v-model="recordform" placeholder="请选择" @change="recordformChange"> title="物料检查表"
:close-on-click-modal="false"
:visible.sync="outerVisible"
>
<el-select
style="width: 100%"
v-model="recordform"
placeholder="请选择"
@change="recordformChange"
>
<el-option <el-option
v-for="item in recordformList" v-for="item in recordformList"
:key="item.name" :key="item.name"
@ -125,45 +154,12 @@
> >
</el-option> </el-option>
</el-select> </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"> <div slot="footer" class="dialog-footer">
<el-button @click="outerVisible = false"> <el-button @click="outerVisible = false"> </el-button>
<el-button type="primary" @click="submitrecordform()"
</el-button> >填写检查项目</el-button
<el-button type="primary" @click="submitrecordform()">填写检查项目</el-button> >
</div> </div>
</el-dialog> </el-dialog>
<!--检查表显示--> <!--检查表显示-->
@ -187,18 +183,20 @@
/> />
</el-dialog> </el-dialog>
<!--检验记录--> <!--检验记录-->
<el-dialog title="检验记录" :close-on-click-modal="false" :visible.sync="limitedCheckRecord"> <el-dialog
<el-table title="检验记录"
:data="recordList" :close-on-click-modal="false"
border :visible.sync="limitedCheckRecord"
height="400"
> >
<el-table :data="recordList" border height="400">
<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.form_.name }}</template> <template slot-scope="scope">{{ scope.row.form_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="检查类型"> <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>
<el-table-column label="是否提交"> <el-table-column label="是否提交">
<template slot-scope="scope"> <template slot-scope="scope">
@ -213,15 +211,8 @@
@click="handleInspectionRecord(scope)" @click="handleInspectionRecord(scope)"
>检验 >检验
</el-link> </el-link>
<el-link <el-link v-else @click="handleRecordDetail(scope)">查看 </el-link>
v-else <el-link @click="delTestRecord(scope)">删除 </el-link>
@click="handleRecordDetail(scope)"
>查看
</el-link>
<el-link
@click="delTestRecord(scope)"
>删除
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -230,164 +221,11 @@
<el-button type="primary" @click="putin"> </el-button> <el-button type="primary" @click="putin"> </el-button>
</div> </div>
</el-dialog> </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 <el-dialog
width="50%" title="成品入库"
title="检查项目" :close-on-click-modal="false"
:visible.sync="innerVisible" :visible.sync="dialogFormVisible"
append-to-body
> >
<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 :model="form">
<el-form-item label="仓库"> <el-form-item label="仓库">
<el-select <el-select
@ -407,14 +245,17 @@
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="form.remark"></el-input> <el-input v-model="form.remark"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button> <el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="putin"> </el-button> <el-button type="primary" @click="putin"> </el-button>
</div> </div>
</el-dialog> </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 :model="form">
<el-form-item label="仓库"> <el-form-item label="仓库">
<el-select <el-select
@ -434,25 +275,65 @@
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="form.remark"></el-input> <el-input v-model="form.remark"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisibles = false"> </el-button> <el-button @click="dialogFormVisibles = false"> </el-button>
<el-button type="primary" @click="putins"> </el-button> <el-button type="primary" @click="putins"> </el-button>
</div> </div>
</el-dialog> </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> </div>
</template> </template>
<script> <script>
import {testInit} from "@/api/wpm"; import { getOrderList } from "@/api/sam";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { getWarehouseList } from "@/api/inm"; import { getWarehouseList } from "@/api/inm";
import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm"; import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm";
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
import customForm from '@/components/customForm/index'; import customForm from "@/components/customForm/index";
import {getwproductList, wproductTest, wproductPutin, createputins} from "@/api/wpm"; import {
import {getTestRecord,getTestRecordItem,putTestRecordItem,delTestRecordItem,subTestRecordItem} from "@/api/qm"; getwproductList,
wproductTest,
wproductPutin,
createputins,
testInit,
toorder,
} from "@/api/wpm";
import {
getTestRecord,
getTestRecordItem,
putTestRecordItem,
delTestRecordItem,
subTestRecordItem,
} from "@/api/qm";
const defaultetestitem = {}; const defaultetestitem = {};
export default { export default {
components: { Pagination, customForm }, components: { Pagination, customForm },
@ -530,6 +411,11 @@
testrecord: {}, testrecord: {},
formName: "检验表", formName: "检验表",
WarehouseData: "", WarehouseData: "",
dialogFormVisibleorder: false,
orderList: [],
mutipID1: [],
mutipID: [],
mtmId: [],
}; };
}, },
computed: {}, computed: {},
@ -557,37 +443,63 @@
//已合格成品 //已合格成品
getList1() { getList1() {
this.listQuery1.act_state = 30; this.listQuery1.act_state = 30;
this.listQuery1.material__type = 1; this.listQuery1.material__type = 1;
getwproductList(this.listQuery1).then((response) => { getwproductList(this.listQuery1).then((response) => {
if (response.data) { if (response.data) {
this.wproductList1 = 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() { handleCreate() {
this.dialogFormVisibles = true; this.dialogFormVisibles = true;
this.getWarehouseLists(); //仓库 this.getWarehouseLists(); //仓库
}, },
//批量入库 //批量入库
putins() { putins() {
let _this = this let _this = this;
_this.mutipID = [] _this.mutipID = [];
this.$refs.multipleTable.selection.forEach((item) => { this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID.push(item.id); _this.mutipID.push(item.id);
}); });
console.log(_this.mutipID); console.log(_this.mutipID);
createputins({ createputins({
warehouse: this.form.warehouse, warehouse: this.form.warehouse,
wproducts: _this.mutipID, wproducts: _this.mutipID,
remark: this.form.remark remark: this.form.remark,
}).then((res) => { }).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.$message.success("批量入库成功!"); this.$message.success("批量入库成功!");
@ -598,12 +510,10 @@
}, },
//仓库列表 //仓库列表
getWarehouseLists() { getWarehouseLists() {
getWarehouseList({ page: 0 }).then((response) => { getWarehouseList({ page: 0 }).then((response) => {
if (response.data) { if (response.data) {
this.WarehouseData = response.data; this.WarehouseData = response.data;
} }
}); });
}, },
//提交检查项目 //提交检查项目
@ -611,11 +521,10 @@
let _this = this; let _this = this;
_this.field = []; //检查项目 _this.field = []; //检查项目
this.fieldList.forEach((item) => { this.fieldList.forEach((item) => {
_this.field.push({ _this.field.push({
form_field: item.id, form_field: item.id,
field_value: item.sort, field_value: item.sort,
is_testok: item.is_testok//单项检查结果 is_testok: item.is_testok, //单项检查结果
}); });
}); });
@ -625,18 +534,14 @@
this.testrecord.is_testok = this.is_testok; //检查表检查结果 this.testrecord.is_testok = this.is_testok; //检查表检查结果
this.testrecord.wproduct = this.wproduct; //半成品ID this.testrecord.wproduct = this.wproduct; //半成品ID
wproductTest(this.testrecord).then((res) => { wproductTest(this.testrecord).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.innerVisible = false; this.innerVisible = false;
this.outerVisible = false; this.outerVisible = false;
this.getList(); this.getList();
this.getList1(); this.getList1();
} }
}); });
}, },
//半成品入库 //半成品入库
handlePutin(scope) { handlePutin(scope) {
@ -680,7 +585,8 @@
submitrecordform() { submitrecordform() {
let that = this; let that = this;
if (this.recordform != "") { if (this.recordform != "") {
testInit({ wproduct: that.wproduct,form: that.recordform}).then((response) => { testInit({ wproduct: that.wproduct, form: that.recordform }).then(
(response) => {
if (response.data) { if (response.data) {
that.hasPicture = false; that.hasPicture = false;
that.recordId = response.data.id; that.recordId = response.data.id;
@ -688,8 +594,8 @@
that.formName = res.data.form_.name; that.formName = res.data.form_.name;
let fieldList = res.data.record_data; let fieldList = res.data.record_data;
that.fieldList = [...fieldList]; that.fieldList = [...fieldList];
let arr = fieldList.filter(item => { let arr = fieldList.filter((item) => {
return item.field_type === 'draw' return item.field_type === "draw";
}); });
if (arr.length > 0) { if (arr.length > 0) {
that.hasPicture = true; that.hasPicture = true;
@ -697,15 +603,16 @@
that.$nextTick(() => { that.$nextTick(() => {
that.innerVisible = true; that.innerVisible = true;
}); });
})
}
}); });
}
}
);
} else this.$message.error("请选择检查表!"); } else this.$message.error("请选择检查表!");
}, },
//选择物料检查表 //选择物料检查表
recordformChange() { recordformChange() {
let that = this; let that = this;
let arr = this.recordformList.filter(item => { let arr = this.recordformList.filter((item) => {
return item.id === that.recordform; return item.id === that.recordform;
}); });
that.formName = arr[0].name; that.formName = arr[0].name;
@ -713,26 +620,26 @@
//更新检验记录列表 //更新检验记录列表
refreshRecord() { refreshRecord() {
let that = this; let that = this;
getTestRecord({wproduct:that.wproduct,page:0}).then(res=>{ getTestRecord({ wproduct: that.wproduct, page: 0 }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
that.recordList = res.data; that.recordList = res.data;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) });
}, },
//检验记录 //检验记录
checkRecord(scope) { checkRecord(scope) {
let that = this; let that = this;
that.wproduct = scope.row.id; //半成品ID that.wproduct = scope.row.id; //半成品ID
that.limitedCheckRecord = true; that.limitedCheckRecord = true;
getTestRecord({wproduct:scope.row.id,page:0}).then(res=>{ getTestRecord({ wproduct: scope.row.id, page: 0 }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
that.recordList = res.data; that.recordList = res.data;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) });
}, },
//点击记录里的检验 //点击记录里的检验
handleInspectionRecord(scope) { handleInspectionRecord(scope) {
@ -741,13 +648,14 @@
that.recordId = scope.row.id; that.recordId = scope.row.id;
that.recordform = scope.row.form; that.recordform = scope.row.form;
that.formName = scope.row.form_.name; 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) { if (response.data) {
that.hasPicture = false; that.hasPicture = false;
let fieldList = response.data.results; let fieldList = response.data.results;
that.fieldList = [...fieldList]; that.fieldList = [...fieldList];
let arr = fieldList.filter(item => { let arr = fieldList.filter((item) => {
return item.field_type === 'draw' return item.field_type === "draw";
}); });
if (arr.length > 0) { if (arr.length > 0) {
that.hasPicture = true; that.hasPicture = true;
@ -765,15 +673,16 @@
obj.field_value = fieldList[j].field_value; obj.field_value = fieldList[j].field_value;
} }
} }
arr.push(obj) arr.push(obj);
} }
that.fieldList = arr; that.fieldList = arr;
that.$nextTick(() => { that.$nextTick(() => {
that.innerVisible = true; that.innerVisible = true;
}); });
})
}
}); });
}
}
);
}, },
delTestRecord(scope) { delTestRecord(scope) {
let that = this; let that = this;
@ -783,7 +692,7 @@
type: "error", type: "error",
}) })
.then(async () => { .then(async () => {
await delTestRecordItem(scope.row.id).then(res=>{ await delTestRecordItem(scope.row.id).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
that.$message.success("成功"); that.$message.success("成功");
that.refreshRecord(); that.refreshRecord();
@ -805,7 +714,8 @@
let params = {}; let params = {};
params.record_data = value.record_data; params.record_data = value.record_data;
params.is_testok = value.is_testok; params.is_testok = value.is_testok;
putTestRecordItem(id,params).then((res) => { putTestRecordItem(id, params)
.then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
that.innerVisible = false; that.innerVisible = false;
that.limitedReview = false; that.limitedReview = false;
@ -813,9 +723,10 @@
that.getList1(); that.getList1();
that.refreshRecord(); that.refreshRecord();
} else { } else {
this.$message.error(res.msg) this.$message.error(res.msg);
} }
}) .catch((err) => { })
.catch((err) => {
console.error(err); console.error(err);
}); });
}, },
@ -826,7 +737,8 @@
let params = {}; let params = {};
params.record_data = value.record_data; params.record_data = value.record_data;
params.is_testok = value.is_testok; params.is_testok = value.is_testok;
putTestRecordItem(id,params).then((res) => { putTestRecordItem(id, params)
.then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
subTestRecordItem(id, params).then((res) => { subTestRecordItem(id, params).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
@ -839,9 +751,10 @@
} }
}); });
} else { } else {
this.$message.error(res.msg) this.$message.error(res.msg);
} }
}) .catch((err) => { })
.catch((err) => {
console.error(err); console.error(err);
}); });
}, },