billsDetails.vue 60 KB

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