edit.vue 94 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116
  1. <template>
  2. <div>
  3. <div
  4. v-if="loading"
  5. v-loading="true"
  6. class="view-window"
  7. element-loading-text="Loading..."
  8. element-loading-background="rgba(0, 0, 0, 0.3)"
  9. ></div>
  10. <div class="flex fixed-button-area">
  11. <!-- <el-button @click="() => generatePDF()">generatePDF</el-button> -->
  12. <el-button
  13. type="info"
  14. @click="formVisible = !formVisible"
  15. >
  16. <el-icon
  17. size="18px"
  18. color="#fff"
  19. >
  20. <Switch />
  21. </el-icon>
  22. &nbsp;{{ formVisible ? 'Preview PDF' : 'Show Form' }}
  23. </el-button>
  24. <el-button
  25. type="primary"
  26. :disabled="!formVisible"
  27. @click="checkForm(mainForm)"
  28. >
  29. <el-icon
  30. size="20px"
  31. color="#fff"
  32. >
  33. <FolderAdd />
  34. </el-icon>
  35. &nbsp;Save & Attach
  36. </el-button>
  37. </div>
  38. <div
  39. v-show="formVisible"
  40. class="screen"
  41. >
  42. <div class="flex justify-between page-title-wrap">
  43. <div class="flex">
  44. <el-icon
  45. size="36px"
  46. :color="variables.mainColor"
  47. >
  48. <ShoppingCart />
  49. </el-icon>
  50. <div class="page-title">New Purchase Order</div>
  51. </div>
  52. </div>
  53. <el-form
  54. ref="mainForm"
  55. :model="form"
  56. :rules="formRule"
  57. label-width="120px"
  58. >
  59. <div class="flex items-start">
  60. <div class="layout-left">
  61. <el-form-item
  62. prop="Order_Type"
  63. label="Order Type"
  64. label-width="130px"
  65. >
  66. <el-radio-group v-model="form.Order_Type">
  67. <el-radio
  68. v-for="(item, index) in orderTypeList"
  69. :key="index"
  70. :label="item.label"
  71. :value="item.label"
  72. >
  73. {{ item.label }}
  74. </el-radio>
  75. </el-radio-group>
  76. </el-form-item>
  77. <el-form-item
  78. label="Artwork Link"
  79. prop="Artwork_Link"
  80. label-width="130px"
  81. >
  82. <el-input
  83. v-model="form.Artwork_Link"
  84. placeholder="Please input"
  85. type="textarea"
  86. :rows="3"
  87. ></el-input>
  88. </el-form-item>
  89. <el-form-item
  90. label="Currency"
  91. label-width="130px"
  92. >
  93. <el-select
  94. v-model="form.Currency"
  95. style="width: 100%"
  96. placeholder="please select currency"
  97. >
  98. <el-option
  99. v-for="(item, index) in currencyList"
  100. :key="index"
  101. :label="item.label"
  102. :value="item.label"
  103. />
  104. </el-select>
  105. </el-form-item>
  106. <el-form-item
  107. v-if="recommandVendor.length"
  108. label="Suggest Supplier"
  109. label-width="130px"
  110. >
  111. <div class="flex flex-col items-start">
  112. <div
  113. v-for="(item, index) in recommandVendor"
  114. :key="index"
  115. class="btn-quick-vendor"
  116. :class="{ active: item.id === form.currentVendor }"
  117. @click="quickSelectSupplier(item)"
  118. >
  119. {{ item.name || '' }}
  120. </div>
  121. </div>
  122. </el-form-item>
  123. </div>
  124. <div class="layout-right flex-auto">
  125. <div style="position: absolute; right: 24px; top: 0">
  126. <el-form-item label="Template:">
  127. <el-select
  128. v-model="currentCompany"
  129. style="width: 150px"
  130. @change="onCompanyTemplateChange"
  131. >
  132. <el-option
  133. v-for="company in computedCompanyList"
  134. :key="company.id"
  135. :value="company.id"
  136. :label="company.label"
  137. ></el-option>
  138. </el-select>
  139. </el-form-item>
  140. </div>
  141. <div class="company-info">
  142. <div class="company-name">{{ computedCompany.name }}</div>
  143. <div class="flex justify-center">
  144. <div class="company-addr">
  145. 地址:&nbsp;{{ computedCompany.addr }}
  146. </div>
  147. <div class="company-phone">
  148. &nbsp;|&nbsp;电话:&nbsp;{{ computedCompany.phone }}
  149. </div>
  150. <div
  151. v-show="computedCompany.fax"
  152. class="company-fax"
  153. >
  154. &nbsp;|&nbsp;传真:&nbsp;{{ computedCompany.fax }}
  155. </div>
  156. </div>
  157. </div>
  158. <div class="pdf-title">采购合同</div>
  159. <div class="pdf-title-bg">
  160. <div class="left"></div>
  161. <div class="right"></div>
  162. </div>
  163. <div class="flex items-start justify-between form-area">
  164. <div class="form-area-left">
  165. <div class="">
  166. <span style="color: #f56c6c">*</span>
  167. 供应商(乙方) :
  168. </div>
  169. <div>{{ computedVendor.Primary_Contact_name }}</div>
  170. <el-form-item
  171. label-width="0"
  172. prop="currentVendor"
  173. >
  174. <el-select
  175. v-model="form.currentVendor"
  176. :remote-method="utils.debounce(getSupplierLists, 1000)"
  177. remote
  178. style="width: 100%"
  179. :loading="vendorLoading"
  180. filterable
  181. clearable
  182. >
  183. <el-option
  184. v-for="option in vendorList"
  185. :key="option.value"
  186. :value="option.value"
  187. :label="option.label"
  188. ></el-option>
  189. </el-select>
  190. </el-form-item>
  191. <div
  192. v-if="typeof computedCompany.taxReimbursement === 'undefined'"
  193. style="white-space: pre-wrap"
  194. >
  195. {{ computedVendor.PDF_display }}
  196. </div>
  197. <div
  198. v-else
  199. style="white-space: pre-wrap"
  200. >
  201. {{ computedVendor.PDF_display2 }}
  202. </div>
  203. </div>
  204. <div class="form-area-right">
  205. <el-form-item label="采购订单 #:">
  206. Generate once PO submitted
  207. </el-form-item>
  208. <el-form-item label="订单号 # :">
  209. <el-input
  210. v-model="form.Reference"
  211. disabled
  212. ></el-input>
  213. </el-form-item>
  214. <el-form-item
  215. label="日期:"
  216. prop="PO_Date"
  217. >
  218. <el-date-picker
  219. v-model="form.PO_Date"
  220. format="YYYY-MM-DD"
  221. value-format="YYYY-MM-DD"
  222. style="width: 100%"
  223. type="date"
  224. placeholder=""
  225. ></el-date-picker>
  226. </el-form-item>
  227. <el-form-item label="付款方式 :">
  228. <el-select
  229. v-model="form.Supplier_Payment_Terms"
  230. style="width: 100%"
  231. >
  232. <el-option
  233. v-for="(item, index) in supplierPaymentTermsLists"
  234. :key="index"
  235. :value="item.label"
  236. :label="item.label"
  237. ></el-option>
  238. </el-select>
  239. </el-form-item>
  240. <el-form-item label="参考 :">
  241. <el-input v-model="form.Title"></el-input>
  242. </el-form-item>
  243. <!-- 退税版没有这几项 -->
  244. <template
  245. v-if="typeof computedCompany.taxReimbursement === 'undefined'"
  246. >
  247. <el-form-item label="收货详情 :">
  248. <el-select
  249. v-model="form.field9"
  250. style="width: 100%"
  251. >
  252. <el-option
  253. v-for="(item, index) in addressList"
  254. :key="index"
  255. :value="item.label"
  256. :label="item.label"
  257. ></el-option>
  258. </el-select>
  259. </el-form-item>
  260. <el-form-item
  261. label="收件人 :"
  262. prop="field7"
  263. >
  264. <el-input v-model="form.field7"></el-input>
  265. </el-form-item>
  266. <el-form-item
  267. label="联系电话 :"
  268. prop="field8"
  269. >
  270. <el-input v-model="form.field8"></el-input>
  271. </el-form-item>
  272. </template>
  273. <el-form-item
  274. label="工厂交货日期 :"
  275. prop="field6"
  276. >
  277. <el-date-picker
  278. v-model="form.field6"
  279. style="width: 100%"
  280. format="YYYY-MM-DD"
  281. value-format="YYYY-MM-DD"
  282. ></el-date-picker>
  283. </el-form-item>
  284. <el-form-item label="送货备注 :">
  285. <el-input v-model="form.Delivery_Details"></el-input>
  286. </el-form-item>
  287. </div>
  288. </div>
  289. <div class="product-table-separator"></div>
  290. <div class="product-table">
  291. <table
  292. border="0"
  293. cellspacing="0"
  294. >
  295. <tr>
  296. <th class="product">品名</th>
  297. <th class="quantity">数量</th>
  298. <th class="rate">价格</th>
  299. <th class="requirement">中文品目|要求</th>
  300. <th class="amount">金额</th>
  301. <th class="discount">折扣</th>
  302. <th class="action">操作</th>
  303. </tr>
  304. <tr
  305. v-for="(product, index) in form.productList"
  306. :key="index"
  307. >
  308. <td class="product">
  309. <el-form-item
  310. label=""
  311. label-width="0"
  312. :prop="'productList.' + index + '.id'"
  313. :rules="{
  314. required: true,
  315. message: '必填项',
  316. trigger: ['blur', 'change'],
  317. }"
  318. >
  319. <el-select-v2
  320. v-model="product.id"
  321. popper-class="product-select"
  322. style="width: 100%; margin-bottom: 4pt"
  323. :options="product.candidate"
  324. :loading="productLoading"
  325. :remote-method="
  326. (e: string) => getProductList(e, product)
  327. "
  328. remote
  329. filterable
  330. clearable
  331. @change="(e) => onProductSelect(e, product)"
  332. ></el-select-v2>
  333. </el-form-item>
  334. <el-input
  335. v-if="userInfo.Organization !== 'PrimePac'"
  336. v-model="product.desc"
  337. type="textarea"
  338. placeholder="Free text"
  339. ></el-input>
  340. </td>
  341. <td class="quantity">
  342. <el-form-item
  343. label=""
  344. label-width="0"
  345. :prop="'productList.' + index + '.quantity'"
  346. :rules="{
  347. required: true,
  348. message: '必填项',
  349. trigger: ['blur', 'change'],
  350. }"
  351. >
  352. <el-input
  353. v-model="product.quantity"
  354. type="number"
  355. min="1"
  356. @change="(e) => onInputChange(e, product, 'quantity')"
  357. ></el-input>
  358. </el-form-item>
  359. </td>
  360. <td class="rate">
  361. <el-form-item
  362. label=""
  363. label-width="0"
  364. :prop="'productList.' + index + '.rate'"
  365. :rules="{
  366. required: true,
  367. message: '必填项',
  368. trigger: ['blur', 'change'],
  369. }"
  370. >
  371. <el-input
  372. v-model="product.rate"
  373. type="number"
  374. @change="(e) => onInputChange(e, product, 'rate')"
  375. ></el-input>
  376. </el-form-item>
  377. </td>
  378. <td class="requirement">
  379. <el-input
  380. v-model="product.requirement"
  381. :rows="userInfo.Organization !== 'PrimePac' ? 4 : 5"
  382. type="textarea"
  383. placeholder="Free text"
  384. ></el-input>
  385. </td>
  386. <td class="amount">
  387. <el-input
  388. v-model="product.amount"
  389. type="number"
  390. disabled
  391. ></el-input>
  392. </td>
  393. <td class="discount">
  394. <el-input
  395. v-model="product.discount"
  396. type="number"
  397. @change="(e) => onInputChange(e, product, 'discount')"
  398. ></el-input>
  399. </td>
  400. <td class="action">
  401. <el-button
  402. size="small"
  403. type="danger"
  404. plain
  405. @click="form.productList.splice(index, 1)"
  406. >
  407. Delete
  408. </el-button>
  409. </td>
  410. </tr>
  411. </table>
  412. </div>
  413. <div>
  414. <el-button
  415. type="primary"
  416. size="small"
  417. plain
  418. @click="addRow"
  419. >
  420. Add Row
  421. </el-button>
  422. </div>
  423. <div class="flex justify-end">
  424. <div class="product-total-table">
  425. <div class="total-item">
  426. <div class="label">Sub Total</div>
  427. <div class="value">{{ toFixed(subTotal, 2) }}</div>
  428. </div>
  429. <div class="total-item">
  430. <div class="label">Total Discount</div>
  431. <div class="value">
  432. {{ toFixed(totalDiscount, 2) }}
  433. </div>
  434. </div>
  435. <div class="total-item">
  436. <div class="label">Adjustment</div>
  437. <div class="value">
  438. <el-input
  439. v-model="adjustment"
  440. style="width: 100%"
  441. type="number"
  442. ></el-input>
  443. </div>
  444. </div>
  445. <div class="total-item">
  446. <div class="label">Grand Total</div>
  447. <div class="value">
  448. {{ toFixed(grandTotal, 2) }}
  449. </div>
  450. </div>
  451. </div>
  452. </div>
  453. <div
  454. v-if="userInfo.Organization !== 'PrimePac'"
  455. class="note-form-area"
  456. >
  457. <div class="sub-form-title">注意事项:</div>
  458. <el-form-item label="印刷质量:">
  459. <el-input
  460. v-model="form.field12"
  461. type="textarea"
  462. :rows="3"
  463. ></el-input>
  464. </el-form-item>
  465. <el-form-item label="产品质量:">
  466. <el-input
  467. v-model="form.field13"
  468. type="textarea"
  469. :rows="3"
  470. ></el-input>
  471. </el-form-item>
  472. <el-form-item label="质量承诺:">
  473. <el-input
  474. v-model="form.field10"
  475. type="textarea"
  476. :rows="3"
  477. ></el-input>
  478. </el-form-item>
  479. <el-form-item label="箱子箱唛:">
  480. <el-input
  481. v-model="form.field11"
  482. type="textarea"
  483. :rows="3"
  484. ></el-input>
  485. </el-form-item>
  486. </div>
  487. <div class="sub-form-title">服务条款</div>
  488. <template v-if="currentCompany === 'PangeaTaxReimbursement'">
  489. <div class="rule-item flex">
  490. 一、合同价为含税价,税率为:
  491. <span style="color: #f56c6c">*</span>
  492. <el-form-item
  493. label-width="10"
  494. prop="field4"
  495. :rules="{
  496. required: true,
  497. message: '必填项',
  498. trigger: ['blur', 'change'],
  499. }"
  500. >
  501. <el-input
  502. v-model="form.field4"
  503. size="small"
  504. style="width: 120px"
  505. >
  506. <template #append>%</template>
  507. </el-input>
  508. </el-form-item>
  509. </div>
  510. <div class="rule-item flex">
  511. 二、运费条款:
  512. <span style="color: #f56c6c">*</span>
  513. <el-form-item label-width="10">
  514. <el-select
  515. v-model="form.field5"
  516. size="small"
  517. style="width: 110px"
  518. >
  519. <el-option
  520. v-for="(item, index) in field5_lists"
  521. :key="index"
  522. :label="item.label"
  523. :value="item.label"
  524. ></el-option>
  525. </el-select>
  526. </el-form-item>
  527. </div>
  528. </template>
  529. <template
  530. v-if="['PrimePacCommon', 'PrimePacSoft'].includes(currentCompany)"
  531. >
  532. <div class="rule-item">
  533. 一、本采购订单签署原件一式两份,双方各持一份。经双方代表签字或盖章即可生效,并具有同等法律效力。
  534. </div>
  535. <div class="rule-item flex nowrap">
  536. 二、以上价格已含所有产品的制作费、包装费;由
  537. <div class="attention flex nowrap">
  538. <span style="color: #f56c6c">*</span>
  539. <el-form-item label-width="10">
  540. <el-select
  541. v-model="form.field5"
  542. size="small"
  543. style="width: 110px"
  544. >
  545. <el-option
  546. v-for="(item, index) in field5_lists"
  547. :key="index"
  548. :label="item.label"
  549. :value="item.label"
  550. ></el-option>
  551. </el-select>
  552. </el-form-item>
  553. </div>
  554. 运费送货到广州甲方指定的卸货地点,不含税,运费届时实报实销。
  555. </div>
  556. <div class="rule-item">
  557. 三、印刷及工艺要求:乙方需按照甲方图稿或指定样品进行生产,颜色对照潘通色卡或指定样品。
  558. </div>
  559. <div class="rule-item">
  560. 四、付款形式:
  561. <span class="attention">{{ form.Supplier_Payment_Terms }}</span>
  562. 。甲方在乙方完成大货时,先寄大货样品给乙方确认,确认后付清剩余尾款。甲方通过银行转帐的方式付款,乙方账户信息如上。
  563. </div>
  564. <div class="rule-item">
  565. 五、出货标准:五层出口空白硬纸箱,箱内套防潮袋。如实际出货包装与合约要求不符,甲方有权拒收整批货物。
  566. </div>
  567. <div class="rule-item">
  568. 六、订货时间:自合同成立,甲方支付定金并确认图稿后算起。
  569. </div>
  570. <div class="rule-item">
  571. 七、交货期限:自确认图稿时间算起,乙方应于
  572. <span class="attention">{{ form.field6 }}</span>
  573. 前生产好产品,甲方确认并支付剩余款项后,乙方在约定时间内安排发出剩余产品到甲方收货地址。
  574. </div>
  575. </template>
  576. <div
  577. v-for="(item, index) in currentServiceRule"
  578. :key="index"
  579. class="rule-item"
  580. :class="[{ sub: typeof item === 'object' }]"
  581. v-html="typeof item === 'object' ? item.value : item"
  582. ></div>
  583. <template
  584. v-if="['PrimePacCommon', 'PrimePacSoft'].includes(currentCompany)"
  585. >
  586. <div class="sub-form-title">附录</div>
  587. <div
  588. v-for="(item, index) in appendixData"
  589. :key="index"
  590. class="rule-item"
  591. :class="[{ sub: typeof item === 'object' }]"
  592. v-html="typeof item === 'object' ? item.value : item"
  593. ></div>
  594. </template>
  595. <div
  596. v-if="currentCompany === 'PrimePacCommon'"
  597. class="flex items-stretch PrimePac-table"
  598. >
  599. <div class="flex flex-col items-stretch">
  600. <div class="column-item flex justify-center">制作要求</div>
  601. <div class="flex-auto column-item flex justify-center">
  602. 产品外观要求
  603. </div>
  604. </div>
  605. <div class="flex-auto flex flex-col items-stretch">
  606. <div
  607. v-for="(item, index) in PrimePacCommonRuleTableData"
  608. :key="index"
  609. class="flex items-stretch flex-auto"
  610. >
  611. <div class="column-item flex justify-center">
  612. {{ item.project }}
  613. </div>
  614. <div class="column-item flex-auto flex justify-center">
  615. {{ item.method }}
  616. </div>
  617. </div>
  618. </div>
  619. </div>
  620. <div
  621. v-if="currentCompany === 'PrimePacSoft'"
  622. class="flex flex-col items-stretch PrimePac-table"
  623. >
  624. <div class="flex items-stretch">
  625. <div class="flex flex-col items-stretch">
  626. <div class="column-item flex-auto flex justify-center">制作要求</div>
  627. </div>
  628. <div class="flex-auto flex flex-col items-stretch">
  629. <div
  630. v-for="(item, index) in PrimePacSoftRuleTableData1"
  631. :key="index"
  632. class="flex items-stretch flex-auto"
  633. >
  634. <div class="column-item flex justify-center">
  635. {{ item.project }}
  636. </div>
  637. <div class="column-item flex-auto flex justify-center">
  638. {{ item.method }}
  639. </div>
  640. </div>
  641. </div>
  642. </div>
  643. <div class="flex items-stretch">
  644. <div class="flex flex-col items-stretch">
  645. <div class="column-item flex-auto flex justify-center">
  646. 产品技术要求
  647. </div>
  648. </div>
  649. <div class="flex-auto flex flex-col items-stretch">
  650. <div
  651. v-for="(item, index) in PrimePacSoftRuleTableData2"
  652. :key="index"
  653. class="flex items-stretch flex-auto"
  654. >
  655. <div class="column-item flex justify-center">
  656. {{ item.project }}
  657. </div>
  658. <div class="column-item flex-auto flex justify-center">
  659. {{ item.method }}
  660. </div>
  661. </div>
  662. </div>
  663. </div>
  664. </div>
  665. </div>
  666. </div>
  667. </el-form>
  668. <br />
  669. </div>
  670. <div
  671. class="print"
  672. :class="{ hidden: formVisible && !loading }"
  673. >
  674. <div class="pdf-wrap">
  675. <div
  676. id="pdfElement"
  677. ref="pdfElement"
  678. class="preview-area"
  679. >
  680. <div class="company-info">
  681. <div class="company-name">{{ computedCompany.name }}</div>
  682. <div class="flex justify-center">
  683. <div class="company-addr">
  684. 地址:&nbsp;{{ computedCompany.addr }}
  685. </div>
  686. <div class="company-phone">
  687. &nbsp;|&nbsp;电话:&nbsp;{{ computedCompany.phone }}
  688. </div>
  689. <div
  690. v-show="computedCompany.fax"
  691. class="company-fax"
  692. >
  693. &nbsp;|&nbsp;传真:&nbsp;{{ computedCompany.fax }}
  694. </div>
  695. </div>
  696. </div>
  697. <div>
  698. <table class="pdf-title-bg">
  699. <tr>
  700. <td class="left">
  701. <div>&nbsp;</div>
  702. </td>
  703. <td class="center">
  704. <div class="pdf-title">采购合同</div>
  705. </td>
  706. <td class="right">
  707. <div>&nbsp;</div>
  708. </td>
  709. </tr>
  710. </table>
  711. </div>
  712. <div class="form-area flex items-start">
  713. <div class="flex-auto">
  714. <div>供应商(乙方) :</div>
  715. <div
  716. v-if="computedVendor.Primary_Contact_name"
  717. class="column-vendor"
  718. >
  719. {{ computedVendor.Primary_Contact_name }}
  720. </div>
  721. <div class="column-vendor">
  722. {{ computedVendor.label }}
  723. </div>
  724. <div
  725. v-if="typeof computedCompany.taxReimbursement === 'undefined'"
  726. class="column-vendor"
  727. >
  728. {{ computedVendor.PDF_display }}
  729. </div>
  730. <div
  731. v-else
  732. class="column-vendor"
  733. >
  734. {{ computedVendor.PDF_display2 }}
  735. </div>
  736. </div>
  737. <div class="flex-auto">
  738. <div class="flex">
  739. <div class="column-form-label">采购订单 #:</div>
  740. <div class="column-form-value">
  741. {{ longPONumber || '' }}
  742. </div>
  743. </div>
  744. <div class="flex">
  745. <div class="column-form-label">订单号 # :</div>
  746. <div class="column-form-value">
  747. {{ form.Reference }}
  748. </div>
  749. </div>
  750. <div class="flex">
  751. <div class="column-form-label">日期 :</div>
  752. <div class="column-form-value">
  753. {{ form.PO_Date }}
  754. </div>
  755. </div>
  756. <div class="flex">
  757. <div class="column-form-label">付款方式 :</div>
  758. <div class="column-form-value">
  759. {{
  760. form.Supplier_Payment_Terms !== '-None-'
  761. ? form.Supplier_Payment_Terms
  762. : ''
  763. }}
  764. </div>
  765. </div>
  766. <div class="flex items-start">
  767. <div class="column-form-label">参考 :</div>
  768. <div class="column-form-value">
  769. {{ form.Title }}
  770. </div>
  771. </div>
  772. <template
  773. v-if="typeof computedCompany.taxReimbursement === 'undefined'"
  774. >
  775. <div class="flex items-start">
  776. <div class="column-form-label">收货详情 :</div>
  777. <div class="column-form-value">
  778. {{ form.field9 }}
  779. </div>
  780. </div>
  781. <div class="flex">
  782. <div class="column-form-label">收件人 :</div>
  783. <div class="column-form-value">
  784. {{ form.field7 }}
  785. </div>
  786. </div>
  787. <div class="flex">
  788. <div class="column-form-label">联系电话 :</div>
  789. <div class="column-form-value">
  790. {{ form.field8 }}
  791. </div>
  792. </div>
  793. </template>
  794. <div class="flex">
  795. <div class="column-form-label">工厂交货日期 :</div>
  796. <div class="column-form-value">
  797. {{ form.field6 }}
  798. </div>
  799. </div>
  800. <div class="flex">
  801. <div class="column-form-label">送货备注 :</div>
  802. <div class="column-form-value">
  803. {{ form.Delivery_Details }}
  804. </div>
  805. </div>
  806. </div>
  807. </div>
  808. <div class="product-table-separator"></div>
  809. <div class="product-table">
  810. <table
  811. border="0"
  812. cellspacing="0"
  813. >
  814. <tr>
  815. <th class="row-index">#</th>
  816. <th>品名</th>
  817. <th v-if="userInfo.Organization !== 'PrimePac'">
  818. 中文品目|要求
  819. </th>
  820. <th>数量</th>
  821. <th>价格</th>
  822. <th>金额</th>
  823. </tr>
  824. <tr
  825. v-for="(product, index) in form.productList"
  826. :key="index"
  827. >
  828. <td class="row-index">{{ index + 1 }}.</td>
  829. <td>
  830. <div class="product-name">{{ product.name }}</div>
  831. <div
  832. v-if="userInfo.Organization !== 'PrimePac'"
  833. class="desc"
  834. >
  835. {{ product.desc }}
  836. </div>
  837. <div
  838. v-else
  839. class="desc"
  840. >
  841. {{ product.requirement }}
  842. </div>
  843. </td>
  844. <td v-if="userInfo.Organization !== 'PrimePac'">
  845. {{ product.requirement }}
  846. </td>
  847. <td>
  848. {{ product.quantity }}
  849. </td>
  850. <td>
  851. {{ currentCurrency.country
  852. }}{{ currentCurrency.symbol }}&nbsp;{{
  853. toFixed(Number(product.rate), computedDeci)
  854. }}
  855. </td>
  856. <td>
  857. {{ currentCurrency.country
  858. }}{{ currentCurrency.symbol }}&nbsp;{{
  859. toFixed(Number(product.amount), computedDeci)
  860. }}
  861. </td>
  862. </tr>
  863. </table>
  864. </div>
  865. <!-- <br /> -->
  866. <div class="flex justify-between items-start">
  867. <div
  868. v-if="userInfo.Organization !== 'PrimePac'"
  869. class="note-form-area"
  870. >
  871. <div class="sub-form-title">注意事项:</div>
  872. <div class="">
  873. <div class="label">印刷质量:</div>
  874. <div class="value">{{ form.field12 }}</div>
  875. </div>
  876. <div class="">
  877. <div class="label">产品质量:</div>
  878. <div class="value">{{ form.field13 }}</div>
  879. </div>
  880. <div class="">
  881. <div class="label">质量承诺:</div>
  882. <div class="value">{{ form.field10 }}</div>
  883. </div>
  884. <div class="">
  885. <div class="label">箱子箱唛:</div>
  886. <div class="value">{{ form.field11 }}</div>
  887. </div>
  888. </div>
  889. <div v-else></div>
  890. <div class="product-total-table">
  891. <div class="total-item flex">
  892. <div class="label">小计&nbsp;</div>
  893. <div class="value">
  894. {{ currentCurrency.country
  895. }}{{ currentCurrency.symbol }}&nbsp;{{
  896. toFixed(subTotal, computedDeci)
  897. }}
  898. </div>
  899. </div>
  900. <div class="total-item flex">
  901. <div class="label">合计&nbsp;</div>
  902. <div class="value">
  903. {{ currentCurrency.country
  904. }}{{ currentCurrency.symbol }}&nbsp;{{
  905. toFixed(grandTotal, computedDeci)
  906. }}
  907. </div>
  908. </div>
  909. </div>
  910. </div>
  911. <br />
  912. <div class="sub-form-title">服务条款</div>
  913. <template v-if="currentCompany === 'PangeaTaxReimbursement'">
  914. <div class="rule-item">
  915. 一、合同价为含税价,税率为: {{ form.field4 }} %
  916. </div>
  917. <div class="rule-item">二、运费条款: {{ form.field5 }}</div>
  918. </template>
  919. <template
  920. v-if="['PrimePacCommon', 'PrimePacSoft'].includes(currentCompany)"
  921. >
  922. <div class="rule-item">
  923. 一、本采购订单签署原件一式两份,双方各持一份。经双方代表签字或盖章即可生效,并具有同等法律效力。
  924. </div>
  925. <div class="rule-item flex nowrap">
  926. 二、以上价格已含所有产品的制作费、包装费;由
  927. <span class="attention">{{ form.field5 }}</span>
  928. 运费送货到广州甲方指定的卸货地点,不含税,运费届时实报实销。
  929. </div>
  930. <div class="rule-item">
  931. 三、印刷及工艺要求:乙方需按照甲方图稿或指定样品进行生产,颜色对照潘通色卡或指定样品。
  932. </div>
  933. <div class="rule-item">
  934. 四、付款形式:
  935. <span class="attention">{{ form.Supplier_Payment_Terms }}</span>
  936. 。甲方在乙方完成大货时,先寄大货样品给乙方确认,确认后付清剩余尾款。甲方通过银行转帐的方式付款,乙方账户信息如上。
  937. </div>
  938. <div class="rule-item">
  939. 五、出货标准:五层出口空白硬纸箱,箱内套防潮袋。如实际出货包装与合约要求不符,甲方有权拒收整批货物。
  940. </div>
  941. <div class="rule-item">
  942. 六、订货时间:自合同成立,甲方支付定金并确认图稿后算起。
  943. </div>
  944. <div class="rule-item">
  945. 七、交货期限:自确认图稿时间算起,乙方应于
  946. <span class="attention">{{ form.field6 }}</span>
  947. 前生产好产品,甲方确认并支付剩余款项后,乙方在约定时间内安排发出剩余产品到甲方收货地址。
  948. </div>
  949. </template>
  950. <div
  951. v-for="(item, index) in currentServiceRule"
  952. :key="index"
  953. class="rule-item"
  954. :class="[{ sub: typeof item === 'object' }]"
  955. v-html="typeof item === 'object' ? item.value : item"
  956. ></div>
  957. <template
  958. v-if="['PrimePacCommon', 'PrimePacSoft'].includes(currentCompany)"
  959. >
  960. <div class="sub-form-title">附录</div>
  961. <div
  962. v-for="(item, index) in appendixData"
  963. :key="index"
  964. class="rule-item"
  965. :class="[{ sub: typeof item === 'object' }]"
  966. v-html="typeof item === 'object' ? item.value : item"
  967. ></div>
  968. </template>
  969. <div
  970. v-if="currentCompany === 'PrimePacCommon'"
  971. class="flex items-stretch PrimePac-table"
  972. >
  973. <div class="flex flex-col items-stretch">
  974. <div class="column-item flex justify-center">制作要求</div>
  975. <div class="flex-auto column-item flex justify-center">产品外观要求</div>
  976. </div>
  977. <div class="flex-auto flex flex-col items-stretch">
  978. <div
  979. v-for="(item, index) in PrimePacCommonRuleTableData"
  980. :key="index"
  981. class="flex items-stretch flex-auto"
  982. >
  983. <div class="column-item flex justify-center">
  984. {{ item.project }}
  985. </div>
  986. <div class="column-item flex-auto flex justify-center">
  987. {{ item.method }}
  988. </div>
  989. </div>
  990. </div>
  991. </div>
  992. <div
  993. v-if="currentCompany === 'PrimePacSoft'"
  994. class="flex flex-col items-stretch PrimePac-table"
  995. >
  996. <div class="flex items-stretch">
  997. <div class="flex flex-col items-stretch">
  998. <div class="column-item flex-auto flex justify-center">制作要求</div>
  999. </div>
  1000. <div class="flex-auto flex flex-col items-stretch">
  1001. <div
  1002. v-for="(item, index) in PrimePacSoftRuleTableData1"
  1003. :key="index"
  1004. class="flex items-stretch flex-auto"
  1005. >
  1006. <div class="column-item flex justify-center">
  1007. {{ item.project }}
  1008. </div>
  1009. <div class="column-item flex-auto flex justify-center">
  1010. {{ item.method }}
  1011. </div>
  1012. </div>
  1013. </div>
  1014. </div>
  1015. <div class="flex items-stretch">
  1016. <div class="flex flex-col items-stretch">
  1017. <div class="column-item flex-auto flex justify-center">
  1018. 产品技术要求
  1019. </div>
  1020. </div>
  1021. <div class="flex-auto flex flex-col items-stretch">
  1022. <div
  1023. v-for="(item, index) in PrimePacSoftRuleTableData2"
  1024. :key="index"
  1025. class="flex items-stretch flex-auto"
  1026. >
  1027. <div class="column-item flex justify-center">
  1028. {{ item.project }}
  1029. </div>
  1030. <div class="column-item flex-auto flex justify-center">
  1031. {{ item.method }}
  1032. </div>
  1033. </div>
  1034. </div>
  1035. </div>
  1036. </div>
  1037. <br />
  1038. <div class="signature-area">
  1039. <div class="company-seal"></div>
  1040. <div
  1041. style="align-items: flex-end"
  1042. :class="{
  1043. flex: ['PrimePacCommon', 'PrimePacSoft'].includes(
  1044. currentCompany,
  1045. ),
  1046. between: ['PrimePacCommon', 'PrimePacSoft'].includes(
  1047. currentCompany,
  1048. ),
  1049. }"
  1050. >
  1051. <div class="first-party">
  1052. <div
  1053. class="flex"
  1054. style="align-items: flex-end"
  1055. >
  1056. <div v-show="!computedCompany.label.includes('Pangea')">
  1057. 甲方(盖章):
  1058. </div>
  1059. <div
  1060. class="sign-wrap"
  1061. :class="{
  1062. pangea: computedCompany.label.includes('Pangea'),
  1063. }"
  1064. >
  1065. <img
  1066. v-if="computedCompany.signPath"
  1067. :src="computedCompany.signPath"
  1068. alt=""
  1069. />
  1070. </div>
  1071. </div>
  1072. <div class="">代表人: {{ userInfo.full_name }}</div>
  1073. <div class="">日期: {{ form.PO_Date }}</div>
  1074. </div>
  1075. <div class="second-party">
  1076. <div class="">乙方(盖章):</div>
  1077. </div>
  1078. </div>
  1079. </div>
  1080. </div>
  1081. </div>
  1082. <div
  1083. v-if="computedCompany.taxReimbursement && false"
  1084. class="pdf-wrap"
  1085. >
  1086. <div
  1087. id=""
  1088. ref="pdfElement2"
  1089. class="preview-area2"
  1090. >
  1091. <div class="supplier-name">
  1092. {{ computedVendor.Suppliers_Name || computedVendor.Vendor_Name }}
  1093. </div>
  1094. <div class="billing-addr">
  1095. {{ computedVendor.Billing_Address || '' }}
  1096. </div>
  1097. <div class="flex justify-around contact-info">
  1098. <div class="flex">
  1099. <div>Tel No.:</div>
  1100. <div>&nbsp;{{ computedVendor.Phone }}</div>
  1101. </div>
  1102. <div class="flex justify-center">
  1103. <div>E-mail:</div>
  1104. <div class="">&nbsp;{{ computedVendor.Email }}</div>
  1105. </div>
  1106. </div>
  1107. <div class="base-info-area">
  1108. <div class="flex">
  1109. <div class="flex items-start left">
  1110. <div class="base-info-label">TO:</div>
  1111. <div
  1112. v-if="currentCompany === 'AZYTaxReimbursement'"
  1113. class="base-info-value"
  1114. >
  1115. Azy Trading Pty Ltd
  1116. </div>
  1117. <div
  1118. v-else-if="currentCompany === 'FOTTaxReimbursement'"
  1119. class="base-info-value"
  1120. >
  1121. Fair Ocean Trading Australia Pty Ltd
  1122. </div>
  1123. </div>
  1124. <div class="right flex">
  1125. <div class="base-info-label">Date:</div>
  1126. <div class="base-info-value">{{ form.PO_Date }}</div>
  1127. </div>
  1128. </div>
  1129. <div class="flex items-start">
  1130. <div class="left flex items-start">
  1131. <div class="base-info-label">ADD:</div>
  1132. <div>
  1133. <div
  1134. v-if="currentCompany === 'AZYTaxReimbursement'"
  1135. class="base-info-value"
  1136. >
  1137. UNIT 12,21/F WAYSON COMM BLDG NO 28 CONNAUGHT RD WEST SHEUNG
  1138. WAN, HK
  1139. </div>
  1140. <div
  1141. v-else-if="currentCompany === 'FOTTaxReimbursement'"
  1142. class="base-info-value"
  1143. >
  1144. 15/10 Chilvers Road, Thornleigh, NSW 2120
  1145. </div>
  1146. </div>
  1147. </div>
  1148. <div class="right flex">
  1149. <div class="base-info-label">P/I. NO.</div>
  1150. <div class="base-info-value">{{ longPONumber }}</div>
  1151. </div>
  1152. </div>
  1153. <div class="flex items-start">
  1154. <div class="left flex">
  1155. <div class="base-info-label">ATTN:</div>
  1156. <div class="base-info-value">Accounts</div>
  1157. </div>
  1158. <div class="right flex">
  1159. <div class="base-info-label">Reference:</div>
  1160. <div class="base-info-value">{{ PONumber }}</div>
  1161. </div>
  1162. </div>
  1163. <div class="flex items-start">
  1164. <div class="flex left">
  1165. <template v-if="currentCompany === 'FOTTaxReimbursement'">
  1166. <div class="base-info-label">TEL NO:</div>
  1167. <div class="base-info-value">02 9008 1322</div>
  1168. </template>
  1169. <div v-else></div>
  1170. </div>
  1171. <div class="right flex">
  1172. <div class="base-info-label">Payment Term:</div>
  1173. <div class="base-info-value">
  1174. {{ computedVendor.Supplier_Payment_Terms }}
  1175. </div>
  1176. </div>
  1177. </div>
  1178. </div>
  1179. <div class="table-title">PROFORMA INVOICE</div>
  1180. <div class="product-table">
  1181. <table cellspacing="0">
  1182. <tr>
  1183. <th>ITEM</th>
  1184. <th>DESCRIPTION</th>
  1185. <th>QTY(pcs)</th>
  1186. <th>UNIT PRICE</th>
  1187. <th>TOPTAL VALUE</th>
  1188. </tr>
  1189. <tr
  1190. v-for="(product, index) in form.productList"
  1191. :key="index"
  1192. >
  1193. <td>
  1194. <div>{{ product.name }}</div>
  1195. </td>
  1196. <td>
  1197. <div class="desc">{{ product.desc }}</div>
  1198. </td>
  1199. <td>
  1200. {{ product.quantity }}
  1201. </td>
  1202. <td>
  1203. {{ currentCurrency.country
  1204. }}{{ currentCurrency.symbol }}&nbsp;{{
  1205. toFixed(Number(product.rate), computedDeci)
  1206. }}
  1207. </td>
  1208. <td>
  1209. {{ currentCurrency.country
  1210. }}{{ currentCurrency.symbol }}&nbsp;{{
  1211. toFixed(Number(product.amount), computedDeci)
  1212. }}
  1213. </td>
  1214. </tr>
  1215. </table>
  1216. <div class="flex justify-end">
  1217. <div
  1218. class="flex"
  1219. style="margin-top: 10pt"
  1220. >
  1221. <div style="margin: 0 100pt 0 0">TOTAL</div>
  1222. <div>
  1223. {{ currentCurrency.country
  1224. }}{{ currentCurrency.symbol }}&nbsp;{{ subTotal }}
  1225. </div>
  1226. </div>
  1227. </div>
  1228. </div>
  1229. <br />
  1230. <div class="bank-info-area">
  1231. <div class="flex">
  1232. <div>Bank Information</div>
  1233. <div></div>
  1234. </div>
  1235. <div class="flex">
  1236. <div class="bank-info-label">Beneficiary:</div>
  1237. <div class="bank-info-value">
  1238. {{ computedVendor.Suppliers_Name }}dd
  1239. </div>
  1240. </div>
  1241. <div class="flex">
  1242. <div class="bank-info-label">Bank:</div>
  1243. <div class="bank-info-value">
  1244. {{ computedVendor.Bank_Branch_Name }}
  1245. </div>
  1246. </div>
  1247. <div class="flex">
  1248. <div class="bank-info-label">Bank Add:</div>
  1249. <div class="bank-info-value">{{}}</div>
  1250. </div>
  1251. <div class="flex">
  1252. <div class="bank-info-label">A/C No.:</div>
  1253. <div class="bank-info-value">
  1254. {{ computedVendor.Bank_Account }}
  1255. </div>
  1256. </div>
  1257. <div class="flex">
  1258. <div class="bank-info-label">Bank Code:</div>
  1259. <div class="bank-info-value">{{}}</div>
  1260. </div>
  1261. <div class="flex">
  1262. <div class="bank-info-label">SWIFT CODE:</div>
  1263. <div class="bank-info-value">
  1264. {{ computedVendor.Swift_Code_IBAN }}
  1265. </div>
  1266. </div>
  1267. <div class="flex">
  1268. <div class="bank-info-label">Add:</div>
  1269. <div class="bank-info-value">{{}}</div>
  1270. </div>
  1271. </div>
  1272. <br />
  1273. <div class="flex justify-between items-start">
  1274. <div class="">
  1275. <div class="">BUYERS' SIGNATURE</div>
  1276. <div class="sign-wrap">
  1277. <img
  1278. v-if="computedCompany.signPath"
  1279. :src="computedCompany.signPath"
  1280. alt=""
  1281. />
  1282. </div>
  1283. </div>
  1284. <div class="">
  1285. <div class="">SELLER'S SIGNATURE</div>
  1286. </div>
  1287. </div>
  1288. </div>
  1289. </div>
  1290. </div>
  1291. </div>
  1292. </template>
  1293. <script lang="ts">
  1294. export default defineComponent({
  1295. name: 'PurchaseOrderEdit',
  1296. })
  1297. </script>
  1298. <script lang="ts" setup>
  1299. import { computed, defineComponent, ref, unref, watch } from 'vue'
  1300. import { useRoute } from 'vue-router'
  1301. import {
  1302. ElButton,
  1303. ElSelectV2,
  1304. ElSelect,
  1305. ElOption,
  1306. ElIcon,
  1307. ElInput,
  1308. ElForm,
  1309. ElFormItem,
  1310. ElDatePicker,
  1311. ElMessage,
  1312. ElNotification,
  1313. ElRadioGroup,
  1314. ElRadio,
  1315. ElMessageBox,
  1316. } from 'element-plus'
  1317. import type { FormInstance, FormRules } from 'element-plus'
  1318. import { ShoppingCart, FolderAdd, Switch } from '@element-plus/icons-vue'
  1319. import request from '@/utils/axios'
  1320. import dayjs from 'dayjs'
  1321. import jspdf from 'jspdf'
  1322. import html2canvas from 'html2canvas'
  1323. import utils from '@/utils/index'
  1324. import variables from '@/assets/css/var.module.scss'
  1325. import {
  1326. ServiceTypeKeyEnum,
  1327. TypeService,
  1328. ISelectItem,
  1329. IProductItem,
  1330. IUser,
  1331. ICompanyItem,
  1332. IVendorItem,
  1333. IRecommandVendor,
  1334. IForm,
  1335. } from '@/interface'
  1336. computed(() => {
  1337. return variables
  1338. })
  1339. const formVisible = ref(true)
  1340. const loading = ref(false)
  1341. // 订单ID. 例如 5757019000000683001, 不是串号.
  1342. const POID = ref('')
  1343. // po 串号. 例如 PO2025
  1344. const PONumber = ref('')
  1345. // po 长串号. 例如 ZCPO2025
  1346. const longPONumber = ref('')
  1347. const mainForm = ref<FormInstance>()
  1348. const checkForm = function (formEl: FormInstance | undefined) {
  1349. if (!formEl) return
  1350. formEl.validate((valid, fields) => {
  1351. if (valid) {
  1352. submit()
  1353. } else {
  1354. console.log('check form has not pass!', fields)
  1355. ElMessage.error('请检查表单必填项')
  1356. }
  1357. })
  1358. }
  1359. const submit = () => {
  1360. loading.value = true
  1361. createPurchaseOrders()
  1362. .then((res) => {
  1363. // console.log(res)
  1364. getPurchaseOrdersData()
  1365. .then(() => {
  1366. generatePDF()
  1367. .then(() => {
  1368. ElNotification({
  1369. duration: 0,
  1370. type: 'success',
  1371. title: '任务已成功处理',
  1372. message: '本页面将自动跳转',
  1373. })
  1374. const url =
  1375. import.meta.env.VITE_PO_PATH +
  1376. POID.value +
  1377. import.meta.env.VITE_PO_APPEND
  1378. setTimeout(() => {
  1379. window.location.replace(url)
  1380. }, 1000)
  1381. })
  1382. .finally(() => {
  1383. loading.value = false
  1384. })
  1385. })
  1386. .catch(() => {
  1387. // loading.value = false
  1388. const msg = '获取PO详情失败, 未能正确生成PDF'
  1389. console.log(msg)
  1390. ElNotification({ duration: 0, title: msg, type: 'error' })
  1391. })
  1392. })
  1393. .catch(() => {
  1394. // loading.value = false
  1395. const msg = '创建PO失败'
  1396. console.log(msg)
  1397. ElNotification({ duration: 0, title: msg, type: 'error' })
  1398. })
  1399. }
  1400. const pdfElement = ref()
  1401. const pdfElement2 = ref()
  1402. const generatePDF = (ele = pdfElement, isFirstTime = true) => {
  1403. const A4_WIDTH = 592.28
  1404. const A4_HEIGHT = 841.89
  1405. let imageWrapper = unref(ele) // 获取DOM
  1406. // let pageHeight = (imageWrapper.scrollWidth / A4_WIDTH) * A4_HEIGHT
  1407. let pageHeight = (imageWrapper.clientWidth / A4_WIDTH) * A4_HEIGHT
  1408. let lableListID = imageWrapper.querySelectorAll('#pdfElement > div')
  1409. // 进行分割操作,当dom内容已超出a4的高度,则将该dom前插入一个空dom,把他挤下去,分割
  1410. for (let i = 0; i < lableListID.length; i++) {
  1411. let multiple = Math.ceil(
  1412. (lableListID[i].offsetTop + lableListID[i].offsetHeight) / pageHeight,
  1413. )
  1414. if (isSplit(lableListID, i, multiple * pageHeight)) {
  1415. let divParent = lableListID[i].parentNode // 获取该div的父节点
  1416. let newNode = document.createElement('div')
  1417. newNode.className = 'empty-div'
  1418. newNode.style.background = '#fff'
  1419. let _H =
  1420. multiple * pageHeight -
  1421. (lableListID[i].offsetTop + lableListID[i].offsetHeight)
  1422. //留白
  1423. newNode.style.height = _H + 40 + 'px'
  1424. newNode.style.width = '100%'
  1425. let next = lableListID[i].nextSibling // 获取div的下一个兄弟节点
  1426. // 判断兄弟节点是否存在
  1427. if (next) {
  1428. // 存在则将新节点插入到div的下一个兄弟节点之前,即div之后
  1429. divParent.insertBefore(newNode, next)
  1430. } else {
  1431. // 不存在则直接添加到最后,appendChild默认添加到divParent的最后
  1432. divParent.appendChild(newNode)
  1433. }
  1434. }
  1435. }
  1436. return new Promise((resolve, reject) => {
  1437. html2canvas(imageWrapper, {
  1438. allowTaint: true,
  1439. useCORS: true,
  1440. backgroundColor: '#fff', //一定要设背景颜色,否则有的浏览器就会变花~,比如Edge
  1441. scale: 3, // 缩放倍率调整清晰度
  1442. }).then((canvas) => {
  1443. let pdf = new jspdf('p', 'mm', 'a4') //A4纸,纵向
  1444. let ctx = canvas.getContext('2d'),
  1445. a4ContentWidth = 190,
  1446. a4ContentHeight = 277, //A4大小,210mm x 297mm,四边各保留10mm的边距,显示区域190x277
  1447. imgHeight = Math.floor(
  1448. (a4ContentHeight / a4ContentWidth) * canvas.width,
  1449. ), //按A4显示比例换算一页图像的像素高度
  1450. renderedHeight = 0
  1451. while (renderedHeight < canvas.height) {
  1452. let page = document.createElement('canvas')
  1453. page.width = canvas.width
  1454. page.height = Math.min(imgHeight, canvas.height - renderedHeight) //可能内容不足一页
  1455. //用getImageData剪裁指定区域,并画到前面创建的canvas对象中
  1456. // @ts-ignore: Object is possibly 'null'.
  1457. page
  1458. .getContext('2d')
  1459. .putImageData(
  1460. ctx!.getImageData(
  1461. 0,
  1462. renderedHeight,
  1463. canvas.width,
  1464. Math.min(imgHeight, canvas.height - renderedHeight),
  1465. ),
  1466. 0,
  1467. 0,
  1468. )
  1469. // document.body.appendChild(page)
  1470. pdf.addImage(
  1471. page.toDataURL('image/jpeg', 0.5),
  1472. 'JPEG',
  1473. 10,
  1474. 10,
  1475. a4ContentWidth,
  1476. Math.min(
  1477. a4ContentHeight,
  1478. a4ContentWidth * (page.height / page.width),
  1479. ),
  1480. ) //添加图像到页面,保留10mm边距
  1481. renderedHeight += imgHeight
  1482. if (renderedHeight < canvas.height) pdf.addPage() //如果后面还有内容,添加一个空页
  1483. }
  1484. const prefix =
  1485. `${PONumber.value}-${computedVendor.value.label}` +
  1486. (form.value.Title?.length ? `-${form.value.Title}` : '')
  1487. const fileName = isFirstTime ? prefix : prefix + '_2'
  1488. // sendPDF(pdf.output('datauristring'), fileName)
  1489. // .then(() => {
  1490. resolve(true)
  1491. // })
  1492. // .catch((e) => {
  1493. // reject(e)
  1494. // })
  1495. // 本地备份一下
  1496. pdf.save(fileName + '.pdf')
  1497. })
  1498. })
  1499. }
  1500. const isSplit = function (nodes: any, index: number, pageHeight: number) {
  1501. // 计算当前这块dom是否跨越了a4大小,以此分割
  1502. if (
  1503. nodes[index].offsetTop + nodes[index].offsetHeight < pageHeight &&
  1504. nodes[index + 1] &&
  1505. nodes[index + 1].offsetTop + nodes[index + 1].offsetHeight > pageHeight
  1506. ) {
  1507. return true
  1508. }
  1509. return false
  1510. }
  1511. const sendPDF = function (file: string, filename = `attachment_file`) {
  1512. const temp = file.split(',')
  1513. // @ts-ignore: Object is possibly 'null'.
  1514. const mimeType = temp[0].match(/:(.*?);/)[1]
  1515. let extName = mimeType.split('/')[1]
  1516. let bstr = window.atob(temp[1])
  1517. let n = bstr.length
  1518. let result = new Uint8Array(n)
  1519. while (n--) {
  1520. result[n] = bstr.charCodeAt(n)
  1521. }
  1522. const data = {
  1523. id: POID.value,
  1524. file: new File([result], `${filename}.${extName}`, { type: mimeType }),
  1525. }
  1526. return new Promise((resolve, reject) => {
  1527. request
  1528. .post('/Purchase_orders/uploadAttachmentFile', data, {
  1529. headers: {
  1530. 'Content-Type': 'multipart/form-data',
  1531. },
  1532. })
  1533. .then((response) => {
  1534. if (response.data.code !== 1) {
  1535. const msg = '自动创建附件失败'
  1536. ElNotification({ duration: 0, title: msg, type: 'error' })
  1537. reject(msg)
  1538. return
  1539. }
  1540. ElNotification({
  1541. duration: 0,
  1542. title: '自动创建 PDF 成功',
  1543. type: 'success',
  1544. })
  1545. resolve(true)
  1546. })
  1547. .catch((e) => {
  1548. reject(e)
  1549. })
  1550. })
  1551. }
  1552. const createPurchaseOrders = function () {
  1553. const data = JSON.parse(JSON.stringify(unref(form)))
  1554. data.Status = 'Created'
  1555. data.Sub_Total = subTotal.value
  1556. data.Total_Taxes = 0
  1557. data.Total_Discount = totalDiscount.value
  1558. data.Adjustment = Number(adjustment.value)
  1559. data.Grand_Total = grandTotal.value
  1560. data.Subject = '这里不用填'
  1561. data.Created_By = {
  1562. id: userInfo.value.users_id || route.query.user,
  1563. name: userInfo.value.full_name || '',
  1564. }
  1565. data.Owner = {
  1566. id: userInfo.value.users_id || route.query.user,
  1567. name: userInfo.value.full_name || '',
  1568. email: userInfo.value.email || '',
  1569. }
  1570. data.Vendor_Name = {
  1571. id: computedVendor.value.value,
  1572. name: computedVendor.value.label,
  1573. }
  1574. // console.log(data.Related_Sales_Order, 'ddd')
  1575. data.Related_Sales_Order = {
  1576. id: form.value.saleOrderId,
  1577. name: form.value.Title,
  1578. }
  1579. data.Purchase_Items = data.productList.map((item: any) => {
  1580. return {
  1581. Quantity: item.quantity,
  1582. Discount: item.discount || 0,
  1583. List_Price: item.rate,
  1584. Tax: 0,
  1585. total: item.amount,
  1586. total_after_discount: Number(item.amount) - Number(item.discount),
  1587. Net_Total: Number(item.amount) - Number(item.discount),
  1588. Description: item.desc,
  1589. Requirement: item.requirement,
  1590. line_tax: [],
  1591. // book: '',
  1592. // id: item.id,
  1593. product: {
  1594. // name: item.name,
  1595. id: item.id,
  1596. // Product_Code: item.Product_Code,
  1597. },
  1598. Product_Name: {
  1599. id: item.id,
  1600. },
  1601. // 这两个是crm有的, 但是文档没有
  1602. List_Price_Non_Currency: item.rate,
  1603. Price_Book_Name: '',
  1604. }
  1605. })
  1606. if (data.productList) delete data.productList
  1607. // console.log(data, 'create po params')
  1608. return new Promise((resolve, reject) => {
  1609. request
  1610. .post('/Purchase_orders/createPurchaseOrders', data, {})
  1611. .then((response) => {
  1612. if (response.data.code !== 1) return
  1613. const res = response.data.result
  1614. // console.log(res, 'create po')
  1615. if (res.data && res.data.length && res.data[0].code === 'SUCCESS') {
  1616. POID.value = res.data[0].details?.id || ''
  1617. resolve(res.data[0].details?.id)
  1618. ElNotification({
  1619. duration: 0,
  1620. title: '创建 Purchase Order 成功',
  1621. type: 'success',
  1622. })
  1623. } else {
  1624. ElNotification({
  1625. duration: 0,
  1626. title: '未能成功创建PO, 请稍后重试或者联系管理员',
  1627. type: 'error',
  1628. })
  1629. }
  1630. reject('未能成功创建PO')
  1631. })
  1632. .catch((e) => {
  1633. reject(e)
  1634. })
  1635. })
  1636. }
  1637. const getPurchaseOrdersData = function () {
  1638. return new Promise((resolve, reject) => {
  1639. request
  1640. .post('/purchase_orders/getPurchaseOrdersData', {
  1641. id: POID.value,
  1642. })
  1643. .then((response) => {
  1644. if (response.data.code !== 1) {
  1645. reject(false)
  1646. return
  1647. }
  1648. const res = Array.isArray(response.data.result)
  1649. ? response.data.result[0]
  1650. : response.data.result
  1651. longPONumber.value = res.PO_Number || ''
  1652. PONumber.value = res.Purchase_Order_Number || ''
  1653. resolve(true)
  1654. })
  1655. .catch((e) => {
  1656. reject(e)
  1657. })
  1658. })
  1659. }
  1660. const currencyList = ref([
  1661. {
  1662. label: 'AUD',
  1663. symbol: '',
  1664. country: '',
  1665. },
  1666. {
  1667. label: 'NZD',
  1668. symbol: '',
  1669. country: '',
  1670. },
  1671. {
  1672. label: 'CNY',
  1673. symbol: '¥',
  1674. country: 'CN',
  1675. },
  1676. {
  1677. label: 'GBP',
  1678. symbol: '',
  1679. country: '',
  1680. },
  1681. {
  1682. label: 'EUR',
  1683. symbol: '',
  1684. country: '',
  1685. },
  1686. {
  1687. label: 'USD',
  1688. symbol: '',
  1689. country: '',
  1690. },
  1691. ])
  1692. const currentCurrency = computed(() => {
  1693. const temp = currencyList.value.filter((i) => i.label === form.value.Currency)
  1694. // 2是人民币
  1695. return temp.length ? temp[0] : temp[2]
  1696. })
  1697. let orderTypeList = ref([
  1698. // {
  1699. // label: '-None-',
  1700. // },
  1701. {
  1702. label: '打样',
  1703. },
  1704. {
  1705. label: '大货',
  1706. },
  1707. ])
  1708. const form = ref<IForm>({
  1709. Order_Type: '',
  1710. Artwork_Link: '',
  1711. Currency: 'CNY',
  1712. // 订单号
  1713. saleOrderId: '',
  1714. Reference: '',
  1715. // 日期
  1716. PO_Date: '',
  1717. // 付款方式
  1718. Supplier_Payment_Terms: '-None-',
  1719. // 参考, so的job name
  1720. Title: '',
  1721. // 收货地址
  1722. field9: '广州市越秀区八旗二马路广东航运大厦1904室 邮编510110',
  1723. // 收件人
  1724. field7: '',
  1725. // 联系电话
  1726. field8: '18925020659',
  1727. // 工厂交货日期
  1728. field6: '',
  1729. productList: [
  1730. {
  1731. name: '',
  1732. id: '',
  1733. quantity: '',
  1734. rate: '',
  1735. requirement: '',
  1736. desc: '',
  1737. amount: 0,
  1738. discount: '',
  1739. candidate: [],
  1740. },
  1741. ] as IProductItem[],
  1742. // 印刷质量
  1743. field12: '',
  1744. // 产品质量
  1745. field13: '',
  1746. // 质量承诺
  1747. field10: '',
  1748. // 箱子箱唛
  1749. field11: '',
  1750. // 税率
  1751. field4: '0',
  1752. // 运费条款
  1753. field5: '供应商承担',
  1754. currentVendor: '',
  1755. Delivery_Details: '',
  1756. })
  1757. const formRule = ref<FormRules>({
  1758. Order_Type: [
  1759. {
  1760. required: true,
  1761. message: '必填项',
  1762. trigger: 'blur',
  1763. },
  1764. ],
  1765. Artwork_Link: [
  1766. {
  1767. required: true,
  1768. message: '必填项',
  1769. trigger: 'blur',
  1770. },
  1771. ],
  1772. PO_Date: [
  1773. {
  1774. required: true,
  1775. message: '必填项',
  1776. trigger: 'blur',
  1777. },
  1778. ],
  1779. // saleOrderId: [
  1780. // {
  1781. // required: true,
  1782. // message: '必填项',
  1783. // trigger: 'blur',
  1784. // },
  1785. // ],
  1786. field7: [
  1787. {
  1788. required: true,
  1789. message: '必填项',
  1790. trigger: 'blur',
  1791. },
  1792. ],
  1793. field8: [
  1794. {
  1795. required: true,
  1796. message: '必填项',
  1797. trigger: 'blur',
  1798. },
  1799. ],
  1800. field6: [
  1801. {
  1802. required: true,
  1803. message: '必填项',
  1804. trigger: 'blur',
  1805. },
  1806. ],
  1807. currentVendor: [
  1808. {
  1809. required: true,
  1810. message: '必填项',
  1811. trigger: 'change',
  1812. },
  1813. ],
  1814. })
  1815. const emptyProductItem = {
  1816. label: '',
  1817. value: '',
  1818. candidate: [],
  1819. name: '',
  1820. desc: '',
  1821. id: '',
  1822. quantity: '',
  1823. rate: '',
  1824. requirement: '',
  1825. // 未计算优惠(discount)之前的总额
  1826. amount: 0,
  1827. // 优惠额度
  1828. discount: '',
  1829. }
  1830. const addRow = function () {
  1831. form.value.productList.push(JSON.parse(JSON.stringify(emptyProductItem)))
  1832. }
  1833. const keyNeedCompute = ['quantity', 'rate']
  1834. const onInputChange = function (e: any, obj: IProductItem, key: string) {
  1835. // console.log(e, 'input value before enfore change')
  1836. if (typeof e === 'string') {
  1837. if (e.length) {
  1838. // 强制转换为数字类型
  1839. // obj[key] = Math.round(utils.multiply(Number(e))) / 100
  1840. obj[key] = Math.round(utils.multiply(Number(e), 1000)) / 1000
  1841. // 计算每行的总额
  1842. if (keyNeedCompute.includes(key)) {
  1843. obj.amount = utils.multiply(Number(obj.quantity), Number(obj.rate))
  1844. }
  1845. } else {
  1846. // obj[key] = minValue
  1847. }
  1848. }
  1849. }
  1850. const onProductSelect = function (e: any, product: IProductItem) {
  1851. if (e) {
  1852. const temp = product.candidate.filter((i) => i.value === e)
  1853. if (temp.length) {
  1854. product.name = temp[0].label
  1855. product.Product_Code = temp[0].Product_Code
  1856. }
  1857. getProductData(product.id).then((ctx) => {
  1858. product.requirement = ctx || ''
  1859. })
  1860. } else {
  1861. product.name = ''
  1862. }
  1863. }
  1864. // 小计
  1865. const subTotal = computed(() => {
  1866. return form.value.productList.reduce((total, current) => {
  1867. total = total + Number(current.amount)
  1868. return total
  1869. }, 0)
  1870. })
  1871. // 总优惠额度
  1872. const totalDiscount = computed(() => {
  1873. return form.value.productList.reduce((total, current) => {
  1874. total = total + Number(current.discount)
  1875. return total
  1876. }, 0)
  1877. })
  1878. // 价格统计修正值
  1879. const adjustment = ref<number | string>('')
  1880. // 总计
  1881. const grandTotal = computed(() => {
  1882. return subTotal.value - totalDiscount.value + Number(adjustment.value)
  1883. })
  1884. const productLoading = ref(false)
  1885. const getProductList = utils.debounce(
  1886. (keyword: string, target: IProductItem) => {
  1887. const key = keyword.trim()
  1888. if (!key.length) return
  1889. productLoading.value = true
  1890. const data = {
  1891. value: key,
  1892. name: 'Products',
  1893. api_name: 'Product_Name',
  1894. contains: 'contains',
  1895. page: 1,
  1896. limit: 20,
  1897. }
  1898. getSearchData(data)
  1899. .then((response) => {
  1900. if (response.data.code !== 1) return
  1901. const res = response.data.result
  1902. target.candidate = res.data.map((item: any) => {
  1903. return {
  1904. ...item,
  1905. label: item.Product_Name,
  1906. value: item.products_id || item.id,
  1907. }
  1908. })
  1909. })
  1910. .finally(() => {
  1911. productLoading.value = false
  1912. })
  1913. },
  1914. 1000,
  1915. )
  1916. const toFixed = function (value: number, ratio = 2) {
  1917. let r = 100
  1918. if (ratio === 3) {
  1919. r = 1000
  1920. }
  1921. return utils.toFixed(value, r)
  1922. }
  1923. const vendorList = ref<IVendorItem[]>([])
  1924. const computedVendor = computed(() => {
  1925. const temp = vendorList.value.filter(
  1926. (i) => i.value === form.value.currentVendor,
  1927. )
  1928. return temp.length
  1929. ? temp[0]
  1930. : {
  1931. Primary_Contact_name: '',
  1932. PDF_display: '',
  1933. PDF_display2: '',
  1934. label: '',
  1935. value: '',
  1936. Payment_Terms: '',
  1937. }
  1938. })
  1939. watch(computedVendor, () => {
  1940. if (
  1941. computedVendor.value.Payment_Terms &&
  1942. computedVendor.value.Payment_Terms.length
  1943. ) {
  1944. form.value.Supplier_Payment_Terms = computedVendor.value.Payment_Terms
  1945. }
  1946. })
  1947. const vendorLoading = ref(false)
  1948. const getSupplierLists = function (string: string) {
  1949. return new Promise((resolve, reject) => {
  1950. const keyword = string.trim() || ''
  1951. if (!keyword.length) {
  1952. reject('false')
  1953. return
  1954. }
  1955. const data = {
  1956. value: keyword,
  1957. name: 'Vendors',
  1958. api_name: 'Vendor_Name',
  1959. contains: 'contains',
  1960. page: 1,
  1961. limit: 100,
  1962. }
  1963. vendorLoading.value = true
  1964. getSearchData(data)
  1965. .then((response) => {
  1966. if (response.data.code !== 1) return false
  1967. const res = response.data.result || { data: [] }
  1968. vendorList.value = res.data
  1969. .filter((i: any) => !i.Hide_Record)
  1970. .map((i: any) => {
  1971. return {
  1972. ...i,
  1973. label: i.Suppliers_Name || i.Vendor_Name,
  1974. value: i.supplier_id || i.id,
  1975. Primary_Contact_name: i.Primary_Contact_name || '',
  1976. PDF_display: i.PDF_display || '',
  1977. PDF_display2: i.PDF_display2 || '',
  1978. }
  1979. })
  1980. vendorLoading.value = false
  1981. loading.value = false
  1982. resolve(true)
  1983. })
  1984. .catch((e) => reject(e))
  1985. })
  1986. }
  1987. const quickSelectSupplier = function (item: IRecommandVendor) {
  1988. form.value.currentVendor = item.id
  1989. loading.value = true
  1990. getSupplierLists(item.name)
  1991. }
  1992. const getSearchData = async function (p: any) {
  1993. return await request
  1994. .post('/common/getPublicLists', p, {
  1995. headers: { 'Content-Type': 'multipart/form-data' },
  1996. })
  1997. .then((response) => {
  1998. return response
  1999. })
  2000. }
  2001. const getPath = function (path: string) {
  2002. return new URL(path, import.meta.url).href
  2003. }
  2004. // 用于切换合同模版. Promo Collection 用户组使用.
  2005. const companyList = ref<ICompanyItem[]>([
  2006. {
  2007. id: 'PC',
  2008. label: 'PC',
  2009. name: '澳之原贸易有限公司',
  2010. addr: 'UNIT 12,21/F WAYSON COMM BLDG NO 28 CONNAUGHT RD WEST SHEUNG WAN,HK',
  2011. phone: '020-81609790',
  2012. signPath: getPath('/assets/sign/AZY.png'),
  2013. },
  2014. // {
  2015. // id: 'Pangea',
  2016. // label: 'Pangea',
  2017. // name: '庞吉亚国际商务服务(广州)有限公司',
  2018. // addr: '广州市越秀区八旗二马路48号内自编1号主楼自编1605、1606房',
  2019. // phone: '020-81609790',
  2020. // fax: '020-81519492',
  2021. // signPath: getPath('/assets/sign/Pangea.png'),
  2022. // },
  2023. {
  2024. id: 'PangeaTaxReimbursement',
  2025. label: 'Pangea_退税版',
  2026. name: '庞吉亚国际商务服务(广州)有限公司',
  2027. addr: '广州市越秀区八旗二马路48号内自编1号主楼901、903、1307、1605、1606房',
  2028. phone: '020-81609790',
  2029. fax: '020-81519492',
  2030. // 名字叫退税版, 实际上合同没有第二份pdf. 判断是否退税版的依据是键名存在与否, 而不是这个值的真假
  2031. taxReimbursement: false,
  2032. signPath: getPath('/assets/sign/Pangea.png'),
  2033. },
  2034. // {
  2035. // id: 'AZYTaxReimbursement',
  2036. // label: 'AZY_退税版',
  2037. // name: '澳之原贸易有限公司',
  2038. // addr: 'UNIT 12,21/F WAYSON COMM BLDG NO 28 CONNAUGHT RD WEST SHEUNG WAN,HK',
  2039. // phone: '020-81609790',
  2040. // taxReimbursement: true,
  2041. // signPath: getPath('/assets/sign/AZY.png'),
  2042. // },
  2043. {
  2044. id: 'FOTTaxReimbursement',
  2045. label: 'FOT_退税版',
  2046. name: 'FAIR OCEAN TRADING AUSTRALIA PTY.LTD',
  2047. addr: '15/10 Chilvers Road, Thornleigh, NSW 2120',
  2048. phone: '020-81609790',
  2049. taxReimbursement: true,
  2050. signPath: getPath('/assets/sign/FOT.png'),
  2051. },
  2052. ])
  2053. // 用于切换合同模版. PrimePac 用户组的模版
  2054. const PrimePacList = ref<ICompanyItem[]>([
  2055. {
  2056. id: 'PrimePacCommon',
  2057. label: 'PrimePac Purchase order 通用版',
  2058. name: '澳之原贸易有限公司',
  2059. addr: 'UNIT 12,21/F WAYSON COMM BLDG NO 28 CONNAUGHT RD WEST SHEUNG WAN,HK',
  2060. phone: '020-81609790',
  2061. signPath: getPath('/assets/sign/AZY.png'),
  2062. },
  2063. {
  2064. id: 'PrimePacSoft',
  2065. label: 'PrimePac Purchase order 软包版',
  2066. name: '澳之原贸易有限公司',
  2067. addr: 'UNIT 12,21/F WAYSON COMM BLDG NO 28 CONNAUGHT RD WEST SHEUNG WAN,HK',
  2068. phone: '020-81609790',
  2069. signPath: getPath('/assets/sign/AZY.png'),
  2070. },
  2071. ])
  2072. const computedCompanyList = computed(() => {
  2073. return userInfo.value.Organization === 'PrimePac'
  2074. ? PrimePacList.value
  2075. : companyList.value
  2076. })
  2077. // 切换模版后的处理
  2078. const onCompanyTemplateChange = function () {
  2079. // 重置这两个字段
  2080. form.value.field5 = '供应商承担'
  2081. form.value.field4 = ''
  2082. if (typeof computedCompany.value.taxReimbursement === 'undefined') {
  2083. form.value.field7 = soOwner.value
  2084. form.value.field8 = '18925020659'
  2085. form.value.field9 = '广州市越秀区八旗二马路广东航运大厦1904室 邮编510110'
  2086. } else {
  2087. // 退税版没有这三个表单项, 直接重置值. 相应的, 非退税版要重新赋值.
  2088. form.value.field7 = ''
  2089. form.value.field8 = ''
  2090. form.value.field9 = ''
  2091. }
  2092. }
  2093. // 合同的服务条款
  2094. const serviceRule = ref<TypeService>({
  2095. PC: [
  2096. '一、本采购订单签署原件一式两份,双方各持一份。',
  2097. '二、验收标准:按乙方所寄样板及国家出口标准作为验收标准。',
  2098. '三、交货期限:交货期限必须严格执行。',
  2099. '四、交货地点:甲方广州公司地址,如上收货地址。',
  2100. '五、付款方式:甲方通过银行转帐的方式付款,乙方账户信息如上。',
  2101. '六、如因未能按上述标准及期限交货而产生经济损失,将由乙方承担。',
  2102. '七、凡因执行本合同所发生的或与本合同有关的一切争议,如经友好协商不能解决时,交由广州当地法院进行判决。',
  2103. ],
  2104. Pangea: [
  2105. '一、本采购订单签署原件一式两份,双方各持一份。',
  2106. '二、验收标准:按乙方所寄样板及国家出口标准作为验收标准。',
  2107. '三、交货期限:交货期限必须严格执行。',
  2108. '四、交货地点:甲方广州公司地址,如上收货地址。',
  2109. '五、付款方式:甲方通过银行转帐的方式付款,乙方账户信息如上。',
  2110. '六、如因未能按上述标准及期限交货而产生经济损失,将由乙方承担。',
  2111. '七、凡因执行本合同所发生的或与本合同有关的一切争议,如经友好协商不能解决时,交由广州当地法院进行判决。',
  2112. ],
  2113. PangeaTaxReimbursement: [
  2114. '三、本采购订单签署原件一式两份,双方各持一份。',
  2115. '四、验收标准:按乙方所寄样板及国家出口标准作为验收标准。',
  2116. '五、交货期限:交货期限必须严格执行。',
  2117. '六、交货地点: 广州市越秀区八旗二马路48号航运大厦1605、1606房',
  2118. '七、付款方式:甲方通过银行转帐的方式付款,乙方账户信息如上。',
  2119. '八、如因未能按上述标准及期限交货而产生经济损失,将由乙方承担。',
  2120. '九、凡因执行本合同所发生的或与本合同有关的一切争议,如经友好协商不能解决时,交由广州当地法院进行判决。',
  2121. '十、我司开票资料:',
  2122. '账户名称:庞吉亚国际商务服务(广州)有限公司',
  2123. '统一社会代码:91440101MA9XUQNB4B',
  2124. '公司地址:广州市越秀区八旗二马路48号内自编1号主楼16楼自编1605、1606房 ',
  2125. '公司电话:81609790',
  2126. '基本账户:中国光大银行股份有限公司广州分行越秀支行',
  2127. '账户号码:77910180803936888',
  2128. '开户银行地址:广州市越秀区文德南路69号',
  2129. ],
  2130. AZYTaxReimbursement: [
  2131. '一、本采购订单签署原件一式两份,双方各持一份。',
  2132. '二、验收标准:按乙方所寄样板及国家出口标准作为验收标准。',
  2133. '三、交货期限:交货期限必须严格执行。',
  2134. '四、收货地址:澳竣元代收,广州市越秀区八旗二马路48号航运大厦1902房。',
  2135. '五、付款方式:甲方通过银行转帐的方式付款,乙方账户信息如上。',
  2136. '六、如因未能按上述标准及期限交货而产生经济损失,将由乙方承担。',
  2137. '七、凡因执行本合同所发生的或与本合同有关的一切争议,如经友好协商不能解决时,交由广州当地法院进行判决。',
  2138. ],
  2139. FOTTaxReimbursement: [
  2140. '一、本采购订单签署原件一式两份,双方各持一份。',
  2141. '二、验收标准:按乙方所寄样板及国家出口标准作为验收标准。',
  2142. '三、交货期限:交货期限必须严格执行。',
  2143. '四、收货地址:澳竣元代收,广州市越秀区八旗二马路48号航运大厦1902房。',
  2144. '五、付款方式:甲方通过银行转帐的方式付款,乙方账户信息如上。',
  2145. '六、如因未能按上述标准及期限交货而产生经济损失,将由乙方承担。',
  2146. '七、凡因执行本合同所发生的或与本合同有关的一切争议,如经友好协商不能解决时,交由广州当地法院进行判决。',
  2147. ],
  2148. PrimePacCommon: [
  2149. '八、质量承诺:如甲方自收到货品之日起一个月内发现货品存在不符合合同约定的瑕疵,乙方应无条件包退包换,承担违约责任。承担违约需双方进行协商,达成解决方案。',
  2150. '九、如因未能按上述标准及期限交货而产生经济损失,将由乙方承担。',
  2151. '十、其他事项:',
  2152. {
  2153. value:
  2154. '1. 乙方应确保最终实际生产数量在合约确定数量±5%以内,同时提供一定数量的备品用于更换运输途中可能出现的损坏品。',
  2155. },
  2156. {
  2157. value:
  2158. '2. 乙方若预计交货时间将出现延误,应立刻通知甲方,与甲方另行约定发货时间并得到甲方确认。如乙方无法确定时间或再度延期,并未告知甲方合理延期原因,甲方有权要求乙方承当相应的违约责任并赔偿甲方相应损失。',
  2159. },
  2160. '十一、凡因执行本合同所发生的或与本合同有关的一切争议,如经友好协商不能解决时,交由广州当地法院进行判决。',
  2161. ],
  2162. PrimePacSoft: [], // 跟 PrimePacCommon 完全相同
  2163. })
  2164. const appendixData: any[] = [
  2165. '产品制作要求及质量检验标准:',
  2166. {
  2167. value:
  2168. '1、乙方必须严格按甲方要求或产品销售国家/产品出口国最新的相关国家、行业标准对产品质量进行监控和检验。如在现场检验中发现乙方提供的产品不符合合同约定或与样板不符,乙方应在甲方要求的期限内补足、更换。补足、更换后的产品应符合合同要求。',
  2169. },
  2170. {
  2171. value:
  2172. '2、出货前甲方对合同项下产品按GB/T2828.1—2012抽样方法进行抽检,采用Ⅱ级检验水准,AQL值为:严重质量缺陷=1.0,重要质量缺陷=2.5,轻微质量缺陷=4.0 作为标准, 若检验不合格,甲方有权拒收整批货品。乙方应及时采取有效的措施补救,确保合同项下产品在合同交货期内按质、按量交货。如发生延误,则按本合同第七条的约定处理。',
  2173. },
  2174. ]
  2175. const currentServiceRule = computed(() => {
  2176. if (currentCompany.value === 'PrimePacSoft') {
  2177. return serviceRule.value['PrimePacCommon']
  2178. }
  2179. return serviceRule.value[currentCompany.value as ServiceTypeKeyEnum]
  2180. })
  2181. const currentCompany = ref('PC')
  2182. const computedCompany = computed(() => {
  2183. const result = computedCompanyList.value.filter(
  2184. (i) => i.id === currentCompany.value,
  2185. )
  2186. return result.length ? result[0] : computedCompanyList.value[0]
  2187. })
  2188. // 格式化输出价格的小数位数. 退税版需要显示三位小数, 其他只需要两位小数
  2189. const computedDeci = computed(() => {
  2190. return typeof computedCompany.value.taxReimbursement !== 'undefined' ? 3 : 2
  2191. })
  2192. // 候选 收货地址
  2193. let addressList = ref<ISelectItem[]>([])
  2194. // 候选 运费条款. 目前只有庞吉亚退税版用到, 其他模版默认供应商承担
  2195. let field5_lists = ref<ISelectItem[]>([])
  2196. let supplierPaymentTermsLists = ref<ISelectItem[]>([])
  2197. loading.value = true
  2198. // 获取下拉框非动态候选数据
  2199. const p1 = request
  2200. .post('/common/getfieldsData')
  2201. .then((response: any) => {
  2202. // console.log(response, '/common/getfieldsData')
  2203. const res = response.data.result
  2204. orderTypeList.value = res.Order_Type_lists.map((i: string) => {
  2205. return {
  2206. label: i,
  2207. }
  2208. }).filter((i: any) => i.label !== '-None-')
  2209. addressList.value = res.field9_lists.map((i: any) => {
  2210. return {
  2211. label: i,
  2212. }
  2213. })
  2214. field5_lists.value = res.field5_lists
  2215. .filter((i: string) => !/^-?[Nn]one-?$/.test(i))
  2216. .map((i: any) => {
  2217. return {
  2218. label: i,
  2219. }
  2220. })
  2221. supplierPaymentTermsLists.value = res.Supplier_Payment_Terms_lists.map(
  2222. (i: any) => {
  2223. return {
  2224. label: i,
  2225. }
  2226. },
  2227. )
  2228. })
  2229. .catch((e) => {
  2230. console.log(e, '下拉框')
  2231. ElMessage.error('获取下拉框数据出错, 请联系管理员.')
  2232. })
  2233. const route = useRoute()
  2234. const productBlackList = ['4791186000046982872', '4791186000046982896']
  2235. const soOwner = ref('')
  2236. // 获取销售订单详情
  2237. const p2 = request
  2238. .post('/common/getSalesOrdersData', { id: route.params.id })
  2239. .then((response) => {
  2240. return response
  2241. })
  2242. // 获取对 该so对应客户的标注 并弹窗提醒
  2243. const getAccountsData = async (id: string) =>
  2244. request.post('/common/getAccountsData', { id }).then((response) => {
  2245. const res = response.data
  2246. if (res.code !== 1) return
  2247. if (res.result.User_Notes && res.result.User_Notes.length) {
  2248. ElMessageBox.alert(res.result.User_Notes, '', {
  2249. showClose: false,
  2250. })
  2251. }
  2252. })
  2253. const getProductData = async (id: string) =>
  2254. request.post('/common/getProductsData', { id }).then((response) => {
  2255. const res = response.data
  2256. if (res.code !== 1) return
  2257. // 推荐供应商. 用来快速选择供应商的.
  2258. if (
  2259. Array.isArray(res.result.SUPPLIER_PRICING) &&
  2260. res.result.SUPPLIER_PRICING.length
  2261. ) {
  2262. for (const item of res.result.SUPPLIER_PRICING) {
  2263. if (
  2264. item.Supplier?.id &&
  2265. !computedRecommandVendorID.value.includes(item.Supplier.id)
  2266. ) {
  2267. recommandVendor.value.push({
  2268. id: item.Supplier.id,
  2269. name: item.Supplier.name,
  2270. })
  2271. }
  2272. }
  2273. }
  2274. if (userInfo.value.Organization === 'PrimePac') {
  2275. return '产品名称:\n尺寸:\n材质:\n工艺:\n颜色:\n其他备注:'
  2276. } else {
  2277. return res.result?.CF3 || ''
  2278. }
  2279. })
  2280. const recommandVendor = ref<IRecommandVendor[]>([])
  2281. // 用来去重
  2282. const computedRecommandVendorID = computed(() =>
  2283. recommandVendor.value.map((i: any) => i.id),
  2284. )
  2285. // 根据url传递过来的用户ID获取的用户身份信息
  2286. const userInfo = ref({} as IUser)
  2287. const p3 = request
  2288. .post('/common/getUsersData', { id: route.query.user })
  2289. .then((response) => {
  2290. const res = response.data
  2291. if (res.code !== 1) return
  2292. if (res.result.users && res.result.users.length) {
  2293. userInfo.value = res.result.users[0]
  2294. } else if (res.result.id) {
  2295. userInfo.value = res.result || {}
  2296. } else if (Array.isArray(res.result) && res.result.length) {
  2297. userInfo.value = res.result[0] || {}
  2298. } else {
  2299. ElMessage.error('获取当前用户身份异常, 请联系管理员')
  2300. }
  2301. // 根据用户 ‘组织’ 切换模版默认选中项
  2302. if (userInfo.value.Organization === 'PrimePac') {
  2303. currentCompany.value = 'PrimePacCommon'
  2304. } else {
  2305. currentCompany.value = 'PC'
  2306. }
  2307. })
  2308. Promise.all([
  2309. p1,
  2310. p2,
  2311. p3,
  2312. getAccountsData,
  2313. // getRecommamdSupplier(route.params.id as string),
  2314. ])
  2315. .then((array: any[]) => {
  2316. // console.log(array, 'all res')
  2317. // p2的数据处理逻辑从原本的p2then移动到这里处理.
  2318. // 因为要根据p3用户数据的Organization 来填充产品列表里面的 requirement, 这步处理必须放在p3后面, 而p2 p3是并发操作.
  2319. if (array[1].data.code !== 1) return
  2320. const res = array[1].data.result
  2321. if (res.Account_Name && res.Account_Name.id) {
  2322. getAccountsData(res.Account_Name.id)
  2323. }
  2324. form.value.field7 = res.Owner_name || res.Owner.name || ''
  2325. soOwner.value = res.Owner_name || res.Owner.name || ''
  2326. form.value.Title =
  2327. res.Contract_Title || res.Sales_Order_Title_Job_Name || ''
  2328. form.value.saleOrderId = res.sales_orders_id || res.id || ''
  2329. form.value.PO_Date = dayjs(new Date()).format('YYYY-MM-DD')
  2330. form.value.Reference = res.Reference || ''
  2331. form.value.Artwork_Link = res.Artwork_Link || ''
  2332. let temp = []
  2333. if (res.details) {
  2334. temp = res.details.filter(
  2335. (item: any) => !productBlackList.includes(item.product_id),
  2336. )
  2337. } else if (res.Product_Details) {
  2338. temp = res.Product_Details.filter(
  2339. (item: any) => !productBlackList.includes(item.product.id),
  2340. )
  2341. }
  2342. if (!temp.length) return
  2343. form.value.productList = []
  2344. recommandVendor.value = []
  2345. temp.forEach((item: any) => {
  2346. getProductData(item.product.id).then((ctx) => {
  2347. form.value.productList.push(
  2348. Object.assign({}, emptyProductItem, {
  2349. candidate: [
  2350. {
  2351. Product_Code: item.product_Product_Code,
  2352. label: item.product.name,
  2353. value: item.product.id,
  2354. },
  2355. ],
  2356. Product_Code: item.product.Product_Code,
  2357. id: item.product.id,
  2358. name: item.product.name,
  2359. label: item.product.name,
  2360. value: item.product.id,
  2361. desc: item.product_description || '',
  2362. quantity: Number(item.quantity),
  2363. requirement: ctx || '',
  2364. }),
  2365. )
  2366. })
  2367. })
  2368. })
  2369. .finally(() => {
  2370. loading.value = false
  2371. })
  2372. interface PrimePacTable {
  2373. project: string
  2374. method: string
  2375. }
  2376. const PrimePacCommonRuleTableData = [
  2377. {
  2378. project: '检验项目',
  2379. method: '产品质量检测方法与标准',
  2380. },
  2381. {
  2382. project: '尺寸',
  2383. method: '参考上述产品尺寸',
  2384. },
  2385. {
  2386. project: '印刷',
  2387. method:
  2388. '1、成品整洁,无明显印刷瑕疵范畴的脏污、残缺、刀丝;\n2、文字印刷清晰完整,印迹边缘光洁,渐变区域清晰均匀;\n3、无明显变形和残缺,套印基本准确,同色之间基本无色差;',
  2389. },
  2390. {
  2391. project: '复合',
  2392. method: '无明显气泡,无分层',
  2393. },
  2394. {
  2395. project: '表面',
  2396. method: '平整,无明显气泡,无刮花,无明显溢胶',
  2397. },
  2398. {
  2399. project: '其他',
  2400. method: '不允许出现划伤、烫伤、穿孔、异味、粘连异物、脏污',
  2401. },
  2402. {
  2403. project: '特殊',
  2404. method: '/',
  2405. },
  2406. ]
  2407. // 软包版表格数据
  2408. const PrimePacSoftRuleTableData1: PrimePacTable[] = [
  2409. {
  2410. project: '检验项目',
  2411. method: '产品质量检测方法与标准',
  2412. },
  2413. {
  2414. project: '印刷',
  2415. method:
  2416. '1、成品整洁,无明显印刷瑕疵范畴的脏污、残缺、刀丝;\n2、文字印刷清晰完整,印迹边缘光洁,渐变区域清晰均匀;\n3、无明显变形和残缺,套印基本准确,同色之间基本无色差;\n4、与颜色标准无明显色差(将提供明确的颜色标准)',
  2417. },
  2418. {
  2419. project: '复合',
  2420. method: '无明显气泡,无分层',
  2421. },
  2422. {
  2423. project: '热封',
  2424. method: '平整,无虚封,无明显气泡',
  2425. },
  2426. {
  2427. project: '其他',
  2428. method: '不允许出现划伤、烫伤、穿孔、异味、粘连异物、脏污',
  2429. },
  2430. ]
  2431. const PrimePacSoftRuleTableData2: PrimePacTable[] = [
  2432. {
  2433. project: '溶剂残留量',
  2434. method:
  2435. '按照GB/T 10004的6.6.17条规定执行\n总溶剂残留量≤10mg/m2\n苯系溶剂残留量≤2mg/m2',
  2436. },
  2437. {
  2438. project: '复合强度',
  2439. method: '按照GB/T 8808的规定执行\n≥1.0 N/15mm',
  2440. },
  2441. {
  2442. project: '热封强度',
  2443. method: '按照GB/T 2358的规定执行\n≥20 N/15mm',
  2444. },
  2445. {
  2446. project: '耐压性能',
  2447. method: '按照GB/T 10004的6.6.8条规定执行\n120N下无渗漏,无破裂',
  2448. },
  2449. {
  2450. project: '熟化时间',
  2451. method: '熟化时间不少于48小时',
  2452. },
  2453. ]
  2454. </script>
  2455. <style lang="scss">
  2456. input[type='number'] {
  2457. -moz-appearance: textfield;
  2458. appearance: textfield;
  2459. &:hover {
  2460. -moz-appearance: textfield;
  2461. appearance: textfield;
  2462. &::-webkit-inner-spin-button,
  2463. &::-webkit-outer-spin-button {
  2464. -webkit-appearance: none;
  2465. margin: 0;
  2466. }
  2467. }
  2468. &::-webkit-inner-spin-button,
  2469. &::-webkit-outer-spin-button {
  2470. -webkit-appearance: none;
  2471. margin: 0;
  2472. }
  2473. }
  2474. .product-select {
  2475. .el-select-dropdown,
  2476. .el-select-dropdown__list {
  2477. min-width: 400px;
  2478. max-width: 500px;
  2479. }
  2480. }
  2481. </style>
  2482. <style lang="scss" scoped>
  2483. .view-window {
  2484. height: 100vh;
  2485. width: 100vw;
  2486. position: fixed;
  2487. z-index: 999;
  2488. background-color: rgba(#fff, 0.3);
  2489. left: 0;
  2490. top: 0;
  2491. }
  2492. .fixed-button-area {
  2493. position: fixed;
  2494. top: 20px;
  2495. right: 24px;
  2496. z-index: 2;
  2497. @media screen and (min-width: 1600px) {
  2498. right: calc((100% - 1600px) / 2 + 24px);
  2499. }
  2500. }
  2501. .screen {
  2502. margin: 0 auto;
  2503. font-size: 12pt;
  2504. line-height: 22pt;
  2505. }
  2506. .print {
  2507. padding: 20px 0;
  2508. }
  2509. .page-title-wrap {
  2510. padding: 12px 36px;
  2511. border-bottom: 1px solid #eee;
  2512. margin-bottom: 24px;
  2513. }
  2514. .page-title {
  2515. font-size: 36px;
  2516. margin-left: 8px;
  2517. }
  2518. .layout-left {
  2519. width: 435px;
  2520. min-width: 435px;
  2521. padding-right: 12px;
  2522. }
  2523. .layout-right {
  2524. position: relative;
  2525. border-left: 1px solid #eee;
  2526. padding: 0 24px;
  2527. }
  2528. .rule-item {
  2529. margin-bottom: 2px;
  2530. color: $subColor;
  2531. line-height: 26pt;
  2532. &.sub {
  2533. line-height: 20pt;
  2534. padding-left: 24px;
  2535. }
  2536. &.nowrap {
  2537. white-space: nowrap;
  2538. }
  2539. .el-form-item {
  2540. margin-bottom: 0;
  2541. }
  2542. .attention {
  2543. padding: 0 8px;
  2544. line-height: 1.5;
  2545. border-bottom: 2px solid #777;
  2546. font-weight: bold;
  2547. }
  2548. }
  2549. .btn-quick-vendor {
  2550. border: 1px solid #dcdfe6;
  2551. border-radius: 4px;
  2552. cursor: pointer;
  2553. padding: 0 8px;
  2554. margin-bottom: 6px;
  2555. &.active {
  2556. color: #fff;
  2557. background-color: #409eff;
  2558. }
  2559. }
  2560. .PrimePac-table {
  2561. margin: 12px auto;
  2562. width: 100%;
  2563. border-bottom: 1px solid #dcdfe6;
  2564. border-right: 1px solid #dcdfe6;
  2565. .column-item {
  2566. color: $subColor;
  2567. white-space: pre-wrap;
  2568. padding: 0 4px;
  2569. line-height: 20pt;
  2570. min-width: 120px;
  2571. min-height: 20pt;
  2572. border-top: 1px solid #dcdfe6;
  2573. border-left: 1px solid #dcdfe6;
  2574. }
  2575. }
  2576. .sign-wrap {
  2577. width: 100pt;
  2578. &.pangea {
  2579. width: 180pt;
  2580. }
  2581. img {
  2582. width: 100%;
  2583. }
  2584. }
  2585. .screen {
  2586. background-color: rgba(#fff, 1);
  2587. box-shadow:
  2588. 0 0 0 1px rgba(255, 255, 255, 0.4) inset,
  2589. 0 0.5em 1em rgba(0, 0, 0, 0.6);
  2590. max-width: 1600px;
  2591. min-width: 1200px;
  2592. margin: 0 auto;
  2593. .company-info {
  2594. text-align: center;
  2595. font-size: 10pt;
  2596. color: $subColor;
  2597. margin-bottom: 16pt;
  2598. }
  2599. .company-name {
  2600. margin-bottom: 4pt;
  2601. color: $mainColor;
  2602. font-size: 16pt;
  2603. line-height: 22pt;
  2604. }
  2605. .company-addr {
  2606. line-height: 12pt;
  2607. height: 12pt;
  2608. }
  2609. .company-phone {
  2610. line-height: 12pt;
  2611. height: 12pt;
  2612. }
  2613. .company-fax {
  2614. line-height: 12pt;
  2615. height: 12pt;
  2616. }
  2617. .form-area {
  2618. position: relative;
  2619. }
  2620. .form-area-left {
  2621. width: 30%;
  2622. }
  2623. .form-area-right {
  2624. width: 45%;
  2625. position: relative;
  2626. text-align: right;
  2627. vertical-align: top;
  2628. .label {
  2629. display: inline-block;
  2630. width: 40%;
  2631. vertical-align: top;
  2632. }
  2633. .value {
  2634. width: 60%;
  2635. word-break: break-word;
  2636. display: inline-block;
  2637. }
  2638. }
  2639. .product-table-separator {
  2640. width: 95%;
  2641. }
  2642. .product-total-table {
  2643. display: inline-block;
  2644. border: 1px solid #eee;
  2645. min-width: 220pt;
  2646. border-radius: 8pt;
  2647. position: relative;
  2648. right: 0;
  2649. top: 0;
  2650. .total-item {
  2651. & > div {
  2652. display: inline-block;
  2653. height: 26pt;
  2654. line-height: 26pt;
  2655. padding: 0 8pt;
  2656. }
  2657. &:nth-of-type(n + 1) {
  2658. border-top: 1px solid #eee;
  2659. }
  2660. }
  2661. .label {
  2662. width: 50%;
  2663. text-align: right;
  2664. }
  2665. .value {
  2666. width: 50%;
  2667. text-align: left;
  2668. }
  2669. }
  2670. .product-table {
  2671. table {
  2672. border: 1pt solid #eee;
  2673. width: 100%;
  2674. }
  2675. tr:nth-of-type(n + 3) td {
  2676. border-top: 1pt solid #eee;
  2677. }
  2678. th {
  2679. text-align: center;
  2680. background-color: $tableHeaderBgColor;
  2681. }
  2682. td {
  2683. padding: 8pt 8pt 4pt;
  2684. min-width: 30pt;
  2685. max-width: 100pt;
  2686. }
  2687. th + th,
  2688. td + td {
  2689. border-left: 1pt solid #eee;
  2690. }
  2691. .action {
  2692. text-align: center;
  2693. width: 50pt;
  2694. }
  2695. .quantity,
  2696. .rate,
  2697. .amount,
  2698. .discount {
  2699. width: 80pt;
  2700. }
  2701. .requirement {
  2702. width: 180pt;
  2703. }
  2704. .product {
  2705. width: 180pt;
  2706. }
  2707. }
  2708. .note-form-area {
  2709. width: 40%;
  2710. }
  2711. .sub-form-title {
  2712. padding-left: 4pt;
  2713. border-left: 2pt solid #efefef;
  2714. margin-bottom: 8pt;
  2715. }
  2716. }
  2717. .preview-area {
  2718. background-color: #fff;
  2719. font-size: 10pt;
  2720. line-height: 22pt;
  2721. color: $mainColor;
  2722. box-sizing: border-box;
  2723. * {
  2724. padding: 0;
  2725. margin: 0;
  2726. }
  2727. .company-info {
  2728. text-align: center;
  2729. font-size: 9pt;
  2730. color: $subColor;
  2731. margin-bottom: 16pt;
  2732. }
  2733. .company-name {
  2734. margin-bottom: 4pt;
  2735. color: $mainColor;
  2736. font-size: 16pt;
  2737. line-height: 22pt;
  2738. }
  2739. .company-addr {
  2740. line-height: 12pt;
  2741. height: 12pt;
  2742. }
  2743. .company-phone {
  2744. line-height: 12pt;
  2745. height: 12pt;
  2746. }
  2747. .company-fax {
  2748. line-height: 12pt;
  2749. height: 12pt;
  2750. }
  2751. $titleWidth: 100%;
  2752. .pdf-title {
  2753. text-align: center;
  2754. font-size: 28pt;
  2755. line-height: 36pt;
  2756. height: 36pt;
  2757. width: $titleWidth;
  2758. margin: 0 auto;
  2759. background-color: #fff;
  2760. }
  2761. .pdf-title-bg {
  2762. width: 100%;
  2763. height: 2pt;
  2764. .center {
  2765. width: 33%;
  2766. text-align: center;
  2767. }
  2768. .right,
  2769. .left {
  2770. width: 33%;
  2771. height: 3pt;
  2772. line-height: 3pt;
  2773. & > div {
  2774. width: 100%;
  2775. height: 2pt;
  2776. line-height: 2pt;
  2777. background-color: $bgColor;
  2778. }
  2779. }
  2780. }
  2781. .form-area {
  2782. padding-top: 24pt;
  2783. line-height: 14pt;
  2784. $formAreaFontSize: 10pt;
  2785. white-space: pre-wrap;
  2786. font-size: $formAreaFontSize;
  2787. & > .flex-auto {
  2788. width: 50%;
  2789. & > div {
  2790. padding-bottom: 8pt;
  2791. }
  2792. &:first-of-type {
  2793. padding-right: 10pt;
  2794. }
  2795. }
  2796. .column-vendor {
  2797. vertical-align: top;
  2798. }
  2799. .column-form-label {
  2800. width: 40%;
  2801. }
  2802. .column-form-value {
  2803. width: 60%;
  2804. }
  2805. }
  2806. .product-table-separator {
  2807. width: 100%;
  2808. margin: 15pt auto 10pt;
  2809. height: 2pt;
  2810. background-color: $bgColor;
  2811. }
  2812. .product-table {
  2813. table {
  2814. margin: 0 auto 6pt;
  2815. width: 100%;
  2816. border-radius: 6pt;
  2817. text-align: left;
  2818. }
  2819. tr:nth-of-type(n + 1) td {
  2820. border-top: 1pt solid #eee;
  2821. }
  2822. th {
  2823. background-color: $bgColor;
  2824. min-width: 20pt;
  2825. padding: 0 2pt;
  2826. }
  2827. td {
  2828. min-width: 20pt;
  2829. max-width: 100pt;
  2830. padding: 0 2pt;
  2831. white-space: pre-wrap;
  2832. .product-name {
  2833. font-weight: bold;
  2834. }
  2835. .desc {
  2836. white-space: pre-wrap;
  2837. line-height: 16pt;
  2838. color: $subColor;
  2839. }
  2840. }
  2841. .row-index {
  2842. width: 20pt;
  2843. }
  2844. }
  2845. .note-form-area {
  2846. width: 40%;
  2847. .label {
  2848. color: $subColor;
  2849. display: inline-block;
  2850. width: 40%;
  2851. vertical-align: top;
  2852. }
  2853. .value {
  2854. color: $subColor;
  2855. width: 60%;
  2856. word-break: break-word;
  2857. white-space: pre-wrap;
  2858. display: inline-block;
  2859. line-height: 16pt;
  2860. }
  2861. }
  2862. .sub-form-title {
  2863. color: $subColor;
  2864. font-weight: bold;
  2865. }
  2866. .signature-area {
  2867. color: $subColor;
  2868. // padding-bottom: 40pt;
  2869. .first-party {
  2870. padding: 30pt 0 0;
  2871. }
  2872. .second-party {
  2873. min-width: 41%;
  2874. // height: 86pt;
  2875. padding: 20pt 0 40pt;
  2876. }
  2877. }
  2878. }
  2879. .preview-area2 {
  2880. background-color: #fff;
  2881. .supplier-name {
  2882. font-size: 22pt;
  2883. text-align: center;
  2884. }
  2885. .billing-addr {
  2886. line-height: 18pt;
  2887. min-height: 18pt;
  2888. font-size: 12pt;
  2889. text-align: center;
  2890. }
  2891. .contact-info {
  2892. margin-bottom: 12pt;
  2893. min-height: 18pt;
  2894. line-height: 18pt;
  2895. font-size: 12pt;
  2896. }
  2897. .product-table {
  2898. table {
  2899. border: 1px solid $bgColor;
  2900. border-radius: 3pt;
  2901. margin: 0 auto 6pt;
  2902. width: 100%;
  2903. font-size: 10pt;
  2904. }
  2905. th {
  2906. text-align: left;
  2907. }
  2908. td {
  2909. white-space: pre-wrap;
  2910. }
  2911. th,
  2912. td {
  2913. padding: 4pt 6pt;
  2914. &:nth-of-type(n + 2) {
  2915. border-left: 1px solid $bgColor;
  2916. }
  2917. }
  2918. tr:nth-of-type(n + 2) {
  2919. td {
  2920. border-top: 1px solid $bgColor;
  2921. }
  2922. }
  2923. }
  2924. .table-title {
  2925. text-align: center;
  2926. font-weight: bold;
  2927. font-size: 16pt;
  2928. margin: 12pt auto 8pt;
  2929. }
  2930. .base-info-area {
  2931. margin-top: 12pt;
  2932. font-size: 11pt;
  2933. .base-info-label {
  2934. min-width: 90pt;
  2935. width: 90pt;
  2936. font-family: serif;
  2937. }
  2938. .base-info-value {
  2939. white-space: pre-wrap;
  2940. vertical-align: top;
  2941. flex: auto;
  2942. text-align: left;
  2943. font-family: sans-serif;
  2944. font-weight: 400;
  2945. }
  2946. .left {
  2947. padding-right: 8pt;
  2948. .base-info-label {
  2949. min-width: 60pt;
  2950. width: 60pt;
  2951. }
  2952. }
  2953. .right {
  2954. padding-left: 8pt;
  2955. }
  2956. .left,
  2957. .right {
  2958. width: 50%;
  2959. margin-bottom: 12pt;
  2960. }
  2961. }
  2962. .bank-info-area {
  2963. font-family: sans-serif;
  2964. font-weight: bold;
  2965. font-size: 11pt;
  2966. margin-bottom: 10pt;
  2967. .bank-info-label {
  2968. font-weight: bold;
  2969. font-family: serif;
  2970. width: 160pt;
  2971. max-width: 160pt;
  2972. }
  2973. .bank-info-value {
  2974. font-family: serif;
  2975. font-weight: normal;
  2976. }
  2977. }
  2978. }
  2979. @media print {
  2980. .screen {
  2981. display: none;
  2982. }
  2983. .preview-area,
  2984. .preview-area2 {
  2985. border: none;
  2986. border-color: transparent;
  2987. }
  2988. }
  2989. @media screen {
  2990. .print.hidden {
  2991. position: fixed;
  2992. right: -10000px;
  2993. bottom: -10000px;
  2994. }
  2995. .pdf-wrap {
  2996. position: relative;
  2997. width: 21cm;
  2998. margin: 0 auto;
  2999. box-shadow: 1px 1px 2pt 0px $subColor;
  3000. & + .pdf-wrap {
  3001. margin-top: 20px;
  3002. }
  3003. }
  3004. .preview-area,
  3005. .preview-area2 {
  3006. padding: 1cm;
  3007. min-height: 29.69cm;
  3008. }
  3009. }
  3010. </style>