newparams.js 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. // 定义字段映射
  2. const FieldKeysMap = {
  3. "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",
  4. "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",
  5. "LT_PRD_PMCWorkBench": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FActualQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FEWorkCenterId_LT.fname,FEntrtyMemo,FDate,FApplicantId.fname,FSTOCKERID.fname,FStockActualQty,FWorkShopId.fname",
  6. "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"
  7. };
  8. export function getSearchParam(condition) {
  9. let FilterString = [{ //其他出库
  10. "Left": "(",
  11. "FieldName": "FDocumentStatus",
  12. "Compare": "105",
  13. "Value": "A",
  14. "Right": "",
  15. "Logic": 1
  16. },
  17. // {//审核中
  18. // "Left": "",
  19. // "FieldName": "FDocumentStatus",
  20. // "Compare": "105",
  21. // "Value": "B",
  22. // "Right": "",
  23. // "Logic": 1
  24. // },
  25. {
  26. "Left": "",
  27. "FieldName": "FDocumentStatus",
  28. "Compare": "105",
  29. "Value": "D",
  30. "Right": ")",
  31. "Logic": 0
  32. }, {
  33. "Left": "",
  34. "FieldName": "FStockOrgId.FNumber",
  35. "Compare": "67",
  36. "Value": condition.FStockOrgId,
  37. "Right": "",
  38. "Logic": 0
  39. },
  40. {
  41. "FieldName": "FBillNo",
  42. "Compare": "17",
  43. "Value": condition.billNo,
  44. "Left": "",
  45. "Right": "",
  46. "Logic": 0
  47. },
  48. {
  49. "Left": "",
  50. "FieldName": "FStockId.FName",
  51. "Compare": "17",
  52. "Value": "面料",
  53. "Right": "",
  54. "Logic": 0
  55. },
  56. {
  57. "FieldName": "FDate",
  58. "Compare": "39",
  59. "Value": condition.range[0],
  60. "Left": "(",
  61. "Right": "",
  62. "Logic": "0"
  63. },
  64. {
  65. "FieldName": "FDate",
  66. "Compare": "16",
  67. "Value": condition.range[1],
  68. "Left": "",
  69. "Right": ")",
  70. "Logic": "0"
  71. }
  72. ]
  73. let FieldKeys =
  74. "FID,FWorkCenterId.fname,FPickingPeople_LT.fname,FSTOCKERID.fname,FBillNo,FDate,FNote,FStockOrgId,FStockId.FName"
  75. console.log(condition.FBillType)
  76. if (condition.FBillType != null) { //领料
  77. FilterString.push({
  78. "Left": "",
  79. "FieldName": "FBillType",
  80. "Compare": "105",
  81. "Value": condition.FBillType,
  82. "Right": "",
  83. "Logic": 0
  84. });
  85. console.log('aaaa')
  86. FieldKeys =
  87. "FID,FWorkCenterId_LT.fname,FApplicantId.fname,FSTOCKERID.fname,FBillNo,FDate,FDescription,FStockOrgId,FStockId.FName"
  88. }
  89. if (condition.FormId == "STK_MisDelivery") { //其他出库
  90. FilterString.push({
  91. "Left": "",
  92. "FieldName": "FStockDirect",
  93. "Compare": "29",
  94. "Value": "GENERAL",
  95. "Right": "",
  96. "Logic": 0
  97. });
  98. FieldKeys =
  99. "FID,FWorkCenterId.fname,FPickingPeople_LT.fname,FSTOCKERID.fname,FBillNo,FDate,FNote,FStockOrgId,FStockId.FName"
  100. }
  101. if (condition.FormId == "SP_PickMtrl") { //简单生产领料单
  102. FieldKeys =
  103. "FID,FWorkCenterId.fname,FPickerId.fname,FSTOCKERID.fname,FBillNo,FDate,FDescription,FStockOrgId,FStockId.FName"
  104. }
  105. if (condition.FormId == "PUR_MRB") { //采购退料单
  106. FieldKeys =
  107. "FID,FSupplierID.fname,FPURCHASERID.fname,FPURCHASEDEPTID.fname,FSTOCKERID.fname,FBillNo,FDate,FStockOrgId"
  108. }
  109. console.log(FieldKeys)
  110. return {
  111. "parameters": [{
  112. "FormId": condition.FormId,
  113. "FieldKeys": FieldKeys,
  114. "FilterString": FilterString
  115. }]
  116. }
  117. }
  118. export function getBillDetailListParam(condition) {
  119. console.log(condition)
  120. // let FieldKeys = ""; // 在外部定义
  121. // if (condition.FormId == "STK_MisDelivery") { //其他出库
  122. // FieldKeys =
  123. // "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"
  124. // }
  125. // if (condition.FormId == "SP_PickMtrl") { //简单生产领料单
  126. // FieldKeys =
  127. // "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"
  128. // }
  129. // if (condition.FormId == "LT_PRD_PMCWorkBench") { //生产领料料管平台
  130. // FieldKeys =
  131. // "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FActualQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FEWorkCenterId_LT.fname,FEntrtyMemo,FDate,FApplicantId.fname,FSTOCKERID.fname,FStockActualQty,FWorkShopId.fname"
  132. // }
  133. //"FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FActualQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FEWorkCenterId_LT.fname,FEntrtyMemo,FDate,FApplicantId.fname,FSTOCKERID.fname,FStockActualQty,FWorkShopId.fname"
  134. return {
  135. "parameters": [{
  136. "FormId": condition.FormId,
  137. "FieldKeys": FieldKeysMap[condition.FormId],
  138. "FilterString": [{
  139. "Left": "",
  140. "FieldName": "FID",
  141. "Compare": "338",
  142. "Value": condition.selectedFID,
  143. "Right": "",
  144. "Logic": 0
  145. }],
  146. }]
  147. }
  148. }
  149. // 定义一个函数来创建库存查询请求数据
  150. export function createInventoryQueryRequest(value) {
  151. return {
  152. parameters: [{
  153. FormId: "STK_Inventory",
  154. FieldKeys: "fID",
  155. FilterString: [{
  156. Left: "",
  157. FieldName: "FStockLocId.FF102029.FName",
  158. Compare: "67",
  159. Value: value,
  160. Right: "",
  161. Logic: 0
  162. },
  163. {
  164. Left: "",
  165. FieldName: "FBaseQty",
  166. Compare: "21",
  167. Value: "0",
  168. Right: "",
  169. Logic: 0
  170. }
  171. ]
  172. }]
  173. };
  174. }
  175. export function getSaveParam(FormId, data, indexList) {
  176. let targetFID = data;
  177. // 使用 Array.prototype.filter 方法筛选符合条件的对象,并使用 Array.prototype.map 方法转换对象格式
  178. let FEntityObjects = indexList
  179. .filter(item => item.FID === targetFID)
  180. .map(item => ({
  181. "FEntryID": item["FEntity.FEntryID"],
  182. "FInventoryQty": item["FInventoryQty"],
  183. "FAuxPropId": {
  184. "FAUXPROPID__FF101501": {
  185. "FNumber": item["FAuxPropId.FF101501.FDATAVALUE"]
  186. }
  187. },
  188. "FStockLocId": {
  189. "FSTOCKLOCID__FF102029": {
  190. "Fname": item["FStockLocId.FF102029.fname"]
  191. }
  192. },
  193. "FLot": {
  194. "FNumber": item["Flot.FNumber"]
  195. },
  196. "FENCHASENUM_LT": item["FENCHASENUM.LT"],
  197. "FActualQty": item["FActualQty"]
  198. }))
  199. return {
  200. "parameters": [
  201. FormId,
  202. {
  203. "NeedUpDateFields": [
  204. "FInventoryQty", //即时库存数量
  205. "FAuxPropId", //等级
  206. "FStockLocId", //仓位
  207. "FIsScanFabric", //是否扫描
  208. "FLot", //批号
  209. "FENCHASENUM_LT", //装箱单号
  210. "FActualQty" //实发数量
  211. ],
  212. "NeedReturnFields": [
  213. "FID"
  214. ],
  215. "IsDeleteEntry": "true",
  216. "SubSystemId": "",
  217. "IsVerifyBaseDataField": "false",
  218. "IsEntryBatchFill": "true",
  219. "ValidateFlag": "true",
  220. "NumberSearch": "true",
  221. "IsAutoAdjustField": "false",
  222. "InterationFlags": "",
  223. "IgnoreInterationFlag": "",
  224. "IsControlPrecision": "false",
  225. "ValidateRepeatJson": "false",
  226. "Model": {
  227. "FID": targetFID,
  228. "FIsScanFabric": true,
  229. "FEntity": FEntityObjects
  230. }
  231. }
  232. ]
  233. }
  234. }
  235. export function getSubmitParam(FormId, data) {
  236. const params = {
  237. "parameters": [
  238. FormId,
  239. {
  240. "CreateOrgId": 0,
  241. "Numbers": [],
  242. "Ids": data.toString(),
  243. "SelectedPostId": 0,
  244. "UseOrgId": 0,
  245. "NetworkCtrl": "",
  246. "IgnoreInterationFlag": ""
  247. }
  248. ]
  249. };
  250. console.log(params);
  251. return params;
  252. }
  253. export function getAuditParam(FormId, data) {
  254. const params = {
  255. "parameters": [
  256. FormId,
  257. {
  258. "CreateOrgId": 0,
  259. "Numbers": [],
  260. "Ids": data.toString(),
  261. "InterationFlags": "",
  262. "UseOrgId": 0,
  263. "NetworkCtrl": "",
  264. "IsVerifyProcInst": "true",
  265. "IgnoreInterationFlag": "",
  266. "UseBatControlTimes": "false"
  267. }
  268. ]
  269. }
  270. console.log(params)
  271. return params
  272. }