billsDetails.vue 92 KB

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