受控文件

master
zhaoxiaolin 9 months ago
parent 381933cc25
commit 548c8932d9

@ -42,3 +42,46 @@ export function delCheckType(id) {
method: 'delete'
});
}
/**查询检验节点受控文件列表**/
// 查询受控文件列表
export function listFile(query) {
return request({
url: '/quality/checkTypeFile/list',
method: 'get',
params: query
});
}
// 查询检验节点维护详细
export function getFile(id) {
return request({
url: '/quality/checkTypeFile/' + id,
method: 'get'
});
}
// 新增检验节点维护
export function addFile(data) {
return request({
url: '/quality/checkTypeFile',
method: 'post',
data: data
});
}
// 修改检验节点维护
export function updateFile(data) {
return request({
url: '/quality/checkTypeFile',
method: 'put',
data: data
});
}
// 删除检验节点维护
export function delFile(id) {
return request({
url: '/quality/checkTypeFile/' + id,
method: 'delete'
});
}

@ -313,14 +313,14 @@ export default {
setInterval(() => this.getAlarmData(), 1000 * 60);
this.poolNameList = JSON.parse(localStorage.getItem("POOL_NAME_LIST"));
this.poolName = localStorage.getItem("USER_POOL_NAME_CURRENT");
/**
//
this.getUnReadList();
//
this.timer = setInterval(() => {
setTimeout(this.getUnReadList(), 30000);
}, 30000);
**/
},
components: {

@ -0,0 +1,277 @@
<template>
<el-dialog title="受控文件管理"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1000px"
>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="文件编号" prop="fileNo">
<el-input
v-model="queryParams.fileNo"
placeholder="请输入文件编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备注" prop="bz">
<el-input
v-model="queryParams.bz"
placeholder="请输入备注"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"></el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="fileList" ref="myTable" >
<el-table-column label="序号" align="center" type="index" width="50" />
<el-table-column label="检验节点" align="center" prop="checkName" width="220"/>
<el-table-column label="受控文件编号" align="center" prop="fileNo" width="220"/>
<el-table-column label="有效开始时间" align="center" prop="startTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="有效结束时间" align="center" prop="endTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"></el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
<!-- 添加或修改检验节点维护对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="有效期开始" prop="startTime">
<el-date-picker clearable style="width: 320px"
v-model="form.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效期开始">
</el-date-picker>
</el-form-item>
<el-form-item label="有效期结束" prop="endTime">
<el-date-picker clearable style="width: 320px"
v-model="form.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效期结束">
</el-date-picker>
</el-form-item>
<el-form-item label="受控文件编号" prop="fileNo">
<el-input v-model="form.fileNo" placeholder="请输入文件编号" style="width: 320px"/>
</el-form-item>
<el-form-item label="描述" prop="remark">
<el-input v-model="form.remark" placeholder="请输入描述" style="width: 320px"/>
</el-form-item>
<el-form-item label="备注" prop="bz">
<el-input v-model="form.bz" placeholder="请输入备注" style="width: 320px"/>
</el-form-item>
<el-form-item label="版本" prop="fileVersion">
<el-input v-model="form.fileVersion" placeholder="请输入版本" style="width: 320px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</el-dialog>
</template>
<script>
import {listFile, getFile,delFile,addFile,updateFile} from "@/api/quality/checkType";
export default {
name: "itemConfFile",
dicts: ["order_type_ll"],
components: { },
data() {
return {
open: false,
showFlag:false,
//
selectedRows: {},
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// BOM
fileList: null,
deptOptions: undefined,
//
checkType: null,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
checkType: this.checkType,
},
//
rules: {
fileNo: [{ required: true, message: "受控文件编码不能为空", trigger: "blur" }],
startTime: [{ required: true, message: "有效起始时间不能为空", trigger: "blur" }],
endTime: [{ required: true, message: "有效结束时间不能为空", trigger: "blur" }]
},
form:{checkType:this.checkType}
};
},
created() {
this.getList();
},
methods: {
initFunc(checkType){
this.checkType = checkType;
this.queryParams.checkType = checkType;
},
/** 查询表格列表*/
getList() {
this.loading = true;
listFile(this.queryParams).then(response => {
this.fileList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
//
reset() {
this.form = {
id: null,
//checkType: null,
startTime: null,
endTime: null,
fileNo: null,
attr1: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null,
delFlag: null,
remark: null,
bz: null,
fileVersion: null
}
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
cancel() {
this.showFlag = false;
this.fileList = [];
},
//
handleBomSelectionChange(selection) {
this.selectedRows = selection;
},
submitBomForm() {
this.$emit('onSelected', this.selectedRows);
this.fileList = [];
this.showFlag = false;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加检验节点受控文件";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getFile(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改检验节点维护";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.checkType = this.checkType;
if (this.form.id != null) {
updateFile(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addFile(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id;
this.$modal.confirm('是否确认删除数据?').then(function() {
return delFile(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
}
};
</script>
<style scoped>
.labelClassName {
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>

@ -95,13 +95,13 @@
icon="el-icon-connection"
@click="handleBind(scope.row)"
>分配检验员</el-button>
<!--
<el-button
size="mini"
type="text"
icon="el-icon-connection"
icon="el-icon-collection"
@click="handleFile(scope.row)"
>受控文件</el-button>-->
>受控文件</el-button>
</template>
</el-table-column>
</el-table>
@ -185,12 +185,10 @@
<el-button type="primary" @click="handleClose" > </el-button>
</div>
</el-dialog>
<!--人员选择弹窗-->
<ItemSelectUser
ref="itemSelectUser"
@onSelected="onSelectUser"
:materialCode="materialCode"
></ItemSelectUser>
<!--人员选择弹窗-->
<ItemSelectUser ref="itemSelectUser" @onSelected="onSelectUser" :materialCode="materialCode"></ItemSelectUser>
<!--受控文件弹窗-->
<ItemConfFile ref="itemConfFile" :checkType="checkType"></ItemConfFile>
</div>
</template>
@ -198,17 +196,16 @@
import { listCheckType, getCheckType, delCheckType, addCheckType, updateCheckType } from "@/api/quality/checkType";
import{ getSelectedUsers, addUserBind, deleteByMaterialCode} from "@/api/quality/userbind";
import ItemSelectUser from "./selectUser.vue";
import ItemConfFile from "./confFile.vue";
export default {
name: "CheckType",
dicts: ["check_type","order_type_ll"],
components: {
ItemSelectUser
},
components: {ItemSelectUser,ItemConfFile},
data() {
return {
//
loading: true,
userloading: true,
userloading: true,
//
ids: [],
//
@ -414,48 +411,55 @@ export default {
},
//
onSelectUser(obj) {
let data = {
materialCode: this.materialCode,
materialName: this.materialName,
attr1List: [],
userCodes: [],
userNames: [],
}
let data = {
materialCode: this.materialCode,
materialName: this.materialName,
attr1List: [],
userCodes: [],
userNames: [],
}
obj.forEach((item, index) => {
data.userCodes.push(item.userCode);
data.userNames.push(item.userName);
data.attr1List.push(item.attr1);
});
addUserBind(data).then(response => {
if(response.code === 200) {
this.$modal.msgSuccess("人员绑定成功");
}else{
this.$modal.msgError(response.msg);
}
this.getSelectUserList();
});
data.userCodes.push(item.userCode);
data.userNames.push(item.userName);
data.attr1List.push(item.attr1);
});
addUserBind(data).then(response => {
if(response.code === 200) {
this.$modal.msgSuccess("人员绑定成功");
}else{
this.$modal.msgError(response.msg);
}
this.getSelectUserList();
});
},
deleteUser(row) {
deleteUser(row) {
const userCode = row.userCode;
const userName = row.userName;
const data = {
materialCode: this.materialCode,
userCode: userCode,
userName: userName,
}
const userName = row.userName;
const data = {
materialCode: this.materialCode,
userCode: userCode,
userName: userName,
}
this.$modal.confirm('是否确认删除用户名为"' + userName + '"的数据项?').then(function() {
return deleteByMaterialCode(data);
}).then(response => {
if(response.code === 200) {
this.$modal.msgSuccess("删除成功");
}else{
this.$modal.msgError(response.msg);
}
if(response.code === 200) {
this.$modal.msgSuccess("删除成功");
}else{
this.$modal.msgError(response.msg);
}
this.getSelectUserList();
}).catch(() => {});
},
//
handleFile(row) {
this.checkType = row.orderCode;
this.$refs.itemConfFile.initFunc(this.checkType);
this.$refs.itemConfFile.showFlag = true;
this.$refs.itemConfFile.getList();
},
}
};
</script>

@ -208,8 +208,12 @@
</el-row>
<el-row>
<el-col :span="8">
<!--
<el-form-item label="抽检数量" prop="sampleQuality">
<el-input v-model="form.sampleQuality" disabled />
</el-form-item>-->
<el-form-item label="检验依据" prop="standardNo">
<el-input v-model="form.standardNo" disabled />
</el-form-item>
</el-col>

@ -167,6 +167,9 @@
<el-col :offset="8" :span="8" class="center-text">
<span style="font-size: 18px;padding: 6px;">产品巡检记录表</span>
</el-col>
<el-col :offset="4" :span="4" class="center-text">
<span style="font-size: 14px;padding: 6px;">检验依据{{form.standardNo}}</span>
</el-col>
</el-row>
<!-- 导航栏 -->
<el-row class="my-print-nav" gutter="10">
@ -581,9 +584,12 @@
</el-row>
<el-row>
<el-col :offset="16" :span="8">
<el-form-item label="检验标准" :prop="this.standardNo">
<span>{{ this.standardNo }}</span>
<el-form-item label="检验标准" prop="standardNo">
<span>{{ form.standardNo }}</span>
</el-form-item>
<!--<el-form-item label="检验标准" :prop="this.standardNo">
<span>{{ this.standardNo }}</span>
</el-form-item>-->
</el-col>
</el-row>
<el-row>
@ -1049,7 +1055,7 @@ export default {
this.checkProjectList = response.rows;
this.total = response.total;
this.loading = false;
this.standardNo = this.checkProjectList[0].standardNo;
//this.standardNo = this.checkProjectList[0].standardNo;
this.rowspan()
});
},

@ -20,6 +20,22 @@
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="物料号" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
placeholder="请输入物料号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>

Loading…
Cancel
Save