billsDetails.vue 54 KB

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