中航光电热表web
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.
 
 
 
 

394 lines
14 KiB

<template>
<div>
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud"
@row-del="rowDel" @row-save="rowSave" @row-update="rowUpdate" @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="batchMaintain()">批量维护
</el-button> -->
<el-button type="danger" @click="handleDelete">删除</el-button>
</template>
<template #menu-right>
<el-button type="primary" @click="handleImport">导入
</el-button>
</template>
<template #menu="scope">
<!-- <el-button type="text" @click="batchMaintain()">删除
</el-button> -->
</template>
</avue-crud>
<processDialog :showDialog="isOpen" v-if="isOpen" @closeDialog="closeDialog"></processDialog>
<!-- 导入 -->
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport"
templateUrl="/blade-desk/mesPlatingTypeRules/downloadExcelTemplate"
templateName="结算规则模板.xlsx"
importUrl="/blade-desk/mesPlatingTypeRules/importExcel"
@closeDialog="closeDialog"></basic-import>
</div>
</template>
<script>
import processDialog from './processDialog.vue'
import basicImport from '@/components/basic-import/main.vue'
import {getPlateList,addPlateData,updatePlateData,deletePlateData} from "@/api/outsourcingManagement/settlementRules"
export default {
components: {
processDialog,
basicImport
},
data() {
return {
isShowImport: false,
loading: false,
selectionList: [],
query:{},
option: {
height: 'auto',
calcHeight: 32,
tip: false,
// size: 'medium',
simplePage: true,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: true,
selection: true,
editBtn: true,
viewBtn: false,
delBtn: true,
addBtn: true,
editBtnText: '修改',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
viewBtnText: '详情',
labelWidth: 120,
menuWidth: 100,
dialogWidth: 640,
dialogClickModal: false,
searchEnter: true,
excelBtn: false,
filterBtn: true,
searchShowBtn: false,
columnSort: true,
excelBtn: true,
columnSort: true,
index: false,
showOverflowTooltip: true,
searchLabelPosition: 'left',
labelWidth: 120,
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
gridBtn: false,
searchMenuPosition: 'right',
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
align: 'center',
menuAlign:"center",
column: [
// {
// label: '镀种描述-报价单',
// prop: 'workCenterNames',
// sortable: true,
// filter: true,
// span: 24,
// search: false,
// labelWidth:130,
// rules: [
// {
// required: true,
// message: '请输入',
// trigger: 'blur'
// }
// ]
// },
{
label: '镀种-描述规则',
prop: 'quotationPlat',
sortable: true,
filter: true,
span: 24,
search: false,
labelWidth:120,
rules: [
{
required: true,
message: '请输入',
trigger: 'blur'
}
]
},
// {
// label: '镀种',
// prop: 'workCenterNames',
// sortable: true,
// filter: true,
// span: 24,
// search: true,
// hide: true,
// },
{
label: '镀种-订单',
prop: 'orderPlat',
sortable: true,
filter: true,
span: 24,
search: false,
type:'select',
clearable:true,
filterable: true,
dicUrl:"/api/blade-desk/BA/Plating/listForSelect",
props:{
label:"plating",
value:'plating'
},
rules: [
{
required: true,
message: '请选择',
trigger: 'blur'
}
]
},
{
label: '维护人',
prop: 'createTime',
sortable: true,
filter: true,
span: 24,
search: false,
display:false,
},
{
label: '维护时间',
prop: 'createUser',
sortable: true,
filter: true,
span: 24,
search: false,
display:false,
},
]
},
form: {
},
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
isOpen: false,
}
},
methods: {
// 点击导入按钮
handleImport() {
this.isShowImport = true
},
batchMaintain() {
this.isOpen = true
},
closeDialog(val) {
this.isOpen = false
this.isShowImport = false
if(val){
this.onLoad()
}
},
currentChange(currentPage){
this.page.currentPage = currentPage
},
sizeChange(pageSize){
this.page.pageSize = pageSize
},
refreshChange(){
this.onLoad()
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.error('请选择至少一条数据');
return;
}
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
deletePlateData({
ids:this.selectionList.map(item => item.id).join(',')
}).then(res =>{
if(res.data.code == 200){
this.$message.success('删除成功')
this.onLoad()
}
})
})
},
// 多选
selectionChange(list) {
this.selectionList = list;
},
rowSave(row, done, loading){
addPlateData(row).then(res =>{
if(res.data.code == 200){
this.$message.success('新增成功')
done()
this.onLoad()
}
})
},
rowUpdate(row, index, done, loading){
updatePlateData(row).then(res =>{
if(res.data.code == 200){
this.$message.success('修改成功')
done()
this.onLoad()
}
})
},
rowDel(row){
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
deletePlateData({ids:row.id}).then(res =>{
if(res.data.code == 200){
this.$message.success('删除成功')
this.onLoad()
}
})
})
},
onLoad() {
this.loading = true
getPlateList({
current:this.page.currentPage,
size:this.page.pageSize,
...this.query
}).then(res =>{
this.data = res.data.data.records
this.page.total = res.data.data.total
this.loading = false
})
// this.data = [
// {
// "bsTeamSet": null,
// "bsWorkCenter": {
// "area": 13000.0,
// "batchNo": null,
// "bigBatch": false,
// "bsJfCenter": {
// "createMan": {
// "userId": 1,
// "userName": "admin"
// },
// "createTime": "2024-12-09 00:00:00",
// "deleted": false,
// "jcCode": "RBZX",
// "jcId": 1,
// "jcName": "热表中心",
// "keyValue": 1,
// "updateTime": "2024-12-09 00:00:00"
// },
// "checkout": false,
// "craftAbility": "化学镀镍",
// "createMan": {
// "userId": 1,
// "userName": "admin"
// },
// "createTime": "2023-02-06 12:31:36",
// "deleted": false,
// "describe": null,
// "endPoint": null,
// "keyValue": 81,
// "leaderUser": {
// "userId": 541,
// "userName": "崔殿龙"
// },
// "limitType": 0,
// "processes": "上挂、下挂、交检、化学镀镍、喷砂",
// "quantity": null,
// "roundCycle": null,
// "saturation": 85.0,
// "sign": "4",
// "startPoint": null,
// "team": "化学镀镍一班崔胜伟、化学镀镍一班郭家梁",
// "updateTime": "2023-03-06 18:42:47",
// "wcCode": "001",
// "wcId": 81,
// "wcName": "化学镀镍作业中心",
// "whetherPlate": false
// },
// "createMan": {
// "userId": 1,
// "userName": "admin"
// },
// "createTime": "2025-04-09 11:27:09",
// "deEquipmentCard": {
// "bindQty": 4,
// "categorys": "产线设备",
// "deviceCode": "9652247",
// "deviceIp": "192.168.43.179",
// "deviceName": "化学镀镍",
// "docking": true,
// "ecId": 1,
// "keyValue": 1,
// "macCode": "9652247",
// "macSpec": null,
// "memo": null,
// "rfId": "SYM-HCP-L4",
// "status": true,
// "typeName": "9652247",
// "updateTime": null,
// "used": 1,
// "usedText": "正常服役",
// "virtualMac": false
// },
// "keyValue": 121,
// "pureWater": 1.0,
// "quotaArea": 0.0,
// "tapWater": 1.0,
// "updateTime": "2025-04-09 11:27:09",
// "uqDate": "2025-04-09",
// "uqId": 121,
// "uqType": 0,
// "useElectric": 0.0,
// "workCenterId": "[81]",
// "workCenterName": "[\"化学镀镍作业中心\"]",
// "workCenterNames": "镀金",
// "workCenterNames1": "Cu%Ni%",
// "workCenterNames2": "张三",
// "workCenterNames3": "2025-10-09 12:09:08",
// }
// ]
// this.page.total = this.data.length
// this.loading = false
// setTimeout(() => {
// this.selectionClear()
// }, 500)
}
}
}
</script>
<style lang="scss" scoped></style>