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.
335 lines
8.7 KiB
335 lines
8.7 KiB
<template> |
|
<div> |
|
<!-- 表格数据 --> |
|
<avue-crud |
|
:height="460" |
|
: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="row"> |
|
<el-button type="primary" @click="handleAdd">新增</el-button> |
|
</template> |
|
<template #menu-right> </template> |
|
<template #menu="{ row }"> |
|
<el-button type="text" @click="handleView(row)">详情</el-button> |
|
</template> |
|
</avue-crud> |
|
<assDialog :add-dialog="addDialog" @closeDialog="closeDialog" :id="id"></assDialog> |
|
<!-- 新增 --> |
|
<assayedContentDialog |
|
v-if="isAddOpen" |
|
:showDialog="isAddOpen" |
|
:id="id" |
|
:type="viewType" |
|
@closeDialog="closeDialog" |
|
></assayedContentDialog> |
|
</div> |
|
</template> |
|
|
|
<script> |
|
import { getList } from '@/api/productionManagement/assayedContent'; |
|
// import addDialog from '../addDialog.vue'; |
|
import coatingColumnData from '../../js/coatingColumnData'; |
|
import assayedContentDialog from './assayedContentDialog.vue'; |
|
import assDialog from '../assDialog.vue'; |
|
export default { |
|
components: { |
|
|
|
assayedContentDialog, |
|
assDialog |
|
}, |
|
data() { |
|
return { |
|
id:null, |
|
searchForm: {}, |
|
tabPosition: 'assayedContent', |
|
loading: false, |
|
data: [], |
|
form: {}, |
|
viewType:"", |
|
addDialog: false, |
|
showDialog: false, |
|
materialDialog: false, |
|
approveForm: {}, |
|
addQuantity: false, |
|
option: { |
|
columnSort: true, |
|
tip: false, |
|
height: 'auto', |
|
calcHeight: 32, |
|
simplePage: false, |
|
searchShow: true, |
|
searchMenuSpan: 12, |
|
searchIcon: true, |
|
searchIndex: 3, |
|
tree: false, |
|
border: true, |
|
index: false, |
|
selection: false, |
|
viewBtn: false, |
|
delBtn: false, |
|
editBtn: false, |
|
addBtnIcon: ' ', |
|
viewBtnIcon: ' ', |
|
delBtnIcon: ' ', |
|
editBtnIcon: ' ', |
|
addBtn: false, |
|
labelWidth: 120, |
|
searchLabelWidth: 120, |
|
menu: true, |
|
menuWidth: 80, |
|
dialogWidth: 600, |
|
dialogClickModal: false, |
|
searchEnter: true, |
|
excelBtn: true, |
|
gridBtn: false, |
|
searchShowBtn: false, |
|
showOverflowTooltip: true, |
|
searchLabelPosition: 'left', |
|
filterBtn: true, |
|
searchLabelPosition: 'left', |
|
searchGutter: 24, |
|
searchSpan: 6, |
|
menuAlign: 'left', |
|
gridBtn: false, |
|
searchMenuPosition: 'right', |
|
align: 'center', |
|
column: [ |
|
{ |
|
label: '作业中心', |
|
prop: 'wcId', |
|
span: 24, |
|
type: 'select', |
|
overflow: true, |
|
search: true, |
|
headerAlign: 'center', |
|
align: 'center', |
|
searchLabelWidth: 80, |
|
rules: [ |
|
{ |
|
required: true, |
|
message: '请输入作业中心', |
|
trigger: 'blur', |
|
}, |
|
], |
|
dicUrl: '/blade-desk/BA/WorkCenter/listForSelect', |
|
props: { |
|
label: 'wcName', |
|
value: 'id', |
|
}, |
|
}, |
|
{ |
|
label: '化验人', |
|
prop: 'assayManName', |
|
span: 24, |
|
overflow: true, |
|
search: false, |
|
headerAlign: 'center', |
|
align: 'center', |
|
searchLabelWidth: 80, |
|
rules: [ |
|
{ |
|
required: true, |
|
message: '请输入化验人', |
|
trigger: 'blur', |
|
}, |
|
], |
|
}, |
|
{ |
|
label: '化验时间', |
|
prop: 'assayTime', |
|
span: 24, |
|
type: 'datetime', |
|
overflow: true, |
|
search: false, |
|
headerAlign: 'center', |
|
align: 'center', |
|
searchLabelWidth: 80, |
|
rules: [ |
|
{ |
|
required: true, |
|
message: '请输入化验时间', |
|
trigger: 'blur', |
|
}, |
|
], |
|
}, |
|
{ |
|
label: '状态', |
|
prop: 'status', |
|
span: 24, |
|
overflow: true, |
|
search: true, |
|
type: 'select', |
|
headerAlign: 'center', |
|
align: 'center', |
|
searchLabelWidth: 50, |
|
rules: [ |
|
{ |
|
required: true, |
|
message: '请输入状态', |
|
trigger: 'blur', |
|
}, |
|
], |
|
dicData: [ |
|
// { label: '待审核', value: '1' }, |
|
// { label: '审核不通过', value: '2' }, |
|
// { label: '已关闭', value: '3' }, |
|
// { label: '审核通过', value: '4' }, |
|
{ label: '已使用', value: 10001 }, |
|
{ label: '未使用', value: 10000 }, |
|
{ label: '已过期', value: 10002 }, |
|
] |
|
}, |
|
], |
|
}, |
|
approveRules: { |
|
approveREsult: [{ required: true, message: '请选择审批结果', trigger: 'blur' }], |
|
}, |
|
approveDialog: false, |
|
page: { |
|
pageSize: 10, |
|
currentPage: 1, |
|
total: 0, |
|
}, |
|
selectionList: [], |
|
isAddOpen: false, |
|
}; |
|
}, |
|
mounted() { |
|
// this.option.column = coatingColumnData[this.tabPosition]; |
|
}, |
|
methods: { |
|
searchReset() { |
|
this.query = {}; |
|
this.onLoad(this.page); |
|
}, |
|
searchChange(params, done) { |
|
this.query = params; |
|
this.page.currentPage = 1; |
|
this.onLoad(this.page, params); |
|
done(); |
|
}, |
|
// 待审核搜索 |
|
pendingReviewFn() { |
|
this.$message.success('操作成功'); |
|
}, |
|
|
|
// 多选 |
|
selectionChange(list) { |
|
this.selectionList = list; |
|
}, |
|
// 点击详情 |
|
handleView(row) { |
|
this.viewType = "view" |
|
this.id = row.id |
|
this.isAddOpen = true; |
|
}, |
|
deleteRow(row) { |
|
this.$confirm('确定删除此条数据?', { |
|
confirmButtonText: '确定', |
|
cancelButtonText: '取消', |
|
type: 'warning', |
|
}).then(() => {}); |
|
}, |
|
closeRow() { |
|
this.$confirm('确定删除此条数据?', { |
|
confirmButtonText: '确定', |
|
cancelButtonText: '取消', |
|
type: 'warning', |
|
}).then(() => {}); |
|
}, |
|
// 新增按钮点击 |
|
handleAdd() { |
|
this.id = '' |
|
this.viewType = "add" |
|
this.isAddOpen = true; |
|
}, |
|
// 关闭弹窗 |
|
closeDialog(val) { |
|
this.showDialog = false; |
|
this.materialDialog = false; |
|
this.addQuantity = false; |
|
this.addDialog = false; |
|
this.isAddOpen = false; |
|
if(val){ |
|
this.onLoad() |
|
} |
|
}, |
|
addQuantityClick() { |
|
if (this.selectionList.length == 0) { |
|
this.$message.error('请至少选择一条数据!'); |
|
} else { |
|
this.addQuantity = true; |
|
} |
|
}, |
|
approveRow() { |
|
this.approveDialog = true; |
|
}, |
|
handleApprove() { |
|
if (this.selectionList.length != 0) { |
|
this.approveDialog = true; |
|
} else { |
|
this.$message.error('请至少选择一条数据!'); |
|
} |
|
}, |
|
submitApprove() { |
|
this.$refs.approveForm.validate(valid => { |
|
console.log('valid==============', valid); |
|
if (valid) { |
|
this.approveDialog = false; |
|
} |
|
}); |
|
}, |
|
async onLoad(page, params = {}) { |
|
// this.data = [ |
|
// { |
|
// id: 1, |
|
// requiredCode: '001', |
|
// assayer: '张三', |
|
// workCenter: '2025-10-20 11:20:32', |
|
// status: 4, |
|
// }, |
|
// { |
|
// id: 2, |
|
// requiredCode: '002', |
|
// assayer: '李四', |
|
// workCenter: '2025-10-21 11:20:32', |
|
// status: 3, |
|
// }, |
|
// ]; |
|
this.loading = true; |
|
try { |
|
const res = await getList({ |
|
current:this.page.currentPage, |
|
size:this.page.pageSize, |
|
...this.query |
|
}); |
|
// if (res.code) { |
|
this.data = res.data.data.records; |
|
this.page.total = res.data.data.total; |
|
// this.selectionClear(); |
|
this.loading = false; |
|
// } |
|
} catch (err) { |
|
console.log(err); |
|
} |
|
|
|
// this.page.total = this.data.length; |
|
}, |
|
}, |
|
}; |
|
</script> |
|
|
|
<style></style>
|
|
|