billsDetails.vue 122 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
  6. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left" @click="backToList"
  7. >{{ $t("btn118n.toList") }}
  8. </el-button>
  9. <el-button v-if="form.id && pageIds.length" type="text" @click="lastPage">{{ $t("btn118n.previous") }}</el-button>
  10. <el-button v-if="form.id && pageIds.length" type="text" @click="nextPage">{{ $t("btn118n.next") }}</el-button>
  11. </div>
  12. <div class="add-customer-btn">
  13. <!--<el-popover-->
  14. <!-- placement="bottom-end"-->
  15. <!-- width="100"-->
  16. <!-- trigger="hover">-->
  17. <!-- <div>-->
  18. <!-- </div>-->
  19. <el-button v-if="form.changeOrderStatus == '录入'" type="primary" size="small" @click="allClick('申请换单')">申请换单 </el-button>
  20. <el-button v-if="form.changeOrderStatus == '申请'" type="danger" size="small" @click="allClick('撤销换单')">撤销换单 </el-button>
  21. <el-button v-if="form.deliveryNoteStatus == '录入'" type="success" size="small" @click="allClick('电子提货单')">电子提货单 </el-button>
  22. <el-button v-if="form.deliveryNoteStatus == '已发送'" type="danger" size="small" @click="allClick('撤销电子提货单')"
  23. >撤销电子提货单
  24. </el-button>
  25. <el-button size="small" type="primary" @click="addEdit">{{ $t("btn118n.new") }} </el-button>
  26. <el-button type="success" size="small" style="margin-right: 8px" @click="CopyDocumentsfun">{{ $t("btn118n.copy") }} </el-button>
  27. <el-dropdown style="line-height: 0" v-if="saberTenantId == '409341' || saberTenantId == '607913'">
  28. <el-button size="small" type="warning" style="margin-right: 8px" :disabled="form.status > 0 || showLock || !form.id">
  29. {{ $t("btn118n.importTemplate") }}<i class="el-icon-arrow-down el-icon--right"></i>
  30. </el-button>
  31. <el-dropdown-menu slot="dropdown">
  32. <el-dropdown-item v-for="item in imporiData" :key="item.id" @click.native="importData(item.id)">{{ item.name }} </el-dropdown-item>
  33. </el-dropdown-menu>
  34. </el-dropdown>
  35. <el-dropdown style="line-height: 0">
  36. <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading" :disabled="!form.id || showLock">
  37. 发送 SO EDI<i class="el-icon-arrow-down el-icon--right"></i>
  38. </el-button>
  39. <el-dropdown-menu slot="dropdown">
  40. <el-dropdown-item v-for="item in ediData_SO" :key="item.id" class="dropdown-max" @click.native="editypesSendingEdifun(item)"
  41. >{{ item.cnName }}
  42. </el-dropdown-item>
  43. </el-dropdown-menu>
  44. </el-dropdown>
  45. <!-- <el-dropdown style="line-height: 0">
  46. <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading"
  47. :disabled="!form.id || showLock">
  48. 发送 SI EDI<i class="el-icon-arrow-down el-icon--right"></i>
  49. </el-button>
  50. <el-dropdown-menu slot="dropdown">
  51. <el-dropdown-item v-for="item in ediData_SI" :key="item.id" class="dropdown-max"
  52. @click.native="editypesSendingEdifun(item)">{{ item.cnName }}
  53. </el-dropdown-item>
  54. </el-dropdown-menu>
  55. </el-dropdown> -->
  56. <el-button
  57. v-if="
  58. bigtabs != 'dz' &&
  59. (roleName.includes('admin') ||
  60. (roleName.includes('应付查看') && roleName.includes('应收查看')) ||
  61. (roleName.includes('应付修改') && roleName.includes('应收修改')))
  62. "
  63. size="small"
  64. style="margin-right: 8px"
  65. :loading="saveLoading"
  66. :disabled="!form.id"
  67. @click="previewDialogfun"
  68. >{{ $t("btn118n.preview") }}
  69. </el-button>
  70. <el-button v-if="form.id && form.receiveStatus == '录入'" size="small" type="success" @click.stop="allClick('接收')"
  71. >{{ $t("btn118n.received") }}
  72. </el-button>
  73. <el-button v-if="form.id && form.receiveStatus == '已接收'" size="small" type="danger" @click.stop="allClick('撤销接收')"
  74. >{{ $t("btn118n.unReceived") }}
  75. </el-button>
  76. <!-- <el-button v-if="form.id && form.changeOrdersStatus == '可换单'" size="small" type="warning"
  77. @click.stop="allClick('换单')">{{ $t("sea118n.changeDoc") }}
  78. </el-button> -->
  79. <!-- <el-button v-if="form.id && form.changeOrdersStatus == '已换单'" size="small" type="danger"
  80. @click.stop="allClick('撤销换单')">{{ $t("sea118n.unChangeDoc") }}
  81. </el-button> -->
  82. <el-button size="small" type="warning" :disabled="!form.id || showLock" v-if="form.billType == 'MM'" @click.stop="allClick('同步分单信息')"
  83. >{{ $t("btn118n.getInfoMMToMH") }}
  84. </el-button>
  85. <el-button v-if="form.id && form.returningSecurityMoneyStatus == '可退押'" size="small" type="info" @click.stop="allClick('退押')"
  86. >{{ $t("btn118n.returnDeposit") }}
  87. </el-button>
  88. <el-button v-if="form.id && form.returningSecurityMoneyStatus == '已退押'" size="small" type="danger" @click.stop="allClick('撤销退押')"
  89. >{{ $t("btn118n.unReturnDeposit") }}
  90. </el-button>
  91. <el-button
  92. size="small"
  93. type="warning"
  94. :disabled="!form.id || showLock"
  95. v-if="form.status == 1 && form.billType != 'MH'"
  96. @click.stop="revokeDocumentApproval"
  97. >{{ $t("btn118n.unapply") }}
  98. </el-button>
  99. <el-button
  100. size="small"
  101. type="success"
  102. :disabled="!form.id || detailData.seeDisabled || showLock"
  103. v-if="form.status == 0 || (form.status == 4 && form.billType != 'MH')"
  104. @click.stop="DocumentApproval"
  105. >{{ $t("btn118n.apply") }}
  106. </el-button>
  107. <el-button
  108. size="small"
  109. type="danger"
  110. :disabled="showLock"
  111. v-if="form.status == 3 && form.billType != 'MH' && (roleName.includes('admin') || roleName.includes('撤销锁单'))"
  112. @click.stop="revokeLockOrder"
  113. >{{ $t("btn118n.unapply") }}
  114. </el-button>
  115. <el-button
  116. size="small"
  117. type="primary"
  118. style="margin-right: 8px"
  119. :disabled="detailData.seeDisabled || showLock"
  120. :loading="saveLoading"
  121. @click="editCustomer"
  122. >{{ $t("btn118n.save") }}
  123. </el-button>
  124. <el-dropdown style="line-height: 0" v-if="form.billType != 'MH'">
  125. <el-button type="warning" :loading="saveLoading" :disabled="!form.id" size="small">
  126. {{ $t("btn118n.checked") }}<i class="el-icon-arrow-down el-icon--right"></i>
  127. </el-button>
  128. <el-dropdown-menu slot="dropdown">
  129. <el-dropdown-item @click.native="(checkScheduleDialog = true), (checkId = form.id)">审核进度 </el-dropdown-item>
  130. </el-dropdown-menu>
  131. </el-dropdown>
  132. </div>
  133. </div>
  134. <div style="margin-top: 50px">
  135. <el-tabs type="border-card" v-model="bigtabs" @tab-click="bigHandleClick">
  136. <el-tab-pane :label="$t('sea118n.orderInfo')" name="wt" class="scrollable-container">
  137. <div>
  138. <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm" :disabled="showLock">
  139. <basic-container>
  140. <el-row :gutter="60">
  141. <el-col v-for="(item, index) in basicData.column" :key="index" :span="8">
  142. <!--数组-->
  143. <div v-if="item instanceof Array" style="display: flex;align-items: center;justify-content: space-between">
  144. <el-row>
  145. <el-col :span="item[0].span ? item[0].span : 12">
  146. <el-form-item :label="item[0].label" :prop="item[0].prop" :rules="item[0].rules" :label-width="item[0].labelWidth">
  147. <span slot="label" v-if="item[0].label">
  148. <span
  149. v-if="item[0].label == 'HB/L NO'"
  150. style="color: #4c9e44;cursor: pointer;text-decoration: underline;"
  151. @click="applyforfun(item[0].label)"
  152. >{{ form.hblno ? "删除" : "申请" }}
  153. {{ item[0].label }}
  154. </span>
  155. <span v-else style="color: #1e9fff">{{ item[0].label }}</span>
  156. </span>
  157. <span v-if="item[0].type == 'button'"></span>
  158. <!--<el-button v-if="item[0].type == 'button'" :disabled="detailData.seeDisabled || item[0].disabled"-->
  159. <!-- size="mini" type="success" icon="el-icon-circle-plus" circle-->
  160. <!-- @click="applyforfun(item[0].label)" >-->
  161. <!--</el-button>-->
  162. <search-query
  163. v-else-if="item[0].type == 'select'"
  164. :datalist="item[0].dicData"
  165. :selectValue="form[item[0].prop]"
  166. :filterable="true"
  167. :allowCreate="item[0].allowCreate || false"
  168. :remote="true"
  169. :disabled="detailData.seeDisabled || item[0].disabled"
  170. :buttonIf="false"
  171. :placeholder="`${item[0].text || ''}`"
  172. :forParameter="item[0].forParameter"
  173. @remoteMethod="remoteMethod($event, item[0].prop)"
  174. @corpChange="corpChange($event, item[0].prop)"
  175. @corpFocus="remoteMethod($event, item[0].prop)"
  176. >
  177. </search-query>
  178. <el-input
  179. v-else
  180. type="age"
  181. style="width: 100%;"
  182. v-model="form[item[0].prop]"
  183. size="small"
  184. autocomplete="off"
  185. :disabled="
  186. detailData.seeDisabled ||
  187. item[0].disabled ||
  188. form.feeCenterListD.filter(item => item.auditStatus > 0).length ||
  189. form.feeCenterListC.filter(item => item.auditStatus > 0).length
  190. "
  191. :placeholder="item[0].text || ''"
  192. ></el-input>
  193. </el-form-item>
  194. </el-col>
  195. <el-col :span="item[1].span ? item[1].span : 12">
  196. <el-form-item :label="item[1].label" :prop="item[1].prop" :rules="item[1].rules" :label-width="item[1].labelWidth">
  197. <span slot="label" v-if="item[1].label">
  198. <span style="color: #1e9fff">{{ item[1].label }}</span>
  199. </span>
  200. <el-date-picker
  201. v-if="item[1].type == 'date'"
  202. v-model="form[item[1].prop]"
  203. clearable
  204. style="width: 100%;"
  205. type="date"
  206. size="small"
  207. :disabled="detailData.seeDisabled || item[1].disabled"
  208. value-format="yyyy-MM-dd HH:mm"
  209. placeholder="选择日期"
  210. >
  211. </el-date-picker>
  212. <search-query
  213. v-else-if="item[1].type == 'select'"
  214. :datalist="item[1].dicData"
  215. :selectValue="form[item[1].prop]"
  216. :filterable="true"
  217. :remote="true"
  218. :disabled="
  219. detailData.seeDisabled ||
  220. item[1].disabled ||
  221. form.feeCenterListD.filter(item => item.auditStatus > 0).length ||
  222. form.feeCenterListC.filter(item => item.auditStatus > 0).length
  223. "
  224. :buttonIf="false"
  225. :placeholder="`${item[1].text || ''}`"
  226. :forParameter="item[1].forParameter"
  227. @remoteMethod="remoteMethod($event, item[1].prop)"
  228. @corpChange="corpChange($event, item[1].prop)"
  229. @corpFocus="remoteMethod($event, item[1].prop)"
  230. >
  231. </search-query>
  232. <tree-select
  233. v-else-if="item[1].type == 'tree'"
  234. v-model="form[item[1].prop]"
  235. :data="item[1].dicData"
  236. :props="item[1].forParameter"
  237. nodeKey="title"
  238. size="small"
  239. :clearable="false"
  240. :disabled="detailData.seeDisabled || item[1].disabled"
  241. :multiple="false"
  242. :placeholder="`${item[1].text || ''}`"
  243. @input="corpChange($event, item[1].prop)"
  244. >
  245. </tree-select>
  246. <el-input
  247. v-else
  248. type="age"
  249. style="width: 100%;"
  250. v-model="form[item[1].prop]"
  251. size="small"
  252. autocomplete="off"
  253. :disabled="detailData.seeDisabled || item[1].disabled"
  254. :placeholder="item[1].text || ''"
  255. ></el-input>
  256. </el-form-item>
  257. </el-col>
  258. <el-col v-if="item[2]" :span="item[2].span ? item[2].span : 12">
  259. <el-form-item :label="item[2].label" :prop="item[2].prop" :rules="item[2].rules" :label-width="item[2].labelWidth">
  260. <span slot="label" v-if="item[2].label">
  261. <span style="color: #1e9fff">{{ item[2].label }}</span>
  262. </span>
  263. <search-query
  264. v-if="item[2].type == 'select'"
  265. :datalist="item[2].dicData"
  266. :selectValue="form[item[2].prop]"
  267. :filterable="true"
  268. :clearable="false"
  269. :remote="true"
  270. :disabled="detailData.seeDisabled || item[2].disabled"
  271. :buttonIf="false"
  272. :forParameter="item[2].forParameter"
  273. :placeholder="`${item[2].text || ''}`"
  274. @remoteMethod="remoteMethod($event, item[2].prop)"
  275. @corpChange="corpChange($event, item[2].prop)"
  276. @corpFocus="remoteMethod($event, item[2].prop)"
  277. >
  278. </search-query>
  279. <el-input
  280. v-else
  281. type="age"
  282. style="width: 100%;"
  283. v-model="form[item[2].prop]"
  284. size="small"
  285. autocomplete="off"
  286. :disabled="detailData.seeDisabled || item[1].disabled"
  287. :placeholder="item[2].text || ''"
  288. ></el-input>
  289. </el-form-item>
  290. </el-col>
  291. </el-row>
  292. </div>
  293. <!--对象-->
  294. <div v-else>
  295. <el-form-item v-if="item.display == true" :label="item.label" :prop="item.prop" :rules="item.rules">
  296. <span slot="label" v-if="item.label">
  297. <span style="color: #1e9fff">{{ item.label }}</span>
  298. </span>
  299. <search-query
  300. v-if="item.type == 'select'"
  301. ref="searchQueryRef"
  302. :datalist="item.dicData"
  303. :selectValue="form[item.prop]"
  304. :filterable="true"
  305. :clearable="false"
  306. :remote="true"
  307. :disabled="detailData.seeDisabled || item.disabled"
  308. :buttonIf="item.buttonIf"
  309. :forParameter="item.forParameter"
  310. :placeholder="`${item.text || ''}`"
  311. :joinData="item.joinData"
  312. @remoteMethod="remoteMethod($event, item.prop)"
  313. @corpChange="corpChange($event, item.prop)"
  314. @corpFocus="remoteMethod($event, item.prop)"
  315. @eldialogConfirm="eldialogConfirm(item.slot)"
  316. >
  317. <bcorps
  318. v-show="item.slot == 'bcorps'"
  319. ref="bcorps"
  320. :eldialog="true"
  321. @selectionChange="eldialogMultipleChoice($event, item.slot)"
  322. >
  323. </bcorps>
  324. <bcorpstypedefine v-show="item.slot == 'bcorpstypedefine'"> </bcorpstypedefine>
  325. </search-query>
  326. <el-input
  327. v-else
  328. type="age"
  329. style="width: 100%;"
  330. v-model="form[item.prop]"
  331. size="small"
  332. autocomplete="off"
  333. :disabled="detailData.seeDisabled || item.disabled"
  334. :placeholder="item.text || ''"
  335. ></el-input>
  336. </el-form-item>
  337. </div>
  338. </el-col>
  339. </el-row>
  340. </basic-container>
  341. </el-form>
  342. </div>
  343. <div class="customer-main margintop">
  344. <basic-container :showBtn="true">
  345. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  346. <el-tab-pane :label="$t('sea118n.billInfo')" name="first">
  347. <entrustment-lnformation
  348. :assemblyForm="form"
  349. :saberUserInfo="saberUserInfo"
  350. :detailData="detailData"
  351. :disabled="showLock"
  352. :generateBillsfalse="generateBillsfalse"
  353. @billsDetailfun="billsDetailfun(form.id)"
  354. >
  355. </entrustment-lnformation>
  356. </el-tab-pane>
  357. <el-tab-pane :label="$t('sea118n.ctnrList')" name="second">
  358. <DistributionBox
  359. :assemblyForm="form"
  360. :detailData="detailData"
  361. :showLock="showLock"
  362. :pleasereviewType="pleasereviewType"
  363. @billsAddfun="billsAddfun"
  364. @billsDetailfun="billsDetailfun(form.id)"
  365. >
  366. </DistributionBox>
  367. </el-tab-pane>
  368. <el-tab-pane label="MB/L信息" name="third">
  369. <mbinformation :assemblyForm="form" :detailData="detailData" :disabled="showLock"> </mbinformation>
  370. </el-tab-pane>
  371. <el-tab-pane
  372. :label="$t('sea118n.reportManage')"
  373. name="fourth"
  374. v-if="roleName.indexOf('admin') != -1 ? true : roleName.indexOf('报表管理') != -1 ? true : false"
  375. >
  376. <reports :id="form.id" :assemblyForm="form" :disabled="detailData.seeDisabled || showLock" businessValue="HYJK"></reports>
  377. </el-tab-pane>
  378. <!-- <el-tab-pane label="EDI 及其他" name="sixth">
  379. <edicode :assemblyForm="form" :detailData="detailData" :disabled="showLock">
  380. </edicode>
  381. </el-tab-pane> -->
  382. <el-tab-pane :label="$t('sea118n.fileCerter')" name="seventh">
  383. <filescenter ref="filescenter" :assemblyForm="form" :pid="form.id" :detailData="detailData" :showLock="showLock"></filescenter>
  384. </el-tab-pane>
  385. </el-tabs>
  386. </basic-container>
  387. <basic-container :showBtn="true" v-show="activeName == 'first' || activeName == 'third'">
  388. <formbottom :assemblyForm="form" :generateBillsfalse="generateBillsfalse" :disabled="showLock" :detailData="detailData"></formbottom>
  389. </basic-container>
  390. </div>
  391. </el-tab-pane>
  392. <el-tab-pane
  393. :label="$t('sea118n.feeInfo')"
  394. name="fy"
  395. class="scrollable-container"
  396. v-if="
  397. roleName.includes('admin') ||
  398. roleName.includes('secondaryAdmin') ||
  399. roleName.includes('应收修改') ||
  400. roleName.includes('应付修改') ||
  401. roleName.includes('应收查看') ||
  402. roleName.includes('应付查看') ||
  403. roleName.includes('国外费用') ||
  404. roleName.includes('允许修改他人费用')
  405. "
  406. >
  407. <feecenter
  408. :assemblyForm="form"
  409. :copyFormData="copyFormData"
  410. :detailData="detailData"
  411. :disabled="detailData.seeDisabled || showLock"
  412. :showLock="showLock"
  413. :pleasereviewType="pleasereviewType"
  414. :pid="form.id"
  415. @billsDetailfun="billsDetailfun(form.id)"
  416. >
  417. </feecenter>
  418. </el-tab-pane>
  419. <el-tab-pane :label="$t('sea118n.docCenter')" name="dz" class="scrollable-container">
  420. <document-center ref="documentCenter" :detailData="detailData" :assemblyForm="form" :disabled="showLock"></document-center>
  421. </el-tab-pane>
  422. <el-tab-pane :label="$t('sea118n.hblnolist')" name="fd" v-if="form.billType == 'MM'" class="scrollable-container">
  423. <Split-list
  424. :detailData="detailData"
  425. :assemblyForm="form"
  426. :data="billsListAllData"
  427. :disabled="detailData.seeDisabled || showLock"
  428. @billsListAllfun="billsListAllfun(form.id)"
  429. ></Split-list>
  430. </el-tab-pane>
  431. </el-tabs>
  432. </div>
  433. <!--导入模板-->
  434. <el-dialog
  435. :title="$t('btn118n.importTemplate')"
  436. append-to-body
  437. :visible.sync="excelBox"
  438. width="555px"
  439. :close-on-click-modal="false"
  440. v-dialog-drag
  441. >
  442. <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading" :upload-before="uploadBefore" :upload-after="onSuccess">
  443. </avue-form>
  444. </el-dialog>
  445. <!--审核弹窗-->
  446. <el-dialog
  447. append-to-body
  448. title="审批进度"
  449. class="el-dialogDeep"
  450. :visible.sync="checkScheduleDialog"
  451. width="40%"
  452. :close-on-click-modal="false"
  453. :destroy-on-close="true"
  454. :close-on-press-escape="false"
  455. v-dialog-drag
  456. >
  457. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  458. </el-dialog>
  459. <!--预览报表弹窗-->
  460. <el-dialog
  461. append-to-body
  462. title="预览报表"
  463. class="el-dialogDeep"
  464. :visible.sync="previewDialog"
  465. width="60%"
  466. :close-on-click-modal="false"
  467. :destroy-on-close="true"
  468. :close-on-press-escape="false"
  469. v-dialog-drag
  470. >
  471. <business-reports
  472. v-if="previewDialog"
  473. :id="form.id"
  474. :classifycode="getReportTypeByBigHandle()"
  475. :disabled="detailData.seeDisabled"
  476. ></business-reports>
  477. </el-dialog>
  478. </div>
  479. </template>
  480. <script>
  481. import EntrustmentLnformation from "@/views/iosBasicData/OceanFreightImport/bills/assembly/EntrustmentLnformation.vue";
  482. import mbinformation from "@/views/iosBasicData/OceanFreightImport/bills/assembly/mbinformation.vue";
  483. import reports from "@/views/iosBasicData/OceanFreightImport/bills/assembly/reports.vue";
  484. import formbottom from "@/views/iosBasicData/OceanFreightImport/bills/assembly/formbottom.vue";
  485. import edicode from "@/views/iosBasicData/OceanFreightImport/bills/assembly/edicode.vue";
  486. import filescenter from "@/views/iosBasicData/OceanFreightImport/bills/assembly/filescenter.vue";
  487. import DistributionBox from "@/views/iosBasicData/OceanFreightImport/bills/assembly/DistributionBox.vue";
  488. import feecenter from "@/views/iosBasicData/OceanFreightImport/bills/assembly/feecenter.vue";
  489. import { getList as userGetList } from "@/api/system/user";
  490. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  491. import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
  492. import bcorps from "@/views/iosBasicData/bcorps/index.vue";
  493. import bcorpstypedefine from "@/views/iosBasicData/bcorps/bcorpstypedefine.vue";
  494. import SplitList from "@/views/iosBasicData/OceanFreightImport/bills/assembly/SplitList.vue";
  495. import { getLazylist } from "@/api/basicData/agreement";
  496. import { getBcorpsList, getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  497. import { getBlocationsList } from "@/api/iosBasicData/blocations";
  498. import { getBcorpsattnList } from "@/api/iosBasicData/bcorpsattn";
  499. import { getWorkDicts } from "@/api/system/dictbiz";
  500. import { getDeptLazyTree, getDeptTree, getLazyList } from "@/api/system/dept";
  501. import {
  502. billsCheckBills,
  503. billsCopyBills,
  504. billsDetail,
  505. billsGetBillNo,
  506. removeHblNo,
  507. billsListAll,
  508. billsRevokeCheckBills,
  509. editypesSendingEdi,
  510. billsSubmit,
  511. billsAdd,
  512. deptGetDetailPol,
  513. postSelectByUser,
  514. receive,
  515. revokeReceive,
  516. changeOrders,
  517. revokeChangeOrders,
  518. returningSecurityMoney,
  519. revokeReturningSecurityMoney,
  520. synchronizeData,
  521. revokeLockOrder
  522. } from "@/api/iosBasicData/bills";
  523. import { dateFormat } from "@/util/date";
  524. import checkSchedule from "@/components/checkH/checkSchedule.vue";
  525. import { getBvesselsList } from "@/api/iosBasicData/bvessels";
  526. import DocumentCenter from "@/views/iosBasicData/OceanFreightImport/bills/assembly/DocumentCenter.vue";
  527. import businessReports from "@/views/iosBasicData/OceanFreightImport/bills/assembly/businessReports.vue";
  528. import { popupReminder } from "@/util/messageReminder";
  529. import editypes from "@/views/iosBasicData/editypes/index.vue";
  530. import { editypesList } from "@/api/iosBasicData/editypes";
  531. import { verifyEnglish, checkFullWidthSymbols, lineQuantityVerification } from "@/util/date";
  532. import { contrastObj, contrastList } from "@/util/contrastData";
  533. import { selectListLos } from "@/api/approval/processConfig";
  534. import { isProcurement } from "@/api/basicData/configuration";
  535. import { applySwitch, revokeSwitch, electronBillOfLading, revokeElectronBillOfLading } from "@/api/iosBasicData/ImportExchange.js";
  536. import _ from "lodash";
  537. export default {
  538. components: {
  539. checkSchedule,
  540. SearchQuery,
  541. EntrustmentLnformation,
  542. formbottom,
  543. mbinformation,
  544. reports,
  545. edicode,
  546. filescenter,
  547. DistributionBox,
  548. feecenter,
  549. bcorps,
  550. bcorpstypedefine,
  551. SplitList,
  552. TreeSelect,
  553. DocumentCenter,
  554. businessReports,
  555. editypes
  556. },
  557. props: {
  558. detailData: {
  559. type: Object
  560. },
  561. pageIds: {
  562. type: Array, // 指定 prop 的类型为 Array
  563. default: () => [] // 提供一个默认值,这里使用函数形式返回一个空数组
  564. }
  565. },
  566. data() {
  567. return {
  568. showLock: false,
  569. ediData: [], // edi 列表数据
  570. ediData_SO: [], // edi SO 列表数据
  571. ediData_SI: [], // edi SI 列表数据
  572. previewDialog: false, // 预览报表弹窗开启
  573. generateBillsfalse: false, // 如果生成账单就禁用
  574. pleasereviewType: false, // 如果请核就禁用
  575. checkScheduleDialog: false, // 审核弹窗
  576. checkId: "", // 审核需要的id
  577. batchNo: "",
  578. billsListAllData: [], // 分单列表数据
  579. pageLoading: false, // 全屏的动画
  580. saveLoading: false,
  581. copyFormData: {}, // 详情的备份数据
  582. // 详情数据
  583. form: {
  584. branchId: JSON.parse(localStorage.getItem("sysitemData")).deptId,
  585. branchName: JSON.parse(localStorage.getItem("sysitemData")).deptName,
  586. billDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00", // 单据日期 默认 当天
  587. operatorName: JSON.parse(localStorage.getItem("saber-userInfo")).content.user_name, // OP 默认登录人
  588. operatorId: JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id, // OP 默认登录人
  589. businessType: "SI", // 业务类型 默认 海运出口
  590. businessTypes: "海运",
  591. billType: "DD", // 单据类型 默认 直单
  592. accDeptName: "", // 核算部门 默认登录人的部门
  593. issueType: "TER", // 签单方式 默认 正本提单
  594. mpaymode: "PP", // 主单付费方式 默认PP
  595. hpaymode: "PP", // 分单付费方式 默认 PP
  596. polFreeBoxUseDays: 7,
  597. podFreeBoxUseDays: 14,
  598. loadType: "整箱", // 装箱方式默认整箱
  599. srcType: "OWN", // 业务来源默认公司 来源 内容 默认登录人所属公司
  600. numberOfObl: "NONE", // 正本份数 默认 THREE
  601. numberOfCopy: "NONE", // 副本份数 默认 THREE
  602. seaType: "I", // 进出口 默认出口 E=出口 I=进口"
  603. cargoType: "dry", // 货物类型默认普货
  604. marks: "N/M",
  605. dgPackingLevel: "0", // 危险品包装等级
  606. serviceTerms: "CY-CY", // 服务方式
  607. filesList: [], // 文件中心
  608. feeCenterListD: [], // 收
  609. feeCenterListC: [], // 付
  610. preContainersList: [], // 箱
  611. feeCenterAmendList: [],
  612. containerNumberItemList: [],
  613. placeReceiptName: "",
  614. placeReceiptNamePrint: "",
  615. polEnName: "",
  616. polNamePrint: "",
  617. podEnName: "",
  618. podNamePrint: "",
  619. destinationName: "",
  620. destinationNamePrint: "",
  621. placeDeliveryName: "",
  622. placeDeliveryNamePrint: "",
  623. potEnName: "",
  624. potNamePrint: "",
  625. detail: {},
  626. hmmEdi: {}
  627. },
  628. oldForm: {
  629. branchId: JSON.parse(localStorage.getItem("sysitemData")).deptId,
  630. branchName: JSON.parse(localStorage.getItem("sysitemData")).deptName,
  631. billDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00", // 单据日期 默认 当天
  632. operatorName: JSON.parse(localStorage.getItem("saber-userInfo")).content.user_name, // OP 默认登录人
  633. operatorId: JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id, // OP 默认登录人
  634. businessType: "SI", // 业务类型 默认 海运出口
  635. businessTypes: "海运",
  636. billType: "DD", // 单据类型 默认 直单
  637. accDeptName: "", // 核算部门 默认登录人的部门
  638. issueType: "TER", // 签单方式 默认 正本提单
  639. mpaymode: "PP", // 主单付费方式 默认PP
  640. hpaymode: "PP", // 分单付费方式 默认 PP
  641. polFreeBoxUseDays: 7,
  642. podFreeBoxUseDays: 14,
  643. loadType: "整箱", // 装箱方式默认整箱
  644. srcType: "OWN", // 业务来源默认公司 来源 内容 默认登录人所属公司
  645. numberOfObl: "NONE", // 正本份数 默认 THREE
  646. numberOfCopy: "NONE", // 副本份数 默认 THREE
  647. seaType: "I", // 进出口 默认出口 E=出口 I=进口"
  648. cargoType: "dry", // 货物类型默认普货
  649. marks: "N/M",
  650. dgPackingLevel: "0", // 危险品包装等级
  651. serviceTerms: "CY-CY", // 服务方式
  652. filesList: [], // 文件中心
  653. feeCenterListD: [], // 收
  654. feeCenterListC: [], // 付
  655. preContainersList: [], // 箱
  656. feeCenterAmendList: [],
  657. containerNumberItemList: [],
  658. placeReceiptName: "",
  659. placeReceiptNamePrint: "",
  660. polEnName: "",
  661. polNamePrint: "",
  662. podEnName: "",
  663. podNamePrint: "",
  664. destinationName: "",
  665. destinationNamePrint: "",
  666. placeDeliveryName: "",
  667. placeDeliveryNamePrint: "",
  668. potEnName: "",
  669. potNamePrint: "",
  670. detail: {},
  671. hmmEdi: {}
  672. },
  673. // 循环的配置
  674. basicData: {
  675. column: [
  676. {
  677. label: this.$t("sea118n.corpName"), // 调往来单位接口
  678. prop: "corpCnName",
  679. text: "请选择客户名称",
  680. type: "select",
  681. dicData: [],
  682. disabled: false,
  683. buttonIf: true,
  684. joinData: true,
  685. slot: "bcorps",
  686. display: true,
  687. forParameter: {
  688. key: "id",
  689. label: "cnName",
  690. value: "cnName",
  691. short: "shortName"
  692. },
  693. rules: [
  694. {
  695. required: true,
  696. message: " ",
  697. trigger: "blur"
  698. }
  699. ]
  700. },
  701. {
  702. label: "booking NO", // 订舱号
  703. text: "请输入booking NO",
  704. prop: "bookingNo",
  705. disabled: false,
  706. display: true
  707. },
  708. {
  709. label: "HB/L NO",
  710. text: "请输入MB/L NO",
  711. prop: "hblno",
  712. disabled: false,
  713. display: false
  714. },
  715. [
  716. {
  717. label: "MB/L NO",
  718. text: "请输入MB/L NO",
  719. prop: "mblno",
  720. span: 18,
  721. disabled: false
  722. },
  723. {
  724. label: "", // MB/L 付款方式 PP=预付, CC=到付, FPA, Other
  725. text: "请选择付款方式",
  726. prop: "mpaymode",
  727. type: "select",
  728. labelWidth: "30px",
  729. disabled: false,
  730. span: 6,
  731. dicData: [],
  732. forParameter: {
  733. key: "dictKey",
  734. label: "dictValue",
  735. value: "dictKey"
  736. }
  737. }
  738. ]
  739. // [
  740. // {
  741. // label: "OP", // 操作id 用户管理下拉 模糊搜索
  742. // text: "请选择OP",
  743. // prop: "operatorName",
  744. // type: 'select',
  745. // dicData: [],
  746. // disabled: false,
  747. // forParameter: {
  748. // key: 'id',
  749. // label: 'name',
  750. // value: 'name',
  751. // },
  752. // rules: [{
  753. // required: true,
  754. // message: " ",
  755. // trigger: "blur"
  756. // }]
  757. // },
  758. // {
  759. // label: "核算部门", // 核算部门Id accDept 核算部门 accDeptName 调机构管理接口
  760. // text: "请选择核算部门",
  761. // prop: "accDeptName",
  762. // type: 'tree',
  763. // dicData: [],
  764. // disabled: false,
  765. // clearable: false,
  766. // forParameter: {
  767. // label: "title",
  768. // children: 'children'
  769. // },
  770. // rules: [{
  771. // required: true,
  772. // message: " ",
  773. // trigger: "blur"
  774. // }]
  775. // },
  776. // ],
  777. ]
  778. },
  779. activeName: "first",
  780. bigtabs: "wt",
  781. saberUserInfo: {}, // 当前登录人信息
  782. roleName: [], // 当前的角色权限
  783. // 需要加判断是否必填的数据
  784. messageData: [
  785. {
  786. name: "客户",
  787. value: "corpCnName"
  788. },
  789. {
  790. name: "业务来源",
  791. value: "srcType"
  792. },
  793. {
  794. name: "MBLNO",
  795. value: "mblno"
  796. },
  797. // {
  798. // name: 'booking NO',
  799. // value: 'bookingNo',
  800. // },
  801. // {
  802. // name: 'REF MBLNO',
  803. // value: 'refno',
  804. // },
  805. {
  806. name: "船名(VSL)",
  807. value: "vesselCnName"
  808. },
  809. {
  810. name: "航次(VOY)",
  811. value: "voyageNo"
  812. },
  813. // {
  814. // name: 'ETD',
  815. // value: 'etd',
  816. // },
  817. {
  818. name: "装货港",
  819. value: "polCnName"
  820. },
  821. {
  822. name: "目的港",
  823. value: "destinationNamePrint"
  824. },
  825. // {
  826. // name: '包装单位',
  827. // value: 'packingUnit',
  828. // },
  829. {
  830. name: "船公司",
  831. value: "carrierCnName"
  832. },
  833. {
  834. name: "场站",
  835. value: "podCyCnName"
  836. }
  837. ],
  838. imporiData: [
  839. {
  840. id: 0,
  841. name: "导入 ONE 模板"
  842. },
  843. {
  844. id: 1,
  845. name: "导入 PIL 订舱模板"
  846. },
  847. {
  848. id: 2,
  849. name: "导入截单格式"
  850. },
  851. {
  852. id: 3,
  853. name: "导入海信提单"
  854. }
  855. ],
  856. excelForm: {},
  857. excelLoading: false,
  858. excelOption: {
  859. submitBtn: false,
  860. emptyBtn: false,
  861. column: [
  862. {
  863. label: "模板上传",
  864. prop: "excelFile",
  865. type: "upload",
  866. drag: true,
  867. loadText: "模板上传中,请稍等",
  868. span: 24,
  869. propsHttp: {
  870. res: "data"
  871. },
  872. tip: "请上传 .xls,.xlsx 标准格式文件",
  873. action: "api/blade-los/templateImport/importOne"
  874. }
  875. ]
  876. },
  877. excelBox: false,
  878. saberTenantId: 0,
  879. isHq: null,
  880. lineLength: 35
  881. };
  882. },
  883. watch: {
  884. // 监听业务类型 如果不是分单 可以编辑分单号
  885. "form.billType": {
  886. // 执行方法
  887. handler(oldValue, newValue) {
  888. if (oldValue == "MH" || oldValue == "MM") {
  889. this.basicData.column.forEach(item => {
  890. if (item.prop == "bookingNo") {
  891. item.display = false;
  892. }
  893. if (item.prop == "hblno") {
  894. item.display = true;
  895. }
  896. });
  897. } else {
  898. this.basicData.column.forEach(item => {
  899. if (item.prop == "bookingNo") {
  900. item.display = false;
  901. }
  902. if (item.prop == "hblno") {
  903. item.display = true;
  904. }
  905. });
  906. }
  907. // 只有分单不能编辑
  908. if (oldValue == "MH") {
  909. this.basicData.column.forEach((item, index) => {
  910. if (index == 3) {
  911. item.forEach(row => {
  912. if (row.prop == "mblno") {
  913. row.disabled = true;
  914. }
  915. });
  916. }
  917. });
  918. } else {
  919. this.basicData.column.forEach((item, index) => {
  920. if (index == 3) {
  921. item.forEach(row => {
  922. if (row.prop == "mblno") {
  923. row.disabled = false;
  924. }
  925. });
  926. }
  927. });
  928. }
  929. // 只有分单不能编辑
  930. // if (oldValue == 'MH') {
  931. // this.columnforfun('hblno').disabled = true
  932. // } else {
  933. // this.columnforfun('hblno').disabled = false
  934. // }
  935. // 王风刚 2025-02-21 所有分单号都不能手动输入,都可以申请
  936. },
  937. deep: true, // 深度监听
  938. immediate: true // 第一次改变就执行
  939. },
  940. // 监听箱信息数据 箱信息中有温度 自动切换 冻货
  941. "form.preContainersList": {
  942. // 执行方法
  943. handler(oldValue, newValue) {
  944. // 判断是否是数组
  945. if (oldValue instanceof Array) {
  946. // 循环 有温度反 true 没有反 false
  947. const arr = oldValue.map(item => {
  948. if (Number(item.temperature)) {
  949. return true;
  950. } else {
  951. return false;
  952. }
  953. });
  954. console.log(arr, 12345);
  955. // 判断是否有温度
  956. if (arr[0]) {
  957. // 判断之前是否是冻货
  958. if (this.form.cargoType == "reefer") return;
  959. this.$message({
  960. message: "箱信息里有温度已将货描切换为冻柜",
  961. type: "warning"
  962. });
  963. this.$set(this.form, "cargoType", "reefer");
  964. }
  965. }
  966. },
  967. deep: true, // 深度监听
  968. immediate: true // 第一次改变就执行,
  969. }
  970. },
  971. created() {
  972. let Obj = JSON.parse(localStorage.getItem("saber-tenantId"));
  973. this.saberTenantId = Obj ? Obj.content : 0;
  974. this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content;
  975. this.isHq = JSON.parse(localStorage.getItem("user-Information")).isHq;
  976. this.roleName = localStorage.getItem("roleName").split(",");
  977. isProcurement({ param: "line.length" }).then(res => {
  978. if (res.data.data) {
  979. this.lineLength = res.data.data;
  980. }
  981. });
  982. if (this.detailData.billType) {
  983. this.form.billType = this.detailData.billType;
  984. }
  985. // 判断是否员id, 有id 就不显示
  986. if (!this.form.id) {
  987. this.deptGetDetailPolfun(); // 收货地 装货港 当前登录人的默认
  988. this.userGetListfun(undefined, true); // 获取用户管理数据
  989. }
  990. this.ownDeptLazyTreefun(); // 获取公司数据
  991. this.getLazylistfun(); // 获取审核数据
  992. this.mpaymodeWorkDictsfun(); // 获取 付款方式字典
  993. this.srcTypeWorkDictsfun();
  994. // 获取EDI 数据
  995. this.editypesListfun();
  996. // 获取所属团队数据
  997. this.postSelectByUserfun();
  998. },
  999. methods: {
  1000. inLock() {
  1001. this.showLock = true;
  1002. const data = {
  1003. moduleName: "SI",
  1004. tableName: "SI_order",
  1005. billId: this.form.id,
  1006. no: localStorage.getItem("browserID"),
  1007. billNo: this.form.billNo
  1008. };
  1009. this.inDetailsKey(this.$route.name, {
  1010. moduleName: "SI",
  1011. tableName: "SI_order",
  1012. billId: this.form.id,
  1013. billNo: this.form.billNo
  1014. });
  1015. this.checkLock(data).then(res => {
  1016. if (res.data.code == 200) {
  1017. this.onLock(data).then(res => {
  1018. if (res.data.code == 200) {
  1019. this.showLock = false;
  1020. }
  1021. });
  1022. }
  1023. });
  1024. },
  1025. lastPage() {
  1026. if (this.pageIds.length) {
  1027. const index = this.pageIds.indexOf(this.form.id);
  1028. if (index == 0) {
  1029. return this.$message.error("没有上一票了");
  1030. }
  1031. if (this.form.id) {
  1032. this.unLock({
  1033. moduleName: "SI",
  1034. tableName: "SI_order",
  1035. billId: this.form.id,
  1036. billNo: this.form.billNo
  1037. });
  1038. }
  1039. const lastIndex = index - 1;
  1040. this.pageLoading = true;
  1041. this.billsDetailfun(this.pageIds[lastIndex]);
  1042. }
  1043. },
  1044. nextPage() {
  1045. if (this.pageIds.length) {
  1046. const index = this.pageIds.indexOf(this.form.id);
  1047. if (this.pageIds[this.pageIds.length - 1] == this.form.id) {
  1048. return this.$message.error("没有下一票了");
  1049. }
  1050. if (this.form.id) {
  1051. this.unLock({
  1052. moduleName: "SI",
  1053. tableName: "SI_order",
  1054. billId: this.form.id,
  1055. billNo: this.form.billNo
  1056. });
  1057. }
  1058. const nextIndex = index + 1;
  1059. this.pageLoading = true;
  1060. this.billsDetailfun(this.pageIds[nextIndex]);
  1061. }
  1062. },
  1063. addEdit() {
  1064. if (this.form.billStatus >= 3) {
  1065. this.$emit("toAddEdit");
  1066. } else {
  1067. if (
  1068. contrastObj(this.form, this.oldForm) ||
  1069. contrastList(this.form.preContainersList, this.oldForm.preContainersList) ||
  1070. contrastList(this.form.containersList, this.oldForm.containersList) ||
  1071. contrastList(this.form.feeCenterListC, this.oldForm.feeCenterListC) ||
  1072. contrastList(this.form.feeCenterListD, this.oldForm.feeCenterListD) ||
  1073. contrastList(this.form.filesList, this.oldForm.filesList) ||
  1074. contrastList(this.form.waitingBoxList, this.oldForm.waitingBoxList)
  1075. ) {
  1076. this.$confirm("是否需要保存?", "提示", {
  1077. confirmButtonText: "确定",
  1078. cancelButtonText: "取消",
  1079. type: "warning"
  1080. })
  1081. .then(() => {
  1082. this.editCustomer("toAddEdit");
  1083. })
  1084. .catch(() => {
  1085. this.$emit("toAddEdit");
  1086. });
  1087. } else {
  1088. this.$emit("toAddEdit");
  1089. }
  1090. }
  1091. },
  1092. CopyDocumentsfun() {
  1093. if (!this.form.id) {
  1094. return this.$message.error("请保存数据");
  1095. }
  1096. this.$DialogForm.show({
  1097. title: "复制单据",
  1098. width: "300px",
  1099. menuPosition: "right",
  1100. data: {
  1101. checkbox: "复制费用,复制箱型箱量"
  1102. },
  1103. option: {
  1104. submitText: "确认",
  1105. emptyText: "取消",
  1106. span: 24,
  1107. column: [
  1108. {
  1109. label: "单据类型",
  1110. prop: "billType",
  1111. type: "select",
  1112. value: this.form.billType,
  1113. dicData: [
  1114. {
  1115. label: "直单",
  1116. value: "DD"
  1117. },
  1118. {
  1119. label: "主单",
  1120. value: "MM"
  1121. },
  1122. {
  1123. label: "分单",
  1124. value: "MH"
  1125. }
  1126. ],
  1127. dataType: "string",
  1128. span: 24
  1129. },
  1130. {
  1131. label: "复制类型",
  1132. prop: "checkbox",
  1133. type: "checkbox",
  1134. dicData: [
  1135. {
  1136. label: "复制费用",
  1137. value: "复制费用"
  1138. },
  1139. {
  1140. label: "复制箱型箱量",
  1141. value: "复制箱型箱量"
  1142. }
  1143. ],
  1144. dataType: "string",
  1145. span: 24
  1146. }
  1147. ]
  1148. },
  1149. beforeClose: done => {
  1150. done();
  1151. },
  1152. callback: res => {
  1153. res.done();
  1154. this.billsCopyBillsfun(this.form.id, res.data.checkbox, res.data.billType);
  1155. res.close();
  1156. }
  1157. });
  1158. },
  1159. //文档导入
  1160. importData(row) {
  1161. if (row == 0) {
  1162. this.excelOption.column[0].action = `/api/blade-los/templateImport/importOne?billId=${this.form.id}`;
  1163. } else if (row == 1) {
  1164. this.excelOption.column[0].action = `/api/blade-los/templateImport/importPilBooking?billId=${this.form.id}`;
  1165. } else if (row == 2) {
  1166. this.excelOption.column[0].action = `/api/blade-los/templateImport/importPilCutOffOrders?billId=${this.form.id}`;
  1167. } else if (row == 3) {
  1168. this.excelOption.column[0].action = `/api/blade-los/templateImport/importHisenseBill?billId=${this.form.id}`;
  1169. }
  1170. this.excelBox = true;
  1171. },
  1172. uploadBefore(file, done, loading) {
  1173. done();
  1174. loading = true;
  1175. },
  1176. removeEmptyValues(obj) {
  1177. Object.keys(obj).forEach(key => {
  1178. if (obj[key] === null || obj[key] === undefined || obj[key] === "") {
  1179. delete obj[key];
  1180. }
  1181. });
  1182. return obj;
  1183. },
  1184. // 上传成功
  1185. onSuccess(res, done, loading, column) {
  1186. if (Object.keys(res).length) {
  1187. this.$confirm("此操作将覆盖数据, 是否继续?", "提示", {
  1188. confirmButtonText: "确定",
  1189. cancelButtonText: "取消",
  1190. type: "warning"
  1191. })
  1192. .then(() => {
  1193. // this.form = res;
  1194. Object.keys(res).forEach(key => {
  1195. if (res[key]) {
  1196. if (key != "detail") {
  1197. // this.form[key] = res[key]
  1198. this.$set(this.form, key, res[key]);
  1199. }
  1200. if (key == "detail") {
  1201. Object.keys(res.detail).forEach(key => {
  1202. if (res.detail[key]) {
  1203. // this.form.detail[key] = res.detail[key]
  1204. this.$set(this.form.detail, key, res.detail[key]);
  1205. }
  1206. });
  1207. }
  1208. }
  1209. });
  1210. this.excelBox = false;
  1211. this.$message.success("导入成功!");
  1212. loading = false;
  1213. done();
  1214. })
  1215. .catch(() => {
  1216. this.excelBox = false;
  1217. loading = false;
  1218. done();
  1219. });
  1220. } else {
  1221. loading = false;
  1222. done();
  1223. }
  1224. },
  1225. allClick(name) {
  1226. if (name == "申请换单") {
  1227. // if (this.form.feeCenterListD.length == 0) {
  1228. // return this.$message.error("应收费用明细不能为空!");
  1229. // }
  1230. // for (let item of this.form.feeCenterListD) {
  1231. // if (item.auditStatus != 4) {
  1232. // return this.$message.error("应收费用明细存在未请核的数据!");
  1233. // }
  1234. // }
  1235. // this.$confirm("是否申请换单?", "提示", {
  1236. // confirmButtonText: "确定",
  1237. // cancelButtonText: "取消",
  1238. // type: "warning"
  1239. // }).then(() => {
  1240. // let obj = {
  1241. // id: this.form.id
  1242. // }
  1243. // applySwitch(obj).then(res => {
  1244. // this.$message({
  1245. // type: "success",
  1246. // message: "操作成功!"
  1247. // });
  1248. // this.billsDetailfun(this.form.id);
  1249. // });
  1250. // });
  1251. this.$DialogForm.show({
  1252. title: "收押箱款",
  1253. width: "30%",
  1254. menuPosition: "right",
  1255. data: {
  1256. quantityCntrDescr: this.form.quantityCntrDescr
  1257. },
  1258. option: {
  1259. submitText: "确定",
  1260. emptyText: "取消",
  1261. // labelWidth: 130,
  1262. column: [
  1263. {
  1264. label: "押箱金额",
  1265. span: 24,
  1266. prop: "boxPackingAmount",
  1267. type: "number",
  1268. controls: false,
  1269. rules: [
  1270. {
  1271. required: true,
  1272. message: "",
  1273. trigger: "blur"
  1274. }
  1275. ]
  1276. },
  1277. {
  1278. label: "箱型箱量",
  1279. span: 24,
  1280. prop: "quantityCntrDescr",
  1281. disabled: true
  1282. }
  1283. ]
  1284. },
  1285. beforeClose: done => {
  1286. done();
  1287. },
  1288. callback: res => {
  1289. res.done();
  1290. let obj = {
  1291. id: this.form.id,
  1292. ...res.data
  1293. };
  1294. applySwitch(obj).then(res => {
  1295. this.$message({
  1296. type: "success",
  1297. message: "操作成功!"
  1298. });
  1299. this.billsDetailfun(this.form.id);
  1300. });
  1301. res.close();
  1302. }
  1303. });
  1304. }
  1305. if (name == "撤销换单") {
  1306. this.$confirm("是否撤销换单?", "提示", {
  1307. confirmButtonText: "确定",
  1308. cancelButtonText: "取消",
  1309. type: "warning"
  1310. }).then(() => {
  1311. let obj = {
  1312. id: this.form.id
  1313. };
  1314. revokeSwitch(obj).then(res => {
  1315. this.$message({
  1316. type: "success",
  1317. message: "操作成功!"
  1318. });
  1319. this.billsDetailfun(this.form.id);
  1320. });
  1321. });
  1322. }
  1323. if (name == "电子提货单") {
  1324. this.$confirm("是否确认电子提货单?", "提示", {
  1325. confirmButtonText: "确定",
  1326. cancelButtonText: "取消",
  1327. type: "warning"
  1328. }).then(() => {
  1329. let obj = {
  1330. id: this.form.id
  1331. };
  1332. electronBillOfLading(obj).then(res => {
  1333. this.$message({
  1334. type: "success",
  1335. message: "操作成功!"
  1336. });
  1337. this.billsDetailfun(this.form.id);
  1338. });
  1339. });
  1340. }
  1341. if (name == "撤销电子提货单") {
  1342. this.$confirm("是否撤销电子提货单?", "提示", {
  1343. confirmButtonText: "确定",
  1344. cancelButtonText: "取消",
  1345. type: "warning"
  1346. }).then(() => {
  1347. let obj = {
  1348. id: this.form.id
  1349. };
  1350. revokeElectronBillOfLading(obj).then(res => {
  1351. this.$message({
  1352. type: "success",
  1353. message: "操作成功!"
  1354. });
  1355. this.billsDetailfun(this.form.id);
  1356. });
  1357. });
  1358. }
  1359. if (name == "接收") {
  1360. this.$confirm("是否接收?", "提示", {
  1361. confirmButtonText: "确定",
  1362. cancelButtonText: "取消",
  1363. type: "warning"
  1364. }).then(() => {
  1365. receive(this.form).then(res => {
  1366. this.$message({
  1367. type: "success",
  1368. message: "操作成功!"
  1369. });
  1370. this.billsDetailfun(this.form.id);
  1371. });
  1372. });
  1373. }
  1374. if (name == "撤销接收") {
  1375. this.$confirm("是否撤销接收?", "提示", {
  1376. confirmButtonText: "确定",
  1377. cancelButtonText: "取消",
  1378. type: "warning"
  1379. }).then(() => {
  1380. revokeReceive(this.form).then(res => {
  1381. this.$message({
  1382. type: "success",
  1383. message: "操作成功!"
  1384. });
  1385. this.logisticsDialog = false;
  1386. this.billsDetailfun(this.form.id);
  1387. });
  1388. });
  1389. }
  1390. // if (name == "换单") {
  1391. // this.$confirm("是否换单?", "提示", {
  1392. // confirmButtonText: "确定",
  1393. // cancelButtonText: "取消",
  1394. // type: "warning"
  1395. // }).then(() => {
  1396. // changeOrders(this.form).then(res => {
  1397. // this.$message({
  1398. // type: "success",
  1399. // message: "操作成功!"
  1400. // });
  1401. // this.billsDetailfun(this.form.id);
  1402. // });
  1403. // });
  1404. // }
  1405. // if (name == "撤销换单") {
  1406. // this.$confirm("是否撤销换单?", "提示", {
  1407. // confirmButtonText: "确定",
  1408. // cancelButtonText: "取消",
  1409. // type: "warning"
  1410. // }).then(() => {
  1411. // revokeChangeOrders(this.form).then(res => {
  1412. // this.$message({
  1413. // type: "success",
  1414. // message: "操作成功!"
  1415. // });
  1416. // this.logisticsDialog = false;
  1417. // this.billsDetailfun(this.form.id);
  1418. // });
  1419. // });
  1420. // }
  1421. if (name == "退押") {
  1422. this.$confirm("是否退押?", "提示", {
  1423. confirmButtonText: "确定",
  1424. cancelButtonText: "取消",
  1425. type: "warning"
  1426. }).then(() => {
  1427. returningSecurityMoney(this.form).then(res => {
  1428. this.$message({
  1429. type: "success",
  1430. message: "操作成功!"
  1431. });
  1432. this.billsDetailfun(this.form.id);
  1433. });
  1434. });
  1435. }
  1436. if (name == "撤销退押") {
  1437. this.$confirm("是否撤销退押?", "提示", {
  1438. confirmButtonText: "确定",
  1439. cancelButtonText: "取消",
  1440. type: "warning"
  1441. }).then(() => {
  1442. revokeReturningSecurityMoney(this.form).then(res => {
  1443. this.$message({
  1444. type: "success",
  1445. message: "操作成功!"
  1446. });
  1447. this.logisticsDialog = false;
  1448. this.billsDetailfun(this.form.id);
  1449. });
  1450. });
  1451. }
  1452. if (name == "同步分单信息") {
  1453. this.$confirm("是否同步分单信息?", "提示", {
  1454. confirmButtonText: "确定",
  1455. cancelButtonText: "取消",
  1456. type: "warning"
  1457. }).then(() => {
  1458. synchronizeData({ billId: this.form.id }).then(res => {
  1459. this.$message({
  1460. type: "success",
  1461. message: "操作成功!"
  1462. });
  1463. this.billsDetailfun(this.form.id);
  1464. });
  1465. });
  1466. }
  1467. if (name == "提单确认") {
  1468. // this.$refs.
  1469. }
  1470. },
  1471. // 获取EDI列表数据
  1472. editypesListfun() {
  1473. editypesList(1, 1000).then(res => {
  1474. this.ediData = res.data.data.records;
  1475. this.ediData_SO = res.data.data.records.filter(r => r.groupName == "SO");
  1476. this.ediData_SI = res.data.data.records.filter(r => r.groupName == "SI");
  1477. });
  1478. },
  1479. // 发送edi
  1480. editypesSendingEdifun(row) {
  1481. row.billId = this.form.id;
  1482. // let msgsList = [];
  1483. // if (checkFullWidthSymbols(this.form.detail.hshipperDetails).hasFullWidth) {
  1484. // let msg = [];
  1485. // for (let item of checkFullWidthSymbols(this.form.detail.hshipperDetails).positions) {
  1486. // msg.push(`第${item.row}行的"${item.symbol}"`);
  1487. // }
  1488. // this.$message({
  1489. // dangerouslyUseHTMLString: true,
  1490. // message: `发货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  1491. // type: "error"
  1492. // });
  1493. // return;
  1494. // }
  1495. // if (checkFullWidthSymbols(this.form.detail.hconsigneeDetails).hasFullWidth) {
  1496. // let msg = [];
  1497. // for (let item of checkFullWidthSymbols(this.form.detail.hconsigneeDetails).positions) {
  1498. // msg.push(`第${item.row}行的"${item.symbol}"`);
  1499. // }
  1500. // this.$message({
  1501. // dangerouslyUseHTMLString: true,
  1502. // message: `收货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  1503. // type: "error"
  1504. // });
  1505. // return;
  1506. // }
  1507. // if (checkFullWidthSymbols(this.form.detail.hnotifyDetails).hasFullWidth) {
  1508. // let msg = [];
  1509. // for (let item of checkFullWidthSymbols(this.form.detail.hnotifyDetails).positions) {
  1510. // msg.push(`第${item.row}行的"${item.symbol}"`);
  1511. // }
  1512. // this.$message({
  1513. // dangerouslyUseHTMLString: true,
  1514. // message: `通知人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  1515. // type: "error"
  1516. // });
  1517. // return;
  1518. // }
  1519. // if (checkFullWidthSymbols(this.form.detail.mshipperDetails).hasFullWidth) {
  1520. // let msg = [];
  1521. // for (let item of checkFullWidthSymbols(this.form.detail.mshipperDetails).positions) {
  1522. // msg.push(`第${item.row}行的"${item.symbol}"`);
  1523. // }
  1524. // if (msg.length > 0) {
  1525. // this.$message({
  1526. // dangerouslyUseHTMLString: true,
  1527. // message: `MBL 发货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  1528. // type: "error"
  1529. // });
  1530. // return;
  1531. // }
  1532. // }
  1533. // if (checkFullWidthSymbols(this.form.detail.mconsigneeDetails).hasFullWidth) {
  1534. // let msg = [];
  1535. // for (let item of checkFullWidthSymbols(this.form.detail.mconsigneeDetails).positions) {
  1536. // msg.push(`第${item.row}行的"${item.symbol}"`);
  1537. // }
  1538. // if (msg.length > 0) {
  1539. // this.$message({
  1540. // dangerouslyUseHTMLString: true,
  1541. // message: `MBL 收货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  1542. // type: "error"
  1543. // });
  1544. // return;
  1545. // }
  1546. // }
  1547. // if (checkFullWidthSymbols(this.form.detail.mnotifyDetails).hasFullWidth) {
  1548. // let msg = [];
  1549. // for (let item of checkFullWidthSymbols(this.form.detail.mnotifyDetails).positions) {
  1550. // msg.push(`第${item.row}行的"${item.symbol}"`);
  1551. // }
  1552. // if (msg.length > 0) {
  1553. // this.$message({
  1554. // dangerouslyUseHTMLString: true,
  1555. // message: `MBL 通知人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  1556. // type: "error"
  1557. // });
  1558. // return;
  1559. // }
  1560. // }
  1561. // if (checkFullWidthSymbols(this.form.marks).hasFullWidth) {
  1562. // let msg = [];
  1563. // for (let item of checkFullWidthSymbols(this.form.marks).positions) {
  1564. // msg.push(`第${item.row}行的"${item.symbol}"`);
  1565. // }
  1566. // this.$message({
  1567. // dangerouslyUseHTMLString: true,
  1568. // message: `唛头:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  1569. // type: "error"
  1570. // });
  1571. // return;
  1572. // }
  1573. // if (checkFullWidthSymbols(this.form.commodityDescr).hasFullWidth) {
  1574. // let msg = [];
  1575. // for (let item of checkFullWidthSymbols(this.form.commodityDescr).positions) {
  1576. // msg.push(`第${item.row}行的"${item.symbol}"`);
  1577. // }
  1578. // this.$message({
  1579. // dangerouslyUseHTMLString: true,
  1580. // message: `货描:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  1581. // type: "error"
  1582. // });
  1583. // return;
  1584. // }
  1585. // if (checkFullWidthSymbols(this.form.forwarding).hasFullWidth) {
  1586. // let msg = [];
  1587. // for (let item of checkFullWidthSymbols(this.form.forwarding).positions) {
  1588. // msg.push(`第${item.row}行的"${item.symbol}"`);
  1589. // }
  1590. // this.$message({
  1591. // dangerouslyUseHTMLString: true,
  1592. // message: `FORWARDING:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  1593. // type: "error"
  1594. // });
  1595. // return;
  1596. // }
  1597. if (lineQuantityVerification(this.form.detail.hshipperDetails, this.lineLength)) {
  1598. return this.$message.error(`发货人详情超长,请手动断行,否则影响打印`);
  1599. }
  1600. if (lineQuantityVerification(this.form.detail.hconsigneeDetails, this.lineLength)) {
  1601. return this.$message.error(`收货人详情超长,请手动断行,否则影响打印`);
  1602. }
  1603. if (lineQuantityVerification(this.form.detail.hnotifyDetails, this.lineLength)) {
  1604. return this.$message.error(`通知人详情超长,请手动断行,否则影响打印`);
  1605. }
  1606. // if (!verifyEnglish(this.form.detail.hshipperDetails)) {
  1607. // msgsList.push("发货人");
  1608. // }
  1609. // if (!verifyEnglish(this.form.detail.hconsigneeDetails)) {
  1610. // msgsList.push("收货人");
  1611. // }
  1612. // if (!verifyEnglish(this.form.detail.hnotifyDetails)) {
  1613. // msgsList.push("通知人");
  1614. // }
  1615. // if (!verifyEnglish(this.form.detail.mshipperDetails)) {
  1616. // msgsList.push("MBL 发货人");
  1617. // }
  1618. // if (!verifyEnglish(this.form.detail.mconsigneeDetails)) {
  1619. // msgsList.push("MBL 收货人");
  1620. // }
  1621. // if (!verifyEnglish(this.form.detail.mnotifyDetails)) {
  1622. // msgsList.push("MBL 通知人");
  1623. // }
  1624. // if (!verifyEnglish(this.form.marks)) {
  1625. // msgsList.push("唛头");
  1626. // }
  1627. // if (!verifyEnglish(this.form.commodityDescr)) {
  1628. // msgsList.push("货描");
  1629. // }
  1630. // if (!verifyEnglish(this.form.forwarding)) {
  1631. // msgsList.push("FORWARDING");
  1632. // }
  1633. // if (msgsList.length > 0) {
  1634. // this.$message.error(`请正确输入${msgsList.join(",")}的英文`);
  1635. // return;
  1636. // }
  1637. this.saveLoading = true;
  1638. editypesSendingEdi(row)
  1639. .then(res => {
  1640. this.saveLoading = false;
  1641. // 判断data是否有值,没有值说明不成功给个弹窗返回
  1642. if (!res.data.data) {
  1643. let text = res.data.msg.replace("\r\n", "<br>");
  1644. console.log(text);
  1645. this.$message({
  1646. type: "warning",
  1647. dangerouslyUseHTMLString: true,
  1648. message: text,
  1649. // message: `<p>${text.slice(text.indexOf('非空'), text.indexOf('特殊字符'))}</p><p>${text.slice(text.indexOf('特殊字符'), text.indexOf('长度超长'))}</p><p>${text.slice(text.indexOf('长度超长'), text.indexOf('其他'))}</p><p>${text.slice(text.indexOf('其他'))}</p>`,
  1650. duration: 5000
  1651. });
  1652. } else {
  1653. this.$message.success("操作成功,请去文件中心查看");
  1654. this.billsDetailfun(this.form.id); // 详情接口
  1655. }
  1656. })
  1657. .catch(err => {
  1658. this.saveLoading = false;
  1659. });
  1660. },
  1661. // 报表弹窗
  1662. previewDialogfun() {
  1663. this.getReportTypeByBigHandle("业务");
  1664. this.previewDialog = true;
  1665. },
  1666. //请核关闭
  1667. choceScheduleFun() {
  1668. this.checkScheduleDialog = false;
  1669. },
  1670. // 收货地 装货港 当前登录人的默认
  1671. deptGetDetailPolfun() {
  1672. deptGetDetailPol(this.saberUserInfo.dept_pid.split(",")[0]).then(res => {
  1673. this.form.placeReceiptName = res.data.data.polEnName;
  1674. this.form.placeReceiptId = res.data.data.polId;
  1675. this.form.placeReceiptCode = res.data.data.polCode;
  1676. this.form.placeReceiptNamePrint = res.data.data.polEnName;
  1677. this.form.polCnName = res.data.data.polCnName;
  1678. this.form.polEnName = res.data.data.polEnName;
  1679. this.form.polId = res.data.data.polId;
  1680. this.form.polCode = res.data.data.polCode;
  1681. this.form.polNamePrint = res.data.data.polEnName;
  1682. // 签单地点 默认 装货港
  1683. this.$set(this.form, "issueAtId", this.form.polId);
  1684. this.$set(this.form, "issueAt", this.form.polEnName);
  1685. // 主单单付费地点 默认 如果主单付费方式 为PP 取装货港 如果主单付费地点为CC 取卸货港
  1686. if (this.form.mpaymode == "PP") {
  1687. this.$set(this.form, "mpayplace", this.form.polEnName);
  1688. }
  1689. // 分单单付费地点 默认 如果分单付费方式 为PP 取装货港 如果分单付费地点为CC 取卸货港
  1690. if (this.form.hpaymode == "PP") {
  1691. this.$set(this.form, "hpayplace", this.form.polEnName);
  1692. }
  1693. });
  1694. },
  1695. // 获取用户管理数据
  1696. userGetListfun(account = undefined, type = false) {
  1697. // userGetList(1, 10, { account }, this.saberUserInfo.dept_pid.split(',')[0]).then(res => {
  1698. // this.columnforfun('operatorName').dicData = res.data.data.records
  1699. // if (type) {
  1700. // // 核算部门 默认登录人的部门
  1701. // for (let item of this.columnforfun('operatorName').dicData) {
  1702. // if (item.name == this.form.operatorName) {
  1703. // this.$set(this.form, 'accDeptName', item.deptName)
  1704. // this.$set(this.form, 'accDept', item.deptId)
  1705. // this.$set(this.form, 'operatorDept', item.deptId.split(',').pop())
  1706. // this.$set(this.form, 'operatorDeptName', item.deptId)
  1707. // }
  1708. // }
  1709. // }
  1710. // })
  1711. },
  1712. // 获取所属岗位数据
  1713. postSelectByUserfun() {
  1714. postSelectByUser(JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id).then(res => {
  1715. // this.columnforfun('teamName').dicData = res.data.data
  1716. // 判断是否有值,没有的话默认第一个
  1717. if (!this.form.teamName) {
  1718. this.$set(this.form, "teamId", res.data.data[0].id);
  1719. this.$set(this.form, "teamName", res.data.data[0].postName);
  1720. }
  1721. });
  1722. },
  1723. // 获取付款方式字典数据
  1724. mpaymodeWorkDictsfun() {
  1725. getWorkDicts("payment_method_los").then(res => {
  1726. this.columnforfun("mpaymode").dicData = res.data.data;
  1727. // this.columnforfun('hpaymode').dicData = res.data.data
  1728. });
  1729. },
  1730. // 获取核算部分数据 // 机构管理接口
  1731. getLazylistfun() {
  1732. // getDeptTree().then(res => {
  1733. // this.columnforfun('accDeptName').dicData = res.data.data
  1734. // })
  1735. },
  1736. // 获取客户名称数据 往来单位数据
  1737. getBcorpsListfun(cnName) {
  1738. getBcorpsList(1, 20, {
  1739. shortName: cnName,
  1740. status: 0
  1741. }).then(res => {
  1742. this.columnforfun("corpCnName").dicData = res.data.data.records;
  1743. });
  1744. },
  1745. // 获取客户联系人 客户OP
  1746. getBcorpsattnListfun(cname) {
  1747. // getBcorpsattnList(1, 10, { pid: this.form.corpId, cname }).then(res => {
  1748. // this.columnforfun('corpAttnName').dicData = res.data.data.records
  1749. // // if (res.data.data.records.length == 0) {
  1750. // // this.form.corpAttnName = ''
  1751. // // this.form.corpAttnId = ''
  1752. // // this.$set(this.form, 'corpAttnTel', '')
  1753. // // this.$set(this.form, 'corpAttnEmail', '')
  1754. // // return
  1755. // // }
  1756. // // this.form.corpAttnName = res.data.data.records[0].cname
  1757. // // this.form.corpAttnId = res.data.data.records[0].id
  1758. // // this.$set(this.form, 'corpAttnTel', res.data.data.records[0].tel)
  1759. // // this.$set(this.form, 'corpAttnEmail', res.data.data.records[0].email)
  1760. // })
  1761. },
  1762. // 获取地点信息
  1763. getBlocationsListfun(cnName) {
  1764. // getBlocationsList(1, 10, { cnName }).then(res => {
  1765. // this.columnforfun('mPayplace').dicData = res.data.data.records
  1766. // })
  1767. },
  1768. // 获取业务来源数据
  1769. srcTypeWorkDictsfun() {
  1770. // getWorkDicts('src_type_los').then(res => {
  1771. // this.columnforfun('srcType').dicData = res.data.data
  1772. // })
  1773. },
  1774. // 获取业务来源代理数据
  1775. agentBcorpsListfun(cnName) {
  1776. // let corpTypeName = '国内直接客户,国内同行及代理,国外直接客户,国外同行及代理'
  1777. // getBcorpslistByType(1, 20, { cnName, status: 0, corpTypeName }).then(res => {
  1778. // this.columnforfun('srcCnName').dicData = res.data.data.records
  1779. // })
  1780. },
  1781. // 获取业务来源业务员数据
  1782. salesUserGetListfun(account) {
  1783. // if (this.$store.getters.userInfo.tenant_id === "263057") {
  1784. // userGetList(1, 10, { roleId: '业务员' }).then(res => {
  1785. // this.columnforfun('srcCnName').dicData = res.data.data.records
  1786. // })
  1787. // } else {
  1788. // selectListLos('业务员', account).then(res => {
  1789. // this.columnforfun('srcCnName').dicData = res.data.data
  1790. // })
  1791. // }
  1792. },
  1793. // 获取公司名称 用户管理左侧
  1794. ownDeptLazyTreefun() {
  1795. // getDeptLazyTree(0).then(res => {
  1796. // this.columnforfun('srcCnName').dicData = res.data.data
  1797. // // 来源 内容 默认登录人所属公司
  1798. // for (let item of this.columnforfun('srcCnName').dicData) {
  1799. // if (item.id == JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid.split(',')[0]) {
  1800. // this.$set(this.form, 'srcId', item.id)
  1801. // this.$set(this.form, 'srcCnName', item.title)
  1802. // this.$set(this.form, 'srcEnName', item.title)
  1803. // }
  1804. // }
  1805. // })
  1806. },
  1807. // 申请B/L NO
  1808. billsGetBillNofun() {
  1809. let billNoFormat = "";
  1810. if (this.form.cargoType == "dry") {
  1811. billNoFormat = "HYJK";
  1812. } else if (this.form.cargoType == "danger") {
  1813. billNoFormat = "HYJK-WXP";
  1814. } else if (this.form.cargoType == "reefer") {
  1815. billNoFormat = "HYJK-DG";
  1816. }
  1817. billsGetBillNo({
  1818. businessTypeCode: "HYJK",
  1819. billNoFormat: billNoFormat
  1820. }).then(res => {
  1821. // this.columnforfun('hpaymode').disabled = false
  1822. this.$set(this.form, "hblno", res.data.data);
  1823. this.billsSubmitfun();
  1824. });
  1825. },
  1826. // 下拉多选弹窗的确认
  1827. eldialogConfirm(name) {
  1828. if (name == "bcorps") {
  1829. if (this.$refs.bcorps[0].isShow) {
  1830. console.log("列表确认");
  1831. this.form.corpCnName = this.$refs.bcorps[0].selectionList[0].cnName;
  1832. this.form.corpEnName = this.$refs.bcorps[0].selectionList[0].enName;
  1833. this.form.corpId = this.$refs.bcorps[0].selectionList[0].id;
  1834. this.form.corpCode = this.$refs.bcorps[0].selectionList[0].code;
  1835. this.form.corpSource = this.$refs.bcorps[0].selectionList[0].corpSource;
  1836. // 获取 客户op数据
  1837. this.getBcorpsattnListfun();
  1838. // 业务来源参数带出
  1839. this.$set(this.form, "srcType", this.$refs.bcorps[0].selectionList[0].sourceType);
  1840. this.$set(this.form, "srcId", this.$refs.bcorps[0].selectionList[0].srcId);
  1841. this.$set(this.form, "srcCnName", this.$refs.bcorps[0].selectionList[0].srcCnName);
  1842. this.$set(this.form, "srcEnName", this.$refs.bcorps[0].selectionList[0].srcEnName);
  1843. // this.columnforfun('srcType').disabled = false
  1844. // this.columnforfun('srcCnName').disabled = false
  1845. // 航线带出往来单位的优势航线
  1846. this.$set(this.form, "lineCnName", this.$refs.bcorps[0].selectionList[0].advantageRoute);
  1847. // 带出发货人数据
  1848. this.$set(this.form.detail, "hshipperId", this.$refs.bcorps[0].selectionList[0].id);
  1849. this.$set(this.form.detail, "hshipperCnName", this.$refs.bcorps[0].selectionList[0].cnName);
  1850. this.$set(this.form.detail, "hshipperEnName", this.$refs.bcorps[0].selectionList[0].enName);
  1851. this.$set(this.form.detail, "hshipperCode", this.$refs.bcorps[0].selectionList[0].code);
  1852. this.$set(this.form.detail, "hshipperDetails", this.$refs.bcorps[0].selectionList[0].details);
  1853. this.$set(this.form.detail, "hshipperCntyName", this.$refs.bcorps[0].selectionList[0].cntyName);
  1854. this.$set(this.form.detail, "hshipperCntyCode", this.$refs.bcorps[0].selectionList[0].cntyCode);
  1855. // this.columnforfun('corpAttnName').disabled = false
  1856. // this.columnforfun('corpAttnTel').disabled = false
  1857. // this.columnforfun('corpAttnEmail').disabled = false
  1858. } else {
  1859. console.log("详情确认");
  1860. console.log(this.$refs.bcorps, 962);
  1861. this.$refs.bcorps[0].$refs.detail.submitForm();
  1862. this.form.corpCnName = this.$refs.bcorps[0].$refs.detail.formData.cnName;
  1863. this.form.corpEnName = this.$refs.bcorps[0].$refs.detail.formData.enName;
  1864. this.form.corpId = this.$refs.bcorps[0].$refs.detail.formData.id;
  1865. this.form.corpCode = this.$refs.bcorps[0].$refs.detail.formData.code;
  1866. this.form.corpSource = this.$refs.bcorps[0].$refs.detail.formData.corpSource;
  1867. // 获取 客户op数据
  1868. this.getBcorpsattnListfun();
  1869. // 业务来源参数带出
  1870. this.$set(this.form, "srcType", this.$refs.bcorps[0].$refs.detail.formData.sourceType);
  1871. this.$set(this.form, "srcId", this.$refs.bcorps[0].$refs.detail.formData.srcId);
  1872. this.$set(this.form, "srcCnName", this.$refs.bcorps[0].$refs.detail.formData.srcCnName);
  1873. this.$set(this.form, "srcEnName", this.$refs.bcorps[0].$refs.detail.formData.srcEnName);
  1874. // this.columnforfun('srcType').disabled = false
  1875. // this.columnforfun('srcCnName').disabled = false
  1876. // 航线带出往来单位的优势航线
  1877. this.$set(this.form, "lineCnName", this.$refs.bcorps[0].$refs.detail.formData.advantageRoute);
  1878. // 带出发货人数据
  1879. this.$set(this.form.detail, "hshipperId", this.$refs.bcorps[0].$refs.detail.formData.id);
  1880. this.$set(this.form.detail, "hshipperCnName", this.$refs.bcorps[0].$refs.detail.formData.cnName);
  1881. this.$set(this.form.detail, "hshipperEnName", this.$refs.bcorps[0].$refs.detail.formData.enName);
  1882. this.$set(this.form.detail, "hshipperCode", this.$refs.bcorps[0].$refs.detail.formData.code);
  1883. this.$set(this.form.detail, "hshipperDetails", this.$refs.bcorps[0].$refs.detail.formData.details);
  1884. this.$set(this.form.detail, "hshipperCntyName", this.$refs.bcorps[0].$refs.detail.formData.cntyName);
  1885. this.$set(this.form.detail, "hshipperCntyCode", this.$refs.bcorps[0].$refs.detail.formData.cntyCode);
  1886. // this.columnforfun('corpAttnName').disabled = false
  1887. // this.columnforfun('corpAttnTel').disabled = false
  1888. // this.columnforfun('corpAttnEmail').disabled = false
  1889. }
  1890. }
  1891. this.$refs.searchQueryRef[0].corpVisible = false;
  1892. },
  1893. // 下拉多选弹窗数据多选回调
  1894. eldialogMultipleChoice(list, name) {
  1895. if (name == "bcorps") {
  1896. let arr = [];
  1897. if (list.length > 1) {
  1898. this.$refs.bcorps[0].$refs.crud.toggleSelection(); // 先清空所以选择的数据
  1899. arr = [list[list.length - 1]]; // 获取最新点击的数组
  1900. this.$refs.bcorps[0].$refs.crud.toggleSelection(arr, true); // 把刚点击的数组变成选择状态
  1901. } else {
  1902. arr = list;
  1903. }
  1904. this.$refs.bcorps[0].selectionList = arr;
  1905. }
  1906. },
  1907. /* 远程模糊查询操作用户 */
  1908. remoteMethod(value, name) {
  1909. // if (name == 'operatorName') {
  1910. // this.userGetListfun(value)
  1911. // }
  1912. // else if (name == 'accDeptName') {
  1913. // this.getLazylistfun(value)
  1914. // }
  1915. if (name == "corpCnName") {
  1916. this.getBcorpsListfun(value);
  1917. }
  1918. // else if (name == 'mPayplace') {
  1919. // this.getBlocationsListfun(value)
  1920. // }
  1921. // else if (name == 'corpAttnName') {
  1922. // this.getBcorpsattnListfun(value)
  1923. // }
  1924. // else if (name == 'srcType') {
  1925. // this.srcTypeWorkDictsfun()
  1926. // }
  1927. // else if (name == 'srcCnName') {
  1928. // if (this.form.srcType == 'SALES') {
  1929. // // 业务员
  1930. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'name', value: 'name' }
  1931. // this.salesUserGetListfun(value)
  1932. // } else if (this.form.srcType == 'AGENT') {
  1933. // // 代理
  1934. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  1935. // this.agentBcorpsListfun(value)
  1936. // } else if (this.form.srcType == 'OWN') {
  1937. // // 公司
  1938. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'title', value: 'title' }
  1939. // this.ownDeptLazyTreefun()
  1940. // }
  1941. // } else if (name == 'teamName') {
  1942. // this.postSelectByUserfun()
  1943. // }
  1944. },
  1945. // 下拉的监听事件
  1946. corpChange(value, name) {
  1947. // if (name == 'operatorName') {
  1948. // // OP 下拉赋值 用户管理列表
  1949. // for (let item of this.columnforfun('operatorName').dicData) {
  1950. // if (item.name == value) {
  1951. // this.form.operatorName = item.name
  1952. // this.form.operatorId = item.id
  1953. // this.form.operatorDept = item.deptId.split(',').pop()
  1954. // this.form.operatorDeptName = item.deptName
  1955. // }
  1956. // }
  1957. // }
  1958. // else if (name == 'accDeptName') {
  1959. // // OP 下拉赋值 用户管理列表
  1960. // for (let item of this.columnforfun('accDeptName').dicData) {
  1961. // if (item.title == value) {
  1962. // this.form.accDeptName = item.title
  1963. // this.form.accDept = item.id
  1964. // }
  1965. // }
  1966. // }
  1967. if (name == "corpCnName") {
  1968. if (value) {
  1969. // this.columnforfun('corpAttnName').disabled = false
  1970. // this.columnforfun('corpAttnTel').disabled = false
  1971. // this.columnforfun('corpAttnEmail').disabled = false
  1972. } else {
  1973. // this.columnforfun('corpAttnName').disabled = true
  1974. // this.columnforfun('corpAttnTel').disabled = true
  1975. // this.columnforfun('corpAttnEmail').disabled = true
  1976. // 如果点击清空按钮把值赋值为空
  1977. this.form.corpCnName = "";
  1978. this.form.corpEnName = "";
  1979. this.form.corpId = "";
  1980. this.form.corpCode = "";
  1981. this.form.shortName = "";
  1982. this.form.corpSource = "";
  1983. // 清空 客户OP
  1984. // this.form.corpAttnName = ''
  1985. this.form.corpAttnId = "";
  1986. this.$set(this.form, "corpAttnTel", "");
  1987. this.$set(this.form, "corpAttnEmail", "");
  1988. // 清空 业务来源和来源详情
  1989. this.$set(this.form, "srcType", "");
  1990. this.$set(this.form, "srcId", "");
  1991. this.$set(this.form, "srcCnName", "");
  1992. this.$set(this.form, "srcEnName", "");
  1993. }
  1994. // 往来单位
  1995. for (let item of this.columnforfun("corpCnName").dicData) {
  1996. if (item.cnName == value) {
  1997. this.form.corpCnName = item.cnName;
  1998. this.form.corpEnName = item.enName;
  1999. this.form.corpId = item.id;
  2000. this.form.corpCode = item.code;
  2001. this.form.shortName = item.shortName;
  2002. this.form.corpSource = item.corpSource;
  2003. // 获取 客户op数据
  2004. this.getBcorpsattnListfun();
  2005. // 业务来源参数带出
  2006. this.$set(this.form, "srcType", item.sourceType);
  2007. this.$set(this.form, "srcId", item.srcId);
  2008. this.$set(this.form, "srcCnName", item.srcCnName);
  2009. this.$set(this.form, "srcEnName", item.srcEnName);
  2010. this.$set(this.form, "srcDeptId", item.deptId.split(",").pop());
  2011. this.$set(this.form, "srcDeptName", item.deptName);
  2012. this.columnforfun("srcType").disabled = false;
  2013. this.columnforfun("srcCnName").disabled = false;
  2014. // 航线带出往来单位的优势航线
  2015. this.$set(this.form, "lineCnName", item.advantageRoute);
  2016. // 带出发货人数据
  2017. // this.$set(this.form,'hshipperId',item.id)
  2018. // this.$set(this.form,'hshipperCnName',item.cnName)
  2019. // this.$set(this.form,'hshipperEnName',item.enName)
  2020. // this.$set(this.form,'hshipperCode',item.code)
  2021. // this.$set(this.form,'hshipperDetails',item.details)
  2022. // this.$set(this.form,'hshipperCntyName',item.cntyName)
  2023. // this.$set(this.form,'hshipperCntyCode',item.cntyCode)
  2024. }
  2025. }
  2026. }
  2027. // else if (name == 'corpAttnName') {
  2028. // if (this.columnforfun('corpAttnName').dicData.length) {
  2029. // for (let item of this.columnforfun('corpAttnName').dicData) {
  2030. // if (item.cname == value) {
  2031. // this.form.corpAttnName = item.cname
  2032. // this.form.corpAttnId = item.id
  2033. // this.$set(this.form, 'corpAttnTel', item.tel)
  2034. // this.$set(this.form, 'corpAttnEmail', item.email)
  2035. // }
  2036. // }
  2037. // } else {
  2038. // if (value) {
  2039. // this.form.corpAttnName = value
  2040. // this.form.corpAttnId = null
  2041. // }
  2042. // }
  2043. // }
  2044. // else if (name == 'srcType') {
  2045. // if (!value) {
  2046. // this.$set(this.form, 'srcType', '')
  2047. // // this.columnforfun('srcCnName').disabled = true
  2048. // return
  2049. // }
  2050. // this.$set(this.form, 'srcId', '')
  2051. // this.$set(this.form, 'srcCnName', '')
  2052. // this.$set(this.form, 'srcEnName', '')
  2053. // this.form[name] = value
  2054. // if (value == 'OWN') {
  2055. // // 公司
  2056. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'title', value: 'title' }
  2057. // this.ownDeptLazyTreefun()
  2058. // } else if (value == 'AGENT') {
  2059. // // 代理
  2060. // this.columnforfun('srcCnName').type = 'select'
  2061. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  2062. // this.columnforfun('srcCnName').disabled = false
  2063. // this.agentBcorpsListfun()
  2064. // } else if (value == 'SALES') {
  2065. // // 业务员
  2066. // this.columnforfun('srcCnName').type = 'select'
  2067. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'name', value: 'name' }
  2068. // this.columnforfun('srcCnName').disabled = false
  2069. // this.salesUserGetListfun()
  2070. // }
  2071. // }
  2072. // else if (name == 'srcCnName') {
  2073. // for (let item of this.columnforfun('srcCnName').dicData) {
  2074. // if (item[this.columnforfun('srcCnName').forParameter.value] == value) {
  2075. // if (this.form.srcType == 'SALES') {
  2076. // // 业务员
  2077. // this.$set(this.form, 'srcId', item.id)
  2078. // this.$set(this.form, 'srcCnName', item.name)
  2079. // this.$set(this.form, 'srcEnName', item.name)
  2080. // this.$set(this.form, 'srcDeptId', item.deptId.split(',').pop())
  2081. // this.$set(this.form, 'srcDeptName', item.deptName)
  2082. // } else if (this.form.srcType == 'AGENT') {
  2083. // // 代理
  2084. // this.$set(this.form, 'srcId', item.id)
  2085. // this.$set(this.form, 'srcCnName', item.cnName)
  2086. // this.$set(this.form, 'srcEnName', item.enName)
  2087. // }
  2088. // }
  2089. // }
  2090. // }
  2091. // else if (name == 'coloaderCnName') {
  2092. // for (let item of this.columnforfun('coloaderCnName').dicData) {
  2093. // if (item.cnName == value) {
  2094. // this.$set(this.form, 'coloaderId', item.id)
  2095. // this.$set(this.form, 'coloaderCnName', item.cnName)
  2096. // this.$set(this.form, 'coloaderEnName', item.enName)
  2097. // }
  2098. // }
  2099. // }
  2100. else if (name == "mpaymode") {
  2101. // 主单付费方式
  2102. this.form[name] = value;
  2103. if (value == "PP") {
  2104. this.$set(this.form, "mpayplace", this.form.polEnName ? this.form.polEnName.split(" - ")[0] : "");
  2105. } else {
  2106. this.$set(this.form, "mpayplace", this.form.podEnName ? this.form.podEnName.split(" - ")[0] : "");
  2107. }
  2108. }
  2109. // else if (name == 'hpaymode') {
  2110. // // 分单付费方式
  2111. // this.form[name] = value
  2112. // if (value == 'PP') {
  2113. // this.$set(this.form, 'hpayplace', this.form.polEnName.split(' - ')[0])
  2114. // } else {
  2115. // this.$set(this.form, 'hpayplace', this.form.podEnName.split(' - ')[0])
  2116. // }
  2117. // }
  2118. // else if (name == 'teamName') {
  2119. // if (!value) {
  2120. // this.$set(this.form, 'teamId', '')
  2121. // this.$set(this.form, 'teamName', '')
  2122. // }
  2123. // for (let item of this.columnforfun('teamName').dicData) {
  2124. // if (item.id == value) {
  2125. // this.$set(this.form, 'teamId', item.id)
  2126. // this.$set(this.form, 'teamName', item.postName)
  2127. // }
  2128. // }
  2129. // }
  2130. else {
  2131. this.form[name] = value;
  2132. }
  2133. },
  2134. // 申请B/L NO
  2135. applyforfun(text) {
  2136. if (!this.form.id) {
  2137. this.$message({
  2138. message: "请先保存数据",
  2139. type: "warning"
  2140. });
  2141. return;
  2142. }
  2143. // 如果不是分单
  2144. // 王风刚 2025-02-21 所有分单号都不能手动输入,都可以申请
  2145. // if (this.form.billType != 'MH') {
  2146. // this.$message({
  2147. // message: '只有分单需要申请',
  2148. // type: 'warning'
  2149. // });
  2150. // return
  2151. // }
  2152. if (!this.form.businessType) {
  2153. this.$message({
  2154. message: "请先选择业务类型",
  2155. type: "warning"
  2156. });
  2157. return;
  2158. }
  2159. if (!this.form.corpCnName) {
  2160. this.$message({
  2161. message: "请先选择客户名称",
  2162. type: "warning"
  2163. });
  2164. return;
  2165. }
  2166. if (this.form.hblno) {
  2167. this.$confirm(`确定删除${text}?`, {
  2168. confirmButtonText: "确定",
  2169. cancelButtonText: "取消",
  2170. type: "warning"
  2171. }).then(res => {
  2172. removeHblNo({
  2173. id: this.form.id
  2174. }).then(res => {
  2175. this.form.hblno = null;
  2176. this.billsSubmitfun();
  2177. });
  2178. });
  2179. } else {
  2180. if (!this.form.hblno) {
  2181. // 王风刚 2025-02-21 无需弹窗,直接申请分单号
  2182. // this.$confirm(`确定${text}?`, {
  2183. // confirmButtonText: "确定",
  2184. // cancelButtonText: "取消",
  2185. // type: "warning"
  2186. // }).then(res => {
  2187. // this.billsGetBillNofun()
  2188. // })
  2189. this.billsGetBillNofun();
  2190. }
  2191. }
  2192. },
  2193. // 配置项
  2194. columnforfun(value) {
  2195. for (let item of this.basicData.column) {
  2196. if (item instanceof Array) {
  2197. for (let ite of item) {
  2198. if (value == ite.prop) {
  2199. return ite;
  2200. }
  2201. }
  2202. } else {
  2203. if (value == item.prop) {
  2204. return item;
  2205. }
  2206. }
  2207. }
  2208. },
  2209. //返回列表
  2210. backToList() {
  2211. if (
  2212. contrastObj(this.form, this.oldForm) ||
  2213. contrastList(this.form.preContainersList, this.oldForm.preContainersList) ||
  2214. contrastList(this.form.containersList, this.oldForm.containersList) ||
  2215. contrastList(this.form.feeCenterListC, this.oldForm.feeCenterListC) ||
  2216. contrastList(this.form.feeCenterListD, this.oldForm.feeCenterListD) ||
  2217. contrastList(this.form.filesList, this.oldForm.filesList) ||
  2218. contrastList(this.form.waitingBoxList, this.oldForm.waitingBoxList)
  2219. ) {
  2220. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  2221. confirmButtonText: "确定",
  2222. cancelButtonText: "取消",
  2223. type: "warning"
  2224. })
  2225. .then(() => {
  2226. this.editCustomer("goBack");
  2227. })
  2228. .catch(() => {
  2229. if (this.form.id) {
  2230. this.unLock({
  2231. moduleName: "SI",
  2232. tableName: "SI_order",
  2233. billId: this.form.id,
  2234. billNo: this.form.billNo
  2235. });
  2236. }
  2237. this.$emit("goBack");
  2238. });
  2239. } else {
  2240. if (this.form.id) {
  2241. this.unLock({
  2242. moduleName: "SI",
  2243. tableName: "SI_order",
  2244. billId: this.form.id,
  2245. billNo: this.form.billNo
  2246. });
  2247. }
  2248. this.$emit("goBack");
  2249. }
  2250. },
  2251. // 单据请核
  2252. DocumentApproval() {
  2253. if (this.form.billType == "MH") {
  2254. this.$message.warning("分单不能提交请核");
  2255. return;
  2256. }
  2257. if (popupReminder(this.form, this.messageData)) {
  2258. this.$confirm(popupReminder(this.form, this.messageData), {
  2259. confirmButtonText: "确定",
  2260. cancelButtonText: "取消",
  2261. type: "warning"
  2262. });
  2263. }
  2264. // if (popupReminder(this.form, this.messageData)) {
  2265. // return;
  2266. // }
  2267. if (this.form.billType == "DD") {
  2268. if (this.form.feeCenterListC.length == 0 && this.form.feeCenterListD.length == 0) {
  2269. return this.$message.warning("请添加费用信息");
  2270. }
  2271. }
  2272. this.$confirm("确定要请核数据?", {
  2273. confirmButtonText: "确定",
  2274. cancelButtonText: "取消",
  2275. type: "warning"
  2276. }).then(() => {
  2277. this.pageLoading = true;
  2278. billsCheckBills({
  2279. id: this.form.id,
  2280. url: "/iosBasicData/OceanFreightImport/bills/approvalDetails",
  2281. pageStatus: "this.$store.getters.approvalDetails",
  2282. pageLabel: "审批详情(F)"
  2283. })
  2284. .then(res => {
  2285. this.pageLoading = false;
  2286. this.$message({
  2287. type: "success",
  2288. message: "操作成功!"
  2289. });
  2290. // 详情
  2291. this.billsDetailfun(this.form.id);
  2292. })
  2293. .catch(() => {
  2294. this.pageLoading = false;
  2295. });
  2296. });
  2297. },
  2298. // 撤销单据请核
  2299. revokeDocumentApproval() {
  2300. this.$confirm("确定要撤销请核数据?", {
  2301. confirmButtonText: "确定",
  2302. cancelButtonText: "取消",
  2303. type: "warning"
  2304. }).then(() => {
  2305. this.pageLoading = true;
  2306. billsRevokeCheckBills({
  2307. id: this.form.id
  2308. }).then(res => {
  2309. this.pageLoading = false;
  2310. this.$message({
  2311. type: "success",
  2312. message: "操作成功!"
  2313. });
  2314. // 详情
  2315. this.billsDetailfun(this.form.id);
  2316. });
  2317. });
  2318. },
  2319. //撤销锁单
  2320. revokeLockOrder() {
  2321. this.$confirm("是否撤销锁单?", {
  2322. confirmButtonText: "确定",
  2323. cancelButtonText: "取消",
  2324. type: "warning"
  2325. }).then(() => {
  2326. this.pageLoading = true;
  2327. revokeLockOrder({
  2328. id: this.form.id
  2329. }).then(res => {
  2330. this.pageLoading = false;
  2331. this.$message({
  2332. type: "success",
  2333. message: "操作成功!"
  2334. });
  2335. // 详情
  2336. this.billsDetailfun(this.form.id);
  2337. });
  2338. });
  2339. },
  2340. // 编辑按钮
  2341. editHandle() {
  2342. this.detailData.seeDisabled = false;
  2343. },
  2344. //去除文本框的空格
  2345. getTextTirim(data) {
  2346. if (data) {
  2347. let obj = data.split("\n");
  2348. let res = [];
  2349. obj.forEach(item => {
  2350. res.push(_.trimEnd(item));
  2351. });
  2352. return res.join("\n");
  2353. } else {
  2354. return null;
  2355. }
  2356. },
  2357. // 大保存按钮
  2358. editCustomer(status) {
  2359. this.$refs.form.validate(valid => {
  2360. if (valid) {
  2361. // 判断必填项
  2362. let msgs = [];
  2363. if (!this.form.cargoType) {
  2364. msgs.push("货描");
  2365. }
  2366. if (!this.form.actualEta) {
  2367. msgs.push("ATA");
  2368. }
  2369. if (!this.form.eta) {
  2370. msgs.push("ETA");
  2371. }
  2372. if (!this.form.quantity) {
  2373. msgs.push("件数");
  2374. }
  2375. if (!this.form.packingUnit) {
  2376. msgs.push("包装");
  2377. }
  2378. if (!this.form.grossWeight) {
  2379. msgs.push("毛重");
  2380. }
  2381. if (!this.form.measurement) {
  2382. msgs.push("尺码");
  2383. }
  2384. if (!this.form.srcType || !this.form.srcCnName) {
  2385. msgs.push("业务来源");
  2386. }
  2387. // if (!this.form.issueType) {
  2388. // msgs.push("签单方式");
  2389. // }
  2390. // if (!this.form.etd) {
  2391. // msgs.push('ETD')
  2392. // }
  2393. // if (!this.form.teamName) {
  2394. // msgs.push('所属团队')
  2395. // }
  2396. for (let item of this.form.preContainersList) {
  2397. if (!item.cntrTypeCode) {
  2398. this.$message.warning("请选择尺码箱型");
  2399. return;
  2400. }
  2401. if (!item.quantity) {
  2402. this.$message.warning("请输入箱量");
  2403. return;
  2404. }
  2405. }
  2406. for (let item of this.form.feeCenterListD) {
  2407. if (!item.corpId || !item.feeId || !item.curCode) {
  2408. msgs.push(
  2409. `应收第${item.$index + 1}行${!item.corpId ? " 往来单位" : ""}${!item.feeId ? " 费用简称" : ""}${!item.curCode ? " 币种" : ""}`
  2410. );
  2411. }
  2412. }
  2413. for (let item of this.form.feeCenterListC) {
  2414. if (!item.corpId || !item.feeId || !item.curCode) {
  2415. msgs.push(
  2416. `应付第${item.$index + 1}行${!item.corpId ? " 往来单位" : ""}${!item.feeId ? " 费用简称" : ""}${!item.curCode ? " 币种" : ""}`
  2417. );
  2418. }
  2419. }
  2420. if (msgs.length > 0) {
  2421. this.$confirm(`请填写下列信息:${msgs.join(" ,")}!`, {
  2422. confirmButtonText: "确定",
  2423. cancelButtonText: "取消",
  2424. type: "warning"
  2425. });
  2426. return;
  2427. }
  2428. // let msgsList = [];
  2429. // if (checkFullWidthSymbols(this.form.detail.hshipperDetails).hasFullWidth) {
  2430. // let msg = [];
  2431. // for (let item of checkFullWidthSymbols(this.form.detail.hshipperDetails).positions) {
  2432. // msg.push(`第${item.row}行的"${item.symbol}"`);
  2433. // }
  2434. // if (msg.length > 0) {
  2435. // this.$message({
  2436. // dangerouslyUseHTMLString: true,
  2437. // message: `发货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  2438. // type: "error"
  2439. // });
  2440. // return;
  2441. // }
  2442. // }
  2443. // if (checkFullWidthSymbols(this.form.detail.hconsigneeDetails).hasFullWidth) {
  2444. // let msg = [];
  2445. // for (let item of checkFullWidthSymbols(this.form.detail.hconsigneeDetails).positions) {
  2446. // msg.push(`第${item.row}行的"${item.symbol}"`);
  2447. // }
  2448. // if (msg.length > 0) {
  2449. // this.$message({
  2450. // dangerouslyUseHTMLString: true,
  2451. // message: `收货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  2452. // type: "error"
  2453. // });
  2454. // return;
  2455. // }
  2456. // }
  2457. // if (checkFullWidthSymbols(this.form.detail.hnotifyDetails).hasFullWidth) {
  2458. // let msg = [];
  2459. // for (let item of checkFullWidthSymbols(this.form.detail.hnotifyDetails).positions) {
  2460. // msg.push(`第${item.row}行的"${item.symbol}"`);
  2461. // }
  2462. // if (msg.length > 0) {
  2463. // this.$message({
  2464. // dangerouslyUseHTMLString: true,
  2465. // message: `通知人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  2466. // type: "error"
  2467. // });
  2468. // return;
  2469. // }
  2470. // }
  2471. // if (checkFullWidthSymbols(this.form.detail.mshipperDetails).hasFullWidth) {
  2472. // let msg = [];
  2473. // for (let item of checkFullWidthSymbols(this.form.detail.mshipperDetails).positions) {
  2474. // msg.push(`第${item.row}行的"${item.symbol}"`);
  2475. // }
  2476. // if (msg.length > 0) {
  2477. // this.$message({
  2478. // dangerouslyUseHTMLString: true,
  2479. // message: `MBL 发货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  2480. // type: "error"
  2481. // });
  2482. // return;
  2483. // }
  2484. // }
  2485. // if (checkFullWidthSymbols(this.form.detail.mconsigneeDetails).hasFullWidth) {
  2486. // let msg = [];
  2487. // for (let item of checkFullWidthSymbols(this.form.detail.mconsigneeDetails).positions) {
  2488. // msg.push(`第${item.row}行的"${item.symbol}"`);
  2489. // }
  2490. // if (msg.length > 0) {
  2491. // this.$message({
  2492. // dangerouslyUseHTMLString: true,
  2493. // message: `MBL 收货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  2494. // type: "error"
  2495. // });
  2496. // return;
  2497. // }
  2498. // }
  2499. // if (checkFullWidthSymbols(this.form.detail.mnotifyDetails).hasFullWidth) {
  2500. // let msg = [];
  2501. // for (let item of checkFullWidthSymbols(this.form.detail.mnotifyDetails).positions) {
  2502. // msg.push(`第${item.row}行的"${item.symbol}"`);
  2503. // }
  2504. // if (msg.length > 0) {
  2505. // this.$message({
  2506. // dangerouslyUseHTMLString: true,
  2507. // message: `MBL 通知人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  2508. // type: "error"
  2509. // });
  2510. // return;
  2511. // }
  2512. // }
  2513. // if (checkFullWidthSymbols(this.form.marks).hasFullWidth) {
  2514. // let msg = [];
  2515. // for (let item of checkFullWidthSymbols(this.form.marks).positions) {
  2516. // msg.push(`第${item.row}行的"${item.symbol}"`);
  2517. // }
  2518. // if (msg.length > 0) {
  2519. // this.$message({
  2520. // dangerouslyUseHTMLString: true,
  2521. // message: `唛头:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  2522. // type: "error"
  2523. // });
  2524. // return;
  2525. // }
  2526. // }
  2527. // if (checkFullWidthSymbols(this.form.commodityDescr).hasFullWidth) {
  2528. // let msg = [];
  2529. // for (let item of checkFullWidthSymbols(this.form.commodityDescr).positions) {
  2530. // msg.push(`第${item.row}行的"${item.symbol}"`);
  2531. // }
  2532. // if (msg.length > 0) {
  2533. // this.$message({
  2534. // dangerouslyUseHTMLString: true,
  2535. // message: `货描:<br>${msg.join(";<br>")}<br>存在全角或汉字符号、汉字,请确认`,
  2536. // type: "error"
  2537. // });
  2538. // return;
  2539. // }
  2540. // }
  2541. // if (checkFullWidthSymbols(this.form.forwarding).hasFullWidth) {
  2542. // let msg = [];
  2543. // for (let item of checkFullWidthSymbols(this.form.forwarding).positions) {
  2544. // msg.push(`第${item.row}行的"${item.symbol}"`);
  2545. // }
  2546. // if (msg.length > 0) {
  2547. // this.$message({
  2548. // dangerouslyUseHTMLString: true,
  2549. // message: `FORWARDING:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,,请修正后再保存!`,
  2550. // type: "error"
  2551. // });
  2552. // return;
  2553. // }
  2554. // }
  2555. if (lineQuantityVerification(this.form.detail.hshipperDetails, this.lineLength)) {
  2556. return this.$message.error(`发货人详情超长,请手动断行,否则影响打印`);
  2557. }
  2558. if (lineQuantityVerification(this.form.detail.hconsigneeDetails, this.lineLength)) {
  2559. return this.$message.error(`收货人详情超长,请手动断行,否则影响打印`);
  2560. }
  2561. if (lineQuantityVerification(this.form.detail.hnotifyDetails, this.lineLength)) {
  2562. return this.$message.error(`通知人详情超长,请手动断行,否则影响打印`);
  2563. }
  2564. // console.log(this.form.detail);
  2565. // if (!verifyEnglish(this.form.detail.hshipperDetails)) {
  2566. // msgsList.push("发货人");
  2567. // }
  2568. // if (!verifyEnglish(this.form.detail.hconsigneeDetails)) {
  2569. // msgsList.push("收货人");
  2570. // }
  2571. // if (!verifyEnglish(this.form.detail.hnotifyDetails)) {
  2572. // msgsList.push("通知人");
  2573. // }
  2574. // if (!verifyEnglish(this.form.detail.mshipperDetails)) {
  2575. // msgsList.push("MBL 发货人");
  2576. // }
  2577. // if (!verifyEnglish(this.form.detail.mconsigneeDetails)) {
  2578. // msgsList.push("MBL 收货人");
  2579. // }
  2580. // if (!verifyEnglish(this.form.detail.mnotifyDetails)) {
  2581. // msgsList.push("MBL 通知人");
  2582. // }
  2583. // if (!verifyEnglish(this.form.marks)) {
  2584. // msgsList.push("唛头");
  2585. // }
  2586. // if (!verifyEnglish(this.form.commodityDescr)) {
  2587. // msgsList.push("货描");
  2588. // }
  2589. // if (!verifyEnglish(this.form.forwarding)) {
  2590. // msgsList.push("FORWARDING");
  2591. // }
  2592. // if (msgsList.length > 0) {
  2593. // // this.$message.error(`请正确输入${msgsList.join(",")}的英文`);
  2594. // this.$message.error(`${msgsList.join(",")}存在非英文字符,如汉字等,请修正后再保存!`);
  2595. // return;
  2596. // }
  2597. this.form.detail.hshipperDetails = this.getTextTirim(this.form.detail.hshipperDetails);
  2598. this.form.detail.hconsigneeDetails = this.getTextTirim(this.form.detail.hconsigneeDetails);
  2599. this.form.detail.hnotifyDetails = this.getTextTirim(this.form.detail.hnotifyDetails);
  2600. this.form.detail.marks = this.getTextTirim(this.form.detail.marks);
  2601. this.form.detail.commodityDescr = this.getTextTirim(this.form.detail.commodityDescr);
  2602. this.form.forwarding = this.getTextTirim(this.form.forwarding);
  2603. // 调用保存接口
  2604. this.billsSubmitfun(status);
  2605. }
  2606. });
  2607. },
  2608. // 主表保存接口大保存
  2609. billsSubmitfun(status) {
  2610. if (this.form.cargoType == "dry") {
  2611. // 普货
  2612. this.form.billNoFormat = "HYJK";
  2613. } else if (this.form.cargoType == "danger") {
  2614. // 危险品
  2615. this.form.billNoFormat = "HYJK-WXP";
  2616. } else if (this.form.cargoType == "reefer") {
  2617. // 冻柜
  2618. this.form.billNoFormat = "HYJK-DG";
  2619. } else {
  2620. this.form.billNoFormat = "HYJK";
  2621. }
  2622. this.form.businessTypeCode = "HYJK";
  2623. delete this.form.extendedData;
  2624. // 把拼接的数据拆开 开始 🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒
  2625. // this.searchSplit()
  2626. // 把拼接的数据拆开 结束 💩💩💩💩💩💩💩💩💩💩💩💩💩💩
  2627. // 费用 收 赋值数据
  2628. // this.form.shortName=this.form.corpCnName.split('-')[1]
  2629. this.form.feeCenterListD.map((row, index) => {
  2630. row.dc = "D";
  2631. row.sort = Number(index) + 1;
  2632. row.businessType = this.form.businessType; // 业务类型
  2633. row.billType = this.form.billType; // 单据类型
  2634. row.billNo = this.form.billNo; // 单据编号
  2635. row.billDate = this.form.billDate;
  2636. row.billCorpId = this.form.corpId; // 主表客户 id
  2637. row.billCorpCnName = this.form.corpCnName; // 主表客户中文名称
  2638. row.billCorpEnName = this.form.corpEnName; // 主表客户英文名称
  2639. row.lineId = this.form.lineId; // 航线 id
  2640. row.lineCnName = this.form.lineCnName; // 航线中文名称
  2641. row.lineEnName = this.form.lineEnName; // 航线英文名称
  2642. row.vesselId = this.form.vesselId; // 船名 id
  2643. row.vesselCnName = this.form.vesselCnName; // 中文船名
  2644. row.vesselEnName = this.form.vesselEnName; // 英文船名
  2645. row.voyageNo = this.form.voyageNo; // 航次
  2646. row.mblno = this.form.mblno; // MB/L NO
  2647. row.hblno = this.form.hblno; // HB/L NO
  2648. // row.etd = this.form.etd // 开船日期
  2649. // row.eta = this.form.actualEta; // 到港日期
  2650. row.polId = this.form.polId; // 装货港 id
  2651. row.polCode = this.form.polCode; // 装货港代码
  2652. row.polCnName = this.form.polCnName; // 装货港中文名称
  2653. row.polEnName = this.form.polEnName; // 装货港英文名称
  2654. row.podId = this.form.podId; // 卸货港 id
  2655. row.podCode = this.form.podCode; // 卸货港代码
  2656. row.podCnName = this.form.podCnName; // 卸货港中文名称
  2657. row.podEnName = this.form.podEnName; // 卸货港英文名称
  2658. row.corpArgreementNo = this.form.corpArgreementNo; // 客户约号
  2659. // 数量 * 单价 = 净额
  2660. // 总税率 = 税率 + 附件税率
  2661. // 税额 = 净额 * 总税率
  2662. // 含税
  2663. if (row.curCode == this.getLocalCurrency()) {
  2664. row.amount = row.rmbAmount ? row.rmbAmount : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2665. } else {
  2666. row.amount = row.usdAmount ? row.usdAmount : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2667. }
  2668. // 净额
  2669. if (row.curCode == this.getLocalCurrency()) {
  2670. row.amountNet = row.rmbAmountNet ? row.rmbAmountNet : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2671. } else {
  2672. row.amountNet = row.usdAmountNet ? row.usdAmountNet : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2673. }
  2674. });
  2675. // 费用 付 赋值数据
  2676. this.form.feeCenterListC.map((row, index) => {
  2677. row.dc = "C";
  2678. row.sort = Number(index) + 1;
  2679. row.businessType = this.form.businessType; // 业务类型
  2680. row.billType = this.form.billType; // 单据类型
  2681. row.billNo = this.form.billNo; // 单据编号
  2682. row.billDate = this.form.billDate; // 单据日期
  2683. row.billCorpId = this.form.corpId; // 主表客户 id
  2684. row.billCorpCnName = this.form.corpCnName; // 主表客户中文名称
  2685. row.billCorpEnName = this.form.corpEnName; // 主表客户英文名称
  2686. row.lineId = this.form.lineId; // 航线 id
  2687. row.lineCnName = this.form.lineCnName; // 航线中文名称
  2688. row.lineEnName = this.form.lineEnName; // 航线英文名称
  2689. row.vesselId = this.form.vesselId; // 船名 id
  2690. row.vesselCnName = this.form.vesselCnName; // 中文船名
  2691. row.vesselEnName = this.form.vesselEnName; // 英文船名
  2692. row.voyageNo = this.form.voyageNo; // 航次
  2693. row.mblno = this.form.mblno; // MB/L NO
  2694. row.hblno = this.form.hblno; // HB/L NO
  2695. // row.etd = this.form.etd // 开船日期
  2696. // row.eta = this.form.actualEta; // 到港日期
  2697. row.polId = this.form.polId; // 装货港 id
  2698. row.polCode = this.form.polCode; // 装货港代码
  2699. row.polCnName = this.form.polCnName; // 装货港中文名称
  2700. row.polEnName = this.form.polEnName; // 装货港英文名称
  2701. row.podId = this.form.podId; // 卸货港 id
  2702. row.podCode = this.form.podCode; // 卸货港代码
  2703. row.podCnName = this.form.podCnName; // 卸货港中文名称
  2704. row.podEnName = this.form.podEnName; // 卸货港英文名称
  2705. row.corpArgreementNo = this.form.corpArgreementNo; // 客户约号
  2706. // 数量 * 单价 = 净额
  2707. // 总税率 = 税率 + 附件税率
  2708. // 税额 = 净额 * 总税率
  2709. // 含税
  2710. if (row.curCode == this.getLocalCurrency()) {
  2711. row.amount = row.rmbAmount ? row.rmbAmount : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2712. } else {
  2713. row.amount = row.usdAmount ? row.usdAmount : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2714. }
  2715. // 净额
  2716. if (row.curCode == this.getLocalCurrency()) {
  2717. row.amountNet = row.rmbAmountNet ? row.rmbAmountNet : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2718. } else {
  2719. row.amountNet = row.usdAmountNet ? row.usdAmountNet : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2720. }
  2721. });
  2722. this.pageLoading = true;
  2723. billsSubmit(this.form)
  2724. .then(res => {
  2725. this.pageLoading = false;
  2726. if (res.data.code === 601) {
  2727. console.info("11111111111----", res);
  2728. this.billsDetailfun(this.form.id);
  2729. this.$message({
  2730. type: "error",
  2731. message: res.data.msg
  2732. });
  2733. return true;
  2734. }
  2735. this.$message({
  2736. type: "success",
  2737. message: "操作成功!"
  2738. });
  2739. if (status == "goBack") {
  2740. if (this.form.id) {
  2741. this.unLock({
  2742. moduleName: "SI",
  2743. tableName: "SI_order",
  2744. billId: this.form.id,
  2745. billNo: this.form.billNo
  2746. });
  2747. }
  2748. this.$emit("goBack");
  2749. }
  2750. // this.detailData.seeDisabled = true
  2751. this.billsDetailfun(res.data.data.id, status);
  2752. })
  2753. .catch(err => {
  2754. this.pageLoading = false;
  2755. })
  2756. .finally(() => {});
  2757. },
  2758. // 提取箱专用的保存
  2759. billsAddfun() {
  2760. billsAdd(this.form)
  2761. .then(res => {
  2762. this.pageLoading = false;
  2763. this.$message({
  2764. type: "success",
  2765. message: "操作成功!"
  2766. });
  2767. // this.detailData.seeDisabled = true
  2768. this.billsDetailfun(res.data.data.id);
  2769. })
  2770. .catch(err => {
  2771. this.pageLoading = false;
  2772. });
  2773. },
  2774. // 复制单据接口
  2775. async billsCopyBillsfun(id, type, billType) {
  2776. const loading = this.$loading({
  2777. lock: true,
  2778. text: "加载中",
  2779. spinner: "el-icon-loading",
  2780. background: "rgba(255,255,255,0.7)"
  2781. });
  2782. let res = await billsCopyBills({
  2783. id
  2784. });
  2785. loading.close();
  2786. this.detailData.seeDisabled = false;
  2787. let types = typeof type == "string" ? type.split(",") : [];
  2788. // if (type == '复制费用' || type == '') {
  2789. // res.data.data.preContainersList = []
  2790. // }
  2791. // if (type == '复制箱型箱量' || type == '') {
  2792. // res.data.data.feeCenterListD = []
  2793. // res.data.data.feeCenterListC = []
  2794. // }
  2795. if (types.indexOf("复制箱型箱量") < 0) {
  2796. res.data.data.preContainersList = [];
  2797. }
  2798. if (types.indexOf("复制费用") < 0) {
  2799. res.data.data.feeCenterListD = [];
  2800. res.data.data.feeCenterListC = [];
  2801. }
  2802. res.data.data.billType = billType;
  2803. if (
  2804. !this.roleName.includes("admin") &&
  2805. (this.roleName.includes("应收修改") || this.roleName.includes("应收查看")) &&
  2806. !(this.roleName.includes("应付修改") || this.roleName.includes("应付查看") || !this.roleName.includes("允许修改他人费用"))
  2807. ) {
  2808. res.data.data.feeCenterListC = [];
  2809. }
  2810. if (
  2811. !this.roleName.includes("admin") &&
  2812. (this.roleName.includes("应付修改") || this.roleName.includes("应付查看")) &&
  2813. !(this.roleName.includes("应收修改") || this.roleName.includes("应收查看") || !this.roleName.includes("允许修改他人费用"))
  2814. ) {
  2815. res.data.data.feeCenterListD = [];
  2816. }
  2817. await this.saveLocalCurrency(res.data.data.branchId);
  2818. this.form = res.data.data;
  2819. this.pageLoading = false;
  2820. // this.searchMontage() // 下拉 中文名称和编号拼接
  2821. // 配箱最上面可以编辑
  2822. for (let item of this.form.containersList) {
  2823. item.edit = false;
  2824. }
  2825. // 先把状态改成可以编辑,然后判断是否可以编辑
  2826. this.generateBillsfalse = false;
  2827. // 应收
  2828. for (let item of this.form.feeCenterListD) {
  2829. // 判断是否生成了账单
  2830. if (item.accStatus == 1) {
  2831. // this.columnforfun("corpCnName").disabled = true;
  2832. // this.columnforfun('srcType').disabled = true
  2833. this.columnforfun("mblno").disabled = true;
  2834. this.columnforfun("bookingNo").disabled = true;
  2835. // this.columnforfun('refno').disabled = true
  2836. this.generateBillsfalse = true;
  2837. }
  2838. if (item.curCode == this.getLocalCurrency()) {
  2839. this.$set(item, "rmbAmount", item.amount);
  2840. this.$set(item, "usdAmount", "");
  2841. this.$set(item, "rmbAmountNet", item.amountNet);
  2842. this.$set(item, "usdAmountNet", "");
  2843. } else {
  2844. this.$set(item, "usdAmount", item.amount);
  2845. this.$set(item, "rmbAmount", "");
  2846. this.$set(item, "usdAmountNet", item.amountNet);
  2847. this.$set(item, "rmbAmountNet", "");
  2848. }
  2849. item.edit = false;
  2850. }
  2851. // 应付
  2852. for (let item of this.form.feeCenterListC) {
  2853. // 判断是否生成了账单
  2854. if (item.accStatus == 1) {
  2855. this.generateBillsfalse = true;
  2856. // this.columnforfun("corpCnName").disabled = true;
  2857. // this.columnforfun('srcType').disabled = true
  2858. this.columnforfun("mblno").disabled = true;
  2859. this.columnforfun("bookingNo").disabled = true;
  2860. // this.columnforfun('refno').disabled = true
  2861. }
  2862. if (item.curCode == this.getLocalCurrency()) {
  2863. this.$set(item, "rmbAmount", item.amount);
  2864. this.$set(item, "usdAmount", "");
  2865. this.$set(item, "rmbAmountNet", item.amountNet);
  2866. this.$set(item, "usdAmountNet", "");
  2867. } else {
  2868. this.$set(item, "usdAmount", item.amount);
  2869. this.$set(item, "rmbAmount", "");
  2870. this.$set(item, "usdAmountNet", item.amountNet);
  2871. this.$set(item, "rmbAmountNet", "");
  2872. }
  2873. item.edit = false;
  2874. }
  2875. // 文件中心
  2876. for (let item of this.form.filesList) {
  2877. this.$set(item, "edit", false);
  2878. }
  2879. },
  2880. // 详情接口
  2881. async billsDetailfun(id, status) {
  2882. const res = await billsDetail(id);
  2883. // this.form = res.data.data;
  2884. if (
  2885. !this.roleName.includes("admin") &&
  2886. (this.roleName.includes("应收修改") || this.roleName.includes("应收查看")) &&
  2887. !(this.roleName.includes("应付修改") || this.roleName.includes("应付查看") || !this.roleName.includes("允许修改他人费用"))
  2888. ) {
  2889. res.data.data.feeCenterListC = [];
  2890. }
  2891. if (
  2892. !this.roleName.includes("admin") &&
  2893. (this.roleName.includes("应付修改") || this.roleName.includes("应付查看")) &&
  2894. !(this.roleName.includes("应收修改") || this.roleName.includes("应收查看") || !this.roleName.includes("允许修改他人费用"))
  2895. ) {
  2896. res.data.data.feeCenterListD = [];
  2897. }
  2898. res.data.data.marks = res.data.data.marks ? res.data.data.marks.split("&|&").join("\n") : "";
  2899. res.data.data.commodityDescr = res.data.data.commodityDescr ? res.data.data.commodityDescr.split("&|&").join("\n") : "";
  2900. this.$set(this, "form", res.data.data);
  2901. // this.inLock();
  2902. // console.log('form', this.form)
  2903. // console.log(this.$refs)
  2904. if (this.form.id) {
  2905. this.$refs.documentCenter.reportslogListfun({ currentPage: 1, pageSize: 10 });
  2906. }
  2907. this.billsListAllfun(this.form.id);
  2908. this.copyFormData = JSON.parse(JSON.stringify(res.data.data));
  2909. // 如果已经请核就禁用按钮
  2910. if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
  2911. this.detailData.seeDisabled = true;
  2912. } else {
  2913. this.detailData.seeDisabled = false;
  2914. }
  2915. // this.columnforfun('teamName').disabled = true
  2916. // this.columnforfun('operatorName').disabled = true
  2917. // this.columnforfun('accDeptName').disabled = true
  2918. if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
  2919. this.columnforfun("corpCnName").disabled = true;
  2920. // this.columnforfun('srcType').disabled = true
  2921. this.columnforfun("mblno").disabled = true;
  2922. this.columnforfun("bookingNo").disabled = true;
  2923. // this.columnforfun('refno').disabled = true
  2924. // this.columnforfun('teamId').disabled = true
  2925. this.generateBillsfalse = true;
  2926. this.pleasereviewType = true; // 请核禁用
  2927. } else {
  2928. // 判断是否可以编辑
  2929. this.columnforfun("corpCnName").disabled = false;
  2930. // this.columnforfun('srcType').disabled = false
  2931. this.columnforfun("mblno").disabled = false;
  2932. this.columnforfun("bookingNo").disabled = false;
  2933. // this.columnforfun('refno').disabled = false
  2934. // if (this.saberTenantId == '607913') {
  2935. // this.columnforfun('operatorName').disabled = false
  2936. // this.columnforfun('accDeptName').disabled = false
  2937. // }
  2938. // this.columnforfun('teamId').disabled = false
  2939. this.generateBillsfalse = false;
  2940. this.pleasereviewType = false;
  2941. }
  2942. this.pageLoading = false;
  2943. // this.searchMontage() // 下拉 中文名称和编号拼接
  2944. // 配箱最上面可以编辑
  2945. for (let item of this.form.containersList) {
  2946. item.edit = false;
  2947. }
  2948. // 配箱最下面的
  2949. for (let item of this.form.waitingBoxList) {
  2950. this.$set(item, "editQuantity", item.quantity);
  2951. this.$set(item, "editGrossWeight", item.grossWeight);
  2952. this.$set(item, "editMeasurement", item.measurement);
  2953. this.$set(item, "edit", false);
  2954. }
  2955. // 应收
  2956. for (let item of this.form.feeCenterListD) {
  2957. // 判断是否生成了账单
  2958. if (item.accStatus == 1) {
  2959. this.generateBillsfalse = true;
  2960. // this.columnforfun("corpCnName").disabled = true;
  2961. // this.columnforfun('srcType').disabled = true
  2962. this.columnforfun("mblno").disabled = true;
  2963. this.columnforfun("bookingNo").disabled = true;
  2964. // this.columnforfun('refno').disabled = true
  2965. }
  2966. if (item.curCode == this.getLocalCurrency()) {
  2967. this.$set(item, "rmbAmount", item.amount);
  2968. this.$set(item, "usdAmount", "");
  2969. this.$set(item, "rmbAmountNet", item.amountNet);
  2970. this.$set(item, "usdAmountNet", "");
  2971. } else {
  2972. this.$set(item, "usdAmount", item.amount);
  2973. this.$set(item, "rmbAmount", "");
  2974. this.$set(item, "usdAmountNet", item.amountNet);
  2975. this.$set(item, "rmbAmountNet", "");
  2976. }
  2977. item.edit = false;
  2978. }
  2979. // 应付
  2980. for (let item of this.form.feeCenterListC) {
  2981. // 判断是否生成了账单
  2982. if (item.accStatus == 1) {
  2983. this.generateBillsfalse = true;
  2984. // this.columnforfun("corpCnName").disabled = true;
  2985. // this.columnforfun('srcType').disabled = true
  2986. this.columnforfun("mblno").disabled = true;
  2987. this.columnforfun("bookingNo").disabled = true;
  2988. // this.columnforfun('refno').disabled = true
  2989. }
  2990. if (item.curCode == this.getLocalCurrency()) {
  2991. this.$set(item, "rmbAmount", item.amount);
  2992. this.$set(item, "usdAmount", "");
  2993. this.$set(item, "rmbAmountNet", item.amountNet);
  2994. this.$set(item, "usdAmountNet", "");
  2995. } else {
  2996. this.$set(item, "usdAmount", item.amount);
  2997. this.$set(item, "rmbAmount", "");
  2998. this.$set(item, "usdAmountNet", item.amountNet);
  2999. this.$set(item, "rmbAmountNet", "");
  3000. }
  3001. item.edit = false;
  3002. }
  3003. // 文件中心
  3004. this.$refs.filescenter.getData(res.data.data);
  3005. for (let item of this.form.filesList) {
  3006. this.$set(item, "edit", false);
  3007. }
  3008. if (status == "toAddEdit") {
  3009. this.$emit(status);
  3010. }
  3011. this.oldForm = this.deepClone(this.form);
  3012. },
  3013. // tbas切换
  3014. handleClick(tba, event) {},
  3015. // 大tbas切换
  3016. bigHandleClick() {
  3017. if (this.bigtabs == "fd") {
  3018. if (this.form.id) {
  3019. this.billsListAllfun(this.form.id);
  3020. }
  3021. }
  3022. if (this.bigtabs == "dz") {
  3023. if (this.form.id) {
  3024. this.$refs.documentCenter.reportslogListfun({
  3025. currentPage: 1,
  3026. pageSize: 10
  3027. });
  3028. }
  3029. this.getReportTypeByBigHandle("单证");
  3030. }
  3031. if (this.bigtabs == "fy") this.getReportTypeByBigHandle("费用");
  3032. },
  3033. getReportTypeByBigHandle(name) {
  3034. return name;
  3035. },
  3036. // 获取不分页的分单列表
  3037. billsListAllfun(masterId) {
  3038. billsListAll({
  3039. masterId
  3040. }).then(res => {
  3041. this.billsListAllData = res.data.data;
  3042. });
  3043. }
  3044. }
  3045. };
  3046. </script>
  3047. <style scoped lang="scss">
  3048. ::v-deep .el-tabs--border-card > .el-tabs__content {
  3049. padding: 4px !important;
  3050. }
  3051. .scrollable-container {
  3052. height: 84vh;
  3053. /* 设置容器高度 */
  3054. overflow-y: auto;
  3055. /* 添加垂直滚动条 */
  3056. }
  3057. .borderless {
  3058. height: 100%;
  3059. box-sizing: border-box;
  3060. }
  3061. .customer-main {
  3062. margin-bottom: 15px;
  3063. }
  3064. .demo-ruleForm {
  3065. font-size: 14px;
  3066. }
  3067. .margintop {
  3068. margin-top: 0px !important;
  3069. }
  3070. ::v-deep.el-form-item {
  3071. margin-bottom: 0;
  3072. }
  3073. ::v-deep .basic-container .el-card__body {
  3074. padding: 6px 20px;
  3075. }
  3076. ::v-deep .el-tabs__header {
  3077. margin: 0 05px;
  3078. }
  3079. .isShow {
  3080. display: none;
  3081. }
  3082. .dropdown-max {
  3083. top: 150px !important;
  3084. max-width: 600px;
  3085. display: flex;
  3086. flex-flow: row wrap;
  3087. li {
  3088. margin-right: 5px;
  3089. white-space: nowrap;
  3090. }
  3091. }
  3092. </style>