info.vue 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690
  1. <template>
  2. <div class="component-edit-indent-info">
  3. <el-dialog
  4. v-model="show"
  5. class="custom-edit-indent-info-dialog"
  6. :title="visible === 1 ? '录入报价信息' : '录入报价信息'"
  7. :close-on-click-modal="false"
  8. :close-on-press-escape="false"
  9. :before-close="close"
  10. width="1300px"
  11. >
  12. <div style="color: #ef4135">* 为了报价单的内容,请填写英文信息</div>
  13. <div class="form-table">
  14. <div class="flex items-stretch form-header">
  15. <div class="first-label"></div>
  16. <div class="second-label">操作</div>
  17. <div
  18. v-for="(item, index) in forms"
  19. :key="index"
  20. class="input-area flex justify-center items-center"
  21. >
  22. <el-button
  23. v-show="forms.length > 1"
  24. size="small"
  25. type="danger"
  26. link
  27. plain
  28. @click="deleteForm(index)"
  29. >
  30. {{ $t('btn_delete') }}
  31. </el-button>
  32. </div>
  33. </div>
  34. <div class="flex items-stretch">
  35. <div class="first-label flex justify-center items-center">
  36. {{ $t(prefix + 'label_supplier') }}
  37. </div>
  38. <div class="flex flex-col items-stretch">
  39. <div class="flex items-center">
  40. <div class="second-label required">
  41. {{ $t(prefix + 'label_company_name') }}
  42. </div>
  43. <el-form
  44. v-for="(item, index) in forms"
  45. :ref="($e) => getFormRef($e, `vendor_id_${index}`)"
  46. :key="index"
  47. :show-message="false"
  48. :model="item"
  49. >
  50. <div class="input-area">
  51. <el-form-item
  52. prop="vendor_id"
  53. :rules="{ required: true, validator: commonCheck }"
  54. >
  55. <el-select
  56. v-model="item.vendor_id"
  57. :remote-method="($e: any) => queryVenderList($e, index)"
  58. filterable
  59. allow-create
  60. remote
  61. style="width: 100%"
  62. placeholder="请选择供应商"
  63. @change="($e) => changeVenderSelect($e, index)"
  64. >
  65. <el-option
  66. v-for="option in vendorList[index]"
  67. :key="option.id"
  68. :value="option.id"
  69. :label="option.name"
  70. ></el-option>
  71. </el-select>
  72. </el-form-item>
  73. <div
  74. v-if="index < forms.length - 1"
  75. class="btn-copy"
  76. @click.self="commonCopyFormItem(index, 'vendor_id')"
  77. >
  78. &gt;&gt;&gt;
  79. </div>
  80. </div>
  81. </el-form>
  82. </div>
  83. <div class="flex items-stretch">
  84. <div class="second-label">
  85. {{ $t(prefix + 'label_supplier_type') }}
  86. </div>
  87. <div
  88. v-for="(item, index) in forms"
  89. :key="index"
  90. class="input-area"
  91. >
  92. <el-input
  93. v-model="item.vendor_type"
  94. placeholder="请输入供应商类型"
  95. ></el-input>
  96. <div
  97. v-if="index < forms.length - 1"
  98. class="btn-copy"
  99. @click.self="commonCopyFormItem(index, 'vendor_type')"
  100. >
  101. &gt;&gt;&gt;
  102. </div>
  103. </div>
  104. </div>
  105. <div class="flex items-stretch">
  106. <div class="second-label">
  107. {{ $t(prefix + 'label_wangwang_year') }}
  108. </div>
  109. <div
  110. v-for="(item, index) in forms"
  111. :key="index"
  112. class="input-area"
  113. >
  114. <el-input
  115. v-model="item.vendor_wangwang_old"
  116. placeholder="请输入旺旺年份"
  117. ></el-input>
  118. <div
  119. v-if="index < forms.length - 1"
  120. class="btn-copy"
  121. @click.self="commonCopyFormItem(index, 'vendor_wangwang_old')"
  122. >
  123. &gt;&gt;&gt;
  124. </div>
  125. </div>
  126. </div>
  127. <div class="flex items-stretch">
  128. <div class="second-label">
  129. {{ $t(prefix + 'label_contact') }}
  130. </div>
  131. <div
  132. v-for="(item, index) in forms"
  133. :key="index"
  134. class="input-area"
  135. >
  136. <el-input
  137. v-model="item.vendor_contact"
  138. placeholder="请输入联系人"
  139. ></el-input>
  140. <div
  141. v-if="index < forms.length - 1"
  142. class="btn-copy"
  143. @click.self="commonCopyFormItem(index, 'vendor_contact')"
  144. >
  145. &gt;&gt;&gt;
  146. </div>
  147. </div>
  148. </div>
  149. <div class="flex items-stretch">
  150. <div class="second-label">
  151. {{ $t(prefix + 'label_phone') }}
  152. </div>
  153. <div
  154. v-for="(item, index) in forms"
  155. :key="index"
  156. class="input-area"
  157. >
  158. <el-input
  159. v-model="item.vendor_phone"
  160. placeholder="请输入电话"
  161. ></el-input>
  162. <div
  163. v-if="index < forms.length - 1"
  164. class="btn-copy"
  165. @click.self="commonCopyFormItem(index, 'vendor_phone')"
  166. >
  167. &gt;&gt;&gt;
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. <div class="flex items-stretch">
  174. <div class="first-label flex justify-center items-center">
  175. {{ $t(prefix + 'label_product_info') }}
  176. </div>
  177. <div class="flex flex-col items-stretch">
  178. <div class="flex items-stretch">
  179. <div class="second-label required">
  180. {{ $t(prefix + 'label_product_name') }}
  181. </div>
  182. <el-form
  183. v-for="(item, index) in forms"
  184. :ref="($e) => getFormRef($e, `product_name_${index}`)"
  185. :key="index"
  186. :show-message="false"
  187. :model="item"
  188. >
  189. <div class="input-area">
  190. <el-form-item
  191. prop="product_name"
  192. :rules="{
  193. required: true,
  194. trigger: 'change',
  195. validator: commonCheck,
  196. }"
  197. >
  198. <el-input
  199. v-model="item.product_name"
  200. placeholder="请输入产品名称"
  201. ></el-input>
  202. </el-form-item>
  203. <div
  204. v-if="index < forms.length - 1"
  205. class="btn-copy"
  206. @click.self="commonCopyFormItem(index, 'product_name')"
  207. >
  208. &gt;&gt;&gt;
  209. </div>
  210. </div>
  211. </el-form>
  212. </div>
  213. <div class="flex items-stretch">
  214. <div class="second-label">
  215. {{ $t(prefix + 'label_product_url') }}
  216. </div>
  217. <div
  218. v-for="(item, index) in forms"
  219. :key="index"
  220. class="input-area"
  221. >
  222. <el-input
  223. v-model="item.product_url"
  224. placeholder="请输入产品链接"
  225. ></el-input>
  226. <div
  227. v-if="index < forms.length - 1"
  228. class="btn-copy"
  229. @click.self="commonCopyFormItem(index, 'product_url')"
  230. >
  231. &gt;&gt;&gt;
  232. </div>
  233. </div>
  234. </div>
  235. <div class="flex items-stretch">
  236. <div class="second-label">
  237. {{ $t(prefix + 'label_product_image') }}
  238. </div>
  239. <div
  240. v-for="(item, index) in forms"
  241. :key="index"
  242. class="input-area"
  243. >
  244. <image-upload
  245. v-model:list="productImageList[index]"
  246. width="100px"
  247. height="100px"
  248. :disable-preview="true"
  249. ></image-upload>
  250. <div
  251. v-if="index < forms.length - 1"
  252. class="btn-copy"
  253. @click.self="commonCopyFormItem(index, 'productImageList')"
  254. >
  255. &gt;&gt;&gt;
  256. </div>
  257. </div>
  258. </div>
  259. <div class="flex items-stretch">
  260. <div class="second-label">
  261. {{ $t(prefix + 'label_size') }}
  262. </div>
  263. <div
  264. v-for="(item, index) in forms"
  265. :key="index"
  266. class="input-area"
  267. >
  268. <el-input
  269. v-model="item.product_size"
  270. placeholder="请输入尺寸"
  271. ></el-input>
  272. <div
  273. v-if="index < forms.length - 1"
  274. class="btn-copy"
  275. @click.self="commonCopyFormItem(index, 'product_size')"
  276. >
  277. &gt;&gt;&gt;
  278. </div>
  279. </div>
  280. </div>
  281. <div class="flex items-stretch">
  282. <div class="second-label">
  283. {{ $t(prefix + 'label_product_hd') }}
  284. </div>
  285. <div
  286. v-for="(item, index) in forms"
  287. :key="index"
  288. class="input-area"
  289. >
  290. <el-input
  291. v-model="item.product_hd"
  292. placeholder="请输入厚度"
  293. ></el-input>
  294. <div
  295. v-if="index < forms.length - 1"
  296. class="btn-copy"
  297. @click.self="commonCopyFormItem(index, 'product_hd')"
  298. >
  299. &gt;&gt;&gt;
  300. </div>
  301. </div>
  302. </div>
  303. <div class="flex items-stretch">
  304. <div class="second-label">
  305. {{ $t(prefix + 'label_capacity') }}
  306. </div>
  307. <div
  308. v-for="(item, index) in forms"
  309. :key="index"
  310. class="input-area"
  311. >
  312. <el-input
  313. v-model="item.product_capacity"
  314. placeholder="请输入容量"
  315. ></el-input>
  316. <div
  317. v-if="index < forms.length - 1"
  318. class="btn-copy"
  319. @click.self="commonCopyFormItem(index, 'product_capacity')"
  320. >
  321. &gt;&gt;&gt;
  322. </div>
  323. </div>
  324. </div>
  325. <div class="flex items-stretch">
  326. <div class="second-label">
  327. {{ $t(prefix + 'label_material') }}
  328. </div>
  329. <div
  330. v-for="(item, index) in forms"
  331. :key="index"
  332. class="input-area"
  333. >
  334. <el-input
  335. v-model="item.product_material"
  336. placeholder="请输入材质"
  337. ></el-input>
  338. <div
  339. v-if="index < forms.length - 1"
  340. class="btn-copy"
  341. @click.self="commonCopyFormItem(index, 'product_material')"
  342. >
  343. &gt;&gt;&gt;
  344. </div>
  345. </div>
  346. </div>
  347. <div class="flex items-stretch">
  348. <div class="second-label">
  349. {{ $t(prefix + 'label_battery') }}
  350. </div>
  351. <div
  352. v-for="(item, index) in forms"
  353. :key="index"
  354. class="input-area"
  355. >
  356. <el-input
  357. v-model="item.product_battery"
  358. placeholder="是否带电池"
  359. ></el-input>
  360. <div
  361. v-if="index < forms.length - 1"
  362. class="btn-copy"
  363. @click.self="commonCopyFormItem(index, 'product_battery')"
  364. >
  365. &gt;&gt;&gt;
  366. </div>
  367. </div>
  368. </div>
  369. <div class="flex items-stretch">
  370. <div class="second-label">
  371. {{ $t(prefix + 'label_print_require') }}
  372. </div>
  373. <div
  374. v-for="(item, index) in forms"
  375. :key="index"
  376. class="input-area"
  377. >
  378. <el-input
  379. v-model="item.product_require_print"
  380. placeholder="请输入要求"
  381. ></el-input>
  382. <div
  383. v-if="index < forms.length - 1"
  384. class="btn-copy"
  385. @click.self="
  386. commonCopyFormItem(index, 'product_require_print')
  387. "
  388. >
  389. &gt;&gt;&gt;
  390. </div>
  391. </div>
  392. </div>
  393. <div class="flex items-stretch">
  394. <div class="second-label">
  395. {{ $t(prefix + 'label_color') }}
  396. </div>
  397. <div
  398. v-for="(item, index) in forms"
  399. :key="index"
  400. class="input-area"
  401. >
  402. <el-input
  403. v-model="item.product_color"
  404. placeholder="请输入颜色"
  405. ></el-input>
  406. <div
  407. v-if="index < forms.length - 1"
  408. class="btn-copy"
  409. @click.self="commonCopyFormItem(index, 'product_color')"
  410. >
  411. &gt;&gt;&gt;
  412. </div>
  413. </div>
  414. </div>
  415. <div class="flex items-stretch">
  416. <div class="second-label">
  417. {{ $t(prefix + 'label_color_require') }}
  418. </div>
  419. <div
  420. v-for="(item, index) in forms"
  421. :key="index"
  422. class="input-area"
  423. >
  424. <el-input
  425. v-model="item.product_require_color"
  426. placeholder="请输入颜色定制要求"
  427. ></el-input>
  428. <div
  429. v-if="index < forms.length - 1"
  430. class="btn-copy"
  431. @click.self="
  432. commonCopyFormItem(index, 'product_require_color')
  433. "
  434. >
  435. &gt;&gt;&gt;
  436. </div>
  437. </div>
  438. </div>
  439. <div class="flex items-stretch">
  440. <div class="second-label">
  441. {{ $t(prefix + 'label_other') }}
  442. </div>
  443. <div
  444. v-for="(item, index) in forms"
  445. :key="index"
  446. class="input-area"
  447. >
  448. <el-input
  449. v-model="item.product_other"
  450. placeholder="其他信息"
  451. type="textarea"
  452. :rows="3"
  453. ></el-input>
  454. <div
  455. v-if="index < forms.length - 1"
  456. class="btn-copy"
  457. @click.self="commonCopyFormItem(index, 'product_other')"
  458. >
  459. &gt;&gt;&gt;
  460. </div>
  461. </div>
  462. </div>
  463. </div>
  464. </div>
  465. <div class="flex items-stretch">
  466. <div class="first-label flex justify-center items-center">
  467. {{ $t(prefix + 'label_factory_price') }}
  468. </div>
  469. <div class="flex flex-col items-stretch">
  470. <div class="flex items-stretch">
  471. <div class="second-label required">
  472. {{ $t(prefix + 'label_number_table') }}
  473. </div>
  474. <el-form
  475. v-for="(item, index) in forms"
  476. :ref="($e) => getFormRef($e, `number_${index}`)"
  477. :key="index"
  478. :show-message="false"
  479. :model="item"
  480. >
  481. <div class="input-area">
  482. <div class="sub-table">
  483. <div class="sub-table-head flex items-center">
  484. <div class="sub-table-number">数量</div>
  485. <div class="sub-table-price">单价(RMB)</div>
  486. <div class="sub-table-days">天数</div>
  487. </div>
  488. <div
  489. v-for="(i, subIndex) in item.number"
  490. :key="subIndex"
  491. class="sub-table-row flex items-center"
  492. >
  493. <div class="sub-table-number">
  494. <el-form-item
  495. :prop="'number.' + subIndex"
  496. :rules="{
  497. required: true,
  498. validator: commonCheck,
  499. }"
  500. >
  501. <el-input v-model="item.number[subIndex]"></el-input>
  502. </el-form-item>
  503. </div>
  504. <div class="sub-table-price">
  505. <el-form-item
  506. :prop="'price.' + subIndex"
  507. :rules="{
  508. required: true,
  509. validator: commonCheck,
  510. }"
  511. >
  512. <el-input v-model="item.price[subIndex]"></el-input>
  513. </el-form-item>
  514. </div>
  515. <div class="sub-table-days">
  516. <el-form-item
  517. :prop="'days.' + subIndex"
  518. :rules="{
  519. required: true,
  520. validator: commonCheck,
  521. }"
  522. >
  523. <el-input v-model="item.days[subIndex]"></el-input>
  524. </el-form-item>
  525. </div>
  526. <div class="sub-table-btn-delete">
  527. <div
  528. v-show="item.number.length > 1"
  529. @click="numberTableDeleteRow(index, subIndex)"
  530. >
  531. <el-icon size="18">
  532. <CircleCloseFilled></CircleCloseFilled>
  533. </el-icon>
  534. </div>
  535. </div>
  536. </div>
  537. </div>
  538. <div class="sub-table-btn-add">
  539. <el-button
  540. size="small"
  541. @click="numberTableAddRow(index)"
  542. >
  543. + 添加价格信息
  544. </el-button>
  545. </div>
  546. <div
  547. v-if="index < forms.length - 1"
  548. class="btn-copy"
  549. style="bottom: 4px; top: unset"
  550. @click.self="commonCopyFormItem(index, 'numberItem')"
  551. >
  552. &gt;&gt;&gt;
  553. </div>
  554. </div>
  555. </el-form>
  556. </div>
  557. <div class="flex items-stretch">
  558. <div class="second-label required">
  559. {{ $t(prefix + 'label_extra_fee') }}
  560. </div>
  561. <el-form
  562. v-for="(item, index) in forms"
  563. :ref="($e) => getFormRef($e, `cost_${index}`)"
  564. :key="index"
  565. :show-message="false"
  566. :model="item"
  567. >
  568. <div class="input-area">
  569. <div class="sub-table">
  570. <div class="sub-table-head flex items-center">
  571. <div class="sub-table-cost-name">项目</div>
  572. <div class="sub-table-cost-price">价格(RMB)</div>
  573. </div>
  574. <div
  575. v-for="(i, subIndex) in item.cost_name"
  576. :key="subIndex"
  577. class="sub-table-row flex items-center"
  578. >
  579. <div class="sub-table-cost-name">
  580. <el-form-item
  581. :prop="'cost_name.' + subIndex"
  582. :rules="{
  583. required: true,
  584. validator: commonCheck,
  585. }"
  586. >
  587. <el-select
  588. v-model="item.cost_name[subIndex]"
  589. size="small"
  590. >
  591. <el-option
  592. v-for="option in costOptions"
  593. :key="option.label"
  594. :label="option.label"
  595. :value="option.value"
  596. ></el-option>
  597. </el-select>
  598. </el-form-item>
  599. </div>
  600. <div class="sub-table-cost-price">
  601. <el-form-item
  602. :prop="'cost_price.' + subIndex"
  603. :rules="{
  604. required: true,
  605. validator: commonCheck,
  606. }"
  607. >
  608. <el-input
  609. v-model="item.cost_price[subIndex]"
  610. ></el-input>
  611. </el-form-item>
  612. </div>
  613. <div class="sub-table-btn-delete">
  614. <el-button
  615. :disabled="item.cost_name.length < 2"
  616. type="danger"
  617. size="small"
  618. plain
  619. @click="costTableDeleteRow(index, subIndex)"
  620. >
  621. {{ $t('btn_delete') }}
  622. </el-button>
  623. </div>
  624. </div>
  625. </div>
  626. <div class="sub-table-btn-add">
  627. <el-button
  628. size="small"
  629. @click="costTableAddRow(index)"
  630. >
  631. + 添加价格信息
  632. </el-button>
  633. </div>
  634. <div
  635. v-if="index < forms.length - 1"
  636. class="btn-copy"
  637. style="bottom: 4px; top: unset"
  638. @click.self="commonCopyFormItem(index, 'cost')"
  639. >
  640. &gt;&gt;&gt;
  641. </div>
  642. </div>
  643. </el-form>
  644. </div>
  645. </div>
  646. </div>
  647. <div class="flex items-stretch">
  648. <div class="first-label flex justify-center items-center">
  649. {{ $t(prefix + 'label_package_info') }}
  650. </div>
  651. <div class="flex flex-col items-stretch">
  652. <div class="flex items-stretch">
  653. <div class="second-label">
  654. {{ $t(prefix + 'label_package') }}
  655. </div>
  656. <div
  657. v-for="(item, index) in forms"
  658. :key="index"
  659. class="input-area"
  660. >
  661. <el-input
  662. v-model="item.package_info"
  663. placeholder="请输入产品包装信息"
  664. ></el-input>
  665. <div
  666. v-if="index < forms.length - 1"
  667. class="btn-copy"
  668. @click.self="commonCopyFormItem(index, 'package_info')"
  669. >
  670. &gt;&gt;&gt;
  671. </div>
  672. </div>
  673. </div>
  674. <div class="flex flex-col items-stretch">
  675. <div class="flex items-stretch">
  676. <div class="second-label required">
  677. {{ $t(prefix + 'label_gross_weight') }}(KG)
  678. </div>
  679. <el-form
  680. v-for="(item, index) in forms"
  681. :ref="($e) => getFormRef($e, `package_weight_${index}`)"
  682. :key="index"
  683. :show-message="false"
  684. :model="item"
  685. >
  686. <div class="input-area">
  687. <el-form-item
  688. prop="package_weight"
  689. :rules="{ required: true, validator: commonCheck }"
  690. >
  691. <el-input
  692. v-model="item.package_weight"
  693. placeholder="请输入每箱毛重"
  694. ></el-input>
  695. </el-form-item>
  696. <div
  697. v-if="index < forms.length - 1"
  698. class="btn-copy"
  699. @click.self="commonCopyFormItem(index, 'package_weight')"
  700. >
  701. &gt;&gt;&gt;
  702. </div>
  703. </div>
  704. </el-form>
  705. </div>
  706. <div class="flex items-stretch">
  707. <div class="second-label required">
  708. {{ $t(prefix + 'label_package_size') }}(CM)
  709. </div>
  710. <el-form
  711. v-for="(item, index) in forms"
  712. :ref="($e) => getFormRef($e, `package_size_${index}`)"
  713. :key="index"
  714. :show-message="false"
  715. :model="item"
  716. >
  717. <div class="input-area flex justify-center items-center">
  718. <el-form-item
  719. prop="package_size_length"
  720. :rules="{
  721. required: true,
  722. trigger: 'change',
  723. validator: commonCheck,
  724. }"
  725. >
  726. <el-input
  727. v-model="item.package_size_length"
  728. style="width: 74px"
  729. placeholder="长"
  730. ></el-input>
  731. </el-form-item>
  732. <el-icon size="18">
  733. <Close></Close>
  734. </el-icon>
  735. <el-form-item
  736. prop="package_size_width"
  737. :rules="{
  738. required: true,
  739. trigger: 'change',
  740. validator: commonCheck,
  741. }"
  742. >
  743. <el-input
  744. v-model="item.package_size_width"
  745. style="width: 74px"
  746. placeholder="宽"
  747. ></el-input>
  748. </el-form-item>
  749. <el-icon size="18">
  750. <Close></Close>
  751. </el-icon>
  752. <el-form-item
  753. prop="package_size_height"
  754. :rules="{
  755. required: true,
  756. trigger: 'change',
  757. validator: commonCheck,
  758. }"
  759. >
  760. <el-input
  761. v-model="item.package_size_height"
  762. style="width: 74px"
  763. placeholder="高"
  764. ></el-input>
  765. </el-form-item>
  766. <span>&nbsp;CM</span>
  767. <div
  768. v-if="index < forms.length - 1"
  769. class="btn-copy"
  770. @click.self="commonCopyFormItem(index, 'package_size')"
  771. >
  772. &gt;&gt;&gt;
  773. </div>
  774. </div>
  775. </el-form>
  776. </div>
  777. <div class="flex items-stretch">
  778. <div class="second-label required">
  779. {{ $t(prefix + 'label_pcs') }}(PCS)
  780. </div>
  781. <el-form
  782. v-for="(item, index) in forms"
  783. :ref="($e) => getFormRef($e, `in_package_${index}`)"
  784. :key="index"
  785. :show-message="false"
  786. :model="item"
  787. >
  788. <div class="input-area">
  789. <el-form-item
  790. prop="in_package"
  791. :rules="{
  792. required: true,
  793. trigger: 'change',
  794. validator: commonCheck,
  795. }"
  796. >
  797. <el-input
  798. v-model="item.in_package"
  799. placeholder="PCS"
  800. ></el-input>
  801. </el-form-item>
  802. <div
  803. v-if="index < forms.length - 1"
  804. class="btn-copy"
  805. @click.self="commonCopyFormItem(index, 'in_package')"
  806. >
  807. &gt;&gt;&gt;
  808. </div>
  809. </div>
  810. </el-form>
  811. </div>
  812. </div>
  813. </div>
  814. </div>
  815. <div class="flex items-stretch">
  816. <div class="first-label flex justify-center items-center">
  817. {{ $t(prefix + 'label_example') }}
  818. </div>
  819. <div class="flex flex-col items-stretch">
  820. <div class="flex items-stretch">
  821. <div class="second-label required">
  822. {{ $t(prefix + 'label_example_days') }}(Days)
  823. </div>
  824. <el-form
  825. v-for="(item, index) in forms"
  826. :ref="($e) => getFormRef($e, `demo_days_${index}`)"
  827. :key="index"
  828. :show-message="false"
  829. :model="item"
  830. >
  831. <div class="input-area">
  832. <el-form-item
  833. prop="demo_days"
  834. :rules="{
  835. required: true,
  836. trigger: 'change',
  837. validator: commonCheck,
  838. }"
  839. >
  840. <el-input
  841. v-model="item.demo_days"
  842. placeholder="天数"
  843. ></el-input>
  844. </el-form-item>
  845. <div
  846. v-if="index < forms.length - 1"
  847. class="btn-copy"
  848. @click.self="commonCopyFormItem(index, 'demo_days')"
  849. >
  850. &gt;&gt;&gt;
  851. </div>
  852. </div>
  853. </el-form>
  854. </div>
  855. <div class="flex items-stretch">
  856. <div class="second-label">
  857. {{ $t(prefix + 'label_example_cost') }}(¥)
  858. </div>
  859. <div
  860. v-for="(item, index) in forms"
  861. :key="index"
  862. class="input-area"
  863. >
  864. <el-input
  865. v-model="item.demo_cost"
  866. placeholder="请输入打样费用"
  867. ></el-input>
  868. <div
  869. v-if="index < forms.length - 1"
  870. class="btn-copy"
  871. @click.self="commonCopyFormItem(index, 'demo_cost')"
  872. >
  873. &gt;&gt;&gt;
  874. </div>
  875. </div>
  876. </div>
  877. <div class="flex items-stretch">
  878. <div class="second-label">
  879. {{ $t(prefix + 'label_can_refund') }}
  880. </div>
  881. <div
  882. v-for="(item, index) in forms"
  883. :key="index"
  884. class="input-area"
  885. >
  886. <el-input
  887. v-model="item.demo_return"
  888. placeholder="请输入退费信息"
  889. ></el-input>
  890. <div
  891. v-if="index < forms.length - 1"
  892. class="btn-copy"
  893. @click.self="commonCopyFormItem(index, 'demo_return')"
  894. >
  895. &gt;&gt;&gt;
  896. </div>
  897. </div>
  898. </div>
  899. </div>
  900. </div>
  901. <div class="flex items-stretch">
  902. <div class="first-label flex justify-center items-center"></div>
  903. <div class="flex flex-col items-stretch">
  904. <div class="flex items-stretch">
  905. <div class="second-label">
  906. {{ $t(prefix + 'label_cert') }}
  907. </div>
  908. <div
  909. v-for="(item, index) in forms"
  910. :key="index"
  911. class="input-area"
  912. >
  913. <el-input
  914. v-model="item.cert"
  915. placeholder="证书"
  916. ></el-input>
  917. <div
  918. v-if="index < forms.length - 1"
  919. class="btn-copy"
  920. @click.self="commonCopyFormItem(index, 'cert')"
  921. >
  922. &gt;&gt;&gt;
  923. </div>
  924. </div>
  925. </div>
  926. <div class="flex items-stretch">
  927. <div class="second-label">
  928. {{ $t(prefix + 'label_comment') }}
  929. </div>
  930. <div
  931. v-for="(item, index) in forms"
  932. :key="index"
  933. class="input-area"
  934. >
  935. <el-input
  936. v-model="item.notes"
  937. placeholder="请输入内容"
  938. type="textarea"
  939. :rows="3"
  940. ></el-input>
  941. <div
  942. v-if="index < forms.length - 1"
  943. class="btn-copy"
  944. @click.self="commonCopyFormItem(index, 'notes')"
  945. >
  946. &gt;&gt;&gt;
  947. </div>
  948. </div>
  949. </div>
  950. </div>
  951. </div>
  952. </div>
  953. <div
  954. v-show="canAddForm"
  955. class="btn-add-indent-info flex justify-center flex-col items-center"
  956. @click="addFormColumn"
  957. >
  958. <el-icon
  959. size="42"
  960. class="el-icon-circle-plus-outline"
  961. >
  962. <CirclePlus></CirclePlus>
  963. </el-icon>
  964. <div>
  965. {{ $t(prefix + 'btn_add_info') }}
  966. </div>
  967. </div>
  968. <template #footer>
  969. <div class="flex justify-center items-center">
  970. <!-- v-show="$showAuthBtn(429)" -->
  971. <el-button
  972. type="primary"
  973. size="small"
  974. @click="checkForm"
  975. >
  976. {{ $t('btn_save') }}
  977. </el-button>
  978. <el-button
  979. type=""
  980. size="small"
  981. @click="close"
  982. >
  983. {{ $t('btn_close') }}
  984. </el-button>
  985. </div>
  986. </template>
  987. </el-dialog>
  988. </div>
  989. </template>
  990. <script lang="ts" setup>
  991. import { defineComponent, ref, watch, computed, nextTick, inject } from 'vue'
  992. import {
  993. ElButton,
  994. ElForm,
  995. ElFormItem,
  996. ElInput,
  997. ElSelect,
  998. ElOption,
  999. ElDialog,
  1000. ElNotification,
  1001. ElMessage,
  1002. ElIcon,
  1003. ElMessageBox,
  1004. } from 'element-plus'
  1005. import { CirclePlus, Close, CircleCloseFilled } from '@element-plus/icons-vue'
  1006. import debounce from 'lodash.debounce'
  1007. import cloneDeep from 'lodash.clonedeep'
  1008. import { $t } from '@/i18n/index'
  1009. import imageUpload from '@/components/ImageUpload.vue'
  1010. // 用来对oss的图片、视频等媒体数据的url进行匹配替换
  1011. import { getVendorList, createQuote } from '@/api/indent'
  1012. import userAPI from '@/api/user'
  1013. defineComponent({
  1014. name: 'EditInfo',
  1015. })
  1016. const $emit = defineEmits(['update:visible', 'create'])
  1017. const {
  1018. visible = 0,
  1019. alreadyHasIndentCount = 0,
  1020. parentId = 0,
  1021. dataForEdit = { vendor_name: '' } as any,
  1022. } = defineProps<{
  1023. visible: number
  1024. alreadyHasIndentCount?: number
  1025. parentId?: number | string
  1026. dataForEdit?: object
  1027. }>()
  1028. const $mediaRegExp = inject('mediaRegExp') as RegExp
  1029. const prefix = 'order.indent_edit_info.'
  1030. const show = ref(false)
  1031. const costOptions = [
  1032. {
  1033. label: $t('text_please_select'),
  1034. value: '',
  1035. },
  1036. {
  1037. label: '样品费用',
  1038. value: '样品费用',
  1039. },
  1040. {
  1041. label: '印刷费用',
  1042. value: '印刷费用',
  1043. },
  1044. {
  1045. label: '模具费用',
  1046. value: '模具费用',
  1047. },
  1048. {
  1049. label: '制版费用',
  1050. value: '制版费用',
  1051. },
  1052. {
  1053. label: '染色费用',
  1054. value: '染色费用',
  1055. },
  1056. {
  1057. label: '其他费用',
  1058. value: '其他费用',
  1059. },
  1060. ]
  1061. const formDemo = {
  1062. // 供应商
  1063. vendor_name: '',
  1064. vendor_id: '',
  1065. vendor_type: '',
  1066. vendor_wangwang_old: '',
  1067. vendor_contact: '',
  1068. vendor_phone: '',
  1069. // 产品信息
  1070. product_name: '',
  1071. product_url: '',
  1072. product_image: '',
  1073. product_size: '',
  1074. product_hd: '',
  1075. product_capacity: '',
  1076. product_material: '',
  1077. product_battery: '',
  1078. product_require_print: '',
  1079. product_color: '',
  1080. product_require_color: '',
  1081. product_other: '',
  1082. // 出厂价
  1083. number: [''],
  1084. price: [''],
  1085. days: [''],
  1086. cost_name: [''],
  1087. cost_price: [''],
  1088. // 包装信息
  1089. package_info: '',
  1090. package_size_length: '',
  1091. package_size_width: '',
  1092. package_size_height: '',
  1093. package_weight: '',
  1094. in_package: '', // 一箱个数
  1095. // 打样情况
  1096. demo_days: '',
  1097. demo_cost: '',
  1098. demo_return: '',
  1099. cert: '',
  1100. notes: '',
  1101. }
  1102. const forms = ref<any[]>([])
  1103. const canAddForm = computed(() => {
  1104. return 100 - alreadyHasIndentCount - forms.value.length > 0
  1105. })
  1106. const productImageList = ref([] as any[][])
  1107. const vendorList = ref([] as any[][])
  1108. const manualVendor = ref({} as any)
  1109. const commonCopyFormItem = function (index: number, key: string) {
  1110. if (['vendor_id', 'vendor_name', 'vendor_phone'].includes(key)) {
  1111. vendorList.value.splice(index + 1, 1, cloneDeep(vendorList.value[index]))
  1112. forms.value[index + 1].vendor_name = forms.value[index].vendor_name
  1113. forms.value[index + 1].vendor_phone = forms.value[index].vendor_phone
  1114. forms.value[index + 1].vendor_id = forms.value[index].vendor_id
  1115. } else if (key === 'productImageList') {
  1116. productImageList.value.splice(
  1117. index + 1,
  1118. 1,
  1119. cloneDeep(productImageList.value[index]),
  1120. )
  1121. } else if (key === 'cost') {
  1122. // 额外费用
  1123. forms.value[index + 1].cost_name = cloneDeep(forms.value[index].cost_name)
  1124. forms.value[index + 1].cost_price = cloneDeep(forms.value[index].cost_price)
  1125. } else if (key === 'numberItem') {
  1126. // 数量 单价
  1127. forms.value[index + 1].number = cloneDeep(forms.value[index].number)
  1128. forms.value[index + 1].price = cloneDeep(forms.value[index].price)
  1129. forms.value[index + 1].days = cloneDeep(forms.value[index].days)
  1130. } else if (key === 'package_size') {
  1131. // 外箱规格
  1132. forms.value[index + 1].package_size_length = cloneDeep(
  1133. forms.value[index].package_size_length,
  1134. )
  1135. forms.value[index + 1].package_size_width = cloneDeep(
  1136. forms.value[index].package_size_width,
  1137. )
  1138. forms.value[index + 1].package_size_height = cloneDeep(
  1139. forms.value[index].package_size_height,
  1140. )
  1141. } else {
  1142. forms.value[index + 1][key] = forms.value[index][key]
  1143. }
  1144. }
  1145. const costTableDeleteRow = function (index: number, subIndex: number) {
  1146. forms.value[index].cost_name.splice(subIndex, 1)
  1147. forms.value[index].cost_price.splice(subIndex, 1)
  1148. }
  1149. const costTableAddRow = function (index: number) {
  1150. forms.value[index].cost_name.push('')
  1151. forms.value[index].cost_price.push('')
  1152. }
  1153. const numberTableDeleteRow = function (index: number, subIndex: number) {
  1154. forms.value[index].number.splice(subIndex, 1)
  1155. forms.value[index].price.splice(subIndex, 1)
  1156. forms.value[index].days.splice(subIndex, 1)
  1157. }
  1158. const numberTableAddRow = function (index: number) {
  1159. forms.value[index].number.push('')
  1160. forms.value[index].price.push('')
  1161. forms.value[index].days.push('')
  1162. }
  1163. // 仅编辑报价信息时需要初始化
  1164. const initData = function () {
  1165. // 查询供应商候选列表, 不然下拉框无数据匹配, 下拉框界面上会显示成供应商的id
  1166. queryVenderList(dataForEdit.vendor_name, 0)
  1167. const temp = cloneDeep(dataForEdit)
  1168. productImageList.value.push([])
  1169. if (Array.isArray(temp.product_image) && temp.product_image.length) {
  1170. nextTick(() => {
  1171. productImageList.value.splice(
  1172. 0,
  1173. 1,
  1174. temp.product_image.map((img: string) => {
  1175. return {
  1176. url: $mediaRegExp.test(img)
  1177. ? img
  1178. : import.meta.env.VITE_APP_OSS_PREFIX + img,
  1179. }
  1180. }),
  1181. )
  1182. })
  1183. }
  1184. if (temp.cost_list && temp.cost_list.length > 2) {
  1185. const t = JSON.parse(temp.cost_list)
  1186. temp.cost_name = []
  1187. temp.cost_price = []
  1188. t.forEach((item: any) => {
  1189. temp.cost_name.push(item.cost_name)
  1190. temp.cost_price.push(item.cost_price)
  1191. })
  1192. } else {
  1193. // 如果cost_list字符串长度小于2, 说明该数组为空, 删除temp的对应字段, 避免覆盖掉formDemo的克隆值.
  1194. delete temp.cost_name
  1195. delete temp.cost_price
  1196. }
  1197. if (temp.price_list && temp.price_list.length > 2) {
  1198. const t = JSON.parse(temp.price_list)
  1199. temp.number = []
  1200. temp.price = []
  1201. temp.days = []
  1202. t.forEach((item: any) => {
  1203. temp.number.push(item.number)
  1204. temp.price.push(item.price)
  1205. temp.days.push(item.days)
  1206. })
  1207. } else {
  1208. // 如果 price_list 字符串长度小于2, 说明该数组为空, 删除temp的对应字段, 避免覆盖掉formDemo的克隆值.
  1209. delete temp.cost_name
  1210. delete temp.cost_price
  1211. }
  1212. temp.entity_id = temp.id
  1213. // 删除无用字段避免接口报错
  1214. delete temp.id
  1215. // delete temp.parent_id
  1216. delete temp.create_time
  1217. delete temp.update_time
  1218. delete temp.creator
  1219. delete temp.admin_id
  1220. forms.value.push(Object.assign({}, cloneDeep(formDemo), temp))
  1221. }
  1222. const deleteForm = function (index: number) {
  1223. forms.value.splice(index, 1)
  1224. productImageList.value.splice(index, 1)
  1225. vendorList.value.splice(index, 1)
  1226. }
  1227. const addFormColumn = function () {
  1228. if (canAddForm.value) {
  1229. forms.value.push(
  1230. Object.assign(cloneDeep(formDemo), { parent_id: parentId }),
  1231. )
  1232. productImageList.value.push([])
  1233. vendorList.value.push([])
  1234. }
  1235. }
  1236. watch(
  1237. () => visible,
  1238. () => {
  1239. forms.value = []
  1240. productImageList.value = []
  1241. vendorList.value = []
  1242. if (visible > 1) {
  1243. initData()
  1244. } else if (visible > 0) {
  1245. addFormColumn()
  1246. }
  1247. show.value = visible > 0
  1248. },
  1249. )
  1250. const queryVenderList = function (keywords: string, index: number) {
  1251. getVendorList({ keywords }).then((response: any) => {
  1252. if (Array.isArray(response.result)) {
  1253. if (manualVendor.value.id) {
  1254. vendorList.value.splice(
  1255. index,
  1256. 1,
  1257. [manualVendor.value].concat(response.result || []),
  1258. )
  1259. } else {
  1260. vendorList.value.splice(index, 1, response.result || [])
  1261. }
  1262. }
  1263. })
  1264. }
  1265. const changeVenderSelect = function (value: string | number, index: number) {
  1266. if (value) {
  1267. const temp = vendorList.value[index].filter((i) => i.id === value)
  1268. if (temp.length) {
  1269. forms.value[index].vendor_name = temp[0].name
  1270. forms.value[index].vendor_phone = temp[0].phone || temp[0].Phone || ''
  1271. manualVendor.value = {
  1272. name: '',
  1273. id: '',
  1274. }
  1275. } else {
  1276. forms.value[index].vendor_name = value || ''
  1277. forms.value[index].vendor_phone = ''
  1278. forms.value[index].vendor_type = ''
  1279. manualVendor.value = {
  1280. name: value || '',
  1281. id: value || '',
  1282. }
  1283. }
  1284. }
  1285. }
  1286. const auditUser = ref('')
  1287. const getCurrentAuditUser = () => {
  1288. userAPI.getAuditUser().then((res: any) => {
  1289. // console.log(res, 'res')
  1290. if (
  1291. res.code === 1 &&
  1292. Array.isArray(res.result.data) &&
  1293. res.result.data.length
  1294. ) {
  1295. const temp = res.result.data.filter((i: any) => i.type === 1)
  1296. // console.log(temp, 'temp')
  1297. if (temp.length) auditUser.value = temp[0].email
  1298. }
  1299. })
  1300. }
  1301. getCurrentAuditUser()
  1302. const createQuoteFunc = function () {
  1303. const params = {
  1304. file: '', // 疑似永远为空
  1305. } as any
  1306. if (parentId) {
  1307. params.parent_id = parentId
  1308. }
  1309. let notiList: string[] = []
  1310. let temp = cloneDeep(forms.value)
  1311. temp = temp.map((item, index) => {
  1312. const result = { ...item }
  1313. result.price_list = []
  1314. result.number.forEach((v: any, i: number) => {
  1315. result.price_list.push({
  1316. number: `${result.number[i]}`,
  1317. price: `${result.price[i]}`,
  1318. days: `${result.days[i]}`,
  1319. })
  1320. })
  1321. result.cost_list = []
  1322. result.cost_name.forEach((v: any, i: number) => {
  1323. result.cost_list.push({
  1324. cost_name: `${result.cost_name[i]}`,
  1325. cost_price: `${result.cost_price[i]}`,
  1326. })
  1327. })
  1328. result.product_image = productImageList.value[index]
  1329. .map((i) => {
  1330. return i.url.replace($mediaRegExp, '/')
  1331. })
  1332. .join(',')
  1333. if (result.vendor_id && result.vendor_name === result.vendor_id) {
  1334. notiList.push(result.vendor_name)
  1335. }
  1336. return result
  1337. })
  1338. // 组装接口数据
  1339. Object.assign(params, { lists: temp })
  1340. if (notiList.length) {
  1341. ElMessageBox.alert(
  1342. '您正在提交系统外供应商 ' +
  1343. notiList.map((i) => `[${i}]`).join(', ') +
  1344. '<br>本次操作已触发审核流程,审核人将会尽快处理,如有问题请联系:' +
  1345. `<a href="mailto:${auditUser.value}">${auditUser.value}</a>`,
  1346. '提示',
  1347. {
  1348. dangerouslyUseHTMLString: true,
  1349. },
  1350. )
  1351. }
  1352. createQuote(params).then((response: any) => {
  1353. if (response.code !== 1) return
  1354. ElNotification({
  1355. title: '成功',
  1356. message: '提交成功',
  1357. type: 'success',
  1358. duration: 3000,
  1359. })
  1360. $emit('create', response.result)
  1361. close()
  1362. })
  1363. }
  1364. // 用来动态绑定ref, 便于调用表单验证
  1365. const formRef = ref({} as any)
  1366. const getFormRef = (el: any, key: string) => {
  1367. formRef.value[`${key}`] = el
  1368. }
  1369. const checkForm = function () {
  1370. const key = [
  1371. 'vendor_id',
  1372. 'product_name',
  1373. 'number',
  1374. 'cost',
  1375. 'package_weight',
  1376. 'package_size',
  1377. 'in_package',
  1378. 'demo_days',
  1379. ]
  1380. let length = forms.value.length
  1381. const target = [] as any[]
  1382. do {
  1383. key.forEach((i) => {
  1384. target.push(`${i}_${length - 1}`)
  1385. })
  1386. length--
  1387. } while (length >= 1)
  1388. // 表单校验结果
  1389. let result = true
  1390. const promisePool: any[] = []
  1391. target.forEach((i: string) => {
  1392. const r: any = formRef.value[`${i}`]
  1393. if (typeof r.validate === 'function') {
  1394. r.clearValidate()
  1395. const p = new Promise((resolve) => {
  1396. r.validate((valid: boolean) => {
  1397. if (!valid) {
  1398. messageError('请检查表单必填项')
  1399. resolve(false)
  1400. } else {
  1401. resolve(true)
  1402. }
  1403. })
  1404. })
  1405. promisePool.push(p)
  1406. } else {
  1407. result = false
  1408. }
  1409. })
  1410. if (!result) {
  1411. // 一般不会到这里
  1412. messageError('表单异常. 请刷新页面再试或者全屏截图联系管理员')
  1413. return
  1414. }
  1415. Promise.all(promisePool).then((res) => {
  1416. const valid = res.every((a) => a === true)
  1417. if (valid) {
  1418. createQuoteFunc()
  1419. }
  1420. })
  1421. }
  1422. const messageError = debounce(function (info) {
  1423. ElMessage.error(info)
  1424. }, 100)
  1425. const commonCheck = (rule: any, value: any, cb: any) => {
  1426. if (typeof value === 'number') {
  1427. if (value >= 0) {
  1428. cb()
  1429. } else {
  1430. cb(new Error('数字校验出错'))
  1431. }
  1432. return
  1433. }
  1434. if (value && value.trim().length) {
  1435. cb()
  1436. } else {
  1437. cb(new Error('字符串校验出错'))
  1438. }
  1439. }
  1440. const close = (done = {} as any) => {
  1441. $emit('update:visible', 0)
  1442. if (typeof done === 'function') done()
  1443. }
  1444. </script>
  1445. <style lang="scss">
  1446. .component-edit-indent-info {
  1447. .custom-edit-indent-info-dialog {
  1448. margin-top: 0 !important;
  1449. margin-bottom: 0 !important;
  1450. height: 100vh;
  1451. .el-dialog__body {
  1452. max-height: 87vh;
  1453. overflow-y: scroll;
  1454. overflow-x: auto;
  1455. padding-top: 8px;
  1456. }
  1457. .el-dialog__header {
  1458. border-bottom: 1px solid #dcdfe6;
  1459. }
  1460. .el-dialog__footer {
  1461. padding-bottom: 10px;
  1462. }
  1463. }
  1464. }
  1465. </style>
  1466. <style lang="scss" scoped>
  1467. div {
  1468. box-sizing: border-box;
  1469. }
  1470. .form-table {
  1471. margin: 24px 0;
  1472. & > div {
  1473. &::after {
  1474. // 占位符. 让表格右侧在横向滚动的时候能再滚动20px
  1475. content: '.';
  1476. width: 20px;
  1477. padding-left: 20px;
  1478. height: 1px;
  1479. background-color: transparent;
  1480. color: transparent;
  1481. }
  1482. }
  1483. }
  1484. .first-label {
  1485. text-align: center;
  1486. width: 120px;
  1487. min-width: 120px;
  1488. border: 1px solid #dcdfe6;
  1489. border-top: none;
  1490. border-right: none;
  1491. }
  1492. .second-label {
  1493. width: 170px;
  1494. min-width: 170px;
  1495. line-height: 55px;
  1496. min-height: 55px;
  1497. text-align: left;
  1498. padding: 0 10px;
  1499. border: 1px solid #dcdfe6;
  1500. border-top: none;
  1501. &.required {
  1502. color: #ef4135;
  1503. &::before {
  1504. content: '*';
  1505. display: inline-block;
  1506. color: #ef4135;
  1507. font-size: 14px;
  1508. width: 8px;
  1509. height: 8px;
  1510. }
  1511. }
  1512. }
  1513. .input-area {
  1514. position: relative;
  1515. border: 1px solid #dcdfe6;
  1516. border-left: none;
  1517. border-top: none;
  1518. min-height: 55px;
  1519. height: 100%;
  1520. padding: 7px 8px;
  1521. width: 300px;
  1522. min-width: 300px;
  1523. &:hover .btn-copy {
  1524. display: block;
  1525. }
  1526. .btn-copy {
  1527. display: none;
  1528. cursor: pointer;
  1529. background-color: #fff;
  1530. line-height: 26px;
  1531. padding: 0 4px;
  1532. position: absolute;
  1533. z-index: 2;
  1534. top: calc((100% - 26px) / 2);
  1535. right: -16px;
  1536. }
  1537. .el-form-item {
  1538. margin-bottom: 0;
  1539. }
  1540. .sub-table {
  1541. border: 1px solid #dcdfe6;
  1542. border-left: none;
  1543. }
  1544. .sub-table-head {
  1545. text-align: center;
  1546. line-height: 24px;
  1547. height: 24px;
  1548. background-color: #efefef;
  1549. }
  1550. .sub-table-row {
  1551. border-top: 1px solid #dcdfe6;
  1552. }
  1553. .sub-table-head,
  1554. .sub-table-row {
  1555. position: relative;
  1556. & > div {
  1557. border-left: 1px solid #dcdfe6;
  1558. padding: 2px 4px;
  1559. }
  1560. &:hover .sub-table-btn-delete {
  1561. border-left: 0;
  1562. padding: 0;
  1563. display: block;
  1564. }
  1565. }
  1566. .sub-table-price {
  1567. width: 120px;
  1568. }
  1569. .sub-table-days {
  1570. width: 90px;
  1571. }
  1572. .sub-table-number {
  1573. width: 90px;
  1574. }
  1575. .sub-table-cost-name {
  1576. width: 140px;
  1577. }
  1578. .sub-table-cost-price {
  1579. width: 140px;
  1580. }
  1581. .sub-table-btn-delete {
  1582. display: none;
  1583. line-height: 1;
  1584. font-size: 20px;
  1585. color: #ef4135;
  1586. position: absolute;
  1587. right: -6px;
  1588. top: 0;
  1589. z-index: 2;
  1590. }
  1591. .sub-table-btn-add {
  1592. margin: 12px 0 8px;
  1593. }
  1594. }
  1595. .form-header {
  1596. .first-label,
  1597. .input-area,
  1598. .second-label {
  1599. border-top: 1px solid #dcdfe6;
  1600. min-height: auto;
  1601. height: 40px;
  1602. line-height: 40px;
  1603. }
  1604. .el-button {
  1605. color: #ef4135;
  1606. }
  1607. }
  1608. .btn-add-indent-info {
  1609. background-color: #fff;
  1610. z-index: 2;
  1611. width: 74px;
  1612. height: 84px;
  1613. border: 1px solid #009688;
  1614. position: absolute;
  1615. right: 40px;
  1616. bottom: 40px;
  1617. color: #666;
  1618. font-size: 14px;
  1619. cursor: pointer;
  1620. .el-icon-circle-plus-outline {
  1621. color: #009688;
  1622. }
  1623. &:hover {
  1624. color: #333;
  1625. font-weight: 500;
  1626. border-color: #00bb88;
  1627. .el-icon-circle-plus-outline {
  1628. color: #00bb88;
  1629. }
  1630. }
  1631. }
  1632. </style>