|
@@ -4,7 +4,8 @@ const FieldKeysMap = {
|
|
|
"SP_PickMtrl": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FActualQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FWorkCenterId.fname,FEntrtyMemo,FDate,FPickerId.fname,FSTOCKERID.fname,FStockActualQty,FWorkShopId.fname,FPickingPeople_LT.FName",
|
|
|
"LT_PRD_PMCWorkBench": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FActualQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FWorkCenterId_LT.fname,FEntrtyMemo,FDate,FApplicantId.fname,FSTOCKERID.fname,FStockActualQty,FWorkShopId.fname",
|
|
|
"PUR_MRB": "FID,FPURMRBENTRY_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FInventoryQty,FENCHASENUM_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FDate,FSTOCKERID.fname,FStockId.FNumber,FRMREALQTY,FFabricOrderNo,FPURCHASERID.fname",
|
|
|
- "STK_OEMInStockRETURN": "FID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBoxNo,FInventoryQty,FENCHASENUM_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FDate,FSTOCKERID.fname,FStockId.FNumber,FQty,FFabricOrderNo,FNoteEntry"
|
|
|
+ "STK_OEMInStockRETURN": "FID,FBillEntry_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBoxNo,FInventoryQty,FENCHASENUM_LT,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FDate,FSTOCKERID.fname,FStockId.FNumber,FQty,FFabricOrderNo,FNoteEntry",
|
|
|
+ "SAL_OUTSTOCK": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBoxNumber,FInventoryQty_LT,FENCHASENUM_LT,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FDate,FSTOCKERID.fname,FStockId.FNumber,FRealQty,FFABRICORDERNO_LT,FEntrynote"
|
|
|
};
|
|
|
|
|
|
export function getSearchParam(condition) {
|
|
@@ -75,7 +76,7 @@ export function getSearchParam(condition) {
|
|
|
let FieldKeys =
|
|
|
"FID,FWorkCenterId.fname,FPickingPeople_LT.fname,FSTOCKERID.fname,FBillNo,FDate,FNote,FStockOrgId"
|
|
|
console.log(condition.FBillType)
|
|
|
- if (condition.FBillType != null) { //领料
|
|
|
+ if (condition.FBillType == "d43d7e5b9def82fc11e3e582178e4360") { //领料
|
|
|
FilterString.push({
|
|
|
"Left": "",
|
|
|
"FieldName": "FBillType",
|
|
@@ -100,19 +101,44 @@ export function getSearchParam(condition) {
|
|
|
FieldKeys =
|
|
|
"FID,FWorkCenterId.fname,FPickingPeople_LT.fname,FSTOCKERID.fname,FBillNo,FDate,FNote,FStockOrgId,FDeptId.FName,FPickerId.FName"
|
|
|
}
|
|
|
- if (condition.FormId == "SP_PickMtrl") { //简单生产领料单
|
|
|
+ if (condition.FormId == "SP_PickMtrl" && condition.FBillType !=='B') { //简单生产领料单
|
|
|
+ FilterString.push({
|
|
|
+ "Left": "",
|
|
|
+ "FieldName": "FCollectStatus_LT",
|
|
|
+ "Compare": "106",
|
|
|
+ "Value": "B",
|
|
|
+ "Right": "",
|
|
|
+ "Logic": 0
|
|
|
+ });
|
|
|
FieldKeys =
|
|
|
- "FID,FWorkCenterId.fname,FPickerId.fname,FSTOCKERID.fname,FBillNo,FDate,FDescription,FStockOrgId,FPickingPeople_LT.FName"
|
|
|
+ "FID,FWorkCenterId.fname,FPickerId.fname,FSTOCKERID.fname,FBillNo,FDate,FDescription,FStockOrgId,FPickingPeople_LT.FName,FCollectStatus_LT"
|
|
|
+ }
|
|
|
+ if (condition.FormId == "SP_PickMtrl" && condition.FBillType =='B') { //简单生产领料单(智能)
|
|
|
+ FilterString.push({
|
|
|
+ "Left": "",
|
|
|
+ "FieldName": "FCollectStatus_LT",
|
|
|
+ "Compare": "105",
|
|
|
+ "Value": "B",
|
|
|
+ "Right": "",
|
|
|
+ "Logic": 0
|
|
|
+ });
|
|
|
+ FieldKeys =
|
|
|
+ "FID,FWorkCenterId.fname,FPickerId.fname,FSTOCKERID.fname,FBillNo,FDate,FDescription,FStockOrgId,FPickingPeople_LT.FName,FCollectStatus_LT"
|
|
|
}
|
|
|
if (condition.FormId == "PUR_MRB") { //采购退料单
|
|
|
FieldKeys =
|
|
|
"FID,FSupplierID.fname,FPURCHASERID.fname,FPURCHASEDEPTID.fname,FSTOCKERID.fname,FBillNo,FDate,FStockOrgId"
|
|
|
}
|
|
|
- if (condition.FormId == "STK_OEMInStockRETURN") { //
|
|
|
+ if (condition.FormId == "STK_OEMInStockRETURN") {
|
|
|
FieldKeys =
|
|
|
"FID,FCustId.FName,FDeptId_LT.FName,FBillNo,FSTOCKERID.fname,FDate,FNote,FStockOrgId"
|
|
|
}
|
|
|
+ if (condition.FormId == "SAL_OUTSTOCK") { //销售出库
|
|
|
+ FieldKeys =
|
|
|
+ "FID,FBillNo,FCustomerID.FName,FSalesManID.FName,FSaleDeptID.FName,FSTOCKERID.fname,FDate"
|
|
|
+ }
|
|
|
console.log(FieldKeys)
|
|
|
+ console.log(FilterString)
|
|
|
|
|
|
return {
|
|
|
"parameters": [{
|
|
@@ -124,10 +150,14 @@ export function getSearchParam(condition) {
|
|
|
}
|
|
|
export function getBillDetailListParam(condition) {
|
|
|
console.log(condition)
|
|
|
+ let FieldKeys = FieldKeysMap[condition.FormId]
|
|
|
+ if(condition.FormId == "SP_PickMtrl" && condition.FBillType =='B'){
|
|
|
+ FieldKeys = "FID,FSumEntity_FEntryID,FBillNo,FSTOCKERID.fname,FSumStockLocId.FF102029.fname,FSumMaterialId.fnumber,FSumBoxNo_LT,FSumActualQty,FSumEnchaseNum_LT,FSumAuxPropId.FF101501.FNumber,FSumLot.FNumber,FWorkCenterId.fname,FDate,FPickerId.fname,FWorkShopId.fname,FPickingPeople_LT.FName"
|
|
|
+ }
|
|
|
return {
|
|
|
"parameters": [{
|
|
|
"FormId": condition.FormId,
|
|
|
- "FieldKeys": FieldKeysMap[condition.FormId],
|
|
|
+ "FieldKeys": FieldKeys,
|
|
|
"FilterString": [{
|
|
|
"Left": "",
|
|
|
"FieldName": "FID",
|
|
@@ -167,81 +197,171 @@ export function createInventoryQueryRequest(value) {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
-function getActualQtyKey(FormId) {
|
|
|
- const keyMap = {
|
|
|
- 'LT_PRD_PMCWorkBench': 'FActualQty',
|
|
|
- 'SP_PickMtrl': 'FActualQty',
|
|
|
- 'STK_MisDelivery': 'FQty',
|
|
|
- 'PUR_MRB': 'FRMREALQTY'
|
|
|
- };
|
|
|
- return keyMap[FormId] || 'FQty';
|
|
|
-}
|
|
|
-
|
|
|
-function createEntityObject(item, actualQtyKey) {
|
|
|
- return {
|
|
|
- "FEntryID": item["FEntity.FEntryID"],
|
|
|
- "FInventoryQty": item["FInventoryQty"],
|
|
|
- "FAuxPropId": {
|
|
|
- "FAUXPROPID__FF101501": {
|
|
|
- "FNumber": item["FAuxPropId.FF101501.FDATAVALUE"]
|
|
|
- }
|
|
|
- },
|
|
|
- "FStockLocId": {
|
|
|
- "FSTOCKLOCID__FF102029": {
|
|
|
- "Fname": item["FStockLocId.FF102029.fname"]
|
|
|
- }
|
|
|
- },
|
|
|
- "FLot": {
|
|
|
- "FNumber": item["Flot.FNumber"]
|
|
|
- },
|
|
|
- "FENCHASENUM_LT": item["FENCHASENUM.LT"],
|
|
|
- [actualQtyKey]: item[actualQtyKey] // 使用动态键名
|
|
|
- };
|
|
|
-}
|
|
|
-
|
|
|
-export function getSaveParam(FormId, data, indexList) {
|
|
|
- const targetFID = data;
|
|
|
- const actualQtyKey = getActualQtyKey(FormId);
|
|
|
-
|
|
|
- const FEntityObjects = indexList
|
|
|
- .filter(item => item.FID === targetFID)
|
|
|
- .map(item => createEntityObject(item, actualQtyKey));
|
|
|
-
|
|
|
- const needUpdateFields = [
|
|
|
- "FInventoryQty",
|
|
|
- "FAuxPropId",
|
|
|
- "FStockLocId",
|
|
|
- "FIsScanFabric",
|
|
|
- "FLot",
|
|
|
- "FENCHASENUM_LT",
|
|
|
- actualQtyKey // 直接添加到数组中
|
|
|
- ];
|
|
|
-
|
|
|
- return {
|
|
|
- "parameters": [
|
|
|
- FormId,
|
|
|
- {
|
|
|
- "NeedUpDateFields": needUpdateFields,
|
|
|
- "NeedReturnFields": ["FID"],
|
|
|
- "IsDeleteEntry": "true",
|
|
|
- "SubSystemId": "",
|
|
|
- "IsVerifyBaseDataField": "false",
|
|
|
- "IsEntryBatchFill": "true",
|
|
|
- "ValidateFlag": "true",
|
|
|
- "NumberSearch": "true",
|
|
|
- "IsAutoAdjustField": "false",
|
|
|
- "InterationFlags": "",
|
|
|
- "IgnoreInterationFlag": "",
|
|
|
- "IsControlPrecision": "false",
|
|
|
- "ValidateRepeatJson": "false",
|
|
|
- "Model": {
|
|
|
- "FID": targetFID,
|
|
|
- "FIsScanFabric": true,
|
|
|
- "FEntity": FEntityObjects
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
+function getActualQtyKey(FormId) {
|
|
|
+ const keyMap = {
|
|
|
+ 'LT_PRD_PMCWorkBench': 'FActualQty',
|
|
|
+ 'SP_PickMtrl': 'FActualQty',
|
|
|
+ 'STK_MisDelivery': 'FQty',
|
|
|
+ 'PUR_MRB': 'FRMREALQTY',
|
|
|
+ 'SAL_OUTSTOCK': 'FRealQty',
|
|
|
+ };
|
|
|
+ return keyMap[FormId] || 'FQty';
|
|
|
+}
|
|
|
+
|
|
|
+function getFInventoryQtyKey(FormId) {
|
|
|
+ const keyMap = {
|
|
|
+ 'SAL_OUTSTOCK': 'FInventoryQty.LT',
|
|
|
+ };
|
|
|
+ return keyMap[FormId] || 'FInventoryQty';
|
|
|
+}
|
|
|
+
|
|
|
+function getStockLocIdKey(FormId) {
|
|
|
+ const keyMap = {
|
|
|
+ 'SAL_OUTSTOCK': 'FName',
|
|
|
+ };
|
|
|
+ return keyMap[FormId] || 'FNumber';
|
|
|
+}
|
|
|
+
|
|
|
+function getEntityKey(FormId) {
|
|
|
+ const keyMap = {
|
|
|
+ 'STK_OEMInStockRETURN': 'FBillEntry',
|
|
|
+ };
|
|
|
+ return keyMap[FormId] || 'FEntity';
|
|
|
+}
|
|
|
+
|
|
|
+function createEntityObject(item, actualQtyKey, entityKey, InventoryQtyKey,StockLocIdKey) {
|
|
|
+ return {
|
|
|
+ "FEntryID": item[entityKey + ".FEntryID"],
|
|
|
+ [InventoryQtyKey]: item[InventoryQtyKey],
|
|
|
+ "FAuxPropId": {
|
|
|
+ "FAUXPROPID__FF101501": {
|
|
|
+ "FNumber": item["FAuxPropId.FF101501.FDATAVALUE"]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "FStockLocId": {
|
|
|
+ "FSTOCKLOCID__FF102029": {
|
|
|
+ [StockLocIdKey]: item["FStockLocId.FF102029.fname"]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "FLot": {
|
|
|
+ "FNumber": item["Flot.FNumber"]
|
|
|
+ },
|
|
|
+ "FENCHASENUM_LT": item["FENCHASENUM.LT"],
|
|
|
+ [actualQtyKey]: item[actualQtyKey] // 使用动态键名
|
|
|
+ };
|
|
|
+}
|
|
|
+function createEntityObject2(item) {
|
|
|
+ return {
|
|
|
+ "FEntryID": item["FSumEntity.FEntryID"],
|
|
|
+ "FSumAuxPropId": {
|
|
|
+ "FSUMAUXPROPID__FF101501": {
|
|
|
+ "FNumber": item["FSumAuxPropId.FF101501.FDATAVALUE"]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "FSumStockLocId": {
|
|
|
+ "FSUMSTOCKLOCID__FF102029": {
|
|
|
+ "FNumber": item["FSumStockLocId.FF102029.fname"]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "FSumLot": {
|
|
|
+ "FNumber": item["FSumLot.FNumber"]
|
|
|
+ },
|
|
|
+ "FSumEnchaseNum_LT": item["FSumEnchaseNum.LT"],
|
|
|
+ "FSumActualQty": item["FSumActualQty"]
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
+export function getSaveParam(FormId, data, indexList) {
|
|
|
+ const targetFID = data;
|
|
|
+ const actualQtyKey = getActualQtyKey(FormId);
|
|
|
+ const InventoryQtyKey = getFInventoryQtyKey(FormId);
|
|
|
+ const entityKey = getEntityKey(FormId);
|
|
|
+ const StockLocIdKey = getStockLocIdKey(FormId);
|
|
|
+ const FEntityObjects = indexList
|
|
|
+ .filter(item => item.FID === targetFID)
|
|
|
+ .map(item => createEntityObject(item, actualQtyKey, entityKey, InventoryQtyKey,StockLocIdKey));
|
|
|
+
|
|
|
+ const needUpdateFields = [
|
|
|
+ InventoryQtyKey,
|
|
|
+ "FAuxPropId",
|
|
|
+ "FStockLocId",
|
|
|
+ "FIsScanFabric",
|
|
|
+ "FLot",
|
|
|
+ "FENCHASENUM_LT",
|
|
|
+ actualQtyKey // 直接添加到数组中
|
|
|
+ ];
|
|
|
+
|
|
|
+ return {
|
|
|
+ "parameters": [
|
|
|
+ FormId,
|
|
|
+ {
|
|
|
+ "NeedUpDateFields": needUpdateFields,
|
|
|
+ "NeedReturnFields": ["FID"],
|
|
|
+ "IsDeleteEntry": "true",
|
|
|
+ "SubSystemId": "",
|
|
|
+ "IsVerifyBaseDataField": "false",
|
|
|
+ "IsEntryBatchFill": "true",
|
|
|
+ "ValidateFlag": "true",
|
|
|
+ "NumberSearch": "true",
|
|
|
+ "IsAutoAdjustField": "false",
|
|
|
+ "InterationFlags": "",
|
|
|
+ "IgnoreInterationFlag": "",
|
|
|
+ "IsControlPrecision": "false",
|
|
|
+ "ValidateRepeatJson": "false",
|
|
|
+ "Model": {
|
|
|
+ "FID": targetFID,
|
|
|
+ "FIsScanFabric": true,
|
|
|
+ [entityKey]: FEntityObjects
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+}
|
|
|
+export function get2SaveParam(FormId, data, indexList) {
|
|
|
+ const targetFID = data;
|
|
|
+ // const actualQtyKey = getActualQtyKey(FormId);
|
|
|
+ // const InventoryQtyKey = getFInventoryQtyKey(FormId);
|
|
|
+ const entityKey = getEntityKey(FormId);
|
|
|
+ // const StockLocIdKey = getStockLocIdKey(FormId);
|
|
|
+ const FEntityObjects = indexList
|
|
|
+ .filter(item => item.FID === targetFID)
|
|
|
+ .map(item => createEntityObject2(item));
|
|
|
+
|
|
|
+ const needUpdateFields = [
|
|
|
+ // InventoryQtyKey,
|
|
|
+ "FSumAuxPropId",
|
|
|
+ "FSumStockLocId",
|
|
|
+ "FIsScanFabric",
|
|
|
+ "FSumLot",
|
|
|
+ "FSumEnchaseNum_LT",
|
|
|
+ "FSumActualQty" // 直接添加到数组中
|
|
|
+ ];
|
|
|
+
|
|
|
+ return {
|
|
|
+ "parameters": [
|
|
|
+ FormId,
|
|
|
+ {
|
|
|
+ "NeedUpDateFields": needUpdateFields,
|
|
|
+ "NeedReturnFields": ["FID"],
|
|
|
+ "IsDeleteEntry": "true",
|
|
|
+ "SubSystemId": "",
|
|
|
+ "IsVerifyBaseDataField": "false",
|
|
|
+ "IsEntryBatchFill": "true",
|
|
|
+ "ValidateFlag": "true",
|
|
|
+ "NumberSearch": "true",
|
|
|
+ "IsAutoAdjustField": "false",
|
|
|
+ "InterationFlags": "",
|
|
|
+ "IgnoreInterationFlag": "",
|
|
|
+ "IsControlPrecision": "false",
|
|
|
+ "ValidateRepeatJson": "false",
|
|
|
+ "Model": {
|
|
|
+ "FID": targetFID,
|
|
|
+ "FIsScanFabric": true,
|
|
|
+ "FSumEntity": FEntityObjects
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
}
|
|
|
export function getSubmitParam(FormId, data) {
|
|
|
const params = {
|