Browse Source

询证函调节表

hella_online_20240829
wangyufei 4 months ago
parent
commit
baa792be9d
  1. 2
      src/api/wms/supplierApbalanceMain/index.ts
  2. 14
      src/components/Detail/src/Detail.vue
  3. 3
      src/components/TableFormAdjustment/index.ts
  4. 63
      src/components/TableFormAdjustment/src/AdjustmentDialog.vue
  5. 442
      src/components/TableFormAdjustment/src/TableFormAdjustment.vue
  6. 47
      src/views/wms/supplierManage/supplierApbalance/supplierApbalanceMain/index.vue

2
src/api/wms/supplierApbalanceMain/index.ts

@ -47,7 +47,7 @@ export const createSupplierApbalanceMain = async (data: SupplierApbalanceMainVO)
} }
// 修改供应商余额明细主 // 修改供应商余额明细主
export const updateSupplierApbalanceMain = async (data: SupplierApbalanceMainVO) => { export const updateSupplierApbalanceMain = async (data: any) => {
return await request.put({ url: `/wms/supplier-apbalance-main/update`, data }) return await request.put({ url: `/wms/supplier-apbalance-main/update`, data })
} }

14
src/components/Detail/src/Detail.vue

@ -29,7 +29,7 @@
<!-- 详情 --> <!-- 详情 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!=annexAlias.label&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'&&tabsList[current].label!='主数据'&&!annexTableData.some(item=>item.label==tabsList[current].label)"> <!-- 列表头部 --> <ContentWrap class="w-[100%]" v-show="tabsList[current].label!=annexAlias.label&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'&&tabsList[current].label!='主数据'&&!annexTableData.some(item=>item.label==tabsList[current].label)"> <!-- 列表头部 -->
<TableHead <TableHead
v-if="!isBasic" v-if="!isBasic&&!slotDetailTabList.some(item=>item.label==tabsList[current].label)"
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
:masterId="masterParmas.masterId" :masterId="masterParmas.masterId"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
@ -63,7 +63,7 @@
</template> --> </template> -->
</Table> </Table>
<Table <Table
v-if="!isBasic && fromeWhere != 'countPlan'" v-if="!isBasic && fromeWhere != 'countPlan'&&!slotDetailTabList.some(item=>item.label==tabsList[current].label)"
:columns="detailAllSchemasRef.tableColumns" :columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList" :data="tableObjectRef.tableList"
:loading="tableObjectRef.loading" :loading="tableObjectRef.loading"
@ -85,6 +85,7 @@
/> />
</template> </template>
</Table> </Table>
<slot v-if="slotDetailTabList.some(item=>item.label==tabsList[current].label)" :name="slotDetail.prop" v-for="slotDetail in slotDetailTabList"></slot>
<DetailTable <DetailTable
v-if="!isBasic && fromeWhere == 'countPlan' && isShowDrawer" v-if="!isBasic && fromeWhere == 'countPlan' && isShowDrawer"
:columns="detailAllSchemasRef.tableColumns" :columns="detailAllSchemasRef.tableColumns"
@ -397,6 +398,11 @@ const props = defineProps({
required: false, required: false,
default: () => [] default: () => []
}, },
slotDetailTabList:{
type:Array,
required: false,
default: () => []
},
//-- //--
mainSubmitCreateApi:{ mainSubmitCreateApi:{
type: Boolean, type: Boolean,
@ -441,6 +447,10 @@ if (props.isBasic == true) {
] ]
} }
} }
//
if(props.slotDetailTabList){
tabsList.value = [...tabsList?.value,...props.slotDetailTabList]
}
let otherList = [...props.annexTable,{ let otherList = [...props.annexTable,{

3
src/components/TableFormAdjustment/index.ts

@ -0,0 +1,3 @@
import TableFormAdjustment from './src/TableFormAdjustment.vue'
export { TableFormAdjustment }

63
src/components/TableFormAdjustment/src/AdjustmentDialog.vue

@ -0,0 +1,63 @@
<template>
<Dialog
title="询证函调节表"
:width="960"
v-model="dialogVisible"
:close-on-click-modal="false"
>
<TableFormAdjustment ref="tableFormAdjustment" :rowData="rowData" :isDetail="false" @updateList="updateList"/>
<template #footer>
<slot name="foorter"></slot>
<ButtonBase :Butttondata="[
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]" @button-base-click="buttonBaseClick" />
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableFormAdjustment from './TableFormAdjustment.vue'
const dialogVisible = ref(false)
const rowData = ref({})
const open = (row)=>{
dialogVisible.value = true
nextTick(()=>{
rowData.value = row
})
}
const tableFormAdjustment = ref()
/** 按钮事件 */
const buttonBaseClick = (val) => {
if (val == 'save') {
//
tableFormAdjustment.value.saveData()
} else if (val == 'close') {
//
dialogVisible.value = false
}
}
const updateList = ()=>{
dialogVisible.value = false
emit('updateList')
}
//
const emit = defineEmits([
'updateList',
])
defineExpose({open})
</script>
<style lang="scss" scoped>
.top{
margin-bottom: 20px
}
</style>

442
src/components/TableFormAdjustment/src/TableFormAdjustment.vue

@ -0,0 +1,442 @@
<template>
<!-- <Dialog
title="询证函调节表"
:width="960"
v-model="dialogVisible"
:close-on-click-modal="false"
> -->
<div>
<!-- 顶部 -->
<div class="top" style="display: flex; flex-direction: row;">
<div style="margin-right:5px">
<el-table border class="top-table" :data="topTableData">
<el-table-column
:label="headerItem.label"
:prop="headerItem.field"
:width="headerItem.width"
align="center"
v-for="headerItem in topHeader"
/>
</el-table>
</div>
<div>
<el-table border class="top-table" :data="topTableData">
<el-table-column
:label="headerItem.label"
:prop="headerItem.field"
:width="headerItem.width"
align="center"
v-for="headerItem in topHeader"
/>
</el-table>
</div>
</div>
<!-- 底部 -->
<div class="bottom" style="display: flex; flex-direction: row;">
<!-- - -->
<div style="margin-right:5px">
<el-button type="info" link>调整事项减项以负数列示</el-button>
<el-table border class="top-table" :data="[...bottomLeftTableData,...bottomLeftSumTableData]">
<el-table-column
:label="headerItem.label"
:prop="headerItem.field"
:width="headerItem.width"
align="center"
v-for="headerItem in bottomLeftHeader"
>
<template #default="scope">
<el-input :disabled="isDetail" v-if="!scope.row.isSum&&headerItem.type=='input'" v-model="scope.row[headerItem.field]" :placeholder="`请输入${headerItem.label}`"/>
<el-input-number :disabled="isDetail" v-else-if="!scope.row.disabled&&headerItem.type=='inputnumber'" v-model="scope.row[headerItem.field]" :placeholder="`请输入${headerItem.label}`"/>
<span v-else>{{ scope.row[headerItem.field] }}</span>
</template>
</el-table-column>
</el-table>
<el-form style="margin-top:20px;width:460px" :model="leftForm" :label-width="300" >
<el-form-item label="经办人">
<el-input :disabled="isDetail" v-model="leftForm.name" placeholder="请输入经办人"/>
</el-form-item>
<el-form-item label="对账日期">
<el-date-picker :disabled="isDetail" value-format="YYYY-MM-DD HH:mm:ss"
v-model="leftForm.date"
type="datetime"
placeholder="请选择对账日期"
/>
</el-form-item>
</el-form>
</div>
<!-- - -->
<div>
<el-button type="info" link>调整事项减项以负数列示</el-button>
<el-table border class="top-table" :data="[...bottomRightTableData,...bottomRightSumTableData]">
<el-table-column
:label="headerItem.label"
:prop="headerItem.field"
:width="headerItem.width"
align="center"
v-for="headerItem in bottomRightHeader"
>
<template #default="scope">
<el-input :disabled="isDetail" v-if="!scope.row.isSum&&headerItem.type=='input'" v-model="scope.row[headerItem.field]" :placeholder="`请输入${headerItem.label}`"/>
<el-input-number :disabled="isDetail" v-else-if="!scope.row.disabled&&headerItem.type=='inputnumber'" v-model="scope.row[headerItem.field]" :placeholder="`请输入${headerItem.label}`"/>
<span v-else>{{ scope.row[headerItem.field] }}</span>
</template>
</el-table-column>
</el-table>
<el-form style="margin-top:20px;width:460px" :model="rightForm" :label-width="300" >
<el-form-item label="经办人">
<el-input :disabled="isDetail" v-model="rightForm.name" placeholder="请输入经办人"/>
</el-form-item>
<el-form-item label="对账日期">
<el-date-picker :disabled="isDetail" value-format="YYYY-MM-DD HH:mm:ss"
v-model="rightForm.date"
type="datetime"
placeholder="请选择对账日期"
/>
</el-form-item>
</el-form>
</div>
</div>
</div>
<!-- <template #footer>
<slot name="foorter"></slot>
<ButtonBase :Butttondata="[
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]" @button-base-click="buttonBaseClick" />
</template>
</Dialog> -->
</template>
<script setup lang="ts">
import * as SupplierApbalanceMainApi from '@/api/wms/supplierApbalanceMain'
import dayjs from 'dayjs'
// import * as defaultButtons from '@/utils/disposition/defaultButtons'
const { t } = useI18n() //
const message = useMessage() //
const props = defineProps({
rowData: {
type: Object,
required: true,
default: null
},
adjustmentData: {
type: Object,
required: true,
default: null
},
isDetail: {
type: Boolean,
default: false
}
})
onMounted(()=>{
console.log('rowData',props.rowData)
nextTick(()=>{
setTopHeaderData()
})
})
watch(
() => props.rowData,
() => {
console.log('rowData',props.rowData)
nextTick(()=>{
setTopHeaderData()
})
},
{
deep: true
}
)
//
const topHeader = ref<any>([])
const topTableData = ref<any>([])
const setTopHeaderData = ()=>{
let myData = unref(props.rowData)
console.log('myData',myData)
topHeader.value = [{
label:`单位名称:${myData?.ttSupplierName}`,
field:'name1',
width:260
},{
label:'金额',
field:'price1',
width:100
},{
label:'备注',
field:'remark1',
width:100
}]
topTableData.value = [{
name1:`截止${dayjs(myData?.ttGenerateTime).year()}${dayjs(myData?.ttGenerateTime).month()}${dayjs(myData?.ttGenerateTime).day()}日账面金额如下`,
price1:Number(myData?.ttAccountAp)+Number(myData?.ttAccountOthap),
remark1:myData?.remark,
name2:'截止年月日账面金额如下',
price2:Number(myData?.ttAccountAp)+Number(myData?.ttAccountOthap),
remark2:myData?.remark,
}]
if(props.isDetail){
//
setDetailData()
}
}
const setDetailData = ()=>{
//
let adjustmentData = unref(props.adjustmentData)
if(adjustmentData?.subList){
bottomLeftTableData.value = adjustmentData?.subList?.map((item,index) => ({
index:index+1,
ttAbstractLeft:item?.ttAbstractLeft,
ttBalanceLeft:item?.ttBalanceLeft,
remark:item?.remark
}));
bottomRightTableData.value = adjustmentData?.subList?.map((item,index) => ({
index:index+1,
ttAbstractRight:item?.ttAbstractRight,
ttBalanceRight:item?.ttBalanceRight,
remark:item?.remark
}));
}
// .
leftForm.value = {
name:adjustmentData?.ttOperatorLeft,
date:adjustmentData?.ttDzDateLeft
}
rightForm.value = {
name:adjustmentData?.ttOperatorRight,
date:adjustmentData?.ttDzDateRight
}
}
//
const bottomLeftHeader = ref([{
label:'序号',
field:'index',
width:80
},{
label:'摘要',
field:'ttAbstractLeft',
width:180,
type:'input'
},{
label:'金额',
field:'ttBalanceLeft',
width:200,
type:'inputnumber'
}])
const bottomRightHeader = ref([{
label:'序号',
field:'index',
width:80
},{
label:'摘要',
field:'ttAbstractRight',
width:180,
type:'input'
},{
label:'金额',
field:'ttBalanceRight',
width:200,
type:'inputnumber'
}])
const bottomLeftTableData = ref([{
index:'1',
ttAbstractLeft:'',
ttBalanceLeft:'',
remark:''
},{
index:'2',
ttAbstractLeft:'',
ttBalanceLeft:'',
remark:''
},{
index:'3',
ttAbstractLeft:'',
ttBalanceLeft:'',
remark:''
},{
index:'4',
ttAbstractLeft:'',
ttBalanceLeft:'',
remark:''
},{
index:'5',
ttAbstractLeft:'',
ttBalanceLeft:'',
remark:''
},{
index:'6',
ttAbstractLeft:'',
ttBalanceLeft:'',
remark:''
},{
index:'7',
ttAbstractLeft:'',
ttBalanceLeft:'',
remark:''
},{
index:'8',
ttAbstractLeft:'',
ttBalanceLeft:'',
remark:''
}])
const bottomRightTableData = ref([{
index:'1',
ttAbstractRight:'',
ttBalanceRight:'',
remark:''
},{
index:'2',
ttAbstractRight:'',
ttBalanceRight:'',
remark:''
},{
index:'3',
ttAbstractRight:'',
ttBalanceRight:'',
remark:''
},{
index:'4',
ttAbstractRight:'',
ttBalanceRight:'',
remark:''
},{
index:'5',
ttAbstractRight:'',
ttBalanceRight:'',
remark:''
},{
index:'6',
ttAbstractRight:'',
ttBalanceRight:'',
remark:''
},{
index:'7',
ttAbstractRight:'',
ttBalanceRight:'',
remark:''
},{
index:'8',
ttAbstractRight:'',
ttBalanceRight:'',
remark:''
}])
//
const bottomLeftSumTableData = ref([{
index:'',
ttAbstractLeft:'调整事项合计',
ttBalanceLeft:'',
remark:'',
isSum:true,
disabled:true
},{
index:'',
ttAbstractLeft:'调整后余额',
ttBalanceLeft:'',
remark:'',
isSum:true
}])
watch(
() => bottomLeftTableData.value,
() => {
//
bottomLeftSumTableData.value[0].ttBalanceLeft = bottomLeftTableData.value.reduce((prev, item1) => prev + Number(item1['ttBalanceLeft']),0)
console.log('调整事项合计左',bottomLeftTableData)
//
// bottomLeftSumTableData.value[0].ttBalanceLeft =
},
{
deep: true
}
)
const bottomRightSumTableData = ref([{
index:'',
ttAbstractRight:'调整事项合计',
ttBalanceRight:'',
remark:'',
isSum:true,
disabled:true
},{
index:'',
ttAbstractRight:'调整后余额',
ttBalanceRight:'',
remark:'',
isSum:true
}])
const leftForm = ref({
name:'',
date:''
})
const rightForm = ref({
name:'',
date:''
})
const dialogVisible = ref(false)
const open = ()=>{
dialogVisible.value = true
}
const saveData = async ()=>{
//
let myData = unref(props.rowData)
// [
// {
// masterId:myData.masterId,
// ttAbstractLeft:'',//
// ttBalanceLeft:'',//
// ttAbstractRight:'',//
// ttBalanceRight:'',//
// }
// ]
let subList = bottomLeftTableData.value.map((item,index)=>({
masterId:myData.id,
ttAbstractLeft:item.ttAbstractLeft,
ttBalanceLeft:item.ttBalanceLeft,
ttAbstractRight:bottomRightTableData.value[index].ttAbstractRight,
ttBalanceRight:bottomRightTableData.value[index].ttBalanceRight,
}))
let data = {
id:myData.id,
subList,
ttAdjustmentTotalLeft:bottomLeftSumTableData.value[0].ttBalanceLeft,//
ttAdjustmentBalLeft:bottomLeftSumTableData.value[1].ttBalanceLeft,//
ttOperatorLeft:leftForm.value.name,//
ttDzDateLeft:leftForm.value.date,//
ttAdjustmentTotalRight:bottomRightSumTableData.value[0].ttBalanceRight,//
ttAdjustmentBalRight:bottomRightSumTableData.value[1].ttBalanceRight,//
ttOperatorRight:rightForm.value.name,//
ttDzDateRight:rightForm.value.date,//
}
await SupplierApbalanceMainApi.updateSupplierApbalanceMain(data)
message.success(t('common.updateSuccess'))
console.log('保存数据',saveData)
emit('updateList')
}
//
const emit = defineEmits([
'updateList',
])
defineExpose({open,saveData})
</script>
<style lang="scss" scoped>
.top{
margin-bottom: 20px
}
</style>

47
src/views/wms/supplierManage/supplierApbalance/supplierApbalanceMain/index.vue

@ -61,10 +61,22 @@
:detailButtonIsShowAdd=false :detailButtonIsShowAdd=false
:detailButtonIsShowEdit=false :detailButtonIsShowEdit=false
:detailButtonIsShowDelete=false :detailButtonIsShowDelete=false
/> :slotDetailTabList="[
{
label: '回调函明细',
prop: 'adjustment'
}
]"
>
<template #adjustment>
<TableFormAdjustment :rowData="rowData" :adjustmentData="adjustmentData" :isDetail="true"/>
</template>
</Detail>
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/supplier-apbalance-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/wms/supplier-apbalance-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<AdjustmentDialog ref="adjustment" @updateList="getList"/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -78,6 +90,9 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import * as BasicSpotCheckOptionApi from "@/api/eam/basicSpotCheckOption"; import * as BasicSpotCheckOptionApi from "@/api/eam/basicSpotCheckOption";
import TableFormAdjustment from '@/components/TableFormAdjustment/src/TableFormAdjustment.vue'
import AdjustmentDialog from '@/components/TableFormAdjustment/src/AdjustmentDialog.vue'
import {getJmreportBaseUrl} from "@/utils/systemParam"; import {getJmreportBaseUrl} from "@/utils/systemParam";
import {getAccessToken} from "@/utils/auth"; import {getAccessToken} from "@/utils/auth";
@ -162,7 +177,7 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'print') { // } else if (val == 'print') { //
handlePrint(row) handlePrint(row)
} else if (val == 'replyInput') { // } else if (val == 'replyInput') { //
handleReplyInput(row.id) handleReplyInput(row)
} }
} }
@ -198,8 +213,16 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const rowData = ref({})
const adjustmentData = ref({})
const openDetail = async (row: any, titleName: any, titleValue: any) => {
const res = await SupplierApbalanceMainApi.getSupplierApbalanceMain(row.id)
console.log('res',res)
rowData.value = row
adjustmentData.value = res
detailRef.value.openDetail(row, titleName, titleValue, 'basicSupplierApbalanceMain') detailRef.value.openDetail(row, titleName, titleValue, 'basicSupplierApbalanceMain')
} }
// //
@ -209,20 +232,12 @@ const handlePrint = async (row) => {
window.open(src.value+'&id='+row.id) window.open(src.value+'&id='+row.id)
} }
const adjustment = ref()
// //
const handleReplyInput = async (id: number) => { const handleReplyInput = async (row) => {
try { adjustment.value.open(row)
const params = ref({
id: '',
available:'',
})
params.value.id = id
params.value.available = 'TRUE'
await BasicSpotCheckOptionApi.updateEnableCode(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
} }
/** 删除按钮操作 */ /** 删除按钮操作 */

Loading…
Cancel
Save