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,34 +2,40 @@
<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"
<el-input icon="el-icon-plus"
v-model="listQuery.search" @click="handleCreate"
placeholder="设备名称/设备编号/备注" >
style="width: 300px" 新增设备
class="filter-item" </el-button>
@keyup.enter.native="handleFilter" <el-input
/> v-model="listQuery.search"
<el-button placeholder="设备名称/设备编号/备注"
class="filter-item" style="width: 300px"
type="primary" class="filter-item"
icon="el-icon-search" @keyup.enter.native="handleFilter"
@click="handleFilter" />
>搜索</el-button <el-button
> class="filter-item"
<el-button type="primary"
class="filter-item" icon="el-icon-search"
type="primary" @click="handleFilter"
icon="el-icon-refresh-left" >
@click="resetFilter" 搜索
>重置</el-button </el-button>
> <el-button
</div> class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>
重置
</el-button>
</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"
@ -37,92 +43,82 @@
fit fit
stripe stripe
highlight-current-row highlight-current-row
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">
<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-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">
{{ state_[scope.row.state] }} {{ state_[scope.row.state] }}
</el-tag> </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.parameter }}</template> <template slot-scope="scope">{{ scope.row.parameter }}</template>
</el-table-column> </el-table-column>
<el-table-column label="保管人" width="120"> <el-table-column label="保管人" width="120">
<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="存放位置" width="120" show-overflow-tooltip> <el-table-column label="存放位置" width="120" show-overflow-tooltip>
<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="绑定工序" width="120" show-overflow-tooltip> <el-table-column label="绑定工序" width="120" show-overflow-tooltip>
<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="备注" 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="操作"
width="120px" width="120px"
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>
@ -146,72 +142,70 @@
label-position="right" label-position="right"
:rules="rule1" :rules="rule1"
> >
<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 :span="12">
<el-form-item label="设备编号" prop="number">
<el-input v-model="equipment.number" placeholder="设备编号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="型号规格" prop="model">
<el-input v-model="equipment.model" placeholder="规格型号规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" prop="count">
<el-input v-model="equipment.count" placeholder="数量" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="厂商及国别" prop="factory">
<el-input v-model="equipment.factory" placeholder="生产厂商及国别" />
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="生产日期" prop="production_date">
<el-date-picker
v-model="equipment.production_date"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width:100%"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="购置日期" prop="buy_date">
<el-date-picker
v-model="equipment.buy_date"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width:100%"
>
</el-date-picker>
</el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12">
<el-form-item label="状态" prop="state"> <el-form-item label="设备编号" prop="number">
<el-input v-model="equipment.number" placeholder="设备编号"/>
<el-select style="width: 100%" v-model="equipment.state" placeholder="请选择"> </el-form-item>
<el-option </el-col>
v-for="item in options" </el-row>
:key="item.value" <el-row>
:label="item.label" <el-col :span="12">
:value="item.value"> <el-form-item label="型号规格" prop="model">
</el-option> <el-input v-model="equipment.model" placeholder="规格型号规格"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" prop="count">
<el-input v-model="equipment.count" placeholder="数量"/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="厂商及国别" prop="factory">
<el-input v-model="equipment.factory" placeholder="生产厂商及国别"/>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="生产日期" prop="production_date">
<el-date-picker
v-model="equipment.production_date"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width:100%"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="购置日期" prop="buy_date">
<el-date-picker
v-model="equipment.buy_date"
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="state">
<el-select style="width: 100%" v-model="equipment.state" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</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"
@ -219,38 +213,35 @@
placeholder="技术指标" placeholder="技术指标"
/> />
</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-row>
<el-col :span="12">
<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-form-item> </el-form-item>
<el-row>
<el-col :span="12">
<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-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 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-col>
</el-form-item> </el-row>
</el-col>
</el-row>
<el-form-item label="设备备注" prop="description"> <el-form-item label="设备备注" prop="description">
<el-input <el-input
type="textarea" type="textarea"
@ -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,33 +259,33 @@
</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,
label: '完好' label: '完好'
}, { }, {
@ -316,130 +298,135 @@ export default {
value: 40, value: 40,
label: '禁用' label: '禁用'
}], }],
listQuery: { listQuery: {
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"}]
}, },
}; };
},
computed: {},
watch: {},
created() {
this.getList();
this.getUserList();
this.getOrgList();
},
methods: {
checkPermission,
//设备列表
getList() {
this.listLoading = true;
this.listQuery.type=1;
getpEquipmentList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentList = response.data;
}
this.listLoading = false;
});
}, },
//组员列表 computed: {},
getUserList() { watch: {},
getUserList({pageoff:true}).then((res) => { created() {
this.keeperOptions = genTree(res.data); this.getList();
}); this.getUserList();
}, this.getOrgList();
//部门列表
getOrgList() {
getOrgList({pageoff:true}).then((res) => {
this.depOptions = genTree(res.data);
});
}, },
methods: {
checkPermission,
//设备列表
handleFilter() { getList() {
this.listQuery.page = 1; this.listLoading = true;
this.getList(); this.listQuery.type = 1;
}, getpEquipmentList(this.listQuery).then((response) => {
resetFilter() { if (response.data) {
this.listQuery = { this.equipmentList = response.data;
page: 1,
page_size: 20,
}
this.getList();
},
handleCreate() {
this.equipment = Object.assign({}, defaultequipment);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.equipment = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteEquipment(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateEquipment(this.equipment.id, this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.equipment.type=1;
createEquipment(this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} }
} else { this.listLoading = false;
return false; });
},
//组员列表
getUserList() {
getUserList({pageoff: true}).then((res) => {
this.keeperOptions = genTree(res.data);
});
},
//部门列表
getOrgList() {
getOrgList({pageoff: true}).then((res) => {
this.depOptions = genTree(res.data);
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
} }
}); this.getList();
},
handleCreate() {
this.equipment = Object.assign({}, defaultequipment);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.equipment = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteEquipment(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
this.$message.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateEquipment(this.equipment.id, this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.equipment.type = 1;
createEquipment(this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
}, },
}, };
};
</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,39 +22,39 @@
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>
</el-table-column> </el-table-column>
<el-table-column label="标准/依据" width="100"> <el-table-column label="标准/依据" width="100">
@ -63,13 +68,12 @@
</el-table-column> </el-table-column>
<el-table-column label="下次校准日期" width="130"> <el-table-column label="下次校准日期" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<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>
@ -83,23 +87,20 @@
<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="校/检状态" width="100"> <el-table-column label="校/检状态" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<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,230 +321,230 @@
</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,
equipmentList: { equipmentList: {
count: 0, count: 0,
},
mgmtype_: {
1: "A",
2: "B",
3: "C",
},
mgmoptions: [
{
value: 1,
label: "A",
}, },
{ mgmtype_: {
value: 2, 1: "A",
label: "B", 2: "B",
3: "C",
}, },
{ mgmoptions: [
value: 3, {
label: "C", value: 1,
label: "A",
},
{
value: 2,
label: "B",
},
{
value: 3,
label: "C",
},
],
waytype_: {
1: "外检",
2: "自检",
}, },
], wayoptions: [
waytype_: { {
1: "外检", value: 1,
2: "自检", label: "外检",
}, },
wayoptions: [ {
{ value: 2,
value: 1, label: "自检",
label: "外检", },
],
usetype_: {
1: "专用",
2: "公用",
}, },
{ useoptions: [
value: 2, {
label: "自检", value: 1,
}, label: "专用",
], },
usetype_: { {
1: "专用", value: 2,
2: "公用", label: "公用",
}, },
useoptions: [ ],
{ state_: {
value: 1, 10: "合格",
label: "专用",
},
{
value: 2,
label: "公用",
},
],
state_: {
10: "合格",
40: "禁用", 40: "禁用",
},
options: [
{
value: 10,
label: "合格",
}, },
{ options: [
value: 40, {
label: "禁用", value: 10,
label: "合格",
},
{
value: 40,
label: "禁用",
},
],
listQuery: {
page: 1,
page_size: 20,
type: null,
}, },
], keeperOptions: [],
listQuery: { depOptions: [],
page: 1, listLoading: true,
page_size: 20, dialogVisible: false,
type:null, dialogType: "new",
}, rule1: {
keeperOptions: [], name: [{required: true, message: "请输入", trigger: "blur"}],
depOptions: [], number: [{required: true, message: "请输入", trigger: "blur"}],
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }],
number: [{ required: true, message: "请输入", trigger: "blur" }],
model: [{ required: true, message: "请输入", trigger: "blur" }],
state: [{ required: true, message: "请选择", trigger: "blur" }],
},
datatime: null,
};
},
computed: {},
watch: {},
created() {
this.getList();
this.getUserList(); model: [{required: true, message: "请输入", trigger: "blur"}],
state: [{required: true, message: "请选择", trigger: "blur"}],
},
methods: {
checkPermission,
//设备列表 },
getList() { datatime: null,
this.listLoading = true; };
this.listQuery.type = 2;
getpEquipmentList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentList = response.data;
}
this.listLoading = false;
});
}, },
computed: {},
watch: {},
created() {
this.getList();
//校准时间提醒 this.getUserList();
setClass:function(check_date) {
},
methods: {
checkPermission,
//设备列表
getList() {
this.listLoading = true;
this.listQuery.type = 2;
getpEquipmentList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentList = response.data;
}
this.listLoading = false;
});
},
//校准时间提醒
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";
} }
} }
return obj; return obj;
}, },
//组员列表 //组员列表
getUserList() { getUserList() {
getUserList({ page: 0 }).then((res) => { getUserList({page: 0}).then((res) => {
this.keeperOptions = res.data; this.keeperOptions = res.data;
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
handleCreate() {
this.equipment = Object.assign({}, defaultequipment);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.equipment = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteEquipment(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
}); });
}, },
async confirm(form) {
this.$refs[form].validate((valid) => { handleFilter() {
if (valid) { this.listQuery.page = 1;
const isEdit = this.dialogType === "edit"; this.getList();
if (isEdit) { },
updateEquipment(this.equipment.id, this.equipment).then((res) => { resetFilter() {
if (res.code >= 200) { this.listQuery = {
this.getList(); page: 1,
this.dialogVisible = false; page_size: 20,
this.$message.success("成功"); };
} this.getList();
}); },
handleCreate() {
this.equipment = Object.assign({}, defaultequipment);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.equipment = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteEquipment(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateEquipment(this.equipment.id, this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.equipment.type = 2;
createEquipment(this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else { } else {
this.equipment.type = 2; return false;
createEquipment(this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} }
} else { });
return false; },
}
});
}, },
}, };
};
</script> </script>

View File

@ -2,34 +2,40 @@
<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"
<el-input icon="el-icon-plus"
v-model="listQuery.search" @click="handleCreate"
placeholder="设备名称/设备编号/备注" >
style="width: 300px" 新增校准或检定
class="filter-item" </el-button>
@keyup.enter.native="handleFilter" <el-input
/> v-model="listQuery.search"
<el-button placeholder="设备名称/设备编号/备注"
class="filter-item" style="width: 300px"
type="primary" class="filter-item"
icon="el-icon-search" @keyup.enter.native="handleFilter"
@click="handleFilter" />
>搜索</el-button <el-button
> class="filter-item"
<el-button type="primary"
class="filter-item" icon="el-icon-search"
type="primary" @click="handleFilter"
icon="el-icon-refresh-left" >
@click="resetFilter" 搜索
>重置</el-button </el-button>
> <el-button
</div> class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>
重置
</el-button>
</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,55 +46,52 @@
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>
<el-table-column label="设备编号"> <el-table-column label="设备编号">
<template slot-scope="scope">{{ scope.row.equipment_.number }}</template> <template slot-scope="scope">{{ scope.row.equipment_.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="型号规格"> <el-table-column label="型号规格">
<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"> <template slot-scope="scope">
<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>
</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 <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,21 +115,19 @@
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-date-picker
<el-form-item label="校准检查日期" prop="check_date">
<el-date-picker
v-model="equipmentrecord.check_date" v-model="equipmentrecord.check_date"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
@ -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,143 +153,142 @@
</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: {
page: 1,
page_size: 20,
},
equipmentoptions:[],
state_:{
10:'合格',
40:'禁用',
}, },
listQuery: {
listLoading: true, page: 1,
dialogVisible: false, page_size: 20,
dialogType: "new", },
rule1: { equipmentoptions: [],
equipment: [{ required: true, message: "请输入", trigger: "blur" }], state_: {
10: '合格',
40: '禁用',
}, },
}; listLoading: true,
}, dialogVisible: false,
computed: {}, dialogType: "new",
watch: {}, rule1: {
created() { equipment: [{required: true, message: "请输入", trigger: "blur"}],
this.getequipmentList(); },
this.getList(); };
},
methods: {
checkPermission,
//设备
getequipmentList() {
getpEquipmentList({pageoff:true,type:2}).then((res) => {
this.equipmentoptions = genTree(res.data);
});
},
getList() {
this.listLoading = true;
getEquipmentrecordList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentrecordList = response.data;
}
this.listLoading = false;
});
}, },
created() {
handleFilter() { this.getequipmentList();
this.listQuery.page = 1;
this.getList(); this.getList();
}, },
resetFilter() {
this.listQuery = { methods: {
page: 1, checkPermission,
page_size: 20,
} //设备
this.getList(); getequipmentList() {
}, getpEquipmentList({pageoff: true, type: 2}).then((res) => {
handleCreate() { this.equipmentoptions = genTree(res.data);
this.equipmentrecord = Object.assign({}, defaultequipment);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.equipmentrecord = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteEquipmentrecord(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
}); });
}, },
async confirm(form) { getList() {
this.$refs[form].validate((valid) => { this.listLoading = true;
if (valid) { getEquipmentrecordList(this.listQuery).then((response) => {
const isEdit = this.dialogType === "edit"; if (response.data) {
if (isEdit) { this.equipmentrecordList = response.data;
updateEquipmentrecord(this.equipmentrecord.id, this.equipmentrecord).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createEquipmentrecord(this.equipmentrecord).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} }
} else { this.listLoading = false;
return false; });
} },
});
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
handleCreate() {
this.equipmentrecord = Object.assign({}, defaultequipment);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.equipmentrecord = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteEquipmentrecord(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
this.$message.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateEquipmentrecord(this.equipmentrecord.id, this.equipmentrecord).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createEquipmentrecord(this.equipmentrecord).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
}, },
}, };
};
</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,186 +1,185 @@
<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
<el-tab-pane type="border-card"
:key="item.name" @tab-click="handleClick"
v-for="item in processOption"
:label="item.name"
:name="item.id"
:closable="item.close"
> >
<el-tab-pane
<el-table v-for="item in processOption"
:data="operationList.results" :key="item.name"
border :label="item.name"
fit :name="item.id"
stripe :closable="item.close"
style="width: 100%" >
height="100" <el-table
highlight-current-row :data="operationList.results"
v-el-height-adaptive-table="{bottomOffset: 50}" border
> fit
<el-table-column type="index" width="50" /> stripe
style="width: 100%"
<el-table-column label="子工序工序"> height="100"
<template slot-scope="scope">{{ scope.row.step_.name }}</template> highlight-current-row
</el-table-column> v-el-height-adaptive-table="{bottomOffset: 50}"
<el-table-column label="是否提交">
<template slot-scope="scope">
<el-span v-if="scope.row.is_submited"></el-span>
<el-span v-else></el-span></template
> >
</el-table-column> <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.step_.name }}</template>
scope.row.create_by_.username </el-table-column>
}}</template> <el-table-column label="是否提交">
</el-table-column> <template slot-scope="scope">
<el-span v-if="scope.row.is_submited"></el-span>
<el-span v-else></el-span>
<el-table-column label="过程记录表"> </template>
</el-table-column>
<template slot-scope="scope" v-if="scope.row.record_"> <el-table-column label="创建人">
<el-tag v-for="item in scope.row.record_" <template slot-scope="scope">
:key="item.id" {{scope.row.create_by_.username}}
:label="item.name" </template>
:value="item.id">{{item.name}}</el-tag> </el-table-column>
</template> <el-table-column label="过程记录表">
<template v-if="scope.row.record_" slot-scope="scope">
<el-tag
</el-table-column> v-for="item in scope.row.record_"
<el-table-column label="产品数量"> :key="item.id"
<template slot-scope="scope" > :label="item.name"
{{ scope.row.count_work }} :value="item.id"
>
</template> {{item.name}}
</el-table-column> </el-tag>
<el-table-column label="生产设备"> </template>
<template slot-scope="scope" v-if="scope.row.equip_"> </el-table-column>
<el-table-column label="产品数量">
<el-tag v-for="item in scope.row.equip_" <template slot-scope="scope">
:key="item.id" {{ scope.row.count_work }}
:label="item.number" </template>
:value="item.id">{{item.number}}</el-tag> </el-table-column>
</template> <el-table-column label="生产设备">
</el-table-column> <template slot-scope="scope" v-if="scope.row.equip_">
<el-tag v-for="item in scope.row.equip_"
<el-table-column label="创建时间"> :key="item.id"
<template slot-scope="scope">{{ scope.row.create_time }}</template> :label="item.number"
</el-table-column> :value="item.id">{{item.number}}
<el-table-column align="center" label="操作" width="100px"> </el-tag>
<template slot-scope="scope"> </template>
</el-table-column>
<el-link <el-table-column label="创建时间">
v-if="checkPermission(['warehouse_update'])&&scope.row.is_submited" <template slot-scope="scope">{{ scope.row.create_time }}</template>
type="primary" </el-table-column>
@click="handleoperation(scope)" <el-table-column align="center" label="操作" width="100px">
>前往查看</el-link> <template slot-scope="scope">
<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 前往查看
v-if="checkPermission(['warehouse_update'])" </el-link>
type="danger" <el-link
@click="handleDelete(scope)" v-if="checkPermission(['operation_create'])&&!scope.row.is_submited"
>删除</el-link> type="primary"
@click="handleoperation(scope)"
</template> >
前往操作
</el-table-column> </el-link>
</el-table> <el-link
<pagination v-if="checkPermission(['operation_delete'])"
v-show="operationList.count > 0" type="danger"
:total="operationList.count" @click="handleDelete(scope)"
:page.sync="listQuery.page" >
:limit.sync="listQuery.page_size" 删除
@pagination="getList" </el-link>
/> </template>
</el-tab-pane> </el-table-column>
</el-tabs> </el-table>
<pagination
v-show="operationList.count > 0"
:total="operationList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-tab-pane>
</el-tabs>
</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: {
count: 0, count: 0,
}, },
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
processOption: "", processOption: "",
}; };
},
computed: {},
watch: {},
created() {
this.id = this.$route.params.id;
this.getProcessList()
},
methods: {
checkPermission,
handleoperation(scope)
{
this.$router.push({name: "operationdo", params: { id: scope.row.id}, })
},
//大工序工序渲染
getProcessList() {
getProcessList({ page: 0 }).then((response) => {
if (response.data) {
this.processOption = response.data;
}
});
}, },
getList(){ computed: {},
getoperationList(this.listQuery).then((response) => { watch: {},
if (response.data) { created() {
this.operationList = response.data; this.id = this.$route.params.id;
} this.getProcessList()
}); },
}, methods: {
checkPermission,
handleoperation(scope) {
this.$router.push({name: "operationdo", params: {id: scope.row.id},})
},
//大工序工序渲染
getProcessList() {
getProcessList({page: 0}).then((response) => {
if (response.data) {
this.processOption = response.data;
}
});
},
getList() {
getoperationList(this.listQuery).then((response) => {
if (response.data) {
this.operationList = response.data;
}
});
},
//选项卡切换 //选项卡切换
handleClick(tab) { handleClick(tab) {
this.process = tab.name; this.process = tab.name;
this.listQuery.step__process = tab.name; this.listQuery.step__process = tab.name;
this.getList(); this.getList();
},
//操作记录删除 },
handleDelete(scope) {
this.$confirm("确认该操作删除?", "警告", { //操作记录删除
confirmButtonText: "确认", handleDelete(scope) {
cancelButtonText: "取消", this.$confirm("确认该操作删除?", "警告", {
type: "error", confirmButtonText: "确认",
}) cancelButtonText: "取消",
.then(async () => { type: "error",
await deleteOperation(scope.row.id);
this.getList();
this.$message.success("成功");
}) })
.catch((err) => { .then(async () => {
console.error(err); await deleteOperation(scope.row.id);
}); this.getList();
}, this.$message.success("成功");
})
.catch((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>
@ -60,26 +59,25 @@
<el-tab-pane label="已合格成品"> <el-tab-pane label="已合格成品">
<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-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>
@ -88,7 +86,7 @@
{{ 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" v-if="scope.row.to_order_">
{{scope.row.to_order_.number }} {{scope.row.to_order_.number }}
</template> </template>
@ -98,7 +96,7 @@
{{scope.row.to_order_.customer_.name }} {{scope.row.to_order_.customer_.name }}
</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" v-if="scope.row.to_order_">
{{scope.row.to_order_.contract_.name }} {{scope.row.to_order_.contract_.name }}
</template> </template>
@ -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,266 +277,339 @@
<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 = {}; const defaultetestitem = {};
export default { export default {
components: { Pagination, customForm }, 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,
},
wproductList1: {
count: 0,
},
wproductList2: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
listQuery1: {
page: 1,
page_size: 20,
},
listQuery2: {
page: 1,
page_size: 20,
},
actstate_: {
6: "待复检",
10: "生产中",
20: "待检验",
30: "已合格",
40: "库存中",
50: "不合格",
60: "待成品检验",
},
checkTypes: {
10: "子工序检验",
20: "工序检验",
30: "工序复检",
36: "夹层检验",
40: "成品检验",
},
choice: [
{
value: true,
label: "合格",
}, },
{ wproductList1: {
value: false, count: 0,
label: "不合格",
}, },
], wproductList2: {
options: [], count: 0,
listLoading: true, },
wproduct: null, listQuery: {
recordId: null, page: 1,
fieldList: null, page_size: 20,
is_testok: "true", },
field: [], listQuery1: {
recordList: [], page: 1,
recordformList: [], page_size: 20,
recordform: null, },
fifo_detail: "", listQuery2: {
listQueryrecordform: { page: 1,
page: 0, page_size: 20,
}, },
hasPicture: false, actstate_: {
outerVisible: false, 6: "待复检",
innerVisible: false, 10: "生产中",
dialogFormVisible: false, 20: "待检验",
dialogFormVisibles: false, 30: "已合格",
limitedCheckRecord: false, 40: "库存中",
testrecord: {}, 50: "不合格",
formName: "检验表", 60: "待成品检验",
WarehouseData: "", },
checkTypes: {
}; 10: "子工序检验",
}, 20: "工序检验",
computed: {}, 30: "工序复检",
watch: {}, 36: "夹层检验",
created() { 40: "成品检验",
this.getList(); },
choice: [
{value: true, label: "合格"},
{value: false, label: "不合格"},
],
options: [],
listLoading: true,
wproduct: null,
recordId: null,
fieldList: null,
is_testok: "true",
field: [],
recordList: [],
recordformList: [],
recordform: null,
fifo_detail: "",
listQueryrecordform: {
page: 0,
},
hasPicture: false,
outerVisible: false,
innerVisible: false,
dialogFormVisible: false,
dialogFormVisibles: false,
limitedCheckRecord: false,
testrecord: {},
formName: "检验表",
WarehouseData: "",
this.getList1(); };
// this.getLists();
},
methods: {
checkPermission,
//待检成品列表
getList() {
this.listLoading = true;
this.listQuery.act_state = 60;
this.listQuery.material__type = 1;
getwproductList(this.listQuery).then((response) => {
if (response.data) {
this.wproductList = response.data;
}
this.listLoading = false;
});
}, },
computed: {},
watch: {},
created() {
this.getList();
//已合格成品 this.getList1();
getList1() { // this.getLists();
this.listQuery1.act_state = 30;
this.listQuery1.material__type = 1;
getwproductList(this.listQuery1).then((response) => {
if (response.data) {
this.wproductList1 = response.data;
}
});
}, },
methods: {
//成品批量入库 checkPermission,
handleCreate() { //待检成品列表
this.dialogFormVisibles = true; getList() {
this.getWarehouseLists(); //仓库 this.listLoading = true;
}, this.listQuery.act_state = 60;
//批量入库 this.listQuery.material__type = 1;
putins() { getwproductList(this.listQuery).then((response) => {
let _this = this; if (response.data) {
_this.mutipID = []; this.wproductList = response.data;
this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID.push(item.id);
});
console.log(_this.mutipID);
createputins({
warehouse: this.form.warehouse,
wproducts: _this.mutipID,
remark: this.form.remark,
}).then((res) => {
if (res.code >= 200) {
this.$message.success("批量入库成功!");
this.dialogFormVisibles = false;
this.getList1();
}
});
},
//仓库列表
getWarehouseLists() {
getWarehouseList({ page: 0 }).then((response) => {
if (response.data) {
this.WarehouseData = response.data;
}
});
},
//提交检查项目
submitfield() {
let _this = this;
_this.field = []; //检查项目
this.fieldList.forEach((item) => {
_this.field.push({
form_field: item.id,
field_value: item.sort,
is_testok: item.is_testok, //单项检查结果
});
});
console.log(this.recordform);
this.testrecord.form = this.recordform; //检查表
this.testrecord.record_data = _this.field; //检查项列表
this.testrecord.is_testok = this.is_testok; //检查表检查结果
this.testrecord.wproduct = this.wproduct; //半成品ID
wproductTest(this.testrecord).then((res) => {
if (res.code >= 200) {
this.innerVisible = false;
this.outerVisible = false;
this.getList();
this.getList1();
}
});
},
//半成品入库
handlePutin(scope) {
this.dialogFormVisible = true;
this.getWarehouseLists(); //仓库
this.id = scope.row.id; //半成品id
},
putin() {
wproductPutin(this.id, this.form).then((res) => {
if (res.code >= 200) {
this.$message.success("入库成功!");
this.dialogFormVisible = false;
this.getList1();
}
});
},
//点击table中的检验
handleInspection(scope) {
let that = this;
//调该物料对应的检查表
this.wproduct = scope.row.id; //成品ID
this.listQueryrecordform.material = scope.row.material; //
this.listQueryrecordform.type = 40;
this.recordform = null;
getrecordformList(this.listQueryrecordform).then((response) => {
if (response.data) {
this.recordformList = response.data;
if (response.data.length === 1) {
that.recordform = response.data[0].id;
that.formName = response.data[0].name;
that.submitrecordform();
} else {
//弹出列表选择框
this.outerVisible = true;
} }
} this.listLoading = false;
}); });
}, },
//根据选择的表渲染检查项目
submitrecordform() { //已合格成品
let that = this; getList1() {
if (this.recordform != "") { this.listQuery1.act_state = 30;
testInit({ wproduct: that.wproduct, form: that.recordform }).then( this.listQuery1.material__type = 1;
getwproductList(this.listQuery1).then((response) => {
if (response.data) {
this.wproductList1 = response.data;
}
});
},
//成品批量入库
handleCreate() {
this.dialogFormVisibles = true;
this.getWarehouseLists(); //仓库
},
//批量入库
putins() {
let _this = this;
_this.mutipID = [];
this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID.push(item.id);
});
createputins({
warehouse: this.form.warehouse,
wproducts: _this.mutipID,
remark: this.form.remark,
}).then((res) => {
if (res.code >= 200) {
this.$message.success("批量入库成功!");
this.dialogFormVisibles = false;
this.getList1();
}
});
},
//仓库列表
getWarehouseLists() {
getWarehouseList({page: 0}).then((response) => {
if (response.data) {
this.WarehouseData = response.data;
}
});
},
//提交检查项目
submitfield() {
let _this = this;
_this.field = []; //检查项目
this.fieldList.forEach((item) => {
_this.field.push({
form_field: item.id,
field_value: item.sort,
is_testok: item.is_testok, //单项检查结果
});
});
this.testrecord.form = this.recordform; //检查表
this.testrecord.record_data = _this.field; //检查项列表
this.testrecord.is_testok = this.is_testok; //检查表检查结果
this.testrecord.wproduct = this.wproduct; //半成品ID
wproductTest(this.testrecord).then((res) => {
if (res.code >= 200) {
this.innerVisible = false;
this.outerVisible = false;
this.getList();
this.getList1();
}
});
},
//半成品入库
handlePutin(scope) {
this.dialogFormVisible = true;
this.getWarehouseLists(); //仓库
this.id = scope.row.id; //半成品id
},
putin() {
wproductPutin(this.id, this.form).then((res) => {
if (res.code >= 200) {
this.$message.success("入库成功!");
this.dialogFormVisible = false;
this.getList1();
}
});
},
//点击table中的检验
handleInspection(scope) {
let that = this;
//调该物料对应的检查表
this.wproduct = scope.row.id; //成品ID
this.listQueryrecordform.material = scope.row.material; //
this.listQueryrecordform.type = 40;
this.recordform = null;
getrecordformList(this.listQueryrecordform).then((response) => {
if (response.data) {
this.recordformList = response.data;
if (response.data.length === 1) {
that.recordform = response.data[0].id;
that.formName = response.data[0].name;
that.submitrecordform();
} else {
//弹出列表选择框
this.outerVisible = true;
}
}
});
},
//根据选择的表渲染检查项目
submitrecordform() {
let that = this;
if (this.recordform != "") {
testInit({wproduct: that.wproduct, form: that.recordform}).then(
(response) => {
if (response.data) {
that.hasPicture = false;
that.recordId = response.data.id;
getTestRecordItem(response.data.id).then((res) => {
that.formName = res.data.form_.name;
let fieldList = res.data.record_data;
that.fieldList = [...fieldList];
let arr = fieldList.filter((item) => {
return item.field_type === "draw";
});
if (arr.length > 0) {
that.hasPicture = true;
}
that.$nextTick(() => {
that.innerVisible = true;
});
});
}
}
);
} else this.$message.error("请选择检查表!");
},
//选择物料检查表
recordformChange() {
let that = this;
let arr = this.recordformList.filter((item) => {
return item.id === that.recordform;
});
that.formName = arr[0].name;
},
//更新检验记录列表
refreshRecord() {
let that = this;
getTestRecord({wproduct: that.wproduct, page: 0}).then((res) => {
if (res.code == 200) {
that.recordList = res.data;
} else {
this.$message.error(res.msg);
}
});
},
//检验记录
checkRecord(scope) {
let that = this;
that.wproduct = scope.row.id; //半成品ID
that.limitedCheckRecord = true;
getTestRecord({wproduct: scope.row.id, page: 0}).then((res) => {
if (res.code == 200) {
that.recordList = res.data;
} else {
this.$message.error(res.msg);
}
});
},
//点击记录里的检验
handleInspectionRecord(scope) {
let that = this;
that.innerVisible = false;
that.recordId = scope.row.id;
that.recordform = scope.row.form;
that.formName = scope.row.form_.name;
getrffieldList({form: this.recordform, page: 1, page_size: 100}).then(
(response) => { (response) => {
if (response.data) { if (response.data) {
that.hasPicture = false; that.hasPicture = false;
that.recordId = response.data.id; let fieldList = response.data.results;
getTestRecordItem(response.data.id).then((res) => { that.fieldList = [...fieldList];
that.formName = res.data.form_.name; let arr = fieldList.filter((item) => {
return item.field_type === "draw";
});
if (arr.length > 0) {
that.hasPicture = true;
}
getTestRecordItem(scope.row.id).then((res) => {
let arr = [];
let fieldList = res.data.record_data; let fieldList = res.data.record_data;
that.fieldList = [...fieldList]; for (let i = 0; i < that.fieldList.length; i++) {
let arr = fieldList.filter((item) => { let obj = that.fieldList[i];
return item.field_type === "draw"; obj.is_testok = null;
}); for (let j = 0; j < fieldList.length; j++) {
if (arr.length > 0) { if (that.fieldList[i].field_key === fieldList[j].field_key) {
that.hasPicture = true; obj.id = parseInt(fieldList[j].id);
obj.is_testok = fieldList[j].is_testok;
obj.field_value = fieldList[j].field_value;
}
}
arr.push(obj);
} }
that.fieldList = arr;
that.$nextTick(() => { that.$nextTick(() => {
that.innerVisible = true; that.innerVisible = true;
}); });
@ -537,162 +617,90 @@ export default {
} }
} }
); );
} else this.$message.error("请选择检查表!"); },
},
//选择物料检查表 delTestRecord(scope) {
recordformChange() { let that = this;
let that = this; this.$confirm("确认删除?", "警告", {
let arr = this.recordformList.filter((item) => { confirmButtonText: "确认",
return item.id === that.recordform; cancelButtonText: "取消",
}); type: "error",
that.formName = arr[0].name; })
}, .then(async () => {
//更新检验记录列表 await delTestRecordItem(scope.row.id).then((res) => {
refreshRecord() { if (res.code >= 200) {
let that = this; that.$message.success("成功");
getTestRecord({ wproduct: that.wproduct, page: 0 }).then((res) => { that.refreshRecord();
if (res.code == 200) { this.getList();
that.recordList = res.data; this.getList1();
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
}
});
},
//检验记录
checkRecord(scope) {
let that = this;
that.wproduct = scope.row.id; //半成品ID
that.limitedCheckRecord = true;
getTestRecord({ wproduct: scope.row.id, page: 0 }).then((res) => {
if (res.code == 200) {
that.recordList = res.data;
} else {
this.$message.error(res.msg);
}
});
},
//点击记录里的检验
handleInspectionRecord(scope) {
let that = this;
that.innerVisible = false;
that.recordId = scope.row.id;
that.recordform = scope.row.form;
that.formName = scope.row.form_.name;
getrffieldList({ form: this.recordform, page: 1, page_size: 100 }).then(
(response) => {
if (response.data) {
that.hasPicture = false;
let fieldList = response.data.results;
that.fieldList = [...fieldList];
let arr = fieldList.filter((item) => {
return item.field_type === "draw";
});
if (arr.length > 0) {
that.hasPicture = true;
}
getTestRecordItem(scope.row.id).then((res) => {
let arr = [];
let fieldList = res.data.record_data;
for (let i = 0; i < that.fieldList.length; i++) {
let obj = that.fieldList[i];
obj.is_testok = null;
for (let j = 0; j < fieldList.length; j++) {
if (that.fieldList[i].field_key === fieldList[j].field_key) {
obj.id = parseInt(fieldList[j].id);
obj.is_testok = fieldList[j].is_testok;
obj.field_value = fieldList[j].field_value;
}
}
arr.push(obj);
} }
that.fieldList = arr;
that.$nextTick(() => {
that.innerVisible = true;
});
}); });
} })
} .catch((err) => {
); this.$message.error(err);
}, });
delTestRecord(scope) { },
let that = this;
this.$confirm("确认删除?", "警告", { //保存检查项目
confirmButtonText: "确认", recordSave(value) {
cancelButtonText: "取消", let that = this;
type: "error", let id = value.id;
}) let params = {};
.then(async () => { params.record_data = value.record_data;
await delTestRecordItem(scope.row.id).then((res) => { params.is_testok = value.is_testok;
putTestRecordItem(id, params)
.then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
that.$message.success("成功"); that.innerVisible = false;
that.limitedReview = false;
that.getList();
that.getList1();
that.refreshRecord(); that.refreshRecord();
this.getList();
this.getList1();
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
})
.catch((err) => {
this.$message.error(err);
}); });
}) },
.catch((err) => {
console.error(err); //记录提交检查项目
}); recordSubmit(value) {
let that = this;
let id = value.id;
let params = {};
params.record_data = value.record_data;
params.is_testok = value.is_testok;
putTestRecordItem(id, params)
.then((res) => {
if (res.code >= 200) {
subTestRecordItem(id, params).then((res) => {
if (res.code >= 200) {
that.innerVisible = false;
that.limitedReview = false;
that.limitedCheckRecord = false;
this.getList();
this.getList1();
that.refreshRecord();
}
});
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
},
//第一次保存提交检查项目
recordCancel() {
this.outerVisible = false;
this.innerVisible = false;
},
}, },
//保存检查项目 };
recordSave(value) {
let that = this;
let id = value.id;
let params = {};
params.record_data = value.record_data;
params.is_testok = value.is_testok;
putTestRecordItem(id, params)
.then((res) => {
if (res.code >= 200) {
that.innerVisible = false;
that.limitedReview = false;
that.getList();
that.getList1();
that.refreshRecord();
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
console.error(err);
});
},
//记录提交检查项目
recordSubmit(value) {
let that = this;
let id = value.id;
let params = {};
params.record_data = value.record_data;
params.is_testok = value.is_testok;
putTestRecordItem(id, params)
.then((res) => {
if (res.code >= 200) {
subTestRecordItem(id, params).then((res) => {
if (res.code >= 200) {
that.innerVisible = false;
that.limitedReview = false;
that.limitedCheckRecord = false;
this.getList();
this.getList1();
that.refreshRecord();
}
});
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
console.error(err);
});
},
//第一次保存提交检查项目
recordCancel() {
this.outerVisible = 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