baseForm.vue 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078
  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-col :span="12">
  23. <el-form-item label="商品分类" prop="cat_id">
  24. <search-sort
  25. :value="ruleForm.cat_id"
  26. :placeholder="'商品分类'"
  27. :disabled="
  28. type === 'view' || type === 'editBase' || type === 'editCoin'
  29. "
  30. :size="'mini'"
  31. :names="cat_id_name"
  32. :isDetail="type !== 'add'"
  33. @searchChange="goods_class_change"
  34. />
  35. </el-form-item>
  36. </el-col>
  37. <el-col :span="12">
  38. <el-form-item label="商品名称" prop="good_name">
  39. <el-input
  40. placeholder="商品名称"
  41. maxlength="100"
  42. :disabled="type === 'view' || type === 'editCoin'"
  43. v-model="ruleForm.good_name"
  44. ></el-input>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :span="12">
  48. <el-form-item label="业务公司" prop="company_id">
  49. <search-work-company
  50. :value="ruleForm.company_id"
  51. :placeholder="'业务公司'"
  52. :disabled="
  53. type === 'view' || type === 'editBase' || type === 'editCoin'
  54. "
  55. :size="'mini'"
  56. :isDetail="type !== 'add'"
  57. @searchChange="company_idsearchChange"
  58. />
  59. </el-form-item>
  60. </el-col>
  61. <el-col :span="12">
  62. <el-form-item label="供应商" prop="supplierNo">
  63. <search-supplier
  64. :value="ruleForm.supplierNo"
  65. :placeholder="'供应商'"
  66. :disabled="type === 'view' || type === 'editCoin'"
  67. :size="'mini'"
  68. :names="supplierName"
  69. :isDetail="type !== 'add'"
  70. @searchChange="supplierNosearchChange"
  71. />
  72. </el-form-item>
  73. </el-col>
  74. <el-col :span="8">
  75. <el-form-item label="商品品牌" prop="brandid">
  76. <search-brand
  77. :value="ruleForm.brandid"
  78. :disabled="type === 'view' || type === 'editCoin'"
  79. :size="'mini'"
  80. :isDetail="type !== 'add'"
  81. :names="brand_name"
  82. :placeholder="'商品品牌'"
  83. @searchChange="brandidsearchChange"
  84. />
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="8">
  88. <el-form-item label="销售权限" prop="is_auth">
  89. <el-select
  90. v-model="ruleForm.is_auth"
  91. filterable
  92. clearable
  93. :disabled="type === 'view' || type === 'editCoin'"
  94. style="width: 100%"
  95. placeholder="销售权限"
  96. >
  97. <el-option
  98. v-for="group in options3"
  99. :key="group.id"
  100. :label="group.name"
  101. :value="group.id"
  102. />
  103. </el-select>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="4">
  107. <el-form-item label="单位" prop="unit" label-width="60px">
  108. <search-unit
  109. :value="ruleForm.unit"
  110. :disabled="type === 'view' || type === 'editCoin'"
  111. :size="'mini'"
  112. :isDetail="type !== 'add'"
  113. :names="unit_name"
  114. :placeholder="'单位'"
  115. @searchChange="unitsearchChange"
  116. />
  117. </el-form-item>
  118. </el-col>
  119. <el-col :span="4">
  120. <el-form-item label="税点" prop="tax" label-width="60px">
  121. <search-tax
  122. :value="ruleForm.tax"
  123. :disabled="
  124. type === 'view' || type === 'editBase' || type === 'editCoin'
  125. "
  126. :size="'mini'"
  127. :isDetail="type !== 'add'"
  128. :placeholder="'税点'"
  129. @searchChange="taxsearchChange"
  130. />
  131. </el-form-item>
  132. </el-col>
  133. <el-col :span="8">
  134. <el-form-item label="专属类型" prop="is_exclusive">
  135. <search-exclusive
  136. :disabled="type === 'view' || type === 'editCoin'"
  137. style="width: 100%"
  138. :isDetail="type !== 'add'"
  139. :size="'mini'"
  140. placeholder="专属类型"
  141. :value="ruleForm.is_exclusive"
  142. @selectChange="exclusiveSearchChange"
  143. />
  144. </el-form-item>
  145. </el-col>
  146. <el-col :span="8">
  147. <el-form-item label="商品总重量" prop="weight" label-width="95px">
  148. <digital-input
  149. :values="ruleForm.weight"
  150. :name="'ruleForm.weight'"
  151. :placeholder="'商品总重量'"
  152. :min="0"
  153. :disabled="type === 'view' || type === 'editCoin'"
  154. :max="100000000000"
  155. :position="'right'"
  156. :precision="3"
  157. :size="'mini'"
  158. :controls="false"
  159. :append="'g'"
  160. @reschange="number_change($event, 'weight')"
  161. />
  162. </el-form-item>
  163. </el-col>
  164. <el-col :span="8">
  165. <el-form-item label="是否库存品" prop="is_stock" label-width="95px">
  166. <el-select
  167. v-model="ruleForm.is_stock"
  168. filterable
  169. clearable
  170. :disabled="
  171. type === 'view' || type === 'editBase' || type === 'editCoin'
  172. "
  173. style="width: 100%"
  174. placeholder="是否库存品"
  175. >
  176. <el-option
  177. v-for="group in options4"
  178. :key="group.id"
  179. :label="group.name"
  180. :value="group.id"
  181. />
  182. </el-select>
  183. </el-form-item>
  184. </el-col>
  185. <el-col :span="24" v-show="is_noble">
  186. <el-row>
  187. <el-col :span="8">
  188. <el-form-item
  189. label="贵金属重量"
  190. prop="noble_weight"
  191. label-width="95px"
  192. >
  193. <digital-input
  194. :values="ruleForm.noble_weight"
  195. :placeholder="'贵金属重量'"
  196. :name="'ruleForm.noble_weight'"
  197. :min="0"
  198. :disabled="
  199. type === 'view' ||
  200. type === 'editBase' ||
  201. type === 'editCoin'
  202. "
  203. :max="100000000000"
  204. :position="'right'"
  205. :precision="3"
  206. :size="'mini'"
  207. :controls="false"
  208. :append="'g'"
  209. @reschange="number_change($event, 'noble_weight')"
  210. />
  211. </el-form-item>
  212. </el-col>
  213. <el-col :span="8">
  214. <el-form-item
  215. label="贵金属种类"
  216. prop="noble_metal"
  217. label-width="95px"
  218. >
  219. <search-metal-kind
  220. :value="ruleForm.noble_metal"
  221. :disabled="
  222. type === 'view' ||
  223. type === 'editBase' ||
  224. type === 'editCoin'
  225. "
  226. :size="'mini'"
  227. :isDetail="type !== 'add'"
  228. :placeholder="'贵金属种类'"
  229. @searchChange="noble_metalsearchChange"
  230. />
  231. </el-form-item>
  232. </el-col>
  233. <el-col :span="8">
  234. <el-form-item
  235. label="启用实时金价"
  236. prop="is_gold_price"
  237. label-width="110px"
  238. >
  239. <el-select
  240. v-model="ruleForm.is_gold_price"
  241. filterable
  242. clearable
  243. :disabled="
  244. type === 'view' ||
  245. type === 'editBase' ||
  246. type === 'editCoin'
  247. "
  248. style="width: 100%"
  249. placeholder="启用实时金价"
  250. >
  251. <el-option
  252. v-for="group in options5"
  253. :key="group.id"
  254. :label="group.name"
  255. :value="group.id"
  256. />
  257. </el-select>
  258. </el-form-item>
  259. </el-col>
  260. <el-col :span="6">
  261. <el-form-item label="有无工差" prop="is_diff">
  262. <el-select
  263. v-model="ruleForm.is_diff"
  264. filterable
  265. clearable
  266. :disabled="
  267. type === 'view' ||
  268. type === 'editBase' ||
  269. type === 'editCoin'
  270. "
  271. style="width: 100%"
  272. placeholder="有无工差"
  273. >
  274. <el-option
  275. v-for="group in options8"
  276. :key="group.id"
  277. :label="group.name"
  278. :value="group.id"
  279. />
  280. </el-select>
  281. </el-form-item>
  282. </el-col>
  283. <el-col :span="10">
  284. <el-form-item label="配置要求" prop="config" label-width="85px">
  285. <el-select
  286. v-model="ruleForm.config"
  287. multiple
  288. :disabled="type === 'view'"
  289. style="width: 100%"
  290. placeholder="配置要求"
  291. >
  292. <el-option
  293. v-for="(item, index) in options9"
  294. :key="item + index"
  295. :label="item"
  296. :value="item"
  297. >
  298. </el-option>
  299. </el-select>
  300. </el-form-item>
  301. </el-col>
  302. <el-col :span="8">
  303. <el-form-item
  304. label="其他配置要求"
  305. prop="other_config"
  306. label-width="110px"
  307. >
  308. <el-input
  309. placeholder="其他配置要求"
  310. maxlength="100"
  311. :disabled="type === 'view'"
  312. v-model="ruleForm.other_config"
  313. >
  314. </el-input>
  315. </el-form-item>
  316. </el-col>
  317. </el-row>
  318. </el-col>
  319. <el-col :span="8">
  320. <el-form-item label="售后说明" prop="after_sales">
  321. <el-input
  322. type="textarea"
  323. :rows="4"
  324. :disabled="type === 'view' || type === 'editCoin'"
  325. placeholder="售后说明"
  326. v-model="ruleForm.after_sales"
  327. >
  328. </el-input>
  329. </el-form-item>
  330. </el-col>
  331. <el-col :span="8">
  332. <el-form-item label="商品备注" prop="good_remark">
  333. <el-input
  334. type="textarea"
  335. :rows="4"
  336. :disabled="type === 'view' || type === 'editCoin'"
  337. placeholder="商品备注"
  338. v-model="ruleForm.good_remark"
  339. >
  340. </el-input>
  341. </el-form-item>
  342. </el-col>
  343. <el-col :span="8">
  344. <el-form-item label="工艺说明" prop="craft_desc">
  345. <el-input
  346. type="textarea"
  347. :disabled="type === 'view' || type === 'editCoin'"
  348. :rows="4"
  349. placeholder="工艺说明"
  350. v-model="ruleForm.craft_desc"
  351. >
  352. </el-input>
  353. </el-form-item>
  354. </el-col>
  355. <el-col :span="8">
  356. <el-form-item label="是否定制" prop="good_type">
  357. <el-select
  358. v-model="ruleForm.good_type"
  359. filterable
  360. :disabled="
  361. type === 'view' || type === 'editBase' || type === 'editCoin'
  362. "
  363. clearable
  364. style="width: 100%"
  365. placeholder="是否定制"
  366. @change="good_type_change"
  367. >
  368. <el-option
  369. v-for="group in options1"
  370. :key="group.id"
  371. :label="group.name"
  372. :value="group.id"
  373. />
  374. </el-select>
  375. </el-form-item>
  376. </el-col>
  377. <el-col :span="8" v-show="ruleForm.good_type === '1'">
  378. <el-form-item label="定制起订量" prop="moq" label-width="95px">
  379. <digital-input
  380. :values="ruleForm.moq"
  381. :placeholder="'定制起订量'"
  382. :name="'ruleForm.moq'"
  383. :min="0"
  384. :disabled="type === 'view' || type === 'editBase'"
  385. :max="100000000000"
  386. :position="'right'"
  387. :precision="0"
  388. :size="'mini'"
  389. :controls="false"
  390. :append="''"
  391. @reschange="number_change($event, 'moq')"
  392. />
  393. </el-form-item>
  394. </el-col>
  395. <el-col :span="8" v-show="ruleForm.good_type === '1'">
  396. <el-form-item label="定制工期" prop="customized">
  397. <digital-input
  398. :values="ruleForm.customized"
  399. :placeholder="'定制工期'"
  400. :name="'ruleForm.customized'"
  401. :min="0"
  402. :disabled="type === 'view' || type === 'editBase'"
  403. :max="100000000000"
  404. :position="'right'"
  405. :precision="0"
  406. :size="'mini'"
  407. :controls="false"
  408. :append="'天'"
  409. @reschange="number_change($event, 'customized')"
  410. />
  411. </el-form-item>
  412. </el-col>
  413. </el-row>
  414. </el-col>
  415. </el-row>
  416. <el-row class="ddiv">
  417. <el-col :span="1" class="dtitle">
  418. <ul>
  419. <li>规</li>
  420. <li>格</li>
  421. <li>信</li>
  422. <li>息</li>
  423. </ul>
  424. </el-col>
  425. <el-col :span="23" class="dmain" style="padding: 20px 0 20px 18px">
  426. <el-table
  427. :data="spec_tableData"
  428. :size="'mini'"
  429. border
  430. style="width: 100%"
  431. >
  432. <el-table-column prop="spec_value" label="规格类型" />
  433. <el-table-column prop="spec_value_value" label="规格值" />
  434. <el-table-column
  435. fixed="right"
  436. v-if="type === 'add' || type === 'editBase' || type === 'edit'"
  437. >
  438. <template slot="header" slot-scope="scope">
  439. <span>操作</span>
  440. <el-tooltip
  441. class="item"
  442. effect="dark"
  443. content="添加规格类型"
  444. placement="top"
  445. >
  446. <i
  447. class="el-icon-circle-plus-outline fr"
  448. style="font-size: 18px; margin-top: 2px"
  449. @click="openEdit('-1', {})"
  450. />
  451. </el-tooltip>
  452. </template>
  453. <template slot-scope="scope">
  454. <el-tooltip effect="dark" content="修改" placement="top">
  455. <i
  456. class="el-icon-edit tb-icon"
  457. @click="openEdit(scope.$index, scope.row)"
  458. ></i>
  459. </el-tooltip>
  460. <el-tooltip
  461. v-if="!scope.row.isMust"
  462. effect="dark"
  463. content="删除"
  464. placement="top"
  465. >
  466. <i
  467. class="el-icon-delete tb-icon"
  468. @click="openDelete(scope.$index)"
  469. ></i>
  470. </el-tooltip>
  471. </template>
  472. </el-table-column>
  473. </el-table>
  474. <!-- 弹窗 新增/修改 -->
  475. <base-form-add-edit
  476. :index="modelIndex"
  477. :show-model="showModel"
  478. :sitem="sitem"
  479. @refresh="refreshEdit"
  480. @cancel="showModel = false"
  481. />
  482. </el-col>
  483. </el-row>
  484. <el-row class="ddiv">
  485. <el-col :span="1" class="dtitle">
  486. <ul>
  487. <li>包</li>
  488. <li>装</li>
  489. <li>信</li>
  490. <li>息</li>
  491. </ul></el-col
  492. >
  493. <el-col :span="23" class="dmain">
  494. <el-row>
  495. <el-col :span="6">
  496. <el-form-item label="包装方式" prop="packing_way">
  497. <el-input
  498. placeholder="包装方式"
  499. :disabled="type === 'view' || type === 'editCoin'"
  500. v-model="ruleForm.packing_way"
  501. maxlength="250"
  502. />
  503. </el-form-item>
  504. </el-col>
  505. <el-col :span="6">
  506. <el-form-item label="装箱规格" prop="packing_spec">
  507. <el-input
  508. placeholder="装箱规格"
  509. :disabled="type === 'view' || type === 'editCoin'"
  510. v-model="ruleForm.packing_spec"
  511. maxlength="250"
  512. />
  513. </el-form-item>
  514. </el-col>
  515. <el-col :span="6">
  516. <el-form-item label="装箱重量" prop="packing_weight">
  517. <digital-input
  518. :values="ruleForm.packing_weight"
  519. :placeholder="'装箱重量'"
  520. :min="0"
  521. :name="'ruleForm.packing_weight'"
  522. :disabled="type === 'view' || type === 'editCoin'"
  523. :max="100000000000"
  524. :position="'right'"
  525. :precision="3"
  526. :size="'mini'"
  527. :controls="false"
  528. :append="'g'"
  529. @reschange="number_change($event, 'packing_weight')"
  530. />
  531. </el-form-item>
  532. </el-col>
  533. <el-col :span="6">
  534. <el-form-item label="装箱尺寸" prop="packing_size">
  535. <el-input
  536. placeholder="装箱尺寸"
  537. :disabled="type === 'view' || type === 'editCoin'"
  538. v-model="ruleForm.packing_size"
  539. maxlength="250"
  540. />
  541. </el-form-item>
  542. </el-col>
  543. <el-col :span="6">
  544. <el-form-item label="商品尺寸" prop="good_size">
  545. <el-input
  546. placeholder="商品尺寸"
  547. :disabled="type === 'view' || type === 'editCoin'"
  548. v-model="ruleForm.good_size"
  549. maxlength="250"
  550. />
  551. </el-form-item>
  552. </el-col>
  553. <el-col :span="6">
  554. <el-form-item label="商品条形码" prop="good_bar">
  555. <el-input
  556. placeholder="商品条形码"
  557. :disabled="type === 'view' || type === 'editCoin'"
  558. v-model="ruleForm.good_bar"
  559. type="number"
  560. :min="0"
  561. :max="9999999999999"
  562. :step="0"
  563. />
  564. </el-form-item>
  565. </el-col>
  566. <el-col :span="12">
  567. <el-form-item label="包装清单" prop="packing_list">
  568. <el-input
  569. placeholder="包装清单"
  570. :disabled="type === 'view' || type === 'editCoin'"
  571. v-model="ruleForm.packing_list"
  572. maxlength="250"
  573. />
  574. </el-form-item>
  575. </el-col>
  576. </el-row>
  577. </el-col>
  578. </el-row>
  579. <el-row class="ddiv">
  580. <el-col :span="1" class="dtitle">
  581. <ul>
  582. <li>发</li>
  583. <li>货</li>
  584. <li>信</li>
  585. <li>息</li>
  586. </ul></el-col
  587. >
  588. <el-col :span="23" class="dmain">
  589. <el-row>
  590. <el-col :span="6">
  591. <el-form-item label="供货区域" prop="supply_area">
  592. <el-select
  593. v-model="ruleForm.supply_area"
  594. filterable
  595. clearable
  596. :disabled="type === 'view' || type === 'editCoin'"
  597. style="width: 100%"
  598. placeholder="供货区域"
  599. >
  600. <el-option
  601. v-for="group in options6"
  602. :key="group.id"
  603. :label="group.name"
  604. :value="group.id"
  605. />
  606. </el-select>
  607. </el-form-item>
  608. </el-col>
  609. <el-col :span="6">
  610. <el-form-item label="物流时间" prop="delivery_day">
  611. <digital-input
  612. :values="ruleForm.delivery_day"
  613. :placeholder="'物流时间'"
  614. :min="0"
  615. :name="'ruleForm.delivery_day'"
  616. :disabled="type === 'view' || type === 'editCoin'"
  617. :max="100000000000"
  618. :position="'right'"
  619. :precision="0"
  620. :size="'mini'"
  621. :controls="false"
  622. :append="'天'"
  623. @reschange="number_change($event, 'delivery_day')"
  624. />
  625. </el-form-item>
  626. </el-col>
  627. <el-col :span="6">
  628. <el-form-item label="供货周期" prop="lead_time">
  629. <digital-input
  630. :values="ruleForm.lead_time"
  631. :placeholder="'物流时间'"
  632. :min="0"
  633. :name="'ruleForm.lead_time'"
  634. :disabled="type === 'view' || type === 'editCoin'"
  635. :max="100000000000"
  636. :position="'right'"
  637. :precision="0"
  638. :size="'mini'"
  639. :controls="false"
  640. :append="'天'"
  641. @reschange="number_change($event, 'lead_time')"
  642. />
  643. </el-form-item>
  644. </el-col>
  645. <el-col :span="6">
  646. <el-form-item label="调样周期" prop="sample_day">
  647. <digital-input
  648. :values="ruleForm.sample_day"
  649. :placeholder="'调样周期'"
  650. :min="0"
  651. :name="'ruleForm.sample_day'"
  652. :disabled="type === 'view' || type === 'editCoin'"
  653. :max="100000000000"
  654. :position="'right'"
  655. :precision="0"
  656. :size="'mini'"
  657. :controls="false"
  658. :append="'天'"
  659. @reschange="number_change($event, 'sample_day')"
  660. />
  661. </el-form-item>
  662. </el-col>
  663. <el-col :span="12">
  664. <el-form-item label="发货地" prop="delivery_place">
  665. <select-area
  666. :placeholder="'发货地'"
  667. :value="ruleForm.delivery_place"
  668. :is-detail="id !== 'add'"
  669. :disabled="type === 'view' || type === 'editCoin'"
  670. :size="'mini'"
  671. @selectChange="selectAreaChange($event, 'delivery_place')"
  672. />
  673. </el-form-item>
  674. </el-col>
  675. <el-col :span="12">
  676. <el-form-item label="产地" prop="origin_place">
  677. <select-area
  678. :placeholder="'产地'"
  679. :value="ruleForm.origin_place"
  680. :size="'mini'"
  681. :is-detail="id !== 'add'"
  682. :disabled="type === 'view' || type === 'editCoin'"
  683. @selectChange="selectAreaChange($event, 'origin_place')"
  684. />
  685. </el-form-item>
  686. </el-col>
  687. </el-row>
  688. </el-col>
  689. </el-row>
  690. <el-row class="ddiv">
  691. <el-col :span="1" class="dtitle">
  692. <ul>
  693. <li>图</li>
  694. <li>片</li>
  695. <li>信</li>
  696. <li>息</li>
  697. </ul></el-col
  698. >
  699. <el-col :span="23" class="dmain">
  700. <el-row style="padding: 0 0 20px 0">
  701. <el-col :span="6">
  702. <el-form-item
  703. label="商品缩略"
  704. prop="good_thumb_img"
  705. class="activity-upload my-label-top"
  706. >
  707. <div class="btnupload" style="position: relative">
  708. <img
  709. v-if="ruleForm.good_thumb_img"
  710. :src="ruleForm.good_thumb_img"
  711. class="avatar"
  712. />
  713. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  714. <file-upload
  715. class="Upload"
  716. :disabled="type === 'view' || type === 'editCoin'"
  717. :accept="'.jpg,.png,.jpeg'"
  718. :multiple="true"
  719. :uploadcondition="beforeAvatarUpload"
  720. @UploadErrorEvent="UploadErrorEvent($event, 'good_thumb_img')"
  721. @UploadSuccessEvent="
  722. UploadSuccessEvent($event, 'good_thumb_img')
  723. "
  724. ></file-upload>
  725. </div>
  726. <div class="txt-tips fl">
  727. <p>尺寸比例:</p>
  728. <p>1:1</p>
  729. </div>
  730. </el-form-item>
  731. <div style="font-size: 12px; color: #606266">
  732. <span style="padding: 0 0 0 20px">图片大小:小于1M</span>
  733. <span style="padding: 0 0 0 20px">图片类型.jpg/png/jpeg</span>
  734. </div>
  735. </el-col>
  736. <el-col :span="9">
  737. <el-form-item label="商品主图" prop="good_img">
  738. <div class="good_info_img_div">
  739. <ul v-if="ruleForm.good_img" class="clear">
  740. <li
  741. class="img-show-li"
  742. v-viewer
  743. v-for="(img, iindex) in ruleForm.good_img"
  744. :key="img + iindex"
  745. >
  746. <div class="img-show-li-div">
  747. <img :src="img" class="img-show" alt="" />
  748. <i
  749. v-if="type == 'add' || type === 'editBase'"
  750. class="el-icon-close"
  751. @click="closeImg(iindex, 'good_img')"
  752. ></i>
  753. </div>
  754. </li>
  755. <li
  756. class="img-show-li"
  757. v-if="
  758. ruleForm.good_img.length < 10 &&
  759. (type == 'add' || type === 'editBase')
  760. "
  761. >
  762. <div class="activity-upload">
  763. <div class="btnupload" style="position: relative">
  764. <i class="el-icon-plus avatar-uploader-icon"></i>
  765. <file-upload
  766. class="Upload"
  767. :disabled="type === 'view' || type === 'editCoin'"
  768. :accept="'.jpg,.png,.jpeg'"
  769. :multiple="true"
  770. :uploadcondition="beforeAvatarUpload"
  771. @UploadErrorEvent="
  772. UploadErrorEvent($event, 'good_img')
  773. "
  774. @UploadSuccessEvent="
  775. UploadSuccessEvent($event, 'good_img')
  776. "
  777. ></file-upload>
  778. </div>
  779. </div>
  780. </li>
  781. </ul>
  782. </div>
  783. </el-form-item>
  784. </el-col>
  785. <el-col :span="9">
  786. <el-form-item label="详情介绍" prop="good_info_img">
  787. <div class="good_info_img_div">
  788. <ul v-if="ruleForm.good_info_img" class="clear">
  789. <li
  790. class="img-show-li"
  791. v-viewer
  792. v-for="(img, iindex) in ruleForm.good_info_img"
  793. :key="img + iindex"
  794. >
  795. <div class="img-show-li-div">
  796. <img :src="img" class="img-show" alt="" />
  797. <i
  798. v-if="type == 'add' || type === 'editBase'"
  799. class="el-icon-close"
  800. @click="closeImg(iindex, 'good_info_img')"
  801. ></i>
  802. </div>
  803. </li>
  804. <li
  805. class="img-show-li"
  806. v-if="
  807. ruleForm.good_info_img.length < 10 &&
  808. (type == 'add' || type === 'editBase')
  809. "
  810. >
  811. <div class="activity-upload">
  812. <div class="btnupload" style="position: relative">
  813. <i class="el-icon-plus avatar-uploader-icon"></i>
  814. <file-upload
  815. class="Upload"
  816. :disabled="type === 'view' || type === 'editCoin'"
  817. :accept="'.jpg,.png,.jpeg'"
  818. :multiple="true"
  819. :uploadcondition="beforeAvatarUpload"
  820. @UploadErrorEvent="
  821. UploadErrorEvent($event, 'good_info_img')
  822. "
  823. @UploadSuccessEvent="
  824. UploadSuccessEvent($event, 'good_info_img')
  825. "
  826. ></file-upload>
  827. </div>
  828. </div>
  829. </li>
  830. </ul>
  831. </div>
  832. </el-form-item>
  833. </el-col>
  834. </el-row>
  835. </el-col>
  836. </el-row>
  837. <el-row class="ddiv">
  838. <el-col :span="1" class="dtitle">
  839. <ul style="padding: 20px 0 0 0">
  840. <li>固</li>
  841. <li>定</li>
  842. <li>成</li>
  843. <li>本</li>
  844. </ul></el-col
  845. >
  846. <el-col :span="23" class="dmain">
  847. <el-row>
  848. <el-col :span="6">
  849. <el-form-item label="加标费" prop="mark_fee" label-width="75px">
  850. <digital-input
  851. :values="ruleForm.mark_fee"
  852. :placeholder="'加标费'"
  853. :min="0"
  854. :name="'ruleForm.mark_fee'"
  855. :disabled="type === 'view' || type === 'editBase'"
  856. :max="100000000000"
  857. :position="'right'"
  858. :precision="2"
  859. :size="'mini'"
  860. :controls="false"
  861. :append="'元'"
  862. @reschange="number_change($event, 'mark_fee')"
  863. />
  864. </el-form-item>
  865. </el-col>
  866. <el-col :span="6">
  867. <el-form-item label="打样费" prop="demo_fee" label-width="75px">
  868. <digital-input
  869. :values="ruleForm.demo_fee"
  870. :placeholder="'打样费'"
  871. :min="0"
  872. :name="'ruleForm.demo_fee'"
  873. :disabled="type === 'view' || type === 'editBase'"
  874. :max="100000000000"
  875. :position="'right'"
  876. :precision="2"
  877. :size="'mini'"
  878. :controls="false"
  879. :append="'元'"
  880. @reschange="number_change($event, 'demo_fee')"
  881. />
  882. </el-form-item>
  883. </el-col>
  884. <el-col :span="6">
  885. <el-form-item label="开模费" prop="open_fee" label-width="75px">
  886. <digital-input
  887. :values="ruleForm.open_fee"
  888. :placeholder="'开模费'"
  889. :min="0"
  890. :name="'ruleForm.open_fee'"
  891. :disabled="type === 'view' || type === 'editBase'"
  892. :max="100000000000"
  893. :position="'right'"
  894. :precision="2"
  895. :size="'mini'"
  896. :controls="false"
  897. :append="'元/件'"
  898. @reschange="number_change($event, 'open_fee')"
  899. />
  900. </el-form-item>
  901. </el-col>
  902. <el-col :span="6">
  903. <el-form-item label="调样费" prop="sample_fee" label-width="75px">
  904. <digital-input
  905. :values="ruleForm.sample_fee"
  906. :placeholder="'调样费'"
  907. :min="0"
  908. :name="'ruleForm.sample_fee'"
  909. :disabled="type === 'view' || type === 'editBase'"
  910. :max="100000000000"
  911. :position="'right'"
  912. :precision="2"
  913. :size="'mini'"
  914. :controls="false"
  915. :append="'元'"
  916. @reschange="number_change($event, 'sample_fee')"
  917. />
  918. </el-form-item>
  919. </el-col>
  920. <el-col :span="6">
  921. <el-form-item label="市场价" prop="market_price" label-width="75px">
  922. <digital-input
  923. :values="ruleForm.market_price"
  924. :placeholder="'市场价'"
  925. :min="0"
  926. :name="'ruleForm.market_price'"
  927. :disabled="type === 'view' || type === 'editBase'"
  928. :max="100000000000"
  929. :position="'right'"
  930. :precision="2"
  931. :size="'mini'"
  932. :controls="false"
  933. :append="'元'"
  934. @reschange="number_change($event, 'market_price')"
  935. />
  936. </el-form-item>
  937. </el-col>
  938. <el-col :span="8" v-show="is_noble">
  939. <el-form-item
  940. label="供应商采购金价"
  941. prop="cgd_gold_price"
  942. label-width="130px"
  943. >
  944. <digital-input
  945. :values="ruleForm.cgd_gold_price"
  946. :placeholder="'供应商采购金价'"
  947. :min="0"
  948. :name="'ruleForm.cgd_gold_price'"
  949. :disabled="type === 'view' || type === 'editBase'"
  950. :max="100000000000"
  951. :position="'right'"
  952. :precision="2"
  953. :size="'mini'"
  954. :controls="false"
  955. :append="'元/g'"
  956. @reschange="number_change($event, 'cgd_gold_price')"
  957. />
  958. </el-form-item>
  959. </el-col>
  960. </el-row>
  961. </el-col>
  962. </el-row>
  963. <el-row class="ddiv">
  964. <el-col :span="1" class="dtitle">
  965. <ul>
  966. <li>阶</li>
  967. <li>梯</li>
  968. <li>成</li>
  969. <li>本</li>
  970. </ul></el-col
  971. >
  972. <el-col :span="23" class="dmain">
  973. <el-row>
  974. <el-col :span="6">
  975. <el-form-item label="启用阶梯" prop="is_step">
  976. <el-select
  977. v-model="ruleForm.is_step"
  978. filterable
  979. :disabled="type === 'view' || type === 'editBase'"
  980. style="width: 100%"
  981. placeholder="启用阶梯"
  982. @change="is_step_change"
  983. >
  984. <el-option
  985. v-for="group in options5"
  986. :key="group.id"
  987. :label="group.name"
  988. :value="group.id"
  989. />
  990. </el-select>
  991. </el-form-item>
  992. </el-col>
  993. <el-col :span="24" style="padding-left: 18px">
  994. <el-table
  995. :data="ladder_tableData"
  996. :size="'mini'"
  997. border
  998. stripe
  999. style="width: 100%; margin: 0 0 20px 0"
  1000. >
  1001. <el-table-column prop="min_num" label="起订量(>=)" />
  1002. <el-table-column prop="nake_price" label="裸价" />
  1003. <el-table-column prop="cert_fee" label="证书费" />
  1004. <el-table-column prop="packing_fee" label="包装费" />
  1005. <el-table-column prop="cost_fee" label="成本工艺费" />
  1006. <el-table-column prop="delivery_fee" label="物流费" />
  1007. <el-table-column prop="new_nake_fee" label="系统成本合计" />
  1008. <el-table-column prop="nake_fee" label="系统成本合计" />
  1009. <el-table-column
  1010. fixed="right"
  1011. v-if="type === 'add' || type === 'editCoin' || type === 'edit'"
  1012. width="80px"
  1013. >
  1014. <template slot="header" slot-scope="scope">
  1015. <span>操作</span>
  1016. <el-tooltip effect="dark" content="添加阶梯" placement="top">
  1017. <i
  1018. class="el-icon-circle-plus-outline tb-icon fr"
  1019. @click="openCostEdit(-1, {})"
  1020. ></i>
  1021. </el-tooltip>
  1022. </template>
  1023. <template slot-scope="scope">
  1024. <el-tooltip effect="dark" content="修改" placement="top">
  1025. <i
  1026. class="el-icon-edit tb-icon"
  1027. @click="openCostEdit(scope.$index, scope.row)"
  1028. ></i>
  1029. </el-tooltip>
  1030. <el-tooltip effect="dark" content="删除" placement="top">
  1031. <i
  1032. class="el-icon-delete tb-icon"
  1033. @click="openCostEditDelete(scope.$index)"
  1034. ></i>
  1035. </el-tooltip>
  1036. </template>
  1037. </el-table-column>
  1038. </el-table>
  1039. </el-col>
  1040. </el-row>
  1041. <!-- 弹窗 新增/修改 -->
  1042. <cost-form-add-edit
  1043. :index="costmodelIndex"
  1044. :show-model="costshowModel"
  1045. :sitem="costsitem"
  1046. @refresh="costrefreshEdit"
  1047. @cancel="costshowModel = false"
  1048. />
  1049. </el-col>
  1050. <el-col
  1051. :span="24"
  1052. v-if="
  1053. type === 'editBase' ||
  1054. type === 'add' ||
  1055. type === 'editCoin' ||
  1056. type === 'edit'
  1057. "
  1058. style="
  1059. text-align: right;
  1060. padding: 15px 0 15px 0;
  1061. border-top: 1px solid #dcdfe6;
  1062. "
  1063. >
  1064. <el-button :size="'mini'" type="primary" @click="submitForm"
  1065. >保 存
  1066. </el-button>
  1067. </el-col></el-row
  1068. >
  1069. </el-form>
  1070. </template>
  1071. <script>
  1072. import asyncRequest from "@/apis/service/goodStore/goodsCost";
  1073. import resToken from "@/mixins/resToken";
  1074. import { mapGetters } from "vuex";
  1075. import baseFormAddEdit from "./baseFormAddEdit";
  1076. import costFormAddEdit from "./costFormAddEdit";
  1077. import {
  1078. options1,
  1079. options2,
  1080. options3,
  1081. options4,
  1082. options5,
  1083. options6,
  1084. options7,
  1085. options8,
  1086. options9,
  1087. rules,
  1088. } from "../columns";
  1089. export default {
  1090. name: "goodsCostAdd",
  1091. mixins: [resToken],
  1092. props: ["showModel", "id", "type", "sitem"],
  1093. components: {
  1094. baseFormAddEdit,
  1095. costFormAddEdit,
  1096. },
  1097. computed: {
  1098. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  1099. powers() {
  1100. let tran =
  1101. this.$store.getters.btnList.find(
  1102. (item) => item.menu_route == "goodsCostAdd"
  1103. ) || {};
  1104. if (tran && tran.action && tran.action.length > 0) {
  1105. return tran.action;
  1106. } else {
  1107. return [];
  1108. }
  1109. },
  1110. },
  1111. watch: {
  1112. newTime: function (val) {
  1113. if (val) {
  1114. this.initForm();
  1115. }
  1116. },
  1117. },
  1118. data() {
  1119. return {
  1120. spec_tableData: [],
  1121. cat_id_name: "",
  1122. brand_name: "",
  1123. unit_name: "",
  1124. costshowModel: false,
  1125. costmodelIndex: "",
  1126. costsitem: {},
  1127. showModel: false,
  1128. modelIndex: "",
  1129. is_noble: false,
  1130. size: "small",
  1131. status: "",
  1132. rulesThis: this.rules,
  1133. activeName: "1",
  1134. loading: true,
  1135. supplierName: "",
  1136. options1: options1,
  1137. options2: options2,
  1138. options3: options3,
  1139. options4: options4,
  1140. options5: options5,
  1141. options6: options6,
  1142. options7: options7,
  1143. options8: options8,
  1144. options9: options9,
  1145. ruleForm: {},
  1146. spec_tableData: [],
  1147. old_spec_tableData: [],
  1148. ladder_tableData: [],
  1149. old_ladder_tableData: [],
  1150. rules: rules,
  1151. };
  1152. },
  1153. mounted() {
  1154. this.initForm();
  1155. },
  1156. methods: {
  1157. async initForm() {
  1158. this.loading = true;
  1159. this.resetFormData();
  1160. this.rulesThis = this.rules;
  1161. await this.resetForm();
  1162. this.sch_is_noble();
  1163. this.good_type_change();
  1164. this.loading = false;
  1165. },
  1166. number_change(e, key) {
  1167. this.ruleForm[key] = e + "" || "0";
  1168. this.$refs.ruleForm.validateField(key);
  1169. },
  1170. openEdit(index, sitem) {
  1171. this.modelIndex = index;
  1172. this.sitem = sitem;
  1173. this.showModel = true;
  1174. },
  1175. openCostEdit(index, sitem) {
  1176. const { is_step } = this.ruleForm;
  1177. if (index === -1 && is_step === "0" && this.ladder_tableData.length > 0) {
  1178. this.$message.warning("不启用阶梯成本,只能录入一条阶梯成本信息!");
  1179. return;
  1180. }
  1181. this.costmodelIndex = index;
  1182. this.costsitem = sitem;
  1183. this.costshowModel = true;
  1184. },
  1185. openDelete(index) {
  1186. this.spec_tableData.splice(index, 1);
  1187. },
  1188. openCostEditDelete(index) {
  1189. this.ladder_tableData.splice(index, 1);
  1190. },
  1191. is_step_change() {
  1192. const { is_step } = this.ruleForm;
  1193. if (is_step === "0") {
  1194. let res = [];
  1195. let list =
  1196. this.ladder_tableData.length === 0
  1197. ? []
  1198. : JSON.parse(JSON.stringify(this.ladder_tableData));
  1199. if (list.length > 0) {
  1200. res.push(list[0]);
  1201. }
  1202. this.ladder_tableData = res;
  1203. }
  1204. },
  1205. async submitForm() {
  1206. this.sch_is_noble();
  1207. this.good_type_change();
  1208. await this.$refs.ruleForm.validate(async (valid) => {
  1209. if (valid) {
  1210. this.loading = true;
  1211. if (this.spec_tableData.length === 0) {
  1212. this.$message.warning("请录入商品规格信息!");
  1213. this.loading = false;
  1214. return;
  1215. }
  1216. let isMust = true;
  1217. this.spec_tableData.forEach((e) => {
  1218. if (e.isMust && !e.spec_value_id) {
  1219. isMust = false;
  1220. }
  1221. });
  1222. if (!isMust) {
  1223. this.$message.warning("分类绑定的规格必须填写规格值!");
  1224. this.loading = false;
  1225. return;
  1226. }
  1227. if (this.ladder_tableData.length === 0) {
  1228. this.$message.warning("请录入阶梯成本!");
  1229. this.loading = false;
  1230. return;
  1231. }
  1232. const { noble_weight, weight, good_type, moq, is_step } =
  1233. this.ruleForm;
  1234. if (is_step === "0" && this.ladder_tableData.length > 1) {
  1235. this.$message.warning("不启用阶梯成本,只能录入一条阶梯成本信息!");
  1236. this.loading = false;
  1237. return;
  1238. }
  1239. if (this.is_noble) {
  1240. if (noble_weight * 1000 > weight * 1000) {
  1241. this.$message.warning("贵金属总重量不能大于商品总重量!");
  1242. this.loading = false;
  1243. return;
  1244. }
  1245. }
  1246. // if (good_type === "1") {
  1247. // let set_num = moq * 1;
  1248. // let isok = true;
  1249. // this.ladder_tableData.forEach((e) => {
  1250. // if (e.min_num * 1 < set_num) {
  1251. // isok = false;
  1252. // }
  1253. // });
  1254. // if (!isok) {
  1255. // this.$message.warning("阶梯成本的起订量不能小于定制起订量!");
  1256. // this.loading = false;
  1257. // return;
  1258. // }
  1259. // }
  1260. let model = JSON.parse(JSON.stringify(this.ruleForm));
  1261. model.cat_id = model.cat_id.toString();
  1262. model.brandid = model.brandid.toString();
  1263. model.supplierNo = model.supplierNo.toString();
  1264. model.delivery_place = model.delivery_place.toString();
  1265. model.origin_place = model.origin_place.toString();
  1266. model.good_info_img = model.good_info_img.toString();
  1267. model.good_img = model.good_img.toString();
  1268. model.unit = model.unit.toString();
  1269. model.speclist = JSON.parse(JSON.stringify(this.setResData(1)));
  1270. model.good_ladder = JSON.parse(JSON.stringify(this.setResData(2)));
  1271. model.config = model.config.toString();
  1272. model.is_exclusive =
  1273. model.is_exclusive.length > 0
  1274. ? model.is_exclusive[model.is_exclusive.length - 1]
  1275. : "";
  1276. let res = {};
  1277. delete model["id"];
  1278. if (this.type === "add") {
  1279. delete model["spuCode"];
  1280. res = await asyncRequest.add(model);
  1281. } else if (this.type === "editBase") {
  1282. let item1 = this.setModel(model, "1");
  1283. res = await asyncRequest.update(item1);
  1284. } else if (this.type === "editCoin") {
  1285. let item2 = this.setModel(model, "2");
  1286. res = await asyncRequest.updateP(item2);
  1287. } else {
  1288. model.companyNo = model.company_id;
  1289. delete model["company_id"];
  1290. res = await asyncRequest.edit_update(model);
  1291. }
  1292. console.log(res);
  1293. this.loading = false;
  1294. if (res && res.code === 0) {
  1295. const { spuCode } = res.data;
  1296. const title =
  1297. this.type === "add"
  1298. ? "新建成功!"
  1299. : this.type === "editBase"
  1300. ? "基础信息修改成功!"
  1301. : this.type === "editCoin"
  1302. ? "成本信息修改成功!"
  1303. : "商品信息修改成功";
  1304. this.$notify.success({
  1305. title: title,
  1306. message: "",
  1307. });
  1308. this.showModelThis = false;
  1309. // 刷新
  1310. this.$emit("refresh", { spuCode: spuCode });
  1311. }
  1312. } else {
  1313. console.log(valid);
  1314. console.log("error submit!!");
  1315. return false;
  1316. }
  1317. });
  1318. },
  1319. //获取规格值
  1320. setResData(type) {
  1321. let list = JSON.parse(
  1322. JSON.stringify(type === 1 ? this.spec_tableData : this.ladder_tableData)
  1323. );
  1324. let oldlist = JSON.parse(
  1325. JSON.stringify(
  1326. type === 1 ? this.old_spec_tableData : this.old_ladder_tableData
  1327. )
  1328. );
  1329. let hasIDlist = [];
  1330. list.forEach((a) => {
  1331. if (a.id !== "") {
  1332. hasIDlist.push(a);
  1333. }
  1334. });
  1335. let newList = [];
  1336. let resList = [];
  1337. oldlist.forEach((a, ai) => {
  1338. let item = null;
  1339. let index = hasIDlist.findIndex((b) => a.id === b.id);
  1340. if (index === -1) {
  1341. item = JSON.parse(JSON.stringify(a));
  1342. item.is_del = "1";
  1343. } else {
  1344. item = JSON.parse(JSON.stringify(hasIDlist[index]));
  1345. }
  1346. newList.push(item);
  1347. });
  1348. list.forEach((b) => {
  1349. if (b.id === "") {
  1350. b.is_del = "0";
  1351. newList.push(b);
  1352. }
  1353. });
  1354. if (type === 1) {
  1355. newList.forEach((a) => {
  1356. let m = {
  1357. id: a.id,
  1358. spec_id: a.spec_id,
  1359. spec_value_id: a.spec_value_id,
  1360. is_del: a.is_del || "0",
  1361. };
  1362. resList.push(m);
  1363. });
  1364. } else {
  1365. newList.forEach((a) => {
  1366. let m = {
  1367. id: a.id,
  1368. min_num: a.min_num,
  1369. nake_fee: a.nake_fee,
  1370. cost_fee: a.cost_fee,
  1371. delivery_fee: a.delivery_fee,
  1372. is_del: a.is_del || "0",
  1373. };
  1374. resList.push(m);
  1375. });
  1376. }
  1377. return resList;
  1378. },
  1379. setladder() {
  1380. let list = JSON.parse(JSON.stringify(this.ladder_tableData));
  1381. let oldlist = JSON.parse(JSON.stringify(this.old_ladder_tableData));
  1382. let hasIDlist = [];
  1383. list.forEach((a) => {
  1384. if (a.id !== "") {
  1385. hasIDlist.push(a);
  1386. }
  1387. });
  1388. let newList = [];
  1389. let resList = [];
  1390. oldlist.forEach((a, ai) => {
  1391. let item = null;
  1392. let index = hasIDlist.findIndex((b) => a.id === b.id);
  1393. if (index === -1) {
  1394. item = JSON.parse(JSON.stringify(a));
  1395. item.is_del = "1";
  1396. } else {
  1397. item = JSON.parse(JSON.stringify(b));
  1398. }
  1399. newList.push(item);
  1400. });
  1401. list.forEach((b) => {
  1402. if (b.id === "") {
  1403. b.is_del = "0";
  1404. newList.push(b);
  1405. }
  1406. });
  1407. newList.forEach((a) => {
  1408. let m = {
  1409. id: a.id,
  1410. min_num: a.min_num,
  1411. spec_value_id: a.spec_value_id,
  1412. is_del: a.is_del || "0",
  1413. };
  1414. resList.push(m);
  1415. });
  1416. return resList;
  1417. },
  1418. //规格编辑修改
  1419. refreshEdit(e) {
  1420. let item = JSON.parse(JSON.stringify(e));
  1421. const {
  1422. index,
  1423. id,
  1424. spec_id,
  1425. isMust,
  1426. spec_value,
  1427. spec_value_id,
  1428. spec_value_value,
  1429. } = item;
  1430. let ffindex = -1;
  1431. this.spec_tableData.forEach((i, findex) => {
  1432. if (i.spec_id === spec_id) {
  1433. ffindex = findex;
  1434. this.spec_tableData[findex].id = id;
  1435. this.spec_tableData[findex].spec_id = spec_id;
  1436. this.spec_tableData[findex].isMust = isMust;
  1437. this.spec_tableData[findex].spec_value = spec_value;
  1438. this.spec_tableData[findex].spec_value_id = spec_value_id;
  1439. this.spec_tableData[findex].spec_value_value = spec_value_value;
  1440. }
  1441. });
  1442. if (ffindex === -1) {
  1443. this.spec_tableData.push(item);
  1444. }
  1445. this.showModel = false;
  1446. },
  1447. //阶梯成本修改
  1448. costrefreshEdit(e) {
  1449. let item = JSON.parse(JSON.stringify(e));
  1450. const { index, id, cost_fee, delivery_fee, min_num, nake_fee } = item;
  1451. let ffindex = -1;
  1452. this.ladder_tableData.forEach((i, findex) => {
  1453. if (findex === parseInt(index + "")) {
  1454. ffindex = findex;
  1455. this.ladder_tableData[findex].id = id;
  1456. this.ladder_tableData[findex].cost_fee = cost_fee;
  1457. this.ladder_tableData[findex].delivery_fee = delivery_fee;
  1458. this.ladder_tableData[findex].min_num = min_num;
  1459. this.ladder_tableData[findex].nake_fee = nake_fee;
  1460. }
  1461. });
  1462. if (ffindex === -1) {
  1463. this.ladder_tableData.push(item);
  1464. }
  1465. this.showModel = false;
  1466. },
  1467. dataSort(key) {
  1468. return function (a, b) {
  1469. let value1 = a[key];
  1470. let value2 = b[key];
  1471. return value1 - value2;
  1472. };
  1473. },
  1474. resetFormData() {
  1475. this.spec_tableData = [];
  1476. this.old_spec_tableData = [];
  1477. this.ladder_tableData = [];
  1478. this.old_ladder_tableData = [];
  1479. this.cat_id_name = "";
  1480. this.is_noble = false;
  1481. this.status = "";
  1482. this.brand_name = "";
  1483. this.unit_name = "";
  1484. this.supplierName = "";
  1485. this.ruleForm = {
  1486. id: "",
  1487. spuCode: "",
  1488. cat_id: [],
  1489. brandid: [],
  1490. noble_weight: "0",
  1491. weight: "",
  1492. good_type: "0",
  1493. is_stock: "0",
  1494. supplierNo: [],
  1495. company_id: "",
  1496. is_auth: "",
  1497. tax: "",
  1498. good_name: "",
  1499. unit: [],
  1500. is_exclusive: [],
  1501. noble_metal: "",
  1502. is_gold_price: "",
  1503. moq: "0",
  1504. customized: "0",
  1505. after_sales: "",
  1506. craft_desc: "",
  1507. good_remark: "",
  1508. //包装发货/图片
  1509. packing_list: "",
  1510. packing_way: "",
  1511. packing_spec: "",
  1512. packing_weight: "",
  1513. packing_size: "",
  1514. good_size: "",
  1515. good_bar: "",
  1516. supply_area: "",
  1517. delivery_place: [],
  1518. origin_place: [],
  1519. delivery_day: "0",
  1520. lead_time: "0",
  1521. sample_day: "0",
  1522. good_thumb_img: "",
  1523. good_img: [],
  1524. good_info_img: [],
  1525. //固定阶梯成本
  1526. cert_fee: "0",
  1527. packing_fee: "0",
  1528. cost_fee: "0",
  1529. mark_fee: "0",
  1530. demo_fee: "0",
  1531. open_fee: "0",
  1532. sample_fee: "0",
  1533. market_price: "0",
  1534. nake_price: "0",
  1535. cgd_gold_price: "0",
  1536. is_step: "0",
  1537. is_diff: "",
  1538. config: [],
  1539. other_config: "",
  1540. };
  1541. },
  1542. async resetForm() {
  1543. // 重置
  1544. await this.$nextTick(async () => {
  1545. if (this.$refs.ruleForm) {
  1546. this.$refs.ruleForm.resetFields();
  1547. this.$refs.ruleForm.clearValidate();
  1548. this.spec_tableData = [];
  1549. this.old_spec_tableData = [];
  1550. this.ladder_tableData = [];
  1551. this.old_ladder_tableData = [];
  1552. const {
  1553. id,
  1554. spuCode, //string 商品spuCode
  1555. // good_code, //string 无
  1556. good_name, //string 商品名称
  1557. // cat_id, //string 分类id
  1558. cat_info, //array 分类
  1559. brand_id, //string 品牌id
  1560. unit,
  1561. supplierName,
  1562. companyNo, // string 企业公司id
  1563. good_unit, // string 商品单位
  1564. good_type, //string 是否定制 1是0否
  1565. moq, //string 起订量
  1566. is_exclusive, // string 是否是专属
  1567. customized, // string 定制工期
  1568. tax, //string 税率
  1569. supplierNo, // string 供应商
  1570. is_auth, //string 是否有销售权限0 否1 是
  1571. auth_img, // string 无
  1572. exclusive,
  1573. is_stock, //
  1574. after_sales, // string 售后说明
  1575. craft_desc, // string 工艺说明
  1576. good_remark, // string 商品备注
  1577. weight, // string 重量
  1578. packing_way, // string 包装方式
  1579. packing_size, // string 包装尺寸
  1580. good_size, //商品尺寸
  1581. packing_spec, // string 包装规格
  1582. packing_list, // string 包装清单
  1583. packing_weight, // string 装箱重量
  1584. good_bar, // string 条形码
  1585. supply_area, // string 供货区域 1 全国2 除偏远地区
  1586. delivery_place, // string 发货地区
  1587. origin_place, // string 产地
  1588. delivery_day, // string 物流天数
  1589. lead_time, // string 供货周期
  1590. sample_day, //string 调样周期
  1591. sample_fee, // string 调样费有
  1592. good_img, // string 商品图片
  1593. good_thumb_img, // string 商品说略图
  1594. good_info_img, // string 商品详情图
  1595. cert_fee, // string 证书费
  1596. packing_fee, // string 打包费
  1597. cost_fee, // string 工艺费
  1598. mark_fee, // string 加标费
  1599. demo_fee, // string 打样费
  1600. open_fee, // string 开模费
  1601. noble_metal, // string 金属类别
  1602. noble_weight, // string 金属重量
  1603. is_gold_price, // string 是否使用实时金价
  1604. market_price, // string 市场价
  1605. nake_price, // string 成本裸价
  1606. cgd_gold_price, // string 供应商采购金价
  1607. is_step, // string 是否使用阶梯价
  1608. // is_online, // string 是否上线
  1609. status, // string 状态
  1610. nakelist, //階梯成本
  1611. speclist, //商品规格
  1612. brand_name,
  1613. config,
  1614. is_diff,
  1615. other_config,
  1616. } = this.sitem;
  1617. let cat_id_name = "";
  1618. let cat_id = [];
  1619. (cat_info || []).forEach((ai, i) => {
  1620. cat_id_name += i === 0 ? ai.name : `_${ai.name}`;
  1621. cat_id.push(ai.id);
  1622. });
  1623. this.cat_id_name = cat_id_name;
  1624. let isok = false;
  1625. if (cat_id.length > 0) {
  1626. cat_id.forEach((i) => {
  1627. if (i === "6") {
  1628. isok = true;
  1629. }
  1630. });
  1631. }
  1632. let exclusiveList = [];
  1633. if (exclusive && exclusive.length > 0) {
  1634. exclusive.forEach((a, ai) => {
  1635. exclusiveList.push(a.id);
  1636. });
  1637. }
  1638. this.is_noble = isok;
  1639. let spec_list1 =
  1640. speclist && speclist.length > 0
  1641. ? JSON.parse(JSON.stringify(speclist))
  1642. : [];
  1643. spec_list1.forEach((a) => {
  1644. let model = {
  1645. id: a.id,
  1646. is_del: a.is_del,
  1647. spec_id: a.spec_id,
  1648. spec_value: a.spec_name,
  1649. spec_value_value: a.spec_value,
  1650. spec_value_id: a.spec_value_id,
  1651. spuCode: a.spuCode,
  1652. };
  1653. this.spec_tableData.push(model);
  1654. });
  1655. this.old_spec_tableData = JSON.parse(
  1656. JSON.stringify(this.spec_tableData)
  1657. );
  1658. let list2 =
  1659. nakelist && nakelist.length > 0
  1660. ? JSON.parse(JSON.stringify(nakelist))
  1661. : [];
  1662. this.ladder_tableData = list2;
  1663. this.old_ladder_tableData = JSON.parse(
  1664. JSON.stringify(this.ladder_tableData)
  1665. );
  1666. this.status = status;
  1667. this.brand_name = brand_name;
  1668. this.unit_name = unit;
  1669. this.supplierName = supplierName || "";
  1670. this.ruleForm = {
  1671. id: id || "",
  1672. spuCode: spuCode || "",
  1673. cat_id:
  1674. cat_id && cat_id.length > 0 ? [cat_id[cat_id.length - 1]] : [],
  1675. brandid: brand_id ? [brand_id] : [],
  1676. noble_weight: noble_weight || "",
  1677. weight: weight || "",
  1678. good_type: good_type || "0",
  1679. is_stock: is_stock || "0",
  1680. supplierNo: supplierNo ? [supplierNo] : [],
  1681. company_id: companyNo || "",
  1682. is_auth: is_auth || "",
  1683. tax: tax ? tax + "%" : "",
  1684. good_name: good_name || "",
  1685. unit: good_unit ? [good_unit] : [],
  1686. is_exclusive: exclusiveList || [],
  1687. noble_metal: noble_metal || "",
  1688. is_gold_price: is_gold_price || "",
  1689. moq: moq || "0",
  1690. customized: customized || "0",
  1691. after_sales: after_sales || "",
  1692. craft_desc: craft_desc || "",
  1693. good_remark: good_remark || "",
  1694. //包装发货/图片
  1695. packing_list: packing_list || "",
  1696. packing_way: packing_way || "",
  1697. packing_spec: packing_spec || "",
  1698. packing_weight: packing_weight || "",
  1699. packing_size: packing_size || "",
  1700. good_size: good_size || "",
  1701. good_bar: good_bar || "",
  1702. supply_area: supply_area || "",
  1703. delivery_place: delivery_place
  1704. ? (delivery_place || "").split(",")
  1705. : [],
  1706. origin_place: origin_place ? (origin_place || "").split(",") : [],
  1707. delivery_day: delivery_day || "",
  1708. lead_time: lead_time || "",
  1709. sample_day: sample_day || "",
  1710. good_thumb_img: good_thumb_img || "",
  1711. good_img: good_img ? (good_img || "").split(",") : [],
  1712. good_info_img: good_info_img
  1713. ? (good_info_img || "").split(",")
  1714. : [],
  1715. //固定阶梯成本
  1716. cert_fee: cert_fee || "",
  1717. packing_fee: packing_fee || "",
  1718. cost_fee: cost_fee || "",
  1719. mark_fee: mark_fee || "",
  1720. demo_fee: demo_fee || "",
  1721. open_fee: open_fee || "",
  1722. sample_fee: sample_fee || "",
  1723. market_price: market_price || "",
  1724. nake_price: nake_price || "",
  1725. cgd_gold_price: cgd_gold_price || "",
  1726. is_step: is_step || "0",
  1727. is_diff: is_diff || "",
  1728. config: config ? config.split(",") : [],
  1729. other_config: other_config || "",
  1730. };
  1731. }
  1732. await this.set_must_spec();
  1733. });
  1734. },
  1735. sch_is_noble() {
  1736. let list = [
  1737. "noble_weight",
  1738. "noble_metal",
  1739. "is_gold_price",
  1740. "is_diff",
  1741. "config",
  1742. "other_config",
  1743. "cgd_gold_price",
  1744. ];
  1745. for (let i = 0; i < list.length; i++) {
  1746. this.rulesThis[list[i]][0].required = this.is_noble;
  1747. console.log(list[i] + "===" + this.rulesThis[list[i]][0].required);
  1748. this.$refs.ruleForm.validateField(list[i]);
  1749. }
  1750. },
  1751. setModel(model, type) {
  1752. let item = null;
  1753. if (type === 1) {
  1754. item = JSON.parse(JSON.stringify(model));
  1755. delete item["cert_fee"];
  1756. delete item["packing_fee"];
  1757. delete item["cost_fee"];
  1758. delete item["mark_fee"];
  1759. delete item["demo_fee"];
  1760. delete item["open_fee"];
  1761. delete item["noble_metal"];
  1762. delete item["noble_weight"];
  1763. delete item["is_gold_price"];
  1764. delete item["market_price"];
  1765. delete item["nake_price"];
  1766. delete item["cgd_gold_price"];
  1767. delete item["is_step"];
  1768. delete item["good_ladder"];
  1769. } else {
  1770. const {
  1771. cert_fee,
  1772. packing_fee,
  1773. cost_fee,
  1774. mark_fee,
  1775. demo_fee,
  1776. open_fee,
  1777. noble_metal,
  1778. noble_weight,
  1779. is_gold_price,
  1780. market_price,
  1781. nake_price,
  1782. cgd_gold_price,
  1783. is_step,
  1784. good_ladder,
  1785. spuCode,
  1786. } = model;
  1787. item = {
  1788. cert_fee: cert_fee || "",
  1789. packing_fee: packing_fee || "",
  1790. cost_fee: cost_fee || "",
  1791. mark_fee: mark_fee || "",
  1792. demo_fee: demo_fee || "",
  1793. open_fee: open_fee || "",
  1794. noble_metal: noble_metal || "",
  1795. noble_weight: noble_weight || "",
  1796. is_gold_price: is_gold_price || "",
  1797. market_price: market_price || "",
  1798. nake_price: nake_price || "",
  1799. cgd_gold_price: cgd_gold_price || "",
  1800. is_step: is_step || "",
  1801. good_ladder: good_ladder || [],
  1802. spuCode: spuCode || "",
  1803. };
  1804. }
  1805. return model;
  1806. },
  1807. //商品分类选择
  1808. async goods_class_change(e) {
  1809. const { code, pid, id, label, cat_desc } = e;
  1810. this.ruleForm.cat_id = id ? [id] : [];
  1811. this.$refs.ruleForm.validateField("cat_id");
  1812. this.ruleForm.after_sales = cat_desc || "";
  1813. this.$refs.ruleForm.validateField("after_sales");
  1814. this.is_noble = pid === "6";
  1815. this.sch_is_noble();
  1816. await this.set_must_spec();
  1817. },
  1818. async set_must_spec() {
  1819. const { cat_id } = this.ruleForm;
  1820. let id = cat_id.length == 1 ? cat_id[0] : "";
  1821. let list1 =
  1822. this.spec_tableData && this.spec_tableData.length > 0
  1823. ? JSON.parse(JSON.stringify(this.spec_tableData))
  1824. : [];
  1825. let list2 = [];
  1826. if (id) {
  1827. const { code, message, data } = await asyncRequest.catinfo({ id: id });
  1828. if (code === 0) {
  1829. const { spec } = data;
  1830. if (spec && spec.length > 0) {
  1831. if (list1 && list1.length > 0) {
  1832. list1.forEach((c) => {
  1833. c.isMust = false;
  1834. });
  1835. spec.forEach((a, ai) => {
  1836. let findex = list1.findIndex((b) => b.spec_id === a.id);
  1837. if (findex !== -1) {
  1838. list1[findex].isMust = true;
  1839. } else {
  1840. list1.push({
  1841. id: "",
  1842. index: "1",
  1843. spec_id: a.id,
  1844. spec_value: a.spec_name,
  1845. isMust: true,
  1846. spec_value_value: "",
  1847. spec_value_id: "",
  1848. });
  1849. }
  1850. });
  1851. } else {
  1852. spec.forEach((a, ai) => {
  1853. let model = {
  1854. id: "",
  1855. index: "1",
  1856. spec_id: a.id,
  1857. spec_value: a.spec_name,
  1858. isMust: true,
  1859. spec_value_value: "",
  1860. spec_value_id: "",
  1861. };
  1862. list1.push(model);
  1863. });
  1864. }
  1865. }
  1866. list1.map((e, ei) => {
  1867. e.index = ei + "";
  1868. return e;
  1869. });
  1870. this.spec_tableData =
  1871. list1 && list1.length > 0 ? JSON.parse(JSON.stringify(list1)) : [];
  1872. } else if (code >= 100 && code <= 104) {
  1873. await this.logout();
  1874. } else {
  1875. this.$message.warning(message);
  1876. }
  1877. } else {
  1878. list1.forEach((e) => {
  1879. if (!e.isMust) {
  1880. list2.push(e);
  1881. }
  1882. });
  1883. }
  1884. },
  1885. //商品品牌选择
  1886. brandidsearchChange(e) {
  1887. const { id, code, label } = e;
  1888. if (id) {
  1889. this.ruleForm.brandid = [id];
  1890. } else {
  1891. this.ruleForm.brandid = [];
  1892. }
  1893. this.$refs.ruleForm.validateField("brandid");
  1894. },
  1895. //供应商选择
  1896. supplierNosearchChange(e) {
  1897. console.log(e);
  1898. const { id, code, label } = e;
  1899. if (id) {
  1900. this.ruleForm.supplierNo = [code];
  1901. } else {
  1902. this.ruleForm.supplierNo = [];
  1903. }
  1904. this.$refs.ruleForm.validateField("supplierNo");
  1905. },
  1906. //业务企业选择
  1907. company_idsearchChange(e) {
  1908. const { id, code, label } = e;
  1909. if (id) {
  1910. this.ruleForm.company_id = code;
  1911. } else {
  1912. this.ruleForm.company_id = "";
  1913. }
  1914. this.$refs.ruleForm.validateField("company_id");
  1915. },
  1916. //税点选择
  1917. taxsearchChange(e) {
  1918. this.ruleForm.tax = e;
  1919. this.$refs.ruleForm.validateField("tax");
  1920. },
  1921. //专属类型选择
  1922. exclusiveSearchChange(e) {
  1923. this.ruleForm.is_exclusive = e;
  1924. this.$refs.ruleForm.validateField("is_exclusive");
  1925. },
  1926. //单位选择
  1927. unitsearchChange(e) {
  1928. const { id, code, label } = e;
  1929. if (id) {
  1930. this.ruleForm.unit = [code];
  1931. } else {
  1932. this.ruleForm.unit = [];
  1933. }
  1934. this.$refs.ruleForm.validateField("unit");
  1935. },
  1936. //贵金属种类选择
  1937. noble_metalsearchChange(e) {
  1938. console.log(e);
  1939. const { id, code, label } = e;
  1940. if (id) {
  1941. this.ruleForm.noble_metal = id;
  1942. } else {
  1943. this.ruleForm.noble_metal = "";
  1944. }
  1945. this.$refs.ruleForm.validateField("noble_metal");
  1946. },
  1947. //省市区
  1948. selectAreaChange(e, key) {
  1949. this.ruleForm[key] = e;
  1950. this.$refs.ruleForm.validateField(key);
  1951. },
  1952. closeImg(index, key) {
  1953. this.ruleForm[key].splice(index, 1);
  1954. this.$refs.ruleForm.validateField(key);
  1955. },
  1956. //图片上传成功
  1957. async UploadSuccessEvent(data, key) {
  1958. const { url } = data;
  1959. if (url === "noToken") {
  1960. await this.logout();
  1961. } else {
  1962. if (key === "good_thumb_img") {
  1963. this.ruleForm[key] = url;
  1964. } else {
  1965. this.ruleForm[key].push(url);
  1966. }
  1967. this.$refs.ruleForm.validateField(key);
  1968. this.$message.success("图片上传成功!");
  1969. }
  1970. },
  1971. good_type_change() {
  1972. let list = ["moq", "customized"];
  1973. for (let i = 0; i < list.length; i++) {
  1974. this.rulesThis[list[i]][0].required = this.ruleForm.good_type === "1";
  1975. console.log(list[i] + "===" + this.rulesThis[list[i]][0].required);
  1976. this.$refs.ruleForm.validateField(list[i]);
  1977. }
  1978. },
  1979. imgUploadError(res, key) {
  1980. if (res !== "break") {
  1981. this.$message.error("图片上传失败!");
  1982. this.$refs.ruleForm.validateField(key);
  1983. }
  1984. },
  1985. //判断图片规格
  1986. beforeAvatarUpload(file) {
  1987. let isJPG = false;
  1988. if (
  1989. file.type === "image/jpg" ||
  1990. file.type === "image/png" ||
  1991. file.type === "image/jpeg"
  1992. ) {
  1993. isJPG = true;
  1994. }
  1995. const isLt2M = file.size / 1024 / 1024 < 1;
  1996. if (!isJPG) {
  1997. this.$message.error("图片格式不正确!");
  1998. }
  1999. if (!isLt2M) {
  2000. this.$message.error("图片大小不能超过 1MB!");
  2001. }
  2002. return isJPG && isLt2M;
  2003. },
  2004. },
  2005. };
  2006. </script>
  2007. <style lang="scss" scoped>
  2008. .goodsCostDetail {
  2009. // position: relative;
  2010. .good_info_img_div {
  2011. ul {
  2012. width: 100%;
  2013. li {
  2014. float: left;
  2015. width: 55px;
  2016. height: 55px;
  2017. padding: 0 5px 0 0;
  2018. .img-show-li-div {
  2019. width: 50px;
  2020. height: 50px;
  2021. border: 1px solid #dfe4ed;
  2022. background: #dfe4ed;
  2023. position: relative;
  2024. img.img-show {
  2025. width: 100%;
  2026. height: 100%;
  2027. position: relative;
  2028. display: inline-block;
  2029. }
  2030. i.el-icon-close {
  2031. position: absolute;
  2032. z-index: 2;
  2033. top: 0;
  2034. right: 0;
  2035. color: #dfe4ed;
  2036. }
  2037. &:hover {
  2038. i.el-icon-close {
  2039. cursor: pointer;
  2040. color: #63cbe7;
  2041. }
  2042. }
  2043. }
  2044. }
  2045. }
  2046. }
  2047. .goodsCostAdd-title {
  2048. border-top: 1px solid #ebeef5;
  2049. span {
  2050. height: 50px;
  2051. line-height: 50px;
  2052. font-family: "微软雅黑", sans-serif;
  2053. font-weight: 400;
  2054. font-style: normal;
  2055. font-size: 16fpx;
  2056. text-align: left;
  2057. }
  2058. }
  2059. }
  2060. </style>