index.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213
  1. <template>
  2. <div>
  3. <basic-container v-if="isShow">
  4. <avue-crud :option="option"
  5. :table-loading="loading"
  6. :data="data"
  7. :page.sync="page"
  8. id="out-table"
  9. :header-cell-class-name="headerClassName"
  10. :permission="permissionList"
  11. :before-open="beforeOpen"
  12. v-model="form"
  13. ref="crud"
  14. :search.sync="query"
  15. @row-update="rowUpdate"
  16. @row-save="rowSave"
  17. @row-del="rowDel"
  18. @search-change="searchChange"
  19. @search-reset="searchReset"
  20. @selection-change="selectionChange"
  21. @current-change="currentChange"
  22. @size-change="sizeChange"
  23. @refresh-change="refreshChange"
  24. @on-load="onLoad"
  25. @expand-change="expandChange"
  26. @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 309)"
  27. @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 309)"
  28. >
  29. <template slot="search" slot-scope="{row,size}">
  30. <el-form ref="form" :model="row" label-width="80px" :style="fold?'width: 100%':'width: 70%'">
  31. <el-row>
  32. <el-col :span="fold?6:8" >
  33. <el-form-item label="主单号">
  34. <el-input placeholder="请输入主单号"
  35. size="small" style="width:100%" v-model="query.mblno">
  36. </el-input>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="fold?6:8">
  40. <el-form-item label="委托人">
  41. <el-input placeholder="请输入委托人"
  42. size="small" style="width:100%" v-model="query.corpCnName">
  43. </el-input>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :span="fold?6:8" >
  47. <el-form-item label="业务号">
  48. <el-input placeholder="请输入业务号"
  49. size="small" style="width:100%" v-model="query.billNo">
  50. </el-input>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="6" v-show="fold">
  54. <el-form-item label="单据类型">
  55. <search-query
  56. :datalist="billTypeData"
  57. :selectValue="query.billType"
  58. :filterable="true"
  59. :clearable="true"
  60. :remote="true"
  61. :buttonIf="false"
  62. @corpChange="corpChange($event,'billType')">
  63. </search-query>
  64. </el-form-item>
  65. </el-col>
  66. <el-col :span="6" v-show="fold">
  67. <el-form-item label="分单号">
  68. <el-input placeholder="请输入分单号"
  69. size="small" style="width:100%" v-model="query.hblno">
  70. </el-input>
  71. </el-form-item>
  72. </el-col>
  73. <el-col :span="6" v-show="fold">
  74. <el-form-item label="船名">
  75. <el-input placeholder="请输入船名"
  76. size="small" style="width:100%" v-model="query.vesselCnName">
  77. </el-input>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="6" v-show="fold" >
  81. <el-form-item label="航次">
  82. <el-input placeholder="请输入航次"
  83. size="small" style="width:100%" v-model="query.voyageNo">
  84. </el-input>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="6" v-show="fold">
  88. <el-form-item label="船公司">
  89. <el-input placeholder="请输入船公司"
  90. size="small" style="width:100%" v-model="query.carrierCnName">
  91. </el-input>
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="6" v-show="fold">
  95. <el-form-item label="目的港">
  96. <el-input placeholder="请输入目的港"
  97. size="small" style="width:100%" v-model="query.podCnName">
  98. </el-input>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="6" v-show="fold">
  102. <el-form-item label="航线">
  103. <el-input placeholder="请输入航线"
  104. size="small" style="width:100%" v-model="query.lineCnName">
  105. </el-input>
  106. </el-form-item>
  107. </el-col>
  108. <el-col :span="6" v-show="fold">
  109. <el-form-item label="场站">
  110. <el-input placeholder="请输入场站"
  111. size="small" style="width:100%" v-model="query.cyCode">
  112. </el-input>
  113. </el-form-item>
  114. </el-col>
  115. <el-col :span="6" v-show="fold">
  116. <el-form-item label="业务来源">
  117. <search-query
  118. :datalist="srcTypeData"
  119. :selectValue="query.srcType"
  120. :filterable="true"
  121. :clearable="true"
  122. :remote="true"
  123. :buttonIf="false"
  124. @corpChange="corpChange($event,'srcType')">
  125. </search-query>
  126. </el-form-item>
  127. </el-col>
  128. <el-col :span="6" v-show="fold">
  129. <el-form-item label="来源详情">
  130. <el-input placeholder="请输入来源详情"
  131. size="small" style="width:100%" v-model="query.srcCnName">
  132. </el-input>
  133. </el-form-item>
  134. </el-col>
  135. <el-col :span="9" v-show="fold">
  136. <el-form-item label="ETD">
  137. <el-checkbox v-model="etdDisabled">
  138. <el-date-picker
  139. v-model="etdList"
  140. style="width: 100%"
  141. :disabled="!etdDisabled"
  142. size="small"
  143. type="datetimerange"
  144. range-separator="至"
  145. start-placeholder="开始日期"
  146. end-placeholder="结束日期"
  147. format="yyyy-MM-dd HH:mm"
  148. value-format="yyyy-MM-dd HH:mm"
  149. clearable>
  150. </el-date-picker>
  151. </el-checkbox>
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="9" v-show="fold">
  155. <el-form-item label="ETA">
  156. <el-checkbox v-model="etaDisabled">
  157. <el-date-picker
  158. v-model="etaList"
  159. style="width: 100%"
  160. :disabled="!etaDisabled"
  161. size="small"
  162. type="datetimerange"
  163. range-separator="至"
  164. start-placeholder="开始日期"
  165. end-placeholder="结束日期"
  166. format="yyyy-MM-dd HH:mm"
  167. value-format="yyyy-MM-dd HH:mm"
  168. clearable>
  169. </el-date-picker>
  170. </el-checkbox>
  171. </el-form-item>
  172. </el-col>
  173. <el-col :span="6" v-show="fold">
  174. <el-form-item label="创建部门">
  175. <el-input placeholder="请输入创建部门"
  176. size="small" style="width:100%" v-model="query.createDeptName">
  177. </el-input>
  178. </el-form-item>
  179. </el-col>
  180. <el-col :span="6" v-show="fold">
  181. <el-form-item label="订舱代理">
  182. <el-input placeholder="请输入订舱代理"
  183. size="small" style="width:100%" v-model="query.bookingAgentCnName">
  184. </el-input>
  185. </el-form-item>
  186. </el-col>
  187. <el-col :span="6" v-show="fold">
  188. <el-form-item label="签单方式">
  189. <search-query
  190. :datalist="issueTypeData"
  191. :selectValue="query.issueType"
  192. :filterable="true"
  193. :clearable="true"
  194. :remote="true"
  195. :buttonIf="false"
  196. :forParameter="{ key:'dictKey', label:'dictValue', value:'dictValue'}"
  197. @corpChange="corpChange($event,'issueType')" >
  198. </search-query>
  199. </el-form-item>
  200. </el-col>
  201. <el-col :span="6" v-show="fold">
  202. <el-form-item label="收货人">
  203. <el-input placeholder="请输入收货人"
  204. size="small" style="width:100%" v-model="query.hConsigneeCnName">
  205. </el-input>
  206. </el-form-item>
  207. </el-col>
  208. </el-row>
  209. </el-form>
  210. </template>
  211. <template slot="searchMenu" slot-scope="{row,size}">
  212. <el-button type="text" @click="shiftCollapsiable">
  213. <span>
  214. {{ fold ? '收起' : '展开' }}
  215. <i :class="fold ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>
  216. </span>
  217. </el-button>
  218. </template>
  219. <template slot="menuLeft">
  220. <el-button type="primary" size="small" icon="el-icon-plus" @click="addbtnfun()">新增海运出口
  221. </el-button>
  222. <el-button type="danger"
  223. size="small"
  224. icon="el-icon-delete"
  225. plain
  226. @click="handleDelete">删 除
  227. </el-button>
  228. <el-button type="success"
  229. size="small"
  230. icon="el-icon-plus"
  231. plain
  232. @click="increaseMawb">添加到主单
  233. </el-button>
  234. <div style="margin-top: 10px">
  235. <el-tabs type="card" v-model="query.billStatus" @tab-click="handleClick">
  236. <el-tab-pane label="接单" name="0">
  237. <span slot="label">接单</span>
  238. </el-tab-pane>
  239. <el-tab-pane label="退舱" name="1">
  240. <span slot="label" style="color: #d86363">退舱</span>
  241. </el-tab-pane>
  242. <el-tab-pane label="暂停" name="2">
  243. <span slot="label" style="color: #d2983c">暂停</span>
  244. </el-tab-pane>
  245. <el-tab-pane label="完成" name="3"></el-tab-pane>
  246. </el-tabs>
  247. </div>
  248. </template>
  249. <template slot-scope="scope" slot="menu">
  250. <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit"
  251. @click.stop="rowCellfun(scope.row, scope.index)">编辑
  252. </el-button>
  253. </template>
  254. <template slot-scope="scope" slot="coloaderEnName">
  255. <avue-text-ellipsis :text="scope.row.coloaderEnName" :height="30" use-tooltip placement="top">
  256. <small slot="more">...</small>
  257. </avue-text-ellipsis>
  258. </template>
  259. <template slot-scope="scope" slot="hblno">
  260. <avue-text-ellipsis :text="scope.row.hblno" :height="30" use-tooltip placement="top">
  261. <small slot="more">...</small>
  262. </avue-text-ellipsis>
  263. </template>
  264. <template slot-scope="scope" slot="mblno">
  265. <avue-text-ellipsis :text="scope.row.mblno" :height="30" use-tooltip placement="top">
  266. <small slot="more">...</small>
  267. </avue-text-ellipsis>
  268. </template>
  269. <template slot="expand" slot-scope="{row}" >
  270. <SplitList :typeMenu="true" :data="row.billsListAllData" :loading="SplitLoading" ></SplitList>
  271. </template>
  272. <temolate slot="billStatus" slot-scope="{row}">
  273. <span v-if="row.billStatus == item.dictKey"
  274. v-for="(item,index) in billStatusData" :key="index"
  275. :style="{'color':item.colour}" >
  276. {{item.dictValue}}
  277. </span>
  278. </temolate>
  279. <template slot="accountStatus" slot-scope="{ row }">
  280. <span v-if="row.accountStatus == item.dictKey"
  281. v-for="(item,index) in accountStatusData" :key="index"
  282. :style="{'color':item.colour}" >
  283. {{item.dictValue}}
  284. </span>
  285. </template>
  286. <template slot="corpCnName" slot-scope="scope">
  287. <span style="color: #1e9fff;cursor: pointer;"
  288. @click.stop="rowCellfun(scope.row, scope.index)" >
  289. {{scope.row.corpCnName}}
  290. </span>
  291. </template>
  292. </avue-crud>
  293. </basic-container>
  294. <bills-details ref="billsDetails" v-if="!isShow" :detailData="detailData" @goBack="goBack"></bills-details>
  295. <el-dialog
  296. title="主单列表"
  297. :visible.sync="dialogVisible"
  298. append-to-body
  299. width="60%"
  300. :before-close="handleClose">
  301. <avue-crud :option="mawbOption"
  302. :table-loading="mawbloading"
  303. :data="mawbData"
  304. :page.sync="mawbPage"
  305. :search="mawbQuery"
  306. id="out-table"
  307. :header-cell-class-name="headerClassName"
  308. @on-load="mawbOnLoad">
  309. <template slot="radio"
  310. slot-scope="{row}">
  311. <el-radio v-model="dialogRadio" :label="row.id" @input="radioInput(row)"></el-radio>
  312. </template>
  313. </avue-crud>
  314. <span slot="footer" class="dialog-footer">
  315. <el-button @click="dialogVisible = false">取 消</el-button>
  316. <el-button type="primary" @click="AddToMainOrder">确 定</el-button>
  317. </span>
  318. </el-dialog>
  319. </div>
  320. </template>
  321. <script>
  322. import {
  323. billsList,
  324. billsDetail,
  325. billsSubmit,
  326. billsRemove,
  327. billsIncreaseReinsurancePolicy, billsListAll
  328. } from "@/api/iosBasicData/bills";
  329. import {mapGetters} from "vuex";
  330. import billsDetails from "@/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue";
  331. import feesTemplateItems from "@/views/iosBasicData/losbfeestemplate/feesTemplateItems.vue";
  332. import SplitList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/SplitList.vue";
  333. import {getWorkDicts} from "@/api/system/dictbiz";
  334. import {dateFormat, defaultDate} from "@/util/date";
  335. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  336. export default {
  337. components:{SearchQuery, feesTemplateItems, billsDetails,SplitList},
  338. data() {
  339. return {
  340. // 展开和收回
  341. fold:false,
  342. maxShow:3,
  343. // 单据类型
  344. billTypeData:[
  345. {
  346. label: '直单',
  347. value: 'DD'
  348. }, {
  349. label: '主单',
  350. value: 'MM'
  351. },{
  352. label: '主分单',
  353. value: 'MH'
  354. }
  355. ],
  356. // 业务来源
  357. srcTypeData:[
  358. {
  359. label:'公司',
  360. value:'OWN'
  361. },
  362. {
  363. label:'代理',
  364. value:'AGENT'
  365. },
  366. {
  367. label:'业务员',
  368. value:'SALES'
  369. }
  370. ],
  371. // 签单方式
  372. issueTypeData:[],
  373. isShow:true,
  374. detailData:{},
  375. dialogVisible:false, // 弹窗开启
  376. // ETD是否可以检索
  377. etdDisabled:false,
  378. // ETA是否可以检索
  379. etaDisabled:false,
  380. form: {},
  381. // 开船日期和到港日期
  382. etdList:[defaultDate(1)[0] + ' 00:00',defaultDate(1)[1] + ' 23:59'],
  383. etaList:[defaultDate(1)[0] + ' 00:00',defaultDate(1)[1] + ' 23:59'],
  384. // 表格的检索条件
  385. query: {
  386. billStatus:'0',
  387. },
  388. // 弹窗的搜索项
  389. mawbQuery:{
  390. billType:'MM'
  391. },
  392. loading: true,
  393. // 弹窗加载
  394. mawbloading:false,
  395. // 下拉的加载
  396. SplitLoading:false,
  397. page: {
  398. pageSize: 10,
  399. currentPage: 1,
  400. total: 0
  401. },
  402. // 弹窗分页
  403. mawbPage:{
  404. pageSize: 10,
  405. currentPage: 1,
  406. total: 0
  407. },
  408. selectionList: [],
  409. // 弹窗的选择数据
  410. dialogRadio:null,
  411. option:{},
  412. optionBack: {
  413. selectable:(row,index)=>{
  414. // 禁用主单
  415. return row.billType != 'MM'
  416. },
  417. expand: true,
  418. expandRowKeys:[],
  419. rowKey:'id',
  420. height:'auto',
  421. calcHeight: 30,
  422. tip: false,
  423. searchShow: true,
  424. searchMenuSpan: 6,
  425. searchLabelWidth:'100',
  426. border: true,
  427. index: true,
  428. selection: true,
  429. dialogClickModal: false,
  430. highlightCurrentRow:true, // 单选
  431. searchIcon: true,
  432. searchIndex: 3,
  433. stripe:true,
  434. addBtn:false,
  435. viewBtn:false,
  436. delBtn:false,
  437. editBtn:false,
  438. menuWidth:'auto',
  439. column: [
  440. {
  441. label: "单据类型",
  442. prop: "billType",
  443. type: 'select',
  444. dicData: [{
  445. label: '直单',
  446. value: 'DD'
  447. }, {
  448. label: '主单',
  449. value: 'MM'
  450. },{
  451. label: '主分单',
  452. value: 'MH'
  453. }],
  454. },
  455. {
  456. label: "单据编号",
  457. prop: "billNo",
  458. width:"160"
  459. },
  460. {
  461. label: "主单据号",
  462. prop: "masterBillNo",
  463. width:"160"
  464. },
  465. {
  466. label: "客户名",
  467. prop: "corpCnName",
  468. width:"160"
  469. },
  470. {
  471. label: "客户英文",
  472. prop: "corpEnName",
  473. width:"160"
  474. },
  475. {
  476. label: "船名",
  477. prop: "vesselCnName",
  478. },
  479. {
  480. label: "航次",
  481. prop: "voyageNo",
  482. },
  483. {
  484. label: "MB/L NO",
  485. prop: "mblno",
  486. },
  487. {
  488. label: "HB/L NO",
  489. prop: "hblno",
  490. },
  491. {
  492. label: "开船日期",
  493. prop: "etd",
  494. type: "date",
  495. unlinkPanels: true,
  496. searchRange: true,
  497. overHidden: true,
  498. forma: "yyyy-MM-dd",
  499. valueFormat: "yyyy-MM-dd HH:mm:ss",
  500. searchDefaultTime: ["00:00:00", "23:59:59"],
  501. },
  502. {
  503. label: "到港日期",
  504. prop: "eta",
  505. },
  506. {
  507. label: "装货港",
  508. prop: "polCnName",
  509. width:"120"
  510. },
  511. {
  512. label: "卸货港",
  513. prop: "podCnName",
  514. width:"120"
  515. },
  516. {
  517. label: "装箱方式",
  518. prop: "loadType",
  519. type: 'select',
  520. dicData: [{
  521. label: '整箱',
  522. value: 'FCL'
  523. }, {
  524. label: '拼箱',
  525. value: 'LCL'
  526. }],
  527. },
  528. {
  529. label: "货物类别",
  530. prop: "cargoType",
  531. type: 'select',
  532. dicData: [{
  533. label: '普货',
  534. value: 'dry'
  535. }, {
  536. label: '危险品',
  537. value: 'danger'
  538. },{
  539. label: '冻柜',
  540. value: 'reefer'
  541. }],
  542. },
  543. {
  544. label: "唛头",
  545. prop: "marks",
  546. // ----------
  547. },
  548. {
  549. label: "件数",
  550. prop: "quantity",
  551. },
  552. {
  553. label: "毛重 (KGM)",
  554. prop: "grossWeight",
  555. width:"120"
  556. },
  557. {
  558. label: "净重 (KGM)",
  559. prop: "netWeight",
  560. width:"120"
  561. },
  562. {
  563. label: "体积 (CBM)",
  564. prop: "measurement",
  565. width:"120"
  566. },
  567. {
  568. label: "V20",
  569. prop: "quantityV20",
  570. width:"100"
  571. },
  572. {
  573. label: "V40",
  574. prop: "quantityV40",
  575. width:"100"
  576. },
  577. {
  578. label: "40HC",
  579. prop: "quantityV40hc",
  580. width:"100"
  581. },
  582. {
  583. label: "V45",
  584. prop: "quantityV45",
  585. width:"100"
  586. },
  587. {
  588. label: "V48",
  589. prop: "quantityV48",
  590. width:"100"
  591. },
  592. {
  593. label: "需陆运",
  594. prop: "isNeedLand",
  595. type: 'select',
  596. dicData: [{
  597. label: '否',
  598. value: 0
  599. }, {
  600. label: '是',
  601. value: 1
  602. }],
  603. },
  604. {
  605. label: "需报关",
  606. prop: "isNeedDeclare",
  607. type: 'select',
  608. dicData: [{
  609. label: '否',
  610. value: 0
  611. }, {
  612. label: '是',
  613. value: 1
  614. }],
  615. },
  616. {
  617. label: "需三检",
  618. prop: "isNeedIq",
  619. type: 'select',
  620. dicData: [{
  621. label: '否',
  622. value: 0
  623. }, {
  624. label: '是',
  625. value: 1
  626. }],
  627. },
  628. {
  629. label: "应收(CNY)",
  630. prop: "amountDr",
  631. width: "160"
  632. },
  633. {
  634. label: "应付(CNY)",
  635. prop: "amountCr",
  636. width: "160"
  637. },
  638. {
  639. label: "利润(CNY)",
  640. prop: "amountProfit",
  641. width: "160"
  642. },
  643. {
  644. // label: "综合 USD 应付(USD) - 非 USD 外币转换为 USD",
  645. label: "综合应付(USD)",
  646. prop: "amountCrUsd",
  647. width: "120"
  648. },
  649. {
  650. label: "综合利润(USD)",
  651. prop: "amountProfitUsd",
  652. width: "120"
  653. },
  654. {
  655. label: "合计应收(CNY )",
  656. prop: "amountDrLoc",
  657. width:"160"
  658. },
  659. {
  660. label: "合计应付(CNY)",
  661. prop: "amountCrLoc",
  662. width:"160"
  663. },
  664. {
  665. label: "合计利润(CNY)",
  666. prop: "amountProfitLoc",
  667. width:"160"
  668. },
  669. {
  670. label: "应收对账状态",
  671. prop: "checkDrStatusDescr",
  672. width:"160"
  673. },
  674. {
  675. label: "应付对账状态",
  676. prop: "checkCrStatusDescr",
  677. width:"160"
  678. },
  679. {
  680. label: "应收结算状态",
  681. prop: "stlDrStatusDescr",
  682. width:"160"
  683. },
  684. {
  685. label: "应付结算状态",
  686. prop: "stlCrStatusDescr",
  687. width:"160"
  688. },
  689. {
  690. label: "销项发票状态",
  691. prop: "invoiceDrStatusDescr",
  692. width:"160"
  693. },
  694. {
  695. label: "进项发票状态",
  696. prop: "invoiceCrStatusDescr",
  697. width:"160"
  698. },
  699. {
  700. label: "业务状态",
  701. prop: "billStatus",
  702. type:"select",
  703. dicData: [],
  704. props: {
  705. label: "dictValue",
  706. value: "dictKey"
  707. },
  708. width: "160"
  709. },
  710. {
  711. label: "财务状态",
  712. prop: "accountStatus",
  713. type:"select",
  714. dicData: [],
  715. props: {
  716. label: "dictValue",
  717. value: "dictKey"
  718. },
  719. width: "180",
  720. },
  721. {
  722. label: "状态",
  723. prop: "status",
  724. type: 'select',
  725. dicData: [{
  726. label: '正常',
  727. value: 0
  728. }, {
  729. label: '停用',
  730. value: 1
  731. }],
  732. },
  733. {
  734. label: "备注",
  735. prop: "remarks",
  736. },
  737. ]
  738. },
  739. // 弹窗的配置
  740. mawbOption:{
  741. height:'450',
  742. calcHeight: 30,
  743. tip: false,
  744. searchShow: true,
  745. searchMenuSpan: 24,
  746. border: true,
  747. selection: false, // 多选
  748. dialogClickModal: false,
  749. stripe:true,
  750. addBtn:false,
  751. viewBtn:false,
  752. delBtn:false,
  753. editBtn:false,
  754. menu:false,
  755. menuWidth:'auto',
  756. column: [
  757. {
  758. label: '',
  759. prop: 'radio',
  760. width: 35,
  761. hide: false
  762. },
  763. {
  764. label: "船名",
  765. prop: "vesselCnName",
  766. },
  767. {
  768. label: "航次",
  769. prop: "voyageNo",
  770. },
  771. {
  772. label: "MB/L NO",
  773. prop: "mblno",
  774. },
  775. {
  776. label: "HB/L NO",
  777. prop: "hblno",
  778. },
  779. {
  780. label: "开船日期",
  781. prop: "etd",
  782. },
  783. {
  784. label: "到港日期",
  785. prop: "eta",
  786. },
  787. {
  788. label: "装货港",
  789. prop: "polCnName",
  790. },
  791. {
  792. label: "卸货港",
  793. prop: "podCnName",
  794. width:"120"
  795. },
  796. {
  797. label: "单据编号",
  798. prop: "billNo",
  799. width:"160"
  800. },
  801. {
  802. label: "客户名",
  803. prop: "corpCnName",
  804. },
  805. {
  806. label: "客户英文",
  807. prop: "corpEnName",
  808. },
  809. {
  810. label: "件数",
  811. prop: "quantity",
  812. },
  813. {
  814. label: "包装单位",
  815. prop: "packingUnit",
  816. },
  817. {
  818. label: "毛重",
  819. prop: "grossWeight",
  820. },
  821. {
  822. label: "净重",
  823. prop: "netWeight",
  824. },
  825. {
  826. label: "体积",
  827. prop: "measurement",
  828. },
  829. {
  830. label: "单据日期",
  831. prop: "billDate",
  832. width:"150"
  833. },
  834. ]
  835. },
  836. data: [],
  837. // 弹窗数据
  838. mawbData:[],
  839. // 业务状态数据
  840. billStatusData:[],
  841. // 财务状态
  842. accountStatusData:[],
  843. };
  844. },
  845. computed: {
  846. ...mapGetters(["permission"]),
  847. permissionList() {
  848. return {
  849. addBtn: this.vaildData(this.permission.bills_add, false),
  850. viewBtn: this.vaildData(this.permission.bills_view, false),
  851. delBtn: this.vaildData(this.permission.bills_delete, false),
  852. editBtn: this.vaildData(this.permission.bills_edit, false)
  853. };
  854. },
  855. ids() {
  856. let ids = [];
  857. this.selectionList.forEach(ele => {
  858. ids.push(ele.id);
  859. });
  860. return ids.join(",");
  861. }
  862. },
  863. async created() {
  864. this.option = await this.getColumnData(this.getColumnName(309), this.optionBack);
  865. this.billStatusWorkDictsfun()
  866. this.accountStatusWorkDictsfun()
  867. this.getWorkDictsfun() // 获取签单方式字典数据
  868. },
  869. methods: {
  870. // 展开和收起
  871. shiftCollapsiable(){
  872. this.fold = !this.fold
  873. if(this.fold) {
  874. this.option.searchMenuSpan = 24
  875. }else {
  876. this.option.searchMenuSpan = 6
  877. }
  878. },
  879. // 下拉的回调
  880. corpChange(value,name) {
  881. this.query[name] = value
  882. },
  883. // 获取签单方式字典数据
  884. getWorkDictsfun(){
  885. getWorkDicts('issue_type_F').then(res=>{
  886. this.issueTypeData = res.data.data
  887. })
  888. },
  889. // tabs切换筛选
  890. handleClick(tab, event){
  891. this.onLoad(this.page, this.query);
  892. },
  893. // 获取业务状态字典数据
  894. billStatusWorkDictsfun(){
  895. getWorkDicts('bill_status').then(res=>{
  896. this.findObject(this.option.column, "billStatus").dicData = res.data.data;
  897. this.billStatusData = res.data.data
  898. })
  899. },
  900. // 获取财务状态字典数据
  901. accountStatusWorkDictsfun(){
  902. getWorkDicts('account_status').then(res=>{
  903. this.findObject(this.option.column, "accountStatus").dicData = res.data.data;
  904. this.accountStatusData = res.data.data
  905. })
  906. },
  907. // 添加到主单
  908. increaseMawb(){
  909. if (this.selectionList.length === 0) {
  910. this.$message.warning("请选择至少一条数据");
  911. return;
  912. }
  913. const obj = this.selectionList[0]
  914. for (let item of this.selectionList) {
  915. if (obj.placeReceiptId != item.placeReceiptId) {
  916. // 收货地
  917. this.$message.warning("请选择收货地相同的");
  918. return
  919. }
  920. if (obj.polId != item.polId) {
  921. // 装货港一样
  922. this.$message.warning("请选择装货港相同的");
  923. return
  924. }
  925. }
  926. this.mawbQuery.placeReceiptName = obj.placeReceiptName
  927. this.mawbQuery.polCnName = obj.polCnName
  928. console.log(obj)
  929. this.$nextTick(()=>{
  930. this.dialogVisible = true
  931. })
  932. },
  933. // 下拉显示数据
  934. async expandChange(row){
  935. if (row.billType == 'MM') {
  936. this.SplitLoading = true
  937. const res = await billsListAll({masterId:row.id})
  938. this.$set(row,'billsListAllData',res.data.data)
  939. this.SplitLoading = false
  940. }else {
  941. this.$refs.crud.toggleRowExpansion(row,false)
  942. }
  943. },
  944. // 弹窗单选
  945. radioInput(row){
  946. console.log(row,2134)
  947. console.log(this.dialogRadio,2083)
  948. },
  949. // 弹窗确认
  950. AddToMainOrder(){
  951. console.log(this.dialogRadio,2140)
  952. if (!this.dialogRadio) {
  953. this.$message.warning("请选择一条数据");
  954. return
  955. }
  956. this.billsIncreaseReinsurancePolicyfun(this.ids,this.dialogRadio)
  957. },
  958. // 添加到主单接口
  959. billsIncreaseReinsurancePolicyfun(ids,id){
  960. billsIncreaseReinsurancePolicy(ids,id).then(res=>{
  961. this.$message({
  962. type: "success",
  963. message: "操作成功!"
  964. });
  965. this.dialogVisible = false
  966. this.onLoad(this.page)
  967. })
  968. },
  969. // 弹窗关闭
  970. handleClose(done) {
  971. this.$confirm('确认关闭?')
  972. .then(_ => {
  973. this.dialogRadio = null
  974. done();
  975. })
  976. .catch(_ => {});
  977. },
  978. // 详情的返回列表
  979. goBack() {
  980. // 初始化数据
  981. // this.detailData = this.$options.data().detailData;
  982. if (JSON.stringify(this.$route.query) != "{}") {
  983. this.$router.$avueRouter.closeTag();
  984. this.$router.push({
  985. path: "/iosBasicData/SeafreightExportF/bills/index"
  986. });
  987. }
  988. this.isShow = true;
  989. this.onLoad(this.page, this.search);
  990. },
  991. // 新增弹窗开启
  992. addbtnfun(){
  993. this.detailData.seeDisabled = false
  994. this.isShow = false
  995. },
  996. // 编辑详情打开
  997. rowCellfun(row,index) {
  998. this.detailData = {
  999. seeDisabled: true,
  1000. id: row.id
  1001. };
  1002. this.isShow = false
  1003. this.$nextTick(()=>{
  1004. this.$refs.billsDetails.pageLoading = true
  1005. this.$refs.billsDetails.billsDetailfun(row.id)
  1006. })
  1007. },
  1008. rowSave(row, done, loading) {
  1009. billsSubmit(row).then(() => {
  1010. this.onLoad(this.page);
  1011. this.$message({
  1012. type: "success",
  1013. message: "操作成功!"
  1014. });
  1015. done();
  1016. }, error => {
  1017. loading();
  1018. window.console.log(error);
  1019. });
  1020. },
  1021. rowUpdate(row, index, done, loading) {
  1022. billsSubmit(row).then(() => {
  1023. this.onLoad(this.page);
  1024. this.$message({
  1025. type: "success",
  1026. message: "操作成功!"
  1027. });
  1028. done();
  1029. }, error => {
  1030. loading();
  1031. console.log(error);
  1032. });
  1033. },
  1034. rowDel(row) {
  1035. this.$confirm("确定将选择数据删除?", {
  1036. confirmButtonText: "确定",
  1037. cancelButtonText: "取消",
  1038. type: "warning"
  1039. })
  1040. .then(() => {
  1041. return billsRemove(row.id);
  1042. })
  1043. .then(() => {
  1044. this.onLoad(this.page);
  1045. this.$message({
  1046. type: "success",
  1047. message: "操作成功!"
  1048. });
  1049. });
  1050. },
  1051. handleDelete() {
  1052. if (this.selectionList.length === 0) {
  1053. this.$message.warning("请选择至少一条数据");
  1054. return;
  1055. }
  1056. this.$confirm("确定将选择数据删除?", {
  1057. confirmButtonText: "确定",
  1058. cancelButtonText: "取消",
  1059. type: "warning"
  1060. })
  1061. .then(() => {
  1062. return billsRemove(this.ids);
  1063. })
  1064. .then(() => {
  1065. this.onLoad(this.page);
  1066. this.$message({
  1067. type: "success",
  1068. message: "操作成功!"
  1069. });
  1070. this.$refs.crud.toggleSelection();
  1071. });
  1072. },
  1073. beforeOpen(done, type) {
  1074. if (["edit", "view"].includes(type)) {
  1075. billsDetail(this.form.id).then(res => {
  1076. this.form = res.data.data;
  1077. });
  1078. }
  1079. done();
  1080. },
  1081. searchReset() {
  1082. this.query = {};
  1083. this.onLoad(this.page);
  1084. },
  1085. // 搜索
  1086. searchChange(params, done) {
  1087. this.query = params;
  1088. this.page.currentPage = 1;
  1089. // 判断检索条件是否可以使用
  1090. if(this.etdDisabled) {
  1091. this.query.etdList = this.etdList
  1092. }else {
  1093. delete params.etdList
  1094. }
  1095. if(this.etaDisabled) {
  1096. this.query.etaList = this.etaList
  1097. }else {
  1098. delete params.etaList
  1099. }
  1100. this.onLoad(this.page, params);
  1101. done();
  1102. },
  1103. selectionChange(list) {
  1104. this.selectionList = list;
  1105. },
  1106. selectionClear() {
  1107. this.selectionList = [];
  1108. this.$refs.crud.toggleSelection();
  1109. },
  1110. currentChange(currentPage){
  1111. this.page.currentPage = currentPage;
  1112. },
  1113. sizeChange(pageSize){
  1114. this.page.pageSize = pageSize;
  1115. },
  1116. refreshChange() {
  1117. this.onLoad(this.page, this.query);
  1118. },
  1119. // 列表获取数据
  1120. onLoad(page, params = {}) {
  1121. this.loading = true;
  1122. billsList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  1123. const data = res.data.data;
  1124. this.page.total = data.total;
  1125. this.data = data.records.map(item=>{
  1126. item.billsListAllData = []
  1127. item.billStatus = item.billStatus + ''
  1128. item.accountStatus = item.accountStatus + ''
  1129. return item
  1130. })
  1131. this.loading = false;
  1132. this.selectionClear();
  1133. });
  1134. },
  1135. // 弹窗表格获取数据
  1136. mawbOnLoad(page, params = {}){
  1137. this.mawbloading = true;
  1138. billsList(page.currentPage, page.pageSize, Object.assign(params, this.mawbQuery)).then(res=>{
  1139. const data = res.data.data;
  1140. this.mawbPage.total = data.total;
  1141. this.mawbData = data.records;
  1142. this.mawbloading = false;
  1143. })
  1144. },
  1145. //自定义列保存
  1146. async saveColumnTwo(ref, option, optionBack, code) {
  1147. /**
  1148. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1149. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1150. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1151. */
  1152. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1153. if (inSave) {
  1154. this.$message.success("保存成功");
  1155. //关闭窗口
  1156. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1157. }
  1158. },
  1159. //自定义列重置
  1160. async resetColumnTwo(ref, option, optionBack, code) {
  1161. this[option] = this[optionBack];
  1162. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1163. if (inSave) {
  1164. this.$message.success("重置成功");
  1165. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1166. }
  1167. },
  1168. // 更改表格颜色
  1169. headerClassName(tab) {
  1170. //颜色间隔
  1171. let back = ""
  1172. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  1173. if (tab.columnIndex % 2 === 0) {
  1174. back = "back-one"
  1175. } else if (tab.columnIndex % 2 === 1) {
  1176. back = "back-two"
  1177. }
  1178. }
  1179. return back;
  1180. },
  1181. }
  1182. };
  1183. </script>
  1184. <style scoped>
  1185. ::v-deep#out-table .back-one {
  1186. background: #ecf5ff !important;
  1187. text-align: center;
  1188. }
  1189. ::v-deep#out-table .back-two {
  1190. background: #ecf5ff !important;
  1191. text-align: center;
  1192. }
  1193. /deep/ .el-col-md-8 {
  1194. width: 24.33333%;
  1195. }
  1196. ::v-deep.el-form-item {
  1197. margin-bottom: 0;
  1198. }
  1199. </style>