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" />
<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
v-if="!isBasic"
:HeadButttondata="HeadButttondata"
@ -97,15 +97,21 @@
</DetailTable>
</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'}">
<Annex v-show="tabsList[current].label=='附件'"
:annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data"
<Annex v-for="(annexItem ,index) in annexTableData" :key="index" v-show="tabsList[current].label==annexItem.label"
:annexData="annexItem"
@handleAnnexSuccess="updateAnnexTableHandle"
@deleteAnnexSuccess="updateAnnexTableHandle"
: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=='备注'"
:remarksData="remarksData"
@ -176,6 +182,12 @@ const props = defineProps({
required: true,
default: null
},
//tab
annexTable: {
type: Array,
required: false,
default: ()=>[]
},
//
isBasic: {
type: Boolean,
@ -334,7 +346,7 @@ if (props.isBasic == true) {
}
}
const otherList = [{
const otherList = [...props.annexTable,{
label:'附件',
prop:'Annex'
},{
@ -373,6 +385,8 @@ const remarkHeight = computed(() => {
const annexData = reactive({
annexList: []
})
//
const annexTableData = ref<Array<any>>([])
//
const remarksData = reactive({
@ -394,6 +408,23 @@ const getFileList = async () => {
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 = () => {
getFileList()
@ -404,6 +435,11 @@ const deleteAnnexSuccess = async () => {
getFileList()
getChangeRecordList()
}
/** 追加的附件 */
const updateAnnexTableHandle = () => {
getAnnexFileList()
getChangeRecordList()
}
// Tabs
const current = ref(0)
@ -481,6 +517,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
detailData.value = row
getRemarkList()
getFileList()
getAnnexFileList()
getChangeRecordList()
//
let detailButtonFilter: any = []

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

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

Loading…
Cancel
Save