页面优化
This commit is contained in:
parent
94327108e2
commit
c30d7aa355
|
|
@ -80,6 +80,7 @@
|
|||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="agreementList"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
|
|
@ -211,13 +212,9 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
// loading: true,
|
||||
loading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
|
|
@ -330,8 +327,6 @@ export default {
|
|||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item)
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
|
||||
/** 批量导出月结明细表 */
|
||||
|
|
|
|||
|
|
@ -160,160 +160,160 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import TableModel from '@/components/TableModel'
|
||||
import DialogModel from '@/components/DialogModel'
|
||||
import { config, dialogConfig, getSelList } from './config'
|
||||
import {
|
||||
getForecastWasteListApi,
|
||||
getDialogListApi,
|
||||
auditingPreScrapApi,
|
||||
} from '@/api/scrap/forecastWaste.js'
|
||||
export default {
|
||||
name: 'Inventory',
|
||||
components: {
|
||||
TableModel,
|
||||
DialogModel,
|
||||
import TableModel from '@/components/TableModel'
|
||||
import DialogModel from '@/components/DialogModel'
|
||||
import { config, dialogConfig, getSelList } from './config'
|
||||
import {
|
||||
getForecastWasteListApi,
|
||||
getDialogListApi,
|
||||
auditingPreScrapApi,
|
||||
} from '@/api/scrap/forecastWaste.js'
|
||||
export default {
|
||||
name: 'Inventory',
|
||||
components: {
|
||||
TableModel,
|
||||
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 {
|
||||
config,
|
||||
dialogConfig,
|
||||
getDialogListApi,
|
||||
getForecastWasteListApi,
|
||||
getSelList,
|
||||
/* 驳回原因 */
|
||||
rejectReason: '',
|
||||
/* 选中的审核数据 */
|
||||
selAuditingList: [],
|
||||
/* 请求参数 */
|
||||
sendParams: {},
|
||||
/* 当前登录的用户id */
|
||||
userId: sessionStorage.getItem('userId'),
|
||||
/* 审核参数 */
|
||||
auditingParams: {
|
||||
taskId: '',
|
||||
scrapDetailList: [],
|
||||
},
|
||||
tbAllChecked: false, // 判断当前设备是否全部审核过
|
||||
/* 审核 */
|
||||
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
|
||||
}
|
||||
},
|
||||
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
|
||||
},
|
||||
/* 审核 */
|
||||
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.selAuditingList.map((e) => {
|
||||
/* 获取当前需要审核的设备数据 */
|
||||
let deviceInfo = {
|
||||
id: e.id, // 设备ID
|
||||
auditBy: this.userId, // 审核人 ID
|
||||
status: '1', // 1 通过 2 驳回
|
||||
}
|
||||
|
||||
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) => {
|
||||
/* 获取当前需要审核的设备数据 */
|
||||
let deviceInfo = {
|
||||
id: e.id, // 设备ID
|
||||
auditBy: this.userId, // 审核人 ID
|
||||
status: '1', // 1 通过 2 驳回
|
||||
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.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) => {
|
||||
/* 获取当前需要审核的设备数据 */
|
||||
let deviceInfo = {
|
||||
id: e.id, // 设备ID
|
||||
auditBy: this.userId, // 审核人 ID
|
||||
status: '2', // 1 通过 2 驳回
|
||||
auditRemark: this.rejectReason, // 驳回原因
|
||||
}
|
||||
|
||||
this.auditingParams.scrapDetailList.push(deviceInfo)
|
||||
this.$message.success('已驳回!')
|
||||
this.dialogConfig.innerVisible = false
|
||||
/* 当驳回成功 重新查询列表回显数据 */
|
||||
this.$nextTick(() => {
|
||||
this.$refs.dialogTbRef.getList()
|
||||
})
|
||||
const res = await auditingPreScrapApi(this.auditingParams)
|
||||
if (res.code == 200) {
|
||||
this.$message.success('已驳回!')
|
||||
this.dialogConfig.innerVisible = false
|
||||
/* 当驳回成功 重新查询列表回显数据 */
|
||||
this.$nextTick(() => {
|
||||
this.$refs.dialogTbRef.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 数据导出 */
|
||||
handleExport(data) {
|
||||
console.log(data, '导出的参数')
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
dialogConfig: {
|
||||
handler(newVal) {
|
||||
/* 监听外层弹框关闭 清空勾选的数据 */
|
||||
if (!newVal.outerVisible) {
|
||||
this.selectionList = []
|
||||
}
|
||||
},
|
||||
/* 数据导出 */
|
||||
handleExport(data) {
|
||||
console.log(data, '导出的参数')
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
watch: {
|
||||
dialogConfig: {
|
||||
handler(newVal) {
|
||||
/* 监听外层弹框关闭 清空勾选的数据 */
|
||||
if (!newVal.outerVisible) {
|
||||
this.selectionList = []
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue