index.tsx 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555
  1. import { ref, reactive, computed, toRefs, nextTick, inject } from "vue";
  2. import { Table } from "@/hooks/interface";
  3. import { ColumnProps } from "@/components/LjVxeTable/interface";
  4. import { ALLOW_EDIT_STATE, sys_arry_formulatype } from "@/config/index";
  5. import { CommonDynamicSelect } from "@/api/modules/common";
  6. import { GetComputeBednet, GetComputeSpring } from "@/api/modules/quote";
  7. import { useUserStore } from "@/stores/modules/user";
  8. import MtrldefSelect from "@/views/system/selector/mtrldef/select.vue";
  9. import SpringSelect from "@/views/system/selector/spring/select.vue";
  10. // import { handleRowAccordingToProp } from "@/utils";
  11. import { ElButton, ElMessage, ElPopconfirm, ElMessageBox, ElNotification } from "element-plus";
  12. import { Minus, Plus, InfoFilled } from "@element-plus/icons-vue";
  13. import { DwnameEnum } from "@/enums/dwnameEnum";
  14. import { isArray } from "@/utils/is";
  15. import { calculateFormula, formulaPartsFormula, floatAdd, floatMul, formatFixedNumber, formatIntNumber } from "@/utils/index";
  16. import { cloneDeep, defaultsDeep } from "lodash-es";
  17. import { TYPE, useToast, POSITION } from "vue-toastification";
  18. import ToastFormula from "@/components/ToastWidget/Formula/index.vue";
  19. import ToastHistoryPrice from "@/components/ToastWidget/HistoryPrice/index.vue";
  20. import { numCheck } from "@/utils/rules/index";
  21. interface defaultState {
  22. /**
  23. * @description 单据当前状态
  24. */
  25. orderStatus: string;
  26. vxeTableRef: any;
  27. LjDetailRef: any;
  28. initParams: any;
  29. initParamsMx: any;
  30. initParamsMxSpring: any;
  31. bednetMxData: any;
  32. bednetMxSpringData: any;
  33. vxeTableMxRef: any;
  34. vxeTableMxSpringRef: any;
  35. MtrldefDialogRef: any;
  36. MtrldefDialogProps: any;
  37. SpringDialogRef: any;
  38. SpringDialogProps: any;
  39. currentArea: any;
  40. AreaList: any;
  41. bednetVarList: any;
  42. AllFormulaRef: any;
  43. cmpFormulas: any;
  44. cmpFormulaReplace: any;
  45. dannum_type: number;
  46. }
  47. /**
  48. * @description 床网明细表-属性默认值
  49. */
  50. const dw_bednet_define_add_mx = {
  51. pid: 1,
  52. bednetmxid: 0,
  53. bednetid: 0,
  54. spring_qty_width: 0,
  55. spring_qty_length: 0,
  56. bednet_height: 0,
  57. wire_mtrlid: 0,
  58. springid: 0,
  59. springname: 0,
  60. if_part: 0,
  61. if_15strip: 0,
  62. if_pocket_around: 0,
  63. pocket_around_springid: 0,
  64. pocket_around_springname: 0,
  65. pocket_around_row: 0,
  66. pocket_around_wire_price: 0,
  67. pocket_around_spring_cost: 0,
  68. pocket_around_fabrics_cost: 0,
  69. if_hard_around: 0,
  70. hard_around_springid: 0,
  71. hard_around_springname: 0,
  72. hard_around_row: 0,
  73. hard_around_wire_price: 0,
  74. hard_around_mtrl_cost: 0,
  75. hard_around_hr_cost: 0,
  76. fabrics1_mtrlid: 0,
  77. fabrics1_price: 0,
  78. fabrics1_mtrl_cost: 0,
  79. fabrics2_mtrlid: 0,
  80. fabrics2_price: 0,
  81. fabrics2_mtrl_cost: 0,
  82. if_side_iron: 0,
  83. side_iron_qty: 0,
  84. side_iron_mtrl_cost: 0,
  85. side_iron_hr_cost: 0,
  86. pocket_around_spring_cost_replace_formula: "",
  87. pocket_around_fabrics_cost_replace_formula: "",
  88. hard_around_mtrl_cost_replace_formula: "",
  89. hard_around_hr_cost_replace_formula: "",
  90. fabrics1_mtrl_cost_replace_formula: "",
  91. fabrics2_mtrl_cost_replace_formula: "",
  92. side_iron_mtrl_cost_replace_formula: "",
  93. side_iron_hr_cost_replace_formula: "",
  94. cnail_mtrl_cost_replace_formula: "",
  95. cnail_mtrl_cost: 0,
  96. cnail_hr_cost_replace_formula: "",
  97. cnail_hr_cost: 0,
  98. glue_mtrl_cost_replace_formula: "",
  99. glue_mtrl_cost: 0,
  100. spring_mtrl_cost: 0,
  101. spring_hr_cost: 0,
  102. spring_mtrl_cost_replace_formula: "",
  103. spring_hr_cost_replace_formula: "",
  104. spring_weight_replace_formula: ""
  105. };
  106. const dw_bednet_mx_spring = {
  107. bednetmx_partid: 0,
  108. bednetmxid: 0,
  109. springid: 0,
  110. springname: "",
  111. spring_qty_width: 0,
  112. spring_qty_length: 0,
  113. fabrics1_mtrl_cost: 0
  114. };
  115. const ifsaleout_default = {
  116. commission: 1.05,
  117. other_rate: 1.05,
  118. taxrate: 1.07,
  119. moneyrate: 6.7
  120. };
  121. /**
  122. * @description 床网报价hooks
  123. * @param t
  124. * @param props 床网入参
  125. * @returns
  126. */
  127. export const useHooks = (t?: any, props?: any) => {
  128. const state = reactive<defaultState>({
  129. orderStatus: "",
  130. vxeTableRef: null,
  131. LjDetailRef: null,
  132. vxeTableMxRef: null,
  133. vxeTableMxSpringRef: null,
  134. initParams: {},
  135. initParamsMx: {},
  136. initParamsMxSpring: {},
  137. bednetMxData: [],
  138. bednetMxSpringData: [],
  139. MtrldefDialogRef: null,
  140. MtrldefDialogProps: {},
  141. SpringDialogRef: null,
  142. SpringDialogProps: {},
  143. currentArea: null,
  144. AreaList: [],
  145. bednetVarList: [],
  146. AllFormulaRef: null,
  147. cmpFormulas: null,
  148. cmpFormulaReplace: null,
  149. dannum_type: 0
  150. });
  151. state.orderStatus = inject("orderStatus", "");
  152. const { userInfo } = useUserStore();
  153. const rModelSetFabrics2_mtrlid = (data: any) => {
  154. data.sponge_tc_mtrlid = 0;
  155. data.mtrl_sponge_tc_name = "";
  156. data.sponge_tc_thickness = 0;
  157. data.sponge_tc_height = 0;
  158. };
  159. /**
  160. * @description 填充明细弹簧
  161. */
  162. const rModelSetMxSpring = (data: any, item: any) => {
  163. console.log("rModelSetSpring data, item :>> ", data, item);
  164. if (item) {
  165. data.springid = item.springid;
  166. data.springname = item.springname;
  167. setMxSpringQtyWidthAndLength(data);
  168. }
  169. };
  170. /**
  171. * @description 填充海绵
  172. */
  173. const rModelSetSpring = (data: any, item: any) => {
  174. console.log("rModelSetSpring data, item :>> ", data, item);
  175. if (item) {
  176. data.springid = item.springid;
  177. data.springname = item.springname;
  178. }
  179. };
  180. const rModelClearSpring = (data: any) => {
  181. data.springid = 0;
  182. data.springname = "";
  183. };
  184. /**
  185. * @description 弹窗模块:选择弹簧
  186. * @param data 当前数据
  187. * @param status 当前订单状态
  188. * @returns Promise
  189. */
  190. const fModelChoseSpring = (data: any, params: any, cb: any) => {
  191. return new Promise((resolve, reject) => {
  192. // if (!ALLOW_EDIT_STATE.includes(status)) return;
  193. let _arg_bedtypeid = -1;
  194. let _arg_newspring = 0;
  195. if (params?.arg_bednettypeid) {
  196. switch (params?.arg_bednettypeid) {
  197. case 11: // 袋装网
  198. _arg_bedtypeid = 0;
  199. _arg_newspring = 1;
  200. break;
  201. case 12: // 圆网
  202. _arg_bedtypeid = 2;
  203. break;
  204. case 13: // 拉丝网
  205. _arg_bedtypeid = 1;
  206. break;
  207. }
  208. }
  209. let _params = {
  210. // arg_springtypeid: "11", // 默认选择国内分类
  211. arg_newspring: _arg_newspring,
  212. arg_bedtypeid: _arg_bedtypeid,
  213. ...params
  214. };
  215. state.SpringDialogProps = {
  216. onSubmit: (res: any) => {
  217. // submit
  218. console.log("openCustDialog res", res);
  219. nextTick(() => {
  220. cb(data, res.value[0]);
  221. resolve(1);
  222. });
  223. },
  224. onCancel: (error: any) => {
  225. // cancel 回调
  226. console.log("openCustDialog error", error);
  227. }
  228. };
  229. state.SpringDialogRef.show(_params);
  230. });
  231. };
  232. const rModelSetMtrlFelt = (data: any, item: any) => {
  233. if (item) {
  234. data.felt_mtrlid = item.mtrlid;
  235. data.felt_price = item.pricelistprice;
  236. data.mtrl_felt_name = item.mtrlname;
  237. data.felt_qty = 1;
  238. }
  239. };
  240. const rModelClearMtrlFelt = (data: any) => {
  241. data.felt_mtrlid = 0;
  242. data.felt_price = 0;
  243. data.mtrl_felt_name = "";
  244. data.felt_qty = 0;
  245. data.felt_dscrp = "";
  246. };
  247. const rModelSetMtrlFeltX = (data: any, item: any) => {
  248. if (item) {
  249. data.felt_x_mtrlid = item.mtrlid;
  250. data.mtrl_felt_x_name = item.mtrlname;
  251. data.felt_x_qty = 1;
  252. }
  253. };
  254. const rModelClearMtrlFeltX = (data: any) => {
  255. data.felt_x_mtrlid = 0;
  256. data.mtrl_felt_x_name = "";
  257. data.felt_x_qty = 0;
  258. };
  259. /**
  260. * @description 封边
  261. */
  262. const rModelSetMtrlEdge = (data: any, item: any) => {
  263. if (item) {
  264. data.edge_mtrlid = item.mtrlid;
  265. data.edge_price = item.pricelistprice;
  266. data.mtrl_edge_name = item.mtrlname;
  267. }
  268. };
  269. const rModelClearMtrlEdge = (data: any) => {
  270. data.edge_mtrlid = 0;
  271. data.edge_price = 0;
  272. data.mtrl_edge_name = "";
  273. data.edge_height = 0;
  274. };
  275. /**
  276. * @description 填充海绵
  277. */
  278. const rModelSetMtrlSpongeTc = (data: any, item: any) => {
  279. if (item) {
  280. data.sponge_tc_mtrlid = item.mtrlid;
  281. data.mtrl_sponge_tc_name = item.mtrlname;
  282. }
  283. };
  284. const rModelClearMtrlSpongeTc = (data: any) => {
  285. data.sponge_tc_mtrlid = 0;
  286. data.mtrl_sponge_tc_name = "";
  287. data.sponge_tc_thickness = 0;
  288. data.sponge_tc_height = 0;
  289. };
  290. const rModelSetMtrlFabrisc1 = (data: any, item: any) => {
  291. if (item) {
  292. data.fabrics1_mtrlid = item.mtrlid;
  293. data.fabrics1_mtrlname = item.mtrlname;
  294. data.fabrics1_price = item.pricelistprice;
  295. }
  296. };
  297. const rModelClearMtrlFabrisc1 = (data: any) => {
  298. data.fabrics1_mtrlid = 0;
  299. data.fabrics1_price = 0;
  300. };
  301. const rModelSetMtrlFabrisc2 = (data: any, item: any) => {
  302. if (item) {
  303. data.fabrics2_mtrlid = item.mtrlid;
  304. data.fabrics2_mtrlname = item.mtrlname;
  305. data.fabrics2_price = item.pricelistprice;
  306. }
  307. };
  308. const rModelClearMtrlFabrisc2 = (data: any) => {
  309. data.fabrics2_mtrlid = 0;
  310. data.fabrics2_price = 0;
  311. };
  312. const rModelSetHardAroundSpring = (data: any, item: any) => {
  313. if (item) {
  314. data.hard_around_springid = item.springid;
  315. data.hard_around_springname = item.springname;
  316. }
  317. };
  318. const rModelClearHardAroundSpring = (data: any) => {
  319. data.hard_around_springid = 0;
  320. data.hard_around_springname = "";
  321. };
  322. const getPriceid = () => {
  323. let _deptid = state.LjDetailRef?._mainData?.deptid ?? 0;
  324. console.log("getPriceid _deptid :>> ", _deptid);
  325. if (!_deptid) {
  326. ElMessage.warning("请先选择部门");
  327. state.LjDetailRef?.baseformRef.element.validateField("deptid");
  328. return 0;
  329. }
  330. let deptEnum = state.LjDetailRef.enumMap.get("deptid");
  331. let _pricelistid = 0;
  332. console.log("deptEnum :>> ", deptEnum);
  333. if (deptEnum) {
  334. let depItem = deptEnum.find((item: any) => item.value == _deptid);
  335. console.log("depItem :>> ", depItem);
  336. if (depItem) {
  337. _pricelistid = Number(depItem.pricelistid);
  338. }
  339. }
  340. return _pricelistid;
  341. };
  342. /**
  343. * @description 弹窗模块:选择物料
  344. * @param data 当前数据
  345. * @param status 当前订单状态
  346. * @returns Promise
  347. */
  348. const fModelChoseMtrl = (data: any, params: any, cb: any) => {
  349. return new Promise((resolve, reject) => {
  350. let _pricelistid = getPriceid();
  351. if (!_pricelistid) return false;
  352. // if (!ALLOW_EDIT_STATE.includes(status)) return;
  353. console.log("fModelChoseMtrl fModelChoseMtrl params :>> ", params);
  354. let _params = {
  355. keyword: "",
  356. arg_mtrltype: params.mtrltype,
  357. arg_pricelistid: _pricelistid
  358. };
  359. state.MtrldefDialogProps = {
  360. onSubmit: (res: any) => {
  361. // submit
  362. console.log("openCustDialog res", res);
  363. nextTick(() => {
  364. cb(data, res.value[0]);
  365. resolve(1);
  366. });
  367. },
  368. onCancel: (error: any) => {
  369. // cancel 回调
  370. console.log("openCustDialog error", error);
  371. }
  372. };
  373. state.MtrldefDialogRef.show(_params);
  374. });
  375. };
  376. /**
  377. * @description 数据赋值:包边海绵
  378. * @param data 当前数据
  379. * @param item 当前选择的数据
  380. */
  381. const rModelSetMtrlSponge = (data: any, item: any) => {
  382. console.log("rModelSetMtrlSponge data :>> ", data);
  383. console.log("rModelSetMtrlSponge item :>> ", item);
  384. if (item) {
  385. data.sponge_mtrlid = item.mtrlid;
  386. data.sponge_price = item.pricelistprice;
  387. data.mtrl_sponge_name = item.mtrlname;
  388. }
  389. console.log("rModelSetMtrlSponge after data :>> ", data);
  390. };
  391. const rModelClearMtrlSponge = (data: any) => {
  392. console.log("rModelClearMtrlSponge data :>> ", data);
  393. data.sponge_mtrlid = 0;
  394. data.sponge_price = 0;
  395. data.mtrl_sponge_name = "";
  396. data.sponge_thickness = 0;
  397. data.sponge_height = 0;
  398. };
  399. const wf_hide_dw2 = (bednetData: any, columns: any) => {
  400. let hFields = [];
  401. console.log('bednetData.typename != "袋装网" :>> ', bednetData.typename, bednetData.typename != "袋装网");
  402. // if (bednetData.typename != "袋装网") {
  403. if (Number(bednetData.bednettypeid) != 11) {
  404. hFields.push("if_part");
  405. // 圆网和拉丝网 没有 入袋无纺布和底面无纺布
  406. hFields.push("fabrics1_mtrlid");
  407. hFields.push("fabrics2_mtrlid");
  408. }
  409. //四周加硬
  410. if (Number(bednetData.if_hard_around) == 0) {
  411. hFields.push("if_hard_around");
  412. hFields.push("hard_around_wire_price");
  413. hFields.push("hard_around_mtrl_cost");
  414. hFields.push("hard_around_hr_cost");
  415. hFields.push("hard_around_springid");
  416. hFields.push("hard_around_row");
  417. }
  418. //四周口袋
  419. if (Number(bednetData.if_pocket_around) == 0) {
  420. hFields.push("pocket_around_springname");
  421. hFields.push("pocket_around_springid");
  422. hFields.push("pocket_around_row");
  423. hFields.push("pocket_around_wire_price");
  424. hFields.push("pocket_around_spring_cost");
  425. hFields.push("pocket_around_fabrics_cost");
  426. hFields.push("if_pocket_around");
  427. }
  428. // 边铁?
  429. if (Number(bednetData.if_side_iron) == 0) {
  430. hFields.push("if_side_iron");
  431. hFields.push("side_iron_qty");
  432. hFields.push("side_iron_mtrl_cost");
  433. hFields.push("side_iron_hr_cost");
  434. }
  435. return columns.map(t => {
  436. if (hFields.includes(t.field)) {
  437. return {
  438. ...t,
  439. limited: true
  440. };
  441. }
  442. return t;
  443. });
  444. };
  445. /**
  446. * @description 重载床网明细和多区明细,返回多区明细数据
  447. * @param bednetData
  448. * @returns
  449. */
  450. const reload_dw2 = async (bednetData: any, cb?: any) => {
  451. state.bednetMxData = [];
  452. state.bednetMxSpringData = [];
  453. let res = await getDataMxAdd(state.initParamsMx);
  454. console.log("getDataMxAdd res :>> ", res);
  455. let result = dataCallback(res);
  456. columnsMx.value = wf_hide_dw2(bednetData, result.tableinfo.columns).map(item => {
  457. let _default = columnsMx_default.value.find(t => t.field == item.field);
  458. if (_default) {
  459. item = defaultsDeep(item, _default);
  460. }
  461. return item;
  462. });
  463. console.log("reset columnsMx.value :>> ", columnsMx.value, result);
  464. // cb && cb(result);
  465. let res2 = await getDataMxSpring(state.initParamsMx);
  466. let result2 = dataCallback(res2);
  467. // columnsMxSpring.value = result.tableinfo.columns;
  468. columnsMxSpring.value = result2.tableinfo.columns.map(item => {
  469. let _default = columnsMxSpring_default.value.find(t => t.field == item.field);
  470. if (_default) {
  471. item = defaultsDeep(item, _default);
  472. }
  473. return item;
  474. });
  475. console.log("reload_dw2 columnsMxSpring.value :>> ", columnsMxSpring.value, result);
  476. cb && cb({ mx: result, spring: result2 });
  477. };
  478. /**
  479. * @description 变更床垫分类时,重载明细数据 dw_1 itemchange
  480. * @author w_mattress_add dw_1 itemchange
  481. */
  482. const wf_b_bednet_type_ch = async (val: any) => {
  483. console.log("wf_b_bednet_type_ch state.LjDetailRef._mainData val:>> ", val, state.LjDetailRef, state.orderStatus);
  484. const { _mainData, enumMap, baseformRef } = state.LjDetailRef;
  485. // let mainData = state.orderStatus == "new" ? initParam : _mainData;
  486. console.log("mainData :>> ", _mainData);
  487. if (!Number(_mainData.deptid)) {
  488. ElMessage.warning("请先选择部门");
  489. console.log("baseformRef.element :>> ", baseformRef.element);
  490. baseformRef.element.validateField("deptid");
  491. _mainData.bednettypeid = "";
  492. return;
  493. }
  494. let _params = {
  495. dsname: "_Mapper_bednet_type_define",
  496. queryparams: {
  497. arg_bednettypeid: Number(val)
  498. }
  499. };
  500. let res = await CommonDynamicSelect(_params);
  501. let rBednetType: any = {};
  502. if (res?.datatable?.length > 0) {
  503. rBednetType = res?.datatable[0];
  504. }
  505. // _mainData.duo_qv_str = "三区";
  506. _mainData.bednettypeid = rBednetType.bednettypeid;
  507. _mainData.snake_wire_diameter = rBednetType.snake_wire_diameter;
  508. _mainData.snake_wire_mtrl_formula = rBednetType.snake_wire_mtrl_formula;
  509. _mainData.pocket_around_spring_formula = rBednetType.pocket_around_spring_formula;
  510. _mainData.pocket_around_fabrics_formula = rBednetType.pocket_around_fabrics_formula;
  511. _mainData.hard_around_mtrl_formula = rBednetType.hard_around_mtrl_formula;
  512. _mainData.hard_around_hr_formula = rBednetType.hard_around_hr_formula;
  513. _mainData.glue_mtrl_formula = rBednetType.glue_mtrl_formula;
  514. _mainData.if_side_iron = rBednetType.if_side_iron;
  515. _mainData.side_iron_mtrl_formula = rBednetType.side_iron_mtrl_formula;
  516. _mainData.side_iron_hr_formula = rBednetType.side_iron_hr_formula;
  517. _mainData.cnail_mtrl_formula = rBednetType.cnail_mtrl_formula;
  518. _mainData.cnail_hr_formula = rBednetType.cnail_hr_formula;
  519. _mainData.if_sponge_drilling = 0; // rBednetType.if_sponge_drilling;
  520. _mainData.sponge_mtrl_formula = rBednetType.sponge_mtrl_formula;
  521. _mainData.sponge_hr_formula = rBednetType.sponge_hr_formula;
  522. _mainData.edge_mtrl_formula = rBednetType.edge_mtrl_formula;
  523. _mainData.edge_hr_formula = rBednetType.edge_hr_formula;
  524. _mainData.fork_mtrl_formula = rBednetType.fork_mtrl_formula;
  525. _mainData.fork_hr_formula = rBednetType.fork_hr_formula;
  526. _mainData.if_rsorwa = 0; // rBednetType.if_rsorwa;
  527. _mainData.rsorwa_mtrl_formula = rBednetType.rsorwa_mtrl_formula;
  528. _mainData.rsorwa_hr_formula = rBednetType.rsorwa_hr_formula;
  529. _mainData.sponge_drilling_hr_formula = rBednetType.sponge_drilling_hr_formula;
  530. _mainData.spring_mtrl_formula = rBednetType.spring_mtrl_formula;
  531. _mainData.spring_hr_formula = rBednetType.spring_hr_formula;
  532. _mainData.fabrics1_mtrl_formula = rBednetType.fabrics1_mtrl_formula;
  533. _mainData.fabrics2_mtrl_formula = rBednetType.fabrics2_mtrl_formula;
  534. _mainData.felt_mtrl_formula = rBednetType.felt_mtrl_formula;
  535. _mainData.felt_hr_formula = rBednetType.felt_hr_formula;
  536. _mainData.packet_mtrl_formula = rBednetType.packet_mtrl_formula;
  537. _mainData.packet_hr_formula = rBednetType.packet_hr_formula;
  538. _mainData.sponge_mtrl_tc_formula = rBednetType.sponge_mtrl_tc_formula;
  539. _mainData.spring_weight_formula = rBednetType.spring_weight_formula;
  540. _mainData.side_iron_weight_formula = rBednetType.side_iron_weight_formula;
  541. _mainData.hard_around_weight_formula = rBednetType.hard_around_weight_formula;
  542. _mainData.fabrics1_weight_formula = rBednetType.fabrics1_weight_formula;
  543. _mainData.fabrics2_weight_formula = rBednetType.fabrics2_weight_formula;
  544. _mainData.felt_weight_formula = rBednetType.felt_weight_formula;
  545. _mainData.cnail_weight_formula = rBednetType.cnail_weight_formula;
  546. _mainData.sponge_weight_formula = rBednetType.sponge_weight_formula;
  547. _mainData.sponge_weight_tc_formula = rBednetType.sponge_weight_tc_formula;
  548. _mainData.edge_weight_formula = rBednetType.edge_weight_formula;
  549. _mainData.fork_weight_formula = rBednetType.fork_weight_formula;
  550. console.log("wf_b_bednet_type_ch _mainData :>> ", _mainData);
  551. let _default = cloneDeep(dw_bednet_define_add_mx);
  552. // 袋网
  553. if (Number(rBednetType.bednettypeid) == 11) {
  554. _default.fabrics2_mtrlid = 8760;
  555. _default.fabrics1_mtrlid = 8759;
  556. }
  557. reload_dw2(rBednetType, ({ mx }) => {
  558. console.log("reload_dw2reload_dw2reload_dw2 mx :>> ", mx);
  559. let fabrics2Col = mx.tableinfo.columns.find(item => item.field == "fabrics2_mtrlid");
  560. let fabrics2Item = fabrics2Col.enum.find(item => item.value == _default.fabrics2_mtrlid);
  561. if (fabrics2Item) {
  562. _default.fabrics2_price = fabrics2Item.pricelistprice;
  563. }
  564. let fabrics1Col = mx.tableinfo.columns.find(item => item.field == "fabrics1_mtrlid");
  565. let fabrics1Item = fabrics1Col.enum.find(item => item.value == _default.fabrics1_mtrlid);
  566. if (fabrics1Item) {
  567. _default.fabrics1_price = fabrics1Item.pricelistprice;
  568. }
  569. state.bednetMxData = [_default];
  570. });
  571. nextTick(() => {
  572. console.log("wf_b_bednet_type_ch state.vxeTableMxRef :>> ", state.vxeTableMxRef);
  573. state.vxeTableMxRef && state.vxeTableMxRef.refresh();
  574. });
  575. };
  576. const getData = (params: any) => {
  577. console.log("getData params :>> ", params);
  578. let newParams: any = {};
  579. params.pageNum && (newParams.pageindex = params.pageNum);
  580. params.pageSize && (newParams.pagesize = params.pageSize);
  581. delete params.pageNum;
  582. delete params.pageSize;
  583. newParams.queryParams = params;
  584. console.log("params :>> ", params);
  585. newParams.dsname = "web_bednet_define";
  586. return CommonDynamicSelect(newParams, DwnameEnum.bednetQuote);
  587. // return [];
  588. };
  589. /**
  590. * @description 获取明细数据
  591. * @param params
  592. * @returns
  593. */
  594. const getDataMx = (params: any) => {
  595. console.log("getData beatad params :>> ", params);
  596. let newParams: any = {};
  597. params.pageNum && (newParams.pageindex = params.pageNum);
  598. params.pageSize && (newParams.pagesize = params.pageSize);
  599. delete params.pageNum;
  600. delete params.pageSize;
  601. newParams.queryParams = params;
  602. console.log("params :>> ", params);
  603. newParams.dsname = "web_bednet_mx";
  604. return CommonDynamicSelect(newParams, DwnameEnum.bednetQuoteMx);
  605. };
  606. /**
  607. * @description 获取弹簧明细
  608. * @param params
  609. * @returns
  610. */
  611. const getDataMxSpring = (params: any) => {
  612. console.log("getData params :>> ", params);
  613. let newParams: any = {};
  614. params.pageNum && (newParams.pageindex = params.pageNum);
  615. params.pageSize && (newParams.pagesize = params.pageSize);
  616. delete params.pageNum;
  617. delete params.pageSize;
  618. newParams.queryParams = params;
  619. console.log("params :>> ", params);
  620. newParams.dsname = "web_bednet_mx_spring";
  621. return CommonDynamicSelect(newParams, DwnameEnum.bednetQuoteMxSpring);
  622. };
  623. const getDataMxAdd = async (params: any) => {
  624. console.log("getData params :>> ", params);
  625. let newParams: any = {};
  626. params.pageNum && (newParams.pageindex = params.pageNum);
  627. params.pageSize && (newParams.pagesize = params.pageSize);
  628. delete params.pageNum;
  629. delete params.pageSize;
  630. newParams.queryParams = params;
  631. console.log("params :>> ", params);
  632. newParams.dsname = "web_bednet_mx_add";
  633. return await CommonDynamicSelect(newParams, DwnameEnum.bednetQuoteMx);
  634. };
  635. const dataCallback = (data: any) => {
  636. return {
  637. list: data.datatable,
  638. tableinfo: data.tableinfo,
  639. total: data.totalcnt,
  640. pageNum: data.pageindex,
  641. pageSize: data.pagesize
  642. };
  643. };
  644. const handleBlur = (value: any, data: any, field: string) => {
  645. //保留小数点和-号
  646. value = (value + "").replace(/[^-\d.]/g, "");
  647. console.log(value);
  648. // 保留整数部分
  649. value = value == "" ? 0 : parseInt(value, 10).toString();
  650. data[field] = value;
  651. };
  652. /**
  653. * @description 获取部门汇率 和 折扣率
  654. */
  655. const wf_get_moneyrate_discount = (val: any, data) => {
  656. const { _mainData, enumMap } = state.LjDetailRef;
  657. let deptEnum = enumMap.get("deptid");
  658. console.log("deptEnum :>> ", deptEnum);
  659. if (deptEnum) {
  660. let depItem = deptEnum.find((item: any) => item.value == _mainData.deptid);
  661. if (depItem) {
  662. let _moneyrate = !depItem.moneyrate || Number(depItem.moneyrate) == 0 ? 1 : depItem.moneyrate;
  663. if (val == 0 || !_mainData.if_moneyrate) {
  664. data.moneyrate = 1;
  665. } else {
  666. data.moneyrate = _moneyrate;
  667. }
  668. data.discount = depItem.discount;
  669. }
  670. }
  671. };
  672. const columns: ColumnProps<any>[] = [
  673. { type: "checkbox", width: 50, fixed: "left" },
  674. { title: "#", field: "pid", fixed: "left", width: 80 },
  675. {
  676. title: "审核",
  677. field: "flag",
  678. basicinfo: {
  679. props: {
  680. trueValue: "1",
  681. falseValue: "0"
  682. }
  683. }
  684. },
  685. {
  686. field: "deptid",
  687. title: "部门",
  688. search: {
  689. el: "select",
  690. key: "arg_deptid",
  691. props: {
  692. filterable: true,
  693. onChange: val => {
  694. state.initParams.arg_deptid = val;
  695. }
  696. },
  697. order: 1
  698. },
  699. basicinfo: {
  700. // el: "select",
  701. // editable: ALLOW_EDIT_STATE,
  702. // rules: [{ required: true, message: "请先选择部门", trigger: "change" }],
  703. // props: {
  704. // filterable: true,
  705. // clearable: false
  706. // },
  707. editvisible: (scope: any) => {
  708. return !state.initParams?.deptid || state.initParams?.deptid == scope.searchParam.deptid;
  709. },
  710. order: 1,
  711. group: "单据信息"
  712. }
  713. },
  714. {
  715. title: "床网编码",
  716. field: "bednetcode",
  717. table: "u_bednet_define"
  718. },
  719. {
  720. title: "床网名称",
  721. field: "bednetname",
  722. table: "u_bednet_define",
  723. search: {
  724. el: "input",
  725. titleKey: "keyword",
  726. key: "arg_search",
  727. props: {
  728. filterable: true
  729. },
  730. order: 2
  731. },
  732. basicinfo: {
  733. el: "input",
  734. editable: ALLOW_EDIT_STATE
  735. }
  736. },
  737. {
  738. title: "部门售价",
  739. field: "dept_cost"
  740. },
  741. {
  742. title: "外币价",
  743. field: "foreign_cost"
  744. },
  745. {
  746. title: "床网类别",
  747. field: "bednettypeid",
  748. basicinfo: {
  749. el: "select",
  750. editable: ALLOW_EDIT_STATE,
  751. rules: [{ required: true, message: "请先选择床网类别", trigger: "change" }],
  752. props: {
  753. clearable: false,
  754. filterable: true,
  755. onChange: val => wf_b_bednet_type_ch(val)
  756. }
  757. }
  758. },
  759. {
  760. title: "床垫宽/CM",
  761. field: "mattress_width",
  762. basicinfo: {
  763. el: "input",
  764. editable: (scope: any) => {
  765. if (ALLOW_EDIT_STATE.includes(scope.status) && !Boolean(props.mattressWidth)) {
  766. return true;
  767. }
  768. return false;
  769. },
  770. rules: [{ validator: numCheck, trigger: "blur" }]
  771. }
  772. },
  773. {
  774. title: "床垫长/CM",
  775. field: "mattress_length",
  776. basicinfo: {
  777. el: "input",
  778. editable: (scope: any) => {
  779. if (ALLOW_EDIT_STATE.includes(scope.status) && !Boolean(props.mattressLength)) {
  780. return true;
  781. }
  782. return false;
  783. },
  784. rules: [{ validator: numCheck, trigger: "blur" }]
  785. }
  786. },
  787. {
  788. title: "床垫高/CM",
  789. field: "mattress_height",
  790. basicinfo: {
  791. el: "input",
  792. editable: ALLOW_EDIT_STATE,
  793. rules: [{ validator: numCheck, trigger: "blur" }]
  794. }
  795. },
  796. {
  797. title: "双网?",
  798. field: "if_doublenet"
  799. },
  800. {
  801. title: "双簧?",
  802. field: "if_doublespring",
  803. basicinfo: {
  804. labelHidden: true,
  805. render: (scope: any) => {
  806. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  807. return (
  808. <>
  809. <el-checkbox
  810. v-model={scope.searchParam.if_doublespring}
  811. disabled={_disabled}
  812. true-value={1}
  813. false-value={0}
  814. label="双簧"
  815. class="mr-8"
  816. />
  817. <el-checkbox
  818. v-model={scope.searchParam.if_rsorwa}
  819. disabled={_disabled}
  820. true-value={1}
  821. false-value={0}
  822. label="胶条 包角"
  823. class="mr-8"
  824. />
  825. <el-checkbox
  826. v-model={scope.searchParam.if_sponge_drilling}
  827. disabled={_disabled}
  828. true-value={1}
  829. false-value={0}
  830. label="海绵打孔"
  831. />
  832. <el-checkbox v-model={scope.searchParam.iffork} disabled={_disabled} true-value={1} false-value={0} label="弹叉" />
  833. <el-checkbox v-model={scope.searchParam.if_jb} disabled={_disabled} true-value={1} false-value={0} label="卷包" />
  834. </>
  835. );
  836. }
  837. }
  838. },
  839. {
  840. title: "蛇线线径MM",
  841. field: "snake_wire_diameter",
  842. basicinfo: {
  843. el: "input",
  844. rules: [{ validator: numCheck, trigger: "blur" }],
  845. editable: (scope: any) => {
  846. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.bednettypeid) > 11) {
  847. return true;
  848. }
  849. return false;
  850. },
  851. editvisible: (scope: any) => {
  852. if (Number(scope.searchParam.bednettypeid) > 11) {
  853. return true;
  854. }
  855. return false;
  856. }
  857. }
  858. },
  859. {
  860. title: "边铁?",
  861. field: "if_side_iron"
  862. },
  863. {
  864. title: "边铁损耗率",
  865. field: "side_iron_lossrate"
  866. },
  867. {
  868. title: "海绵包边物料",
  869. field: "mtrl_sponge_name",
  870. basicinfo: {
  871. editable: ALLOW_EDIT_STATE,
  872. render: (scope: any) => {
  873. const { column, row, status } = scope;
  874. let _label = column.title;
  875. return (
  876. <>
  877. <MtrldefSelect
  878. value={scope.searchParam.sponge_mtrlid}
  879. pricelistidfn={() => getPriceid()}
  880. mtrltype={1}
  881. disabled={!ALLOW_EDIT_STATE.includes(status)}
  882. clearable
  883. placeholder={_label}
  884. onOpenModal={() => fModelChoseMtrl(scope.searchParam, { mtrltype: 1 }, rModelSetMtrlSponge)}
  885. onSelect={(val: any) => rModelSetMtrlSponge(scope.searchParam, val)}
  886. onClear={() => rModelClearMtrlSponge(scope.searchParam)}
  887. >
  888. {{
  889. label: () => scope.searchParam.mtrl_sponge_name
  890. }}
  891. </MtrldefSelect>
  892. </>
  893. );
  894. }
  895. }
  896. },
  897. {
  898. title: "海绵厚度CM",
  899. field: "sponge_thickness",
  900. basicinfo: {
  901. el: "input",
  902. editable: ALLOW_EDIT_STATE,
  903. rules: [{ validator: numCheck, trigger: "blur" }]
  904. }
  905. },
  906. {
  907. title: "海绵高CM",
  908. field: "sponge_height",
  909. basicinfo: {
  910. el: "input",
  911. editable: ALLOW_EDIT_STATE,
  912. rules: [{ validator: numCheck, trigger: "blur" }]
  913. }
  914. },
  915. {
  916. title: "填充海绵物料",
  917. field: "mtrl_sponge_tc_name",
  918. basicinfo: {
  919. editable: ALLOW_EDIT_STATE,
  920. render: (scope: any) => {
  921. const { column, row, status } = scope;
  922. let _label = column.title;
  923. return (
  924. <>
  925. <MtrldefSelect
  926. value={scope.searchParam.sponge_tc_mtrlid}
  927. pricelistidfn={() => getPriceid()}
  928. mtrltype={1}
  929. disabled={!ALLOW_EDIT_STATE.includes(status)}
  930. clearable
  931. placeholder={_label}
  932. onOpenModal={() => fModelChoseMtrl(scope.searchParam, { mtrltype: 1 }, rModelSetMtrlSpongeTc)}
  933. onSelect={(val: any) => rModelSetMtrlSpongeTc(scope.searchParam, val)}
  934. onClear={() => rModelClearMtrlSpongeTc(scope.searchParam)}
  935. >
  936. {{
  937. label: () => scope.searchParam.mtrl_sponge_tc_name
  938. }}
  939. </MtrldefSelect>
  940. </>
  941. );
  942. }
  943. }
  944. },
  945. {
  946. title: "填充海绵厚度CM",
  947. field: "sponge_tc_thickness",
  948. basicinfo: {
  949. el: "input",
  950. editable: ALLOW_EDIT_STATE,
  951. rules: [{ validator: numCheck, trigger: "blur" }]
  952. }
  953. },
  954. {
  955. title: "填充海绵高CM",
  956. field: "sponge_tc_height",
  957. basicinfo: {
  958. el: "input",
  959. editable: ALLOW_EDIT_STATE,
  960. rules: [{ validator: numCheck, trigger: "blur" }]
  961. }
  962. },
  963. {
  964. title: "封边物料",
  965. field: "mtrl_edge_name",
  966. basicinfo: {
  967. editable: ALLOW_EDIT_STATE,
  968. render: (scope: any) => {
  969. const { column, row, status } = scope;
  970. let _label = column.title;
  971. return (
  972. <>
  973. <MtrldefSelect
  974. value={scope.searchParam.edge_mtrlid}
  975. pricelistidfn={() => getPriceid()}
  976. mtrltype={7}
  977. disabled={!ALLOW_EDIT_STATE.includes(status)}
  978. clearable
  979. placeholder={_label}
  980. onOpenModal={() => fModelChoseMtrl(scope.searchParam, { mtrltype: 7 }, rModelSetMtrlEdge)}
  981. onSelect={(val: any) => rModelSetMtrlEdge(scope.searchParam, val)}
  982. onClear={() => rModelClearMtrlEdge(scope.searchParam)}
  983. >
  984. {{
  985. label: () => scope.searchParam.mtrl_edge_name
  986. }}
  987. </MtrldefSelect>
  988. </>
  989. );
  990. }
  991. }
  992. },
  993. {
  994. title: "封边高",
  995. field: "edge_height",
  996. basicinfo: {
  997. el: "input",
  998. editable: ALLOW_EDIT_STATE,
  999. rules: [{ validator: numCheck, trigger: "blur" }]
  1000. }
  1001. },
  1002. {
  1003. title: "上垫层材料",
  1004. field: "mtrl_felt_name",
  1005. basicinfo: {
  1006. editable: ALLOW_EDIT_STATE,
  1007. render: (scope: any) => {
  1008. const { column, row, status } = scope;
  1009. let _label = column.title;
  1010. return (
  1011. <>
  1012. <MtrldefSelect
  1013. value={scope.searchParam.felt_mtrlid}
  1014. pricelistidfn={() => getPriceid()}
  1015. mtrltype={7}
  1016. disabled={!ALLOW_EDIT_STATE.includes(status)}
  1017. clearable
  1018. placeholder={_label}
  1019. onOpenModal={() => fModelChoseMtrl(scope.searchParam, { mtrltype: 7 }, rModelSetMtrlFelt)}
  1020. onSelect={(val: any) => rModelSetMtrlFelt(scope.searchParam, val)}
  1021. onClear={() => rModelClearMtrlFelt(scope.searchParam)}
  1022. >
  1023. {{
  1024. label: () => scope.searchParam.mtrl_felt_name
  1025. }}
  1026. </MtrldefSelect>
  1027. </>
  1028. );
  1029. }
  1030. }
  1031. },
  1032. {
  1033. field: "felt_qty",
  1034. basicinfo: {
  1035. el: "input",
  1036. editable: ALLOW_EDIT_STATE,
  1037. rules: [{ validator: numCheck, trigger: "blur" }]
  1038. }
  1039. },
  1040. {
  1041. title: "下垫层材料",
  1042. field: "mtrl_felt_x_name",
  1043. basicinfo: {
  1044. editable: ALLOW_EDIT_STATE,
  1045. render: (scope: any) => {
  1046. const { column, row, status } = scope;
  1047. let _label = column.title;
  1048. return (
  1049. <>
  1050. <MtrldefSelect
  1051. value={scope.searchParam.felt_x_mtrlid}
  1052. pricelistidfn={() => getPriceid()}
  1053. mtrltype={7}
  1054. disabled={!ALLOW_EDIT_STATE.includes(status)}
  1055. clearable
  1056. placeholder={_label}
  1057. onOpenModal={() => fModelChoseMtrl(scope.searchParam, { mtrltype: 7 }, rModelSetMtrlFeltX)}
  1058. onSelect={(val: any) => rModelSetMtrlFeltX(scope.searchParam, val)}
  1059. onClear={() => rModelClearMtrlFeltX(scope.searchParam)}
  1060. >
  1061. {{
  1062. label: () => scope.searchParam.mtrl_felt_x_name
  1063. }}
  1064. </MtrldefSelect>
  1065. </>
  1066. );
  1067. }
  1068. }
  1069. },
  1070. {
  1071. field: "felt_x_qty",
  1072. basicinfo: {
  1073. el: "input",
  1074. editable: ALLOW_EDIT_STATE,
  1075. rules: [{ validator: numCheck, trigger: "blur" }]
  1076. }
  1077. },
  1078. {
  1079. title: "弹叉数量",
  1080. field: "fork_qty",
  1081. basicinfo: {
  1082. el: "input",
  1083. rules: [{ validator: numCheck, trigger: "blur" }],
  1084. editable: (scope: any) => {
  1085. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.iffork)) {
  1086. return true;
  1087. }
  1088. return false;
  1089. },
  1090. editvisible: (scope: any) => {
  1091. if (Number(scope.searchParam.iffork)) {
  1092. return true;
  1093. }
  1094. return false;
  1095. }
  1096. }
  1097. },
  1098. {
  1099. title: "做法",
  1100. field: "felt_dscrp",
  1101. basicinfo: {
  1102. el: "input",
  1103. editable: ALLOW_EDIT_STATE,
  1104. props: { type: "textarea", rows: 2 }
  1105. }
  1106. },
  1107. {
  1108. title: "胶条?包角?",
  1109. field: "if_rsorwa"
  1110. },
  1111. {
  1112. title: "海绵打孔?",
  1113. field: "if_sponge_drilling"
  1114. },
  1115. {
  1116. title: "登记人",
  1117. field: "createby"
  1118. },
  1119. {
  1120. title: "登记时间",
  1121. field: "createtime"
  1122. },
  1123. {
  1124. title: "总重量",
  1125. field: "sum_weight"
  1126. },
  1127. {
  1128. title: "计划价",
  1129. field: "planprice"
  1130. },
  1131. // {
  1132. // title: "Bednetid",
  1133. // field: "bednetid"
  1134. // },
  1135. {
  1136. title: "床网独立销售",
  1137. field: "ifsaleout",
  1138. basicinfo: {
  1139. el: "checkbox",
  1140. editable: ALLOW_EDIT_STATE,
  1141. props: {
  1142. trueValue: 1,
  1143. falseValue: 0
  1144. }
  1145. }
  1146. },
  1147. {
  1148. title: "包装",
  1149. field: "packtype",
  1150. // enum: [
  1151. // {
  1152. // label: "压包",
  1153. // value: "压包"
  1154. // },
  1155. // {
  1156. // label: "卷包",
  1157. // value: "卷包"
  1158. // },
  1159. // {
  1160. // label: "不压不卷",
  1161. // value: "不压不卷"
  1162. // },
  1163. // {
  1164. // label: "裸包装",
  1165. // value: "裸包装"
  1166. // }
  1167. // ],
  1168. basicinfo: {
  1169. el: "select",
  1170. editable: (scope: any) => {
  1171. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
  1172. return true;
  1173. }
  1174. return false;
  1175. },
  1176. editvisible: (scope: any) => {
  1177. if (Number(scope.searchParam.ifsaleout)) {
  1178. return true;
  1179. }
  1180. return false;
  1181. },
  1182. render: scope => {
  1183. return (
  1184. <>
  1185. <div class="flx w-full">
  1186. <el-select
  1187. v-model={scope.searchParam.packtype}
  1188. placeholder="方式"
  1189. clearable
  1190. disabled={!ALLOW_EDIT_STATE.includes(scope.status)}
  1191. >
  1192. <el-option label="压包" value="压包" />
  1193. <el-option label="卷包" value="卷包" />
  1194. <el-option label="不压不卷" value="不压不卷" />
  1195. <el-option label="裸包装" value="裸包装" />
  1196. </el-select>
  1197. {["卷包", "不压不卷"].includes(scope.searchParam.packtype) ? (
  1198. <el-select
  1199. v-model={scope.searchParam.packmtrl}
  1200. class="ml-4"
  1201. placeholder="材料"
  1202. clearable
  1203. disabled={!ALLOW_EDIT_STATE.includes(scope.status)}
  1204. >
  1205. <el-option label="编织袋" value="编织袋" />
  1206. <el-option label="牛皮纸" value="牛皮纸" />
  1207. <el-option label="胶袋" value="胶袋" />
  1208. <el-option label="牛皮纸袋" value="牛皮纸袋" />
  1209. </el-select>
  1210. ) : null}
  1211. </div>
  1212. </>
  1213. );
  1214. }
  1215. }
  1216. },
  1217. {
  1218. title: "包装数量",
  1219. field: "packqty",
  1220. basicinfo: {
  1221. el: "input",
  1222. rules: [{ validator: numCheck, trigger: "blur" }],
  1223. editable: (scope: any) => {
  1224. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
  1225. return true;
  1226. }
  1227. return false;
  1228. },
  1229. editvisible: (scope: any) => {
  1230. if (Number(scope.searchParam.ifsaleout)) {
  1231. return true;
  1232. }
  1233. return false;
  1234. }
  1235. }
  1236. },
  1237. // {
  1238. // title: "包装材料",
  1239. // field: "packmtrl",
  1240. // enum: [
  1241. // {
  1242. // label: "编辑袋",
  1243. // value: "编辑袋"
  1244. // },
  1245. // {
  1246. // label: "牛皮纸",
  1247. // value: "牛皮纸"
  1248. // },
  1249. // {
  1250. // label: "胶袋",
  1251. // value: "胶袋"
  1252. // },
  1253. // {
  1254. // label: "牛皮纸袋",
  1255. // value: "牛皮纸袋"
  1256. // }
  1257. // ],
  1258. // basicinfo: {
  1259. // el: "select",
  1260. // editable: (scope: any) => {
  1261. // if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
  1262. // return true;
  1263. // }
  1264. // return false;
  1265. // },
  1266. // editvisible: (scope: any) => {
  1267. // if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
  1268. // return true;
  1269. // }
  1270. // return false;
  1271. // }
  1272. // }
  1273. // },
  1274. {
  1275. title: "运输方式",
  1276. field: "transport_type",
  1277. enum: [
  1278. {
  1279. label: "装车送货(装柜)",
  1280. value: "装车送货(装柜)"
  1281. },
  1282. {
  1283. label: "装车送货(送货运站)",
  1284. value: "装车送货(送货运站)"
  1285. }
  1286. ],
  1287. basicinfo: {
  1288. el: "select",
  1289. editable: (scope: any) => {
  1290. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
  1291. return true;
  1292. }
  1293. return false;
  1294. },
  1295. editvisible: (scope: any) => {
  1296. if (Number(scope.searchParam.ifsaleout)) {
  1297. return true;
  1298. }
  1299. return false;
  1300. }
  1301. }
  1302. },
  1303. {
  1304. title: "佣金点数",
  1305. field: "commission",
  1306. basicinfo: {
  1307. el: "input",
  1308. props: {
  1309. placeholder: ifsaleout_default.commission + ""
  1310. },
  1311. rules: [{ validator: numCheck, trigger: "blur" }],
  1312. editable: (scope: any) => {
  1313. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
  1314. return true;
  1315. }
  1316. return false;
  1317. },
  1318. editvisible: (scope: any) => {
  1319. if (Number(scope.searchParam.ifsaleout)) {
  1320. return true;
  1321. }
  1322. return false;
  1323. }
  1324. }
  1325. },
  1326. {
  1327. title: "额外点数",
  1328. field: "other_rate",
  1329. basicinfo: {
  1330. el: "input",
  1331. props: {
  1332. placeholder: ifsaleout_default.other_rate + ""
  1333. },
  1334. rules: [{ validator: numCheck, trigger: "blur" }],
  1335. editable: (scope: any) => {
  1336. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
  1337. return true;
  1338. }
  1339. return false;
  1340. },
  1341. editvisible: (scope: any) => {
  1342. if (Number(scope.searchParam.ifsaleout)) {
  1343. return true;
  1344. }
  1345. return false;
  1346. }
  1347. }
  1348. },
  1349. {
  1350. title: "FOB",
  1351. field: "fob",
  1352. basicinfo: {
  1353. el: "input",
  1354. props: {
  1355. slots: {
  1356. suffix: () => {
  1357. return <>元</>;
  1358. },
  1359. append: () => {
  1360. return <>元</>;
  1361. }
  1362. }
  1363. },
  1364. rules: [{ validator: numCheck, trigger: "blur" }],
  1365. editable: (scope: any) => {
  1366. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
  1367. return true;
  1368. }
  1369. return false;
  1370. },
  1371. editvisible: (scope: any) => {
  1372. if (Number(scope.searchParam.ifsaleout)) {
  1373. return true;
  1374. }
  1375. return false;
  1376. }
  1377. }
  1378. },
  1379. {
  1380. title: "税率",
  1381. field: "taxrate",
  1382. basicinfo: {
  1383. el: "input",
  1384. props: {
  1385. placeholder: ifsaleout_default.taxrate + ""
  1386. },
  1387. rules: [{ validator: numCheck, trigger: "blur" }],
  1388. editable: (scope: any) => {
  1389. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
  1390. return true;
  1391. }
  1392. return false;
  1393. },
  1394. editvisible: (scope: any) => {
  1395. if (Number(scope.searchParam.ifsaleout)) {
  1396. return true;
  1397. }
  1398. return false;
  1399. }
  1400. }
  1401. },
  1402. {
  1403. title: "额外费用",
  1404. field: "extras_cost",
  1405. basicinfo: {
  1406. el: "input",
  1407. rules: [{ validator: numCheck, trigger: "blur" }],
  1408. editable: (scope: any) => {
  1409. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
  1410. return true;
  1411. }
  1412. return false;
  1413. },
  1414. editvisible: (scope: any) => {
  1415. if (Number(scope.searchParam.ifsaleout)) {
  1416. return true;
  1417. }
  1418. return false;
  1419. }
  1420. }
  1421. },
  1422. {
  1423. title: "币种",
  1424. field: "moneyrate",
  1425. basicinfo: {
  1426. el: "input",
  1427. // props: {
  1428. // placeholder: ifsaleout_default.moneyrate + ""
  1429. // },
  1430. // rules: [{ validator: numCheck, trigger: "blur" }],
  1431. editable: (scope: any) => {
  1432. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
  1433. return true;
  1434. }
  1435. return false;
  1436. },
  1437. // editvisible: (scope: any) => {
  1438. // if (Number(scope.searchParam.ifsaleout)) {
  1439. // return true;
  1440. // }
  1441. // return false;
  1442. // }
  1443. render: (scope: any) => {
  1444. let optionRender = [];
  1445. let _disabled = !ALLOW_EDIT_STATE.includes(scope.status);
  1446. scope.enum.map(item => {
  1447. optionRender.push(<el-option label={item.label} value={item.value} />);
  1448. });
  1449. let slotprefix = {
  1450. prefix: () => {
  1451. return <>{scope.searchParam.moneyrate}</>;
  1452. }
  1453. };
  1454. return (
  1455. <el-select
  1456. v-model={scope.searchParam.if_moneyrate}
  1457. v-slots={slotprefix}
  1458. class="select-text-right"
  1459. disabled={_disabled}
  1460. onChange={val => wf_get_moneyrate_discount(val, scope.searchParam)}
  1461. >
  1462. {optionRender}
  1463. </el-select>
  1464. );
  1465. }
  1466. }
  1467. },
  1468. {
  1469. title: "额外费用备注",
  1470. field: "extras_cost_dscrp",
  1471. basicinfo: {
  1472. el: "input",
  1473. span: 2,
  1474. props: { type: "textarea", rows: 2 },
  1475. editable: (scope: any) => {
  1476. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
  1477. return true;
  1478. }
  1479. return false;
  1480. },
  1481. editvisible: (scope: any) => {
  1482. if (Number(scope.searchParam.ifsaleout)) {
  1483. return true;
  1484. }
  1485. return false;
  1486. }
  1487. }
  1488. },
  1489. {
  1490. field: "duo_qv_str",
  1491. basicinfo: {
  1492. el: "select",
  1493. editable: (scope: any) => {
  1494. if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.bednettypeid) == 11) {
  1495. return true;
  1496. }
  1497. return false;
  1498. },
  1499. editvisible: (scope: any) => {
  1500. if (Number(scope.searchParam.bednettypeid) == 11) {
  1501. return true;
  1502. }
  1503. return false;
  1504. },
  1505. render: (scope: any) => {
  1506. console.log("duo_qv_str scope :>> ", scope);
  1507. let optionRender = [];
  1508. scope.enum.map(item => {
  1509. optionRender.push(<el-option label={item.label} value={item.value + ""} />);
  1510. });
  1511. return (
  1512. <>
  1513. <el-select
  1514. v-model={scope.searchParam.duo_qv_str}
  1515. disabled={!ALLOW_EDIT_STATE.includes(scope.status)}
  1516. clearable
  1517. onChange={val => handelChangeDuoqv(val, scope.enum)}
  1518. >
  1519. {optionRender}
  1520. </el-select>
  1521. </>
  1522. );
  1523. }
  1524. }
  1525. },
  1526. {
  1527. title: "是否备货",
  1528. field: "if_stock_up",
  1529. basicinfo: {
  1530. el: "checkbox",
  1531. editable: ALLOW_EDIT_STATE,
  1532. props: {
  1533. trueValue: 1,
  1534. falseValue: 0
  1535. }
  1536. }
  1537. }
  1538. ];
  1539. /**
  1540. * @description 多区select,控制多区明细条数
  1541. * @param val
  1542. */
  1543. const handelChangeDuoqv = (val: any, enumArr: any) => {
  1544. console.log("duo_qv_str val :>> ", val);
  1545. const { _mainData } = state.LjDetailRef;
  1546. let item = enumArr.find((item: any) => item.value + "" == val);
  1547. let attrKey = "area_";
  1548. if (_mainData.sponge_mtrlid > 0) {
  1549. attrKey = "sponge_";
  1550. }
  1551. let arr = getDuoquVal(item, attrKey);
  1552. let num = arr.length;
  1553. state.bednetMxData[0].if_part = Boolean(num > 1);
  1554. console.log("fullData bednetMxData :>> ", state.bednetMxData);
  1555. if (num > 1) {
  1556. state.bednetMxData[0].springid = 0;
  1557. state.bednetMxData[0].springname = "";
  1558. nextTick(() => {
  1559. setTimeout(async () => {
  1560. console.log(
  1561. "state.vxeTableMxSpringRef, state.vxeTableMxSpringRef.getTableData() :>> ",
  1562. state.vxeTableMxSpringRef
  1563. // state.vxeTableMxSpringRef.getTableData()
  1564. );
  1565. const $table = state.vxeTableMxSpringRef.element;
  1566. if ($table) {
  1567. const { fullData: springData } = $table.getTableData();
  1568. console.log("handleAreaChange fullData :>> ", springData, num > 0 && springData.length < num);
  1569. if (springData.length < num) {
  1570. let arr = [];
  1571. // let sum = Number(fullData[0].spring_qty_length);
  1572. // let lengthValSum = 0;
  1573. for (let i = 0; i < num - springData.length; i++) {
  1574. // let lengthVal = 0;
  1575. // if (i < num - springData.length - 1) {
  1576. // if (sum > 0) {
  1577. // lengthVal = (areaArr[i] / total) * sum;
  1578. // lengthValSum += lengthVal;
  1579. // }
  1580. // } else {
  1581. // lengthVal = sum - lengthValSum;
  1582. // }
  1583. // console.log("lengthVal :>> ", lengthVal);
  1584. let _data = {
  1585. ...dw_bednet_mx_spring,
  1586. spring_qty_width: Number(state.bednetMxData[0].spring_qty_width),
  1587. spring_qty_length: 0
  1588. };
  1589. arr.push(_data);
  1590. }
  1591. console.log("$table :>> ", $table, arr);
  1592. await $table.insertAt(arr, -1);
  1593. } else if (springData.length > num) {
  1594. let arrs = springData.filter((item, index) => index + 1 > num);
  1595. await $table.remove(arrs);
  1596. }
  1597. setMxSpringLength();
  1598. }
  1599. }, 200);
  1600. });
  1601. } else {
  1602. // 1
  1603. }
  1604. };
  1605. /**
  1606. * @description 获取多区数据,数组化
  1607. * @param item
  1608. * @returns
  1609. */
  1610. const getDuoquVal = (item: any, attr = "area_") => {
  1611. let arr = [];
  1612. for (const key in item) {
  1613. if (key.indexOf(attr) > -1) {
  1614. arr.push(Number(item[key]));
  1615. }
  1616. }
  1617. // 忽略数组中尾部出现的多个0
  1618. let i = arr.length - 1;
  1619. while (arr[i] === 0) {
  1620. i--;
  1621. }
  1622. arr = arr.slice(0, i + 1);
  1623. return arr;
  1624. };
  1625. /**
  1626. * @description 设置床网高度,自动计算宽度,长度
  1627. */
  1628. const setMxSpringQtyWidthAndLength = async row => {
  1629. if (row?.springid && Number(row.springid) > 0) {
  1630. const { _mainData, enumMap } = state.LjDetailRef;
  1631. let _pricelistid = getPriceid();
  1632. let bednet = cloneDeep(_mainData);
  1633. bednet.if_doublenet = Number(bednet.if_doublenet);
  1634. bednet.if_doublespring = Number(bednet.if_doublespring);
  1635. bednet.if_side_iron = Number(bednet.if_side_iron);
  1636. bednet.if_rsorwa = Number(bednet.if_rsorwa);
  1637. bednet.if_sponge_drilling = Number(bednet.if_sponge_drilling);
  1638. bednet.iffork = Number(bednet.iffork);
  1639. bednet.ifsaleout = Number(bednet.ifsaleout);
  1640. bednet.if_jb = Number(bednet.if_jb);
  1641. bednet.flag = Number(bednet.flag);
  1642. bednet.pricelistid = _pricelistid;
  1643. let _bednetMx = state.vxeTableMxRef?.element.getTableData().fullData ?? [];
  1644. _bednetMx.forEach(itm => {
  1645. itm.if_part = Number(itm.if_part);
  1646. });
  1647. let _params: any = {
  1648. bednet: bednet,
  1649. bednetMx: _bednetMx,
  1650. spring: state.vxeTableMxSpringRef?.element.getTableData().fullData ?? []
  1651. };
  1652. let res = await GetComputeSpring(_params);
  1653. console.log("setMxSpringQtyWidthAndLength res :>> ", res);
  1654. if (!res?.message) {
  1655. row.spring_qty_width = res.bednetMx[0].spring_qty_width;
  1656. row.spring_qty_length = res.bednetMx[0].spring_qty_length;
  1657. }
  1658. }
  1659. };
  1660. /**
  1661. * @description 设置多区弹簧宽度
  1662. */
  1663. const setMxSpringWidth = row => {
  1664. console.log("setMxSpringWidth val :>> ", row);
  1665. // if (Number(row.if_part)) {
  1666. // state.bednetMxSpringData = state.bednetMxSpringData.map(item => {
  1667. // item.spring_qty_width = row.spring_qty_width;
  1668. // return item;
  1669. // });
  1670. // }
  1671. if (state.vxeTableMxSpringRef) {
  1672. let { fullData: springData } = state.vxeTableMxSpringRef?.element.getTableData();
  1673. springData.forEach((item, index) => {
  1674. item.spring_qty_width = row.spring_qty_width;
  1675. });
  1676. console.log("state.vxeTableMxSpringRef.element :>> ", state.vxeTableMxSpringRef.element);
  1677. state.vxeTableMxSpringRef.element.updateFooter();
  1678. }
  1679. };
  1680. /**
  1681. * @description 设置多区弹簧长度
  1682. */
  1683. const setMxSpringLength = () => {
  1684. const { _mainData, enumMap } = state.LjDetailRef;
  1685. console.log("setMxSpringLength object :>> ", _mainData, enumMap);
  1686. let duoEnum = enumMap.get("duo_qv_str");
  1687. let item = {};
  1688. if (duoEnum) {
  1689. item = duoEnum.find(t => t.value == _mainData.duo_qv_str);
  1690. }
  1691. console.log("setMxSpringLength item :>> ", item);
  1692. let attrKey = "area_";
  1693. if (_mainData.sponge_mtrlid > 0) {
  1694. attrKey = "sponge_";
  1695. }
  1696. let arr = getDuoquVal(item, attrKey);
  1697. let totality = arr.reduce((a, b) => a + b, 0);
  1698. let { fullData } = state.vxeTableMxRef.element.getTableData();
  1699. let sum = Number(fullData[0].spring_qty_length);
  1700. console.log("arr, totality :>> ", arr, totality, sum);
  1701. if (state.vxeTableMxSpringRef) {
  1702. let { fullData: springData } = state.vxeTableMxSpringRef?.element.getTableData();
  1703. let lengthValSum = 0;
  1704. springData.forEach((item, index) => {
  1705. let lengthVal = 0;
  1706. if (arr.length >= index + 1) {
  1707. console.log("index, arr.length :>> ", index, arr.length);
  1708. if (index <= arr.length - 1) {
  1709. console.log("index == arr.length - 1 :>> ", index, arr.length - 1);
  1710. if (index == arr.length - 1) {
  1711. lengthVal = sum - lengthValSum;
  1712. console.log("lengthVal end:>> ", lengthVal, lengthValSum, sum);
  1713. } else {
  1714. lengthVal = formatIntNumber({ val: (arr[index] / totality) * sum });
  1715. lengthValSum += Number(lengthVal);
  1716. }
  1717. } else {
  1718. lengthVal = 0;
  1719. }
  1720. console.log("lengthVal :>> ", lengthVal);
  1721. }
  1722. item.spring_qty_length = lengthVal;
  1723. });
  1724. console.log("state.vxeTableMxSpringRef.element :>> ", state.vxeTableMxSpringRef.element);
  1725. state.vxeTableMxSpringRef.element.updateFooter();
  1726. }
  1727. };
  1728. const columnsMx_default = ref<ColumnProps<any>[]>([
  1729. {
  1730. field: "bednet_height",
  1731. // editRender: {
  1732. // name: "input"
  1733. // }
  1734. editRender: {},
  1735. editColRender: (scope: any) => {
  1736. const { column, row, status } = scope;
  1737. return (
  1738. <>
  1739. <el-input
  1740. v-model={row.bednet_height}
  1741. onBlur={() => handleBlur(row.bednet_height, row, "bednet_height")}
  1742. onChange={() => setMxSpringQtyWidthAndLength(row)}
  1743. style="width: unset"
  1744. />
  1745. </>
  1746. );
  1747. }
  1748. },
  1749. {
  1750. field: "spring_qty_width",
  1751. datatype: "integer",
  1752. editRender: {},
  1753. editColRender: (scope: any) => {
  1754. const { column, row, status } = scope;
  1755. return (
  1756. <>
  1757. <el-input
  1758. v-model={row.spring_qty_width}
  1759. onBlur={() => handleBlur(row.spring_qty_width, row, "spring_qty_width")}
  1760. onChange={() => setMxSpringWidth(row)}
  1761. style="width: unset"
  1762. />
  1763. </>
  1764. );
  1765. }
  1766. },
  1767. {
  1768. field: "spring_qty_length",
  1769. editRender: {},
  1770. editColRender: (scope: any) => {
  1771. const { column, row, status } = scope;
  1772. return (
  1773. <>
  1774. <el-input
  1775. v-model={row.spring_qty_length}
  1776. onBlur={() => handleBlur(row.spring_qty_length, row, "spring_qty_length")}
  1777. onChange={() => setMxSpringLength()}
  1778. style="width: unset"
  1779. />
  1780. </>
  1781. );
  1782. }
  1783. },
  1784. {
  1785. field: "springname",
  1786. editRender: {},
  1787. editColRender: (scope: any) => {
  1788. const { column, row, status } = scope;
  1789. let _label = column.title;
  1790. return (
  1791. <>
  1792. <SpringSelect
  1793. value={row.springid}
  1794. argHeight={row.bednet_height}
  1795. argBednettypeid={state.LjDetailRef._mainData.bednettypeid}
  1796. disabled={Number(row.if_part) == 1}
  1797. clearable
  1798. placeholder={_label}
  1799. onOpenModal={() =>
  1800. fModelChoseSpring(
  1801. row,
  1802. { arg_height: row.bednet_height, arg_bednettypeid: state.LjDetailRef._mainData.bednettypeid },
  1803. rModelSetMxSpring
  1804. )
  1805. }
  1806. onSelect={(val: any) => rModelSetMxSpring(row, val)}
  1807. onClear={() => rModelClearSpring(row)}
  1808. >
  1809. {{
  1810. label: () => row.springname
  1811. }}
  1812. </SpringSelect>
  1813. </>
  1814. );
  1815. }
  1816. },
  1817. {
  1818. field: "if_side_iron",
  1819. editRender: {},
  1820. editColRender: (scope: any) => {
  1821. const { column, row, status } = scope;
  1822. if (Number(row.if_side_iron) == 0) {
  1823. row.side_iron_qty = 0;
  1824. }
  1825. return (
  1826. <>
  1827. <el-checkbox v-model={row.if_side_iron} class="vxe-edit-col-middle"></el-checkbox>
  1828. </>
  1829. );
  1830. }
  1831. },
  1832. {
  1833. field: "side_iron_qty",
  1834. editRender: {},
  1835. editColRender: (scope: any) => {
  1836. const { column, row, status } = scope;
  1837. return (
  1838. <>
  1839. <el-input v-model={row.side_iron_qty} disabled={Number(row.if_side_iron) == 0} />
  1840. </>
  1841. );
  1842. }
  1843. },
  1844. {
  1845. field: "if_hard_around",
  1846. editRender: {},
  1847. editColRender: (scope: any) => {
  1848. const { column, row, status } = scope;
  1849. if (Number(row.if_hard_around) == 0) {
  1850. row.hard_around_springid = 0;
  1851. row.hard_around_springname = "";
  1852. row.hard_around_row = 0;
  1853. }
  1854. return (
  1855. <>
  1856. <el-checkbox v-model={row.if_hard_around} class="vxe-edit-col-middle"></el-checkbox>
  1857. </>
  1858. );
  1859. }
  1860. },
  1861. {
  1862. field: "hard_around_row",
  1863. editRender: {},
  1864. editColRender: (scope: any) => {
  1865. const { column, row, status } = scope;
  1866. return (
  1867. <>
  1868. <el-input v-model={row.hard_around_row} disabled={Number(row.if_hard_around) == 0} />
  1869. </>
  1870. );
  1871. }
  1872. },
  1873. {
  1874. field: "hard_around_springname",
  1875. editRender: {},
  1876. editColRender: (scope: any) => {
  1877. console.log("hard_around_springname editColRender scope :>> ", scope);
  1878. const { column, row, status } = scope;
  1879. let _label = column.title;
  1880. return (
  1881. <>
  1882. <SpringSelect
  1883. value={row.hard_around_springid}
  1884. disabled={Number(row.if_hard_around) == 0}
  1885. clearable
  1886. placeholder={_label}
  1887. onOpenModal={() => fModelChoseSpring(row, {}, rModelSetHardAroundSpring)}
  1888. onSelect={(val: any) => rModelSetHardAroundSpring(row, val)}
  1889. onClear={() => rModelClearHardAroundSpring(row)}
  1890. />
  1891. </>
  1892. );
  1893. }
  1894. },
  1895. {
  1896. field: "if_15strip",
  1897. editRender: {},
  1898. editColRender: (scope: any) => {
  1899. const { column, row, status } = scope;
  1900. return (
  1901. <>
  1902. <el-checkbox v-model={row.if_15strip} class="vxe-edit-col-middle"></el-checkbox>
  1903. </>
  1904. );
  1905. }
  1906. },
  1907. {
  1908. field: "fabrics2_mtrlid",
  1909. editRender: {},
  1910. editColRender: (scope: any) => {
  1911. const { column, row, status } = scope;
  1912. let _label = column.title;
  1913. return (
  1914. <>
  1915. <MtrldefSelect
  1916. value={row.fabrics2_mtrlid}
  1917. pricelistidfn={() => getPriceid()}
  1918. mtrltype={2}
  1919. clearable
  1920. placeholder={_label}
  1921. onOpenModal={() => fModelChoseMtrl(row, { mtrltype: 2 }, rModelSetMtrlFabrisc2)}
  1922. onSelect={(val: any) => rModelSetMtrlFabrisc2(row, val)}
  1923. onClear={() => rModelClearMtrlFabrisc2(row)}
  1924. />
  1925. </>
  1926. );
  1927. }
  1928. },
  1929. {
  1930. field: "fabrics1_mtrlid",
  1931. editRender: {},
  1932. editColRender: (scope: any) => {
  1933. const { column, row, status } = scope;
  1934. let _label = column.title;
  1935. return (
  1936. <>
  1937. <MtrldefSelect
  1938. value={scope.row.fabrics1_mtrlid}
  1939. pricelistidfn={() => getPriceid()}
  1940. mtrltype={2}
  1941. clearable
  1942. placeholder={_label}
  1943. onOpenModal={() => fModelChoseMtrl(scope.row, { mtrltype: 2 }, rModelSetMtrlFabrisc1)}
  1944. onSelect={(val: any) => rModelSetMtrlFabrisc1(scope.row, val)}
  1945. onClear={() => rModelClearMtrlFabrisc1(scope.row)}
  1946. />
  1947. </>
  1948. );
  1949. }
  1950. }
  1951. ]);
  1952. const columnsMx = ref<ColumnProps<any>[]>();
  1953. const columnsMxSpring = ref<ColumnProps<any>[]>([]);
  1954. const columnsMxSpring_default = ref<ColumnProps<any>[]>([
  1955. { title: "#", field: "pid", fixed: "left", width: 80 },
  1956. {
  1957. field: "springname",
  1958. editRender: {},
  1959. editColRender: (scope: any) => {
  1960. console.log("springname editColRender scope :>> ", scope);
  1961. const { column, row, status } = scope;
  1962. let _label = column.title;
  1963. let { fullData: mxlist } = state.vxeTableMxRef.element.getTableData();
  1964. return (
  1965. <>
  1966. <SpringSelect
  1967. value={row.springid}
  1968. disabled={Number(row.if_part) == 1}
  1969. clearable
  1970. placeholder={_label}
  1971. onOpenModal={() =>
  1972. fModelChoseSpring(
  1973. scope.row,
  1974. { arg_height: mxlist[0]?.bednet_height, arg_bednettypeid: state.LjDetailRef._mainData.bednettypeid },
  1975. rModelSetSpring
  1976. )
  1977. }
  1978. onSelect={(val: any) => rModelSetSpring(scope.row, val)}
  1979. onClear={() => rModelClearSpring(scope.row)}
  1980. >
  1981. {{
  1982. label: () => row.springname
  1983. }}
  1984. </SpringSelect>
  1985. </>
  1986. );
  1987. }
  1988. },
  1989. {
  1990. field: "spring_qty_width",
  1991. editRender: {},
  1992. editColRender: (scope: any) => {
  1993. const { column, row, status } = scope;
  1994. return (
  1995. <>
  1996. <el-input
  1997. v-model={row.spring_qty_width}
  1998. onBlur={() => handleBlur(row.spring_qty_width, row, "spring_qty_width")}
  1999. style="width: unset"
  2000. />
  2001. </>
  2002. );
  2003. }
  2004. },
  2005. {
  2006. field: "spring_qty_length",
  2007. editRender: {},
  2008. editColRender: (scope: any) => {
  2009. const { column, row, status } = scope;
  2010. return (
  2011. <>
  2012. <el-input
  2013. v-model={row.spring_qty_length}
  2014. onBlur={() => handleBlur(row.spring_qty_length, row, "spring_qty_length")}
  2015. style="width: unset"
  2016. />
  2017. </>
  2018. );
  2019. }
  2020. }
  2021. ]);
  2022. const columnsBednet = ref<ColumnProps<any>[]>([{}]);
  2023. /**
  2024. * @description 计算价格
  2025. */
  2026. const wf_cmp_cb = async () => {
  2027. const { _mainData, enumMap, baseformRef } = state.LjDetailRef;
  2028. wf_clear();
  2029. wf_set_if_doublespring();
  2030. if (!wf_check_rule()) return false;
  2031. if (!(await wf_check_required())) return false;
  2032. return true;
  2033. };
  2034. /**
  2035. * @description 清除运算结果
  2036. */
  2037. const wf_clear = () => {
  2038. const { _mainData } = state.LjDetailRef;
  2039. _mainData.spring_mtrl_cost = 0;
  2040. _mainData.spring_hr_cost = 0;
  2041. _mainData.total_mtrl_cost = 0;
  2042. _mainData.total_hr_cost = 0;
  2043. _mainData.total_fees_cost = 0;
  2044. _mainData.total_cost = 0;
  2045. _mainData.nottax_factory_cost = 0;
  2046. _mainData.nottax_dept_cost = 0;
  2047. _mainData.dept_cost = 0;
  2048. _mainData.foreign_cost = 0;
  2049. _mainData.taxes = 0;
  2050. _mainData.snake_wire_mtrl_cost = 0;
  2051. _mainData.pocket_around_spring_cost = 0;
  2052. _mainData.pocket_around_fabrics_cost = 0;
  2053. _mainData.hard_around_mtrl_cost = 0;
  2054. _mainData.hard_around_hr_cost = 0;
  2055. _mainData.glue_price = 0;
  2056. _mainData.felt_price = 0;
  2057. _mainData.felt_mtrl_cost = 0;
  2058. _mainData.felt_hr_cost = 0;
  2059. _mainData.glue_mtrl_cost = 0;
  2060. _mainData.fabrics1_mtrl_cost = 0;
  2061. _mainData.fabrics2_mtrl_cost = 0;
  2062. _mainData.side_iron_mtrl_cost = 0;
  2063. _mainData.side_iron_hr_cost = 0;
  2064. _mainData.side_iron_price = 0;
  2065. _mainData.side_iron_lossrate = 0;
  2066. _mainData.cnail_price = 0;
  2067. _mainData.cnail_mtrl_cost = 0;
  2068. _mainData.cnail_hr_cost = 0;
  2069. _mainData.sponge_mtrl_cost = 0;
  2070. _mainData.sponge_hr_cost = 0;
  2071. _mainData.edge_mtrl_cost = 0;
  2072. _mainData.edge_hr_cost = 0;
  2073. _mainData.fork_mtrl_cost = 0;
  2074. _mainData.fork_hr_cost = 0;
  2075. _mainData.rsorwa_mtrl_cost = 0;
  2076. _mainData.rsorwa_hr_cost = 0;
  2077. _mainData.sponge_drilling_hr_cost = 0;
  2078. _mainData.sponge_price = 0;
  2079. _mainData.edge_price = 0;
  2080. _mainData.fork_price = 0;
  2081. _mainData.rsorwa_price = 0;
  2082. _mainData.felt_mtrl_x_cost = 0;
  2083. _mainData.packet_mtrl_cost = 0;
  2084. _mainData.packet_hr_cost = 0;
  2085. _mainData.sum_weight = 0;
  2086. _mainData.spring_weight_qty = 0;
  2087. _mainData.side_iron_weight_qty = 0;
  2088. _mainData.hard_around_weight_qty = 0;
  2089. _mainData.fabrics1_weight_qty = 0;
  2090. _mainData.fabrics2_weight_qty = 0;
  2091. _mainData.felt_weight_qty = 0;
  2092. _mainData.cnail_weight_qty = 0;
  2093. _mainData.sponge_weight_qty = 0;
  2094. _mainData.sponge_weight_tc_qty = 0;
  2095. _mainData.fork_weight_qty = 0;
  2096. _mainData.edge_weight_qty = 0;
  2097. };
  2098. const wf_set_if_doublespring = () => {
  2099. const { _mainData, enumMap } = state.LjDetailRef;
  2100. const deptEnum = enumMap.get("deptid");
  2101. const bednettypeEnum = enumMap.get("bednettypeid");
  2102. let deptItem = deptEnum.find((item: any) => Number(item.value) == _mainData.deptid);
  2103. let typeItem = bednettypeEnum.find((item: any) => Number(item.value) == _mainData.bednettypeid);
  2104. console.log("typeItem :>> ", typeItem, deptItem);
  2105. if (
  2106. typeItem &&
  2107. deptItem &&
  2108. typeItem.label.indexOf("圆网") > -1 &&
  2109. deptItem.label.indexOf("外贸") === -1 &&
  2110. deptItem.label.indexOf("国外") === -1
  2111. ) {
  2112. _mainData.if_doublespring = 1;
  2113. }
  2114. };
  2115. const wf_check_rule = (): boolean => {
  2116. let { fullData: mxlist } = state.vxeTableMxRef.element.getTableData();
  2117. if (!state.vxeTableMxSpringRef) {
  2118. return true;
  2119. }
  2120. let { fullData: springlist } = state.vxeTableMxSpringRef.element.getTableData();
  2121. for (let mx of mxlist) {
  2122. //1.如果没有四周加硬 左边 弹簧个数排列宽 等于 右边每行 弹簧个数排列宽 , 左边 弹簧个数排列长 等于 右边每行合计 弹簧个数排列长
  2123. if (Number(mx.if_hard_around) === 0) {
  2124. // 左边 弹簧个数排列宽 等于 右边每行 弹簧个数排列宽
  2125. let sum_length = 0;
  2126. for (let spring of springlist) {
  2127. sum_length += parseFloat(spring.spring_qty_length);
  2128. if (Number(mx.spring_qty_width) != Number(spring.spring_qty_width)) {
  2129. throw new Error(`多区袋装明细列表,第${spring.pid}行,弹簧个数排列宽填写错误!`);
  2130. }
  2131. }
  2132. if (parseFloat(mx.spring_qty_length) != sum_length) {
  2133. throw new Error(
  2134. `床网明细列表 弹簧个数排列长${parseFloat(
  2135. mx.spring_qty_length
  2136. )}不等于 多区袋装明细列表 弹簧个数排列长合计${sum_length}!`
  2137. );
  2138. }
  2139. } else if (Number(mx.if_hard_around) === 1) {
  2140. // 左边 弹簧个数排列宽 小于 右边每行 弹簧个数排列宽
  2141. let sum_length = 0;
  2142. for (let spring of springlist) {
  2143. sum_length += parseFloat(spring.spring_qty_length);
  2144. if (Number(mx.spring_qty_width) < Number(spring.spring_qty_width)) {
  2145. throw new Error(`多区袋装明细列表,第${spring.pid}行,弹簧个数排列宽填写错误!`);
  2146. }
  2147. }
  2148. //左边 弹簧个数排列长 小于 右边每行合计 弹簧个数排列长
  2149. if (parseFloat(mx.spring_qty_length) < sum_length) {
  2150. throw new Error(
  2151. `床网明细列表 弹簧个数排列长${parseFloat(
  2152. mx.spring_qty_length
  2153. )}小于 多区袋装明细列表 弹簧个数排列长合计${sum_length}!`
  2154. );
  2155. }
  2156. }
  2157. }
  2158. return true;
  2159. };
  2160. const wf_check_required = async (): Promise<boolean> => {
  2161. const { _mainData, enumMap } = state.LjDetailRef;
  2162. let { fullData: mxlist } = state.vxeTableMxRef.element.getTableData();
  2163. //检查有没有填写床网高
  2164. for (let mx of mxlist) {
  2165. if (mx.bednet_height + 0 == 0) {
  2166. throw new Error("请填写床网高");
  2167. } else {
  2168. _mainData.mattress_height = parseFloat(mx.bednet_height);
  2169. }
  2170. }
  2171. // 检查有没有 填写 填充海绵高
  2172. if (_mainData.sponge_tc_mtrlid + 0 > 0) {
  2173. if (_mainData.sponge_tc_thickness + 0 == 0) {
  2174. throw new Error("请填写填充海绵厚度!");
  2175. }
  2176. if (_mainData.sponge_tc_height + 0 == 0) {
  2177. throw new Error("请填写填充海绵厚度!");
  2178. }
  2179. if ((_mainData.sponge_tc_thickness + 0 > 0 || _mainData.sponge_tc_height + 0 > 0) && _mainData.sponge_tc_mtrlid + 0 == 0) {
  2180. throw new Error("请选择填充海绵物料!");
  2181. }
  2182. }
  2183. // 如果 没有填写 海绵高和封边高 自动等于 床网高
  2184. if (_mainData.sponge_mtrlid > 0 && _mainData.sponge_height + 0 <= 0) _mainData.sponge_height = _mainData.mattress_height;
  2185. if (_mainData.edge_mtrlid > 0 && _mainData.edge_height + 0 <= 0) _mainData.edge_height = _mainData.mattress_height;
  2186. _mainData.commission = _mainData.commission && Number(_mainData.commission) !== 0 ? _mainData.commission : 1;
  2187. _mainData.taxrate = _mainData.taxrate && Number(_mainData.taxrate) !== 0 ? _mainData.taxrate : 1;
  2188. _mainData.other_rate = _mainData.other_rate && Number(_mainData.other_rate) !== 0 ? _mainData.other_rate : 1;
  2189. _mainData.moneyrate = _mainData.moneyrate && Number(_mainData.moneyrate) !== 0 ? _mainData.moneyrate : 1;
  2190. if (Number(_mainData.commission) < 1) {
  2191. throw new Error("佣金点数不能小于1!");
  2192. }
  2193. if (Number(_mainData.taxrate) < 1) {
  2194. throw new Error("税率不能小于1!");
  2195. }
  2196. if (Number(_mainData.other_rate) < 1) {
  2197. throw new Error("额外点数不能小于1!");
  2198. }
  2199. if (_mainData.packtype && _mainData.packtype.length > 0) {
  2200. _mainData.packtype = _mainData.packtype.trim();
  2201. if (_mainData.packtype != "不压不卷" && _mainData.packqty + 0 == 0) {
  2202. throw new Error("请填写包装数量!");
  2203. }
  2204. if (_mainData.packtype != "不压不卷" && _mainData.packtype != "裸包装" && _mainData.transport_type + "" == "") {
  2205. throw new Error("请选择运输方式!");
  2206. }
  2207. if (_mainData.packtype == "卷包" && _mainData.packmtrl + "" == "") {
  2208. throw new Error("请选择包装材料!");
  2209. }
  2210. }
  2211. await wf_factory_profitrate();
  2212. if (_mainData.dept_profitrate + 0 == 0) {
  2213. throw new Error("部门利润率不能为0!");
  2214. }
  2215. if (_mainData.bednettypeid + 0 == 0) {
  2216. throw new Error("请选择床网类别!");
  2217. }
  2218. if (_mainData.sponge_mtrlid + 0 > 0 && _mainData.sponge_thickness + 0 == 0) {
  2219. throw new Error("请填写海绵厚度!");
  2220. }
  2221. if (_mainData.sponge_mtrlid + 0 == 0 && _mainData.sponge_thickness + 0 > 0) {
  2222. throw new Error("请选择海绵物料!");
  2223. }
  2224. const bednettypeEnum = enumMap.get("bednettypeid");
  2225. let typeItem = bednettypeEnum.find((item: any) => Number(item.value) == _mainData.bednettypeid);
  2226. for (let mx of mxlist) {
  2227. if (mx.bednet_height + 0 == 0) {
  2228. throw new Error(`第${mx.pid}行,请填写床网高!`);
  2229. }
  2230. if (mx.spring_qty_width + 0 == 0) {
  2231. throw new Error(`第${mx.pid}行,请填写弹簧排列个数-宽!`);
  2232. }
  2233. if (mx.spring_qty_length + 0 == 0) {
  2234. throw new Error(`第${mx.pid}行,请填写弹簧排列个数-长!`);
  2235. }
  2236. if (typeItem.label.indexOf("袋装网") > -1 && mx.fabrics1_mtrlid + 0 == 0) {
  2237. throw new Error(`第${mx.pid}行,请选择入袋无纺布!`);
  2238. }
  2239. if (mx.if_side_iron > 0 && mx.side_iron_qty + 0 == 0) {
  2240. throw new Error(`第${mx.pid}行,请填写边铁条数!`);
  2241. }
  2242. }
  2243. return true;
  2244. };
  2245. /**
  2246. * @description 获取部门利润率
  2247. */
  2248. const wf_factory_profitrate = async () => {
  2249. const { _mainData, enumMap } = state.LjDetailRef;
  2250. console.log("wf_factory_profitrate enumMap :>> ", enumMap);
  2251. let deptEnum = enumMap.get("deptid");
  2252. console.log("deptEnum :>> ", deptEnum);
  2253. if (deptEnum) {
  2254. let depItem = deptEnum.find((item: any) => item.value == _mainData.deptid);
  2255. console.log("depItem :>> ", depItem);
  2256. if (depItem) {
  2257. _mainData.dept_profitrate = parseFloat(depItem.profitrate);
  2258. }
  2259. }
  2260. let _params = {
  2261. dsname: "web_factory_profitratelist",
  2262. queryparams: {
  2263. arg_deptid: _mainData.deptid,
  2264. arg_bednettypeid_mattresstypeid: _mainData.mattresstypeid,
  2265. kind: 0
  2266. }
  2267. };
  2268. let res = await CommonDynamicSelect(_params);
  2269. if (res?.datatable?.length > 0) {
  2270. _mainData.profitrate = parseFloat(res?.datatable[0].profitrate);
  2271. }
  2272. };
  2273. /**
  2274. * @description 展示计算公式
  2275. * @param timeout
  2276. */
  2277. const gotoSummy = async (timeout = 0, ifdrawer?: boolean) => {
  2278. // if (userInfo.usermode == 1) {
  2279. // ElMessage.error("'业务员模式不可以查看计算公式!'");
  2280. // return false;
  2281. // }
  2282. console.log(
  2283. "state.vxeTableMxRef?.element.getTableData().fullData :>> ",
  2284. state.vxeTableMxRef?.element.getTableData().fullData,
  2285. state.vxeTableMxRef
  2286. );
  2287. let bednet = cloneDeep(state.LjDetailRef._mainData);
  2288. bednet.if_doublenet = Number(bednet.if_doublenet);
  2289. bednet.if_doublespring = Number(bednet.if_doublespring);
  2290. bednet.if_side_iron = Number(bednet.if_side_iron);
  2291. bednet.if_rsorwa = Number(bednet.if_rsorwa);
  2292. bednet.if_sponge_drilling = Number(bednet.if_sponge_drilling);
  2293. bednet.iffork = Number(bednet.iffork);
  2294. bednet.ifsaleout = Number(bednet.ifsaleout);
  2295. bednet.if_jb = Number(bednet.if_jb);
  2296. bednet.flag = Number(bednet.flag);
  2297. if (state.initParams?.deptid > 0 && state.initParams?.deptid != bednet.deptid) {
  2298. bednet.deptid = state.initParams.deptid;
  2299. }
  2300. let _params: any = {
  2301. dannum_type: state.dannum_type,
  2302. bednet: bednet,
  2303. bednetMx: state.vxeTableMxRef?.element.getTableData().fullData ?? [],
  2304. spring: state.vxeTableMxSpringRef?.element.getTableData().fullData ?? []
  2305. };
  2306. let res = await GetComputeBednet(_params);
  2307. console.log("GetComputeBednet res :>> ", res);
  2308. let summaryData = [];
  2309. let fieldParams = [];
  2310. let cpData = {};
  2311. if (!res.message) {
  2312. // summaryData = res.formulas;
  2313. // fieldParams = res.replace;
  2314. // cpData = res.bednet;
  2315. state.cmpFormulas = res.formulas;
  2316. state.cmpFormulaReplace = res.replace;
  2317. } else {
  2318. setTimeout(() => {
  2319. if (res.message) {
  2320. ElNotification({
  2321. title: "计算失败",
  2322. message: res.message,
  2323. type: "warning"
  2324. });
  2325. }
  2326. }, 100);
  2327. return false;
  2328. }
  2329. console.log("summaryData :>> ", summaryData, fieldParams);
  2330. // const toast = useToast();
  2331. // if (ifdrawer) {
  2332. // state.AllFormulaRef.open(summaryData, fieldParams, cpData);
  2333. // toast.clear();
  2334. // } else {
  2335. // toast(
  2336. // {
  2337. // component: ToastFormula,
  2338. // props: {
  2339. // t: t,
  2340. // formulas: summaryData,
  2341. // // data: cpData,
  2342. // fields: fieldParams
  2343. // },
  2344. // listeners: {
  2345. // tomore: () => {
  2346. // console.log("tomore summaryData :>> ", summaryData);
  2347. // state.AllFormulaRef.open(summaryData, fieldParams, cpData);
  2348. // toast.clear();
  2349. // },
  2350. // refresh: () => {
  2351. // gotoSummy();
  2352. // }
  2353. // }
  2354. // },
  2355. // {
  2356. // position: POSITION.BOTTOM_RIGHT,
  2357. // icon: false,
  2358. // timeout: timeout,
  2359. // closeButton: false,
  2360. // toastClassName: "longjoe-toast"
  2361. // }
  2362. // );
  2363. // }
  2364. };
  2365. return {
  2366. ...toRefs(state),
  2367. columns,
  2368. columnsMx,
  2369. columnsMxSpring,
  2370. columnsBednet,
  2371. dw_bednet_mx_spring,
  2372. reload_dw2,
  2373. getData,
  2374. getDataMx,
  2375. getDataMxSpring,
  2376. getDataMxAdd,
  2377. dataCallback,
  2378. wf_cmp_cb,
  2379. setMxSpringLength,
  2380. gotoSummy
  2381. };
  2382. };