product.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. /**
  2. * 成品服务
  3. * 冯海夫
  4. * 20201008
  5. */
  6. var ServiceProduct = {
  7. // 待发货成品
  8. getWatingSendList: function () {
  9. return getService.methodGet("/fbsDispatchList/fbsDispatchList/getWatingSendList");
  10. // const productList = [];
  11. // productList.push({
  12. // warehouseName: "A仓库",
  13. // materialCode: "10001",
  14. // materialName: "物料A",
  15. // specs: "3*4",
  16. // sendSum: "10",
  17. // planSendDate: "09月18日"
  18. // });
  19. // productList.push({
  20. // warehouseName: "A仓库",
  21. // materialCode: "10002",
  22. // materialName: "物料B",
  23. // specs: "3*4",
  24. // sendSum: "20",
  25. // planSendDate: "09月18日"
  26. // });
  27. // productList.push({
  28. // warehouseName: "A仓库",
  29. // materialCode: "10003",
  30. // materialName: "物料C",
  31. // specs: "3*4",
  32. // sendSum: "30",
  33. // planSendDate: "09月18日"
  34. // });
  35. // productList.push({
  36. // warehouseName: "B仓库",
  37. // materialCode: "10004",
  38. // materialName: "物料D",
  39. // specs: "3*4",
  40. // sendSum: "40",
  41. // planSendDate: "09月18日"
  42. // });
  43. // productList.push({
  44. // warehouseName: "B仓库",
  45. // materialCode: "10005",
  46. // materialName: "物料E",
  47. // specs: "3*4",
  48. // sendSum: "50",
  49. // planSendDate: "09月18日"
  50. // });
  51. // productList.push({
  52. // warehouseName: "B仓库",
  53. // materialCode: "10006",
  54. // materialName: "物料F",
  55. // specs: "3*4",
  56. // sendSum: "60",
  57. // planSendDate: "09月18日"
  58. // });
  59. // return productList;
  60. },
  61. // 已入库数量
  62. getSendSum: function () {
  63. return getService.methodPost("/fbsDispatchList/fbsDispatchList/getSendSum");
  64. // return 9;
  65. },
  66. // 月成品出货统计,根据成品维度
  67. getMonthSend: function () {
  68. // return getService.methodGet("/fbsRdrecord32/fbsRdrecords32/getMonthSend");
  69. var map=getService.methodGet("/fbsDispatchLists/fbsDispatchLists/getProjectDelivery")
  70. if(map){
  71. var remainingQuantity=5-(Object.keys(map).length%5);
  72. for(var i=0;i<remainingQuantity;i++){
  73. var bu="补"+i
  74. console.log(bu)
  75. map[bu]="";
  76. }
  77. }
  78. return map;
  79. // return {
  80. // "成品A": 20,
  81. // "成品B": 100,
  82. // "成品C": 80,
  83. // "成品D": 150,
  84. // "成品E": 200,
  85. // };
  86. },
  87. // 月项目发货统计,根据项目维度
  88. getMonthSendByProject: function () {
  89. // return {
  90. // "项目A": 20,
  91. // "项目B": 100,
  92. // "项目C": 80,
  93. // "项目D": 150,
  94. // "项目E": 200,
  95. // };
  96. var getMonthSendByProject=MethodGetService.methodGet("/fbsDispatchLists/fbsDispatchLists/getMonthSendByProject");
  97. return getMonthSendByProject;
  98. },
  99. // 成品库存,物料维度
  100. getStockList: function () {
  101. var map=getService.methodGet("/fbsInventory/fbsInventory/getAllStockList")
  102. if(map){
  103. var remainingQuantity=5-(Object.keys(map).length%5);
  104. for(var i=0;i<remainingQuantity;i++){
  105. var bu="补"+i
  106. console.log(bu)
  107. map[bu]="";
  108. }
  109. }
  110. return map;
  111. // return {
  112. // "成品A": 800,
  113. // "成品B": 900,
  114. // "成品C": 1000,
  115. // "成品D": 700,
  116. // "成品E": 600,
  117. // "成品F": 1100,
  118. // "成品G": 500
  119. // };
  120. },
  121. // 根据产品分类获取质量异常数量
  122. getQualityExceptionByCategory: function () {
  123. return MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getAbnormalHoursMonthReport");
  124. // return {
  125. // "分类A": 800,
  126. // "分类B": 900,
  127. // "分类C": 1000,
  128. // "分类D": 700,
  129. // "分类E": 600,
  130. // "分类F": 1100,
  131. // "分类G": 500
  132. // };
  133. },
  134. // 某月产品良数量
  135. getMonthGood: function () {
  136. // const list = [];
  137. // list.push({
  138. // label: "产品A",
  139. // sum1: 48,
  140. // sum2: 50
  141. // });
  142. // list.push({
  143. // label: "产品B",
  144. // sum1: 80,
  145. // sum2: 90
  146. // });
  147. // list.push({
  148. // label: "产品C",
  149. // sum1: 47,
  150. // sum2: 50
  151. // });
  152. // list.push({
  153. // label: "产品D",
  154. // sum1: 40,
  155. // sum2: 50
  156. // });
  157. // list.push({
  158. // label: "产品E",
  159. // sum1: 42,
  160. // sum2: 50
  161. // });
  162. // list.push({
  163. // label: "产品F",
  164. // sum1: 44,
  165. // sum2: 50
  166. // });
  167. // list.push({
  168. // label: "产品G",
  169. // sum1: 45,
  170. // sum2: 50
  171. // });
  172. // return list;
  173. var list=MethodGetService.methodGet("/fbsAbnormalWorkingHours/fbsAbnormalWorkingHours/getRejectsNumber")
  174. if(list){
  175. var remainingQuantity=3-(list.length%3);
  176. for(var i=0;i<remainingQuantity;i++){
  177. var bu="补"+i
  178. list.push({label: bu,sum1:0,sum2:0})
  179. }
  180. }
  181. return list;
  182. },
  183. // 月制程异常,根据分类
  184. getMonthExceptionByCategory: function () {
  185. // return {
  186. // "分类A": 600,
  187. // "分类B": 500,
  188. // "分类C": 300,
  189. // "分类D": 200,
  190. // "分类E": 100,
  191. // "分类F": 200,
  192. // "分类G": 400
  193. // };
  194. // return MethodGetService.methodGet("/fbsAbnormalWorkingHours/fbsAbnormalWorkingHours/getQualityType");
  195. var map=MethodGetService.methodGet("/fbsAbnormalWorkingHours/fbsAbnormalWorkingHoursDescribe/getMonthExceptionByCategory")
  196. if(map){
  197. var remainingQuantity=3-(Object.keys(map).length%3);
  198. for(var i=0;i<remainingQuantity;i++){
  199. var bu="补"+i
  200. console.log(bu)
  201. map[bu]="";
  202. }
  203. }
  204. return map;
  205. },
  206. // 周成品入库数量,根据分类
  207. getWeekInByCategory: function () {
  208. // return {
  209. // "分类A": 500,
  210. // "分类B": 600,
  211. // "分类C": 800,
  212. // "分类D": 700,
  213. // "分类E": 600,
  214. // "分类F": 400,
  215. // "分类G": 500
  216. // };
  217. var map =MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getQualifiedInQtyWeek");
  218. if(map){
  219. var remainingQuantity=3-(Object.keys(map).length%3);
  220. for(var i=0;i<remainingQuantity;i++){
  221. var bu="补"+i
  222. console.log(bu)
  223. map[bu]="";
  224. }
  225. }
  226. return map;
  227. },
  228. // 生产效率
  229. getProduceRate: function () {
  230. // const rate = 95;
  231. rate=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getProductionEfficiency");
  232. return {
  233. name: "当月生产效率",
  234. value: rate
  235. };
  236. },
  237. // 日生产效率
  238. getDayProduceRate: function () {
  239. // const rate = 90;
  240. rate=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getProductionEfficiency?type=1");
  241. return {
  242. name: "生产效率",
  243. value: rate
  244. };
  245. },
  246. // 某日产品良数量
  247. getDayGood: function () {
  248. // const list = [];
  249. // list.push({
  250. // label: "产品A",
  251. // sum1: 48,
  252. // sum2: 50
  253. // });
  254. // list.push({
  255. // label: "产品B",
  256. // sum1: 80,
  257. // sum2: 90
  258. // });
  259. // list.push({
  260. // label: "产品C",
  261. // sum1: 47,
  262. // sum2: 50
  263. // });
  264. // list.push({
  265. // label: "产品D",
  266. // sum1: 40,
  267. // sum2: 50
  268. // });
  269. // list.push({
  270. // label: "产品E",
  271. // sum1: 42,
  272. // sum2: 50
  273. // });
  274. // list.push({
  275. // label: "产品F",
  276. // sum1: 44,
  277. // sum2: 50
  278. // });
  279. // list.push({
  280. // label: "产品G",
  281. // sum1: 45,
  282. // sum2: 50
  283. // });
  284. // return list;
  285. var list=MethodGetService.methodGet("/fbsAbnormalWorkingHours/fbsAbnormalWorkingHours/getRejectsNumber?type=1")
  286. if(list){
  287. var remainingQuantity=3-(list.length%3);
  288. for(var i=0;i<remainingQuantity;i++){
  289. var bu="补"+i
  290. list.push({label: bu,sum1:0,sum2:0})
  291. }
  292. }
  293. return list;
  294. },
  295. // 日质量异常,根据分类
  296. getDayExceptionByCategory: function () {
  297. // return {
  298. // "分类A": 600,
  299. // "分类B": 500,
  300. // "分类C": 300,
  301. // "分类D": 200,
  302. // "分类E": 100,
  303. // "分类F": 200,
  304. // "分类G": 400
  305. // };
  306. return MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getAbnormalHoursMonthReport?type=1");
  307. },
  308. }