detailsPage.vue 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn" v-if="showBut">
  10. <el-button type="primary" size="small" v-if="detailData.status == 1" class="el-button--small-yh "
  11. @click.stop="openEdit">编辑
  12. </el-button>
  13. <el-dropdown style="margin-right: 8px;margin-left: 8px;">
  14. <el-button type="primary" size="small">
  15. 审核处理<i class="el-icon-arrow-down el-icon--right"></i>
  16. </el-button>
  17. <el-dropdown-menu slot="dropdown">
  18. <el-dropdown-item :disabled="form.status > 0" @click.native="pleaseCheck">请核数据</el-dropdown-item>
  19. <el-dropdown-item disabled>审核进度</el-dropdown-item>
  20. <el-dropdown-item disabled>撤销请核</el-dropdown-item>
  21. </el-dropdown-menu>
  22. </el-dropdown>
  23. <el-dropdown style="margin-right: 8px;">
  24. <el-button type="warning" size="small">
  25. 账单处理<i class="el-icon-arrow-down el-icon--right"></i>
  26. </el-button>
  27. <el-dropdown-menu slot="dropdown">
  28. <el-dropdown-item @click.native="generateBill" :disabled="!form.id">生成账单
  29. </el-dropdown-item>
  30. <el-dropdown-item @click.native="viewBill" :disabled="!form.id">查看账单</el-dropdown-item>
  31. </el-dropdown-menu>
  32. </el-dropdown>
  33. <el-dropdown style="margin-right: 8px;">
  34. <el-button type="success" size="small">
  35. 业务处理<i class="el-icon-arrow-down el-icon--right"></i>
  36. </el-button>
  37. <el-dropdown-menu slot="dropdown">
  38. <el-dropdown-item :disabled="!form.id" @click.native="copyDoc">复制单据</el-dropdown-item>
  39. </el-dropdown-menu>
  40. </el-dropdown>
  41. <el-button type="primary" :disabled="disabled" @click="editCustomer" :loading="subLoading"
  42. v-if="detailData.status != 1" size="small">保存数据
  43. </el-button>
  44. </div>
  45. </div>
  46. <div class="customer-main">
  47. <trade-card title="业务进程">
  48. <div class="content" style="height: 10px;">
  49. <div class="content-item">
  50. <div class="card">
  51. <div class="card-content">
  52. <span class="card-content-num selected">{{ form.fudaPurchaseStatus?form.fudaPurchaseStatus:'待采购' }}</span>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="divider"/>
  57. <div class="content-item">
  58. <div class="card">
  59. <div class="card-content">
  60. <span class="card-content-num" :class="form.productionScheduling?'selected':''">{{ form.productionScheduling?form.productionScheduling:'排产中' }}</span>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="divider"/>
  65. <div class="content-item">
  66. <div class="card">
  67. <div class="card-content">
  68. <span class="card-content-num" :class="form.estimateGoodGoods?'selected':''">{{ form.estimateGoodGoods?form.estimateGoodGoods:'预计货好' }}</span>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="divider"/>
  73. <div class="content-item">
  74. <div class="card">
  75. <div class="card-content">
  76. <span class="card-content-num" :class="form.documentaryStatus?'selected':''">{{ form.documentaryStatus?form.documentaryStatus:'待跟单' }}</span>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="divider"/>
  81. <div class="content-item">
  82. <div class="card">
  83. <div class="card-content">
  84. <span class="card-content-num" :class="form.depositReceived?'selected':''">{{ form.depositReceived?form.depositReceived:'定金到账' }}</span>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="divider"/>
  89. <div class="content-item">
  90. <div class="card">
  91. <div class="card-content">
  92. <span class="card-content-num" :class="form.balancePayment?'selected':''">{{ form.balancePayment?form.balancePayment:'尾款' }}</span>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </trade-card>
  98. <trade-card title="基础信息">
  99. <avue-form ref="form" class="trading-form" v-model="form" :option="option">
  100. <template slot="portOfLoad">
  101. <port-info v-model="form.portOfLoad" :disabled="detailData.status == 1"/>
  102. </template>
  103. <template slot="portOfDestination">
  104. <port-info v-model="form.portOfDestination" :disabled="detailData.status == 1"/>
  105. </template>
  106. <template slot-scope="{}" slot="corpIdLabel">
  107. <span style="color: #409EFF;cursor: pointer" @click.stop="khEdit('kh')">客户名称:</span>
  108. </template>
  109. <template slot-scope="{}" slot="belongToCorpIdLabel"> <span style="color: #409EFF;cursor: pointer"
  110. @click.stop="khEdit('GS')">公司主体:</span>
  111. </template>
  112. <template slot-scope="{}" slot="portOfLoadLabel"> <span style="color: #409EFF;cursor: pointer"
  113. @click.stop="khEdit('portOfLoad')">起运港:</span>
  114. </template> <template slot-scope="{}" slot="portOfDestinationLabel"> <span
  115. style="color: #409EFF;cursor: pointer" @click.stop="khEdit('portOfLoad')">目的港:</span> </template>
  116. <template slot="corpId">
  117. <crop-select v-model="form.corpId" @getCorpData="getCorpData" corpType="KH"
  118. :disabled="detailData.status == 1"></crop-select>
  119. </template>
  120. <template slot="belongToCorpId">
  121. <crop-select v-model="form.belongToCorpId" corpType="GS" :disabled="detailData.status == 1"></crop-select>
  122. </template>
  123. <template slot="corpAttn">
  124. <el-select size="small" v-model="form.corpAttn" placeholder="请选择" @change="corpAttnChange" clearable
  125. :disabled="detailData.status == 1">
  126. <el-option v-for="item in corpsattns" :key="item.id" :label="item.cname" :value="item.cname">
  127. </el-option>
  128. </el-select>
  129. </template>
  130. <template slot="priceTerms">
  131. <el-select size="small" v-model="form.priceTerms" placeholder="请选择" @change="priceTermsChange" clearable
  132. :disabled="detailData.status == 1">
  133. <el-option v-for="item in priceTermsList" :key="item.id" :label="item.dictValue" :value="item.dictValue">
  134. </el-option>
  135. </el-select>
  136. </template>
  137. <template slot="paymentType">
  138. <el-select size="small" v-model="form.paymentType" placeholder="请选择" @change="paymentTypeChange" clearable
  139. :disabled="detailData.status == 1">
  140. <el-option v-for="item in paymentTermList" :key="item.id" :label="item.dictValue" :value="item.dictValue">
  141. </el-option>
  142. </el-select>
  143. </template>
  144. <template slot="dateClause">
  145. <el-select size="small" v-model="form.dateClause" placeholder="请选择" @change="dateClauseChange"
  146. :disabled="detailData.status == 1" clearable>
  147. <el-option v-for="item in dateClauseList" :key="item.id" :label="item.dictValue" :value="item.dictValue">
  148. </el-option>
  149. </el-select>
  150. </template>
  151. <template slot="businesDate">
  152. <el-date-picker v-model="form.businesDate" type="date" format="yyyy-MM-dd"
  153. value-format="yyyy-MM-dd 00:00:00" @change="businesDateChange" :disabled="detailData.status == 1">
  154. </el-date-picker>
  155. </template>
  156. <template slot="currency">
  157. <el-select size="small" v-model="form.currency" placeholder="请选择" @change="currencyChange"
  158. :disabled="detailData.status == 1" clearable>
  159. <el-option v-for="item in currencyList" :key="item.id" :label="item" :value="item">
  160. </el-option>
  161. </el-select>
  162. </template>
  163. <template slot="exchangeRate">
  164. <el-input size="small" v-model="form.exchangeRate"
  165. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  166. placeholder="请输入 汇率" :disabled="detailData.status == 1" @change="exchangeRateChange" />
  167. </template>
  168. <template slot="boxPile">
  169. <el-select size="small" v-model="form.boxPile" placeholder="请选择" clearable filterable
  170. :disabled="detailData.status == 1">
  171. <el-option v-for="item in allBoxs" :key="item.id" :label="item.name" :value="item.name">
  172. </el-option>
  173. </el-select>
  174. </template>
  175. <template slot="boxNumber">
  176. <el-input size="mini" v-model="form.boxNumber"
  177. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  178. placeholder="请输入 箱量" :disabled="detailData.status == 1" />
  179. </template>
  180. <template slot="minOrder">
  181. <el-input size="mini" v-model="form.minOrder"
  182. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  183. placeholder="请输入 起订量" :disabled="detailData.status == 1" />
  184. </template>
  185. <template slot="predictOceanFreight">
  186. <el-input size="mini" v-model="form.predictOceanFreight"
  187. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  188. placeholder="请输入 预计海运费" :disabled="detailData.status == 1" />
  189. </template>
  190. <template slot="referenceOceanFreight">
  191. <el-input size="mini" v-model="form.referenceOceanFreight"
  192. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  193. placeholder="请输入 参考海运费" :disabled="detailData.status == 1" />
  194. </template>
  195. <template slot="oceanFreight">
  196. <el-input size="mini" v-model="form.oceanFreight"
  197. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  198. placeholder="请输入 实际海运费" :disabled="detailData.status == 1" />
  199. </template>
  200. <template slot="orderNo">
  201. <el-input size="mini" v-model="form.orderNo" oninput="this.value=this.value.toUpperCase()"
  202. placeholder="请输入 " :disabled="detailData.status == 1" />
  203. </template>
  204. </avue-form>
  205. </trade-card>
  206. <goods-info ref="goodsInfo" :form="form" :data="data" :detailData="detailData" :orderFeesList.sync="orderFeesList"
  207. @formGoodstoFees="formGoodstoFees" @backToList="getDetail"></goods-info>
  208. <!-- <trade-card title="商品信息">
  209. <avue-crud ref="crud" :data="data" :option="tableOption" @row-del="rowDel"
  210. @selection-change="goodsSelectionChange" @saveColumn="saveColumn" @resetColumn="resetColumn"
  211. :summary-method="summaryMethod" :cell-style="cellStyle" @row-dblclick="handleRowDBLClick">
  212. <template slot="menuLeft">
  213. <el-row>
  214. <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newDetails"
  215. :disabled="detailData.status == 1">批量录入</el-button>
  216. <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addLibrary"
  217. :disabled="detailData.status == 1">出口价格库</el-button>
  218. <el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印</el-button>
  219. <el-button type="warning" icon="el-icon-plus" size="small"
  220. :disabled="detailData.status == 1 || orderItemIds.length == 0" @click="getInvoice">生成发货单
  221. </el-button>
  222. <el-button v-if="goodsEditShow && detailData.status != 1" size="small" type="primary" @click="handleSave">
  223. 保存明细</el-button>
  224. <el-button v-if="goodsEditShow" size="small" @click="handleClose">关闭明细</el-button>
  225. <el-button type="info" size="small" @click="cnameData">刷新基础资料</el-button>
  226. </el-row>
  227. <el-row>
  228. <avue-form v-if="goodsEditShow" class="trading-form" v-model="goodsEditForm" :option="goodsEditOption">
  229. <template slot="ename">
  230. <el-input type="textarea" size="small" v-model="goodsEditForm.ename" placeholder="请输入"
  231. :disabled="detailData.status == 1" @change="formEditChange(goodsEditForm)" />
  232. </template>
  233. <template slot="itemProp">
  234. <el-input type="textarea" size="small" v-model="goodsEditForm.itemProp" placeholder="请输入"
  235. :disabled="detailData.status == 1" @change="formEditChange(goodsEditForm)" />
  236. </template>
  237. <template slot="itemDescription">
  238. <el-input type="textarea" size="small" v-model="goodsEditForm.itemDescription" placeholder="请输入"
  239. :disabled="detailData.status == 1" @change="formEditChange(goodsEditForm)" />
  240. </template>
  241. <template slot="partsDescribe">
  242. <el-input type="textarea" size="small" v-model="goodsEditForm.partsDescribe" placeholder="请输入"
  243. :disabled="detailData.status == 1" @change="formEditChange(goodsEditForm)" />
  244. </template>
  245. </avue-form>
  246. </el-row>
  247. </template>
  248. <template slot="headerSerial">
  249. <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
  250. :disabled="detailData.status == 1" circle></el-button>
  251. </template>
  252. <template slot="codeHeader" slot-scope="{column}"> <span style="color: #409EFF;cursor: pointer"
  253. @click.stop="khEdit('cname')">{{column.label}}</span>
  254. </template>
  255. <template slot="cname" slot-scope="{ row, index }">
  256. <span v-if="row.$cellEdit" style="display:flex">
  257. <el-select v-model="row.itemId" placeholder="请选择" size="small" style="width:60%"
  258. @change="cnameChange(row, index)">
  259. <el-option v-for="item in goodsoptions" :key="item.id" :label="item.cname" :value="item.id">
  260. </el-option>
  261. </el-select>
  262. <el-button icon="el-icon-search" size="small" @click="rePick(row, index)"></el-button>
  263. </span>
  264. <span v-else> {{ row.cname }}</span>
  265. </template>
  266. <template slot="ename" slot-scope="{ row, index }">
  267. <el-input v-if="row.$cellEdit" v-model="row.ename" size="small" placeholder="请点击右边按钮"
  268. @change="editChange(row)">
  269. </el-input>
  270. <span v-else>{{ row.ename }}</span>
  271. </template>
  272. <template slot="itemDescription" slot-scope="{ row, index }">
  273. <span v-if="row.$cellEdit" style="display:flex">
  274. <el-input v-model="row.itemDescription" size="small" placeholder="请输入" @change="editChange(row)">
  275. </el-input>
  276. </span>
  277. <span v-else>{{ row.itemDescription }}</span>
  278. </template>
  279. <template slot="partsDescribe" slot-scope="{ row, index }">
  280. <span v-if="row.$cellEdit" style="display:flex">
  281. <el-input v-model="row.partsDescribe" size="small" placeholder="请点击右边按钮" @change="editChange(row)">
  282. </el-input>
  283. <el-button icon="el-icon-edit" size="mini" @click="partrePick(row, index)"></el-button>
  284. </span>
  285. <span v-else>{{ row.partsDescribe }}</span>
  286. </template>
  287. <template slot="itemType" slot-scope="{ row }">
  288. <el-select v-if="row.$cellEdit" v-model="row.itemType" filterable allow-create default-first-option
  289. placeholder="请输入" size="small" @focus="itemTypeFocus(row)">
  290. <el-option v-for="(item, index) in itemtypeList" :key="index" :label="item.value" :value="item.value">
  291. </el-option>
  292. </el-select>
  293. <span v-else>{{ row.itemType }}</span>
  294. </template>
  295. <template slot="itemProp" slot-scope="{ row, index }">
  296. <span v-if="row.$cellEdit" style="display:flex">
  297. <el-input v-model="row.itemProp" size="small" placeholder="请点击右边按钮" @change="editChange(row)"></el-input>
  298. <el-button icon="el-icon-edit" size="mini" @click="openProperty(row, index)"></el-button>
  299. </span>
  300. <span v-else>{{ row.itemProp }}</span>
  301. </template>
  302. <template slot="priorityReferrer" slot-scope="{ row }">
  303. <el-checkbox :disabled="!row.$cellEdit" v-model="row.priorityReferrer" :true-label="1" :false-label="0" />
  304. </template>
  305. <template slot="corpId" slot-scope="{ row }">
  306. <span>{{ row.corpName }}</span>
  307. </template>
  308. <template slot="purchaseCost" slot-scope="{ row }">
  309. <el-input v-if="row.$cellEdit" v-model="row.purchaseCost" size="small" placeholder="请输入"
  310. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"></el-input>
  311. <span v-else>{{ row.purchaseCost | micrometerFormat }}</span>
  312. </template>
  313. <template slot="purchaseAmount" slot-scope="{ row }">
  314. <el-input v-if="row.$cellEdit" v-model="row.purchaseAmount" size="small" placeholder="请输入"
  315. @change="purchaseAmountChange(row)"
  316. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"></el-input>
  317. <span v-else>{{ row.purchaseAmount | micrometerFormat }}</span>
  318. </template>
  319. <template slot="price" slot-scope="{ row }">
  320. <el-input v-if="row.$cellEdit" v-model="row.price" size="small"
  321. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  322. @change="priceChange(row)">
  323. </el-input>
  324. <span v-else>{{ row.price | micrometerFormat }}</span>
  325. </template>
  326. <template slot="amount" slot-scope="{ row }">
  327. <span>{{ row.amount | micrometerFormat }}</span>
  328. </template>
  329. <template slot="orderQuantity" slot-scope="{ row }">
  330. <el-input v-if="row.$cellEdit" v-model="row.orderQuantity" size="small"
  331. oninput='this.value=this.value.replace(/[^(\d)]/g,"")' @change="priceChange(row)"></el-input>
  332. <span v-else>{{ row.orderQuantity | IntegerFormat }}</span>
  333. </template>
  334. <template slot="actualQuantity" slot-scope="{ row }">
  335. <span>{{ row.actualQuantity | IntegerFormat }}</span>
  336. </template>
  337. <template slot="discount" slot-scope="{ row }">
  338. <el-input v-if="row.$cellEdit" v-model="row.discount" size="small"
  339. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  340. @change="discountChange(row)"></el-input>
  341. <span v-else>{{ row.discount | isDiscount }}</span>
  342. </template>
  343. <template slot="insurance" slot-scope="{ row }">
  344. <el-input v-if="row.$cellEdit" v-model="row.insurance" size="small"
  345. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  346. @change="priceChange(row)">
  347. </el-input>
  348. <span v-else>{{ row.insurance | micrometerFormat }}</span>
  349. </template>
  350. <template slot="freight" slot-scope="{ row }">
  351. <el-input v-if="row.$cellEdit" v-model="row.freight" size="small"
  352. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  353. @change="priceChange(row)">
  354. </el-input>
  355. <span v-else>{{ row.freight | micrometerFormat }}</span>
  356. </template>
  357. <template slot="taxRate" slot-scope="{ row }">
  358. <el-input v-if="row.$cellEdit" v-model="row.taxRate" size="small"
  359. oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  360. @change="taxRateChange(row)"></el-input>
  361. <span v-else>{{ row.taxRate | isPercentage }}</span>
  362. </template>
  363. <template slot="itemMargin" slot-scope="{ row }">
  364. <span>{{ row.itemMargin | isPercentage }}</span>
  365. </template>
  366. <template slot="menu" slot-scope="{ row, index }">
  367. <div style="display:flex;justify-content: center;">
  368. <el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)"
  369. :disabled="disabled || detailData.status == 1">{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
  370. <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
  371. :disabled="detailData.status == 1">删除</el-button>
  372. <div v-if="!goodsEditShow"
  373. style="display:flex;flex-direction: column;justify-content: center;margin-left: 10px;">
  374. <el-tooltip effect="dark" content="向上移动" placement="top">
  375. <i v-if="index != 0" :disabled="detailData.status == 1" class="el-icon-arrow-up"
  376. @click="moveUp(row, index)" style="color:#409EFF;"></i>
  377. </el-tooltip>
  378. <el-tooltip effect="dark" content="向下移动" placement="bottom"> <i v-if="index != (data.length - 1)"
  379. :disabled="detailData.status == 1" class="el-icon-arrow-down" @click="moveDown(row, index)"
  380. style="color:#409EFF;"></i></el-tooltip>
  381. </div>
  382. </div>
  383. </template>
  384. </avue-crud>
  385. </trade-card> -->
  386. <fee-info ref="feeInfo" :tabShow="1" :orderFeesList="orderFeesList" :disabled="detailData.status == 1"
  387. feeUrl="/blade-purchase-sales/orderfees/update" optionType="CK" itemType="销售" @beforeFinance="beforeFinance"
  388. :inCropId="true" />
  389. <containerTitle title="合同附件"></containerTitle>
  390. <c-upload typeUpload="CK" :data="orderFilesList" :disabled="detailData.status == 1" :enumerationValue="76"
  391. deleteUrl="/blade-purchase-sales/orderfiles/update" />
  392. <div>
  393. <trade-card title="银行信息">
  394. <avue-form class="trading-form" v-model="form" :option="bankOption" />
  395. </trade-card>
  396. </div>
  397. <div>
  398. <trade-card title="保险信息">
  399. <avue-form class="trading-form" v-model="form" :option="insuranceOption" />
  400. </trade-card>
  401. </div>
  402. <div>
  403. <trade-card title="唛头">
  404. <avue-form class="trading-form" v-model="form" :option="markOption" />
  405. </trade-card>
  406. </div>
  407. </div>
  408. <el-dialog title="账单" append-to-body class="el-dialogDeep" :visible.sync="financialAccountDialog" width="60%"
  409. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  410. <financial-account billType="收费" :billData="billData" itemType="销售" @choceFun="choceFun">
  411. </financial-account>
  412. </el-dialog>
  413. <el-dialog title="申请记录" append-to-body class="el-dialogDeep" :visible.sync="applicationDialog" width="60%"
  414. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  415. <bill-application :billId="form.id" @choceApplication="choceApplication">
  416. </bill-application>
  417. </el-dialog>
  418. <el-dialog title="导入商品" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
  419. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close="closeGoods"
  420. top="5vh" v-dialog-drag>
  421. <span>
  422. <el-row>
  423. <el-col :span="4">
  424. <div>
  425. <el-scrollbar>
  426. <basic-container>
  427. <avue-tree :option="treeOption" @node-click="nodeClick" :style="treeStyle" />
  428. </basic-container>
  429. </el-scrollbar>
  430. </div>
  431. </el-col>
  432. <el-col :span="20">
  433. <avue-crud :option="goodsOption" :table-loading="loading" :data="goodsList" ref="goodsCrud"
  434. :search.sync="search" @search-change="searchChange" @refresh-change="refreshChange"
  435. @selection-change="selectionChange" @row-click="rowClick" :page.sync="page" @on-load="onLoad"
  436. @saveColumn="saveGoodsColumn" @resetColumn="resetGoodsColumn" :cell-style="cellStyle"></avue-crud>
  437. </el-col>
  438. </el-row>
  439. </span>
  440. <span slot="footer" class="dialog-footer">
  441. <el-button @click="dialogVisible = false">取 消</el-button>
  442. <el-button type="primary" @click="importGoods" :disabled="selectionList.length == 0">导入</el-button>
  443. </span>
  444. </el-dialog>
  445. <report-dialog :switchDialog="switchDialog" :reportId="form.id" reportName="销售明细(E)" @onClose="onClose()">
  446. </report-dialog>
  447. <part-dialog ref="part" :partList="partList" @importPart="importPart" @partClosed="partClosed" />
  448. <price-library ref="library" @importLibray="importLibray" />
  449. <property-dialog ref="property" @importProperty="importProperty" />
  450. </div>
  451. </template>
  452. <script>
  453. import tableOption from "./config/customerContact.json";
  454. import goodsOption from "./config/commodity.json";
  455. import feeInfo from "@/components/fee-info/main";
  456. import uploadFile from "@/components/upload-file/main";
  457. import {
  458. detail,
  459. submit,
  460. delItem,
  461. getDeptLazyTree,
  462. getGoods,
  463. deliverGoods,
  464. getPorts,
  465. getSpecification,
  466. saveSell,
  467. getPricedetail,
  468. pleaseCheck,
  469. getParities,
  470. getCode, generatePurchaseNews
  471. } from "@/api/basicData/salesContract";
  472. import {
  473. getAllBoxs
  474. } from "@/api/basicData/portinformation";
  475. import _ from "lodash";
  476. import reportDialog from "@/components/report-dialog/main";
  477. import partDialog from "@/components/part-dialog/main";
  478. import {
  479. isDiscount,
  480. isPercentage,
  481. micrometerFormat,
  482. IntegerFormat
  483. } from "@/util/validate";
  484. import {
  485. contrastObj,
  486. contrastList
  487. } from "@/util/contrastData";
  488. import customerDialog from "@/components/customer-dialog/main";
  489. import priceLibrary from "@/components/price-Library/main";
  490. import propertyDialog from "@/components/property-dialog/main";
  491. import {
  492. dateFormat
  493. } from "@/util/date";
  494. import financialAccount from "@/components/finance/financialAccount";
  495. import billApplication from "@/components/bill/billApplication";
  496. import {
  497. productCal,
  498. sellingCal,
  499. amountCal,
  500. transformCal,
  501. grossProfitCal,
  502. STGPCal,
  503. numCal,
  504. costsCal,
  505. costCal,
  506. multiply,
  507. sum,
  508. addPrice
  509. } from "@/util/calculate";
  510. import {
  511. getCorpsattn
  512. } from "@/api/basicData/customerInformation";
  513. import goodsInfo from "./components/goodsInfo.vue";
  514. export default {
  515. name: "detailsPageEdit",
  516. data() {
  517. return {
  518. goodsEditForm: {},
  519. billData: {}, //账单需要数据
  520. corpsattns: [],
  521. financialAccountDialog: false,
  522. applicationDialog: false,
  523. oldExchange: null,
  524. treeStyle: "height:" + (window.innerHeight - 315) + "px",
  525. configuration: {
  526. multipleChoices: false,
  527. multiple: false,
  528. collapseTags: false,
  529. placeholder: "请点击右边按钮选择",
  530. dicData: []
  531. },
  532. switchDialog: false,
  533. form: {
  534. orderStatus: "录入",
  535. cargoType: "普货",
  536. businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00",
  537. currency: "USD"
  538. },
  539. disabled: false,
  540. dialogVisible: false,
  541. tableOption: {},
  542. option: {
  543. menuBtn: false,
  544. labelWidth: 100,
  545. column: [{
  546. label: "客户名称",
  547. prop: "corpId",
  548. rules: [{
  549. required: true,
  550. message: "",
  551. trigger: "blur"
  552. }],
  553. span: 10,
  554. slot: true
  555. },
  556. {
  557. label: "公司主体",
  558. prop: "belongToCorpId",
  559. offset: 2,
  560. span: 6,
  561. rules: [
  562. {
  563. required: true,
  564. message: "",
  565. trigger: "blur"
  566. }
  567. ]
  568. },
  569. {
  570. label: "系统号",
  571. prop: "sysNo",
  572. span: 6,
  573. disabled: true
  574. },
  575. {
  576. label: "详情信息",
  577. prop: "clientMessage",
  578. type: "textarea",
  579. minRows: 2,
  580. span: 10
  581. },
  582. {
  583. label: "预交日期",
  584. prop: "plannedDeliveryDate",
  585. span: 6,
  586. type: "date",
  587. format: "yyyy-MM-dd",
  588. valueFormat: "yyyy-MM-dd 00:00:00",
  589. offset: 2
  590. },
  591. {
  592. label: "销售订单号",
  593. prop: "orderNo",
  594. span: 6
  595. },
  596. {
  597. label: "联系人",
  598. prop: "corpAttn",
  599. span: 5
  600. },
  601. {
  602. label: "电话",
  603. prop: "corpTel",
  604. span: 5
  605. },
  606. {
  607. label: "有效日期",
  608. prop: "dateValidity",
  609. span: 6,
  610. type: "date",
  611. format: "yyyy-MM-dd",
  612. valueFormat: "yyyy-MM-dd 00:00:00",
  613. // row: true,
  614. offset: 2,
  615. rules: [
  616. {
  617. required: true,
  618. message: "",
  619. trigger: "blur"
  620. }
  621. ]
  622. },
  623. {
  624. label: "订单日期",
  625. prop: "businesDate",
  626. span: 6,
  627. rules: [{
  628. required: true,
  629. message: "",
  630. trigger: "blur"
  631. }]
  632. },
  633. {
  634. label: "起运港",
  635. prop: "portOfLoad",
  636. span: 6,
  637. type: "select",
  638. filterable: true,
  639. rules: [{
  640. required: true,
  641. message: "",
  642. trigger: "blur"
  643. }],
  644. dicData: [],
  645. props: {
  646. label: "name",
  647. value: "name"
  648. }
  649. },
  650. {
  651. label: "目的港",
  652. prop: "portOfDestination",
  653. span: 6,
  654. type: "select",
  655. filterable: true,
  656. rules: [{
  657. required: true,
  658. message: "",
  659. trigger: "blur"
  660. }],
  661. dicData: [],
  662. props: {
  663. label: "name",
  664. value: "name"
  665. }
  666. },
  667. {
  668. label: "运输方式",
  669. prop: "transport",
  670. span: 6,
  671. type: "select",
  672. dicUrl: "/api/blade-system/dict-biz/dictionary?code=mode_transport",
  673. props: {
  674. label: "dictValue",
  675. value: "dictValue"
  676. },
  677. row: true,
  678. rules: [
  679. {
  680. required: true,
  681. message: "",
  682. trigger: "blur"
  683. }
  684. ]
  685. },
  686. {
  687. label: "日期条款",
  688. prop: "dateClause",
  689. span: 6,
  690. rules: [
  691. {
  692. required: true,
  693. message: "",
  694. trigger: "blur"
  695. }
  696. ]
  697. },
  698. {
  699. label: "日期说明",
  700. prop: "dateDesc",
  701. type: "textarea",
  702. minRows: 1,
  703. span: 12,
  704. },
  705. {
  706. label: "货物类型",
  707. prop: "cargoType",
  708. span: 6,
  709. type: "select",
  710. dicData: [],
  711. props: {
  712. label: "dictValue",
  713. value: "dictValue"
  714. },
  715. rules: [
  716. {
  717. required: true,
  718. message: "",
  719. trigger: "blur"
  720. }
  721. ]
  722. },
  723. {
  724. label: "价格条款",
  725. prop: "priceTerms",
  726. span: 6,
  727. rules: [
  728. {
  729. required: true,
  730. message: "",
  731. trigger: "blur"
  732. }
  733. ]
  734. },
  735. {
  736. label: "条款说明",
  737. prop: "priceTermsDescription",
  738. type: "textarea",
  739. minRows: 1,
  740. span: 12,
  741. },
  742. {
  743. label: "订单状态",
  744. prop: "orderStatus",
  745. span: 6,
  746. type: "select",
  747. dicUrl: "/api/blade-system/dict-biz/dictionary?code=order_status",
  748. props: {
  749. label: "dictValue",
  750. value: "dictValue"
  751. }
  752. },
  753. {
  754. label: "收款方式",
  755. prop: "paymentType",
  756. span: 6,
  757. rules: [
  758. {
  759. required: true,
  760. message: "",
  761. trigger: "blur"
  762. }
  763. ]
  764. // type: "select",
  765. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=payment_term",
  766. // props: {
  767. // label: "dictValue",
  768. // value: "dictValue"
  769. // }
  770. },
  771. {
  772. label: "收款说明",
  773. prop: "paymentTypeDescription",
  774. type: "textarea",
  775. minRows: 1,
  776. span: 12,
  777. },
  778. {
  779. label: "币别",
  780. prop: "currency",
  781. span: 6,
  782. rules: [{
  783. required: true,
  784. message: "",
  785. trigger: "blur"
  786. }]
  787. },
  788. {
  789. label: "产品毛利",
  790. prop: "grossProfit",
  791. span: 8,
  792. disabled: true
  793. },
  794. {
  795. label: "产品利率",
  796. prop: "grossProfitRate",
  797. span: 8,
  798. append: "%",
  799. disabled: true
  800. },
  801. {
  802. label: "汇率",
  803. prop: "exchangeRate",
  804. span: 8,
  805. row: true,
  806. rules: [{
  807. required: true,
  808. message: "",
  809. trigger: "blur"
  810. }]
  811. }, {
  812. label: "箱型",
  813. prop: "boxPile",
  814. type: "select",
  815. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  816. props: {
  817. label: "dictValue",
  818. value: "dictValue"
  819. },
  820. span: 6,
  821. rules: [
  822. {
  823. required: true,
  824. message: "",
  825. trigger: "blur"
  826. }
  827. ]
  828. }, {
  829. label: "箱量",
  830. prop: "boxNumber",
  831. span: 6,
  832. rules: [
  833. {
  834. required: true,
  835. message: "",
  836. trigger: "blur"
  837. }
  838. ]
  839. }, {
  840. label: "起订量",
  841. prop: "minOrder",
  842. span: 6
  843. }, {
  844. label: "预计海运费",
  845. prop: "predictOceanFreight",
  846. span: 6
  847. },
  848. {
  849. label: "参考海运费",
  850. prop: "referenceOceanFreight",
  851. span: 6
  852. }, {
  853. label: "实际海运费",
  854. prop: "oceanFreight",
  855. span: 6,
  856. // offset: 0,
  857. // row: true
  858. }, {
  859. label: "单票毛利",
  860. prop: "singleTicketMargin",
  861. span: 6,
  862. disabled: true,
  863. row: true
  864. }, {
  865. label: "采购员",
  866. prop: "buyerId",
  867. span: 6,
  868. overHidden: true,
  869. filterable: true,
  870. remote: true,
  871. type: "select",
  872. dicUrl: "/api/blade-user/page?size=20&current=1&realName={{key}}",
  873. props: {
  874. label: "realName",
  875. value: "id",
  876. res: 'data.records'
  877. },
  878. rules: [
  879. {
  880. required: true,
  881. message: "",
  882. trigger: "blur"
  883. }
  884. ]
  885. }, {
  886. label: "跟单员",
  887. prop: "documenterId",
  888. span: 6,
  889. overHidden: true,
  890. filterable: true,
  891. remote: true,
  892. type: "select",
  893. dicUrl: "/api/blade-user/page?size=20&current=1&realName={{key}}",
  894. props: {
  895. label: "realName",
  896. value: "id",
  897. res: 'data.records'
  898. },
  899. rules: [
  900. {
  901. required: true,
  902. message: "",
  903. trigger: "blur"
  904. }
  905. ]
  906. }, {
  907. label: "提单号",
  908. prop: "billLadingNo",
  909. span: 6,
  910. row: true
  911. },
  912. {
  913. label: "备注",
  914. prop: "orderRemark",
  915. type: "textarea",
  916. minRows: 2,
  917. span: 8
  918. },
  919. {
  920. label: "采购备注",
  921. prop: "purchaseRemark",
  922. type: "textarea",
  923. minRows: 2,
  924. span: 8
  925. },
  926. {
  927. label: "船务备注",
  928. prop: "shippingRemark",
  929. type: "textarea",
  930. minRows: 2,
  931. span: 8
  932. }
  933. ]
  934. },
  935. goodsEditShow: false,
  936. goodsEditOption: {
  937. emptyBtn: false,
  938. submitBtn: false,
  939. labelWidth: 100,
  940. column: [{
  941. label: "英文名称",
  942. prop: "ename",
  943. type: "textarea",
  944. minRows: 2,
  945. span: 12,
  946. },
  947. {
  948. label: "产品属性",
  949. prop: "itemProp",
  950. type: "textarea",
  951. minRows: 2,
  952. span: 12,
  953. },
  954. {
  955. label: "产品描述",
  956. prop: "itemDescription",
  957. type: "textarea",
  958. minRows: 2,
  959. span: 12,
  960. },
  961. {
  962. label: "配件信息",
  963. prop: "partsDescribe",
  964. type: "textarea",
  965. minRows: 2,
  966. span: 12,
  967. },
  968. {
  969. label: "商品信息",
  970. prop: "productRemark",
  971. type: "textarea",
  972. minRows: 2,
  973. span: 24,
  974. }
  975. ]
  976. },
  977. treeOption: {
  978. nodeKey: "id",
  979. lazy: true,
  980. treeLoad: function (node, resolve) {
  981. const parentId = node.level === 0 ? 0 : node.data.id;
  982. getDeptLazyTree(parentId).then(res => {
  983. resolve(
  984. res.data.data.map(item => {
  985. return {
  986. ...item,
  987. leaf: !item.hasChildren
  988. };
  989. })
  990. );
  991. });
  992. },
  993. addBtn: false,
  994. menu: false,
  995. size: "small",
  996. props: {
  997. label: "title",
  998. value: "value",
  999. children: "children"
  1000. }
  1001. },
  1002. bankOption: {
  1003. menuBtn: false,
  1004. labelWidth: 100,
  1005. column: [{
  1006. label: "外币银行",
  1007. prop: "banks",
  1008. span: 8
  1009. },
  1010. {
  1011. label: "银行信息",
  1012. prop: "banksAccountName",
  1013. span: 16,
  1014. type: "textarea",
  1015. minRows: 2
  1016. }
  1017. ]
  1018. },
  1019. insuranceOption: {
  1020. menuBtn: false,
  1021. labelWidth: 100,
  1022. column: [{
  1023. label: "保险描述",
  1024. prop: "insuranceRemarks",
  1025. span: 24,
  1026. type: "textarea",
  1027. minRows: 2
  1028. }]
  1029. },
  1030. markOption: {
  1031. menuBtn: false,
  1032. labelWidth: 100,
  1033. column: [{
  1034. label: "唛头描述",
  1035. prop: "marks",
  1036. span: 24,
  1037. type: "textarea",
  1038. minRows: 2
  1039. }]
  1040. },
  1041. page: {
  1042. pageSize: 10,
  1043. currentPage: 1,
  1044. total: 0
  1045. },
  1046. loading: false,
  1047. goodsOption: {},
  1048. data: [],
  1049. goodsList: [],
  1050. selectionList: [],
  1051. treeDeptId: null,
  1052. orderFeesList: [],
  1053. orderFilesList: [],
  1054. orderItemIds: [],
  1055. itemtypeList: [],
  1056. reData: null,
  1057. oldform: {
  1058. orderStatus: "录入",
  1059. cargoType: "普货",
  1060. businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00",
  1061. currency: "USD"
  1062. },
  1063. olddata: [],
  1064. oldorderFeesList: [],
  1065. oldorderFilesList: [],
  1066. subLoading: false,
  1067. pageLoading: false,
  1068. showBut: true,
  1069. partType: false,
  1070. partList: [],
  1071. goodsoptions: [],
  1072. priceTermsList: [],
  1073. paymentTermList: [],
  1074. currencyList: [],
  1075. allBoxs: [],
  1076. search: {},
  1077. dateClauseList: []
  1078. };
  1079. },
  1080. props: {
  1081. detailData: {
  1082. type: Object
  1083. }
  1084. },
  1085. components: {
  1086. reportDialog,
  1087. feeInfo,
  1088. uploadFile,
  1089. customerDialog,
  1090. partDialog,
  1091. priceLibrary,
  1092. propertyDialog,
  1093. financialAccount,
  1094. billApplication,
  1095. goodsInfo
  1096. },
  1097. async created() {
  1098. if (this.detailData.id) {
  1099. this.getDetail(this.detailData.id);
  1100. }
  1101. this.tableOption = await this.getColumnData(
  1102. this.getColumnName(5),
  1103. tableOption
  1104. );
  1105. this.goodsOption = await this.getColumnData(
  1106. this.getColumnName(28),
  1107. goodsOption
  1108. );
  1109. if (this.detailData.status == 1) {
  1110. this.option.disabled = true;
  1111. this.goodsEditOption.disabled = true;
  1112. this.bankOption.disabled = true;
  1113. this.insuranceOption.disabled = true;
  1114. this.markOption.disabled = true;
  1115. }
  1116. if (localStorage.getItem("roleName") == "贸易") {
  1117. this.findObject(this.tableOption.column, "purchaseCost").hide = true;
  1118. this.findObject(
  1119. this.tableOption.column,
  1120. "purchaseCost"
  1121. ).showColumn = false;
  1122. this.findObject(this.option.column, "singleTicketMargin").display = false;
  1123. this.findObject(this.option.column, "oceanFreight").row = true;
  1124. }
  1125. getPorts().then(res => {
  1126. this.findObject(this.option.column, "portOfLoad").dicData = res.data;
  1127. this.findObject(this.option.column, "portOfDestination").dicData =
  1128. res.data;
  1129. });
  1130. this.getWorkDicts("product_properties").then(res => {
  1131. this.findObject(this.tableOption.column, "itemProp").dicData =
  1132. res.data.data;
  1133. });
  1134. this.getWorkDicts("unit").then(res => {
  1135. this.findObject(this.tableOption.column, "unit").dicData = res.data.data;
  1136. });
  1137. this.getWorkDicts("pricing_terms").then(res => {
  1138. this.priceTermsList = res.data.data;
  1139. });
  1140. this.getWorkDicts("payment_term").then(res => {
  1141. this.paymentTermList = res.data.data;
  1142. });
  1143. this.getWorkDicts("date_clause").then(res => {
  1144. this.dateClauseList = res.data.data;
  1145. });
  1146. this.getWorkDicts("cargo_type").then(res => {
  1147. this.findObject(this.option.column, "cargoType").dicData =
  1148. res.data.data;
  1149. });
  1150. getCode().then(res => {
  1151. this.currencyList = res.data.data;
  1152. });
  1153. if (!this.detailData.id) {
  1154. this.getParities();
  1155. }
  1156. // getGoods(1, 10).then(res => {
  1157. // if (res.data.data.total > 0) {
  1158. // this.goodsoptions = res.data.data.records;
  1159. // if (Math.ceil(res.data.data.total / 10) > 1) {
  1160. // for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
  1161. // getGoods(i, 10).then(e => {
  1162. // this.goodsoptions = this.goodsoptions.concat(e.data.data.records);
  1163. // });
  1164. // }
  1165. // }
  1166. // }
  1167. // });
  1168. getAllBoxs().then(res => {
  1169. this.allBoxs = res.data.data;
  1170. });
  1171. },
  1172. filters: {
  1173. isDiscount(val) {
  1174. return isDiscount(val);
  1175. },
  1176. isPercentage(val) {
  1177. return isPercentage(val);
  1178. },
  1179. micrometerFormat(val) {
  1180. return micrometerFormat(val);
  1181. },
  1182. IntegerFormat(num) {
  1183. return IntegerFormat(num);
  1184. }
  1185. },
  1186. methods: {
  1187. cellStyle() {
  1188. return "padding:0;height:40px;";
  1189. },
  1190. formGoodstoFees(rows,type){
  1191. this.$refs.feeInfo.imporData(rows,type)
  1192. },
  1193. khEdit(staus) {
  1194. if (staus == 'kh') {
  1195. if (this.form.corpId) {
  1196. this.$router.push({
  1197. path: '/basicData/customerInformation/index',
  1198. query: {
  1199. corpId: this.form.corpId,
  1200. corpName: this.form.corpName
  1201. }
  1202. })
  1203. } else {
  1204. this.$router.push({
  1205. path: '/basicData/customerInformation/index',
  1206. })
  1207. }
  1208. } else if (staus == 'GS') {
  1209. if (this.form.corpId) {
  1210. this.$router.push({
  1211. path: '/basicData/customerManagement/companyMaterial/index',
  1212. query: {
  1213. corpId: this.form.corpId,
  1214. corpName: this.form.corpName
  1215. }
  1216. })
  1217. } else {
  1218. this.$router.push({
  1219. path: '/basicData/customerManagement/companyMaterial/index'
  1220. })
  1221. }
  1222. } else if (staus == 'portOfLoad') {
  1223. this.$router.push({
  1224. path: '/basicData/portinformation/index'
  1225. })
  1226. } else if (staus == 'cname') {
  1227. this.$router.push({
  1228. path: '/basicData/commodityType/index'
  1229. })
  1230. }
  1231. },
  1232. copyDoc() {
  1233. this.$emit("copyOrder", this.form.id);
  1234. },
  1235. rowCorpData(row) {
  1236. this.data[row.index].corpName = row.code;
  1237. },
  1238. priceTermsChange(row) {
  1239. if (row == "FOB" || row == "EXW") {
  1240. this.form.priceTermsDescription = this.form.portOfLoad;
  1241. } else {
  1242. this.form.priceTermsDescription = this.form.portOfDestination;
  1243. }
  1244. },
  1245. corpAttnChange() {
  1246. this.corpsattns.forEach(e => {
  1247. if (this.form.corpId == e.pid) {
  1248. this.form.corpTel = e.tel;
  1249. }
  1250. });
  1251. },
  1252. paymentTypeChange(row) {
  1253. this.paymentTermList.forEach(e => {
  1254. if (row == e.dictValue) {
  1255. this.form.paymentTypeDescription = e.remark;
  1256. }
  1257. });
  1258. },
  1259. getParities(status) {
  1260. this.oldExchange = this.form.exchangeRate;
  1261. getParities({
  1262. currency: this.form.currency,
  1263. businesDate: this.form.businesDate
  1264. })
  1265. .then(res => {
  1266. const data = res.data.data;
  1267. this.form.exchangeRate = data.receivableParities;
  1268. this.oldform.exchangeRate = data.receivableParities;
  1269. })
  1270. .finally(() => {
  1271. if (this.data.length > 0 && status == "currency") {
  1272. this.data.forEach(e => {
  1273. e.freight = transformCal(
  1274. e.freight,
  1275. this.oldExchange,
  1276. this.form.exchangeRate
  1277. );
  1278. e.insurance = transformCal(
  1279. e.insurance,
  1280. this.oldExchange,
  1281. this.form.exchangeRate
  1282. );
  1283. e.shareAmount = transformCal(e.shareAmount, this.oldExchange, this.form.exchangeRate);
  1284. e.internationalAmount = transformCal(e.internationalAmount, this.oldExchange, this.form.exchangeRate);
  1285. e.outFactoryPrice = sellingCal(e.productPrice, this.form.exchangeRate);
  1286. e.price = addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount);
  1287. e.amount = amountCal(
  1288. e.price,
  1289. e.orderQuantity,
  1290. e.freight,
  1291. e.insurance,
  1292. e.discount
  1293. );
  1294. e.itemMargin = grossProfitCal(
  1295. e.purchaseAmount,
  1296. e.partsPrice,
  1297. e.price,
  1298. this.form.exchangeRate
  1299. );
  1300. e.exchangeRate = this.form.exchangeRate;
  1301. });
  1302. }
  1303. });
  1304. },
  1305. businesDateChange() {
  1306. if (this.form.currency && this.form.businesDate) {
  1307. this.getParities();
  1308. }
  1309. },
  1310. getCorpData(row) {
  1311. this.form.coefficient = row.coefficient;
  1312. this.form.corpsName = row.cname;
  1313. this.form.clientMessage = (row.cname ? row.cname : '') + '\r\n' + (row.addr ? row.addr : '')
  1314. if (this.data.length > 0) {
  1315. this.data.forEach(e => {
  1316. e.productPrice = productCal(
  1317. e.purchaseAmount,
  1318. e.partsPrice,
  1319. this.form.coefficient
  1320. );
  1321. e.price = sellingCal(e.productPrice, this.form.exchangeRate);
  1322. e.amount = amountCal(
  1323. e.price,
  1324. e.orderQuantity,
  1325. e.freight,
  1326. e.insurance,
  1327. e.discount
  1328. );
  1329. e.itemMargin = grossProfitCal(
  1330. e.purchaseAmount,
  1331. e.partsPrice,
  1332. e.price,
  1333. this.form.exchangeRate
  1334. );
  1335. });
  1336. }
  1337. },
  1338. // cnameData() {
  1339. // this.goodsoptions = []
  1340. // getGoods(1, 10).then(res => {
  1341. // if (res.data.data.total > 0) {
  1342. // this.goodsoptions = res.data.data.records;
  1343. // if (Math.ceil(res.data.data.total / 10) > 1) {
  1344. // for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
  1345. // getGoods(i, 10).then(e => {
  1346. // this.goodsoptions = this.goodsoptions.concat(e.data.data.records);
  1347. // });
  1348. // }
  1349. // }
  1350. // }
  1351. // });
  1352. // },
  1353. cnameChange(row) {
  1354. this.goodsoptions.forEach(e => {
  1355. if (e.id == row.itemId) {
  1356. row.cname = e.cname;
  1357. row.code = e.code;
  1358. row.corpId = e.corpId;
  1359. row.corpName = e.corpCode;
  1360. row.priceCategory = e.goodsTypeName;
  1361. row.itemUrl = e.url;
  1362. row.itemDescription = e.cnameDescription;
  1363. row.unit = e.unit;
  1364. row.purchaseAmount = 0;
  1365. row.productPrice = productCal(
  1366. 0,
  1367. row.partsPrice,
  1368. this.form.coefficient
  1369. );
  1370. row.price = sellingCal(
  1371. productCal(0, row.partsPrice, this.form.coefficient),
  1372. this.form.exchangeRate
  1373. );
  1374. row.amount = amountCal(
  1375. sellingCal(
  1376. productCal(0, row.partsPrice, this.form.coefficient),
  1377. this.form.exchangeRate
  1378. ),
  1379. row.orderQuantity,
  1380. row.freight,
  1381. row.insurance,
  1382. row.discount
  1383. );
  1384. row.itemMargin = grossProfitCal(
  1385. 0,
  1386. row.partsPrice,
  1387. sellingCal(
  1388. productCal(0, row.partsPrice, this.form.coefficient),
  1389. this.form.exchangeRate
  1390. ),
  1391. this.form.exchangeRate
  1392. );
  1393. }
  1394. });
  1395. getPricedetail({
  1396. itemId: row.itemId,
  1397. corpId: row.corpId
  1398. }).then(res => {
  1399. if (res.data.data) {
  1400. this.goodsoptions.forEach(e => {
  1401. if (e.id == row.itemId) {
  1402. row.purchaseAmount = res.data.data.purchaseAmount;
  1403. row.productPrice = productCal(
  1404. res.data.data.purchaseAmount,
  1405. row.partsPrice,
  1406. this.form.coefficient
  1407. );
  1408. row.price = sellingCal(
  1409. productCal(
  1410. res.data.data.purchaseAmount,
  1411. row.partsPrice,
  1412. this.form.coefficient
  1413. ),
  1414. this.form.exchangeRate
  1415. );
  1416. row.amount = amountCal(
  1417. sellingCal(
  1418. productCal(
  1419. res.data.data.purchaseAmount,
  1420. row.partsPrice,
  1421. this.form.coefficient
  1422. ),
  1423. this.form.exchangeRate
  1424. ),
  1425. row.orderQuantity,
  1426. row.freight,
  1427. row.insurance,
  1428. row.discount
  1429. );
  1430. row.itemMargin = grossProfitCal(
  1431. res.data.data.purchaseAmount,
  1432. row.partsPrice,
  1433. sellingCal(
  1434. productCal(
  1435. res.data.data.purchaseAmount,
  1436. row.partsPrice,
  1437. this.form.coefficient
  1438. ),
  1439. this.form.exchangeRate
  1440. ),
  1441. this.form.exchangeRate
  1442. );
  1443. }
  1444. });
  1445. }
  1446. });
  1447. },
  1448. addLibrary() {
  1449. if (!this.form.corpId) {
  1450. return this.$message.error("请选择客户名称");
  1451. }
  1452. if (!this.form.currency) {
  1453. return this.$message.error("请选择币别");
  1454. }
  1455. this.$refs.library.init(false);
  1456. },
  1457. handleRowDBLClick(row) {
  1458. if (row.$cellEdit) {
  1459. return this.$message.error("请保存此行内容再操作");
  1460. }
  1461. this.goodsEditShow = true
  1462. this.goodsEditForm = row
  1463. },
  1464. handleSave() {
  1465. this.$set(this.data, this.goodsEditForm.$index, this.goodsEditForm)
  1466. this.goodsEditShow = false
  1467. this.goodsEditForm = this.$options.data().goodsEditForm
  1468. this.editCustomer()
  1469. },
  1470. handleClose() {
  1471. this.goodsEditShow = false
  1472. this.goodsEditForm = this.$options.data().goodsEditForm
  1473. },
  1474. partrePick(row, index) {
  1475. this.partList = row.partsList;
  1476. this.$refs.part.init(index);
  1477. },
  1478. importPart(rows, sum, index) {
  1479. this.data[index].partsList = rows;
  1480. this.data[index].partsPrice = sum;
  1481. // 销售价=(配件采购价格+产品价格)/汇率 *(1+客户FOB系数/100)
  1482. this.data[index].productPrice = productCal(
  1483. this.data[index].purchaseAmount,
  1484. this.data[index].partsPrice,
  1485. this.form.coefficient
  1486. );
  1487. this.data[index].price = sellingCal(
  1488. this.data[index].productPrice,
  1489. this.form.exchangeRate
  1490. );
  1491. this.data[index].amount = amountCal(
  1492. this.data[index].price,
  1493. this.data[index].orderQuantity,
  1494. this.data[index].freight,
  1495. this.data[index].insurance,
  1496. this.data[index].discount
  1497. );
  1498. this.data[index].itemMargin = grossProfitCal(
  1499. this.data[index].purchaseAmount,
  1500. this.data[index].partsPrice,
  1501. this.data[index].price,
  1502. this.form.exchangeRate
  1503. );
  1504. const names = [];
  1505. const namePrices = [];
  1506. let costsSum = 0;
  1507. rows.map(e => {
  1508. if (e.ename) {
  1509. names.push(e.ename);
  1510. }
  1511. namePrices.push((e.goodName ? e.goodName : "") + ":" + e.amout);
  1512. costsSum = costsCal(costsSum, e.partsCost, e.goodNumber);
  1513. });
  1514. this.data[index].partsDescribe = names.join(",");
  1515. this.data[index].partsPriceDescribe = namePrices.join(";");
  1516. this.data[index].partsCost = costsSum;
  1517. this.data[index].productRemark = this.getproductRemark(this.data[index])
  1518. this.priceChange(this.data[index]);
  1519. },
  1520. importProperty(row, index) {
  1521. const arr = [];
  1522. for (let key in row) {
  1523. if (row[key]) {
  1524. arr.push(row[key]);
  1525. }
  1526. }
  1527. this.data[index].itemProp = arr.join(",");
  1528. this.data[index].remarksOne = row.remarksOne;
  1529. this.data[index].customTwo = row.customTwo;
  1530. this.data[index].customThree = row.customThree;
  1531. this.data[index].customFour = row.customFour;
  1532. this.data[index].customFive = row.customFive;
  1533. this.data[index].customSix = row.customSix;
  1534. this.data[index].customSeven = row.customSeven;
  1535. this.data[index].customEight = row.customEight;
  1536. this.data[index].customNine = row.customNine;
  1537. this.data[index].customTen = row.customTen;
  1538. this.data[index].productRemark = this.getproductRemark(this.data[index])
  1539. },
  1540. partClosed() {
  1541. this.partList = [];
  1542. },
  1543. saveSell() {
  1544. if (!this.form.id) {
  1545. return this.$message.error("此单据没有提交记录,请先提交");
  1546. }
  1547. if (!this.form.buyerId){
  1548. return this.$message.error("采购员必填");
  1549. }
  1550. this.$confirm("是否生成采购单?", {
  1551. confirmButtonText: "确定",
  1552. cancelButtonText: "取消",
  1553. type: "warning"
  1554. }).then(() => {
  1555. generatePurchaseNews(this.form.id).then(res => {
  1556. if (res.data.code == 200) {
  1557. this.$message.success("生成成功");
  1558. }
  1559. });
  1560. });
  1561. },
  1562. rePick(row, index) {
  1563. this.reData = {
  1564. ...row,
  1565. index: index
  1566. };
  1567. this.newDetails();
  1568. },
  1569. rowCell(row, index) {
  1570. if (this.goodsEditShow) {
  1571. return this.$message.error('请关闭表格上面的编辑')
  1572. }
  1573. if (row.$cellEdit == true) {
  1574. this.$set(row, "$cellEdit", false);
  1575. } else {
  1576. this.$set(row, "$cellEdit", true);
  1577. }
  1578. },
  1579. itemTypeFocus(row) {
  1580. this.itemtypeList = [];
  1581. getSpecification({
  1582. goodId: row.itemId
  1583. }).then(res => {
  1584. const data = res.data.data;
  1585. this.itemtypeList = data.map(item => ({
  1586. value: item
  1587. }));
  1588. });
  1589. },
  1590. purchaseAmountChange(row) {
  1591. row.productPrice = productCal(
  1592. row.purchaseAmount,
  1593. row.partsPrice,
  1594. this.form.coefficient
  1595. );
  1596. row.price = sellingCal(row.productPrice, this.form.exchangeRate);
  1597. row.amount = amountCal(
  1598. row.price,
  1599. row.orderQuantity,
  1600. row.freight,
  1601. row.insurance,
  1602. row.discount
  1603. );
  1604. row.itemMargin = grossProfitCal(
  1605. row.purchaseAmount,
  1606. row.partsPrice,
  1607. row.price,
  1608. this.form.exchangeRate
  1609. );
  1610. },
  1611. priceChange(row) {
  1612. row.amount = amountCal(
  1613. row.price,
  1614. row.orderQuantity,
  1615. row.freight,
  1616. row.insurance,
  1617. row.discount
  1618. );
  1619. row.itemMargin = grossProfitCal(
  1620. row.purchaseAmount,
  1621. row.partsPrice,
  1622. row.price,
  1623. this.form.exchangeRate
  1624. );
  1625. },
  1626. quantityChange(row) {
  1627. if (Number(row.orderQuantity) < Number(row.actualQuantity)) {
  1628. row.orderQuantity = row.actualQuantity;
  1629. this.$message.error("修改的数量不能低于发货数量");
  1630. }
  1631. if (!row.orderQuantity) {
  1632. row.orderQuantity = 0;
  1633. } else {
  1634. row.amount = amountCal(
  1635. row.price,
  1636. row.orderQuantity,
  1637. row.freight,
  1638. row.insurance,
  1639. row.discount
  1640. );
  1641. }
  1642. },
  1643. currencyChange() {
  1644. if (this.form.currency && this.form.businesDate) {
  1645. this.getParities("currency");
  1646. }
  1647. },
  1648. dateClauseChange(row) {
  1649. this.dateClauseList.forEach(e => {
  1650. if (row == e.dictValue) {
  1651. this.form.dateDesc = e.remark;
  1652. }
  1653. });
  1654. },
  1655. exchangeRateChange(row) {
  1656. if (this.data.length > 0) {
  1657. this.data.forEach(e => {
  1658. e.freight = transformCal(e.freight, this.oldExchange, row);
  1659. e.insurance = transformCal(e.insurance, this.oldExchange, row);
  1660. e.shareAmount = transformCal(e.shareAmount, this.oldExchange, row);
  1661. e.internationalAmount = transformCal(e.internationalAmount, this.oldExchange, row);
  1662. e.outFactoryPrice = sellingCal(e.productPrice, row);
  1663. e.price = addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount);
  1664. e.amount = amountCal(
  1665. e.price,
  1666. e.orderQuantity,
  1667. e.freight,
  1668. e.insurance,
  1669. e.discount
  1670. );
  1671. e.itemMargin = grossProfitCal(
  1672. e.purchaseAmount,
  1673. e.partsPrice,
  1674. e.price,
  1675. this.form.exchangeRate
  1676. );
  1677. e.exchangeRate = this.form.exchangeRate;
  1678. });
  1679. }
  1680. this.oldExchange = this.deepClone(row);
  1681. },
  1682. discountChange(row) {
  1683. if (row.discount >= 10) {
  1684. row.discount = null;
  1685. this.$message.error("请正确输入折扣");
  1686. }
  1687. this.priceChange(row);
  1688. },
  1689. taxRateChange(row) {
  1690. if (Number(row.taxRate) >= 100) {
  1691. row.taxRate = 0;
  1692. this.$message.error("税率不能超过100%");
  1693. }
  1694. },
  1695. rowSave(row) {
  1696. this.$set(row, "$cellEdit", false);
  1697. },
  1698. rowDel(row) {
  1699. this.$confirm("确定删除数据?", {
  1700. confirmButtonText: "确定",
  1701. cancelButtonText: "取消",
  1702. type: "warning"
  1703. }).then(() => {
  1704. if (row.id) {
  1705. delItem(row.id).then(res => {
  1706. this.$message({
  1707. type: "success",
  1708. message: "删除成功!"
  1709. });
  1710. this.data.splice(row.$index, 1);
  1711. });
  1712. } else {
  1713. this.$message({
  1714. type: "success",
  1715. message: "删除成功!"
  1716. });
  1717. this.data.splice(row.$index, 1);
  1718. }
  1719. });
  1720. },
  1721. importGoods() {
  1722. if (this.reData) {
  1723. if (this.selectionList.length != 1) {
  1724. return this.$message.error("重新选择的时候只能选择一条数据");
  1725. } else {
  1726. this.selectionList.forEach(e => {
  1727. this.data.forEach((item, index) => {
  1728. if (index == this.reData.index) {
  1729. item.itemId = e.id;
  1730. item.code = e.code;
  1731. item.cname = e.cname;
  1732. item.ename = e.ename;
  1733. item.corpId = e.corpId;
  1734. item.corpName = e.corpCode;
  1735. item.priceCategory = e.goodsTypeName;
  1736. item.itemUrl = e.url;
  1737. item.itemProp = this.reData.itemProp;
  1738. item.remarksOne = this.reData.remarksOne;
  1739. item.customTwo = this.reData.customTwo;
  1740. item.customThree = this.reData.customThree;
  1741. item.customFour = this.reData.customFour;
  1742. item.customFive = this.reData.customFive;
  1743. item.customSix = this.reData.customSix;
  1744. item.customSeven = this.reData.customSeven;
  1745. item.customEight = this.reData.customEight;
  1746. item.customNine = this.reData.customNine;
  1747. item.customTen = this.reData.customTen;
  1748. item.item.partsList = this.reData.partsList;
  1749. item.partsPrice = this.reData.ppartsPrice;
  1750. item.itemDescription = e.cnameDescription;
  1751. item.itemType = this.reData.itemType;
  1752. item.tradeTerms = this.reData.tradeTerms;
  1753. item.partsDescribe = this.reData.partsDescribe;
  1754. item.attributeList = this.reData.attributeList;
  1755. item.purchaseCost = 0;
  1756. item.purchaseAmount = 0;
  1757. item.productPrice = productCal(
  1758. 0,
  1759. this.reData.partsPrice,
  1760. this.form.coefficient
  1761. );
  1762. item.price = sellingCal(
  1763. productCal(0, this.reData.partsPrice, this.form.coefficient),
  1764. this.form.exchangeRate
  1765. );
  1766. item.orderQuantity = this.reData.orderQuantity;
  1767. item.insurance = this.reData.insurance;
  1768. item.freight = this.reData.freight;
  1769. item.discount = this.reData.discount;
  1770. item.amount = amountCal(
  1771. sellingCal(
  1772. productCal(
  1773. 0,
  1774. this.reData.partsPrice,
  1775. this.form.coefficient
  1776. ),
  1777. this.form.exchangeRate
  1778. ),
  1779. this.reData.orderQuantity,
  1780. this.reData.freight,
  1781. this.reData.insurance,
  1782. this.reData.discount
  1783. );
  1784. item.taxRate = this.reData.taxRate;
  1785. item.itemMargin = grossProfitCal(
  1786. 0,
  1787. this.reData.partsPrice,
  1788. sellingCal(
  1789. productCal(
  1790. 0,
  1791. this.reData.partsPrice,
  1792. this.form.coefficient
  1793. ),
  1794. this.form.exchangeRate
  1795. ),
  1796. this.form.exchangeRate
  1797. );
  1798. item.unit = e.unit;
  1799. item.remarks = this.reData.remarks;
  1800. item.exchangeRate = this.reData.exchangeRate;
  1801. item.productRemark = e.ename + "\n" + (this.reData.itemProp ? this.reData.itemProp : '') +
  1802. " " + (this.reData.itemDescription ? this.reData.itemDescription : '') + " " + (this.reData
  1803. .partsDescribe ? (", " + this.reData.partsDescribe) : ''),
  1804. item.$cellEdit = true;
  1805. }
  1806. });
  1807. });
  1808. }
  1809. } else {
  1810. this.selectionList.forEach(e => {
  1811. this.data.push({
  1812. itemId: e.id,
  1813. code: e.code,
  1814. cname: e.cname,
  1815. ename: e.ename,
  1816. corpId: e.corpId,
  1817. corpName: e.corpCode,
  1818. priceCategory: e.goodsTypeName,
  1819. itemUrl: e.url,
  1820. itemProp: null,
  1821. remarksOne: null,
  1822. customTwo: null,
  1823. customThree: null,
  1824. customFour: null,
  1825. customFive: null,
  1826. customSix: null,
  1827. customSeven: null,
  1828. customEight: null,
  1829. customNine: null,
  1830. customTen: null,
  1831. itemDescription: e.cnameDescription,
  1832. partsList: [],
  1833. partsPrice: 0,
  1834. itemType: null,
  1835. tradeTerms: null,
  1836. price: 0,
  1837. orderQuantity: 0,
  1838. insurance: 0,
  1839. freight: 0,
  1840. discount: null,
  1841. amount: 0,
  1842. taxRate: 0,
  1843. unit: e.unit,
  1844. itemMargin: 0,
  1845. remarks: null,
  1846. purchaseCost: 0,
  1847. purchaseAmount: 0,
  1848. exchangeRate: this.form.exchangeRate,
  1849. partsDescribe: null,
  1850. productRemark: e.ename,
  1851. attributeList: this.getAttribute(e.goodsSpecificationList),
  1852. $cellEdit: true
  1853. });
  1854. this.importPart(this.transition(e.priceBankList), this.partsSum(this.transition(e.priceBankList)), Number(this.data.length - 1))
  1855. });
  1856. }
  1857. this.dialogVisible = false;
  1858. },
  1859. transition(rows) {
  1860. let data = []
  1861. rows.forEach(e => {
  1862. data.push({
  1863. goodId: e.itemId,
  1864. goodTypeId: e.goodTypeId,
  1865. goodTypeName: e.goodsTypeName,
  1866. ename: e.ename,
  1867. corpId: e.corpId,
  1868. corpName: e.corpName,
  1869. goodName: e.cname,
  1870. price: e.purchaseAmount,
  1871. goodNumber: 1,
  1872. amout: e.purchaseAmount,
  1873. partsCost: costCal(e.price, e.taxRate),
  1874. $cellEdit: true
  1875. })
  1876. })
  1877. return data
  1878. },
  1879. partsSum(rows) {
  1880. let qtySum = 0;
  1881. let amountSum = 0;
  1882. let amoutSum = 0;
  1883. rows.forEach(e => {
  1884. qtySum = _.add(qtySum, Number(e.goodNumber));
  1885. amountSum = _.add(amountSum, Number(e.amout));
  1886. amoutSum = Number(amountSum).toFixed(2);
  1887. });
  1888. return amoutSum
  1889. },
  1890. getAttribute(rows) {
  1891. let data = []
  1892. rows.forEach(e => {
  1893. data.push({
  1894. attributeData: JSON.parse(e.attributeData),
  1895. attributeName: e.attributeName,
  1896. attributeNo: e.attributeNo,
  1897. })
  1898. })
  1899. return JSON.stringify(data);
  1900. },
  1901. closeGoods() {
  1902. this.selectionList = [];
  1903. this.treeDeptId = "";
  1904. this.reData = null;
  1905. },
  1906. goodsSelectionChange(list) {
  1907. this.orderItemIds = [];
  1908. list.map(e => {
  1909. this.orderItemIds.push(e.id);
  1910. });
  1911. },
  1912. selectionChange(list) {
  1913. this.selectionList = list;
  1914. },
  1915. rowClick(row) {
  1916. this.$refs.goodsCrud.toggleSelection([this.goodsList[row.$index]]);
  1917. },
  1918. nodeClick(data) {
  1919. this.treeDeptId = data.id;
  1920. this.page.currentPage = 1;
  1921. this.onLoad(this.page);
  1922. },
  1923. searchChange(params, done) {
  1924. this.search = this.deepClone(params);
  1925. this.onLoad(this.page, params);
  1926. done();
  1927. },
  1928. //费用查询
  1929. onLoad(page, params = {}) {
  1930. let obj = this.deepClone(Object.assign(params, this.search));
  1931. this.loading = true;
  1932. getGoods(page.currentPage, page.pageSize, this.treeDeptId, obj).then(
  1933. res => {
  1934. const data = res.data.data;
  1935. this.page.total = data.total;
  1936. this.goodsList = data.records;
  1937. this.loading = false;
  1938. if (this.page.total) {
  1939. this.goodsOption.height = window.innerHeight - 350;
  1940. }
  1941. }
  1942. );
  1943. },
  1944. importLibray(rows) {
  1945. rows.forEach(e => {
  1946. this.data.push({
  1947. itemId: e.itemId,
  1948. code: e.code,
  1949. cname: e.cname,
  1950. ename: e.ename,
  1951. priceCategory: e.goodsTypeName,
  1952. purchaseCost: costCal(e.price, e.taxRate),
  1953. purchaseAmount: e.purchaseAmount,
  1954. itemProp: null,
  1955. remarksOne: null,
  1956. customTwo: null,
  1957. customThree: null,
  1958. customFour: null,
  1959. customFive: null,
  1960. customSix: null,
  1961. customSeven: null,
  1962. customEight: null,
  1963. customNine: null,
  1964. customTen: null,
  1965. corpId: e.corpId,
  1966. corpName: e.corpCode,
  1967. itemDescription: e.cnameDescription,
  1968. partsList: [],
  1969. partsPrice: 0,
  1970. itemType: e.specs,
  1971. tradeTerms: null,
  1972. productPrice: productCal(e.purchaseAmount, 0, this.form.coefficient),
  1973. price: sellingCal(
  1974. productCal(e.purchaseAmount, 0, this.form.coefficient),
  1975. this.form.exchangeRate
  1976. ),
  1977. orderQuantity: 1,
  1978. insurance: 0,
  1979. freight: 0,
  1980. discount: null,
  1981. amount: sellingCal(
  1982. productCal(e.purchaseAmount, 0, this.form.coefficient),
  1983. this.form.exchangeRate
  1984. ),
  1985. taxRate: 0,
  1986. unit: e.unit,
  1987. itemMargin: grossProfitCal(
  1988. e.purchaseAmount,
  1989. 0,
  1990. sellingCal(
  1991. productCal(e.purchaseAmount, 0, this.form.coefficient),
  1992. this.form.exchangeRate
  1993. ),
  1994. this.form.exchangeRate
  1995. ),
  1996. partsDescribe: null,
  1997. remarks: null,
  1998. exchangeRate: this.form.exchangeRate,
  1999. productRemark: e.ename,
  2000. $cellEdit: true
  2001. });
  2002. });
  2003. },
  2004. addRow() {
  2005. this.data.push({
  2006. $cellEdit: true
  2007. });
  2008. },
  2009. //商品明细导入
  2010. newDetails() {
  2011. if (!this.form.corpId) {
  2012. return this.$message.error("请选择客户名称");
  2013. }
  2014. this.dialogVisible = !this.dialogVisible;
  2015. },
  2016. getDetail(id) {
  2017. this.showBut = false;
  2018. this.pageLoading = true;
  2019. detail(id)
  2020. .then(res => {
  2021. if (this.detailData.status == "copy") {
  2022. delete res.data.data.id;
  2023. delete res.data.data.sysNo;
  2024. delete res.data.data.orderNo;
  2025. delete res.data.data.orgOrderNo;
  2026. delete res.data.data.createTime;
  2027. delete res.data.data.createUser;
  2028. delete res.data.data.createUserName;
  2029. delete res.data.data.updateTime;
  2030. delete res.data.data.updateUser;
  2031. delete res.data.data.updateUserName;
  2032. delete res.data.data.morderNo;
  2033. delete res.data.data.status;
  2034. delete res.data.data.ifEnquiry;
  2035. delete res.data.data.ifShipping;
  2036. delete res.data.data.fudaPurchaseStatus;
  2037. delete res.data.data.documentaryStatus;
  2038. res.data.data.orderStatus = "录入";
  2039. res.data.data.cargoType = "普货",
  2040. res.data.data.orderItemsList.forEach(e => {
  2041. delete e.id;
  2042. delete e.pid;
  2043. delete e.createTime;
  2044. delete e.createUser;
  2045. delete e.updateTime;
  2046. delete e.updateUser;
  2047. delete e.orgOrderNo;
  2048. delete e.srcId;
  2049. delete e.status;
  2050. delete e.isDeleted;
  2051. });
  2052. res.data.data.orderFeesList.forEach(e => {
  2053. delete e.id;
  2054. delete e.pid;
  2055. delete e.createTime;
  2056. delete e.createUser;
  2057. delete e.updateTime;
  2058. delete e.updateUser;
  2059. delete e.status;
  2060. delete e.isDeleted;
  2061. });
  2062. res.data.data.orderFilesList.forEach(e => {
  2063. delete e.id;
  2064. delete e.pid;
  2065. delete e.createTime;
  2066. delete e.createUser;
  2067. delete e.updateTime;
  2068. delete e.updateUser;
  2069. delete e.status;
  2070. delete e.isDeleted;
  2071. });
  2072. }
  2073. this.form = res.data.data;
  2074. this.data = res.data.data.orderItemsList;
  2075. this.orderFeesList = res.data.data.orderFeesList;
  2076. this.orderFilesList = res.data.data.orderFilesList;
  2077. this.oldform = res.data.data;
  2078. this.olddata = this.deepClone(res.data.data.orderItemsList);
  2079. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  2080. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  2081. this.oldExchange = this.deepClone(this.form.exchangeRate);
  2082. })
  2083. .finally(() => {
  2084. this.showBut = true;
  2085. this.pageLoading = false;
  2086. });
  2087. },
  2088. getproductRemark(row) {
  2089. const ename = row.ename ? row.ename : "";
  2090. const itemDescription = row.itemDescription ?
  2091. row.itemDescription :
  2092. "";
  2093. const itemProp = row.itemProp ? row.itemProp : "";
  2094. const partsDescribe = row.partsDescribe ? (', ' + row.partsDescribe) : "";
  2095. const productRemark =
  2096. ename +
  2097. "\n" +
  2098. itemProp +
  2099. " " +
  2100. itemDescription +
  2101. " " +
  2102. partsDescribe;
  2103. return productRemark
  2104. },
  2105. formEditChange(row) {
  2106. row.productRemark = this.getproductRemark(row)
  2107. },
  2108. editChange(row) {
  2109. row.productRemark = this.getproductRemark(row)
  2110. },
  2111. //修改提交触发
  2112. editCustomer(status) {
  2113. this.$refs["form"].validate((valid, done) => {
  2114. done();
  2115. if (valid) {
  2116. let amountSum = 0;
  2117. let reSum = 0;
  2118. let costSum = 0;
  2119. let paySum = 0;
  2120. if (this.data.length > 0) {
  2121. for (let i = 0; i < this.data.length; i++) {
  2122. if (this.data[i].corpId == null) {
  2123. return this.$message.error(`请输入第${i + 1}行的供应商`);
  2124. }
  2125. amountSum = _.add(
  2126. amountSum,
  2127. _.multiply(
  2128. numCal(this.data[i].amount),
  2129. numCal(this.data[i].exchangeRate)
  2130. )
  2131. );
  2132. costSum = _.add(
  2133. costSum,
  2134. _.multiply(
  2135. _.add(
  2136. numCal(this.data[i].purchaseAmount),
  2137. numCal(this.data[i].partsPrice)
  2138. ),
  2139. numCal(this.data[i].orderQuantity)
  2140. )
  2141. );
  2142. }
  2143. }
  2144. const orderFeesList = this.$refs.feeInfo.submitData();
  2145. for (let i = 0; i < orderFeesList.length; i++) {
  2146. // if (orderFeesList[i].corpId == null) {
  2147. // return this.$message.error(`请输入第${i + 1}行的结算中心`);
  2148. // }
  2149. if (orderFeesList[i].price == 0) {
  2150. return this.$message.error(`请正确输入第${i + 1}行的价格`);
  2151. }
  2152. if (orderFeesList[i].quantity == 0) {
  2153. return this.$message.error(`请正确输入第${i + 1}行的数量`);
  2154. }
  2155. if (!orderFeesList[i].currency) {
  2156. return this.$message.error(`请正确选择第${i + 1}行的币别`);
  2157. }
  2158. if (!orderFeesList[i].exchangeRate) {
  2159. return this.$message.error(`请正确输入第${i + 1}行的汇率`);
  2160. }
  2161. if (orderFeesList[i].feesType == 1) {
  2162. reSum = _.add(
  2163. reSum,
  2164. _.multiply(
  2165. numCal(orderFeesList[i].amount),
  2166. numCal(orderFeesList[i].exchangeRate)
  2167. )
  2168. );
  2169. }
  2170. if (orderFeesList[i].feesType == 2) {
  2171. paySum = _.add(
  2172. paySum,
  2173. _.multiply(
  2174. numCal(orderFeesList[i].amount),
  2175. numCal(orderFeesList[i].exchangeRate)
  2176. )
  2177. );
  2178. }
  2179. }
  2180. this.form.singleTicketMargin = STGPCal(
  2181. amountSum,
  2182. reSum,
  2183. costSum,
  2184. paySum
  2185. );
  2186. this.form.totalValue = 0
  2187. this.data.forEach((e, index) => {
  2188. e.sort = Number(index) + 1
  2189. this.form.totalValue = sum(multiply(e.outFactoryPrice, e.orderQuantity), this.form.totalValue)
  2190. })
  2191. this.subLoading = true;
  2192. submit({
  2193. ...this.form,
  2194. orderItemsList: this.data,
  2195. orderFeesList: orderFeesList,
  2196. orderFilesList: this.orderFilesList
  2197. })
  2198. .then(res => {
  2199. this.form = res.data.data;
  2200. this.data = res.data.data.orderItemsList;
  2201. this.orderFeesList = res.data.data.orderFeesList;
  2202. this.orderFilesList = res.data.data.orderFilesList;
  2203. this.$message.success("保存成功");
  2204. this.oldform = res.data.data;
  2205. this.olddata = this.deepClone(res.data.data.orderItemsList);
  2206. this.oldorderFeesList = this.deepClone(
  2207. res.data.data.orderFeesList
  2208. );
  2209. this.oldorderFilesList = this.deepClone(
  2210. res.data.data.orderFilesList
  2211. );
  2212. this.oldExchange = this.deepClone(this.form.exchangeRate);
  2213. if (status == "goBack") {
  2214. if (this.form.id) {
  2215. this.unLock({
  2216. moduleName: "xs",
  2217. tableName: "business_order",
  2218. billId: this.form.id,
  2219. billNo: this.form.orgOrderNo
  2220. });
  2221. }
  2222. this.$emit("goBack");
  2223. this.leaveDetailsKey(this.$route.name);
  2224. }
  2225. })
  2226. .finally(() => {
  2227. this.subLoading = false;
  2228. });
  2229. } else {
  2230. return false;
  2231. }
  2232. });
  2233. },
  2234. generateBill() {
  2235. this.financialAccountDialog = true;
  2236. this.billData = {
  2237. srcOrderno: this.form.orgOrderNo,
  2238. itemType: "销售",
  2239. corpsName: this.form.corpName,
  2240. corpId: this.form.corpId,
  2241. srcParentId: this.form.id,
  2242. currency: "CNY",
  2243. exchangeRate: "1",
  2244. taxRate: "0",
  2245. accDate: this.form.businesDate,
  2246. srcType: 1,
  2247. tradeType: "CK",
  2248. optionType: "CK"
  2249. };
  2250. },
  2251. choceFun() {
  2252. this.financialAccountDialog = false;
  2253. },
  2254. viewBill() {
  2255. this.applicationDialog = true;
  2256. },
  2257. //关闭记录
  2258. choceApplication() {
  2259. this.applicationDialog = false;
  2260. },
  2261. // 请核
  2262. pleaseCheck() {
  2263. this.$confirm("您确定提交此次申请吗?", {
  2264. confirmButtonText: "确定",
  2265. cancelButtonText: "取消",
  2266. type: "warning"
  2267. }).then(() => {
  2268. const data = {
  2269. id: this.form.id,
  2270. checkType: "xsqh",
  2271. url: "/exportTrade/salesContract/index",
  2272. pageStatus: "this.$store.getters.xsStatus",
  2273. pageLabel: "销售(E)",
  2274. checkFlag: 2
  2275. };
  2276. pleaseCheck(data).then(res => {
  2277. this.$message.success("请核成功");
  2278. this.getDetail(this.form.id);
  2279. });
  2280. });
  2281. },
  2282. //返回列表
  2283. backToList() {
  2284. let orderFeesList = this.$refs.feeInfo.submitData();
  2285. if (
  2286. contrastObj(this.form, this.oldform) ||
  2287. contrastList(this.data, this.olddata) ||
  2288. contrastList(orderFeesList, this.oldorderFeesList) ||
  2289. contrastList(this.orderFilesList, this.oldorderFilesList)
  2290. ) {
  2291. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  2292. confirmButtonText: "确定",
  2293. cancelButtonText: "取消",
  2294. type: "warning"
  2295. })
  2296. .then(() => {
  2297. this.editCustomer("goBack");
  2298. })
  2299. .catch(() => {
  2300. if (this.form.id) {
  2301. this.unLock({
  2302. moduleName: "xs",
  2303. tableName: "business_order",
  2304. billId: this.form.id,
  2305. billNo: this.form.orgOrderNo
  2306. });
  2307. }
  2308. this.$emit("goBack");
  2309. this.leaveDetailsKey(this.$route.name);
  2310. });
  2311. } else {
  2312. if (this.form.id) {
  2313. this.unLock({
  2314. moduleName: "xs",
  2315. tableName: "business_order",
  2316. billId: this.form.id,
  2317. billNo: this.form.orgOrderNo
  2318. });
  2319. }
  2320. this.$emit("goBack");
  2321. this.leaveDetailsKey(this.$route.name);
  2322. }
  2323. },
  2324. openReport() {
  2325. this.switchDialog = !this.switchDialog;
  2326. },
  2327. openProperty(row, index) {
  2328. this.$refs.property.init(row, index);
  2329. },
  2330. onClose(val) {
  2331. this.switchDialog = val;
  2332. },
  2333. getInvoice() {
  2334. if (this.$store.getters.outStatus) {
  2335. this.$alert("出口跟单存在,请保存发货单再进行操作", "温馨提示", {
  2336. confirmButtonText: "确定",
  2337. type: "warning",
  2338. callback: action => {
  2339. console.log(action);
  2340. }
  2341. });
  2342. } else {
  2343. this.inInvoice();
  2344. }
  2345. },
  2346. inInvoice() {
  2347. const data = {
  2348. id: this.form.id,
  2349. orderItemIds: this.orderItemIds
  2350. };
  2351. deliverGoods(data).then(res => {
  2352. if (res.data.code == 200) {
  2353. this.$message.success("生成成功");
  2354. if (data) {
  2355. const data = res.data.data;
  2356. data.orderItemsList.forEach(e => {
  2357. e.actualQuantity = e.orderQuantity;
  2358. e.contractAmount = e.amount;
  2359. e.srcId = e.id;
  2360. e.specificationAndModel = e.itemType;
  2361. e.productDesc = e.itemDescription;
  2362. e.exRate0 = e.exchangeRate;
  2363. delete e.id;
  2364. delete e.version;
  2365. delete e.status;
  2366. delete e.createUser;
  2367. delete e.createTime;
  2368. delete e.updateUser;
  2369. delete e.updateTime;
  2370. delete e.isDeleted;
  2371. });
  2372. const obj = {
  2373. corpId: data.corpId,
  2374. deliveryStatus: "录入",
  2375. srcOrderNo: data.sysNo,
  2376. orgOrderNo: data.orgOrderNo,
  2377. orderItemsList: data.orderItemsList,
  2378. orderFeesList: data.deliveryFeesList
  2379. };
  2380. this.$router.$avueRouter.closeTag("/exportTrade/invoice/index");
  2381. this.$router.push({
  2382. path: "/exportTrade/invoice/index",
  2383. query: {
  2384. pageType: "Generate",
  2385. data: JSON.stringify(obj)
  2386. }
  2387. });
  2388. }
  2389. }
  2390. });
  2391. },
  2392. //费用明细回调
  2393. beforeFinance(feesData, callback) {
  2394. this.advantageProjectData = feesData;
  2395. let params = {};
  2396. //暂时默认通过 之后优化
  2397. params.valid = true;
  2398. params.parentId = this.form.id;
  2399. params.srcOrderno = this.form.orderNo;
  2400. callback(params);
  2401. },
  2402. openEdit() {
  2403. const data = {
  2404. moduleName: "xs",
  2405. tableName: "business_order",
  2406. billId: this.form.id,
  2407. no: localStorage.getItem("browserID"),
  2408. billNo: this.form.orgOrderNo
  2409. };
  2410. this.inDetailsKey(this.$route.name, {
  2411. moduleName: "xs",
  2412. tableName: "business_order",
  2413. billId: this.form.id,
  2414. billNo: this.form.orgOrderNo
  2415. });
  2416. this.checkLock(data).then(res => {
  2417. if (res.data.code == 200) {
  2418. this.onLock(data).then(res => {
  2419. if (res.data.code == 200) {
  2420. this.detailData.status = 2;
  2421. this.option = this.$options.data().option;
  2422. this.goodsEditOption = this.$options.data().goodsEditOption;
  2423. this.getWorkDicts("cargo_type").then(res => {
  2424. this.findObject(this.option.column, "cargoType").dicData =
  2425. res.data.data;
  2426. });
  2427. // this.$refs.crud.refreshTable();
  2428. this.$refs.goodsInfo.refreshTable();
  2429. }
  2430. });
  2431. }
  2432. });
  2433. },
  2434. async saveColumn() {
  2435. const inSave = await this.saveColumnData(
  2436. this.getColumnName(5),
  2437. this.tableOption
  2438. );
  2439. if (inSave) {
  2440. this.$nextTick(() => {
  2441. this.$refs.crud.doLayout();
  2442. });
  2443. this.$message.success("保存成功");
  2444. //关闭窗口
  2445. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  2446. }
  2447. },
  2448. async resetColumn() {
  2449. this.tableOption = tableOption;
  2450. const inSave = await this.delColumnData(
  2451. this.getColumnName(5),
  2452. tableOption
  2453. );
  2454. if (inSave) {
  2455. this.$nextTick(() => {
  2456. this.$refs.crud.doLayout();
  2457. });
  2458. this.getWorkDicts("cargo_type").then(res => {
  2459. this.findObject(this.tableOption.column, "cargoType").dicData =
  2460. res.data.data;
  2461. });
  2462. this.$message.success("重置成功");
  2463. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  2464. }
  2465. },
  2466. summaryMethod({
  2467. columns,
  2468. data
  2469. }) {
  2470. const sums = [];
  2471. if (columns.length > 0) {
  2472. columns.forEach((item, index) => {
  2473. sums[0] = "合计";
  2474. if (item.property == "orderQuantity" || item.property == "amount") {
  2475. let qtySum = 0;
  2476. let amountSum = 0;
  2477. data.forEach(e => {
  2478. qtySum = _.add(qtySum, Number(e.orderQuantity));
  2479. amountSum = _.add(amountSum, Number(e.amount));
  2480. });
  2481. //数量总计
  2482. if (item.property == "orderQuantity") {
  2483. sums[index] = qtySum ? qtySum.toFixed(2) : "0.00";
  2484. }
  2485. //金额总计
  2486. if (item.property == "amount") {
  2487. sums[index] = micrometerFormat(amountSum);
  2488. }
  2489. }
  2490. });
  2491. }
  2492. return sums;
  2493. },
  2494. moveUp(row, index) {
  2495. this.data[index] = this.data.splice(index - 1, 1, row)[0]
  2496. },
  2497. moveDown(row, index) {
  2498. this.data[index] = this.data.splice(index + 1, 1, row)[0]
  2499. },
  2500. async saveGoodsColumn() {
  2501. const inSave = await this.saveColumnData(
  2502. this.getColumnName(28),
  2503. this.goodsOption
  2504. );
  2505. if (inSave) {
  2506. this.$nextTick(() => {
  2507. this.$refs.goodsCrud.doLayout();
  2508. });
  2509. this.$message.success("保存成功");
  2510. //关闭窗口
  2511. this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
  2512. }
  2513. },
  2514. async resetGoodsColumn() {
  2515. this.goodsOption = goodsOption;
  2516. const inSave = await this.delColumnData(
  2517. this.getColumnName(28),
  2518. goodsOption
  2519. );
  2520. if (inSave) {
  2521. this.$nextTick(() => {
  2522. this.$refs.goodsCrud.doLayout();
  2523. });
  2524. this.$message.success("重置成功");
  2525. //关闭窗口
  2526. setTimeout(() => {
  2527. this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
  2528. }, 1000);
  2529. }
  2530. }
  2531. },
  2532. watch: {
  2533. "form.corpId": function (id) {
  2534. if (id) {
  2535. this.corpsattns = [];
  2536. getCorpsattn({
  2537. pid: id
  2538. }).then(res => {
  2539. this.corpsattns = res.data.data.records;
  2540. });
  2541. }
  2542. }
  2543. }
  2544. };
  2545. </script>
  2546. <style lang="scss" scoped>
  2547. .trading-form ::v-deep .el-form-item {
  2548. margin-bottom: 8px !important;
  2549. }
  2550. ::v-deep .el-form-item__error {
  2551. display: none !important;
  2552. }
  2553. ::v-deep .select-component {
  2554. display: flex !important;
  2555. }
  2556. .divider {
  2557. display: block;
  2558. height: 0px;
  2559. width: 100%;
  2560. border-top: 1px dashed #dcdfe6;
  2561. }
  2562. .content {
  2563. display: flex;
  2564. justify-content: center;
  2565. align-items: center;
  2566. height: 15vh;
  2567. width: 88vw;
  2568. .divider {
  2569. display: block;
  2570. height: 0px;
  2571. width: 100%;
  2572. border-top: 2px dashed #dcdfe6;
  2573. }
  2574. &-item {
  2575. margin-left: 1vw;
  2576. .card {
  2577. width: 130px;
  2578. display: flex;
  2579. align-items: center;
  2580. &-title {
  2581. width: 40px;
  2582. height: 40px;
  2583. text-align: center;
  2584. border-radius: 50%;
  2585. font-size: 20px;
  2586. font-weight: 600;
  2587. display: flex;
  2588. justify-content: center;
  2589. align-items: center;
  2590. span {
  2591. line-height: 20px;
  2592. }
  2593. }
  2594. &-title1 {
  2595. color: #037fe1;
  2596. background-color: rgba(3, 127, 225, 0.15);
  2597. }
  2598. &-title2 {
  2599. color: #ffa21e;
  2600. background-color: rgba(255, 162, 30, 0.15);
  2601. }
  2602. &-title3 {
  2603. color: #fb5b60;
  2604. background-color: rgba(251, 91, 96, 0.15);
  2605. }
  2606. &-title4 {
  2607. color: #42bc6f;
  2608. background-color: rgba(66, 188, 111, 0.15);
  2609. }
  2610. &-title5 {
  2611. color: #14cde1;
  2612. background-color: rgba(52, 149, 161, 0.15);
  2613. }
  2614. &-title6 {
  2615. color: rgba(4, 66, 31, 0.63);
  2616. background-color: rgba(66, 188, 111, 0.15);
  2617. }
  2618. &-content {
  2619. padding-left: 1vw;
  2620. display: flex;
  2621. flex-direction: column;
  2622. &-num {
  2623. font-size: 16px;
  2624. font-weight: 500;
  2625. text-align: center;
  2626. }
  2627. &-text {
  2628. color: #909399;
  2629. }
  2630. }
  2631. }
  2632. }
  2633. }
  2634. .selected{
  2635. color: #1e9fff !important;
  2636. }
  2637. </style>