页面优化

This commit is contained in:
BianLzhaoMin 2024-07-29 14:19:06 +08:00
parent 94327108e2
commit c30d7aa355
2 changed files with 139 additions and 144 deletions

View File

@ -80,6 +80,7 @@
</el-form> </el-form>
<el-table <el-table
v-loading="loading"
:data="agreementList" :data="agreementList"
border border
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@ -211,13 +212,9 @@ export default {
data() { data() {
return { return {
// //
// loading: true, loading: false,
// //
ids: [], ids: [],
//
single: true,
//
multiple: true,
// //
showSearch: true, showSearch: true,
// //
@ -330,8 +327,6 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item) this.ids = selection.map((item) => item)
this.single = selection.length != 1
this.multiple = !selection.length
}, },
/** 批量导出月结明细表 */ /** 批量导出月结明细表 */

View File

@ -160,160 +160,160 @@
</template> </template>
<script> <script>
import TableModel from '@/components/TableModel' import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel' import DialogModel from '@/components/DialogModel'
import { config, dialogConfig, getSelList } from './config' import { config, dialogConfig, getSelList } from './config'
import { import {
getForecastWasteListApi, getForecastWasteListApi,
getDialogListApi, getDialogListApi,
auditingPreScrapApi, auditingPreScrapApi,
} from '@/api/scrap/forecastWaste.js' } from '@/api/scrap/forecastWaste.js'
export default { export default {
name: 'Inventory', name: 'Inventory',
components: { components: {
TableModel, TableModel,
DialogModel, DialogModel,
},
data() {
return {
config,
dialogConfig,
getDialogListApi,
getForecastWasteListApi,
getSelList,
/* 驳回原因 */
rejectReason: '',
/* 选中的审核数据 */
selAuditingList: [],
/* 请求参数 */
sendParams: {},
/* 当前登录的用户id */
userId: sessionStorage.getItem('userId'),
/* 审核参数 */
auditingParams: {
taskId: '',
scrapDetailList: [],
},
tbAllChecked: false, //
}
},
created() {
this.getSelList()
},
methods: {
/* 查看 */
async handlePreview(row) {
this.sendParams.taskId = this.auditingParams.taskId = row.taskId
this.dialogConfig.outerTitle = '查看'
this.dialogConfig.isSelShow = false
this.dialogConfig.outerVisible = true
}, },
data() { /* 审核 */
return { handleAuditing(row) {
config, this.sendParams.taskId = this.auditingParams.taskId = row.taskId
dialogConfig, this.dialogConfig.outerTitle = '审核'
getDialogListApi, this.dialogConfig.isSelShow = true
getForecastWasteListApi, this.dialogConfig.outerVisible = true
getSelList, },
/* 驳回原因 */ /* 外层弹框关闭 */
rejectReason: '', closeDialogOuter() {
/* 选中的审核数据 */ this.dialogConfig.outerVisible = false
selAuditingList: [], },
/* 请求参数 */ /* 内层弹框关闭 */
sendParams: {}, closeDialogInner() {
/* 当前登录的用户id */ this.dialogConfig.innerVisible = false
userId: sessionStorage.getItem('userId'), },
/* 审核参数 */ /* 弹框内列表复选框勾选后数据 */
auditingParams: { getDialogTbSelList(list) {
taskId: '', this.selAuditingList = list
scrapDetailList: [], },
}, /* 审核通过 */
tbAllChecked: false, // async auditingPass() {
if (this.selAuditingList.length < 1) {
this.$message.error('请勾选审核设备')
return
} }
},
created() { this.selAuditingList.map((e) => {
this.getSelList() /* 获取当前需要审核的设备数据 */
}, let deviceInfo = {
methods: { id: e.id, // ID
/* 查看 */ auditBy: this.userId, // ID
async handlePreview(row) { status: '1', // 1 2
this.sendParams.taskId = this.auditingParams.taskId = row.taskId
this.dialogConfig.outerTitle = '查看'
this.dialogConfig.isSelShow = false
this.dialogConfig.outerVisible = true
},
/* 审核 */
handleAuditing(row) {
this.sendParams.taskId = this.auditingParams.taskId = row.taskId
this.dialogConfig.outerTitle = '审核'
this.dialogConfig.isSelShow = true
this.dialogConfig.outerVisible = true
},
/* 外层弹框关闭 */
closeDialogOuter() {
this.dialogConfig.outerVisible = false
},
/* 内层弹框关闭 */
closeDialogInner() {
this.dialogConfig.innerVisible = false
},
/* 弹框内列表复选框勾选后数据 */
getDialogTbSelList(list) {
this.selAuditingList = list
},
/* 审核通过 */
async auditingPass() {
if (this.selAuditingList.length < 1) {
this.$message.error('请勾选审核设备')
return
} }
this.auditingParams.scrapDetailList.push(deviceInfo)
})
const res = await auditingPreScrapApi(this.auditingParams)
if (res.code == 200) {
this.$message.success('审核通过!')
this.dialogConfig.outerVisible = false
this.$refs.tbRef.getList()
}
},
/* 审核驳回 */
async auditingReject() {
if (this.tbAllChecked) {
this.$message.error('当前页面没有可审核的装备')
this.dialogConfig.outerVisible = false
return
}
if (this.selAuditingList.length < 1) {
this.$message.error('请勾选审核设备')
return
}
this.dialogConfig.innerTitle = '驳回原因'
this.dialogConfig.innerVisible = true
},
/* 驳回原因弹框内取消按钮 */
handleCancelInner() {
/* 关闭内弹框 */
this.dialogConfig.innerVisible = false
},
/* 驳回弹框内保存按钮 */
async handleSubmitInner() {
if (!this.rejectReason) {
this.$message.error('驳回原因不能为空!')
this.$refs.rejectReasonRef.focus()
return
} else {
this.selAuditingList.map((e) => { this.selAuditingList.map((e) => {
/* 获取当前需要审核的设备数据 */ /* 获取当前需要审核的设备数据 */
let deviceInfo = { let deviceInfo = {
id: e.id, // ID id: e.id, // ID
auditBy: this.userId, // ID auditBy: this.userId, // ID
status: '1', // 1 2 status: '2', // 1 2
auditRemark: this.rejectReason, //
} }
this.auditingParams.scrapDetailList.push(deviceInfo) this.auditingParams.scrapDetailList.push(deviceInfo)
}) })
const res = await auditingPreScrapApi(this.auditingParams) const res = await auditingPreScrapApi(this.auditingParams)
if (res.code == 200) { if (res.code == 200) {
this.$message.success('审核通过!') this.$message.success('已驳回!')
this.dialogConfig.outerVisible = false this.dialogConfig.innerVisible = false
this.$refs.tbRef.getList() /* 当驳回成功 重新查询列表回显数据 */
} this.$nextTick(() => {
}, this.$refs.dialogTbRef.getList()
/* 审核驳回 */
async auditingReject() {
if (this.tbAllChecked) {
this.$message.error('当前已没有可审核的装备')
this.dialogConfig.outerVisible = false
return
}
if (this.selAuditingList.length < 1) {
this.$message.error('请勾选审核设备')
return
}
this.dialogConfig.innerTitle = '驳回原因'
this.dialogConfig.innerVisible = true
},
/* 驳回原因弹框内取消按钮 */
handleCancelInner() {
/* 关闭内弹框 */
this.dialogConfig.innerVisible = false
},
/* 驳回弹框内保存按钮 */
async handleSubmitInner() {
if (!this.rejectReason) {
this.$message.error('驳回原因不能为空!')
this.$refs.rejectReasonRef.focus()
return
} else {
this.selAuditingList.map((e) => {
/* 获取当前需要审核的设备数据 */
let deviceInfo = {
id: e.id, // ID
auditBy: this.userId, // ID
status: '2', // 1 2
auditRemark: this.rejectReason, //
}
this.auditingParams.scrapDetailList.push(deviceInfo)
}) })
const res = await auditingPreScrapApi(this.auditingParams) }
if (res.code == 200) { }
this.$message.success('已驳回!') },
this.dialogConfig.innerVisible = false /* 数据导出 */
/* 当驳回成功 重新查询列表回显数据 */ handleExport(data) {
this.$nextTick(() => { console.log(data, '导出的参数')
this.$refs.dialogTbRef.getList() },
}) },
} watch: {
dialogConfig: {
handler(newVal) {
/* 监听外层弹框关闭 清空勾选的数据 */
if (!newVal.outerVisible) {
this.selectionList = []
} }
}, },
/* 数据导出 */ deep: true,
handleExport(data) {
console.log(data, '导出的参数')
},
}, },
watch: { },
dialogConfig: { }
handler(newVal) {
/* 监听外层弹框关闭 清空勾选的数据 */
if (!newVal.outerVisible) {
this.selectionList = []
}
},
deep: true,
},
},
}
</script> </script>