|
|
|
@ -4,14 +4,28 @@
|
|
|
|
|
<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-popconfirm
|
|
|
|
|
title="将会审核选中的最后一条整票,是否确认?"
|
|
|
|
|
ok-text="是"
|
|
|
|
|
cancel-text="否"
|
|
|
|
|
@confirm="FnAudit(true, 'confirm')"
|
|
|
|
|
>
|
|
|
|
|
<a-button type="link">
|
|
|
|
|
<span class="iconfont icon-yiwancheng2-copy" :style="{ fontSize: '13px' }"></span>
|
|
|
|
|
整票审核通过
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
<a-popconfirm
|
|
|
|
|
title="是否确认审核通过?"
|
|
|
|
|
ok-text="是"
|
|
|
|
|
cancel-text="否"
|
|
|
|
|
@confirm="FnAudit(false, 'confirm')"
|
|
|
|
|
>
|
|
|
|
|
<a-button type="link">
|
|
|
|
|
<span class="iconfont icon-yiwancheng2-copy" :style="{ fontSize: '13px' }"></span>
|
|
|
|
|
选中审核通过
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
<a-button type="link" @click="FnAudit(true, 'cancel')">
|
|
|
|
|
<span class="iconfont icon-bohui-01" :style="{ fontSize: '13px' }"></span>
|
|
|
|
|
整票驳回
|
|
|
|
@ -20,6 +34,10 @@
|
|
|
|
|
<span class="iconfont icon-bohui-01" :style="{ fontSize: '13px' }"></span>
|
|
|
|
|
驳回选中行
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button type="link" class="pl0" @click="derivedExcel">
|
|
|
|
|
<span class="iconfont icon-Excel"></span>
|
|
|
|
|
导出审核通过
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<BasicTable class="ds-table" @register="registerTableBotton"> </BasicTable>
|
|
|
|
@ -40,69 +58,84 @@
|
|
|
|
|
import { BasicTable, useTable } from '/@/components/Table'
|
|
|
|
|
import { BasicForm, useForm } from '/@/components/Form/index'
|
|
|
|
|
import { ApiList, ApiDetailList, ApiConfirm, ApiCancel } from './api'
|
|
|
|
|
import { ExportExcelByColumn } from '/@/api/common'
|
|
|
|
|
import { columns, searchFormSchema, detailColumns } from './columns'
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
const { notification } = useMessage()
|
|
|
|
|
// 引入处理入参方法
|
|
|
|
|
import { formatParams } from '/@/hooks/web/common'
|
|
|
|
|
const [registerTableTop, { reload, clearSelectedRowKeys, getSelectRows }] = useTable({
|
|
|
|
|
title: '',
|
|
|
|
|
api: async (p) => {
|
|
|
|
|
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)
|
|
|
|
|
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: 'radio',
|
|
|
|
|
onChange: () => {
|
|
|
|
|
reloadBotton()
|
|
|
|
|
const TopSelectLast = ref('')
|
|
|
|
|
const [registerTableTop, { reload, clearSelectedRowKeys, setSelectedRowKeys, getSelectRows }] =
|
|
|
|
|
useTable({
|
|
|
|
|
title: '',
|
|
|
|
|
api: async (p) => {
|
|
|
|
|
clearSelectedRowKeys()
|
|
|
|
|
getSelectRowsBotton()
|
|
|
|
|
const res: API.DataResult = await ApiList(p)
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
resolve({ data: [...res.data], total: res.count })
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
formConfig: {
|
|
|
|
|
labelWidth: 120,
|
|
|
|
|
schemas: searchFormSchema,
|
|
|
|
|
},
|
|
|
|
|
pagination: true,
|
|
|
|
|
striped: true,
|
|
|
|
|
useSearchForm: true,
|
|
|
|
|
showTableSetting: false,
|
|
|
|
|
bordered: true,
|
|
|
|
|
showIndexColumn: true,
|
|
|
|
|
indexColumnProps: {
|
|
|
|
|
width: 60,
|
|
|
|
|
},
|
|
|
|
|
canResize: true,
|
|
|
|
|
resizeHeightOffset: 335,
|
|
|
|
|
immediate: true,
|
|
|
|
|
})
|
|
|
|
|
beforeFetch: (p) => {
|
|
|
|
|
let Rdata = formatParams(p)
|
|
|
|
|
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,
|
|
|
|
|
rowKey: 'id',
|
|
|
|
|
rowSelection: {
|
|
|
|
|
// type: 'radio',
|
|
|
|
|
type: 'checkbox',
|
|
|
|
|
onChange: (e, a) => {
|
|
|
|
|
TopSelectLast.value = JSON.stringify(a[a.length - 1])
|
|
|
|
|
reloadBotton()
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
formConfig: {
|
|
|
|
|
labelWidth: 120,
|
|
|
|
|
schemas: searchFormSchema,
|
|
|
|
|
},
|
|
|
|
|
pagination: true,
|
|
|
|
|
striped: true,
|
|
|
|
|
useSearchForm: true,
|
|
|
|
|
showTableSetting: false,
|
|
|
|
|
bordered: true,
|
|
|
|
|
showIndexColumn: true,
|
|
|
|
|
indexColumnProps: {
|
|
|
|
|
width: 60,
|
|
|
|
|
},
|
|
|
|
|
canResize: true,
|
|
|
|
|
resizeHeightOffset: 335,
|
|
|
|
|
immediate: true,
|
|
|
|
|
})
|
|
|
|
|
const derivedObj = ref('{}')
|
|
|
|
|
const [registerTableBotton, { reload: reloadBotton, getSelectRows: getSelectRowsBotton }] =
|
|
|
|
|
useTable({
|
|
|
|
|
title: '',
|
|
|
|
|
api: async (p) => {
|
|
|
|
|
const res: API.DataResult = await ApiDetailList(p)
|
|
|
|
|
if (JSON.parse(TopSelectLast.value).billState == 1100) {
|
|
|
|
|
let Obj = JSON.parse(derivedObj.value)
|
|
|
|
|
if (!Obj[JSON.parse(TopSelectLast.value).id]) {
|
|
|
|
|
Obj[JSON.parse(TopSelectLast.value).id] = res.data
|
|
|
|
|
}
|
|
|
|
|
derivedObj.value = JSON.stringify(Obj)
|
|
|
|
|
}
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
resolve({ data: [...res.data], total: res.count })
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
beforeFetch: (p) => {
|
|
|
|
|
p['Pid'] = getSelectRows()[0].id
|
|
|
|
|
// p['Pid'] = getSelectRows()[0].id
|
|
|
|
|
p['Pid'] = JSON.parse(TopSelectLast.value).id
|
|
|
|
|
return formatParams(p)
|
|
|
|
|
},
|
|
|
|
|
columns: detailColumns,
|
|
|
|
@ -130,8 +163,8 @@
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
if (type) {
|
|
|
|
|
if (getSelectRows()[0]?.id) {
|
|
|
|
|
ApiData.id = getSelectRows()[0].id
|
|
|
|
|
if (JSON.parse(TopSelectLast.value)?.id) {
|
|
|
|
|
ApiData.id = JSON.parse(TopSelectLast.value).id
|
|
|
|
|
} else {
|
|
|
|
|
notification.warning({ message: '请选择一条数据', duration: 3 })
|
|
|
|
|
throw new Error('请选择一条数据')
|
|
|
|
@ -141,13 +174,13 @@
|
|
|
|
|
getSelectRowsBotton().forEach((item) => {
|
|
|
|
|
ApiData.ids.push(item.id)
|
|
|
|
|
})
|
|
|
|
|
ApiData.id = getSelectRows()[0].id
|
|
|
|
|
ApiData.id = JSON.parse(TopSelectLast.value).id
|
|
|
|
|
} else {
|
|
|
|
|
notification.warning({ message: '请至少选择一条数据', duration: 3 })
|
|
|
|
|
throw new Error('请至少选择一条数据')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ApiData.businessType = getSelectRows()[0]?.ctnBizStateId
|
|
|
|
|
ApiData.businessType = JSON.parse(TopSelectLast.value)?.ctnBizStateId
|
|
|
|
|
if (state == 'cancel') {
|
|
|
|
|
Ctype.value = type
|
|
|
|
|
CApiData.value = JSON.stringify(ApiData)
|
|
|
|
@ -160,6 +193,10 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
async function FnExamine(type, state, ApiData) {
|
|
|
|
|
if (state == 'confirm' && type) {
|
|
|
|
|
clearSelectedRowKeys()
|
|
|
|
|
setSelectedRowKeys([JSON.parse(TopSelectLast.value)?.id])
|
|
|
|
|
}
|
|
|
|
|
let res: any = state == 'confirm' ? await ApiConfirm(ApiData) : await ApiCancel(ApiData)
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
notification.success({ message: res.message, duration: 3 })
|
|
|
|
@ -204,6 +241,44 @@
|
|
|
|
|
modalResetFields()
|
|
|
|
|
visible.value = false
|
|
|
|
|
}
|
|
|
|
|
function derivedExcel() {
|
|
|
|
|
let ApiData: any = {
|
|
|
|
|
columnSets: [],
|
|
|
|
|
jsonDataStr: [],
|
|
|
|
|
}
|
|
|
|
|
detailColumns.forEach((item) => {
|
|
|
|
|
ApiData.columnSets.push({
|
|
|
|
|
title: item.title,
|
|
|
|
|
enTitle: item.dataIndex,
|
|
|
|
|
dataIndex: item.dataIndex,
|
|
|
|
|
visible: true,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
getSelectRows().forEach((item) => {
|
|
|
|
|
let Obj = JSON.parse(derivedObj.value)
|
|
|
|
|
if (Obj[item.id]) {
|
|
|
|
|
ApiData.jsonDataStr = [...ApiData.jsonDataStr, ...Obj[item.id]]
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (ApiData.jsonDataStr.length) {
|
|
|
|
|
ApiData.jsonDataStr = JSON.stringify(ApiData.jsonDataStr)
|
|
|
|
|
ExportExcelByColumn(ApiData).then((res) => {
|
|
|
|
|
const xlsUrl = window.URL.createObjectURL(
|
|
|
|
|
new Blob([res], {
|
|
|
|
|
type: 'application/vnd.ms-excel;charset=utf-8',
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
const fname = '下线审批_审核通过数据'
|
|
|
|
|
const link = document.createElement('a')
|
|
|
|
|
link.href = xlsUrl
|
|
|
|
|
link.setAttribute('download', fname)
|
|
|
|
|
document.body.appendChild(link)
|
|
|
|
|
link.click()
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
notification.warning({ message: '请选择审核通过数据。', duration: 3 })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
:deep(.ant-table-column-sorters) {
|
|
|
|
|