diff --git a/src/components/Common/commonBusiness.js b/src/components/Common/commonBusiness.js index 760e6c2..d0e4a24 100644 --- a/src/components/Common/commonBusiness.js +++ b/src/components/Common/commonBusiness.js @@ -171,54 +171,9 @@ export async function saveData(param) { const { token, value, sModelsId, bMachineTask, } = param; - console.log(param, 'param'); - - const { optName } = value; - let vb = { - ...value, - data: value.data.map(item => { - if (item.name === 'slave') { - const d = { - ...item, - column: item.column.map(x => { - const c = { - ...x, - "dMaterialsQty": x.dAuxiliaryQty + '.000', - "dMaterialsMoney": 0, - "dNMaterialsMoney": 0, - "dMaterialsNoTaxMoney": 0, - "dMaterialsPrice": 0, - "dMaterialsForeignPrice": 0, - "dMaterialsNoTaxPrice": 0, - "dMaterialsTaxMoney": 0, - "dMaterialsForeignMoney": 0, - "dMaterialsTaxForeignMoney": 0, - "dSrcNoCheckMoney": 0, - "iOrder": 1, - "bDefault": false, - 'key': x.sId, - sNodeId - : - "17659590640005403595594904199000" - - } - delete c.sWareHouseId - return c - }) - } - - return d - } - return { - ...item - } - }).filter(x => x.name !== 'slave0') - } - console.log(vb, 'vb'); - const dataReturn = (await commonServices.postValueService( - token, vb, + token, value, `${commonConfig.server_host}business/addUpdateDelBusinessData?sModelsId=${sModelsId}`, )).data; if (bMachineTask) return dataReturn; @@ -240,7 +195,7 @@ export async function saveData(param) { {dataReturn.msg} ), - onOk() { }, + onOk() {}, }); } else if (dataReturn.code === -7) { /* 防呆校验 返回是-7 */ return dataReturn; @@ -359,7 +314,7 @@ export function getShowTypes(name, props) { getFloatNum: props.getFloatNum, getDateFormat: props.getDateFormat, // onChange: props.onChange, - onChange: () => { }, + onChange: () => {}, formRoute: props.formRoute, } } @@ -415,7 +370,6 @@ export function getCalculateByPrice(app, type, masterData, tableDataRow, sFieldN /* 待用数据赋值 */ const { dNetPrice, dNetMoney } = app.decimals; const { sModelsType } = app.currentPane; - if (!tableDataRow) return const dProductQty = commonUtils.convertToNum(tableDataRow[`d${type}Qty`]); /* 数量 */ const dProductPrice = commonUtils.convertToNum(tableDataRow[`d${type}Price`]); /* 价格 */ const dProductForeignPrice = commonUtils.convertToNum(tableDataRow[`d${type}ForeignPrice`]); /* 外币单价 */ @@ -425,7 +379,7 @@ export function getCalculateByPrice(app, type, masterData, tableDataRow, sFieldN const dLossMoney = commonUtils.convertToNum(tableDataRow.dLossMoney); /* 报损金额 */ const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */ - let dCurrencyRate = masterData?.dCurrencyRate ? commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate) : 1; /* 汇率 */ + let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ /* 报价单模块,工单模块、产品工艺卡 汇率取从表 */ if (commonUtils.isNotEmptyObject(sModelsType) && (sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('processCard'))) { dCurrencyRate = commonUtils.convertIsNotNumToNumber1(tableDataRow.dCurrencyRate); /* 汇率 */ @@ -491,7 +445,6 @@ export function getCalculateByPriceNew(app, type, masterData, tableDataRow, sFil /* 待用数据赋值 */ const { dNetPrice, dNetMoney } = app.decimals; const { sModelsType } = app.currentPane; - if (!tableDataRow) return const dProductQty = commonUtils.convertToNum(tableDataRow[`d${type}Qty`]); /* 数量 */ const dProofingMoney = commonUtils.convertToNum(tableDataRow.dProofingMoney); /* 打样金额 */ const dPlateMoney = commonUtils.convertToNum(tableDataRow.dPlateMoney); /* 制版金额 */ @@ -502,7 +455,7 @@ export function getCalculateByPriceNew(app, type, masterData, tableDataRow, sFil let dProductForeignMoney = commonUtils.convertToNum(tableDataRow[`d${type}ForeignMoney`]); let dProductMoney = commonUtils.convertToNum(tableDataRow[`d${type}Money`]); /* 本币金额 */ const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */ - let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); /* 汇率 */ + let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ const dLossMoney = commonUtils.convertToNum(tableDataRow.dLossMoney); /* 报损金额 */ /* 报价单模块,工单模块、产品工艺卡 汇率取从表 */ if (commonUtils.isNotEmptyObject(sModelsType) && (sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('processCard'))) { @@ -606,7 +559,7 @@ export function getCalculatedLossMoney(app, masterData, tableDataRow, type) { const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */ /* 数据赋值 */ tableDataRow.dLossMoney = commonUtils.convertFixNum(dLossMoney, dNetMoney); - const dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); /* 汇率 */ + const dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ const dSrcNoCheckMoney = commonUtils.isNull(tableDataRow.dSrcNoCheckMoney, 0); if (commonUtils.isNotEmptyNumber(dSrcNoCheckMoney) && commonUtils.isNotEmptyNumber(dLossMoney)) { const dMoney = commonUtils.convertFixNum(dSrcNoCheckMoney - dLossMoney, dNetMoney); @@ -721,10 +674,9 @@ export function getCalculateMoney(app, masterData, tableDataRow, type, sFieldNam /* 待用数据赋值 */ const { dNetPrice, dNetMoney } = app.decimals; const { sModelsType } = app.currentPane; - if (!tableDataRow) return const dProductQty = commonUtils.convertToNum(tableDataRow[`d${type}Qty`]); /* 数量 */ const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */ - let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); /* 汇率 */ + let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ /* 报价单模块,工单模块、产品工艺卡 汇率取从表 */ if (commonUtils.isNotEmptyObject(sModelsType) && (sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('processCard'))) { dCurrencyRate = commonUtils.convertIsNotNumToNumber1(tableDataRow.dCurrencyRate); /* 汇率 */ @@ -772,10 +724,9 @@ export function getCalculateMoneyNew(app, masterData, tableDataRow, type, sField /* 待用数据赋值 */ const { dNetPrice, dNetMoney } = app.decimals; const { sModelsType } = app.currentPane; - if (!tableDataRow) return const dProductQty = commonUtils.convertToNum(tableDataRow[`d${type}Qty`]); /* 数量 */ const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */ - let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); /* 汇率 */ + let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ /* 报价单模块,工单模块、产品工艺卡 汇率取从表 */ if (commonUtils.isNotEmptyObject(sModelsType) && (sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('processCard'))) { dCurrencyRate = commonUtils.convertIsNotNumToNumber1(tableDataRow.dCurrencyRate); /* 汇率 */ @@ -854,11 +805,10 @@ export function getCalculateNoTaxPrice(app, masterData, tableDataRow, type) { /* 待用数据赋值 */ const { dNetPrice, dNetMoney } = app.decimals; const { sModelsType } = app.currentPane; - if (!tableDataRow) return const dProductQty = commonUtils.convertToNum(tableDataRow[`d${type}Qty`]); /* 数量 */ const dProductNoTaxPrice = commonUtils.convertToNum(tableDataRow[`d${type}NoTaxPrice`]); /* 不含税价 */ const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */ - let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); /* 汇率 */ + let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ /* 报价单模块,工单模块、产品工艺卡 汇率取从表 */ if (commonUtils.isNotEmptyObject(sModelsType) && (sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('processCard'))) { dCurrencyRate = commonUtils.convertIsNotNumToNumber1(tableDataRow.dCurrencyRate); /* 汇率 */ @@ -886,11 +836,10 @@ export function getCalculateNoTaxMoney(app, masterData, tableDataRow, type) { /* 待用数据赋值 */ const { dNetPrice, dNetMoney } = app.decimals; const { sModelsType } = app.currentPane; - if (!tableDataRow) return const dProductQty = commonUtils.convertToNum(tableDataRow[`d${type}Qty`]); const dProductNoTaxMoney = commonUtils.convertToNum(tableDataRow[`d${type}NoTaxMoney`]); const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); - let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); + let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 报价单模块,工单模块、产品工艺卡 汇率取从表 */ if (commonUtils.isNotEmptyObject(sModelsType) && (sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('processCard'))) { dCurrencyRate = commonUtils.convertIsNotNumToNumber1(tableDataRow.dCurrencyRate); /* 汇率 */ @@ -932,7 +881,7 @@ export function getCalculateMoneyByLossMoney(app, type, masterData, tableDataRow /* 待用数据赋值 */ const { dNetMoney } = app.decimals; const dProductForeignMoney = commonUtils.convertFixNum(dSrcNoCheckMoney - dLossMoney, dNetMoney); - const dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); /* 汇率 */ + const dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ const dProductMoney = commonUtils.convertFixNum(dCurrencyRate !== 0 ? dProductForeignMoney * dCurrencyRate : 0, dNetMoney); /* 本位币金额 */ /* 数据赋值 */ tableDataRow[`d${type}ForeignMoney`] = dProductForeignMoney; @@ -1103,7 +1052,7 @@ export function handleUnitType(app, resultValue) { } export function showLocalMessage(props, sName, sChineseName) { let sTitle = ''; - if (commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) && commonUtils.isNotEmptyArr(props.app.commonConst)) { + if(commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) && commonUtils.isNotEmptyArr(props.app.commonConst)) { const gdsformconst = props.app.commonConst; sTitle = showMessage(gdsformconst, sName) } else { @@ -1308,7 +1257,7 @@ export async function clearSocketData(param) { message.destroy(); const { token, value, sModelsId } = param; const { optName } = value; - const dataReturn = (await commonServices.postValueService(token, value, `${commonConfig.server_host}sysWebsocket/clearUserOperationRecord?sModelsId=${sModelsId}`)).data; + const dataReturn = (await commonServices.postValueService( token, value, `${commonConfig.server_host}sysWebsocket/clearUserOperationRecord?sModelsId=${sModelsId}` )).data; /* 成功的话返回数据 */ if (dataReturn.code === 1) { /* 成功 */ if (!commonUtils.isEmpty(optName)) {