Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

hella_online_20240829
陈薪名 6 months ago
parent
commit
3dc2d29bda
  1. 2
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRecordMain/index.vue
  2. 476
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  3. 2
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

2
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRecordMain/index.vue

@ -329,7 +329,7 @@ const searchTableSuccess1 = async (formField, searchField, val, formRef, type, r
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
} else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
const src = ref(BASE_URL + '/jmreport/view/979553753876811776?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
}
}).catch(err => {

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

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SupplierinvoiceRequestMain.allSchemas.searchSchema" @search="searchList" @reset="searchList" />
<Search
:schema="SupplierinvoiceRequestMain.allSchemas.searchSchema"
@search="searchList"
@reset="searchList"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -12,17 +16,23 @@
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SupplierinvoiceRequestMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table ref="tableRef"
<Table
ref="tableRef"
:selection="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
}" 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"
@getSelectionRows="getSelectionRows"
>
@ -32,10 +42,15 @@
</el-button>
</template>
<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 #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>
</Table>
</ContentWrap>
@ -53,10 +68,29 @@
:tableAllSchemas="SupplierinvoiceRequestDetail.allSchemas"
:tableFormRules="SupplierinvoiceRequestDetailRules"
:tableData="tableData"
:sumFormDataByForm ="(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
:sumFormDataByForm="
(
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
// 2X*2
if(formType=='update'){ //
if (formType == 'update') {
//
console.log('taxRate', taxRate)
console.log('originFormModel', originFormModel.taxRate)
console.log('taxAmount', taxAmount)
@ -73,10 +107,22 @@
taxAmountDiff: totalTaxAmount - taxAmount, // -
totalTaxDiffAmount: beforeTaxDiffAmount + taxAmountDiff // =+
})
}else if(formType=='create'){ //
} else if (formType == 'create') {
//
let taxAmount_ = taxAmount
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)
}
formRef.value.setValues({
@ -88,19 +134,34 @@
totalTaxDiffAmount: beforeTaxDiffAmount + taxAmountDiff // =+
})
}
}"
:sumFormDataByTableCustom ="(formRef,formModel,tableData)=>{
}
"
:sumFormDataByTableCustom="
(formRef, formModel, tableData) => {
// 1 XX
const { taxRate = 0 } = formModel
const sumObject = {
amount:tableData.reduce((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)
amount: tableData.reduce(
(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)
}"
}
"
:apiUpdate="SupplierinvoiceRequestMainApi.updateSupplierinvoiceRequestMain"
:apiCreate="SupplierinvoiceRequestMainApi.createSupplierinvoiceRequestMain"
:isBusiness="true"
@ -112,10 +173,22 @@
@submitForm="submitForm"
@sumFormDataHandle="sumFormDataHandle"
>
<template #selectionsActionspoLine="{ selections }">
<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>
</template>
<!-- <template #foorter>
@ -124,7 +197,11 @@
</div>
</template> -->
<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>
</BasicForm>
@ -158,7 +235,8 @@
hidden: true,
label: t('ts.其他附件')
}"
:otherHeadButttonData="[{
:otherHeadButttonData="[
{
label: t('ts.打印明细'),
name: 'printing',
hide: false,
@ -167,7 +245,8 @@
color: '',
float: 'left',
hasPermi: ''
},{
},
{
label: t('ts.打印全部发货单'),
name: 'printing-all',
hide: false,
@ -176,7 +255,8 @@
color: '',
float: 'left',
hasPermi: ''
},{
},
{
label: t('ts.导出明细'),
name: 'export-detail',
hide: false,
@ -185,8 +265,10 @@
color: '',
float: 'left',
hasPermi: ''
}]"
:buttondataTable = "[{
}
]"
:buttondataTable="[
{
label: t('ts.打印'),
name: 'print',
hide: true,
@ -196,13 +278,16 @@
float: 'left',
link: true, //
hasPermi: ''
}]"
:sumFormDataByForm ="(formRef,formModel)=>{
}
]"
:sumFormDataByForm="
(formRef, formModel) => {
const { singlePrice = 0, purchasePrice = 0 } = formModel
formRef.value.setValues({
differencePrice: Number((Number(singlePrice) - Number(purchasePrice)).toFixed(5))
})
}"
}
"
:isBasic="false"
:allSchemas="SupplierinvoiceRequestDetailMain.allSchemas"
:detailAllSchemas="SupplierinvoiceRequestDetail.allSchemas"
@ -238,14 +323,14 @@
:coverIsDisable="true"
:mode="2"
/>
</template>
<script setup lang="ts">
import dayjs from 'dayjs'
//
import download from '@/utils/download'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { SupplierinvoiceRequestMain,
import {
SupplierinvoiceRequestMain,
SupplierinvoiceRequestMainRules,
SupplierinvoiceRequestDetail,
SupplierinvoiceRequestDetailRules,
@ -297,8 +382,8 @@ const searchList = (model)=>{
const selectionRows = ref<any>([])
const tableRef = ref()
const getSelectionRows = (currentPage, currentPageSelectionRows) => {
console.log("getSelectionRows",currentPage,currentPageSelectionRows)
const currentRows = selectionRows.value.find(item=>item.currentPage==currentPage)
console.log('getSelectionRows', currentPage, currentPageSelectionRows)
const currentRows = selectionRows.value.find((item) => item.currentPage == currentPage)
if (currentRows) {
currentRows.selectionRows = currentPageSelectionRows
} else {
@ -312,9 +397,15 @@ const handleMainFefresh = ()=>{
getList()
}
const searchTableSuccessDetail = async (formField, searchField, val, formRef,searchTableFormModel)=>{
const searchTableSuccessDetail = async (
formField,
searchField,
val,
formRef,
searchTableFormModel
) => {
console.log('详情', formField, searchField, val, formRef, searchTableFormModel)
val.forEach(item=>{
val.forEach((item) => {
item.deliveryDate = item['prhRcpDate']
item.arrivalQty = item['prhRcvd']
})
@ -342,8 +433,14 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea
nextTick(() => {
if (type == 'tableForm') {
//
val.forEach(item=>{
if(tableData.value.find(item1=>item1['recvBillNum'] == item['recvBillNum']&&item1['poLine'] == item['poLine'])) return
val.forEach((item) => {
if (
tableData.value.find(
(item1) =>
item1['recvBillNum'] == item['recvBillNum'] && item1['poLine'] == item['poLine']
)
)
return
const newRow = { ...row }
newRow[formField] = item[searchField]
@ -365,14 +462,15 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea
newRow['arrivalQty'] = item['prhRcvd']
newRow['id'] = item['id']
newRow['currency'] = item['currency']
}
tableData.value.push(newRow)
})
} else {
//
if(formField=='supplierCode'&&val[0][searchField]!=searchFormRef.formModel.supplierCode){
if (
formField == 'supplierCode' &&
val[0][searchField] != searchFormRef.formModel.supplierCode
) {
tableData.value = []
}
//
@ -402,7 +500,7 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea
defaultButtons.mainLisSelectiontPointBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -415,15 +513,20 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val=='selection_point'){//
} else if (val == 'selection_point') {
//
handleSelectionPoint()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({
filters: tableObject.params.filters
@ -431,8 +534,10 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
@ -450,7 +555,10 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea
const butttondata = (row, $index) => {
return [
// 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.查看明细'),
name: 'open_detail',
@ -458,8 +566,9 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea
icon: '',
color: '',
hasPermi: '',
link: true, //
},{
link: true //
},
{
label: t('ts.采购通过'),
name: 'purchase_mainPlanSub',
hide: !(!isShowMainButton(row, ['2']) && row.currentIsProcurementCreator == true),
@ -467,8 +576,9 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea
icon: '',
color: '',
hasPermi: 'wms:supplierinvoice-request-main:app',
link: true, //
},{
link: true //
},
{
label: t('ts.采购驳回'),
name: 'purchase_mainPlanTur',
hide: !(!isShowMainButton(row, ['2']) && row.currentIsProcurementCreator == true),
@ -494,8 +604,9 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea
icon: '',
color: '',
hasPermi: 'wms:supplierinvoice-request-main:financeApp',
link: true, //
},{
link: true //
},
{
label: t('ts.财务驳回'),
name: 'finance_mainPlanTur',
hide: isShowMainButton(row, ['4']),
@ -504,7 +615,10 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea
link: true, //
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']) }), //
{
label: t('ts.作废'),
@ -536,49 +650,78 @@ const handleImport = () => {
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPurPlanOpe') { //
if (val == 'mainPurPlanOpe') {
//
handleOpe(row.id)
} else if (val == 'mainPurPlanClo') {//
} else if (val == 'mainPurPlanClo') {
//
handleClo(row.id)
} else if (val == 'mainPlanSub') { //
} else if (val == 'mainPlanSub') {
//
handleSub(row.id)
} else if (val == 'open_detail') { //
} else if (val == 'open_detail') {
//
openDetail(row, '单据号', row.number)
}else if (val == 'purchase_mainPlanSub') { //
} else if (val == 'purchase_mainPlanSub') {
//
// handleApp(row.id)
if (row.balanceStatementStatus) {
formPurchasePassRef.value.open('update', row, null, '采购审批通过', '采购审批通过')
} else {
submitPurchasePass(row.id)
}
} else if (val == 'purchase_mainPlanTur') { //
} else if (val == 'purchase_mainPlanTur') {
//
resonSubmit(val, row)
// handleTur(row.id)
} else if (val == 'invoice_sent_out') { //
} else if (val == 'invoice_sent_out') {
//
handleInvoiceSentOut(row.id)
} else if(val == 'finance_mainPlanSub'){ //
} else if (val == 'finance_mainPlanSub') {
//
handleFinanceApp(row)
} else if(val == 'finance_mainPlanTur'){ //
} else if (val == 'finance_mainPlanTur') {
//
resonSubmit(val, row)
// handleFinaceTur(row.masterId)
} else if (val == 'genRecords') { //
} else if (val == 'genRecords') {
//
genRecords(row.id)
} else if (val == 'edit') { //
} else if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if( val == 'mian_print'){ //
} else if (val == 'mian_print') {
//
handleDocumentPrint(row.id)
} else if( val == 'repeal'){ //
} else if (val == 'repeal') {
//
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 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') {
//
@ -594,7 +737,13 @@ const handleImport = () => {
}
// ---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') {
item.componentProps.disabled = false
} else {
@ -625,9 +774,22 @@ const handleImport = () => {
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
}
if (item.field == 'procurementCreator') {
item.componentProps.options = procurementCreators.value
}
})
}
if (row && (row.status == '3' || row.status == '7')) {
@ -635,7 +797,6 @@ const handleImport = () => {
SupplierinvoiceRequestMainRules.totalTaxAmount[0].required = true //
SupplierinvoiceRequestMainRules.goldenTaxInvoiceNumber[0].required = true //
SupplierinvoiceRequestMainRules.invoiceTime[0].required = true
} else {
SupplierinvoiceRequestMainRules.beforeTaxAmount[0].required = false //
SupplierinvoiceRequestMainRules.totalTaxAmount[0].required = false //
@ -644,13 +805,18 @@ const handleImport = () => {
}
if (row && row.procurementCreator) row.procurementCreator = Number(row.procurementCreator)
//
SupplierinvoiceRequestMainApi.checkInvoicingCalendar({}).then(res => {
SupplierinvoiceRequestMainApi.checkInvoicingCalendar({}).then((res) => {
if (res.flag) {
message.alertWarning(res.msg)
return
}
tableData.value = [] //
formRef.value.open(type, row)
nextTick(() => {
formRef.value.formRef.setValues({
procurementCreator:procurementCreators.value[0].id
})
})
})
}
const defaultSupplierCode = ref('')
@ -664,46 +830,53 @@ const handleImport = () => {
console.log('defaultSupplierCode', defaultSupplierCode)
}
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const clicKRowId = ref();
const detailAnnexTable = ref(
[{
const clicKRowId = ref()
const detailAnnexTable = ref([
{
label: t('ts.合同附件'),
prop: 'Annex',
tableName: 'contract',
hiddenDelete: false,
hiddenUpload: false,
fileSize: 20
},{
},
{
label: t('ts.发票附件'),
prop: 'Annex',
tableName: 'invoice',
hiddenDelete: false,
hiddenUpload: false,
fileSize: 20
},{
},
{
label: t('ts.货运单附件'),
prop: 'Annex',
tableName: 'waybill',
fileSize: 20
},{
},
{
label: t('ts.其他附件'),
prop: 'Annex',
tableName: 'invoiceOther',
fileSize: 20
}])
}
])
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))
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].hiddenUpload = false
} else {
@ -711,7 +884,10 @@ const handleImport = () => {
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].hiddenUpload = false
} else {
@ -719,7 +895,7 @@ const handleImport = () => {
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
//
await getList()
} catch { }finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -751,7 +928,8 @@ const handleImport = () => {
tableObject.loading = false
//
await getList()
} catch { }finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -768,7 +946,8 @@ const handleImport = () => {
tableObject.loading = false
//
await getList()
} catch { }finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -785,7 +964,8 @@ const handleImport = () => {
tableObject.loading = false
//
await getList()
} catch { }finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -802,7 +982,8 @@ const handleImport = () => {
tableObject.loading = false
//
await getList()
} catch { }finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -818,18 +999,21 @@ const handleImport = () => {
await message.confirm(t('ts.是否审批通过所选中数据?'))
tableObject.loading = true
//
await SupplierinvoiceRequestMainApi.appSupplierinvoiceRequestMain(id1,submitData?.balanceStatement)
await SupplierinvoiceRequestMainApi.appSupplierinvoiceRequestMain(
id1,
submitData?.balanceStatement
)
message.success(t('ts.审批通过成功!'))
tableObject.loading = false
formPurchasePassRef.value.dialogVisible = false
//
await getList()
} catch { }finally{
} catch {
} finally {
tableObject.loading = false
}
}
/** 审批通过按钮操作 finance_mainPlanSub */
const formFinanceRef = ref()
const handleFinanceApp = async (row) => {
@ -844,7 +1028,7 @@ const handleImport = () => {
await SupplierinvoiceRequestMainApi.financeappSupplierinvoiceRequestMain({
id: data.id,
postingDate: data.postingDate,
voucherNumberRemark:data.voucherNumberRemark,
voucherNumberRemark: data.voucherNumberRemark
})
formFinanceRef.value.dialogVisible = false
getList()
@ -878,7 +1062,8 @@ const handleImport = () => {
tableObject.loading = false
//
await getList()
} catch { }finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -895,13 +1080,13 @@ const handleImport = () => {
tableObject.loading = false
//
await getList()
} catch { }finally{
} catch {
} finally {
tableObject.loading = false
}
}
const resonSubmit = async (val, row) => {
ElMessageBox.prompt(t('ts.请输入驳回原因'), t('ts.提示'), {
confirmButtonText: t('common.ok'),
cancelButtonText: t('common.cancel'),
@ -915,16 +1100,18 @@ const handleImport = () => {
return true
}
}
}).then(({ value }) => {
})
.then(({ value }) => {
// 
if (val == 'purchase_mainPlanTur') { //
if (val == 'purchase_mainPlanTur') {
//
handleTur(row.id, value)
}else if(val == 'finance_mainPlanTur'){ //
} else if (val == 'finance_mainPlanTur') {
//
handleFinaceTur(row.id, value)
}
})
.catch(() => {
})
.catch(() => {})
}
/** 驳回按钮操作 */
@ -942,7 +1129,8 @@ const handleImport = () => {
tableObject.loading = false
//
await getList()
} catch { }finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -959,7 +1147,8 @@ const handleImport = () => {
tableObject.loading = false
//
await getList()
} catch { }finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -968,16 +1157,16 @@ const handleImport = () => {
const exportLoading = ref(false) //
const handleExport = async () => {
let rows: any = []
selectionRows.value.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.number)]
selectionRows.value.forEach((item) => {
rows = [...rows, ...item.selectionRows.map((item1) => item1.number)]
})
let paramsData = JSON.parse(JSON.stringify(tableObject.params))
if (tableObject.params && tableObject.params.isSearch == true) {
paramsData.filters.push({
action: "in",
column: "number",
value: rows.join(",")
action: 'in',
column: 'number',
value: rows.join(',')
})
} else {
paramsData = { ...paramsData, checkNums: rows }
@ -996,12 +1185,11 @@ const handleImport = () => {
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
SupplierinvoiceRequestDetail.allSchemas.tableFormColumns.forEach(item => {
SupplierinvoiceRequestDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
@ -1018,13 +1206,23 @@ const handleImport = () => {
}
}
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 (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)
formRef1.value.setValues({
taxAmount: res
@ -1036,7 +1234,9 @@ const handleImport = () => {
const submitForm = async (formType, submitData) => {
let data = { ...submitData }
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 //
console.log('data', data)
@ -1044,11 +1244,11 @@ const handleImport = () => {
if (formType === 'create') {
if (data.subList.length == 0) {
message.warning(t('ts.请添明细数据'))
return;
return
}
if (data.subList.length > 20000) {
message.warning(t('ts.明细数据条数已超过最大数量限制【20000条】'))
return;
return
}
formRef.value.formLoading = true
await SupplierinvoiceRequestMainApi.createSupplierinvoiceRequestMain(data)
@ -1089,7 +1289,7 @@ const importSuccess = () => {
// --
const detailButtonBaseClick = (val, item) => {
console.log("点击的按钮",val)
console.log('点击的按钮', val)
if (val == 'printing') {
//
handleDocumentPrint(clicKRowId.value)
@ -1097,18 +1297,18 @@ const importSuccess = () => {
//
handlePrintAll(clicKRowId.value)
} else if (val === 'export-detail') {
console.log("导出明细:",clicKRowId.value)
console.log('导出明细:', clicKRowId.value)
handleDetailExport(clicKRowId.value)
}
}
const tableFormButton = (val, item) => {
console.log("点击的按钮",val)
console.log('点击的按钮', val)
if (val == 'print') {
//
SupplierinvoiceRequestMainApi.printSupplierRecord(item.asnBillNum).then(res =>{
SupplierinvoiceRequestMainApi.printSupplierRecord(item.asnBillNum).then((res) => {
if (res) {
handleSupplierdeliverRecordPrint(res);
handleSupplierdeliverRecordPrint(res)
}
})
}
@ -1136,7 +1336,9 @@ const importSuccess = () => {
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) => {
window.open(documentSupplierdeliverRecordSrc.value + '&id=' + id)
}
@ -1147,12 +1349,11 @@ const importSuccess = () => {
window.open(documentSrc.value + '&id=' + id)
}
const srcPoint = ref(BASE_URL + '/jmreport/view/972723426543935488?token=' + getAccessToken())
const handleSelectionPoint = async () => {
let rows: any = []
selectionRows.value.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.id)]
selectionRows.value.forEach((item) => {
rows = [...rows, ...item.selectionRows.map((item1) => item1.id)]
})
if (rows.length == 0) {
message.warning('至少选择一条数据!')
@ -1162,18 +1363,17 @@ const handleSelectionPoint = async ()=>{
window.open(srcPoint.value + '&ids=' + rows.join(','))
}
const handlePrintAll = async (masterId) => {
//
SupplierinvoiceRequestMainApi.printSupplierRecordByMasterId(masterId).then(res =>{
SupplierinvoiceRequestMainApi.printSupplierRecordByMasterId(masterId).then((res) => {
if (res && res.length > 0) {
for (let i = 0; i < res.length; i++) {
let id = res[i];
handleSupplierdeliverRecordPrint(id);
let id = res[i]
handleSupplierdeliverRecordPrint(id)
}
} else {
message.warning(t('ts.非SCP订单无法打印'))
return;
return
}
})
}

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

@ -16,6 +16,7 @@ const queryParams = {
pageNo: 1,
code: 'PurchaseInvoiceRequest'
}
console.log(34343)
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData = data?.list[0] || {}
@ -784,7 +785,6 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
form: {
component: 'Select',
api: () => procurementCreators.list,
value:procurementCreators?.list.length>0?procurementCreators.list[0].id:'',
componentProps: {
optionsAlias: {
labelField: 'nickname',

Loading…
Cancel
Save