baseFormNormal.vue 90 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693
  1. <template>
  2. <el-form
  3. :model="ruleForm"
  4. status-icon
  5. :rules="rulesThis"
  6. ref="ruleForm"
  7. :size="'mini'"
  8. v-loading="loading"
  9. label-width="90px"
  10. >
  11. <el-row class="ddiv">
  12. <el-col :span="1" class="dtitle">
  13. <ul style="padding: 140px 0 0 0">
  14. <li>基</li>
  15. <li>础</li>
  16. <li>信</li>
  17. <li>息</li>
  18. </ul>
  19. </el-col>
  20. <el-col :span="23" class="dmain">
  21. <el-row>
  22. <el-row>
  23. <el-col :span="12">
  24. <el-form-item label="业务公司" prop="company_id">
  25. <el-input
  26. :value="
  27. type === 'add'
  28. ? getCompanyWithCode(ruleForm.companyNo).name
  29. : companyName
  30. "
  31. disabled
  32. />
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="6">
  36. <el-form-item label="是否库存品" prop="is_stock" label-width="95px">
  37. <el-select
  38. v-model="ruleForm.is_stock"
  39. filterable
  40. clearable
  41. :disabled="
  42. type === 'view' ||
  43. type === 'editBase' ||
  44. type === 'editCoin' ||
  45. type === 'edit'
  46. "
  47. style="width: 100%"
  48. @change="stock_change"
  49. placeholder="是否库存品"
  50. >
  51. <el-option
  52. v-for="group in options4"
  53. :key="group.id"
  54. :label="group.name"
  55. :value="group.id"
  56. />
  57. </el-select>
  58. </el-form-item>
  59. </el-col>
  60. <el-col :span="6">
  61. <el-form-item prop="is_combind" label="组合类型" label-width="110px">
  62. <el-select
  63. style="width: 100%"
  64. :disabled="
  65. type === 'view' ||
  66. type === 'editBase' ||
  67. type === 'editCoin' ||
  68. type === 'edit'
  69. "
  70. v-model="ruleForm.is_combind"
  71. placeholder="是否组合商品"
  72. @change="groupGoodChange"
  73. >
  74. <el-option
  75. v-if="ruleForm.is_stock === '1'"
  76. value="1"
  77. label="组合商品"
  78. />
  79. <el-option value="0" label="非组合商品" />
  80. </el-select>
  81. </el-form-item>
  82. </el-col>
  83. </el-row>
  84. <el-row>
  85. <el-col :span="12">
  86. <el-form-item label="供应商" prop="supplierNo">
  87. <search-supplier
  88. :value="ruleForm.supplierNo"
  89. :placeholder="'供应商'"
  90. :disabled="type === 'view' || type === 'editCoin'"
  91. :size="'mini'"
  92. :names="supplierName"
  93. :isDetail="type !== 'add'"
  94. :isp="this.type !== 'view'"
  95. @searchChange="supplierNosearchChange"
  96. />
  97. </el-form-item>
  98. </el-col>
  99. <el-col :span="12">
  100. <el-form-item label="商品名称" prop="good_name">
  101. <el-input
  102. placeholder="商品名称"
  103. maxlength="100"
  104. :disabled="type === 'view' || type === 'editCoin'"
  105. v-model="ruleForm.good_name"
  106. ></el-input>
  107. </el-form-item>
  108. </el-col>
  109. </el-row>
  110. <el-row>
  111. <el-col :span="8">
  112. <el-form-item label="商品分类" prop="cat_id">
  113. <company-sort
  114. :value="ruleForm.cat_id"
  115. :placeholder="'商品分类'"
  116. :disabled="
  117. type !== 'add' && !(type === 'edit' && String(sitem.status) === '7')
  118. "
  119. :size="'mini'"
  120. :names="cat_id_name"
  121. :isDetail="type !== 'add'"
  122. :company-no="ruleForm.company_id"
  123. @searchChange="goods_class_change"
  124. />
  125. </el-form-item>
  126. </el-col>
  127. <el-col :span="8">
  128. <el-form-item label="商品品牌" prop="brandid">
  129. <search-brand
  130. :value="ruleForm.brandid"
  131. :disabled="type === 'view' || type === 'editCoin'"
  132. :size="'mini'"
  133. :isDetail="type !== 'add'"
  134. :names="brand_name"
  135. :placeholder="'商品品牌'"
  136. @searchChange="brandidsearchChange"
  137. />
  138. </el-form-item>
  139. </el-col>
  140. <el-col :span="8">
  141. <el-form-item label="销售权限" prop="is_auth">
  142. <el-select
  143. v-model="ruleForm.is_auth"
  144. filterable
  145. clearable
  146. :disabled="type === 'view' || type === 'editCoin'"
  147. style="width: 100%"
  148. placeholder="销售权限"
  149. >
  150. <el-option
  151. v-for="group in options3"
  152. :key="group.id"
  153. :label="group.name"
  154. :value="group.id"
  155. />
  156. </el-select>
  157. </el-form-item>
  158. </el-col>
  159. </el-row>
  160. <el-row>
  161. <el-col :span="4">
  162. <el-form-item label="单位" prop="unit" label-width="60px">
  163. <search-unit
  164. :value="ruleForm.unit"
  165. :disabled="type === 'view' || type === 'editCoin'"
  166. :size="'mini'"
  167. :isDetail="type !== 'add'"
  168. :names="unit_name"
  169. :placeholder="'单位'"
  170. @searchChange="unitsearchChange"
  171. />
  172. </el-form-item>
  173. </el-col>
  174. <el-col :span="4">
  175. <el-form-item label="税点" prop="tax" label-width="60px">
  176. <search-tax
  177. :value="ruleForm.tax"
  178. :disabled="
  179. type === 'view' || type === 'editBase' || type === 'editCoin'
  180. "
  181. :size="'mini'"
  182. :isDetail="type !== 'add'"
  183. :placeholder="'税点'"
  184. @searchChange="taxsearchChange"
  185. />
  186. </el-form-item>
  187. </el-col>
  188. <el-col :span="8">
  189. <el-form-item label="专属类型" prop="is_exclusive">
  190. <search-exclusive
  191. :disabled="type === 'view' || type === 'editCoin'"
  192. style="width: 100%"
  193. :isDetail="type !== 'add'"
  194. :size="'mini'"
  195. placeholder="专属类型"
  196. :value="ruleForm.is_exclusive"
  197. @selectChange="exclusiveSearchChange"
  198. />
  199. </el-form-item>
  200. </el-col>
  201. <el-col :span="8">
  202. <el-form-item
  203. label="商品总重量"
  204. prop="weight"
  205. label-width="95px"
  206. style="height: 32px"
  207. >
  208. <digital-input
  209. :values="ruleForm.weight"
  210. :name="'ruleForm.weight'"
  211. :placeholder="'商品总重量'"
  212. :min="0"
  213. :disabled="type === 'view' || type === 'editCoin'"
  214. :max="100000000000"
  215. :position="'right'"
  216. :precision="3"
  217. :size="'mini'"
  218. :controls="false"
  219. :append="'g'"
  220. @reschange="number_change($event, 'weight')"
  221. />
  222. </el-form-item>
  223. </el-col>
  224. <template v-if="hasAccount">
  225. <el-col :span="8">
  226. <el-form-item label="供应商采购成本" label-width="130px" prop="supplier_origin_price">
  227. <digital-input
  228. :values="ruleForm.supplier_origin_price"
  229. :placeholder="'供应商采购成本'"
  230. :min="0"
  231. :disabled="type === 'view' || is_noble"
  232. :max="100000000000"
  233. :position="'right'"
  234. :precision="2"
  235. :size="'mini'"
  236. :controls="false"
  237. :append="'元'"
  238. @reschange="number_change_origin($event)"
  239. />
  240. </el-form-item>
  241. </el-col>
  242. <el-col :span="8">
  243. <el-form-item label="采购供应商" label-width="120px" prop="cgd_supplier_code">
  244. <search-supplier
  245. :value="ruleForm.cgd_supplier_code"
  246. :placeholder="'采购供应商'"
  247. :size="'mini'"
  248. :names="cgdSupplierName"
  249. :disabled="type === 'view'"
  250. :isDetail="type !== 'add'"
  251. @searchChange="supplierCgdChange"
  252. />
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="8">
  256. <el-form-item label="竞单人" prop="cgd_apply_id">
  257. <search-account
  258. :value="ruleForm.cgd_apply_id"
  259. :disabled="type === 'view'"
  260. :isDetail="type !== 'add'"
  261. :names="ruleForm.cgd_apply_name"
  262. :size="searchSize"
  263. :placeholder="'竞单人'"
  264. @searchChange="handleResignName"
  265. />
  266. </el-form-item>
  267. </el-col>
  268. </template>
  269. </el-row>
  270. <el-row :span="24" v-show="is_noble">
  271. <el-row>
  272. <el-col :span="8">
  273. <el-form-item label="贵金属重量" prop="noble_weight" label-width="95px">
  274. <digital-input
  275. :values="ruleForm.noble_weight"
  276. :placeholder="'贵金属重量'"
  277. :name="'ruleForm.noble_weight'"
  278. :min="0"
  279. :disabled="
  280. type === 'view' || type === 'editBase' || type === 'editCoin'
  281. "
  282. :max="100000000000"
  283. :position="'right'"
  284. :precision="3"
  285. :size="'mini'"
  286. :controls="false"
  287. :append="'g'"
  288. @reschange="number_change($event, 'noble_weight')"
  289. />
  290. </el-form-item>
  291. </el-col>
  292. <el-col :span="8">
  293. <el-form-item label="贵金属种类" prop="noble_metal" label-width="95px">
  294. <search-metal-kind
  295. :value="ruleForm.noble_metal"
  296. :disabled="
  297. type === 'view' || type === 'editBase' || type === 'editCoin'
  298. "
  299. :size="'mini'"
  300. :isDetail="type !== 'add'"
  301. :placeholder="'贵金属种类'"
  302. @searchChange="noble_metalsearchChange"
  303. />
  304. </el-form-item>
  305. </el-col>
  306. <el-col :span="8">
  307. <el-form-item
  308. label="启用实时金价"
  309. prop="is_gold_price"
  310. label-width="110px"
  311. >
  312. <el-select
  313. v-model="ruleForm.is_gold_price"
  314. filterable
  315. clearable
  316. :disabled="
  317. type === 'view' || type === 'editBase' || type === 'editCoin'
  318. "
  319. style="width: 100%"
  320. placeholder="启用实时金价"
  321. @change="is_goold_price_change"
  322. >
  323. <el-option
  324. v-for="group in options5"
  325. :key="group.id"
  326. :label="group.name"
  327. :value="group.id"
  328. />
  329. </el-select>
  330. </el-form-item>
  331. </el-col>
  332. <el-col :span="6">
  333. <el-form-item label="有无工差" prop="is_diff">
  334. <el-select
  335. v-model="ruleForm.is_diff"
  336. filterable
  337. clearable
  338. :disabled="
  339. type === 'view' || type === 'editBase' || type === 'editCoin'
  340. "
  341. style="width: 100%"
  342. placeholder="有无工差"
  343. >
  344. <el-option
  345. v-for="group in options8"
  346. :key="group.id"
  347. :label="group.name"
  348. :value="group.id"
  349. />
  350. </el-select>
  351. </el-form-item>
  352. </el-col>
  353. <el-col :span="10">
  354. <el-form-item label="配置要求" prop="config" label-width="85px">
  355. <el-select
  356. v-model="ruleForm.config"
  357. multiple
  358. :disabled="type === 'view'"
  359. style="width: 100%"
  360. placeholder="配置要求"
  361. >
  362. <el-option
  363. v-for="(item, index) in options9"
  364. :key="item + index"
  365. :label="item"
  366. :value="item"
  367. ></el-option>
  368. </el-select>
  369. </el-form-item>
  370. </el-col>
  371. <el-col :span="8">
  372. <el-form-item
  373. label="其他配置要求"
  374. prop="other_config"
  375. label-width="110px"
  376. >
  377. <el-input
  378. placeholder="其他配置要求"
  379. maxlength="100"
  380. :disabled="type === 'view'"
  381. v-model="ruleForm.other_config"
  382. ></el-input>
  383. </el-form-item>
  384. </el-col>
  385. </el-row>
  386. </el-row>
  387. <el-row>
  388. <el-col :span="8">
  389. <el-form-item label="售后说明" prop="after_sales">
  390. <el-input
  391. type="textarea"
  392. :rows="4"
  393. :disabled="type === 'view' || type === 'editCoin'"
  394. placeholder="售后说明"
  395. v-model="ruleForm.after_sales"
  396. show-word-limit
  397. maxlength="1000"
  398. />
  399. </el-form-item>
  400. </el-col>
  401. <el-col :span="8">
  402. <el-form-item label="商品备注" prop="good_remark">
  403. <el-input
  404. type="textarea"
  405. :rows="4"
  406. :disabled="type === 'view' || type === 'editCoin'"
  407. placeholder="商品备注"
  408. show-word-limit
  409. maxlength="250"
  410. v-model="ruleForm.good_remark"
  411. ></el-input>
  412. </el-form-item>
  413. </el-col>
  414. <el-col :span="8">
  415. <el-form-item label="工艺说明" prop="craft_desc">
  416. <el-input
  417. type="textarea"
  418. :disabled="type === 'view' || type === 'editCoin'"
  419. :rows="4"
  420. placeholder="工艺说明"
  421. show-word-limit
  422. maxlength="250"
  423. v-model="ruleForm.craft_desc"
  424. ></el-input>
  425. </el-form-item>
  426. </el-col>
  427. </el-row>
  428. <el-col :span="8">
  429. <el-form-item label="是否定制" prop="good_type">
  430. <el-select
  431. v-model="ruleForm.good_type"
  432. filterable
  433. :disabled="type === 'view' || type === 'editCoin'"
  434. clearable
  435. style="width: 100%"
  436. placeholder="是否定制"
  437. @change="good_type_change"
  438. >
  439. <el-option
  440. v-for="group in options1"
  441. :key="group.id"
  442. :label="group.name"
  443. :value="group.id"
  444. />
  445. </el-select>
  446. </el-form-item>
  447. </el-col>
  448. <el-col :span="8" v-show="ruleForm.good_type === '1'">
  449. <el-form-item label="定制起订量" prop="moq" label-width="95px">
  450. <digital-input
  451. :values="ruleForm.moq"
  452. :placeholder="'定制起订量'"
  453. :name="'ruleForm.moq'"
  454. :min="0"
  455. :disabled="type === 'view' || type === 'editCoin'"
  456. :max="100000000000"
  457. :position="'right'"
  458. :precision="0"
  459. :size="'mini'"
  460. :controls="false"
  461. :append="''"
  462. @reschange="number_change($event, 'moq')"
  463. />
  464. </el-form-item>
  465. </el-col>
  466. <el-col :span="8" v-show="ruleForm.good_type === '1'">
  467. <el-form-item label="定制工期" prop="customized">
  468. <digital-input
  469. :values="ruleForm.customized"
  470. :placeholder="'定制工期'"
  471. :name="'ruleForm.customized'"
  472. :min="0"
  473. :disabled="type === 'view' || type === 'editCoin'"
  474. :max="100000000000"
  475. :position="'right'"
  476. :precision="0"
  477. :size="'mini'"
  478. :controls="false"
  479. :append="'天'"
  480. @reschange="number_change($event, 'customized')"
  481. />
  482. </el-form-item>
  483. </el-col>
  484. <el-col :span="8" v-show="ruleForm.is_stock === '1'">
  485. <el-form-item label="备库起订量" prop="stock_moq" label-width="95px">
  486. <digital-input
  487. :values="ruleForm.stock_moq"
  488. :placeholder="'备库起订量'"
  489. :min="0"
  490. :disabled="type === 'view' || type === 'editCoin'"
  491. :max="100000000000"
  492. :position="'right'"
  493. :precision="0"
  494. :size="'mini'"
  495. :controls="false"
  496. :append="''"
  497. @reschange="number_change($event, 'stock_moq')"
  498. />
  499. </el-form-item>
  500. </el-col>
  501. </el-row>
  502. </el-col>
  503. </el-row>
  504. <el-row class="ddiv" v-if="ruleForm.is_combind === '1'">
  505. <el-col
  506. :span="1"
  507. tag="div"
  508. style="
  509. border-right: 1px solid #dcdfe6;
  510. width: 40px;
  511. display: flex;
  512. align-items: center;
  513. height: 100%;
  514. "
  515. >
  516. <ul style="text-align: center; padding-top: 20px">
  517. <li>子</li>
  518. <li>商</li>
  519. <li>品</li>
  520. <li>设</li>
  521. <li>置</li>
  522. </ul>
  523. </el-col>
  524. <el-col :span="23" class="dmain" style="padding: 20px 0px; padding-left: 20px">
  525. <el-table :data="childTableData" size="mini" border max-height="350px">
  526. <el-table-column label="子商品成本编号" prop="childCode" min-width="160px" />
  527. <el-table-column
  528. label="子商品名称"
  529. prop="child_name"
  530. min-width="180px"
  531. show-overflow-tooltip
  532. />
  533. <el-table-column label="组合比例" prop="child_num" width="140px">
  534. <template slot-scope="scope">
  535. <span v-if="scope.$index !== editIndex">
  536. {{ childTableData[scope.$index].child_num }}
  537. </span>
  538. <digital-input
  539. v-else
  540. :values="childTableData[scope.$index].child_num"
  541. :placeholder="'组合比例'"
  542. :min="0"
  543. :max="100000000000"
  544. :position="'right'"
  545. :precision="0"
  546. :size="'mini'"
  547. :controls="false"
  548. @reschange="num_change($event, scope.$index)"
  549. />
  550. </template>
  551. </el-table-column>
  552. <el-table-column label="操作" width="120px">
  553. <template #header>
  554. <div>
  555. <span>操作</span>
  556. <el-tooltip
  557. class="item"
  558. effect="dark"
  559. content="添加"
  560. placement="top"
  561. v-if="type === 'add' || type === 'edit'"
  562. >
  563. <i
  564. class="el-icon-circle-plus-outline fr"
  565. style="font-size: 18px; cursor: pointer"
  566. @click="onChildProdChange(null, 'add')"
  567. />
  568. </el-tooltip>
  569. </div>
  570. </template>
  571. <template slot-scope="scope">
  572. <el-tooltip
  573. effect="dark"
  574. content="查看"
  575. placement="top"
  576. v-if="editIndex !== scope.$index"
  577. >
  578. <i
  579. class="el-icon-view tb-icon"
  580. @click="onChildProdChange(scope.$index, 'view')"
  581. ></i>
  582. </el-tooltip>
  583. <template v-if="type === 'add' || type === 'edit'">
  584. <el-tooltip
  585. effect="dark"
  586. content="修改"
  587. placement="top"
  588. v-if="editIndex !== scope.$index"
  589. >
  590. <i
  591. class="el-icon-edit tb-icon"
  592. @click="onChildProdChange(scope.$index, 'edit')"
  593. ></i>
  594. </el-tooltip>
  595. <el-tooltip effect="dark" content="保存" placement="top" v-else>
  596. <i
  597. class="el-icon-circle-check tb-icon"
  598. @click="onSaveLine(scope.$index)"
  599. ></i>
  600. </el-tooltip>
  601. <el-tooltip
  602. effect="dark"
  603. content="删除"
  604. placement="top"
  605. v-if="editIndex !== scope.$index"
  606. >
  607. <i
  608. class="el-icon-delete tb-icon"
  609. @click="onDeleteItem(scope.$index)"
  610. ></i>
  611. </el-tooltip>
  612. </template>
  613. </template>
  614. </el-table-column>
  615. </el-table>
  616. </el-col>
  617. </el-row>
  618. <el-row class="ddiv">
  619. <el-col :span="1" class="dtitle">
  620. <ul>
  621. <li>规</li>
  622. <li>格</li>
  623. <li>信</li>
  624. <li>息</li>
  625. </ul>
  626. </el-col>
  627. <el-col :span="23" class="dmain" style="padding: 20px 0 20px 18px">
  628. <el-table :data="spec_tableData" :size="'mini'" border style="width: 100%">
  629. <el-table-column prop="spec_value" label="规格类型" />
  630. <el-table-column prop="spec_value_value" label="规格值" />
  631. <el-table-column
  632. fixed="right"
  633. v-if="type === 'add' || type === 'editBase' || type === 'edit'"
  634. >
  635. <template slot="header" slot-scope="scope">
  636. <span>操作</span>
  637. <el-tooltip
  638. class="item"
  639. effect="dark"
  640. content="添加规格类型"
  641. placement="top"
  642. >
  643. <i
  644. class="el-icon-circle-plus-outline fr"
  645. style="font-size: 18px; margin-top: 2px"
  646. @click="openEdit('-1', {})"
  647. />
  648. </el-tooltip>
  649. </template>
  650. <template slot-scope="scope">
  651. <el-tooltip effect="dark" content="修改" placement="top">
  652. <i
  653. class="el-icon-edit tb-icon"
  654. @click="openEdit(scope.$index, scope.row)"
  655. ></i>
  656. </el-tooltip>
  657. <el-tooltip
  658. v-if="!scope.row.isMust"
  659. effect="dark"
  660. content="删除"
  661. placement="top"
  662. >
  663. <i class="el-icon-delete tb-icon" @click="openDelete(scope.$index)"></i>
  664. </el-tooltip>
  665. </template>
  666. </el-table-column>
  667. </el-table>
  668. <!-- 弹窗 新增/修改 -->
  669. <base-form-add-edit
  670. :index="modelIndex"
  671. :show-model="showModel"
  672. :sitem="sitem"
  673. @refresh="refreshEdit"
  674. @cancel="showModel = false"
  675. />
  676. </el-col>
  677. </el-row>
  678. <el-row class="ddiv">
  679. <el-col :span="1" class="dtitle">
  680. <ul>
  681. <li>包</li>
  682. <li>装</li>
  683. <li>信</li>
  684. <li>息</li>
  685. </ul>
  686. </el-col>
  687. <el-col :span="23" class="dmain">
  688. <el-row>
  689. <el-col :span="6">
  690. <el-form-item label="包装方式" prop="packing_way">
  691. <el-input
  692. placeholder="包装方式"
  693. :disabled="type === 'view' || type === 'editCoin'"
  694. v-model="ruleForm.packing_way"
  695. maxlength="250"
  696. />
  697. </el-form-item>
  698. </el-col>
  699. <el-col :span="6">
  700. <el-form-item label="装箱规格" prop="packing_spec">
  701. <el-input
  702. placeholder="装箱规格"
  703. :disabled="type === 'view' || type === 'editCoin'"
  704. v-model="ruleForm.packing_spec"
  705. maxlength="250"
  706. />
  707. </el-form-item>
  708. </el-col>
  709. <el-col :span="6">
  710. <el-form-item label="装箱重量" prop="packing_weight">
  711. <digital-input
  712. :values="ruleForm.packing_weight"
  713. :placeholder="'装箱重量'"
  714. :min="0"
  715. :name="'ruleForm.packing_weight'"
  716. :disabled="type === 'view' || type === 'editCoin'"
  717. :max="100000000000"
  718. :position="'right'"
  719. :precision="3"
  720. :size="'mini'"
  721. :controls="false"
  722. :append="'g'"
  723. @reschange="number_change($event, 'packing_weight')"
  724. />
  725. </el-form-item>
  726. </el-col>
  727. <el-col :span="6">
  728. <el-form-item label="装箱尺寸" prop="packing_size">
  729. <el-input
  730. placeholder="装箱尺寸"
  731. :disabled="type === 'view' || type === 'editCoin'"
  732. v-model="ruleForm.packing_size"
  733. maxlength="250"
  734. />
  735. </el-form-item>
  736. </el-col>
  737. <el-col :span="6">
  738. <el-form-item label="商品尺寸" prop="good_size">
  739. <el-input
  740. placeholder="商品尺寸"
  741. :disabled="type === 'view' || type === 'editCoin'"
  742. v-model="ruleForm.good_size"
  743. maxlength="250"
  744. />
  745. </el-form-item>
  746. </el-col>
  747. <el-col :span="6">
  748. <el-form-item label="商品条形码" prop="good_bar">
  749. <el-input
  750. placeholder="商品条形码"
  751. :disabled="type === 'view' || type === 'editCoin'"
  752. v-model="ruleForm.good_bar"
  753. type="number"
  754. :min="0"
  755. :max="9999999999999"
  756. :step="0"
  757. />
  758. </el-form-item>
  759. </el-col>
  760. <el-col :span="12">
  761. <el-form-item label="包装清单" prop="packing_list">
  762. <el-input
  763. placeholder="包装清单"
  764. :disabled="type === 'view' || type === 'editCoin'"
  765. v-model="ruleForm.packing_list"
  766. maxlength="250"
  767. />
  768. </el-form-item>
  769. </el-col>
  770. </el-row>
  771. </el-col>
  772. </el-row>
  773. <el-row class="ddiv">
  774. <el-col :span="1" class="dtitle">
  775. <ul>
  776. <li>发</li>
  777. <li>货</li>
  778. <li>信</li>
  779. <li>息</li>
  780. </ul>
  781. </el-col>
  782. <el-col :span="23" class="dmain">
  783. <el-row>
  784. <el-col :span="6">
  785. <el-form-item label="供货区域" prop="supply_area">
  786. <el-select
  787. v-model="ruleForm.supply_area"
  788. filterable
  789. clearable
  790. :disabled="type === 'view' || type === 'editCoin'"
  791. style="width: 100%"
  792. placeholder="供货区域"
  793. >
  794. <el-option
  795. v-for="group in options6"
  796. :key="group.id"
  797. :label="group.name"
  798. :value="group.id"
  799. />
  800. </el-select>
  801. </el-form-item>
  802. </el-col>
  803. <el-col :span="6" style="padding-bottom: 1px">
  804. <el-form-item label="物流时间" prop="delivery_day">
  805. <digital-input
  806. :values="ruleForm.delivery_day"
  807. :placeholder="'物流时间'"
  808. :min="0"
  809. :name="'ruleForm.delivery_day'"
  810. :disabled="type === 'view' || type === 'editCoin'"
  811. :max="100000000000"
  812. :position="'right'"
  813. :precision="0"
  814. :size="'mini'"
  815. :controls="false"
  816. :append="'天'"
  817. @reschange="number_change($event, 'delivery_day')"
  818. />
  819. </el-form-item>
  820. </el-col>
  821. <el-col :span="6" style="padding-bottom: 1px">
  822. <el-form-item label="供货周期" prop="lead_time">
  823. <digital-input
  824. :values="ruleForm.lead_time"
  825. :placeholder="'物流时间'"
  826. :min="0"
  827. :name="'ruleForm.lead_time'"
  828. :disabled="type === 'view' || type === 'editCoin'"
  829. :max="100000000000"
  830. :position="'right'"
  831. :precision="0"
  832. :size="'mini'"
  833. :controls="false"
  834. :append="'天'"
  835. @reschange="number_change($event, 'lead_time')"
  836. />
  837. </el-form-item>
  838. </el-col>
  839. <el-col :span="6" style="padding-bottom: 1px">
  840. <el-form-item label="调样周期" prop="sample_day">
  841. <digital-input
  842. :values="ruleForm.sample_day"
  843. :placeholder="'调样周期'"
  844. :min="0"
  845. :name="'ruleForm.sample_day'"
  846. :disabled="type === 'view' || type === 'editCoin'"
  847. :max="100000000000"
  848. :position="'right'"
  849. :precision="0"
  850. :size="'mini'"
  851. :controls="false"
  852. :append="'天'"
  853. @reschange="number_change($event, 'sample_day')"
  854. />
  855. </el-form-item>
  856. </el-col>
  857. <el-col :span="12">
  858. <el-form-item label="发货地" prop="delivery_place">
  859. <search-area
  860. :value="areaInfo.delivery_place.code"
  861. :is-detail="true"
  862. size="mini"
  863. :disabled="type === 'view' || type === 'editCoin'"
  864. :names="areaInfo.delivery_place.label"
  865. placeholder="发货地"
  866. :level="3"
  867. @searchChange="areaChange($event, 'delivery_place')"
  868. />
  869. </el-form-item>
  870. </el-col>
  871. <el-col :span="12">
  872. <el-form-item label="产地" prop="origin_place">
  873. <search-area
  874. :value="areaInfo.origin_place.code"
  875. :disabled="type === 'view' || type === 'editCoin'"
  876. :is-detail="true"
  877. size="mini"
  878. :names="areaInfo.origin_place.label"
  879. placeholder="产地"
  880. :level="3"
  881. @searchChange="areaChange($event, 'origin_place')"
  882. />
  883. </el-form-item>
  884. </el-col>
  885. </el-row>
  886. </el-col>
  887. </el-row>
  888. <el-row class="ddiv">
  889. <el-col :span="1" class="dtitle">
  890. <ul>
  891. <li>图</li>
  892. <li>片</li>
  893. <li>信</li>
  894. <li>息</li>
  895. </ul>
  896. </el-col>
  897. <el-col :span="23" class="dmain">
  898. <el-row style="padding: 0 0 20px 0">
  899. <el-col :span="6">
  900. <el-form-item
  901. label="商品缩略"
  902. prop="good_thumb_img"
  903. class="activity-upload my-label-top"
  904. >
  905. <div class="btnupload" style="position: relative">
  906. <img
  907. v-if="ruleForm.good_thumb_img"
  908. :src="ruleForm.good_thumb_img"
  909. class="avatar"
  910. />
  911. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  912. <file-upload
  913. class="Upload"
  914. :disabled="type === 'view' || type === 'editCoin'"
  915. :accept="'.jpg,.png,.jpeg'"
  916. :multiple="true"
  917. :uploadcondition="beforeAvatarUpload"
  918. @UploadErrorEvent="UploadErrorEvent($event, 'good_thumb_img')"
  919. @UploadSuccessEvent="UploadSuccessEvent($event, 'good_thumb_img')"
  920. ></file-upload>
  921. </div>
  922. <div class="txt-tips fl">
  923. <p>尺寸比例:</p>
  924. <p>1:1</p>
  925. </div>
  926. </el-form-item>
  927. </el-col>
  928. <el-col :span="9">
  929. <el-form-item label="商品主图" prop="good_img">
  930. <div class="good_info_img_div" style="display: flex">
  931. <ul v-if="ruleForm.good_img" class="clear">
  932. <li
  933. class="img-show-li"
  934. v-viewer
  935. v-for="(img, iindex) in ruleForm.good_img"
  936. :key="img + iindex"
  937. >
  938. <div class="img-show-li-div">
  939. <img :src="img" class="img-show" alt />
  940. <i
  941. v-if="type == 'add' || type === 'editBase' || type === 'edit'"
  942. class="el-icon-close"
  943. @click="closeImg(iindex, 'good_img')"
  944. ></i>
  945. </div>
  946. </li>
  947. <li
  948. class="img-show-li"
  949. v-if="
  950. ruleForm.good_img.length < 11 &&
  951. (type == 'add' || type === 'editBase' || type === 'edit')
  952. "
  953. >
  954. <div class="activity-upload">
  955. <div class="btnupload" style="position: relative">
  956. <i class="el-icon-plus avatar-uploader-icon"></i>
  957. <file-upload
  958. class="Upload"
  959. :disabled="type === 'view' || type === 'editCoin'"
  960. :accept="'.jpg,.png,.jpeg'"
  961. :multiple="true"
  962. :uploadcondition="beforeAvatarUpload"
  963. @UploadErrorEvent="UploadErrorEvent($event, 'good_img')"
  964. @UploadSuccessEvent="UploadSuccessEvent($event, 'good_img')"
  965. ></file-upload>
  966. </div>
  967. </div>
  968. </li>
  969. </ul>
  970. </div>
  971. </el-form-item>
  972. </el-col>
  973. <el-col :span="9">
  974. <el-form-item label="详情介绍" prop="good_info_img">
  975. <div class="good_info_img_div" style="display: flex">
  976. <ul v-if="ruleForm.good_info_img" class="clear">
  977. <li
  978. class="img-show-li"
  979. v-viewer
  980. v-for="(img, iindex) in ruleForm.good_info_img"
  981. :key="img + iindex"
  982. >
  983. <div class="img-show-li-div">
  984. <img :src="img" class="img-show" alt />
  985. <i
  986. v-if="type == 'add' || type === 'editBase' || type === 'edit'"
  987. class="el-icon-close"
  988. @click="closeImg(iindex, 'good_info_img')"
  989. ></i>
  990. </div>
  991. </li>
  992. <li
  993. class="img-show-li"
  994. v-if="
  995. ruleForm.good_info_img.length < 11 &&
  996. (type == 'add' || type === 'editBase' || type === 'edit')
  997. "
  998. >
  999. <div class="activity-upload">
  1000. <div class="btnupload" style="position: relative">
  1001. <i class="el-icon-plus avatar-uploader-icon"></i>
  1002. <file-upload
  1003. class="Upload"
  1004. :disabled="type === 'view' || type === 'editCoin'"
  1005. :accept="'.jpg,.png,.jpeg'"
  1006. :multiple="true"
  1007. :uploadcondition="beforeAvatarUpload"
  1008. @UploadErrorEvent="UploadErrorEvent($event, 'good_info_img')"
  1009. @UploadSuccessEvent="
  1010. UploadSuccessEvent($event, 'good_info_img')
  1011. "
  1012. ></file-upload>
  1013. </div>
  1014. </div>
  1015. </li>
  1016. </ul>
  1017. </div>
  1018. </el-form-item>
  1019. </el-col>
  1020. <el-col :span="24">
  1021. <div style="font-size: 12px; color: #606266">
  1022. <span style="padding: 0 0 0 20px">图片大小:小于1M</span>
  1023. <span style="padding: 0 0 0 20px">图片类型.jpg/png/jpeg</span>
  1024. </div>
  1025. </el-col>
  1026. </el-row>
  1027. </el-col>
  1028. </el-row>
  1029. <el-row class="ddiv">
  1030. <el-col :span="1" class="dtitle">
  1031. <ul style="padding: 0">
  1032. <li>固</li>
  1033. <li>定</li>
  1034. <li>与</li>
  1035. <li>阶</li>
  1036. <li>梯</li>
  1037. <li>成</li>
  1038. <li>本</li>
  1039. </ul>
  1040. </el-col>
  1041. <el-col :span="23" class="dmain">
  1042. <el-row>
  1043. <el-col :span="6">
  1044. <el-form-item label="打样费" prop="demo_fee" label-width="75px">
  1045. <digital-input
  1046. :values="ruleForm.demo_fee"
  1047. :placeholder="'打样费'"
  1048. :min="0"
  1049. :name="'ruleForm.demo_fee'"
  1050. :disabled="type === 'view' || type === 'editBase'"
  1051. :max="100000000000"
  1052. :position="'right'"
  1053. :precision="2"
  1054. :size="'mini'"
  1055. :controls="false"
  1056. :append="'元'"
  1057. @reschange="number_change($event, 'demo_fee')"
  1058. />
  1059. </el-form-item>
  1060. </el-col>
  1061. <el-col :span="6">
  1062. <el-form-item label="开模费" prop="open_fee" label-width="75px">
  1063. <digital-input
  1064. :values="ruleForm.open_fee"
  1065. :placeholder="'开模费'"
  1066. :min="0"
  1067. :name="'ruleForm.open_fee'"
  1068. :disabled="type === 'view' || type === 'editBase'"
  1069. :max="100000000000"
  1070. :position="'right'"
  1071. :precision="2"
  1072. :size="'mini'"
  1073. :controls="false"
  1074. :append="'元/件'"
  1075. @reschange="number_change($event, 'open_fee')"
  1076. />
  1077. </el-form-item>
  1078. </el-col>
  1079. <el-col :span="6">
  1080. <el-form-item label="调样费" prop="sample_fee" label-width="75px">
  1081. <digital-input
  1082. :values="ruleForm.sample_fee"
  1083. :placeholder="'调样费'"
  1084. :min="0"
  1085. :name="'ruleForm.sample_fee'"
  1086. :disabled="type === 'view' || type === 'editBase'"
  1087. :max="100000000000"
  1088. :position="'right'"
  1089. :precision="2"
  1090. :size="'mini'"
  1091. :controls="false"
  1092. :append="'元'"
  1093. @reschange="number_change($event, 'sample_fee')"
  1094. />
  1095. </el-form-item>
  1096. </el-col>
  1097. <el-col :span="6">
  1098. <el-form-item label="市场价" prop="market_price" label-width="75px">
  1099. <digital-input
  1100. :values="ruleForm.market_price"
  1101. :placeholder="'市场价'"
  1102. :min="0"
  1103. :name="'ruleForm.market_price'"
  1104. :disabled="type === 'view' || type === 'editBase'"
  1105. :max="100000000000"
  1106. :position="'right'"
  1107. :precision="2"
  1108. :size="'mini'"
  1109. :controls="false"
  1110. :append="'元'"
  1111. @reschange="number_change($event, 'market_price')"
  1112. />
  1113. </el-form-item>
  1114. </el-col>
  1115. <!-- <el-col :span="6">
  1116. <el-form-item label="启用阶梯" prop="is_step">
  1117. <el-select
  1118. v-model="ruleForm.is_step"
  1119. filterable
  1120. :disabled="type === 'view' || type === 'editBase'"
  1121. style="width: 100%"
  1122. placeholder="启用阶梯"
  1123. @change="is_step_change"
  1124. >
  1125. <el-option
  1126. v-for="group in options5"
  1127. :key="group.id"
  1128. :label="group.name"
  1129. :value="group.id"
  1130. />
  1131. </el-select>
  1132. </el-form-item>
  1133. </el-col>-->
  1134. <el-col
  1135. :span="6"
  1136. v-show="is_noble && ruleForm && ruleForm.is_gold_price === '1'"
  1137. >
  1138. <el-form-item
  1139. label="供应商采购金价"
  1140. prop="cgd_gold_price"
  1141. label-width="130px"
  1142. >
  1143. <digital-input
  1144. :values="ruleForm.cgd_gold_price"
  1145. :placeholder="'供应商采购金价'"
  1146. :min="0"
  1147. :name="'ruleForm.cgd_gold_price'"
  1148. :disabled="type === 'view' || type === 'editBase'"
  1149. :max="100000000000"
  1150. :position="'right'"
  1151. :precision="2"
  1152. :size="'mini'"
  1153. :controls="false"
  1154. :append="'元/g'"
  1155. @reschange="number_change($event, 'cgd_gold_price')"
  1156. />
  1157. </el-form-item>
  1158. </el-col>
  1159. <el-col
  1160. :span="6"
  1161. v-show="is_noble && ruleForm && ruleForm.is_gold_price === '1'"
  1162. >
  1163. <el-form-item label="当前金价">
  1164. <el-input
  1165. v-model="ruleForm.noble_price"
  1166. disabled
  1167. maxlength="15"
  1168. placeholder="当前金价"
  1169. >
  1170. <template slot="append">元/g</template>
  1171. </el-input>
  1172. </el-form-item>
  1173. </el-col>
  1174. <el-col :span="24" style="padding-left: 18px">
  1175. <el-table
  1176. :data="ladder_tableData"
  1177. :size="'mini'"
  1178. border
  1179. stripe
  1180. style="width: 100%; margin: 0 0 20px 0"
  1181. >
  1182. <el-table-column prop="min_num" label="起订量(>=)" />
  1183. <el-table-column prop="nake_fee" label="成本单价" />
  1184. <el-table-column prop="cost_fee" label="工艺费" />
  1185. <el-table-column prop="delivery_fee" label="物流费" />
  1186. <el-table-column prop="cert_fee" label="证书费" />
  1187. <el-table-column prop="mark_fee" label="加标费" />
  1188. <el-table-column prop="package_fee" label="包装费" />
  1189. <el-table-column prop="other_fee" label="其他费用" />
  1190. <el-table-column prop="nake_total" label="成本合计" />
  1191. <el-table-column
  1192. fixed="right"
  1193. v-if="type === 'add' || type === 'editCoin' || type === 'edit'"
  1194. width="80px"
  1195. >
  1196. <template slot="header" slot-scope="scope">
  1197. <span>操作</span>
  1198. <el-tooltip effect="dark" content="添加阶梯" placement="top">
  1199. <i
  1200. class="el-icon-circle-plus-outline tb-icon fr"
  1201. @click="openCostEdit(-1, {})"
  1202. ></i>
  1203. </el-tooltip>
  1204. </template>
  1205. <template slot-scope="scope">
  1206. <el-tooltip effect="dark" content="修改" placement="top">
  1207. <i
  1208. class="el-icon-edit tb-icon"
  1209. @click="openCostEdit(scope.$index, scope.row)"
  1210. ></i>
  1211. </el-tooltip>
  1212. <el-tooltip effect="dark" content="删除" placement="top">
  1213. <i
  1214. class="el-icon-delete tb-icon"
  1215. @click="openCostEditDelete(scope.$index)"
  1216. ></i>
  1217. </el-tooltip>
  1218. </template>
  1219. </el-table-column>
  1220. </el-table>
  1221. </el-col>
  1222. </el-row>
  1223. <!-- 弹窗 新增/修改 -->
  1224. <cost-form-add-edit
  1225. :index="costmodelIndex"
  1226. :show-model="costshowModel"
  1227. :sitem="costsitem"
  1228. @refresh="costrefreshEdit"
  1229. @cancel="costshowModel = false"
  1230. />
  1231. <product-modal
  1232. :type="modalType"
  1233. :editIndex="editIndex"
  1234. :editItem="editItem"
  1235. :visible.sync="mVisible"
  1236. />
  1237. <product-list-modal :visible.sync="visible" @selected="handleProductSelected" />
  1238. </el-col>
  1239. <el-col
  1240. :span="24"
  1241. v-if="
  1242. type === 'editBase' || type === 'add' || type === 'editCoin' || type === 'edit'
  1243. "
  1244. style="text-align: right; padding: 15px 0 15px 0; border-top: 1px solid #dcdfe6"
  1245. >
  1246. <el-button :size="'mini'" type="primary" @click="submitForm">保 存</el-button>
  1247. </el-col>
  1248. </el-row>
  1249. </el-form>
  1250. </template>
  1251. <script>
  1252. import asyncRequest from "@/apis/service/goodStore/goodsCost";
  1253. import resToken from "@/mixins/resToken";
  1254. import { mapGetters } from "vuex";
  1255. import baseFormAddEdit from "./baseFormAddEdit";
  1256. import costFormAddEdit from "./costFormAddEdit";
  1257. import companyHelper from "@/mixins/companyHelper";
  1258. import { add_sum, accMul } from "@/utils/validate";
  1259. import CompanySort from "@/components/globalComponents/company-sort/index.vue";
  1260. import { replaceTextWrapAndSpace } from "@/utils";
  1261. import ProductModal from "./productModal.vue";
  1262. import ProductListModal from "./productListModal.vue";
  1263. import { isStockOptions } from "@/assets/js/statusList";
  1264. import { isArray } from "@/utils/validate";
  1265. import {
  1266. options1,
  1267. options2,
  1268. options3,
  1269. options4,
  1270. options5,
  1271. options6,
  1272. options7,
  1273. options8,
  1274. options9,
  1275. rules,
  1276. } from "../columns";
  1277. export default {
  1278. name: "goodsCostAdd",
  1279. mixins: [resToken, companyHelper],
  1280. props: ["showModel", "id", "type", "sitem", "business_companyNo"],
  1281. components: {
  1282. CompanySort,
  1283. baseFormAddEdit,
  1284. costFormAddEdit,
  1285. ProductModal,
  1286. ProductListModal,
  1287. },
  1288. computed: {
  1289. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  1290. powers() {
  1291. const { btnList } = this.$store.getters;
  1292. const tran = btnList.find((i) => i.menu_route == "goodsCostAdd") || {};
  1293. const { action } = tran ?? {};
  1294. return action ?? [];
  1295. },
  1296. },
  1297. watch: {
  1298. newTime: function (val) {
  1299. if (val) {
  1300. this.initForm();
  1301. }
  1302. },
  1303. },
  1304. data() {
  1305. return {
  1306. hasAccount: false,
  1307. isStockOptions,
  1308. areaInfo: {
  1309. delivery_place: {
  1310. code: [],
  1311. label: [],
  1312. },
  1313. origin_place: {
  1314. code: [],
  1315. label: [],
  1316. },
  1317. },
  1318. mVisible: false,
  1319. modalType: "",
  1320. editItem: null,
  1321. editIndex: -1,
  1322. childTableData: [],
  1323. visible: false,
  1324. companyName: "",
  1325. spec_tableData: [],
  1326. is_support_stock: "",
  1327. cat_id_name: "",
  1328. brand_name: "",
  1329. unit_name: "",
  1330. costshowModel: false,
  1331. costmodelIndex: "",
  1332. costsitem: {},
  1333. showModel: false,
  1334. modelIndex: "",
  1335. is_noble: false,
  1336. size: "small",
  1337. status: "",
  1338. rulesThis: this.rules,
  1339. activeName: "1",
  1340. loading: true,
  1341. supplierName: "",
  1342. cgdSupplierName: "",
  1343. options1: options1,
  1344. options2: options2,
  1345. options3: options3,
  1346. options4: options4,
  1347. options5: options5,
  1348. options6: options6,
  1349. options7: options7,
  1350. options8: options8,
  1351. options9: options9,
  1352. sourceCombindList: [],
  1353. ruleForm: {
  1354. is_combind: "",
  1355. company_id: "",
  1356. },
  1357. spec_tableData: [],
  1358. old_spec_tableData: [],
  1359. ladder_tableData: [],
  1360. old_ladder_tableData: [],
  1361. rules: rules,
  1362. };
  1363. },
  1364. mounted() {
  1365. this.initForm();
  1366. },
  1367. methods: {
  1368. async handleResignName(evt) {
  1369. const { id,label} = evt;
  1370. this.ruleForm.cgd_apply_id = id ? [id] : [];
  1371. this.ruleForm.cgd_apply_name = label || "";
  1372. this.$refs.ruleForm.validateField("cgd_apply_id")
  1373. },
  1374. number_change_origin(e){
  1375. this.ruleForm['supplier_origin_price'] = e + "" || "0";
  1376. this.$refs.ruleForm && this.$refs.ruleForm.validateField('supplier_origin_price');
  1377. },
  1378. supplierCgdChange(e){
  1379. const { id, code, label } = e;
  1380. if (id) {
  1381. this.ruleForm.cgd_supplier_code = [code];
  1382. } else {
  1383. this.ruleForm.cgd_supplier_code = [];
  1384. }
  1385. this.$refs.ruleForm.validateField("cgd_supplier_code");
  1386. },
  1387. num_change(evt, index) {
  1388. this.$set(this.childTableData, index, {
  1389. ...this.childTableData[index],
  1390. child_num: evt,
  1391. });
  1392. },
  1393. onSaveLine(index) {
  1394. const { child_num } = this.childTableData[index];
  1395. if (Number(child_num) === 0) {
  1396. this.$message.warning("组合比例不能为零!");
  1397. return;
  1398. }
  1399. this.editIndex = -1;
  1400. },
  1401. onChildProdChange(index = null, type = "view") {
  1402. this.modalType = type;
  1403. if (type === "add") {
  1404. if (this.editIndex !== -1) {
  1405. this.$message.warning("当前有正在编辑的子商品,请先保存");
  1406. return;
  1407. }
  1408. if (this.childTableData.length === 10) {
  1409. this.$message.warning("子商品最多不能超过十条");
  1410. return;
  1411. }
  1412. }
  1413. if (type === "view" && index !== null) {
  1414. this.editItem = { ...this.childTableData[index] };
  1415. } else {
  1416. this.editItem = null;
  1417. }
  1418. if (type === "edit") {
  1419. if (this.editIndex !== -1) {
  1420. this.$message.warning("当前有正在编辑的子商品,请先保存");
  1421. return;
  1422. }
  1423. this.editIndex = index !== null ? index : -1;
  1424. return;
  1425. }
  1426. this[type === "view" ? "mVisible" : "visible"] = true;
  1427. },
  1428. handleProductSelected(selecteds = []) {
  1429. const childCodes = this.childTableData.map(({ childCode }) => childCode);
  1430. selecteds.forEach((item) => {
  1431. const { childCode, child_name } = item;
  1432. const _t = { childCode, child_name, child_num: 1 };
  1433. if (!childCodes.includes(childCode)) {
  1434. this.childTableData.push(_t);
  1435. }
  1436. });
  1437. },
  1438. onCompanyChange() {
  1439. if (this.type === "add") {
  1440. this.ruleForm.company_id = this.currentCompany;
  1441. }
  1442. },
  1443. async initForm() {
  1444. this.loading = true;
  1445. this.resetFormData();
  1446. this.rulesThis = this.rules;
  1447. await this.resetForm();
  1448. this.sch_is_noble();
  1449. this.good_type_change();
  1450. await this.get_golpricelast();
  1451. this.stock_change();
  1452. this.loading = false;
  1453. },
  1454. async number_change(e, key) {
  1455. this.ruleForm[key] = e + "" || "0";
  1456. this.$refs.ruleForm && this.$refs.ruleForm.validateField(key);
  1457. await this.get_all_fee();
  1458. },
  1459. openEdit(index, sitem) {
  1460. this.modelIndex = index;
  1461. this.sitem = sitem;
  1462. this.showModel = true;
  1463. },
  1464. stock_change() {
  1465. if (this.ruleForm.is_stock === "0") {
  1466. this.ruleForm.is_combind = "0";
  1467. }
  1468. this.rulesThis.stock_moq[0].required = this.ruleForm.is_stock === "1";
  1469. },
  1470. onDeleteItem(index) {
  1471. if (this.editIndex !== -1) {
  1472. this.$message.warning("当前有正在编辑的子商品,请先保存");
  1473. return;
  1474. }
  1475. this.childTableData.splice(index, 1);
  1476. // if (index === this.editIndex) {
  1477. // this.editIndex = -1;
  1478. // }
  1479. },
  1480. openCostEdit(index, sitem) {
  1481. // const { is_step } = this.ruleForm;
  1482. // if (index === -1 && is_step === "0" && this.ladder_tableData.length > 0) {
  1483. // this.$message.warning("不启用阶梯成本,只能录入一条阶梯成本信息!");
  1484. // return;
  1485. // }
  1486. this.costmodelIndex = index;
  1487. this.costsitem = sitem;
  1488. this.costshowModel = true;
  1489. },
  1490. openDelete(index) {
  1491. this.spec_tableData.splice(index, 1);
  1492. },
  1493. openCostEditDelete(index) {
  1494. this.ladder_tableData.splice(index, 1);
  1495. },
  1496. // is_step_change() {
  1497. // const { is_step } = this.ruleForm;
  1498. // if (is_step === "0") {
  1499. // let res = [];
  1500. // let list =
  1501. // this.ladder_tableData.length === 0
  1502. // ? []
  1503. // : JSON.parse(JSON.stringify(this.ladder_tableData));
  1504. // if (list.length > 0) {
  1505. // res.push(list[0]);
  1506. // }
  1507. // this.ladder_tableData = res;
  1508. // }
  1509. // },
  1510. async submitForm() {
  1511. if (this.editIndex !== -1) {
  1512. this.$message.warning("当前有正在编辑的子商品,请先保存");
  1513. return;
  1514. }
  1515. const { is_combind, is_gold_price } = this.ruleForm;
  1516. if (is_combind === "1" && is_gold_price === "1" && this.is_noble) {
  1517. this.$message.warning("组合商品不能启用实时金价");
  1518. return;
  1519. }
  1520. this.sch_is_noble();
  1521. this.good_type_change();
  1522. this.ruleForm.good_remark = replaceTextWrapAndSpace(this.ruleForm.good_remark);
  1523. this.ruleForm.craft_desc = replaceTextWrapAndSpace(this.ruleForm.craft_desc);
  1524. this.ruleForm.after_sales = replaceTextWrapAndSpace(this.ruleForm.after_sales);
  1525. await this.$refs.ruleForm.validate(async (valid) => {
  1526. if (valid) {
  1527. if (!this.loading) {
  1528. this.loading = true;
  1529. const {
  1530. noble_weight,
  1531. weight,
  1532. is_gold_price,
  1533. stock_moq,
  1534. is_stock,
  1535. supplierNo,
  1536. company_id,
  1537. } = this.ruleForm;
  1538. if (supplierNo.toString() === company_id) {
  1539. this.$message.warning("供应商不能与业务公司相同!");
  1540. loading = false;
  1541. return;
  1542. }
  1543. if (this.is_support_stock + "" === "0" && is_stock === "0") {
  1544. this.$message.warning("该商品为供应商退货业务创建的,不允许改为非库存品!");
  1545. loading = false;
  1546. return;
  1547. }
  1548. if (is_stock === "0") {
  1549. const { scode, sdata, smsg } = await this.getSupplerPower();
  1550. if (scode === 0) {
  1551. const { has_account } = sdata;
  1552. if (has_account + "" === "1") {
  1553. this.$message.warning("该供应商已开通账号,不允许创建非库存商品!");
  1554. this.loading = false;
  1555. return;
  1556. }
  1557. }
  1558. }
  1559. if (this.spec_tableData.length === 0) {
  1560. this.$message.warning("请录入商品规格信息!");
  1561. this.loading = false;
  1562. return;
  1563. }
  1564. let isMust = true;
  1565. this.spec_tableData.forEach((e) => {
  1566. if (e.isMust && !e.spec_value_id) {
  1567. isMust = false;
  1568. }
  1569. });
  1570. if (!isMust) {
  1571. this.$message.warning("分类绑定的规格必须填写规格值!");
  1572. this.loading = false;
  1573. return;
  1574. }
  1575. if (this.ladder_tableData.length === 0) {
  1576. this.$message.warning("请录入阶梯成本!");
  1577. this.loading = false;
  1578. return;
  1579. }
  1580. // stock_moq
  1581. if (is_stock === "1") {
  1582. let min = parseInt(this.ladder_tableData[0].min_num),
  1583. smoq = parseInt(stock_moq);
  1584. this.ladder_tableData.forEach((si) => {
  1585. let n = parseInt(si.min_num);
  1586. min = n < min ? n : min;
  1587. });
  1588. if (smoq < min) {
  1589. this.$message.warning("备库起订量不能低于成本最低起订量!");
  1590. this.loading = false;
  1591. return;
  1592. }
  1593. }
  1594. if (this.is_noble) {
  1595. if (noble_weight * 1000 > weight * 1000) {
  1596. this.$message.warning("贵金属总重量不能大于商品总重量!");
  1597. this.loading = false;
  1598. return;
  1599. }
  1600. }
  1601. if (is_gold_price === "1" && this.is_noble) {
  1602. let is_p = true;
  1603. this.ladder_tableData.forEach((v) => {
  1604. if (v.nake_fee * 1 !== 0) {
  1605. is_p = false;
  1606. }
  1607. });
  1608. }
  1609. let model = JSON.parse(JSON.stringify(this.ruleForm));
  1610. model.cat_id = model.cat_id.toString();
  1611. model.brandid = model.brandid.toString();
  1612. model.supplierNo = model.supplierNo.toString();
  1613. model.delivery_place = model.delivery_place.toString();
  1614. model.origin_place = model.origin_place.toString();
  1615. model.good_info_img = model.good_info_img.toString();
  1616. model.good_img = model.good_img.toString();
  1617. model.unit = model.unit.toString();
  1618. model.speclist = JSON.parse(JSON.stringify(this.setResData(1)));
  1619. model.good_ladder = JSON.parse(JSON.stringify(this.setResData(2)));
  1620. model.config = model.config.toString();
  1621. model.is_exclusive =
  1622. model.is_exclusive.length > 0
  1623. ? model.is_exclusive[model.is_exclusive.length - 1]
  1624. : "";
  1625. let res = {};
  1626. delete model["id"];
  1627. if (model.is_combind === "1") {
  1628. if (this.childTableData.length === 0) {
  1629. this.message.warning("请添加子商品!");
  1630. return;
  1631. }
  1632. if (this.childTableData.length === 1) {
  1633. this.message.warning("子商品数量必须大于1!");
  1634. return;
  1635. }
  1636. if (this.type === "add") {
  1637. model.combind_list = this.childTableData.map((item) => ({
  1638. ...item,
  1639. is_del: "0",
  1640. }));
  1641. } else {
  1642. const currentIds = this.childTableData.map(({ id }) => id);
  1643. // 删除项
  1644. const delCombinds = this.sourceCombindList
  1645. .filter(({ id }) => !currentIds.includes(String(id)))
  1646. .map((item) => ({
  1647. ...item,
  1648. is_del: "1",
  1649. }));
  1650. //原项
  1651. const sourceCombinds = this.sourceCombindList
  1652. .filter(({ id }) => currentIds.includes(String(id)))
  1653. .map((item) => ({
  1654. ...item,
  1655. is_del: "0",
  1656. }));
  1657. const addCombinds = this.childTableData
  1658. .filter(({ id }) => !id)
  1659. .map(({ childCode, child_num, child_name }) => ({
  1660. childCode,
  1661. child_num,
  1662. child_name,
  1663. is_del: "0",
  1664. }));
  1665. model.combind_list = [...delCombinds, ...sourceCombinds, ...addCombinds];
  1666. }
  1667. }
  1668. model.supplier_origin_price = this.hasAccount ? model.supplier_origin_price : "";
  1669. model.cgd_apply_name = this.hasAccount ? model.cgd_apply_name : "";
  1670. model.cgd_apply_id = this.hasAccount ? model.cgd_apply_id[0] : "";
  1671. model.cgd_supplier_code = this.hasAccount ? model.cgd_supplier_code[0] : "";
  1672. if (this.type === "add") {
  1673. delete model["spuCode"];
  1674. res = await asyncRequest.add(model);
  1675. } else if (this.type === "editBase") {
  1676. let item1 = this.setModel(model, "1");
  1677. res = await asyncRequest.update(item1);
  1678. } else if (this.type === "editCoin") {
  1679. let item2 = this.setModel(model, "2");
  1680. res = await asyncRequest.updateP(item2);
  1681. } else {
  1682. model.companyNo = model.company_id;
  1683. delete model["company_id"];
  1684. res = await asyncRequest.edit_update(model);
  1685. }
  1686. // console.log(res);
  1687. this.loading = false;
  1688. const { code, data, message } = res;
  1689. if (code === 0) {
  1690. const title =
  1691. this.type === "add"
  1692. ? "新建成功!"
  1693. : this.type === "editBase"
  1694. ? "基础信息修改成功!"
  1695. : this.type === "editCoin"
  1696. ? "成本信息修改成功!"
  1697. : "商品信息修改成功";
  1698. this.$notify.success({
  1699. title: title,
  1700. message: "",
  1701. });
  1702. this.showModelThis = false;
  1703. // 刷新
  1704. this.$emit("refresh");
  1705. } else if (code >= 100 && code <= 104) {
  1706. await this.logout();
  1707. } else {
  1708. this.$message.warning(message);
  1709. }
  1710. }
  1711. } else {
  1712. // console.log("error submit!!");
  1713. return false;
  1714. }
  1715. });
  1716. },
  1717. groupGoodChange(e) {
  1718. this.ruleForm.is_combind = e;
  1719. },
  1720. //获取规格值
  1721. setResData(type) {
  1722. let list = JSON.parse(
  1723. JSON.stringify(type === 1 ? this.spec_tableData : this.ladder_tableData)
  1724. );
  1725. let oldlist = JSON.parse(
  1726. JSON.stringify(type === 1 ? this.old_spec_tableData : this.old_ladder_tableData)
  1727. );
  1728. let hasIDlist = [];
  1729. list.forEach((a) => {
  1730. if (a.id !== "") {
  1731. hasIDlist.push(a);
  1732. }
  1733. });
  1734. let newList = [];
  1735. let resList = [];
  1736. oldlist.forEach((a, ai) => {
  1737. let item = null;
  1738. let index = hasIDlist.findIndex((b) => a.id === b.id);
  1739. if (index === -1) {
  1740. item = JSON.parse(JSON.stringify(a));
  1741. item.is_del = "1";
  1742. } else {
  1743. item = JSON.parse(JSON.stringify(hasIDlist[index]));
  1744. }
  1745. newList.push(item);
  1746. });
  1747. list.forEach((b) => {
  1748. if (b.id === "") {
  1749. b.is_del = "0";
  1750. newList.push(b);
  1751. }
  1752. });
  1753. if (type === 1) {
  1754. newList.forEach((a) => {
  1755. let m = {
  1756. id: a.id,
  1757. spec_id: a.spec_id,
  1758. spec_value_id: a.spec_value_id,
  1759. is_del: a.is_del || "0",
  1760. };
  1761. resList.push(m);
  1762. });
  1763. } else {
  1764. newList.forEach((a) => {
  1765. let m = {
  1766. id: a.id,
  1767. min_num: a.min_num,
  1768. nake_fee: a.nake_fee,
  1769. cost_fee: a.cost_fee,
  1770. delivery_fee: a.delivery_fee,
  1771. cert_fee: a.cert_fee,
  1772. mark_fee: a.mark_fee,
  1773. package_fee: a.package_fee,
  1774. other_fee: a.other_fee,
  1775. is_del: a.is_del || "0",
  1776. };
  1777. resList.push(m);
  1778. });
  1779. }
  1780. return resList;
  1781. },
  1782. setladder() {
  1783. let list = JSON.parse(JSON.stringify(this.ladder_tableData));
  1784. let oldlist = JSON.parse(JSON.stringify(this.old_ladder_tableData));
  1785. let hasIDlist = [];
  1786. list.forEach((a) => {
  1787. if (a.id !== "") {
  1788. hasIDlist.push(a);
  1789. }
  1790. });
  1791. let newList = [];
  1792. let resList = [];
  1793. oldlist.forEach((a, ai) => {
  1794. let item = null;
  1795. let index = hasIDlist.findIndex((b) => a.id === b.id);
  1796. if (index === -1) {
  1797. item = JSON.parse(JSON.stringify(a));
  1798. item.is_del = "1";
  1799. } else {
  1800. item = JSON.parse(JSON.stringify(b));
  1801. }
  1802. newList.push(item);
  1803. });
  1804. list.forEach((b) => {
  1805. if (b.id === "") {
  1806. b.is_del = "0";
  1807. newList.push(b);
  1808. }
  1809. });
  1810. newList.forEach((a) => {
  1811. let m = {
  1812. id: a.id,
  1813. min_num: a.min_num,
  1814. spec_value_id: a.spec_value_id,
  1815. is_del: a.is_del || "0",
  1816. };
  1817. resList.push(m);
  1818. });
  1819. return resList;
  1820. },
  1821. //规格编辑修改
  1822. refreshEdit(e) {
  1823. let item = JSON.parse(JSON.stringify(e));
  1824. const {
  1825. index,
  1826. id,
  1827. spec_id,
  1828. isMust,
  1829. spec_value,
  1830. spec_value_id,
  1831. spec_value_value,
  1832. } = item;
  1833. let ffindex = -1;
  1834. this.spec_tableData.forEach((i, findex) => {
  1835. if (i.spec_id === spec_id) {
  1836. ffindex = findex;
  1837. this.spec_tableData[findex].id = id;
  1838. this.spec_tableData[findex].spec_id = spec_id;
  1839. // this.spec_tableData[findex].isMust = isMust;
  1840. this.spec_tableData[findex].spec_value = spec_value;
  1841. this.spec_tableData[findex].spec_value_id = spec_value_id;
  1842. this.spec_tableData[findex].spec_value_value = spec_value_value;
  1843. }
  1844. });
  1845. if (ffindex === -1) {
  1846. this.spec_tableData.push(item);
  1847. }
  1848. this.showModel = false;
  1849. },
  1850. //阶梯成本修改
  1851. async costrefreshEdit(e) {
  1852. let item = JSON.parse(JSON.stringify(e));
  1853. const {
  1854. index,
  1855. id,
  1856. cost_fee,
  1857. delivery_fee,
  1858. min_num,
  1859. nake_fee,
  1860. cert_fee,
  1861. mark_fee,
  1862. package_fee,
  1863. other_fee,
  1864. } = item;
  1865. let isok = true;
  1866. let ffindex = -1;
  1867. if (this.ladder_tableData && this.ladder_tableData.length === 0) {
  1868. this.ladder_tableData.push(item);
  1869. } else {
  1870. this.ladder_tableData.forEach((i, findex) => {
  1871. if (parseInt(min_num + "") === parseInt(i.min_num + "")) {
  1872. isok = false;
  1873. this.ladder_tableData[findex].id = id;
  1874. this.ladder_tableData[findex].min_num = min_num;
  1875. this.ladder_tableData[findex].cost_fee = cost_fee;
  1876. this.ladder_tableData[findex].delivery_fee = delivery_fee;
  1877. this.ladder_tableData[findex].nake_fee = nake_fee;
  1878. this.ladder_tableData[findex].cert_fee = cert_fee;
  1879. this.ladder_tableData[findex].mark_fee = mark_fee;
  1880. this.ladder_tableData[findex].package_fee = package_fee;
  1881. this.ladder_tableData[findex].other_fee = other_fee;
  1882. }
  1883. });
  1884. if (isok) {
  1885. this.ladder_tableData.forEach((i, findex) => {
  1886. if (findex === parseInt(index + "")) {
  1887. ffindex = findex;
  1888. this.ladder_tableData[findex].id = id;
  1889. this.ladder_tableData[findex].min_num = min_num;
  1890. this.ladder_tableData[findex].cost_fee = cost_fee;
  1891. this.ladder_tableData[findex].delivery_fee = delivery_fee;
  1892. this.ladder_tableData[findex].nake_fee = nake_fee;
  1893. this.ladder_tableData[findex].cert_fee = cert_fee;
  1894. this.ladder_tableData[findex].mark_fee = mark_fee;
  1895. this.ladder_tableData[findex].package_fee = package_fee;
  1896. this.ladder_tableData[findex].other_fee = other_fee;
  1897. }
  1898. });
  1899. if (ffindex === -1) {
  1900. this.ladder_tableData.push(item);
  1901. }
  1902. }
  1903. }
  1904. await this.get_all_fee();
  1905. this.showModel = false;
  1906. },
  1907. async get_golpricelast() {
  1908. const { noble_metal } = this.ruleForm;
  1909. if (noble_metal) {
  1910. let model = {
  1911. type: noble_metal,
  1912. };
  1913. const { code, data, message } = await asyncRequest.golpricelast(model);
  1914. if (code === 0) {
  1915. data.forEach((e) => {
  1916. if (e.type) {
  1917. this.ruleForm.noble_price = e.price;
  1918. }
  1919. });
  1920. } else if (code >= 100 && code <= 104) {
  1921. await this.logout();
  1922. } else {
  1923. this.$message.warning(message);
  1924. }
  1925. } else {
  1926. this.ruleForm.noble_price = "0";
  1927. }
  1928. },
  1929. async get_all_fee() {
  1930. await this.get_golpricelast();
  1931. this.ladder_tableData.forEach((si, sii) => {
  1932. this.ladder_tableData[sii].nake_total = this.count_fee(si);
  1933. this.$set(this.ladder_tableData, sii, this.ladder_tableData[sii]);
  1934. });
  1935. },
  1936. count_fee(e) {
  1937. const {
  1938. noble_price, //供应商采购金价
  1939. is_gold_price, //是否启用实时金价
  1940. noble_weight, //贵金属重量
  1941. } = this.ruleForm;
  1942. const {
  1943. nake_fee, //成本单价
  1944. cost_fee, //工艺费
  1945. delivery_fee, //物流费
  1946. cert_fee, //证书费
  1947. mark_fee, //加标费
  1948. package_fee, //包装费
  1949. other_fee, //其他费用
  1950. } = e;
  1951. let XA = add_sum(nake_fee, delivery_fee),
  1952. XB = add_sum(package_fee, cert_fee),
  1953. XC = add_sum(mark_fee, other_fee),
  1954. XD = 0;
  1955. let total = add_sum(add_sum(XA, XB), XC);
  1956. // console.log(total);
  1957. if (this.is_noble && is_gold_price === "1") {
  1958. XD = add_sum(accMul(noble_price, noble_weight), accMul(noble_weight, cost_fee));
  1959. total = add_sum(total, XD);
  1960. }
  1961. return total;
  1962. },
  1963. dataSort(key) {
  1964. return function (a, b) {
  1965. let value1 = a[key];
  1966. let value2 = b[key];
  1967. return value1 - value2;
  1968. };
  1969. },
  1970. async getSupplerPower() {
  1971. const { code, data, message } = await asyncRequest.supplerlist({
  1972. code: this.ruleForm.supplierNo[0],
  1973. is_platform: "",
  1974. name: "",
  1975. page: 1,
  1976. size: 1000,
  1977. });
  1978. return { scode: code, sdata: data, smsg: message };
  1979. },
  1980. resetFormData() {
  1981. this.is_support_stock = "1";
  1982. this.spec_tableData = [];
  1983. this.old_spec_tableData = [];
  1984. this.ladder_tableData = [];
  1985. this.old_ladder_tableData = [];
  1986. this.cat_id_name = "";
  1987. this.is_noble = false;
  1988. this.status = "";
  1989. this.brand_name = "";
  1990. this.unit_name = "";
  1991. this.supplierName = "";
  1992. this.cgdSupplierName = ""
  1993. this.ruleForm = {
  1994. id: "",
  1995. supplier_origin_price: "0.00",
  1996. cgd_apply_id: [],
  1997. cgd_apply_name: "",
  1998. cgd_supplier_code: [],
  1999. spuCode: "",
  2000. cat_id: [],
  2001. brandid: [],
  2002. noble_weight: "0",
  2003. weight: "0",
  2004. good_type: "0",
  2005. is_stock: "0",
  2006. supplierNo: [],
  2007. company_id: "",
  2008. is_auth: "",
  2009. tax: "",
  2010. good_name: "",
  2011. unit: [],
  2012. is_exclusive: [],
  2013. noble_metal: "",
  2014. is_gold_price: "",
  2015. moq: "",
  2016. customized: "",
  2017. after_sales: "",
  2018. craft_desc: "",
  2019. good_remark: "",
  2020. //包装发货/图片
  2021. packing_list: "",
  2022. packing_way: "",
  2023. packing_spec: "",
  2024. packing_weight: "",
  2025. packing_size: "",
  2026. good_size: "",
  2027. good_bar: "",
  2028. supply_area: "",
  2029. delivery_place: [],
  2030. origin_place: [],
  2031. delivery_day: "0",
  2032. lead_time: "0",
  2033. sample_day: "0",
  2034. good_thumb_img: "",
  2035. good_img: [],
  2036. good_info_img: [],
  2037. //固定阶梯成本
  2038. demo_fee: "0",
  2039. open_fee: "0",
  2040. sample_fee: "0",
  2041. market_price: "0",
  2042. cgd_gold_price: "0",
  2043. noble_price: "0",
  2044. // is_step: "0",
  2045. is_diff: "",
  2046. config: [],
  2047. other_config: "",
  2048. stock_moq: "0",
  2049. is_combind: "",
  2050. };
  2051. },
  2052. async resetForm() {
  2053. // 重置
  2054. await this.$nextTick(async () => {
  2055. if (this.$refs.ruleForm) {
  2056. this.$refs.ruleForm.resetFields();
  2057. this.$refs.ruleForm.clearValidate();
  2058. this.spec_tableData = [];
  2059. this.old_spec_tableData = [];
  2060. this.ladder_tableData = [];
  2061. this.old_ladder_tableData = [];
  2062. const {
  2063. id,
  2064. supplier_origin_price,
  2065. cgd_apply_id,
  2066. cgd_apply_name,
  2067. cgd_supplier_code,
  2068. companyName,
  2069. spuCode, //string 商品spuCode
  2070. // good_code, //string 无
  2071. good_name, //string 商品名称
  2072. // cat_id, //string 分类id
  2073. cat_info, //array 分类
  2074. brand_id, //string 品牌id
  2075. unit,
  2076. supplierName,
  2077. companyNo, // string 企业公司id
  2078. good_unit, // string 商品单位
  2079. good_type, //string 是否定制 1是0否
  2080. moq, //string 起订量
  2081. is_exclusive, // string 是否是专属
  2082. customized, // string 定制工期
  2083. tax, //string 税率
  2084. supplierNo, // string 供应商
  2085. is_auth, //string 是否有销售权限0 否1 是
  2086. auth_img, // string 无
  2087. exclusive,
  2088. is_stock, //
  2089. after_sales, // string 售后说明
  2090. craft_desc, // string 工艺说明
  2091. good_remark, // string 商品备注
  2092. weight, // string 重量
  2093. packing_way, // string 包装方式
  2094. packing_size, // string 包装尺寸
  2095. good_size, //商品尺寸
  2096. packing_spec, // string 包装规格
  2097. packing_list, // string 包装清单
  2098. packing_weight, // string 装箱重量
  2099. good_bar, // string 条形码
  2100. supply_area, // string 供货区域 1 全国2 除偏远地区
  2101. delivery_place, // string 发货地区
  2102. origin_place, // string 产地
  2103. delivery_day, // string 物流天数
  2104. lead_time, // string 供货周期
  2105. sample_day, //string 调样周期
  2106. sample_fee, // string 调样费有
  2107. good_img, // string 商品图片
  2108. good_thumb_img, // string 商品说略图
  2109. good_info_img, // string 商品详情图
  2110. demo_fee, // string 打样费
  2111. open_fee, // string 开模费
  2112. noble_metal, // string 金属类别
  2113. noble_weight, // string 金属重量
  2114. is_gold_price, // string 是否使用实时金价
  2115. market_price, // string 市场价
  2116. cgd_gold_price, // string 供应商采购金价
  2117. noble_price,
  2118. // is_step, // string 是否使用阶梯价
  2119. // is_online, // string 是否上线
  2120. status, // string 状态
  2121. nakelist, //阶梯成本
  2122. speclist, //商品规格
  2123. brand_name,
  2124. config,
  2125. is_diff,
  2126. other_config,
  2127. stock_moq,
  2128. is_support_stock,
  2129. is_combind,
  2130. combind_list,
  2131. cgd_supplier_name
  2132. } = this.sitem;
  2133. console.log(good_img);
  2134. if (this.type !== "add") {
  2135. const { name, area_code } = await this.getArea("delivery_place");
  2136. if (name && area_code) {
  2137. this.areaInfo.delivery_place.label = [name];
  2138. this.areaInfo.delivery_place.code = [area_code];
  2139. const { name: _name, area_code: _area_code } = await this.getArea(
  2140. "origin_place"
  2141. );
  2142. this.areaInfo.origin_place.label = [_name];
  2143. this.areaInfo.origin_place.code = [_area_code];
  2144. }
  2145. }
  2146. this.companyName = companyName;
  2147. if (this.type !== "add") {
  2148. this.childTableData = combind_list.map(
  2149. ({ childCode, child_name, child_num, id }) => ({
  2150. childCode,
  2151. child_name,
  2152. child_num,
  2153. id,
  2154. })
  2155. );
  2156. this.sourceCombindList = this.childTableData.map((item) => ({
  2157. ...item,
  2158. }));
  2159. }
  2160. this.is_support_stock = is_support_stock || "1";
  2161. let cat_id_name = "";
  2162. let cat_id = [];
  2163. (cat_info || []).forEach((ai, i) => {
  2164. cat_id_name += i === 0 ? ai.name : `_${ai.name}`;
  2165. cat_id.push(ai.id);
  2166. });
  2167. this.cat_id_name = cat_id_name;
  2168. let isok = false;
  2169. if (cat_id.length > 0) {
  2170. cat_id.forEach((i) => {
  2171. if (i === "6") {
  2172. isok = true;
  2173. }
  2174. });
  2175. }
  2176. let exclusiveList = [];
  2177. if (exclusive && exclusive.length > 0) {
  2178. exclusive.forEach((a, ai) => {
  2179. exclusiveList.push(a.id);
  2180. });
  2181. }
  2182. this.is_noble = isok;
  2183. let spec_list1 =
  2184. speclist && speclist.length > 0 ? JSON.parse(JSON.stringify(speclist)) : [];
  2185. spec_list1.forEach((a) => {
  2186. let model = {
  2187. id: a.id,
  2188. is_del: a.is_del,
  2189. spec_id: a.spec_id,
  2190. spec_value: a.spec_name,
  2191. spec_value_value: a.spec_value,
  2192. spec_value_id: a.spec_value_id,
  2193. spuCode: a.spuCode,
  2194. };
  2195. this.spec_tableData.push(model);
  2196. });
  2197. this.old_spec_tableData = JSON.parse(JSON.stringify(this.spec_tableData));
  2198. let list2 =
  2199. nakelist && nakelist.length > 0 ? JSON.parse(JSON.stringify(nakelist)) : [];
  2200. this.ladder_tableData = list2;
  2201. this.old_ladder_tableData = JSON.parse(JSON.stringify(this.ladder_tableData));
  2202. this.status = status;
  2203. this.brand_name = brand_name;
  2204. this.unit_name = unit;
  2205. this.supplierName = supplierName || "";
  2206. this.cgdSupplierName = cgd_supplier_name || "";
  2207. console.log(good_img);
  2208. console.log(good_info_img);
  2209. this.ruleForm = {
  2210. id: id || "",
  2211. supplier_origin_price: supplier_origin_price || "0.00",
  2212. cgd_apply_id: cgd_apply_id ? [cgd_apply_id] : [],
  2213. cgd_apply_name: cgd_apply_name ? cgd_apply_name : "",
  2214. cgd_supplier_code:cgd_supplier_code ? [cgd_supplier_code] : [],
  2215. spuCode: spuCode || "",
  2216. cat_id: cat_id && cat_id.length > 0 ? [cat_id[cat_id.length - 1]] : [],
  2217. brandid: brand_id ? [brand_id] : [],
  2218. noble_weight: noble_weight || "",
  2219. weight: weight || "",
  2220. good_type: good_type || "0",
  2221. is_stock: is_stock || "0",
  2222. supplierNo: supplierNo ? [supplierNo] : [],
  2223. company_id: companyNo,
  2224. is_auth: is_auth || "",
  2225. tax: tax ? tax + "%" : "",
  2226. good_name: good_name || "",
  2227. unit: good_unit ? [good_unit] : [],
  2228. is_exclusive: exclusiveList || [],
  2229. noble_metal: noble_metal || "",
  2230. is_gold_price: is_gold_price || "0",
  2231. moq: moq || "0",
  2232. customized: customized || "0",
  2233. after_sales: after_sales || "",
  2234. craft_desc: craft_desc || "",
  2235. good_remark: good_remark || "",
  2236. //包装发货/图片
  2237. packing_list: packing_list || "",
  2238. packing_way: packing_way || "",
  2239. packing_spec: packing_spec || "",
  2240. packing_weight: packing_weight || "",
  2241. packing_size: packing_size || "",
  2242. good_size: good_size || "",
  2243. good_bar: good_bar || "",
  2244. supply_area: supply_area || "",
  2245. delivery_place: delivery_place ? (delivery_place || "").split(",") : [],
  2246. origin_place: origin_place ? (origin_place || "").split(",") : [],
  2247. delivery_day: delivery_day || "",
  2248. lead_time: lead_time || "",
  2249. sample_day: sample_day || "",
  2250. good_thumb_img: good_thumb_img || "",
  2251. good_img: good_img?!isArray(good_img || "") ? good_img.split(",") : []:[],
  2252. good_info_img:good_info_img||[] ,
  2253. //固定阶梯成本
  2254. demo_fee: demo_fee || "",
  2255. open_fee: open_fee || "",
  2256. sample_fee: sample_fee || "",
  2257. market_price: market_price || "",
  2258. cgd_gold_price: cgd_gold_price || "",
  2259. noble_price: noble_price || "0",
  2260. // is_step: is_step || "0",
  2261. is_diff: is_diff || "",
  2262. config: config ? config.split(",") : [],
  2263. other_config: other_config || "",
  2264. stock_moq: stock_moq || "0",
  2265. is_combind: is_combind || "",
  2266. };
  2267. }
  2268. if (this.type === "add") this.ruleForm.company_id = this.currentCompany;
  2269. await this.set_must_spec();
  2270. console.log(this.ruleForm);
  2271. });
  2272. },
  2273. sch_is_noble() {
  2274. let list = [
  2275. "noble_weight",
  2276. "noble_metal",
  2277. "is_gold_price",
  2278. "is_diff",
  2279. "config",
  2280. "other_config",
  2281. "cgd_gold_price",
  2282. ];
  2283. for (let i = 0; i < list.length; i++) {
  2284. if (list[i] === "cgd_gold_price") {
  2285. const { is_gold_price } = this.ruleForm;
  2286. this.rulesThis[list[i]][0].required = this.is_noble && is_gold_price === "1";
  2287. // console.log(list[i] + "===" + this.rulesThis[list[i]][0].required);
  2288. } else {
  2289. this.rulesThis[list[i]][0].required = this.is_noble;
  2290. }
  2291. this.$refs.ruleForm && this.$refs.ruleForm.validateField(list[i]);
  2292. }
  2293. },
  2294. setModel(model, type) {
  2295. let item = null;
  2296. if (type === 1) {
  2297. item = JSON.parse(JSON.stringify(model));
  2298. delete item["demo_fee"];
  2299. delete item["open_fee"];
  2300. delete item["noble_metal"];
  2301. delete item["noble_weight"];
  2302. delete item["is_gold_price"];
  2303. delete item["market_price"];
  2304. delete item["cgd_gold_price"];
  2305. // delete item["is_step"];
  2306. delete item["good_ladder"];
  2307. } else {
  2308. const {
  2309. demo_fee,
  2310. open_fee,
  2311. noble_metal,
  2312. noble_weight,
  2313. is_gold_price,
  2314. market_price,
  2315. cgd_gold_price,
  2316. // is_step,
  2317. good_ladder,
  2318. spuCode,
  2319. } = model;
  2320. item = {
  2321. demo_fee: demo_fee || "",
  2322. open_fee: open_fee || "",
  2323. noble_metal: noble_metal || "",
  2324. noble_weight: noble_weight || "",
  2325. is_gold_price: is_gold_price || "",
  2326. market_price: market_price || "",
  2327. cgd_gold_price: cgd_gold_price || "",
  2328. // is_step: is_step || "",
  2329. good_ladder: good_ladder || [],
  2330. spuCode: spuCode || "",
  2331. };
  2332. }
  2333. return model;
  2334. },
  2335. //商品分类选择
  2336. async goods_class_change(e) {
  2337. const { is_gold, pid, id, label, cat_desc } = e;
  2338. this.spec_tableData = [];
  2339. this.ruleForm.cat_id = id ? [id] : [];
  2340. this.$refs.ruleForm && this.$refs.ruleForm.validateField("cat_id");
  2341. this.ruleForm.after_sales = cat_desc || "";
  2342. this.$refs.ruleForm && this.$refs.ruleForm.validateField("after_sales");
  2343. this.is_noble = is_gold;
  2344. this.sch_is_noble();
  2345. await this.set_must_spec();
  2346. await this.get_all_fee();
  2347. },
  2348. async getArea(prop = "delivery_place") {
  2349. const chunks = this.sitem[prop].split(",");
  2350. if (chunks.length !== 3) return { nanme: "", area_code: "" };
  2351. let { data: province } = await asyncRequest.province();
  2352. province = province.find(({ province_code }) => province_code === chunks[0]);
  2353. let { data: city } = await asyncRequest.city({ code: chunks[0] });
  2354. city = city.find(({ city_code }) => city_code === chunks[1]);
  2355. let { data: area } = await asyncRequest.area({ code: chunks[1] });
  2356. return area.find(({ area_code }) => area_code === chunks[2]) || {};
  2357. },
  2358. async set_must_spec() {
  2359. const { cat_id } = this.ruleForm;
  2360. let id = cat_id.length == 1 ? cat_id[0] : "";
  2361. if (id) {
  2362. const { code, message, data } = await asyncRequest.catinfo({ id: id });
  2363. this.ruleForm.after_sales = data.cat_desc;
  2364. this.$refs.ruleForm && this.$refs.ruleForm.validateField("after_sales");
  2365. const unionSpec = (spec) => {
  2366. const newArr = [];
  2367. const map = new Map();
  2368. spec.forEach((item, index) => {
  2369. if (!map.has(item.id)) {
  2370. map.set(item.id, index);
  2371. newArr.push(item);
  2372. }
  2373. });
  2374. return newArr;
  2375. };
  2376. if (code === 0) {
  2377. const { spec: _spec = [] } = data;
  2378. const spec = unionSpec(_spec);
  2379. if (spec && spec.length > 0) {
  2380. if (this.spec_tableData && this.spec_tableData.length > 0) {
  2381. this.spec_tableData.forEach((c) => {
  2382. c.isMust = false;
  2383. });
  2384. spec.forEach((a, ai) => {
  2385. let findex = this.spec_tableData.findIndex(
  2386. (b) => b.spec_id + "" === a.id + ""
  2387. );
  2388. if (findex !== -1) {
  2389. this.spec_tableData[findex].isMust = true;
  2390. } else {
  2391. this.spec_tableData.push({
  2392. id: "",
  2393. index: "1",
  2394. spec_id: a.id + "",
  2395. spec_value: a.spec_name,
  2396. isMust: true,
  2397. spec_value_value: "",
  2398. spec_value_id: "",
  2399. });
  2400. }
  2401. });
  2402. } else {
  2403. spec.forEach((a, ai) => {
  2404. let model = {
  2405. id: "",
  2406. index: "1",
  2407. spec_id: a.id + "",
  2408. spec_value: a.spec_name,
  2409. isMust: true,
  2410. spec_value_value: "",
  2411. spec_value_id: "",
  2412. };
  2413. this.spec_tableData.push(model);
  2414. });
  2415. }
  2416. }
  2417. this.spec_tableData.map((e, ei) => {
  2418. e.index = ei + "";
  2419. return e;
  2420. });
  2421. this.spec_tableData.forEach((si, sii) => {
  2422. this.$set(this.spec_tableData, sii, si);
  2423. });
  2424. this.ruleForm.after_sales = data.cat_desc || "";
  2425. this.$refs.ruleForm && this.$refs.ruleForm.validateField("after_sales");
  2426. } else if (code >= 100 && code <= 104) {
  2427. await this.logout();
  2428. } else {
  2429. this.$message.warning(message);
  2430. }
  2431. } else {
  2432. this.spec_tableData.forEach((si, sii) => {
  2433. si.isMust = false;
  2434. this.$set(this.spec_tableData, sii, si);
  2435. });
  2436. }
  2437. },
  2438. async is_goold_price_change(e) {
  2439. await this.get_all_fee();
  2440. },
  2441. //商品品牌选择
  2442. brandidsearchChange(e) {
  2443. const { id, code, label } = e;
  2444. this.ruleForm.brandid = id ? [id] : [];
  2445. this.$refs.ruleForm && this.$refs.ruleForm.validateField("brandid");
  2446. },
  2447. //供应商选择
  2448. supplierNosearchChange(e) {
  2449. const { id, code, label,isPower } = e;
  2450. this.hasAccount = isPower;
  2451. this.ruleForm.supplierNo = code ? [code] : [];
  2452. this.$refs.ruleForm && this.$refs.ruleForm.validateField("supplierNo");
  2453. },
  2454. //业务企业选择
  2455. company_idsearchChange(e) {
  2456. const { code } = e;
  2457. this.ruleForm.company_id = code || "";
  2458. this.$refs.ruleForm && this.$refs.ruleForm.validateField("company_id");
  2459. },
  2460. //税点选择
  2461. taxsearchChange(e) {
  2462. this.ruleForm.tax = e;
  2463. this.$refs.ruleForm && this.$refs.ruleForm.validateField("tax");
  2464. },
  2465. //专属类型选择
  2466. exclusiveSearchChange(e) {
  2467. this.ruleForm.is_exclusive = e;
  2468. this.$refs.ruleForm && this.$refs.ruleForm.validateField("is_exclusive");
  2469. },
  2470. //单位选择
  2471. unitsearchChange(e) {
  2472. const { id, code, label } = e;
  2473. this.ruleForm.unit = code ? [code] : [];
  2474. this.$refs.ruleForm && this.$refs.ruleForm.validateField("unit");
  2475. },
  2476. //贵金属种类选择
  2477. async noble_metalsearchChange(e) {
  2478. const { id, code, label } = e;
  2479. this.ruleForm.noble_metal = id || "";
  2480. this.$refs.ruleForm && this.$refs.ruleForm.validateField("noble_metal");
  2481. await this.get_all_fee();
  2482. },
  2483. async areaChange(e, key) {
  2484. const { code, area_code, label } = e;
  2485. this.ruleForm[key] = code ? code.split(",") : [];
  2486. this.areaInfo[key].code = area_code ? [area_code] : [];
  2487. this.areaInfo[key].label = label ? [label] : [];
  2488. this.$refs.ruleForm && this.$refs.ruleForm.validateField(key);
  2489. },
  2490. //省市区
  2491. selectAreaChange(e, key) {
  2492. this.ruleForm[key] = e;
  2493. this.$refs.ruleForm && this.$refs.ruleForm.validateField(key);
  2494. },
  2495. closeImg(index, key) {
  2496. this.ruleForm[key].splice(index, 1);
  2497. this.$refs.ruleForm && this.$refs.ruleForm.validateField(key);
  2498. },
  2499. //图片上传成功
  2500. async UploadSuccessEvent(data, key) {
  2501. const { url } = data;
  2502. if (url === "noToken") {
  2503. await this.logout();
  2504. } else {
  2505. if (key === "good_thumb_img") {
  2506. this.ruleForm[key] = url;
  2507. } else {
  2508. if (this.ruleForm[key].length < 10) {
  2509. this.ruleForm[key].push(url);
  2510. }
  2511. }
  2512. this.$refs.ruleForm && this.$refs.ruleForm.validateField(key);
  2513. this.$message.success("图片上传成功!");
  2514. }
  2515. },
  2516. good_type_change() {
  2517. let list = ["moq", "customized"];
  2518. for (let i = 0; i < list.length; i++) {
  2519. this.rulesThis[list[i]][0].required = this.ruleForm.good_type === "1";
  2520. this.$refs.ruleForm && this.$refs.ruleForm.validateField(list[i]);
  2521. }
  2522. },
  2523. UploadErrorEvent(res, key) {
  2524. if (res !== "break") {
  2525. this.$message.error("图片上传失败!");
  2526. this.$refs.ruleForm && this.$refs.ruleForm.validateField(key);
  2527. }
  2528. },
  2529. //判断图片规格
  2530. beforeAvatarUpload(file) {
  2531. let isJPG = false;
  2532. if (
  2533. file.type === "image/jpg" ||
  2534. file.type === "image/png" ||
  2535. file.type === "image/jpeg"
  2536. ) {
  2537. isJPG = true;
  2538. }
  2539. const isLt2M = file.size / 1024 / 1024 < 1;
  2540. if (!isJPG) {
  2541. this.$message.error("图片格式不正确!");
  2542. }
  2543. if (!isLt2M) {
  2544. this.$message.error("图片大小不能超过 1MB!");
  2545. }
  2546. return isJPG && isLt2M;
  2547. },
  2548. },
  2549. };
  2550. </script>
  2551. <style lang="scss" scoped>
  2552. .goodsCostDetail {
  2553. // position: relative;
  2554. .good_info_img_div {
  2555. ul {
  2556. width: 100%;
  2557. li {
  2558. float: left;
  2559. width: 55px;
  2560. height: 55px;
  2561. padding: 0 5px 0 0;
  2562. .img-show-li-div {
  2563. width: 50px;
  2564. height: 50px;
  2565. border: 1px solid #dfe4ed;
  2566. background: #dfe4ed;
  2567. position: relative;
  2568. img.img-show {
  2569. width: 100%;
  2570. height: 100%;
  2571. position: relative;
  2572. display: inline-block;
  2573. }
  2574. i.el-icon-close {
  2575. position: absolute;
  2576. z-index: 2;
  2577. top: 0;
  2578. right: 0;
  2579. color: #dfe4ed;
  2580. }
  2581. &:hover {
  2582. i.el-icon-close {
  2583. cursor: pointer;
  2584. color: #6954f0;
  2585. }
  2586. }
  2587. }
  2588. }
  2589. }
  2590. }
  2591. .goodsCostAdd-title {
  2592. border-top: 1px solid #ebeef5;
  2593. span {
  2594. height: 50px;
  2595. line-height: 50px;
  2596. font-family: "微软雅黑", sans-serif;
  2597. font-weight: 400;
  2598. font-style: normal;
  2599. font-size: 16fpx;
  2600. text-align: left;
  2601. }
  2602. }
  2603. }
  2604. </style>