billsDetails.vue 93 KB

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