|
@@ -1,123 +1,12 @@
|
|
|
// 定义字段映射
|
|
|
const FieldKeysMap = {
|
|
|
- "STK_MisDelivery": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FWorkCenterId.fname,FDate,FEntryNote,FPickingPeople_LT.fname,FSTOCKERID.fname,FWorkDeptId_LT.fname,FDeptId.FName,FPickerId.FName",
|
|
|
- "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_MISCELLANEOUS": "FID,FEnchaseNum_LT,FSTOCKID.FName,FStockLocId.FF102029.FNumber,FMATERIALID.FNumber,FLOT.FNumber,FQty,FUnitID.FName,FDate,FBillNo,FSTOCKID.FNumber"
|
|
|
+ "STK_MISCELLANEOUS": "FID,FEntity_FEntryID,FENCHASENUM_LT,FSTOCKID.FName,FStockLocId.FF102029.FNumber,FMATERIALID.FNumber,FLOT.FNumber,FQty,FUnitID.FName,FDate,FBillNo,FSTOCKID.FNumber",
|
|
|
+ "STK_InStock": "FID,FInStockEntry_FEntryID,FENCHASENUM_LT,FSTOCKID.FName,FStockLocId.FF102029.FNumber,FMATERIALID.FNumber,FLOT.FNumber,FRealQty,FUnitID.FName,FDate,FBillNo,FSTOCKID.FNumber",
|
|
|
+ "STK_OEMInStock": "FID,FBillEntry_FEntryID,FENCHASENUM_LT,FSTOCKID.FName,FStockLocId.FF102029.FNumber,FMATERIALID.FNumber,FLOT.FNumber,FQty,FUnitID.FName,FDate,FBillNo,FSTOCKID.FNumber",
|
|
|
+ "LT_PRD_PMCWorkBench": "FID,FEntity_FEntryID,FENCHASENUM_LT,FSTOCKID.FName,FStockLocId.FF102029.FNumber,FMATERIALID.FNumber,FLOT.FNumber,FActualQty,FUnitID.FName,FDate,FBillNo,FSTOCKID.FNumber",
|
|
|
+ "SP_ReturnMtrl": "FID,FEntity_FEntryID,FENCHASENUM_LT,FSTOCKID.FName,FStockLocId.FF102029.FNumber,FMATERIALID.FNumber,FLOT.FNumber,FQty,FUnitID.FName,FDate,FBillNo,FSTOCKID.FNumber",
|
|
|
+ "STK_MisDelivery": "FID,FEntity_FEntryID,FENCHASENUM_LT,FSTOCKID.FName,FStockLocId.FF102029.FNumber,FMATERIALID.FNumber,FLOT.FNumber,FQty,FUnitID.FName,FDate,FBillNo,FSTOCKID.FNumber",
|
|
|
};
|
|
|
-
|
|
|
-export function getSearchParam(condition) {
|
|
|
- let FilterString = [{ //其他出库
|
|
|
- "Left": "(",
|
|
|
- "FieldName": "FDocumentStatus",
|
|
|
- "Compare": "105",
|
|
|
- "Value": "A",
|
|
|
- "Right": "",
|
|
|
- "Logic": 1
|
|
|
- },
|
|
|
- // {//审核中
|
|
|
- // "Left": "",
|
|
|
- // "FieldName": "FDocumentStatus",
|
|
|
- // "Compare": "105",
|
|
|
- // "Value": "B",
|
|
|
- // "Right": "",
|
|
|
- // "Logic": 1
|
|
|
- // },
|
|
|
- {
|
|
|
- "Left": "",
|
|
|
- "FieldName": "FDocumentStatus",
|
|
|
- "Compare": "105",
|
|
|
- "Value": "D",
|
|
|
- "Right": ")",
|
|
|
- "Logic": 0
|
|
|
- }, {
|
|
|
- "Left": "",
|
|
|
- "FieldName": "FStockOrgId.FNumber",
|
|
|
- "Compare": "67",
|
|
|
- "Value": condition.FStockOrgId,
|
|
|
- "Right": "",
|
|
|
- "Logic": 0
|
|
|
- },
|
|
|
- {
|
|
|
- "FieldName": "FBillNo",
|
|
|
- "Compare": "17",
|
|
|
- "Value": condition.billNo,
|
|
|
- "Left": "",
|
|
|
- "Right": "",
|
|
|
- "Logic": 0
|
|
|
- },
|
|
|
- {
|
|
|
- "Left": "",
|
|
|
- "FieldName": "FStockId.FName",
|
|
|
- "Compare": "17",
|
|
|
- "Value": "面料",
|
|
|
- "Right": "",
|
|
|
- "Logic": 0
|
|
|
- },
|
|
|
- {
|
|
|
- "FieldName": "FDate",
|
|
|
- "Compare": "39",
|
|
|
- "Value": condition.range[0],
|
|
|
- "Left": "(",
|
|
|
- "Right": "",
|
|
|
- "Logic": "0"
|
|
|
- },
|
|
|
- {
|
|
|
- "FieldName": "FDate",
|
|
|
- "Compare": "16",
|
|
|
- "Value": condition.range[1],
|
|
|
- "Left": "",
|
|
|
- "Right": ")",
|
|
|
- "Logic": "0"
|
|
|
- }
|
|
|
- ]
|
|
|
- let FieldKeys =
|
|
|
- "FID,FWorkCenterId.fname,FPickingPeople_LT.fname,FSTOCKERID.fname,FBillNo,FDate,FNote,FStockOrgId"
|
|
|
- console.log(condition.FBillType)
|
|
|
- if (condition.FBillType != null) { //领料
|
|
|
- FilterString.push({
|
|
|
- "Left": "",
|
|
|
- "FieldName": "FBillType",
|
|
|
- "Compare": "105",
|
|
|
- "Value": condition.FBillType,
|
|
|
- "Right": "",
|
|
|
- "Logic": 0
|
|
|
- });
|
|
|
- console.log('aaaa')
|
|
|
- FieldKeys =
|
|
|
- "FID,FWorkCenterId_LT.fname,FApplicantId.fname,FSTOCKERID.fname,FBillNo,FDate,FDescription,FStockOrgId"
|
|
|
- }
|
|
|
- if (condition.FormId == "STK_MisDelivery") { //其他出库
|
|
|
- FilterString.push({
|
|
|
- "Left": "",
|
|
|
- "FieldName": "FStockDirect",
|
|
|
- "Compare": "29",
|
|
|
- "Value": "GENERAL",
|
|
|
- "Right": "",
|
|
|
- "Logic": 0
|
|
|
- });
|
|
|
- FieldKeys =
|
|
|
- "FID,FWorkCenterId.fname,FPickingPeople_LT.fname,FSTOCKERID.fname,FBillNo,FDate,FNote,FStockOrgId,FDeptId.FName,FPickerId.FName"
|
|
|
- }
|
|
|
- if (condition.FormId == "SP_PickMtrl") { //简单生产领料单
|
|
|
- FieldKeys =
|
|
|
- "FID,FWorkCenterId.fname,FPickerId.fname,FSTOCKERID.fname,FBillNo,FDate,FDescription,FStockOrgId,FPickingPeople_LT.FName"
|
|
|
- }
|
|
|
- if (condition.FormId == "PUR_MRB") { //采购退料单
|
|
|
- FieldKeys =
|
|
|
- "FID,FSupplierID.fname,FPURCHASERID.fname,FPURCHASEDEPTID.fname,FSTOCKERID.fname,FBillNo,FDate,FStockOrgId"
|
|
|
- }
|
|
|
- console.log(FieldKeys)
|
|
|
-
|
|
|
- return {
|
|
|
- "parameters": [{
|
|
|
- "FormId": condition.FormId,
|
|
|
- "FieldKeys": FieldKeys,
|
|
|
- "FilterString": FilterString
|
|
|
- }]
|
|
|
- }
|
|
|
-}
|
|
|
export function getStorageSearchParam(condition) {
|
|
|
let FilterString = [{
|
|
|
"Left": "(",
|
|
@@ -162,6 +51,115 @@ export function getStorageSearchParam(condition) {
|
|
|
"Right": "",
|
|
|
"Logic": 0
|
|
|
}]
|
|
|
+ if (condition.FormId == "STK_InStock" || condition.FormId == "STK_OEMInStock"||condition.FormId == "SP_ReturnMtrl") {
|
|
|
+ FilterString = [{
|
|
|
+ "Left": "(",
|
|
|
+ "FieldName": "FDocumentStatus",
|
|
|
+ "Compare": "105",
|
|
|
+ "Value": "A",
|
|
|
+ "Right": "",
|
|
|
+ "Logic": 1
|
|
|
+ }, {
|
|
|
+ "Left": "",
|
|
|
+ "FieldName": "FDocumentStatus",
|
|
|
+ "Compare": "105",
|
|
|
+ "Value": "D",
|
|
|
+ "Right": ")",
|
|
|
+ "Logic": 0
|
|
|
+ }, {
|
|
|
+ "Left": "",
|
|
|
+ "FieldName": "FEnchaseNum_LT",
|
|
|
+ "Compare": "67",
|
|
|
+ "Value": condition.FEnchaseNum_LT,
|
|
|
+ "Right": "",
|
|
|
+ "Logic": 0
|
|
|
+ }]
|
|
|
+
|
|
|
+ }
|
|
|
+ if (condition.FormId == "LT_PRD_PMCWorkBench") { //
|
|
|
+ FilterString = [{
|
|
|
+ "Left": "(",
|
|
|
+ "FieldName": "FDocumentStatus",
|
|
|
+ "Compare": "105",
|
|
|
+ "Value": "A",
|
|
|
+ "Right": "",
|
|
|
+ "Logic": 1
|
|
|
+ }, {
|
|
|
+ "Left": "",
|
|
|
+ "FieldName": "FDocumentStatus",
|
|
|
+ "Compare": "105",
|
|
|
+ "Value": "D",
|
|
|
+ "Right": ")",
|
|
|
+ "Logic": 0
|
|
|
+ }, {
|
|
|
+ "Left": "",
|
|
|
+ "FieldName": "FEnchaseNum_LT",
|
|
|
+ "Compare": "67",
|
|
|
+ "Value": condition.FEnchaseNum_LT,
|
|
|
+ "Right": "",
|
|
|
+ "Logic": 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "Left": "",
|
|
|
+ "FieldName": "FStockId.FName",
|
|
|
+ "Compare": "17",
|
|
|
+ "Value": "面料",
|
|
|
+ "Right": "",
|
|
|
+ "Logic": 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "Left": "",
|
|
|
+ "FieldName": "FBillType",
|
|
|
+ "Compare": "105",
|
|
|
+ "Value": "d43d7e5b9def82fd11e3e603ca986cd9",
|
|
|
+ "Right": "",
|
|
|
+ "Logic": 0
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ }
|
|
|
+ if (condition.FormId == "STK_MisDelivery") { //
|
|
|
+ FilterString = [{
|
|
|
+ "Left": "(",
|
|
|
+ "FieldName": "FDocumentStatus",
|
|
|
+ "Compare": "105",
|
|
|
+ "Value": "A",
|
|
|
+ "Right": "",
|
|
|
+ "Logic": 1
|
|
|
+ }, {
|
|
|
+ "Left": "",
|
|
|
+ "FieldName": "FDocumentStatus",
|
|
|
+ "Compare": "105",
|
|
|
+ "Value": "D",
|
|
|
+ "Right": ")",
|
|
|
+ "Logic": 0
|
|
|
+ }, {
|
|
|
+ "Left": "",
|
|
|
+ "FieldName": "FEnchaseNum_LT",
|
|
|
+ "Compare": "67",
|
|
|
+ "Value": condition.FEnchaseNum_LT,
|
|
|
+ "Right": "",
|
|
|
+ "Logic": 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "Left": "",
|
|
|
+ "FieldName": "FStockId.FName",
|
|
|
+ "Compare": "17",
|
|
|
+ "Value": "面料",
|
|
|
+ "Right": "",
|
|
|
+ "Logic": 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "Left": "",
|
|
|
+ "FieldName": "FStockDirect",
|
|
|
+ "Compare": "29",
|
|
|
+ "Value": "RETURN",
|
|
|
+ "Right": "",
|
|
|
+ "Logic": 0
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
return {
|
|
|
"parameters": [{
|
|
@@ -187,77 +185,10 @@ export function getStorageByBillNoParam(condition) {
|
|
|
}]
|
|
|
}
|
|
|
}
|
|
|
-export function getBillDetailListParam(condition) {
|
|
|
- console.log(condition)
|
|
|
- return {
|
|
|
- "parameters": [{
|
|
|
- "FormId": condition.FormId,
|
|
|
- "FieldKeys": FieldKeysMap[condition.FormId],
|
|
|
- "FilterString": [{
|
|
|
- "Left": "",
|
|
|
- "FieldName": "FID",
|
|
|
- "Compare": "338",
|
|
|
- "Value": condition.selectedFID,
|
|
|
- "Right": "",
|
|
|
- "Logic": 0
|
|
|
- }],
|
|
|
- }]
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-// 定义一个函数来创建库存查询请求数据
|
|
|
-export function createInventoryQueryRequest(value) {
|
|
|
- return {
|
|
|
- parameters: [{
|
|
|
- FormId: "STK_Inventory",
|
|
|
- FieldKeys: "fID",
|
|
|
- FilterString: [{
|
|
|
- Left: "",
|
|
|
- FieldName: "FStockLocId.FF102029.FName",
|
|
|
- Compare: "67",
|
|
|
- Value: value,
|
|
|
- Right: "",
|
|
|
- Logic: 0
|
|
|
- },
|
|
|
- {
|
|
|
- Left: "",
|
|
|
- FieldName: "FBaseQty",
|
|
|
- Compare: "21",
|
|
|
- Value: "0",
|
|
|
- Right: "",
|
|
|
- Logic: 0
|
|
|
- }
|
|
|
- ]
|
|
|
- }]
|
|
|
- };
|
|
|
-}
|
|
|
|
|
|
-function getActualQtyKey(FormId) {
|
|
|
- const keyMap = {
|
|
|
- 'LT_PRD_PMCWorkBench': 'FActualQty',
|
|
|
- 'SP_PickMtrl': 'FActualQty',
|
|
|
- 'STK_MisDelivery': 'FQty',
|
|
|
- 'PUR_MRB': 'FRMREALQTY'
|
|
|
- };
|
|
|
- return keyMap[FormId] || 'FQty';
|
|
|
-}
|
|
|
- // {
|
|
|
- // "FID": 1433700,
|
|
|
- // "FEnchaseNum.LT": "877895251",
|
|
|
- // "FSTOCKID.FName": "总公司衬衣面料仓库(国内)",
|
|
|
- // "FStockLocId.FF102029.FNumber": null,
|
|
|
- // "FMATERIALID.FNumber": "ML92730-222034LAM",
|
|
|
- // "FLOT.FNumber": "999423132132",
|
|
|
- // "FQty": 10000,
|
|
|
- // "FUnitID.FName": "米",
|
|
|
- // "FDate": "2024-09-04T00:00:00",
|
|
|
- // "FBillNo": "QTRK2409040002",
|
|
|
- // "FSTOCKID.FNumber": "MLCK003",
|
|
|
- // "smzt": 1
|
|
|
- // },
|
|
|
-function createEntityObject(item, actualQtyKey) {
|
|
|
+function createEntityObject(item, FEntryIDKey) {
|
|
|
return {
|
|
|
- "FEntryID": item["FEntity.FEntryID"],
|
|
|
+ "FEntryID": item[FEntryIDKey+".FEntryID"],
|
|
|
// "FInventoryQty": item["FInventoryQty"],
|
|
|
// "FAuxPropId": {
|
|
|
// "FAUXPROPID__FF101501": {
|
|
@@ -277,14 +208,25 @@ function createEntityObject(item, actualQtyKey) {
|
|
|
// [actualQtyKey]: item[actualQtyKey] // 使用动态键名
|
|
|
};
|
|
|
}
|
|
|
+function getFEntryIDKey(FormId) {
|
|
|
+ const keyMap = {
|
|
|
+ 'STK_MISCELLANEOUS': 'FEntity',
|
|
|
+ 'STK_InStock': 'FInStockEntry',
|
|
|
+ 'STK_OEMInStock': 'FBillEntry',
|
|
|
+ 'LT_PRD_PMCWorkBench': 'FEntity',
|
|
|
+ 'SP_ReturnMtrl': 'FEntity',
|
|
|
+ 'STK_MisDelivery': 'FEntity',
|
|
|
+ };
|
|
|
+ return keyMap[FormId];
|
|
|
+}
|
|
|
|
|
|
export function getSaveParam(FormId, data, indexList) {
|
|
|
const targetFID = data;
|
|
|
- // const actualQtyKey = getActualQtyKey(FormId);
|
|
|
+ const FEntryIDKey = getFEntryIDKey(FormId);
|
|
|
|
|
|
const FEntityObjects = indexList
|
|
|
.filter(item => item.FID === targetFID)
|
|
|
- .map(item => createEntityObject(item));
|
|
|
+ .map(item => createEntityObject(item,FEntryIDKey));
|
|
|
|
|
|
const needUpdateFields = [
|
|
|
// "FInventoryQty",
|
|
@@ -316,7 +258,7 @@ export function getSaveParam(FormId, data, indexList) {
|
|
|
"Model": {
|
|
|
"FID": targetFID,
|
|
|
"FIsScanFabric": true,
|
|
|
- "FEntity": FEntityObjects
|
|
|
+ [FEntryIDKey]: FEntityObjects
|
|
|
}
|
|
|
}
|
|
|
]
|