Browse Source

上线结算明细

hella_zhaoxuebing
王宇飞 1 month ago
parent
commit
45bbf636bb
  1. 16
      src/views/wms/issueManage/onlinesettlement/onlinesettlementInfo/index.vue
  2. 1
      src/views/wms/issueManage/onlinesettlement/onlinesettlementInfo/onlinesettlementInfo.data.ts
  3. 221
      src/views/wms/issueManage/onlinesettlement/onlinesettlementInfoDetail/index.vue

16
src/views/wms/issueManage/onlinesettlement/onlinesettlementInfo/index.vue

@ -27,9 +27,9 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
@ -51,8 +51,8 @@
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="OnlinesettlementInfo.allSchemas" />
<!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="OnlinesettlementInfo.allSchemas" /> -->
<InfoDetail ref="infoDetailRef"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/onlinesettlement-info/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
@ -65,7 +65,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import InfoDetail from '../onlinesettlementInfoDetail/index.vue'
defineOptions({ name: 'OnlinesettlementInfo' })
const message = useMessage() //
@ -178,8 +178,10 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */
const detailRef = ref()
const infoDetailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicOnlinesettlementInfo')
// detailRef.value.openDetail(row, titleName, titleValue, 'basicOnlinesettlementInfo')
infoDetailRef.value.openDetail(row)
}
/** 删除按钮操作 */

1
src/views/wms/issueManage/onlinesettlement/onlinesettlementInfo/onlinesettlementInfo.data.ts

@ -24,6 +24,7 @@ export const OnlinesettlementInfo = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true,
table: {
fixed: 'left',
width: 180
},
},

221
src/views/wms/issueManage/onlinesettlement/onlinesettlementInfoDetail/index.vue

@ -1,20 +1,12 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="OnlinesettlementInfoDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="OnlinesettlementInfoDetail.allSchemas"
/>
<!-- 列表 -->
<Dialog
title="结算明细"
v-model="dialogVisible"
width="80%"
:close-on-click-modal="false"
:vLoading="formLoading"
>
<ContentWrap>
<Table
:columns="tableColumns"
@ -27,34 +19,9 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="OnlinesettlementInfoDetailRules"
:formAllSchemas="OnlinesettlementInfoDetail.allSchemas"
:apiUpdate="OnlinesettlementInfoDetailApi.updateOnlinesettlementInfoDetail"
:apiCreate="OnlinesettlementInfoDetailApi.createOnlinesettlementInfoDetail"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</Table></ContentWrap>
</Dialog>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="OnlinesettlementInfoDetail.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/onlinesettlement-info-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
@ -62,12 +29,10 @@ import download from '@/utils/download'
import { OnlinesettlementInfoDetail,OnlinesettlementInfoDetailRules } from './onlinesettlementInfoDetail.data'
import * as OnlinesettlementInfoDetailApi from '@/api/wms/onlinesettlementInfoDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'OnlinesettlementInfoDetail' })
const message = useMessage() //
const { t } = useI18n() //
@ -76,18 +41,16 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(OnlinesettlementInfoDetail.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
const dialogVisible = ref(false)
const formLoading = ref(false)
const openDetail = async ({number,id})=>{
dialogVisible.value = true
formLoading.value = true
await setSearchParams({
number,
masterId:id
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
formLoading.value = false
}
const { tableObject, tableMethods } = useTable({
@ -97,148 +60,8 @@ const { tableObject, tableMethods } = useTable({
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:onlinesettlementInfoDetail:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:onlinesettlementInfoDetail:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:onlinesettlementInfoDetail:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:onlinesettlementInfoDetail:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:onlinesettlementInfoDetail:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =OnlinesettlementInfoDetail.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await OnlinesettlementInfoDetailApi.createOnlinesettlementInfoDetail(data)
message.success(t('common.createSuccess'))
} else {
await OnlinesettlementInfoDetailApi.updateOnlinesettlementInfoDetail(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicOnlinesettlementInfoDetail')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await OnlinesettlementInfoDetailApi.deleteOnlinesettlementInfoDetail(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await OnlinesettlementInfoDetailApi.exportOnlinesettlementInfoDetail(tableObject.params)
download.excel(data, '上线结算记录信息新子表.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '上线结算记录信息新子表导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await OnlinesettlementInfoDetailApi.importTemplate()
})
defineExpose({
openDetail
}) // open
</script>

Loading…
Cancel
Save