Merge branch 'dev' of http://60.209.125.238:20010/lijingjia/ds-wms-client-web into dev
commit
60ea1db15e
@ -1,119 +1,159 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="OfflineAudit">
|
||||||
<BasicTable class="ds-table" @register="registerTableTop"> </BasicTable>
|
<div>
|
||||||
<BasicTable class="ds-table" @register="registerTableBotton"> </BasicTable>
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue'
|
|
||||||
import { BasicTable, useTable } from '/@/components/Table'
|
import { BasicTable, useTable } from '/@/components/Table'
|
||||||
import { ApiChangeList, ApiChangeDel } from './api'
|
import { ApiList, ApiDetailList, ApiConfirm, ApiCancel } from './api'
|
||||||
import { columns, searchFormSchema } from './columns'
|
import { columns, searchFormSchema, detailColumns } from './columns'
|
||||||
import { useMessage } from '/@/hooks/web/useMessage'
|
import { useMessage } from '/@/hooks/web/useMessage'
|
||||||
const { notification } = useMessage()
|
const { notification } = useMessage()
|
||||||
// 引入处理入参方法
|
// 引入处理入参方法
|
||||||
import { formatParams } from '/@/hooks/web/common'
|
import { formatParams } from '/@/hooks/web/common'
|
||||||
const [registerTableTop, { reload, getForm, getSelectRows }] = useTable({
|
const [registerTableTop, { reload, clearSelectedRowKeys, getSelectRows }] = useTable({
|
||||||
title: '',
|
title: '',
|
||||||
api: async (p) => {
|
api: async (p) => {
|
||||||
if (p.queryCondition == '[]') {
|
clearSelectedRowKeys()
|
||||||
notification.warning({ message: '请输入查询条件!', duration: 3 })
|
getSelectRowsBotton()
|
||||||
} else {
|
const res: API.DataResult = await ApiList(p)
|
||||||
const res: API.DataResult = await ApiChangeList(p)
|
return new Promise((resolve) => {
|
||||||
res.data.forEach((item, index) => {
|
resolve({ data: [...res.data], total: res.count })
|
||||||
item.index = index + 1
|
})
|
||||||
})
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
resolve({ data: [...res.data], total: res.count })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
beforeFetch: (p) => {
|
beforeFetch: (p) => {
|
||||||
let Rdata = formatParams(p)
|
let Rdata = formatParams(p)
|
||||||
if (!!p.cntrno) {
|
let data = JSON.parse(Rdata.queryCondition)
|
||||||
let data = JSON.parse(Rdata.queryCondition)
|
data.forEach((item) => {
|
||||||
data.forEach((item, index) => {
|
if (item.FieldName == 'cntrnoall') {
|
||||||
if (item.FieldName == 'cntrno') {
|
item.FieldValue = item.FieldValue.replace(/ {1,}/g, ',')
|
||||||
item.FieldValue = item.FieldValue.replace(/ {1,}/g, ',')
|
item.FieldValue = item.FieldValue.replace(/\n/g, ',')
|
||||||
item.FieldValue = item.FieldValue.replace(/\n/g, ',')
|
item.ConditionalType = 15
|
||||||
item.ConditionalType = 15
|
}
|
||||||
}
|
})
|
||||||
})
|
Rdata.queryCondition = JSON.stringify(data)
|
||||||
Rdata.queryCondition = JSON.stringify(data)
|
|
||||||
}
|
|
||||||
return Rdata
|
return Rdata
|
||||||
},
|
},
|
||||||
columns,
|
columns,
|
||||||
rowSelection: { type: 'checkbox' },
|
rowSelection: {
|
||||||
|
type: 'radio',
|
||||||
|
onChange: () => {
|
||||||
|
reloadBotton()
|
||||||
|
},
|
||||||
|
},
|
||||||
formConfig: {
|
formConfig: {
|
||||||
labelWidth: 120,
|
labelWidth: 120,
|
||||||
schemas: searchFormSchema,
|
schemas: searchFormSchema,
|
||||||
},
|
},
|
||||||
isTreeTable: false,
|
|
||||||
pagination: true,
|
pagination: true,
|
||||||
striped: true,
|
striped: true,
|
||||||
useSearchForm: true,
|
useSearchForm: true,
|
||||||
showTableSetting: true,
|
showTableSetting: false,
|
||||||
bordered: true,
|
bordered: true,
|
||||||
showIndexColumn: true,
|
showIndexColumn: true,
|
||||||
indexColumnProps: {
|
indexColumnProps: {
|
||||||
width: 60,
|
width: 60,
|
||||||
},
|
},
|
||||||
canResize: true,
|
canResize: true,
|
||||||
resizeHeightOffset: 35,
|
resizeHeightOffset: 335,
|
||||||
immediate: false,
|
immediate: true,
|
||||||
})
|
})
|
||||||
const [
|
const [registerTableBotton, { reload: reloadBotton, getSelectRows: getSelectRowsBotton }] =
|
||||||
registerTableBotton,
|
useTable({
|
||||||
{ reload: reloadBotton, getForm: getFormBotton, getSelectRows: getSelectRowsBotton },
|
title: '',
|
||||||
] = useTable({
|
api: async (p) => {
|
||||||
title: '',
|
const res: API.DataResult = await ApiDetailList(p)
|
||||||
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) => {
|
return new Promise((resolve) => {
|
||||||
resolve({ data: [...res.data], total: res.count })
|
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 })
|
||||||
}
|
}
|
||||||
},
|
} else {
|
||||||
beforeFetch: (p) => {
|
if (getSelectRowsBotton().length) {
|
||||||
let Rdata = formatParams(p)
|
getSelectRowsBotton().forEach((item) => {
|
||||||
if (!!p.cntrno) {
|
ApiData.ids.push(item.id)
|
||||||
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)
|
ApiData.id = getSelectRows()[0].id
|
||||||
|
} else {
|
||||||
|
notification.warning({ message: '请至少选择一条数据', duration: 3 })
|
||||||
}
|
}
|
||||||
return Rdata
|
}
|
||||||
},
|
let res: any = state == 'confirm' ? await ApiConfirm(ApiData) : await ApiCancel(ApiData)
|
||||||
columns,
|
if (res.succeeded) {
|
||||||
rowSelection: { type: 'checkbox' },
|
notification.success({ message: res.message, duration: 3 })
|
||||||
// formConfig: {
|
console.log(type)
|
||||||
// labelWidth: 120,
|
|
||||||
// schemas: searchFormSchema,
|
if (type) {
|
||||||
// },
|
reload()
|
||||||
isTreeTable: false,
|
} else {
|
||||||
pagination: true,
|
reloadBotton()
|
||||||
striped: true,
|
}
|
||||||
useSearchForm: false,
|
}
|
||||||
showTableSetting: false,
|
}
|
||||||
bordered: true,
|
|
||||||
showIndexColumn: true,
|
|
||||||
indexColumnProps: {
|
|
||||||
width: 60,
|
|
||||||
},
|
|
||||||
canResize: true,
|
|
||||||
resizeHeightOffset: 35,
|
|
||||||
immediate: false,
|
|
||||||
})
|
|
||||||
</script>
|
</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