billsDetails.vue 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
  6. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  7. @click="backToList">返回列表
  8. </el-button>
  9. </div>
  10. <div class="add-customer-btn">
  11. <el-button size="small" type="primary" style="margin-right: 8px" v-if="detailData.seeDisabled"
  12. :loading="saveLoading" @click="editHandle">编 辑
  13. </el-button>
  14. <el-button size="small" type="primary" style="margin-right: 8px" v-else
  15. :loading="saveLoading" @click="editCustomer">保 存
  16. </el-button>
  17. </div>
  18. </div>
  19. <div style="margin-top: 65px">
  20. <el-tabs type="border-card" v-model="bigtabs" @tab-click="bigHandleClick">
  21. <el-tab-pane label="委托信息" name="wt">
  22. <div>
  23. <div>
  24. <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm">
  25. <containerTitle title="基础资料"></containerTitle>
  26. <basic-container :showBtn="true">
  27. <el-row :gutter="60">
  28. <el-col v-for="(item, index) in basicData.column" :key="index" :span="8">
  29. <!--数组-->
  30. <div v-if="item instanceof Array" style="display: flex;align-items: center;justify-content: space-between">
  31. <el-row>
  32. <el-col :span="item[0].span?item[0].span:12">
  33. <el-form-item :label="item[0].label" :prop="item[0].prop" :rules="item[0].rules"
  34. :label-width="item[0].labelWidth">
  35. <span slot="label" v-if="item[0].label">
  36. <span style="color: #1e9fff">{{item[0].label}}</span>
  37. </span>
  38. <!--<div v-if="item[0].type == 'button'" style="width: 100%;background: #1eff11" class="buttomBlNO">-->
  39. <!--</div>-->
  40. <el-button v-if="item[0].type == 'button'" :disabled="item[0].disabled"
  41. size="small" type="success" icon="el-icon-edit" circle @click="applyforfun(item[0].label)" >
  42. </el-button>
  43. <search-query v-else-if="item[0].type == 'select'"
  44. :datalist="item[0].dicData"
  45. :selectValue="form[item[0].prop]"
  46. :filterable="true"
  47. :clearable="true"
  48. :remote="true"
  49. :disabled="detailData.seeDisabled || item[0].disabled"
  50. :buttonIf="false"
  51. :forParameter="item[0].forParameter"
  52. @remoteMethod="remoteMethod($event,item[0].prop)"
  53. @corpChange="corpChange($event,item[0].prop)"
  54. @corpFocus="remoteMethod($event,item[0].prop)" >
  55. </search-query>
  56. <el-input v-else type="age" style="width: 100%;" v-model="form[item[0].prop]"
  57. size="small" autocomplete="off"
  58. :disabled="detailData.seeDisabled || item[0].disabled"
  59. clearable :placeholder="'请输入' + item[0].label" ></el-input>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :span="item[1].span?item[1].span:12">
  63. <el-form-item :label="item[1].label" :prop="item[1].prop" :rules="item[1].rules"
  64. :label-width="item[1].labelWidth">
  65. <span slot="label" v-if="item[1].label">
  66. <span style="color: #1e9fff">{{item[1].label}}</span>
  67. </span>
  68. <el-date-picker v-if="item[1].type == 'date'"
  69. v-model="form[item[1].prop]" clearable style="width: 100%;"
  70. type="date" size="small" :disabled="detailData.seeDisabled || item[1].disabled"
  71. value-format="yyyy-MM-dd HH:mm:ss"
  72. placeholder="选择日期">
  73. </el-date-picker>
  74. <search-query v-else-if="item[1].type == 'select'"
  75. :datalist="item[1].dicData"
  76. :selectValue="form[item[1].prop]"
  77. :filterable="true"
  78. :clearable="true"
  79. :remote="true"
  80. :disabled="detailData.seeDisabled || item[1].disabled"
  81. :buttonIf="false"
  82. :forParameter="item[1].forParameter"
  83. @remoteMethod="remoteMethod($event,item[1].prop)"
  84. @corpChange="corpChange($event,item[1].prop)"
  85. @corpFocus="remoteMethod($event,item[1].prop)" >
  86. </search-query>
  87. <tree-select v-else-if="item[1].type == 'tree'"
  88. v-model="form[item[1].prop]" filterable
  89. :data="item[1].dicData"
  90. :props="item[1].forParameter"
  91. nodeKey="title"
  92. size="small"
  93. :disabled="detailData.seeDisabled || item[1].disabled"
  94. :multiple="false"
  95. @input="corpChange($event,item[1].prop)">
  96. </tree-select>
  97. <el-input v-else type="age" style="width: 100%;" v-model="form[item[1].prop]"
  98. size="small" autocomplete="off"
  99. :disabled="detailData.seeDisabled || item[1].disabled"
  100. clearable :placeholder="'请输入' + item[1].label" ></el-input>
  101. </el-form-item>
  102. </el-col>
  103. <el-col v-if="item[2]" :span="item[2].span?item[2].span:12">
  104. <el-form-item :label="item[2].label" :prop="item[2].prop" :rules="item[2].rules"
  105. :label-width="item[2].labelWidth">
  106. <span slot="label" v-if="item[2].label">
  107. <span style="color: #1e9fff">{{item[2].label}}</span>
  108. </span>
  109. <search-query v-if="item[2].type == 'select'"
  110. :datalist="item[2].dicData"
  111. :selectValue="form[item[2].prop]"
  112. :filterable="true"
  113. :clearable="true"
  114. :remote="true"
  115. :disabled="detailData.seeDisabled || item[2].disabled"
  116. :buttonIf="false"
  117. :forParameter="item[1].forParameter"
  118. @remoteMethod="remoteMethod($event,item[2].prop)"
  119. @corpChange="corpChange($event,item[2].prop)"
  120. @corpFocus="remoteMethod($event,item[2].prop)" >
  121. </search-query>
  122. <el-input v-else type="age" style="width: 100%;" v-model="form[item[2].prop]"
  123. size="small" autocomplete="off"
  124. :disabled="detailData.seeDisabled || item[1].disabled"
  125. clearable :placeholder="'请输入' + item[2].label" ></el-input>
  126. </el-form-item>
  127. </el-col>
  128. </el-row>
  129. </div>
  130. <!--对象-->
  131. <div v-else>
  132. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  133. <span slot="label" v-if="item.label">
  134. <span style="color: #1e9fff">{{item.label}}</span>
  135. </span>
  136. <search-query v-if="item.type == 'select'"
  137. :datalist="item.dicData"
  138. :selectValue="form[item.prop]"
  139. :filterable="true"
  140. :clearable="true"
  141. :remote="true"
  142. :disabled="detailData.seeDisabled || item.disabled"
  143. :buttonIf="item.buttonIf"
  144. :forParameter="item.forParameter"
  145. @remoteMethod="remoteMethod($event,item.prop)"
  146. @corpChange="corpChange($event,item.prop)"
  147. @corpFocus="remoteMethod($event,item.prop)">
  148. <bcorps v-if="item.slot == 'bcorps'"></bcorps>
  149. <bcorpstypedefine v-if="item.slot == 'bcorpstypedefine'"></bcorpstypedefine>
  150. </search-query>
  151. <el-input v-else type="age" style="width: 100%;" v-model="form[item.prop]"
  152. size="small" autocomplete="off"
  153. :disabled="detailData.seeDisabled || item.disabled"
  154. clearable :placeholder="'请输入' + item.label" ></el-input>
  155. </el-form-item>
  156. </div>
  157. </el-col>
  158. </el-row>
  159. </basic-container>
  160. </el-form>
  161. </div>
  162. <div class="customer-main margintop">
  163. <containerTitle title="详细"></containerTitle>
  164. <basic-container :showBtn="true">
  165. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  166. <el-tab-pane label="委托详情" name="first">
  167. <entrustment-lnformation :assemblyForm="form" :detailData="detailData" @billsDetailfun="billsDetailfun(form.id)"></entrustment-lnformation>
  168. </el-tab-pane>
  169. <el-tab-pane label="配箱处理" name="second">
  170. <DistributionBox :assemblyForm="form" :detailData="detailData" @billsDetailfun="billsDetailfun(form.id)"></DistributionBox>
  171. </el-tab-pane>
  172. <el-tab-pane label="MB/L信息" name="third">
  173. <mbinformation :assemblyForm="form" :detailData="detailData"></mbinformation>
  174. </el-tab-pane>
  175. <el-tab-pane label="单证中心" name="fourth">单证中心</el-tab-pane>
  176. <!--<el-tab-pane label="费用" name="fifth">-->
  177. <!-- <feecenter :assemblyForm="form" :pid="form.id"-->
  178. <!-- @billsDetailfun="billsDetailfun(form.id)"></feecenter>-->
  179. <!--</el-tab-pane>-->
  180. <el-tab-pane label="EDI CODE" name="sixth">
  181. <edicode :assemblyForm="form" :detailData="detailData"></edicode>
  182. </el-tab-pane>
  183. <el-tab-pane label="文件中心" name="seventh">
  184. <filescenter :assemblyForm="form" :detailData="detailData"></filescenter>
  185. </el-tab-pane>
  186. <!--<el-tab-pane label="分单列表" name="eighth">-->
  187. <!-- <Split-list :detailData="detailData" :assemblyForm="form"-->
  188. <!-- :data="billsListAllData"-->
  189. <!-- @billsListAllfun="billsListAllfun(this.form.id)"></Split-list>-->
  190. <!--</el-tab-pane>-->
  191. </el-tabs>
  192. </basic-container>
  193. <basic-container :showBtn="true" v-if="activeName == 'first' || activeName == 'third'">
  194. <formbottom :assemblyForm="form" :detailData="detailData"></formbottom>
  195. </basic-container>
  196. </div>
  197. </div>
  198. </el-tab-pane>
  199. <el-tab-pane label="费用信息" name="fy">
  200. <feecenter :assemblyForm="form" :detailData="detailData" :pid="form.id" @billsDetailfun="billsDetailfun(form.id)"></feecenter>
  201. </el-tab-pane>
  202. <el-tab-pane label="分单列表" name="fd">
  203. <Split-list :detailData="detailData" :assemblyForm="form"
  204. :data="billsListAllData"
  205. @billsListAllfun="billsListAllfun(this.form.id)"></Split-list>
  206. </el-tab-pane>
  207. </el-tabs>
  208. </div>
  209. </div>
  210. </template>
  211. <script>
  212. import EntrustmentLnformation from "@/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation.vue";
  213. import mbinformation from "@/views/iosBasicData/SeafreightExportF/bills/assembly/mbinformation.vue";
  214. import formbottom from "@/views/iosBasicData/SeafreightExportF/bills/assembly/formbottom.vue";
  215. import edicode from '@/views/iosBasicData/SeafreightExportF/bills/assembly/edicode.vue'
  216. import filescenter from "@/views/iosBasicData/SeafreightExportF/bills/assembly/filescenter.vue";
  217. import DistributionBox from "@/views/iosBasicData/SeafreightExportF/bills/assembly/DistributionBox.vue";
  218. import feecenter from '@/views/iosBasicData/SeafreightExportF/bills/assembly/feecenter.vue'
  219. import {getList as userGetList} from '@/api/system/user'
  220. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  221. import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
  222. import bcorps from "@/views/iosBasicData/bcorps/index.vue";
  223. import bcorpstypedefine from "@/views/iosBasicData/bcorps/bcorpstypedefine.vue";
  224. import SplitList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/SplitList.vue";
  225. import {getLazylist} from "@/api/basicData/agreement";
  226. import {getBcorpsList, getBcorpslistByType} from "@/api/iosBasicData/bcorps";
  227. import {getBlocationsList} from "@/api/iosBasicData/blocations";
  228. import {getBcorpsattnList} from "@/api/iosBasicData/bcorpsattn";
  229. import {getWorkDicts} from "@/api/system/dictbiz";
  230. import {getDeptLazyTree, getDeptTree, getLazyList} from "@/api/system/dept";
  231. import {billsDetail, billsGetBillNo, billsListAll, billsSubmit,deptGetDetailPol} from '@/api/iosBasicData/bills'
  232. import {dateFormat} from "@/util/date";
  233. export default {
  234. components:{
  235. SearchQuery,
  236. EntrustmentLnformation,
  237. formbottom,
  238. mbinformation,
  239. edicode,
  240. filescenter,
  241. DistributionBox,
  242. feecenter,
  243. bcorps,
  244. bcorpstypedefine,
  245. SplitList,
  246. TreeSelect
  247. },
  248. props:{
  249. detailData: {
  250. type: Object
  251. }
  252. },
  253. data() {
  254. return {
  255. // 分单列表数据
  256. billsListAllData:[],
  257. pageLoading:false,
  258. saveLoading:false,
  259. // 详情数据
  260. form:{
  261. billDate:dateFormat(new Date(), "yyyy-MM-dd"), // 单据日期 默认 当天
  262. operatorName:JSON.parse(localStorage.getItem('saber-userInfo')).content.user_name, // OP 默认登录人
  263. operatorId:JSON.parse(localStorage.getItem('saber-userInfo')).content.user_id, // OP 默认登录人
  264. businessType:'SE', // 业务类型 默认 海运出口
  265. billType:'DD', // 单据类型 默认 直单
  266. accDeptName:'',// 核算部门 默认登录人的部门
  267. issueType:'正本', // 签单方式 默认 正本
  268. mpaymode:'PP', // 主单付费方式 默认PP
  269. hpaymode:'PP', // 分单付费方式 默认 PP
  270. loadType:'FCL', // 装箱方式默认整箱
  271. srcType:'OWN', // 业务来源默认公司 来源 内容 默认登录人所属公司
  272. numberOfObl:'THREE', // 正本份数 默认 THREE
  273. numberOfCopy:'ONE', // 副本份数 默认 ONE
  274. seaType:'E' // 进出口 默认出口 E=出口 I=进口"
  275. },
  276. basicData:{
  277. column:[
  278. [
  279. {
  280. label: "业务编号",
  281. prop: "billNo",
  282. disabled:true,
  283. },
  284. {
  285. label: "单据日期",
  286. prop: "billDate",
  287. type:'date',
  288. disabled:false,
  289. rules: [{
  290. required: true,
  291. message: "请输入单据日期",
  292. trigger: "blur"
  293. }]
  294. },
  295. ],
  296. [
  297. {
  298. label: "OP", // 操作id 用户管理下拉 模糊搜索
  299. prop: "operatorName",
  300. type:'select',
  301. dicData:[],
  302. disabled:false,
  303. forParameter:{
  304. key:'id',
  305. label:'name',
  306. value:'name',
  307. },
  308. rules: [{
  309. required: true,
  310. message: "请选择OP",
  311. trigger: "blur"
  312. }]
  313. },
  314. {
  315. label: "业务类型", // SE=海运出口 SI=海运进口"
  316. prop: "businessType",
  317. type:'select',
  318. disabled:false,
  319. dicData:[
  320. {
  321. label:'海运出口',
  322. value:'SE'
  323. },
  324. {
  325. label:'海运进口',
  326. value:'SI'
  327. },
  328. ],
  329. rules: [{
  330. required: true,
  331. message: "请输入业务类型",
  332. trigger: "blur"
  333. }]
  334. },
  335. ],
  336. [
  337. {
  338. label: "单据类型", // DD=直单(默认) MM=主单 MH=主分单 HH=从分单
  339. prop: "billType",
  340. type:'select',
  341. disabled:false,
  342. dicData:[
  343. {
  344. label:'直单',
  345. value:'DD'
  346. },
  347. {
  348. label:'主单',
  349. value:'MM'
  350. },
  351. {
  352. label:'主分单',
  353. value:'MH'
  354. }
  355. ],
  356. rules: [{
  357. required: true,
  358. message: "请输入单据类型",
  359. trigger: "blur"
  360. }]
  361. },
  362. {
  363. label: "核算部门", // 核算部门Id accDept 核算部门 accDeptName 调机构管理接口
  364. prop: "accDeptName",
  365. type:'tree',
  366. dicData:[],
  367. disabled:false,
  368. forParameter:{
  369. label: "title",
  370. children:'children'
  371. },
  372. rules: [{
  373. required: true,
  374. message: "请选择核算部门",
  375. trigger: "blur"
  376. }]
  377. },
  378. ],
  379. {
  380. label: "客户名称", // 调往来单位接口
  381. prop: "corpCnName",
  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. type:'select',
  403. dicData:[],
  404. span:10,
  405. disabled:true,
  406. forParameter:{
  407. key:'id',
  408. label:'cname',
  409. value:'cname',
  410. },
  411. },
  412. {
  413. label: "", //客户联系人电话
  414. prop: "corpAttnTel",
  415. labelWidth:'10px',
  416. disabled:true,
  417. span:7,
  418. rules: [{
  419. required: true,
  420. message: "",
  421. trigger: "blur"
  422. }]
  423. },
  424. {
  425. label: "", // 客户联系人邮箱
  426. prop: "corpAttnEmail",
  427. labelWidth:'10px',
  428. disabled:true,
  429. span:7,
  430. rules: [{
  431. required: true,
  432. message: "请输入客户联系人邮箱",
  433. trigger: "blur"
  434. }]
  435. },
  436. ],
  437. [
  438. {
  439. label: "签单方式",
  440. prop: "issueType",
  441. type:'select',
  442. dicData:[],
  443. disabled:false,
  444. forParameter:{
  445. key:'dictKey',
  446. label:'dictValue',
  447. value:'dictValue',
  448. },
  449. rules: [{
  450. required: true,
  451. message: "请输入签单方式",
  452. trigger: "blur"
  453. }]
  454. },
  455. {
  456. label: "装箱方式", // FCL=整箱, LCL=拼箱",
  457. prop: "loadType",
  458. type:'select',
  459. disabled:false,
  460. dicData:[
  461. {
  462. label:'整箱',
  463. value:'FCL'
  464. },
  465. {
  466. label:'拼箱',
  467. value:'LCL'
  468. }
  469. ],
  470. rules: [{
  471. required: true,
  472. message: "请输入装箱方式",
  473. trigger: "blur"
  474. }]
  475. },
  476. ],
  477. [
  478. {
  479. label: "MB/L NO",
  480. prop: "mblno",
  481. span:19,
  482. disabled:false,
  483. },
  484. {
  485. label: "", // MB/L 付款方式 PP=预付, CC=到付, FPA, Other
  486. prop: "mpaymode",
  487. type:'select',
  488. labelWidth:'10px',
  489. disabled:false,
  490. span:5,
  491. dicData:[
  492. {
  493. label:'预付',
  494. value:'PP'
  495. },
  496. {
  497. label:'到付',
  498. value:'CC'
  499. }
  500. ],
  501. },
  502. ],
  503. [
  504. {
  505. label: "业务来源", // OWN=公司 AGENT=代理 SALES=业务员
  506. prop: "srcType",
  507. type:'select',
  508. disabled:false,
  509. dicData:[
  510. {
  511. label:'公司',
  512. value:'OWN'
  513. },
  514. {
  515. label:'代理',
  516. value:'AGENT'
  517. },
  518. {
  519. label:'业务员',
  520. value:'SALES'
  521. }
  522. ],
  523. },
  524. {
  525. label: "",
  526. prop: "srcCnName", // 来源中文 公司不是下拉写死公司两字 业务员调用户管理列表 代理调往来单位四个代理数据
  527. labelWidth:'10px',
  528. type:'select',
  529. disabled:true,
  530. dicData:[],
  531. forParameter:{
  532. key:'id',
  533. label:'cnName',
  534. value:'cnName',
  535. },
  536. },
  537. ],
  538. {
  539. label: "付费地点", // MB/L 付款地点 地点管理表
  540. prop: "mPayplace",
  541. type:'select',
  542. dicData:[],
  543. disabled:false,
  544. buttonIf:false,
  545. forParameter:{
  546. key:'id',
  547. label:'cnName',
  548. value:'cnName',
  549. },
  550. },
  551. {
  552. label: "booking NO", // 订舱号
  553. prop: "bookingNo",
  554. disabled:false,
  555. },
  556. {
  557. label: "外提单号", // Co-Loader 中文名称 往来单位 类别
  558. prop: "refno",
  559. disabled:false,
  560. },
  561. // {
  562. // label: "COLOADER", // Co-Loader 中文名称 往来单位 类别
  563. // prop: "coloaderCnName",
  564. // type:'select',
  565. // dicData:[],
  566. // slot:'bcorpstypedefine',
  567. // buttonIf:true,
  568. // disabled:false,
  569. // forParameter:{
  570. // key:'id',
  571. // label:'cnName',
  572. // value:'cnName',
  573. // },
  574. // },
  575. [
  576. {
  577. label: "申请B/L NO", //弹窗点击确认还是取消申请 调后台接口获取到一个编号
  578. prop: "申请B/L NO",
  579. type:'button',
  580. span:7,
  581. disabled:false,
  582. },
  583. {
  584. label: "",
  585. prop: "hblno",
  586. labelWidth:'10px',
  587. span:12,
  588. disabled:true,
  589. },
  590. {
  591. label: "", // HB/L 付款方式 PP=预付, CC=到付, FPA, Other', 申请之后默认 PP
  592. prop: "hpaymode",
  593. labelWidth:'10px',
  594. disabled:true,
  595. type:'select',
  596. span:5,
  597. dicData:[
  598. {
  599. label:'预付',
  600. value:'PP'
  601. },
  602. {
  603. label:'到付',
  604. value:'CC'
  605. }
  606. ],
  607. },
  608. ],
  609. ]
  610. },
  611. activeName:'first',
  612. bigtabs:'wt',
  613. saberUserInfo:{}, // 当前登录人信息
  614. }
  615. },
  616. created() {
  617. this.saberUserInfo = JSON.parse(localStorage.getItem('saber-userInfo')).content
  618. // 判断是否员id, 有id 就不显示
  619. if (!this.form.id) {
  620. this.deptGetDetailPolfun() // 收货地 装货港 当前登录人的默认
  621. this.userGetListfun(undefined,true) // 获取用户管理数据
  622. }
  623. this.ownDeptLazyTreefun() // 获取公司数据
  624. this.getLazylistfun() // 获取审核数据
  625. },
  626. methods:{
  627. // 收货地 装货港 当前登录人的默认
  628. deptGetDetailPolfun(){
  629. deptGetDetailPol(this.saberUserInfo.dept_id).then(res=>{
  630. // 收货地
  631. this.form.placeReceiptName = res.data.data.polCnName
  632. this.form.placeReceiptId = res.data.data.polId
  633. this.form.placeReceiptNamePrint = res.data.data.polEnName
  634. // 装货港
  635. this.form.polCnName = res.data.data.polCnName
  636. this.form.placeReceiptId = res.data.data.polId
  637. this.form.polNamePrint = res.data.data.polEnName
  638. // 签单地点 默认 装货港
  639. this.$set(this.form,'issueAt',this.form.polCnName)
  640. // 主单单付费地点 默认 如果主单付费方式 为PP 取装货港 如果主单付费地点为CC 取卸货港
  641. if (this.form.mpaymode == 'PP') {
  642. this.$set(this.form,'mPayplace',this.form.polCnName)
  643. }
  644. // 分单单付费地点 默认 如果分单付费方式 为PP 取装货港 如果分单付费地点为CC 取卸货港
  645. if (this.form.hpaymode == 'PP') {
  646. this.$set(this.form,'hPayplace',this.form.polCnName)
  647. }
  648. })
  649. },
  650. // 获取用户管理数据
  651. userGetListfun(account = undefined,type = false,){
  652. userGetList(1,10,{account}).then(res=>{
  653. this.columnforfun('operatorName').dicData = res.data.data.records
  654. if (type) {
  655. // 核算部门 默认登录人的部门
  656. for (let item of this.columnforfun('operatorName').dicData) {
  657. if (item.name == this.form.operatorName) {
  658. this.$set(this.form,'accDeptName',item.deptName)
  659. this.$set(this.form,'accDeptId',item.deptId)
  660. }
  661. }
  662. }
  663. })
  664. },
  665. // 获取核算部分数据 // 机构管理接口
  666. getLazylistfun(){
  667. getDeptTree().then(res=>{
  668. this.columnforfun('accDeptName').dicData = res.data.data
  669. })
  670. },
  671. // 获取客户名称数据 往来单位数据
  672. getBcorpsListfun(cnName){
  673. getBcorpsList(1,10,{cnName}).then(res=>{
  674. this.columnforfun('corpCnName').dicData = res.data.data.records
  675. })
  676. },
  677. // 获取客户联系人 客户OP
  678. getBcorpsattnListfun(cnName){
  679. getBcorpsattnList(1,10,{pid:this.form.corpId,cnName}).then(res=>{
  680. this.columnforfun('corpAttnName').dicData = res.data.data.records
  681. })
  682. },
  683. // 获取地点信息
  684. getBlocationsListfun(cnName){
  685. getBlocationsList(1,10,{cnName}).then(res=>{
  686. this.columnforfun('mPayplace').dicData = res.data.data.records
  687. })
  688. },
  689. // 获取签单方式字典数据
  690. getWorkDictsfun(){
  691. getWorkDicts('issue_type_F').then(res=>{
  692. this.columnforfun('issueType').dicData = res.data.data
  693. })
  694. },
  695. // 获取业务来源代理数据
  696. agentBcorpsListfun(cnName){
  697. let corpType = '1712285382575398914,1712285645314990082,1712285842321448962,1712286433378574338'
  698. getBcorpslistByType(1,10,{cnName,corpType}).then(res=>{
  699. this.columnforfun('srcCnName').dicData = res.data.data.records
  700. })
  701. },
  702. // 获取业务来源业务员数据
  703. salesUserGetListfun(account){
  704. userGetList(1,10,{account}).then(res=>{
  705. this.columnforfun('srcCnName').dicData = res.data.data.records
  706. })
  707. },
  708. // 获取公司名称 用户管理左侧
  709. ownDeptLazyTreefun(){
  710. getDeptLazyTree(0).then(res=>{
  711. this.columnforfun('srcCnName').dicData = res.data.data
  712. // 来源 内容 默认登录人所属公司
  713. for(let item of this.columnforfun('srcCnName').dicData) {
  714. if (item.id == JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_id) {
  715. this.$set(this.form,'srcId',item.id)
  716. this.$set(this.form,'srcCnName',item.title)
  717. this.$set(this.form,'srcEnName',item.title)
  718. }
  719. }
  720. })
  721. },
  722. // 申请B/L NO
  723. billsGetBillNofun(){
  724. billsGetBillNo({
  725. businessType:this.form.businessType,
  726. seaType:this.form.seaType,
  727. billType:this.form.businessType,
  728. corpCode:this.form.corpCode,
  729. }).then(res=>{
  730. this.columnforfun('hpaymode').disabled = false
  731. this.form.hblno = res.data.data
  732. })
  733. },
  734. /* 远程模糊查询操作用户 */
  735. remoteMethod(value,name) {
  736. if (name == 'operatorName') {
  737. this.userGetListfun(value)
  738. }else if (name == 'accDeptName') {
  739. this.getLazylistfun(value)
  740. }else if (name == 'corpCnName') {
  741. this.getBcorpsListfun(value)
  742. }else if (name == 'mPayplace') {
  743. this.getBlocationsListfun(value)
  744. }else if (name == 'corpAttnName') {
  745. this.getBcorpsattnListfun(value)
  746. }else if (name == 'srcCnName') {
  747. if (this.form.srcType == 'SALES') {
  748. // 业务员
  749. this.salesUserGetListfun(value)
  750. }else if (this.form.srcType == 'AGENT') {
  751. // 代理
  752. this.agentBcorpsListfun(value)
  753. }
  754. } else if (name == 'issueType') {
  755. // 签单方式
  756. this.getWorkDictsfun()
  757. }else {
  758. }
  759. },
  760. // 下拉的监听事件
  761. corpChange(value,name){
  762. if (name == 'operatorName') {
  763. // OP 下拉赋值 用户管理列表
  764. for(let item of this.columnforfun('operatorName').dicData) {
  765. if (item.name == value) {
  766. this.form.operatorName = item.name
  767. this.form.operatorId = item.id
  768. }
  769. }
  770. }
  771. else if (name == 'accDeptName') {
  772. // OP 下拉赋值 用户管理列表
  773. for(let item of this.columnforfun('accDeptName').dicData) {
  774. if (item.title == value) {
  775. this.form.accDeptName = item.title
  776. this.form.accDeptId = item.id
  777. }
  778. }
  779. }
  780. else if (name == 'corpCnName') {
  781. if (value) {
  782. this.columnforfun('corpAttnName').disabled = false
  783. this.columnforfun('corpAttnTel').disabled = false
  784. this.columnforfun('corpAttnEmail').disabled = false
  785. }else {
  786. this.columnforfun('corpAttnName').disabled = true
  787. this.columnforfun('corpAttnTel').disabled = true
  788. this.columnforfun('corpAttnEmail').disabled = true
  789. // 如果点击清空按钮把值赋值为空
  790. this.form.corpCnName = ''
  791. this.form.corpEnName = ''
  792. this.form.corpId = ''
  793. this.form.corpCode = ''
  794. }
  795. // 往来单位
  796. for(let item of this.columnforfun('corpCnName').dicData) {
  797. if (item.cnName == value) {
  798. console.log(item,677)
  799. this.form.corpCnName = item.cnName
  800. this.form.corpEnName = item.enName
  801. this.form.corpId = item.id
  802. this.form.corpCode = item.code
  803. this.getBcorpsattnListfun()
  804. }
  805. }
  806. }
  807. else if (name == 'corpAttnName') {
  808. for(let item of this.columnforfun('corpAttnName').dicData) {
  809. if (item.cname == value) {
  810. this.form.corpAttnName = item.cname
  811. this.form.corpAttnId = item.id
  812. this.$set(this.form,'corpAttnTel',item.tel)
  813. this.$set(this.form,'corpAttnEmail',item.email)
  814. }
  815. }
  816. }
  817. else if (name == 'srcType') {
  818. if (!value) {
  819. this.$set(this.form,'srcType','')
  820. this.$set(this.form,'srcId','')
  821. this.$set(this.form,'srcCnName','')
  822. this.$set(this.form,'srcEnName','')
  823. this.columnforfun('srcCnName').disabled = true
  824. return
  825. }
  826. this.form[name] = value
  827. if (value == 'OWN') {
  828. // 公司
  829. this.columnforfun('srcCnName').type = ''
  830. for(let item of this.columnforfun('srcCnName').dicData) {
  831. if (item.id == JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_id) {
  832. console.log(item,847)
  833. this.$set(this.form,'srcId',item.id)
  834. this.$set(this.form,'srcCnName',item.title)
  835. this.$set(this.form,'srcEnName',item.title)
  836. }
  837. }
  838. this.columnforfun('srcCnName').disabled = true
  839. }else if (value == 'AGENT') {
  840. // 代理
  841. this.columnforfun('srcCnName').type = 'select'
  842. this.columnforfun('srcCnName').forParameter = { key:'id', label:'cnName', value:'cnName'}
  843. this.columnforfun('srcCnName').disabled = false
  844. this.agentBcorpsListfun()
  845. }else if (value == 'SALES') {
  846. // 业务员
  847. this.columnforfun('srcCnName').type = 'select'
  848. this.columnforfun('srcCnName').forParameter = { key:'id', label:'name', value:'name'}
  849. this.columnforfun('srcCnName').disabled = false
  850. this.salesUserGetListfun()
  851. }else {}
  852. }
  853. else if (name == 'srcCnName'){
  854. for(let item of this.columnforfun('srcCnName').dicData) {
  855. if (item[this.columnforfun('srcCnName').forParameter.value] == value) {
  856. if (this.form.srcType == 'SALES') {
  857. // 业务员
  858. this.$set(this.form,'srcId',item.id)
  859. this.$set(this.form,'srcCnName',item.name)
  860. this.$set(this.form,'srcEnName',item.name)
  861. }else if (this.form.srcType == 'AGENT') {
  862. // 代理
  863. this.$set(this.form,'srcId',item.id)
  864. this.$set(this.form,'srcCnName',item.cnName)
  865. this.$set(this.form,'srcEnName',item.enName)
  866. }else {}
  867. }
  868. }
  869. }
  870. else if (name == 'coloaderCnName') {
  871. for(let item of this.columnforfun('coloaderCnName').dicData) {
  872. if (item.cnName == value) {
  873. this.$set(this.form,'coloaderId',item.id)
  874. this.$set(this.form,'coloaderCnName',item.cnName)
  875. this.$set(this.form,'coloaderEnName',item.enName)
  876. }
  877. }
  878. }
  879. else {
  880. this.form[name] = value
  881. }
  882. },
  883. // 申请B/L NO
  884. applyforfun(text){
  885. if (!this.form.businessType) {
  886. this.$message({
  887. message: '请先选择业务类型',
  888. type: 'warning'
  889. });
  890. return
  891. }
  892. if (!this.form.corpCnName) {
  893. this.$message({
  894. message: '请先选择客户名称',
  895. type: 'warning'
  896. });
  897. return
  898. }
  899. this.$confirm(`确定${text}?`, {
  900. confirmButtonText: "确定",
  901. cancelButtonText: "取消",
  902. type: "warning"
  903. }).then(res=>{
  904. this.billsGetBillNofun()
  905. })
  906. },
  907. // 配置项
  908. columnforfun(value){
  909. for(let item of this.basicData.column) {
  910. if (item instanceof Array) {
  911. for(let ite of item) {
  912. if (value == ite.prop) {
  913. return ite
  914. }
  915. }
  916. }else {
  917. if (value == item.prop) {
  918. return item
  919. }
  920. }
  921. }
  922. },
  923. //返回列表
  924. backToList() {
  925. this.$emit('goBack')
  926. },
  927. // 编辑按钮
  928. editHandle(){
  929. this.detailData.seeDisabled = false
  930. },
  931. // 大保存按钮
  932. editCustomer(){
  933. this.$refs.form.validate((valid)=>{
  934. if (valid) {
  935. this.billsSubmitfun()
  936. }
  937. })
  938. },
  939. // 主表保存接口大保存
  940. billsSubmitfun(){
  941. this.form.billNoFormat = 'HYCK'
  942. this.form.businessTypeId = '1714186930489712641'
  943. billsSubmit(this.form).then(res=>{
  944. this.$message({
  945. type: "success",
  946. message: "操作成功!"
  947. });
  948. this.detailData.seeDisabled = true
  949. this.billsDetailfun(this.form.id)
  950. })
  951. },
  952. // 详情接口
  953. async billsDetailfun(id){
  954. const res = await billsDetail(id)
  955. this.form = res.data.data;
  956. this.pageLoading = false
  957. // 配箱最上面可以编辑
  958. for(let item of this.form.containersList) {
  959. item.edit = false
  960. }
  961. // 配箱最下面的
  962. for(let item of this.form.waitingBoxList) {
  963. this.$set(item,'editQuantity',item.quantity)
  964. this.$set(item,'editGrossWeight',item.grossWeight)
  965. this.$set(item,'editMeasurement',item.measurement)
  966. this.$set(item,'edit',false)
  967. }
  968. // 应收
  969. for(let item of this.form.feeCenterListD) {
  970. if (item.curCode == 'CNY') {
  971. this.$set(item,'rmbAmount',item.amount)
  972. this.$set(item,'usdAmount','')
  973. }else {
  974. this.$set(item,'usdAmount',item.amount)
  975. this.$set(item,'rmbAmount','')
  976. }
  977. item.edit = false
  978. }
  979. // 应付
  980. for(let item of this.form.feeCenterListC) {
  981. if (item.curCode == 'CNY') {
  982. this.$set(item,'rmbAmount',item.amount)
  983. this.$set(item,'usdAmount','')
  984. }else {
  985. this.$set(item,'usdAmount',item.amount)
  986. this.$set(item,'rmbAmount','')
  987. }
  988. item.edit = false
  989. }
  990. },
  991. // tbas切换
  992. handleClick(tba,event) {
  993. },
  994. // 大tbas切换
  995. bigHandleClick(){
  996. if (this.bigtabs == 'fd') {
  997. if (this.form.id) {
  998. this.billsListAllfun(this.form.id)
  999. }
  1000. }
  1001. },
  1002. // 获取不分页的分单列表
  1003. billsListAllfun(masterId){
  1004. billsListAll({masterId}).then(res=>{
  1005. this.billsListAllData = res.data.data
  1006. })
  1007. },
  1008. },
  1009. }
  1010. </script>
  1011. <style scoped>
  1012. .borderless {
  1013. height: 100%;
  1014. box-sizing: border-box
  1015. }
  1016. .customer-main {
  1017. margin-bottom: 15px;
  1018. }
  1019. .demo-ruleForm {
  1020. font-size: 14px;
  1021. }
  1022. .margintop {
  1023. margin-top: 10px;
  1024. }
  1025. ::v-deep.el-form-item {
  1026. margin-bottom: 0;
  1027. }
  1028. .isShow {
  1029. display: none;
  1030. }
  1031. </style>