index.vue 105 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651
  1. <template>
  2. <div>
  3. <basic-container v-show="isShow">
  4. <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" id="out-table"
  5. :header-cell-class-name="headerClassName" :permission="permissionList" :before-open="beforeOpen"
  6. v-model="form" ref="crud" :search.sync="query" @row-update="rowUpdate" @row-save="rowSave"
  7. @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset"
  8. @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
  9. @refresh-change="refreshChange" @on-load="onLoad" :row-style="rowStyle" :summary-method="summaryMethod"
  10. @resetColumn="resetColumn('crud', 'option', 'optionBack', 309)"
  11. @saveColumn="saveColumn('crud', 'option', 'optionBack', 309)">
  12. <template slot-scope="{ disabled, size }" slot="billSortSearch">
  13. <el-radio-group v-model="query.billSort">
  14. <el-radio label="1">ETD</el-radio>
  15. <el-radio label="2">提单号</el-radio>
  16. <el-radio label="3">分单号</el-radio>
  17. </el-radio-group>
  18. </template>
  19. <template slot="menuLeft">
  20. <el-button type="primary" size="small" @click="addbtnfun('DD')">
  21. {{ $t("seSeaibllsList.buttonBillTypeDD") }}
  22. </el-button>
  23. <el-button type="success" size="small" @click="addbtnfun('MM')">
  24. {{ $t("seSeaibllsList.buttonBillTypeMM") }}
  25. </el-button>
  26. <el-button type="warning" size="small" @click="addbtnfun('MH')">
  27. {{ $t("seSeaibllsList.buttonBillTypeMH") }}
  28. </el-button>
  29. <el-button type="primary" size="small" plain @click="CopyDocumentsfun">复制
  30. </el-button>
  31. <el-button type="primary" size="small" @click="allClick('修改单据类型')">修改单据类型
  32. </el-button>
  33. <el-button type="success" size="small" plain @click="increaseMawb">分单->主单
  34. </el-button>
  35. <el-button type="warning" size="small" plain v-if="query.billStatus != 1" @click="Disembarkingfun">退
  36. </el-button>
  37. <el-button type="primary" size="small" plain v-if="query.billStatus == 1"
  38. @click="revokeWithdrawalfun">撤销退舱
  39. </el-button>
  40. <el-button type="danger" size="small" plain v-if="query.billStatus != 3" @click="handleDelete">删 除
  41. </el-button>
  42. <el-button type="warning" size="small" @click="outExport">导 出
  43. </el-button>
  44. <el-button
  45. v-if="roleName.indexOf('admin') >= 0 || roleName.indexOf('应收修改') >= 0 || roleName.indexOf('应收查看') >= 0"
  46. type="primary" size="small" @click="templateImport('D')" :disabled="!selectionList.length">模板(收)
  47. </el-button>
  48. <el-button
  49. v-if="roleName.indexOf('admin') >= 0 || roleName.indexOf('应付修改') >= 0 || roleName.indexOf('应付查看') >= 0"
  50. type="warning" size="small" @click="templateImport('C')" :disabled="!selectionList.length">模板(付)
  51. </el-button>
  52. <el-button
  53. v-if="isHq == 1 && (roleName.indexOf('admin') >= 0 || roleName.indexOf('应付修改') >= 0 || roleName.indexOf('应付查看') >= 0)"
  54. type="primary" plain size="small" @click="checkSubmit"
  55. :disabled="!selectionList.length">提取成本</el-button>
  56. <!-- <el-button type="success" plain size="small" @click="freightRateSubmit"
  57. :disabled="!selectionList.length">提取运价</el-button>-->
  58. <el-button
  59. v-if="roleName.indexOf('admin') >= 0 || roleName.indexOf('应收修改') >= 0 || roleName.indexOf('应收查看') >= 0"
  60. type="primary" size="small" @click="pleaseVerify('D')" :disabled="!selectionList.length">提交收
  61. </el-button>
  62. <el-button
  63. v-if="roleName.indexOf('admin') >= 0 || roleName.indexOf('应付修改') >= 0 || roleName.indexOf('应付查看') >= 0"
  64. type="warning" size="small" @click="pleaseVerify('C')" :disabled="!selectionList.length">提交付
  65. </el-button>
  66. <el-button type="success" size="small" @click="checkBills" :disabled="!selectionList.length">请核
  67. </el-button>
  68. <!-- <el-dropdown style="line-height: 0">
  69. <el-button size="small" type="success" style="margin-right: 8px"
  70. :disabled="selectionList.length == 0">
  71. 发送 SO EDI<i class="el-icon-arrow-down el-icon--right"></i>
  72. </el-button>
  73. <el-dropdown-menu slot="dropdown">
  74. <el-dropdown-item v-for="item in ediData_SO" :key="item.id"
  75. @click.native="editypesSendingEdifun(item)">{{ item.cnName }}
  76. </el-dropdown-item>
  77. </el-dropdown-menu>
  78. </el-dropdown> -->
  79. <!-- <el-dropdown style="line-height: 0">
  80. <el-button size="small" type="success" style="margin-right: 8px"
  81. :disabled="selectionList.length == 0">
  82. 发送 SI EDI<i class="el-icon-arrow-down el-icon--right"></i>
  83. </el-button>
  84. <el-dropdown-menu slot="dropdown">
  85. <el-dropdown-item v-for="item in ediData_SI" :key="item.id"
  86. @click.native="editypesSendingEdifun(item)">{{ item.cnName }}
  87. </el-dropdown-item>
  88. </el-dropdown-menu>
  89. </el-dropdown> -->
  90. <div style="margin-top: 10px">
  91. <el-tabs type="card" v-model="query.billStatus" @tab-click="handleClick">
  92. <el-tab-pane v-if="!(roleName.indexOf('总部中心') >= 0)" label="接单" name="0">
  93. <span slot="label">接单</span>
  94. </el-tab-pane>
  95. <el-tab-pane v-if="!(roleName.indexOf('总部中心') >= 0)" label="出号" name="4">
  96. <span slot="label">出号</span>
  97. </el-tab-pane>
  98. <el-tab-pane v-if="!(roleName.indexOf('总部中心') >= 0)" label="开船" name="5">
  99. <span slot="label">开船</span>
  100. </el-tab-pane>
  101. <el-tab-pane v-if="!(roleName.indexOf('总部中心') >= 0)" label="到港" name="6">
  102. <span slot="label">到港</span>
  103. </el-tab-pane>
  104. <el-tab-pane v-if="!(roleName.indexOf('总部中心') >= 0)" label="退舱" name="1">
  105. <span slot="label" style="color: #d86363">退舱</span>
  106. </el-tab-pane>
  107. <el-tab-pane v-if="roleName.indexOf('总部中心') >= 0" label="待处理" name="11">
  108. <span slot="label">待处理</span>
  109. </el-tab-pane>
  110. <el-tab-pane v-if="roleName.indexOf('总部中心') >= 0" label="待请核" name="12">
  111. <span slot="label">待请核</span>
  112. </el-tab-pane>
  113. <el-tab-pane label="完成" name="3"></el-tab-pane>
  114. <el-tab-pane label="全部" name="7"></el-tab-pane>
  115. </el-tabs>
  116. </div>
  117. </template>
  118. <template slot-scope="scope" slot="menu">
  119. <!--:disabled="saberUserInfo.role_name.indexOf('允许修改他人业务') == -1?saberUserInfo.user_id != scope.row.createUser:false"-->
  120. <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit"
  121. @click.stop="rowCellfun(scope.row.id, scope.row)">编辑
  122. </el-button>
  123. </template>
  124. <!-- <template slot="expand" slot-scope="{row}">
  125. <SplitList :typeMenu="true" :data="row.billsListAllData" :loading="SplitLoading"
  126. @corpfun="rowCellfun">
  127. </SplitList>
  128. </template> -->
  129. <temolate slot="billStatus" slot-scope="{ row }">
  130. <div>
  131. <span v-if="row.billStatus == item.dictKey" v-for="(item, index) in billStatusData" :key="index"
  132. :style="{ 'background-color': item.colour }"
  133. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;">
  134. {{ item.dictValue }}
  135. </span>
  136. </div>
  137. </temolate>
  138. <template slot="accountStatus" slot-scope="{ row }">
  139. <div>
  140. <span v-if="row.accountStatus == item.dictKey" v-for="(item, index) in accountStatusData"
  141. :key="index" :style="{ 'background-color': item.colour }"
  142. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;">
  143. {{ item.dictValue }}
  144. </span>
  145. </div>
  146. </template>
  147. <template slot="whetherModify" slot-scope="{ row }">
  148. <div>
  149. <span v-if="row.whetherModify == item.dictKey" v-for="(item, index) in khdcStatus" :key="index"
  150. :style="{ 'background-color': item.colour }"
  151. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;">
  152. {{ item.dictValue }}
  153. </span>
  154. </div>
  155. </template>
  156. <!-- <template slot="status" slot-scope="{ row }">
  157. <div>
  158. <span v-if="row.status == item.dictKey" v-for="(item, index) in auditStatusList" :key="index"
  159. :style="{ 'background-color': item.colour }"
  160. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;">
  161. {{ item.dictValue }}
  162. </span>
  163. </div>
  164. </template> -->
  165. <template slot="corpCnName" slot-scope="scope">
  166. <span
  167. style="color: #1e9fff;cursor: pointer;width: 100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;"
  168. @click.stop="rowCellfun(scope.row.id, scope.row)">
  169. {{ scope.row.shortName }}
  170. </span>
  171. </template>
  172. <template slot="billNo" slot-scope="scope">
  173. <span
  174. style="color: #1e9fff;cursor: pointer;width: 100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;"
  175. @click.stop="rowCellfun(scope.row.id, scope.row)">
  176. {{ scope.row.billNo }}
  177. </span>
  178. </template>
  179. <template slot="eta" slot-scope="scope">
  180. <span>{{
  181. scope.row.eta ? scope.row.eta.slice(0, 10) : ""
  182. }}</span>
  183. </template>
  184. <template slot="updateTime" slot-scope="scope">
  185. <span>{{
  186. scope.row.updateTime
  187. ? scope.row.updateTime.slice(0, 10)
  188. : ""
  189. }}</span>
  190. </template>
  191. <template slot="checkDrStatusDescr" slot-scope="{ row }">
  192. <div>
  193. <span v-if="row.checkDrStatusDescr == '未对账'"
  194. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #67C23A;">
  195. 未对账
  196. </span>
  197. <span v-if="row.checkDrStatusDescr == '已对账'"
  198. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #409EFF;">
  199. 已对账
  200. </span>
  201. <span v-if="row.checkDrStatusDescr == '部分对账'"
  202. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #F56C6C;">
  203. 部分对账
  204. </span>
  205. </div>
  206. </template>
  207. <template slot="stlDrStatusDescr" slot-scope="{ row }">
  208. <div>
  209. <span v-if="row.stlDrStatusDescr == '未结'"
  210. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #67C23A;">
  211. 未结
  212. </span>
  213. <span v-if="row.stlDrStatusDescr == '已结'"
  214. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #409EFF;">
  215. 已结
  216. </span>
  217. <span v-if="row.stlDrStatusDescr == '部分结'"
  218. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #F56C6C;">
  219. 部分结
  220. </span>
  221. </div>
  222. </template>
  223. <template slot="stlCrStatusDescr" slot-scope="{ row }">
  224. <div>
  225. <span v-if="row.stlCrStatusDescr == '未结'"
  226. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #67C23A;">
  227. 未结
  228. </span>
  229. <span v-if="row.stlCrStatusDescr == '结清'"
  230. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #409EFF;">
  231. 结清
  232. </span>
  233. <span v-if="row.stlCrStatusDescr == '部分'"
  234. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #F56C6C;">
  235. 部分
  236. </span>
  237. </div>
  238. </template>
  239. <template slot="stlCrStatusDescr" slot-scope="{ row }">
  240. <div>
  241. <span v-if="row.stlCrStatusDescr == '未结'"
  242. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #67C23A;">
  243. 未结
  244. </span>
  245. <span v-if="row.stlCrStatusDescr == '结清'"
  246. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #409EFF;">
  247. 结清
  248. </span>
  249. <span v-if="row.stlCrStatusDescr == '部分'"
  250. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #F56C6C;">
  251. 部分
  252. </span>
  253. </div>
  254. </template>
  255. <template slot="invoiceDrStatusDescr" slot-scope="{ row }">
  256. <div>
  257. <span v-if="row.invoiceDrStatusDescr == '未开'"
  258. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #67C23A;">
  259. 未开
  260. </span>
  261. <span v-if="row.invoiceDrStatusDescr == '部分'"
  262. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #409EFF;">
  263. 部分
  264. </span>
  265. <span v-if="row.invoiceDrStatusDescr == '全开'"
  266. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #F56C6C;">
  267. 全开
  268. </span>
  269. </div>
  270. </template>
  271. <template slot="checkCrStatusDescr" slot-scope="{ row }">
  272. <div>
  273. <span v-if="row.checkCrStatusDescr == '未申请'"
  274. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #67C23A;">
  275. 未申请
  276. </span>
  277. <span v-if="row.checkCrStatusDescr == '部分申请'"
  278. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #409EFF;">
  279. 部分申请
  280. </span>
  281. <span v-if="row.checkCrStatusDescr == '已申请'"
  282. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;background-color: #F56C6C;">
  283. 已申请
  284. </span>
  285. </div>
  286. </template>
  287. <template slot="billOfLadingStatus" slot-scope="{ row }">
  288. <div>
  289. <span v-if="row.billOfLadingStatus == item.dictValue"
  290. v-for="(item, index) in billOfLadingStatusData" :key="index"
  291. :style="{ 'background-color': item.colour }"
  292. style="color: #fff;border-radius: 30px;padding: 2px 15px;text-align: center;">
  293. {{ item.dictValue }}
  294. </span>
  295. </div>
  296. </template>
  297. <template slot="logisticsStatus" slot-scope="{ row }">
  298. <span v-if="row.logisticsStatus == '录入'"
  299. style="color: #fff;border-radius: 30px;padding: 2px 15px;background-color: #409EFF;">{{
  300. row.logisticsStatus }}</span>
  301. <span v-if="row.logisticsStatus != '录入'"
  302. style="color: #fff;border-radius: 30px;padding: 2px 15px;background-color: #67C23A;">{{
  303. row.logisticsStatus }}</span>
  304. </template>
  305. <template slot="transferOrderStatus" slot-scope="{ row }">
  306. <span v-if="row.transferOrderStatus == '录入'"
  307. style="color: #fff;border-radius: 30px;padding: 2px 15px;background-color: #409EFF;">{{
  308. row.transferOrderStatus }}</span>
  309. <span v-if="row.transferOrderStatus != '录入'"
  310. style="color: #fff;border-radius: 30px;padding: 2px 15px;background-color: #67C23A;">{{
  311. row.transferOrderStatus }}</span>
  312. </template>
  313. </avue-crud>
  314. </basic-container>
  315. <bills-details ref="billsDetails" v-if="!isShow" :detailData="detailData" :pageIds="pageIds" @goBack="goBack"
  316. @toAddEdit="toAddEdit" :key="datekey"></bills-details>
  317. <el-dialog title="主单列表" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
  318. <avue-crud :option="mawbOptionBack" :table-loading="mawbloading" :data="mawbData" :page.sync="mawbPage"
  319. :search="mawbQuery" ref="mawbOptionCrud" id="out-table" :header-cell-class-name="headerClassName"
  320. @search-change="mawbSearch" @size-change="mawbSizeChange" @current-change="mawbCurrentChange"
  321. @resetColumn="resetColumnTwo('mawbOptionCrud', 309.7)" @saveColumn="
  322. saveColumnTwo('mawbOptionCrud', mawbOptionBack, 309.7)
  323. ">
  324. <template slot="radio" slot-scope="{ row }">
  325. <el-radio style="margin-left: 8px;" v-model="dialogRadio" :label="row.id"
  326. @input="radioInput(row)">&nbsp;</el-radio>
  327. </template>
  328. </avue-crud>
  329. <span slot="footer" class="dialog-footer">
  330. <el-button @click="
  331. dialogVisible = false;
  332. dialogRadio = null;
  333. ">取 消</el-button>
  334. <el-button type="primary" @click="AddToMainOrder">确 定</el-button>
  335. </span>
  336. </el-dialog>
  337. <el-dialog append-to-body title="费用模板" :visible.sync="templateDialog" width="60%" :before-close="handleClose">
  338. <span>
  339. <el-row>
  340. <el-col :span="5">
  341. <el-scrollbar>
  342. <basic-container>
  343. <avue-tree :option="treeOption" :data="templateData" @node-click="nodeClick">
  344. </avue-tree>
  345. </basic-container>
  346. </el-scrollbar>
  347. </el-col>
  348. <el-col :span="19">
  349. <avue-crud :data="templateList" :option="templateOption"></avue-crud>
  350. </el-col>
  351. </el-row>
  352. </span>
  353. <span slot="footer" class="dialog-footer">
  354. <el-button @click="templateDialog = false" size="mini">取 消</el-button>
  355. <el-button type="primary" @click="importTemplate" size="mini">导 入</el-button>
  356. </span>
  357. </el-dialog>
  358. <extraction-cost ref="extractionCost" />
  359. <freight-rate ref="freightRate" @refreshPage="refreshChange"></freight-rate>
  360. </div>
  361. </template>
  362. <script>
  363. import {
  364. billsList,
  365. billsDetail,
  366. billsSubmit,
  367. billsRemove,
  368. billsIncreaseReinsurancePolicy,
  369. billsListAll,
  370. billsDisembarking,
  371. editypesSendingEdi,
  372. updateBillType,
  373. billsRevokeDisembarking,
  374. templateImportBatch,
  375. checkBillsBatch,
  376. increaseReinsurancePolicyTeu,
  377. pleaseVerifyCostBatch
  378. } from "@/api/iosBasicData/bills";
  379. import { mapGetters } from "vuex";
  380. import billsDetails from "@/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue";
  381. import feesTemplateItems from "@/views/iosBasicData/losbfeestemplate/feesTemplateItems.vue";
  382. import SplitList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/SplitList.vue";
  383. import { getWorkDicts } from "@/api/system/dictbiz";
  384. import { dateFormat, defaultDate } from "@/util/date";
  385. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  386. import freightRate from "@/views/iosBasicData/SeafreightExportF/bills/assembly/freightRate.vue";
  387. import { editypesList } from "@/api/iosBasicData/editypes";
  388. import { getBvesselsList } from "@/api/iosBasicData/bvessels";
  389. import {
  390. getBcorpslistByType,
  391. getBcorpsDetail
  392. } from "@/api/iosBasicData/bcorps";
  393. import { bportsList } from "@/api/iosBasicData/bports";
  394. import { blinesList } from "@/api/iosBasicData/blines";
  395. import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
  396. import extractionCost from "@/components/extractionCost/main.vue";
  397. import { getDeptTree } from "@/api/system/dept";
  398. import { getToken } from "@/util/auth";
  399. import { getListTemplate, getListTemplatelist } from "@/api/iosBasicData/losbfeestemplate";
  400. export default {
  401. components: {
  402. TreeSelect,
  403. SearchQuery,
  404. feesTemplateItems,
  405. billsDetails,
  406. SplitList,
  407. extractionCost,
  408. freightRate
  409. },
  410. data() {
  411. return {
  412. billOfLadingStatusData:[],
  413. isHq: JSON.parse(localStorage.getItem('user-Information')).isHq,
  414. radioRow: {},
  415. roleName: [], // 当前登录人的角色权限
  416. dcDic: [
  417. {
  418. label: '收',
  419. value: 'D'
  420. },
  421. {
  422. label: '付',
  423. value: 'C'
  424. }
  425. ],
  426. selectionTemplateList: [],
  427. treeOption: {
  428. nodeKey: "id",
  429. // lazy: true,
  430. addBtn: false,
  431. menu: false,
  432. size: "small",
  433. props: {
  434. labelText: "标题",
  435. label: "cnName",
  436. value: "value",
  437. children: "children"
  438. }
  439. },
  440. dc: null,
  441. templateId: null,
  442. templateData: [],
  443. templateList: [],
  444. templateOption: {
  445. height: 500,
  446. menu: false,
  447. addBtn: false,
  448. editBtn: false,
  449. delBtn: false,
  450. viewBtn: false,
  451. header: false,
  452. index: true,
  453. tip: false,
  454. // selection: true,
  455. column: [
  456. {
  457. label: '类别',
  458. prop: 'type',
  459. overHidden: true,
  460. },
  461. {
  462. label: '费用',
  463. prop: 'feeCnName',
  464. overHidden: true,
  465. },
  466. {
  467. label: '计量单位',
  468. prop: 'unitNo',
  469. overHidden: true,
  470. },
  471. {
  472. label: '单价',
  473. prop: 'salesPrice',
  474. overHidden: true,
  475. },
  476. {
  477. label: '币别',
  478. prop: 'curCode',
  479. overHidden: true,
  480. },
  481. {
  482. label: '结算单位',
  483. prop: 'corpCnName',
  484. overHidden: true,
  485. },
  486. ]
  487. },
  488. templateDialog: false,
  489. datekey: Date.now(),
  490. ediData: [], // 获取的 edi 数据
  491. ediData_SO: [], // 获取的 SO edi 数据
  492. ediData_SI: [], // 获取的 SI edi 数据
  493. // 展开和收回
  494. fold: false,
  495. maxShow: 3,
  496. corpData: [], //委托人
  497. hConsigneeData: [], // 收货人
  498. // 船名
  499. vesselData: [],
  500. // 船公司
  501. carrierData: [],
  502. // 目的港(卸货港)
  503. podData: [],
  504. // 航线
  505. lineData: [],
  506. // 场站
  507. cyData: [],
  508. // 订舱代理
  509. bookingAgentData: [],
  510. createDeptData: [], // 部门数据
  511. auditStatusList: [],
  512. // 单据类型
  513. billTypeData: [
  514. {
  515. label: "直单",
  516. value: "DD"
  517. },
  518. {
  519. label: "主单",
  520. value: "MM"
  521. },
  522. {
  523. label: "分单",
  524. value: "MH"
  525. }
  526. ],
  527. // 业务来源
  528. srcTypeData: [
  529. {
  530. label: "公司",
  531. value: "OWN"
  532. },
  533. {
  534. label: "代理",
  535. value: "AGENT"
  536. },
  537. {
  538. label: "业务员",
  539. value: "SALES"
  540. }
  541. ],
  542. // 签单方式
  543. issueTypeData: [],
  544. isShow: true,
  545. detailData: {},
  546. dialogVisible: false, // 弹窗开启V
  547. // ETD是否可以检索
  548. etdDisabled: false,
  549. // ETA是否可以检索
  550. etaDisabled: false,
  551. form: {},
  552. // 开船日期和到港日期
  553. etdList: [
  554. defaultDate(1)[0] + " 00:00",
  555. defaultDate(1)[1] + " 23:59"
  556. ],
  557. etaList: [
  558. defaultDate(1)[0] + " 00:00",
  559. defaultDate(1)[1] + " 23:59"
  560. ],
  561. // 表格的检索条件
  562. query: {
  563. billStatus: "0",
  564. billSort: "1"
  565. },
  566. // 弹窗的搜索项
  567. mawbQuery: {
  568. billType: "MM"
  569. },
  570. loading: true,
  571. // 弹窗加载
  572. mawbloading: false,
  573. // 下拉的加载
  574. SplitLoading: false,
  575. page: {
  576. pageSize: 10,
  577. currentPage: 1,
  578. total: 0,
  579. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 500]
  580. },
  581. // 弹窗分页
  582. mawbPage: {
  583. pageSize: 10,
  584. currentPage: 1,
  585. total: 0
  586. },
  587. selectionList: [],
  588. // 弹窗的选择数据
  589. dialogRadio: null,
  590. option: {},
  591. optionBack: {
  592. // selectable:(row,index)=>{
  593. // // 禁用主单
  594. // return row.billType != 'MM'
  595. // },
  596. // expand: true,
  597. // expandRowKeys: [],
  598. rowKey: "id",
  599. height: 500,
  600. calcHeight: 30,
  601. tip: false,
  602. searchShow: true,
  603. searchMenuSpan: 24,
  604. searchLabelWidth: "100",
  605. border: true,
  606. index: true,
  607. selection: true, // 是否有选择框
  608. dialogClickModal: false,
  609. highlightCurrentRow: true, // 单选
  610. searchIcon: true,
  611. searchIndex: 3,
  612. // stripe: true,
  613. addBtn: false,
  614. viewBtn: false,
  615. delBtn: false,
  616. editBtn: false,
  617. menuWidth: "auto",
  618. align: "center",
  619. showSummary: true,
  620. column: [
  621. {
  622. label: this.$t("seSeaibllsList.branchName"),
  623. prop: "branchId",
  624. width: "120",
  625. overHidden: true,
  626. hide: true,
  627. //showColumn: false,
  628. type: "select",
  629. filterable: true,
  630. dicUrl: "/api/blade-system/dept/lazy-list",
  631. props: {
  632. label: "deptName",
  633. value: "id",
  634. },
  635. search: false,
  636. searchOrder: 1
  637. },
  638. {
  639. label: this.$t("seSeaibllsList.branchName"),
  640. prop: "branchName",
  641. width: "120",
  642. overHidden: true,
  643. hide: true,
  644. //showColumn: false,
  645. },
  646. {
  647. label: this.$t("seSeaibllsList.corpName"),
  648. prop: "corpCnName",
  649. width: "160",
  650. overHidden: true,
  651. search: true,
  652. type: "select",
  653. filterable: true,
  654. remote: true,
  655. dicUrl: "/api/blade-los/bcorps/listByType?shortName={{key}}",
  656. props: {
  657. label: "cnName",
  658. value: "cnName",
  659. res: "data.records"
  660. },
  661. span: 6,
  662. searchOrder: 1.1
  663. },
  664. // {
  665. // label: '箱属',
  666. // prop: 'boxBelongsTo',
  667. // width: 100,
  668. // overHidden: true,
  669. // disabled: true,
  670. // },
  671. {
  672. label: "MB/L NO",
  673. prop: "mblno",
  674. width: "160",
  675. overHidden: true,
  676. search: true,
  677. span: 6,
  678. searchOrder: 2
  679. },
  680. {
  681. label: "HB/L NO",
  682. prop: "hblno",
  683. width: "160",
  684. overHidden: true,
  685. search: true,
  686. span: 6,
  687. searchOrder: 3
  688. },
  689. {
  690. label: "主业务编号",
  691. prop: "masterBillNo",
  692. width: "100",
  693. overHidden: true
  694. },
  695. {
  696. label: "分单数",
  697. prop: "splitOrderSum",
  698. width: "100",
  699. overHidden: true
  700. },
  701. {
  702. label: "单据类型",
  703. prop: "billType",
  704. type: "select",
  705. search: true,
  706. span: 6,
  707. searchOrder: 3.1,
  708. dicData: [
  709. {
  710. label: "直单",
  711. value: "DD"
  712. },
  713. {
  714. label: "主单",
  715. value: "MM"
  716. },
  717. {
  718. label: "分单",
  719. value: "MH"
  720. }
  721. ],
  722. overHidden: true
  723. },
  724. {
  725. label: "单据编号",
  726. prop: "billNo",
  727. width: "160",
  728. overHidden: true,
  729. search: true,
  730. span: 6,
  731. searchOrder: 4
  732. },
  733. {
  734. label: '来源单号',
  735. prop: "temporaryNo",
  736. width: "100",
  737. search: true,
  738. overHidden: true,
  739. },
  740. {
  741. label: "船名",
  742. prop: "vesselCnName",
  743. width: "120",
  744. overHidden: true,
  745. type: "select",
  746. filterable: true,
  747. remote: true,
  748. dicUrl: "/api/blade-los/bvessels/list?enName={{key}}",
  749. props: {
  750. label: "enName",
  751. value: "enName",
  752. res: "data.records"
  753. },
  754. search: true,
  755. span: 6,
  756. searchOrder: 5,
  757. hide: true,
  758. //showColumn: false
  759. },
  760. {
  761. label: "船名",
  762. width: "120",
  763. prop: "vesselEnName",
  764. overHidden: true
  765. },
  766. {
  767. label: "航次",
  768. prop: "voyageNo",
  769. width: "80",
  770. overHidden: true,
  771. search: true,
  772. span: 6,
  773. searchOrder: 6
  774. },
  775. {
  776. label: "客服",
  777. prop: "customerServiceName",
  778. width: "80",
  779. overHidden: true,
  780. },
  781. {
  782. label: "OP",
  783. prop: "operatorId",
  784. width: "120",
  785. overHidden: true,
  786. type: "select",
  787. filterable: true,
  788. remote: true,
  789. dicUrl: "/api/blade-user/userListAll?roleAlias=操作员&realName={{key}}",
  790. props: {
  791. label: "realName",
  792. value: "id",
  793. },
  794. search: true,
  795. span: 6,
  796. searchOrder: 7
  797. },
  798. {
  799. label: "开船日期",
  800. prop: "etd",
  801. width: "120",
  802. searchProp: "etdList",
  803. type: "date",
  804. unlinkPanels: true,
  805. searchRange: true,
  806. overHidden: true,
  807. format: "yyyy-MM-dd",
  808. valueFormat: "yyyy-MM-dd HH:mm:ss",
  809. searchDefaultTime: ["00:00:00", "23:59:59"],
  810. search: true,
  811. span: 6,
  812. searchOrder: 8
  813. },
  814. {
  815. label: "到港日期",
  816. prop: "eta",
  817. width: "120",
  818. overHidden: true,
  819. searchProp: "etaList",
  820. type: "date",
  821. unlinkPanels: true,
  822. searchRange: true,
  823. format: "yyyy-MM-dd",
  824. valueFormat: "yyyy-MM-dd HH:mm:ss",
  825. searchDefaultTime: ["00:00:00", "23:59:59"],
  826. search: true,
  827. span: 6,
  828. searchOrder: 9
  829. },
  830. {
  831. label: "承运人",
  832. prop: "carrierEnName",
  833. overHidden: true,
  834. type: "select",
  835. filterable: true,
  836. remote: true,
  837. dicUrl: "/api/blade-los/bcorps/listByType?corpTypeName=船公司&enName={{key}}",
  838. props: {
  839. label: "enName",
  840. value: "enName",
  841. res: "data.records"
  842. },
  843. search: true,
  844. span: 6,
  845. searchOrder: 10,
  846. // hide: true,
  847. },
  848. {
  849. label: '箱属',
  850. prop: 'boxBelongsTo',
  851. overHidden: true,
  852. type: 'select',
  853. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxBelongsTo",
  854. props: {
  855. label: "dictValue",
  856. value: "dictValue"
  857. },
  858. search: true,
  859. searchOrder: 10.1
  860. },
  861. {
  862. label: "装货港",
  863. prop: "polEnName",
  864. width: "120",
  865. overHidden: true,
  866. type: "select",
  867. filterable: true,
  868. remote: true,
  869. dicUrl: "/api/blade-los/bports/list?enName={{key}}",
  870. props: {
  871. label: "enName",
  872. value: "enName",
  873. res: "data.records"
  874. },
  875. search: true,
  876. span: 6,
  877. searchOrder: 10.3
  878. },
  879. {
  880. label: "卸货港",
  881. prop: "podEnName",
  882. width: "120",
  883. overHidden: true,
  884. type: "select",
  885. filterable: true,
  886. remote: true,
  887. dicUrl: "/api/blade-los/bports/list?enName={{key}}",
  888. props: {
  889. label: "enName",
  890. value: "enName",
  891. res: "data.records"
  892. },
  893. search: true,
  894. span: 6,
  895. searchOrder: 10.5
  896. },
  897. {
  898. label: "交货地",
  899. prop: "placeDeliveryName",
  900. width: "120",
  901. overHidden: true,
  902. type: "select",
  903. filterable: true,
  904. remote: true,
  905. dicUrl: "/api/blade-los/bports/list?enName={{key}}",
  906. props: {
  907. label: "enName",
  908. value: "enName",
  909. res: "data.records"
  910. },
  911. search: true,
  912. span: 6,
  913. searchOrder: 11
  914. },
  915. {
  916. label: "航线",
  917. prop: "lineCnName",
  918. width: "120",
  919. overHidden: true,
  920. type: "select",
  921. filterable: true,
  922. remote: true,
  923. dicUrl: "/api/blade-los/blines/list?cnName={{key}}",
  924. props: {
  925. label: "cnName",
  926. value: "cnName",
  927. res: "data.records"
  928. },
  929. search: true,
  930. span: 6,
  931. searchOrder: 12
  932. },
  933. {
  934. label: "场站",
  935. prop: "cyCnName",
  936. width: "120",
  937. overHidden: true,
  938. type: "select",
  939. filterable: true,
  940. remote: true,
  941. dicUrl:
  942. "/api/blade-los/bcorps/listByType?cnName={{key}}",
  943. props: {
  944. label: "cnName",
  945. value: "cnName",
  946. res: "data.records"
  947. },
  948. search: true,
  949. span: 6,
  950. searchOrder: 13,
  951. },
  952. {
  953. label: "箱型/箱量",
  954. prop: "quantityCntrDescr",
  955. width: "120",
  956. overHidden: true
  957. },
  958. {
  959. label: '接单状态',
  960. prop: 'billOfLadingStatus',
  961. overHidden: true,
  962. width:100,
  963. },
  964. {
  965. label: "物流状态",
  966. prop: "logisticsStatus",
  967. type: "select",
  968. search: true,
  969. span: 6,
  970. searchOrder: 3.2,
  971. dicData: [
  972. {
  973. label: "录入",
  974. value: "录入"
  975. },
  976. {
  977. label: "已提交",
  978. value: "已提交"
  979. }
  980. ],
  981. overHidden: true
  982. },
  983. {
  984. label: "转单状态",
  985. prop: "transferOrderStatus",
  986. width: "100",
  987. type: "select",
  988. search: true,
  989. span: 6,
  990. searchOrder: 3.3,
  991. dicData: [
  992. {
  993. label: "录入",
  994. value: "录入"
  995. },
  996. {
  997. label: "已转单",
  998. value: "已转单"
  999. }
  1000. ],
  1001. overHidden: true
  1002. },
  1003. {
  1004. label: "业务来源",
  1005. prop: "srcType",
  1006. type: "select",
  1007. dicData: [
  1008. {
  1009. label: "公司",
  1010. value: "OWN"
  1011. },
  1012. {
  1013. label: "代理",
  1014. value: "AGENT"
  1015. },
  1016. {
  1017. label: "业务员",
  1018. value: "SALES"
  1019. }
  1020. ],
  1021. overHidden: true,
  1022. search: true,
  1023. span: 6,
  1024. searchOrder: 14
  1025. },
  1026. {
  1027. label: "来源详情",
  1028. prop: "srcCnName",
  1029. width: "80",
  1030. overHidden: true,
  1031. search: true,
  1032. span: 6,
  1033. searchOrder: 15
  1034. },
  1035. {
  1036. label: "货物类别",
  1037. prop: "cargoType",
  1038. type: "select",
  1039. dicData: [
  1040. {
  1041. label: "普货",
  1042. value: "dry"
  1043. },
  1044. {
  1045. label: "危险品",
  1046. value: "danger"
  1047. },
  1048. {
  1049. label: "冻柜",
  1050. value: "reefer"
  1051. }
  1052. ],
  1053. overHidden: true
  1054. },
  1055. {
  1056. label: "订舱代理",
  1057. prop: "bookingAgentCnName",
  1058. width: "120",
  1059. overHidden: true,
  1060. },
  1061. {
  1062. label: "收发货人",
  1063. prop: "receivingAndShipping",
  1064. width: "120",
  1065. overHidden: true,
  1066. search: true,
  1067. span: 6,
  1068. searchOrder: 18
  1069. },
  1070. {
  1071. label: "唛头",
  1072. prop: "marks",
  1073. width: "80",
  1074. overHidden: true
  1075. },
  1076. {
  1077. label: "件数",
  1078. prop: "quantity",
  1079. overHidden: true
  1080. },
  1081. {
  1082. label: "毛重 (KGM)",
  1083. prop: "grossWeight",
  1084. width: "120",
  1085. overHidden: true
  1086. },
  1087. {
  1088. label: "体积 (CBM)",
  1089. prop: "measurement",
  1090. width: "120",
  1091. overHidden: true
  1092. },
  1093. {
  1094. label: "TEU箱数",
  1095. prop: "teu",
  1096. width: "100",
  1097. overHidden: true
  1098. },
  1099. {
  1100. label: "订舱TEU",
  1101. prop: "teuTotal",
  1102. width: "100",
  1103. overHidden: true
  1104. },
  1105. {
  1106. label: "20GP",
  1107. prop: "quantityV20",
  1108. width: "100",
  1109. overHidden: true
  1110. },
  1111. {
  1112. label: "40GP",
  1113. prop: "quantityV40",
  1114. width: "100",
  1115. overHidden: true
  1116. },
  1117. {
  1118. label: "20HC",
  1119. prop: "quantityV45",
  1120. width: "100",
  1121. overHidden: true
  1122. },
  1123. {
  1124. label: "40FR",
  1125. prop: "quantityV48",
  1126. width: "100",
  1127. overHidden: true
  1128. },
  1129. {
  1130. label: "40HC",
  1131. prop: "quantityV40hc",
  1132. width: "100",
  1133. overHidden: true
  1134. },
  1135. {
  1136. label: "合计应收(CNY )",
  1137. prop: "amountDrLoc",
  1138. width: "160",
  1139. overHidden: true
  1140. },
  1141. {
  1142. label: "付费申请状态",
  1143. prop: "checkCrStatusDescr",
  1144. width: "160",
  1145. overHidden: true
  1146. },
  1147. {
  1148. label: "应收对账状态",
  1149. prop: "checkDrStatusDescr",
  1150. width: "160",
  1151. overHidden: true
  1152. },
  1153. {
  1154. label: "应收结算状态",
  1155. prop: "stlDrStatusDescr",
  1156. type: "select",
  1157. search: true,
  1158. dicData: [
  1159. {
  1160. label: "未结",
  1161. value: "未结"
  1162. },
  1163. {
  1164. label: "部分",
  1165. value: "部分"
  1166. },
  1167. {
  1168. label: "结清",
  1169. value: "结清"
  1170. }
  1171. ],
  1172. width: "100",
  1173. searchLabelWidth: "100",
  1174. overHidden: true
  1175. },
  1176. {
  1177. label: "应付结算状态",
  1178. prop: "stlCrStatusDescr",
  1179. type: "select",
  1180. search: true,
  1181. dicData: [
  1182. {
  1183. label: "未结",
  1184. value: "未结"
  1185. },
  1186. {
  1187. label: "部分",
  1188. value: "部分"
  1189. },
  1190. {
  1191. label: "结清",
  1192. value: "结清"
  1193. }
  1194. ],
  1195. width: "100",
  1196. searchLabelWidth: "100",
  1197. overHidden: true
  1198. },
  1199. {
  1200. label: "销项发票状态",
  1201. prop: "invoiceDrStatusDescr",
  1202. width: "160",
  1203. overHidden: true
  1204. },
  1205. {
  1206. label: "创建人",
  1207. prop: "createUserName",
  1208. search: true,
  1209. rules: [
  1210. {
  1211. required: true,
  1212. message: "请输入创建人",
  1213. trigger: "blur"
  1214. }
  1215. ],
  1216. overHidden: true
  1217. },
  1218. {
  1219. label: "创建时间",
  1220. prop: "createTime",
  1221. width: "160",
  1222. overHidden: true
  1223. },
  1224. {
  1225. label: "排序方式",
  1226. prop: "billSort",
  1227. hide: true,
  1228. search: true,
  1229. searchValue: "1",
  1230. searchSpan: 12,
  1231. overHidden: true
  1232. },
  1233. {
  1234. label: "业务状态",
  1235. prop: "billStatus",
  1236. type: "select",
  1237. dicUrl: "/api/blade-system/dict-biz/dictionary?code=bill_status",
  1238. props: {
  1239. label: "dictValue",
  1240. value: "dictKey"
  1241. },
  1242. width: "120",
  1243. overHidden: true
  1244. },
  1245. {
  1246. label: '订舱状态',
  1247. prop: "whetherModify",
  1248. width: "100",
  1249. overHidden: true,
  1250. },
  1251. {
  1252. label: "财务状态",
  1253. prop: "accountStatus",
  1254. type: "select",
  1255. dicUrl: "/api/blade-system/dict-biz/dictionary?code=account_status",
  1256. props: {
  1257. label: "dictValue",
  1258. value: "dictKey"
  1259. },
  1260. width: "120",
  1261. overHidden: true
  1262. },
  1263. {
  1264. label: "审核状态",
  1265. prop: "status",
  1266. type: "select",
  1267. dicUrl: "/api/blade-system/dict-biz/dictionary?code=audit_status_los",
  1268. width: "120",
  1269. props: {
  1270. label: "dictValue",
  1271. value: "dictKey"
  1272. },
  1273. overHidden: true,
  1274. search: true,
  1275. searchOrder: 19
  1276. },
  1277. {
  1278. label: "提取成本",
  1279. prop: "whetherExtractCost",
  1280. type: "select",
  1281. dicData: [{
  1282. label: '否',
  1283. value: 0
  1284. }, {
  1285. label: '是',
  1286. value: 1
  1287. }],
  1288. overHidden: true,
  1289. },
  1290. {
  1291. label: "备注",
  1292. prop: "remarks",
  1293. overHidden: true
  1294. }
  1295. ]
  1296. },
  1297. // 弹窗的配置
  1298. mawbOption: {},
  1299. mawbOptionBack: {
  1300. height: "450",
  1301. calcHeight: 30,
  1302. tip: false,
  1303. searchShow: true,
  1304. searchMenuSpan: 6,
  1305. border: true,
  1306. selection: false, // 多选
  1307. dialogClickModal: false,
  1308. stripe: true,
  1309. addBtn: false,
  1310. viewBtn: false,
  1311. delBtn: false,
  1312. editBtn: false,
  1313. menu: false,
  1314. menuWidth: "auto",
  1315. column: [
  1316. {
  1317. label: "行号",
  1318. prop: "radio",
  1319. width: 50,
  1320. hide: false
  1321. },
  1322. {
  1323. label: "船名",
  1324. prop: "vesselCnName",
  1325. overHidden: true
  1326. },
  1327. {
  1328. label: "航次",
  1329. prop: "voyageNo",
  1330. overHidden: true
  1331. },
  1332. {
  1333. label: "MB/L NO",
  1334. prop: "mblno",
  1335. search: true,
  1336. overHidden: true
  1337. },
  1338. {
  1339. label: "HB/L NO",
  1340. prop: "hblno",
  1341. search: true,
  1342. overHidden: true
  1343. },
  1344. {
  1345. label: "开船日期",
  1346. prop: "etd",
  1347. width: "80",
  1348. overHidden: true
  1349. },
  1350. {
  1351. label: "到港日期",
  1352. prop: "eta",
  1353. overHidden: true
  1354. },
  1355. {
  1356. label: "装货港",
  1357. prop: "polCnName",
  1358. overHidden: true
  1359. },
  1360. {
  1361. label: "卸货港",
  1362. prop: "podCnName",
  1363. width: "120",
  1364. overHidden: true
  1365. },
  1366. {
  1367. label: "单据编号",
  1368. prop: "billNo",
  1369. width: "160",
  1370. overHidden: true
  1371. },
  1372. {
  1373. label: "客户名",
  1374. prop: "corpCnName",
  1375. overHidden: true
  1376. },
  1377. {
  1378. label: "客户英文",
  1379. prop: "corpEnName",
  1380. overHidden: true
  1381. },
  1382. {
  1383. label: "件数",
  1384. prop: "quantity",
  1385. overHidden: true
  1386. },
  1387. {
  1388. label: "包装单位",
  1389. prop: "packingUnit",
  1390. overHidden: true
  1391. },
  1392. {
  1393. label: "毛重",
  1394. prop: "grossWeight",
  1395. overHidden: true
  1396. },
  1397. {
  1398. label: "净重",
  1399. prop: "netWeight",
  1400. overHidden: true
  1401. },
  1402. {
  1403. label: "体积",
  1404. prop: "measurement",
  1405. overHidden: true
  1406. },
  1407. {
  1408. label: "单据日期",
  1409. prop: "billDate",
  1410. width: "150",
  1411. overHidden: true
  1412. }
  1413. ]
  1414. },
  1415. data: [],
  1416. // 弹窗数据
  1417. mawbData: [],
  1418. // 业务状态数据
  1419. billStatusData: [],
  1420. khdcStatus: [],
  1421. // 财务状态
  1422. accountStatusData: [],
  1423. saberUserInfo: {}, // 当前登录人个人信息
  1424. pageIds: []
  1425. };
  1426. },
  1427. computed: {
  1428. ...mapGetters(["permission"]),
  1429. permissionList() {
  1430. return {
  1431. addBtn: this.vaildData(this.permission.bills_add, false),
  1432. viewBtn: this.vaildData(this.permission.bills_view, false),
  1433. delBtn: this.vaildData(this.permission.bills_delete, false),
  1434. editBtn: this.vaildData(this.permission.bills_edit, false)
  1435. };
  1436. },
  1437. ids() {
  1438. let ids = [];
  1439. this.selectionList.forEach(ele => {
  1440. ids.push(ele.id);
  1441. });
  1442. return ids.join(",");
  1443. }
  1444. },
  1445. async created() {
  1446. this.roleName = localStorage.getItem('roleName').split(',') // 获取角色数据
  1447. // 获取当前登录人个人信息
  1448. this.saberUserInfo = JSON.parse(
  1449. localStorage.getItem("saber-userInfo")
  1450. ).content;
  1451. // 首页快捷跳转进来的
  1452. if (this.$route.query.home) {
  1453. this.addbtnfun();
  1454. }
  1455. // if (this.$route.query.id) {
  1456. // this.rowCellfun(this.$route.query.id)
  1457. // }
  1458. this.option = await this.getColumnData(this.getColumnName(309), this.optionBack);
  1459. // this.mawbOption = await this.getColumnData(this.getColumnName(309.7), this.mawbOptionBack); // 主单列表
  1460. // if (localStorage.getItem(this.getColumnName(309))) {
  1461. // this.optionBack = JSON.parse(
  1462. // localStorage.getItem(this.getColumnName(309))
  1463. // );
  1464. // }
  1465. if (this.saberUserInfo.role_name.indexOf('admin') != -1 || this.saberUserInfo.role_name.indexOf('总部') != -1) {
  1466. this.option.searchMenuSpan = 12
  1467. this.option.column.forEach(item => {
  1468. if (item.prop == 'branchId') {
  1469. item.search = true
  1470. }
  1471. if (item.prop == 'branchName') {
  1472. item.hide = false
  1473. // item.showColumn = true
  1474. }
  1475. })
  1476. }
  1477. this.billStatusWorkDictsfun(); // 获取业务状态字典数据
  1478. this.accountStatusWorkDictsfun(); // 获取财务状态字典数据
  1479. this.statusWorkDictsfun(); // 业务审核类型
  1480. this.editypesListfun(); // edi 数据获取
  1481. // console.log(,11111)
  1482. },
  1483. mounted() { },
  1484. activated() {
  1485. if (this.$route.query.id) {
  1486. if (!this.$store.getters.seaFEStatus) {
  1487. setTimeout(() => {
  1488. this.rowCellfun(this.$route.query.id);
  1489. }, 200);
  1490. }
  1491. }
  1492. if (this.$route.query.params) {
  1493. if (!this.$store.getters.seaFEStatus) {
  1494. setTimeout(() => {
  1495. this.rowCellfun(this.$route.query.params);
  1496. }, 200);
  1497. }
  1498. }
  1499. },
  1500. methods: {
  1501. summaryMethod({ columns, data }) {
  1502. const sums = [];
  1503. if (columns.length > 0) {
  1504. columns.forEach((column, index) => {
  1505. sums[0] = "合计";
  1506. let prop = column.property
  1507. if (['quantity', 'grossWeight', 'measurement', 'teu', 'teuTotal', 'quantityV20', 'quantityV40', 'quantityV40hc', 'quantityV45', 'quantityV48'].includes(prop)) {
  1508. let values = this.data.filter(item => item.billType == 'MH').map(item => Number(item[prop] || 0));
  1509. let all = values.length !== 0 ? sums[index] = values.reduce((a, b) => {
  1510. return a + b;
  1511. }) : 0
  1512. if (prop == 'grossWeight' || prop == 'measurement') {
  1513. sums[index] = all.toFixed(3)
  1514. }
  1515. if (prop == 'quantity' || prop == 'teu' || prop == 'quantityV20' || prop == 'quantityV40' || prop == 'quantityV40hc' || prop == 'quantityV45' || prop == 'quantityV48') {
  1516. sums[index] = all
  1517. }
  1518. } else {
  1519. sums[index]
  1520. }
  1521. });
  1522. }
  1523. return sums;
  1524. },
  1525. freightRateSubmit() {
  1526. const ids = []
  1527. for (let item of this.selectionList) {
  1528. if (item.polId != this.selectionList[0].polId) {
  1529. return this.$message.error("请选择相同的装货港");
  1530. }
  1531. if (item.podId != this.selectionList[0].podId) {
  1532. return this.$message.error("请选择相同的卸货港");
  1533. }
  1534. if (item.carrierId != this.selectionList[0].carrierId) {
  1535. return this.$message.error("请选择相同的船公司");
  1536. }
  1537. if (item.etd != this.selectionList[0].etd) {
  1538. return this.$message.error("请选择相同的ETD");
  1539. }
  1540. ids.push(item.id)
  1541. }
  1542. let obj = {
  1543. polId: this.selectionList[0].polId,
  1544. podId: this.selectionList[0].podId,
  1545. actualShippingCompanyId: this.selectionList[0].carrierId,
  1546. etd: this.selectionList[0].etd,
  1547. }
  1548. this.$refs.freightRate.openDialog(obj, ids.join(','))
  1549. },
  1550. checkSubmit() {
  1551. if (this.selectionList.filter(item => item.whetherExtractCost == 1).length) {
  1552. this.$confirm('已提取成本,是否再次提取?', '提示', {
  1553. confirmButtonText: '确定',
  1554. cancelButtonText: '取消',
  1555. type: 'warning'
  1556. }).then(() => {
  1557. this.costSubmit()
  1558. })
  1559. } else {
  1560. this.costSubmit()
  1561. }
  1562. },
  1563. costSubmit() {
  1564. let podId = []
  1565. let destinationId = []
  1566. let airlineId = []
  1567. let shipNameId = []
  1568. let shippingCompanyId = []
  1569. let boxBelongsTo = []
  1570. let etd = []
  1571. let voyag = []
  1572. let obj = {}
  1573. let billsIds = []
  1574. for (let item of this.selectionList) {
  1575. if (item.status == 3) {
  1576. return this.$message.error("单据已提交审核,请重新选择");
  1577. }
  1578. if (item.polId) podId.push(item.polId)
  1579. if (item.podId) destinationId.push(item.podId)
  1580. if (item.lineId) airlineId.push(item.lineId)
  1581. if (item.vesselId) shipNameId.push(item.vesselId)
  1582. if (item.carrierId) shippingCompanyId.push(item.carrierId)
  1583. if (item.voyageNo) voyag.push(item.voyageNo)
  1584. if (item.boxBelongsTo) boxBelongsTo.push(item.boxBelongsTo)
  1585. if (item.etd) etd.push(item.etd)
  1586. billsIds.push(item.id)
  1587. }
  1588. if ([...new Set(podId)].length > 1) {
  1589. return this.$message.error("请选择相同的装货港");
  1590. }
  1591. console.log([...new Set(destinationId)])
  1592. if ([...new Set(destinationId)].length > 1) {
  1593. return this.$message.error("请选择相同的卸货港");
  1594. }
  1595. // if ([...new Set(airlineId)].length > 1) {
  1596. // return this.$message.error("请选择相同的航线");
  1597. // }
  1598. // if ([...new Set(shipNameId)].length > 1) {
  1599. // return this.$message.error("请选择相同的船名");
  1600. // }
  1601. console.log([...new Set(shippingCompanyId)])
  1602. if ([...new Set(shippingCompanyId)].length > 1) {
  1603. return this.$message.error("请选择相同的船公司");
  1604. }
  1605. if ([...new Set(boxBelongsTo)].length > 1) {
  1606. return this.$message.error("请选择相同的箱属");
  1607. }
  1608. if ([...new Set(etd)].length > 1) {
  1609. return this.$message.error("请选择相同的ETD");
  1610. }
  1611. obj = {
  1612. podId: podId[0],
  1613. destinationId: destinationId[0],
  1614. shippingCompanyId: shippingCompanyId[0],
  1615. businessType: boxBelongsTo[0],
  1616. etd: etd[0]
  1617. }
  1618. this.$refs.extractionCost.inTemplate(obj, billsIds.join(','))
  1619. },
  1620. checkBills() {
  1621. for (let item of this.selectionList) {
  1622. if (item.status != 0) {
  1623. return this.$message.error("单据已提交审核,请勿重复操作");
  1624. }
  1625. }
  1626. let ids = []
  1627. for (let item of this.selectionList) {
  1628. ids.push(item.id)
  1629. }
  1630. let obj = {
  1631. billsIds: ids.join(","),
  1632. url: '/iosBasicData/SeafreightExportF/bills/approvalDetails',
  1633. pageStatus: "this.$store.getters.approvalDetails",
  1634. pageLabel: "海运出口(F)",
  1635. }
  1636. this.$confirm('是否批量单据请核?', '提示', {
  1637. confirmButtonText: '确定',
  1638. cancelButtonText: '取消',
  1639. type: 'warning'
  1640. }).then(() => {
  1641. const loading = this.$loading({
  1642. lock: true,
  1643. text: '加载中',
  1644. spinner: 'el-icon-loading',
  1645. background: 'rgba(255,255,255,0.7)'
  1646. });
  1647. checkBillsBatch(obj).then(res => {
  1648. this.$message.success("操作成功!");
  1649. this.onLoad(this.page, this.query);
  1650. }).finally(() => {
  1651. loading.close();
  1652. })
  1653. })
  1654. },
  1655. importTemplate() {
  1656. if (!this.templateList.length) {
  1657. return this.$message.error("暂无模板数据,请先维护");
  1658. }
  1659. let billsIds = []
  1660. for (let item of this.selectionList) {
  1661. billsIds.push(item.id)
  1662. }
  1663. let obj = {
  1664. billsIds: billsIds.join(","),
  1665. templateId: this.templateId,
  1666. dc: this.dc,
  1667. }
  1668. const loading = this.$loading({
  1669. lock: true,
  1670. text: '加载中',
  1671. spinner: 'el-icon-loading',
  1672. background: 'rgba(255,255,255,0.7)'
  1673. });
  1674. templateImportBatch(obj).then(res => {
  1675. this.$message.success("操作成功!");
  1676. this.templateDialog = false
  1677. this.onLoad(this.page, this.query);
  1678. }).finally(() => {
  1679. loading.close();
  1680. })
  1681. },
  1682. templateImport(dc) {
  1683. for (let item of this.selectionList) {
  1684. if (item.status != 0) {
  1685. return this.$message.error("单据已提交审核,请勿重复操作");
  1686. }
  1687. if (!item.carrierId) {
  1688. return this.$message.error("请先维护船公司");
  1689. }
  1690. if (item.carrierId != this.selectionList[0].carrierId) {
  1691. return this.$message.error("请选择同一个船公司");
  1692. }
  1693. }
  1694. this.templateId = null
  1695. this.dc = dc
  1696. this.templateData = []
  1697. this.templateList = []
  1698. this.templateDialog = true
  1699. let obj = {
  1700. current: 1,
  1701. size: 100,
  1702. status: 0,
  1703. type: 'HYCK',
  1704. dc: this.dc,
  1705. shippingCompanyId: this.selectionList[0].carrierId,
  1706. }
  1707. const loading = this.$loading({
  1708. lock: true,
  1709. text: '加载中',
  1710. spinner: 'el-icon-loading',
  1711. background: 'rgba(255,255,255,0.7)'
  1712. });
  1713. getListTemplate(obj).then(res => {
  1714. this.templateData = res.data.data.records
  1715. if (res.data.data.records.length) {
  1716. this.templateId = res.data.data.records[0].id
  1717. getListTemplatelist({ current: 1, size: 100, pid: res.data.data.records[0].id }).then(res => {
  1718. this.templateList = res.data.data.records
  1719. })
  1720. }
  1721. }).finally(() => {
  1722. loading.close();
  1723. })
  1724. },
  1725. pleaseVerify(dc) {
  1726. let ids = []
  1727. for (let item of this.selectionList) {
  1728. ids.push(item.id)
  1729. }
  1730. let obj = {
  1731. type: 'HYCK',
  1732. dc: dc,
  1733. ids: ids.join(",")
  1734. }
  1735. this.$confirm('是否请核费用?', '提示', {
  1736. confirmButtonText: '确定',
  1737. cancelButtonText: '取消',
  1738. type: 'warning'
  1739. }).then(() => {
  1740. const loading = this.$loading({
  1741. lock: true,
  1742. text: '加载中',
  1743. spinner: 'el-icon-loading',
  1744. background: 'rgba(255,255,255,0.7)'
  1745. });
  1746. pleaseVerifyCostBatch(obj).then(res => {
  1747. this.$message.success("操作成功");
  1748. this.refreshChange()
  1749. }).finally(() => {
  1750. loading.close();
  1751. })
  1752. })
  1753. },
  1754. // 左侧选择
  1755. nodeClick(e) {
  1756. this.templateId = e.id
  1757. getListTemplatelist({ current: 1, size: 100, pid: e.id }).then(res => {
  1758. this.templateList = res.data.data.records
  1759. })
  1760. },
  1761. rowStyle({ row, column, rowIndex, columnIndex }) {
  1762. if (row.status == 2) {
  1763. return {
  1764. // color: '#fff',
  1765. backgroundColor: "#fbd26a"
  1766. };
  1767. }
  1768. if (row.status == 3) {
  1769. return {
  1770. // color: '#fff',
  1771. backgroundColor: "#ced094"
  1772. };
  1773. }
  1774. if (row.status == 4) {
  1775. return {
  1776. // color: '#fff',
  1777. backgroundColor: "#fbc4c4"
  1778. };
  1779. }
  1780. },
  1781. //导出
  1782. outExport() {
  1783. this.$confirm("是否导出当前所有数据?", "提示", {
  1784. confirmButtonText: "确定",
  1785. cancelButtonText: "取消",
  1786. type: "warning"
  1787. }).then(() => {
  1788. let queryParams = {};
  1789. queryParams = {
  1790. businessType: "SE",
  1791. seaType: "E",
  1792. ...this.query
  1793. };
  1794. delete queryParams.billStatus;
  1795. const routeData = this.$router.resolve({
  1796. path: "/api/blade-los/bills/exportBills", //跳转目标窗口的地址
  1797. query: {
  1798. "Blade-Auth": getToken(),
  1799. ...queryParams //括号内是要传递给新窗口的参数
  1800. }
  1801. });
  1802. window.open(routeData.href.slice(1, routeData.href.length));
  1803. });
  1804. },
  1805. // 发送EDI
  1806. editypesSendingEdifun(row) {
  1807. row.billId = this.ids;
  1808. editypesSendingEdi(row).then(res => {
  1809. console.log(res)
  1810. this.$message.success(res.data.msg);
  1811. this.onLoad(this.page);
  1812. });
  1813. },
  1814. // 获取EDI列表数据
  1815. editypesListfun() {
  1816. editypesList(1, 1000).then(res => {
  1817. console.log("EDI", res.data.data.records);
  1818. this.ediData = res.data.data.records;
  1819. this.ediData_SO = res.data.data.records.filter(
  1820. r => r.groupName == "SO"
  1821. );
  1822. this.ediData_SI = res.data.data.records.filter(
  1823. r => r.groupName == "SI"
  1824. );
  1825. console.log(this.ediData_SO, this.ediData_SI);
  1826. });
  1827. },
  1828. // // 展开和收起
  1829. // shiftCollapsiable() {
  1830. // this.fold = !this.fold;
  1831. // if (this.fold) {
  1832. // this.option.searchMenuSpan = 18;
  1833. // } else {
  1834. // this.option.searchMenuSpan = 6;
  1835. // }
  1836. // },
  1837. // 下拉的回调
  1838. corpChange(value, name) {
  1839. this.query[name] = value;
  1840. },
  1841. // 获取签单方式字典数据
  1842. getWorkDictsfun() {
  1843. getWorkDicts("issue_type_F").then(res => {
  1844. this.issueTypeData = res.data.data;
  1845. this.findObject(this.option.column, "issueType").dicData =
  1846. res.data.data;
  1847. });
  1848. },
  1849. // tabs切换筛选
  1850. handleClick(tab, event) {
  1851. // if (this.query.billStatus == 4) {
  1852. // this.query.billStatus = null;
  1853. // }
  1854. this.onLoad(this.page, this.query);
  1855. },
  1856. // 获取委托人数据
  1857. // corpBcorpslistByType(cnName) {
  1858. // getBcorpslistByType(1, 10, { cnName, status: 0 }).then(res => {
  1859. // this.corpData = res.data.data.records
  1860. // this.findObject(this.option.column, "corpCnName").dicData = res.data.data.records
  1861. // })
  1862. // },
  1863. // 获取收货人数据
  1864. hConsigneeBcorpslistByType(cnName) {
  1865. getBcorpslistByType(1, 10, { cnName, status: 0 }).then(res => {
  1866. this.hConsigneeData = res.data.data.records;
  1867. this.findObject(
  1868. this.option.column,
  1869. "hConsigneeCnName"
  1870. ).dicData = res.data.data.records;
  1871. });
  1872. },
  1873. // 获取船名
  1874. vesselBvesselsListfun(enName) {
  1875. getBvesselsList(1, 10, { enName, status: 0 }).then(res => {
  1876. this.vesselData = res.data.data.records;
  1877. this.findObject(this.option.column, "vesselEnName").dicData =
  1878. res.data.data.records;
  1879. });
  1880. },
  1881. // 获取船公司数据
  1882. carrierBcorpslistByTypefun(enName) {
  1883. let corpTypeName = "船公司";
  1884. getBcorpslistByType(1, 10, {
  1885. enName,
  1886. status: 0,
  1887. corpTypeName
  1888. }).then(res => {
  1889. this.carrierData = res.data.data.records;
  1890. this.findObject(this.option.column, "carrierEnName").dicData =
  1891. res.data.data.records;
  1892. });
  1893. },
  1894. // 卸货港数据
  1895. podBportsListfun(enName) {
  1896. bportsList(1, 10, { enName, status: 0 }).then(res => {
  1897. this.podData = res.data.data.records;
  1898. this.findObject(this.option.column, "podEnName").dicData =
  1899. res.data.data.records;
  1900. });
  1901. },
  1902. // 航线数据
  1903. lineBlinesListfun(cnName) {
  1904. blinesList(1, 10, { cnName, status: 0 }).then(res => {
  1905. this.lineData = res.data.data.records;
  1906. this.findObject(this.option.column, "lineCnName").dicData =
  1907. res.data.data.records;
  1908. });
  1909. },
  1910. // 获取场站数据
  1911. cyBcorpslistByType(cnName) {
  1912. let corpTypeName = "场站";
  1913. getBcorpslistByType(1, 10, {
  1914. cnName,
  1915. status: 0,
  1916. corpTypeName
  1917. }).then(res => {
  1918. this.cyData = res.data.data.records;
  1919. this.findObject(this.option.column, "cyCnName").dicData =
  1920. res.data.data.records;
  1921. });
  1922. },
  1923. // 订舱代理
  1924. bookingAgentBcorpsListfun(cnName) {
  1925. let corpTypeName =
  1926. "国内直接客户,国内同行及代理,国外直接客户,国外同行及代理";
  1927. getBcorpslistByType(1, 10, {
  1928. cnName,
  1929. status: 0,
  1930. corpTypeName
  1931. }).then(res => {
  1932. this.bookingAgentData = res.data.data.records;
  1933. this.findObject(
  1934. this.option.column,
  1935. "bookingAgentCnName"
  1936. ).dicData = res.data.data.records;
  1937. });
  1938. },
  1939. // 获取核算部分数据 // 机构管理接口
  1940. createDeptLzylistfun() {
  1941. getDeptTree().then(res => {
  1942. this.createDeptData = res.data.data;
  1943. this.findObject(this.option.column, "createDeptName").dicData =
  1944. res.data.data;
  1945. });
  1946. },
  1947. // 获取业务状态字典数据
  1948. billStatusWorkDictsfun() {
  1949. getWorkDicts("bill_status").then(res => {
  1950. this.billStatusData = res.data.data;
  1951. });
  1952. getWorkDicts("KHDC_Status").then(res => {
  1953. this.khdcStatus = res.data.data;
  1954. });
  1955. getWorkDicts("billOfLadingStatus").then(res => {
  1956. this.billOfLadingStatusData = res.data.data;
  1957. });
  1958. },
  1959. // 获取财务状态字典数据
  1960. accountStatusWorkDictsfun() {
  1961. getWorkDicts("account_status").then(res => {
  1962. this.accountStatusData = res.data.data;
  1963. });
  1964. },
  1965. // 获取业务审核状态
  1966. statusWorkDictsfun() {
  1967. getWorkDicts("audit_status_los").then(res => {
  1968. this.auditStatusList = res.data.data;
  1969. });
  1970. },
  1971. // 添加到主单
  1972. increaseMawb() {
  1973. this.radioRow = {}
  1974. if (this.selectionList.length === 0) {
  1975. this.$message.warning("请选择至少一条数据");
  1976. return;
  1977. }
  1978. // 判断是否可以编辑别人业务 true 就没有权限
  1979. if (this.ModifyOthersfun()) return;
  1980. const obj = this.selectionList[0];
  1981. for (let item of this.selectionList) {
  1982. if (item.billType != "MH") {
  1983. this.$message.warning("请选择分单");
  1984. return;
  1985. }
  1986. // if (obj.placeReceiptId != item.placeReceiptId) {
  1987. // // 收货地
  1988. // this.$message.warning("请选择收货地相同的");
  1989. // return;
  1990. // }
  1991. if (obj.polId != item.polId) {
  1992. // 装货港一样
  1993. this.$message.error("请选择装货港相同的单据");
  1994. return;
  1995. }
  1996. if (obj.podId != item.podId) {
  1997. // 装货港一样
  1998. this.$message.error("请选择卸货港相同的单据");
  1999. return;
  2000. }
  2001. }
  2002. // this.mawbQuery.placeReceiptName = obj.placeReceiptName;
  2003. // this.mawbQuery.polCnName = obj.polCnName;
  2004. this.$nextTick(() => {
  2005. this.dialogVisible = true;
  2006. this.mawbOnLoad(this.mawbPage);
  2007. });
  2008. },
  2009. // 判断是否可以编辑别人业务
  2010. ModifyOthersfun() {
  2011. let sumArr = [];
  2012. const h = this.$createElement;
  2013. // 判断是否有权限
  2014. // if (
  2015. // this.saberUserInfo.role_name.indexOf("admin") != -1
  2016. // ? this.saberUserInfo.role_name.indexOf(
  2017. // "允许修改他人业务"
  2018. // ) != -1
  2019. // : false
  2020. // )
  2021. // return false;
  2022. // 当前登录人和选择的创建人对比是不是一个人
  2023. // for (let item of this.selectionList) {
  2024. // if (this.saberUserInfo.user_id != item.createUser) {
  2025. // sumArr.push(
  2026. // h("p", `你没有"允许修改他人业务"权限,请重新选择数据`)
  2027. // );
  2028. // }
  2029. // }
  2030. if (sumArr.length != 0) {
  2031. this.$confirm("提示", {
  2032. message: h("div", sumArr),
  2033. confirmButtonText: "确定",
  2034. cancelButtonText: "取消",
  2035. type: "warning"
  2036. }).catch(err => { });
  2037. return true;
  2038. }
  2039. },
  2040. // 退舱
  2041. Disembarkingfun() {
  2042. if (this.selectionList.length === 0) {
  2043. this.$message.warning("请选择至少一条数据");
  2044. return;
  2045. }
  2046. // 判断是否可以编辑别人业务 true 就没有权限
  2047. if (this.ModifyOthersfun()) return;
  2048. this.billsDisembarkingfun(this.ids);
  2049. },
  2050. // 退舱接口
  2051. billsDisembarkingfun(ids) {
  2052. billsDisembarking(ids).then(res => {
  2053. this.$message({
  2054. type: "success",
  2055. message: "操作成功!"
  2056. });
  2057. this.onLoad(this.page);
  2058. });
  2059. },
  2060. // 撤销退仓
  2061. revokeWithdrawalfun() {
  2062. if (this.selectionList.length === 0) {
  2063. this.$message.warning("请选择至少一条数据");
  2064. return;
  2065. }
  2066. this.billsRevokeDisembarkingfun(this.ids);
  2067. },
  2068. // 撤销退舱接口
  2069. billsRevokeDisembarkingfun(ids) {
  2070. billsRevokeDisembarking(ids).then(res => {
  2071. this.$message({
  2072. type: "success",
  2073. message: "操作成功!"
  2074. });
  2075. this.onLoad(this.page);
  2076. });
  2077. },
  2078. // 下拉显示数据
  2079. async expandChange(row) {
  2080. if (row.billType == "MM") {
  2081. this.SplitLoading = true;
  2082. const res = await billsListAll({ masterId: row.id });
  2083. this.$set(row, "billsListAllData", res.data.data);
  2084. this.SplitLoading = false;
  2085. } else {
  2086. this.$refs.crud.toggleRowExpansion(row, false);
  2087. }
  2088. },
  2089. // 弹窗单选
  2090. radioInput(row) {
  2091. console.log(row, 2134);
  2092. this.radioRow = row
  2093. console.log(this.dialogRadio, 2083);
  2094. },
  2095. // 弹窗确认
  2096. AddToMainOrder() {
  2097. if (!this.dialogRadio) {
  2098. this.$message.warning("请选择一条数据");
  2099. return;
  2100. }
  2101. if (this.radioRow.status == 3) {
  2102. this.$message.error("此单据已审核通过,请重新选择!");
  2103. return;
  2104. }
  2105. increaseReinsurancePolicyTeu(this.ids, this.dialogRadio).then(res => {
  2106. if (res.data.data == '操作成功') {
  2107. this.billsIncreaseReinsurancePolicyfun(this.ids, this.dialogRadio);
  2108. } else {
  2109. this.$confirm(res.data.data, '提示', {
  2110. confirmButtonText: '确定',
  2111. cancelButtonText: '取消',
  2112. type: 'warning'
  2113. }).then(() => {
  2114. this.billsIncreaseReinsurancePolicyfun(this.ids, this.dialogRadio);
  2115. }).catch(() => {
  2116. this.dialogRadio = null;
  2117. this.dialogVisible = false;
  2118. });
  2119. }
  2120. });
  2121. },
  2122. // 添加到主单接口
  2123. billsIncreaseReinsurancePolicyfun(ids, id) {
  2124. billsIncreaseReinsurancePolicy(ids, id).then(res => {
  2125. this.dialogRadio = null;
  2126. this.$message({
  2127. type: "success",
  2128. message: "操作成功!"
  2129. });
  2130. this.dialogVisible = false;
  2131. this.onLoad(this.page);
  2132. });
  2133. },
  2134. // 弹窗关闭
  2135. handleClose(done) {
  2136. done();
  2137. },
  2138. toAddEdit() {
  2139. this.datekey = Date.now();
  2140. },
  2141. // 详情的返回列表
  2142. goBack() {
  2143. // 初始化数据
  2144. this.pageIds = []
  2145. // this.detailData = this.$options.data().detailData;
  2146. if (JSON.stringify(this.$route.query) != "{}") {
  2147. this.$router.$avueRouter.closeTag();
  2148. this.$router.push({
  2149. path: "/iosBasicData/SeafreightExportF/bills/index"
  2150. });
  2151. }
  2152. this.isShow = true;
  2153. this.onLoad(this.page, this.search);
  2154. this.$store.commit("OUT_SEAFE_DETAIL");
  2155. },
  2156. // 新增弹窗开启
  2157. addbtnfun(type) {
  2158. this.pageIds = []
  2159. this.detailData.seeDisabled = false;
  2160. this.detailData.billType = type;
  2161. this.isShow = false;
  2162. this.$store.commit("IN_SEAFE_DETAIL");
  2163. },
  2164. allClick(name) {
  2165. if (name == '修改单据类型') {
  2166. // if (this.selectionList.length !== 1) {
  2167. // this.$message.warning("请选择一条数据");
  2168. // return;
  2169. // }
  2170. for (let item of this.selectionList) {
  2171. if (item.status != 0) {
  2172. return this.$message.error("请选择未审核的单据");
  2173. }
  2174. }
  2175. this.$DialogForm.show({
  2176. title: "修改单据类型",
  2177. width: "300px",
  2178. menuPosition: "right",
  2179. option: {
  2180. submitText: "确认",
  2181. emptyText: "取消",
  2182. span: 24,
  2183. column: [
  2184. {
  2185. label: "单据类型",
  2186. prop: "billType",
  2187. type: 'select',
  2188. dicData: [
  2189. {
  2190. label: "直单",
  2191. value: "DD"
  2192. },
  2193. {
  2194. label: "主单",
  2195. value: "MM"
  2196. },
  2197. {
  2198. label: "分单",
  2199. value: "MH"
  2200. }
  2201. ],
  2202. span: 24
  2203. }
  2204. ]
  2205. },
  2206. beforeClose: done => {
  2207. done();
  2208. },
  2209. callback: res => {
  2210. res.done();
  2211. // this.detailData.seeDisabled = false;
  2212. // this.detailData.id = this.selectionList[0].id;
  2213. // this.isShow = false;
  2214. let ids = []
  2215. for (let item of this.selectionList) {
  2216. ids.push(item.id)
  2217. }
  2218. let obj = {
  2219. ids: ids.join(','),
  2220. billType: res.data.billType
  2221. }
  2222. updateBillType(obj).then(res => {
  2223. this.refreshChange()
  2224. this.$message({
  2225. type: "success",
  2226. message: "操作成功!"
  2227. });
  2228. })
  2229. // this.$nextTick(() => {
  2230. // this.$refs.billsDetails.pageLoading = true;
  2231. // this.$refs.billsDetails.billsCopyBillsfun(
  2232. // this.selectionList[0].id,
  2233. // res.data.checkbox
  2234. // );
  2235. // });
  2236. // this.$store.commit("IN_SEAFE_DETAIL");
  2237. res.close();
  2238. }
  2239. });
  2240. }
  2241. },
  2242. // 复制单据
  2243. CopyDocumentsfun() {
  2244. if (this.selectionList.length !== 1) {
  2245. this.$message.warning("请选择一条数据");
  2246. return;
  2247. }
  2248. this.$DialogForm.show({
  2249. title: "复制单据",
  2250. width: "300px",
  2251. menuPosition: "right",
  2252. data: { checkbox: "" },
  2253. option: {
  2254. submitText: "确认",
  2255. emptyText: "取消",
  2256. span: 24,
  2257. column: [
  2258. {
  2259. label: "单据类型",
  2260. prop: "billType",
  2261. type: "select",
  2262. value: this.selectionList[0].billType,
  2263. dicData: [
  2264. {
  2265. label: '直单',
  2266. value: 'DD'
  2267. },
  2268. {
  2269. label: '主单',
  2270. value: 'MM'
  2271. },
  2272. {
  2273. label: '分单',
  2274. value: 'MH'
  2275. }
  2276. ],
  2277. dataType: "string",
  2278. span: 24
  2279. },
  2280. {
  2281. label: "复制类型",
  2282. prop: "checkbox",
  2283. type: "checkbox",
  2284. dicData: [
  2285. {
  2286. label: "复制费用",
  2287. value: "复制费用"
  2288. },
  2289. {
  2290. label: "复制箱型箱量",
  2291. value: "复制箱型箱量"
  2292. },
  2293. {
  2294. label: "复制配箱信息",
  2295. value: "复制配箱信息"
  2296. }
  2297. ],
  2298. dataType: "string",
  2299. span: 24
  2300. }
  2301. ]
  2302. },
  2303. beforeClose: done => {
  2304. done();
  2305. },
  2306. callback: res => {
  2307. res.done();
  2308. this.detailData.seeDisabled = false;
  2309. this.detailData.id = this.selectionList[0].id;
  2310. this.isShow = false;
  2311. this.$nextTick(() => {
  2312. this.$refs.billsDetails.pageLoading = true;
  2313. this.$refs.billsDetails.billsCopyBillsfun(
  2314. this.selectionList[0].id,
  2315. res.data.checkbox,
  2316. res.data.billType
  2317. );
  2318. });
  2319. this.$store.commit("IN_SEAFE_DETAIL");
  2320. res.close();
  2321. }
  2322. });
  2323. },
  2324. // 编辑详情打开
  2325. rowCellfun(id, row) {
  2326. this.pageIds = []
  2327. this.data.forEach(item => {
  2328. this.pageIds.push(item.id)
  2329. })
  2330. this.detailData = {
  2331. id: id
  2332. };
  2333. if (row) {
  2334. if (
  2335. this.saberUserInfo.role_name.indexOf("admin") == -1
  2336. ? this.saberUserInfo.role_name.indexOf(
  2337. "允许修改他人业务"
  2338. ) == -1
  2339. ? this.saberUserInfo.user_id == row.createUser
  2340. : true
  2341. : true
  2342. ) {
  2343. this.detailData.seeDisabled = false;
  2344. } else {
  2345. this.detailData.seeDisabled = true;
  2346. }
  2347. } else {
  2348. this.detailData.seeDisabled = false;
  2349. }
  2350. this.isShow = false;
  2351. this.$nextTick(() => {
  2352. this.$refs.billsDetails.pageLoading = true;
  2353. this.$refs.billsDetails.billsDetailfun(id);
  2354. });
  2355. this.$store.commit("IN_SEAFE_DETAIL");
  2356. },
  2357. rowSave(row, done, loading) {
  2358. billsSubmit(row).then(
  2359. () => {
  2360. this.onLoad(this.page);
  2361. this.$message({
  2362. type: "success",
  2363. message: "操作成功!"
  2364. });
  2365. done();
  2366. },
  2367. error => {
  2368. loading();
  2369. window.console.log(error);
  2370. }
  2371. );
  2372. },
  2373. rowUpdate(row, index, done, loading) {
  2374. billsSubmit(row).then(
  2375. () => {
  2376. this.onLoad(this.page);
  2377. this.$message({
  2378. type: "success",
  2379. message: "操作成功!"
  2380. });
  2381. done();
  2382. },
  2383. error => {
  2384. loading();
  2385. console.log(error);
  2386. }
  2387. );
  2388. },
  2389. rowDel(row) {
  2390. this.$confirm("确定将选择数据删除?", {
  2391. confirmButtonText: "确定",
  2392. cancelButtonText: "取消",
  2393. type: "warning"
  2394. })
  2395. .then(() => {
  2396. return billsRemove(row.id);
  2397. })
  2398. .then(() => {
  2399. this.onLoad(this.page);
  2400. this.$message({
  2401. type: "success",
  2402. message: "操作成功!"
  2403. });
  2404. });
  2405. },
  2406. // 批量删除
  2407. handleDelete() {
  2408. if (this.selectionList.length === 0) {
  2409. this.$message.warning("请选择至少一条数据");
  2410. return;
  2411. }
  2412. // 判断是否可以编辑别人业务 true 就没有权限
  2413. if (this.ModifyOthersfun()) return;
  2414. // 已经提交请核的提示不让删除
  2415. let sumArr = [];
  2416. const h = this.$createElement;
  2417. for (let item of this.selectionList) {
  2418. if (item.status == 1) {
  2419. sumArr.push(
  2420. h(
  2421. "p",
  2422. `序号${item.$index + 1}的数据已经提交请核请勿删除`
  2423. )
  2424. );
  2425. }
  2426. }
  2427. if (sumArr.length != 0) {
  2428. this.$confirm("提示", {
  2429. message: h("div", sumArr),
  2430. confirmButtonText: "确定",
  2431. cancelButtonText: "取消",
  2432. type: "warning"
  2433. });
  2434. return;
  2435. }
  2436. this.$confirm("确定将选择数据删除?", {
  2437. confirmButtonText: "确定",
  2438. cancelButtonText: "取消",
  2439. type: "warning"
  2440. })
  2441. .then(() => {
  2442. return billsRemove(this.ids);
  2443. })
  2444. .then(() => {
  2445. this.onLoad(this.page);
  2446. this.$message({
  2447. type: "success",
  2448. message: "操作成功!"
  2449. });
  2450. this.$refs.crud.toggleSelection();
  2451. });
  2452. },
  2453. beforeOpen(done, type) {
  2454. if (["edit", "view"].includes(type)) {
  2455. billsDetail(this.form.id).then(res => {
  2456. this.form = res.data.data;
  2457. });
  2458. }
  2459. done();
  2460. },
  2461. searchReset() {
  2462. this.query = {};
  2463. this.query.billSort = this.query.billSort
  2464. ? this.query.billSort
  2465. : "1";
  2466. this.onLoad(this.page);
  2467. },
  2468. // 搜索
  2469. searchChange(params, done) {
  2470. this.query = params;
  2471. this.page.currentPage = 1;
  2472. // // 判断检索条件是否可以使用
  2473. // if(this.etdDisabled) {
  2474. // this.query.etdList = this.etdList
  2475. // }else {
  2476. // delete params.etdList
  2477. // }
  2478. // if(this.etaDisabled) {
  2479. // this.query.etaList = this.etaList
  2480. // }else {
  2481. // delete params.etaList
  2482. // }
  2483. this.onLoad(this.page, params);
  2484. done();
  2485. },
  2486. selectionChange(list) {
  2487. this.selectionList = list;
  2488. },
  2489. selectionClear() {
  2490. this.selectionList = [];
  2491. this.$refs.crud.toggleSelection();
  2492. },
  2493. currentChange(currentPage) {
  2494. this.page.currentPage = currentPage;
  2495. },
  2496. sizeChange(pageSize) {
  2497. this.page.pageSize = pageSize;
  2498. },
  2499. refreshChange() {
  2500. this.onLoad(this.page, this.query);
  2501. },
  2502. // 列表获取数据
  2503. onLoad(page, params = {}) {
  2504. this.loading = true;
  2505. billsList(page.currentPage, page.pageSize, {
  2506. ...Object.assign(params, this.query),
  2507. businessType: "SE",
  2508. seaType: "E",
  2509. // status: this.query.billStatus == 3 ? 3 : undefined
  2510. }).then(res => {
  2511. const data = res.data.data;
  2512. this.page.total = data.total;
  2513. this.data = data.records.map(item => {
  2514. item.billsListAllData = [];
  2515. item.billStatus = item.billStatus + "";
  2516. item.accountStatus = item.accountStatus + "";
  2517. item.status = item.status + "";
  2518. return item;
  2519. });
  2520. this.$nextTick(() => {
  2521. this.$refs.crud.doLayout();
  2522. this.$refs.crud.dicInit();
  2523. });
  2524. this.loading = false;
  2525. this.selectionClear();
  2526. });
  2527. },
  2528. // 弹窗表格获取数据
  2529. mawbOnLoad(page, params = {}) {
  2530. this.mawbloading = true;
  2531. billsListAll({
  2532. ...Object.assign(params, this.mawbQuery),
  2533. businessType: "SE",
  2534. polId: this.selectionList[0].polId,
  2535. podId: this.selectionList[0].podId
  2536. }).then(res => {
  2537. const data = res.data.data;
  2538. // this.mawbPage.total = data.total;
  2539. this.mawbData = data;
  2540. this.mawbloading = false;
  2541. });
  2542. },
  2543. // 弹窗列表的分页
  2544. mawbSizeChange(val) {
  2545. this.mawbPage.pageSize = val;
  2546. this.mawbOnLoad(this.mawbPage, this.mawbQuery);
  2547. },
  2548. // 弹窗列表的分页
  2549. mawbCurrentChange(val) {
  2550. this.mawbPage.currentPage = val;
  2551. this.mawbOnLoad(this.mawbPage, this.mawbQuery);
  2552. },
  2553. // 弹窗的搜索
  2554. mawbSearch(params, done) {
  2555. this.mawbQuery = params;
  2556. this.mawbPage.currentPage = 1;
  2557. this.mawbOnLoad(this.mawbPage, params);
  2558. done();
  2559. },
  2560. //自定义列保存
  2561. async saveColumn(ref, option, optionBack, code) {
  2562. /**
  2563. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  2564. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  2565. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  2566. */
  2567. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  2568. if (inSave) {
  2569. this.$message.success("保存成功");
  2570. //关闭窗口
  2571. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  2572. this.selectionList = []
  2573. this.searchReset()
  2574. }
  2575. },
  2576. //自定义列重置
  2577. async resetColumn(ref, option, optionBack, code) {
  2578. this[option] = this[optionBack];
  2579. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  2580. if (this.saberUserInfo.role_name.indexOf('admin') != -1 || this.saberUserInfo.role_name.indexOf('总部') != -1) {
  2581. this.option.searchMenuSpan = 12
  2582. this.option.column.forEach(item => {
  2583. if (item.prop == 'branchId') {
  2584. item.search = true
  2585. }
  2586. if (item.prop == 'branchName') {
  2587. item.hide = false
  2588. // item.showColumn = true
  2589. }
  2590. })
  2591. }
  2592. if (inSave) {
  2593. this.$message.success("重置成功");
  2594. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  2595. this.selectionList = []
  2596. this.searchReset()
  2597. }
  2598. },
  2599. // 更改表格颜色
  2600. headerClassName(tab) {
  2601. // //颜色间隔
  2602. let back = "";
  2603. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  2604. if (tab.columnIndex % 2 === 0) {
  2605. back = "back-one";
  2606. } else if (tab.columnIndex % 2 === 1) {
  2607. back = "back-two";
  2608. }
  2609. }
  2610. return back;
  2611. }
  2612. }
  2613. };
  2614. </script>
  2615. <style scoped>
  2616. ::v-deep#out-table .back-one {
  2617. background: #ecf5ff !important;
  2618. text-align: center;
  2619. }
  2620. ::v-deep#out-table .back-two {
  2621. background: #ecf5ff !important;
  2622. text-align: center;
  2623. }
  2624. /deep/ .el-col-md-8 {
  2625. width: 24.33333%;
  2626. }
  2627. ::v-deep.el-form-item {
  2628. margin-bottom: 0;
  2629. }
  2630. </style>