箱管 下线审批
parent
2aeedd9bd5
commit
6ac13df1a4
@ -1,119 +1,159 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable class="ds-table" @register="registerTableTop"> </BasicTable>
|
||||
<BasicTable class="ds-table" @register="registerTableBotton"> </BasicTable>
|
||||
<div class="OfflineAudit">
|
||||
<div>
|
||||
<BasicTable class="ds-table" @register="registerTableTop"> </BasicTable>
|
||||
</div>
|
||||
<div>
|
||||
<a-button type="link" @click="FnAudit(true, 'confirm')">
|
||||
<span class="iconfont icon-yiwancheng2-copy" :style="{ fontSize: '13px' }"></span>
|
||||
整票审核通过
|
||||
</a-button>
|
||||
<a-button type="link" @click="FnAudit(false, 'confirm')">
|
||||
<span class="iconfont icon-yiwancheng2-copy" :style="{ fontSize: '13px' }"></span>
|
||||
选中审核通过
|
||||
</a-button>
|
||||
<a-button type="link" @click="FnAudit(true, 'cancel')">
|
||||
<span class="iconfont icon-bohui-01" :style="{ fontSize: '13px' }"></span>
|
||||
整票驳回
|
||||
</a-button>
|
||||
<a-button type="link" @click="FnAudit(false, 'cancel')">
|
||||
<span class="iconfont icon-bohui-01" :style="{ fontSize: '13px' }"></span>
|
||||
驳回选中行
|
||||
</a-button>
|
||||
</div>
|
||||
<div>
|
||||
<BasicTable class="ds-table" @register="registerTableBotton"> </BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { BasicTable, useTable } from '/@/components/Table'
|
||||
import { ApiChangeList, ApiChangeDel } from './api'
|
||||
import { columns, searchFormSchema } from './columns'
|
||||
import { ApiList, ApiDetailList, ApiConfirm, ApiCancel } from './api'
|
||||
import { columns, searchFormSchema, detailColumns } from './columns'
|
||||
import { useMessage } from '/@/hooks/web/useMessage'
|
||||
const { notification } = useMessage()
|
||||
// 引入处理入参方法
|
||||
import { formatParams } from '/@/hooks/web/common'
|
||||
const [registerTableTop, { reload, getForm, getSelectRows }] = useTable({
|
||||
const [registerTableTop, { reload, clearSelectedRowKeys, getSelectRows }] = useTable({
|
||||
title: '',
|
||||
api: async (p) => {
|
||||
if (p.queryCondition == '[]') {
|
||||
notification.warning({ message: '请输入查询条件!', duration: 3 })
|
||||
} else {
|
||||
const res: API.DataResult = await ApiChangeList(p)
|
||||
res.data.forEach((item, index) => {
|
||||
item.index = index + 1
|
||||
})
|
||||
return new Promise((resolve) => {
|
||||
resolve({ data: [...res.data], total: res.count })
|
||||
})
|
||||
}
|
||||
clearSelectedRowKeys()
|
||||
getSelectRowsBotton()
|
||||
const res: API.DataResult = await ApiList(p)
|
||||
return new Promise((resolve) => {
|
||||
resolve({ data: [...res.data], total: res.count })
|
||||
})
|
||||
},
|
||||
beforeFetch: (p) => {
|
||||
let Rdata = formatParams(p)
|
||||
if (!!p.cntrno) {
|
||||
let data = JSON.parse(Rdata.queryCondition)
|
||||
data.forEach((item, index) => {
|
||||
if (item.FieldName == 'cntrno') {
|
||||
item.FieldValue = item.FieldValue.replace(/ {1,}/g, ',')
|
||||
item.FieldValue = item.FieldValue.replace(/\n/g, ',')
|
||||
item.ConditionalType = 15
|
||||
}
|
||||
})
|
||||
Rdata.queryCondition = JSON.stringify(data)
|
||||
}
|
||||
let data = JSON.parse(Rdata.queryCondition)
|
||||
data.forEach((item) => {
|
||||
if (item.FieldName == 'cntrnoall') {
|
||||
item.FieldValue = item.FieldValue.replace(/ {1,}/g, ',')
|
||||
item.FieldValue = item.FieldValue.replace(/\n/g, ',')
|
||||
item.ConditionalType = 15
|
||||
}
|
||||
})
|
||||
Rdata.queryCondition = JSON.stringify(data)
|
||||
return Rdata
|
||||
},
|
||||
columns,
|
||||
rowSelection: { type: 'checkbox' },
|
||||
rowSelection: {
|
||||
type: 'radio',
|
||||
onChange: () => {
|
||||
reloadBotton()
|
||||
},
|
||||
},
|
||||
formConfig: {
|
||||
labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
},
|
||||
isTreeTable: false,
|
||||
pagination: true,
|
||||
striped: true,
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
showIndexColumn: true,
|
||||
indexColumnProps: {
|
||||
width: 60,
|
||||
},
|
||||
canResize: true,
|
||||
resizeHeightOffset: 35,
|
||||
immediate: false,
|
||||
resizeHeightOffset: 335,
|
||||
immediate: true,
|
||||
})
|
||||
const [
|
||||
registerTableBotton,
|
||||
{ reload: reloadBotton, getForm: getFormBotton, getSelectRows: getSelectRowsBotton },
|
||||
] = useTable({
|
||||
title: '',
|
||||
api: async (p) => {
|
||||
if (p.queryCondition == '[]') {
|
||||
notification.warning({ message: '请输入查询条件!', duration: 3 })
|
||||
} else {
|
||||
const res: API.DataResult = await ApiChangeList(p)
|
||||
res.data.forEach((item, index) => {
|
||||
item.index = index + 1
|
||||
})
|
||||
const [registerTableBotton, { reload: reloadBotton, getSelectRows: getSelectRowsBotton }] =
|
||||
useTable({
|
||||
title: '',
|
||||
api: async (p) => {
|
||||
const res: API.DataResult = await ApiDetailList(p)
|
||||
return new Promise((resolve) => {
|
||||
resolve({ data: [...res.data], total: res.count })
|
||||
})
|
||||
},
|
||||
beforeFetch: (p) => {
|
||||
p['Pid'] = getSelectRows()[0].id
|
||||
return formatParams(p)
|
||||
},
|
||||
columns: detailColumns,
|
||||
rowSelection: { type: 'checkbox' },
|
||||
pagination: true,
|
||||
striped: true,
|
||||
useSearchForm: false,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
showIndexColumn: true,
|
||||
indexColumnProps: {
|
||||
width: 60,
|
||||
},
|
||||
canResize: true,
|
||||
resizeHeightOffset: 35,
|
||||
immediate: false,
|
||||
})
|
||||
|
||||
async function FnAudit(type, state) {
|
||||
let ApiData: any = {
|
||||
id: '',
|
||||
ids: [],
|
||||
}
|
||||
if (type) {
|
||||
if (getSelectRows()[0].id) {
|
||||
ApiData.id = getSelectRows()[0].id
|
||||
} else {
|
||||
notification.warning({ message: '请选择一条数据', duration: 3 })
|
||||
}
|
||||
},
|
||||
beforeFetch: (p) => {
|
||||
let Rdata = formatParams(p)
|
||||
if (!!p.cntrno) {
|
||||
let data = JSON.parse(Rdata.queryCondition)
|
||||
data.forEach((item, index) => {
|
||||
if (item.FieldName == 'cntrno') {
|
||||
item.FieldValue = item.FieldValue.replace(/ {1,}/g, ',')
|
||||
item.FieldValue = item.FieldValue.replace(/\n/g, ',')
|
||||
item.ConditionalType = 15
|
||||
}
|
||||
} else {
|
||||
if (getSelectRowsBotton().length) {
|
||||
getSelectRowsBotton().forEach((item) => {
|
||||
ApiData.ids.push(item.id)
|
||||
})
|
||||
Rdata.queryCondition = JSON.stringify(data)
|
||||
ApiData.id = getSelectRows()[0].id
|
||||
} else {
|
||||
notification.warning({ message: '请至少选择一条数据', duration: 3 })
|
||||
}
|
||||
return Rdata
|
||||
},
|
||||
columns,
|
||||
rowSelection: { type: 'checkbox' },
|
||||
// formConfig: {
|
||||
// labelWidth: 120,
|
||||
// schemas: searchFormSchema,
|
||||
// },
|
||||
isTreeTable: false,
|
||||
pagination: true,
|
||||
striped: true,
|
||||
useSearchForm: false,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
showIndexColumn: true,
|
||||
indexColumnProps: {
|
||||
width: 60,
|
||||
},
|
||||
canResize: true,
|
||||
resizeHeightOffset: 35,
|
||||
immediate: false,
|
||||
})
|
||||
}
|
||||
let res: any = state == 'confirm' ? await ApiConfirm(ApiData) : await ApiCancel(ApiData)
|
||||
if (res.succeeded) {
|
||||
notification.success({ message: res.message, duration: 3 })
|
||||
console.log(type)
|
||||
|
||||
if (type) {
|
||||
reload()
|
||||
} else {
|
||||
reloadBotton()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.OfflineAudit {
|
||||
height: 100%;
|
||||
> div {
|
||||
&:nth-child(1) {
|
||||
height: 60%;
|
||||
}
|
||||
&:nth-child(3) {
|
||||
height: calc(40% - 32px);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue