You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
716 lines
23 KiB
716 lines
23 KiB
<template> |
|
<basic-container> |
|
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud" |
|
@row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" |
|
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
|
@refresh-change="refreshChange" @on-load="onLoad"> |
|
<template #menu-left> |
|
<el-button type="primary" @click="handleConfig">提醒配置</el-button> |
|
</template> |
|
|
|
<template #menu-right="{ size }"> |
|
|
|
</template> |
|
<template #menu="scope"> |
|
<el-button type="primary" link @click="setCrew(scope.row.bcId)">设置人员</el-button> |
|
</template> |
|
<template #bsWorkType.wtName="scope"> |
|
<span> |
|
{{ scope.row.bsWorkType ? scope.row.bsWorkType.wtName : '-' }} |
|
</span> |
|
</template> |
|
<template #name="{ row }"> |
|
<i :class="row.source" style="margin-right: 5px" /> |
|
<span>{{ row.name }}</span> |
|
</template> |
|
<template #source="{ row }"> |
|
<div style="text-align: center"> |
|
<i :class="row.source" /> |
|
</div> |
|
</template> |
|
</avue-crud> |
|
<!-- 设置人员弹框 --> |
|
<setPersonnel :id="bcId" :set-crew-open="setCrewOpen" v-if="setCrewOpen" type="platingAssort" |
|
@setCrewOpeSancel="setCrewOpeSancel" /> |
|
|
|
<!-- 提醒配置 --> |
|
<reminder-configuration v-if="isConfigOpen" :showDialog="isConfigOpen" @closeDialog="setCrewOpeSancel"></reminder-configuration> |
|
<!-- <alertConfigDialog v-if="isConfigOpen" :showDialog="isConfigOpen" @closeDialog="setCrewOpeSancel"></alertConfigDialog> --> |
|
</basic-container> |
|
</template> |
|
<script> |
|
|
|
import { getLazyList, remove, update, add, getMenu } from '@/api/system/menu'; |
|
|
|
import { mapGetters } from 'vuex'; |
|
import {getRecorderList} from "@/api/equiptManagement/measurementRecords" |
|
|
|
import setPersonnel from "@/components/dialogCom/setPersonnel.vue" |
|
import alertConfigDialog from './alertConfigDialog.vue' |
|
import reminderConfiguration from './reminderConfiguration.vue' |
|
export default { |
|
components: { |
|
setPersonnel, |
|
alertConfigDialog, |
|
reminderConfiguration |
|
}, |
|
data() { |
|
return { |
|
bcId: null, |
|
setCrewOpen: false, |
|
form: {}, |
|
query: {}, |
|
loading: true, |
|
selectionList: [], |
|
parentId: '', |
|
page: { |
|
pageSize: 10, |
|
currentPage: 1, |
|
total: 0, |
|
}, |
|
option: { |
|
columnSort: true, |
|
tip: false, |
|
height: 'auto', |
|
calcHeight: 32, |
|
simplePage: false, |
|
searchShow: true, |
|
searchMenuSpan: 6, |
|
dialogWidth: '60%', |
|
border: true, |
|
selection: false, |
|
viewBtn: true, |
|
menuWidth: 240, |
|
dialogClickModal: false, |
|
excelBtn: true, |
|
viewBtn: false, |
|
addBtn: false, |
|
editBtnText: '编辑', |
|
refreshBtn: false, |
|
searchShowBtn: false, |
|
gridBtn: false, |
|
searchIndex: 3, |
|
searchIcon: true, |
|
menu: false, |
|
searchLabelPosition: 'left', |
|
searchLabelPosition: 'left', |
|
searchGutter: 24, |
|
searchSpan: 6, |
|
menuAlign: 'left', |
|
gridBtn: false, |
|
searchMenuPosition: 'right', |
|
addBtnIcon: ' ', |
|
viewBtnIcon: ' ', |
|
delBtnIcon: ' ', |
|
editBtnIcon: ' ', |
|
align: 'center', |
|
|
|
column: [ |
|
{ |
|
label: '编号', |
|
prop: 'mcCode', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '类别', |
|
prop: 'mcClass', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '名称', |
|
prop: 'mcName', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
// { |
|
// label: '计量类型', |
|
// prop: 'labelNo', |
|
// sortable: true, |
|
// overHidden: true, |
|
// width: 120, |
|
// }, |
|
{ |
|
label: '型号', |
|
prop: 'mcType', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '使用单位', |
|
prop: 'useUnit', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '到期日期', |
|
prop: 'dueDate', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '检定周期', |
|
prop: 'testCycle', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '检定部门', |
|
prop: 'testDept', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '规格', |
|
prop: 'norms', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '精度', |
|
prop: 'accuracy', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '生产厂家', |
|
prop: 'mcOem', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '启用日期', |
|
prop: 'enableDate', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '出厂编号', |
|
prop: 'oemCode', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '是否送检', |
|
prop: 'censorship', |
|
type: 'select', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
dicData:[ |
|
{label:"是",value:1}, |
|
{label:"否",value:0}, |
|
] |
|
}, |
|
{ |
|
label: '检验结果', |
|
prop: 'checkResult', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
{ |
|
label: '用途分类', |
|
prop: 'purposeClass', |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
}, |
|
// { |
|
// label: '检验结果', |
|
// prop: 'testMethod', |
|
// sortable: true, |
|
// overHidden: true, |
|
// width: 120, |
|
// }, |
|
|
|
], |
|
}, |
|
data: [], |
|
isConfigOpen:false, |
|
|
|
|
|
} |
|
}, |
|
computed: { |
|
...mapGetters(['userInfo', 'permission']), |
|
permissionList() { |
|
return { |
|
addBtn: this.validData(this.permission.menu_add, false), |
|
viewBtn: this.validData(this.permission.menu_view, false), |
|
delBtn: this.validData(this.permission.menu_delete, false), |
|
editBtn: this.validData(this.permission.menu_edit, false), |
|
}; |
|
}, |
|
ids() { |
|
let ids = []; |
|
this.selectionList.forEach(ele => { |
|
ids.push(ele.id); |
|
}); |
|
return ids.join(','); |
|
}, |
|
}, |
|
methods: { |
|
// 提醒维护 |
|
handleConfig(){ |
|
this.isConfigOpen = true |
|
}, |
|
// 设置班组人员 |
|
setCrew(bcId) { |
|
console.log(9999, bcId) |
|
this.bcId = bcId; |
|
this.setCrewOpen = true; |
|
}, |
|
// 设置班组人员弹框关闭 |
|
setCrewOpeSancel(isRefresh) { |
|
if (isRefresh) { |
|
this.$refs.myTable.load(); |
|
} |
|
this.setCrewOpen = false; |
|
this.isConfigOpen = false |
|
}, |
|
initData() { |
|
// getMenuTree().then(res => { |
|
// const column = this.findObject(this.option.column, 'parentId'); |
|
// column.dicData = res.data.data; |
|
// }); |
|
}, |
|
handleAdd(row) { |
|
this.parentId = row.id; |
|
const column = this.findObject(this.option.column, 'parentId'); |
|
column.value = row.id; |
|
column.addDisabled = true; |
|
this.$refs.crud.rowAdd(); |
|
}, |
|
// 保存 |
|
rowSave(row, done, loading) { |
|
// add(row).then( |
|
// res => { |
|
// // 获取新增数据的相关字段 |
|
// const data = res.data.data; |
|
// row.id = data.id; |
|
// this.$message({ |
|
// type: 'success', |
|
// message: '操作成功!', |
|
// }); |
|
// // 数据回调进行刷新 |
|
// done(row); |
|
// }, |
|
// error => { |
|
// window.console.log(error); |
|
// loading(); |
|
// } |
|
// ); |
|
}, |
|
// 修改 |
|
rowUpdate(row, index, done, loading) { |
|
// update(row).then( |
|
// () => { |
|
// this.$message({ |
|
// type: 'success', |
|
// message: '操作成功!', |
|
// }); |
|
// // 数据回调进行刷新 |
|
// done(row); |
|
// }, |
|
// error => { |
|
// window.console.log(error); |
|
// loading(); |
|
// } |
|
// ); |
|
}, |
|
rowDel(row, index, done) { |
|
this.$confirm('确定将选择数据删除?', { |
|
confirmButtonText: '确定', |
|
cancelButtonText: '取消', |
|
type: 'warning', |
|
}) |
|
.then(() => { |
|
return remove(row.id); |
|
}) |
|
.then(() => { |
|
this.$message({ |
|
type: 'success', |
|
message: '操作成功!', |
|
}); |
|
// 数据回调进行刷新 |
|
done(row); |
|
}); |
|
}, |
|
// 重置 |
|
searchReset() { |
|
this.query = {}; |
|
this.parentId = 0; |
|
this.onLoad(this.page); |
|
}, |
|
// 搜索 |
|
searchChange(params, done) { |
|
this.query = params; |
|
this.parentId = ''; |
|
this.page.currentPage = 1; |
|
this.onLoad(this.page, params); |
|
done(); |
|
}, |
|
// 选中表格数据 |
|
selectionChange(list) { |
|
this.selectionList = list; |
|
}, |
|
// |
|
selectionClear() { |
|
this.selectionList = []; |
|
this.$refs.crud.toggleSelection(); |
|
}, |
|
// 打开弹框 前操作 打开表单前会执行beforeOpen方法 |
|
beforeOpen(done, type) { |
|
if (['add', 'edit'].includes(type)) { |
|
this.initData(); |
|
} |
|
if (['edit', 'view'].includes(type)) { |
|
getMenu(this.form.id).then(res => { |
|
this.form = Object.assign(res.data.data, { |
|
hasChildren: this.form.hasChildren, |
|
}); |
|
if (this.form.parentId === '0') { |
|
this.form.parentId = ''; |
|
} |
|
}); |
|
} |
|
done(); |
|
}, |
|
// 关闭 弹框 关闭表单前会执行beforeClose方法, |
|
beforeClose(done) { |
|
this.parentId = ''; |
|
const column = this.findObject(this.option.column, 'parentId'); |
|
column.value = ''; |
|
column.addDisabled = false; |
|
done(); |
|
}, |
|
// 切换 页码 |
|
currentChange(currentPage) { |
|
this.page.currentPage = currentPage; |
|
}, |
|
// 切换页面 数量 |
|
sizeChange(pageSize) { |
|
this.page.pageSize = pageSize; |
|
}, |
|
|
|
refreshChange() { |
|
this.onLoad(this.page, this.query); |
|
}, |
|
// 加载页面数据 |
|
onLoad(page, params = {}) { |
|
this.loading = true; |
|
getRecorderList({ |
|
current:this.page.currentPage, |
|
size:this.page.pageSize, |
|
cmType:1, |
|
...this.query |
|
}).then(res =>{ |
|
this.data = res.data.data.records |
|
this.page.total = res.data.data.total |
|
this.loading = false |
|
|
|
// this.data = [ |
|
// { |
|
// "id": "", |
|
// "createUser": -1, |
|
// "createDept": -1, |
|
// "createTime": "", |
|
// "updateUser": -1, |
|
// "updateTime": "", |
|
// "status": -1, |
|
// "isDeleted": -1, |
|
// "mcName": "钢直尺", |
|
// "norms": "0-50cm", |
|
// "mcClass": "C", |
|
// "labelNo": "长度", |
|
// "str2": "钢直尺", |
|
// "mcCode": "LS321295", |
|
// "useUnit": "热表分厂", |
|
// "accuracy": "", |
|
// "oemCode": "", |
|
// "mcOem": "", |
|
// "enableDate": "", |
|
// "whenDccept": "", |
|
// "mcType": "", |
|
// "testCycle": 0, |
|
// "dueDate": "", |
|
// "date2": "", |
|
// "belong": "在用", |
|
// "whenBuy": "", |
|
// "testDept": "市计量所", |
|
// "testMethod": "JJG1钢直尺检定规程", |
|
// "str9": "", |
|
// "str10": "一次性检定合格", |
|
// "assetsNo": "", |
|
// "str6": "", |
|
// "purposeClass": "", |
|
// "isOverStr": "正常", |
|
// "cmType": -1, |
|
// "censorship": false, |
|
// "checkStatus": false, |
|
// "checkResult": false |
|
// }, |
|
// { |
|
// "id": "", |
|
// "createUser": -1, |
|
// "createDept": -1, |
|
// "createTime": "", |
|
// "updateUser": -1, |
|
// "updateTime": "", |
|
// "status": -1, |
|
// "isDeleted": -1, |
|
// "mcName": "钢直尺", |
|
// "norms": "0-30cm", |
|
// "mcClass": "C", |
|
// "labelNo": "长度", |
|
// "str2": "钢直尺", |
|
// "mcCode": "LS321294", |
|
// "useUnit": "热表分厂", |
|
// "accuracy": "", |
|
// "oemCode": "", |
|
// "mcOem": "", |
|
// "enableDate": "", |
|
// "whenDccept": "", |
|
// "mcType": "", |
|
// "testCycle": 0, |
|
// "dueDate": "", |
|
// "date2": "", |
|
// "belong": "在用", |
|
// "whenBuy": "", |
|
// "testDept": "市计量所", |
|
// "testMethod": "JJG1钢直尺检定规程", |
|
// "str9": "", |
|
// "str10": "一次性检定合格", |
|
// "assetsNo": "", |
|
// "str6": "", |
|
// "purposeClass": "", |
|
// "isOverStr": "正常", |
|
// "cmType": -1, |
|
// "censorship": false, |
|
// "checkStatus": false, |
|
// "checkResult": false |
|
// }, |
|
// { |
|
// "id": "", |
|
// "createUser": -1, |
|
// "createDept": -1, |
|
// "createTime": "", |
|
// "updateUser": -1, |
|
// "updateTime": "", |
|
// "status": -1, |
|
// "isDeleted": -1, |
|
// "mcName": "钢直尺", |
|
// "norms": "0-50cm", |
|
// "mcClass": "C", |
|
// "labelNo": "长度", |
|
// "str2": "钢直尺", |
|
// "mcCode": "LS321296", |
|
// "useUnit": "热表分厂", |
|
// "accuracy": "", |
|
// "oemCode": "", |
|
// "mcOem": "", |
|
// "enableDate": "", |
|
// "whenDccept": "", |
|
// "mcType": "", |
|
// "testCycle": 0, |
|
// "dueDate": "", |
|
// "date2": "", |
|
// "belong": "在用", |
|
// "whenBuy": "", |
|
// "testDept": "市计量所", |
|
// "testMethod": "", |
|
// "str9": "", |
|
// "str10": "一次性检定合格", |
|
// "assetsNo": "", |
|
// "str6": "", |
|
// "purposeClass": "", |
|
// "isOverStr": "正常", |
|
// "cmType": -1, |
|
// "censorship": false, |
|
// "checkStatus": false, |
|
// "checkResult": false |
|
// }, |
|
// { |
|
// "id": "", |
|
// "createUser": -1, |
|
// "createDept": -1, |
|
// "createTime": "", |
|
// "updateUser": -1, |
|
// "updateTime": "", |
|
// "status": -1, |
|
// "isDeleted": -1, |
|
// "mcName": "钢直尺", |
|
// "norms": "0-50cm", |
|
// "mcClass": "C", |
|
// "labelNo": "长度", |
|
// "str2": "钢直尺", |
|
// "mcCode": "LS321296", |
|
// "useUnit": "热表分厂", |
|
// "accuracy": "", |
|
// "oemCode": "", |
|
// "mcOem": "", |
|
// "enableDate": "", |
|
// "whenDccept": "", |
|
// "mcType": "", |
|
// "testCycle": 0, |
|
// "dueDate": "", |
|
// "date2": "", |
|
// "belong": "在用", |
|
// "whenBuy": "", |
|
// "testDept": "市计量所", |
|
// "testMethod": "", |
|
// "str9": "", |
|
// "str10": "一次性检定合格", |
|
// "assetsNo": "", |
|
// "str6": "", |
|
// "purposeClass": "", |
|
// "isOverStr": "正常", |
|
// "cmType": -1, |
|
// "censorship": false, |
|
// "checkStatus": false, |
|
// "checkResult": false |
|
// }, |
|
// { |
|
// "id": "", |
|
// "createUser": -1, |
|
// "createDept": -1, |
|
// "createTime": "", |
|
// "updateUser": -1, |
|
// "updateTime": "", |
|
// "status": -1, |
|
// "isDeleted": -1, |
|
// "mcName": "磁导率测试仪", |
|
// "norms": "MAGNETOSCOP1.070", |
|
// "mcClass": "B", |
|
// "labelNo": "电学", |
|
// "str2": "磁导率测试仪", |
|
// "mcCode": "YQ202512057", |
|
// "useUnit": "热表分厂", |
|
// "accuracy": "±5%", |
|
// "oemCode": "17175", |
|
// "mcOem": "FOERSTER", |
|
// "enableDate": "2025-11-28 00:00:00", |
|
// "whenDccept": "", |
|
// "mcType": "1.068/1.069", |
|
// "testCycle": 12, |
|
// "dueDate": "2026-11-27 00:00:00", |
|
// "date2": "", |
|
// "belong": "在用", |
|
// "whenBuy": "", |
|
// "testDept": "FOERSTER", |
|
// "testMethod": "厂家检测报告", |
|
// "str9": "", |
|
// "str10": "", |
|
// "assetsNo": "", |
|
// "str6": "", |
|
// "purposeClass": "", |
|
// "isOverStr": "正常", |
|
// "cmType": -1, |
|
// "censorship": false, |
|
// "checkStatus": false, |
|
// "checkResult": false |
|
// } |
|
// ] |
|
// this.page = this.data.length |
|
// this.loading = false |
|
|
|
}) |
|
|
|
// getLazyList(this.parentId, Object.assign(params, this.query)).then(res => { |
|
// // this.data = res.data.data; |
|
// this.data = [ |
|
// { |
|
// "bcId": 21, |
|
// "code": "A1", |
|
// "deleted": false, |
|
// "keyValue": 21, |
|
// "memo": "镀金", |
|
// "name": "A类", |
|
// "type": 5, |
|
// "updateTime": null |
|
// }, |
|
// { |
|
// "bcId": 22, |
|
// "code": "B类", |
|
// "deleted": false, |
|
// "keyValue": 22, |
|
// "memo": "镀银", |
|
// "name": "B类", |
|
// "type": 5, |
|
// "updateTime": null |
|
// }, |
|
// { |
|
// "bcId": 23, |
|
// "code": "C类", |
|
// "deleted": false, |
|
// "keyValue": 23, |
|
// "memo": "镀镍、锌镍、镀锡", |
|
// "name": "C类", |
|
// "type": 5, |
|
// "updateTime": null |
|
// }, |
|
// { |
|
// "bcId": 24, |
|
// "code": "D类", |
|
// "deleted": false, |
|
// "keyValue": 24, |
|
// "memo": "镀锌、镀镉、复合材料", |
|
// "name": "D类", |
|
// "type": 5, |
|
// "updateTime": null |
|
// }, |
|
// { |
|
// "bcId": 25, |
|
// "code": "E类", |
|
// "deleted": false, |
|
// "keyValue": 25, |
|
// "memo": "氧化、喷漆", |
|
// "name": "E类", |
|
// "type": 5, |
|
// "updateTime": null |
|
// }, |
|
// { |
|
// "bcId": 26, |
|
// "code": "F类", |
|
// "deleted": false, |
|
// "keyValue": 26, |
|
// "memo": "钝化、综合", |
|
// "name": "F类", |
|
// "type": 5, |
|
// "updateTime": null |
|
// }, |
|
// { |
|
// "bcId": 27, |
|
// "code": "G类", |
|
// "deleted": false, |
|
// "keyValue": 27, |
|
// "memo": "镀铬、杂项", |
|
// "name": "G类", |
|
// "type": 5, |
|
// "updateTime": null |
|
// } |
|
// ] |
|
// this.loading = false; |
|
// this.page.total = this.data.length |
|
// this.selectionClear(); |
|
// }); |
|
|
|
}, |
|
}, |
|
} |
|
</script> |