billsDetails.vue 58 KB

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