|
@ -1,7 +1,11 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search :schema="SupplierinvoiceRequestMain.allSchemas.searchSchema" @search="searchList" @reset="searchList" /> |
|
|
<Search |
|
|
|
|
|
:schema="SupplierinvoiceRequestMain.allSchemas.searchSchema" |
|
|
|
|
|
@search="searchList" |
|
|
|
|
|
@reset="searchList" |
|
|
|
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
@ -12,17 +16,23 @@ |
|
|
@updataTableColumns="updataTableColumns" |
|
|
@updataTableColumns="updataTableColumns" |
|
|
@searchFormClick="searchFormClick" |
|
|
@searchFormClick="searchFormClick" |
|
|
:allSchemas="SupplierinvoiceRequestMain.allSchemas" |
|
|
:allSchemas="SupplierinvoiceRequestMain.allSchemas" |
|
|
|
|
|
|
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<Table ref="tableRef" |
|
|
<Table |
|
|
|
|
|
ref="tableRef" |
|
|
:selection="true" |
|
|
:selection="true" |
|
|
:selectionColor="true" |
|
|
:selectionColor="true" |
|
|
v-clientTable :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{ |
|
|
v-clientTable |
|
|
|
|
|
:columns="tableColumns" |
|
|
|
|
|
:data="tableObject.tableList" |
|
|
|
|
|
:loading="tableObject.loading" |
|
|
|
|
|
:pagination="{ |
|
|
total: tableObject.total |
|
|
total: tableObject.total |
|
|
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" |
|
|
}" |
|
|
|
|
|
v-model:pageSize="tableObject.pageSize" |
|
|
|
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:sort="tableObject.sort" |
|
|
v-model:sort="tableObject.sort" |
|
|
@getSelectionRows="getSelectionRows" |
|
|
@getSelectionRows="getSelectionRows" |
|
|
> |
|
|
> |
|
@ -32,10 +42,15 @@ |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
<template #differencePrice="{ row }"> |
|
|
<template #differencePrice="{ row }"> |
|
|
<span :class="{'red-text':row.differencePrice!=0}">{{ Number(row.differencePrice).toFixed(5) }}</span> |
|
|
<span :class="{ 'red-text': row.differencePrice != 0 }">{{ |
|
|
|
|
|
Number(row.differencePrice).toFixed(5) |
|
|
|
|
|
}}</span> |
|
|
</template> |
|
|
</template> |
|
|
<template #action="{ row, $index }"> |
|
|
<template #action="{ row, $index }"> |
|
|
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<ButtonBase |
|
|
|
|
|
:Butttondata="butttondata(row, $index)" |
|
|
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
@ -53,10 +68,29 @@ |
|
|
:tableAllSchemas="SupplierinvoiceRequestDetail.allSchemas" |
|
|
:tableAllSchemas="SupplierinvoiceRequestDetail.allSchemas" |
|
|
:tableFormRules="SupplierinvoiceRequestDetailRules" |
|
|
:tableFormRules="SupplierinvoiceRequestDetailRules" |
|
|
:tableData="tableData" |
|
|
:tableData="tableData" |
|
|
:sumFormDataByForm ="(formRef,formModel,tableData,formType,originFormModel,updateOriginFormModel,sumFormDataHandle1)=>{ |
|
|
:sumFormDataByForm=" |
|
|
const {taxRate=0,amount=0,taxAmount=0,beforeTaxAmount=0,totalTaxAmount=0,discountAmount1=0,beforeTaxDiffAmount=0,taxAmountDiff=0} = formModel |
|
|
( |
|
|
|
|
|
formRef, |
|
|
|
|
|
formModel, |
|
|
|
|
|
tableData, |
|
|
|
|
|
formType, |
|
|
|
|
|
originFormModel, |
|
|
|
|
|
updateOriginFormModel, |
|
|
|
|
|
sumFormDataHandle1 |
|
|
|
|
|
) => { |
|
|
|
|
|
const { |
|
|
|
|
|
taxRate = 0, |
|
|
|
|
|
amount = 0, |
|
|
|
|
|
taxAmount = 0, |
|
|
|
|
|
beforeTaxAmount = 0, |
|
|
|
|
|
totalTaxAmount = 0, |
|
|
|
|
|
discountAmount1 = 0, |
|
|
|
|
|
beforeTaxDiffAmount = 0, |
|
|
|
|
|
taxAmountDiff = 0 |
|
|
|
|
|
} = formModel |
|
|
// 2、系统税额:每条数据的合同价格X可开票数量,计算结果取两位小数之后*税率的计算结果,再保留2位。所有子表数据再求和 |
|
|
// 2、系统税额:每条数据的合同价格X可开票数量,计算结果取两位小数之后*税率的计算结果,再保留2位。所有子表数据再求和 |
|
|
if(formType=='update'){ // 编辑 |
|
|
if (formType == 'update') { |
|
|
|
|
|
// 编辑 |
|
|
console.log('taxRate', taxRate) |
|
|
console.log('taxRate', taxRate) |
|
|
console.log('originFormModel', originFormModel.taxRate) |
|
|
console.log('originFormModel', originFormModel.taxRate) |
|
|
console.log('taxAmount', taxAmount) |
|
|
console.log('taxAmount', taxAmount) |
|
@ -73,10 +107,22 @@ |
|
|
taxAmountDiff: totalTaxAmount - taxAmount, // 税额差异:税额-系统税额 |
|
|
taxAmountDiff: totalTaxAmount - taxAmount, // 税额差异:税额-系统税额 |
|
|
totalTaxDiffAmount: beforeTaxDiffAmount + taxAmountDiff // 价税合计差额=未税差额+税额差异 |
|
|
totalTaxDiffAmount: beforeTaxDiffAmount + taxAmountDiff // 价税合计差额=未税差额+税额差异 |
|
|
}) |
|
|
}) |
|
|
}else if(formType=='create'){ // 新增 |
|
|
} else if (formType == 'create') { |
|
|
|
|
|
// 新增 |
|
|
let taxAmount_ = taxAmount |
|
|
let taxAmount_ = taxAmount |
|
|
if (taxRate != originFormModel.taxRate) { |
|
|
if (taxRate != originFormModel.taxRate) { |
|
|
taxAmount_ = tableData.reduce((prev, item) => prev + Number(Number(taxRate*0.01*Number(Number(item['singlePrice']*item['invoicableQuantity']).toFixed(2))).toFixed(2)),0) |
|
|
taxAmount_ = tableData.reduce( |
|
|
|
|
|
(prev, item) => |
|
|
|
|
|
prev + |
|
|
|
|
|
Number( |
|
|
|
|
|
Number( |
|
|
|
|
|
taxRate * |
|
|
|
|
|
0.01 * |
|
|
|
|
|
Number(Number(item['singlePrice'] * item['invoicableQuantity']).toFixed(2)) |
|
|
|
|
|
).toFixed(2) |
|
|
|
|
|
), |
|
|
|
|
|
0 |
|
|
|
|
|
) |
|
|
updateOriginFormModel(formModel) |
|
|
updateOriginFormModel(formModel) |
|
|
} |
|
|
} |
|
|
formRef.value.setValues({ |
|
|
formRef.value.setValues({ |
|
@ -88,19 +134,34 @@ |
|
|
totalTaxDiffAmount: beforeTaxDiffAmount + taxAmountDiff // 价税合计差额=未税差额+税额差异 |
|
|
totalTaxDiffAmount: beforeTaxDiffAmount + taxAmountDiff // 价税合计差额=未税差额+税额差异 |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
}" |
|
|
" |
|
|
|
|
|
:sumFormDataByTableCustom=" |
|
|
:sumFormDataByTableCustom ="(formRef,formModel,tableData)=>{ |
|
|
(formRef, formModel, tableData) => { |
|
|
// 1、系统未税金额: 合同价格X可开票数量。每条数据的合同价格X可开票数量,计算结果取两位小数之后,求和 |
|
|
// 1、系统未税金额: 合同价格X可开票数量。每条数据的合同价格X可开票数量,计算结果取两位小数之后,求和 |
|
|
const { taxRate = 0 } = formModel |
|
|
const { taxRate = 0 } = formModel |
|
|
const sumObject = { |
|
|
const sumObject = { |
|
|
amount:tableData.reduce((prev, item) => prev + Number(Number(item['singlePrice']*item['invoicableQuantity']).toFixed(2)),0), |
|
|
amount: tableData.reduce( |
|
|
taxAmount:tableData.reduce((prev, item) => prev + Number(Number(taxRate*0.01*Number(Number(item['singlePrice']*item['invoicableQuantity']).toFixed(2))).toFixed(2)),0) |
|
|
(prev, item) => |
|
|
|
|
|
prev + Number(Number(item['singlePrice'] * item['invoicableQuantity']).toFixed(2)), |
|
|
|
|
|
0 |
|
|
|
|
|
), |
|
|
|
|
|
taxAmount: tableData.reduce( |
|
|
|
|
|
(prev, item) => |
|
|
|
|
|
prev + |
|
|
|
|
|
Number( |
|
|
|
|
|
Number( |
|
|
|
|
|
taxRate * |
|
|
|
|
|
0.01 * |
|
|
|
|
|
Number(Number(item['singlePrice'] * item['invoicableQuantity']).toFixed(2)) |
|
|
|
|
|
).toFixed(2) |
|
|
|
|
|
), |
|
|
|
|
|
0 |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
formRef.value.setValues(sumObject) |
|
|
formRef.value.setValues(sumObject) |
|
|
}" |
|
|
} |
|
|
|
|
|
" |
|
|
:apiUpdate="SupplierinvoiceRequestMainApi.updateSupplierinvoiceRequestMain" |
|
|
:apiUpdate="SupplierinvoiceRequestMainApi.updateSupplierinvoiceRequestMain" |
|
|
:apiCreate="SupplierinvoiceRequestMainApi.createSupplierinvoiceRequestMain" |
|
|
:apiCreate="SupplierinvoiceRequestMainApi.createSupplierinvoiceRequestMain" |
|
|
:isBusiness="true" |
|
|
:isBusiness="true" |
|
@ -112,10 +173,22 @@ |
|
|
@submitForm="submitForm" |
|
|
@submitForm="submitForm" |
|
|
@sumFormDataHandle="sumFormDataHandle" |
|
|
@sumFormDataHandle="sumFormDataHandle" |
|
|
> |
|
|
> |
|
|
|
|
|
|
|
|
<template #selectionsActionspoLine="{ selections }"> |
|
|
<template #selectionsActionspoLine="{ selections }"> |
|
|
<div style="text-align: left; margin-right: 10px"> |
|
|
<div style="text-align: left; margin-right: 10px"> |
|
|
系统未税金额:{{Number(selections.reduce((prev, item) => prev + Number(Number(Number(Number(item['purchasePrice']).toFixed(5))*item['invoicableQuantity']).toFixed(2)),0)).toFixed(2)}} |
|
|
系统未税金额:{{ |
|
|
|
|
|
Number( |
|
|
|
|
|
selections.reduce( |
|
|
|
|
|
(prev, item) => |
|
|
|
|
|
prev + |
|
|
|
|
|
Number( |
|
|
|
|
|
Number( |
|
|
|
|
|
Number(Number(item['purchasePrice']).toFixed(5)) * item['invoicableQuantity'] |
|
|
|
|
|
).toFixed(2) |
|
|
|
|
|
), |
|
|
|
|
|
0 |
|
|
|
|
|
) |
|
|
|
|
|
).toFixed(2) |
|
|
|
|
|
}} |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<!-- <template #foorter> |
|
|
<!-- <template #foorter> |
|
@ -124,7 +197,11 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> --> |
|
|
</template> --> |
|
|
<template v-slot="{ row }"> |
|
|
<template v-slot="{ row }"> |
|
|
<el-input :disabled="true" :class="{'is-red': row['singlePrice'] - row['purchasePrice'] > 0}" :modelValue="((row['singlePrice']) - (row['purchasePrice'])).toFixed(5)"/> |
|
|
<el-input |
|
|
|
|
|
:disabled="true" |
|
|
|
|
|
:class="{ 'is-red': row['singlePrice'] - row['purchasePrice'] > 0 }" |
|
|
|
|
|
:modelValue="(row['singlePrice'] - row['purchasePrice']).toFixed(5)" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</BasicForm> |
|
|
</BasicForm> |
|
|
|
|
|
|
|
@ -158,7 +235,8 @@ |
|
|
hidden: true, |
|
|
hidden: true, |
|
|
label: t('ts.其他附件') |
|
|
label: t('ts.其他附件') |
|
|
}" |
|
|
}" |
|
|
:otherHeadButttonData="[{ |
|
|
:otherHeadButttonData="[ |
|
|
|
|
|
{ |
|
|
label: t('ts.打印明细'), |
|
|
label: t('ts.打印明细'), |
|
|
name: 'printing', |
|
|
name: 'printing', |
|
|
hide: false, |
|
|
hide: false, |
|
@ -167,7 +245,8 @@ |
|
|
color: '', |
|
|
color: '', |
|
|
float: 'left', |
|
|
float: 'left', |
|
|
hasPermi: '' |
|
|
hasPermi: '' |
|
|
},{ |
|
|
}, |
|
|
|
|
|
{ |
|
|
label: t('ts.打印全部发货单'), |
|
|
label: t('ts.打印全部发货单'), |
|
|
name: 'printing-all', |
|
|
name: 'printing-all', |
|
|
hide: false, |
|
|
hide: false, |
|
@ -176,7 +255,8 @@ |
|
|
color: '', |
|
|
color: '', |
|
|
float: 'left', |
|
|
float: 'left', |
|
|
hasPermi: '' |
|
|
hasPermi: '' |
|
|
},{ |
|
|
}, |
|
|
|
|
|
{ |
|
|
label: t('ts.导出明细'), |
|
|
label: t('ts.导出明细'), |
|
|
name: 'export-detail', |
|
|
name: 'export-detail', |
|
|
hide: false, |
|
|
hide: false, |
|
@ -185,8 +265,10 @@ |
|
|
color: '', |
|
|
color: '', |
|
|
float: 'left', |
|
|
float: 'left', |
|
|
hasPermi: '' |
|
|
hasPermi: '' |
|
|
}]" |
|
|
} |
|
|
:buttondataTable = "[{ |
|
|
]" |
|
|
|
|
|
:buttondataTable="[ |
|
|
|
|
|
{ |
|
|
label: t('ts.打印'), |
|
|
label: t('ts.打印'), |
|
|
name: 'print', |
|
|
name: 'print', |
|
|
hide: true, |
|
|
hide: true, |
|
@ -196,13 +278,16 @@ |
|
|
float: 'left', |
|
|
float: 'left', |
|
|
link: true, // 文本展现按钮 |
|
|
link: true, // 文本展现按钮 |
|
|
hasPermi: '' |
|
|
hasPermi: '' |
|
|
}]" |
|
|
} |
|
|
:sumFormDataByForm ="(formRef,formModel)=>{ |
|
|
]" |
|
|
|
|
|
:sumFormDataByForm=" |
|
|
|
|
|
(formRef, formModel) => { |
|
|
const { singlePrice = 0, purchasePrice = 0 } = formModel |
|
|
const { singlePrice = 0, purchasePrice = 0 } = formModel |
|
|
formRef.value.setValues({ |
|
|
formRef.value.setValues({ |
|
|
differencePrice: Number((Number(singlePrice) - Number(purchasePrice)).toFixed(5)) |
|
|
differencePrice: Number((Number(singlePrice) - Number(purchasePrice)).toFixed(5)) |
|
|
}) |
|
|
}) |
|
|
}" |
|
|
} |
|
|
|
|
|
" |
|
|
:isBasic="false" |
|
|
:isBasic="false" |
|
|
:allSchemas="SupplierinvoiceRequestDetailMain.allSchemas" |
|
|
:allSchemas="SupplierinvoiceRequestDetailMain.allSchemas" |
|
|
:detailAllSchemas="SupplierinvoiceRequestDetail.allSchemas" |
|
|
:detailAllSchemas="SupplierinvoiceRequestDetail.allSchemas" |
|
@ -238,14 +323,14 @@ |
|
|
:coverIsDisable="true" |
|
|
:coverIsDisable="true" |
|
|
:mode="2" |
|
|
:mode="2" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
</template> |
|
|
</template> |
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import dayjs from 'dayjs' |
|
|
import dayjs from 'dayjs' |
|
|
// 供应商发票申请 |
|
|
// 供应商发票申请 |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
import { SupplierinvoiceRequestMain, |
|
|
import { |
|
|
|
|
|
SupplierinvoiceRequestMain, |
|
|
SupplierinvoiceRequestMainRules, |
|
|
SupplierinvoiceRequestMainRules, |
|
|
SupplierinvoiceRequestDetail, |
|
|
SupplierinvoiceRequestDetail, |
|
|
SupplierinvoiceRequestDetailRules, |
|
|
SupplierinvoiceRequestDetailRules, |
|
@ -297,8 +382,8 @@ const searchList = (model)=>{ |
|
|
const selectionRows = ref<any>([]) |
|
|
const selectionRows = ref<any>([]) |
|
|
const tableRef = ref() |
|
|
const tableRef = ref() |
|
|
const getSelectionRows = (currentPage, currentPageSelectionRows) => { |
|
|
const getSelectionRows = (currentPage, currentPageSelectionRows) => { |
|
|
console.log("getSelectionRows",currentPage,currentPageSelectionRows) |
|
|
console.log('getSelectionRows', currentPage, currentPageSelectionRows) |
|
|
const currentRows = selectionRows.value.find(item=>item.currentPage==currentPage) |
|
|
const currentRows = selectionRows.value.find((item) => item.currentPage == currentPage) |
|
|
if (currentRows) { |
|
|
if (currentRows) { |
|
|
currentRows.selectionRows = currentPageSelectionRows |
|
|
currentRows.selectionRows = currentPageSelectionRows |
|
|
} else { |
|
|
} else { |
|
@ -312,9 +397,15 @@ const handleMainFefresh = ()=>{ |
|
|
getList() |
|
|
getList() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const searchTableSuccessDetail = async (formField, searchField, val, formRef,searchTableFormModel)=>{ |
|
|
const searchTableSuccessDetail = async ( |
|
|
|
|
|
formField, |
|
|
|
|
|
searchField, |
|
|
|
|
|
val, |
|
|
|
|
|
formRef, |
|
|
|
|
|
searchTableFormModel |
|
|
|
|
|
) => { |
|
|
console.log('详情', formField, searchField, val, formRef, searchTableFormModel) |
|
|
console.log('详情', formField, searchField, val, formRef, searchTableFormModel) |
|
|
val.forEach(item=>{ |
|
|
val.forEach((item) => { |
|
|
item.deliveryDate = item['prhRcpDate'] |
|
|
item.deliveryDate = item['prhRcpDate'] |
|
|
item.arrivalQty = item['prhRcvd'] |
|
|
item.arrivalQty = item['prhRcvd'] |
|
|
}) |
|
|
}) |
|
@ -342,8 +433,14 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
if (type == 'tableForm') { |
|
|
if (type == 'tableForm') { |
|
|
// 明细查询页赋值 |
|
|
// 明细查询页赋值 |
|
|
val.forEach(item=>{ |
|
|
val.forEach((item) => { |
|
|
if(tableData.value.find(item1=>item1['recvBillNum'] == item['recvBillNum']&&item1['poLine'] == item['poLine'])) return |
|
|
if ( |
|
|
|
|
|
tableData.value.find( |
|
|
|
|
|
(item1) => |
|
|
|
|
|
item1['recvBillNum'] == item['recvBillNum'] && item1['poLine'] == item['poLine'] |
|
|
|
|
|
) |
|
|
|
|
|
) |
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
const newRow = { ...row } |
|
|
const newRow = { ...row } |
|
|
newRow[formField] = item[searchField] |
|
|
newRow[formField] = item[searchField] |
|
@ -365,14 +462,15 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea |
|
|
newRow['arrivalQty'] = item['prhRcvd'] |
|
|
newRow['arrivalQty'] = item['prhRcvd'] |
|
|
newRow['id'] = item['id'] |
|
|
newRow['id'] = item['id'] |
|
|
newRow['currency'] = item['currency'] |
|
|
newRow['currency'] = item['currency'] |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
tableData.value.push(newRow) |
|
|
tableData.value.push(newRow) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
// 切换供应商代码 |
|
|
// 切换供应商代码 |
|
|
if(formField=='supplierCode'&&val[0][searchField]!=searchFormRef.formModel.supplierCode){ |
|
|
if ( |
|
|
|
|
|
formField == 'supplierCode' && |
|
|
|
|
|
val[0][searchField] != searchFormRef.formModel.supplierCode |
|
|
|
|
|
) { |
|
|
tableData.value = [] |
|
|
tableData.value = [] |
|
|
} |
|
|
} |
|
|
// 切换订单类型 |
|
|
// 切换订单类型 |
|
@ -402,7 +500,7 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea |
|
|
defaultButtons.mainLisSelectiontPointBtn(null), // 批量打印 |
|
|
defaultButtons.mainLisSelectiontPointBtn(null), // 批量打印 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
// { |
|
|
// { |
|
|
// label: '自定义扩展按钮', |
|
|
// label: '自定义扩展按钮', |
|
|
// name: 'zdy', |
|
|
// name: 'zdy', |
|
@ -415,15 +513,20 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea |
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'add') { |
|
|
|
|
|
// 新增 |
|
|
openForm('create') |
|
|
openForm('create') |
|
|
} else if (val == 'import') { // 导入 |
|
|
} else if (val == 'import') { |
|
|
|
|
|
// 导入 |
|
|
handleImport() |
|
|
handleImport() |
|
|
} else if (val == 'export') { // 导出 |
|
|
} else if (val == 'export') { |
|
|
|
|
|
// 导出 |
|
|
handleExport() |
|
|
handleExport() |
|
|
} else if (val=='selection_point'){// 批量打印 |
|
|
} else if (val == 'selection_point') { |
|
|
|
|
|
// 批量打印 |
|
|
handleSelectionPoint() |
|
|
handleSelectionPoint() |
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
} else if (val == 'refresh') { |
|
|
|
|
|
// 刷新 |
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0) { |
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0) { |
|
|
searchFormClick({ |
|
|
searchFormClick({ |
|
|
filters: tableObject.params.filters |
|
|
filters: tableObject.params.filters |
|
@ -431,8 +534,10 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea |
|
|
} else { |
|
|
} else { |
|
|
getList() |
|
|
getList() |
|
|
} |
|
|
} |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else if (val == 'filtrate') { |
|
|
} else { // 其他按钮 |
|
|
// 筛选 |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他按钮 |
|
|
console.log('其他按钮', item) |
|
|
console.log('其他按钮', item) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -450,7 +555,10 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea |
|
|
const butttondata = (row, $index) => { |
|
|
const butttondata = (row, $index) => { |
|
|
return [ |
|
|
return [ |
|
|
// defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['9']) ,hasPermi: 'wms:supplierinvoice-request-main:open'}), // 打开 |
|
|
// defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['9']) ,hasPermi: 'wms:supplierinvoice-request-main:open'}), // 打开 |
|
|
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1','6']),hasPermi: 'wms:supplierinvoice-request-main:sub' }), // 提交审批 |
|
|
defaultButtons.mainListPlanSubBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['1', '6']), |
|
|
|
|
|
hasPermi: 'wms:supplierinvoice-request-main:sub' |
|
|
|
|
|
}), // 提交审批 |
|
|
{ |
|
|
{ |
|
|
label: t('ts.查看明细'), |
|
|
label: t('ts.查看明细'), |
|
|
name: 'open_detail', |
|
|
name: 'open_detail', |
|
@ -458,8 +566,9 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea |
|
|
icon: '', |
|
|
icon: '', |
|
|
color: '', |
|
|
color: '', |
|
|
hasPermi: '', |
|
|
hasPermi: '', |
|
|
link: true, // 文本展现按钮 |
|
|
link: true // 文本展现按钮 |
|
|
},{ |
|
|
}, |
|
|
|
|
|
{ |
|
|
label: t('ts.采购通过'), |
|
|
label: t('ts.采购通过'), |
|
|
name: 'purchase_mainPlanSub', |
|
|
name: 'purchase_mainPlanSub', |
|
|
hide: !(!isShowMainButton(row, ['2']) && row.currentIsProcurementCreator == true), |
|
|
hide: !(!isShowMainButton(row, ['2']) && row.currentIsProcurementCreator == true), |
|
@ -467,8 +576,9 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea |
|
|
icon: '', |
|
|
icon: '', |
|
|
color: '', |
|
|
color: '', |
|
|
hasPermi: 'wms:supplierinvoice-request-main:app', |
|
|
hasPermi: 'wms:supplierinvoice-request-main:app', |
|
|
link: true, // 文本展现按钮 |
|
|
link: true // 文本展现按钮 |
|
|
},{ |
|
|
}, |
|
|
|
|
|
{ |
|
|
label: t('ts.采购驳回'), |
|
|
label: t('ts.采购驳回'), |
|
|
name: 'purchase_mainPlanTur', |
|
|
name: 'purchase_mainPlanTur', |
|
|
hide: !(!isShowMainButton(row, ['2']) && row.currentIsProcurementCreator == true), |
|
|
hide: !(!isShowMainButton(row, ['2']) && row.currentIsProcurementCreator == true), |
|
@ -494,8 +604,9 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea |
|
|
icon: '', |
|
|
icon: '', |
|
|
color: '', |
|
|
color: '', |
|
|
hasPermi: 'wms:supplierinvoice-request-main:financeApp', |
|
|
hasPermi: 'wms:supplierinvoice-request-main:financeApp', |
|
|
link: true, // 文本展现按钮 |
|
|
link: true // 文本展现按钮 |
|
|
},{ |
|
|
}, |
|
|
|
|
|
{ |
|
|
label: t('ts.财务驳回'), |
|
|
label: t('ts.财务驳回'), |
|
|
name: 'finance_mainPlanTur', |
|
|
name: 'finance_mainPlanTur', |
|
|
hide: isShowMainButton(row, ['4']), |
|
|
hide: isShowMainButton(row, ['4']), |
|
@ -504,7 +615,10 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea |
|
|
link: true, // 文本展现按钮 |
|
|
link: true, // 文本展现按钮 |
|
|
hasPermi: 'wms:supplierinvoice-request-main:financeRej' |
|
|
hasPermi: 'wms:supplierinvoice-request-main:financeRej' |
|
|
}, |
|
|
}, |
|
|
defaultButtons.mainListEditBtn({ hasPermi: 'wms:supplierinvoice-request-main:update' , hide: isShowMainButton(row, ['1','3','6','7'])}), // 编辑 |
|
|
defaultButtons.mainListEditBtn({ |
|
|
|
|
|
hasPermi: 'wms:supplierinvoice-request-main:update', |
|
|
|
|
|
hide: isShowMainButton(row, ['1', '3', '6', '7']) |
|
|
|
|
|
}), // 编辑 |
|
|
// defaultButtons.mainListPurchasePlanCloBtn({ hasPermi: 'wms:supplierinvoice-request-main:close' ,hide: isShowMainButton(row, ['1','3','6','7']) }), // 关闭 |
|
|
// defaultButtons.mainListPurchasePlanCloBtn({ hasPermi: 'wms:supplierinvoice-request-main:close' ,hide: isShowMainButton(row, ['1','3','6','7']) }), // 关闭 |
|
|
{ |
|
|
{ |
|
|
label: t('ts.作废'), |
|
|
label: t('ts.作废'), |
|
@ -536,49 +650,78 @@ const handleImport = () => { |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'mainPurPlanOpe') { // 打开 |
|
|
if (val == 'mainPurPlanOpe') { |
|
|
|
|
|
// 打开 |
|
|
handleOpe(row.id) |
|
|
handleOpe(row.id) |
|
|
} else if (val == 'mainPurPlanClo') {// 关闭 |
|
|
} else if (val == 'mainPurPlanClo') { |
|
|
|
|
|
// 关闭 |
|
|
handleClo(row.id) |
|
|
handleClo(row.id) |
|
|
} else if (val == 'mainPlanSub') { // 提交审批 |
|
|
} else if (val == 'mainPlanSub') { |
|
|
|
|
|
// 提交审批 |
|
|
handleSub(row.id) |
|
|
handleSub(row.id) |
|
|
} else if (val == 'open_detail') { // 查看明细 |
|
|
} else if (val == 'open_detail') { |
|
|
|
|
|
// 查看明细 |
|
|
openDetail(row, '单据号', row.number) |
|
|
openDetail(row, '单据号', row.number) |
|
|
}else if (val == 'purchase_mainPlanSub') { // 采购审批通过 |
|
|
} else if (val == 'purchase_mainPlanSub') { |
|
|
|
|
|
// 采购审批通过 |
|
|
// handleApp(row.id) |
|
|
// handleApp(row.id) |
|
|
if (row.balanceStatementStatus) { |
|
|
if (row.balanceStatementStatus) { |
|
|
formPurchasePassRef.value.open('update', row, null, '采购审批通过', '采购审批通过') |
|
|
formPurchasePassRef.value.open('update', row, null, '采购审批通过', '采购审批通过') |
|
|
} else { |
|
|
} else { |
|
|
submitPurchasePass(row.id) |
|
|
submitPurchasePass(row.id) |
|
|
} |
|
|
} |
|
|
} else if (val == 'purchase_mainPlanTur') { // 采购驳回按钮 |
|
|
} else if (val == 'purchase_mainPlanTur') { |
|
|
|
|
|
// 采购驳回按钮 |
|
|
resonSubmit(val, row) |
|
|
resonSubmit(val, row) |
|
|
// handleTur(row.id) |
|
|
// handleTur(row.id) |
|
|
} else if (val == 'invoice_sent_out') { // 发票寄出确认 |
|
|
} else if (val == 'invoice_sent_out') { |
|
|
|
|
|
// 发票寄出确认 |
|
|
handleInvoiceSentOut(row.id) |
|
|
handleInvoiceSentOut(row.id) |
|
|
} else if(val == 'finance_mainPlanSub'){ // 财务审批通过 |
|
|
} else if (val == 'finance_mainPlanSub') { |
|
|
|
|
|
// 财务审批通过 |
|
|
handleFinanceApp(row) |
|
|
handleFinanceApp(row) |
|
|
} else if(val == 'finance_mainPlanTur'){ //财务审批拒绝 |
|
|
} else if (val == 'finance_mainPlanTur') { |
|
|
|
|
|
//财务审批拒绝 |
|
|
resonSubmit(val, row) |
|
|
resonSubmit(val, row) |
|
|
// handleFinaceTur(row.masterId) |
|
|
// handleFinaceTur(row.masterId) |
|
|
} else if (val == 'genRecords') { // 处理 |
|
|
} else if (val == 'genRecords') { |
|
|
|
|
|
// 处理 |
|
|
genRecords(row.id) |
|
|
genRecords(row.id) |
|
|
} else if (val == 'edit') { // 编辑 |
|
|
} else if (val == 'edit') { |
|
|
|
|
|
// 编辑 |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { |
|
|
|
|
|
// 删除 |
|
|
handleDelete(row.id) |
|
|
handleDelete(row.id) |
|
|
} else if( val == 'mian_print'){ // 打印 |
|
|
} else if (val == 'mian_print') { |
|
|
|
|
|
// 打印 |
|
|
handleDocumentPrint(row.id) |
|
|
handleDocumentPrint(row.id) |
|
|
} else if( val == 'repeal'){ // 作废 |
|
|
} else if (val == 'repeal') { |
|
|
|
|
|
// 作废 |
|
|
handleRepeal(row.id) |
|
|
handleRepeal(row.id) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
const procurementCreators = ref([]) |
|
|
|
|
|
SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ |
|
|
|
|
|
roleCode: 'purchase', |
|
|
|
|
|
pageSize: 1000, |
|
|
|
|
|
pageNo: 1, |
|
|
|
|
|
sort: '', |
|
|
|
|
|
by: 'ASC' |
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
procurementCreators.value = res.list |
|
|
|
|
|
}) |
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
const openForm = async (type : string, row ?: number) => { |
|
|
const openForm = async (type: string, row?: any) => { |
|
|
// 合同金额 采购金额 总差额 :只在详情里展示 |
|
|
// 合同金额 采购金额 总差额 :只在详情里展示 |
|
|
SupplierinvoiceRequestDetail.allSchemas.tableFormColumns = SupplierinvoiceRequestDetail.allSchemas.tableFormColumns.filter(item=>item.field!='contractAmountTotal'&&item.field!='purchaseAmontTotal'&&item.field!='differencePriceTotal') |
|
|
SupplierinvoiceRequestDetail.allSchemas.tableFormColumns = |
|
|
|
|
|
SupplierinvoiceRequestDetail.allSchemas.tableFormColumns.filter( |
|
|
|
|
|
(item) => |
|
|
|
|
|
item.field != 'contractAmountTotal' && |
|
|
|
|
|
item.field != 'purchaseAmontTotal' && |
|
|
|
|
|
item.field != 'differencePriceTotal' |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
if (type == 'update') { |
|
|
if (type == 'update') { |
|
|
//编辑 |
|
|
//编辑 |
|
@ -594,7 +737,13 @@ const handleImport = () => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 编辑---taxRate税率\beforeTaxAmount未税金额\totalTaxAmount税额\goldenTaxInvoiceNumber金税票号\invoiceTime发票日期 |
|
|
// 编辑---taxRate税率\beforeTaxAmount未税金额\totalTaxAmount税额\goldenTaxInvoiceNumber金税票号\invoiceTime发票日期 |
|
|
if(item.field == 'taxRate'||item.field == 'beforeTaxAmount'||item.field == 'totalTaxAmount'||item.field == 'goldenTaxInvoiceNumber'||item.field == 'invoiceTime'){ |
|
|
if ( |
|
|
|
|
|
item.field == 'taxRate' || |
|
|
|
|
|
item.field == 'beforeTaxAmount' || |
|
|
|
|
|
item.field == 'totalTaxAmount' || |
|
|
|
|
|
item.field == 'goldenTaxInvoiceNumber' || |
|
|
|
|
|
item.field == 'invoiceTime' |
|
|
|
|
|
) { |
|
|
if (row.status == '1' || row.status == '3' || row.status == '6' || row.status == '7') { |
|
|
if (row.status == '1' || row.status == '3' || row.status == '6' || row.status == '7') { |
|
|
item.componentProps.disabled = false |
|
|
item.componentProps.disabled = false |
|
|
} else { |
|
|
} else { |
|
@ -625,9 +774,22 @@ const handleImport = () => { |
|
|
item.componentProps.disabled = false |
|
|
item.componentProps.disabled = false |
|
|
} |
|
|
} |
|
|
// 税率 \采购价格审批人 \未税金额 \税额\金税票号\开票日期\折扣金额 |
|
|
// 税率 \采购价格审批人 \未税金额 \税额\金税票号\开票日期\折扣金额 |
|
|
if(item.field == 'taxRate'||item.field == 'procurementCreator'||item.field == 'beforeTaxAmount'||item.field == 'totalTaxAmount'||item.field == 'goldenTaxInvoiceNumber'||item.field == 'invoiceTime'||item.field == 'discountAmount1'){ |
|
|
if ( |
|
|
|
|
|
item.field == 'taxRate' || |
|
|
|
|
|
item.field == 'procurementCreator' || |
|
|
|
|
|
item.field == 'beforeTaxAmount' || |
|
|
|
|
|
item.field == 'totalTaxAmount' || |
|
|
|
|
|
item.field == 'goldenTaxInvoiceNumber' || |
|
|
|
|
|
item.field == 'invoiceTime' || |
|
|
|
|
|
item.field == 'discountAmount1' |
|
|
|
|
|
) { |
|
|
item.componentProps.disabled = false |
|
|
item.componentProps.disabled = false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (item.field == 'procurementCreator') { |
|
|
|
|
|
item.componentProps.options = procurementCreators.value |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
if (row && (row.status == '3' || row.status == '7')) { |
|
|
if (row && (row.status == '3' || row.status == '7')) { |
|
@ -635,7 +797,6 @@ const handleImport = () => { |
|
|
SupplierinvoiceRequestMainRules.totalTaxAmount[0].required = true //税额 |
|
|
SupplierinvoiceRequestMainRules.totalTaxAmount[0].required = true //税额 |
|
|
SupplierinvoiceRequestMainRules.goldenTaxInvoiceNumber[0].required = true //金税票号 |
|
|
SupplierinvoiceRequestMainRules.goldenTaxInvoiceNumber[0].required = true //金税票号 |
|
|
SupplierinvoiceRequestMainRules.invoiceTime[0].required = true |
|
|
SupplierinvoiceRequestMainRules.invoiceTime[0].required = true |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
SupplierinvoiceRequestMainRules.beforeTaxAmount[0].required = false //未税金额 |
|
|
SupplierinvoiceRequestMainRules.beforeTaxAmount[0].required = false //未税金额 |
|
|
SupplierinvoiceRequestMainRules.totalTaxAmount[0].required = false //税额 |
|
|
SupplierinvoiceRequestMainRules.totalTaxAmount[0].required = false //税额 |
|
@ -644,13 +805,18 @@ const handleImport = () => { |
|
|
} |
|
|
} |
|
|
if (row && row.procurementCreator) row.procurementCreator = Number(row.procurementCreator) |
|
|
if (row && row.procurementCreator) row.procurementCreator = Number(row.procurementCreator) |
|
|
// 校验是否可以开票 |
|
|
// 校验是否可以开票 |
|
|
SupplierinvoiceRequestMainApi.checkInvoicingCalendar({}).then(res => { |
|
|
SupplierinvoiceRequestMainApi.checkInvoicingCalendar({}).then((res) => { |
|
|
if (res.flag) { |
|
|
if (res.flag) { |
|
|
message.alertWarning(res.msg) |
|
|
message.alertWarning(res.msg) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
tableData.value = [] // 重置明细数据 |
|
|
tableData.value = [] // 重置明细数据 |
|
|
formRef.value.open(type, row) |
|
|
formRef.value.open(type, row) |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
formRef.value.formRef.setValues({ |
|
|
|
|
|
procurementCreator:procurementCreators.value[0].id |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
const defaultSupplierCode = ref('') |
|
|
const defaultSupplierCode = ref('') |
|
@ -664,46 +830,53 @@ const handleImport = () => { |
|
|
console.log('defaultSupplierCode', defaultSupplierCode) |
|
|
console.log('defaultSupplierCode', defaultSupplierCode) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取部门 用于详情 部门回显 |
|
|
// 获取部门 用于详情 部门回显 |
|
|
const { wsCache } = useCache() |
|
|
const { wsCache } = useCache() |
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
const clicKRowId = ref(); |
|
|
const clicKRowId = ref() |
|
|
const detailAnnexTable = ref( |
|
|
const detailAnnexTable = ref([ |
|
|
[{ |
|
|
{ |
|
|
label: t('ts.合同附件'), |
|
|
label: t('ts.合同附件'), |
|
|
prop: 'Annex', |
|
|
prop: 'Annex', |
|
|
tableName: 'contract', |
|
|
tableName: 'contract', |
|
|
hiddenDelete: false, |
|
|
hiddenDelete: false, |
|
|
hiddenUpload: false, |
|
|
hiddenUpload: false, |
|
|
fileSize: 20 |
|
|
fileSize: 20 |
|
|
},{ |
|
|
}, |
|
|
|
|
|
{ |
|
|
label: t('ts.发票附件'), |
|
|
label: t('ts.发票附件'), |
|
|
prop: 'Annex', |
|
|
prop: 'Annex', |
|
|
tableName: 'invoice', |
|
|
tableName: 'invoice', |
|
|
hiddenDelete: false, |
|
|
hiddenDelete: false, |
|
|
hiddenUpload: false, |
|
|
hiddenUpload: false, |
|
|
fileSize: 20 |
|
|
fileSize: 20 |
|
|
|
|
|
}, |
|
|
},{ |
|
|
{ |
|
|
label: t('ts.货运单附件'), |
|
|
label: t('ts.货运单附件'), |
|
|
prop: 'Annex', |
|
|
prop: 'Annex', |
|
|
tableName: 'waybill', |
|
|
tableName: 'waybill', |
|
|
fileSize: 20 |
|
|
fileSize: 20 |
|
|
},{ |
|
|
}, |
|
|
|
|
|
{ |
|
|
label: t('ts.其他附件'), |
|
|
label: t('ts.其他附件'), |
|
|
prop: 'Annex', |
|
|
prop: 'Annex', |
|
|
tableName: 'invoiceOther', |
|
|
tableName: 'invoiceOther', |
|
|
fileSize: 20 |
|
|
fileSize: 20 |
|
|
}]) |
|
|
} |
|
|
|
|
|
]) |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name |
|
|
const departmentCode = wsCache |
|
|
|
|
|
.get(CACHE_KEY.DEPT) |
|
|
|
|
|
.find((account) => account.id == row.departmentCode)?.name |
|
|
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) |
|
|
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) |
|
|
clicKRowId.value = row.id |
|
|
clicKRowId.value = row.id |
|
|
|
|
|
|
|
|
// 合同附件 |
|
|
// 合同附件 |
|
|
if((roleList.value.indexOf('purchase')>-1&&row.status=='2')||(roleList.value.indexOf('supplier_operator')>-1&&(row.status=='1'||row.status=='6'))){ |
|
|
if ( |
|
|
|
|
|
(roleList.value.indexOf('purchase') > -1 && row.status == '2') || |
|
|
|
|
|
(roleList.value.indexOf('supplier_operator') > -1 && (row.status == '1' || row.status == '6')) |
|
|
|
|
|
) { |
|
|
detailAnnexTable.value[0].hiddenDelete = false |
|
|
detailAnnexTable.value[0].hiddenDelete = false |
|
|
detailAnnexTable.value[0].hiddenUpload = false |
|
|
detailAnnexTable.value[0].hiddenUpload = false |
|
|
} else { |
|
|
} else { |
|
@ -711,7 +884,10 @@ const handleImport = () => { |
|
|
detailAnnexTable.value[0].hiddenUpload = true |
|
|
detailAnnexTable.value[0].hiddenUpload = true |
|
|
} |
|
|
} |
|
|
// 发票附件 |
|
|
// 发票附件 |
|
|
if(roleList.value.indexOf('supplier_operator')>-1&&(row.status=='3'||row.status=='7')){ |
|
|
if ( |
|
|
|
|
|
roleList.value.indexOf('supplier_operator') > -1 && |
|
|
|
|
|
(row.status == '3' || row.status == '7') |
|
|
|
|
|
) { |
|
|
detailAnnexTable.value[1].hiddenDelete = false |
|
|
detailAnnexTable.value[1].hiddenDelete = false |
|
|
detailAnnexTable.value[1].hiddenUpload = false |
|
|
detailAnnexTable.value[1].hiddenUpload = false |
|
|
} else { |
|
|
} else { |
|
@ -719,7 +895,7 @@ const handleImport = () => { |
|
|
detailAnnexTable.value[1].hiddenUpload = true |
|
|
detailAnnexTable.value[1].hiddenUpload = true |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
detailRef.value.openDetail(row, titleName, titleValue,"requestSupplierinvoiceMain") |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'requestSupplierinvoiceMain') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
@ -734,7 +910,8 @@ const handleImport = () => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch { }finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -751,7 +928,8 @@ const handleImport = () => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch { }finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -768,7 +946,8 @@ const handleImport = () => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch { }finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -785,7 +964,8 @@ const handleImport = () => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch { }finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -802,7 +982,8 @@ const handleImport = () => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch { }finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -818,18 +999,21 @@ const handleImport = () => { |
|
|
await message.confirm(t('ts.是否审批通过所选中数据?')) |
|
|
await message.confirm(t('ts.是否审批通过所选中数据?')) |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
// 发起审批通过 |
|
|
// 发起审批通过 |
|
|
await SupplierinvoiceRequestMainApi.appSupplierinvoiceRequestMain(id1,submitData?.balanceStatement) |
|
|
await SupplierinvoiceRequestMainApi.appSupplierinvoiceRequestMain( |
|
|
|
|
|
id1, |
|
|
|
|
|
submitData?.balanceStatement |
|
|
|
|
|
) |
|
|
message.success(t('ts.审批通过成功!')) |
|
|
message.success(t('ts.审批通过成功!')) |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
formPurchasePassRef.value.dialogVisible = false |
|
|
formPurchasePassRef.value.dialogVisible = false |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch { }finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 审批通过按钮操作 finance_mainPlanSub */ |
|
|
/** 审批通过按钮操作 finance_mainPlanSub */ |
|
|
const formFinanceRef = ref() |
|
|
const formFinanceRef = ref() |
|
|
const handleFinanceApp = async (row) => { |
|
|
const handleFinanceApp = async (row) => { |
|
@ -844,7 +1028,7 @@ const handleImport = () => { |
|
|
await SupplierinvoiceRequestMainApi.financeappSupplierinvoiceRequestMain({ |
|
|
await SupplierinvoiceRequestMainApi.financeappSupplierinvoiceRequestMain({ |
|
|
id: data.id, |
|
|
id: data.id, |
|
|
postingDate: data.postingDate, |
|
|
postingDate: data.postingDate, |
|
|
voucherNumberRemark:data.voucherNumberRemark, |
|
|
voucherNumberRemark: data.voucherNumberRemark |
|
|
}) |
|
|
}) |
|
|
formFinanceRef.value.dialogVisible = false |
|
|
formFinanceRef.value.dialogVisible = false |
|
|
getList() |
|
|
getList() |
|
@ -878,7 +1062,8 @@ const handleImport = () => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch { }finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -895,13 +1080,13 @@ const handleImport = () => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch { }finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const resonSubmit = async (val, row) => { |
|
|
const resonSubmit = async (val, row) => { |
|
|
|
|
|
|
|
|
ElMessageBox.prompt(t('ts.请输入驳回原因'), t('ts.提示'), { |
|
|
ElMessageBox.prompt(t('ts.请输入驳回原因'), t('ts.提示'), { |
|
|
confirmButtonText: t('common.ok'), |
|
|
confirmButtonText: t('common.ok'), |
|
|
cancelButtonText: t('common.cancel'), |
|
|
cancelButtonText: t('common.cancel'), |
|
@ -915,16 +1100,18 @@ const handleImport = () => { |
|
|
return true |
|
|
return true |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}).then(({ value }) => { |
|
|
}) |
|
|
|
|
|
.then(({ value }) => { |
|
|
// 驳回原因 |
|
|
// 驳回原因 |
|
|
if (val == 'purchase_mainPlanTur') { // 采购驳回按钮 |
|
|
if (val == 'purchase_mainPlanTur') { |
|
|
|
|
|
// 采购驳回按钮 |
|
|
handleTur(row.id, value) |
|
|
handleTur(row.id, value) |
|
|
}else if(val == 'finance_mainPlanTur'){ //财务审批拒绝 |
|
|
} else if (val == 'finance_mainPlanTur') { |
|
|
|
|
|
//财务审批拒绝 |
|
|
handleFinaceTur(row.id, value) |
|
|
handleFinaceTur(row.id, value) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch(() => { |
|
|
.catch(() => {}) |
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 驳回按钮操作 */ |
|
|
/** 驳回按钮操作 */ |
|
@ -942,7 +1129,8 @@ const handleImport = () => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch { }finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -959,7 +1147,8 @@ const handleImport = () => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch { }finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -968,16 +1157,16 @@ const handleImport = () => { |
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
const handleExport = async () => { |
|
|
const handleExport = async () => { |
|
|
let rows: any = [] |
|
|
let rows: any = [] |
|
|
selectionRows.value.forEach(item=>{ |
|
|
selectionRows.value.forEach((item) => { |
|
|
rows = [...rows,...item.selectionRows.map(item1=>item1.number)] |
|
|
rows = [...rows, ...item.selectionRows.map((item1) => item1.number)] |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
let paramsData = JSON.parse(JSON.stringify(tableObject.params)) |
|
|
let paramsData = JSON.parse(JSON.stringify(tableObject.params)) |
|
|
if (tableObject.params && tableObject.params.isSearch == true) { |
|
|
if (tableObject.params && tableObject.params.isSearch == true) { |
|
|
paramsData.filters.push({ |
|
|
paramsData.filters.push({ |
|
|
action: "in", |
|
|
action: 'in', |
|
|
column: "number", |
|
|
column: 'number', |
|
|
value: rows.join(",") |
|
|
value: rows.join(',') |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
paramsData = { ...paramsData, checkNums: rows } |
|
|
paramsData = { ...paramsData, checkNums: rows } |
|
@ -996,12 +1185,11 @@ const handleImport = () => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* tableForm方法 |
|
|
* tableForm方法 |
|
|
*/ |
|
|
*/ |
|
|
const tableFormKeys = {} |
|
|
const tableFormKeys = {} |
|
|
SupplierinvoiceRequestDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
SupplierinvoiceRequestDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
}) |
|
|
}) |
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
@ -1018,13 +1206,23 @@ const handleImport = () => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
const tableSelectionDelete = (selection) => { |
|
|
const tableSelectionDelete = (selection) => { |
|
|
tableData.value = tableData.value.filter(item => !selection.includes(item)) |
|
|
tableData.value = tableData.value.filter((item) => !selection.includes(item)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const sumFormDataHandle = async (formRef1,formModel,tableData,formType,originFormModel,updateOriginFormModel)=>{ |
|
|
const sumFormDataHandle = async ( |
|
|
|
|
|
formRef1, |
|
|
|
|
|
formModel, |
|
|
|
|
|
tableData, |
|
|
|
|
|
formType, |
|
|
|
|
|
originFormModel, |
|
|
|
|
|
updateOriginFormModel |
|
|
|
|
|
) => { |
|
|
if (formType == 'update') { |
|
|
if (formType == 'update') { |
|
|
if (formModel && formModel.id && formModel.taxRate && originFormModel) { |
|
|
if (formModel && formModel.id && formModel.taxRate && originFormModel) { |
|
|
let res = await SupplierinvoiceRequestMainApi.getTaxAmount({id:formModel.id,taxRate:formModel.taxRate}) |
|
|
let res = await SupplierinvoiceRequestMainApi.getTaxAmount({ |
|
|
|
|
|
id: formModel.id, |
|
|
|
|
|
taxRate: formModel.taxRate |
|
|
|
|
|
}) |
|
|
console.log('更新taxAmount', res) |
|
|
console.log('更新taxAmount', res) |
|
|
formRef1.value.setValues({ |
|
|
formRef1.value.setValues({ |
|
|
taxAmount: res |
|
|
taxAmount: res |
|
@ -1036,7 +1234,9 @@ const handleImport = () => { |
|
|
const submitForm = async (formType, submitData) => { |
|
|
const submitForm = async (formType, submitData) => { |
|
|
let data = { ...submitData } |
|
|
let data = { ...submitData } |
|
|
tableData.value.forEach((item) => { |
|
|
tableData.value.forEach((item) => { |
|
|
item.differencePrice = Number((Number(item?.singlePrice)-Number(item?.purchasePrice)).toFixed(5)) |
|
|
item.differencePrice = Number( |
|
|
|
|
|
(Number(item?.singlePrice) - Number(item?.purchasePrice)).toFixed(5) |
|
|
|
|
|
) |
|
|
}) |
|
|
}) |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
console.log('data', data) |
|
|
console.log('data', data) |
|
@ -1044,11 +1244,11 @@ const handleImport = () => { |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
if (data.subList.length == 0) { |
|
|
if (data.subList.length == 0) { |
|
|
message.warning(t('ts.请添明细数据')) |
|
|
message.warning(t('ts.请添明细数据')) |
|
|
return; |
|
|
return |
|
|
} |
|
|
} |
|
|
if (data.subList.length > 20000) { |
|
|
if (data.subList.length > 20000) { |
|
|
message.warning(t('ts.明细数据条数已超过最大数量限制【20000条】')) |
|
|
message.warning(t('ts.明细数据条数已超过最大数量限制【20000条】')) |
|
|
return; |
|
|
return |
|
|
} |
|
|
} |
|
|
formRef.value.formLoading = true |
|
|
formRef.value.formLoading = true |
|
|
await SupplierinvoiceRequestMainApi.createSupplierinvoiceRequestMain(data) |
|
|
await SupplierinvoiceRequestMainApi.createSupplierinvoiceRequestMain(data) |
|
@ -1089,7 +1289,7 @@ const importSuccess = () => { |
|
|
|
|
|
|
|
|
// 详情--头部按钮事件 |
|
|
// 详情--头部按钮事件 |
|
|
const detailButtonBaseClick = (val, item) => { |
|
|
const detailButtonBaseClick = (val, item) => { |
|
|
console.log("点击的按钮",val) |
|
|
console.log('点击的按钮', val) |
|
|
if (val == 'printing') { |
|
|
if (val == 'printing') { |
|
|
// 单据打印 |
|
|
// 单据打印 |
|
|
handleDocumentPrint(clicKRowId.value) |
|
|
handleDocumentPrint(clicKRowId.value) |
|
@ -1097,18 +1297,18 @@ const importSuccess = () => { |
|
|
//打印全部发货单 |
|
|
//打印全部发货单 |
|
|
handlePrintAll(clicKRowId.value) |
|
|
handlePrintAll(clicKRowId.value) |
|
|
} else if (val === 'export-detail') { |
|
|
} else if (val === 'export-detail') { |
|
|
console.log("导出明细:",clicKRowId.value) |
|
|
console.log('导出明细:', clicKRowId.value) |
|
|
handleDetailExport(clicKRowId.value) |
|
|
handleDetailExport(clicKRowId.value) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const tableFormButton = (val, item) => { |
|
|
const tableFormButton = (val, item) => { |
|
|
console.log("点击的按钮",val) |
|
|
console.log('点击的按钮', val) |
|
|
if (val == 'print') { |
|
|
if (val == 'print') { |
|
|
// 打印 |
|
|
// 打印 |
|
|
SupplierinvoiceRequestMainApi.printSupplierRecord(item.asnBillNum).then(res =>{ |
|
|
SupplierinvoiceRequestMainApi.printSupplierRecord(item.asnBillNum).then((res) => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
handleSupplierdeliverRecordPrint(res); |
|
|
handleSupplierdeliverRecordPrint(res) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
@ -1136,7 +1336,9 @@ const importSuccess = () => { |
|
|
const BASE_URL = getJmreportBaseUrl() |
|
|
const BASE_URL = getJmreportBaseUrl() |
|
|
|
|
|
|
|
|
//供应商发货单打印 |
|
|
//供应商发货单打印 |
|
|
const documentSupplierdeliverRecordSrc = ref(BASE_URL + '/jmreport/view/932556833517789184?token=' + getAccessToken()) |
|
|
const documentSupplierdeliverRecordSrc = ref( |
|
|
|
|
|
BASE_URL + '/jmreport/view/932556833517789184?token=' + getAccessToken() |
|
|
|
|
|
) |
|
|
const handleSupplierdeliverRecordPrint = async (id) => { |
|
|
const handleSupplierdeliverRecordPrint = async (id) => { |
|
|
window.open(documentSupplierdeliverRecordSrc.value + '&id=' + id) |
|
|
window.open(documentSupplierdeliverRecordSrc.value + '&id=' + id) |
|
|
} |
|
|
} |
|
@ -1147,12 +1349,11 @@ const importSuccess = () => { |
|
|
window.open(documentSrc.value + '&id=' + id) |
|
|
window.open(documentSrc.value + '&id=' + id) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const srcPoint = ref(BASE_URL + '/jmreport/view/972723426543935488?token=' + getAccessToken()) |
|
|
const srcPoint = ref(BASE_URL + '/jmreport/view/972723426543935488?token=' + getAccessToken()) |
|
|
const handleSelectionPoint = async () => { |
|
|
const handleSelectionPoint = async () => { |
|
|
let rows: any = [] |
|
|
let rows: any = [] |
|
|
selectionRows.value.forEach(item=>{ |
|
|
selectionRows.value.forEach((item) => { |
|
|
rows = [...rows,...item.selectionRows.map(item1=>item1.id)] |
|
|
rows = [...rows, ...item.selectionRows.map((item1) => item1.id)] |
|
|
}) |
|
|
}) |
|
|
if (rows.length == 0) { |
|
|
if (rows.length == 0) { |
|
|
message.warning('至少选择一条数据!') |
|
|
message.warning('至少选择一条数据!') |
|
@ -1162,18 +1363,17 @@ const handleSelectionPoint = async ()=>{ |
|
|
window.open(srcPoint.value + '&ids=' + rows.join(',')) |
|
|
window.open(srcPoint.value + '&ids=' + rows.join(',')) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handlePrintAll = async (masterId) => { |
|
|
const handlePrintAll = async (masterId) => { |
|
|
// 打印 |
|
|
// 打印 |
|
|
SupplierinvoiceRequestMainApi.printSupplierRecordByMasterId(masterId).then(res =>{ |
|
|
SupplierinvoiceRequestMainApi.printSupplierRecordByMasterId(masterId).then((res) => { |
|
|
if (res && res.length > 0) { |
|
|
if (res && res.length > 0) { |
|
|
for (let i = 0; i < res.length; i++) { |
|
|
for (let i = 0; i < res.length; i++) { |
|
|
let id = res[i]; |
|
|
let id = res[i] |
|
|
handleSupplierdeliverRecordPrint(id); |
|
|
handleSupplierdeliverRecordPrint(id) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
message.warning(t('ts.非SCP订单无法打印')) |
|
|
message.warning(t('ts.非SCP订单无法打印')) |
|
|
return; |
|
|
return |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|