Commit f64a3d1f665feb5f8e422f0c5f2c7b5c21db44ec
1 parent
c79a1ccb
处理开工报错问题
Showing
1 changed file
with
13 additions
and
64 deletions
src/components/Common/commonBusiness.js
| ... | ... | @@ -171,54 +171,9 @@ export async function saveData(param) { |
| 171 | 171 | const { |
| 172 | 172 | token, value, sModelsId, bMachineTask, |
| 173 | 173 | } = param; |
| 174 | - console.log(param, 'param'); | |
| 175 | - | |
| 176 | - | |
| 177 | 174 | const { optName } = value; |
| 178 | - let vb = { | |
| 179 | - ...value, | |
| 180 | - data: value.data.map(item => { | |
| 181 | - if (item.name === 'slave') { | |
| 182 | - const d = { | |
| 183 | - ...item, | |
| 184 | - column: item.column.map(x => { | |
| 185 | - const c = { | |
| 186 | - ...x, | |
| 187 | - "dMaterialsQty": x.dAuxiliaryQty + '.000', | |
| 188 | - "dMaterialsMoney": 0, | |
| 189 | - "dNMaterialsMoney": 0, | |
| 190 | - "dMaterialsNoTaxMoney": 0, | |
| 191 | - "dMaterialsPrice": 0, | |
| 192 | - "dMaterialsForeignPrice": 0, | |
| 193 | - "dMaterialsNoTaxPrice": 0, | |
| 194 | - "dMaterialsTaxMoney": 0, | |
| 195 | - "dMaterialsForeignMoney": 0, | |
| 196 | - "dMaterialsTaxForeignMoney": 0, | |
| 197 | - "dSrcNoCheckMoney": 0, | |
| 198 | - "iOrder": 1, | |
| 199 | - "bDefault": false, | |
| 200 | - 'key': x.sId, | |
| 201 | - sNodeId | |
| 202 | - : | |
| 203 | - "17659590640005403595594904199000" | |
| 204 | - | |
| 205 | - } | |
| 206 | - delete c.sWareHouseId | |
| 207 | - return c | |
| 208 | - }) | |
| 209 | - } | |
| 210 | - | |
| 211 | - return d | |
| 212 | - } | |
| 213 | - return { | |
| 214 | - ...item | |
| 215 | - } | |
| 216 | - }).filter(x => x.name !== 'slave0') | |
| 217 | - } | |
| 218 | - console.log(vb, 'vb'); | |
| 219 | - | |
| 220 | 175 | const dataReturn = (await commonServices.postValueService( |
| 221 | - token, vb, | |
| 176 | + token, value, | |
| 222 | 177 | `${commonConfig.server_host}business/addUpdateDelBusinessData?sModelsId=${sModelsId}`, |
| 223 | 178 | )).data; |
| 224 | 179 | if (bMachineTask) return dataReturn; |
| ... | ... | @@ -240,7 +195,7 @@ export async function saveData(param) { |
| 240 | 195 | {dataReturn.msg} |
| 241 | 196 | </div> |
| 242 | 197 | ), |
| 243 | - onOk() { }, | |
| 198 | + onOk() {}, | |
| 244 | 199 | }); |
| 245 | 200 | } else if (dataReturn.code === -7) { /* 防呆校验 返回是-7 */ |
| 246 | 201 | return dataReturn; |
| ... | ... | @@ -359,7 +314,7 @@ export function getShowTypes(name, props) { |
| 359 | 314 | getFloatNum: props.getFloatNum, |
| 360 | 315 | getDateFormat: props.getDateFormat, |
| 361 | 316 | // onChange: props.onChange, |
| 362 | - onChange: () => { }, | |
| 317 | + onChange: () => {}, | |
| 363 | 318 | formRoute: props.formRoute, |
| 364 | 319 | } |
| 365 | 320 | } |
| ... | ... | @@ -415,7 +370,6 @@ export function getCalculateByPrice(app, type, masterData, tableDataRow, sFieldN |
| 415 | 370 | /* 待用数据赋值 */ |
| 416 | 371 | const { dNetPrice, dNetMoney } = app.decimals; |
| 417 | 372 | const { sModelsType } = app.currentPane; |
| 418 | - if (!tableDataRow) return | |
| 419 | 373 | const dProductQty = commonUtils.convertToNum(tableDataRow[`d${type}Qty`]); /* 数量 */ |
| 420 | 374 | const dProductPrice = commonUtils.convertToNum(tableDataRow[`d${type}Price`]); /* 价格 */ |
| 421 | 375 | const dProductForeignPrice = commonUtils.convertToNum(tableDataRow[`d${type}ForeignPrice`]); /* 外币单价 */ |
| ... | ... | @@ -425,7 +379,7 @@ export function getCalculateByPrice(app, type, masterData, tableDataRow, sFieldN |
| 425 | 379 | const dLossMoney = commonUtils.convertToNum(tableDataRow.dLossMoney); /* 报损金额 */ |
| 426 | 380 | |
| 427 | 381 | const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */ |
| 428 | - let dCurrencyRate = masterData?.dCurrencyRate ? commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate) : 1; /* 汇率 */ | |
| 382 | + let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ | |
| 429 | 383 | /* 报价单模块,工单模块、产品工艺卡 汇率取从表 */ |
| 430 | 384 | if (commonUtils.isNotEmptyObject(sModelsType) && (sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('processCard'))) { |
| 431 | 385 | dCurrencyRate = commonUtils.convertIsNotNumToNumber1(tableDataRow.dCurrencyRate); /* 汇率 */ |
| ... | ... | @@ -491,7 +445,6 @@ export function getCalculateByPriceNew(app, type, masterData, tableDataRow, sFil |
| 491 | 445 | /* 待用数据赋值 */ |
| 492 | 446 | const { dNetPrice, dNetMoney } = app.decimals; |
| 493 | 447 | const { sModelsType } = app.currentPane; |
| 494 | - if (!tableDataRow) return | |
| 495 | 448 | const dProductQty = commonUtils.convertToNum(tableDataRow[`d${type}Qty`]); /* 数量 */ |
| 496 | 449 | const dProofingMoney = commonUtils.convertToNum(tableDataRow.dProofingMoney); /* 打样金额 */ |
| 497 | 450 | const dPlateMoney = commonUtils.convertToNum(tableDataRow.dPlateMoney); /* 制版金额 */ |
| ... | ... | @@ -502,7 +455,7 @@ export function getCalculateByPriceNew(app, type, masterData, tableDataRow, sFil |
| 502 | 455 | let dProductForeignMoney = commonUtils.convertToNum(tableDataRow[`d${type}ForeignMoney`]); |
| 503 | 456 | let dProductMoney = commonUtils.convertToNum(tableDataRow[`d${type}Money`]); /* 本币金额 */ |
| 504 | 457 | const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */ |
| 505 | - let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); /* 汇率 */ | |
| 458 | + let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ | |
| 506 | 459 | const dLossMoney = commonUtils.convertToNum(tableDataRow.dLossMoney); /* 报损金额 */ |
| 507 | 460 | /* 报价单模块,工单模块、产品工艺卡 汇率取从表 */ |
| 508 | 461 | if (commonUtils.isNotEmptyObject(sModelsType) && (sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('processCard'))) { |
| ... | ... | @@ -606,7 +559,7 @@ export function getCalculatedLossMoney(app, masterData, tableDataRow, type) { |
| 606 | 559 | const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */ |
| 607 | 560 | /* 数据赋值 */ |
| 608 | 561 | tableDataRow.dLossMoney = commonUtils.convertFixNum(dLossMoney, dNetMoney); |
| 609 | - const dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); /* 汇率 */ | |
| 562 | + const dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ | |
| 610 | 563 | const dSrcNoCheckMoney = commonUtils.isNull(tableDataRow.dSrcNoCheckMoney, 0); |
| 611 | 564 | if (commonUtils.isNotEmptyNumber(dSrcNoCheckMoney) && commonUtils.isNotEmptyNumber(dLossMoney)) { |
| 612 | 565 | const dMoney = commonUtils.convertFixNum(dSrcNoCheckMoney - dLossMoney, dNetMoney); |
| ... | ... | @@ -721,10 +674,9 @@ export function getCalculateMoney(app, masterData, tableDataRow, type, sFieldNam |
| 721 | 674 | /* 待用数据赋值 */ |
| 722 | 675 | const { dNetPrice, dNetMoney } = app.decimals; |
| 723 | 676 | const { sModelsType } = app.currentPane; |
| 724 | - if (!tableDataRow) return | |
| 725 | 677 | const dProductQty = commonUtils.convertToNum(tableDataRow[`d${type}Qty`]); /* 数量 */ |
| 726 | 678 | const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */ |
| 727 | - let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); /* 汇率 */ | |
| 679 | + let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ | |
| 728 | 680 | /* 报价单模块,工单模块、产品工艺卡 汇率取从表 */ |
| 729 | 681 | if (commonUtils.isNotEmptyObject(sModelsType) && (sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('processCard'))) { |
| 730 | 682 | dCurrencyRate = commonUtils.convertIsNotNumToNumber1(tableDataRow.dCurrencyRate); /* 汇率 */ |
| ... | ... | @@ -772,10 +724,9 @@ export function getCalculateMoneyNew(app, masterData, tableDataRow, type, sField |
| 772 | 724 | /* 待用数据赋值 */ |
| 773 | 725 | const { dNetPrice, dNetMoney } = app.decimals; |
| 774 | 726 | const { sModelsType } = app.currentPane; |
| 775 | - if (!tableDataRow) return | |
| 776 | 727 | const dProductQty = commonUtils.convertToNum(tableDataRow[`d${type}Qty`]); /* 数量 */ |
| 777 | 728 | const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */ |
| 778 | - let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); /* 汇率 */ | |
| 729 | + let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ | |
| 779 | 730 | /* 报价单模块,工单模块、产品工艺卡 汇率取从表 */ |
| 780 | 731 | if (commonUtils.isNotEmptyObject(sModelsType) && (sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('processCard'))) { |
| 781 | 732 | dCurrencyRate = commonUtils.convertIsNotNumToNumber1(tableDataRow.dCurrencyRate); /* 汇率 */ |
| ... | ... | @@ -854,11 +805,10 @@ export function getCalculateNoTaxPrice(app, masterData, tableDataRow, type) { |
| 854 | 805 | /* 待用数据赋值 */ |
| 855 | 806 | const { dNetPrice, dNetMoney } = app.decimals; |
| 856 | 807 | const { sModelsType } = app.currentPane; |
| 857 | - if (!tableDataRow) return | |
| 858 | 808 | const dProductQty = commonUtils.convertToNum(tableDataRow[`d${type}Qty`]); /* 数量 */ |
| 859 | 809 | const dProductNoTaxPrice = commonUtils.convertToNum(tableDataRow[`d${type}NoTaxPrice`]); /* 不含税价 */ |
| 860 | 810 | const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); /* 税率 */ |
| 861 | - let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); /* 汇率 */ | |
| 811 | + let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ | |
| 862 | 812 | /* 报价单模块,工单模块、产品工艺卡 汇率取从表 */ |
| 863 | 813 | if (commonUtils.isNotEmptyObject(sModelsType) && (sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('processCard'))) { |
| 864 | 814 | dCurrencyRate = commonUtils.convertIsNotNumToNumber1(tableDataRow.dCurrencyRate); /* 汇率 */ |
| ... | ... | @@ -886,11 +836,10 @@ export function getCalculateNoTaxMoney(app, masterData, tableDataRow, type) { |
| 886 | 836 | /* 待用数据赋值 */ |
| 887 | 837 | const { dNetPrice, dNetMoney } = app.decimals; |
| 888 | 838 | const { sModelsType } = app.currentPane; |
| 889 | - if (!tableDataRow) return | |
| 890 | 839 | const dProductQty = commonUtils.convertToNum(tableDataRow[`d${type}Qty`]); |
| 891 | 840 | const dProductNoTaxMoney = commonUtils.convertToNum(tableDataRow[`d${type}NoTaxMoney`]); |
| 892 | 841 | const dTaxRate = commonUtils.convertToNum(tableDataRow.dTaxRate); |
| 893 | - let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); | |
| 842 | + let dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); | |
| 894 | 843 | /* 报价单模块,工单模块、产品工艺卡 汇率取从表 */ |
| 895 | 844 | if (commonUtils.isNotEmptyObject(sModelsType) && (sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('processCard'))) { |
| 896 | 845 | dCurrencyRate = commonUtils.convertIsNotNumToNumber1(tableDataRow.dCurrencyRate); /* 汇率 */ |
| ... | ... | @@ -932,7 +881,7 @@ export function getCalculateMoneyByLossMoney(app, type, masterData, tableDataRow |
| 932 | 881 | /* 待用数据赋值 */ |
| 933 | 882 | const { dNetMoney } = app.decimals; |
| 934 | 883 | const dProductForeignMoney = commonUtils.convertFixNum(dSrcNoCheckMoney - dLossMoney, dNetMoney); |
| 935 | - const dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData?.dCurrencyRate); /* 汇率 */ | |
| 884 | + const dCurrencyRate = commonUtils.convertIsNotNumToNumber1(masterData.dCurrencyRate); /* 汇率 */ | |
| 936 | 885 | const dProductMoney = commonUtils.convertFixNum(dCurrencyRate !== 0 ? dProductForeignMoney * dCurrencyRate : 0, dNetMoney); /* 本位币金额 */ |
| 937 | 886 | /* 数据赋值 */ |
| 938 | 887 | tableDataRow[`d${type}ForeignMoney`] = dProductForeignMoney; |
| ... | ... | @@ -1103,7 +1052,7 @@ export function handleUnitType(app, resultValue) { |
| 1103 | 1052 | } |
| 1104 | 1053 | export function showLocalMessage(props, sName, sChineseName) { |
| 1105 | 1054 | let sTitle = ''; |
| 1106 | - if (commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) && commonUtils.isNotEmptyArr(props.app.commonConst)) { | |
| 1055 | + if(commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) && commonUtils.isNotEmptyArr(props.app.commonConst)) { | |
| 1107 | 1056 | const gdsformconst = props.app.commonConst; |
| 1108 | 1057 | sTitle = showMessage(gdsformconst, sName) |
| 1109 | 1058 | } else { |
| ... | ... | @@ -1308,7 +1257,7 @@ export async function clearSocketData(param) { |
| 1308 | 1257 | message.destroy(); |
| 1309 | 1258 | const { token, value, sModelsId } = param; |
| 1310 | 1259 | const { optName } = value; |
| 1311 | - const dataReturn = (await commonServices.postValueService(token, value, `${commonConfig.server_host}sysWebsocket/clearUserOperationRecord?sModelsId=${sModelsId}`)).data; | |
| 1260 | + const dataReturn = (await commonServices.postValueService( token, value, `${commonConfig.server_host}sysWebsocket/clearUserOperationRecord?sModelsId=${sModelsId}` )).data; | |
| 1312 | 1261 | /* 成功的话返回数据 */ |
| 1313 | 1262 | if (dataReturn.code === 1) { /* 成功 */ |
| 1314 | 1263 | if (!commonUtils.isEmpty(optName)) { | ... | ... |