|
@ -61,12 +61,26 @@ |
|
|
@onChange="onChange" |
|
|
@onChange="onChange" |
|
|
:sumFormDataByTableCustom=" |
|
|
:sumFormDataByTableCustom=" |
|
|
(formRef, formModel, tableData) => { |
|
|
(formRef, formModel, tableData) => { |
|
|
tableData.forEach(item=>{ |
|
|
const { taxRate = 0 } = formModel |
|
|
|
|
|
// 1、主数据未税金额 mainBeforeTaxAmount : 所有明细行未税金额的和 |
|
|
}) |
|
|
let mainBeforeTaxAmount = tableData.reduce( |
|
|
|
|
|
(prev, item) => |
|
|
|
|
|
prev + Number(item['beforeTaxAmount']), |
|
|
|
|
|
0 |
|
|
|
|
|
) |
|
|
|
|
|
// 2.主数据税额 mainTaxAmount = 未税金额*税率/100 保留两位小数 |
|
|
|
|
|
let mainTaxAmount = Number(Number(mainBeforeTaxAmount*taxRate*0.01).toFixed(2)) |
|
|
|
|
|
const sumObject = { |
|
|
|
|
|
// 主数据未税金额 |
|
|
|
|
|
mainBeforeTaxAmount, |
|
|
|
|
|
// 主数据税额 |
|
|
|
|
|
mainTaxAmount, |
|
|
|
|
|
// 主数据价税合计金额:mainAdTaxAmount =未税金额+税额 |
|
|
|
|
|
mainAdTaxAmount:mainBeforeTaxAmount+mainTaxAmount |
|
|
|
|
|
} |
|
|
|
|
|
formRef.value.setValues(sumObject) |
|
|
} |
|
|
} |
|
|
" |
|
|
" |
|
|
|
|
|
|
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
@ -157,7 +171,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
if(formField == 'customerStatementNumber') { |
|
|
if(formField == 'customerStatementNumber') { |
|
|
//客户对账单 |
|
|
//客户对账单 |
|
|
setV['customer'] = val[0]['customerCode'] |
|
|
setV['customerCode'] = val[0]['customerCode'] |
|
|
setV['customerName'] = val[0]['customerName'] |
|
|
setV['customerName'] = val[0]['customerName'] |
|
|
CustomerStatementDetailApi.getCustomerStatementDetailPage({ |
|
|
CustomerStatementDetailApi.getCustomerStatementDetailPage({ |
|
|
pageNo:1, |
|
|
pageNo:1, |
|
@ -170,6 +184,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
item['sumPrice'] = item['price'] + item['allocationPrice'] |
|
|
item['sumPrice'] = item['price'] + item['allocationPrice'] |
|
|
// 未税金额 默认等于数量*合计单价,可修改,必填,最多可输入2位小数 |
|
|
// 未税金额 默认等于数量*合计单价,可修改,必填,最多可输入2位小数 |
|
|
item['beforeTaxAmount'] = item['sumPrice']*item['qty'] |
|
|
item['beforeTaxAmount'] = item['sumPrice']*item['qty'] |
|
|
|
|
|
// 含税金额 未税价格+税额,四舍五入保留2位小数 |
|
|
item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //含税金额 |
|
|
item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //含税金额 |
|
|
|
|
|
|
|
|
// 税额:taxAmount 未税价格*税率/100,四舍五入保留2位小数 |
|
|
// 税额:taxAmount 未税价格*税率/100,四舍五入保留2位小数 |
|
@ -210,9 +225,9 @@ const Echo = [] |
|
|
const { getList, setSearchParams } = tableMethods |
|
|
const { getList, setSearchParams } = tableMethods |
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultAddBtn({hasPermi:`wms:customer-sale-invoice-main:create` }), // 新增 |
|
|
defaultButtons.defaultAddBtn({hasPermi:`wms:customer-sale-invoice-request-main:create` }), // 新增 |
|
|
defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-main:import` }), // 导入 |
|
|
defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-request-main:import` }), // 导入 |
|
|
defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-main:export` }), // 导出 |
|
|
defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-request-main:export` }), // 导出 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
@ -264,14 +279,16 @@ const butttondata = (row,$index) => { |
|
|
return [] |
|
|
return [] |
|
|
} |
|
|
} |
|
|
return [ |
|
|
return [ |
|
|
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:`wms:${routeName.value}:open`}), // 打开 |
|
|
// defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:`wms:customer-sale-invoice-request-main:open`}), // 打开 |
|
|
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:`wms:${routeName.value}:close`}), // 关闭 |
|
|
// defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:`wms:customer-sale-invoice-request-main:close`}), // 关闭 |
|
|
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:submit`}), // 提交审批 |
|
|
// defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:customer-sale-invoice-request-main:submit`}), // 提交审批 |
|
|
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:reject`}), // 驳回 |
|
|
// defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:customer-sale-invoice-request-main:reject`}), // 驳回 |
|
|
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:agree`}), // 审批通过 |
|
|
// defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:customer-sale-invoice-request-main:agree`}), // 审批通过 |
|
|
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:`wms:${routeName.value}:publish`}), // 发布 |
|
|
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:`wms:customer-sale-invoice-request-main:publish`}), // 发布 |
|
|
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:`wms:${routeName.value}:resetting`}), // 重置 |
|
|
// defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:`wms:customer-sale-invoice-request-main:resetting`}), // 重置 |
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:update`}), // 编辑 |
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:customer-sale-invoice-request-main:update`}), // 编辑 |
|
|
|
|
|
defaultButtons.mainListCancelBtn({hide: isShowMainButton(row,['5']),hasPermi:'wms:customer-sale-invoice-request-main:cancel'}), //作废 |
|
|
|
|
|
|
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -334,7 +351,7 @@ const buttonTableClick = async (val, row) => { |
|
|
} else if (val == 'mainPlanPub') { // 发布 |
|
|
} else if (val == 'mainPlanPub') { // 发布 |
|
|
await message.confirm('确认要发布吗?') |
|
|
await message.confirm('确认要发布吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
CustomerSaleInvoiceMainApi.publish(row.masterId).then(() => { |
|
|
CustomerSaleInvoiceMainApi.publish(row.id).then(() => { |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh',null) |
|
@ -342,6 +359,19 @@ const buttonTableClick = async (val, row) => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
}) |
|
|
}) |
|
|
|
|
|
} else if (val == 'cancel') { // 作废 |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm('确认要作废吗?') |
|
|
|
|
|
await CustomerSaleInvoiceMainApi.nodeAbrogate(row.id) |
|
|
|
|
|
await message.success(t('ts.作废成功')) |
|
|
|
|
|
// 发起导出 |
|
|
|
|
|
//exportLoading.value = true |
|
|
|
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
buttonBaseClick('refresh',null) |
|
|
|
|
|
} |
|
|
} else if (val == 'mainPlanRes') { // 重置 |
|
|
} else if (val == 'mainPlanRes') { // 重置 |
|
|
await message.confirm('确认要重置吗?') |
|
|
await message.confirm('确认要重置吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|