billsDetails.vue 93 KB

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