billsDetails.vue 98 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874
  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"
  7. @click="backToList">返回列表
  8. </el-button>
  9. </div>
  10. <div class="add-customer-btn">
  11. <!--<el-popover-->
  12. <!-- placement="bottom-end"-->
  13. <!-- width="100"-->
  14. <!-- trigger="hover">-->
  15. <!-- <div>-->
  16. <!-- </div>-->
  17. <el-dropdown style="line-height: 0">
  18. <el-button size="small" type="success" style="margin-right: 8px"
  19. :loading="saveLoading" :disabled="!form.id" >
  20. 发送 EDI<i class="el-icon-arrow-down el-icon--right"></i>
  21. </el-button>
  22. <el-dropdown-menu slot="dropdown">
  23. <el-dropdown-item v-for="item in ediData" :key="item.id"
  24. @click.native="editypesSendingEdifun(item)">{{item.cnName}}
  25. </el-dropdown-item>
  26. </el-dropdown-menu>
  27. </el-dropdown>
  28. <el-button size="small" style="margin-right: 8px"
  29. :loading="saveLoading" @click="previewDialogfun" >预 览
  30. </el-button>
  31. <el-button size="small" type="warning" :disabled="!form.id || detailData.seeDisabled" v-if="form.status == 1"
  32. @click.stop="revokeDocumentApproval">撤销单据请核
  33. </el-button>
  34. <el-button size="small" type="success" :disabled="!form.id || detailData.seeDisabled" v-if="form.status == 0 || form.status == 4"
  35. @click.stop="DocumentApproval">单据请核
  36. </el-button>
  37. <!--<el-button size="small" type="primary" style="margin-right: 8px" v-if="detailData.seeDisabled"-->
  38. <!-- :loading="saveLoading" @click="editHandle">编 辑-->
  39. <!--</el-button>-->
  40. <el-button size="small" type="primary" style="margin-right: 8px" :disabled="detailData.seeDisabled"
  41. :loading="saveLoading" @click="editCustomer">保 存
  42. </el-button>
  43. <el-dropdown style="line-height: 0">
  44. <el-button type="warning" :loading="saveLoading" :disabled="!form.id" size="small">
  45. 审 批<i class="el-icon-arrow-down el-icon--right"></i>
  46. </el-button>
  47. <el-dropdown-menu slot="dropdown">
  48. <!--<el-dropdown-item @click.native="examineBtn('审批')" :disabled="isExamineBtn && !detailData.check">审批-->
  49. <!--</el-dropdown-item>-->
  50. <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
  51. </el-dropdown-item>
  52. </el-dropdown-menu>
  53. </el-dropdown>
  54. </div>
  55. </div>
  56. <div style="margin-top: 65px">
  57. <el-tabs type="border-card" v-model="bigtabs" @tab-click="bigHandleClick">
  58. <el-tab-pane label="委托信息" name="wt">
  59. <div>
  60. <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm">
  61. <containerTitle title="基础资料"></containerTitle>
  62. <basic-container :showBtn="true">
  63. <el-row :gutter="60">
  64. <el-col v-for="(item, index) in basicData.column" :key="index" :span="8">
  65. <!--数组-->
  66. <div v-if="item instanceof Array" style="display: flex;align-items: center;justify-content: space-between">
  67. <el-row>
  68. <el-col :span="item[0].span?item[0].span:12">
  69. <el-form-item :label="item[0].label" :prop="item[0].prop" :rules="item[0].rules"
  70. :label-width="item[0].labelWidth">
  71. <span slot="label" v-if="item[0].label">
  72. <span v-if="item[0].label == 'HB/L NO'"
  73. style="color: #4c9e44;cursor: pointer;text-decoration: underline;"
  74. @click="applyforfun(item[0].label)">{{item[0].label}}
  75. </span>
  76. <span v-else style="color: #1e9fff">{{item[0].label}}</span>
  77. </span>
  78. <span v-if="item[0].type == 'button'"></span>
  79. <!--<el-button v-if="item[0].type == 'button'" :disabled="detailData.seeDisabled || item[0].disabled"-->
  80. <!-- size="mini" type="success" icon="el-icon-circle-plus" circle-->
  81. <!-- @click="applyforfun(item[0].label)" >-->
  82. <!--</el-button>-->
  83. <search-query v-else-if="item[0].type == 'select'"
  84. :datalist="item[0].dicData"
  85. :selectValue="form[item[0].prop]"
  86. :filterable="true"
  87. :allowCreate="item[0].allowCreate || false"
  88. :clearable="true"
  89. :remote="true"
  90. :disabled="detailData.seeDisabled || item[0].disabled"
  91. :buttonIf="false"
  92. :placeholder="`${item[0].text || ''}`"
  93. :forParameter="item[0].forParameter"
  94. @remoteMethod="remoteMethod($event,item[0].prop)"
  95. @corpChange="corpChange($event,item[0].prop)"
  96. @corpFocus="remoteMethod($event,item[0].prop)" >
  97. </search-query>
  98. <el-input v-else type="age" style="width: 100%;" v-model="form[item[0].prop]"
  99. size="small" autocomplete="off"
  100. :disabled="detailData.seeDisabled || item[0].disabled"
  101. clearable :placeholder="item[0].text || ''" ></el-input>
  102. </el-form-item>
  103. </el-col>
  104. <el-col :span="item[1].span?item[1].span:12">
  105. <el-form-item :label="item[1].label" :prop="item[1].prop" :rules="item[1].rules"
  106. :label-width="item[1].labelWidth">
  107. <span slot="label" v-if="item[1].label">
  108. <span style="color: #1e9fff">{{item[1].label}}</span>
  109. </span>
  110. <el-date-picker v-if="item[1].type == 'date'"
  111. v-model="form[item[1].prop]" clearable style="width: 100%;"
  112. type="date" size="small" :disabled="detailData.seeDisabled || item[1].disabled"
  113. value-format="yyyy-MM-dd HH:mm"
  114. placeholder="选择日期">
  115. </el-date-picker>
  116. <search-query v-else-if="item[1].type == 'select'"
  117. :datalist="item[1].dicData"
  118. :selectValue="form[item[1].prop]"
  119. :filterable="true"
  120. :clearable="true"
  121. :remote="true"
  122. :disabled="detailData.seeDisabled || item[1].disabled"
  123. :buttonIf="false"
  124. :placeholder="`${item[1].text || ''}`"
  125. :forParameter="item[1].forParameter"
  126. @remoteMethod="remoteMethod($event,item[1].prop)"
  127. @corpChange="corpChange($event,item[1].prop)"
  128. @corpFocus="remoteMethod($event,item[1].prop)" >
  129. </search-query>
  130. <tree-select v-else-if="item[1].type == 'tree'"
  131. v-model="form[item[1].prop]" filterable
  132. :data="item[1].dicData"
  133. :props="item[1].forParameter"
  134. nodeKey="title"
  135. size="small"
  136. :disabled="detailData.seeDisabled || item[1].disabled"
  137. :multiple="false"
  138. :placeholder="`${item[1].text || ''}`"
  139. @input="corpChange($event,item[1].prop)">
  140. </tree-select>
  141. <el-input v-else type="age" style="width: 100%;" v-model="form[item[1].prop]"
  142. size="small" autocomplete="off"
  143. :disabled="detailData.seeDisabled || item[1].disabled"
  144. clearable :placeholder="item[1].text || ''" ></el-input>
  145. </el-form-item>
  146. </el-col>
  147. <el-col v-if="item[2]" :span="item[2].span?item[2].span:12">
  148. <el-form-item :label="item[2].label" :prop="item[2].prop" :rules="item[2].rules"
  149. :label-width="item[2].labelWidth">
  150. <span slot="label" v-if="item[2].label">
  151. <span style="color: #1e9fff">{{item[2].label}}</span>
  152. </span>
  153. <search-query v-if="item[2].type == 'select'"
  154. :datalist="item[2].dicData"
  155. :selectValue="form[item[2].prop]"
  156. :filterable="true"
  157. :clearable="true"
  158. :remote="true"
  159. :disabled="detailData.seeDisabled || item[2].disabled"
  160. :buttonIf="false"
  161. :forParameter="item[2].forParameter"
  162. :placeholder="`${item[2].text || ''}`"
  163. @remoteMethod="remoteMethod($event,item[2].prop)"
  164. @corpChange="corpChange($event,item[2].prop)"
  165. @corpFocus="remoteMethod($event,item[2].prop)" >
  166. </search-query>
  167. <el-input v-else type="age" style="width: 100%;" v-model="form[item[2].prop]"
  168. size="small" autocomplete="off"
  169. :disabled="detailData.seeDisabled || item[1].disabled"
  170. clearable :placeholder="item[2].text || ''" ></el-input>
  171. </el-form-item>
  172. </el-col>
  173. </el-row>
  174. </div>
  175. <!--对象-->
  176. <div v-else>
  177. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  178. <span slot="label" v-if="item.label">
  179. <span style="color: #1e9fff">{{item.label}}</span>
  180. </span>
  181. <search-query v-if="item.type == 'select'"
  182. ref="searchQueryRef"
  183. :datalist="item.dicData"
  184. :selectValue="form[item.prop]"
  185. :filterable="true"
  186. :clearable="true"
  187. :remote="true"
  188. :disabled="detailData.seeDisabled || item.disabled"
  189. :buttonIf="item.buttonIf"
  190. :forParameter="item.forParameter"
  191. :placeholder="`${item.text || ''}`"
  192. @remoteMethod="remoteMethod($event,item.prop)"
  193. @corpChange="corpChange($event,item.prop)"
  194. @corpFocus="remoteMethod($event,item.prop)"
  195. @eldialogConfirm="eldialogConfirm(item.slot)" >
  196. <bcorps v-show="item.slot == 'bcorps'"
  197. ref="bcorps"
  198. :eldialog="true"
  199. @selectionChange="eldialogMultipleChoice($event,item.slot)" >
  200. </bcorps>
  201. <bcorpstypedefine v-show="item.slot == 'bcorpstypedefine'"></bcorpstypedefine>
  202. </search-query>
  203. <el-input v-else type="age" style="width: 100%;" v-model="form[item.prop]"
  204. size="small" autocomplete="off"
  205. :disabled="detailData.seeDisabled || item.disabled"
  206. clearable :placeholder="item.text || ''" ></el-input>
  207. </el-form-item>
  208. </div>
  209. </el-col>
  210. </el-row>
  211. </basic-container>
  212. </el-form>
  213. </div>
  214. <div class="customer-main margintop">
  215. <containerTitle title="详细"></containerTitle>
  216. <basic-container :showBtn="true">
  217. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  218. <el-tab-pane label="委托详情" name="first">
  219. <entrustment-lnformation :assemblyForm="form"
  220. :detailData="detailData"
  221. :generateBillsfalse="generateBillsfalse"
  222. @billsDetailfun="billsDetailfun(form.id)">
  223. </entrustment-lnformation>
  224. </el-tab-pane>
  225. <el-tab-pane label="配箱信息" name="second">
  226. <DistributionBox :assemblyForm="form" :detailData="detailData"
  227. :pleasereviewType="pleasereviewType"
  228. @billsDetailfun="billsDetailfun(form.id)">
  229. </DistributionBox>
  230. </el-tab-pane>
  231. <el-tab-pane label="MB/L信息" name="third">
  232. <mbinformation :assemblyForm="form" :detailData="detailData"></mbinformation>
  233. </el-tab-pane>
  234. <el-tab-pane label="报表管理" name="fourth" v-if="roleName.indexOf('admin') != -1" >
  235. <reports :id="form.id" :assemblyForm="form"
  236. :disabled="detailData.seeDisabled" businessValue="HYCK"></reports>
  237. </el-tab-pane>
  238. <el-tab-pane label="EDI CODE" name="sixth">
  239. <edicode :assemblyForm="form" :detailData="detailData"></edicode>
  240. </el-tab-pane>
  241. <el-tab-pane label="文件中心" name="seventh">
  242. <filescenter :assemblyForm="form" :detailData="detailData"></filescenter>
  243. </el-tab-pane>
  244. </el-tabs>
  245. </basic-container>
  246. <basic-container :showBtn="true" v-if="activeName == 'first' || activeName == 'third'">
  247. <formbottom :assemblyForm="form" :generateBillsfalse="generateBillsfalse" :detailData="detailData"></formbottom>
  248. </basic-container>
  249. </div>
  250. </el-tab-pane>
  251. <el-tab-pane label="费用信息" name="fy"
  252. v-if="roleName.indexOf('admin') != -1?true:roleName.indexOf('应收修改') != -1 || roleName.indexOf('应付修改') != -1 || roleName.indexOf('应收查看') != -1 || roleName.indexOf('应付查看') != -1" >
  253. <feecenter :assemblyForm="form" :detailData="detailData" :pleasereviewType="pleasereviewType" :pid="form.id" @billsDetailfun="billsDetailfun(form.id)"></feecenter>
  254. </el-tab-pane>
  255. <el-tab-pane label="单证中心" name="dz">
  256. <document-center ref="documentCenter" :detailData="detailData" :assemblyForm="form" ></document-center>
  257. </el-tab-pane>
  258. <el-tab-pane label="分单列表" name="fd" v-if="form.billType == 'MM'">
  259. <Split-list :detailData="detailData" :assemblyForm="form"
  260. :data="billsListAllData"
  261. @billsListAllfun="billsListAllfun(form.id)"></Split-list>
  262. </el-tab-pane>
  263. </el-tabs>
  264. </div>
  265. <!--审核弹窗-->
  266. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  267. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  268. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  269. </el-dialog>
  270. <!--预览报表弹窗-->
  271. <el-dialog append-to-body title="预览报表" class="el-dialogDeep" :visible.sync="previewDialog" width="60%"
  272. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  273. <business-reports :id="form.id" :disabled="detailData.seeDisabled"></business-reports>
  274. </el-dialog>
  275. </div>
  276. </template>
  277. <script>
  278. import EntrustmentLnformation from "@/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation.vue";
  279. import mbinformation from "@/views/iosBasicData/SeafreightExportF/bills/assembly/mbinformation.vue";
  280. import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
  281. import formbottom from "@/views/iosBasicData/SeafreightExportF/bills/assembly/formbottom.vue";
  282. import edicode from '@/views/iosBasicData/SeafreightExportF/bills/assembly/edicode.vue'
  283. import filescenter from "@/views/iosBasicData/SeafreightExportF/bills/assembly/filescenter.vue";
  284. import DistributionBox from "@/views/iosBasicData/SeafreightExportF/bills/assembly/DistributionBox.vue";
  285. import feecenter from '@/views/iosBasicData/SeafreightExportF/bills/assembly/feecenter.vue'
  286. import {getList as userGetList} from '@/api/system/user'
  287. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  288. import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
  289. import bcorps from "@/views/iosBasicData/bcorps/index.vue";
  290. import bcorpstypedefine from "@/views/iosBasicData/bcorps/bcorpstypedefine.vue";
  291. import SplitList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/SplitList.vue";
  292. import {getLazylist} from "@/api/basicData/agreement";
  293. import {getBcorpsList, getBcorpslistByType} from "@/api/iosBasicData/bcorps";
  294. import {getBlocationsList} from "@/api/iosBasicData/blocations";
  295. import {getBcorpsattnList} from "@/api/iosBasicData/bcorpsattn";
  296. import {getWorkDicts} from "@/api/system/dictbiz";
  297. import {getDeptLazyTree, getDeptTree, getLazyList} from "@/api/system/dept";
  298. import {
  299. billsCheckBills, billsCopyBills,
  300. billsDetail,
  301. billsGetBillNo,
  302. billsListAll, billsRevokeCheckBills, editypesSendingEdi,
  303. billsSubmit,
  304. deptGetDetailPol, postSelectByUser,
  305. } from '@/api/iosBasicData/bills'
  306. import {dateFormat} from "@/util/date";
  307. import checkSchedule from "@/components/checkH/checkSchedule.vue";
  308. import {getBvesselsList} from "@/api/iosBasicData/bvessels";
  309. import DocumentCenter from "@/views/iosBasicData/SeafreightExportF/bills/assembly/DocumentCenter.vue";
  310. import businessReports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/businessReports.vue";
  311. import {popupReminder} from "@/util/messageReminder";
  312. import editypes from "@/views/iosBasicData/editypes/index.vue";
  313. import {editypesList} from "@/api/iosBasicData/editypes";
  314. export default {
  315. components:{
  316. checkSchedule,
  317. SearchQuery,
  318. EntrustmentLnformation,
  319. formbottom,
  320. mbinformation,
  321. reports,
  322. edicode,
  323. filescenter,
  324. DistributionBox,
  325. feecenter,
  326. bcorps,
  327. bcorpstypedefine,
  328. SplitList,
  329. TreeSelect,
  330. DocumentCenter,
  331. businessReports,
  332. editypes,
  333. },
  334. props:{
  335. detailData: {
  336. type: Object
  337. }
  338. },
  339. data() {
  340. return {
  341. ediData:[], // edi 列表数据
  342. previewDialog:false, // 预览报表弹窗开启
  343. generateBillsfalse:false, // 如果生成账单就禁用
  344. pleasereviewType:false, // 如果请核就禁用
  345. checkScheduleDialog:false, // 审核弹窗
  346. checkId:'', // 审核需要的id
  347. batchNo:'',
  348. billsListAllData:[], // 分单列表数据
  349. pageLoading:false, // 全屏的动画
  350. saveLoading:false,
  351. // 详情数据
  352. form:{
  353. billDate:dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00', // 单据日期 默认 当天
  354. operatorName:JSON.parse(localStorage.getItem('saber-userInfo')).content.user_name, // OP 默认登录人
  355. operatorId:JSON.parse(localStorage.getItem('saber-userInfo')).content.user_id, // OP 默认登录人
  356. businessType:'SE', // 业务类型 默认 海运出口
  357. billType:'DD', // 单据类型 默认 直单
  358. accDeptName:'',// 核算部门 默认登录人的部门
  359. issueType:'正本', // 签单方式 默认 正本
  360. mpaymode:'PP', // 主单付费方式 默认PP
  361. hpaymode:'PP', // 分单付费方式 默认 PP
  362. loadType:'FCL', // 装箱方式默认整箱
  363. srcType:'OWN', // 业务来源默认公司 来源 内容 默认登录人所属公司
  364. numberOfObl:'THREE', // 正本份数 默认 THREE
  365. numberOfCopy:'ONE', // 副本份数 默认 ONE
  366. seaType:'E', // 进出口 默认出口 E=出口 I=进口"
  367. cargoType:'dry', // 货物类型默认普货
  368. marks:'N/M',
  369. filesList:[], // 文件中心
  370. feeCenterListD:[], // 收
  371. feeCenterListC:[], // 付
  372. preContainersList:[], // 箱
  373. },
  374. // 循环的配置
  375. basicData:{
  376. column:[
  377. {
  378. label: "客户名称", // 调往来单位接口
  379. prop: "corpCnName",
  380. text:"请选择客户名称",
  381. type:'select',
  382. dicData:[],
  383. disabled:false,
  384. buttonIf:true,
  385. slot:'bcorps',
  386. forParameter:{
  387. key:'id',
  388. label:'cnName',
  389. value:'cnName',
  390. },
  391. rules: [{
  392. required: true,
  393. message: " ",
  394. trigger: "blur"
  395. }]
  396. },
  397. [
  398. {
  399. label: "客户OP", // 客户联系人姓名 电话和邮箱带出来,可以修改 往来单位接口 需要传一个客户名称的值过去
  400. prop: "corpAttnName",
  401. text:"姓名",
  402. allowCreate:true,
  403. type:'select',
  404. dicData:[],
  405. span:10,
  406. disabled:true,
  407. forParameter:{
  408. key:'id',
  409. label:'cname',
  410. value:'cname',
  411. },
  412. },
  413. {
  414. label: "", //客户联系人电话
  415. prop: "corpAttnTel",
  416. text:"电话",
  417. labelWidth:'10px',
  418. disabled:true,
  419. span:7,
  420. // rules: [{
  421. // required: true,
  422. // message: "",
  423. // trigger: "blur"
  424. // }]
  425. },
  426. {
  427. label: "", // 客户联系人邮箱
  428. prop: "corpAttnEmail",
  429. text:"邮箱",
  430. labelWidth:'10px',
  431. disabled:true,
  432. span:7,
  433. // rules: [{
  434. // required: true,
  435. // message: " ",
  436. // trigger: "blur"
  437. // }]
  438. },
  439. ],
  440. [
  441. {
  442. label: "业务来源", // OWN=公司 AGENT=代理 SALES=业务员
  443. prop: "srcType",
  444. text:"请选择业务来源",
  445. type:'select',
  446. disabled:true,
  447. forParameter:{
  448. key:'dictKey',
  449. label:'dictValue',
  450. value:'dictKey',
  451. },
  452. dicData:[],
  453. },
  454. {
  455. label: "",
  456. prop: "srcCnName", // 来源中文 公司不是下拉写死公司两字 业务员调用户管理列表 代理调往来单位四个代理数据
  457. text:"请选择来源",
  458. labelWidth:'30px',
  459. type:'select',
  460. disabled:true,
  461. dicData:[],
  462. forParameter:{
  463. key:'id',
  464. label:'cnName',
  465. value:'cnName',
  466. },
  467. },
  468. ],
  469. [
  470. {
  471. label: "MB/L NO",
  472. text:"请输入MB/L NO",
  473. prop: "mblno",
  474. span:19,
  475. disabled:false,
  476. },
  477. {
  478. label: "", // MB/L 付款方式 PP=预付, CC=到付, FPA, Other
  479. text:"请选择付款方式",
  480. prop: "mpaymode",
  481. type:'select',
  482. labelWidth:'30px',
  483. disabled:false,
  484. span:5,
  485. dicData:[],
  486. forParameter:{
  487. key:'dictKey',
  488. label:'dictValue',
  489. value:'dictKey',
  490. },
  491. },
  492. ],
  493. [
  494. {
  495. label: "HB/L NO", //弹窗点击确认还是取消申请 调后台接口获取到一个编号
  496. prop: "HB/L NO",
  497. type:'button',
  498. span:4,
  499. disabled:false,
  500. },
  501. {
  502. label: "",
  503. text:"请输入HB/L NO",
  504. prop: "hblno",
  505. labelWidth:'6px',
  506. span:14,
  507. disabled:true,
  508. },
  509. {
  510. label: "", // HB/L 付款方式 PP=预付, CC=到付, FPA, Other', 申请之后默认 PP
  511. text:"请选择付款方式",
  512. prop: "hpaymode",
  513. labelWidth:'30px',
  514. disabled:false,
  515. type:'select',
  516. span:6,
  517. dicData:[],
  518. forParameter:{
  519. key:'dictKey',
  520. label:'dictValue',
  521. value:'dictKey',
  522. },
  523. },
  524. ],
  525. {
  526. label: "booking NO", // 订舱号
  527. text:"请输入booking NO",
  528. prop: "bookingNo",
  529. disabled:false,
  530. },
  531. {
  532. label: "REF MBLNO", // Co-Loader 中文名称 往来单位 类别
  533. text:"请输入REF MBLNO",
  534. prop: "refno",
  535. disabled:false,
  536. },
  537. [
  538. {
  539. label: "业务编号",
  540. text:"业务编号",
  541. prop: "billNo",
  542. disabled:true,
  543. },
  544. {
  545. label: "所属团队",
  546. text:"请选择所属团队",
  547. prop: "teamId",
  548. disabled:false,
  549. type:'select',
  550. dicData:[],
  551. forParameter:{
  552. key:'id',
  553. label:'postName',
  554. value:'id',
  555. },
  556. rules: [{
  557. required: true,
  558. message: " ",
  559. trigger: "blur"
  560. }]
  561. },
  562. ],
  563. [
  564. {
  565. label: "OP", // 操作id 用户管理下拉 模糊搜索
  566. text:"请选择OP",
  567. prop: "operatorName",
  568. type:'select',
  569. dicData:[],
  570. disabled:false,
  571. forParameter:{
  572. key:'id',
  573. label:'name',
  574. value:'name',
  575. },
  576. rules: [{
  577. required: true,
  578. message: " ",
  579. trigger: "blur"
  580. }]
  581. },
  582. {
  583. label: "核算部门", // 核算部门Id accDept 核算部门 accDeptName 调机构管理接口
  584. text:"请选择核算部门",
  585. prop: "accDeptName",
  586. type:'tree',
  587. dicData:[],
  588. disabled:false,
  589. forParameter:{
  590. label: "title",
  591. children:'children'
  592. },
  593. rules: [{
  594. required: true,
  595. message: " ",
  596. trigger: "blur"
  597. }]
  598. },
  599. ],
  600. ]
  601. },
  602. activeName:'first',
  603. bigtabs:'wt',
  604. saberUserInfo:{}, // 当前登录人信息
  605. roleName:[], // 当前的角色权限
  606. // 需要加判断是否必填的数据
  607. messageData:[
  608. {
  609. name:'客户',
  610. value:'corpCnName',
  611. },
  612. {
  613. name:'业务来源',
  614. value:'srcType',
  615. },
  616. {
  617. name:'MBLNO',
  618. value:'mblno',
  619. },
  620. {
  621. name:'booking NO',
  622. value:'bookingNo',
  623. },
  624. {
  625. name:'REF MBLNO',
  626. value:'refno',
  627. },
  628. {
  629. name:'船名(VSL)',
  630. value:'vesselCnName',
  631. },
  632. {
  633. name:'航次(VOY)',
  634. value:'voyageNo',
  635. },
  636. {
  637. name:'ETD',
  638. value:'etd',
  639. },
  640. {
  641. name:'装货港',
  642. value:'polCnName',
  643. },
  644. {
  645. name:'目的港',
  646. value:'destinationNamePrint',
  647. },
  648. {
  649. name:'包装单位',
  650. value:'packingUnit',
  651. },
  652. {
  653. name:'船公司',
  654. value:'carrierCnName',
  655. },
  656. {
  657. name:'场站',
  658. value:'cyCnName',
  659. },
  660. ],
  661. }
  662. },
  663. watch:{
  664. // 监听业务类型 如果不是分单 可以编辑分单号
  665. 'form.billType':{
  666. // 执行方法
  667. handler(oldValue,newValue) {
  668. // if (oldValue == 'MM') {
  669. // this.form.hblno = ''
  670. // }
  671. // 只有分单不能编辑
  672. if (oldValue == 'MH') {
  673. this.columnforfun('hblno').disabled = true
  674. }else {
  675. this.columnforfun('hblno').disabled = false
  676. }
  677. },
  678. deep: true, // 深度监听
  679. immediate: true // 第一次改变就执行
  680. },
  681. // 监听箱信息数据 箱信息中有温度 自动切换 冻货
  682. 'form.preContainersList':{
  683. // 执行方法
  684. handler(oldValue,newValue) {
  685. // 判断是否是数组
  686. if (oldValue instanceof Array) {
  687. // 循环 有温度反 true 没有反 false
  688. const arr = oldValue.map(item=>{
  689. if (Number(item.temperature)) {
  690. return true
  691. }else {
  692. return false
  693. }
  694. })
  695. // 判断是否有温度
  696. if (arr[0]) {
  697. // 判断之前是否是冻货
  698. if (this.form.cargoType == 'reefer') return
  699. this.$message({
  700. message: '箱信息里有温度已将货描切换为冻柜',
  701. type: 'warning'
  702. });
  703. this.$set(this.form,'cargoType','reefer')
  704. }
  705. }
  706. },
  707. deep: true, // 深度监听
  708. immediate: true // 第一次改变就执行
  709. }
  710. },
  711. created() {
  712. this.saberUserInfo = JSON.parse(localStorage.getItem('saber-userInfo')).content
  713. this.roleName = localStorage.getItem('roleName').split(',')
  714. // 判断是否员id, 有id 就不显示
  715. if (!this.form.id) {
  716. this.deptGetDetailPolfun() // 收货地 装货港 当前登录人的默认
  717. this.userGetListfun(undefined,true) // 获取用户管理数据
  718. }
  719. this.ownDeptLazyTreefun() // 获取公司数据
  720. this.getLazylistfun() // 获取审核数据
  721. this.mpaymodeWorkDictsfun() // 获取 付款方式字典
  722. this.srcTypeWorkDictsfun()
  723. // 获取EDI 数据
  724. this.editypesListfun()
  725. // 获取所属团队数据
  726. this.postSelectByUserfun()
  727. },
  728. methods:{
  729. // 获取EDI列表数据
  730. editypesListfun(){
  731. editypesList(1,30).then(res=>{
  732. this.ediData = res.data.data.records
  733. })
  734. },
  735. // 发送edi
  736. editypesSendingEdifun(row){
  737. row.billId = this.form.id
  738. this.saveLoading = true
  739. editypesSendingEdi(row).then(res=>{
  740. this.saveLoading = false
  741. // 判断data是否有值,没有值说明不成功给个弹窗返回
  742. if (!res.data.data) {
  743. let text = res.data.msg
  744. this.$message({
  745. type:'warning',
  746. dangerouslyUseHTMLString: true,
  747. 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>`,
  748. duration:5000
  749. });
  750. }else {
  751. this.$message.success('操作成功,请去文件中心查看')
  752. this.billsDetailfun(this.form.id) // 详情接口
  753. }
  754. }).catch((err)=>{
  755. this.saveLoading = false
  756. })
  757. },
  758. // 报表弹窗
  759. previewDialogfun(){
  760. this.previewDialog = true
  761. },
  762. //请核关闭
  763. choceScheduleFun() {
  764. this.checkScheduleDialog = false
  765. },
  766. // 收货地 装货港 当前登录人的默认
  767. deptGetDetailPolfun(){
  768. deptGetDetailPol(this.saberUserInfo.dept_pid.split(',')[0]).then(res=>{
  769. // 收货地
  770. this.form.placeReceiptName = res.data.data.polEnName
  771. this.form.placeReceiptId = res.data.data.polId
  772. this.form.placeReceiptCode = res.data.data.polCode
  773. this.form.placeReceiptNamePrint = res.data.data.polEnName
  774. // 装货港
  775. this.form.polCnName = res.data.data.polCnName
  776. this.form.polEnName = res.data.data.polEnName
  777. this.form.polId = res.data.data.polId
  778. this.form.polCode = res.data.data.polCode
  779. this.form.polNamePrint = res.data.data.polEnName
  780. // 签单地点 默认 装货港
  781. this.$set(this.form,'issueAt',this.form.polEnName)
  782. // 主单单付费地点 默认 如果主单付费方式 为PP 取装货港 如果主单付费地点为CC 取卸货港
  783. if (this.form.mpaymode == 'PP') {
  784. this.$set(this.form,'mpayplace',this.form.polEnName)
  785. }
  786. // 分单单付费地点 默认 如果分单付费方式 为PP 取装货港 如果分单付费地点为CC 取卸货港
  787. if (this.form.hpaymode == 'PP') {
  788. this.$set(this.form,'hpayplace',this.form.polEnName)
  789. }
  790. })
  791. },
  792. // 获取用户管理数据
  793. userGetListfun(account = undefined,type = false,){
  794. userGetList(1,10,{account},this.saberUserInfo.dept_pid.split(',')[0]).then(res=>{
  795. this.columnforfun('operatorName').dicData = res.data.data.records
  796. if (type) {
  797. // 核算部门 默认登录人的部门
  798. for (let item of this.columnforfun('operatorName').dicData) {
  799. if (item.name == this.form.operatorName) {
  800. this.$set(this.form,'accDeptName',item.deptName)
  801. this.$set(this.form,'accDeptId',item.deptId)
  802. }
  803. }
  804. }
  805. })
  806. },
  807. // 获取所属岗位数据
  808. postSelectByUserfun(){
  809. postSelectByUser(JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id).then(res=>{
  810. this.columnforfun('teamId').dicData = res.data.data
  811. // 判断是否有值,没有的话默认第一个
  812. if (!this.form.teamId) {
  813. this.$set(this.form,'teamId',res.data.data[0].id)
  814. this.$set(this.form,'teamName',res.data.data[0].postName)
  815. }
  816. })
  817. },
  818. // 获取付款方式字典数据
  819. mpaymodeWorkDictsfun(){
  820. getWorkDicts('payment_method_los').then((res) => {
  821. this.columnforfun('mpaymode').dicData = res.data.data
  822. this.columnforfun('hpaymode').dicData = res.data.data
  823. })
  824. },
  825. // 获取核算部分数据 // 机构管理接口
  826. getLazylistfun(){
  827. getDeptTree().then(res=>{
  828. this.columnforfun('accDeptName').dicData = res.data.data
  829. })
  830. },
  831. // 获取客户名称数据 往来单位数据
  832. getBcorpsListfun(cnName){
  833. getBcorpsList(1,10,{cnName}).then(res=>{
  834. this.columnforfun('corpCnName').dicData = res.data.data.records.map(item=>{
  835. item.cnName = item.cnName + ' - ' + item.shortName
  836. return item
  837. })
  838. })
  839. },
  840. // 获取客户联系人 客户OP
  841. getBcorpsattnListfun(cnName){
  842. getBcorpsattnList(1,10,{pid:this.form.corpId,cnName}).then(res=>{
  843. this.columnforfun('corpAttnName').dicData = res.data.data.records
  844. if(res.data.data.records.length == 0) {
  845. this.form.corpAttnName = ''
  846. this.form.corpAttnId = ''
  847. this.$set(this.form,'corpAttnTel','')
  848. this.$set(this.form,'corpAttnEmail','')
  849. return
  850. }
  851. this.form.corpAttnName = res.data.data.records[0].cname
  852. this.form.corpAttnId = res.data.data.records[0].id
  853. this.$set(this.form,'corpAttnTel',res.data.data.records[0].tel)
  854. this.$set(this.form,'corpAttnEmail',res.data.data.records[0].email)
  855. })
  856. },
  857. // 获取地点信息
  858. getBlocationsListfun(cnName){
  859. getBlocationsList(1,10,{cnName}).then(res=>{
  860. this.columnforfun('mPayplace').dicData = res.data.data.records
  861. })
  862. },
  863. // 获取业务来源数据
  864. srcTypeWorkDictsfun(){
  865. getWorkDicts('src_type_los').then(res=>{
  866. this.columnforfun('srcType').dicData = res.data.data
  867. })
  868. },
  869. // 获取业务来源代理数据
  870. agentBcorpsListfun(cnName){
  871. let corpType = '1712285382575398914,1712285645314990082,1712285842321448962,1712286433378574338'
  872. getBcorpslistByType(1,10,{cnName,corpType}).then(res=>{
  873. this.columnforfun('srcCnName').dicData = res.data.data.records
  874. })
  875. },
  876. // 获取业务来源业务员数据
  877. salesUserGetListfun(account){
  878. userGetList(1,10,{account}).then(res=>{
  879. this.columnforfun('srcCnName').dicData = res.data.data.records
  880. })
  881. },
  882. // 获取公司名称 用户管理左侧
  883. ownDeptLazyTreefun(){
  884. getDeptLazyTree(0).then(res=>{
  885. this.columnforfun('srcCnName').dicData = res.data.data
  886. // 来源 内容 默认登录人所属公司
  887. for(let item of this.columnforfun('srcCnName').dicData) {
  888. if (item.id == JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid.split(',')[0]) {
  889. this.$set(this.form,'srcId',item.id)
  890. this.$set(this.form,'srcCnName',item.title)
  891. this.$set(this.form,'srcEnName',item.title)
  892. }
  893. }
  894. })
  895. },
  896. // 申请B/L NO
  897. billsGetBillNofun(){
  898. let billNoFormat = ''
  899. if (this.form.cargoType == 'dry') {
  900. billNoFormat = 'HYCK-PH'
  901. }else if (this.form.cargoType == 'danger') {
  902. billNoFormat = 'HYCK-WXP'
  903. }else if (this.form.cargoType == 'reefer') {
  904. billNoFormat = 'HYCK-DG'
  905. }else {}
  906. billsGetBillNo({
  907. businessTypeCode:'HYCK',
  908. billNoFormat:billNoFormat
  909. }).then(res=>{
  910. this.columnforfun('hpaymode').disabled = false
  911. this.$set(this.form,'hblno',res.data.data)
  912. this.billsSubmitfun()
  913. })
  914. },
  915. // 下拉多选弹窗的确认
  916. eldialogConfirm(name){
  917. if (name == 'bcorps') {
  918. if (this.$refs.bcorps[0].isShow) {
  919. console.log('列表确认')
  920. this.form.corpCnName = this.$refs.bcorps[0].selectionList[0].cnName
  921. this.form.corpEnName = this.$refs.bcorps[0].selectionList[0].enName
  922. this.form.corpId = this.$refs.bcorps[0].selectionList[0].id
  923. this.form.corpCode = this.$refs.bcorps[0].selectionList[0].code
  924. // 获取 客户op数据
  925. this.getBcorpsattnListfun()
  926. // 业务来源参数带出
  927. this.$set(this.form,'srcType',this.$refs.bcorps[0].selectionList[0].sourceType)
  928. this.$set(this.form,'srcId',this.$refs.bcorps[0].selectionList[0].srcId)
  929. this.$set(this.form,'srcCnName',this.$refs.bcorps[0].selectionList[0].srcCnName)
  930. this.$set(this.form,'srcEnName',this.$refs.bcorps[0].selectionList[0].srcEnName)
  931. this.columnforfun('srcType').disabled = false
  932. this.columnforfun('srcCnName').disabled = false
  933. // 航线带出往来单位的优势航线
  934. this.$set(this.form,'lineCnName',this.$refs.bcorps[0].selectionList[0].advantageRoute)
  935. // 带出发货人数据
  936. this.$set(this.form,'hshipperId',this.$refs.bcorps[0].selectionList[0].id)
  937. this.$set(this.form,'hshipperCnName',this.$refs.bcorps[0].selectionList[0].cnName)
  938. this.$set(this.form,'hshipperEnName',this.$refs.bcorps[0].selectionList[0].enName)
  939. this.$set(this.form,'hshipperCode',this.$refs.bcorps[0].selectionList[0].code)
  940. this.$set(this.form,'hshipperDetails',this.$refs.bcorps[0].selectionList[0].details)
  941. this.$set(this.form,'hshipperCntyName',this.$refs.bcorps[0].selectionList[0].cntyName)
  942. this.$set(this.form,'hshipperCntyCode',this.$refs.bcorps[0].selectionList[0].cntyCode)
  943. }else {
  944. console.log('详情确认')
  945. this.$refs.bcorps[0].$refs.detail.submitForm()
  946. }
  947. }
  948. this.$refs.searchQueryRef[0].corpVisible = false
  949. },
  950. // 下拉多选弹窗数据多选回调
  951. eldialogMultipleChoice(list,name){
  952. if (name == 'bcorps') {
  953. let arr = []
  954. if (list.length > 1) {
  955. this.$refs.bcorps[0].$refs.crud.toggleSelection() // 先清空所以选择的数据
  956. arr = [list[list.length -1]] // 获取最新点击的数组
  957. this.$refs.bcorps[0].$refs.crud.toggleSelection(arr,true) // 把刚点击的数组变成选择状态
  958. }else {
  959. arr = list
  960. }
  961. this.$refs.bcorps[0].selectionList = arr
  962. }else {}
  963. },
  964. /* 远程模糊查询操作用户 */
  965. remoteMethod(value,name) {
  966. if (name == 'operatorName') {
  967. this.userGetListfun(value)
  968. }else if (name == 'accDeptName') {
  969. this.getLazylistfun(value)
  970. }else if (name == 'corpCnName') {
  971. this.getBcorpsListfun(value)
  972. }else if (name == 'mPayplace') {
  973. this.getBlocationsListfun(value)
  974. }else if (name == 'corpAttnName') {
  975. this.getBcorpsattnListfun(value)
  976. }else if (name == 'srcType') {
  977. this.srcTypeWorkDictsfun()
  978. } else if (name == 'srcCnName') {
  979. if (this.form.srcType == 'SALES') {
  980. // 业务员
  981. this.columnforfun('srcCnName').forParameter = { key:'id', label:'name', value:'name'}
  982. this.salesUserGetListfun(value)
  983. }else if (this.form.srcType == 'AGENT') {
  984. // 代理
  985. this.columnforfun('srcCnName').forParameter = { key:'id', label:'cnName', value:'cnName'}
  986. this.agentBcorpsListfun(value)
  987. }else if (this.form.srcType == 'OWN') {
  988. // 公司
  989. this.columnforfun('srcCnName').forParameter = { key:'id', label:'title', value:'title'}
  990. this.ownDeptLazyTreefun()
  991. }else {}
  992. }else if (name == 'teamId') {
  993. this.postSelectByUserfun()
  994. } else {
  995. }
  996. },
  997. // 下拉的监听事件
  998. corpChange(value,name){
  999. if (name == 'operatorName') {
  1000. // OP 下拉赋值 用户管理列表
  1001. for(let item of this.columnforfun('operatorName').dicData) {
  1002. if (item.name == value) {
  1003. this.form.operatorName = item.name
  1004. this.form.operatorId = item.id
  1005. }
  1006. }
  1007. }
  1008. else if (name == 'accDeptName') {
  1009. // OP 下拉赋值 用户管理列表
  1010. for(let item of this.columnforfun('accDeptName').dicData) {
  1011. if (item.title == value) {
  1012. this.form.accDeptName = item.title
  1013. this.form.accDeptId = item.id
  1014. }
  1015. }
  1016. }
  1017. else if (name == 'corpCnName') {
  1018. if (value) {
  1019. this.columnforfun('corpAttnName').disabled = false
  1020. this.columnforfun('corpAttnTel').disabled = false
  1021. this.columnforfun('corpAttnEmail').disabled = false
  1022. }else {
  1023. this.columnforfun('corpAttnName').disabled = true
  1024. this.columnforfun('corpAttnTel').disabled = true
  1025. this.columnforfun('corpAttnEmail').disabled = true
  1026. // 如果点击清空按钮把值赋值为空
  1027. this.form.corpCnName = ''
  1028. this.form.corpEnName = ''
  1029. this.form.corpId = ''
  1030. this.form.corpCode = ''
  1031. // 清空 客户OP
  1032. this.form.corpAttnName = ''
  1033. this.form.corpAttnId = ''
  1034. this.$set(this.form,'corpAttnTel','')
  1035. this.$set(this.form,'corpAttnEmail','')
  1036. // 清空 业务来源和来源详情
  1037. this.$set(this.form,'srcType','')
  1038. this.$set(this.form,'srcId','')
  1039. this.$set(this.form,'srcCnName','')
  1040. this.$set(this.form,'srcEnName','')
  1041. }
  1042. // 往来单位
  1043. for(let item of this.columnforfun('corpCnName').dicData) {
  1044. if (item.cnName == value) {
  1045. this.form.corpCnName = item.cnName
  1046. this.form.corpEnName = item.enName
  1047. this.form.corpId = item.id
  1048. this.form.corpCode = item.code
  1049. // 获取 客户op数据
  1050. this.getBcorpsattnListfun()
  1051. // 业务来源参数带出
  1052. this.$set(this.form,'srcType',item.sourceType)
  1053. this.$set(this.form,'srcId',item.srcId)
  1054. this.$set(this.form,'srcCnName',item.srcCnName)
  1055. this.$set(this.form,'srcEnName',item.srcEnName)
  1056. this.columnforfun('srcType').disabled = false
  1057. this.columnforfun('srcCnName').disabled = false
  1058. // 航线带出往来单位的优势航线
  1059. this.$set(this.form,'lineCnName',item.advantageRoute)
  1060. // 带出发货人数据
  1061. this.$set(this.form,'hshipperId',item.id)
  1062. this.$set(this.form,'hshipperCnName',item.cnName)
  1063. this.$set(this.form,'hshipperEnName',item.enName)
  1064. this.$set(this.form,'hshipperCode',item.code)
  1065. this.$set(this.form,'hshipperDetails',item.details)
  1066. this.$set(this.form,'hshipperCntyName',item.cntyName)
  1067. this.$set(this.form,'hshipperCntyCode',item.cntyCode)
  1068. }
  1069. }
  1070. }
  1071. else if (name == 'corpAttnName') {
  1072. for(let item of this.columnforfun('corpAttnName').dicData) {
  1073. if (item.cname == value) {
  1074. this.form.corpAttnName = item.cname
  1075. this.form.corpAttnId = item.id
  1076. this.$set(this.form,'corpAttnTel',item.tel)
  1077. this.$set(this.form,'corpAttnEmail',item.email)
  1078. }
  1079. }
  1080. }
  1081. else if (name == 'srcType') {
  1082. if (!value) {
  1083. this.$set(this.form,'srcType','')
  1084. // this.columnforfun('srcCnName').disabled = true
  1085. return
  1086. }
  1087. this.$set(this.form,'srcId','')
  1088. this.$set(this.form,'srcCnName','')
  1089. this.$set(this.form,'srcEnName','')
  1090. this.form[name] = value
  1091. if (value == 'OWN') {
  1092. // 公司
  1093. this.columnforfun('srcCnName').forParameter = { key:'id', label:'title', value:'title'}
  1094. this.ownDeptLazyTreefun()
  1095. }else if (value == 'AGENT') {
  1096. // 代理
  1097. this.columnforfun('srcCnName').type = 'select'
  1098. this.columnforfun('srcCnName').forParameter = { key:'id', label:'cnName', value:'cnName'}
  1099. this.columnforfun('srcCnName').disabled = false
  1100. this.agentBcorpsListfun()
  1101. }else if (value == 'SALES') {
  1102. // 业务员
  1103. this.columnforfun('srcCnName').type = 'select'
  1104. this.columnforfun('srcCnName').forParameter = { key:'id', label:'name', value:'name'}
  1105. this.columnforfun('srcCnName').disabled = false
  1106. this.salesUserGetListfun()
  1107. }else {}
  1108. }
  1109. else if (name == 'srcCnName'){
  1110. for(let item of this.columnforfun('srcCnName').dicData) {
  1111. if (item[this.columnforfun('srcCnName').forParameter.value] == value) {
  1112. if (this.form.srcType == 'SALES') {
  1113. // 业务员
  1114. this.$set(this.form,'srcId',item.id)
  1115. this.$set(this.form,'srcCnName',item.name)
  1116. this.$set(this.form,'srcEnName',item.name)
  1117. }else if (this.form.srcType == 'AGENT') {
  1118. // 代理
  1119. this.$set(this.form,'srcId',item.id)
  1120. this.$set(this.form,'srcCnName',item.cnName)
  1121. this.$set(this.form,'srcEnName',item.enName)
  1122. }else {}
  1123. }
  1124. }
  1125. }
  1126. else if (name == 'coloaderCnName') {
  1127. for(let item of this.columnforfun('coloaderCnName').dicData) {
  1128. if (item.cnName == value) {
  1129. this.$set(this.form,'coloaderId',item.id)
  1130. this.$set(this.form,'coloaderCnName',item.cnName)
  1131. this.$set(this.form,'coloaderEnName',item.enName)
  1132. }
  1133. }
  1134. }
  1135. else if (name == 'mpaymode') {
  1136. // 主单付费方式
  1137. this.form[name] = value
  1138. if (value == 'PP') {
  1139. this.$set(this.form,'mpayplace',this.form.polEnName?this.form.polEnName.split(' - ')[0]:'')
  1140. }else {
  1141. this.$set(this.form,'mpayplace',this.form.podEnName?this.form.podEnName.split(' - ')[0]:'')
  1142. }
  1143. }
  1144. else if (name == 'hpaymode') {
  1145. // 分单付费方式
  1146. this.form[name] = value
  1147. if (value == 'PP') {
  1148. this.$set(this.form,'hpayplace',this.form.polEnName.split(' - ')[0])
  1149. }else {
  1150. this.$set(this.form,'hpayplace',this.form.podEnName.split(' - ')[0])
  1151. }
  1152. }
  1153. else if (name == 'teamId') {
  1154. if (!value) {
  1155. this.$set(this.form,'teamId','')
  1156. this.$set(this.form,'teamName','')
  1157. }
  1158. for(let item of this.columnforfun('teamId').dicData) {
  1159. if (item.id == value) {
  1160. this.$set(this.form,'teamId',item.id)
  1161. this.$set(this.form,'teamName',item.postName)
  1162. }
  1163. }
  1164. }
  1165. else {
  1166. this.form[name] = value
  1167. }
  1168. },
  1169. // 申请B/L NO
  1170. applyforfun(text){
  1171. if (!this.form.id) {
  1172. this.$message({
  1173. message: '请先保存数据',
  1174. type: 'warning'
  1175. });
  1176. return
  1177. }
  1178. // 如果不是分单
  1179. if (this.form.billType != 'MH') {
  1180. this.$message({
  1181. message: '只有分单需要申请',
  1182. type: 'warning'
  1183. });
  1184. return
  1185. }
  1186. if (this.form.hblno) {
  1187. this.$message({
  1188. message: 'B/L NO 只能申请一次',
  1189. type: 'warning'
  1190. });
  1191. return
  1192. }
  1193. if (!this.form.businessType) {
  1194. this.$message({
  1195. message: '请先选择业务类型',
  1196. type: 'warning'
  1197. });
  1198. return
  1199. }
  1200. if (!this.form.corpCnName) {
  1201. this.$message({
  1202. message: '请先选择客户名称',
  1203. type: 'warning'
  1204. });
  1205. return
  1206. }
  1207. this.$confirm(`确定${text}?`, {
  1208. confirmButtonText: "确定",
  1209. cancelButtonText: "取消",
  1210. type: "warning"
  1211. }).then(res=>{
  1212. this.billsGetBillNofun()
  1213. })
  1214. },
  1215. // 配置项
  1216. columnforfun(value){
  1217. for(let item of this.basicData.column) {
  1218. if (item instanceof Array) {
  1219. for(let ite of item) {
  1220. if (value == ite.prop) {
  1221. return ite
  1222. }
  1223. }
  1224. }else {
  1225. if (value == item.prop) {
  1226. return item
  1227. }
  1228. }
  1229. }
  1230. },
  1231. //返回列表
  1232. backToList() {
  1233. this.$emit('goBack')
  1234. },
  1235. // 单据请核
  1236. DocumentApproval(){
  1237. if(this.form.billType == 'MH') {
  1238. this.$message.warning('分单不能提交请核')
  1239. return
  1240. }
  1241. if (popupReminder(this.form,this.messageData)){
  1242. this.$confirm(popupReminder(this.form,this.messageData), {
  1243. confirmButtonText: "确定",
  1244. cancelButtonText: "取消",
  1245. type: "warning"
  1246. })
  1247. }
  1248. if (popupReminder(this.form,this.messageData)) {
  1249. return;
  1250. }
  1251. if (this.form.feeCenterListC.length == 0 && this.form.feeCenterListD == 0) {
  1252. return this.$message.warning('请添加费用信息')
  1253. }
  1254. this.$confirm("确定要请核数据?", {
  1255. confirmButtonText: "确定",
  1256. cancelButtonText: "取消",
  1257. type: "warning"
  1258. }).then(()=>{
  1259. this.pageLoading = true
  1260. billsCheckBills({
  1261. id:this.form.id,
  1262. url: '/iosBasicData/SeafreightExportF/bills/approvalDetails',
  1263. pageStatus: "this.$store.getters.approvalDetails",
  1264. pageLabel: "审批详情(F)",
  1265. }).then(res=>{
  1266. this.pageLoading = false
  1267. this.$message({
  1268. type: "success",
  1269. message: "操作成功!"
  1270. });
  1271. // 详情
  1272. this.billsDetailfun(this.form.id)
  1273. }).catch(()=>{
  1274. this.pageLoading = false
  1275. })
  1276. })
  1277. },
  1278. // 撤销单据请核
  1279. revokeDocumentApproval(){
  1280. this.$confirm("确定要撤销请核数据?", {
  1281. confirmButtonText: "确定",
  1282. cancelButtonText: "取消",
  1283. type: "warning"
  1284. }).then(()=>{
  1285. this.pageLoading = true
  1286. billsRevokeCheckBills({
  1287. id:this.form.id
  1288. }).then(res=>{
  1289. this.pageLoading = false
  1290. this.$message({
  1291. type: "success",
  1292. message: "操作成功!"
  1293. });
  1294. // 详情
  1295. this.billsDetailfun(this.form.id)
  1296. })
  1297. })
  1298. },
  1299. // 编辑按钮
  1300. editHandle(){
  1301. this.detailData.seeDisabled = false
  1302. },
  1303. // 大保存按钮
  1304. editCustomer(){
  1305. this.$refs.form.validate((valid)=>{
  1306. if (valid) {
  1307. // 判断必填项
  1308. let sum = '请填写'
  1309. if (!this.form.quantity) {
  1310. sum += ` 件数`
  1311. }
  1312. if (!this.form.packingUnit) {
  1313. sum += ` 包装`
  1314. }
  1315. if (!this.form.grossWeight) {
  1316. sum += ` 毛重`
  1317. }
  1318. if (!this.form.measurement) {
  1319. sum += ` 尺码`
  1320. }
  1321. if (!this.form.etd) {
  1322. sum += ` ETD`
  1323. }
  1324. if (!this.form.teamId) {
  1325. sum += ` 所属团队`
  1326. }
  1327. for (let item of this.form.feeCenterListD) {
  1328. if (!item.corpId) {
  1329. sum += ` 应收序号${item.$index + 1}往来单位`
  1330. }
  1331. if (!item.feeId) {
  1332. sum += ` 应收序号${item.$index + 1}费用简称`
  1333. }
  1334. if (!item.elementsCode) {
  1335. sum += ` 应收序号${item.$index + 1}核算要素`
  1336. }
  1337. if (!item.curCode) {
  1338. sum += ` 应收序号${item.$index + 1}币种`
  1339. }
  1340. }
  1341. for (let item of this.form.feeCenterListC) {
  1342. if (!item.corpId) {
  1343. sum += ` 应付序号${item.$index + 1}往来单位`
  1344. }
  1345. if (!item.feeId) {
  1346. sum += ` 应付序号${item.$index + 1}费用简称`
  1347. }
  1348. if (!item.elementsCode) {
  1349. sum += ` 应付序号${item.$index + 1}核算要素`
  1350. }
  1351. if (!item.curCode) {
  1352. sum += ` 应付序号${item.$index + 1}币种`
  1353. }
  1354. }
  1355. if(sum != '请填写') {
  1356. this.$confirm(sum, {
  1357. confirmButtonText: "确定",
  1358. cancelButtonText: "取消",
  1359. type: "warning"
  1360. })
  1361. return;
  1362. }
  1363. // 赋值 ETD 日期
  1364. this.form.billDate = this.form.etd?this.form.etd.slice(0,10) + ' 00:00:00':null // 单据日期
  1365. // 调用保存接口
  1366. this.billsSubmitfun()
  1367. }
  1368. })
  1369. },
  1370. // 主表保存接口大保存
  1371. billsSubmitfun(){
  1372. if (this.form.cargoType == 'dry') {
  1373. // 普货
  1374. this.form.billNoFormat = 'HYCK-PH'
  1375. }else if (this.form.cargoType == 'danger'){
  1376. // 危险品
  1377. this.form.billNoFormat = 'HYCK-WXP'
  1378. }else if (this.form.cargoType == 'reefer') {
  1379. // 冻柜
  1380. this.form.billNoFormat = 'HYCK-DG'
  1381. }else {
  1382. this.form.billNoFormat = 'HYCK'
  1383. }
  1384. this.form.businessTypeCode = 'HYCK'
  1385. // 把拼接的数据拆开 开始 🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒
  1386. this.searchSplit()
  1387. // 把拼接的数据拆开 结束 💩💩💩💩💩💩💩💩💩💩💩💩💩💩
  1388. // 费用 收 赋值数据
  1389. this.form.feeCenterListD.map((row,index)=>{
  1390. row.dc = 'D'
  1391. row.sort = Number(index) + 1
  1392. row.businessType = this.form.businessType // 业务类型
  1393. row.billType = this.form.billType // 单据类型
  1394. row.billNo = this.form.billNo // 单据编号
  1395. row.billDate = this.form.billDate
  1396. row.billCorpId = this.form.corpId // 主表客户 id
  1397. row.billCorpCnName = this.form.corpCnName // 主表客户中文名称
  1398. row.billCorpEnName = this.form.corpEnName // 主表客户英文名称
  1399. row.lineId = this.form.lineId // 航线 id
  1400. row.lineCnName = this.form.lineCnName // 航线中文名称
  1401. row.lineEnName = this.form.lineEnName // 航线英文名称
  1402. row.vesselId = this.form.vesselId // 船名 id
  1403. row.vesselCnName = this.form.vesselCnName // 中文船名
  1404. row.vesselEnName = this.form.vesselEnName // 英文船名
  1405. row.voyageNo = this.form.voyageNo // 航次
  1406. row.mblno = this.form.mblno // MB/L NO
  1407. row.hblno = this.form.hblno // HB/L NO
  1408. row.etd = this.form.etd // 开船日期
  1409. row.eta = this.form.eta // 到港日期
  1410. row.polId = this.form.polId // 装货港 id
  1411. row.polCode = this.form.polCode // 装货港代码
  1412. row.polCnName = this.form.polCnName // 装货港中文名称
  1413. row.polEnName = this.form.polEnName // 装货港英文名称
  1414. row.podId = this.form.podId // 卸货港 id
  1415. row.podCode = this.form.podCode // 卸货港代码
  1416. row.podCnName = this.form.podCnName // 卸货港中文名称
  1417. row.podEnName = this.form.podEnName // 卸货港英文名称
  1418. row.corpArgreementNo = this.form.corpArgreementNo // 客户约号
  1419. // 数量 * 单价 = 净额
  1420. // 总税率 = 税率 + 附件税率
  1421. // 税额 = 净额 * 总税率
  1422. // 含税
  1423. if (row.curCode == 'CNY') {
  1424. row.amount = row.rmbAmount?row.rmbAmount:(Number(row.quantity) * Number(row.price)).toFixed(2)
  1425. }else {
  1426. row.amount = row.usdAmount?row.usdAmount:(Number(row.quantity) * Number(row.price)).toFixed(2)
  1427. }
  1428. // 净额
  1429. if (row.curCode == 'CNY') {
  1430. row.amountNet = row.rmbAmountNet?row.rmbAmountNet:(Number(row.quantity) * Number(row.price)).toFixed(2)
  1431. }else {
  1432. row.amountNet = row.usdAmountNet?row.usdAmountNet:(Number(row.quantity) * Number(row.price)).toFixed(2)
  1433. }
  1434. })
  1435. // 费用 付 赋值数据
  1436. this.form.feeCenterListC.map((row,index)=>{
  1437. row.dc = 'C'
  1438. row.sort = Number(index) + 1
  1439. row.businessType = this.form.businessType // 业务类型
  1440. row.billType = this.form.billType // 单据类型
  1441. row.billNo = this.form.billNo // 单据编号
  1442. row.billDate = this.form.billDate // 单据日期
  1443. row.billCorpId = this.form.corpId // 主表客户 id
  1444. row.billCorpCnName = this.form.corpCnName // 主表客户中文名称
  1445. row.billCorpEnName = this.form.corpEnName // 主表客户英文名称
  1446. row.lineId = this.form.lineId // 航线 id
  1447. row.lineCnName = this.form.lineCnName // 航线中文名称
  1448. row.lineEnName = this.form.lineEnName // 航线英文名称
  1449. row.vesselId = this.form.vesselId // 船名 id
  1450. row.vesselCnName = this.form.vesselCnName // 中文船名
  1451. row.vesselEnName = this.form.vesselEnName // 英文船名
  1452. row.voyageNo = this.form.voyageNo // 航次
  1453. row.mblno = this.form.mblno // MB/L NO
  1454. row.hblno = this.form.hblno // HB/L NO
  1455. row.etd = this.form.etd // 开船日期
  1456. row.eta = this.form.eta // 到港日期
  1457. row.polId = this.form.polId // 装货港 id
  1458. row.polCode = this.form.polCode // 装货港代码
  1459. row.polCnName = this.form.polCnName // 装货港中文名称
  1460. row.polEnName = this.form.polEnName // 装货港英文名称
  1461. row.podId = this.form.podId // 卸货港 id
  1462. row.podCode = this.form.podCode // 卸货港代码
  1463. row.podCnName = this.form.podCnName // 卸货港中文名称
  1464. row.podEnName = this.form.podEnName // 卸货港英文名称
  1465. row.corpArgreementNo = this.form.corpArgreementNo // 客户约号
  1466. // 数量 * 单价 = 净额
  1467. // 总税率 = 税率 + 附件税率
  1468. // 税额 = 净额 * 总税率
  1469. // 含税
  1470. if (row.curCode == 'CNY') {
  1471. row.amount = row.rmbAmount?row.rmbAmount:(Number(row.quantity) * Number(row.price)).toFixed(2)
  1472. }else {
  1473. row.amount = row.usdAmount?row.usdAmount:(Number(row.quantity) * Number(row.price)).toFixed(2)
  1474. }
  1475. // 净额
  1476. if (row.curCode == 'CNY') {
  1477. row.amountNet = row.rmbAmountNet?row.rmbAmountNet:(Number(row.quantity) * Number(row.price)).toFixed(2)
  1478. }else {
  1479. row.amountNet = row.usdAmountNet?row.usdAmountNet:(Number(row.quantity) * Number(row.price)).toFixed(2)
  1480. }
  1481. })
  1482. this.pageLoading = true
  1483. billsSubmit(this.form).then(res=>{
  1484. this.pageLoading = false
  1485. this.$message({
  1486. type: "success",
  1487. message: "操作成功!"
  1488. });
  1489. // this.detailData.seeDisabled = true
  1490. this.billsDetailfun(res.data.data.id)
  1491. }).catch(err=>{
  1492. this.pageLoading = false
  1493. })
  1494. },
  1495. // 复制单据接口
  1496. billsCopyBillsfun(id){
  1497. billsCopyBills({id}).then(res=>{
  1498. this.form = res.data.data;
  1499. this.pageLoading = false
  1500. this.searchMontage() // 下拉 中文名称和编号拼接
  1501. // 配箱最上面可以编辑
  1502. for(let item of this.form.containersList) {
  1503. item.edit = false
  1504. }
  1505. // 先把状态改成可以编辑,然后判断是否可以编辑
  1506. this.generateBillsfalse = false
  1507. // 应收
  1508. for(let item of this.form.feeCenterListD) {
  1509. // 判断是否生成了账单
  1510. if (item.accStatus == 1) {
  1511. this.columnforfun('corpCnName').disabled = true
  1512. this.columnforfun('srcType').disabled = true
  1513. this.columnforfun('mblno').disabled = true
  1514. this.columnforfun('bookingNo').disabled = true
  1515. this.columnforfun('refno').disabled = true
  1516. this.generateBillsfalse = true
  1517. }
  1518. if (item.curCode == 'CNY') {
  1519. this.$set(item,'rmbAmount',item.amount)
  1520. this.$set(item,'usdAmount','')
  1521. this.$set(item,'rmbAmountNet',item.amountNet)
  1522. this.$set(item,'usdAmountNet','')
  1523. }else {
  1524. this.$set(item,'usdAmount',item.amount)
  1525. this.$set(item,'rmbAmount','')
  1526. this.$set(item,'usdAmountNet',item.amountNet)
  1527. this.$set(item,'rmbAmountNet','')
  1528. }
  1529. item.edit = false
  1530. }
  1531. // 应付
  1532. for(let item of this.form.feeCenterListC) {
  1533. // 判断是否生成了账单
  1534. if (item.accStatus == 1) {
  1535. this.generateBillsfalse = true
  1536. this.columnforfun('corpCnName').disabled = true
  1537. this.columnforfun('srcType').disabled = true
  1538. this.columnforfun('mblno').disabled = true
  1539. this.columnforfun('bookingNo').disabled = true
  1540. this.columnforfun('refno').disabled = true
  1541. }
  1542. if (item.curCode == 'CNY') {
  1543. this.$set(item,'rmbAmount',item.amount)
  1544. this.$set(item,'usdAmount','')
  1545. this.$set(item,'rmbAmountNet',item.amountNet)
  1546. this.$set(item,'usdAmountNet','')
  1547. }else {
  1548. this.$set(item,'usdAmount',item.amount)
  1549. this.$set(item,'rmbAmount','')
  1550. this.$set(item,'usdAmountNet',item.amountNet)
  1551. this.$set(item,'rmbAmountNet','')
  1552. }
  1553. item.edit = false
  1554. }
  1555. // 文件中心
  1556. for(let item of this.form.filesList) {
  1557. this.$set(item,'edit',false)
  1558. }
  1559. })
  1560. },
  1561. // 详情接口
  1562. async billsDetailfun(id){
  1563. const res = await billsDetail(id)
  1564. this.form = res.data.data;
  1565. // 如果已经请核就禁用按钮
  1566. // if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
  1567. // this.detailData.seeDisabled = true
  1568. // }else {
  1569. // this.detailData.seeDisabled = false
  1570. // }
  1571. if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
  1572. this.columnforfun('corpCnName').disabled = true
  1573. this.columnforfun('srcType').disabled = true
  1574. this.columnforfun('mblno').disabled = true
  1575. this.columnforfun('bookingNo').disabled = true
  1576. this.columnforfun('refno').disabled = true
  1577. this.columnforfun('teamId').disabled = true
  1578. this.generateBillsfalse = true
  1579. this.pleasereviewType = true // 请核禁用
  1580. }else {
  1581. // 判断是否可以编辑
  1582. this.columnforfun('corpCnName').disabled = false
  1583. this.columnforfun('srcType').disabled = false
  1584. this.columnforfun('mblno').disabled = false
  1585. this.columnforfun('bookingNo').disabled = false
  1586. this.columnforfun('refno').disabled = false
  1587. this.columnforfun('teamId').disabled = false
  1588. this.generateBillsfalse = false
  1589. this.pleasereviewType = false
  1590. }
  1591. this.pageLoading = false
  1592. this.searchMontage() // 下拉 中文名称和编号拼接
  1593. // 配箱最上面可以编辑
  1594. for(let item of this.form.containersList) {
  1595. item.edit = false
  1596. }
  1597. // 配箱最下面的
  1598. for(let item of this.form.waitingBoxList) {
  1599. this.$set(item,'editQuantity',item.quantity)
  1600. this.$set(item,'editGrossWeight',item.grossWeight)
  1601. this.$set(item,'editMeasurement',item.measurement)
  1602. this.$set(item,'edit',false)
  1603. }
  1604. // 应收
  1605. for(let item of this.form.feeCenterListD) {
  1606. // 判断是否生成了账单
  1607. if (item.accStatus == 1) {
  1608. this.columnforfun('corpCnName').disabled = true
  1609. this.columnforfun('srcType').disabled = true
  1610. this.columnforfun('mblno').disabled = true
  1611. this.columnforfun('bookingNo').disabled = true
  1612. this.columnforfun('refno').disabled = true
  1613. this.columnforfun('teamId').disabled = true
  1614. this.generateBillsfalse = true
  1615. }
  1616. if (item.curCode == 'CNY') {
  1617. this.$set(item,'rmbAmount',item.amount)
  1618. this.$set(item,'usdAmount','')
  1619. this.$set(item,'rmbAmountNet',item.amountNet)
  1620. this.$set(item,'usdAmountNet','')
  1621. }else {
  1622. this.$set(item,'usdAmount',item.amount)
  1623. this.$set(item,'rmbAmount','')
  1624. this.$set(item,'usdAmountNet',item.amountNet)
  1625. this.$set(item,'rmbAmountNet','')
  1626. }
  1627. item.edit = false
  1628. }
  1629. // 应付
  1630. for(let item of this.form.feeCenterListC) {
  1631. // 判断是否生成了账单
  1632. if (item.accStatus == 1) {
  1633. this.generateBillsfalse = true
  1634. this.columnforfun('corpCnName').disabled = true
  1635. this.columnforfun('srcType').disabled = true
  1636. this.columnforfun('mblno').disabled = true
  1637. this.columnforfun('bookingNo').disabled = true
  1638. this.columnforfun('refno').disabled = true
  1639. this.columnforfun('teamId').disabled = true
  1640. }
  1641. if (item.curCode == 'CNY') {
  1642. this.$set(item,'rmbAmount',item.amount)
  1643. this.$set(item,'usdAmount','')
  1644. this.$set(item,'rmbAmountNet',item.amountNet)
  1645. this.$set(item,'usdAmountNet','')
  1646. }else {
  1647. this.$set(item,'usdAmount',item.amount)
  1648. this.$set(item,'rmbAmount','')
  1649. this.$set(item,'usdAmountNet',item.amountNet)
  1650. this.$set(item,'rmbAmountNet','')
  1651. }
  1652. item.edit = false
  1653. }
  1654. // 文件中心
  1655. for(let item of this.form.filesList) {
  1656. this.$set(item,'edit',false)
  1657. }
  1658. },
  1659. // tbas切换
  1660. handleClick(tba,event) {
  1661. },
  1662. // 大tbas切换
  1663. bigHandleClick(){
  1664. if (this.bigtabs == 'fd') {
  1665. if (this.form.id) {
  1666. this.billsListAllfun(this.form.id)
  1667. }
  1668. }
  1669. if (this.bigtabs == 'dz') {
  1670. if (this.form.id) {
  1671. this.$refs.documentCenter.reportslogListfun({currentPage:1,pageSize:10})
  1672. }
  1673. }
  1674. },
  1675. // 获取不分页的分单列表
  1676. billsListAllfun(masterId){
  1677. billsListAll({masterId}).then(res=>{
  1678. this.billsListAllData = res.data.data
  1679. })
  1680. },
  1681. // 下拉 把拼接的拆分
  1682. searchSplit(){
  1683. // 发货人
  1684. if (this.form.hshipperCnName) {
  1685. this.form.hshipperCnName = this.form.hshipperCnName.split(' - ')[0]
  1686. }
  1687. // 收货人
  1688. if (this.form.hconsigneeCnName) {
  1689. this.form.hconsigneeCnName = this.form.hconsigneeCnName.split(' - ')[0]
  1690. }
  1691. // 通知人
  1692. if (this.form.hnotifyCnName) {
  1693. this.form.hnotifyCnName = this.form.hnotifyCnName.split(' - ')[0]
  1694. }
  1695. // 第二通知人
  1696. if (this.form.hnotify2CnName) {
  1697. this.form.hnotify2CnName = this.form.hnotify2CnName.split(' - ')[0]
  1698. }
  1699. // COLOADER
  1700. if (this.form.coloaderCnName) {
  1701. this.form.coloaderCnName = this.form.coloaderCnName.split(' - ')[0]
  1702. }
  1703. // 船公司
  1704. if (this.form.carrierCnName) {
  1705. this.form.carrierCnName = this.form.carrierCnName.split(' - ')[0]
  1706. }
  1707. // 收货地
  1708. if (this.form.placeReceiptName) {
  1709. this.form.placeReceiptName = this.form.placeReceiptName.split(' - ')[0]
  1710. this.form.placeReceiptNamePrint = this.form.placeReceiptNamePrint.split(' - ')[0]
  1711. }
  1712. // 装货港
  1713. if (this.form.polEnName) {
  1714. this.form.polEnName = this.form.polEnName.split(' - ')[0]
  1715. this.form.polNamePrint = this.form.polNamePrint.split(' - ')[0]
  1716. }
  1717. // 卸货港
  1718. if (this.form.podEnName) {
  1719. this.form.podEnName = this.form.podEnName.split(' - ')[0]
  1720. this.form.podNamePrint = this.form.podNamePrint.split(' - ')[0]
  1721. }
  1722. // 目的地
  1723. if (this.form.destinationName) {
  1724. this.form.destinationName = this.form.destinationName.split(' - ')[0]
  1725. this.form.destinationNamePrint = this.form.destinationNamePrint.split(' - ')[0]
  1726. }
  1727. // 交货地
  1728. if (this.form.placeDeliveryName) {
  1729. this.form.placeDeliveryName = this.form.placeDeliveryName.split(' - ')[0]
  1730. this.form.placeDeliveryNamePrint = this.form.placeDeliveryNamePrint.split(' - ')[0]
  1731. }
  1732. // 中转港
  1733. if (this.form.potEnName) {
  1734. this.form.potEnName = this.form.potEnName.split(' - ')[0]
  1735. this.form.potNamePrint = this.form.potNamePrint.split(' - ')[0]
  1736. }
  1737. // 船名
  1738. if (this.form.vesselCnName) {
  1739. this.form.vesselCnName = this.form.vesselCnName.split(' - ')[0]
  1740. }
  1741. // 客户名称
  1742. if (this.form.corpCnName) {
  1743. this.form.corpCnName = this.form.corpCnName.split(' - ')[0]
  1744. }
  1745. },
  1746. // 下拉 中文名称和编号拼接
  1747. searchMontage(){
  1748. // 发货人
  1749. if (this.form.hshipperCnName) {
  1750. this.form.hshipperCnName = this.form.hshipperCnName + ' - ' + this.form.hshipperCode
  1751. }
  1752. // 收货人
  1753. if (this.form.hconsigneeCnName) {
  1754. this.form.hconsigneeCnName = this.form.hconsigneeCnName + ' - ' + this.form.hconsigneeCode
  1755. }
  1756. // 通知人
  1757. if (this.form.hnotifyCnName) {
  1758. this.form.hnotifyCnName = this.form.hnotifyCnName + ' - ' + this.form.hnotifyCode
  1759. }
  1760. // 第二通知人
  1761. if (this.form.hnotify2CnName) {
  1762. this.form.hnotify2CnName = this.form.hnotify2CnName + ' - ' + this.form.hnotify2Code
  1763. }
  1764. // COLOADER
  1765. if (this.form.coloaderCnName) {
  1766. let corpType = '1712285382575398914,1712285645314990082,1712285842321448962,1712286433378574338'
  1767. getBcorpslistByType(1,10,{cnName:this.form.coloaderCnName,corpType}).then(res=>{
  1768. this.form.coloaderCnName = this.form.coloaderCnName + ' - ' + res.data.data.records[0].code
  1769. })
  1770. }
  1771. // 船公司
  1772. if (this.form.carrierCnName) {
  1773. let corpType = '1712286570540703745'
  1774. getBcorpslistByType(1,10,{cnName:this.form.carrierCnName,corpType}).then(res=>{
  1775. this.form.carrierCnName = this.form.carrierCnName + ' - ' + res.data.data.records[0].code
  1776. })
  1777. // this.form.carrierCnName = this.form.carrierCnName + ' - ' + this.form.carrierCode
  1778. }
  1779. // 收货地
  1780. if (this.form.placeReceiptName) {
  1781. this.form.placeReceiptName = this.form.placeReceiptName + ' - ' + this.form.placeReceiptCode
  1782. this.form.placeReceiptNamePrint = this.form.placeReceiptNamePrint + ' - ' + this.form.placeReceiptCode
  1783. }
  1784. // 装货港
  1785. if (this.form.polEnName) {
  1786. this.form.polEnName = this.form.polEnName + ' - ' + this.form.polCode
  1787. this.form.polNamePrint = this.form.polNamePrint + ' - ' + this.form.polCode
  1788. }
  1789. // 卸货港
  1790. if (this.form.podEnName) {
  1791. this.form.podEnName = this.form.podEnName + ' - ' + this.form.podCode
  1792. this.form.podNamePrint = this.form.podNamePrint + ' - ' + this.form.podCode
  1793. }
  1794. // 目的地
  1795. if (this.form.destinationName) {
  1796. this.form.destinationName = this.form.destinationName + ' - ' + this.form.destinationCode
  1797. this.form.destinationNamePrint = this.form.destinationNamePrint + ' - ' + this.form.destinationCode
  1798. }
  1799. // 交货地
  1800. if (this.form.placeDeliveryName) {
  1801. this.form.placeDeliveryName = this.form.placeDeliveryName + ' - ' + this.form.placeDeliveryCode
  1802. this.form.placeDeliveryNamePrint = this.form.placeDeliveryNamePrint + ' - ' + this.form.placeDeliveryCode
  1803. }
  1804. // 中转港
  1805. if (this.form.potEnName) {
  1806. this.form.potEnName = this.form.potEnName + ' - ' + this.form.potCode
  1807. this.form.potNamePrint = this.form.potNamePrint + ' - ' + this.form.potCode
  1808. }
  1809. // 船名
  1810. if (this.form.vesselCnName) {
  1811. getBvesselsList(1,10,{cnName:this.form.vesselCnName}).then(res=>{
  1812. this.form.vesselCnName = this.form.vesselCnName + ' - ' + res.data.data.records[0].code
  1813. })
  1814. }
  1815. // 客户名称
  1816. if (this.form.corpCnName) {
  1817. getBcorpslistByType(1,10,{cnName:this.form.corpCnName}).then(res=>{
  1818. this.form.corpCnName = this.form.corpCnName + ' - ' + res.data.data.records[0].shortName
  1819. })
  1820. }
  1821. },
  1822. },
  1823. }
  1824. </script>
  1825. <style scoped>
  1826. .borderless {
  1827. height: 100%;
  1828. box-sizing: border-box
  1829. }
  1830. .customer-main {
  1831. margin-bottom: 15px;
  1832. }
  1833. .demo-ruleForm {
  1834. font-size: 14px;
  1835. }
  1836. .margintop {
  1837. margin-top: 10px;
  1838. }
  1839. ::v-deep.el-form-item {
  1840. margin-bottom: 0;
  1841. }
  1842. .isShow {
  1843. display: none;
  1844. }
  1845. </style>