Browse Source

采购收获管理--供应商发票申请:1、新增--添加明细多选以及直接展示SearchTable 2、详情--添加合同附件 电子发票附件 货运单附件

master_hella_20240701
yufei0306 8 months ago
parent
commit
bf091befbe
  1. 53
      src/components/Detail/src/Detail.vue
  2. 50
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  3. 1
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

53
src/components/Detail/src/Detail.vue

@ -28,7 +28,7 @@
<Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" /> <Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" />
<div class="flex"> <div class="flex">
<!-- 详情 --> <!-- 详情 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!='附件'&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'"> <!-- 列表头部 --> <ContentWrap class="w-[100%]" v-show="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"
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@ -97,15 +97,21 @@
</DetailTable> </DetailTable>
</ContentWrap> </ContentWrap>
<!-- 附件/备注/变更记录 --> <!-- 附件/备注/变更记录 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}"> <ContentWrap class="w-[100%]" v-show="annexTableData.some(item=>item.label==tabsList[current].label)||tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}">
<!-- 附件组件 --> <!-- 附件组件 -->
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}"> <ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}">
<Annex v-show="tabsList[current].label=='附件'" <Annex v-for="(annexItem ,index) in annexTableData" :key="index" v-show="tabsList[current].label==annexItem.label"
:annexData="annexData" :annexData="annexItem"
@handleAnnexSuccess="handleAnnexSuccess" @handleAnnexSuccess="updateAnnexTableHandle"
@deleteAnnexSuccess="deleteAnnexSuccess" @deleteAnnexSuccess="updateAnnexTableHandle"
:upData="remarksData.data" :upData="{...remarksData.data,tableName:annexItem.tableName}"
/> />
<Annex v-show="tabsList[current].label=='附件'"
:annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data"
/>
<!-- 备注组件 --> <!-- 备注组件 -->
<Remarks v-show="tabsList[current].label=='备注'" <Remarks v-show="tabsList[current].label=='备注'"
:remarksData="remarksData" :remarksData="remarksData"
@ -176,6 +182,12 @@ const props = defineProps({
required: true, required: true,
default: null default: null
}, },
//tab
annexTable: {
type: Array,
required: false,
default: ()=>[]
},
// //
isBasic: { isBasic: {
type: Boolean, type: Boolean,
@ -334,7 +346,7 @@ if (props.isBasic == true) {
} }
} }
const otherList = [{ const otherList = [...props.annexTable,{
label:'附件', label:'附件',
prop:'Annex' prop:'Annex'
},{ },{
@ -373,6 +385,8 @@ const remarkHeight = computed(() => {
const annexData = reactive({ const annexData = reactive({
annexList: [] annexList: []
}) })
//
const annexTableData = ref<Array<any>>([])
// //
const remarksData = reactive({ const remarksData = reactive({
@ -394,6 +408,23 @@ const getFileList = async () => {
detailLoading.value = false detailLoading.value = false
} }
} }
//
const getAnnexFileList = async () => {
props.annexTable?.forEach(async (item) => {
let requstData = {...remarksData.data,tableName: item?.tableName}
const annexList = await FileApi.getFileList(requstData)
const annexData = annexTableData.value.find(annex=>annex.label === item.label)
if(annexData){
annexData.annexList = annexList
}else{
annexTableData.value.push({
label: item.label,
tableName: item?.tableName || '',
annexList
})
}
})
}
/** 添加附件 */ /** 添加附件 */
const handleAnnexSuccess = () => { const handleAnnexSuccess = () => {
getFileList() getFileList()
@ -404,6 +435,11 @@ const deleteAnnexSuccess = async () => {
getFileList() getFileList()
getChangeRecordList() getChangeRecordList()
} }
/** 追加的附件 */
const updateAnnexTableHandle = () => {
getAnnexFileList()
getChangeRecordList()
}
// Tabs // Tabs
const current = ref(0) const current = ref(0)
@ -481,6 +517,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
detailData.value = row detailData.value = row
getRemarkList() getRemarkList()
getFileList() getFileList()
getAnnexFileList()
getChangeRecordList() getChangeRecordList()
// //
let detailButtonFilter: any = [] let detailButtonFilter: any = []

50
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

@ -35,6 +35,8 @@
<BasicForm <BasicForm
ref="formRef" ref="formRef"
@success="getList" @success="getList"
:isOpenSearchTable="true"
:indexTableColumn="1"
:rules="SupplierinvoiceRequestMainRules" :rules="SupplierinvoiceRequestMainRules"
:formAllSchemas="SupplierinvoiceRequestMain.allSchemas" :formAllSchemas="SupplierinvoiceRequestMain.allSchemas"
:searchTableParams="searchTableParams" :searchTableParams="searchTableParams"
@ -51,8 +53,21 @@
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
ref="detailRef" ref="detailRef"
:annexTable="[{
label: '合同附件',
prop: 'Annex',
tableName:'contract'
},{
label: '电子发票附件',
prop: 'Annex',
tableName:'invoice'
},{
label: '货运单附件',
prop: 'Annex',
tableName:'waybill'
}]"
:isBasic="false" :isBasic="false"
:allSchemas="SupplierinvoiceRequestMain.allSchemas" :allSchemas="SupplierinvoiceRequestMain.allSchemas"
:detailAllSchemas="SupplierinvoiceRequestDetail.allSchemas" :detailAllSchemas="SupplierinvoiceRequestDetail.allSchemas"
@ -121,20 +136,25 @@
nextTick(() => { nextTick(() => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] val.forEach(item=>{
if (formField == 'poLine') { const newRow = {...row}
row['poNumber'] = val[0]['poNumber'] newRow[formField] = item[searchField]
row['poLine'] = val[0]['poLine'] if (formField == 'poLine') {
row['tax'] = val[0]['tax'] newRow['poNumber'] = item['poNumber']
row['projectCode'] = val[0]['projectCode'] newRow['poLine'] = item['poLine']
row['billType'] = val[0]['billType'] newRow['tax'] =item['tax']
row['recvBillNum'] = val[0]['recvBillNum'] newRow['projectCode'] = item['projectCode']
row['asnBillNum'] = val[0]['asnBillNum'] newRow['billType'] = item['billType']
row['supplierCode'] = val[0]['supplierCode'] newRow['recvBillNum'] = item['recvBillNum']
row['purchasePrice'] = val[0]['purchasePrice'] newRow['asnBillNum'] = item['asnBillNum']
row['invoicableQuantity'] = val[0]['invoicableQuantity'] newRow['supplierCode'] = item['supplierCode']
row['itemCode'] = val[0]['itemCode'] newRow['purchasePrice'] = item['purchasePrice']
} newRow['invoicableQuantity'] = item['invoicableQuantity']
newRow['itemCode'] = item['itemCode']
}
tableData.value.push(newRow)
})
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]

1
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

@ -591,6 +591,7 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
} }
}, },
tableForm: { tableForm: {
multiple:true,//多选
isInpuFocusShow: true, isInpuFocusShow: true,
searchListPlaceholder: '请选择订单行', searchListPlaceholder: '请选择订单行',
searchField: 'poLine', searchField: 'poLine',

Loading…
Cancel
Save