页面优化
This commit is contained in:
parent
94327108e2
commit
c30d7aa355
|
|
@ -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
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 批量导出月结明细表 */
|
/** 批量导出月结明细表 */
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue