detailsPage.vue 99 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251
  1. <template>
  2. <div>
  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="goBack(0)">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button size="small" style="margin-right: 8px" :disabled="!form.id"
  11. @click="$refs.report.openDialog()">报表设计
  12. </el-button>
  13. <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
  14. v-if="editButton"
  15. :disabled="showLock || !(roleName.indexOf('admin') != -1 || roleName.indexOf('允许修改他人业务') != -1 || saberUserInfo.user_id == form.createUser)"
  16. @click="inEdit">编 辑
  17. </el-button>
  18. <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
  19. :disabled="isSaveBtn || form.businessStatus != '录入'" @click="submit">保 存
  20. </el-button>
  21. <el-button v-if="form.id" class="el-button--small-yh" style="margin-left: 6px;" type="success"
  22. size="small" :disabled="form.businessStatus != '录入'" @click="application">单据请核
  23. </el-button>
  24. <el-button v-if="form.businessStatus == '提交审核'" class="el-button--small-yh" style="margin-left: 6px;"
  25. type="danger" size="small" @click="revokeApplication">撤销单据请核
  26. </el-button>
  27. <el-dropdown style="line-height: 0">
  28. <el-button class="el-button--small-yh" style="margin-left: 6px;" type="warning" :disabled="!form.id"
  29. size="small">
  30. 审 批<i class="el-icon-arrow-down el-icon--right"></i>
  31. </el-button>
  32. <el-dropdown-menu slot="dropdown">
  33. <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
  34. </el-dropdown-item>
  35. </el-dropdown-menu>
  36. </el-dropdown>
  37. </div>
  38. </div>
  39. <div style="margin-top: 50px">
  40. <trade-card title="基础信息">
  41. <avue-form :option="optionForm" v-model="form" ref="form">
  42. <template slot="corpNameLabel">
  43. <span style="color: #1e9fff;cursor: pointer;" @click="inJump('客户')">客户:</span>
  44. </template>
  45. <template slot="abroadConsignorCnameLabel">
  46. <span style="color: #1e9fff;cursor: pointer;" @click="inJump('客户')">国外发货人:</span>
  47. </template>
  48. <template slot="domesticConsigneeCnameLabel">
  49. <span style="color: #1e9fff;cursor: pointer;" @click="inJump('客户')">国内收货人:</span>
  50. </template>
  51. <template slot="fundingPartyLabel">
  52. <span style="color: #1e9fff;cursor: pointer;" @click="inJump('客户')">资金方:</span>
  53. </template>
  54. <template slot="countryOfOriginLabel">
  55. <span style="color: #1e9fff;cursor: pointer;" @click="inJump('原产地')">原产地:</span>
  56. </template>
  57. <template slot="polCnNameLabel">
  58. <span style="color: #1e9fff;cursor: pointer;" @click="inJump('港口')">起运港:</span>
  59. </template>
  60. <template slot="podCnNameLabel">
  61. <span style="color: #1e9fff;cursor: pointer;" @click="inJump('港口')">目的港:</span>
  62. </template>
  63. <tempalte slot="corpName" slot-scope="{ row }">
  64. <dic-select v-model="form.corpName" placeholder="客户" key="id" label="cnName" res="records"
  65. url="/blade-los/bcorps/listByType" :filterable="true" :remote="true" dataName="cnName"
  66. @selectChange="dicChange('corpName', $event)" :disabled="editDisabled" :searchShow="true"
  67. :treeShow="true"></dic-select>
  68. </tempalte>
  69. <tempalte slot="contractNo" slot-scope="{ row }">
  70. <el-input v-model="form.contractNo" placeholder="请输入 合同号"
  71. :disabled="editDisabled || form.feeCenterListD.length || form.feeCenterListC.length"></el-input>
  72. </tempalte>
  73. <tempalte slot="contractDate" slot-scope="{ row }">
  74. <el-date-picker v-model="form.contractDate" type="date" placeholder="请选择 合同日期"
  75. format="yyyy-MM-dd" valueFormat="yyyy-MM-dd 00:00:00"
  76. :disabled="editDisabled || form.feeCenterListD.length || form.feeCenterListC.length">
  77. </el-date-picker>
  78. </tempalte>
  79. <tempalte slot="prepaidAmount" slot-scope="{ row }">
  80. <el-input v-model="form.prepaidAmount" placeholder="请输入 预付金额"
  81. :disabled="editDisabled || form.feeCenterListD.length || form.feeCenterListC.length"></el-input>
  82. </tempalte>
  83. <tempalte slot="countryOfOrigin" slot-scope="{ row }">
  84. <dic-select v-model="form.countryOfOrigin" placeholder="原产地" key="id" label="cnName"
  85. res="records" url="/blade-los/bcountrys/list" :filterable="true" :remote="true"
  86. dataName="cnName" :disabled="editDisabled"
  87. @selectChange="dicChange('countryOfOrigin', $event)" :searchShow="true"></dic-select>
  88. </tempalte>
  89. <tempalte slot="typeOfShipping" slot-scope="{ row }">
  90. <dic-select v-model="form.typeOfShipping" placeholder="运输方式" key="dictKey" label="dictValue"
  91. url="/blade-system/dict-biz/dictionary?code=mode_transport" :filterable="true"
  92. :disabled="editDisabled"></dic-select>
  93. </tempalte>
  94. <tempalte slot="polCnName" slot-scope="{ row }">
  95. <dic-select v-model="form.polCnName" placeholder="起运港" key="id" label="cnName" res="records"
  96. url="/blade-los/bports/list" :filterable="true" :remote="true" dataName="cnName"
  97. @selectChange="dicChange('polCnName', $event)" :disabled="editDisabled"
  98. :searchShow="true"></dic-select>
  99. </tempalte>
  100. <tempalte slot="podCnName" slot-scope="{ row }">
  101. <dic-select v-model="form.podCnName" placeholder="目的港" key="id" label="cnName" res="records"
  102. url="/blade-los/bports/list" :filterable="true" :remote="true" dataName="cnName"
  103. @selectChange="dicChange('podCnName', $event)" :disabled="editDisabled"
  104. :searchShow="true"></dic-select>
  105. </tempalte>
  106. <tempalte slot="currency" slot-scope="{ row }">
  107. <dic-select v-model="form.currency" placeholder="币别" key="id" label="code" res="records"
  108. url="/blade-los/bcurrency/page" :filterable="true" :disabled="editDisabled"></dic-select>
  109. </tempalte>
  110. <tempalte slot="abroadConsignorCname" slot-scope="{ row }">
  111. <dic-select v-model="form.abroadConsignorCname" placeholder="国外发货人" key="id" label="cnName"
  112. res="records" url="/blade-los/bcorps/listByType?corpTypeName=国外工厂" :filterable="true"
  113. :remote="true" dataName="cnName" @selectChange="dicChange('abroadConsignorCname', $event)"
  114. :disabled="editDisabled" :searchShow="true"></dic-select>
  115. </tempalte>
  116. <tempalte slot="abroadBankMnemonicCode" slot-scope="{ row }">
  117. <dic-select ref="abankCode" v-model="form.abroadBankMnemonicCode" placeholder="银行助记码" key="id"
  118. label="mnemonicCode" res="corpsBankList" url="/blade-los/bcorps/detail"
  119. :activateCreated="false" :filterable="true"
  120. @selectChange="dicChange('abroadBankMnemonicCode', $event)"
  121. :disabled="editDisabled"></dic-select>
  122. </tempalte>
  123. <tempalte slot="abroadCurrency" slot-scope="{ row }">
  124. <dic-select v-model="form.abroadCurrency" placeholder="币别" key="id" label="code" res="records"
  125. url="/blade-los/bcurrency/page" :filterable="true" :disabled="editDisabled"></dic-select>
  126. </tempalte>
  127. <tempalte slot="domesticConsigneeCname" slot-scope="{ row }">
  128. <dic-select v-model="form.domesticConsigneeCname" placeholder="国内收货人" key="id" label="cnName"
  129. res="records" url="/blade-los/bcorps/listByType?corpTypeName=国内贸易商" :filterable="true"
  130. :remote="true" dataName="cnName" @selectChange="dicChange('domesticConsigneeCname', $event)"
  131. :disabled="editDisabled" :searchShow="true"></dic-select>
  132. </tempalte>
  133. <tempalte slot="domesticBankMnemonicCode" slot-scope="{ row }">
  134. <dic-select ref="dbankCode" v-model="form.domesticBankMnemonicCode" placeholder="银行助记码" key="id"
  135. label="mnemonicCode" res="corpsBankList" url="/blade-los/bcorps/detail"
  136. :activateCreated="false" :filterable="true"
  137. @selectChange="dicChange('domesticBankMnemonicCode', $event)"
  138. :disabled="editDisabled"></dic-select>
  139. </tempalte>
  140. <tempalte slot="domesticCurrency" slot-scope="{ row }">
  141. <dic-select v-model="form.domesticCurrency" placeholder="币别" key="id" label="code" res="records"
  142. url="/blade-los/bcurrency/page" :filterable="true" :disabled="editDisabled"></dic-select>
  143. </tempalte>
  144. <tempalte slot="documentType" slot-scope="{ row }">
  145. <dic-select v-model="form.documentType" placeholder="运输方式" key="dictKey" label="dictValue"
  146. url="/blade-system/dict-biz/dictionary?code=business_type" :filterable="true"
  147. :disabled="editDisabled"></dic-select>
  148. </tempalte>
  149. <tempalte slot="affiliatedCompanyName" slot-scope="{ row }">
  150. <dic-select v-model="form.affiliatedCompanyName" placeholder="所属公司" key="id" label="deptName"
  151. url="/blade-system/dept/lazy-list?parentId=0" :filterable="true"
  152. @selectChange="dicChange('affiliatedCompanyName', $event)"
  153. :disabled="editDisabled"></dic-select>
  154. </tempalte>
  155. <tempalte slot="fundingParty" slot-scope="{ row }">
  156. <dic-select v-model="form.fundingParty" placeholder="资金方" key="id" label="cnName" res="records"
  157. url="/blade-los/bcorps/listByType?corpTypeName=客户" :filterable="true" :remote="true"
  158. dataName="cnName" @selectChange="dicChange('fundingParty', $event)" :disabled="editDisabled"
  159. :searchShow="true"></dic-select>
  160. </tempalte>
  161. <tempalte slot="transactionMethod" slot-scope="{ row }">
  162. <dic-select v-model="form.transactionMethod" placeholder="成交方式" key="id" label="cnName"
  163. res="records" url="/blade-los/btrademodes/list" :filterable="true" :remote="true"
  164. dataName="cnName" @selectChange="dicChange('transactionMethod', $event)"
  165. :disabled="editDisabled"></dic-select>
  166. </tempalte>
  167. <tempalte slot="sourceType" slot-scope="{ row }">
  168. <div style="display: flex;">
  169. <dic-select style="margin-right: 4px;" v-model="form.sourceType" placeholder="业务来源"
  170. key="dictKey" keyValue="dictKey" label="dictValue"
  171. url="/blade-system/dict-biz/dictionary?code=source_Type" :filterable="true"
  172. :disabled="editDisabled" @selectChange="dicChange('sourceType', $event)"></dic-select>
  173. <el-input v-show="!form.sourceType" v-model="form.salesmanName" placeholder="请选择"
  174. :disabled="true">
  175. </el-input>
  176. <dic-select v-show="form.sourceType == 'OWN'" v-model="form.salesmanName" placeholder="所属公司"
  177. key="id" label="deptName" url="/blade-system/dept/lazy-list?parentId=0"
  178. :filterable="true" @selectChange="dicChange('salesmanName', $event)"
  179. :disabled="editDisabled"></dic-select>
  180. <dic-select v-show="form.sourceType == 'AGENT'" v-model="form.salesmanName" placeholder="代理"
  181. key="id" label="cnName" res="records"
  182. url="/blade-los/bcorps/listByType?corpTypeName=代理客户" :filterable="true" :remote="true"
  183. dataName="cnName" @selectChange="dicChange('salesmanName', $event)"
  184. :disabled="editDisabled"></dic-select>
  185. <dic-select v-show="form.sourceType == 'SALES'" v-model="form.salesmanName"
  186. placeholder="业务员" key="id" label="realName" res="records" url="/blade-user/page"
  187. :filterable="true" :remote="true" dataName="realName"
  188. @selectChange="dicChange('salesmanName', $event)" :disabled="editDisabled"></dic-select>
  189. </div>
  190. </tempalte>
  191. </avue-form>
  192. </trade-card>
  193. <trade-card title="货物明细">
  194. <avue-crud :option="option" :data="form.agentItemsList" id="out-table" ref="crud"
  195. @selection-change="selectionChange" @select="selectHandle" @row-update="rowUpdate"
  196. @resetColumn="resetColumn('crud', 'option', 'optionBack', 376)"
  197. @saveColumn="saveColumn('crud', 'option', 'optionBack', 376)">
  198. <template slot="menuLeft">
  199. <el-button type="info" plain size="small" :disabled="editDisabled"
  200. @click="allClick('一键保存')">一键保存</el-button>
  201. <el-button type="info" plain size="small" :disabled="editDisabled"
  202. @click="allClick('一键编辑')">一键编辑</el-button>
  203. <el-button type="success" size="small" :disabled="editDisabled || !form.id"
  204. @click="allClick('首款账单')">首款账单
  205. </el-button>
  206. <el-button type="info" size="small"
  207. :disabled="editDisabled || selectionList.length == 0 || !form.id"
  208. @click="allClick('尾款账单')">尾款账单
  209. </el-button>
  210. <el-button type="warning" size="small" :disabled="selectionList.length == 0 || !form.id"
  211. @click="allClick('生成货代')">生成货代
  212. </el-button>
  213. <el-button size="small" style="margin-right: 8px" :disabled="!form.id"
  214. @click="$refs.print.openDialog()">打印账单
  215. </el-button>
  216. <!-- <el-button type="info" size="small" :disabled="editDisabled || !form.id"
  217. @click="allClick('生成申请收款')">生成货款收款
  218. </el-button>
  219. <el-button type="warning" size="small" :disabled="editDisabled || !form.id"
  220. @click="allClick('生成申请付款')">生成货款付款
  221. </el-button> -->
  222. <el-dropdown>
  223. <el-button type="danger" size="small" :disabled="editDisabled || !form.id">
  224. 生成应付<i class="el-icon-arrow-down el-icon--right"></i>
  225. </el-button>
  226. <el-dropdown-menu slot="dropdown">
  227. <el-dropdown-item @click.native="allClick('生成首款应付')">首款</el-dropdown-item>
  228. <el-dropdown-item :disabled="selectionList.length == 0"
  229. @click.native="allClick('生成尾款应付')">尾款</el-dropdown-item>
  230. </el-dropdown-menu>
  231. </el-dropdown>
  232. <!-- <el-dropdown>
  233. <el-button type="danger" size="small" :disabled="editDisabled">
  234. 撤销申请付款<i class="el-icon-arrow-down el-icon--right"></i>
  235. </el-button>
  236. <el-dropdown-menu slot="dropdown">
  237. <el-dropdown-item @click.native="allClick('首款撤销申请付款')">首款</el-dropdown-item>
  238. <el-dropdown-item @click.native="allClick('尾款撤销申请付款')">尾款</el-dropdown-item>
  239. </el-dropdown-menu>
  240. </el-dropdown> -->
  241. <!-- <el-dropdown>
  242. <el-button type="primary" size="small" :disabled="!form.id">
  243. 应收待确认通知<i class="el-icon-arrow-down el-icon--right"></i>
  244. </el-button>
  245. <el-dropdown-menu slot="dropdown">
  246. <el-dropdown-item @click.native="allClick('首款应收待确认通知')">首款应收待确认通知</el-dropdown-item>
  247. <el-dropdown-item @click.native="allClick('尾款应收待确认通知')">尾款应收待确认通知</el-dropdown-item>
  248. </el-dropdown-menu>
  249. </el-dropdown> -->
  250. </template>
  251. <template slot="indexHeader" slot-scope="{row,index}">
  252. <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled" circle
  253. @click="addRow()">
  254. </el-button>
  255. </template>
  256. <template slot="hsCodeHeader" slot-scope="{column}">
  257. <span style="color: #1e9fff;cursor: pointer;" @click="inJump('HSCODE')">{{ (column || {}).label
  258. }}</span>
  259. </template>
  260. <template slot="labelProductNameHeader" slot-scope="{column}">
  261. <span style="color: #1e9fff;cursor: pointer;" @click="inJump('HSCODE')">{{ (column || {}).label
  262. }}</span>
  263. </template>
  264. <template slot="boxTypeHeader" slot-scope="{column}">
  265. <span style="color: #1e9fff;cursor: pointer;" @click="inJump('箱型')">{{ (column || {}).label
  266. }}</span>
  267. </template>
  268. <template slot="goodsTypeHeader" slot-scope="{column}">
  269. <span style="color: #1e9fff;cursor: pointer;" @click="inJump('商品类别')">{{ (column || {}).label
  270. }}</span>
  271. </template>
  272. <template slot="index" slot-scope="{row,index}">
  273. <span>{{ index + 1 }}</span>
  274. </template>
  275. <template slot="billNo" slot-scope="{ row }">
  276. <!-- <el-input v-if="row.$cellEdit" v-model="row.billNo" placeholder="请输入 提单号"></el-input> -->
  277. <span v-if="!row.$cellEdit" style="color: #1e9fff" @click="rowJump(row)">{{ row.billNo }}</span>
  278. </template>
  279. <template slot="boxTypeForm" slot-scope="{ row }">
  280. <dic-select v-if="row.$cellEdit" v-model="row.boxType" placeholder="箱型" key="id" res="records"
  281. label="cnName" url="/blade-los/bcntrtypes/list" :filterable="true" :remote="true"
  282. dataName="cnName"></dic-select>
  283. <span v-else>{{ row.boxType }}</span>
  284. </template>
  285. <template slot="boxNoForm" slot-scope="{ row }">
  286. <el-input v-if="row.$cellEdit" v-model="row.boxNo" placeholder="请输入 箱号" size="small"
  287. @change="boxChange(row)"></el-input>
  288. <span v-else>{{ row.boxNo }}</span>
  289. </template>
  290. <tempalte slot="orderReleaseMethodForm" slot-scope="{ row }">
  291. <dic-select v-if="row.$cellEdit" v-model="row.orderReleaseMethod" placeholder="放单方式"
  292. key="dictKey" label="dictValue" url="/blade-system/dict-biz/dictionary?code=release_method"
  293. :filterable="true"></dic-select>
  294. <span v-else>{{ row.orderReleaseMethod }}</span>
  295. </tempalte>
  296. <template slot="hsCodeForm" slot-scope="{ row }">
  297. <dic-select v-if="row.$cellEdit" v-model="row.hsCode" placeholder="HSCODE" key="id"
  298. res="records" label="hsCode" url="/blade-los/bcommodity/list" :filterable="true"
  299. :remote="true" dataName="hsCode"
  300. @selectChange="rowDicChange('hsCode', $event, row)"></dic-select>
  301. <span v-else>{{ row.hsCode }}</span>
  302. </template>
  303. <tempalte slot="goodsTypeForm" slot-scope="{ row }">
  304. <dic-select v-if="row.$cellEdit" v-model="row.goodsType" placeholder="商品类型" key="dictKey"
  305. label="dictValue" url="/blade-system/dict-biz/dictionary?code=goods-type"
  306. :filterable="true"></dic-select>
  307. <span v-else>{{ row.goodsType }}</span>
  308. </tempalte>
  309. <tempalte slot="netWeightForm" slot-scope="{ row }">
  310. <el-input-number v-if="row.$cellEdit" v-model="row.netWeight" @change="countChange(row)"
  311. :controls="false" placeholder="请输入 净重" size="small" style="width: 100%;"></el-input-number>
  312. <span v-else>{{ row.netWeight }}</span>
  313. </tempalte>
  314. <tempalte slot="priceForm" slot-scope="{ row }">
  315. <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)"
  316. :controls="false" placeholder="请输入 单价" size="small" style="width: 100%;"></el-input-number>
  317. <span v-else>{{ row.price }}</span>
  318. </tempalte>
  319. <tempalte slot="amountForm" slot-scope="{ row }">
  320. <el-input-number v-if="row.$cellEdit" v-model="row.amount" @change="amountChange(row)"
  321. :controls="false" placeholder="请输入 金额" size="small" style="width: 100%;"></el-input-number>
  322. <span v-else>{{ row.amount }}</span>
  323. </tempalte>
  324. <template slot="menu" slot-scope="{ row, index }">
  325. <!-- <el-button size="small" :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" type="text"
  326. :disabled="editDisabled" @click="rowCell(row, index)">{{ row.$cellEdit ? '保 存' : '编 辑'
  327. }}</el-button> -->
  328. <el-button size="small" icon="el-icon-delete" type="text"
  329. :disabled="editDisabled || form.feeCenterListD.length || form.feeCenterListC.length"
  330. @click="rowDel(row, index)">删 除</el-button>
  331. </template>
  332. </avue-crud>
  333. </trade-card>
  334. <trade-card title="费用明细">
  335. <fee-info ref="feeInfo" :form="form" :disabled="editDisabled" @getDetails="getDetails"></fee-info>
  336. </trade-card>
  337. <trade-card title="记录信息">
  338. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  339. <el-tab-pane label="付汇记录" name="1">
  340. <avue-crud :data="form.recordRateList" :option="option3">
  341. <template slot="contractNo" slot-scope="{ row }">
  342. <span style="color: #1e9fff" @click="rowEdit(row)">{{ row.contractNo }}</span>
  343. </template>
  344. <template slot="customsDeclarationNo" slot-scope="{ row }">
  345. <span style="color: #1e9fff" @click="rowEdit(row)">{{ row.customsDeclarationNo }}</span>
  346. </template>
  347. </avue-crud>
  348. </el-tab-pane>
  349. <el-tab-pane label="收款记录" name="2">
  350. <avue-crud :data="form.recordListD" :option="option1">
  351. <template slot="account" slot-scope="{ row }">
  352. <span style="color: #1e9fff" @click="rowEdit(row)">{{ row.account }}</span>
  353. </template>
  354. </avue-crud>
  355. </el-tab-pane>
  356. <el-tab-pane label="付款记录" name="3">
  357. <avue-crud :data="form.recordListC" :option="option1">
  358. <template slot="account" slot-scope="{ row }">
  359. <span style="color: #1e9fff" @click="rowEdit(row)">{{ row.account }}</span>
  360. </template>
  361. </avue-crud>
  362. </el-tab-pane>
  363. <el-tab-pane label="开票记录" name="4">
  364. <avue-crud :data="form.recordInvoiceList" :option="option2"></avue-crud>
  365. </el-tab-pane>
  366. <el-tab-pane label="合同修改记录" name="5">
  367. <avue-crud :data="form.recordList" :option="option4"></avue-crud>
  368. </el-tab-pane>
  369. </el-tabs>
  370. </trade-card>
  371. <containerTitle title="上传附件"></containerTitle>
  372. <c-upload :data="form.filesCenterList" :enumerationValue="76" deleteUrl="/api/blade-los/filescenter/remove"
  373. display :disabled="editDisabled"></c-upload>
  374. </div>
  375. <business-reports :id="form.id" :itemIds="itemIds" ref="print" businessValue="MYDL"
  376. :type="true"></business-reports>
  377. <reports :id="form.id" :assemblyForm="form" businessValue="MYDL" ref="report"></reports>
  378. <!--审核弹窗-->
  379. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  380. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  381. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  382. </el-dialog>
  383. <el-dialog append-to-body title="尾款账单" class="el-dialogDeep" :visible.sync="wkDialog" width="50%" top="30vh"
  384. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @closed="wkClosed"
  385. v-dialog-drag>
  386. <avue-form v-model="wkForm" :option="wkOption"></avue-form>
  387. <avue-crud :data="wkForm.agentItemsRList" :option="wkOptionList">
  388. <tempalte slot="thisSettlementAmount" slot-scope="{ row }">
  389. <el-input-number v-if="row.$cellEdit" v-model="row.thisSettlementAmount" @change="wkChange(row)"
  390. :controls="false" placeholder="请输入 本次金额" size="small" style="width: 100%;"></el-input-number>
  391. </tempalte>
  392. </avue-crud>
  393. <span slot="footer" class="dialog-footer">
  394. <el-button size="mini" @click="wkDialog = false">取 消</el-button>
  395. <el-button size="mini" type="primary" @click="wkSubmit">提 交</el-button>
  396. </span>
  397. </el-dialog>
  398. <el-dialog append-to-body title="生成货代" class="el-dialogDeep" :visible.sync="hdDialog" width="30%" top="30vh"
  399. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @closed="hdClosed"
  400. v-dialog-drag>
  401. <avue-form v-model="hdForm" :option="hdOption">
  402. <tempalte slot="operatorName">
  403. <div style="display: flex;">
  404. <dic-select v-model="hdForm.operatorName" placeholder="操作员" key="id" label="realName"
  405. res="records" url="/blade-user/page" :filterable="true" :remote="true" dataName="realName"
  406. @selectChange="dicChange('operatorName', $event)"></dic-select>
  407. </div>
  408. </tempalte>
  409. </avue-form>
  410. <span slot="footer" class="dialog-footer">
  411. <el-button size="mini" @click="hdDialog = false">取 消</el-button>
  412. <el-button size="mini" type="primary" @click="hdSubmit">提 交</el-button>
  413. </span>
  414. </el-dialog>
  415. <dictbiz-dialog ref="dictbiz" :title="dicTitle" :code="dicCode" :parentId="parentId" @closed="getAllWorkDicts">
  416. </dictbiz-dialog>
  417. </div>
  418. </template>
  419. <script>
  420. import { submit, getDetail, removeItem, checkAgent, revokeCheckAgent, copyAgent, generateDownPaymentBill, generateBalancePaymentBill, generatePayment, revokeApplyForPayment, confirmationNotification, generateFreightForwarder, balancePayment, applyForPaymentList } from "@/api/tradeAgency/tradeAgency";
  421. import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
  422. import feeInfo from "@/components/tradeAgency/fee-info";
  423. import dicSelect from "@/components/dicSelect/main";
  424. import checkSchedule from "@/components/checkH/checkSchedule.vue";
  425. import businessReports from "@/components/tradeAgency/businessReports.vue";
  426. import reports from "@/components/tradeAgency/reports.vue";
  427. import { getDicinit } from "@/api/dicSelect/index";
  428. import { dateFormat } from "@/util/date";
  429. import { getBcorpsDetail } from "@/api/iosBasicData/bcorps";
  430. import { contrastObj, contrastList } from "@/util/contrastData";
  431. import { getToken } from "@/util/auth";
  432. import _ from "lodash";
  433. export default {
  434. name: "detailsPage",
  435. data() {
  436. return {
  437. hdDialog: false,
  438. hdForm: {},
  439. dicTitle: null,
  440. parentId: null,
  441. dicCode: null,
  442. wkType: null,
  443. wkForm: {
  444. agentItemsRList: []
  445. },
  446. hdOption: {
  447. menuBtn: false,
  448. span: 24,
  449. disabled: false,
  450. column: [
  451. {
  452. label: '操作员',
  453. prop: 'operatorName',
  454. disabled: false,
  455. },
  456. ]
  457. },
  458. wkOption: {
  459. menuBtn: false,
  460. span: 8,
  461. disabled: false,
  462. column: [
  463. {
  464. label: '总货值',
  465. prop: 'goodsValue',
  466. disabled: true,
  467. },
  468. {
  469. label: '预付金额',
  470. prop: 'prepaidAmount',
  471. disabled: true,
  472. },
  473. {
  474. label: '应收金额',
  475. prop: 'amountD',
  476. disabled: true,
  477. },
  478. {
  479. label: '汇率',
  480. prop: 'exchangeRate'
  481. }
  482. ]
  483. },
  484. wkOptionList: {
  485. header: false,
  486. border: true,
  487. index: true,
  488. menu: false,
  489. align: 'center',
  490. column: [
  491. {
  492. label: '提单号',
  493. prop: 'billNo',
  494. overHidden: true
  495. },
  496. {
  497. label: '货值',
  498. prop: 'amount',
  499. overHidden: true
  500. },
  501. {
  502. label: '本次金额',
  503. prop: 'thisSettlementAmount',
  504. }
  505. ]
  506. },
  507. selectionList: [],
  508. checkId: '', // 审核需要的id
  509. batchNo: '',
  510. checkScheduleDialog: false, // 审核弹窗
  511. wkDialog: false,//尾款弹窗
  512. editButton: false,
  513. editDisabled: false,
  514. activeName: '1',
  515. form: {
  516. typeOfShipping: '海运',
  517. contractDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00",
  518. currency: 'USD',
  519. documentType: '普通',
  520. advanceRatio: 'T/T',
  521. billNoFormat: 'MYDL',
  522. businessTypeCode: 'MYDL',
  523. businessType: 'MYDL',
  524. businessStatus: '录入',
  525. tradeMode: '一般贸易',
  526. agentItemsList: [],
  527. feeCenterListC: [],
  528. feeCenterListD: [],
  529. filesCenterList: [],
  530. recordList: [],
  531. recordInvoiceList: [],
  532. recordListC: [],
  533. recordListD: [],
  534. recordRateList: []
  535. },
  536. oldForm: {
  537. typeOfShipping: '海运',
  538. contractDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00",
  539. currency: 'USD',
  540. documentType: '普通',
  541. advanceRatio: 'T/T',
  542. billNoFormat: 'MYDL',
  543. businessTypeCode: 'MYDL',
  544. businessType: 'MYDL',
  545. businessStatus: '录入',
  546. tradeMode: '一般贸易',
  547. agentItemsList: [],
  548. feeCenterListC: [],
  549. feeCenterListD: [],
  550. filesCenterList: [],
  551. recordList: [],
  552. recordInvoiceList: [],
  553. recordListC: [],
  554. recordListD: [],
  555. recordRateList: []
  556. },
  557. optionForm: {
  558. menuBtn: false,
  559. span: 8,
  560. disabled: false,
  561. column: [
  562. {
  563. label: '客户',
  564. prop: "corpName",
  565. disabled: false,
  566. rules: [{
  567. required: true,
  568. message: " ",
  569. trigger: "blur"
  570. }]
  571. },
  572. {
  573. label: '合同号',
  574. prop: "contractNo",
  575. disabled: false,
  576. rules: [{
  577. required: true,
  578. message: " ",
  579. trigger: "blur"
  580. }]
  581. },
  582. {
  583. label: '合同日期',
  584. prop: "contractDate",
  585. rules: [{
  586. required: true,
  587. message: " ",
  588. trigger: "blur"
  589. }]
  590. },
  591. {
  592. label: '原产地',
  593. prop: "countryOfOrigin",
  594. disabled: false,
  595. rules: [{
  596. required: true,
  597. message: " ",
  598. trigger: "blur"
  599. }]
  600. },
  601. {
  602. label: '运输方式',
  603. prop: "typeOfShipping",
  604. disabled: false,
  605. rules: [{
  606. required: true,
  607. message: " ",
  608. trigger: "blur"
  609. }]
  610. },
  611. {
  612. label: '起运港',
  613. prop: "polCnName",
  614. disabled: false,
  615. },
  616. {
  617. label: '目的港',
  618. prop: "podCnName",
  619. disabled: false,
  620. },
  621. {
  622. label: '币别',
  623. prop: "currency",
  624. disabled: false,
  625. rules: [{
  626. required: true,
  627. message: " ",
  628. trigger: "blur"
  629. }]
  630. },
  631. {
  632. label: '国外发货人',
  633. prop: "abroadConsignorCname",
  634. disabled: false,
  635. rules: [{
  636. required: true,
  637. message: " ",
  638. trigger: "blur"
  639. }]
  640. },
  641. {
  642. label: '银行助记码',
  643. prop: "abroadBankMnemonicCode",
  644. disabled: false,
  645. },
  646. {
  647. label: '银行',
  648. prop: "abroadBank",
  649. disabled: false,
  650. },
  651. {
  652. label: '币别',
  653. prop: "abroadCurrency",
  654. disabled: false,
  655. },
  656. {
  657. label: '国内收货人',
  658. prop: "domesticConsigneeCname",
  659. disabled: false,
  660. rules: [{
  661. required: true,
  662. message: " ",
  663. trigger: "blur"
  664. }]
  665. },
  666. {
  667. label: '银行助记码',
  668. prop: "domesticBankMnemonicCode",
  669. disabled: false,
  670. },
  671. {
  672. label: '银行',
  673. prop: "domesticBank",
  674. disabled: false,
  675. },
  676. {
  677. label: '币别',
  678. prop: "domesticCurrency",
  679. disabled: false,
  680. },
  681. {
  682. label: '资金方',
  683. prop: "fundingParty",
  684. disabled: false,
  685. },
  686. {
  687. label: '货值',
  688. prop: "goodsValue",
  689. disabled: true,
  690. },
  691. {
  692. label: '付费方式',
  693. prop: "advanceRatio",
  694. type: "select",
  695. dicUrl: "/api/blade-system/dict-biz/dictionary?code=advance_ratio",
  696. props: {
  697. label: "dictValue",
  698. value: "dictValue"
  699. },
  700. disabled: false,
  701. rules: [{
  702. required: true,
  703. message: " ",
  704. trigger: "blur"
  705. }]
  706. },
  707. {
  708. label: '预付金额',
  709. prop: "prepaidAmount",
  710. disabled: false,
  711. rules: [{
  712. required: true,
  713. message: " ",
  714. trigger: "blur"
  715. }]
  716. },
  717. {
  718. label: '单据类型',
  719. prop: "documentType",
  720. disabled: false,
  721. },
  722. {
  723. label: '贸易方式',
  724. prop: "tradeMode",
  725. type: "select",
  726. dicUrl: "/api/blade-system/dict-biz/dictionary?code=trade_Mode",
  727. props: {
  728. label: "dictValue",
  729. value: "dictValue"
  730. },
  731. disabled: false,
  732. rules: [{
  733. required: true,
  734. message: " ",
  735. trigger: "blur"
  736. }],
  737. },
  738. {
  739. label: '成交方式',
  740. prop: "transactionMethod",
  741. disabled: false
  742. },
  743. {
  744. label: '所属公司',
  745. prop: "affiliatedCompanyName",
  746. disabled: false,
  747. rules: [{
  748. required: true,
  749. message: " ",
  750. trigger: "blur"
  751. }],
  752. },
  753. {
  754. label: '业务来源',
  755. prop: "sourceType",
  756. disabled: false,
  757. rules: [{
  758. required: true,
  759. message: " ",
  760. trigger: "blur"
  761. }],
  762. },
  763. // {
  764. // prop: "salesmanName",
  765. // disabled: false,
  766. // display:false,
  767. // rules: [{
  768. // required: true,
  769. // message: " ",
  770. // trigger: "blur"
  771. // }],
  772. // },
  773. {
  774. label: "审单状态",
  775. prop: "reviewStatus",
  776. type: "select",
  777. dicUrl: "/api/blade-system/dict-biz/dictionary?code=audit_status",
  778. props: {
  779. label: "dictValue",
  780. value: "dictValue"
  781. },
  782. },
  783. {
  784. label: '备注',
  785. prop: "remarks",
  786. type: 'textarea',
  787. disabled: false,
  788. span: 12,
  789. minRows: 2,
  790. },
  791. ]
  792. },
  793. option: {},
  794. optionBack: {
  795. height: 'auto',
  796. calcHeight: 30,
  797. menuWidth: 60,
  798. tip: false,
  799. border: true,
  800. addBtn: false,
  801. viewBtn: false,
  802. editBtn: false,
  803. delBtn: false,
  804. refreshBtn: false,
  805. selection: true,
  806. align: 'center',
  807. column: [
  808. {
  809. label: "index",
  810. prop: "index",
  811. width: "55",
  812. headerslot: true,
  813. },
  814. {
  815. label: "提单号",
  816. prop: "billNo",
  817. width: "140",
  818. cell: true,
  819. overHidden: true,
  820. rules: [
  821. {
  822. required: true,
  823. message: '请输入提单号',
  824. trigger: 'blur'
  825. }
  826. ]
  827. },
  828. {
  829. label: "箱型",
  830. prop: "boxType",
  831. width: "80",
  832. cell: true,
  833. slot: true,
  834. formslot: true,
  835. overHidden: true,
  836. rules: [
  837. {
  838. required: true,
  839. message: '请选择箱型',
  840. trigger: 'blur'
  841. }
  842. ]
  843. },
  844. {
  845. label: "箱号",
  846. prop: "boxNo",
  847. width: "140",
  848. cell: true,
  849. slot: true,
  850. overHidden: true,
  851. rules: [
  852. {
  853. required: true,
  854. message: '请输入箱号',
  855. trigger: 'blur'
  856. }
  857. ]
  858. },
  859. {
  860. label: "PI发票号",
  861. prop: "invoiceNo",
  862. width: "100",
  863. cell: true,
  864. overHidden: true
  865. },
  866. {
  867. label: "订单号",
  868. prop: "orderNo",
  869. width: "100",
  870. cell: true,
  871. overHidden: true
  872. },
  873. {
  874. label: "厂号",
  875. prop: "factoryNumber",
  876. width: "100",
  877. cell: true,
  878. overHidden: true
  879. },
  880. {
  881. label: "HSCODE",
  882. prop: "hsCode",
  883. width: "100",
  884. overHidden: true,
  885. cell: true,
  886. slot: true,
  887. formslot: true,
  888. rules: [
  889. {
  890. required: true,
  891. message: '请输入HSCODE',
  892. trigger: 'blur'
  893. }
  894. ]
  895. },
  896. {
  897. label: "标签品名",
  898. prop: "labelProductName",
  899. width: "100",
  900. overHidden: true
  901. },
  902. {
  903. label: "商品类别",
  904. prop: "goodsType",
  905. width: "100",
  906. cell: true,
  907. slot: true,
  908. formslot: true,
  909. overHidden: true,
  910. rules: [
  911. {
  912. required: true,
  913. message: '请选择商品类别',
  914. trigger: 'blur'
  915. }
  916. ]
  917. },
  918. {
  919. label: "件数",
  920. prop: "quantity",
  921. width: "100",
  922. cell: true,
  923. type: 'number',
  924. controls: false,
  925. overHidden: true,
  926. rules: [
  927. {
  928. required: true,
  929. message: '请输入件数',
  930. trigger: 'blur'
  931. }
  932. ]
  933. },
  934. {
  935. label: "净重(kg)",
  936. prop: "netWeight",
  937. width: "100",
  938. cell: true,
  939. slot: true,
  940. formslot: true,
  941. overHidden: true,
  942. rules: [
  943. {
  944. required: true,
  945. message: '请输入净重',
  946. trigger: 'blur'
  947. }
  948. ]
  949. },
  950. {
  951. label: "单价(USD)",
  952. prop: "price",
  953. width: "100",
  954. cell: true,
  955. slot: true,
  956. formslot: true,
  957. overHidden: true,
  958. rules: [
  959. {
  960. required: true,
  961. message: '请输入单价',
  962. trigger: 'blur'
  963. }
  964. ]
  965. },
  966. {
  967. label: "毛重(kg)",
  968. prop: "grossWeight",
  969. width: "100",
  970. cell: true,
  971. type: 'number',
  972. controls: false,
  973. overHidden: true,
  974. rules: [
  975. {
  976. required: true,
  977. message: '请输入毛重',
  978. trigger: 'blur'
  979. }
  980. ]
  981. },
  982. {
  983. label: "金额(USD)",
  984. prop: "amount",
  985. width: "100",
  986. cell: true,
  987. slot: true,
  988. formslot: true,
  989. overHidden: true
  990. },
  991. {
  992. label: "税率",
  993. prop: "taxRate",
  994. width: "80",
  995. overHidden: true
  996. },
  997. {
  998. label: "铅封号",
  999. prop: "leadSealNo",
  1000. width: "120",
  1001. cell: true,
  1002. overHidden: true
  1003. },
  1004. {
  1005. label: "放单方式",
  1006. prop: "orderReleaseMethod",
  1007. width: "100",
  1008. cell: true,
  1009. slot: true,
  1010. formslot: true,
  1011. overHidden: true
  1012. },
  1013. {
  1014. label: "开船日期",
  1015. prop: "etd",
  1016. width: "120",
  1017. overHidden: true
  1018. },
  1019. {
  1020. label: "预计到港",
  1021. prop: "estimateReachHarbor",
  1022. width: "120",
  1023. overHidden: true
  1024. },
  1025. {
  1026. label: "实际到港",
  1027. prop: "actualReachHarbor",
  1028. width: "120",
  1029. overHidden: true
  1030. },
  1031. {
  1032. label: "报关单号",
  1033. prop: "customsDeclarationNo",
  1034. width: "120",
  1035. overHidden: true
  1036. },
  1037. {
  1038. label: "报关日期",
  1039. prop: "customsDeclarationDate",
  1040. width: "120",
  1041. overHidden: true
  1042. },
  1043. {
  1044. label: "放行日期",
  1045. prop: "releaseDate",
  1046. width: "120",
  1047. overHidden: true
  1048. },
  1049. {
  1050. label: "派车日期",
  1051. prop: "dispatchDate",
  1052. width: "120",
  1053. overHidden: true
  1054. },
  1055. {
  1056. label: "库存件数",
  1057. prop: "inventoryQuantity",
  1058. width: "100",
  1059. overHidden: true
  1060. },
  1061. {
  1062. label: "货代",
  1063. prop: "freightForwarder",
  1064. width: "80",
  1065. type: 'select',
  1066. dicData: [{
  1067. label: '是',
  1068. value: '1'
  1069. }, {
  1070. label: '否',
  1071. value: '0'
  1072. }],
  1073. overHidden: true
  1074. },
  1075. {
  1076. label: "备注",
  1077. prop: "remarks",
  1078. width: "120",
  1079. cell: true,
  1080. overHidden: true
  1081. }
  1082. ]
  1083. },
  1084. option1: {
  1085. header: false,
  1086. border: true,
  1087. index: true,
  1088. menu: false,
  1089. align: 'center',
  1090. column: [
  1091. {
  1092. label: '户头',
  1093. prop: 'account'
  1094. },
  1095. {
  1096. label: '账号',
  1097. prop: 'accountNumber'
  1098. },
  1099. {
  1100. label: '银行',
  1101. prop: 'bank'
  1102. },
  1103. {
  1104. label: '金额',
  1105. prop: 'amount'
  1106. },
  1107. {
  1108. label: '备注',
  1109. prop: 'remarks'
  1110. }
  1111. ]
  1112. },
  1113. option2: {
  1114. header: false,
  1115. border: true,
  1116. index: true,
  1117. menu: false,
  1118. align: 'center',
  1119. column: [
  1120. {
  1121. label: '开票抬头',
  1122. prop: 'invoiceHeader'
  1123. },
  1124. {
  1125. label: '开票金额',
  1126. prop: 'amount'
  1127. },
  1128. {
  1129. label: '税率',
  1130. prop: 'taxRate'
  1131. },
  1132. {
  1133. label: '开票内容',
  1134. prop: 'invoiceContent'
  1135. },
  1136. {
  1137. label: '备注',
  1138. prop: 'remarks'
  1139. }
  1140. ]
  1141. },
  1142. option3: {
  1143. header: false,
  1144. border: true,
  1145. index: true,
  1146. menu: false,
  1147. align: 'center',
  1148. column: [
  1149. {
  1150. label: '结算单位',
  1151. prop: "corpName",
  1152. },
  1153. {
  1154. label: '合同号',
  1155. prop: "contractNo",
  1156. },
  1157. {
  1158. label: '提单号',
  1159. prop: 'billNo'
  1160. },
  1161. {
  1162. label: '金额',
  1163. prop: 'amount'
  1164. },
  1165. {
  1166. label: '金额(USD)',
  1167. prop: 'amountUsd'
  1168. },
  1169. {
  1170. label: '汇率',
  1171. prop: 'exchangeRate'
  1172. },
  1173. {
  1174. label: '报关单号',
  1175. prop: 'customsDeclarationNo'
  1176. },
  1177. {
  1178. label: '日期',
  1179. prop: 'date'
  1180. },
  1181. {
  1182. label: '状态',
  1183. prop: 'status'
  1184. },
  1185. {
  1186. label: '备注',
  1187. prop: 'remarks'
  1188. }
  1189. ]
  1190. },
  1191. option4: {
  1192. header: false,
  1193. border: true,
  1194. index: true,
  1195. menu: false,
  1196. align: 'center',
  1197. column: [
  1198. {
  1199. label: '提单号',
  1200. prop: 'billNo'
  1201. },
  1202. {
  1203. label: '日期',
  1204. prop: 'date'
  1205. },
  1206. {
  1207. label: '操作人',
  1208. prop: 'createUserName'
  1209. },
  1210. {
  1211. label: '原金额',
  1212. prop: 'amount'
  1213. },
  1214. {
  1215. label: '修改金额',
  1216. prop: 'amountUsd'
  1217. },
  1218. {
  1219. label: '备注',
  1220. prop: 'remarks'
  1221. }
  1222. ]
  1223. },
  1224. itemIds: null,
  1225. showLock: false,
  1226. roleName: [],
  1227. saberUserInfo: ''
  1228. }
  1229. },
  1230. components: {
  1231. dicSelect,
  1232. feeInfo,
  1233. checkSchedule,
  1234. businessReports,
  1235. reports
  1236. },
  1237. props: {
  1238. detailData: Object
  1239. },
  1240. async created() {
  1241. this.roleName = localStorage.getItem('roleName').split(',')
  1242. this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content
  1243. this.option = await this.getColumnData(this.getColumnName(376), this.optionBack);
  1244. if (this.detailData.new) {
  1245. getDicinit('get', '/blade-los/bports/list', { cnName: '青岛' }).then(res => {
  1246. res.data.data.records.forEach(e => {
  1247. if (e.cnName == '青岛') {
  1248. this.form.podId = e.id
  1249. this.form.podCode = e.code
  1250. this.form.podEnName = e.enName
  1251. this.form.podCnName = e.cnName
  1252. }
  1253. })
  1254. })
  1255. getDicinit('get', '/blade-system/dept/lazy-list?parentId=0').then(res => {
  1256. res.data.data.forEach(e => {
  1257. if (e.deptName == '君海贸易') {
  1258. this.form.affiliatedCompanyId = e.id
  1259. this.form.affiliatedCompanyName = e.deptName
  1260. }
  1261. })
  1262. })
  1263. }
  1264. if (this.detailData.id) {
  1265. this.showLock = true;
  1266. this.editButton = true
  1267. this.editDisabled = true
  1268. this.optionForm.disabled = true
  1269. this.getDetails(this.detailData.id)
  1270. }
  1271. if (this.$route.query.params) {
  1272. this.showLock = true;
  1273. this.getDetails(this.$route.query.params)
  1274. }
  1275. if (this.detailData.copyId) {
  1276. this.getCopydate(this.detailData.copyId)
  1277. }
  1278. },
  1279. methods: {
  1280. inLock() {
  1281. const data = {
  1282. moduleName: "MYDL",
  1283. tableName: "MYDL_Detail",
  1284. billId: this.form.id,
  1285. no: localStorage.getItem("browserID"),
  1286. billNo: this.form.contractNo
  1287. };
  1288. this.inDetailsKey(this.$route.name, {
  1289. moduleName: "MYDL",
  1290. tableName: "MYDL_Detail",
  1291. billId: this.form.id,
  1292. billNo: this.form.contractNo
  1293. });
  1294. this.checkLock(data).then(res => {
  1295. if (res.data.code == 200) {
  1296. this.onLock(data).then(res => {
  1297. if (res.data.code == 200) {
  1298. this.showLock = false
  1299. }
  1300. });
  1301. }
  1302. });
  1303. },
  1304. inJump(name) {
  1305. if (name == '客户') {
  1306. this.$router.push({
  1307. path: "/iosBasicData/bcorps/index",
  1308. query: { type: 'new' },
  1309. })
  1310. }
  1311. if (name == '原产地') {
  1312. this.$router.push({
  1313. path: "/iosBasicData/bcountrys/index",
  1314. query: { type: 'new' },
  1315. })
  1316. }
  1317. if (name == '港口') {
  1318. this.$router.push({
  1319. path: "/iosBasicData/bports/index",
  1320. query: { type: 'new' },
  1321. })
  1322. }
  1323. if (name == 'HSCODE') {
  1324. this.$router.push({
  1325. path: "/iosBasicData/bcommodity/index",
  1326. query: { type: 'new' },
  1327. })
  1328. }
  1329. if (name == '箱型') {
  1330. this.$router.push({
  1331. path: "/iosBasicData/bcntrtypes/index",
  1332. query: { type: 'new' },
  1333. })
  1334. }
  1335. if (name == '商品类别') {
  1336. this.$refs.dictbiz.open()
  1337. this.dicTitle = '添加类型'
  1338. this.parentId = '1813125517193330690'
  1339. this.dicCode = 'goods-type'
  1340. }
  1341. },
  1342. dicChange(name, row) {
  1343. if (name == 'corpName') {
  1344. if (row) {
  1345. this.form.corpId = row.id
  1346. this.form.corpName = row.cnName
  1347. this.form.sourceType = row.sourceType
  1348. this.form.salesmanName = row.srcCnName
  1349. this.form.salesmanId = row.srcId
  1350. } else {
  1351. this.form.corpId = null
  1352. this.form.sourceType = null
  1353. this.form.salesmanName = null
  1354. this.form.salesmanId = null
  1355. }
  1356. }
  1357. if (name == 'countryOfOrigin') {
  1358. if (row) {
  1359. this.form.countryOfOrigin = row.cnName
  1360. }
  1361. }
  1362. if (name == 'polCnName') {
  1363. if (row) {
  1364. this.form.polId = row.id
  1365. this.form.polCode = row.code
  1366. this.form.polCnName = row.cnName
  1367. this.form.polEnName = row.enName
  1368. } else {
  1369. this.form.polId = null
  1370. this.form.polCode = null
  1371. this.form.polEnName = null
  1372. }
  1373. }
  1374. if (name == 'podCnName') {
  1375. if (row) {
  1376. this.form.podId = row.id
  1377. this.form.podCode = row.code
  1378. this.form.podCnName = row.cnName
  1379. this.form.podEnName = row.enName
  1380. } else {
  1381. this.form.podId = null
  1382. this.form.podCode = null
  1383. this.form.podEnName = null
  1384. }
  1385. }
  1386. if (name == 'abroadConsignorCname') {
  1387. if (row) {
  1388. this.$refs.abankCode.IdGetDicData({ id: row.id })
  1389. this.form.abroadConsignorId = row.id
  1390. this.form.abroadConsignorCname = row.cnName
  1391. getDicinit('get', '/blade-los/bcorps/detail', { id: row.id }).then(res => {
  1392. res.data.data.corpsBankList.forEach((e, index) => {
  1393. if (index == 0) {
  1394. console.log(e)
  1395. this.form.abroadBankMnemonicCode = e.mnemonicCode
  1396. this.form.abroadBank = e.accountBank
  1397. this.form.abroadCurrency = e.curNo
  1398. }
  1399. })
  1400. })
  1401. } else {
  1402. this.form.abroadConsignorId = null
  1403. this.form.abroadBankMnemonicCode = null
  1404. this.form.abroadBank = null
  1405. this.form.abroadCurrency = null
  1406. }
  1407. }
  1408. if (name == 'domesticConsigneeCname') {
  1409. if (row) {
  1410. this.$refs.dbankCode.IdGetDicData({ id: row.id })
  1411. console.log(this.$refs.abankCode.IdGetDicData({ id: row.id }), 222)
  1412. this.form.domesticConsigneeId = row.id
  1413. this.form.domesticConsigneeCname = row.cnName
  1414. getDicinit('get', '/blade-los/bcorps/detail', { id: row.id }).then(res => {
  1415. res.data.data.corpsBankList.forEach((e, index) => {
  1416. if (index == 0) {
  1417. console.log(e)
  1418. this.form.domesticBankMnemonicCode = e.mnemonicCode
  1419. this.form.domesticBank = e.accountBank
  1420. this.form.domesticCurrency = e.curNo
  1421. }
  1422. })
  1423. })
  1424. } else {
  1425. this.form.domesticConsigneeId = null
  1426. this.form.domesticBankMnemonicCode = null
  1427. this.form.domesticBank = null
  1428. this.form.domesticCurrency = null
  1429. }
  1430. }
  1431. if (name == 'affiliatedCompanyName') {
  1432. if (row) {
  1433. this.form.affiliatedCompanyId = row.id
  1434. } else {
  1435. this.form.affiliatedCompanyId = null
  1436. }
  1437. }
  1438. if (name == 'sourceType') {
  1439. if (!row) {
  1440. this.form.salesmanId = null
  1441. this.form.salesmanName = null
  1442. }
  1443. }
  1444. if (name == 'salesmanName') {
  1445. if (row) {
  1446. this.form.salesmanId = row.id
  1447. } else {
  1448. this.form.salesmanId = null
  1449. }
  1450. }
  1451. if (name == 'abroadBankMnemonicCode') {
  1452. if (row) {
  1453. this.form.abroadBank = row.accountBank
  1454. this.form.abroadCurrency = row.curNo
  1455. } else {
  1456. this.form.abroadBank = null
  1457. this.form.abroadCurrency = null
  1458. }
  1459. }
  1460. if (name == 'domesticBankMnemonicCode') {
  1461. if (row) {
  1462. this.form.domesticBank = row.accountBank
  1463. this.form.domesticCurrency = row.curNo
  1464. } else {
  1465. this.form.domesticBank = null
  1466. this.form.domesticCurrency = null
  1467. }
  1468. }
  1469. if (name == 'fundingParty') {
  1470. if (row) {
  1471. this.form.fundingPartyId = row.id
  1472. this.form.fundingParty = row.cnName
  1473. } else {
  1474. this.form.fundingPartyId = null
  1475. }
  1476. }
  1477. if (name == 'transactionMethod') {
  1478. if (row) {
  1479. this.form.transactionMethodId = row.id
  1480. } else {
  1481. this.form.transactionMethodId = null
  1482. }
  1483. }
  1484. if (name == 'operatorName') {
  1485. if (row) {
  1486. this.hdForm.operatorId = row.id
  1487. } else {
  1488. this.hdForm.operatorId = null
  1489. }
  1490. }
  1491. },
  1492. rowDicChange(name, row, el) {
  1493. if (name == 'hsCode') {
  1494. if (row) {
  1495. el.labelProductName = row.cnName
  1496. el.taxRate = row.taxRate
  1497. } else {
  1498. el.labelProductName = null
  1499. el.taxRate = null
  1500. }
  1501. }
  1502. },
  1503. boxChange(row) {
  1504. getDicinit('get', '/blade-los/agentitems/selectBoxNo', { boxNo: row.boxNo }).then(res => {
  1505. if (res.data.data != 'true') {
  1506. this.$alert(res.data.data, '提示', {
  1507. confirmButtonText: '确定',
  1508. });
  1509. }
  1510. })
  1511. },
  1512. countChange(row) {
  1513. row.amount = _.multiply(Number(row.netWeight ? row.netWeight : 0), Number(row.price ? row.price : 0))
  1514. },
  1515. amountChange(row) {
  1516. if (row.netWeight == 0) return this.$message.error("净重不能为零");
  1517. row.price = _.divide(Number(row.amount ? row.amount : 0), Number(row.netWeight ? row.netWeight : 1))
  1518. },
  1519. wkChange(row) {
  1520. let sum = 0
  1521. this.wkForm.agentItemsRList.forEach(e => {
  1522. sum = _.add(sum, e.thisSettlementAmount)
  1523. })
  1524. if (sum > this.wkForm.unresolvedAmount) {
  1525. setTimeout(() => {
  1526. row.thisSettlementAmount = 0
  1527. this.$message.error("本次金额总数不能超过未结算金额");
  1528. }, 200);
  1529. }
  1530. },
  1531. rowEdit(row) {
  1532. console.log(row.srcType)
  1533. if (row.srcType == 'STL-D-FH') {
  1534. if (this.$store.getters.firstSetStatus) {
  1535. this.$alert("货款收费(T)页面已存在,请关闭货款收费(T)再进行操作", "温馨提示", {
  1536. confirmButtonText: "确定",
  1537. type: 'warning',
  1538. callback: action => {
  1539. }
  1540. });
  1541. } else {
  1542. this.$router.push({
  1543. path: '/tradeAgency/firstSettlement/index',
  1544. query: {
  1545. billNo: row.srcId
  1546. },
  1547. })
  1548. }
  1549. }
  1550. if (row.srcType == 'STL-C-GH') {
  1551. if (this.$store.getters.exchangePurStatus) {
  1552. this.$alert("货款付费(T)页面已存在,请关闭货款付费(T)再进行操作", "温馨提示", {
  1553. confirmButtonText: "确定",
  1554. type: 'warning',
  1555. callback: action => {
  1556. }
  1557. });
  1558. } else {
  1559. this.$router.push({
  1560. path: '/tradeAgency/exchangePurchasing/index',
  1561. query: {
  1562. billNo: row.srcId
  1563. },
  1564. })
  1565. }
  1566. }
  1567. if (row.srcType == 'STL-D' || row.srcType == 'STL-C') {
  1568. if (this.$store.getters.SettlementCenterF) {
  1569. this.$alert("结算中心(F)页面已存在,请关闭结算中心(F)再进行操作", "温馨提示", {
  1570. confirmButtonText: "确定",
  1571. type: 'warning',
  1572. callback: action => {
  1573. }
  1574. });
  1575. } else {
  1576. this.$router.push({
  1577. path: '/iosBasicData/ComputationCenter/index',
  1578. query: {
  1579. billNo: row.srcId
  1580. },
  1581. })
  1582. }
  1583. }
  1584. },
  1585. addRow() {
  1586. if (!this.form.corpId) return this.$message.error("请选择客户名称");
  1587. if (this.form.agentItemsList.length == 0) {
  1588. this.form.agentItemsList.push({ orderReleaseMethod: '正本', freightForwarder: '0', $cellEdit: true })
  1589. } else {
  1590. let obj = {}
  1591. obj = this.deepClone(this.form.agentItemsList[this.form.agentItemsList.length - 1])
  1592. this.form.agentItemsList.push({
  1593. billNo: obj.billNo,
  1594. boxType: obj.boxType,
  1595. leadSealNo: obj.leadSealNo,
  1596. orderReleaseMethod: '正本',
  1597. orderNo: obj.orderNo,
  1598. hsCode: obj.hsCode,
  1599. factoryNumber: obj.factoryNumber,
  1600. labelProductName: obj.labelProductName,
  1601. taxRate: obj.taxRate,
  1602. goodsType: obj.goodsType,
  1603. quantity: obj.quantity,
  1604. netWeight: obj.netWeight,
  1605. price: obj.price,
  1606. grossWeight: obj.grossWeight,
  1607. amount: obj.amount,
  1608. freightForwarder: '0',
  1609. $cellEdit: true
  1610. })
  1611. }
  1612. },
  1613. // rowCell(row, index) {
  1614. // if (!row.billNo || !row.boxType || !row.boxNo || !row.hsCode || !row.goodsType || !row.quantity || !row.netWeight || !row.price || !row.grossWeight) {
  1615. // this.$refs.crud.rowCell(row, index)
  1616. // return this.$message.error("请完善明细信息");
  1617. // }
  1618. // if (row.$cellEdit == true) {
  1619. // this.$set(row, "$cellEdit", false);
  1620. // } else {
  1621. // this.$set(row, "$cellEdit", true);
  1622. // }
  1623. // },
  1624. rowDel(row, index) {
  1625. this.$confirm("确定删除数据?", {
  1626. confirmButtonText: "确定",
  1627. cancelButtonText: "取消",
  1628. type: "warning"
  1629. }).then(() => {
  1630. if (row.id) {
  1631. removeItem({ ids: row.id }).then(res => {
  1632. this.form.agentItemsList.splice(index, 1);
  1633. this.$message.success("成功删除");
  1634. })
  1635. } else {
  1636. this.form.agentItemsList.splice(index, 1);
  1637. }
  1638. });
  1639. },
  1640. selectionChange(list) {
  1641. let ids = []
  1642. list.forEach(e => {
  1643. ids.push(e.id)
  1644. })
  1645. if (ids.length) {
  1646. this.itemIds = ids.join(',')
  1647. } else {
  1648. this.itemIds = null
  1649. }
  1650. this.selectionList = list;
  1651. },
  1652. selectHandle(selection, row) {
  1653. // 取消其中一个选中的时候 默认取消同单号的选中
  1654. if (!selection.includes(row)) {
  1655. this.pickUp(false, row.billNo);
  1656. } else {
  1657. this.pickUp(true, row.billNo);
  1658. }
  1659. },
  1660. // 需要默认勾选/取消的数据
  1661. pickUp(bool, billNo) {
  1662. let arr = [];
  1663. this.form.agentItemsList.forEach(e => {
  1664. if (billNo == e.billNo) {
  1665. arr.push(e)
  1666. }
  1667. })
  1668. this.toggleSelection(arr, bool);
  1669. },
  1670. // 默认选择/取消中的行
  1671. toggleSelection(rows, bool) {
  1672. if (rows) {
  1673. this.$nextTick(() => {
  1674. rows.forEach(row => {
  1675. this.$refs.crud.toggleRowSelection(row, bool);
  1676. });
  1677. });
  1678. } else {
  1679. this.$refs.crud.clearSelection();
  1680. }
  1681. },
  1682. getDetails(id) {
  1683. const loading = this.$loading({
  1684. lock: true,
  1685. text: '加载中',
  1686. spinner: 'el-icon-loading',
  1687. background: 'rgba(255,255,255,0.7)'
  1688. });
  1689. getDetail({ id: id }).then(res => {
  1690. this.form = res.data.data
  1691. this.oldForm = this.deepClone(res.data.data)
  1692. this.inLock()
  1693. if (res.data.data.abroadConsignorId) {
  1694. this.$refs.abankCode.IdGetDicData({ id: res.data.data.abroadConsignorId })
  1695. }
  1696. if (res.data.data.domesticConsigneeId) {
  1697. this.$refs.dbankCode.IdGetDicData({ id: res.data.data.domesticConsigneeId })
  1698. }
  1699. }).finally(() => {
  1700. loading.close()
  1701. })
  1702. },
  1703. getCopydate(id) {
  1704. const loading = this.$loading({
  1705. lock: true,
  1706. text: '加载中',
  1707. spinner: 'el-icon-loading',
  1708. background: 'rgba(255,255,255,0.7)'
  1709. });
  1710. copyAgent({ id: id }).then(res => {
  1711. this.form = res.data.data
  1712. if (res.data.data.abroadConsignorId) {
  1713. this.$refs.abankCode.IdGetDicData({ id: res.data.data.abroadConsignorId })
  1714. }
  1715. if (res.data.data.domesticConsigneeId) {
  1716. this.$refs.dbankCode.IdGetDicData({ id: res.data.data.domesticConsigneeId })
  1717. }
  1718. }).finally(() => {
  1719. loading.close()
  1720. })
  1721. },
  1722. inEdit() {
  1723. this.editButton = false
  1724. if (this.form.businessStatus == '录入') {
  1725. this.editDisabled = false
  1726. this.optionForm.disabled = false
  1727. }
  1728. },
  1729. rowJump(row) {
  1730. if (row.freightForwarder == 1) {
  1731. if (this.$store.getters.oceanFreightStatus) {
  1732. this.$alert("海运进口(T)页面已存在,请关闭海运出口再进行操作", "温馨提示", {
  1733. confirmButtonText: "确定",
  1734. type: 'warning',
  1735. callback: action => {
  1736. }
  1737. });
  1738. } else {
  1739. this.$router.push({
  1740. path: '/tradeAgency/oceanFreightImport/index',
  1741. query: {
  1742. billNo: row.billNo
  1743. },
  1744. })
  1745. }
  1746. } else {
  1747. this.$message.error("未生成货代");
  1748. }
  1749. },
  1750. allClick(name) {
  1751. if (name == '一键保存') {
  1752. for (let row of this.form.agentItemsList) {
  1753. if (!row.billNo || !row.boxType || !row.boxNo || !row.hsCode || !row.goodsType || !row.quantity || !row.netWeight || !row.price || !row.grossWeight) {
  1754. this.$refs.crud.rowCell(row, row.$index)
  1755. return this.$message.error("请完善明细信息");
  1756. }
  1757. this.$set(row, "$cellEdit", false);
  1758. }
  1759. this.submit()
  1760. }
  1761. if (name == '一键编辑') {
  1762. for (let row of this.form.agentItemsList) {
  1763. this.$set(row, "$cellEdit", true);
  1764. }
  1765. }
  1766. if (name == '首款账单') {
  1767. // if (!this.form.domesticConsigneeCname) return this.$message.error("请选择国内收货人");
  1768. bcurrencyGetExrate({ date: this.form.contractDate, dc: 'D' }).then(res => {
  1769. res.data.data.forEach(e => {
  1770. if (this.form.currency == e.code) {
  1771. this.$prompt('账单金额(' + this.form.currency + '):' + this.form.prepaidAmount + '<br/>请输入汇率', '首款账单', {
  1772. confirmButtonText: '确定',
  1773. cancelButtonText: '取消',
  1774. inputValue: e.exrate,
  1775. dangerouslyUseHTMLString: true,
  1776. closeOnClickModal: false,
  1777. }).then(({ value }) => {
  1778. let obj = {}
  1779. obj = {
  1780. ...this.form,
  1781. exchangeRate: value
  1782. }
  1783. generateDownPaymentBill(obj).then(res => {
  1784. this.$message.success("成功生成首款账单");
  1785. this.getDetails(this.form.id)
  1786. })
  1787. })
  1788. }
  1789. })
  1790. })
  1791. }
  1792. if (name == '尾款账单') {
  1793. // if (!this.form.domesticConsigneeCname) return this.$message.error("请选择国内收货人");
  1794. let obj = {}
  1795. obj = {
  1796. ...this.form,
  1797. agentItemsList: this.selectionList
  1798. }
  1799. balancePayment(obj).then(res => {
  1800. this.wkForm = res.data.data
  1801. this.wkForm.amountD = _.subtract(res.data.data.goodsValue, res.data.data.prepaidAmount)
  1802. res.data.data.agentItemsRList.forEach(e => {
  1803. e.$cellEdit = true
  1804. })
  1805. this.wkForm.agentItemsRList = res.data.data.agentItemsRList
  1806. bcurrencyGetExrate({ date: this.form.contractDate, dc: 'D' }).then(res => {
  1807. res.data.data.forEach(e => {
  1808. if (this.form.currency == e.code) {
  1809. this.wkForm.exchangeRate = e.exrate
  1810. }
  1811. })
  1812. })
  1813. })
  1814. this.findObject(this.wkOption.column, "amountD").label = '应收金额';
  1815. this.wkDialog = true
  1816. this.wkType = name
  1817. }
  1818. if (name == '生成首款应付') {
  1819. // if (this.form.applyForPayment == 1) return this.$message.error("请勿重复生成");
  1820. bcurrencyGetExrate({ date: this.form.contractDate, dc: 'D' }).then(res => {
  1821. res.data.data.forEach(e => {
  1822. if (this.form.currency == e.code) {
  1823. this.$prompt('账单金额(' + this.form.currency + '):' + this.form.prepaidAmount + '<br/>请输入汇率', '生成首款应付', {
  1824. confirmButtonText: '确定',
  1825. cancelButtonText: '取消',
  1826. inputValue: e.exrate,
  1827. dangerouslyUseHTMLString: true,
  1828. closeOnClickModal: false,
  1829. }).then(({ value }) => {
  1830. let obj = {}
  1831. obj = {
  1832. id: this.form.id,
  1833. exchangeRate: value,
  1834. paidApplication: 'FFSQ-SK'
  1835. }
  1836. generatePayment(obj).then(res => {
  1837. this.$message.success("生成首款应付成功");
  1838. this.getDetails(this.form.id)
  1839. })
  1840. })
  1841. }
  1842. })
  1843. })
  1844. }
  1845. if (name == '生成尾款应付') {
  1846. // if (this.form.applyForPaymentBalance == 1) return this.$message.error("请勿重复生成");
  1847. // let obj = {}
  1848. // obj = {
  1849. // id: this.form.id,
  1850. // // url: '/tradeAgency/tradeAgency/index',
  1851. // // pageStatus: '',
  1852. // // pageLabel: '贸易代理(T)',
  1853. // paidApplication: 'FFSQ-WK'
  1854. // }
  1855. // generatePayment(obj).then(res => {
  1856. // this.$message.success("生成尾款应付成功");
  1857. // this.getDetails(this.form.id)
  1858. // })
  1859. // for (let index in this.selectionList) {
  1860. // if (this.selectionList[index].applyForPaymentBalance == 1) {
  1861. // return this.$message.error("第" + Number(this.selectionList[index].$index + 1) + "行已生成尾款");
  1862. // }
  1863. // }
  1864. let obj = {}
  1865. obj = {
  1866. ...this.form,
  1867. agentItemsList: this.selectionList
  1868. }
  1869. balancePayment(obj).then(res => {
  1870. this.wkForm = res.data.data
  1871. this.wkForm.amountD = _.subtract(res.data.data.goodsValue, res.data.data.prepaidAmount)
  1872. res.data.data.agentItemsRList.forEach(e => {
  1873. e.$cellEdit = true
  1874. })
  1875. this.wkForm.agentItemsRList = res.data.data.agentItemsRList
  1876. bcurrencyGetExrate({ date: this.form.contractDate, dc: 'C' }).then(res => {
  1877. res.data.data.forEach(e => {
  1878. if (this.form.currency == e.code) {
  1879. this.wkForm.exchangeRate = e.exrate
  1880. }
  1881. })
  1882. })
  1883. })
  1884. this.findObject(this.wkOption.column, "amountD").label = '应付金额';
  1885. this.wkDialog = true
  1886. this.wkType = name
  1887. }
  1888. if (name == '首款撤销申请付款') {
  1889. if (this.form.applyForPayment == 0) return this.$message.error("未申请付款");
  1890. let obj = {}
  1891. obj = {
  1892. id: this.form.id,
  1893. paidApplication: 'FFSQ-SK'
  1894. }
  1895. revokeApplyForPayment(obj).then(res => {
  1896. this.$message.success("撤销申请付款成功");
  1897. this.getDetails(this.form.id)
  1898. })
  1899. }
  1900. if (name == '尾款撤销申请付款') {
  1901. if (this.form.applyForPaymentBalance == 0) return this.$message.error("未申请付款");
  1902. let obj = {}
  1903. obj = {
  1904. id: this.form.id,
  1905. paidApplication: 'FFSQ-WK'
  1906. }
  1907. revokeApplyForPayment(obj).then(res => {
  1908. this.$message.success("撤销申请付款成功");
  1909. this.getDetails(this.form.id)
  1910. })
  1911. }
  1912. if (name == '首款应收待确认通知') {
  1913. this.$confirm("确定发起通知?", {
  1914. confirmButtonText: "确定",
  1915. cancelButtonText: "取消",
  1916. type: "warning"
  1917. }).then(() => {
  1918. let obj = {}
  1919. obj = {
  1920. id: this.form.id,
  1921. url: '/tradeAgency/tradeAgency/index',
  1922. pageStatus: '',
  1923. pageLabel: '贸易代理(T)',
  1924. paidApplication: 'YSQR-SK'
  1925. }
  1926. const loading = this.$loading({
  1927. lock: true,
  1928. text: '加载中',
  1929. spinner: 'el-icon-loading',
  1930. background: 'rgba(255,255,255,0.7)'
  1931. });
  1932. confirmationNotification(obj).then(res => {
  1933. this.$message.success("通知成功");
  1934. }).finally(() => {
  1935. loading.close();
  1936. })
  1937. });
  1938. }
  1939. if (name == '尾款应收待确认通知') {
  1940. this.$confirm("确定发起通知?", {
  1941. confirmButtonText: "确定",
  1942. cancelButtonText: "取消",
  1943. type: "warning"
  1944. }).then(() => {
  1945. let obj = {}
  1946. obj = {
  1947. id: this.form.id,
  1948. url: '/tradeAgency/tradeAgency/index',
  1949. pageStatus: '',
  1950. pageLabel: '贸易代理(T)',
  1951. paidApplication: 'YSQR-WK'
  1952. }
  1953. const loading = this.$loading({
  1954. lock: true,
  1955. text: '加载中',
  1956. spinner: 'el-icon-loading',
  1957. background: 'rgba(255,255,255,0.7)'
  1958. });
  1959. confirmationNotification(obj).then(res => {
  1960. this.$message.success("通知成功");
  1961. }).finally(() => {
  1962. loading.close();
  1963. })
  1964. });
  1965. }
  1966. if (name == '生成货代') {
  1967. this.hdDialog = true
  1968. }
  1969. if (name == '生成申请付款') {
  1970. const loading = this.$loading({
  1971. lock: true,
  1972. text: '加载中',
  1973. spinner: 'el-icon-loading',
  1974. background: 'rgba(255,255,255,0.7)'
  1975. });
  1976. applyForPaymentList({ ids: this.form.id, dc: 'C' }).then(res => {
  1977. // this.getDetails(tshis.form.id)
  1978. }).finally(() => {
  1979. loading.close();
  1980. })
  1981. }
  1982. if (name == '生成申请收款') {
  1983. const loading = this.$loading({
  1984. lock: true,
  1985. text: '加载中',
  1986. spinner: 'el-icon-loading',
  1987. background: 'rgba(255,255,255,0.7)'
  1988. });
  1989. applyForPaymentList({ ids: this.form.id, dc: 'D' }).then(res => {
  1990. // this.getDetails(this.form.id)
  1991. }).finally(() => {
  1992. loading.close();
  1993. })
  1994. }
  1995. },
  1996. submit(type) {
  1997. this.$refs["form"].validate((valid, done) => {
  1998. done();
  1999. if (valid) {
  2000. for (let row of this.form.agentItemsList) {
  2001. if (!row.billNo || !row.boxType || !row.boxNo || !row.hsCode || !row.goodsType || !row.quantity || !row.netWeight || !row.price || !row.grossWeight) {
  2002. this.$refs.crud.rowCell(row, row.$index)
  2003. return this.$message.error("请完善明细信息");
  2004. }
  2005. }
  2006. if (this.$refs.feeInfo.submitValidate()) {
  2007. const loading = this.$loading({
  2008. lock: true,
  2009. text: '加载中',
  2010. spinner: 'el-icon-loading',
  2011. background: 'rgba(255,255,255,0.7)'
  2012. });
  2013. this.form.businessDate = this.form.contractDate
  2014. submit(this.form).then(res => {
  2015. this.$message.success("保存成功");
  2016. if (type == 'goBack') {
  2017. if (this.form.id) {
  2018. this.unLock({
  2019. moduleName: "MYDL",
  2020. tableName: "MYDL_Detail",
  2021. billId: this.form.id,
  2022. billNo: this.form.contractNo
  2023. });
  2024. }
  2025. this.$emit("goBack", type);
  2026. this.$emit('updateKey')
  2027. }
  2028. this.getDetails(res.data.data.id)
  2029. }).finally(() => {
  2030. loading.close();
  2031. })
  2032. }
  2033. } else {
  2034. return false;
  2035. }
  2036. });
  2037. },
  2038. hdSubmit() {
  2039. let obj = {
  2040. ...this.form,
  2041. ...this.hdForm,
  2042. agentItemsList: this.selectionList,
  2043. }
  2044. const loading = this.$loading({
  2045. lock: true,
  2046. text: '加载中',
  2047. spinner: 'el-icon-loading',
  2048. background: 'rgba(255,255,255,0.7)'
  2049. });
  2050. generateFreightForwarder(obj).then(res => {
  2051. this.$message.success("生成货代成功");
  2052. this.hdDialog = false
  2053. this.getDetails(this.form.id)
  2054. }).finally(() => {
  2055. loading.close();
  2056. })
  2057. },
  2058. wkSubmit() {
  2059. if (this.wkType == '尾款账单') {
  2060. generateBalancePaymentBill(this.wkForm).then(res => {
  2061. this.$message.success("成功生成尾款账单");
  2062. this.getDetails(this.form.id)
  2063. this.wkDialog = false
  2064. })
  2065. }
  2066. if (this.wkType == '生成尾款应付') {
  2067. let obj = {}
  2068. obj = {
  2069. ...this.wkForm,
  2070. paidApplication: 'FFSQ-WK'
  2071. }
  2072. generatePayment(obj).then(res => {
  2073. this.$message.success("生成尾款应付成功");
  2074. this.getDetails(this.form.id)
  2075. this.wkDialog = false
  2076. })
  2077. }
  2078. },
  2079. wkClosed() {
  2080. this.wkForm = this.$options.data().wkForm
  2081. this.wkType = null
  2082. },
  2083. hdClosed() {
  2084. this.hdForm = this.$options.data().hdForm
  2085. },
  2086. application() {
  2087. // if (this.form.downPayment != 1) return this.$message.error("未申请首款账单");
  2088. // if (this.form.balancePayment != 1) return this.$message.error("未申请尾款账单");
  2089. // if (this.form.applyForPayment != 1) return this.$message.error("未申请首款付款");
  2090. // if (this.form.applyForPaymentBalance != 1) return this.$message.error("未申请尾款付款");
  2091. this.$confirm("确定请核数据?", {
  2092. confirmButtonText: "确定",
  2093. cancelButtonText: "取消",
  2094. type: "warning"
  2095. }).then(() => {
  2096. let obj = {}
  2097. obj = {
  2098. id: this.form.id,
  2099. url: '/tradeAgency/tradeAgency/index',
  2100. pageStatus: '',
  2101. pageLabel: '贸易代理(T)',
  2102. }
  2103. const loading = this.$loading({
  2104. lock: true,
  2105. text: '加载中',
  2106. spinner: 'el-icon-loading',
  2107. background: 'rgba(255,255,255,0.7)'
  2108. });
  2109. checkAgent(obj).then(res => {
  2110. this.$message.success("请核成功");
  2111. this.getDetails(res.data.data.id)
  2112. }).finally(() => {
  2113. loading.close();
  2114. })
  2115. });
  2116. },
  2117. revokeApplication() {
  2118. this.$confirm("确定撤销请核?", {
  2119. confirmButtonText: "确定",
  2120. cancelButtonText: "取消",
  2121. type: "warning"
  2122. }).then(() => {
  2123. let obj = {}
  2124. obj = {
  2125. id: this.form.id,
  2126. }
  2127. const loading = this.$loading({
  2128. lock: true,
  2129. text: '加载中',
  2130. spinner: 'el-icon-loading',
  2131. background: 'rgba(255,255,255,0.7)'
  2132. });
  2133. revokeCheckAgent(obj).then(res => {
  2134. this.$message.success("撤销请核成功");
  2135. this.getDetails(res.data.data.id)
  2136. this.editDisabled = false
  2137. this.optionForm.disabled = false
  2138. }).finally(() => {
  2139. loading.close();
  2140. })
  2141. });
  2142. },
  2143. //请核关闭
  2144. choceScheduleFun() {
  2145. this.checkScheduleDialog = false
  2146. },
  2147. //自定义列保存
  2148. async saveColumn(ref, option, optionBack, code) {
  2149. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  2150. if (inSave) {
  2151. this.$message.success("保存成功");
  2152. //关闭窗口
  2153. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  2154. }
  2155. },
  2156. //自定义列重置
  2157. async resetColumn(ref, option, optionBack, code) {
  2158. this[option] = this[optionBack];
  2159. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  2160. if (inSave) {
  2161. this.$message.success("重置成功");
  2162. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  2163. }
  2164. },
  2165. goBack(type) {
  2166. if (contrastObj(this.form, this.oldForm) || contrastList(this.form.agentItemsList, this.oldForm.agentItemsList) || contrastList(this.form.feeCenterListD, this.oldForm.feeCenterListD) || contrastList(this.form.feeCenterListC, this.oldForm.feeCenterListC) || contrastList(this.form.filesCenterList, this.oldForm.filesCenterList)) {
  2167. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  2168. confirmButtonText: "确定",
  2169. cancelButtonText: "取消",
  2170. type: "warning"
  2171. })
  2172. .then(() => {
  2173. this.submit('goBack')
  2174. })
  2175. .catch(() => {
  2176. if (this.form.id) {
  2177. this.unLock({
  2178. moduleName: "MYDL",
  2179. tableName: "MYDL_Detail",
  2180. billId: this.form.id,
  2181. billNo: this.form.contractNo
  2182. });
  2183. }
  2184. this.$emit("goBack", type);
  2185. this.$emit('updateKey')
  2186. });
  2187. } else {
  2188. if (this.form.id) {
  2189. this.unLock({
  2190. moduleName: "MYDL",
  2191. tableName: "MYDL_Detail",
  2192. billId: this.form.id,
  2193. billNo: this.form.contractNo
  2194. });
  2195. }
  2196. this.$emit("goBack", type);
  2197. this.$emit('updateKey')
  2198. }
  2199. },
  2200. }
  2201. }
  2202. </script>
  2203. <style lang="scss" scoped>
  2204. ::v-deep .el-form-item {
  2205. margin-bottom: 8px !important;
  2206. }
  2207. ::v-deep .el-table .cell {
  2208. padding: 0 2px !important;
  2209. .el-form-item {
  2210. margin-bottom: 0px !important;
  2211. }
  2212. }
  2213. ::v-deep .avue-crud .el-table .el-form-item__label {
  2214. left: -1px;
  2215. }
  2216. ::v-deep#out-table .back-one {
  2217. background: #ecf5ff !important;
  2218. }
  2219. ::v-deep#out-table .back-two {
  2220. background: #ecf5ff !important;
  2221. }
  2222. ::v-deep .el-table--small td,
  2223. .el-table--small th {
  2224. padding: 2px !important;
  2225. }
  2226. ::v-deep .el-card__body {
  2227. padding: 3px 10px;
  2228. }
  2229. </style>