index.vue 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627
  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. <template slot="search" slot-scope="{row,size}">
  29. <el-form ref="form" :model="row" label-width="80px" :style="fold?'width: 100%':'width: 70%'">
  30. <el-row>
  31. <el-col :span="fold?6:8" >
  32. <el-form-item label="主单号">
  33. <el-input placeholder="请输入主单号" clearable
  34. size="small" style="width:100%" v-model="query.mblno">
  35. </el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :span="fold?6:8">
  39. <el-form-item label="委托人">
  40. <!--<el-input placeholder="请输入委托人" clearable-->
  41. <!-- size="small" style="width:100%" v-model="query.corpCnName">-->
  42. <!--</el-input>-->
  43. <search-query :datalist="corpData"
  44. :selectValue="query.corpCnName"
  45. :filterable="true"
  46. :clearable="true"
  47. :remote="true"
  48. :buttonIf="false"
  49. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  50. placeholder="请输入委托人"
  51. @remoteMethod="corpBcorpslistByType"
  52. @corpChange="corpChange($event,'corpCnName')"
  53. @corpFocus="corpBcorpslistByType" >
  54. </search-query>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="fold?6:8" >
  58. <el-form-item label="业务号">
  59. <el-input placeholder="请输入业务号" clearable
  60. size="small" style="width:100%" v-model="query.billNo">
  61. </el-input>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="6" v-show="fold">
  65. <el-form-item label="单据类型">
  66. <search-query
  67. :datalist="billTypeData"
  68. :selectValue="query.billType"
  69. :filterable="true"
  70. :clearable="true"
  71. :remote="true"
  72. :buttonIf="false"
  73. @corpChange="corpChange($event,'billType')">
  74. </search-query>
  75. </el-form-item>
  76. </el-col>
  77. <el-col :span="6" v-show="fold">
  78. <el-form-item label="分单号">
  79. <el-input placeholder="请输入分单号" clearable
  80. size="small" style="width:100%" v-model="query.hblno">
  81. </el-input>
  82. </el-form-item>
  83. </el-col>
  84. <el-col :span="6" v-show="fold">
  85. <el-form-item label="船名">
  86. <search-query :datalist="vesselData"
  87. :selectValue="query.vesselEnName"
  88. :filterable="true"
  89. :clearable="true"
  90. :remote="true"
  91. :buttonIf="false"
  92. :forParameter="{key:'id',label:'enName',value:'enName'}"
  93. placeholder="请输入船名"
  94. @remoteMethod="vesselBvesselsListfun"
  95. @corpChange="corpChange($event,'vesselEnName')"
  96. @corpFocus="vesselBvesselsListfun" >
  97. </search-query>
  98. </el-form-item>
  99. </el-col>
  100. <el-col :span="6" v-show="fold" >
  101. <el-form-item label="航次">
  102. <el-input placeholder="请输入航次" clearable
  103. size="small" style="width:100%" v-model="query.voyageNo">
  104. </el-input>
  105. </el-form-item>
  106. </el-col>
  107. <el-col :span="6" v-show="fold">
  108. <el-form-item label="船公司">
  109. <search-query :datalist="carrierData"
  110. :selectValue="query.carrierCnName"
  111. :filterable="true"
  112. :clearable="true"
  113. :remote="true"
  114. :buttonIf="false"
  115. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  116. placeholder="请输入船公司"
  117. @remoteMethod="carrierBcorpslistByTypefun"
  118. @corpChange="corpChange($event,'carrierCnName')"
  119. @corpFocus="carrierBcorpslistByTypefun" >
  120. </search-query>
  121. </el-form-item>
  122. </el-col>
  123. <el-col :span="6" v-show="fold">
  124. <el-form-item label="目的港">
  125. <!--<el-input placeholder="请输入目的港" clearable-->
  126. <!-- size="small" style="width:100%" v-model="query.podCnName">-->
  127. <!--</el-input>-->
  128. <search-query :datalist="podData"
  129. :selectValue="query.podEnName"
  130. :filterable="true"
  131. :clearable="true"
  132. :remote="true"
  133. :buttonIf="false"
  134. :forParameter="{key:'id',label:'enName',value:'enName'}"
  135. placeholder="请输入目的港"
  136. @remoteMethod="podBportsListfun"
  137. @corpChange="corpChange($event,'podEnName')"
  138. @corpFocus="podBportsListfun" >
  139. </search-query>
  140. </el-form-item>
  141. </el-col>
  142. <el-col :span="6" v-show="fold">
  143. <el-form-item label="航线">
  144. <!--<el-input placeholder="请输入航线" clearable-->
  145. <!-- size="small" style="width:100%" v-model="query.lineCnName">-->
  146. <!--</el-input>-->
  147. <search-query :datalist="lineData"
  148. :selectValue="query.lineCnName"
  149. :filterable="true"
  150. :clearable="true"
  151. :remote="true"
  152. :buttonIf="false"
  153. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  154. placeholder="请输入航线"
  155. @remoteMethod="lineBlinesListfun"
  156. @corpChange="corpChange($event,'lineCnName')"
  157. @corpFocus="lineBlinesListfun" >
  158. </search-query>
  159. </el-form-item>
  160. </el-col>
  161. <el-col :span="6" v-show="fold">
  162. <el-form-item label="场站">
  163. <!--<el-input placeholder="请输入场站" clearable-->
  164. <!-- size="small" style="width:100%" v-model="query.cyCode">-->
  165. <!--</el-input>-->
  166. <search-query :datalist="cyData"
  167. :selectValue="query.cyCnName"
  168. :filterable="true"
  169. :clearable="true"
  170. :remote="true"
  171. :buttonIf="false"
  172. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  173. placeholder="请输入场站"
  174. @remoteMethod="cyBcorpslistByType"
  175. @corpChange="corpChange($event,'cyCnName')"
  176. @corpFocus="cyBcorpslistByType" >
  177. </search-query>
  178. </el-form-item>
  179. </el-col>
  180. <el-col :span="6" v-show="fold">
  181. <el-form-item label="业务来源">
  182. <search-query
  183. :datalist="srcTypeData"
  184. :selectValue="query.srcType"
  185. :filterable="true"
  186. :clearable="true"
  187. :remote="true"
  188. :buttonIf="false"
  189. @corpChange="corpChange($event,'srcType')">
  190. </search-query>
  191. </el-form-item>
  192. </el-col>
  193. <el-col :span="6" v-show="fold">
  194. <el-form-item label="来源详情">
  195. <el-input placeholder="请输入来源详情" clearable
  196. size="small" style="width:100%" v-model="query.srcCnName">
  197. </el-input>
  198. </el-form-item>
  199. </el-col>
  200. <el-col :span="9" v-show="fold">
  201. <el-form-item label="ETD">
  202. <el-checkbox v-model="etdDisabled">
  203. <el-date-picker
  204. v-model="etdList"
  205. style="width: 100%"
  206. :disabled="!etdDisabled"
  207. size="small"
  208. type="datetimerange"
  209. range-separator="至"
  210. start-placeholder="开始日期"
  211. end-placeholder="结束日期"
  212. format="yyyy-MM-dd HH:mm"
  213. value-format="yyyy-MM-dd HH:mm"
  214. clearable>
  215. </el-date-picker>
  216. </el-checkbox>
  217. </el-form-item>
  218. </el-col>
  219. <el-col :span="9" v-show="fold">
  220. <el-form-item label="ETA">
  221. <el-checkbox v-model="etaDisabled">
  222. <el-date-picker
  223. v-model="etaList"
  224. style="width: 100%"
  225. :disabled="!etaDisabled"
  226. size="small"
  227. type="datetimerange"
  228. range-separator="至"
  229. start-placeholder="开始日期"
  230. end-placeholder="结束日期"
  231. format="yyyy-MM-dd HH:mm"
  232. value-format="yyyy-MM-dd HH:mm"
  233. clearable>
  234. </el-date-picker>
  235. </el-checkbox>
  236. </el-form-item>
  237. </el-col>
  238. <el-col :span="6" v-show="fold">
  239. <el-form-item label="创建部门">
  240. <!--<el-input placeholder="请输入创建部门" clearable-->
  241. <!-- size="small" style="width:100%" v-model="query.createDeptName">-->
  242. <!--</el-input>-->
  243. <tree-select v-model="query.createDeptName" filterable
  244. :data="createDeptData"
  245. :props="{label: 'title', children:'children' }"
  246. nodeKey="title"
  247. size="small"
  248. :multiple="false"
  249. placeholder="请选择创建部门"
  250. @focus="createDeptLzylistfun"
  251. @input="corpChange($event,'createDeptName')">
  252. </tree-select>
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="6" v-show="fold">
  256. <el-form-item label="订舱代理">
  257. <!--<el-input placeholder="请输入订舱代理" clearable-->
  258. <!-- size="small" style="width:100%" v-model="query.bookingAgentCnName">-->
  259. <!--</el-input>-->
  260. <search-query :datalist="bookingAgentData"
  261. :selectValue="query.bookingAgentCnName"
  262. :filterable="true"
  263. :clearable="true"
  264. :remote="true"
  265. :buttonIf="false"
  266. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  267. placeholder="请输入订舱代理"
  268. @remoteMethod="bookingAgentBcorpsListfun"
  269. @corpChange="corpChange($event,'bookingAgentCnName')"
  270. @corpFocus="bookingAgentBcorpsListfun">
  271. </search-query>
  272. </el-form-item>
  273. </el-col>
  274. <el-col :span="6" v-show="fold">
  275. <el-form-item label="签单方式">
  276. <search-query
  277. :datalist="issueTypeData"
  278. :selectValue="query.issueType"
  279. :filterable="true"
  280. :clearable="true"
  281. :remote="true"
  282. :buttonIf="false"
  283. :forParameter="{ key:'dictKey', label:'dictValue', value:'dictValue'}"
  284. @corpChange="corpChange($event,'issueType')" >
  285. </search-query>
  286. </el-form-item>
  287. </el-col>
  288. <el-col :span="6" v-show="fold">
  289. <el-form-item label="收货人">
  290. <!--<el-input placeholder="请输入收货人" clearable-->
  291. <!-- size="small" style="width:100%" v-model="query.hConsigneeCnName">-->
  292. <!--</el-input>-->
  293. <search-query :datalist="hConsigneeData"
  294. :selectValue="query.hConsigneeCnName"
  295. :filterable="true"
  296. :clearable="true"
  297. :remote="true"
  298. :buttonIf="false"
  299. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  300. placeholder="请选择收货人"
  301. @remoteMethod="hConsigneeBcorpslistByType"
  302. @corpChange="corpChange($event,'hConsigneeCnName')"
  303. @corpFocus="hConsigneeBcorpslistByType" >
  304. </search-query>
  305. </el-form-item>
  306. </el-col>
  307. </el-row>
  308. </el-form>
  309. </template>
  310. <template slot="searchMenu" slot-scope="{row,size}">
  311. <el-button type="text" @click="shiftCollapsiable">
  312. <span>
  313. {{ fold ? '收起' : '展开' }}
  314. <i :class="fold ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>
  315. </span>
  316. </el-button>
  317. </template>
  318. <template slot="menuLeft">
  319. <el-button type="primary" size="small" icon="el-icon-plus" @click="addbtnfun()">新建业务
  320. </el-button>
  321. <el-button type="primary"
  322. size="small"
  323. icon="el-icon-delete"
  324. plain @click="CopyDocumentsfun">复制单据
  325. </el-button>
  326. <el-button type="success"
  327. size="small"
  328. icon="el-icon-plus"
  329. plain
  330. @click="increaseMawb">分单->主单
  331. </el-button>
  332. <el-button type="warning"
  333. size="small"
  334. icon="el-icon-delete"
  335. plain
  336. v-if="query.billStatus == 0"
  337. @click="Disembarkingfun">退 舱
  338. </el-button>
  339. <el-button type="primary"
  340. size="small"
  341. icon="el-icon-delete"
  342. plain
  343. v-if="query.billStatus == 1"
  344. @click="revokeWithdrawalfun" >撤销退舱
  345. </el-button>
  346. <el-button type="danger"
  347. size="small"
  348. icon="el-icon-delete"
  349. plain
  350. v-if="query.billStatus != 3"
  351. @click="handleDelete">删 除
  352. </el-button>
  353. <el-dropdown style="line-height: 0">
  354. <el-button size="small" type="success" style="margin-right: 8px" :disabled="selectionList.length == 0" >
  355. 发送 EDI<i class="el-icon-arrow-down el-icon--right"></i>
  356. </el-button>
  357. <el-dropdown-menu slot="dropdown">
  358. <el-dropdown-item v-for="item in ediData" :key="item.id"
  359. @click.native="editypesSendingEdifun(item)" >{{item.cnName}}
  360. </el-dropdown-item>
  361. </el-dropdown-menu>
  362. </el-dropdown>
  363. <div style="margin-top: 10px">
  364. <el-tabs type="card" v-model="query.billStatus" @tab-click="handleClick">
  365. <el-tab-pane label="接单" name="0">
  366. <span slot="label">接单</span>
  367. </el-tab-pane>
  368. <el-tab-pane label="退舱" name="1">
  369. <span slot="label" style="color: #d86363">退舱</span>
  370. </el-tab-pane>
  371. <el-tab-pane label="完成" name="3"></el-tab-pane>
  372. </el-tabs>
  373. </div>
  374. </template>
  375. <template slot-scope="scope" slot="menu">
  376. <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit"
  377. @click.stop="rowCellfun(scope.row.id, scope.index)">编辑
  378. </el-button>
  379. </template>
  380. <template slot="expand" slot-scope="{row}" >
  381. <SplitList :typeMenu="true" :data="row.billsListAllData" :loading="SplitLoading" @corpfun="rowCellfun" ></SplitList>
  382. </template>
  383. <temolate slot="billStatus" slot-scope="{row}">
  384. <span v-if="row.billStatus == item.dictKey"
  385. v-for="(item,index) in billStatusData" :key="index"
  386. :style="{'color':item.colour}" >
  387. {{item.dictValue}}
  388. </span>
  389. </temolate>
  390. <template slot="accountStatus" slot-scope="{ row }">
  391. <span v-if="row.accountStatus == item.dictKey"
  392. v-for="(item,index) in accountStatusData" :key="index"
  393. :style="{'color':item.colour}" >
  394. {{item.dictValue}}
  395. </span>
  396. </template>
  397. <template slot="billNo" slot-scope="scope">
  398. <span style="color: #1e9fff;cursor: pointer;width: 100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;"
  399. @click.stop="rowCellfun(scope.row.id, scope.index)" >
  400. {{scope.row.billNo}}
  401. </span>
  402. </template>
  403. <template slot="eta" slot-scope="scope">
  404. <span>{{scope.row.eta?scope.row.eta.slice(0,10):''}}</span>
  405. </template>
  406. <template slot="updateTime" slot-scope="scope">
  407. <span>{{scope.row.updateTime?scope.row.updateTime.slice(0,10):''}}</span>
  408. </template>
  409. </avue-crud>
  410. </basic-container>
  411. <bills-details ref="billsDetails" v-if="!isShow" :detailData="detailData" @goBack="goBack"></bills-details>
  412. <el-dialog
  413. title="主单列表"
  414. :visible.sync="dialogVisible"
  415. append-to-body
  416. width="60%"
  417. :before-close="handleClose">
  418. <avue-crud :option="mawbOption"
  419. :table-loading="mawbloading"
  420. :data="mawbData"
  421. :page.sync="mawbPage"
  422. :search="mawbQuery"
  423. ref="mawbOptionCrud"
  424. id="out-table"
  425. :header-cell-class-name="headerClassName"
  426. @search-change="mawbSearch"
  427. @resetColumn="resetColumnTwo('mawbOptionCrud', 'mawbOption', 'mawbOptionBack', 309.7)"
  428. @saveColumn="saveColumnTwo('mawbOptionCrud', 'mawbOption', 'mawbOptionBack', 309.7)"
  429. >
  430. <template slot="radio" slot-scope="{row}">
  431. <el-radio v-model="dialogRadio" :label="row.id" @input="radioInput(row)"></el-radio>
  432. </template>
  433. </avue-crud>
  434. <span slot="footer" class="dialog-footer">
  435. <el-button @click="dialogVisible = false;dialogRadio = null">取 消</el-button>
  436. <el-button type="primary" @click="AddToMainOrder">确 定</el-button>
  437. </span>
  438. </el-dialog>
  439. </div>
  440. </template>
  441. <script>
  442. import {
  443. billsList,
  444. billsDetail,
  445. billsSubmit,
  446. billsRemove,
  447. billsIncreaseReinsurancePolicy, billsListAll, billsDisembarking, editypesSendingEdi, billsRevokeDisembarking
  448. } from "@/api/iosBasicData/bills";
  449. import {mapGetters} from "vuex";
  450. import billsDetails from "@/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue";
  451. import feesTemplateItems from "@/views/iosBasicData/losbfeestemplate/feesTemplateItems.vue";
  452. import SplitList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/SplitList.vue";
  453. import {getWorkDicts} from "@/api/system/dictbiz";
  454. import {dateFormat, defaultDate} from "@/util/date";
  455. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  456. import {editypesList} from "@/api/iosBasicData/editypes";
  457. import {getBvesselsList} from "@/api/iosBasicData/bvessels";
  458. import {getBcorpslistByType,getBcorpsDetail} from "@/api/iosBasicData/bcorps";
  459. import {bportsList} from "@/api/iosBasicData/bports";
  460. import {blinesList} from "@/api/iosBasicData/blines";
  461. import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
  462. import { getDeptTree } from "@/api/system/dept";
  463. export default {
  464. components:{TreeSelect, SearchQuery, feesTemplateItems, billsDetails,SplitList},
  465. data() {
  466. return {
  467. ediData:[], // 获取的 edi 数据
  468. // 展开和收回
  469. fold:false,
  470. maxShow:3,
  471. corpData:[], //委托人
  472. hConsigneeData:[], // 收货人
  473. // 船名
  474. vesselData:[],
  475. // 船公司
  476. carrierData:[],
  477. // 目的港(卸货港)
  478. podData:[],
  479. // 航线
  480. lineData:[],
  481. // 场站
  482. cyData:[],
  483. // 订舱代理
  484. bookingAgentData:[],
  485. createDeptData:[], // 部门数据
  486. // 单据类型
  487. billTypeData:[
  488. {
  489. label: '直单',
  490. value: 'DD'
  491. }, {
  492. label: '主单',
  493. value: 'MM'
  494. },{
  495. label: '分单',
  496. value: 'MH'
  497. }
  498. ],
  499. // 业务来源
  500. srcTypeData:[
  501. {
  502. label:'公司',
  503. value:'OWN'
  504. },
  505. {
  506. label:'代理',
  507. value:'AGENT'
  508. },
  509. {
  510. label:'业务员',
  511. value:'SALES'
  512. }
  513. ],
  514. // 签单方式
  515. issueTypeData:[],
  516. isShow:true,
  517. detailData:{},
  518. dialogVisible:false, // 弹窗开启
  519. // ETD是否可以检索
  520. etdDisabled:false,
  521. // ETA是否可以检索
  522. etaDisabled:false,
  523. form: {},
  524. // 开船日期和到港日期
  525. etdList:[defaultDate(1)[0] + ' 00:00',defaultDate(1)[1] + ' 23:59'],
  526. etaList:[defaultDate(1)[0] + ' 00:00',defaultDate(1)[1] + ' 23:59'],
  527. // 表格的检索条件
  528. query: {
  529. billStatus:'0',
  530. },
  531. // 弹窗的搜索项
  532. mawbQuery:{
  533. billType:'MM',
  534. },
  535. loading: true,
  536. // 弹窗加载
  537. mawbloading:false,
  538. // 下拉的加载
  539. SplitLoading:false,
  540. page: {
  541. pageSize: 10,
  542. currentPage: 1,
  543. total: 0
  544. },
  545. // 弹窗分页
  546. mawbPage:{
  547. pageSize: 10,
  548. currentPage: 1,
  549. total: 0
  550. },
  551. selectionList: [],
  552. // 弹窗的选择数据
  553. dialogRadio:null,
  554. option:{},
  555. optionBack: {
  556. // selectable:(row,index)=>{
  557. // // 禁用主单
  558. // return row.billType != 'MM'
  559. // },
  560. expand: true,
  561. expandRowKeys:[],
  562. rowKey:'id',
  563. height:'auto',
  564. calcHeight: 30,
  565. tip: false,
  566. searchShow: true,
  567. searchMenuSpan: 6,
  568. searchLabelWidth:'100',
  569. border: true,
  570. index: true,
  571. selection: true,
  572. dialogClickModal: false,
  573. highlightCurrentRow:true, // 单选
  574. searchIcon: true,
  575. searchIndex: 3,
  576. stripe:true,
  577. addBtn:false,
  578. viewBtn:false,
  579. delBtn:false,
  580. editBtn:false,
  581. menuWidth:'auto',
  582. column: [
  583. {
  584. label: "单据类型",
  585. prop: "billType",
  586. type: 'select',
  587. dicData: [{
  588. label: '直单',
  589. value: 'DD'
  590. }, {
  591. label: '主单',
  592. value: 'MM'
  593. },{
  594. label: '分单',
  595. value: 'MH'
  596. }],
  597. overHidden:true,
  598. },
  599. {
  600. label: "单据编号",
  601. prop: "billNo",
  602. width:"160",
  603. overHidden:true,
  604. },
  605. {
  606. label: "客户名",
  607. prop: "corpCnName",
  608. width:"160",
  609. overHidden:true,
  610. },
  611. {
  612. label: "客户英文",
  613. prop: "corpEnName",
  614. width:"160",
  615. overHidden:true,
  616. },
  617. {
  618. label: "船名",
  619. prop: "vesselCnName",
  620. overHidden:true,
  621. },
  622. {
  623. label: "航次",
  624. prop: "voyageNo",
  625. width: "80",
  626. overHidden: true,
  627. },
  628. {
  629. label: "MB/L NO",
  630. prop: "mblno",
  631. width: "80",
  632. overHidden: true,
  633. // search:true,
  634. // span:6,
  635. },
  636. {
  637. label: "HB/L NO",
  638. prop: "hblno",
  639. width: "80",
  640. overHidden: true,
  641. },
  642. {
  643. label: "开船日期",
  644. prop: "etd",
  645. type: "date",
  646. unlinkPanels: true,
  647. searchRange: true,
  648. overHidden: true,
  649. forma: "yyyy-MM-dd",
  650. valueFormat: "yyyy-MM-dd HH:mm:ss",
  651. searchDefaultTime: ["00:00:00", "23:59:59"],
  652. },
  653. {
  654. label: "到港日期",
  655. prop: "eta",
  656. width: "80",
  657. overHidden: true,
  658. },
  659. {
  660. label: "装货港",
  661. prop: "polCnName",
  662. width:"120",
  663. overHidden:true,
  664. },
  665. {
  666. label: "卸货港",
  667. prop: "podCnName",
  668. width:"120",
  669. overHidden:true,
  670. },
  671. {
  672. label: "装箱方式",
  673. prop: "loadType",
  674. type: 'select',
  675. dicData: [{
  676. label: '整箱',
  677. value: 'FCL'
  678. }, {
  679. label: '拼箱',
  680. value: 'LCL'
  681. }],
  682. overHidden:true,
  683. },
  684. {
  685. label: "货物类别",
  686. prop: "cargoType",
  687. type: 'select',
  688. dicData: [{
  689. label: '普货',
  690. value: 'dry'
  691. }, {
  692. label: '危险品',
  693. value: 'danger'
  694. },{
  695. label: '冻柜',
  696. value: 'reefer'
  697. }],
  698. overHidden:true,
  699. },
  700. {
  701. label: "唛头",
  702. prop: "marks",
  703. width: "80",
  704. overHidden: true,
  705. },
  706. {
  707. label: "件数",
  708. prop: "quantity",
  709. overHidden:true,
  710. },
  711. {
  712. label: "毛重 (KGM)",
  713. prop: "grossWeight",
  714. width:"120",
  715. overHidden:true,
  716. },
  717. {
  718. label: "净重 (KGM)",
  719. prop: "netWeight",
  720. width:"120",
  721. overHidden:true,
  722. },
  723. {
  724. label: "体积 (CBM)",
  725. prop: "measurement",
  726. width:"120",
  727. overHidden:true,
  728. },
  729. {
  730. label: "V20",
  731. prop: "quantityV20",
  732. width:"100",
  733. overHidden:true,
  734. },
  735. {
  736. label: "V40",
  737. prop: "quantityV40",
  738. width:"100",
  739. overHidden:true,
  740. },
  741. {
  742. label: "40HC",
  743. prop: "quantityV40hc",
  744. width:"100",
  745. overHidden:true,
  746. },
  747. {
  748. label: "V45",
  749. prop: "quantityV45",
  750. width:"100",
  751. overHidden:true,
  752. },
  753. {
  754. label: "V48",
  755. prop: "quantityV48",
  756. width:"100",
  757. overHidden:true,
  758. },
  759. {
  760. label: "需陆运",
  761. prop: "isNeedLand",
  762. type: 'select',
  763. dicData: [{
  764. label: '否',
  765. value: 0
  766. }, {
  767. label: '是',
  768. value: 1
  769. }],
  770. overHidden:true,
  771. },
  772. {
  773. label: "需报关",
  774. prop: "isNeedDeclare",
  775. type: 'select',
  776. dicData: [{
  777. label: '否',
  778. value: 0
  779. }, {
  780. label: '是',
  781. value: 1
  782. }],
  783. overHidden:true,
  784. },
  785. {
  786. label: "需三检",
  787. prop: "isNeedIq",
  788. type: 'select',
  789. dicData: [{
  790. label: '否',
  791. value: 0
  792. }, {
  793. label: '是',
  794. value: 1
  795. }],
  796. overHidden:true,
  797. },
  798. {
  799. label: "应收(CNY)",
  800. prop: "amountDr",
  801. width: "160",
  802. overHidden:true,
  803. },
  804. {
  805. label: "应付(CNY)",
  806. prop: "amountCr",
  807. width: "160",
  808. overHidden:true,
  809. },
  810. {
  811. label: "利润(CNY)",
  812. prop: "amountProfit",
  813. width: "160",
  814. overHidden:true,
  815. },
  816. {
  817. // label: "综合 USD 应付(USD) - 非 USD 外币转换为 USD",
  818. label: "综合应付(USD)",
  819. prop: "amountCrUsd",
  820. width: "120",
  821. overHidden:true,
  822. },
  823. {
  824. label: "综合利润(USD)",
  825. prop: "amountProfitUsd",
  826. width: "120",
  827. overHidden:true,
  828. },
  829. {
  830. label: "合计应收(CNY )",
  831. prop: "amountDrLoc",
  832. width:"160",
  833. overHidden:true,
  834. },
  835. {
  836. label: "合计应付(CNY)",
  837. prop: "amountCrLoc",
  838. width:"160",
  839. overHidden:true,
  840. },
  841. {
  842. label: "合计利润(CNY)",
  843. prop: "amountProfitLoc",
  844. width:"160",
  845. overHidden:true,
  846. },
  847. {
  848. label: "应收对账状态",
  849. prop: "checkDrStatusDescr",
  850. width:"160",
  851. overHidden:true,
  852. },
  853. {
  854. label: "应付对账状态",
  855. prop: "checkCrStatusDescr",
  856. width:"160",
  857. overHidden:true,
  858. },
  859. {
  860. label: "应收结算状态",
  861. prop: "stlDrStatusDescr",
  862. width:"160",
  863. overHidden:true,
  864. },
  865. {
  866. label: "应付结算状态",
  867. prop: "stlCrStatusDescr",
  868. width:"160",
  869. overHidden:true,
  870. },
  871. {
  872. label: "销项发票状态",
  873. prop: "invoiceDrStatusDescr",
  874. width:"160",
  875. overHidden:true,
  876. },
  877. {
  878. label: "进项发票状态",
  879. prop: "invoiceCrStatusDescr",
  880. width:"160",
  881. overHidden:true,
  882. },
  883. {
  884. label: "创建人",
  885. prop: "createUserName",
  886. rules: [{
  887. required: true,
  888. message: "请输入创建人",
  889. trigger: "blur"
  890. }],
  891. overHidden:true,
  892. },
  893. {
  894. label: "创建时间",
  895. prop: "createTime",
  896. width:"160",
  897. overHidden:true,
  898. },
  899. {
  900. label: "更新人",
  901. prop: "updateUserName",
  902. overHidden:true,
  903. },
  904. {
  905. label: "更新时间",
  906. prop: "updateTime",
  907. width:"160",
  908. overHidden:true,
  909. },
  910. {
  911. label: "edi发送状态",
  912. prop: "ediStatus",
  913. type:"select",
  914. dicData: [
  915. {
  916. label: '未发送',
  917. value: '0'
  918. },{
  919. label: '已发送',
  920. value: '1'
  921. }
  922. ],
  923. width: "100",
  924. overHidden:true,
  925. },
  926. {
  927. label: "业务状态",
  928. prop: "billStatus",
  929. type:"select",
  930. dicData: [],
  931. props: {
  932. label: "dictValue",
  933. value: "dictKey"
  934. },
  935. width: "100",
  936. overHidden:true,
  937. },
  938. {
  939. label: "财务状态",
  940. prop: "accountStatus",
  941. type:"select",
  942. dicData: [],
  943. props: {
  944. label: "dictValue",
  945. value: "dictKey"
  946. },
  947. width: "180",
  948. overHidden:true,
  949. },
  950. {
  951. label: "审核状态",
  952. prop: "status",
  953. type: 'select',
  954. dicData: [],
  955. props: {
  956. label: "dictValue",
  957. value: "dictKey"
  958. },
  959. overHidden:true,
  960. },
  961. {
  962. label: "备注",
  963. prop: "remarks",
  964. overHidden:true,
  965. },
  966. ]
  967. },
  968. // 弹窗的配置
  969. mawbOption:{},
  970. mawbOptionBack:{
  971. height:'450',
  972. calcHeight: 30,
  973. tip: false,
  974. searchShow: true,
  975. searchMenuSpan: 6,
  976. border: true,
  977. selection: false, // 多选
  978. dialogClickModal: false,
  979. stripe:true,
  980. addBtn:false,
  981. viewBtn:false,
  982. delBtn:false,
  983. editBtn:false,
  984. menu:false,
  985. menuWidth:'auto',
  986. column: [
  987. {
  988. label: '',
  989. prop: 'radio',
  990. width: 35,
  991. hide: false
  992. },
  993. {
  994. label: "船名",
  995. prop: "vesselCnName",
  996. overHidden:true,
  997. },
  998. {
  999. label: "航次",
  1000. prop: "voyageNo",
  1001. overHidden:true,
  1002. },
  1003. {
  1004. label: "MB/L NO",
  1005. prop: "mblno",
  1006. search:true,
  1007. overHidden:true,
  1008. },
  1009. {
  1010. label: "HB/L NO",
  1011. prop: "hblno",
  1012. search:true,
  1013. overHidden:true,
  1014. },
  1015. {
  1016. label: "开船日期",
  1017. prop: "etd",
  1018. overHidden:true,
  1019. },
  1020. {
  1021. label: "到港日期",
  1022. prop: "eta",
  1023. overHidden:true,
  1024. },
  1025. {
  1026. label: "装货港",
  1027. prop: "polCnName",
  1028. overHidden:true,
  1029. },
  1030. {
  1031. label: "卸货港",
  1032. prop: "podCnName",
  1033. width:"120",
  1034. overHidden:true,
  1035. },
  1036. {
  1037. label: "单据编号",
  1038. prop: "billNo",
  1039. width:"160",
  1040. overHidden:true,
  1041. },
  1042. {
  1043. label: "客户名",
  1044. prop: "corpCnName",
  1045. overHidden:true,
  1046. },
  1047. {
  1048. label: "客户英文",
  1049. prop: "corpEnName",
  1050. overHidden:true,
  1051. },
  1052. {
  1053. label: "件数",
  1054. prop: "quantity",
  1055. overHidden:true,
  1056. },
  1057. {
  1058. label: "包装单位",
  1059. prop: "packingUnit",
  1060. overHidden:true,
  1061. },
  1062. {
  1063. label: "毛重",
  1064. prop: "grossWeight",
  1065. overHidden:true,
  1066. },
  1067. {
  1068. label: "净重",
  1069. prop: "netWeight",
  1070. overHidden:true,
  1071. },
  1072. {
  1073. label: "体积",
  1074. prop: "measurement",
  1075. overHidden:true,
  1076. },
  1077. {
  1078. label: "单据日期",
  1079. prop: "billDate",
  1080. width:"150",
  1081. overHidden:true,
  1082. },
  1083. ]
  1084. },
  1085. data: [],
  1086. // 弹窗数据
  1087. mawbData:[],
  1088. // 业务状态数据
  1089. billStatusData:[],
  1090. // 财务状态
  1091. accountStatusData:[],
  1092. };
  1093. },
  1094. computed: {
  1095. ...mapGetters(["permission"]),
  1096. permissionList() {
  1097. return {
  1098. addBtn: this.vaildData(this.permission.bills_add, false),
  1099. viewBtn: this.vaildData(this.permission.bills_view, false),
  1100. delBtn: this.vaildData(this.permission.bills_delete, false),
  1101. editBtn: this.vaildData(this.permission.bills_edit, false)
  1102. };
  1103. },
  1104. ids() {
  1105. let ids = [];
  1106. this.selectionList.forEach(ele => {
  1107. ids.push(ele.id);
  1108. });
  1109. return ids.join(",");
  1110. }
  1111. },
  1112. async created() {
  1113. if (this.$route.query.id) {
  1114. this.rowCellfun(this.$route.query.id)
  1115. }
  1116. this.option = await this.getColumnData(this.getColumnName(309), this.optionBack);
  1117. this.mawbOption = await this.getColumnData(this.getColumnName(309.7), this.mawbOptionBack); // 主单列表
  1118. this.billStatusWorkDictsfun()
  1119. this.accountStatusWorkDictsfun()
  1120. this.getWorkDictsfun() // 获取签单方式字典数据
  1121. this.statusWorkDictsfun() // 业务审核类型
  1122. this.editypesListfun() // edi 数据获取
  1123. },
  1124. methods: {
  1125. // 发送EDI
  1126. editypesSendingEdifun(row){
  1127. row.billId = this.ids
  1128. editypesSendingEdi(row).then(res=>{
  1129. this.$message.success('发送EDI成功')
  1130. this.onLoad(this.page)
  1131. })
  1132. },
  1133. // 获取EDI列表数据
  1134. editypesListfun(){
  1135. editypesList(1,30,{type:'HYCK'}).then(res=>{
  1136. this.ediData = res.data.data.records
  1137. })
  1138. },
  1139. // 展开和收起
  1140. shiftCollapsiable(){
  1141. this.fold = !this.fold
  1142. if(this.fold) {
  1143. this.option.searchMenuSpan = 24
  1144. }else {
  1145. this.option.searchMenuSpan = 6
  1146. }
  1147. },
  1148. // 下拉的回调
  1149. corpChange(value,name) {
  1150. this.query[name] = value
  1151. },
  1152. // 获取签单方式字典数据
  1153. getWorkDictsfun(){
  1154. getWorkDicts('issue_type_F').then(res=>{
  1155. this.issueTypeData = res.data.data
  1156. })
  1157. },
  1158. // tabs切换筛选
  1159. handleClick(tab, event){
  1160. this.onLoad(this.page, this.query);
  1161. },
  1162. // 获取委托人数据
  1163. corpBcorpslistByType(cnName){
  1164. getBcorpslistByType(1,10,{cnName}).then(res=>{
  1165. this.corpData = res.data.data.records
  1166. })
  1167. },
  1168. // 获取收货人数据
  1169. hConsigneeBcorpslistByType(cnName){
  1170. getBcorpslistByType(1,10,{cnName}).then(res=>{
  1171. this.hConsigneeData = res.data.data.records
  1172. })
  1173. },
  1174. // 获取船名
  1175. vesselBvesselsListfun(enName){
  1176. getBvesselsList(1,10,{enName}).then(res=>{
  1177. this.vesselData = res.data.data.records
  1178. })
  1179. },
  1180. // 获取船公司数据
  1181. carrierBcorpslistByTypefun(cnName){
  1182. let corpType = '1712286570540703745'
  1183. getBcorpslistByType(1,10,{cnName,corpType}).then(res=>{
  1184. this.carrierData = res.data.data.records
  1185. })
  1186. },
  1187. // 卸货港数据
  1188. podBportsListfun(enName){
  1189. bportsList(1,10,{enName}).then(res=>{
  1190. this.podData = res.data.data.records
  1191. })
  1192. },
  1193. // 航线数据
  1194. lineBlinesListfun(cnName){
  1195. blinesList(1,10,{cnName}).then(res=>{
  1196. this.lineData = res.data.data.records
  1197. })
  1198. },
  1199. // 获取场站数据
  1200. cyBcorpslistByType(cnName){
  1201. let corpType = '1712286771737272322'
  1202. getBcorpslistByType(1,10,{cnName,corpType}).then(res=>{
  1203. this.cyData = res.data.data.records
  1204. })
  1205. },
  1206. // 订舱代理
  1207. bookingAgentBcorpsListfun(cnName){
  1208. let corpType = '1712285382575398914,1712285645314990082,1712285842321448962,1712286433378574338'
  1209. getBcorpslistByType(1,10,{cnName,corpType}).then(res=>{
  1210. this.bookingAgentData = res.data.data.records
  1211. })
  1212. },
  1213. // 获取核算部分数据 // 机构管理接口
  1214. createDeptLzylistfun(){
  1215. getDeptTree().then(res=>{
  1216. this.createDeptData = res.data.data
  1217. })
  1218. },
  1219. // 获取业务状态字典数据
  1220. billStatusWorkDictsfun(){
  1221. getWorkDicts('bill_status').then(res=>{
  1222. this.findObject(this.option.column, "billStatus").dicData = res.data.data;
  1223. this.billStatusData = res.data.data
  1224. })
  1225. },
  1226. // 获取财务状态字典数据
  1227. accountStatusWorkDictsfun(){
  1228. getWorkDicts('account_status').then(res=>{
  1229. this.findObject(this.option.column, "accountStatus").dicData = res.data.data;
  1230. this.accountStatusData = res.data.data
  1231. })
  1232. },
  1233. // 获取业务审核状态
  1234. statusWorkDictsfun(){
  1235. getWorkDicts('audit_status_los').then(res=>{
  1236. this.findObject(this.option.column, "status").dicData = res.data.data;
  1237. })
  1238. },
  1239. // 添加到主单
  1240. increaseMawb(){
  1241. if (this.selectionList.length === 0) {
  1242. this.$message.warning("请选择至少一条数据");
  1243. return;
  1244. }
  1245. const obj = this.selectionList[0]
  1246. for (let item of this.selectionList) {
  1247. if (item.billType != 'MH') {
  1248. this.$message.warning("请选择分单");
  1249. return;
  1250. }
  1251. if (obj.placeReceiptId != item.placeReceiptId) {
  1252. // 收货地
  1253. this.$message.warning("请选择收货地相同的");
  1254. return
  1255. }
  1256. if (obj.polId != item.polId) {
  1257. // 装货港一样
  1258. this.$message.warning("请选择装货港相同的");
  1259. return
  1260. }
  1261. }
  1262. this.mawbQuery.placeReceiptName = obj.placeReceiptName
  1263. this.mawbQuery.polCnName = obj.polCnName
  1264. this.$nextTick(()=>{
  1265. this.dialogVisible = true
  1266. this.mawbOnLoad(this.mawbPage)
  1267. })
  1268. },
  1269. // 退舱
  1270. Disembarkingfun(){
  1271. if (this.selectionList.length === 0) {
  1272. this.$message.warning("请选择至少一条数据");
  1273. return;
  1274. }
  1275. this.billsDisembarkingfun(this.ids)
  1276. },
  1277. // 退舱接口
  1278. billsDisembarkingfun(ids){
  1279. billsDisembarking(ids).then(res=>{
  1280. this.$message({
  1281. type: "success",
  1282. message: "操作成功!"
  1283. });
  1284. this.onLoad(this.page)
  1285. })
  1286. },
  1287. // 撤销退仓
  1288. revokeWithdrawalfun(){
  1289. if (this.selectionList.length === 0) {
  1290. this.$message.warning("请选择至少一条数据");
  1291. return;
  1292. }
  1293. this.billsRevokeDisembarkingfun(this.ids)
  1294. },
  1295. // 撤销退舱接口
  1296. billsRevokeDisembarkingfun(ids){
  1297. billsRevokeDisembarking(ids).then(res=>{
  1298. this.$message({
  1299. type: "success",
  1300. message: "操作成功!"
  1301. });
  1302. this.onLoad(this.page)
  1303. })
  1304. },
  1305. // 下拉显示数据
  1306. async expandChange(row){
  1307. if (row.billType == 'MM') {
  1308. this.SplitLoading = true
  1309. const res = await billsListAll({masterId:row.id})
  1310. this.$set(row,'billsListAllData',res.data.data)
  1311. this.SplitLoading = false
  1312. }else {
  1313. this.$refs.crud.toggleRowExpansion(row,false)
  1314. }
  1315. },
  1316. // 弹窗单选
  1317. radioInput(row){
  1318. console.log(row,2134)
  1319. console.log(this.dialogRadio,2083)
  1320. },
  1321. // 弹窗确认
  1322. AddToMainOrder(){
  1323. if (!this.dialogRadio) {
  1324. this.$message.warning("请选择一条数据");
  1325. return
  1326. }
  1327. this.billsIncreaseReinsurancePolicyfun(this.ids,this.dialogRadio)
  1328. },
  1329. // 添加到主单接口
  1330. billsIncreaseReinsurancePolicyfun(ids,id){
  1331. billsIncreaseReinsurancePolicy(ids,id).then(res=>{
  1332. this.dialogRadio = null
  1333. this.$message({
  1334. type: "success",
  1335. message: "操作成功!"
  1336. });
  1337. this.dialogVisible = false
  1338. this.onLoad(this.page)
  1339. })
  1340. },
  1341. // 弹窗关闭
  1342. handleClose(done) {
  1343. this.$confirm('确认关闭?')
  1344. .then(_ => {
  1345. this.dialogRadio = null
  1346. done();
  1347. })
  1348. .catch(_ => {});
  1349. },
  1350. // 详情的返回列表
  1351. goBack() {
  1352. // 初始化数据
  1353. // this.detailData = this.$options.data().detailData;
  1354. if (JSON.stringify(this.$route.query) != "{}") {
  1355. this.$router.$avueRouter.closeTag();
  1356. this.$router.push({
  1357. path: "/iosBasicData/SeafreightExportF/bills/index"
  1358. });
  1359. }
  1360. this.isShow = true;
  1361. this.onLoad(this.page, this.search);
  1362. },
  1363. // 新增弹窗开启
  1364. addbtnfun(){
  1365. this.detailData.seeDisabled = false
  1366. this.isShow = false
  1367. },
  1368. // 复制单据
  1369. CopyDocumentsfun(){
  1370. if (this.selectionList.length !== 1) {
  1371. this.$message.warning("请选择一条数据");
  1372. return;
  1373. }
  1374. this.detailData.seeDisabled = false
  1375. this.detailData.id = this.selectionList[0].id
  1376. this.isShow = false
  1377. this.$nextTick(()=>{
  1378. this.$refs.billsDetails.pageLoading = true
  1379. this.$refs.billsDetails.billsCopyBillsfun(this.selectionList[0].id)
  1380. })
  1381. },
  1382. // 编辑详情打开
  1383. rowCellfun(id,index) {
  1384. this.detailData = {
  1385. seeDisabled: false,
  1386. id: id
  1387. };
  1388. this.isShow = false
  1389. this.$nextTick(()=>{
  1390. this.$refs.billsDetails.pageLoading = true
  1391. this.$refs.billsDetails.billsDetailfun(id)
  1392. })
  1393. },
  1394. rowSave(row, done, loading) {
  1395. billsSubmit(row).then(() => {
  1396. this.onLoad(this.page);
  1397. this.$message({
  1398. type: "success",
  1399. message: "操作成功!"
  1400. });
  1401. done();
  1402. }, error => {
  1403. loading();
  1404. window.console.log(error);
  1405. });
  1406. },
  1407. rowUpdate(row, index, done, loading) {
  1408. billsSubmit(row).then(() => {
  1409. this.onLoad(this.page);
  1410. this.$message({
  1411. type: "success",
  1412. message: "操作成功!"
  1413. });
  1414. done();
  1415. }, error => {
  1416. loading();
  1417. console.log(error);
  1418. });
  1419. },
  1420. rowDel(row) {
  1421. this.$confirm("确定将选择数据删除?", {
  1422. confirmButtonText: "确定",
  1423. cancelButtonText: "取消",
  1424. type: "warning"
  1425. })
  1426. .then(() => {
  1427. return billsRemove(row.id);
  1428. })
  1429. .then(() => {
  1430. this.onLoad(this.page);
  1431. this.$message({
  1432. type: "success",
  1433. message: "操作成功!"
  1434. });
  1435. });
  1436. },
  1437. handleDelete() {
  1438. if (this.selectionList.length === 0) {
  1439. this.$message.warning("请选择至少一条数据");
  1440. return;
  1441. }
  1442. // 已经提交请核的提示不让删除
  1443. let sumArr = []
  1444. const h = this.$createElement
  1445. for (let item of this.selectionList) {
  1446. if (item.status == 1) {
  1447. sumArr.push(h('p', `序号${item.$index + 1}的数据已经提交请核请勿删除`))
  1448. }
  1449. }
  1450. if(sumArr.length != 0) {
  1451. this.$confirm('提示', {
  1452. message:h('div', sumArr),
  1453. confirmButtonText: "确定",
  1454. cancelButtonText: "取消",
  1455. type: "warning"
  1456. })
  1457. return;
  1458. }
  1459. this.$confirm("确定将选择数据删除?", {
  1460. confirmButtonText: "确定",
  1461. cancelButtonText: "取消",
  1462. type: "warning"
  1463. })
  1464. .then(() => {
  1465. return billsRemove(this.ids);
  1466. })
  1467. .then(() => {
  1468. this.onLoad(this.page);
  1469. this.$message({
  1470. type: "success",
  1471. message: "操作成功!"
  1472. });
  1473. this.$refs.crud.toggleSelection();
  1474. });
  1475. },
  1476. beforeOpen(done, type) {
  1477. if (["edit", "view"].includes(type)) {
  1478. billsDetail(this.form.id).then(res => {
  1479. this.form = res.data.data;
  1480. });
  1481. }
  1482. done();
  1483. },
  1484. searchReset() {
  1485. this.query = {};
  1486. this.onLoad(this.page);
  1487. },
  1488. // 搜索
  1489. searchChange(params, done) {
  1490. this.query = params;
  1491. this.page.currentPage = 1;
  1492. // 判断检索条件是否可以使用
  1493. if(this.etdDisabled) {
  1494. this.query.etdList = this.etdList
  1495. }else {
  1496. delete params.etdList
  1497. }
  1498. if(this.etaDisabled) {
  1499. this.query.etaList = this.etaList
  1500. }else {
  1501. delete params.etaList
  1502. }
  1503. this.onLoad(this.page, params);
  1504. done();
  1505. },
  1506. selectionChange(list) {
  1507. this.selectionList = list;
  1508. },
  1509. selectionClear() {
  1510. this.selectionList = [];
  1511. this.$refs.crud.toggleSelection();
  1512. },
  1513. currentChange(currentPage){
  1514. this.page.currentPage = currentPage;
  1515. },
  1516. sizeChange(pageSize){
  1517. this.page.pageSize = pageSize;
  1518. },
  1519. refreshChange() {
  1520. this.onLoad(this.page, this.query);
  1521. },
  1522. // 列表获取数据
  1523. onLoad(page, params = {}) {
  1524. this.loading = true;
  1525. billsList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  1526. const data = res.data.data;
  1527. this.page.total = data.total;
  1528. this.data = data.records.map(item=>{
  1529. item.billsListAllData = []
  1530. item.billStatus = item.billStatus + ''
  1531. item.accountStatus = item.accountStatus + ''
  1532. item.status = item.status + ''
  1533. return item
  1534. })
  1535. this.loading = false;
  1536. this.selectionClear();
  1537. });
  1538. },
  1539. // 弹窗表格获取数据
  1540. mawbOnLoad(page, params = {}){
  1541. this.mawbloading = true;
  1542. billsList(page.currentPage, page.pageSize, Object.assign(params, this.mawbQuery)).then(res=>{
  1543. const data = res.data.data;
  1544. this.mawbPage.total = data.total;
  1545. this.mawbData = data.records;
  1546. this.mawbloading = false;
  1547. })
  1548. },
  1549. // 弹窗的搜索
  1550. mawbSearch(params, done){
  1551. this.mawbQuery = params;
  1552. this.mawbPage.currentPage = 1;
  1553. this.mawbOnLoad(this.mawbPage,params)
  1554. done()
  1555. },
  1556. //自定义列保存
  1557. async saveColumnTwo(ref, option, optionBack, code) {
  1558. /**
  1559. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1560. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1561. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1562. */
  1563. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1564. if (inSave) {
  1565. this.$message.success("保存成功");
  1566. //关闭窗口
  1567. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1568. }
  1569. },
  1570. //自定义列重置
  1571. async resetColumnTwo(ref, option, optionBack, code) {
  1572. this[option] = this[optionBack];
  1573. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1574. if (inSave) {
  1575. this.$message.success("重置成功");
  1576. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1577. }
  1578. },
  1579. // 更改表格颜色
  1580. headerClassName(tab) {
  1581. //颜色间隔
  1582. let back = ""
  1583. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  1584. if (tab.columnIndex % 2 === 0) {
  1585. back = "back-one"
  1586. } else if (tab.columnIndex % 2 === 1) {
  1587. back = "back-two"
  1588. }
  1589. }
  1590. return back;
  1591. },
  1592. }
  1593. };
  1594. </script>
  1595. <style scoped>
  1596. ::v-deep#out-table .back-one {
  1597. background: #ecf5ff !important;
  1598. text-align: center;
  1599. }
  1600. ::v-deep#out-table .back-two {
  1601. background: #ecf5ff !important;
  1602. text-align: center;
  1603. }
  1604. /deep/ .el-col-md-8 {
  1605. width: 24.33333%;
  1606. }
  1607. ::v-deep.el-form-item {
  1608. margin-bottom: 0;
  1609. }
  1610. </style>