detailsPage.vue 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button
  6. type="danger"
  7. style="border: none;background: none;color: red"
  8. icon="el-icon-arrow-left"
  9. @click="backToList"
  10. >返回列表
  11. </el-button>
  12. </div>
  13. <div class="add-customer-btn" v-if="showBut">
  14. <el-button
  15. type="primary"
  16. size="small"
  17. v-if="detailData.status == 1"
  18. class="el-button--small-yh "
  19. @click.stop="openEdit"
  20. >编辑
  21. </el-button>
  22. <el-button type="info" @click="saveSell" size="small"
  23. >生成销售单</el-button
  24. >
  25. <el-button
  26. type="success"
  27. :disabled="!form.id"
  28. size="small"
  29. @click="copyDoc"
  30. >
  31. 复制单据
  32. </el-button>
  33. <el-button
  34. type="primary"
  35. :disabled="disabled"
  36. @click="editCustomer"
  37. :loading="subLoading"
  38. v-if="detailData.status != 1"
  39. size="small"
  40. >保存数据
  41. </el-button>
  42. </div>
  43. </div>
  44. <div class="customer-main">
  45. <containerTitle title="基础信息"></containerTitle>
  46. <basic-container :showBtn="true">
  47. <avue-form
  48. ref="form"
  49. class="trading-form"
  50. v-model="form"
  51. :option="option"
  52. >
  53. <template slot="portOfLoad">
  54. <port-info
  55. v-model="form.portOfLoad"
  56. :disabled="detailData.status == 1"
  57. />
  58. </template>
  59. <template slot="portOfDestination">
  60. <port-info
  61. v-model="form.portOfDestination"
  62. :disabled="detailData.status == 1"
  63. />
  64. </template>
  65. <template slot="corpId">
  66. <crop-select
  67. v-model="form.corpId"
  68. @getCorpData="getCorpData"
  69. corpType="KH"
  70. :disabled="detailData.status == 1"
  71. ></crop-select>
  72. </template>
  73. <template slot="corpAttn">
  74. <el-select
  75. size="small"
  76. v-model="form.corpAttn"
  77. placeholder="请选择"
  78. @change="corpAttnChange"
  79. clearable
  80. :disabled="detailData.status == 1"
  81. >
  82. <el-option
  83. v-for="item in corpsattns"
  84. :key="item.id"
  85. :label="item.cname"
  86. :value="item.cname"
  87. >
  88. </el-option>
  89. </el-select>
  90. </template>
  91. <template slot="belongToCorpId">
  92. <crop-select
  93. v-model="form.belongToCorpId"
  94. corpType="GS"
  95. :disabled="detailData.status == 1"
  96. ></crop-select>
  97. </template>
  98. <template slot="priceTerms">
  99. <el-select
  100. size="small"
  101. v-model="form.priceTerms"
  102. placeholder="请选择"
  103. @change="priceTermsChange"
  104. clearable
  105. :disabled="detailData.status == 1"
  106. >
  107. <el-option
  108. v-for="item in priceTermsList"
  109. :key="item.id"
  110. :label="item.dictValue"
  111. :value="item.dictValue"
  112. >
  113. </el-option>
  114. </el-select>
  115. </template>
  116. <template slot="paymentType">
  117. <el-select
  118. size="small"
  119. v-model="form.paymentType"
  120. placeholder="请选择"
  121. @change="paymentTypeChange"
  122. clearable
  123. :disabled="detailData.status == 1"
  124. >
  125. <el-option
  126. v-for="item in paymentTermList"
  127. :key="item.id"
  128. :label="item.dictValue"
  129. :value="item.dictValue"
  130. >
  131. </el-option>
  132. </el-select>
  133. </template>
  134. <template slot="currency">
  135. <el-select
  136. size="small"
  137. v-model="form.currency"
  138. placeholder="请选择"
  139. @change="currencyChange"
  140. :disabled="detailData.status == 1"
  141. >
  142. <el-option
  143. v-for="item in currencyList"
  144. :key="item.id"
  145. :label="item.dictValue"
  146. :value="item.dictValue"
  147. >
  148. </el-option>
  149. </el-select>
  150. </template>
  151. <template slot="exchangeRate">
  152. <el-input
  153. size="small"
  154. v-model="form.exchangeRate"
  155. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  156. placeholder="请输入 汇率"
  157. :disabled="detailData.status == 1"
  158. @change="exchangeRateChange"
  159. />
  160. </template>
  161. <template slot="boxPile">
  162. <el-select
  163. size="small"
  164. v-model="form.boxPile"
  165. placeholder="请选择"
  166. clearable
  167. filterable
  168. :disabled="detailData.status == 1"
  169. >
  170. <el-option
  171. v-for="item in allBoxs"
  172. :key="item.id"
  173. :label="item.name"
  174. :value="item.name"
  175. >
  176. </el-option>
  177. </el-select>
  178. </template>
  179. <template slot="boxNumber">
  180. <el-input
  181. size="small"
  182. v-model="form.boxNumber"
  183. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  184. placeholder="请输入 箱量"
  185. :disabled="detailData.status == 1"
  186. />
  187. </template>
  188. <template slot="minOrder">
  189. <el-input
  190. size="small"
  191. v-model="form.minOrder"
  192. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  193. placeholder="请输入 起订量"
  194. :disabled="detailData.status == 1"
  195. />
  196. </template>
  197. <template slot="predictOceanFreight">
  198. <el-input
  199. size="small"
  200. v-model="form.predictOceanFreight"
  201. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  202. placeholder="请输入 预计海运费"
  203. :disabled="detailData.status == 1"
  204. />
  205. </template>
  206. <template slot="referenceOceanFreight">
  207. <el-input
  208. size="small"
  209. v-model="form.referenceOceanFreight"
  210. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  211. placeholder="请输入 参考海运费"
  212. :disabled="detailData.status == 1"
  213. />
  214. </template>
  215. <template slot="oceanFreight">
  216. <el-input
  217. size="small"
  218. v-model="form.oceanFreight"
  219. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  220. placeholder="请输入 实际海运费"
  221. :disabled="detailData.status == 1"
  222. />
  223. </template>
  224. </avue-form>
  225. </basic-container>
  226. <containerTitle title="商品信息"></containerTitle>
  227. <basic-container>
  228. <avue-crud
  229. ref="crud"
  230. :data="data"
  231. :option="tableOption"
  232. @row-del="rowDel"
  233. :summary-method="summaryMethod"
  234. @saveColumn="saveColumn"
  235. @resetColumn="resetColumn"
  236. :cell-style="cellStyle"
  237. >
  238. <template slot="headerSerial">
  239. <el-button
  240. type="primary"
  241. icon="el-icon-plus"
  242. size="mini"
  243. @click.stop="addRow"
  244. :disabled="detailData.status == 1"
  245. circle
  246. ></el-button>
  247. </template>
  248. <template slot="menuLeft">
  249. <el-button
  250. type="primary"
  251. icon="el-icon-plus"
  252. size="small"
  253. @click.stop="newDetails"
  254. :disabled="detailData.status == 1"
  255. >批量录入</el-button
  256. >
  257. <el-button
  258. type="primary"
  259. icon="el-icon-plus"
  260. size="small"
  261. @click.stop="addLibrary"
  262. :disabled="detailData.status == 1"
  263. >出口价格库</el-button
  264. >
  265. <el-button
  266. type="info"
  267. icon="el-icon-printer"
  268. size="small"
  269. @click.stop="openReport()"
  270. >报表打印</el-button
  271. >
  272. <el-button
  273. type="info"
  274. size="small"
  275. @click.stop="savePurchase"
  276. :disabled="detailData.status == 1"
  277. >采购询价</el-button
  278. >
  279. <el-button
  280. type="info"
  281. size="small"
  282. @click.stop="saveShipping"
  283. :disabled="detailData.status == 1"
  284. >船务询价</el-button
  285. >
  286. </template>
  287. <template slot="menu" slot-scope="{ row, index }">
  288. <el-button
  289. size="small"
  290. icon="el-icon-edit"
  291. type="text"
  292. @click="rowCell(row, index)"
  293. :disabled="disabled || detailData.status == 1"
  294. >{{ row.$cellEdit ? "保存" : "修改" }}</el-button
  295. >
  296. <el-button
  297. size="small"
  298. icon="el-icon-delete"
  299. type="text"
  300. @click="rowDel(row, index)"
  301. :disabled="detailData.status == 1"
  302. >删除</el-button
  303. >
  304. </template>
  305. <template slot="itemType" slot-scope="{ row }">
  306. <el-select
  307. v-if="row.$cellEdit"
  308. v-model="row.itemType"
  309. filterable
  310. allow-create
  311. default-first-option
  312. placeholder="请输入"
  313. size="small"
  314. @focus="itemTypeFocus(row)"
  315. >
  316. <el-option
  317. v-for="(item, index) in itemtypeList"
  318. :key="index"
  319. :label="item.value"
  320. :value="item.value"
  321. >
  322. </el-option>
  323. </el-select>
  324. <span v-else>{{ row.itemType }}</span>
  325. </template>
  326. <template slot="itemProp" slot-scope="{ row, index }">
  327. <span v-if="row.$cellEdit" style="display:flex">
  328. <el-input
  329. v-model="row.itemProp"
  330. size="small"
  331. placeholder="请点击右边按钮"
  332. ></el-input>
  333. <el-button
  334. icon="el-icon-edit"
  335. size="mini"
  336. @click="openProperty(row, index)"
  337. ></el-button>
  338. </span>
  339. <span v-else>{{ row.itemProp }}</span>
  340. </template>
  341. <template slot="cname" slot-scope="{ row, index }">
  342. <span v-if="row.$cellEdit" style="display:flex">
  343. <el-select
  344. v-model="row.itemId"
  345. placeholder="请选择"
  346. size="small"
  347. style="width:60%"
  348. @change="cnameChange(row, index)"
  349. >
  350. <el-option
  351. v-for="item in goodsoptions"
  352. :key="item.id"
  353. :label="item.cname"
  354. :value="item.id"
  355. >
  356. </el-option>
  357. </el-select>
  358. <el-button
  359. icon="el-icon-search"
  360. size="small"
  361. @click="rePick(row, index)"
  362. ></el-button>
  363. </span>
  364. <span v-else> {{ row.cname }}</span>
  365. </template>
  366. <template slot="partsDescribe" slot-scope="{ row, index }">
  367. <span v-if="row.$cellEdit" style="display:flex">
  368. <el-input
  369. v-model="row.partsDescribe"
  370. size="small"
  371. placeholder="请点击右边按钮"
  372. ></el-input>
  373. <el-button
  374. icon="el-icon-edit"
  375. size="mini"
  376. @click="partrePick(row, index)"
  377. ></el-button>
  378. </span>
  379. <span v-else>{{ row.partsDescribe }}</span>
  380. </template>
  381. <template slot="priorityReferrer" slot-scope="{ row }">
  382. <el-checkbox
  383. :disabled="!row.$cellEdit"
  384. v-model="row.priorityReferrer"
  385. :true-label="1"
  386. :false-label="0"
  387. />
  388. </template>
  389. <template slot="corpId" slot-scope="{ row }">
  390. <span>{{ row.corpName }}</span>
  391. </template>
  392. <template slot="purchaseCost" slot-scope="{ row }">
  393. <el-input
  394. v-if="row.$cellEdit"
  395. v-model="row.purchaseCost"
  396. size="small"
  397. placeholder="请输入"
  398. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  399. ></el-input>
  400. <span v-else>{{ row.purchaseCost | micrometerFormat }}</span>
  401. </template>
  402. <template slot="purchaseAmount" slot-scope="{ row }">
  403. <el-input
  404. v-if="row.$cellEdit"
  405. v-model="row.purchaseAmount"
  406. size="small"
  407. placeholder="请输入"
  408. @change="purchaseAmountChange(row)"
  409. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  410. ></el-input>
  411. <span v-else>{{ row.purchaseAmount | micrometerFormat }}</span>
  412. </template>
  413. <template slot="price" slot-scope="{ row }">
  414. <el-input
  415. v-if="row.$cellEdit"
  416. v-model="row.price"
  417. size="small"
  418. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  419. @change="priceChange(row)"
  420. ></el-input>
  421. <span v-else>{{ row.price | micrometerFormat }}</span>
  422. </template>
  423. <template slot="amount" slot-scope="{ row }">
  424. <span>{{ row.amount | micrometerFormat }}</span>
  425. </template>
  426. <template slot="orderQuantity" slot-scope="{ row }">
  427. <el-input
  428. v-if="row.$cellEdit"
  429. v-model="row.orderQuantity"
  430. size="small"
  431. oninput='this.value=this.value.replace(/[^(\d)]/g,"")'
  432. @change="priceChange(row)"
  433. ></el-input>
  434. <span v-else>{{ row.orderQuantity | IntegerFormat }}</span>
  435. </template>
  436. <template slot="discount" slot-scope="{ row }">
  437. <el-input
  438. v-if="row.$cellEdit"
  439. v-model="row.discount"
  440. size="small"
  441. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  442. @change="discountChange(row)"
  443. ></el-input>
  444. <span v-else>{{ row.discount | isDiscount }}</span>
  445. </template>
  446. <template slot="insurance" slot-scope="{ row }">
  447. <el-input
  448. v-if="row.$cellEdit"
  449. v-model="row.insurance"
  450. size="small"
  451. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  452. @change="priceChange(row)"
  453. ></el-input>
  454. <span v-else>{{ row.insurance | micrometerFormat }}</span>
  455. </template>
  456. <template slot="freight" slot-scope="{ row }">
  457. <el-input
  458. v-if="row.$cellEdit"
  459. v-model="row.freight"
  460. size="small"
  461. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  462. @change="priceChange(row)"
  463. ></el-input>
  464. <span v-else>{{ row.freight | micrometerFormat }}</span>
  465. </template>
  466. <template slot="taxRate" slot-scope="{ row }">
  467. <el-input
  468. v-if="row.$cellEdit"
  469. v-model="row.taxRate"
  470. size="small"
  471. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  472. @change="taxRateChange(row)"
  473. ></el-input>
  474. <span v-else>{{ row.taxRate | isPercentage }}</span>
  475. </template>
  476. <template slot="itemMargin" slot-scope="{ row }">
  477. <span>{{ row.itemMargin | isPercentage }}</span>
  478. </template>
  479. </avue-crud>
  480. </basic-container>
  481. <fee-info
  482. ref="feeInfo"
  483. :orderFeesList="orderFeesList"
  484. :disabled="detailData.status == 1"
  485. feeUrl="/blade-purchase-sales/orderfees/update"
  486. optionType="CK"
  487. itemType="报价"
  488. @beforeFinance="beforeFinance"
  489. :inCropId="true"
  490. />
  491. <containerTitle title="合同附件"></containerTitle>
  492. <c-upload
  493. typeUpload="CK"
  494. :data="orderFilesList"
  495. :disabled="detailData.status == 1"
  496. :enumerationValue="76"
  497. deleteUrl="/blade-purchase-sales/orderfiles/update"
  498. />
  499. </div>
  500. <el-dialog
  501. title="导入商品"
  502. append-to-body
  503. class="el-dialogDeep"
  504. :visible.sync="dialogVisible"
  505. width="80%"
  506. :close-on-click-modal="false"
  507. :destroy-on-close="true"
  508. :close-on-press-escape="false"
  509. @close="closeGoods"
  510. top="5vh"
  511. v-dialog-drag
  512. >
  513. <span>
  514. <el-row>
  515. <el-col :span="4">
  516. <div>
  517. <el-scrollbar>
  518. <basic-container>
  519. <avue-tree
  520. :option="treeOption"
  521. @node-click="nodeClick"
  522. :style="treeStyle"
  523. />
  524. </basic-container>
  525. </el-scrollbar>
  526. </div>
  527. </el-col>
  528. <el-col :span="20">
  529. <avue-crud
  530. :option="goodsOption"
  531. :table-loading="loading"
  532. :data="goodsList"
  533. ref="goodsCrud"
  534. :search.sync="search"
  535. @search-change="searchChange"
  536. @refresh-change="refreshChange"
  537. @selection-change="selectionChange"
  538. @row-click="rowClick"
  539. :page.sync="page"
  540. @on-load="onLoad"
  541. @saveColumn="saveGoodsColumn"
  542. @resetColumn="resetGoodsColumn"
  543. :cell-style="cellStyle"
  544. ></avue-crud>
  545. </el-col>
  546. </el-row>
  547. </span>
  548. <span slot="footer" class="dialog-footer">
  549. <el-button @click="dialogVisible = false">取 消</el-button>
  550. <el-button
  551. type="primary"
  552. @click="importGoods"
  553. :disabled="selectionList.length == 0"
  554. >导入</el-button
  555. >
  556. </span>
  557. </el-dialog>
  558. <report-dialog
  559. :switchDialog="switchDialog"
  560. :reportId="form.id"
  561. reportName="报价单明细(E)"
  562. @onClose="onClose()"
  563. ></report-dialog>
  564. <part-dialog
  565. ref="part"
  566. :partList="partList"
  567. @importPart="importPart"
  568. @partClosed="partClosed"
  569. />
  570. <property-dialog ref="property" @importProperty="importProperty" />
  571. <price-library ref="library" @importLibray="importLibray" />
  572. </div>
  573. </template>
  574. <script>
  575. import tableOption from "./config/customerContact.json";
  576. import goodsOption from "./config/commodity.json";
  577. import feeInfo from "@/components/fee-info/main";
  578. import customerDialog from "@/components/customer-dialog/main";
  579. import partDialog from "@/components/part-dialog/main";
  580. import propertyDialog from "@/components/property-dialog/main";
  581. import {
  582. detail,
  583. submit,
  584. delItem,
  585. getDeptLazyTree,
  586. getGoods,
  587. savePurchase,
  588. saveShipping,
  589. getPorts,
  590. getSpecification,
  591. saveSell,
  592. getPricedetail
  593. } from "@/api/basicData/customerInquiry";
  594. import { getAllBoxs } from "@/api/basicData/portinformation";
  595. import { getCorpsattn } from "@/api/basicData/customerInformation";
  596. import reportDialog from "@/components/report-dialog/main";
  597. import priceLibrary from "@/components/price-Library/main";
  598. import {
  599. isDiscount,
  600. isPercentage,
  601. micrometerFormat,
  602. IntegerFormat
  603. } from "@/util/validate";
  604. import { contrastObj, contrastList } from "@/util/contrastData";
  605. import { dateFormat } from "@/util/date";
  606. import {
  607. productCal,
  608. sellingCal,
  609. amountCal,
  610. transformCal,
  611. grossProfitCal,
  612. STGPCal,
  613. numCal,
  614. costsCal,
  615. costCal
  616. } from "@/util/calculate";
  617. import _ from "lodash";
  618. export default {
  619. name: "detailsPageEdit",
  620. data() {
  621. return {
  622. show: true,
  623. oldExchange: null,
  624. treeStyle: "height:" + (window.innerHeight - 315) + "px",
  625. itemtypeList: [],
  626. switchDialog: false,
  627. form: {
  628. orderStatus: "录入",
  629. businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00",
  630. currency: "USD"
  631. },
  632. disabled: false,
  633. dialogVisible: false,
  634. tableOption: {},
  635. option: {
  636. menuBtn: false,
  637. labelWidth: 100,
  638. column: [
  639. {
  640. label: "客户名称",
  641. prop: "corpId",
  642. rules: [
  643. {
  644. required: true,
  645. message: "",
  646. trigger: "blur"
  647. }
  648. ],
  649. span: 16,
  650. slot: true
  651. },
  652. {
  653. label: "系统号",
  654. prop: "sysNo",
  655. span: 8,
  656. disabled: true
  657. },
  658. {
  659. label: "联系人",
  660. prop: "corpAttn",
  661. span: 8
  662. },
  663. {
  664. label: "电话",
  665. prop: "corpTel",
  666. span: 8
  667. },
  668. {
  669. label: "订单状态",
  670. prop: "orderStatus",
  671. span: 8,
  672. type: "select",
  673. dicUrl: "/api/blade-system/dict-biz/dictionary?code=order_status",
  674. props: {
  675. label: "dictValue",
  676. value: "dictValue"
  677. }
  678. },
  679. {
  680. label: "公司主体",
  681. prop: "belongToCorpId",
  682. span: 16,
  683. row: true
  684. },
  685. {
  686. label: "起运港",
  687. prop: "portOfLoad",
  688. span: 8,
  689. type: "select",
  690. filterable: true,
  691. rules: [
  692. {
  693. required: true,
  694. message: "",
  695. trigger: "blur"
  696. }
  697. ],
  698. dicData: [],
  699. props: {
  700. label: "name",
  701. value: "name"
  702. }
  703. },
  704. {
  705. label: "目的港",
  706. prop: "portOfDestination",
  707. span: 8,
  708. type: "select",
  709. filterable: true,
  710. rules: [
  711. {
  712. required: true,
  713. message: "",
  714. trigger: "blur"
  715. }
  716. ],
  717. dicData: [],
  718. props: {
  719. label: "name",
  720. value: "name"
  721. }
  722. },
  723. {
  724. label: "运输方式",
  725. prop: "transport",
  726. span: 8,
  727. type: "select",
  728. dicUrl: "/api/blade-system/dict-biz/dictionary?code=mode_transport",
  729. props: {
  730. label: "dictValue",
  731. value: "dictValue"
  732. }
  733. },
  734. {
  735. label: "价格条款",
  736. prop: "priceTerms",
  737. span: 8
  738. // type: "select",
  739. // dicData:[],
  740. // props: {
  741. // label: "dictValue",
  742. // value: "dictValue"
  743. // }
  744. },
  745. {
  746. label: "条款说明",
  747. prop: "priceTermsDescription",
  748. span: 16
  749. },
  750. {
  751. label: "收款方式",
  752. prop: "paymentType",
  753. span: 8
  754. // type: "select",
  755. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=payment_term",
  756. // props: {
  757. // label: "dictValue",
  758. // value: "dictValue"
  759. // }
  760. },
  761. {
  762. label: "收款说明",
  763. prop: "paymentTypeDescription",
  764. span: 16
  765. },
  766. {
  767. label: "报价日期",
  768. prop: "businesDate",
  769. span: 8,
  770. type: "date",
  771. format: "yyyy-MM-dd",
  772. valueFormat: "yyyy-MM-dd 00:00:00",
  773. rules: [
  774. {
  775. required: true,
  776. message: "",
  777. trigger: "blur"
  778. }
  779. ]
  780. },
  781. {
  782. label: "有效日期",
  783. prop: "dateValidity",
  784. span: 8,
  785. type: "date",
  786. format: "yyyy-MM-dd",
  787. valueFormat: "yyyy-MM-dd 00:00:00",
  788. rules: [
  789. {
  790. required: true,
  791. message: "",
  792. trigger: "blur"
  793. }
  794. ]
  795. },
  796. {
  797. label: "报价单号",
  798. prop: "orderNo",
  799. span: 8
  800. },
  801. {
  802. label: "币别",
  803. prop: "currency",
  804. span: 8,
  805. rules: [
  806. {
  807. required: true,
  808. message: "",
  809. trigger: "blur"
  810. }
  811. ]
  812. },
  813. {
  814. label: "汇率",
  815. prop: "exchangeRate",
  816. span: 8,
  817. row: true,
  818. rules: [
  819. {
  820. required: true,
  821. message: "",
  822. trigger: "blur"
  823. }
  824. ]
  825. },
  826. {
  827. label: "箱型",
  828. prop: "boxPile",
  829. span: 8
  830. },
  831. {
  832. label: "箱量",
  833. prop: "boxNumber",
  834. span: 8
  835. },
  836. {
  837. label: "起订量",
  838. prop: "minOrder",
  839. span: 8
  840. },
  841. {
  842. label: "预计海运费",
  843. prop: "predictOceanFreight",
  844. span: 8
  845. },
  846. {
  847. label: "参考海运费",
  848. prop: "referenceOceanFreight",
  849. span: 8
  850. },
  851. {
  852. label: "实际海运费",
  853. prop: "oceanFreight",
  854. span: 8
  855. },
  856. {
  857. label: "产品毛利",
  858. prop: "grossProfit",
  859. span: 8,
  860. disabled: true
  861. },
  862. {
  863. label: "产品利率",
  864. prop: "grossProfitRate",
  865. span: 8,
  866. append: "%",
  867. disabled: true
  868. },
  869. {
  870. label: "单票毛利",
  871. prop: "singleTicketMargin",
  872. span: 8,
  873. disabled: true
  874. },
  875. {
  876. label: "备注",
  877. prop: "orderRemark",
  878. type: "textarea",
  879. minRows: 2,
  880. span: 8
  881. },
  882. {
  883. label: "采购备注",
  884. prop: "purchaseRemark",
  885. type: "textarea",
  886. minRows: 2,
  887. span: 8
  888. },
  889. {
  890. label: "船务备注",
  891. prop: "shippingRemark",
  892. type: "textarea",
  893. minRows: 2,
  894. span: 8
  895. }
  896. ]
  897. },
  898. treeOption: {
  899. nodeKey: "id",
  900. lazy: true,
  901. treeLoad: function(node, resolve) {
  902. const parentId = node.level === 0 ? 0 : node.data.id;
  903. getDeptLazyTree(parentId).then(res => {
  904. resolve(
  905. res.data.data.map(item => {
  906. return {
  907. ...item,
  908. leaf: !item.hasChildren
  909. };
  910. })
  911. );
  912. });
  913. },
  914. addBtn: false,
  915. menu: false,
  916. size: "small",
  917. props: {
  918. label: "title",
  919. value: "value",
  920. children: "children"
  921. }
  922. },
  923. page: {
  924. pageSize: 10,
  925. currentPage: 1,
  926. total: 0
  927. },
  928. goodsOption: {},
  929. data: [],
  930. goodsList: [],
  931. selectionList: [],
  932. treeDeptId: null,
  933. orderFeesList: [],
  934. orderFilesList: [],
  935. oldform: {
  936. orderStatus: "录入",
  937. businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00",
  938. currency: "USD"
  939. },
  940. olddata: [],
  941. oldorderFeesList: [],
  942. oldorderFilesList: [],
  943. reData: null,
  944. loading: false,
  945. subLoading: false,
  946. pageLoading: false,
  947. showBut: true,
  948. partList: [],
  949. goodsoptions: [],
  950. priceTermsList: [],
  951. paymentTermList: [],
  952. currencyList: [],
  953. corpsattns: [],
  954. allBoxs: [],
  955. search: {}
  956. };
  957. },
  958. props: {
  959. detailData: {
  960. type: Object
  961. }
  962. },
  963. components: {
  964. reportDialog,
  965. feeInfo,
  966. customerDialog,
  967. partDialog,
  968. priceLibrary,
  969. propertyDialog
  970. },
  971. async created() {
  972. if (this.detailData.id) {
  973. this.getDetail(this.detailData.id);
  974. }
  975. this.tableOption = await this.getColumnData(
  976. this.getColumnName(1),
  977. tableOption
  978. );
  979. // console.log(JSON.stringify('(<el-button type="primary" icon="el-icon-circle-plus" circle size="small" onClick={() => this.$refs.crudBox.rowCellAdd()}></el-button>)'))
  980. this.goodsOption = await this.getColumnData(
  981. this.getColumnName(26),
  982. goodsOption
  983. );
  984. if (this.detailData.status == 1) {
  985. this.option.disabled = true;
  986. }
  987. if (localStorage.getItem("roleName") == "贸易") {
  988. this.findObject(this.tableOption.column, "purchaseCost").hide = true;
  989. this.findObject(
  990. this.tableOption.column,
  991. "purchaseCost"
  992. ).showColumn = false;
  993. }
  994. this.getWorkDicts("product_properties").then(res => {
  995. this.findObject(this.tableOption.column, "itemProp").dicData =
  996. res.data.data;
  997. });
  998. this.getWorkDicts("unit").then(res => {
  999. this.findObject(this.tableOption.column, "unit").dicData = res.data.data;
  1000. });
  1001. this.getWorkDicts("pricing_terms").then(res => {
  1002. this.priceTermsList = res.data.data;
  1003. });
  1004. this.getWorkDicts("payment_term").then(res => {
  1005. this.paymentTermList = res.data.data;
  1006. });
  1007. this.getWorkDicts("currency").then(res => {
  1008. this.currencyList = res.data.data;
  1009. if (!this.detailData.id) {
  1010. this.currencyList.forEach(e => {
  1011. if (e.dictValue == "USD") {
  1012. this.form.exchangeRate = e.remark;
  1013. this.oldform.exchangeRate = e.remark;
  1014. this.oldExchange = e.remark;
  1015. }
  1016. });
  1017. }
  1018. });
  1019. getPorts().then(res => {
  1020. this.findObject(this.option.column, "portOfLoad").dicData = res.data;
  1021. this.findObject(this.option.column, "portOfDestination").dicData =
  1022. res.data;
  1023. });
  1024. getAllBoxs().then(res => {
  1025. this.allBoxs = res.data.data;
  1026. });
  1027. getGoods(1, 10).then(res => {
  1028. if (res.data.data.total > 0) {
  1029. this.goodsoptions = res.data.data.records;
  1030. if (Math.ceil(res.data.data.total / 10) > 1) {
  1031. for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
  1032. getGoods(i, 10).then(e => {
  1033. this.goodsoptions = this.goodsoptions.concat(e.data.data.records);
  1034. });
  1035. }
  1036. }
  1037. }
  1038. });
  1039. },
  1040. filters: {
  1041. isDiscount(val) {
  1042. return isDiscount(val);
  1043. },
  1044. isPercentage(val) {
  1045. return isPercentage(val);
  1046. },
  1047. micrometerFormat(val) {
  1048. return micrometerFormat(val);
  1049. },
  1050. IntegerFormat(num) {
  1051. return IntegerFormat(num);
  1052. }
  1053. },
  1054. methods: {
  1055. cellStyle() {
  1056. return "padding:0;height:40px;";
  1057. },
  1058. copyDoc() {
  1059. this.$emit("copyOrder", this.form.id);
  1060. },
  1061. getCorpData(row) {
  1062. this.form.corpAttn = null;
  1063. this.form.corpTel = null;
  1064. this.form.coefficient = row.coefficient;
  1065. if (this.data.length > 0) {
  1066. this.data.forEach(e => {
  1067. e.productPrice = productCal(
  1068. e.purchaseAmount,
  1069. e.partsPrice,
  1070. this.form.coefficient
  1071. );
  1072. e.price = sellingCal(e.productPrice, this.form.exchangeRate);
  1073. e.amount = amountCal(
  1074. e.price,
  1075. e.orderQuantity,
  1076. e.freight,
  1077. e.insurance,
  1078. e.discount
  1079. );
  1080. e.itemMargin = grossProfitCal(
  1081. e.purchaseAmount,
  1082. e.partsPrice,
  1083. e.price,
  1084. this.form.exchangeRate
  1085. );
  1086. });
  1087. }
  1088. },
  1089. addRow() {
  1090. this.data.push({ $cellEdit: true });
  1091. },
  1092. corpAttnChange() {
  1093. this.corpsattns.forEach(e => {
  1094. if (this.form.corpId == e.pid) {
  1095. this.form.corpTel = e.tel;
  1096. }
  1097. });
  1098. },
  1099. rowCorpData(row) {
  1100. this.data[row.index].corpName = row.code;
  1101. },
  1102. priceTermsChange(row) {
  1103. if (!this.form.priceTermsDescription) {
  1104. if (row == "FOB" || row == "EXW") {
  1105. this.form.priceTermsDescription = this.form.portOfLoad;
  1106. } else {
  1107. this.form.priceTermsDescription = this.form.portOfDestination;
  1108. }
  1109. }
  1110. },
  1111. paymentTypeChange(row) {
  1112. this.paymentTermList.forEach(e => {
  1113. if (row == e.dictValue) {
  1114. this.form.paymentTypeDescription = e.remark;
  1115. }
  1116. });
  1117. },
  1118. addLibrary() {
  1119. if (!this.form.corpId) {
  1120. return this.$message.error("请选择客户名称");
  1121. }
  1122. if (!this.form.currency) {
  1123. return this.$message.error("请选择币别");
  1124. }
  1125. this.$refs.library.init(false);
  1126. },
  1127. cnameChange(row) {
  1128. this.goodsoptions.forEach(e => {
  1129. if (e.id == row.itemId) {
  1130. row.cname = e.cname;
  1131. row.code = e.code;
  1132. row.corpId = e.corpId;
  1133. row.corpName = e.corpCode;
  1134. row.priceCategory = e.goodsTypeName;
  1135. row.itemUrl = e.url;
  1136. row.itemDescription = e.cnameDescription;
  1137. row.unit = e.unit;
  1138. row.purchaseAmount = 0;
  1139. row.productPrice = productCal(
  1140. 0,
  1141. row.partsPrice,
  1142. this.form.coefficient
  1143. );
  1144. row.price = sellingCal(
  1145. productCal(0, row.partsPrice, this.form.coefficient),
  1146. this.form.exchangeRate
  1147. );
  1148. row.amount = amountCal(
  1149. sellingCal(
  1150. productCal(0, row.partsPrice, this.form.coefficient),
  1151. this.form.exchangeRate
  1152. ),
  1153. row.orderQuantity,
  1154. row.freight,
  1155. row.insurance,
  1156. row.discount
  1157. );
  1158. row.itemMargin = grossProfitCal(
  1159. 0,
  1160. row.partsPrice,
  1161. sellingCal(
  1162. productCal(0, row.partsPrice, this.form.coefficient),
  1163. this.form.exchangeRate
  1164. ),
  1165. this.form.exchangeRate
  1166. );
  1167. }
  1168. });
  1169. getPricedetail({ itemId: row.itemId, corpId: row.corpId }).then(res => {
  1170. if (res.data.data) {
  1171. this.goodsoptions.forEach(e => {
  1172. if (e.id == row.itemId) {
  1173. row.purchaseAmount = res.data.data.purchaseAmount;
  1174. row.productPrice = productCal(
  1175. res.data.data.purchaseAmount,
  1176. row.partsPrice,
  1177. this.form.coefficient
  1178. );
  1179. row.price = sellingCal(
  1180. productCal(
  1181. res.data.data.purchaseAmount,
  1182. row.partsPrice,
  1183. this.form.coefficient
  1184. ),
  1185. this.form.exchangeRate
  1186. );
  1187. row.amount = amountCal(
  1188. sellingCal(
  1189. productCal(
  1190. res.data.data.purchaseAmount,
  1191. row.partsPrice,
  1192. this.form.coefficient
  1193. ),
  1194. this.form.exchangeRate
  1195. ),
  1196. row.orderQuantity,
  1197. row.freight,
  1198. row.insurance,
  1199. row.discount
  1200. );
  1201. row.itemMargin = grossProfitCal(
  1202. res.data.data.purchaseAmount,
  1203. row.partsPrice,
  1204. sellingCal(
  1205. productCal(
  1206. res.data.data.purchaseAmount,
  1207. row.partsPrice,
  1208. this.form.coefficient
  1209. ),
  1210. this.form.exchangeRate
  1211. ),
  1212. this.form.exchangeRate
  1213. );
  1214. }
  1215. });
  1216. }
  1217. });
  1218. },
  1219. saveSell() {
  1220. if (!this.form.id) {
  1221. return this.$message.error("此单据没有提交记录,请先提交");
  1222. }
  1223. this.$confirm("是否生成销售单?", {
  1224. confirmButtonText: "确定",
  1225. cancelButtonText: "取消",
  1226. type: "warning"
  1227. }).then(() => {
  1228. saveSell(this.form.id).then(res => {
  1229. if (res.data.code == 200) {
  1230. this.$message.success("生成成功");
  1231. this.getDetail(this.form.id);
  1232. }
  1233. });
  1234. });
  1235. },
  1236. rePick(row, index) {
  1237. this.reData = {
  1238. ...row,
  1239. index: index
  1240. };
  1241. this.newDetails();
  1242. },
  1243. partrePick(row, index) {
  1244. this.partList = row.partsList;
  1245. this.$refs.part.init(index);
  1246. },
  1247. importPart(rows, sum, index) {
  1248. this.data[index].partsList = rows;
  1249. this.data[index].partsPrice = sum;
  1250. // 销售价=(配件采购价格+产品价格)/汇率 *(1+客户FOB系数/100)
  1251. this.data[index].productPrice = productCal(
  1252. this.data[index].purchaseAmount,
  1253. this.data[index].partsPrice,
  1254. this.form.coefficient
  1255. );
  1256. this.data[index].price = sellingCal(
  1257. this.data[index].productPrice,
  1258. this.form.exchangeRate
  1259. );
  1260. this.data[index].amount = amountCal(
  1261. this.data[index].price,
  1262. this.data[index].orderQuantity,
  1263. this.data[index].freight,
  1264. this.data[index].insurance,
  1265. this.data[index].discount
  1266. );
  1267. this.data[index].itemMargin = grossProfitCal(
  1268. this.data[index].purchaseAmount,
  1269. this.data[index].partsPrice,
  1270. this.data[index].price,
  1271. this.form.exchangeRate
  1272. );
  1273. const names = [];
  1274. const namePrices = [];
  1275. let costsSum = 0;
  1276. rows.map(e => {
  1277. if (e.ename) {
  1278. names.push(e.ename);
  1279. }
  1280. namePrices.push((e.goodName ? e.goodName : "") + ":" + e.amout);
  1281. costsSum = costsCal(costsSum, e.partsCost, e.goodNumber);
  1282. });
  1283. this.data[index].partsDescribe = names.join(",");
  1284. this.data[index].partsPriceDescribe = namePrices.join(";");
  1285. this.data[index].partsCost = costsSum;
  1286. this.priceChange(this.data[index]);
  1287. },
  1288. importProperty(row, index) {
  1289. const arr = [];
  1290. for (let key in row) {
  1291. if (row[key]) {
  1292. arr.push(row[key]);
  1293. }
  1294. }
  1295. this.data[index].itemProp = arr.join(",");
  1296. this.data[index].remarksOne = row.remarksOne;
  1297. this.data[index].customTwo = row.customTwo;
  1298. this.data[index].customThree = row.customThree;
  1299. this.data[index].customFour = row.customFour;
  1300. this.data[index].customFive = row.customFive;
  1301. },
  1302. partClosed() {
  1303. this.partList = [];
  1304. },
  1305. rowCell(row, index) {
  1306. if (row.$cellEdit == true) {
  1307. this.$set(row, "$cellEdit", false);
  1308. } else {
  1309. this.$set(row, "$cellEdit", true);
  1310. }
  1311. },
  1312. itemTypeFocus(row) {
  1313. this.itemtypeList = [];
  1314. getSpecification({ goodId: row.itemId }).then(res => {
  1315. const data = res.data.data;
  1316. this.itemtypeList = data.map(item => ({ value: item }));
  1317. });
  1318. },
  1319. purchaseAmountChange(row) {
  1320. row.productPrice = productCal(
  1321. row.purchaseAmount,
  1322. row.partsPrice,
  1323. this.form.coefficient
  1324. );
  1325. row.price = sellingCal(row.productPrice, this.form.exchangeRate);
  1326. row.amount = amountCal(
  1327. row.price,
  1328. row.orderQuantity,
  1329. row.freight,
  1330. row.insurance,
  1331. row.discount
  1332. );
  1333. row.itemMargin = grossProfitCal(
  1334. row.purchaseAmount,
  1335. row.partsPrice,
  1336. row.price,
  1337. this.form.exchangeRate
  1338. );
  1339. },
  1340. priceChange(row) {
  1341. row.amount = amountCal(
  1342. row.price,
  1343. row.orderQuantity,
  1344. row.freight,
  1345. row.insurance,
  1346. row.discount
  1347. );
  1348. row.itemMargin = grossProfitCal(
  1349. row.purchaseAmount,
  1350. row.partsPrice,
  1351. row.price,
  1352. this.form.exchangeRate
  1353. );
  1354. },
  1355. currencyChange(row) {
  1356. this.currencyList.forEach(e => {
  1357. if (e.dictValue == row) {
  1358. this.form.exchangeRate = e.remark;
  1359. }
  1360. });
  1361. if (this.data.length > 0) {
  1362. this.data.forEach(e => {
  1363. e.freight = transformCal(
  1364. e.freight,
  1365. this.oldExchange,
  1366. this.form.exchangeRate
  1367. );
  1368. e.insurance = transformCal(
  1369. e.insurance,
  1370. this.oldExchange,
  1371. this.form.exchangeRate
  1372. );
  1373. e.price = sellingCal(e.productPrice, this.form.exchangeRate);
  1374. e.amount = amountCal(
  1375. e.price,
  1376. e.orderQuantity,
  1377. e.freight,
  1378. e.insurance,
  1379. e.discount
  1380. );
  1381. e.itemMargin = grossProfitCal(
  1382. e.purchaseAmount,
  1383. e.partsPrice,
  1384. e.price,
  1385. this.form.exchangeRate
  1386. );
  1387. e.exchangeRate = this.form.exchangeRate;
  1388. });
  1389. }
  1390. this.oldExchange = this.deepClone(this.form.exchangeRate);
  1391. },
  1392. exchangeRateChange(row) {
  1393. if (this.data.length > 0) {
  1394. this.data.forEach(e => {
  1395. e.freight = transformCal(e.freight, this.oldExchange, row);
  1396. e.insurance = transformCal(e.insurance, this.oldExchange, row);
  1397. e.price = sellingCal(e.productPrice, row);
  1398. e.amount = amountCal(
  1399. e.price,
  1400. e.orderQuantity,
  1401. e.freight,
  1402. e.insurance,
  1403. e.discount
  1404. );
  1405. e.itemMargin = grossProfitCal(
  1406. e.purchaseAmount,
  1407. e.partsPrice,
  1408. e.price,
  1409. this.form.exchangeRate
  1410. );
  1411. e.exchangeRate = this.form.exchangeRate;
  1412. });
  1413. }
  1414. this.oldExchange = this.deepClone(row);
  1415. },
  1416. discountChange(row) {
  1417. if (row.discount >= 10) {
  1418. row.discount = null;
  1419. this.$message.error("请正确输入折扣");
  1420. }
  1421. this.priceChange(row);
  1422. },
  1423. taxRateChange(row) {
  1424. if (row.taxRate > 100) {
  1425. row.taxRate = 0;
  1426. this.$message.error("请正确输入税率");
  1427. }
  1428. },
  1429. saveShipping() {
  1430. if (!this.form.id) {
  1431. return this.$message.error("此单据没有提交记录,请先提交");
  1432. }
  1433. this.$confirm("是否生成船务询价单?", {
  1434. confirmButtonText: "确定",
  1435. cancelButtonText: "取消",
  1436. type: "warning"
  1437. }).then(() => {
  1438. saveShipping(this.form.id).then(res => {
  1439. if (res.data.code == 200) {
  1440. this.$message.success("生成成功");
  1441. }
  1442. });
  1443. });
  1444. },
  1445. savePurchase() {
  1446. if (!this.form.id) {
  1447. return this.$message.error("此单据没有提交记录,请先提交");
  1448. }
  1449. this.$confirm("是否生成采购询价单?", {
  1450. confirmButtonText: "确定",
  1451. cancelButtonText: "取消",
  1452. type: "warning"
  1453. }).then(() => {
  1454. savePurchase(this.form.id).then(res => {
  1455. if (res.data.code == 200) {
  1456. this.$message.success("生成成功");
  1457. }
  1458. });
  1459. });
  1460. },
  1461. rowSave(row) {
  1462. this.$set(row, "$cellEdit", false);
  1463. },
  1464. rowDel(row) {
  1465. this.$confirm("确定删除数据?", {
  1466. confirmButtonText: "确定",
  1467. cancelButtonText: "取消",
  1468. type: "warning"
  1469. }).then(() => {
  1470. if (row.id) {
  1471. delItem(row.id).then(res => {
  1472. this.$message({
  1473. type: "success",
  1474. message: "删除成功!"
  1475. });
  1476. this.data.splice(row.$index, 1);
  1477. });
  1478. } else {
  1479. this.$message({
  1480. type: "success",
  1481. message: "删除成功!"
  1482. });
  1483. this.data.splice(row.$index, 1);
  1484. }
  1485. });
  1486. },
  1487. importGoods() {
  1488. if (this.reData) {
  1489. if (this.selectionList.length != 1) {
  1490. return this.$message.error("重新选择的时候只能选择一条数据");
  1491. } else {
  1492. this.selectionList.forEach(e => {
  1493. this.data.forEach((item, index) => {
  1494. if (index == this.reData.index) {
  1495. item.itemId = e.id;
  1496. item.code = e.code;
  1497. item.cname = e.cname;
  1498. item.ename = e.ename;
  1499. item.corpId = e.corpId;
  1500. item.corpName = e.corpCode;
  1501. item.priceCategory = e.goodsTypeName;
  1502. item.itemUrl = e.url;
  1503. item.itemProp = this.reData.itemProp;
  1504. item.remarksOne = this.reData.remarksOne;
  1505. item.customTwo = this.reData.customTwo;
  1506. item.customThree = this.reData.customThree;
  1507. item.customFour = this.reData.customFour;
  1508. item.customFive = this.reData.customFive;
  1509. item.partsList = this.reData.partsList;
  1510. item.partsPrice = this.reData.partsPrice;
  1511. item.itemDescription = e.cnameDescription;
  1512. item.itemType = this.reData.itemType;
  1513. item.tradeTerms = this.reData.tradeTerms;
  1514. item.partsDescribe = this.reData.partsDescribe;
  1515. item.purchaseCost = 0;
  1516. item.purchaseAmount = 0;
  1517. item.productPrice = productCal(
  1518. 0,
  1519. this.reData.partsPrice,
  1520. this.form.coefficient
  1521. );
  1522. item.price = sellingCal(
  1523. productCal(0, this.reData.partsPrice, this.form.coefficient),
  1524. this.form.exchangeRate
  1525. );
  1526. item.orderQuantity = this.reData.orderQuantity;
  1527. item.insurance = this.reData.insurance;
  1528. item.freight = this.reData.freight;
  1529. item.discount = this.reData.discount;
  1530. item.amount = amountCal(
  1531. sellingCal(
  1532. productCal(
  1533. 0,
  1534. this.reData.partsPrice,
  1535. this.form.coefficient
  1536. ),
  1537. this.form.exchangeRate
  1538. ),
  1539. this.reData.orderQuantity,
  1540. this.reData.freight,
  1541. this.reData.insurance,
  1542. this.reData.discount
  1543. );
  1544. item.taxRate = this.reData.taxRate;
  1545. item.itemMargin = grossProfitCal(
  1546. 0,
  1547. this.reData.partsPrice,
  1548. sellingCal(
  1549. productCal(
  1550. 0,
  1551. this.reData.partsPrice,
  1552. this.form.coefficient
  1553. ),
  1554. this.form.exchangeRate
  1555. ),
  1556. this.form.exchangeRate
  1557. );
  1558. item.unit = e.unit;
  1559. item.remarks = this.reData.remarks;
  1560. item.exchangeRate = this.reData.exchangeRate;
  1561. item.$cellEdit = true;
  1562. }
  1563. });
  1564. });
  1565. }
  1566. } else {
  1567. this.selectionList.forEach(e => {
  1568. this.data.push({
  1569. itemId: e.id,
  1570. code: e.code,
  1571. cname: e.cname,
  1572. ename: e.ename,
  1573. corpId: e.corpId,
  1574. corpName: e.corpCode,
  1575. priceCategory: e.goodsTypeName,
  1576. itemUrl: e.url,
  1577. itemProp: null,
  1578. remarksOne: null,
  1579. customTwo: null,
  1580. customThree: null,
  1581. customFour: null,
  1582. customFive: null,
  1583. itemDescription: e.cnameDescription,
  1584. partsList: [],
  1585. partsPrice: 0,
  1586. itemType: null,
  1587. tradeTerms: null,
  1588. purchaseCost: 0,
  1589. purchaseAmount: 0,
  1590. price: 0,
  1591. orderQuantity: 0,
  1592. insurance: 0,
  1593. freight: 0,
  1594. discount: null,
  1595. amount: 0,
  1596. taxRate: 0,
  1597. unit: e.unit,
  1598. itemMargin: 0,
  1599. remarks: null,
  1600. exchangeRate: this.form.exchangeRate,
  1601. partsDescribe: null,
  1602. $cellEdit: true
  1603. });
  1604. });
  1605. }
  1606. this.dialogVisible = false;
  1607. },
  1608. closeGoods() {
  1609. this.selectionList = [];
  1610. this.treeDeptId = "";
  1611. this.reData = null;
  1612. },
  1613. selectionChange(list) {
  1614. this.selectionList = list;
  1615. },
  1616. rowClick(row) {
  1617. this.$refs.goodsCrud.toggleSelection([this.goodsList[row.$index]]);
  1618. },
  1619. nodeClick(data) {
  1620. this.treeDeptId = data.id;
  1621. this.page.currentPage = 1;
  1622. this.onLoad(this.page);
  1623. },
  1624. searchChange(params, done) {
  1625. this.search = this.deepClone(params);
  1626. this.onLoad(this.page, params);
  1627. done();
  1628. },
  1629. //费用查询
  1630. onLoad(page, params = {}) {
  1631. let obj = this.deepClone(Object.assign(params, this.search));
  1632. this.loading = true;
  1633. getGoods(page.currentPage, page.pageSize, this.treeDeptId, obj)
  1634. .then(res => {
  1635. const data = res.data.data;
  1636. this.page.total = data.total;
  1637. this.goodsList = data.records;
  1638. if (this.page.total) {
  1639. this.goodsOption.height = window.innerHeight - 350;
  1640. }
  1641. })
  1642. .finally(() => {
  1643. this.loading = false;
  1644. });
  1645. },
  1646. importLibray(rows) {
  1647. rows.forEach(e => {
  1648. console.log(e);
  1649. this.data.push({
  1650. itemId: e.itemId,
  1651. code: e.code,
  1652. cname: e.cname,
  1653. ename: e.ename,
  1654. priceCategory: e.goodsTypeName,
  1655. purchaseCost: costCal(e.price, e.taxRate),
  1656. purchaseAmount: e.purchaseAmount,
  1657. itemProp: null,
  1658. remarksOne: null,
  1659. customTwo: null,
  1660. customThree: null,
  1661. customFour: null,
  1662. customFive: null,
  1663. corpId: e.corpId,
  1664. corpName: e.corpCode,
  1665. itemDescription: e.cnameDescription,
  1666. partsList: [],
  1667. partsPrice: 0,
  1668. itemType: e.specs,
  1669. tradeTerms: null,
  1670. productPrice: productCal(e.purchaseAmount, 0, this.form.coefficient),
  1671. price: sellingCal(
  1672. productCal(e.purchaseAmount, 0, this.form.coefficient),
  1673. this.form.exchangeRate
  1674. ),
  1675. orderQuantity: 1,
  1676. insurance: 0,
  1677. freight: 0,
  1678. discount: null,
  1679. amount: sellingCal(
  1680. productCal(e.purchaseAmount, 0, this.form.coefficient),
  1681. this.form.exchangeRate
  1682. ),
  1683. taxRate: 0,
  1684. unit: e.unit,
  1685. itemMargin: grossProfitCal(
  1686. e.purchaseAmount,
  1687. 0,
  1688. sellingCal(
  1689. productCal(e.purchaseAmount, 0, this.form.coefficient),
  1690. this.form.exchangeRate
  1691. ),
  1692. this.form.exchangeRate
  1693. ),
  1694. partsDescribe: null,
  1695. remarks: null,
  1696. exchangeRate: this.form.exchangeRate,
  1697. $cellEdit: true
  1698. });
  1699. });
  1700. },
  1701. //商品明细导入
  1702. newDetails() {
  1703. if (!this.form.corpId) {
  1704. return this.$message.error("请选择客户名称");
  1705. }
  1706. this.dialogVisible = !this.dialogVisible;
  1707. },
  1708. rowAdd() {
  1709. if (!this.form.corpId) {
  1710. return this.$message.error("请选择客户名称");
  1711. }
  1712. this.data.push({ $cellEdit: true });
  1713. },
  1714. getDetail(id) {
  1715. this.loading = true;
  1716. this.showBut = false;
  1717. this.pageLoading = true;
  1718. detail(id)
  1719. .then(res => {
  1720. if (this.detailData.status == "copy") {
  1721. delete res.data.data.id;
  1722. delete res.data.data.sysNo;
  1723. delete res.data.data.orderNo;
  1724. delete res.data.data.orgOrderNo;
  1725. delete res.data.data.createTime;
  1726. delete res.data.data.createUser;
  1727. delete res.data.data.createUserName;
  1728. delete res.data.data.updateTime;
  1729. delete res.data.data.updateUser;
  1730. delete res.data.data.updateUserName;
  1731. delete res.data.data.morderNo;
  1732. delete res.data.data.status;
  1733. delete res.data.data.ifEnquiry;
  1734. delete res.data.data.ifShipping;
  1735. res.data.data.orderStatus = "录入";
  1736. res.data.data.orderItemsList.forEach(e => {
  1737. delete e.id;
  1738. delete e.pid;
  1739. delete e.createTime;
  1740. delete e.createUser;
  1741. delete e.updateTime;
  1742. delete e.updateUser;
  1743. delete e.orgOrderNo;
  1744. delete e.srcId;
  1745. delete e.status;
  1746. delete e.isDeleted;
  1747. });
  1748. res.data.data.orderFeesList.forEach(e => {
  1749. delete e.id;
  1750. delete e.pid;
  1751. delete e.createTime;
  1752. delete e.createUser;
  1753. delete e.updateTime;
  1754. delete e.updateUser;
  1755. delete e.status;
  1756. delete e.isDeleted;
  1757. });
  1758. res.data.data.orderFilesList.forEach(e => {
  1759. delete e.id;
  1760. delete e.pid;
  1761. delete e.createTime;
  1762. delete e.createUser;
  1763. delete e.updateTime;
  1764. delete e.updateUser;
  1765. delete e.status;
  1766. delete e.isDeleted;
  1767. });
  1768. }
  1769. this.form = res.data.data;
  1770. this.data = res.data.data.orderItemsList;
  1771. this.orderFeesList = res.data.data.orderFeesList;
  1772. this.orderFilesList = res.data.data.orderFilesList;
  1773. this.oldform = res.data.data;
  1774. this.olddata = this.deepClone(res.data.data.orderItemsList);
  1775. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  1776. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  1777. this.oldExchange = this.deepClone(this.form.exchangeRate);
  1778. })
  1779. .finally(() => {
  1780. this.loading = false;
  1781. this.showBut = true;
  1782. this.pageLoading = false;
  1783. });
  1784. },
  1785. //修改提交触发
  1786. editCustomer(status) {
  1787. this.$refs["form"].validate((valid, done) => {
  1788. done();
  1789. if (valid) {
  1790. let orderFeesList = this.$refs.feeInfo.submitData();
  1791. let amountSum = 0;
  1792. let reSum = 0;
  1793. let costSum = 0;
  1794. let paySum = 0;
  1795. if (this.data.length > 0) {
  1796. for (let i = 0; i < this.data.length; i++) {
  1797. if (this.data[i].corpId == null) {
  1798. return this.$message.error(`请输入第${i + 1}行的供应商`);
  1799. }
  1800. amountSum = _.add(
  1801. amountSum,
  1802. _.multiply(
  1803. numCal(this.data[i].amount),
  1804. numCal(this.data[i].exchangeRate)
  1805. )
  1806. );
  1807. costSum = _.add(
  1808. costSum,
  1809. _.multiply(
  1810. _.add(
  1811. numCal(this.data[i].purchaseAmount),
  1812. numCal(this.data[i].partsPrice)
  1813. ),
  1814. numCal(this.data[i].orderQuantity)
  1815. )
  1816. );
  1817. }
  1818. this.data.forEach(e => {
  1819. const ename = e.ename ? e.ename : "";
  1820. const itemDescription = e.itemDescription
  1821. ? e.itemDescription
  1822. : "";
  1823. const itemProp = e.itemProp ? e.itemProp : "";
  1824. const partsDescribe = e.partsDescribe ? e.partsDescribe : "";
  1825. e.productRemark =
  1826. ename +
  1827. "\n" +
  1828. itemDescription +
  1829. " " +
  1830. itemProp +
  1831. " " +
  1832. partsDescribe;
  1833. });
  1834. }
  1835. for (let i = 0; i < orderFeesList.length; i++) {
  1836. // if (orderFeesList[i].corpId == null) {
  1837. // return this.$message.error(`请输入第${i + 1}行的结算中心`);
  1838. // }
  1839. if (orderFeesList[i].price == 0) {
  1840. return this.$message.error(`请正确输入第${i + 1}行的销售价`);
  1841. }
  1842. if (orderFeesList[i].orderQuantity == 0) {
  1843. return this.$message.error(`请正确输入第${i + 1}行的数量`);
  1844. }
  1845. if (!orderFeesList[i].currency) {
  1846. return this.$message.error(`请正确选择第${i + 1}行的币别`);
  1847. }
  1848. if (!orderFeesList[i].exchangeRate) {
  1849. return this.$message.error(`请正确输入第${i + 1}行的汇率`);
  1850. }
  1851. if (orderFeesList[i].feesType == 1) {
  1852. reSum = _.add(
  1853. reSum,
  1854. _.multiply(
  1855. numCal(orderFeesList[i].amount),
  1856. numCal(orderFeesList[i].exchangeRate)
  1857. )
  1858. );
  1859. }
  1860. if (orderFeesList[i].feesType == 2) {
  1861. paySum = _.add(
  1862. paySum,
  1863. _.multiply(
  1864. numCal(orderFeesList[i].amount),
  1865. numCal(orderFeesList[i].exchangeRate)
  1866. )
  1867. );
  1868. }
  1869. }
  1870. this.form.singleTicketMargin = STGPCal(
  1871. amountSum,
  1872. reSum,
  1873. costSum,
  1874. paySum
  1875. );
  1876. this.subLoading = true;
  1877. submit({
  1878. ...this.form,
  1879. orderItemsList: this.data,
  1880. orderFeesList: orderFeesList,
  1881. orderFilesList: this.orderFilesList
  1882. })
  1883. .then(res => {
  1884. if (res.data.code == 200) {
  1885. this.$message.success("保存成功");
  1886. this.form = res.data.data;
  1887. this.data = res.data.data.orderItemsList;
  1888. this.orderFeesList = res.data.data.orderFeesList;
  1889. this.orderFilesList = res.data.data.orderFilesList;
  1890. this.oldform = res.data.data;
  1891. this.olddata = this.deepClone(res.data.data.orderItemsList);
  1892. this.oldorderFeesList = this.deepClone(
  1893. res.data.data.orderFeesList
  1894. );
  1895. this.oldorderFilesList = this.deepClone(
  1896. res.data.data.orderFilesList
  1897. );
  1898. this.oldExchange = this.deepClone(this.form.exchangeRate);
  1899. if (status == "goBack") {
  1900. if (this.form.id) {
  1901. this.unLock({
  1902. moduleName: "bj",
  1903. tableName: "business_order",
  1904. billId: this.form.id,
  1905. billNo: this.form.orgOrderNo
  1906. });
  1907. }
  1908. this.$emit("goBack");
  1909. this.leaveDetailsKey(this.$route.name);
  1910. }
  1911. }
  1912. })
  1913. .finally(() => {
  1914. this.subLoading = false;
  1915. });
  1916. } else {
  1917. return false;
  1918. }
  1919. });
  1920. },
  1921. //返回列表
  1922. backToList() {
  1923. let orderFeesList = this.$refs.feeInfo.submitData();
  1924. if (
  1925. contrastObj(this.form, this.oldform) ||
  1926. contrastList(this.data, this.olddata) ||
  1927. contrastList(orderFeesList, this.oldorderFeesList) ||
  1928. contrastList(this.orderFilesList, this.oldorderFilesList)
  1929. ) {
  1930. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  1931. confirmButtonText: "确定",
  1932. cancelButtonText: "取消",
  1933. type: "warning"
  1934. })
  1935. .then(() => {
  1936. this.editCustomer("goBack");
  1937. })
  1938. .catch(() => {
  1939. if (this.form.id) {
  1940. this.unLock({
  1941. moduleName: "bj",
  1942. tableName: "business_order",
  1943. billId: this.form.id,
  1944. billNo: this.form.orgOrderNo
  1945. });
  1946. }
  1947. this.$emit("goBack");
  1948. this.leaveDetailsKey(this.$route.name);
  1949. });
  1950. } else {
  1951. if (this.form.id) {
  1952. this.unLock({
  1953. moduleName: "bj",
  1954. tableName: "business_order",
  1955. billId: this.form.id,
  1956. billNo: this.form.orgOrderNo
  1957. });
  1958. }
  1959. this.$emit("goBack");
  1960. this.leaveDetailsKey(this.$route.name);
  1961. }
  1962. },
  1963. openReport() {
  1964. this.switchDialog = !this.switchDialog;
  1965. },
  1966. openProperty(row, index) {
  1967. this.$refs.property.init(row, index);
  1968. },
  1969. onClose(val) {
  1970. this.switchDialog = val;
  1971. },
  1972. summaryMethod({ columns, data }) {
  1973. const sums = [];
  1974. if (columns.length > 0) {
  1975. columns.forEach((item, index) => {
  1976. sums[0] = "合计";
  1977. if (
  1978. item.property == "orderQuantity" ||
  1979. item.property == "amount" ||
  1980. item.property == "insurance" ||
  1981. item.property == "freight"
  1982. ) {
  1983. let qtySum = 0;
  1984. let amountSum = 0;
  1985. let insuranceSum = 0;
  1986. let freightSum = 0;
  1987. data.forEach(e => {
  1988. qtySum = _.add(qtySum, Number(e.orderQuantity));
  1989. amountSum = _.add(amountSum, Number(e.amount));
  1990. insuranceSum = _.add(insuranceSum, Number(e.insurance));
  1991. freightSum = _.add(freightSum, Number(e.freight));
  1992. });
  1993. //数量总计
  1994. if (item.property == "orderQuantity") {
  1995. sums[index] = qtySum ? qtySum.toFixed(2) : "0.00";
  1996. }
  1997. //金额总计
  1998. if (item.property == "amount") {
  1999. sums[index] = micrometerFormat(amountSum);
  2000. }
  2001. //保险总计
  2002. if (item.property == "insurance") {
  2003. sums[index] = micrometerFormat(insuranceSum);
  2004. }
  2005. //运费总计
  2006. if (item.property == "freight") {
  2007. sums[index] = micrometerFormat(freightSum);
  2008. }
  2009. }
  2010. });
  2011. }
  2012. return sums;
  2013. },
  2014. //费用明细回调
  2015. beforeFinance(feesData, callback) {
  2016. this.advantageProjectData = feesData;
  2017. let params = {};
  2018. //暂时默认通过 之后优化
  2019. params.valid = true;
  2020. params.parentId = this.form.id;
  2021. params.srcOrderno = this.form.orderNo;
  2022. callback(params);
  2023. },
  2024. openEdit() {
  2025. const data = {
  2026. moduleName: "bj",
  2027. tableName: "business_order",
  2028. billId: this.form.id,
  2029. no: localStorage.getItem("browserID"),
  2030. billNo: this.form.orgOrderNo
  2031. };
  2032. this.inDetailsKey(this.$route.name, {
  2033. moduleName: "bj",
  2034. tableName: "business_order",
  2035. billId: this.form.id,
  2036. billNo: this.form.orgOrderNo
  2037. });
  2038. this.checkLock(data).then(res => {
  2039. if (res.data.code == 200) {
  2040. this.onLock(data).then(res => {
  2041. if (res.data.code == 200) {
  2042. this.detailData.status = 2;
  2043. this.option = this.$options.data().option;
  2044. this.$refs.crud.refreshTable();
  2045. }
  2046. });
  2047. }
  2048. });
  2049. },
  2050. async saveColumn() {
  2051. const inSave = await this.saveColumnData(
  2052. this.getColumnName(1),
  2053. this.tableOption
  2054. );
  2055. if (inSave) {
  2056. this.$nextTick(() => {
  2057. this.$refs.crud.doLayout();
  2058. });
  2059. this.$message.success("保存成功");
  2060. //关闭窗口
  2061. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  2062. }
  2063. },
  2064. async resetColumn() {
  2065. this.tableOption = tableOption;
  2066. const inSave = await this.delColumnData(
  2067. this.getColumnName(1),
  2068. tableOption
  2069. );
  2070. if (inSave) {
  2071. this.$nextTick(() => {
  2072. this.$refs.crud.doLayout();
  2073. });
  2074. this.$message.success("重置成功");
  2075. //关闭窗口
  2076. setTimeout(() => {
  2077. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  2078. }, 1000);
  2079. }
  2080. },
  2081. async saveGoodsColumn() {
  2082. const inSave = await this.saveColumnData(
  2083. this.getColumnName(26),
  2084. this.goodsOption
  2085. );
  2086. if (inSave) {
  2087. this.$nextTick(() => {
  2088. this.$refs.goodsCrud.doLayout();
  2089. });
  2090. this.$message.success("保存成功");
  2091. //关闭窗口
  2092. this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
  2093. }
  2094. },
  2095. async resetGoodsColumn() {
  2096. this.goodsOption = goodsOption;
  2097. const inSave = await this.delColumnData(
  2098. this.getColumnName(26),
  2099. goodsOption
  2100. );
  2101. if (inSave) {
  2102. this.$nextTick(() => {
  2103. this.$refs.goodsCrud.doLayout();
  2104. });
  2105. this.$message.success("重置成功");
  2106. //关闭窗口
  2107. setTimeout(() => {
  2108. this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
  2109. }, 1000);
  2110. }
  2111. }
  2112. },
  2113. watch: {
  2114. "form.corpId": function(id) {
  2115. if (id) {
  2116. this.corpsattns = [];
  2117. getCorpsattn({ pid: id }).then(res => {
  2118. this.corpsattns = res.data.data.records;
  2119. });
  2120. }
  2121. }
  2122. }
  2123. };
  2124. </script>
  2125. <style lang="scss" scoped>
  2126. .trading-form ::v-deep .el-form-item {
  2127. margin-bottom: 8px !important;
  2128. }
  2129. ::v-deep .el-form-item__error {
  2130. display: none !important;
  2131. }
  2132. ::v-deep .select-component {
  2133. display: flex !important;
  2134. }
  2135. </style>