yemianqunaxiananniutinajia

This commit is contained in:
shijing 2022-03-02 11:04:24 +08:00
parent 72ec880a45
commit 8dcaec8003
8 changed files with 1488 additions and 1540 deletions

View File

@ -2,9 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button
>新增设备</el-button v-if="checkPermission(['equipment_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
> >
新增设备
</el-button>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="设备名称/设备编号/备注" placeholder="设备名称/设备编号/备注"
@ -17,19 +22,20 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button
> >
搜索
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</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"
@ -40,28 +46,20 @@
height="100" 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 type="index" width="50"/>
<el-table-column label="设备名称" width="120" show-overflow-tooltip> <el-table-column label="设备名称" prop="name" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="设备编号" prop="number" width="120">
<el-table-column label="设备编号" width="120">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="型号规格" width="120"> <el-table-column label="型号规格" prop="model" width="120">
<template slot-scope="scope">{{ scope.row.model }}</template>
</el-table-column> </el-table-column>
<el-table-column label="生产厂及国别" width="120" show-overflow-tooltip> <el-table-column label="生产厂及国别" prop="factory" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.factory }}</template>
</el-table-column> </el-table-column>
<el-table-column label="生产日期" width="120"> <el-table-column label="生产日期" prop="production_date" width="120">
<template slot-scope="scope">{{ scope.row.production_date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="购置日期" width="120"> <el-table-column label="购置日期" prop="buy_date" width="120">
<template slot-scope="scope">{{ scope.row.buy_date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="数量" width="120"> <el-table-column label="数量" prop="count" width="120">
<template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column> </el-table-column>
<el-table-column label="状态" width="120"> <el-table-column label="状态" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
@ -71,7 +69,7 @@
<el-tag v-else-if="scope.row.state===20" type="warning"> <el-tag v-else-if="scope.row.state===20" type="warning">
{{ state_[scope.row.state] }} {{ state_[scope.row.state] }}
</el-tag> </el-tag>
<el-tag v-else-if="scope.row.state===30" > <el-tag v-else-if="scope.row.state===30">
{{ state_[scope.row.state] }} {{ state_[scope.row.state] }}
</el-tag> </el-tag>
<el-tag v-else type="danger"> <el-tag v-else type="danger">
@ -93,16 +91,13 @@
<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="备注" width="120" show-overflow-tooltip> <el-table-column label="备注" width="120" show-overflow-tooltip>
<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 <el-table-column
align="center" align="center"
label="操作" label="操作"
@ -110,19 +105,20 @@
fixed="right" fixed="right"
> >
<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"
@click="handleEdit(scope)" @click="handleEdit(scope)"
>编辑</el-link
> >
编辑
</el-link>
<el-link <el-link
v-if="checkPermission(['equipment_delete'])" v-if="checkPermission(['equipment_delete'])"
type="danger" type="danger"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link
> >
删除
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -149,29 +145,29 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="设备名称" prop="name"> <el-form-item label="设备名称" prop="name">
<el-input v-model="equipment.name" placeholder="设备名称" /> <el-input v-model="equipment.name" placeholder="设备名称"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="设备编号" prop="number"> <el-form-item label="设备编号" prop="number">
<el-input v-model="equipment.number" placeholder="设备编号" /> <el-input v-model="equipment.number" 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="model"> <el-form-item label="型号规格" prop="model">
<el-input v-model="equipment.model" placeholder="规格型号规格" /> <el-input v-model="equipment.model" placeholder="规格型号规格"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="数量" prop="count"> <el-form-item label="数量" prop="count">
<el-input v-model="equipment.count" placeholder="数量" /> <el-input v-model="equipment.count" placeholder="数量"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="厂商及国别" prop="factory"> <el-form-item label="厂商及国别" prop="factory">
<el-input v-model="equipment.factory" placeholder="生产厂商及国别" /> <el-input v-model="equipment.factory" placeholder="生产厂商及国别"/>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -200,7 +196,6 @@
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="状态" prop="state"> <el-form-item label="状态" prop="state">
<el-select style="width: 100%" v-model="equipment.state" placeholder="请选择"> <el-select style="width: 100%" v-model="equipment.state" placeholder="请选择">
<el-option <el-option
v-for="item in options" v-for="item in options"
@ -211,7 +206,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="技术指标" prop="parameter"> <el-form-item label="技术指标" prop="parameter">
<el-input <el-input
type="textarea" type="textarea"
:rows="4" :rows="4"
@ -220,18 +214,17 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="存放位置" prop="place"> <el-form-item label="存放位置" prop="place">
<el-input v-model="equipment.place" placeholder="存放位置" /> <el-input v-model="equipment.place" placeholder="存放位置"/>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属部门" prop="belong_dept"> <el-form-item label="所属部门" prop="belong_dept">
<el-cascader :options="depOptions" :props="{ checkStrictly: true,emitPath:false }" ref="demoCascader" style="width:100%" v-model="equipment.belong_dept"></el-cascader> <el-cascader :options="depOptions" :props="{ checkStrictly: true,emitPath:false }" ref="demoCascader"
style="width:100%" v-model="equipment.belong_dept"></el-cascader>
</el-form-item> </el-form-item>
</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
@ -246,8 +239,6 @@
: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>
@ -259,15 +250,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>
@ -277,31 +259,31 @@
</div> </div>
</template> </template>
<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 = {
name: "", name: "",
number: "", number: "",
}; };
export default { export default {
components: { Pagination }, components: {Pagination},
data() { data() {
return { return {
equipment: defaultequipment, equipment: defaultequipment,
equipmentList: { equipmentList: {
count: 0, count: 0,
}, },
state_:{ state_: {
10:'完好', 10: '完好',
20:'限用', 20: '限用',
30:'在修', 30: '在修',
40:'禁用', 40: '禁用',
}, },
options: [{ options: [{
value: 10, value: 10,
@ -320,18 +302,18 @@ export default {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
keeperOptions:[], keeperOptions: [],
depOptions:[], depOptions: [],
listLoading: true, listLoading: true,
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
rule1: { rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }], name: [{required: true, message: "请输入", trigger: "blur"}],
number: [{ required: true, message: "请输入", trigger: "blur" }], number: [{required: true, message: "请输入", trigger: "blur"}],
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"}]
}, },
}; };
}, },
@ -344,10 +326,11 @@ export default {
}, },
methods: { methods: {
checkPermission, checkPermission,
//设备列表 //设备列表
getList() { getList() {
this.listLoading = true; this.listLoading = true;
this.listQuery.type=1; this.listQuery.type = 1;
getpEquipmentList(this.listQuery).then((response) => { getpEquipmentList(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
this.equipmentList = response.data; this.equipmentList = response.data;
@ -355,24 +338,26 @@ export default {
this.listLoading = false; this.listLoading = false;
}); });
}, },
//组员列表 //组员列表
getUserList() { getUserList() {
getUserList({pageoff:true}).then((res) => { getUserList({pageoff: true}).then((res) => {
this.keeperOptions = genTree(res.data); this.keeperOptions = genTree(res.data);
}); });
}, },
//部门列表 //部门列表
getOrgList() { getOrgList() {
getOrgList({pageoff:true}).then((res) => { getOrgList({pageoff: true}).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();
}, },
resetFilter() { resetFilter() {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
@ -380,6 +365,7 @@ export default {
} }
this.getList(); this.getList();
}, },
handleCreate() { handleCreate() {
this.equipment = Object.assign({}, defaultequipment); this.equipment = Object.assign({}, defaultequipment);
this.dialogType = "new"; this.dialogType = "new";
@ -397,6 +383,7 @@ export default {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
handleDelete(scope) { handleDelete(scope) {
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认", confirmButtonText: "确认",
@ -409,7 +396,7 @@ export default {
this.$message.success("成功"); this.$message.success("成功");
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
@ -426,7 +413,7 @@ export default {
} }
}); });
} else { } else {
this.equipment.type=1; this.equipment.type = 1;
createEquipment(this.equipment).then((res) => { createEquipment(this.equipment).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.getList(); this.getList();
@ -441,5 +428,5 @@ export default {
}); });
}, },
}, },
}; };
</script> </script>

View File

@ -2,9 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button
>新增设备</el-button v-if="checkPermission(['equipment_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
> >
新增设备
</el-button>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="检测设备名称/检测设备编号/备注" placeholder="检测设备名称/检测设备编号/备注"
@ -17,37 +22,37 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button
> >
搜索
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</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"
border border
fit fit
stripe stripe
height="100" 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 type="index" width="50"/>
<el-table-column label="设备编号" width="100"> <el-table-column label="设备编号" width="100">
<template slot-scope="scope">{{ scope.row.number }}</template> <template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="管理类别"> <el-table-column label="管理类别">
<template slot-scope="scope">{{ <template slot-scope="scope">
mgmtype_[scope.row.mgmtype] {{mgmtype_[scope.row.mgmtype]}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="校/检方式" width="100"> <el-table-column label="校/检方式" width="100">
<template slot-scope="scope">{{ waytype_[scope.row.way] }}</template> <template slot-scope="scope">{{ waytype_[scope.row.way] }}</template>
@ -66,10 +71,9 @@
<el-tag v-if="scope.row.next_check_date" :type="setClass(scope.row.next_check_date)"> <el-tag v-if="scope.row.next_check_date" :type="setClass(scope.row.next_check_date)">
{{scope.row.next_check_date}} {{scope.row.next_check_date}}
</el-tag> </el-tag>
<div v-else></div></template <div v-else></div>
> </template>
</el-table-column> </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>
@ -88,18 +92,15 @@
<el-tag v-if="scope.row.state===10" type="success"> <el-tag v-if="scope.row.state===10" type="success">
{{ state_[scope.row.state] }} {{ state_[scope.row.state] }}
</el-tag> </el-tag>
<el-tag v-else type="danger"> <el-tag v-else type="danger">
{{ state_[scope.row.state] }} {{ state_[scope.row.state] }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="保管人"> <el-table-column label="保管人">
<template slot-scope="scope" v-if="scope.row.keeper_">{{ <template slot-scope="scope" v-if="scope.row.keeper_">
scope.row.keeper_.username {{scope.row.keeper_.username}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="存放位置" width="100"> <el-table-column label="存放位置" width="100">
<template slot-scope="scope">{{ scope.row.place }}</template> <template slot-scope="scope">{{ scope.row.place }}</template>
@ -111,28 +112,30 @@
:key="item.number" :key="item.number"
:label="item.name" :label="item.name"
:value="item.number" :value="item.number"
>{{ item.name }}</el-tag
> >
{{ 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="操作" fixed="right" 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"
@click="handleEdit(scope)" @click="handleEdit(scope)"
>编辑</el-link
> >
编辑
</el-link>
<el-link <el-link
v-if="checkPermission(['equipment_delete'])" v-if="checkPermission(['equipment_delete'])"
type="danger" type="danger"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link
> >
删除
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -159,19 +162,19 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="设备名称" prop="name"> <el-form-item label="设备名称" prop="name">
<el-input v-model="equipment.name" placeholder="设备名称" /> <el-input v-model="equipment.name" placeholder="设备名称"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="设备编号" prop="number"> <el-form-item label="设备编号" prop="number">
<el-input v-model="equipment.number" placeholder="设备编号" /> <el-input v-model="equipment.number" 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="model"> <el-form-item label="型号规格" prop="model">
<el-input v-model="equipment.model" placeholder="规格型号规格" /> <el-input v-model="equipment.model" placeholder="规格型号规格"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -183,7 +186,6 @@
</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="state"> <el-form-item label="校/检状态" prop="state">
@ -223,7 +225,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="存放位置" prop="place"> <el-form-item label="存放位置" prop="place">
<el-input v-model="equipment.place" placeholder="存放位置" /> <el-input v-model="equipment.place" placeholder="存放位置"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -267,7 +269,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="存放位置" prop="place"> <el-form-item label="存放位置" prop="place">
<el-input v-model="equipment.place" placeholder="存放位置" /> <el-input v-model="equipment.place" placeholder="存放位置"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -298,11 +300,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="生产厂家" prop="factory"> <el-form-item label="生产厂家" prop="factory">
<el-input v-model="equipment.factory" placeholder="生产厂商及国别" /> <el-input v-model="equipment.factory" placeholder="生产厂商及国别"/>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="description"> <el-form-item label="备注" prop="description">
<el-input <el-input
type="textarea" type="textarea"
@ -321,23 +321,23 @@
</template> </template>
<script> <script>
import { import {
getpEquipmentList, getpEquipmentList,
createEquipment, createEquipment,
updateEquipment, updateEquipment,
deleteEquipment, deleteEquipment,
} from "@/api/equipment"; } from "@/api/equipment";
import { getUserList } from "@/api/user"; import {getUserList} from "@/api/user";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
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 = {
name: "", name: "",
number: "", number: "",
type:null, type: null,
}; };
export default { export default {
components: { Pagination }, components: {Pagination},
data() { data() {
return { return {
equipment: defaultequipment, equipment: defaultequipment,
@ -409,7 +409,7 @@ export default {
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
type:null, type: null,
}, },
keeperOptions: [], keeperOptions: [],
depOptions: [], depOptions: [],
@ -417,11 +417,11 @@ export default {
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
rule1: { rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }], name: [{required: true, message: "请输入", trigger: "blur"}],
number: [{ required: true, message: "请输入", trigger: "blur" }], number: [{required: true, message: "请输入", trigger: "blur"}],
model: [{ required: true, message: "请输入", trigger: "blur" }], model: [{required: true, message: "请输入", trigger: "blur"}],
state: [{ required: true, message: "请选择", trigger: "blur" }], state: [{required: true, message: "请选择", trigger: "blur"}],
}, },
datatime: null, datatime: null,
@ -451,16 +451,16 @@ export default {
}, },
//校准时间提醒 //校准时间提醒
setClass:function(check_date) { setClass: function (check_date) {
let obj = {}; let obj = {};
if(check_date!=null){ if (check_date != null) {
let dat = new Date(); let dat = new Date();
let time = dat.getTime(); let time = dat.getTime();
let check = new Date(check_date).getTime(); let check = new Date(check_date).getTime();
let timeDiffer = (check-time)/1000/60/60/24; let timeDiffer = (check - time) / 1000 / 60 / 60 / 24;
if (4>timeDiffer&&timeDiffer>0) { if (4 > timeDiffer && timeDiffer > 0) {
obj = 'warning'; obj = 'warning';
}else if (timeDiffer<0) { } else if (timeDiffer < 0) {
obj = "danger"; obj = "danger";
} }
} }
@ -468,7 +468,7 @@ export default {
}, },
//组员列表 //组员列表
getUserList() { getUserList() {
getUserList({ page: 0 }).then((res) => { getUserList({page: 0}).then((res) => {
this.keeperOptions = res.data; this.keeperOptions = res.data;
}); });
}, },
@ -546,5 +546,5 @@ export default {
}); });
}, },
}, },
}; };
</script> </script>

View File

@ -2,9 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button
>新增校准或检定</el-button v-if="checkPermission(['echeckrecord_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
> >
新增校准或检定
</el-button>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="设备名称/设备编号/备注" placeholder="设备名称/设备编号/备注"
@ -17,19 +22,20 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button
> >
搜索
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</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="equipmentrecordList.results" :data="equipmentrecordList.results"
@ -40,8 +46,7 @@
height="100" 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 type="index" width="50" />
<el-table-column label="设备名称"> <el-table-column label="设备名称">
<template slot-scope="scope">{{ scope.row.equipment_.name }}</template> <template slot-scope="scope">{{ scope.row.equipment_.name }}</template>
</el-table-column> </el-table-column>
@ -56,12 +61,10 @@
<el-tag v-if="scope.row.equipment_.state===10" type="success"> <el-tag v-if="scope.row.equipment_.state===10" type="success">
{{ state_[scope.row.equipment_.state] }} {{ state_[scope.row.equipment_.state] }}
</el-tag> </el-tag>
<el-tag v-else type="danger"> <el-tag v-else type="danger">
{{ state_[scope.row.equipment_.state] }} {{ state_[scope.row.equipment_.state] }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="校准检查日期"> <el-table-column label="校准检查日期">
<template slot-scope="scope">{{ scope.row.check_date }}</template> <template slot-scope="scope">{{ scope.row.check_date }}</template>
@ -69,26 +72,26 @@
<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 <el-table-column
align="center" align="center"
label="操作" label="操作"
width="120px" width="120px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['equipment_update'])" v-if="checkPermission(['echeckrecord_update'])"
type="primary" type="primary"
@click="handleEdit(scope)" @click="handleEdit(scope)"
>编辑</el-link
> >
编辑
</el-link>
<el-link <el-link
v-if="checkPermission(['equipment_delete'])" v-if="checkPermission(['echeckrecord_delete'])"
type="danger" type="danger"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link
> >
删除
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -112,19 +115,17 @@
label-position="right" label-position="right"
: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"
: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-form-item label="校准检查日期" prop="check_date"> <el-form-item label="校准检查日期" prop="check_date">
<el-date-picker <el-date-picker
v-model="equipmentrecord.check_date" v-model="equipmentrecord.check_date"
@ -134,20 +135,15 @@
style="width: 100%" style="width: 100%"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="description"> <el-form-item label="备注" prop="description">
<el-input <el-input
v-model="equipmentrecord.description"
type="textarea" type="textarea"
:rows="4" :rows="4"
v-model="equipmentrecord.description"
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>
@ -157,62 +153,59 @@
</div> </div>
</template> </template>
<script> <script>
import { getpEquipmentList, import {
getEquipmentrecordList, createEquipmentrecord,updateEquipmentrecord,deleteEquipmentrecord } from "@/api/equipment"; getpEquipmentList,
import { getUserList } from "@/api/user"; getEquipmentrecordList, createEquipmentrecord, updateEquipmentrecord, deleteEquipmentrecord
import { getOrgList } from "@/api/org"; } from "@/api/equipment";
import checkPermission from "@/utils/permission"; // import {getUserList} from "@/api/user";
// import {getOrgList} from "@/api/org";
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 = {};
}; export default {
export default { components: {Pagination},
components: { Pagination },
data() { data() {
return { return {
equipmentrecord: defaultequipment, equipmentrecord: defaultequipment,
equipmentrecordList: { equipmentrecordList: {
count: 0, count: 0,
}, },
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
equipmentoptions:[], equipmentoptions: [],
state_:{ state_: {
10:'合格', 10: '合格',
40: '禁用',
40:'禁用',
}, },
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"}],
}, },
}; };
}, },
computed: {},
watch: {},
created() { created() {
this.getequipmentList(); this.getequipmentList();
this.getList(); this.getList();
}, },
methods: { methods: {
checkPermission, checkPermission,
//设备 //设备
getequipmentList() { getequipmentList() {
getpEquipmentList({pageoff:true,type:2}).then((res) => { getpEquipmentList({pageoff: true, type: 2}).then((res) => {
this.equipmentoptions = genTree(res.data); this.equipmentoptions = genTree(res.data);
}); });
}, },
getList() { getList() {
this.listLoading = true; this.listLoading = true;
getEquipmentrecordList(this.listQuery).then((response) => { getEquipmentrecordList(this.listQuery).then((response) => {
@ -223,18 +216,19 @@ export default {
}); });
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
}, },
resetFilter() { resetFilter() {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
} };
this.getList(); this.getList();
}, },
handleCreate() { handleCreate() {
this.equipmentrecord = Object.assign({}, defaultequipment); this.equipmentrecord = Object.assign({}, defaultequipment);
this.dialogType = "new"; this.dialogType = "new";
@ -252,6 +246,7 @@ export default {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
handleDelete(scope) { handleDelete(scope) {
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认", confirmButtonText: "确认",
@ -264,7 +259,7 @@ export default {
this.$message.success("成功"); this.$message.success("成功");
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
@ -295,5 +290,5 @@ export default {
}); });
}, },
}, },
}; };
</script> </script>

View File

@ -63,21 +63,21 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="scope.row.first_test===null" v-if="checkPermission(['first_test'])&&scope.row.first_test===null"
type="primary" type="primary"
@click="handleTest(scope)" @click="handleTest(scope)"
> >
首件检验 首件检验
</el-link> </el-link>
<el-link <el-link
v-else-if="scope.row.first_test!==null&&!scope.row.first_test_.is_submited" v-if="checkPermission(['first_test'])&&scope.row.first_test!==null&&!scope.row.first_test_.is_submited"
type="primary" type="primary"
@click="handleTestContinue(scope)" @click="handleTestContinue(scope)"
> >
检验 检验
</el-link> </el-link>
<el-link <el-link
v-else-if="scope.row.first_test_.is_submited&&(scope.row.leader_1===null||scope.row.leader_2===null||scope.row.leader_3===null)" v-if="checkPermission(['first_audit'])&&scope.row.first_test_.is_submited&&(scope.row.leader_1===null||scope.row.leader_2===null||scope.row.leader_3===null)"
type="primary" type="primary"
@click="handleSelectclick(scope,'0')" @click="handleSelectclick(scope,'0')"
> >
@ -291,12 +291,14 @@
} }
}); });
}, },
//工序转换 //工序转换
changeIndex(item,index) { changeIndex(item,index) {
this.activeIndex = index; this.activeIndex = index;
this.listQuery.process = item.id; this.listQuery.process = item.id;
this.getTableData(); this.getTableData();
}, },
//获取table数据 //获取table数据
getTableData() { getTableData() {
this.listLoading = true; this.listLoading = true;
@ -309,8 +311,12 @@
this.listLoading = false; this.listLoading = false;
}); });
}, },
//分页 //分页
getsList(){}, getsList(){
this.getTableData
},
//第一次点击首件检验 //第一次点击首件检验
handleTest(scope){ handleTest(scope){
let that = this; let that = this;
@ -331,6 +337,7 @@
} }
}); });
}, },
//首件审批 //首件审批
handleSelectclick(scope,index){ handleSelectclick(scope,index){
let that = this; let that = this;
@ -362,6 +369,7 @@
}); });
}) })
}, },
//选择物料检查表 //选择物料检查表
recordFormChange() { recordFormChange() {
let that = this; let that = this;
@ -370,6 +378,7 @@
}); });
that.formName = arr[0].name; that.formName = arr[0].name;
}, },
//根据选择的表渲染检查项目 //根据选择的表渲染检查项目
selectedRecordForm() { selectedRecordForm() {
let that = this; let that = this;
@ -396,40 +405,27 @@
}); });
} else this.$message.error("请选择检查表!"); } else this.$message.error("请选择检查表!");
}, },
//第一次保存提交检查项目 //第一次保存提交检查项目
recordCancel() { recordCancel() {
this.recordVisible = false; this.recordVisible = false;
this.listVisible = false; this.listVisible = false;
this.getTableData(); this.getTableData();
}, },
/*关闭相机*/ /*关闭相机*/
closeCamera () { closeCamera () {
this.$refs.faceTracking.closeCamera(); this.$refs.faceTracking.closeCamera();
let video = document.getElementById('video'); let video = document.getElementById('video');
let stream = video.srcObject; let stream = video.srcObject;
console.log(stream); // console.log(stream);
let tracks = stream.getTracks(); let tracks = stream.getTracks();
tracks.forEach(track => { tracks.forEach(track => {
track.stop() track.stop()
}); });
video.srcObject = null; video.srcObject = null;
/*let firstTestIndex = sessionStorage.getItem('firstTestIndex');
let firstTestProcess = sessionStorage.getItem('firstTestProcess');
if(firstTestIndex){
sessionStorage.removeItem('firstTestIndex');
sessionStorage.setItem('firstTestIndex',this.activeIndex);
}else{
sessionStorage.setItem('firstTestIndex',this.activeIndex);
}
if(firstTestProcess){
sessionStorage.removeItem('firstTestProcess');
sessionStorage.setItem('firstTestProcess',this.listQuery.process);
}else{
sessionStorage.setItem('firstTestProcess',this.listQuery.process);
}
this.reload();*/
// this.thisVideo.srcObject.getTracks()[0].stop();
}, },
//保存首件检查 //保存首件检查
recordSave(value) { recordSave(value) {
let that = this; let that = this;
@ -445,10 +441,10 @@
that.$message.error(res.msg) that.$message.error(res.msg)
} }
}).catch((err) => { }).catch((err) => {
// console.error(err);
that.$message.error(err) that.$message.error(err)
}); });
}, },
//提交首件检查 //提交首件检查
recordSubmit(value) { recordSubmit(value) {
let that = this; let that = this;
@ -471,6 +467,7 @@
that.$message.error(err); that.$message.error(err);
}); });
}, },
//再次点击首件检验 //再次点击首件检验
handleTestContinue(scope) { handleTestContinue(scope) {
let that = this; let that = this;
@ -508,11 +505,13 @@
} }
});*/ });*/
}, },
//点击人脸验证 //点击人脸验证
directorConfirm(index){ directorConfirm(index){
this.leader = index; this.leader = index;
this.limitedPhoto = true; this.limitedPhoto = true;
}, },
//获取人脸数据 //获取人脸数据
getMsgFormSon(data){ getMsgFormSon(data){
let that =this; let that =this;
@ -553,25 +552,7 @@
}, },
}, },
mounted() { mounted() {
debugger;
this.getProcessList(); this.getProcessList();
/*let that = this;
let activeIndex = sessionStorage.getItem('firstTestIndex');
let firstTestProcess = sessionStorage.getItem('firstTestProcess');
if(activeIndex&&firstTestProcess){
this.activeIndex = parseInt(activeIndex);
this.listQuery.process = parseInt(firstTestProcess);
sessionStorage.removeItem('firstTestIndex');
sessionStorage.removeItem('firstTestProcess');
this.getTableData();
getProcessList({page: 0}).then((response) => {
if (response.data) {
that.processOption = response.data;
}
});
}else{
this.getProcessList();
}*/
}, },
} }
</script> </script>

View File

@ -15,14 +15,16 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter1" @click="handleFilter1"
>搜索 >
搜索
</el-button> </el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter1" @click="resetFilter1"
>重置 >
重置
</el-button> </el-button>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
@ -38,15 +40,12 @@
<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="半成品编号" prop="number">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="规格型号"> <el-table-column label="规格型号">
<template slot-scope="scope">{{ scope.row.material_.specification }}</template> <template slot-scope="scope">{{ scope.row.material_.specification }}</template>
</el-table-column> </el-table-column>
<el-table-column label="检测状态">
<el-table-column label="检测状态"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ actstate_[scope.row.act_state] }} {{ actstate_[scope.row.act_state] }}
</template> </template>
@ -54,31 +53,34 @@
<el-table-column label="子计划编号"> <el-table-column label="子计划编号">
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template> <template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="所在子工序" :filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' }, <el-table-column
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' }, label="所在子工序"
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' }, :filters="filtersList"
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]"
:filter-method="filterTag" :filter-method="filterTag"
filter-placement="bottom-end"> filter-placement="bottom-end"
>
<template slot-scope="scope">{{ scope.row.step_.name }}</template> <template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column 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(['wp_test_init'])&&scope.row.test===null"
@click="handleInspection(scope,'1')" @click="handleInspection(scope,'1')"
>检验 >
检验
</el-link> </el-link>
<el-link <el-link
v-if="scope.row.test!==null" v-if="scope.row.test!==null"
@click="checkRecord(scope,'1')" @click="checkRecord(scope,'1')"
>检验记录 >
检验记录
</el-link> </el-link>
<el-link <el-link
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['wp_scrap'])"
type="danger" type="danger"
@click="handleScrapbcp(scope)" @click="handleScrapbcp(scope)"
>报废 >
报废
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
@ -129,22 +131,22 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter2" @click="handleFilter2"
>搜索 >
搜索
</el-button> </el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter2" @click="resetFilter2"
>重置 >
重置
</el-button> </el-button>
<el-table <el-table
:data="wproductList2.results" :data="wproductList2.results"
border border
fit fit
stripe stripe
height="100" height="100"
highlight-current-row highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 50}" v-el-height-adaptive-table="{bottomOffset: 50}"
@ -153,7 +155,6 @@
<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="半成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template> <template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
@ -168,18 +169,16 @@
<el-table-column label="子计划编号"> <el-table-column label="子计划编号">
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template> <template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="所在子工序" <el-table-column
:filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' }, :filters="filtersList"
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' }, :filter-method="filterTag"
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' }, >
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]"
:filter-method="filterTag">
<template slot-scope="scope">{{ scope.row.step_.name }}</template> <template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column 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(['wp_test_init'])&&scope.row.test===null"
@click="handleInspection(scope,'2')" @click="handleInspection(scope,'2')"
>检验 >检验
</el-link> </el-link>
@ -217,26 +216,26 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter3" @click="handleFilter3"
>搜索 >
搜索
</el-button> </el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter3" @click="resetFilter3"
>重置 >
重置
</el-button> </el-button>
<el-table <el-table
:data="wproductList1.results"
ref="multipleTable" ref="multipleTable"
:data="wproductList1.results"
border border
fit fit
stripe stripe
height="100" height="100"
highlight-current-row highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 50}" v-el-height-adaptive-table="{bottomOffset: 50}"
> >
<el-table-column <el-table-column
type="selection" type="selection"
@ -246,9 +245,7 @@
<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="半成品编号" prop="number">
<el-table-column label="半成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="规格型号"> <el-table-column label="规格型号">
<template slot-scope="scope">{{ scope.row.material_.specification }}</template> <template slot-scope="scope">{{ scope.row.material_.specification }}</template>
@ -261,26 +258,26 @@
<el-table-column label="子计划编号"> <el-table-column label="子计划编号">
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template> <template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="所在子工序" <el-table-column
:filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' }, label="所在子工序"
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' }, :filters="filtersList"
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' }, :filter-method="filterTag"
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]" >
:filter-method="filterTag">
<template slot-scope="scope">{{ scope.row.step_.name }}</template> <template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column 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'])" v-if="checkPermission(['wp_putins'])"
@click="handlePutin(scope)" @click="handlePutin(scope)"
>入库 >
入库
</el-link> </el-link>
<el-link <el-link
v-if="scope.row.test!==null" v-if="scope.row.test!==null"
@click="checkRecord(scope)" @click="checkRecord(scope)"
>检验记录 >
检验记录
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
@ -308,17 +305,18 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter4" @click="handleFilter4"
>搜索 >
搜索
</el-button> </el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter4" @click="resetFilter4"
>重置 >
重置
</el-button> </el-button>
<el-table <el-table
:data="wproductList4.results" :data="wproductList4.results"
border border
fit fit
@ -331,7 +329,6 @@
<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="半成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template> <template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
@ -343,11 +340,11 @@
<el-table-column label="规格型号"> <el-table-column label="规格型号">
<template slot-scope="scope">{{ scope.row.material_.specification }}</template> <template slot-scope="scope">{{ scope.row.material_.specification }}</template>
</el-table-column> </el-table-column>
<el-table-column label="所在子工序" :filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' }, <el-table-column
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' }, label="所在子工序"
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' }, :filters="filtersList"
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]" :filter-method="filterTag"
:filter-method="filterTag"> >
<template slot-scope="scope">{{ scope.row.step_.name }}</template> <template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="不合格标记"> <el-table-column label="不合格标记">
@ -361,14 +358,14 @@
<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'])" v-if="checkPermission(['wmaterial_scrap'])"
type="danger" type="danger"
@click="handleScrap(scope)" @click="handleScrap(scope)"
> >
报废 报废
</el-link> </el-link>
<el-link <el-link
v-if="!scope.row.ticket" v-if="checkPermission(['operation_hear'])&&!scope.row.ticket"
type="primary" type="primary"
@click="handleRetrial(scope)" @click="handleRetrial(scope)"
> >
@ -389,7 +386,6 @@
<el-tab-pane label="夹层半成品" name="5"> <el-tab-pane label="夹层半成品" name="5">
<el-card style="margin-top: 2px"> <el-card style="margin-top: 2px">
<el-table <el-table
:data="wproductList3.results" :data="wproductList3.results"
border border
fit fit
@ -416,16 +412,17 @@
<el-table-column label="子计划编号"> <el-table-column label="子计划编号">
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template> <template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="所在子工序" :filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' }, <el-table-column
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' }, label="所在子工序"
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' }, :filters="filtersList"
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]" :filter-method="filterTag"> :filter-method="filterTag"
>
<template slot-scope="scope">{{ scope.row.step_.name }}</template> <template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column 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="scope.row.test===null" v-if="scope.row.test===null&&checkPermission(['wp_test_init'])"
@click="handleInspection(scope,'3')" @click="handleInspection(scope,'3')"
>检验 >检验
</el-link> </el-link>
@ -458,40 +455,6 @@
> >
</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">
@ -602,18 +565,22 @@
<el-table-column align="center" label="操作"> <el-table-column align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="!scope.row.is_submited" v-if="checkPermission(['wp_test_init'])&&!scope.row.is_submited"
@click="handleInspectionRecord(scope)" @click="handleInspectionRecord(scope)"
>检验 >
检验
</el-link> </el-link>
<el-link <el-link
v-else v-if="scope.row.is_submited"
@click="handleRecordDetail(scope)" @click="handleRecordDetail(scope)"
>查看 >
查看
</el-link> </el-link>
<el-link <el-link
v-if="checkPermission(['wp_test_init'])"
@click="delTestRecord(scope)" @click="delTestRecord(scope)"
>删除 >
删除
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
@ -924,6 +891,10 @@
}, },
WarehouseData: "", WarehouseData: "",
formName: '项目检查表', formName: '项目检查表',
filtersList: [{text: '切割', value: '切割'}, {text: '磨边', value: '磨边'},
{text: '清洗', value: '清洗'}, {text: '热弯成型', value: '热弯成型'}, {text: '化学钢化', value: '化学钢化'},
{text: '镀膜', value: '镀膜'}, {text: '断膜', value: '断膜'}, {text: '汇流条制备', value: '汇流条制备'},
{text: '夹层', value: '夹层'}, {text: '包边', value: '包边'}]
}; };
}, },
computed: {}, computed: {},
@ -952,7 +923,6 @@
} else if (tab.name == 5) { } else if (tab.name == 5) {
this.getList3(); this.getList3();
} }
}, },
//待检半成品列表 //待检半成品列表
getList() { getList() {
@ -965,37 +935,38 @@
this.listLoading = false; this.listLoading = false;
}); });
}, },
handleFilter1() { handleFilter1() {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
}, },
resetFilter1() {
resetFilter1() {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
}; };
this.getList(); this.getList();
}, },
//待检半成品报废 //待检半成品报废
handleScrapbcp(scope) { handleScrapbcp(scope) {
this.dialogFormVisiblebcp = true; this.dialogFormVisiblebcp = true;
this.bcpbf = scope.row.id; this.bcpbf = scope.row.id;
}, },
//确定报废半成品 //确定报废半成品
scrapesubmit() { scrapesubmit() {
// console.log(this.formbcp);
console.log(this.formbcp);
scrap(this.bcpbf, this.formbcp).then((response) => { scrap(this.bcpbf, this.formbcp).then((response) => {
if (response.code >= 200) { if (response.code >= 200) {
this.$message.success("该半成品已报废!"); this.$message.success("该半成品已报废!");
this.dialogFormVisiblebcp = false; this.dialogFormVisiblebcp = false;
this.getList(); this.getList();
} }
}); });
}, },
//复检半成品列表 //复检半成品列表
getList2() { getList2() {
this.listQuery2.act_state = 6; this.listQuery2.act_state = 6;
@ -1005,18 +976,20 @@
} }
}); });
}, },
handleFilter2() { handleFilter2() {
this.listQuery2.page = 1; this.listQuery2.page = 1;
this.getList2(); this.getList2();
}, },
resetFilter2() {
resetFilter2() {
this.listQuery2 = { this.listQuery2 = {
page: 1, page: 1,
page_size: 20, page_size: 20,
}; };
this.getList2(); this.getList2();
}, },
//已合格半成品 //已合格半成品
getList1() { getList1() {
this.listQuery1.act_state = 30; this.listQuery1.act_state = 30;
@ -1025,21 +998,22 @@
if (response.data) { if (response.data) {
this.wproductList1 = response.data; this.wproductList1 = response.data;
} }
}); });
}, },
handleFilter3() { handleFilter3() {
this.listQuery1.page = 1; this.listQuery1.page = 1;
this.getList1(); this.getList1();
}, },
resetFilter3() {
resetFilter3() {
this.listQuery1 = { this.listQuery1 = {
page: 1, page: 1,
page_size: 20, page_size: 20,
}; };
this.getList1(); this.getList1();
}, },
//不合格半成品 //不合格半成品
getList4() { getList4() {
this.listQuery4.act_state = 50; this.listQuery4.act_state = 50;
@ -1048,21 +1022,22 @@
if (response.data) { if (response.data) {
this.wproductList4 = response.data; this.wproductList4 = response.data;
} }
}); });
}, },
handleFilter4() { handleFilter4() {
this.listQuery4.page = 1; this.listQuery4.page = 1;
this.getList4(); this.getList4();
}, },
resetFilter4() {
resetFilter4() {
this.listQuery4 = { this.listQuery4 = {
page: 1, page: 1,
page_size: 20, page_size: 20,
}; };
this.getList4(); this.getList4();
}, },
//不合格半成品报废 //不合格半成品报废
handleScrap(scope) { handleScrap(scope) {
this.$confirm("确认该半成品报废?", "警告", { this.$confirm("确认该半成品报废?", "警告", {
@ -1076,9 +1051,10 @@
this.$message.success("该半成品已报废!"); this.$message.success("该半成品已报废!");
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
//不合格产品重审展示 //不合格产品重审展示
handleRetrial(scope) { handleRetrial(scope) {
let that = this; let that = this;
@ -1111,13 +1087,13 @@
if (that.customfieldList[i].label === "deptSelect") { if (that.customfieldList[i].label === "deptSelect") {
that.customfieldList[i].field_choice = that.orgList; that.customfieldList[i].field_choice = that.orgList;
} }
} }
} }
}); });
that.limitedRetrial = true; that.limitedRetrial = true;
}) })
}, },
//不合格产品重审提交 //不合格产品重审提交
retrialSubmit() { retrialSubmit() {
let that = this; let that = this;
@ -1137,10 +1113,12 @@
} }
}); });
}, },
//筛选 //筛选
filterTag(value, row) { filterTag(value, row) {
return row.step_.name === value; return row.step_.name === value;
}, },
//夹层半成品列表 //夹层半成品列表
getList3() { getList3() {
this.listQuery3.act_state = 26; this.listQuery3.act_state = 26;
@ -1150,11 +1128,13 @@
} }
}); });
}, },
//半成品批量入库 //半成品批量入库
handleCreate() { handleCreate() {
this.dialogFormVisibles = true; this.dialogFormVisibles = true;
this.getWarehouseLists();//仓库 this.getWarehouseLists();//仓库
}, },
//批量入库 //批量入库
putins() { putins() {
let _this = this; let _this = this;
@ -1174,6 +1154,7 @@
} }
}); });
}, },
//仓库列表 //仓库列表
getWarehouseLists() { getWarehouseLists() {
getWarehouseList({page: 0}).then((response) => { getWarehouseList({page: 0}).then((response) => {
@ -1182,6 +1163,7 @@
} }
}); });
}, },
//点击检验:如果有一个直接进入如果有多个表再进行选择 //点击检验:如果有一个直接进入如果有多个表再进行选择
handleInspection(scope, index) { handleInspection(scope, index) {
//调该物料对应的检查表 //调该物料对应的检查表
@ -1211,6 +1193,7 @@
} }
}); });
}, },
//选择物料检查表 //选择物料检查表
recordformChange() { recordformChange() {
let that = this; let that = this;
@ -1219,6 +1202,7 @@
}); });
that.formName = arr[0].name; that.formName = arr[0].name;
}, },
//检验记录 //检验记录
checkRecord(scope, index) { checkRecord(scope, index) {
let that = this; let that = this;
@ -1233,6 +1217,7 @@
} }
}) })
}, },
//点击记录里的检验 //点击记录里的检验
handleInspectionRecord(scope) { handleInspectionRecord(scope) {
let that = this; let that = this;
@ -1282,7 +1267,6 @@
if (res.data) { if (res.data) {
that.hasPicture = false; that.hasPicture = false;
let fieldList = res.data.record_data; let fieldList = res.data.record_data;
that.origintest = res.data.origin_test; that.origintest = res.data.origin_test;
that.recordform = res.data.origin_test_.form; that.recordform = res.data.origin_test_.form;
let originList = res.data.origin_test_.record_data; let originList = res.data.origin_test_.record_data;
@ -1311,6 +1295,7 @@
}) })
} }
}, },
//点击记录里的查看 //点击记录里的查看
handleRecordDetail(scope) { handleRecordDetail(scope) {
let that = this; let that = this;
@ -1325,6 +1310,7 @@
} }
}) })
}, },
//半产品复检 //半产品复检
handleReview() { handleReview() {
let that = this; let that = this;
@ -1349,8 +1335,6 @@
} }
that.fieldList.push(obj) that.fieldList.push(obj)
} }
/*that.fieldList = [...fieldList];
that.originList = [...originList];*/
let arr = fieldList.filter(item => { let arr = fieldList.filter(item => {
return item.field_type === 'draw' return item.field_type === 'draw'
}); });
@ -1377,7 +1361,6 @@
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];
debugger;
let arr = fieldList.filter(item => { let arr = fieldList.filter(item => {
return item.field_type === 'draw' return item.field_type === 'draw'
}); });
@ -1403,6 +1386,7 @@
this.getWarehouseLists();//仓库 this.getWarehouseLists();//仓库
this.id = scope.row.id;//半成品id this.id = scope.row.id;//半成品id
}, },
putin() { putin() {
wproductPutin(this.id, this.form).then((res) => { wproductPutin(this.id, this.form).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
@ -1412,6 +1396,7 @@
} }
}); });
}, },
delTestRecord(scope) { delTestRecord(scope) {
let that = this; let that = this;
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
@ -1434,9 +1419,10 @@
}); });
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
//更新检验记录列表 //更新检验记录列表
refreshRecord() { refreshRecord() {
let that = this; let that = this;
@ -1448,6 +1434,7 @@
} }
}) })
}, },
//保存检查项目 //保存检查项目
recordSave(value) { recordSave(value) {
let that = this; let that = this;
@ -1468,9 +1455,10 @@
this.$message.error(res.msg) this.$message.error(res.msg)
} }
}).catch((err) => { }).catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
//记录提交检查项目 //记录提交检查项目
recordSubmit(value) { recordSubmit(value) {
let that = this; let that = this;
@ -1496,9 +1484,10 @@
this.$message.error(res.msg) this.$message.error(res.msg)
} }
}).catch((err) => { }).catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
//第一次保存提交检查项目 //第一次保存提交检查项目
recordCancel() { recordCancel() {
this.recordVisible = false; this.recordVisible = false;
@ -1508,9 +1497,6 @@
this.getList1(); this.getList1();
this.getList3(); this.getList3();
}, },
pageRefresh() {
this.reload()
},
}, },
mounted() { mounted() {
getUserList({page: 0}).then(response => { getUserList({page: 0}).then(response => {

View File

@ -1,15 +1,17 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card class="box-card"> <el-card class="box-card">
<el-tabs @tab-click="handleClick" type="border-card"> <el-tabs
type="border-card"
@tab-click="handleClick"
>
<el-tab-pane <el-tab-pane
:key="item.name"
v-for="item in processOption" v-for="item in processOption"
:key="item.name"
:label="item.name" :label="item.name"
:name="item.id" :name="item.id"
:closable="item.close" :closable="item.close"
> >
<el-table <el-table
:data="operationList.results" :data="operationList.results"
border border
@ -20,75 +22,74 @@
highlight-current-row highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 50}" v-el-height-adaptive-table="{bottomOffset: 50}"
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50"/>
<el-table-column label="子工序工序"> <el-table-column label="子工序工序">
<template slot-scope="scope">{{ scope.row.step_.name }}</template> <template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="是否提交"> <el-table-column label="是否提交">
<template slot-scope="scope"> <template slot-scope="scope">
<el-span v-if="scope.row.is_submited"></el-span> <el-span v-if="scope.row.is_submited"></el-span>
<el-span v-else></el-span></template <el-span v-else></el-span>
> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建人"> <el-table-column label="创建人">
<template slot-scope="scope">{{ <template slot-scope="scope">
scope.row.create_by_.username {{scope.row.create_by_.username}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="过程记录表"> <el-table-column label="过程记录表">
<template v-if="scope.row.record_" slot-scope="scope">
<template slot-scope="scope" v-if="scope.row.record_"> <el-tag
<el-tag v-for="item in scope.row.record_" v-for="item in scope.row.record_"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id">{{item.name}}</el-tag> :value="item.id"
>
{{item.name}}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="产品数量"> <el-table-column label="产品数量">
<template slot-scope="scope" > <template slot-scope="scope">
{{ scope.row.count_work }} {{ scope.row.count_work }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="生产设备"> <el-table-column label="生产设备">
<template slot-scope="scope" v-if="scope.row.equip_"> <template slot-scope="scope" v-if="scope.row.equip_">
<el-tag v-for="item in scope.row.equip_" <el-tag v-for="item in scope.row.equip_"
:key="item.id" :key="item.id"
:label="item.number" :label="item.number"
:value="item.id">{{item.number}}</el-tag> :value="item.id">{{item.number}}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间"> <el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template> <template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="100px"> <el-table-column align="center" label="操作" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['warehouse_update'])&&scope.row.is_submited" v-if="checkPermission(['operation_create'])&&scope.row.is_submited"
type="primary" type="primary"
@click="handleoperation(scope)" @click="handleoperation(scope)"
>前往查看</el-link> >
前往查看
</el-link>
<el-link <el-link
v-else v-if="checkPermission(['operation_create'])&&!scope.row.is_submited"
type="primary" type="primary"
@click="handleoperation(scope)" @click="handleoperation(scope)"
>前往操作</el-link> >
前往操作
</el-link>
<el-link <el-link
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['operation_delete'])"
type="danger" type="danger"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link> >
删除
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
@ -103,15 +104,15 @@
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import { getoperationList, deleteOperation } from "@/api/wpm"; import {getoperationList, deleteOperation} from "@/api/wpm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { getProcessList, getStepLists } from "@/api/mtm"; import {getProcessList, getStepLists} from "@/api/mtm";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
export default { export default {
components: { Pagination }, components: {Pagination},
data() { data() {
return { return {
operationList: { operationList: {
@ -134,27 +135,25 @@ export default {
methods: { methods: {
checkPermission, checkPermission,
handleoperation(scope) handleoperation(scope) {
{ this.$router.push({name: "operationdo", params: {id: scope.row.id},})
this.$router.push({name: "operationdo", params: { id: scope.row.id}, }) },
},
//大工序工序渲染 //大工序工序渲染
getProcessList() { getProcessList() {
getProcessList({ page: 0 }).then((response) => { getProcessList({page: 0}).then((response) => {
if (response.data) { if (response.data) {
this.processOption = response.data; this.processOption = response.data;
} }
}); });
}, },
getList(){
getList() {
getoperationList(this.listQuery).then((response) => { getoperationList(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
this.operationList = response.data; this.operationList = response.data;
} }
}); });
}, },
//选项卡切换 //选项卡切换
handleClick(tab) { handleClick(tab) {
@ -177,10 +176,10 @@ getList(){
this.$message.success("成功"); this.$message.success("成功");
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
}, },
}; };
</script> </script>

View File

@ -12,11 +12,11 @@
highlight-current-row highlight-current-row
max-height="600" max-height="600"
> >
<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">{{ <template slot-scope="scope">
scope.row.material_.name {{scope.row.material_.name}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="成品编号"> <el-table-column label="成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template> <template slot-scope="scope">{{ scope.row.number }}</template>
@ -33,17 +33,16 @@
<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=" v-if="checkPermission(['wp_test_init']) &&scope.row.test === null"
checkPermission(['warehouse_update']) &&
scope.row.test === null
"
@click="handleInspection(scope)" @click="handleInspection(scope)"
>检验 >
检验
</el-link> </el-link>
<el-link <el-link
v-if="scope.row.test !== null" v-if="scope.row.test !== null"
@click="checkRecord(scope)" @click="checkRecord(scope)"
>检验记录 >
检验记录
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
@ -63,23 +62,22 @@
>批量入库 >批量入库
</el-button> </el-button>
<el-table <el-table
ref="multipleTable"
v-loading="listLoading" v-loading="listLoading"
:data="wproductList1.results" :data="wproductList1.results"
ref="multipleTable"
border border
fit fit
stripe stripe
highlight-current-row highlight-current-row
max-height="600" max-height="600"
> >
<el-table-column type="selection" width="55"> </el-table-column> <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">{{ <template slot-scope="scope">
scope.row.material_.name {{scope.row.material_.name}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="成品编号"> <el-table-column label="成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template> <template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
@ -106,9 +104,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'])" v-if="checkPermission(['wp_putins'])"
@click="handlePutin(scope)" @click="handlePutin(scope)"
>入库 >
入库
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
@ -143,12 +142,14 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="outerVisible = false"> </el-button> <el-button @click="outerVisible = false"> </el-button>
<el-button type="primary" @click="submitrecordform()" <el-button
>填写检查项目</el-button type="primary"
@click="submitrecordform()"
> >
填写检查项目
</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--检查表显示--> <!--检查表显示-->
@ -178,14 +179,14 @@
:visible.sync="limitedCheckRecord" :visible.sync="limitedCheckRecord"
> >
<el-table :data="recordList" border 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">{{ <template slot-scope="scope">
checkTypes[scope.row.type] {{checkTypes[scope.row.type]}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="是否提交"> <el-table-column label="是否提交">
<template slot-scope="scope"> <template slot-scope="scope">
@ -196,12 +197,18 @@
<el-table-column align="center" label="操作"> <el-table-column align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="!scope.row.is_submited" v-if="checkPermission(['wp_test_init'])&&!scope.row.is_submited"
@click="handleInspectionRecord(scope)" @click="handleInspectionRecord(scope)"
>检验 >
检验
</el-link> </el-link>
<el-link v-else @click="handleRecordDetail(scope)">查看 </el-link> <el-link
<el-link @click="delTestRecord(scope)">删除 </el-link> v-if="scope.row.is_submited"
@click="handleRecordDetail(scope)"
>
查看
</el-link>
<el-link @click="delTestRecord(scope)">删除</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -218,8 +225,8 @@
<el-form :model="form"> <el-form :model="form">
<el-form-item label="仓库"> <el-form-item label="仓库">
<el-select <el-select
style="width: 100%"
v-model="form.warehouse" v-model="form.warehouse"
style="width: 100%"
placeholder="请选择仓库" placeholder="请选择仓库"
> >
<el-option <el-option
@ -248,8 +255,8 @@
<el-form :model="form"> <el-form :model="form">
<el-form-item label="仓库"> <el-form-item label="仓库">
<el-select <el-select
style="width: 100%"
v-model="form.warehouse" v-model="form.warehouse"
style="width: 100%"
placeholder="请选择仓库" placeholder="请选择仓库"
> >
<el-option <el-option
@ -270,40 +277,38 @@
<el-button type="primary" @click="putins"> </el-button> <el-button type="primary" @click="putins"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getOrderList } from "@/api/sam"; // 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 { 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 { import {
getwproductList, getwproductList,
wproductTest, wproductTest,
wproductPutin, wproductPutin,
createputins, createputins,
testInit, testInit,
toorder, } from "@/api/wpm";
} from "@/api/wpm"; import {
import {
getTestRecord, getTestRecord,
getTestRecordItem, getTestRecordItem,
putTestRecordItem, putTestRecordItem,
delTestRecordItem, delTestRecordItem,
subTestRecordItem, subTestRecordItem,
} from "@/api/qm"; } from "@/api/qm";
const defaultetestitem = {};
export default { const defaultetestitem = {};
components: { Pagination, customForm }, export default {
components: {Pagination, customForm},
data() { data() {
return { return {
testitem: defaultetestitem, testitem: defaultetestitem,
form: { remark: "", warehouse: "" }, form: {remark: "", warehouse: ""},
form1: {}, form1: {},
wproductList: { wproductList: {
count: 0, count: 0,
@ -343,14 +348,8 @@ export default {
40: "成品检验", 40: "成品检验",
}, },
choice: [ choice: [
{ {value: true, label: "合格"},
value: true, {value: false, label: "不合格"},
label: "合格",
},
{
value: false,
label: "不合格",
},
], ],
options: [], options: [],
listLoading: true, listLoading: true,
@ -417,6 +416,7 @@ export default {
this.dialogFormVisibles = true; this.dialogFormVisibles = true;
this.getWarehouseLists(); //仓库 this.getWarehouseLists(); //仓库
}, },
//批量入库 //批量入库
putins() { putins() {
let _this = this; let _this = this;
@ -424,8 +424,6 @@ export default {
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);
createputins({ createputins({
warehouse: this.form.warehouse, warehouse: this.form.warehouse,
wproducts: _this.mutipID, wproducts: _this.mutipID,
@ -438,14 +436,16 @@ export default {
} }
}); });
}, },
//仓库列表 //仓库列表
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;
} }
}); });
}, },
//提交检查项目 //提交检查项目
submitfield() { submitfield() {
let _this = this; let _this = this;
@ -457,13 +457,10 @@ export default {
is_testok: item.is_testok, //单项检查结果 is_testok: item.is_testok, //单项检查结果
}); });
}); });
console.log(this.recordform);
this.testrecord.form = this.recordform; //检查表 this.testrecord.form = this.recordform; //检查表
this.testrecord.record_data = _this.field; //检查项列表 this.testrecord.record_data = _this.field; //检查项列表
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;
@ -473,12 +470,14 @@ export default {
} }
}); });
}, },
//半成品入库 //半成品入库
handlePutin(scope) { handlePutin(scope) {
this.dialogFormVisible = true; this.dialogFormVisible = true;
this.getWarehouseLists(); //仓库 this.getWarehouseLists(); //仓库
this.id = scope.row.id; //半成品id this.id = scope.row.id; //半成品id
}, },
putin() { putin() {
wproductPutin(this.id, this.form).then((res) => { wproductPutin(this.id, this.form).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
@ -511,11 +510,12 @@ export default {
} }
}); });
}, },
//根据选择的表渲染检查项目 //根据选择的表渲染检查项目
submitrecordform() { submitrecordform() {
let that = this; let that = this;
if (this.recordform != "") { if (this.recordform != "") {
testInit({ wproduct: that.wproduct, form: that.recordform }).then( testInit({wproduct: that.wproduct, form: that.recordform}).then(
(response) => { (response) => {
if (response.data) { if (response.data) {
that.hasPicture = false; that.hasPicture = false;
@ -539,6 +539,7 @@ export default {
); );
} else this.$message.error("请选择检查表!"); } else this.$message.error("请选择检查表!");
}, },
//选择物料检查表 //选择物料检查表
recordformChange() { recordformChange() {
let that = this; let that = this;
@ -547,10 +548,11 @@ export default {
}); });
that.formName = arr[0].name; that.formName = arr[0].name;
}, },
//更新检验记录列表 //更新检验记录列表
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 {
@ -558,12 +560,13 @@ export default {
} }
}); });
}, },
//检验记录 //检验记录
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 {
@ -571,6 +574,7 @@ export default {
} }
}); });
}, },
//点击记录里的检验 //点击记录里的检验
handleInspectionRecord(scope) { handleInspectionRecord(scope) {
let that = this; let that = this;
@ -578,7 +582,7 @@ export default {
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( getrffieldList({form: this.recordform, page: 1, page_size: 100}).then(
(response) => { (response) => {
if (response.data) { if (response.data) {
that.hasPicture = false; that.hasPicture = false;
@ -614,6 +618,7 @@ export default {
} }
); );
}, },
delTestRecord(scope) { delTestRecord(scope) {
let that = this; let that = this;
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
@ -634,9 +639,10 @@ export default {
}); });
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
//保存检查项目 //保存检查项目
recordSave(value) { recordSave(value) {
let that = this; let that = this;
@ -657,9 +663,10 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
//记录提交检查项目 //记录提交检查项目
recordSubmit(value) { recordSubmit(value) {
let that = this; let that = this;
@ -685,14 +692,15 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
//第一次保存提交检查项目 //第一次保存提交检查项目
recordCancel() { recordCancel() {
this.outerVisible = false; this.outerVisible = false;
this.innerVisible = false; this.innerVisible = false;
}, },
}, },
}; };
</script> </script>

View File

@ -2,8 +2,8 @@
<div class="app-container"> <div class="app-container">
<el-tabs v-model="activeName" @tab-click="handleClick" type="border-card"> <el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
<el-tab-pane <el-tab-pane
:key="item.name"
v-for="item in processOption" v-for="item in processOption"
:key="item.name"
:label="item.name" :label="item.name"
:name="item.id" :name="item.id"
:closable="item.close" :closable="item.close"
@ -18,8 +18,7 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="子计划编号" min-width="100" show-overflow-tooltip> <el-table-column label="子计划编号" prop="number" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="产品名称" min-width="120" show-overflow-tooltip> <el-table-column label="产品名称" min-width="120" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
@ -58,11 +57,9 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="开工时间" width="100"> <el-table-column label="开工时间" prop="start_date" width="100">
<template slot-scope="scope">{{ scope.row.start_date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="完工时间" width="100"> <el-table-column label="完工时间" prop="end_date" width="100">
<template slot-scope="scope">{{ scope.row.end_date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="状态"> <el-table-column label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
@ -88,20 +85,21 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['wmaterial_pick'])&&!scope.row.is_picked"
type="success" type="success"
v-if="scope.row.is_picked == false"
@click="handleNeed(scope)" @click="handleNeed(scope)"
> >
领料 领料
</el-link> </el-link>
<el-link <el-link
v-if="checkPermission(['wmaterial_pick'])&&scope.row.is_picked"
type="success" type="success"
v-if="scope.row.is_picked"
@click="handleNeed(scope)" @click="handleNeed(scope)"
> >
继续领料 继续领料
</el-link> </el-link>
<el-link <el-link
v-if="checkPermission(['wmaterial_pick'])"
type="primary" type="primary"
@click="handlepick(scope)" @click="handlepick(scope)"
> >
@ -124,10 +122,11 @@
<span>半成品</span> <span>半成品</span>
</div> </div>
<el-button <el-button
v-for="item in steps"
v-show="checkPermission(['wmaterial_operation'])"
:key="item.number"
type="primary" type="primary"
style="margin-left: 2px" style="margin-left: 2px"
v-for="item in steps"
:key="item.number"
:label="item.name" :label="item.name"
:value="item.number" :value="item.number"
@click="handlework(item)" @click="handlework(item)"
@ -135,10 +134,11 @@
{{ item.name }} {{ item.name }}
</el-button> </el-button>
<el-button <el-button
type="primary" v-if="checkPermission(['wmaterial_scrap'])"
@click="handleScrapbcp()"
id="scrap" id="scrap"
type="primary"
style="float: right; display: none" style="float: right; display: none"
@click="handleScrapbcp()"
> >
报废 报废
</el-button> </el-button>
@ -167,10 +167,7 @@
{{scope.row.subproduction_plan_.number}} {{scope.row.subproduction_plan_.number}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="玻璃编号" width="100" show-overflow-tooltip> <el-table-column label="玻璃编号" prop="number" width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.number }}
</template>
</el-table-column> </el-table-column>
<el-table-column label="玻璃状态" width="100" show-overflow-tooltip> <el-table-column label="玻璃状态" width="100" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
@ -192,10 +189,7 @@
{{ ng_sign_[scope.row.ng_sign] }} {{ ng_sign_[scope.row.ng_sign] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="更新时间" width="160"> <el-table-column label="更新时间" prop="update_time" width="160">
<template slot-scope="scope">
{{scope.row.update_time}}
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
@ -229,11 +223,9 @@
{{scope.row.material_.unit}} {{scope.row.material_.unit}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="物料批次"> <el-table-column prop="batch" label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column> </el-table-column>
<el-table-column label="物料数量"> <el-table-column prop="count" label="物料数量">
<template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
@ -249,8 +241,8 @@
<el-form :model="formbcp"> <el-form :model="formbcp">
<el-form-item label="甩片原因"> <el-form-item label="甩片原因">
<el-select <el-select
style="width: 80%"
v-model="formbcp.scrap_reason" v-model="formbcp.scrap_reason"
style="width: 80%"
placeholder="请甩片原因" placeholder="请甩片原因"
> >
<el-option <el-option