edit.vue 165 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756
  1. <template>
  2. <div>
  3. <Toptitle
  4. :title="type == 1 ? '新增订单' : type == 2 ? '编辑订单' : '订单详情'"
  5. >
  6. <Button
  7. @click="print"
  8. type="primary"
  9. ghost
  10. v-show="type == 3"
  11. style="margin-right: 10px"
  12. >打印</Button
  13. >
  14. <Button @click="back" type="primary" ghost style="margin-right: 10px"
  15. >返回</Button
  16. >
  17. <Button
  18. @click="showForms = true"
  19. type="primary"
  20. v-show="type != 3"
  21. style="margin-right: 10px"
  22. >表单设置</Button
  23. >
  24. <Button
  25. type="primary"
  26. v-show="type != 3"
  27. @click="handleSubmit('infoOrder')"
  28. >保存</Button
  29. >
  30. </Toptitle>
  31. <div class="page-edit">
  32. <!-- 表单项 -->
  33. <Form
  34. ref="infoOrder"
  35. inline
  36. :label-width="100"
  37. :model="info"
  38. style="padding: 10px 0"
  39. :rules="infoRules"
  40. >
  41. <FormItem
  42. v-if="formSetTableData.filter((v) => v.key == 'order_no')[0].is_show"
  43. :label="formSetTableData.filter((v) => v.key == 'order_no')[0].title"
  44. >
  45. <Input
  46. disabled
  47. v-if="type != 3"
  48. v-model="info.order_no"
  49. class="auto-width"
  50. placeholder="自动生成"
  51. />
  52. <span v-else>{{ info.order_no }}</span>
  53. </FormItem>
  54. <FormItem
  55. v-if="
  56. formSetTableData.filter((v) => v.key == 'residential_name')[0]
  57. .is_show
  58. "
  59. :label="
  60. formSetTableData.filter((v) => v.key == 'residential_name')[0].title
  61. "
  62. prop="residential_name"
  63. >
  64. <Input
  65. v-model="info.residential_name"
  66. v-if="type != 3"
  67. class="auto-width"
  68. placeholder="请输入项目名称"
  69. />
  70. <span v-else>{{ info.residential_name }}</span>
  71. </FormItem>
  72. <FormItem
  73. v-if="
  74. formSetTableData.filter((v) => v.key == 'warning_state')[0].is_show
  75. "
  76. :label="
  77. formSetTableData.filter((v) => v.key == 'warning_state')[0].title
  78. "
  79. prop="warning_state"
  80. >
  81. <Select
  82. clearable
  83. class="auto-width"
  84. v-if="type != 3"
  85. v-model="info.warning_state"
  86. >
  87. <Option
  88. :label="_item.title"
  89. v-for="_item in warningList"
  90. :key="_item.id"
  91. :value="_item.id"
  92. ></Option>
  93. </Select>
  94. <span v-else>{{
  95. warningList.length > 0 && info.warning_state
  96. ? warningList.filter((item) => item.id == info.warning_state)[0]
  97. .title
  98. : ""
  99. }}</span>
  100. </FormItem>
  101. <FormItem
  102. v-if="
  103. formSetTableData.filter((v) => v.key == 'front_money')[0].is_show
  104. "
  105. :label="
  106. formSetTableData.filter((v) => v.key == 'front_money')[0].title
  107. "
  108. >
  109. <Input
  110. v-model="info.front_money"
  111. class="auto-width"
  112. v-if="type != 3"
  113. placeholder="请输入项目定金"
  114. />
  115. <span v-else>{{ info.front_money }}</span>
  116. </FormItem>
  117. <FormItem
  118. v-if="
  119. formSetTableData.filter((v) => v.key == 'start_time')[0].is_show
  120. "
  121. :label="
  122. formSetTableData.filter((v) => v.key == 'start_time')[0].title
  123. "
  124. >
  125. <DatePicker
  126. :options="options"
  127. v-if="type != 3"
  128. v-model="info.start_time"
  129. type="date"
  130. placeholder="开始日期"
  131. class="auto-width"
  132. ></DatePicker>
  133. <span v-else>{{ info.start_time }}</span>
  134. </FormItem>
  135. <FormItem
  136. v-if="
  137. formSetTableData.filter((v) => v.key == 'client_name')[0].is_show
  138. "
  139. :label="
  140. formSetTableData.filter((v) => v.key == 'client_name')[0].title
  141. "
  142. prop="custom_id"
  143. >
  144. <Select
  145. clearable
  146. filterable
  147. v-if="type != 3"
  148. class="auto-width"
  149. @on-change="handleClientChange"
  150. v-model="info.custom_id"
  151. >
  152. <Option
  153. v-for="item in clientList"
  154. :label="item.title"
  155. :key="item.id"
  156. :value="item.id"
  157. ></Option>
  158. </Select>
  159. <span v-else>{{
  160. clientList.length > 0 && info.custom_id
  161. ? clientList.filter((item) => item.id == info.custom_id)[0].title
  162. : ""
  163. }}</span>
  164. </FormItem>
  165. <FormItem
  166. v-if="
  167. formSetTableData.filter((v) => v.key == 'custom_detail_name')[0]
  168. .is_show
  169. "
  170. :label="
  171. formSetTableData.filter((v) => v.key == 'custom_detail_name')[0]
  172. .title
  173. "
  174. >
  175. <Select
  176. placeholder="请选择负责人"
  177. v-if="type != 3"
  178. clearable
  179. filterable
  180. v-model="info.custom_detail_name"
  181. @on-change="handleClientChargeChange"
  182. class="auto-width"
  183. >
  184. <!-- @on-change="handleClientDetailChange" -->
  185. <Option
  186. v-for="item of clientDetailList_respon"
  187. :key="item.service_name"
  188. :label="item.service_name"
  189. :value="item.service_name"
  190. ></Option>
  191. </Select>
  192. <span v-else>{{ info.custom_detail_name }}</span>
  193. </FormItem>
  194. <FormItem
  195. v-if="
  196. formSetTableData.filter((v) => v.key == 'custom_detail_mobile')[0]
  197. .is_show
  198. "
  199. :label="
  200. formSetTableData.filter((v) => v.key == 'custom_detail_mobile')[0]
  201. .title
  202. "
  203. >
  204. <Select
  205. clearable
  206. filterable
  207. v-if="type != 3"
  208. class="auto-width"
  209. v-model="info.custom_detail_mobile"
  210. >
  211. <Option
  212. v-for="item in clientDetailList_mobile"
  213. :label="item.mobile"
  214. :key="item.id"
  215. :value="item.mobile"
  216. ></Option>
  217. </Select>
  218. <span v-else>{{ info.custom_detail_mobile }}</span>
  219. </FormItem>
  220. <FormItem
  221. v-if="
  222. formSetTableData.filter((v) => v.key == 'custom_detail_id')[0]
  223. .is_show
  224. "
  225. :label="
  226. formSetTableData.filter((v) => v.key == 'custom_detail_id')[0].title
  227. "
  228. >
  229. <Select
  230. clearable
  231. filterable
  232. v-if="type != 3"
  233. class="auto-width"
  234. @on-change="handleClientDetailChange"
  235. v-model="info.custom_detail_id"
  236. >
  237. <Option
  238. v-for="item in clientDetailList_address"
  239. :label="item.address"
  240. :key="item.id"
  241. :value="item.id"
  242. ></Option>
  243. </Select>
  244. <span v-else>{{ info.custom_detail_id }}</span>
  245. </FormItem>
  246. <FormItem
  247. v-if="
  248. formSetTableData.filter((v) => v.key == 'service_id')[0].is_show
  249. "
  250. :label="
  251. formSetTableData.filter((v) => v.key == 'service_id')[0].title
  252. "
  253. >
  254. <Select
  255. disabled
  256. v-if="type != 3"
  257. placeholder="自动带出"
  258. v-model="info.service_id"
  259. class="auto-width"
  260. >
  261. <Option
  262. v-for="item of users"
  263. :key="item.id"
  264. :label="item.nickname"
  265. :value="item.id"
  266. ></Option>
  267. </Select>
  268. <span v-else>{{
  269. users.length > 0 && info.service_id
  270. ? users.filter((item) => item.id == info.service_id)[0].nickname
  271. : ""
  272. }}</span>
  273. </FormItem>
  274. <FormItem
  275. v-if="formSetTableData.filter((v) => v.key == 'end_time')[0].is_show"
  276. :label="formSetTableData.filter((v) => v.key == 'end_time')[0].title"
  277. >
  278. <DatePicker
  279. :options="options"
  280. v-if="type != 3"
  281. v-model="info.end_time"
  282. type="date"
  283. placeholder="交付日期"
  284. class="auto-width"
  285. ></DatePicker>
  286. <span v-else>{{ info.end_time }}</span>
  287. </FormItem>
  288. <FormItem
  289. v-if="
  290. formSetTableData.filter((v) => v.key == 'predict_price')[0].is_show
  291. "
  292. :label="
  293. formSetTableData.filter((v) => v.key == 'predict_price')[0].title
  294. "
  295. >
  296. <Input
  297. v-model="info.predict_price"
  298. v-if="type != 3"
  299. readonly
  300. class="auto-width"
  301. placeholder="自动生成"
  302. />
  303. <span v-else>{{ info.predict_price }}</span>
  304. </FormItem>
  305. <FormItem
  306. v-if="formSetTableData.filter((v) => v.key == 'fax_price')[0].is_show"
  307. :label="formSetTableData.filter((v) => v.key == 'fax_price')[0].title"
  308. >
  309. <Input
  310. v-model="info.fax_price"
  311. v-if="type != 3"
  312. readonly
  313. class="auto-width"
  314. placeholder="自动生成"
  315. />
  316. <span v-else>{{ info.fax_price }}</span>
  317. </FormItem>
  318. <FormItem
  319. v-if="
  320. formSetTableData.filter((v) => v.key == 'order_price')[0].is_show
  321. "
  322. :label="
  323. formSetTableData.filter((v) => v.key == 'order_price')[0].title
  324. "
  325. >
  326. <Input
  327. v-model="info.order_price"
  328. v-if="type != 3"
  329. @on-change="handleOrderPriceChange($event, info)"
  330. class="auto-width"
  331. placeholder="自动生成"
  332. />
  333. <span v-else>{{ info.order_price }}</span>
  334. </FormItem>
  335. <FormItem
  336. prop="box_id"
  337. v-if="formSetTableData.filter((v) => v.key == 'box_id')[0].is_show"
  338. :label="formSetTableData.filter((v) => v.key == 'box_id')[0].title"
  339. >
  340. <Select
  341. clearable
  342. filterable
  343. v-if="type != 3"
  344. v-model="info.box_id"
  345. class="auto-width"
  346. >
  347. <Option
  348. v-for="item of sub_material_list"
  349. :key="item.id"
  350. :label="item.title"
  351. :value="item.id"
  352. ></Option>
  353. </Select>
  354. <span v-else>{{
  355. sub_material_list.length > 0 && info.box_id
  356. ? sub_material_list.filter((item) => item.id == info.box_id)[0]
  357. .title
  358. : ""
  359. }}</span>
  360. </FormItem>
  361. <FormItem
  362. v-if="formSetTableData.filter((v) => v.key == 'remark')[0].is_show"
  363. :label="formSetTableData.filter((v) => v.key == 'remark')[0].title"
  364. >
  365. <Input
  366. v-model="info.remark"
  367. type="textarea"
  368. v-if="type != 3"
  369. class="auto-width"
  370. placeholder="请输入订单备注"
  371. />
  372. <span v-else>{{ info.remark }}</span>
  373. </FormItem>
  374. <FormItem label="上传附件:">
  375. <div class="product-img">
  376. <div class="product-add">
  377. <div class="items" v-for="(item, index) of info.img" :key="index">
  378. <img
  379. @click="looks(item)"
  380. :src="$store.state.ip + item"
  381. alt=""
  382. />
  383. <Icon
  384. v-if="type != 3"
  385. size="20"
  386. @click="delItems(index, info.img)"
  387. class="delete-img"
  388. type="ios-close-circle"
  389. />
  390. </div>
  391. <div class="add-items" v-if="type != 3">
  392. <div class="item">
  393. <Icon size="50" type="ios-add" />
  394. </div>
  395. <span>支持jpg/png格式</span>
  396. <input
  397. @change="changeIpt($event, info.img)"
  398. type="file"
  399. class="ipt"
  400. />
  401. </div>
  402. </div>
  403. </div>
  404. <!-- <Button type="primary"
  405. style="margin-right:10px;"
  406. ghost>上传附件</Button> -->
  407. <!-- <Upload style="display: inline"
  408. name="your_file"
  409. :show-upload-list="false"
  410. :headers="headers"
  411. multiple
  412. :data="uploadData"
  413. :on-error="uploadError"
  414. :on-progress="onProgress"
  415. :on-success="uploadSuccess"
  416. :action="$store.state.ip + '/api/deep_img_import'">
  417. <Button type="primary"
  418. style="margin-right: 10px">上传附件</Button>
  419. </Upload> -->
  420. </FormItem>
  421. <div label="线条:" style="margin-left:20px;width:95%">
  422. <div style="font-size:20px">
  423. <span>线条:</span>
  424. <span v-if="wood_title_count.length < 1">无</span>
  425. <span
  426. v-else
  427. v-for="(item, index) in wood_title_count"
  428. :key="item.title + '' + index"
  429. >{{ item.title }}:
  430. <span v-for="(_item, _index) in item.measure_str" :key="_item.id"
  431. >{{ _item.measure }}={{ _item.num }}{{ item.unit }}
  432. <span v-show="_index < item.measure_str.length - 1">;</span>
  433. </span>
  434. <span v-show="index < wood_title_count.length - 1">;</span>
  435. </span>
  436. </div>
  437. </div>
  438. <div label="合计:" style="margin-left:20px;width:95%">
  439. <div style="font-size:20px">
  440. <span>合计:</span>
  441. <span v-if="parts_title_count.length < 1">无</span>
  442. <span
  443. v-else
  444. v-for="(item, index) in parts_title_count"
  445. :key="item.title + '' + index"
  446. v-show="item.title.indexOf('线条') == -1"
  447. >{{ item.title }}:{{ item.num }}{{ item.unit }}
  448. <span v-show="index < parts_title_count.length - 1">;</span>
  449. </span>
  450. </div>
  451. </div>
  452. </Form>
  453. <!-- 户型选择 -->
  454. <div class="content">
  455. <vxe-toolbar>
  456. <template #buttons>
  457. <div class="content_header">
  458. <h2>产品信息</h2>
  459. <div>
  460. <Button
  461. type="primary"
  462. style="margin-right: 10px"
  463. v-show="!tree_btn_show"
  464. @click="
  465. $refs.xTree.setAllTreeExpand(true);
  466. tree_btn_show = !tree_btn_show;
  467. "
  468. >全部展开</Button
  469. >
  470. <Button
  471. type="primary"
  472. style="margin-right: 10px"
  473. v-show="tree_btn_show"
  474. @click="
  475. $refs.xTree.clearTreeExpand();
  476. tree_btn_show = !tree_btn_show;
  477. "
  478. >全部收缩</Button
  479. >
  480. <Button
  481. type="primary"
  482. style="margin-right: 10px"
  483. v-show="type == 3"
  484. @click="handleShowMaterial"
  485. >{{ is_material_show ? "收起" : "查看" }}原材料</Button
  486. >
  487. <Button
  488. type="primary"
  489. style="margin-right: 10px"
  490. v-show="type != 3"
  491. @click="handleSet({}, null, 1)"
  492. >新增产品</Button
  493. >
  494. </div>
  495. </div>
  496. </template>
  497. </vxe-toolbar>
  498. <vxe-table
  499. border
  500. resizable
  501. class="my-xtable-iview"
  502. align="center"
  503. :edit-config="{ trigger: 'dblclick', mode: 'row' }"
  504. :data="tableData"
  505. >
  506. <vxe-column type="seq" min-width="80">
  507. <template #header>
  508. <span>序号</span>
  509. </template>
  510. </vxe-column>
  511. <vxe-column
  512. field="position"
  513. title="位置"
  514. min-width="100"
  515. :edit-render="{}"
  516. >
  517. <template #edit="scope">
  518. <Input v-model="scope.row.position" />
  519. </template>
  520. </vxe-column>
  521. <vxe-column
  522. field="product_id"
  523. title="产品名称"
  524. min-width="150"
  525. :edit-render="{}"
  526. >
  527. <template #edit="scope">
  528. <Select
  529. filterable
  530. clearable
  531. transfer
  532. filter-by-label
  533. label-in-value
  534. v-model="scope.row.product_id"
  535. @change="$refs.xTable.updateStatus(scope)"
  536. @on-change="
  537. changeEditTableData(scope.row, scope.rowIndex, $event, scope)
  538. "
  539. >
  540. <Option
  541. v-for="item in productList"
  542. :tag="item.img_url"
  543. :value="item.id"
  544. :key="item.id"
  545. >{{ item.title }}</Option
  546. >
  547. </Select>
  548. </template>
  549. <template #default="{ row }">{{
  550. getSelectedLabel(row.product_id, productList, "id", "title")
  551. }}</template>
  552. </vxe-column>
  553. <vxe-column
  554. v-for="process in bpp_list"
  555. :key="process.id + 'bpp'"
  556. :field="process.id + ''"
  557. :title="process.name"
  558. min-width="120"
  559. :edit-render="{}"
  560. >
  561. <template #edit="scope">
  562. <Select
  563. filterable
  564. clearable
  565. transfer
  566. filter-by-label
  567. label-in-value
  568. v-model="scope.row[process.id]"
  569. @change="$refs.xTable.updateStatus(scope)"
  570. @on-change="changeEditProcess(scope.row, process)"
  571. @on-open-change="
  572. (e) => handleGetProductMeasure(e, null, scope.row, process)
  573. "
  574. >
  575. <Option
  576. v-for="item in process.cld"
  577. :value="item.id"
  578. :key="item.id + 'cld'"
  579. >{{ item.title }}</Option
  580. >
  581. </Select>
  582. </template>
  583. <template #default="{ row }">
  584. {{
  585. getSelectedLabel(row[process.id], process.cld, "id", "title")
  586. }}</template
  587. >
  588. </vxe-column>
  589. <vxe-column
  590. v-for="measure in measure_total"
  591. :key="measure.e_title"
  592. :field="measure.e_title"
  593. :title="measure.title"
  594. min-width="120"
  595. :edit-render="{}"
  596. >
  597. <template #edit="scope">
  598. <Input
  599. v-model="scope.row[measure.e_title]"
  600. @on-change="(e) => changeEditMeasure(e, scope.row, measure)"
  601. />
  602. </template>
  603. <template #default="{ row }"> {{ row[measure.e_title] }}</template>
  604. </vxe-column>
  605. <vxe-column
  606. v-for="part_type in part_type_total"
  607. :key="part_type.id + '999'"
  608. :title="part_type.title"
  609. min-width="120"
  610. :edit-render="{}"
  611. >
  612. <template #edit="scope">
  613. <Select
  614. clearable
  615. transfer
  616. label-in-value
  617. :value="
  618. scope.row.part.filter((v) => v.type_id == part_type.id)
  619. .length > 0
  620. ? scope.row.part.filter((v) => v.type_id == part_type.id)[0]
  621. .part_id
  622. : ''
  623. "
  624. @on-change="changeEditPart(scope.row, part_type)"
  625. >
  626. <Option
  627. v-for="ch in scope.row.part.filter(
  628. (v) => v.type_id == part_type.id
  629. ).length > 0
  630. ? scope.row.part.filter((v) => v.type_id == part_type.id)[0]
  631. .change
  632. : []"
  633. :key="ch.part_id + '999'"
  634. :label="ch.part_title"
  635. :value="ch.part_id"
  636. />
  637. </Select>
  638. </template>
  639. <template #default="{ row }">
  640. {{
  641. row.part.filter((v) => v.type_id == part_type.id).length > 0
  642. ? row.part.filter((v) => v.type_id == part_type.id)[0].title
  643. : ""
  644. }}</template
  645. >
  646. </vxe-column>
  647. <vxe-column title="原材料名称" min-width="200">
  648. <template #default="scope">
  649. <div
  650. v-for="part_detail in scope.row.part"
  651. :key="part_detail.order_product_part_id"
  652. v-show="!part_detail.is_metal"
  653. >
  654. <div
  655. v-for="(sub_part_detail, idx) in part_detail.sub_part"
  656. :key="idx + '999'"
  657. v-show="sub_part_detail.title.indexOf('线条') > 0"
  658. :style="
  659. idx != part_detail.sub_part.length - 1
  660. ? {
  661. borderBottom: '1px solid #e8eaec',
  662. padding: '10px 0',
  663. }
  664. : { padding: '10px 0' }
  665. "
  666. >
  667. {{ sub_part_detail.title }}
  668. </div>
  669. </div>
  670. </template>
  671. </vxe-column>
  672. <vxe-column title="原材料规格" min-width="200" :edit-render="{}">
  673. <template #default="scope">
  674. <div
  675. v-for="(part_detail, idx) in scope.row.part"
  676. :key="idx + '999'"
  677. v-show="!part_detail.is_metal"
  678. >
  679. <div
  680. v-for="(sub_part_detail, idx) in part_detail.sub_part"
  681. :key="idx + 'sub_part'"
  682. v-show="sub_part_detail.title.indexOf('线条') > 0"
  683. :style="
  684. idx != part_detail.sub_part.length - 1
  685. ? {
  686. borderBottom: '1px solid #e8eaec',
  687. padding: '10px 0',
  688. }
  689. : { padding: '10px 0' }
  690. "
  691. >
  692. {{
  693. sub_part_detail.part_detail_option
  694. ? sub_part_detail.part_detail_option.find(
  695. (v) => v.value == sub_part_detail.material_detail_id
  696. ).label
  697. : ""
  698. }}
  699. </div>
  700. </div>
  701. </template>
  702. <template #edit="scope">
  703. <div
  704. v-for="part_detail in scope.row.part"
  705. :key="part_detail.order_product_part_id"
  706. v-show="!part_detail.is_metal"
  707. >
  708. <div
  709. v-for="(sub_part_detail, idx) in part_detail.sub_part"
  710. :key="idx + 'sub_part'"
  711. v-show="sub_part_detail.title.indexOf('线条') > 0"
  712. :style="
  713. idx != part_detail.sub_part.length - 1
  714. ? {
  715. borderBottom: '1px solid #e8eaec',
  716. padding: '10px 0',
  717. }
  718. : { padding: '10px 0' }
  719. "
  720. >
  721. <Select
  722. filterable
  723. clearable
  724. transfer
  725. label-in-value
  726. v-model="sub_part_detail.material_detail_id"
  727. >
  728. <Option
  729. v-for="ch in sub_part_detail.part_detail_option"
  730. :key="ch.value"
  731. :label="ch.label"
  732. :value="ch.value"
  733. />
  734. </Select>
  735. </div>
  736. </div>
  737. </template>
  738. </vxe-column>
  739. <vxe-column title="原材料数量" min-width="200" :edit-render="{}">
  740. <template #default="scope">
  741. <div
  742. v-for="part_detail in scope.row.part"
  743. :key="part_detail.order_product_part_id"
  744. v-show="!part_detail.is_metal"
  745. >
  746. <div
  747. v-for="(sub_part_detail, idx) in part_detail.sub_part"
  748. :key="idx + 'sub_part'"
  749. v-show="sub_part_detail.title.indexOf('线条') > 0"
  750. :style="
  751. idx != part_detail.sub_part.length - 1
  752. ? {
  753. borderBottom: '1px solid #e8eaec',
  754. padding: '10px 0',
  755. }
  756. : { padding: '10px 0' }
  757. "
  758. >
  759. {{ sub_part_detail.num }}
  760. </div>
  761. </div>
  762. </template>
  763. <template #edit="scope">
  764. <div
  765. v-for="part_detail in scope.row.part"
  766. :key="part_detail.order_product_part_id"
  767. v-show="!part_detail.is_metal"
  768. >
  769. <div
  770. v-for="(sub_part_detail, idx) in part_detail.sub_part"
  771. :key="idx + 'sub_part'"
  772. v-show="sub_part_detail.title.indexOf('线条') > 0"
  773. :style="
  774. idx != part_detail.sub_part.length - 1
  775. ? {
  776. borderBottom: '1px solid #e8eaec',
  777. padding: '10px 0',
  778. }
  779. : { padding: '10px 0' }
  780. "
  781. >
  782. <Input v-model="sub_part_detail.num" />
  783. </div>
  784. </div>
  785. </template>
  786. </vxe-column>
  787. <vxe-column field="total_num" title="数量" min-width="80">
  788. </vxe-column>
  789. <vxe-column field="unit" title="单位" min-width="70"> </vxe-column>
  790. <vxe-column field="num" title="核算数量" min-width="80"> </vxe-column>
  791. <vxe-column field="unit_price" title="单价" min-width="80">
  792. </vxe-column>
  793. <vxe-column title="附加项" min-width="80"> </vxe-column>
  794. <vxe-column field="ext_price" title="附加金额" min-width="80">
  795. </vxe-column>
  796. <vxe-column field="over_price" title="超标金额" min-width="80">
  797. </vxe-column>
  798. <vxe-column field="price" title="总金额" min-width="80"> </vxe-column>
  799. <vxe-column
  800. field="remark"
  801. title="备注"
  802. min-width="120"
  803. :edit-render="{}"
  804. >
  805. <template #edit="scope">
  806. <Select filterable clearable transfer v-model="scope.row.remark">
  807. <Option
  808. v-for="item in support_remark"
  809. :value="item"
  810. :key="item"
  811. >{{ item }}</Option
  812. >
  813. </Select>
  814. </template>
  815. <template #default="{ row }">
  816. {{ row.remark }}
  817. </template>
  818. </vxe-column>
  819. <vxe-column title="操作" min-width="200">
  820. <template #default="{ row, rowIndex }">
  821. <a @click="handleSet(row, rowIndex, 5)" style="margin: 0 5px"
  822. >详情</a
  823. >
  824. <a
  825. @click="handleSet(row, rowIndex, 4)"
  826. v-if="type != 3"
  827. v-show="rowIndex >= 0"
  828. style="margin: 0 5px"
  829. >复制</a
  830. >
  831. <a
  832. @click="handleSet(row, rowIndex, 2)"
  833. v-if="type != 3"
  834. v-show="rowIndex >= 0"
  835. style="margin: 0 5px"
  836. >编辑</a
  837. >
  838. <a
  839. @click="handleSet(row, rowIndex, 3)"
  840. v-if="type != 3"
  841. v-show="rowIndex >= 0"
  842. style="margin: 0 5px"
  843. >删除</a
  844. >
  845. </template>
  846. </vxe-column>
  847. </vxe-table>
  848. <vxe-table resizable border ref="xTree" :data="tableData">
  849. <vxe-table-column
  850. field="position"
  851. title="位置"
  852. align="center"
  853. min-width="80"
  854. ></vxe-table-column>
  855. <vxe-table-column
  856. field="unit"
  857. title="计量单位"
  858. align="center"
  859. min-width="80"
  860. ></vxe-table-column>
  861. <!-- <vxe-table-column
  862. field="process_str"
  863. title="工艺属性"
  864. align="center"
  865. min-width="200"
  866. ></vxe-table-column> -->
  867. <vxe-table-column
  868. field="measurement_no_letter"
  869. title="尺寸"
  870. align="center"
  871. min-width="180"
  872. ></vxe-table-column>
  873. <vxe-table-column
  874. field="total_num"
  875. title="数量"
  876. align="center"
  877. min-width="80"
  878. ></vxe-table-column>
  879. <vxe-table-column
  880. field="num"
  881. title="核算数量"
  882. align="center"
  883. min-width="80"
  884. >
  885. <template #default="{ row }">
  886. {{ row.is_metal ? "" : row.num }}
  887. </template>
  888. </vxe-table-column>
  889. <vxe-table-column
  890. field="unit_price"
  891. title="单价"
  892. align="center"
  893. min-width="80"
  894. ></vxe-table-column>
  895. <vxe-table-column
  896. field="ext_price"
  897. title="附加金额"
  898. align="center"
  899. min-width="80"
  900. ></vxe-table-column>
  901. <vxe-table-column
  902. field="over_price"
  903. title="超标金额"
  904. align="center"
  905. min-width="80"
  906. ></vxe-table-column>
  907. <vxe-table-column
  908. field="price"
  909. title="金额"
  910. align="center"
  911. min-width="80"
  912. >
  913. <template #default="{ row }">
  914. {{ row.is_metal ? "" : row.price }}
  915. </template>
  916. </vxe-table-column>
  917. <vxe-table-column
  918. field="url_number"
  919. title="图号"
  920. align="center"
  921. min-width="80"
  922. ></vxe-table-column>
  923. <vxe-table-column
  924. field="remark"
  925. title="备注"
  926. align="center"
  927. min-width="80"
  928. ></vxe-table-column>
  929. <vxe-table-column
  930. field="extra"
  931. title="附加项"
  932. align="center"
  933. min-width="80"
  934. ></vxe-table-column>
  935. <vxe-table-column
  936. field="date"
  937. title="其他项"
  938. align="center"
  939. min-width="80"
  940. ></vxe-table-column>
  941. <vxe-table-column
  942. field=""
  943. title="操作"
  944. align="center"
  945. min-width="180"
  946. >
  947. <template #default="{ row, rowIndex }">
  948. <a
  949. @click="handleSet(row, rowIndex, 5)"
  950. v-show="type == 3 && rowIndex >= 0"
  951. style="margin: 0 5px"
  952. >详情</a
  953. >
  954. <a
  955. @click="handleSet(row, rowIndex, 4)"
  956. v-if="type != 3"
  957. v-show="rowIndex >= 0"
  958. style="margin: 0 5px"
  959. >复制</a
  960. >
  961. <a
  962. @click="handleSet(row, rowIndex, 2)"
  963. v-if="type != 3"
  964. v-show="rowIndex >= 0"
  965. style="margin: 0 5px"
  966. >编辑</a
  967. >
  968. <a
  969. @click="handleSet(row, rowIndex, 3)"
  970. v-if="type != 3"
  971. v-show="rowIndex >= 0"
  972. style="margin: 0 5px"
  973. >删除</a
  974. >
  975. </template>
  976. </vxe-table-column>
  977. </vxe-table>
  978. <!-- 原材料 -->
  979. <!-- v-show="type==3" -->
  980. <div class="original-part" v-show="type == 3 && is_material_show">
  981. <Table
  982. border
  983. show-summary
  984. :summary-method="handleSummary"
  985. :span-method="handleSpan"
  986. :columns="originalTableColumns"
  987. :data="originalData"
  988. ></Table>
  989. </div>
  990. </div>
  991. </div>
  992. <!-- 选择产品弹层--编辑框 -->
  993. <Modal
  994. :width="1400"
  995. class-name="vertical-center-modal"
  996. :title="title_state == 2 ? '编辑产品' : '查看产品'"
  997. :mask-closable="false"
  998. v-model="showEditProduct"
  999. @on-visible-change="modalVisibleChange"
  1000. >
  1001. <div style="max-height: 800px; overflow: hidden; overflow-y: auto">
  1002. <Tabs value="name">
  1003. <TabPane
  1004. :label="
  1005. (modalData.position ? modalData.position : '位置') +
  1006. '-' +
  1007. modalData.type_name
  1008. "
  1009. name="name"
  1010. >
  1011. <div class="modal_product_info">
  1012. <div class="modal_product_info_title">产品信息</div>
  1013. <div class="modal_product_info_content modal_product">
  1014. <Form :model="modalData" :label-width="100">
  1015. <FormItem label="选择产品:">
  1016. <Tooltip style="width: 120px" transfer>
  1017. <span slot="content">
  1018. <span
  1019. v-for="_item in productList"
  1020. :key="_item.id"
  1021. v-show="_item.id == modalData.product_id"
  1022. >{{ _item.title }}</span
  1023. >
  1024. </span>
  1025. <Select
  1026. filterable
  1027. clearable
  1028. transfer
  1029. filter-by-label
  1030. label-in-value
  1031. :disabled="isCheck"
  1032. size="small"
  1033. v-model="modalData.product_id"
  1034. @on-change="changeEditProduct($event)"
  1035. style="width: 120px"
  1036. >
  1037. <Option
  1038. v-for="item of productList"
  1039. :tag="item.img_url"
  1040. :key="item.id"
  1041. :label="item.title"
  1042. :value="item.id"
  1043. ></Option>
  1044. </Select>
  1045. </Tooltip>
  1046. </FormItem>
  1047. <FormItem label="位置:">
  1048. <Tooltip style="width: 120px" transfer>
  1049. <span slot="content">
  1050. {{ modalData.position }}
  1051. </span>
  1052. <Input
  1053. size="small"
  1054. v-model="modalData.position"
  1055. :disabled="isCheck"
  1056. @on-change="
  1057. (e) => handleProductPositionChange(modalData, e)
  1058. "
  1059. style="width: 120px"
  1060. placeholder="请输入位置"
  1061. />
  1062. </Tooltip>
  1063. </FormItem>
  1064. <FormItem label="计量单位:">
  1065. <Input
  1066. size="small"
  1067. disabled
  1068. style="width: 120px"
  1069. v-model="modalData.unit"
  1070. placeholder="自动带出"
  1071. />
  1072. </FormItem>
  1073. <!-- 工艺属性 -->
  1074. <div
  1075. v-for="(ele, idx) in modalData.process_obj"
  1076. :key="idx + '777'"
  1077. >
  1078. <FormItem
  1079. v-for="(_process, idx) in process_all_list"
  1080. :key="idx + '333' + modalData.id"
  1081. :label="(ele.title || _process.title) + ':'"
  1082. v-show="ele.id == _process.id"
  1083. >
  1084. <Tooltip style="width: 120px" transfer>
  1085. <span slot="content">
  1086. <span
  1087. v-for="_item in ele.processList"
  1088. :key="_item.id + '999'"
  1089. v-show="_item.id == ele.value"
  1090. >{{ _item.title }}</span
  1091. >
  1092. </span>
  1093. <Select
  1094. style="width: 120px"
  1095. filterable
  1096. clearable
  1097. transfer
  1098. label-in-value
  1099. :disabled="isCheck"
  1100. @on-open-change="
  1101. (e) =>
  1102. handleGetProductMeasure(e, idx, modalData, ele)
  1103. "
  1104. @on-change="
  1105. (e) =>
  1106. handleProductProcessChange(e, idx, modalData, ele)
  1107. "
  1108. v-model="ele.value"
  1109. size="small"
  1110. >
  1111. <Option
  1112. v-for="option of ele.cld"
  1113. :key="option.id + 'cld'"
  1114. :disabled="option.isDisabled"
  1115. :label="option.title"
  1116. :value="option.id"
  1117. ></Option>
  1118. </Select>
  1119. </Tooltip>
  1120. </FormItem>
  1121. </div>
  1122. <!-- 测量字段 -->
  1123. <FormItem
  1124. v-for="(ele, idx) in modalData.measure"
  1125. :key="idx + '888'"
  1126. :label="ele.title + ':'"
  1127. >
  1128. <Input
  1129. size="small"
  1130. type="text"
  1131. clearable
  1132. :disabled="isCheck"
  1133. :placeholder="ele.e_title"
  1134. v-model="ele.value"
  1135. @on-change="
  1136. (e) => handleProductMeasureChange(e, modalData, ele)
  1137. "
  1138. @on-blur="
  1139. (e) => handleProductMeasureBlur(e, modalData, ele)
  1140. "
  1141. style="width: 120px"
  1142. />
  1143. </FormItem>
  1144. <FormItem label="数量:">
  1145. <Input
  1146. size="small"
  1147. @on-change="(e) => handleProductNumChange(e, modalData)"
  1148. v-model="modalData.total_num"
  1149. :disabled="isCheck"
  1150. style="width: 120px"
  1151. placeholder="请输入产品数量"
  1152. />
  1153. </FormItem>
  1154. <FormItem label="核算数量:">
  1155. <Input
  1156. size="small"
  1157. v-model="modalData.num"
  1158. disabled
  1159. style="width: 120px"
  1160. placeholder="自动带出"
  1161. />
  1162. </FormItem>
  1163. <FormItem label="单价:">
  1164. <Input
  1165. size="small"
  1166. :disabled="isCheck"
  1167. v-model="modalData.unit_price"
  1168. @on-change="
  1169. (e) => handleProductUnit_priceChange(e, modalData)
  1170. "
  1171. style="width: 120px"
  1172. placeholder="自动带出"
  1173. />
  1174. </FormItem>
  1175. <FormItem label="附加金额:">
  1176. <Input
  1177. size="small"
  1178. :disabled="isCheck"
  1179. v-model="modalData.ext_price"
  1180. @on-change="
  1181. (e) => handleProductExt_priceChange(e, modalData)
  1182. "
  1183. style="width: 120px"
  1184. placeholder="自动带出"
  1185. />
  1186. </FormItem>
  1187. <FormItem label="超标金额:">
  1188. <Input
  1189. :disabled="isCheck"
  1190. size="small"
  1191. @on-change="
  1192. (e) => handleProductOver_priceChange(e, modalData)
  1193. "
  1194. v-model="modalData.over_price"
  1195. style="width: 120px"
  1196. placeholder="自动带出"
  1197. />
  1198. </FormItem>
  1199. <FormItem label="金额:">
  1200. <Input
  1201. :disabled="isCheck"
  1202. size="small"
  1203. v-model="modalData.price"
  1204. style="width: 120px"
  1205. placeholder="自动带出"
  1206. />
  1207. </FormItem>
  1208. <FormItem label="图号:">
  1209. <Input
  1210. size="small"
  1211. :disabled="isCheck"
  1212. v-model="modalData.url_number"
  1213. style="width: 120px"
  1214. placeholder="自动带出"
  1215. />
  1216. </FormItem>
  1217. <FormItem
  1218. v-for="(_customize, customize_key) in modalData.customize"
  1219. :label="_customize.style + ':'"
  1220. :key="customize_key + '99'"
  1221. >
  1222. <Input
  1223. v-show="_customize.type == 1"
  1224. :disabled="isCheck"
  1225. size="small"
  1226. type="text"
  1227. v-model="_customize.value"
  1228. style="width: 120px"
  1229. placeholder="请输入"
  1230. />
  1231. <Select
  1232. v-show="_customize.type == 2"
  1233. style="width: 120px"
  1234. :disabled="isCheck"
  1235. filterable
  1236. clearable
  1237. v-model="_customize.value"
  1238. size="small"
  1239. >
  1240. <Option
  1241. v-for="option of _customize.explain"
  1242. :key="option.value"
  1243. :label="option.value"
  1244. :value="option.value"
  1245. ></Option>
  1246. </Select>
  1247. </FormItem>
  1248. <FormItem
  1249. v-for="(outh, outh_key) in modalData.outh"
  1250. :label="outh.title"
  1251. :key="outh_key + 21"
  1252. >
  1253. <img
  1254. v-if="outh.key == 'img' || outh.key == 'url'"
  1255. @click="showPreview(modalData, outh.key)"
  1256. style="
  1257. max-width: 30px;
  1258. max-height: 30px;
  1259. top: 5px;
  1260. position: relative;
  1261. cursor: pointer;
  1262. "
  1263. :src="$store.state.ip + outh.value"
  1264. />
  1265. <Input
  1266. v-if="
  1267. outh.key != 'img' &&
  1268. outh.key != 'url' &&
  1269. outh.key != 'lock'
  1270. "
  1271. disabled
  1272. placeholder="自动生成"
  1273. style="width: 120px"
  1274. size="small"
  1275. v-model="outh.value"
  1276. />
  1277. <Select
  1278. label-in-value
  1279. @on-change="changeLock($event, modalData, index)"
  1280. size="small"
  1281. clearable
  1282. style="width: 120px"
  1283. v-if="outh.key == 'lock'"
  1284. v-model="modalData[outh.key]"
  1285. >
  1286. <Option
  1287. v-for="luck of lock_list"
  1288. :key="luck.id"
  1289. :tag="luck.price"
  1290. :value="luck.id"
  1291. :label="luck.title"
  1292. ></Option>
  1293. <Option :value="0" label="无"></Option>
  1294. </Select>
  1295. </FormItem>
  1296. <FormItem label="备注:">
  1297. <Select
  1298. size="small"
  1299. clearable
  1300. filterable
  1301. :disabled="isCheck"
  1302. style="width: 120px"
  1303. allow-create
  1304. @on-create="handleRemarkCreate"
  1305. v-model="modalData.remark"
  1306. >
  1307. <Option
  1308. v-for="_remark of support_remark"
  1309. :key="_remark"
  1310. :value="_remark"
  1311. :label="_remark"
  1312. ></Option>
  1313. </Select>
  1314. <!-- <Input
  1315. size="small"
  1316. type="textarea"
  1317. :disabled="isCheck"
  1318. v-model="modalData.remark"
  1319. style="width: 120px"
  1320. placeholder="请输入备注"
  1321. /> -->
  1322. </FormItem>
  1323. <FormItem label="产品图:">
  1324. <!-- v-show="modalData.url && modalData.url.length > 0" -->
  1325. <div class="product-img">
  1326. <div class="product-add">
  1327. <div
  1328. class="items"
  1329. v-for="(item, index) of modalData.url"
  1330. :key="index"
  1331. >
  1332. <img
  1333. @click="looks(item)"
  1334. :src="$store.state.ip + item"
  1335. alt=""
  1336. />
  1337. </div>
  1338. </div>
  1339. </div>
  1340. </FormItem>
  1341. </Form>
  1342. </div>
  1343. </div>
  1344. <div class="modal_product_info">
  1345. <div class="modal_product_info_title">部件信息</div>
  1346. <div class="modal_product_info_content modal_parts">
  1347. <Form
  1348. :model="element"
  1349. v-for="(element, idx) in modalData.part"
  1350. :key="element.id + '444' + idx"
  1351. :label-width="50"
  1352. >
  1353. <FormItem
  1354. :label-width="element.isBP ? 1 : 50"
  1355. v-show="!element.is_metal"
  1356. >
  1357. <Radio
  1358. v-show="element.isBP"
  1359. :disabled="isCheck"
  1360. @click.native.prevent="handleRadioClick(element)"
  1361. v-model="element.isChoosed"
  1362. ></Radio>
  1363. <!-- <span v-show="element.isBP">{{ element.part_title }} </span> -->
  1364. </FormItem>
  1365. <FormItem
  1366. label="部件:"
  1367. v-show="element.is_metal ? false : true"
  1368. >
  1369. <Select
  1370. filterable
  1371. clearable
  1372. transfer
  1373. :disabled="isCheck"
  1374. label-in-value
  1375. size="small"
  1376. @on-change="
  1377. handlePartChange(
  1378. $event,
  1379. element,
  1380. modalData.measure,
  1381. modalData.total_num
  1382. )
  1383. "
  1384. v-model="element.change_id"
  1385. style="width: 180px"
  1386. >
  1387. <Option
  1388. v-for="item of element.change"
  1389. :key="item.id"
  1390. :label="item.part_title"
  1391. :value="item.id"
  1392. ></Option>
  1393. </Select>
  1394. </FormItem>
  1395. <FormItem
  1396. label="高:"
  1397. v-show="
  1398. !element.is_metal &&
  1399. element.hide_measure &&
  1400. !element.hide_measure.filter((v) => v == 'H').length > 0
  1401. "
  1402. >
  1403. <Input
  1404. size="small"
  1405. clearable
  1406. :disabled="isCheck"
  1407. v-model="element.long"
  1408. style="width: 50px"
  1409. placeholder="请输入厚"
  1410. />
  1411. </FormItem>
  1412. <FormItem
  1413. label="宽:"
  1414. v-show="
  1415. !element.is_metal &&
  1416. element.hide_measure &&
  1417. !element.hide_measure.filter((v) => v == 'W').length > 0
  1418. "
  1419. >
  1420. <Input
  1421. size="small"
  1422. clearable
  1423. :disabled="isCheck"
  1424. v-model="element.wide"
  1425. style="width: 50px"
  1426. placeholder="请输入宽"
  1427. />
  1428. </FormItem>
  1429. <FormItem
  1430. label="厚:"
  1431. v-show="
  1432. !element.is_metal &&
  1433. element.hide_measure &&
  1434. !element.hide_measure.filter((v) => v == 'T').length > 0
  1435. "
  1436. >
  1437. <Input
  1438. size="small"
  1439. clearable
  1440. :disabled="isCheck"
  1441. v-model="element.high"
  1442. style="width: 50px"
  1443. placeholder="请输入高"
  1444. />
  1445. </FormItem>
  1446. <FormItem
  1447. v-for="(process_detail, idx) in element.process"
  1448. :key="idx + '555' + element.part_id"
  1449. :label="process_detail.name + ':'"
  1450. v-show="
  1451. !element.is_metal &&
  1452. element.hide_process &&
  1453. !element.hide_process.filter(
  1454. (v) => process_all_list[v] == process_detail.name
  1455. ).length > 0
  1456. "
  1457. >
  1458. <Tooltip style="width: 120px" transfer>
  1459. <span slot="content">
  1460. <span
  1461. v-for="_item in process_detail.cld"
  1462. :key="_item.id + 'cld'"
  1463. v-show="_item.id == process_detail.value"
  1464. >{{ _item.title }}</span
  1465. >
  1466. </span>
  1467. <Select
  1468. style="width: 120px"
  1469. filterable
  1470. clearable
  1471. transfer
  1472. label-in-value
  1473. :disabled="isCheck"
  1474. @on-change="
  1475. (e) =>
  1476. handlePartProcessChange(
  1477. e,
  1478. idx,
  1479. element,
  1480. process_detail
  1481. )
  1482. "
  1483. v-model="process_detail.value"
  1484. size="small"
  1485. >
  1486. <Option
  1487. v-for="option of process_detail.cld"
  1488. :key="option.id + 'cld'"
  1489. :label="option.title"
  1490. :value="option.id"
  1491. ></Option>
  1492. </Select>
  1493. </Tooltip>
  1494. </FormItem>
  1495. <FormItem v-show="!element.is_metal">
  1496. <Button
  1497. @click="handlePartsApart(element, idx, modalData.part)"
  1498. type="primary"
  1499. v-show="!isCheck"
  1500. v-if="element.isBP"
  1501. style="margin-right: 5px"
  1502. size="small"
  1503. >拆分</Button
  1504. >
  1505. <Button
  1506. @click="handlePartsDele(element, idx, modalData.part)"
  1507. type="primary"
  1508. v-else
  1509. v-show="!isCheck"
  1510. style="margin-right: 5px"
  1511. size="small"
  1512. >删除</Button
  1513. >
  1514. <Button
  1515. @click="handlePartDetailEdit(element, idx)"
  1516. type="primary"
  1517. style="margin-right: 5px"
  1518. size="small"
  1519. >{{
  1520. element.isShowPartDetail
  1521. ? "收起"
  1522. : isCheck
  1523. ? "查看"
  1524. : "修改原材料"
  1525. }}</Button
  1526. >
  1527. </FormItem>
  1528. <div
  1529. :class="[
  1530. 'part_detail_form',
  1531. element.isShowPartDetail ? '' : 'hide_part_detail',
  1532. ]"
  1533. :data-index="idx"
  1534. >
  1535. <FormItem>
  1536. <div
  1537. v-for="(ele, idx) in element.part_detail"
  1538. :key="idx + '999'"
  1539. >
  1540. <Form :model="ele">
  1541. <FormItem>
  1542. <div style="width: 200px">
  1543. {{ ele.title || ele.part_detail_title }}
  1544. </div>
  1545. </FormItem>
  1546. <!-- <FormItem label="厚" :label-width="40">
  1547. <Input
  1548. size="small"
  1549. v-model="ele.long"
  1550. style="width: 80px"
  1551. placeholder="请输入厚"
  1552. />
  1553. </FormItem> -->
  1554. <!-- <FormItem label="宽" :label-width="40">
  1555. <Input
  1556. size="small"
  1557. v-model="ele.wide"
  1558. style="width: 80px"
  1559. placeholder="请输入宽"
  1560. />
  1561. </FormItem> -->
  1562. <!-- <FormItem label="高" :label-width="40">
  1563. <Input
  1564. size="small"
  1565. v-model="ele.high"
  1566. style="width: 80px"
  1567. placeholder="请输入高"
  1568. />
  1569. </FormItem> -->
  1570. <!-- <FormItem label="数量" :label-width="40">
  1571. <Input
  1572. size="small"
  1573. v-model="ele.num"
  1574. @on-change="(e) => handleSubpartNumChange(e, ele)"
  1575. style="width: 80px"
  1576. placeholder="请输入数量"
  1577. />
  1578. </FormItem> -->
  1579. <!-- 原材料 -->
  1580. <Form>
  1581. <FormItem>
  1582. <div style="width: 200px">
  1583. <!-- <Tooltip
  1584. :content="
  1585. ele.material_detail_title || '请选择'
  1586. "
  1587. > -->
  1588. {{ ele.material_detail_title || "请选择" }}
  1589. <!-- </Tooltip> -->
  1590. </div>
  1591. </FormItem>
  1592. <FormItem label="高" :label-width="40">
  1593. <Select
  1594. style="width: 80px"
  1595. filterable
  1596. clearable
  1597. transfer
  1598. :disabled="isCheck"
  1599. v-model="ele.material_detail_id"
  1600. @on-change="(e) => handleMaterialChange(e, ele)"
  1601. placeholder="请选择高"
  1602. size="small"
  1603. >
  1604. <Option
  1605. v-for="option of ele.material_detail_list"
  1606. :key="option.material_detail_id"
  1607. :label="option.long"
  1608. :value="option.material_detail_id"
  1609. ></Option>
  1610. </Select>
  1611. </FormItem>
  1612. <FormItem label="宽" :label-width="40">
  1613. <Select
  1614. style="width: 80px"
  1615. filterable
  1616. clearable
  1617. transfer
  1618. :disabled="isCheck"
  1619. v-model="ele.material_detail_id"
  1620. placeholder="请选择宽"
  1621. size="small"
  1622. >
  1623. <Option
  1624. v-for="option of ele.material_detail_list"
  1625. :key="option.material_detail_id"
  1626. :label="option.wide"
  1627. :value="option.material_detail_id"
  1628. ></Option>
  1629. </Select>
  1630. </FormItem>
  1631. <FormItem label="厚" :label-width="40">
  1632. <Select
  1633. style="width: 80px"
  1634. filterable
  1635. clearable
  1636. transfer
  1637. :disabled="isCheck"
  1638. v-model="ele.material_detail_id"
  1639. placeholder="请选择厚"
  1640. size="small"
  1641. >
  1642. <Option
  1643. v-for="option of ele.material_detail_list"
  1644. :key="option.material_detail_id"
  1645. :label="option.high"
  1646. :value="option.material_detail_id"
  1647. ></Option>
  1648. </Select>
  1649. </FormItem>
  1650. <FormItem label="数量" :label-width="40">
  1651. <Input
  1652. size="small"
  1653. :disabled="isCheck"
  1654. v-model="ele.material_detail_num"
  1655. style="width: 80px"
  1656. placeholder="请输入数量"
  1657. />
  1658. </FormItem>
  1659. </Form>
  1660. </Form>
  1661. </div>
  1662. </FormItem>
  1663. </div>
  1664. </Form>
  1665. </div>
  1666. </div>
  1667. <div class="modal_product_info">
  1668. <div class="modal_product_info_title">
  1669. 附加信息
  1670. <Button
  1671. @click="handleExtraAdd(modalData.extArray, 2)"
  1672. type="primary"
  1673. v-show="!isCheck"
  1674. size="small"
  1675. >新增附加项目</Button
  1676. >
  1677. </div>
  1678. <div class="modal_product_info_content modal_extra">
  1679. <Form
  1680. :model="element"
  1681. v-for="(element, idx) in modalData.extArray"
  1682. :key="element.id"
  1683. :label-width="80"
  1684. >
  1685. <FormItem label="附加项目:">
  1686. <Select
  1687. filterable
  1688. clearable
  1689. transfer
  1690. label-in-value
  1691. :disabled="isCheck"
  1692. size="small"
  1693. v-model="element.id"
  1694. @on-change="(e) => handleExtChange(element, e, modalData)"
  1695. style="width: 100px"
  1696. >
  1697. <Option
  1698. v-for="item of extList"
  1699. :key="item.id"
  1700. :label="item.title"
  1701. :value="item.id"
  1702. ></Option>
  1703. </Select>
  1704. </FormItem>
  1705. <FormItem label="数量:">
  1706. <Input
  1707. size="small"
  1708. :disabled="isCheck"
  1709. v-model="element.num"
  1710. @on-change="handleTotalPriceCalc(element, modalData)"
  1711. style="width: 100px"
  1712. placeholder="请输入数量"
  1713. />
  1714. </FormItem>
  1715. <FormItem label="单价:">
  1716. <Input
  1717. size="small"
  1718. :disabled="isCheck"
  1719. v-model="element.price"
  1720. @on-change="handleTotalPriceCalc(element, modalData)"
  1721. style="width: 100px"
  1722. placeholder="请输入单价"
  1723. />
  1724. </FormItem>
  1725. <FormItem label="金额:">
  1726. <Input
  1727. size="small"
  1728. :disabled="isCheck"
  1729. v-model="element.total_price"
  1730. @on-change="handleTotalPriceChange(element, modalData)"
  1731. style="width: 100px"
  1732. placeholder="请输入金额"
  1733. />
  1734. </FormItem>
  1735. <FormItem label="备注:">
  1736. <Input
  1737. size="small"
  1738. :disabled="isCheck"
  1739. v-model="element.remark"
  1740. style="width: 100px"
  1741. placeholder="请输入备注"
  1742. />
  1743. </FormItem>
  1744. <FormItem>
  1745. <a
  1746. v-show="!isCheck"
  1747. style="color: red"
  1748. @click="
  1749. handleExtraDele(
  1750. modalData.extArray,
  1751. element,
  1752. idx,
  1753. modalData
  1754. )
  1755. "
  1756. >删除</a
  1757. >
  1758. </FormItem>
  1759. </Form>
  1760. </div>
  1761. </div>
  1762. </TabPane>
  1763. </Tabs>
  1764. </div>
  1765. <div slot="footer">
  1766. <Button @click="cancelModal">取消</Button>
  1767. <Button
  1768. @click="handleEditProductSubmit"
  1769. v-show="!isCheck"
  1770. type="primary"
  1771. >确定</Button
  1772. >
  1773. </div>
  1774. </Modal>
  1775. <Modal
  1776. v-model="showForms"
  1777. @on-ok="postForms(1)"
  1778. class-name="vertical-center-modal"
  1779. style="max-height: 700px; overflow: hidden; overflow-y: auto"
  1780. title="表单设置"
  1781. >
  1782. <Table
  1783. :max-height="600"
  1784. border
  1785. :columns="formSetTableColumns"
  1786. :data="post_formSetTableData"
  1787. >
  1788. </Table>
  1789. </Modal>
  1790. </div>
  1791. </template>
  1792. <script>
  1793. export default {
  1794. beforeRouteLeave(to, from, next) {
  1795. if (this.type == 1 || this.type == 2) {
  1796. if (to.path != "/cms/ordermannage/businessorderlist/list") {
  1797. this.$Modal.confirm({
  1798. title: "提示",
  1799. content: "切换页面会导致数据丢失,是否确认切换?",
  1800. onOk: () => {
  1801. next(() => {});
  1802. },
  1803. onCancel: () => {},
  1804. });
  1805. } else {
  1806. if (this.isAllowLeave) {
  1807. next(() => {});
  1808. } else {
  1809. this.$Modal.confirm({
  1810. title: "提示",
  1811. content: "切换页面会导致数据丢失,是否确认切换?",
  1812. onOk: () => {
  1813. next(() => {});
  1814. },
  1815. onCancel: () => {},
  1816. });
  1817. }
  1818. }
  1819. } else {
  1820. next(() => {});
  1821. }
  1822. },
  1823. data() {
  1824. return {
  1825. currency_edit_index: null,
  1826. measure_total: [],
  1827. part_type_total: [],
  1828. tree_btn_show: false,
  1829. showForms: false,
  1830. forms_list: [],
  1831. type: 1,
  1832. order_no: this.$route.query.order_no,
  1833. modalArray: [],
  1834. modalData: {},
  1835. productList: [],
  1836. metalList: [],
  1837. extList: [],
  1838. coumstList: [],
  1839. tableWidth: null,
  1840. users: [],
  1841. lock_list: [],
  1842. headers: { Authorization: localStorage.getItem("token") },
  1843. uploadData: {
  1844. order_no: this.$route.query.order_no,
  1845. title: "",
  1846. },
  1847. title_state: 0,
  1848. clientList: [],
  1849. clientDetailList: [],
  1850. clientDetailList_mobile: [],
  1851. clientDetailList_respon: [],
  1852. clientDetailList_address: [],
  1853. tableData: [],
  1854. showEditProduct: false,
  1855. infoRules: {
  1856. residential_name: [{ required: true, message: " ", trigger: "blur" }],
  1857. warning_state: [{ required: true, message: " " }],
  1858. pay_state: [{ required: true, message: "" }],
  1859. predict_price: [{ required: true, message: " " }],
  1860. fax_price: [{ required: true, message: " " }],
  1861. order_price: [{ required: true, message: " " }],
  1862. custom_id: [{ required: true, message: " " }],
  1863. start_time: [{ required: true, message: " " }],
  1864. end_time: [{ required: true, message: " " }],
  1865. box_id: [{ required: true, message: " " }],
  1866. remark: [{ required: true, message: " " }],
  1867. },
  1868. info: {
  1869. residential_name: "", //项目名称
  1870. order_no: "", //订单号
  1871. client_name: "", //客户名称
  1872. address: "", //
  1873. mobile: "", //手机号
  1874. start_time: new Date().toLocaleDateString().replace(/\//g, "-"), //开始时间
  1875. end_time: "", //结束时间
  1876. pay_state: "", //是否支付
  1877. warning_state: 1, //是否紧急
  1878. predict_time: "", //预估交付日期
  1879. service_id: null, //业务员
  1880. predict_price: null, //预估工价,
  1881. predict_working: null, //预估工期
  1882. remark: "",
  1883. img: [],
  1884. front_money: 0,
  1885. },
  1886. process_match_list: [],
  1887. process_all_list: [
  1888. { id: 1, title: "材质" },
  1889. { id: 2, title: "颜色" },
  1890. { id: 3, title: "工艺" },
  1891. ],
  1892. img: [],
  1893. sub_material_list: [],
  1894. showCurrencyOnly: false,
  1895. options: {
  1896. disabledDate(date) {
  1897. return date && date.valueOf() < Date.now() - 86400000;
  1898. },
  1899. },
  1900. editForm: {},
  1901. is_material_show: false,
  1902. currencyIndex: null,
  1903. currentTabIndex: "0",
  1904. parts_title_count: [],
  1905. wood_title_count: [],
  1906. isCheck: false,
  1907. warningList: [],
  1908. originalTableColumns: [
  1909. { title: "原材料名称", align: "center", key: "title" },
  1910. { title: "原材料库存", align: "center", key: "stock" },
  1911. { title: "所需原材料数量", align: "center", key: "num" },
  1912. // { title: '原材料单价', align: 'center', key: 'price' },
  1913. {
  1914. title: "规格型号",
  1915. align: "center",
  1916. key: "specifications",
  1917. render: (h, params) => {
  1918. const { row } = params;
  1919. let text = "";
  1920. row.long ? (text += "L" + row.long + "*") : "";
  1921. row.wide ? (text += "W" + row.wide + "*") : "";
  1922. row.high ? (text += "H" + row.high + "*") : "";
  1923. text = text.substring(0, text.length - 1);
  1924. return h("span", {}, text);
  1925. },
  1926. },
  1927. { title: "原材料单位", align: "center", key: "unit" },
  1928. {
  1929. title: "原材料预估费用",
  1930. align: "center",
  1931. key: "total_price",
  1932. },
  1933. ],
  1934. originalData: [],
  1935. isAllowLeave: false,
  1936. pre_process_obj: {},
  1937. route_id_at_copy: "",
  1938. formSetTableColumns: [
  1939. {
  1940. title: "是否展示",
  1941. align: "center",
  1942. key: "is_show",
  1943. minWidth: 60,
  1944. render: (h, params) => {
  1945. const { index } = params;
  1946. const currentRow = JSON.parse(
  1947. JSON.stringify(this.post_formSetTableData[index])
  1948. );
  1949. return h("Checkbox", {
  1950. props: {
  1951. value: currentRow.is_show,
  1952. disabled:
  1953. currentRow.key == "order_no" ||
  1954. currentRow.key == "residential_name" ||
  1955. currentRow.key == "warning_state" ||
  1956. currentRow.key == "start_time" ||
  1957. currentRow.key == "end_time" ||
  1958. currentRow.key == "client_name" ||
  1959. currentRow.key == "predict_price" ||
  1960. currentRow.key == "box_id" ||
  1961. currentRow.key == "predict_price" ||
  1962. currentRow.key == "order_price" ||
  1963. currentRow.key == "fax_price" ||
  1964. currentRow.key == "remark",
  1965. },
  1966. on: {
  1967. "on-change": (e) => {
  1968. currentRow.is_show = e;
  1969. this.post_formSetTableData.splice(index, 1, currentRow);
  1970. },
  1971. },
  1972. });
  1973. },
  1974. },
  1975. {
  1976. title: "字段名",
  1977. align: "center",
  1978. key: "value",
  1979. minWidth: 100,
  1980. },
  1981. {
  1982. title: "展示名称",
  1983. align: "center",
  1984. key: "title",
  1985. minWidth: 100,
  1986. render: (h, params) => {
  1987. const { index } = params;
  1988. const currentRow = JSON.parse(
  1989. JSON.stringify(this.post_formSetTableData[index])
  1990. );
  1991. return h("Input", {
  1992. props: {
  1993. value: currentRow.title,
  1994. type: "text",
  1995. },
  1996. on: {
  1997. "on-change": (e) => {
  1998. currentRow.title = e.target.value;
  1999. this.post_formSetTableData.splice(index, 1, currentRow);
  2000. },
  2001. },
  2002. });
  2003. },
  2004. },
  2005. ],
  2006. formSetTableData: [
  2007. {
  2008. is_show: true,
  2009. key: "order_no",
  2010. value: "订单编号",
  2011. title: "订单编号",
  2012. },
  2013. {
  2014. is_show: true,
  2015. key: "residential_name",
  2016. value: "项目名称",
  2017. title: "项目名称",
  2018. },
  2019. {
  2020. is_show: true,
  2021. key: "warning_state",
  2022. value: "紧急程度",
  2023. title: "紧急程度",
  2024. },
  2025. {
  2026. is_show: true,
  2027. key: "front_money",
  2028. value: "项目定金",
  2029. title: "项目定金",
  2030. },
  2031. {
  2032. is_show: true,
  2033. key: "start_time",
  2034. value: "开始日期",
  2035. title: "开始日期",
  2036. },
  2037. {
  2038. is_show: true,
  2039. key: "client_name",
  2040. value: "客户名称",
  2041. title: "客户名称",
  2042. },
  2043. {
  2044. is_show: true,
  2045. key: "custom_detail_name",
  2046. value: "负责人",
  2047. title: "负责人",
  2048. },
  2049. {
  2050. is_show: true,
  2051. key: "custom_detail_mobile",
  2052. value: "手机号",
  2053. title: "手机号",
  2054. },
  2055. {
  2056. is_show: true,
  2057. key: "custom_detail_id",
  2058. value: "详细地址",
  2059. title: "详细地址",
  2060. },
  2061. {
  2062. is_show: true,
  2063. key: "service_id",
  2064. value: "专营业务员",
  2065. title: "专营业务员",
  2066. },
  2067. {
  2068. is_show: true,
  2069. key: "end_time",
  2070. value: "交付日期",
  2071. title: "交付日期",
  2072. },
  2073. {
  2074. is_show: true,
  2075. key: "predict_price",
  2076. value: "产品总价",
  2077. title: "产品总价",
  2078. },
  2079. {
  2080. is_show: true,
  2081. key: "order_price",
  2082. value: "订单金额",
  2083. title: "订单金额",
  2084. },
  2085. {
  2086. is_show: true,
  2087. key: "fax_price",
  2088. value: "折扣金额",
  2089. title: "折扣金额",
  2090. },
  2091. { is_show: true, key: "box_id", value: "包装", title: "包装" },
  2092. { is_show: true, key: "remark", value: "订单备注", title: "订单备注" },
  2093. ],
  2094. post_formSetTableData: [],
  2095. charge_list: [],
  2096. cus_list: [],
  2097. pre_bp_id: "",
  2098. support_remark: [],
  2099. bpp_list: [],
  2100. process_obj: [],
  2101. };
  2102. },
  2103. computed: {
  2104. predict_price_clac() {
  2105. let sum = 0;
  2106. return sum;
  2107. },
  2108. },
  2109. watch: {},
  2110. created() {
  2111. //获取部件分类
  2112. this.axios.get("/api/basics_parts_index").then((res) => {
  2113. this.part_type_total = res.data.data;
  2114. });
  2115. // 获取测量字段
  2116. this.axios.get("/api/basics_measure_index").then((res) => {
  2117. this.measure_total = res.data.data;
  2118. });
  2119. // 获取工艺属性
  2120. this.axios({
  2121. method: "get",
  2122. url: "/api/bpp_list",
  2123. }).then((res) => {
  2124. if (res.code == 200) {
  2125. this.bpp_list = res.data;
  2126. this.bpp_list.map((v) => {
  2127. this.process_obj.push({
  2128. ...v,
  2129. value: "",
  2130. });
  2131. });
  2132. }
  2133. });
  2134. // 获取负责人列表
  2135. this.axios.get("/api/support_service_name").then((res) => {
  2136. this.clientDetailList_respon = [];
  2137. res.data.map((item) => {
  2138. this.clientDetailList_respon.push({ service_name: item });
  2139. });
  2140. this.charge_list = JSON.parse(
  2141. JSON.stringify(this.clientDetailList_respon)
  2142. );
  2143. });
  2144. // 获取设置表单
  2145. this.get_forms();
  2146. // 获取紧急程度
  2147. this.axios.get("/api/warning_list").then((res) => {
  2148. (this.warningList = res.data.data),
  2149. (this.info.warning_state = this.warningList[0].id);
  2150. });
  2151. // 获取客户列表
  2152. this.axios.get("/api/custom_list").then((res) => {
  2153. this.cus_list = JSON.parse(JSON.stringify(res.data.data));
  2154. this.clientList = res.data.data;
  2155. });
  2156. // 获取五金列表
  2157. this.axios
  2158. .get("/api/material", { params: { sub_type_id: 5 } })
  2159. .then((res) => {
  2160. if (res.code == 200) {
  2161. this.metalList = res.data.data;
  2162. }
  2163. });
  2164. // 获取辅料列表
  2165. this.axios
  2166. .get("/api/material", { params: { sub_type_id: 4 } })
  2167. .then((res) => {
  2168. if (res.code == 200) {
  2169. this.sub_material_list = res.data.data;
  2170. }
  2171. });
  2172. // 获取附加列表
  2173. this.axios.get("/api/project_ext_list").then((res) => {
  2174. if (res.code == 200) {
  2175. this.extList = res.data.data;
  2176. }
  2177. });
  2178. let date1 = new Date();
  2179. let date2 = new Date();
  2180. date2.setDate(date1.getDate() + 30);
  2181. this.info.end_time = date2;
  2182. this.tableWidth = window.innerWidth - 300;
  2183. this.getUsers();
  2184. this.type = this.$route.query.type;
  2185. // this.axios("/api/order_get_forms").then((res) => {
  2186. // if (res.code == 200) {
  2187. // this.forms_list = res.data;
  2188. // this.postForms(0);
  2189. // }
  2190. // });
  2191. this.getCoumstList();
  2192. this.getLockList();
  2193. },
  2194. mounted() {
  2195. if (this.order_no) {
  2196. if (this.order_no) {
  2197. this.info = {};
  2198. }
  2199. this.initData(this.order_no);
  2200. }
  2201. this.getProducts();
  2202. addEventListener("resize", (e) => {
  2203. this.tableWidth = e.target.innerWidth - 300;
  2204. this.$forceUpdate();
  2205. });
  2206. },
  2207. methods: {
  2208. getSelectedLabel(value, list, valueProp = "value", labelField = "label") {
  2209. const item = list.find((item) => item[valueProp] === value);
  2210. return item ? item[labelField] : null;
  2211. },
  2212. get_forms() {
  2213. this.axios
  2214. .post("/api/update/get_table", { id: "businessorderlist_detail" })
  2215. .then((res) => {
  2216. if (Array.isArray(res.data)) {
  2217. this.post_formSetTableData = JSON.parse(
  2218. JSON.stringify(this.formSetTableData)
  2219. );
  2220. } else {
  2221. if (res.data.table.formSet && res.data.table.formSet.length > 0) {
  2222. this.formSetTableData = JSON.parse(
  2223. JSON.stringify(res.data.table.formSet)
  2224. );
  2225. this.post_formSetTableData = JSON.parse(
  2226. JSON.stringify(res.data.table.formSet)
  2227. );
  2228. } else {
  2229. this.post_formSetTableData = JSON.parse(
  2230. JSON.stringify(this.formSetTableData)
  2231. );
  2232. }
  2233. }
  2234. });
  2235. },
  2236. print() {
  2237. this.$router.push({
  2238. path: "/cms/ordermannage/businessorderlist/printlist",
  2239. query: {
  2240. order_no: this.$route.query.order_no,
  2241. box_id: this.info.box_id,
  2242. },
  2243. });
  2244. },
  2245. back() {
  2246. // this.$router.go(-1);
  2247. this.$router.push({
  2248. path: "/cms/ordermannage/businessorderlist/list",
  2249. });
  2250. },
  2251. postForms(n) {
  2252. this.post_formSetTableData.forEach((element, index) => {
  2253. element.sort = index;
  2254. });
  2255. this.axios({
  2256. method: "post",
  2257. url: "/api/update/table",
  2258. data: {
  2259. id: "businessorderlist_detail",
  2260. result: {
  2261. formSet: this.post_formSetTableData,
  2262. },
  2263. },
  2264. }).then((res) => {
  2265. if (res.code == 200) {
  2266. this.$Message.success(res.msg);
  2267. // this.initData(this.order_no);
  2268. this.get_forms();
  2269. }
  2270. });
  2271. },
  2272. postData() {
  2273. let sendData = JSON.parse(JSON.stringify(this.info));
  2274. // sendData.custom_detail_id = sendData.custom_id
  2275. let sendList = JSON.parse(JSON.stringify(this.tableData));
  2276. sendList.map((item) => {
  2277. delete item.part;
  2278. });
  2279. this.tableData.map((item, index) => {
  2280. item.part.map((it, idx) => {
  2281. if (!it.is_metal) {
  2282. if (!sendList[index].part) {
  2283. sendList[index].part = [];
  2284. }
  2285. sendList[index].part.push(it);
  2286. }
  2287. });
  2288. });
  2289. // sendList= this.tableData.filter(item)
  2290. sendList.map((element) => {
  2291. element.part.map((elem) => {
  2292. if (!elem.is_metal) {
  2293. // elem.part_detail = elem.sub_part;
  2294. if (!elem.part_detail) {
  2295. elem.part_detail = elem.sub_part;
  2296. }
  2297. elem.part_detail.map((el) => {
  2298. el.material_num = el.material_detail_num;
  2299. });
  2300. }
  2301. });
  2302. });
  2303. try {
  2304. sendData.start_time = new Date(sendData.start_time)
  2305. .toLocaleDateString()
  2306. .replace(/\//g, "-");
  2307. sendData.end_time = new Date(sendData.end_time)
  2308. .toLocaleDateString()
  2309. .replace(/\//g, "-");
  2310. } catch (e) {
  2311. console.log(e);
  2312. }
  2313. let params = { ...sendData, product: sendList, renovation_type: 2 };
  2314. this.axios.post("/api/order_save_new", params).then((res) => {
  2315. if (res.code == 200) {
  2316. this.$Message.success(res.msg);
  2317. this.isAllowLeave = true;
  2318. this.back();
  2319. }
  2320. });
  2321. },
  2322. // 表格位置选择
  2323. handleTablePositionChange(obj, $event) {
  2324. console.log("obj :>> ", obj);
  2325. console.log("$event :>> ", $event);
  2326. },
  2327. handleShowMaterial() {
  2328. this.is_material_show = !this.is_material_show;
  2329. },
  2330. initData(order_no) {
  2331. this.axios("/api/order_detail_new", { params: { order_no } }).then(
  2332. (res) => {
  2333. //获取产品
  2334. this.info = res.data;
  2335. this.info.img = this.info.imgs;
  2336. this.tableData = res.data.product_list;
  2337. this.support_remark = res.data.product_list[0].support_remark;
  2338. this.tableData.forEach((element) => {
  2339. for (const k in element.procedure_properties) {
  2340. const v = element.procedure_properties[k];
  2341. element[k] = v * 1;
  2342. }
  2343. // 数据第一次通过接口获取
  2344. element.get_first_data = true;
  2345. //保存用数据
  2346. element.other = element.customize;
  2347. element.process_str = element.process;
  2348. element.process_obj = JSON.parse(JSON.stringify(this.process_obj));
  2349. // 部件尺寸不展示字母
  2350. element.measurement_no_letter = JSON.parse(
  2351. JSON.stringify(element.measurement)
  2352. );
  2353. element.measure.map((v) => {
  2354. element.measurement_no_letter = element.measurement_no_letter.replace(
  2355. new RegExp(v.e_title, "g"),
  2356. ""
  2357. );
  2358. });
  2359. element.part.forEach((elem) => {
  2360. if (!elem.is_metal) {
  2361. // 表格数据展示字段
  2362. elem.process_str = elem.process;
  2363. elem.measurement = elem.measure;
  2364. elem.longCalc = elem.long;
  2365. elem.wideCalc = elem.wide;
  2366. elem.highCalc = elem.high;
  2367. let measure_arr = elem.measure.split("*");
  2368. elem.long = measure_arr[0];
  2369. elem.wide = measure_arr[1];
  2370. elem.high = measure_arr[2];
  2371. elem.part_detail = elem.sub_part;
  2372. elem.part_detail.map((_part_detail) => {
  2373. _part_detail.part_detail_option = [];
  2374. _part_detail.material_detail_list.map((v) => {
  2375. _part_detail.part_detail_option.push({
  2376. label: `${v.long}*${v.wide}*${v.high}`,
  2377. value: v.material_detail_id,
  2378. });
  2379. });
  2380. });
  2381. }
  2382. });
  2383. // 拆分测量字段
  2384. // let product_measure = element.measurement.split('*')
  2385. element.measure.forEach((elem) => {
  2386. element[elem.e_title] = elem.value;
  2387. });
  2388. // 拼五金展示用
  2389. if (element.ext_list && element.ext_list.length > 0) {
  2390. element.ext_list.map((elem) => {
  2391. if (elem.type == 1) {
  2392. elem.total_num = elem.num;
  2393. elem.unit_price = elem.price;
  2394. elem.ext_price = elem.num * elem.price;
  2395. elem.is_metal = true;
  2396. element.part.push(elem);
  2397. } else {
  2398. if (!element.extra) {
  2399. element.extra = "";
  2400. }
  2401. element.extra += `${elem.title}/`;
  2402. }
  2403. });
  2404. if (element.extra) {
  2405. element.extra = element.extra.substring(
  2406. 0,
  2407. element.extra.length - 1
  2408. );
  2409. }
  2410. }
  2411. });
  2412. this.forms_list = res.tableSet || [];
  2413. // 查看详情时获取原材料信息
  2414. this.originalData = res.data.material_list;
  2415. this.originalData.forEach((element) => {
  2416. element.total_price = (element.num * element.price).toFixed(2);
  2417. });
  2418. this.handleCalcCount();
  2419. //获取客户信息
  2420. this.axios
  2421. .get("/api/custom_detail", { params: { id: res.data.custom_id } })
  2422. .then((re) => {
  2423. this.clientDetailList = re.data.list;
  2424. const _temp = this.clientDetailList.filter(
  2425. (item) => item.id == res.data.custom_detail_id
  2426. );
  2427. this.info.custom_detail_name = _temp[0].service_name;
  2428. this.info.custom_detail_mobile = _temp[0].mobile;
  2429. // 去重负责人
  2430. this.clientDetailList_respon = this.unique(re.data.list);
  2431. // 取负责人名字
  2432. // 取出手机号码是该负责人的
  2433. this.clientDetailList_mobile = this.unique(re.data.list);
  2434. this.clientDetailList_mobile = this.clientDetailList.filter(
  2435. (item) => item.service_name == this.info.custom_detail_name
  2436. );
  2437. // 去重手机号码
  2438. this.clientDetailList_mobile = this.unique(
  2439. this.clientDetailList_mobile
  2440. );
  2441. // 取出地址是该负责人的
  2442. this.clientDetailList_address = this.clientDetailList.filter(
  2443. (item) => item.service_name == this.info.custom_detail_name
  2444. );
  2445. this.fax = re.data.detail.fax;
  2446. // 修改价格
  2447. let sum = 0;
  2448. this.tableData.forEach((element) => {
  2449. sum += element.price * 1;
  2450. });
  2451. this.info.service_id = re.data.detail.service_id;
  2452. this.info.predict_price = sum.toFixed(2);
  2453. this.info.order_price = (
  2454. (this.info.predict_price * this.fax) /
  2455. 100
  2456. ).toFixed(2);
  2457. this.info.fax_price = (
  2458. this.info.predict_price - this.info.order_price
  2459. ).toFixed(2);
  2460. this.$forceUpdate();
  2461. });
  2462. }
  2463. );
  2464. },
  2465. addHours(row) {
  2466. row.push({
  2467. unit: null,
  2468. layer: null,
  2469. number: null,
  2470. product: [{ product_id: "" }],
  2471. });
  2472. },
  2473. getProducts() {
  2474. this.axios("/api/product").then((res) => {
  2475. this.productList = res.data.data;
  2476. this.productList.map((v) => {
  2477. v.label = v.title;
  2478. v.value = v.id;
  2479. });
  2480. });
  2481. },
  2482. cancelModal() {
  2483. this.showEditProduct = false;
  2484. },
  2485. handleSubmit(name) {
  2486. this.$refs[name].validate((valid) => {
  2487. if (valid) {
  2488. this.postData();
  2489. }
  2490. });
  2491. },
  2492. handleEditProductSubmit() {
  2493. this.$Modal.confirm({
  2494. content: "请确认线条名称是否正确!",
  2495. onOk: () => {
  2496. const checkArr = this.modalData.part.filter((v) => {
  2497. return !v.change_id && !v.is_metal;
  2498. });
  2499. if (checkArr.length > 0) {
  2500. return this.$Message.warning("部件信息请填写完整!");
  2501. }
  2502. // 工艺属性
  2503. if (!this.modalData.procedure_properties_str) {
  2504. this.modalData.procedure_properties_str = [];
  2505. }
  2506. this.modalData.process_obj.forEach((elem, index) => {
  2507. const _temp = elem.cld.filter((item) => item.id == elem.value);
  2508. this.modalData.procedure_properties_str[index] =
  2509. _temp.length > 0 ? _temp[0].title : "";
  2510. });
  2511. this.modalData.process_str = this.modalData.procedure_properties_str.join(
  2512. "/"
  2513. );
  2514. // 尺寸
  2515. this.modalData.measure;
  2516. if (!this.modalData.measurement) {
  2517. this.modalData.measurement = "";
  2518. }
  2519. if (!this.modalData.measurement_no_letter) {
  2520. this.modalData.measurement_no_letter = "";
  2521. }
  2522. let tempStr = "";
  2523. let tempStr_no_letter = "";
  2524. this.modalData.measure.forEach((elem) => {
  2525. this.modalData[elem.e_title] = elem.value;
  2526. tempStr += elem.measureCalc + elem.value + "*";
  2527. tempStr_no_letter += elem.value + "*";
  2528. });
  2529. this.modalData.measurement = tempStr.substring(0, tempStr.length - 1);
  2530. this.modalData.measurement_no_letter = tempStr_no_letter.substring(
  2531. 0,
  2532. tempStr_no_letter.length - 1
  2533. );
  2534. // 五金、 附加项目
  2535. this.modalData.ext = [...this.modalData.extArray];
  2536. //其他项
  2537. this.modalData.other = this.modalData.customize;
  2538. // 部件字段
  2539. this.modalData.part.forEach((elem, idx) => {
  2540. if (!elem.is_metal) {
  2541. elem.title ? "" : (elem.title = elem.part_title);
  2542. // if (elem.procedure_properties_str && elem.procedure_properties_str != 0) {
  2543. // elem.process_str = elem.procedure_properties_str.join('/')
  2544. // } else {
  2545. elem.procedure_properties_str = [];
  2546. if (elem.process) {
  2547. elem.process.forEach((item, index) => {
  2548. const _temp = item.cld.filter(
  2549. (_cld) => _cld.id == item.value
  2550. );
  2551. elem.procedure_properties_str[index] =
  2552. _temp.length > 0 ? _temp[0].title : "";
  2553. });
  2554. elem.process_str = elem.procedure_properties_str.join("/");
  2555. elem.procedure_properties = {};
  2556. elem.process.map((item) => {
  2557. elem.procedure_properties[item.id] = item.value;
  2558. });
  2559. }
  2560. // }
  2561. } else {
  2562. this.modalData.part.splice(idx, 1);
  2563. }
  2564. });
  2565. this.modalData.extra = "";
  2566. this.modalData.extArray.map((item) => {
  2567. const temp = this.extList.filter((it) => it.id == item.ext_id);
  2568. temp && temp.length > 0 && (item.title = temp[0].title);
  2569. });
  2570. this.modalData.extra = this.modalData.extArray.reduce((pre, cur) => {
  2571. return pre + `${cur.title}/`;
  2572. }, "");
  2573. this.modalData.extra = this.modalData.extra.substring(
  2574. 0,
  2575. this.modalData.extra.length - 1
  2576. );
  2577. const _temp = this.productList.filter(
  2578. (item) => item.id == this.modalData.product_id
  2579. );
  2580. this.modalData.title = _temp[0].title;
  2581. this.tableData.splice(this.currencyIndex, 1, this.modalData);
  2582. this.route_id_at_copy = "";
  2583. // 合计 、 线条 统计价格
  2584. this.handleCalcCount();
  2585. this.showEditProduct = false;
  2586. this.$forceUpdate();
  2587. },
  2588. onCancel: () => {},
  2589. });
  2590. },
  2591. // 合计 、 线条 统计价格
  2592. handleCalcCount() {
  2593. let sum = 0;
  2594. this.parts_title_count = [];
  2595. this.wood_title_count = [];
  2596. let total_line_unit = "";
  2597. this.tableData.forEach((element) => {
  2598. sum += element.price * 1;
  2599. element.part.forEach((elem) => {
  2600. if (!elem.is_metal) {
  2601. // 统计部件
  2602. const temp = this.parts_title_count.filter(
  2603. (item) => item.title == elem.title
  2604. );
  2605. if (temp && temp.length > 0) {
  2606. this.parts_title_count.map((v) => {
  2607. v.title == elem.title && v.num++;
  2608. });
  2609. } else {
  2610. this.parts_title_count.push({
  2611. title: elem.title,
  2612. num: elem.num || 1,
  2613. unit: elem.unit,
  2614. });
  2615. }
  2616. // 如果没有点开产品详情的话找不到 part_detail
  2617. if (!elem.part_detail) {
  2618. elem.part_detail = elem.sub_part;
  2619. }
  2620. // 部件中要统计所有线条数量
  2621. elem.part_detail &&
  2622. elem.part_detail.length > 0 &&
  2623. elem.part_detail.forEach((el) => {
  2624. if (el.material_detail_title.indexOf("线条") != -1) {
  2625. const temp = this.wood_title_count.filter(
  2626. (item) => item.title == el.material_detail_title
  2627. );
  2628. if (temp && temp.length > 0) {
  2629. // 匹配规格是否已存在
  2630. const _temp = temp[0].measure_str.filter(
  2631. (item) => item.id == el.material_detail_id
  2632. );
  2633. if (_temp && _temp.length > 0) {
  2634. this.wood_title_count.map((v) => {
  2635. v.title == el.material_detail_title &&
  2636. v.measure_str.map((item) => {
  2637. if (item.id == el.material_detail_id) {
  2638. item.num =
  2639. item.num * 1 + el.material_detail_num * 1;
  2640. }
  2641. });
  2642. });
  2643. } else {
  2644. // 不存在一样规格
  2645. if (
  2646. el.material_detail_list &&
  2647. el.material_detail_list.length > 0
  2648. ) {
  2649. const __temp = el.material_detail_list.filter(
  2650. (item) =>
  2651. item.material_detail_id == el.material_detail_id
  2652. );
  2653. this.wood_title_count.map((v) => {
  2654. v.title == el.material_detail_title &&
  2655. ((v.unit = __temp[0].unit),
  2656. v.measure_str.push({
  2657. num: el.material_detail_num,
  2658. id: __temp[0].material_detail_id,
  2659. measure: `${__temp[0].long || 0}*${__temp[0]
  2660. .wide || 0}*${__temp[0].high || 0}`,
  2661. }));
  2662. });
  2663. } else {
  2664. this.wood_title_count.map((v) => {
  2665. v.title == el.material_detail_title &&
  2666. ((v.unit = el.unit),
  2667. v.measure_str.push({
  2668. num: el.material_detail_num,
  2669. id: el.material_detail_id,
  2670. measure: `${el.long || 0}*${el.wide ||
  2671. 0}*${el.high || 0}`,
  2672. }));
  2673. });
  2674. }
  2675. }
  2676. } else {
  2677. // 不存在就新增
  2678. if (
  2679. el.material_detail_list &&
  2680. el.material_detail_list.length > 0
  2681. ) {
  2682. const _temp = el.material_detail_list.filter(
  2683. (item) =>
  2684. item.material_detail_id == el.material_detail_id
  2685. );
  2686. if (_temp && _temp.length > 0) {
  2687. if (!total_line_unit) {
  2688. total_line_unit = _temp[0].unit;
  2689. }
  2690. this.wood_title_count.push({
  2691. title: el.material_detail_title,
  2692. unit: total_line_unit,
  2693. measure_str: [
  2694. {
  2695. num: el.material_detail_num,
  2696. id: _temp[0].material_detail_id,
  2697. measure: `${_temp[0].long || 0}*${_temp[0].wide ||
  2698. 0}*${_temp[0].high || 0}`,
  2699. unit: _temp[0].unit,
  2700. },
  2701. ],
  2702. });
  2703. }
  2704. } else {
  2705. if (!total_line_unit) {
  2706. total_line_unit = el.unit;
  2707. }
  2708. this.wood_title_count.push({
  2709. title: el.material_detail_title,
  2710. unit: total_line_unit,
  2711. measure_str: [
  2712. {
  2713. num: el.material_detail_num,
  2714. id: el.material_detail_id,
  2715. measure: `${el.long || 0}*${el.wide ||
  2716. 0}*${el.high || 0}`,
  2717. unit: el.unit,
  2718. },
  2719. ],
  2720. });
  2721. }
  2722. }
  2723. }
  2724. });
  2725. }
  2726. });
  2727. });
  2728. // 数线条
  2729. let total_line = 0;
  2730. this.wood_title_count.map((v) => {
  2731. v.measure_str.map((w) => {
  2732. total_line += w.num * 1;
  2733. });
  2734. });
  2735. // 线条合计放进统计
  2736. this.parts_title_count.push({
  2737. title: "线 条",
  2738. num: total_line,
  2739. unit: total_line_unit,
  2740. });
  2741. // 计算价格
  2742. this.info.predict_price = sum.toFixed(2);
  2743. this.info.order_price = (
  2744. (this.info.predict_price * this.fax) /
  2745. 100
  2746. ).toFixed(2);
  2747. this.info.fax_price = (
  2748. this.info.predict_price - this.info.order_price
  2749. ).toFixed(2);
  2750. },
  2751. getUsers() {
  2752. this.axios("/api/employee_list").then((res) => (this.users = res.data));
  2753. },
  2754. handleExtraAdd(array, type) {
  2755. array.push({
  2756. num: 0,
  2757. price: 0,
  2758. total_price: 0,
  2759. type,
  2760. remark: "",
  2761. title: "",
  2762. is_metal: true,
  2763. });
  2764. this.$forceUpdate();
  2765. },
  2766. handleExtraDele(array, row, index, modalData) {
  2767. array.splice(index, 1);
  2768. this.handleTotalPriceCalc(row, modalData);
  2769. this.$forceUpdate();
  2770. },
  2771. getCoumstList() {
  2772. this.axios("/api/bpp_list").then((res) => {
  2773. res.data.map((v) => {
  2774. if (v.select) {
  2775. v.cld.map((z) => {
  2776. v.select.map((k) => {
  2777. z.show = k == z.id ? true : false;
  2778. });
  2779. });
  2780. } else {
  2781. v.cld.map((v) => (v.show = false));
  2782. }
  2783. });
  2784. this.coumstList = res.data;
  2785. });
  2786. },
  2787. handleRemarkCreate(val) {
  2788. this.support_remark.push(val);
  2789. },
  2790. getLockList() {
  2791. this.axios("/api/lock_list").then((res) => (this.lock_list = res.data));
  2792. },
  2793. modalVisibleChange(e) {
  2794. if (!e) {
  2795. this.cancelModal();
  2796. }
  2797. },
  2798. unique(array) {
  2799. let arr = JSON.parse(JSON.stringify(array));
  2800. for (var i = 0; i < arr.length; i++) {
  2801. for (var j = i + 1; j < arr.length; j++) {
  2802. if (arr[i].service_name == arr[j].service_name) {
  2803. //第一个等同于第二个,splice方法删除第二个
  2804. arr.splice(j, 1);
  2805. j--;
  2806. }
  2807. }
  2808. }
  2809. return arr;
  2810. },
  2811. handleClientChange(id) {
  2812. if (id) {
  2813. this.axios({
  2814. method: "get",
  2815. url: "/api/custom_detail",
  2816. params: { id },
  2817. }).then((res) => {
  2818. this.info.custom_id = id;
  2819. this.clientDetailList = res.data.list;
  2820. // 去重负责人
  2821. this.clientDetailList_respon = this.unique(res.data.list);
  2822. // 赋值默认负责人
  2823. this.info.custom_detail_name = this.clientDetailList_respon[0].service_name;
  2824. // 取出手机号码是该负责人的
  2825. this.clientDetailList_mobile = this.clientDetailList.filter(
  2826. (item) => item.service_name == this.info.custom_detail_name
  2827. );
  2828. // 赋值默认手机号码
  2829. this.info.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
  2830. // 去重手机号码
  2831. this.clientDetailList_mobile = this.unique(
  2832. this.clientDetailList_mobile
  2833. );
  2834. // 取出地址是该负责人的
  2835. this.clientDetailList_address = this.clientDetailList.filter(
  2836. (item) => item.service_name == this.info.custom_detail_name
  2837. );
  2838. // 赋值默认地址
  2839. this.info.custom_detail_id = this.clientDetailList_respon[0].id || 0;
  2840. this.info.service_id = res.data.detail.service_id;
  2841. this.fax = res.data.detail.fax;
  2842. this.$forceUpdate();
  2843. });
  2844. } else {
  2845. this.clientDetailList_respon = JSON.parse(
  2846. JSON.stringify(this.charge_list)
  2847. );
  2848. this.clientList = JSON.parse(JSON.stringify(this.cus_list));
  2849. }
  2850. },
  2851. handleSpan({ row, column, rowIndex, columnIndex }) {
  2852. if (row.end) {
  2853. return [1, 6];
  2854. }
  2855. },
  2856. handleSummary({ columns, data }) {
  2857. const sums = {};
  2858. columns.forEach((column, index) => {
  2859. const key = column.key;
  2860. if (index === 0) {
  2861. sums[key] = {
  2862. key,
  2863. value: "合计",
  2864. };
  2865. return;
  2866. }
  2867. const values = data.map((item) => Number(item[key]));
  2868. if (!values.every((value) => isNaN(value))) {
  2869. const v = values.reduce((prev, curr) => {
  2870. const value = Number(curr);
  2871. if (!isNaN(value)) {
  2872. return prev + curr;
  2873. } else {
  2874. return prev;
  2875. }
  2876. }, 0);
  2877. sums[key] = {
  2878. key,
  2879. value: v,
  2880. };
  2881. } else {
  2882. sums[key] = {
  2883. key,
  2884. value: "",
  2885. };
  2886. }
  2887. });
  2888. return sums;
  2889. },
  2890. handleMetalChange(e, row, n, arr) {
  2891. arr[n].ext_id = e.value;
  2892. arr[n].title = e.label;
  2893. },
  2894. handleClientChargeChange(value) {
  2895. if (value) {
  2896. // if (this.info.custom_id) {
  2897. // this.info.custom_detail_name = value;
  2898. // // 取出手机号码是该负责人的
  2899. // this.clientDetailList_mobile = this.clientDetailList.filter(
  2900. // (item) => item.service_name == this.info.custom_detail_name
  2901. // );
  2902. // // 赋值默认手机号码
  2903. // this.info.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
  2904. // // 去重手机号码
  2905. // this.clientDetailList_mobile = this.unique(
  2906. // this.clientDetailList_mobile
  2907. // );
  2908. // // 取出地址是该负责人的
  2909. // this.clientDetailList_address = this.clientDetailList.filter(
  2910. // (item) => item.service_name == this.info.custom_detail_name
  2911. // );
  2912. // // 赋值默认地址
  2913. // this.info.custom_detail_id = this.clientDetailList_address[0].id || 0;
  2914. // } else {
  2915. this.axios
  2916. .get("/api/support_custom_for_service", {
  2917. params: { name: this.info.custom_detail_name },
  2918. })
  2919. .then((res) => {
  2920. this.clientList = res.data.data;
  2921. this.info.custom_id = res.data.data[0].id;
  2922. this.axios({
  2923. method: "get",
  2924. url: "/api/custom_detail",
  2925. params: { id: res.data.data[0].id },
  2926. }).then((re) => {
  2927. this.clientDetailList = re.data.list;
  2928. // 取出手机号码是该负责人的
  2929. this.clientDetailList_mobile = this.clientDetailList.filter(
  2930. (item) => item.service_name == value
  2931. );
  2932. // 赋值默认手机号码
  2933. this.info.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
  2934. // 去重手机号码
  2935. this.clientDetailList_mobile = this.unique(
  2936. this.clientDetailList_mobile
  2937. );
  2938. // 取出地址是该负责人的
  2939. this.clientDetailList_address = this.clientDetailList.filter(
  2940. (item) => item.service_name == value
  2941. );
  2942. // 赋值默认地址
  2943. this.info.custom_detail_id =
  2944. this.clientDetailList_address[0].id || 0;
  2945. this.info.service_id = re.data.detail.service_id;
  2946. this.fax = re.data.detail.fax;
  2947. });
  2948. });
  2949. // }
  2950. } else {
  2951. this.info.custom_detail_mobile = "";
  2952. this.info.custom_detail_id = "";
  2953. this.info.service_id = "";
  2954. this.clientDetailList_respon = JSON.parse(
  2955. JSON.stringify(this.charge_list)
  2956. );
  2957. this.clientList = JSON.parse(JSON.stringify(this.cus_list));
  2958. }
  2959. },
  2960. handleClientDetailChange(value) {
  2961. if (value) {
  2962. // this.clientDetailList_mobile = this.clientDetailList.filter(
  2963. // (item) => item.service_name == this.info.custom_detail_name
  2964. // );
  2965. this.info.custom_detail_id = value;
  2966. // this.info.address = row[0].address;
  2967. // this.info.address = row[0].address;
  2968. // this.info.mobile = row[0].mobile;
  2969. this.$forceUpdate();
  2970. }
  2971. },
  2972. getEditData(modalData, curData) {
  2973. console.log("modalData :>> ", modalData);
  2974. console.log("curData :>> ", curData);
  2975. modalData.ext_price = curData.ext_price * 1 || 0;
  2976. modalData.model = curData.model;
  2977. modalData.num = curData.num || 1;
  2978. modalData.num_temp_save = modalData.num;
  2979. modalData.over_price = curData.over_price * 1 || 0;
  2980. modalData.position = curData.position;
  2981. modalData.price = curData.price;
  2982. modalData.product_id = curData.product_id;
  2983. modalData.remark = curData.remark;
  2984. modalData.route_id = curData.route_id;
  2985. modalData.total_num = curData.total_num;
  2986. modalData.unit = curData.unit;
  2987. modalData.unit_price = curData.unit_price * 1 || 0;
  2988. modalData.url_number = curData.url_number;
  2989. modalData.extArray = [];
  2990. // 金额=(产品单价)*核算数量+超标金额+附加金额
  2991. modalData.price =
  2992. (modalData.unit_price * 1 || 0) * (modalData.num * 1 || 1) +
  2993. (modalData.over_price * 1 || 0) +
  2994. (modalData.ext_price * 1 || 0);
  2995. modalData.price = modalData.price.toFixed(2);
  2996. // 获取产品 type_name
  2997. const temprow = this.productList.filter(
  2998. (item) => item.id == curData.product_id
  2999. );
  3000. modalData.type_name = temprow[0].title;
  3001. // 获取工艺属性
  3002. // 如果route_id是0,工艺属性值取procedure_properties
  3003. if (modalData.route_id == 0) {
  3004. modalData.process_obj.map((v) => {
  3005. v.value = modalData.procedure_properties[v.id] * 1;
  3006. });
  3007. } else {
  3008. this.process_match_list.forEach((element) => {
  3009. if (element.id == curData.route_id) {
  3010. modalData.process_ids = element.detail;
  3011. }
  3012. });
  3013. modalData.process_obj.forEach((element) => {
  3014. //赋值测量字段
  3015. for (const key in modalData.process_ids) {
  3016. const ele = modalData.process_ids[key];
  3017. if (element.id == key) {
  3018. element.value = ele * 1;
  3019. }
  3020. }
  3021. });
  3022. }
  3023. // 产品测量字段
  3024. let product_measure = curData.measurement.split("*");
  3025. for (let index = 0; index < product_measure.length; index++) {
  3026. const item = product_measure[index];
  3027. const product_measure_detail = [
  3028. item.substring(0, 1),
  3029. item.substring(1),
  3030. ];
  3031. modalData.measure.forEach((element) => {
  3032. if (element.measureCalc == product_measure_detail[0]) {
  3033. element.value = product_measure_detail[1];
  3034. }
  3035. });
  3036. }
  3037. // 拆分五金、附加信息
  3038. if (!curData.ext) {
  3039. curData.ext = curData.ext_list;
  3040. }
  3041. curData.ext.forEach((element) => {
  3042. element.type == 2 && modalData.extArray.push(element);
  3043. });
  3044. modalData.extArray.forEach((element) => {
  3045. element.id = element.ext_id;
  3046. element.total_price = (element.price * element.num).toFixed(2);
  3047. });
  3048. // 同步 curData 、 modalData
  3049. curData.part.map((ele, idx) => {
  3050. //判断是否存在
  3051. if (modalData.part[idx]) {
  3052. //判断是否相等
  3053. if (modalData.part[idx].part_id != ele.part_id) {
  3054. //不相等情况1,是否为替换项
  3055. /////
  3056. //不相等情况2,是否为另一部件
  3057. // if (
  3058. // modalData.part[idx].change.filter(v=>v.id==ele.id).length>0
  3059. // ) {
  3060. modalData.part.splice(
  3061. idx,
  3062. 0,
  3063. JSON.parse(JSON.stringify(modalData.part[idx - 1]))
  3064. );
  3065. // }
  3066. }
  3067. } else {
  3068. modalData.part.splice(
  3069. idx,
  3070. 0,
  3071. JSON.parse(JSON.stringify(modalData.part[idx - 1]))
  3072. );
  3073. }
  3074. });
  3075. // 处理部件
  3076. curData.part.forEach((element, index) => {
  3077. if (!element.is_metal) {
  3078. console.log("element :>> ", element);
  3079. console.log("element.change_id :>> ", element.change_id);
  3080. modalData.part[index].change_id = element.change_id;
  3081. modalData.part[index].part_title = element.part_title;
  3082. modalData.part[index].org_part_id = modalData.part[index].part_id;
  3083. // 部件测量字段
  3084. if (element.measure && element.measure.length > 0) {
  3085. const part_measure_detail = element.measure.split("*");
  3086. modalData.part[index].long = part_measure_detail[0];
  3087. modalData.part[index].wide = part_measure_detail[1];
  3088. modalData.part[index].high = part_measure_detail[2];
  3089. }
  3090. // 替换项相关 如果选了替换项
  3091. if (element.part_id != modalData.part[index].part_id) {
  3092. const change_obj = modalData.part[index].change.filter(
  3093. (item) => item.part_id == element.part_id
  3094. );
  3095. if (change_obj && change_obj.length > 0) {
  3096. change_obj[0].sub_part.forEach((elem, idx) => {
  3097. modalData.part[index].part_detail[idx].material_detail_title =
  3098. elem.material_detail_list[0].title;
  3099. modalData.part[index].part_detail[idx].material_detail_id =
  3100. elem.material_detail_id;
  3101. modalData.part[index].part_detail[idx].material_detail_list =
  3102. elem.material_detail_list;
  3103. });
  3104. }
  3105. }
  3106. element.sub_part.forEach((elem, idx) => {
  3107. // 零部件字段 、 原材料字段
  3108. modalData.part[index].part_detail[idx].long = elem.long;
  3109. modalData.part[index].part_detail[idx].wide = elem.wide;
  3110. modalData.part[index].part_detail[idx].high = elem.high;
  3111. modalData.part[index].part_detail[idx].material_detail_id =
  3112. elem.material_detail_id;
  3113. modalData.part[index].part_detail[idx].material_detail_num =
  3114. elem.material_detail_num;
  3115. modalData.part[index].part_detail[idx].material_id =
  3116. elem.material_id;
  3117. modalData.part[index].part_detail[idx].num = elem.num;
  3118. });
  3119. modalData.part[index].part_id = element.part_id;
  3120. // // 工艺属性
  3121. // modalData.part[index].procedure_properties = JSON.parse(
  3122. // JSON.stringify(element.process)
  3123. // );
  3124. for (const k in element.process) {
  3125. const v = element.process[k];
  3126. modalData.part[index].process.map((ele) => {
  3127. if (ele.id == k) {
  3128. ele.value = v;
  3129. }
  3130. });
  3131. }
  3132. }
  3133. });
  3134. },
  3135. handleShowAddProductModal(custom_id, route_id_at_copy) {
  3136. this.$addProduct({
  3137. custom_id,
  3138. route_id_at_copy,
  3139. then: (subAddProductData) => {
  3140. console.log("subAddProductData :>> ", subAddProductData);
  3141. this.modalArray = subAddProductData;
  3142. this.modalArray.map((element) => {
  3143. // 工艺属性
  3144. if (!element.procedure_properties_str) {
  3145. element.procedure_properties_str = [];
  3146. }
  3147. if (!element.procedure_properties) {
  3148. element.procedure_properties = {};
  3149. }
  3150. element.process_obj.forEach((elem, index) => {
  3151. const _temp = elem.cld.filter((item) => item.id == elem.value);
  3152. element.procedure_properties_str[index] =
  3153. _temp.length > 0 ? _temp[0].title : "";
  3154. element.procedure_properties[elem.id] =
  3155. _temp.length > 0 ? _temp[0].id : "";
  3156. });
  3157. element.process_str = element.procedure_properties_str.join("/");
  3158. // 尺寸
  3159. if (!element.measurement) {
  3160. element.measurement = "";
  3161. }
  3162. if (!element.measurement_no_letter) {
  3163. element.measurement_no_letter = "";
  3164. }
  3165. let tempStr = "";
  3166. let tempStr_no_letter = "";
  3167. element.measure.forEach((elem) => {
  3168. tempStr += elem.measureCalc + elem.value + "*";
  3169. tempStr_no_letter += +elem.value + "*";
  3170. //为了表格上展示,拆解赋值到产品上
  3171. element[elem.e_title] = elem.value;
  3172. });
  3173. element.measurement = tempStr.substring(0, tempStr.length - 1);
  3174. element.measurement_no_letter = tempStr_no_letter.substring(
  3175. 0,
  3176. tempStr_no_letter.length - 1
  3177. );
  3178. // 五金、 附加项目
  3179. element.ext = [...element.extArray];
  3180. //其他项
  3181. element.other = element.customize;
  3182. // 部件字段
  3183. element.part.forEach((elem) => {
  3184. if (!elem.is_metal) {
  3185. elem.title ? "" : (elem.title = elem.part_title);
  3186. elem.procedure_properties_str = [];
  3187. elem.process.forEach((item, index) => {
  3188. const _temp = item.cld.filter(
  3189. (_cld) => _cld.id == item.value
  3190. );
  3191. elem.procedure_properties_str[index] =
  3192. _temp.length > 0 ? _temp[0].title : "";
  3193. });
  3194. elem.process_str = elem.procedure_properties_str.join("/");
  3195. // }
  3196. }
  3197. });
  3198. element.ext &&
  3199. element.ext.length > 0 &&
  3200. (element.ext.map((elem) => {
  3201. if (elem.type == 1) {
  3202. elem.total_num = elem.num;
  3203. elem.unit_price = elem.price;
  3204. elem.ext_price = elem.num * elem.price;
  3205. elem.is_metal = true;
  3206. element.part.push(elem);
  3207. if (!element.extra) {
  3208. element.extra = "";
  3209. }
  3210. } else {
  3211. if (!element.extra) {
  3212. element.extra = "";
  3213. }
  3214. element.extra += `${elem.title}/`;
  3215. }
  3216. }),
  3217. (element.extra = element.extra.substring(
  3218. 0,
  3219. element.extra.length - 1
  3220. )));
  3221. });
  3222. this.modalArray.forEach((element) => {
  3223. element.part.forEach((elem) => {
  3224. if (!elem.is_metal) {
  3225. elem.measurement = `${elem.long}*${elem.wide}*${elem.high}`;
  3226. elem.title = elem.part_title;
  3227. elem.procedure_properties = {};
  3228. elem.process.map((item) => {
  3229. elem.procedure_properties[item.id] = item.value;
  3230. });
  3231. }
  3232. });
  3233. });
  3234. this.tableData = [...this.tableData, ...this.modalArray];
  3235. this.currencyIndex = null;
  3236. this.route_id_at_copy = "";
  3237. // 合计 、 线条 统计价格
  3238. this.handleCalcCount();
  3239. this.showAddProduct = false;
  3240. this.$forceUpdate();
  3241. },
  3242. });
  3243. },
  3244. handleShowEditProductModal(custom_id, route_id_at_copyrow) {},
  3245. handleSet(row, index, type) {
  3246. console.log("row :>> ", row);
  3247. let obj;
  3248. // 1 新增 2 编辑 3 删除 4复制 5详情
  3249. switch (type) {
  3250. case 1:
  3251. this.title_state = 1;
  3252. if (this.info.custom_id) {
  3253. this.currentTabIndex = "0";
  3254. // this.showAddProduct = true;
  3255. this.handleShowAddProductModal(
  3256. this.info.custom_id,
  3257. this.route_id_at_copy
  3258. );
  3259. } else {
  3260. this.$Message.warning("请先选择客户");
  3261. }
  3262. break;
  3263. case 2:
  3264. this.title_state = 2;
  3265. this.isCheck = false;
  3266. if (this.type == 1) {
  3267. console.log("1 :>> ", 1);
  3268. this.showEditProduct = true;
  3269. this.modalData = JSON.parse(JSON.stringify(row));
  3270. this.currencyIndex = index;
  3271. } else if (this.type == 2) {
  3272. console.log("2 :>> ", 2);
  3273. //订单编辑点产品编辑
  3274. if (row.get_first_data && !row.isEdit) {
  3275. this.axios
  3276. .get("/api/order_product_detail_new", {
  3277. params: { order_product_id: row.order_product_id },
  3278. })
  3279. .then((res) => {
  3280. if (res.code == 200) {
  3281. this.currencyIndex = index;
  3282. this.modalData = JSON.parse(JSON.stringify(row));
  3283. this.editForm = res.data;
  3284. this.changeProductOnEdit(res.data, 0);
  3285. }
  3286. });
  3287. } else {
  3288. console.log("3 :>> ", 3);
  3289. // 订单新增点产品编辑
  3290. if (row.isEdit) {
  3291. row.measure.map((v) => {
  3292. v.value = row[v.e_title];
  3293. });
  3294. row.process_obj.map((v) => {
  3295. v.title = v.name;
  3296. v.value = row[v.id];
  3297. });
  3298. }
  3299. this.modalData = JSON.parse(JSON.stringify(row));
  3300. console.log("this.modalData :>> ", this.modalData);
  3301. this.currencyIndex = index;
  3302. this.showEditProduct = true;
  3303. }
  3304. }
  3305. break;
  3306. case 3:
  3307. this.tableData.splice(index, 1);
  3308. this.handleCalcCount();
  3309. break;
  3310. case 4:
  3311. obj = JSON.parse(JSON.stringify(row));
  3312. this.route_id_at_copy = row.route_id;
  3313. obj.index = obj.index + 1;
  3314. this.handleSetCopyId(obj, "_XID");
  3315. this.tableData.splice(index, 0, obj);
  3316. this.handleCalcCount();
  3317. break;
  3318. case 5:
  3319. this.title_state = 3;
  3320. this.isCheck = true;
  3321. if (row.get_first_data) {
  3322. this.axios
  3323. .get("/api/order_product_detail_new", {
  3324. params: { order_product_id: row.order_product_id },
  3325. })
  3326. .then((res) => {
  3327. if (res.code == 200) {
  3328. this.currencyIndex = index;
  3329. this.modalData = JSON.parse(JSON.stringify(row));
  3330. this.editForm = res.data;
  3331. this.changeProductOnEdit(res.data, 0);
  3332. }
  3333. });
  3334. } else {
  3335. this.modalData = JSON.parse(JSON.stringify(row));
  3336. this.currencyIndex = index;
  3337. this.showEditProduct = true;
  3338. }
  3339. break;
  3340. }
  3341. },
  3342. handleSetCopyId(obj, key) {
  3343. // 浅拷贝,不需要返回
  3344. const temp = obj[key].split("_");
  3345. temp[1]++;
  3346. obj[key] = temp.join("_");
  3347. },
  3348. async handleBeforeUpload(row) {
  3349. // row.name
  3350. this.uploadData.title = row.name.substring(0, row.name.indexOf("."));
  3351. return true;
  3352. },
  3353. uploadError(err) {
  3354. this.$Message.error(err.msg || "上传失败");
  3355. },
  3356. onProgress(e) {
  3357. console.log(e);
  3358. },
  3359. //导入成功
  3360. uploadSuccess(res) {
  3361. if (res.code == 200) {
  3362. this.$Message.success(res.msg || "上传成功");
  3363. // const temp = res.data;
  3364. // let list = [...this.postInfo.children, ...temp];
  3365. } else {
  3366. this.$Message.warning(res.msg || "上传失败");
  3367. }
  3368. },
  3369. handleExtChange(row, { value, label }, item) {
  3370. row.ext_id = value;
  3371. row.title = label;
  3372. const element = this.extList.filter((item) => item.id == value);
  3373. row.num = element[0].num;
  3374. row.price = element[0].price;
  3375. row.total_price = (row.num * row.price).toFixed(2);
  3376. this.handleTotalPriceCalc(row, item);
  3377. },
  3378. handleSameProcessDisabled(array, currencyChooseValue, currencyChooseIndex) {
  3379. let matchIds = array.selected_ids;
  3380. let target = array.same_process;
  3381. let source = array.same_process_compare;
  3382. let chooseable = [];
  3383. source.forEach((element, index) => {
  3384. element.forEach((elem, idx) => {
  3385. if (elem.id == currencyChooseValue) {
  3386. chooseable = [...chooseable, ...element];
  3387. }
  3388. });
  3389. });
  3390. target.forEach((element) => {
  3391. element.option.forEach((elem) => {
  3392. elem.isAllowSelect = true;
  3393. chooseable.forEach((el) => {
  3394. if (el.id == elem.id) {
  3395. elem.isAllowSelect = false;
  3396. }
  3397. });
  3398. });
  3399. });
  3400. this.$forceUpdate();
  3401. },
  3402. changeLock(value, row, idx) {
  3403. if (row.old_lock_price) {
  3404. row.price = parseInt(row.price) - row.old_lock_price;
  3405. }
  3406. row.old_lock_price = parseInt(value.tag || "0");
  3407. row.price = parseInt(row.price) + parseInt(value.tag || "0");
  3408. this.modalArray[idx] = row;
  3409. this.$forceUpdate();
  3410. },
  3411. handleTotalPriceChange(row, item) {
  3412. row.price = (row.total_price / (row.num == 0 ? 1 : row.num)).toFixed(2);
  3413. let sum = 0;
  3414. item.extArray.map((v) => {
  3415. return (sum += v.total_price * 1);
  3416. });
  3417. item.ext_price = sum;
  3418. item.price =
  3419. (item.unit_price * 1 || 0) * (item.num * 1 || 1) +
  3420. (item.over_price * 1 || 0) +
  3421. (item.ext_price * 1 || 0);
  3422. item.price = item.price.toFixed(2);
  3423. this.$forceUpdate();
  3424. },
  3425. handleTotalPriceCalc(row, item) {
  3426. row.total_price = ((row.price || 0) * (row.num || 0)).toFixed(2);
  3427. let sum2 = 0;
  3428. item.extArray &&
  3429. item.extArray.length > 0 &&
  3430. item.extArray.forEach((element) => {
  3431. sum2 += element.total_price * 1 || 0;
  3432. });
  3433. item.ext_price = sum2 * 1;
  3434. item.price =
  3435. (item.unit_price * 1 || 0) * (item.num * 1 || 1) +
  3436. (item.over_price * 1 || 0) +
  3437. (item.ext_price * 1 || 0);
  3438. item.price = item.price.toFixed(2);
  3439. this.$forceUpdate();
  3440. },
  3441. handlePartDetailEdit(element, index) {
  3442. element.isShowPartDetail = !element.isShowPartDetail;
  3443. this.$forceUpdate();
  3444. },
  3445. handlePartsApart(element, index, array) {
  3446. let obj = JSON.parse(JSON.stringify(element));
  3447. obj.isBP = false;
  3448. array.splice(index + 1, 0, obj);
  3449. this.$forceUpdate();
  3450. },
  3451. handlePartsDele(element, index, array) {
  3452. array.splice(index, 1);
  3453. this.handleCalcCount();
  3454. this.$forceUpdate();
  3455. },
  3456. handleProductPositionChange(item, e) {
  3457. item.position = e.target.value;
  3458. this.$forceUpdate();
  3459. },
  3460. handleOrderPriceChange(e, info) {
  3461. this.info.order_price = e.target.value;
  3462. this.info.fax_price = (this.info.predict_price - e.target.value).toFixed(
  3463. 2
  3464. );
  3465. this.$forceUpdate();
  3466. },
  3467. handleClearExtInfo(modalData, pre_id, cur_id) {
  3468. if (cur_id != pre_id) {
  3469. modalData.extArray = [];
  3470. } else {
  3471. let sum = 0;
  3472. modalData.extArray.map((v) => {
  3473. return (sum += v.total_price * 1);
  3474. });
  3475. modalData.ext_price = sum;
  3476. modalData.price =
  3477. (modalData.unit_price * 1 || 0) * (modalData.num * 1 || 1) +
  3478. (modalData.over_price * 1 || 0) +
  3479. (modalData.ext_price * 1 || 0);
  3480. modalData.price = modalData.price.toFixed(2);
  3481. }
  3482. this.pre_bp_id = cur_id;
  3483. },
  3484. changeEditProcess(row, obj) {
  3485. row.isEdit = true;
  3486. row.procedure_properties[obj.id] = row[obj.id];
  3487. row.process_obj.filter((v) => v.id == obj.id)[0].value = row[obj.id];
  3488. },
  3489. changeEditMeasure(e, row, measure) {
  3490. row.isEdit = true;
  3491. console.log("e :>> ", e);
  3492. console.log("row :>> ", row);
  3493. console.log("measure :>> ", measure);
  3494. this.handleProductMeasureChange(e, row, measure);
  3495. },
  3496. changeEditPart(row, part_type) {
  3497. row.isEdit = true;
  3498. console.log("row :>> ", row);
  3499. },
  3500. changeEditTableData(row, rowIndex, $event, scope) {
  3501. if ($event) {
  3502. let id = $event.value;
  3503. row.type_name = $event.label;
  3504. row.title = $event.label;
  3505. //被编辑过了 标记
  3506. row.isEdit = true;
  3507. this.axios("/api/order_get_product_detail_new", {
  3508. params: { product_id: id, custom_id: this.info.custom_id },
  3509. }).then((res) => {
  3510. this.process_match_list = res.data.process.list;
  3511. this.process_all_list = res.data.process_list;
  3512. this.support_remark = res.data.support_remark;
  3513. this.bpp_list.map((v) => (row[v.id] = ""));
  3514. row.url = res.data.url;
  3515. row.total_num = res.data.total_num || 1;
  3516. row.ext_price = res.data.ext_price || 0;
  3517. row.unit_price = res.data.price || 0;
  3518. row.num = res.data.num || 1;
  3519. row.over_price = res.data.over_price || 0;
  3520. row.position = res.data.position || "";
  3521. row.unit = res.data.unit || "";
  3522. row.remark = res.data.remark || "";
  3523. row.url_number = res.data.url_number || "";
  3524. row.overdraft = res.data.overdraft;
  3525. row.num_formula = res.data.num_formula;
  3526. row.bp_id = res.data.bp_id;
  3527. // 金额=(产品单价)*核算数量 +附加金额 + 超标金额
  3528. row.price =
  3529. (row.unit_price * 1 || 0) * (row.num * 1 || 1) +
  3530. (row.over_price * 1 || 0) +
  3531. (row.ext_price * 1 || 0);
  3532. row.price = row.price.toFixed(2);
  3533. row.selected_ids = [];
  3534. // row.part = [];
  3535. // row.part = res.data.part;
  3536. res.data.part.forEach((element, index) => {
  3537. // 选择不是附加项目的,
  3538. if (!element.is_metal) {
  3539. // 选择不是线条、或者基础档案中要默认为空的部件
  3540. element.isBP = true;
  3541. element.isChoosed = true;
  3542. element.title = element.part_title;
  3543. if (element.is_null == 1) {
  3544. element.change_id = "";
  3545. } else {
  3546. element.part_detail = element.sub_part;
  3547. //展示非拆分部件
  3548. // 默认替换部件
  3549. element.change_id = element.change[0].id;
  3550. //存计算公式
  3551. element.long ? "" : (element.long = 0);
  3552. element.wide ? "" : (element.wide = 0);
  3553. element.high ? "" : (element.high = 0);
  3554. element.longCalc = element.long + "";
  3555. element.wideCalc = element.wide + "";
  3556. element.highCalc = element.high + "";
  3557. element.part_detail.forEach((elem) => {
  3558. elem.material_detail_title =
  3559. elem.material_detail_list[0].title;
  3560. elem.material_detail_id =
  3561. elem.material_detail_list[0].material_detail_id;
  3562. elem.part_detail_option = [];
  3563. elem.material_detail_list.map((v) => {
  3564. elem.part_detail_option.push({
  3565. label: `${v.long}*${v.wide}*${v.high}`,
  3566. value: v.material_detail_id,
  3567. });
  3568. });
  3569. elem.org_num = elem.num;
  3570. elem.material_detail_org_num = elem.num || 0;
  3571. elem.material_detail_num = elem.num || 0;
  3572. elem.long ? "" : (elem.long = 0);
  3573. elem.wide ? "" : (elem.wide = 0);
  3574. elem.high ? "" : (elem.high = 0);
  3575. elem.longCalc = elem.long + "";
  3576. elem.wideCalc = elem.wide + "";
  3577. elem.highCalc = elem.high + "";
  3578. elem.material_detail_list.forEach((el) => {
  3579. el.long = el.long || "0";
  3580. el.wide = el.wide || "0";
  3581. el.high = el.high || "0";
  3582. });
  3583. });
  3584. }
  3585. }
  3586. });
  3587. row.part = JSON.parse(JSON.stringify(res.data.part));
  3588. // //测量字段
  3589. row.measure = res.data.measure;
  3590. row.measure.forEach((element) => {
  3591. element.value = "";
  3592. element.measureCalc = element.e_title;
  3593. });
  3594. this.tableData.splice(rowIndex, 1, row);
  3595. row.get_first_data = false;
  3596. this.$forceUpdate();
  3597. });
  3598. }
  3599. // row.part=[]
  3600. },
  3601. changeEditProduct($event) {
  3602. if ($event) {
  3603. let id = $event.value;
  3604. this.modalData.type_name = $event.label;
  3605. this.modalData.title = $event.label;
  3606. this.axios("/api/order_get_product_detail_new", {
  3607. params: { product_id: id, custom_id: this.info.custom_id },
  3608. }).then((res) => {
  3609. if (res.code == 200) {
  3610. this.process_match_list = res.data.process.list;
  3611. this.process_all_list = res.data.process_list;
  3612. this.support_remark = res.data.support_remark;
  3613. // 赋值默认工艺路线
  3614. let _temp_obj = {};
  3615. if (res.data.process.list.length > 1) {
  3616. for (const key in res.data.process.list[0].detail) {
  3617. res.data.process.list.reduce((pre, cur) => {
  3618. if (_temp_obj[key] == "") {
  3619. return pre;
  3620. } else {
  3621. if (pre.detail[key] == cur.detail[key]) {
  3622. _temp_obj[key] = pre.detail[key];
  3623. return pre;
  3624. } else {
  3625. _temp_obj[key] = "";
  3626. return pre;
  3627. }
  3628. }
  3629. });
  3630. }
  3631. } else {
  3632. _temp_obj = res.data.process.list[0].detail;
  3633. }
  3634. this.pre_process_obj = JSON.parse(JSON.stringify(_temp_obj));
  3635. this.modalData.url = res.data.url;
  3636. this.modalData.total_num = res.data.total_num || 1;
  3637. this.modalData.ext_price = res.data.ext_price || 0;
  3638. this.modalData.unit_price = res.data.price || 0;
  3639. this.modalData.num = res.data.num || 1;
  3640. this.modalData.num = res.data.num;
  3641. this.modalData.over_price = res.data.over_price || 0;
  3642. this.modalData.position = res.data.position || "";
  3643. this.modalData.unit = res.data.unit || "";
  3644. this.modalData.remark = res.data.remark || "";
  3645. this.modalData.url_number = res.data.url_number || "";
  3646. this.modalData.overdraft = res.data.overdraft;
  3647. this.modalData.num_formula = res.data.num_formula;
  3648. this.modalData.bp_id = res.data.bp_id;
  3649. // 金额=(产品单价)*核算数量 +附加金额 + 超标金额
  3650. this.modalData.price =
  3651. (this.modalData.unit_price * 1 || 0) *
  3652. (this.modalData.num * 1 || 1) +
  3653. (this.modalData.over_price * 1 || 0) +
  3654. (this.modalData.ext_price * 1 || 0);
  3655. this.modalData.price = this.modalData.price.toFixed(2);
  3656. // this.modalData.model = res.data.model || ''
  3657. // this.modalData.same_process_compare = JSON.parse(JSON.stringify(res.data.intermediate.same_process || []))
  3658. this.modalData.selected_ids = [];
  3659. this.modalData.part = [];
  3660. this.modalData.part = res.data.part;
  3661. // 数据第一次通过接口获取
  3662. this.modalData.get_first_data = false;
  3663. this.modalData.part.forEach((element, index) => {
  3664. // 选择不是附加项目的,
  3665. if (!element.is_metal) {
  3666. // 选择不是线条、或者基础档案中要默认为空的部件
  3667. element.isBP = true;
  3668. element.isChoosed = true;
  3669. if (element.is_null == 1) {
  3670. element.change_id = "";
  3671. } else {
  3672. element.part_detail = element.sub_part;
  3673. //展示非拆分部件
  3674. // 默认替换部件
  3675. element.change_id = element.change[0].id;
  3676. //存计算公式
  3677. element.long ? "" : (element.long = 0);
  3678. element.wide ? "" : (element.wide = 0);
  3679. element.high ? "" : (element.high = 0);
  3680. element.longCalc = element.long + "";
  3681. element.wideCalc = element.wide + "";
  3682. element.highCalc = element.high + "";
  3683. element.part_detail.forEach((elem) => {
  3684. elem.material_detail_id = 0;
  3685. elem.material_detail_title =
  3686. elem.material_detail_list[0].title;
  3687. elem.material_detail_id =
  3688. elem.material_detail_list[0].material_detail_id;
  3689. elem.org_num = elem.num;
  3690. elem.material_detail_org_num = elem.num || 0;
  3691. elem.material_detail_num = elem.num || 0;
  3692. elem.long ? "" : (elem.long = 0);
  3693. elem.wide ? "" : (elem.wide = 0);
  3694. elem.high ? "" : (elem.high = 0);
  3695. elem.longCalc = elem.long || "";
  3696. elem.wideCalc = elem.wide || "";
  3697. elem.highCalc = elem.high || "";
  3698. elem.material_detail_list.forEach((el) => {
  3699. el.long = el.long || "0";
  3700. el.wide = el.wide || "0";
  3701. el.high = el.high || "0";
  3702. });
  3703. });
  3704. }
  3705. }
  3706. });
  3707. //测量字段
  3708. this.modalData.measure = res.data.measure;
  3709. this.modalData.measure.forEach((element) => {
  3710. element.value = "";
  3711. element.measureCalc = element.e_title;
  3712. });
  3713. //工艺属性
  3714. this.modalData.process_obj = [];
  3715. for (const k in res.data.process.title) {
  3716. this.process_obj.map((v) => {
  3717. if (v.id == k) {
  3718. this.modalData.process_obj.push(v);
  3719. }
  3720. });
  3721. }
  3722. this.modalData.part.forEach((element) => {
  3723. if (!element.is_metal) {
  3724. //赋值默认工艺属性
  3725. element.process = JSON.parse(JSON.stringify(this.bpp_list));
  3726. element.process.forEach((elem, index) => {
  3727. for (const key in res.data.process.title) {
  3728. const ele = res.data.process.title[key];
  3729. if (elem.name == ele) {
  3730. elem.value = this.pre_process_obj[key] * 1;
  3731. elem.process_id = key;
  3732. if (!element.procedure_properties) {
  3733. element.procedure_properties = {};
  3734. }
  3735. element.procedure_properties[key] =
  3736. this.pre_process_obj[key] * 1;
  3737. }
  3738. }
  3739. });
  3740. }
  3741. });
  3742. this.handleClearExtInfo(
  3743. this.modalData,
  3744. this.pre_bp_id,
  3745. res.data.bp_id
  3746. );
  3747. // 是否有上一个的工艺属性ID
  3748. this.chooseLastRouteId(this.modalData, res);
  3749. this.$forceUpdate();
  3750. }
  3751. });
  3752. }
  3753. },
  3754. chooseLastRouteId(modalData, res) {
  3755. // 匹配
  3756. modalData.process_obj.forEach((element) => {
  3757. for (const key in this.pre_process_obj) {
  3758. const item = this.pre_process_obj[key];
  3759. const compare = res.data.process.list.filter(
  3760. (_process) => _process.detail[key] == this.pre_process_obj[key]
  3761. );
  3762. if (element.id == key) {
  3763. if (compare.length > 0) {
  3764. element.value = item * 1;
  3765. } else {
  3766. element.value = "";
  3767. }
  3768. }
  3769. }
  3770. });
  3771. this.$forceUpdate();
  3772. },
  3773. changeProductOnEdit(row, n) {
  3774. if (row) {
  3775. this.modalData.type_name = row.label;
  3776. this.modalData.title = row.label;
  3777. this.axios("/api/order_get_product_detail_new", {
  3778. params: {
  3779. product_id: row.product_id,
  3780. custom_id: this.info.custom_id,
  3781. },
  3782. }).then((res) => {
  3783. if (res.code == 200) {
  3784. this.support_remark = res.data.support_remark;
  3785. this.process_match_list = res.data.process.list;
  3786. this.process_all_list = res.data.process_list;
  3787. //获取产品
  3788. this.modalData.total_num = res.data.total_num || 1;
  3789. this.modalData.ext_price = res.data.ext_price || 0;
  3790. this.modalData.unit_price = res.data.price || 0;
  3791. this.modalData.num = res.data.num || 1;
  3792. this.modalData.num_temp_save = JSON.parse(
  3793. JSON.stringify(res.data.num || 1)
  3794. );
  3795. this.modalData.over_price = res.data.over_price || 0;
  3796. this.modalData.position = res.data.position | "";
  3797. this.modalData.unit = res.data.unit || "";
  3798. this.modalData.remark = res.data.remark || "";
  3799. this.modalData.url = res.data.url || [];
  3800. this.modalData.url_number = res.data.url_number || "";
  3801. this.modalData.overdraft = res.data.overdraft;
  3802. this.modalData.bp_id = res.data.bp_id;
  3803. // this.modalData.same_process_compare = JSON.parse(JSON.stringify(res.data.intermediate.same_process || []))
  3804. this.modalData.selected_ids = [];
  3805. this.modalData.customize = row.customize;
  3806. this.modalData.get_first_data = false;
  3807. this.modalData.part = res.data.part;
  3808. this.modalData.part.forEach((element) => {
  3809. if (!element.is_metal) {
  3810. element.isBP = true;
  3811. element.isChoosed = true;
  3812. element.part_detail = element.sub_part;
  3813. // 数据第一次通过接口获取
  3814. //展示非拆分部件
  3815. //存计算公式
  3816. element.longCalc = JSON.parse(
  3817. JSON.stringify(element.long || "")
  3818. );
  3819. element.wideCalc = JSON.parse(
  3820. JSON.stringify(element.wide || "")
  3821. );
  3822. element.highCalc = JSON.parse(
  3823. JSON.stringify(element.high || "")
  3824. );
  3825. element.part_detail.forEach((elem) => {
  3826. elem.org_num = elem.num;
  3827. elem.material_detail_id = 0;
  3828. elem.material_detail_title =
  3829. elem.material_detail_list[0].title;
  3830. elem.material_detail_num = elem.num || 0;
  3831. elem.material_detail_org_num = elem.num || 0;
  3832. elem.longCalc = elem.long || "";
  3833. elem.wideCalc = elem.wide || "";
  3834. elem.highCalc = elem.high || "";
  3835. elem.material_detail_list.forEach((el) => {
  3836. el.long = el.long || "0";
  3837. el.wide = el.wide || "0";
  3838. el.high = el.high || "0";
  3839. });
  3840. });
  3841. }
  3842. });
  3843. //测量字段
  3844. this.modalData.measure = res.data.measure;
  3845. this.modalData.measure.forEach((element) => {
  3846. element.measureCalc = element.e_title;
  3847. });
  3848. //工艺属性
  3849. this.modalData.part.forEach((element) => {
  3850. if (!element.is_metal) {
  3851. element.process = JSON.parse(JSON.stringify(this.process_obj));
  3852. element.process.forEach((elem) => {
  3853. elem.value = "";
  3854. });
  3855. }
  3856. });
  3857. this.modalData.process_obj = [];
  3858. for (const k in res.data.process.title) {
  3859. this.process_obj.map((v) => {
  3860. if (v.id == k) {
  3861. this.modalData.process_obj.push(v);
  3862. }
  3863. });
  3864. }
  3865. (this.type == 2 || this.type == 3) &&
  3866. this.getEditData(this.modalData, this.editForm);
  3867. this.showEditProduct = true;
  3868. this.$forceUpdate();
  3869. }
  3870. });
  3871. }
  3872. },
  3873. handlePartChange($event, row, measure, product_num) {
  3874. if ($event) {
  3875. let cur = row.change.filter((item) => item.id == row.change_id);
  3876. row.part_title = cur[0].part_title;
  3877. row.org_part_id = row.part_id;
  3878. row.part_id = cur[0].part_id;
  3879. row.high = cur[0].high || 0;
  3880. row.highCalc = row.high;
  3881. row.long = cur[0].long || 0;
  3882. row.longCalc = row.long;
  3883. row.wide = cur[0].wide || 0;
  3884. row.wideCalc = row.wide;
  3885. row.part_detail = cur[0].sub_part;
  3886. row.part_detail.forEach((elem) => {
  3887. elem.longCalc = elem.long || "";
  3888. elem.wideCalc = elem.wide || "";
  3889. elem.highCalc = elem.high || "";
  3890. elem.org_num = elem.num;
  3891. elem.material_detail_org_num = JSON.parse(
  3892. JSON.stringify(elem.num || 0)
  3893. );
  3894. elem.num =
  3895. ((elem.material_detail_org_num || elem.num) * product_num) | 0;
  3896. elem.material_detail_num = elem.material_detail_org_num * product_num;
  3897. });
  3898. measure.forEach((element) => {
  3899. if ((row.long + "").indexOf(element.measureCalc) != -1) {
  3900. if (typeof (element.value * 1) == "number") {
  3901. row.long = row.long.replace(
  3902. new RegExp(element.measureCalc, "g"),
  3903. element.value | ""
  3904. );
  3905. row.long = eval(row.long);
  3906. row.long += "";
  3907. } else {
  3908. row.long = "";
  3909. }
  3910. }
  3911. if ((row.wide + "").indexOf(element.measureCalc) != -1) {
  3912. if (typeof (element.value * 1) == "number") {
  3913. row.wide = row.wide.replace(
  3914. new RegExp(element.measureCalc, "g"),
  3915. element.value | ""
  3916. );
  3917. row.wide = eval(row.wide);
  3918. row.wide += "";
  3919. } else {
  3920. row.wide = "";
  3921. }
  3922. }
  3923. if ((row.high + "").indexOf(element.measureCalc) != -1) {
  3924. if (typeof (element.value * 1) == "number") {
  3925. row.high = row.high.replace(
  3926. new RegExp(element.measureCalc, "g"),
  3927. element.value | ""
  3928. );
  3929. row.high = eval(row.high);
  3930. row.high += "";
  3931. } else {
  3932. row.high = "";
  3933. }
  3934. }
  3935. row.part_detail.forEach((item) => {
  3936. item.num =
  3937. row.material_detail_org_num || item.material_detail_org_num;
  3938. if ((item.long || "").indexOf(element.measureCalc) != -1) {
  3939. if (typeof (element.value * 1) == "number") {
  3940. item.long = item.long.replace(
  3941. new RegExp(element.measureCalc, "g"),
  3942. element.value
  3943. );
  3944. try {
  3945. item.long = eval(item.long);
  3946. item.long += "";
  3947. } catch (error) {
  3948. item.long = "";
  3949. }
  3950. }
  3951. }
  3952. if ((item.wide || "").indexOf(element.measureCalc) != -1) {
  3953. if (typeof (element.value * 1) == "number") {
  3954. item.wide = item.wide.replace(
  3955. new RegExp(element.measureCalc, "g"),
  3956. element.value
  3957. );
  3958. try {
  3959. item.wide = eval(item.wide);
  3960. item.wide += "";
  3961. } catch (error) {
  3962. item.wide = "";
  3963. }
  3964. }
  3965. }
  3966. if ((item.high || "").indexOf(element.measureCalc) != -1) {
  3967. if (typeof (element.value * 1) == "number") {
  3968. item.high = item.high.replace(
  3969. new RegExp(element.measureCalc, "g"),
  3970. element.value
  3971. );
  3972. try {
  3973. item.high = eval(item.high);
  3974. item.high += "";
  3975. } catch (error) {
  3976. item.high = "";
  3977. }
  3978. }
  3979. }
  3980. item.material_detail_list.forEach((it) => {
  3981. it.long = it.long || "0";
  3982. it.wide = it.wide || "0";
  3983. it.high = it.high || "0";
  3984. });
  3985. item.long = item.long || "0";
  3986. item.wide = item.wide || "0";
  3987. item.high = item.high || "0";
  3988. item.material_detail_title = item.material_detail_list[0].title;
  3989. item.material_detail_id =
  3990. item.material_detail_list[0].material_detail_id;
  3991. item.material_detail_org_num = item.num || 0;
  3992. });
  3993. });
  3994. } else {
  3995. row.change_id = "";
  3996. }
  3997. this.$forceUpdate();
  3998. },
  3999. handleProductNumChange(e, product) {
  4000. product.part.map((element) => {
  4001. element.part_detail.map((elem) => {
  4002. elem.material_detail_num =
  4003. e.target.value * elem.material_detail_org_num;
  4004. });
  4005. });
  4006. product.total_num = e.target.value;
  4007. product.num = (product.total_num * product.num_temp_save).toFixed(2);
  4008. product.price =
  4009. (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
  4010. (product.over_price * 1 || 0) +
  4011. (product.ext_price * 1 || 0);
  4012. product.price = product.price.toFixed(2);
  4013. this.$forceUpdate();
  4014. },
  4015. handleProductUnit_priceChange(e, product) {
  4016. product.unit_price = e.target.value * 1;
  4017. product.price =
  4018. (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
  4019. (product.over_price * 1 || 0) +
  4020. (product.ext_price * 1 || 0);
  4021. product.price = product.price.toFixed(2);
  4022. this.$forceUpdate();
  4023. },
  4024. handleProductExt_priceChange(e, product) {
  4025. product.ext_price = e.target.value * 1;
  4026. product.price =
  4027. (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
  4028. (product.over_price * 1 || 0) +
  4029. (product.ext_price * 1 || 0);
  4030. product.price = product.price.toFixed(2);
  4031. this.$forceUpdate();
  4032. },
  4033. handleProductOver_priceChange(e, product) {
  4034. product.over_price = e.target.value;
  4035. product.price =
  4036. (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
  4037. (product.over_price * 1 || 0) +
  4038. (product.ext_price * 1 || 0);
  4039. product.price = product.price.toFixed(2);
  4040. this.$forceUpdate();
  4041. },
  4042. handleGetProductMeasure(val, index, product, ele) {
  4043. if (val) {
  4044. let change = [];
  4045. if (product.part.filter((v) => !v.change_id).length > 0) {
  4046. ele.cld = [];
  4047. this.$forceUpdate();
  4048. return this.$Message.warning("请先选择部件!");
  4049. }
  4050. product.part.map((item) => {
  4051. change.push({
  4052. old_id: item.org_part_id || item.part_id,
  4053. new_id: item.change.filter((v) => v.id == item.change_id)[0]
  4054. .part_id,
  4055. });
  4056. });
  4057. let list = product.process_obj.map((item) => {
  4058. return { type_id: item.key || item.id, value: item.value || "" };
  4059. });
  4060. this.axios({
  4061. method: "post",
  4062. url: "/api/order_get_product_process",
  4063. data: {
  4064. product_id: product.product_id,
  4065. type_id: ele.key || ele.id,
  4066. list,
  4067. change,
  4068. },
  4069. }).then((res) => {
  4070. if (res.code == 200) {
  4071. (ele.cld = []), (ele.cld = res.data);
  4072. } else {
  4073. ele.cld = [];
  4074. }
  4075. this.$forceUpdate();
  4076. });
  4077. }
  4078. },
  4079. // 查找最接近
  4080. handleFindNearest(array, value) {
  4081. const temp = JSON.parse(JSON.stringify(array));
  4082. temp.sort((a, b) => {
  4083. return Math.abs(a.long - value) - Math.abs(b.long - value);
  4084. });
  4085. return temp[0].material_detail_id;
  4086. },
  4087. handleCalcPartDetailLong(part_detail, product) {
  4088. for (const key in product.measure) {
  4089. const element = product.measure[key];
  4090. if (element.value) {
  4091. part_detail._longCalc = part_detail.longCalc.replace(
  4092. new RegExp(element.e_title, "g"),
  4093. element.value || ""
  4094. );
  4095. }
  4096. }
  4097. try {
  4098. eval(part_detail._longCalc);
  4099. } catch (error) {
  4100. for (const key in product.measure) {
  4101. const element = product.measure[key];
  4102. part_detail._longCalc = part_detail._longCalc.replace(
  4103. new RegExp(element.e_title, "g"),
  4104. element.value || ""
  4105. );
  4106. }
  4107. }
  4108. return part_detail._longCalc;
  4109. },
  4110. handleProductMeasureBlur(e, product, measure_detail) {
  4111. try {
  4112. measure_detail.value = eval(e.target.value);
  4113. } catch (error) {
  4114. console.log("error :>> ", error);
  4115. }
  4116. product.part.map((part) => {
  4117. part.part_detail &&
  4118. part.part_detail.length > 0 &&
  4119. part.part_detail.map((part_detail) => {
  4120. part_detail._longCalc = this.handleCalcPartDetailLong(
  4121. part_detail,
  4122. product
  4123. );
  4124. if (part_detail.material_detail_list.length > 1) {
  4125. try {
  4126. part_detail.longCalcFinal = eval(part_detail._longCalc);
  4127. part_detail.material_detail_id = this.handleFindNearest(
  4128. part_detail.material_detail_list,
  4129. part_detail.longCalcFinal
  4130. );
  4131. } catch (error) {
  4132. console.log("error :>> ", error);
  4133. }
  4134. }
  4135. });
  4136. });
  4137. this.$forceUpdate();
  4138. },
  4139. handleProductMeasureChange(e, product, measure_detail) {
  4140. if (e.target.value) {
  4141. let cur_measure = measure_detail.measureCalc;
  4142. let cur_value = measure_detail.value;
  4143. product.over_price = 0;
  4144. //当前测量字段 L W H 修改部件测量字段
  4145. product.part.forEach((element) => {
  4146. if (!element.is_metal) {
  4147. if (!element.is_null == 1) {
  4148. //处理公式
  4149. if (element.highCalc.indexOf(cur_measure) != -1) {
  4150. element.high = element.highCalc.replace(
  4151. new RegExp(cur_measure, "g"),
  4152. cur_value || ""
  4153. );
  4154. }
  4155. if (element.longCalc.indexOf(cur_measure) != -1) {
  4156. element.long = element.longCalc.replace(
  4157. new RegExp(cur_measure, "g"),
  4158. cur_value || ""
  4159. );
  4160. }
  4161. if (element.wideCalc.indexOf(cur_measure) != -1) {
  4162. element.wide = element.wideCalc.replace(
  4163. new RegExp(cur_measure, "g"),
  4164. cur_value || ""
  4165. );
  4166. }
  4167. //判断测量字段公式中是否还含有字母
  4168. let flag_high = false;
  4169. let flag_long = false;
  4170. let flag_wide = false;
  4171. for (let index = 0; index < product.measure.length; index++) {
  4172. const item = product.measure[index];
  4173. if (element.high.indexOf(item.measureCalc) != -1) {
  4174. flag_high = true;
  4175. }
  4176. if (element.long.indexOf(item.measureCalc) != -1) {
  4177. flag_long = true;
  4178. }
  4179. if (element.wide.indexOf(item.measureCalc) != -1) {
  4180. flag_wide = true;
  4181. }
  4182. }
  4183. if (flag_high) {
  4184. element.high = JSON.parse(JSON.stringify(element.high));
  4185. } else {
  4186. element.high = eval(element.high);
  4187. element.high += "";
  4188. }
  4189. if (flag_long) {
  4190. element.long = JSON.parse(JSON.stringify(element.long));
  4191. } else {
  4192. element.long = eval(element.long);
  4193. element.long += "";
  4194. }
  4195. if (flag_wide) {
  4196. element.wide = JSON.parse(JSON.stringify(element.wide));
  4197. } else {
  4198. element.wide = eval(element.wide);
  4199. element.wide += "";
  4200. }
  4201. element.part_detail.forEach((elem) => {
  4202. if (!elem.high) {
  4203. } else if (elem.highCalc.indexOf(cur_measure) != -1) {
  4204. elem.high = elem.highCalc.replace(
  4205. new RegExp(cur_measure, "g"),
  4206. cur_value || ""
  4207. );
  4208. }
  4209. if (!elem.long) {
  4210. } else if (elem.longCalc.indexOf(cur_measure) != -1) {
  4211. elem.long = elem.longCalc.replace(
  4212. new RegExp(cur_measure, "g"),
  4213. cur_value || ""
  4214. );
  4215. }
  4216. if (!elem.wide) {
  4217. } else if (elem.wideCalc.indexOf(cur_measure) != -1) {
  4218. elem.wide = elem.wideCalc.replace(
  4219. new RegExp(cur_measure, "g"),
  4220. cur_value || ""
  4221. );
  4222. }
  4223. //判断测量字段公式中是否还含有字母
  4224. let _flag_high = false;
  4225. let _flag_long = false;
  4226. let _flag_wide = false;
  4227. // Number类型无法使用indexOf
  4228. elem.high += "";
  4229. elem.long += "";
  4230. elem.wide += "";
  4231. for (let index = 0; index < product.measure.length; index++) {
  4232. const item = product.measure[index];
  4233. if (!elem.high) {
  4234. } else if (elem.high.indexOf(item.measureCalc) != -1) {
  4235. _flag_high = true;
  4236. }
  4237. if (!elem.long) {
  4238. } else if (elem.long.indexOf(item.measureCalc) != -1) {
  4239. _flag_long = true;
  4240. }
  4241. if (!elem.wide) {
  4242. } else if (elem.wide.indexOf(item.measureCalc) != -1) {
  4243. _flag_wide = true;
  4244. }
  4245. }
  4246. if (_flag_high) {
  4247. elem.high = JSON.parse(JSON.stringify(elem.high));
  4248. } else {
  4249. elem.high = eval(elem.high);
  4250. elem.high += "";
  4251. elem.high == "null" && (elem.high = 0);
  4252. }
  4253. if (_flag_long) {
  4254. elem.long = JSON.parse(JSON.stringify(elem.long));
  4255. } else {
  4256. elem.long = eval(elem.long);
  4257. elem.long += "";
  4258. elem.long == "null" && (elem.long = 0);
  4259. }
  4260. if (_flag_wide) {
  4261. elem.wide = JSON.parse(JSON.stringify(elem.wide));
  4262. } else {
  4263. elem.wide = eval(elem.wide);
  4264. elem.wide += "";
  4265. elem.wide == "null" && (elem.wide = 0);
  4266. }
  4267. });
  4268. }
  4269. }
  4270. });
  4271. product.part.map((item) => {
  4272. const cur_part = product.overdraft.filter(
  4273. (v) => v.part_id == item.part_id
  4274. );
  4275. cur_part.length > 0 &&
  4276. cur_part.map((element) => {
  4277. // 1 高 2 宽 3 厚
  4278. if (
  4279. element.type == 1 &&
  4280. item.long >= element.min &&
  4281. item.long < element.max
  4282. ) {
  4283. item.formula_temp = JSON.parse(JSON.stringify(element.formula));
  4284. item.formula_temp = item.formula_temp.replace(/H/g, item.long);
  4285. item.formula_temp = item.formula_temp.replace(/W/g, item.wide);
  4286. item.formula_temp = item.formula_temp.replace(/T/g, item.high);
  4287. item.formula_value = eval(item.formula_temp);
  4288. product.over_price += item.formula_value * 1 || 0;
  4289. }
  4290. if (
  4291. element.type == 2 &&
  4292. item.wide >= element.min &&
  4293. item.wide < element.max
  4294. ) {
  4295. item.formula_temp = JSON.parse(JSON.stringify(element.formula));
  4296. item.formula_temp = item.formula_temp.replace(/H/g, item.long);
  4297. item.formula_temp = item.formula_temp.replace(/W/g, item.wide);
  4298. item.formula_temp = item.formula_temp.replace(/T/g, item.high);
  4299. item.formula_value = eval(item.formula_temp);
  4300. product.over_price += item.formula_value * 1 || 0;
  4301. }
  4302. if (
  4303. element.type == 3 &&
  4304. item.high >= element.min &&
  4305. item.high < element.max
  4306. ) {
  4307. item.formula_temp = JSON.parse(JSON.stringify(element.formula));
  4308. item.formula_temp = item.formula_temp.replace(/H/g, item.long);
  4309. item.formula_temp = item.formula_temp.replace(/W/g, item.wide);
  4310. item.formula_temp = item.formula_temp.replace(/T/g, item.high);
  4311. item.formula_value = eval(item.formula_temp);
  4312. product.over_price += item.formula_value * 1 || 0;
  4313. }
  4314. });
  4315. });
  4316. //修改核算数量
  4317. // 如果没有核算数量公式,核算数量取产品数量
  4318. if (product.num_formula == "") {
  4319. product.total_num = product.num;
  4320. } else {
  4321. product.num_formula_temp = product.num_formula;
  4322. product.measure.forEach((element) => {
  4323. if (product.num_formula.indexOf(element.e_title) != -1) {
  4324. product.num_formula_temp = product.num_formula_temp.replace(
  4325. new RegExp(element.e_title, "g"),
  4326. element.value || 0
  4327. );
  4328. }
  4329. });
  4330. product.num = eval(product.num_formula_temp);
  4331. product.num = product.num.toFixed(2);
  4332. product.over_price = product.over_price.toFixed(2);
  4333. product.num_temp_save = product.num;
  4334. product.price =
  4335. (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
  4336. (product.over_price * 1 || 0) +
  4337. (product.ext_price * 1 || 0);
  4338. product.price = product.price.toFixed(2);
  4339. }
  4340. this.$forceUpdate();
  4341. }
  4342. },
  4343. handleSubpartNumChange(e, row) {
  4344. row.material_detail_num = e.target.value;
  4345. this.$forceUpdate();
  4346. },
  4347. //修改材质/颜色/工艺的
  4348. handleProductProcessChange(e, n, modelData, ele) {
  4349. console.log("ele :>> ", ele);
  4350. if (e) {
  4351. this.pre_process_obj[ele.id] = e.value;
  4352. if (!modelData.procedure_properties_str) {
  4353. modelData.procedure_properties_str = [];
  4354. }
  4355. modelData.procedure_properties_str[ele.id - 1] = e.label;
  4356. if (!modelData.procedure_properties) {
  4357. modelData.procedure_properties = {};
  4358. }
  4359. modelData.procedure_properties[ele.id] = e.value;
  4360. let isStart = true;
  4361. // let match_list = []; //当前选中的list
  4362. // this.process_match_list.map((item) => {
  4363. // if (item.detail[ele.id] == e.value) {
  4364. // match_list.push(item.detail);
  4365. // }
  4366. // });
  4367. // this.process_Select_match_list = match_list;
  4368. modelData.process_obj.forEach((element) => {
  4369. if (element.value == "") {
  4370. isStart = false;
  4371. }
  4372. });
  4373. //匹配工艺路线
  4374. if (isStart) {
  4375. let _target = [];
  4376. let _sorce = JSON.parse(JSON.stringify(this.process_match_list));
  4377. modelData.process_obj.forEach((element) => {
  4378. _target.push(element.value);
  4379. });
  4380. _sorce.forEach((element) => {
  4381. let _str = [];
  4382. for (const key in element.detail) {
  4383. const item = element.detail[key];
  4384. _str.push(item);
  4385. }
  4386. element.new_detail = _str.join(",");
  4387. });
  4388. let target = _target.join(",");
  4389. _sorce.forEach((element) => {
  4390. if (element.new_detail == target) {
  4391. modelData.route_id = element.id;
  4392. }
  4393. });
  4394. }
  4395. // 产品 - 部件 工艺属性联动
  4396. modelData.part.forEach((element) => {
  4397. // 此处有错误,产品选择完工艺路线之后部件的展示跟着改了但是procedure_properties没有
  4398. if (!element.is_metal) {
  4399. element.process.forEach((elem) => {
  4400. if (elem.name == ele.name) {
  4401. elem.value = e.value;
  4402. if (!element.procedure_properties) {
  4403. element.procedure_properties = {};
  4404. }
  4405. if (!element.procedure_properties_str) {
  4406. element.procedure_properties_str = [];
  4407. }
  4408. element.procedure_properties[ele.id] = e.value;
  4409. element.procedure_properties_str[n] = e.label;
  4410. }
  4411. });
  4412. }
  4413. });
  4414. } else {
  4415. modelData.route_id = "";
  4416. if (typeof modelData.procedure_properties == "string") {
  4417. modelData.procedure_properties = modelData.procedure_properties.split(
  4418. ","
  4419. );
  4420. }
  4421. modelData.procedure_properties[ele.id] = "";
  4422. }
  4423. this.$forceUpdate();
  4424. },
  4425. handleMaterialChange(val, row) {
  4426. if (val) {
  4427. let tempRow = row.material_detail_list.filter(
  4428. (item) => item.material_detail_id == val
  4429. );
  4430. row.material_detail_title = tempRow[0].title;
  4431. // row.material_detail_id = tempRow.length > 0 ? tempRow[0].id : 0
  4432. this.$forceUpdate();
  4433. }
  4434. },
  4435. handleRadioClick(row) {
  4436. row.isChoosed = !row.isChoosed;
  4437. this.$forceUpdate();
  4438. },
  4439. handlePartProcessChange(val, n, row, process_detail) {
  4440. if (!row.procedure_properties) {
  4441. row.procedure_properties = {};
  4442. }
  4443. if (!row.procedure_properties_str) {
  4444. row.procedure_properties_str = [];
  4445. }
  4446. if (val) {
  4447. row.procedure_properties[process_detail.id] = val.value;
  4448. row.procedure_properties_str[n] = val.label;
  4449. } else {
  4450. row.procedure_properties[process_detail.id] = "";
  4451. row.procedure_properties_str[n] = "";
  4452. }
  4453. this.$forceUpdate();
  4454. },
  4455. looks(img) {
  4456. const array = [{ img_url: img }];
  4457. this.$previewImg({
  4458. list: array,
  4459. baseUrl: this.$store.state.ip,
  4460. baseImgField: "img_url",
  4461. baseTitleField: "",
  4462. });
  4463. },
  4464. delItems(n, arr) {
  4465. arr.splice(n, 1);
  4466. this.$forceUpdate();
  4467. },
  4468. changeIpt(e, row) {
  4469. if (this.info.img.length >= 3) {
  4470. return this.$Message.warning("图片最多上传3张");
  4471. }
  4472. let file = e.target.files[0];
  4473. this.postImg(file, row);
  4474. e.target.value = null;
  4475. },
  4476. postImg(file, row) {
  4477. let formData = new FormData();
  4478. formData.append("file", file);
  4479. this.axios.post("/api/upload_pic", formData).then((res) => {
  4480. row.push(res.data.url);
  4481. this.$forceUpdate();
  4482. });
  4483. },
  4484. },
  4485. };
  4486. </script>
  4487. <style lang="scss" scoped>
  4488. .product-img {
  4489. padding-top: 10px;
  4490. }
  4491. .product-add {
  4492. padding: 10px 0;
  4493. display: flex;
  4494. flex-wrap: wrap;
  4495. .ipt {
  4496. position: absolute;
  4497. width: 100%;
  4498. height: 100%;
  4499. opacity: 0;
  4500. cursor: pointer;
  4501. outline: none;
  4502. top: 0;
  4503. left: 0;
  4504. }
  4505. .add-items {
  4506. width: 120px;
  4507. height: 120px;
  4508. border: 1px dotted #e7e7e7;
  4509. border-radius: 5px;
  4510. display: flex;
  4511. justify-content: center;
  4512. align-items: center;
  4513. overflow: hidden;
  4514. position: relative;
  4515. flex-direction: column;
  4516. background: #f4f5f7;
  4517. .item {
  4518. width: 46px;
  4519. height: 46px;
  4520. background: #3764ff;
  4521. opacity: 0.6;
  4522. display: flex;
  4523. justify-content: center;
  4524. align-items: center;
  4525. border-radius: 50%;
  4526. color: #fff;
  4527. }
  4528. }
  4529. .items {
  4530. width: 120px;
  4531. height: 120px;
  4532. margin-bottom: 10px;
  4533. display: flex;
  4534. justify-content: center;
  4535. align-items: center;
  4536. background: #e7e7e7;
  4537. margin-right: 10px;
  4538. border-radius: 5px;
  4539. position: relative;
  4540. img {
  4541. max-width: 108px;
  4542. max-height: 108px;
  4543. }
  4544. }
  4545. }
  4546. .delete-img {
  4547. position: absolute;
  4548. right: 0px;
  4549. top: 0px;
  4550. color: red;
  4551. }
  4552. /deep/.ivu-tooltip-rel {
  4553. width: 200px;
  4554. overflow: hidden;
  4555. text-overflow: ellipsis;
  4556. white-space: nowrap;
  4557. }
  4558. .page-edit {
  4559. overflow: hidden;
  4560. overflow-y: auto;
  4561. position: relative;
  4562. top: 20px;
  4563. height: 85%;
  4564. padding-bottom: 20px;
  4565. /deep/ .ivu-form-item {
  4566. min-width: 300px;
  4567. }
  4568. }
  4569. .auto-width {
  4570. width: 200px;
  4571. }
  4572. .items {
  4573. // box-shadow: 0 2px 7px rgba(0, 0, 0, 0.15);
  4574. border-color: transparent;
  4575. position: relative;
  4576. border-radius: 5px;
  4577. .items-header {
  4578. padding: 10px 20px;
  4579. display: flex;
  4580. justify-content: space-between;
  4581. align-items: center;
  4582. border-bottom: 1px solid #f4f4f4;
  4583. .header-left {
  4584. span {
  4585. margin-left: 10px;
  4586. }
  4587. }
  4588. }
  4589. .form-item {
  4590. padding: 20px;
  4591. }
  4592. }
  4593. .modal-scroll {
  4594. height: 600px;
  4595. overflow: scroll;
  4596. }
  4597. .modal-items {
  4598. border-radius: 5px;
  4599. border: 1px solid #dedede;
  4600. padding: 0px 10px;
  4601. margin-bottom: 40px;
  4602. }
  4603. .modal-footer-button {
  4604. display: flex;
  4605. justify-content: flex-end;
  4606. padding: 10px 0;
  4607. }
  4608. .items-table {
  4609. width: 100%;
  4610. overflow-x: scroll;
  4611. }
  4612. /deep/ .ivu-table-wrapper {
  4613. overflow: visible;
  4614. color: red;
  4615. } //穿透iview
  4616. .original-part {
  4617. padding-top: 20px;
  4618. }
  4619. .column-li {
  4620. display: flex;
  4621. justify-content: space-between;
  4622. align-items: center;
  4623. padding: 2px 5px;
  4624. }
  4625. .hierarchy {
  4626. display: flex;
  4627. justify-content: flex-start;
  4628. align-items: flex-start;
  4629. flex-wrap: wrap;
  4630. .radio-g {
  4631. padding: 10px 0;
  4632. width: 700px;
  4633. display: flex;
  4634. justify-content: flex-start;
  4635. // align-items: flex-start;
  4636. flex-wrap: wrap;
  4637. .radio-us {
  4638. background: #f4f5f7;
  4639. padding: 5px 20px;
  4640. margin-right: 18px;
  4641. margin-bottom: 10px;
  4642. color: #999999;
  4643. border-radius: 15px;
  4644. border: 1px solid #dedede;
  4645. cursor: pointer;
  4646. }
  4647. .radio-us-foc {
  4648. color: #3764ff;
  4649. background: #fff;
  4650. border: 1px solid #3764ff;
  4651. }
  4652. }
  4653. }
  4654. .nav-product {
  4655. width: 100%;
  4656. height: 50px;
  4657. display: flex;
  4658. align-items: center;
  4659. }
  4660. /deep/.ivu-poptip-inner {
  4661. max-width: 90%;
  4662. // display: flex;
  4663. // justify-content: center;
  4664. }
  4665. /deep/.ivu-poptip-body {
  4666. max-height: 600px;
  4667. overflow: hidden;
  4668. overflow-y: auto;
  4669. }
  4670. .content {
  4671. .content_header {
  4672. display: flex;
  4673. justify-content: space-between;
  4674. padding: 0 10px;
  4675. }
  4676. }
  4677. .modal_product_info {
  4678. background-color: #f5f5f5;
  4679. border-radius: 10px;
  4680. padding: 10px;
  4681. margin-bottom: 10px;
  4682. .modal_product_info_title {
  4683. font-size: 20px;
  4684. font-weight: 700;
  4685. margin-bottom: 10px;
  4686. }
  4687. .modal_product_info_content {
  4688. .part_detail_form {
  4689. /deep/.ivu-form {
  4690. display: flex;
  4691. justify-content: flex-start;
  4692. flex-wrap: wrap;
  4693. }
  4694. /deep/ .ivu-form-item {
  4695. display: inline-block;
  4696. min-width: 150px;
  4697. }
  4698. }
  4699. }
  4700. .modal_product {
  4701. /deep/.ivu-form {
  4702. display: flex;
  4703. justify-content: flex-start;
  4704. flex-wrap: wrap;
  4705. }
  4706. /deep/ .ivu-form-item {
  4707. display: inline-block;
  4708. min-width: 200px;
  4709. }
  4710. }
  4711. .modal_parts {
  4712. /deep/.ivu-form {
  4713. display: flex;
  4714. justify-content: flex-start;
  4715. flex-wrap: wrap;
  4716. }
  4717. /deep/ .ivu-form-item {
  4718. display: inline-block;
  4719. min-width: 30px;
  4720. }
  4721. }
  4722. .modal_extra {
  4723. /deep/.ivu-form {
  4724. display: flex;
  4725. justify-content: flex-start;
  4726. flex-wrap: wrap;
  4727. }
  4728. /deep/ .ivu-form-item {
  4729. display: inline-block;
  4730. min-width: 100px;
  4731. }
  4732. }
  4733. }
  4734. /deep/.ivu-modal-body {
  4735. max-height: 800px;
  4736. }
  4737. .hide_part_detail {
  4738. display: none;
  4739. }
  4740. /deep/.ivu-form-item-content {
  4741. span {
  4742. vertical-align: middle;
  4743. }
  4744. }
  4745. </style>