index.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209
  1. <template>
  2. <div class="app-container">
  3. <div v-show="pageShow">
  4. <el-form
  5. :model="queryParams"
  6. ref="queryForm"
  7. v-show="showSearch"
  8. label-width="70px"
  9. size="small"
  10. >
  11. <el-row>
  12. <el-col :span="6">
  13. <el-form-item label="起运港" prop="polId">
  14. <el-select
  15. v-model="queryParams.polId"
  16. clearable
  17. filterable
  18. placeholder="请输入关键词"
  19. style="width: 100%"
  20. >
  21. <el-option
  22. v-for="(item, index) in podList"
  23. :key="index.fId"
  24. :label="item.fName"
  25. :value="item.fId"
  26. ></el-option>
  27. </el-select>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="6">
  31. <el-form-item label="目的港" prop=" podId">
  32. <el-select
  33. v-model="queryParams.podId"
  34. clearable
  35. filterable
  36. placeholder="请输入关键词"
  37. style="width: 100%"
  38. >
  39. <el-option
  40. v-for="(item, index) in podList"
  41. :key="index.fId"
  42. :label="item.fName"
  43. :value="item.fId"
  44. ></el-option>
  45. </el-select>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="6">
  49. <el-form-item label="船公司" prop="fCorpid">
  50. <el-select
  51. clearable
  52. filterable
  53. placeholder="请输入关键词"
  54. style="width: 100%"
  55. v-model="queryParams.fCorpid"
  56. >
  57. <el-option
  58. v-for="(item, index) in fMblnoOptions"
  59. :key="index.fId"
  60. :label="item.fName"
  61. :value="item.fId"
  62. ></el-option>
  63. </el-select>
  64. </el-form-item>
  65. </el-col>
  66. <el-col :span="6">
  67. <el-form-item label="业务类型" prop="fBilltype">
  68. <el-select
  69. clearable
  70. filterable
  71. placeholder="请选择"
  72. style="width: 100%"
  73. v-model="queryParams.fBilltype"
  74. >
  75. <el-option
  76. v-for="(item, index) in billTypeList"
  77. :key="index.dictValue"
  78. :label="item.dictLabel"
  79. :value="item.dictValue"
  80. />
  81. </el-select>
  82. </el-form-item>
  83. </el-col>
  84. </el-row>
  85. <el-collapse-transition>
  86. <div v-show="show">
  87. <el-row>
  88. <el-col :span="6">
  89. <el-form-item label="航线" prop="fLineid">
  90. <el-select
  91. size="small"
  92. clearable
  93. filterable
  94. placeholder="请选择"
  95. style="width: 80%"
  96. v-model="queryParams.fLineid"
  97. >
  98. <el-option
  99. v-for="(item, index) in fLineList"
  100. :key="index.fId"
  101. :label="item.fName"
  102. :value="item.fId"
  103. />
  104. </el-select>
  105. </el-form-item>
  106. </el-col>
  107. <el-col :span="6">
  108. <el-form-item label="有效期" prop="validdateList">
  109. <el-date-picker
  110. v-model="queryParams.validdateList"
  111. type="daterange"
  112. value-format="yyyy-MM-dd HH:mm:ss"
  113. :default-time="['00:00:00', '23:59:59']"
  114. clearable
  115. style="width: 100%"
  116. range-separator="至"
  117. start-placeholder="开始日期"
  118. end-placeholder="结束日期"
  119. @keyup.enter.native="handleQuery"
  120. >
  121. </el-date-picker>
  122. </el-form-item>
  123. </el-col>
  124. <el-col :span="6">
  125. <el-form-item label="状态" prop="fBillstatus">
  126. <el-select
  127. clearable
  128. filterable
  129. placeholder="请选择"
  130. style="width: 100%"
  131. v-model="queryParams.fBillstatus"
  132. >
  133. <el-option
  134. v-for="(item, index) in statusList"
  135. :key="index.dictValue"
  136. :label="item.dictLabel"
  137. :value="item.dictValue"
  138. />
  139. </el-select>
  140. </el-form-item>
  141. </el-col>
  142. <el-col :span="6">
  143. <el-form-item label="订舱代理" prop="fBookagentid">
  144. <el-select
  145. size="small"
  146. clearable
  147. filterable
  148. placeholder="请选择"
  149. style="width: 80%"
  150. v-model="queryParams.fBookagentid"
  151. >
  152. <el-option
  153. v-for="(item, index) in fBookagentList"
  154. :key="index.fId"
  155. :label="item.fName"
  156. :value="item.fId"
  157. />
  158. </el-select>
  159. </el-form-item>
  160. </el-col>
  161. </el-row>
  162. </div>
  163. </el-collapse-transition>
  164. </el-form>
  165. <el-row :gutter="10" class="mb8">
  166. <el-col :span="1.5">
  167. <el-button
  168. type="primary"
  169. icon="el-icon-plus"
  170. size="mini"
  171. @click="handleAdd"
  172. v-hasPermi="['warehouseBusiness:stockTransfer:add']"
  173. >新增
  174. </el-button>
  175. </el-col>
  176. <el-col :span="1.5">
  177. <el-button
  178. type="success"
  179. icon="el-icon-edit"
  180. size="mini"
  181. :disabled="single"
  182. @click="handleUpdate"
  183. v-hasPermi="['warehouseBusiness:stockTransfer:edit']"
  184. >修改
  185. </el-button>
  186. </el-col>
  187. <el-col :span="1.5">
  188. <el-button
  189. type="warning"
  190. icon="el-icon-download"
  191. size="mini"
  192. @click="handleExport"
  193. v-hasPermi="['warehouseBusiness:stockTransfer:export']"
  194. >导出
  195. </el-button>
  196. </el-col>
  197. <el-col :span="1.5">
  198. <el-button
  199. type="warning"
  200. icon="el-icon-download"
  201. size="mini"
  202. @click="handleExport"
  203. :disabled="multiple"
  204. v-hasPermi="['warehouseBusiness:stockTransfer:export']"
  205. >导入
  206. </el-button>
  207. </el-col>
  208. <el-col :span="1.5">
  209. <el-button
  210. type="info"
  211. icon="el-icon-download"
  212. size="mini"
  213. :disabled="single"
  214. @click="copyUpdate"
  215. v-hasPermi="['agreement:agreementStorage:export']"
  216. >复制新增
  217. </el-button>
  218. </el-col>
  219. <div class="tabSetting">
  220. <div style="margin-right: 20px">
  221. <el-button
  222. type="cyan"
  223. icon="el-icon-search"
  224. size="mini"
  225. @click="handleQuery"
  226. >搜索
  227. </el-button
  228. >
  229. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  230. >重置
  231. </el-button
  232. >
  233. <el-button
  234. v-show="show"
  235. @click="show = !show"
  236. icon="el-icon-arrow-up"
  237. size="mini"
  238. >展开
  239. </el-button
  240. >
  241. <el-button
  242. v-show="!show"
  243. @click="show = !show"
  244. icon="el-icon-arrow-down"
  245. size="mini"
  246. >展开
  247. </el-button
  248. >
  249. </div>
  250. <right-toolbar
  251. :showSearch.sync="showSearch"
  252. @queryTable="getList"
  253. ></right-toolbar>
  254. <div style="margin: 0 12px">
  255. <el-button
  256. icon="el-icon-setting"
  257. size="mini"
  258. circle
  259. @click="showSetting = !showSetting"
  260. ></el-button>
  261. </div>
  262. </div>
  263. </el-row>
  264. <el-dialog
  265. title="自定义列显示"
  266. :visible.sync="showSetting"
  267. width="700px"
  268. v-dialogDrag
  269. :close-on-click-modal="false"
  270. >
  271. <template slot="title">
  272. <div class="avue-crud__dialog__header">
  273. <span class="el-dialog__title">
  274. <span
  275. style="
  276. display: inline-block;
  277. width: 3px;
  278. height: 20px;
  279. margin-right: 5px;
  280. float: left;
  281. margin-top: 2px;
  282. "
  283. ></span>
  284. </span>
  285. </div>
  286. </template>
  287. <div>配置排序列数据(拖动调整顺序)</div>
  288. <div style="margin-left: 17px">
  289. <el-checkbox
  290. v-model="allCheck"
  291. label="全选"
  292. @change="allChecked"
  293. ></el-checkbox>
  294. </div>
  295. <div style="padding: 4px; display: flex; justify-content: center">
  296. <draggable
  297. v-model="setRowList"
  298. group="site"
  299. animation="300"
  300. @start="onStart"
  301. @end="onEnd"
  302. handle=".indraggable"
  303. >
  304. <transition-group>
  305. <div
  306. v-for="item in setRowList"
  307. :key="item.surface"
  308. class="listStyle"
  309. >
  310. <div style="width: 500px" class="indraggable">
  311. <div class="progress" :style="{ width: item.width + 'px' }">
  312. <el-checkbox
  313. :label="item.name"
  314. v-model="item.checked"
  315. :true-label="0"
  316. :false-label="1"
  317. >{{ item.name }}
  318. </el-checkbox>
  319. </div>
  320. </div>
  321. <el-input-number
  322. v-model.number="item.width"
  323. controls-position="right"
  324. :min="1"
  325. :max="500"
  326. size="mini"
  327. ></el-input-number>
  328. </div>
  329. </transition-group>
  330. </draggable>
  331. </div>
  332. <span slot="footer" class="dialog-footer">
  333. <el-button @click="showSetting = false">取 消</el-button>
  334. <el-button @click="delRow" type="danger">重 置</el-button>
  335. <el-button type="primary" @click="save()">确 定</el-button>
  336. </span>
  337. </el-dialog>
  338. <el-table
  339. v-loading="loading"
  340. :data="warehousebillsList"
  341. @selection-change="handleSelectionChange"
  342. show-summary
  343. :summary-method="getSum"
  344. >
  345. <el-table-column type="selection" width="50" fixed align="center"/>
  346. <el-table-column
  347. type="index"
  348. label="行号"
  349. width="50"
  350. align="center"
  351. fixed
  352. />
  353. <el-table-column
  354. v-for="(item, index) in getRowList"
  355. :key="index"
  356. :label="item.name"
  357. :width="item.width"
  358. :prop="item.label"
  359. align="center"
  360. :fixed="item.fixed"
  361. :show-overflow-tooltip="true"
  362. sortable
  363. >
  364. <template slot-scope="scope">
  365. <span v-if="item.label == 'fMblno'">
  366. <el-link :underline="false" type="primary"
  367. ><div @click="handleUpdate(scope.row)">
  368. {{ scope.row.fMblno }}
  369. </div></el-link
  370. >
  371. </span>
  372. <span v-else-if="item.label == 'fValiddate'">
  373. {{ scope.row.fValiddate.slice(0, 10) }}
  374. </span>
  375. <span v-else>{{ scope.row[item.label] }}</span>
  376. </template>
  377. </el-table-column>
  378. <el-table-column
  379. label="操作"
  380. align="center"
  381. class-name="small-padding fixed-width"
  382. min-width="180"
  383. fixed="right"
  384. >
  385. <template slot-scope="scope">
  386. <el-button
  387. size="mini"
  388. type="text"
  389. icon="el-icon-edit"
  390. @click="handleUpdate(scope.row, true)"
  391. v-hasPermi="['warehouseBusiness:stockTransfer:edit']"
  392. >查看
  393. </el-button>
  394. <el-button
  395. size="mini"
  396. type="text"
  397. icon="el-icon-monitor"
  398. @click="estimate(scope.row)"
  399. v-hasPermi="['freight:calculation:button']"
  400. >测算
  401. </el-button>
  402. <el-button
  403. size="mini"
  404. type="text"
  405. icon="el-icon-edit"
  406. v-if="
  407. scope.row.fBillstatus == '录入' ||
  408. scope.row.fBillstatus == '暂存' ||
  409. scope.row.fBillstatus == '驳回'
  410. "
  411. @click="handleUpdate(scope.row, false)"
  412. v-hasPermi="['warehouseBusiness:stockTransfer:edit']"
  413. >修改
  414. </el-button>
  415. <el-button
  416. size="mini"
  417. type="text"
  418. icon="el-icon-delete"
  419. v-if="scope.row.fItemsStatus == '计划'"
  420. @click="handleDelete(scope.row)"
  421. v-hasPermi="['warehouseBusiness:stockTransfer:remove']"
  422. >删除
  423. </el-button>
  424. <el-button
  425. size="mini"
  426. type="text"
  427. icon="el-icon-delete"
  428. v-if="
  429. scope.row.fBillstatus == '请核' ||
  430. scope.row.fBillstatus == '审核中'
  431. "
  432. @click="handleUpdate(scope.row, true)"
  433. >审核进度
  434. </el-button>
  435. </template>
  436. </el-table-column>
  437. </el-table>
  438. <pagination
  439. v-show="total > 0"
  440. :total="total"
  441. :page.sync="queryParams.pageNum"
  442. :limit.sync="queryParams.pageSize"
  443. @pagination="getList"
  444. />
  445. </div>
  446. <el-dialog
  447. title="运费测算"
  448. :visible.sync="dialogVisible"
  449. :before-close="handleClose"
  450. width="70%">
  451. <span>
  452. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  453. <el-row>
  454. <el-col :span="8">
  455. <el-form-item label="起运港:" prop="polId">
  456. <el-select
  457. size="small"
  458. v-model="form.polId"
  459. clearable
  460. filterable
  461. placeholder="请输入关键词"
  462. style="width: 100%"
  463. >
  464. <el-option
  465. v-for="(item, index) in podList"
  466. :key="index.fId"
  467. :label="item.fName"
  468. :value="item.fId"
  469. ></el-option>
  470. </el-select>
  471. </el-form-item>
  472. </el-col>
  473. <el-col :span="8">
  474. <el-form-item label="目的港:" prop="podId">
  475. <el-select
  476. size="small"
  477. v-model="form.podId"
  478. clearable
  479. filterable
  480. placeholder="请输入关键词"
  481. style="width: 100%"
  482. >
  483. <el-option
  484. v-for="(item, index) in podList"
  485. :key="index.fId"
  486. :label="item.fName"
  487. :value="item.fId"
  488. ></el-option>
  489. </el-select>
  490. </el-form-item>
  491. </el-col>
  492. <el-col :span="8">
  493. <el-form-item label="业务类型:" prop="fBilltype">
  494. <el-select
  495. size="small"
  496. v-model="form.fBilltype"
  497. placeholder="请选择"
  498. clearable
  499. style="width: 100%"
  500. >
  501. <el-option
  502. v-for="(item, index) in billTypeList"
  503. :key="index.dictValue"
  504. :label="item.dictLabel"
  505. :value="item.dictValue"
  506. />
  507. </el-select>
  508. </el-form-item>
  509. </el-col>
  510. </el-row>
  511. <el-row>
  512. <el-col :span="8">
  513. <el-form-item label="船公司:" prop="fCorpid">
  514. <el-select
  515. size="small"
  516. v-model="form.fCorpid"
  517. clearable
  518. filterable
  519. placeholder="请输入关键词"
  520. style="width: 100%"
  521. >
  522. <el-option
  523. v-for="(item, index) in fMblnoOptions"
  524. :key="index.fId"
  525. :label="item.fName"
  526. :value="item.fId"
  527. ></el-option>
  528. </el-select>
  529. </el-form-item>
  530. </el-col>
  531. <el-col :span="8">
  532. <el-form-item label="航线:" prop="fLineid">
  533. <el-select
  534. size="small"
  535. clearable
  536. filterable
  537. placeholder="请选择"
  538. style="width: 100%"
  539. v-model="form.fLineid"
  540. >
  541. <el-option
  542. v-for="(item, index) in fLineList"
  543. :key="index.fId"
  544. :label="item.fName"
  545. :value="item.fId"
  546. />
  547. </el-select>
  548. </el-form-item>
  549. </el-col>
  550. <el-col :span="8">
  551. <el-form-item label="订舱代理:" prop="fBookagentid">
  552. <el-select
  553. size="small"
  554. clearable
  555. filterable
  556. placeholder="请选择"
  557. style="width: 100%"
  558. v-model="form.fBookagentid"
  559. >
  560. <el-option
  561. v-for="(item, index) in fBookagentList"
  562. :key="index.fId"
  563. :label="item.fName"
  564. :value="item.fId"
  565. />
  566. </el-select>
  567. </el-form-item>
  568. </el-col>
  569. </el-row>
  570. <el-row>
  571. <el-col :span="8">
  572. <el-form-item label="箱型:" prop="fSpecification">
  573. <el-select size="small" v-model="form.fSpecification" placeholder="请选择" style="width: 100%;" @change="information">
  574. <el-option
  575. v-for="item in [{
  576. id: 'f_specification1',
  577. text: '20GP'
  578. }, {
  579. id: 'f_specification2',
  580. text: '40GP'
  581. }, {
  582. id: 'f_specification3',
  583. text: '40HC'
  584. }, {
  585. id: 'f_specification4',
  586. text: '45HC'
  587. }, {
  588. id: 'f_specification5',
  589. text: '20RH'
  590. }, {
  591. id: 'f_specification6',
  592. text: '40RH'
  593. }]"
  594. :key="item.id"
  595. :label="item.text"
  596. :value="item.id">
  597. </el-option>
  598. </el-select>
  599. </el-form-item>
  600. </el-col>
  601. <el-col :span="8">
  602. <el-form-item label="箱量:" prop="fQty">
  603. <el-input-number v-model="form.fQty" :precision="0" size="small" label="箱量" style="width: 100%;"
  604. placeholder="请输入箱量"></el-input-number>
  605. </el-form-item>
  606. </el-col>
  607. <el-col :span="8">
  608. <el-form-item label="海运费:" prop="shippingFee">
  609. <el-input-number v-model="form.shippingFee" :precision="2" :controls="false" size="small"
  610. style="width: 100%;" placeholder="请输入海运费" @blur="amtrmb"></el-input-number>
  611. </el-form-item>
  612. </el-col>
  613. </el-row>
  614. <el-row>
  615. <el-col :span="8">
  616. <el-form-item label="汇率:" prop="exrate">
  617. <el-input-number v-model="form.exrate" :precision="2" :controls="false" size="small"
  618. style="width: 100%;" placeholder="请输入汇率" @blur="amtrmb"></el-input-number>
  619. </el-form-item>
  620. </el-col>
  621. <el-col :span="8">
  622. <el-form-item label="陆运费:" prop="landFee">
  623. <el-input-number v-model="form.landFee" :precision="2" :controls="false" size="small"
  624. style="width: 100%;" placeholder="请输入陆运费" @blur="amtrmb"></el-input-number>
  625. </el-form-item>
  626. </el-col>
  627. <el-col :span="8">
  628. <el-form-item label="折合人民币:" prop="rmb">
  629. <el-input v-model="form.rmb" disabled placeholder="请输入内容" size="small" style="width: 100%;"></el-input>
  630. </el-form-item>
  631. </el-col>
  632. </el-row>
  633. </el-form>
  634. <div style="display:flex;justify-content: space-between">
  635. <el-button type="primary" icon="el-icon-search" size="mini" @click="submit">立即计算</el-button>
  636. <div v-if="tableData.amt" style="text-align: center;display: flex;align-items: center;justify-content: center;font-weight: bold">
  637. 预测价格:{{tableData.amt}}元
  638. </div>
  639. </div>
  640. <el-table
  641. :data="tableData.fleet"
  642. size="mini"
  643. style="width: 100%">
  644. <el-table-column
  645. type="index"
  646. label="行号"
  647. align="center"
  648. width="50">
  649. </el-table-column>
  650. <el-table-column
  651. prop="fFeeid"
  652. align="center"
  653. label="费用名称">
  654. </el-table-column>
  655. <el-table-column
  656. prop="fUnitprice"
  657. align="center"
  658. label="价格">
  659. </el-table-column>
  660. <el-table-column
  661. prop="remark"
  662. align="center"
  663. label="备注">
  664. </el-table-column>
  665. </el-table>
  666. </span>
  667. <span slot="footer" class="dialog-footer">
  668. <el-button @click="handleClose(null)">取 消</el-button>
  669. </span>
  670. </el-dialog>
  671. <add-or-update
  672. v-show="pageShow2"
  673. @changeShow="showAddOrUpdate"
  674. ref="addOrUpdateRef"
  675. :chiId="formId"
  676. :copyStatus="copyStatus"
  677. :key="timer"
  678. ></add-or-update>
  679. </div>
  680. </template>
  681. <script>
  682. import AddOrUpdate from "./AddOrUpdate.vue";
  683. import {listCorpsList, query, shippingCompany, listRoute, exportSeaprice,calculationDetails,changeSelectShippingFee} from '@/api/warehouseBusiness/shipping'
  684. import {listCorps} from "@/api/basicdata/corps";
  685. import {listWarehousesss} from "@/api/basicdata/warehouse";
  686. import {listGoods} from "@/api/basicdata/goods";
  687. import {listUser, queryUserVal} from "@/api/system/user";
  688. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  689. import Cookies from "js-cookie";
  690. import {addSet, select, resetModule} from "@/api/system/set";
  691. import draggable from "vuedraggable";
  692. import {exportList} from '@/api/finance/query'
  693. export default {
  694. name: "plans",
  695. data() {
  696. return {
  697. timer: "",
  698. form: {},
  699. tableData: [],
  700. rules: {
  701. fBilltype: [{required: true, message: " ", trigger: "blur"}],
  702. fCorpid: [{required: true, message: " ", trigger: "blur"}],
  703. fBillstatus: [{required: true, message: " ", trigger: "blur"}],
  704. polId: [{required: true, message: " ", trigger: "blur"}],
  705. podId: [{required: true, message: " ", trigger: "blur"}],
  706. fSpecification: [{required: true, message: " ", trigger: "blur"}],
  707. // fValiddate: [{ required: true, message: " ", trigger: "blur" }],
  708. },
  709. dialogVisible: false,
  710. pageShow: true,
  711. pageShow2: false,
  712. queryParams: {
  713. pageNum: 1,
  714. pageSize: 10,
  715. fBilltype: null,
  716. fCorpid: null,
  717. polId: null,
  718. podId: null,
  719. fValiddate: null,
  720. remarks: null,
  721. },
  722. // 显示搜索条件
  723. showSearch: true,
  724. userOptions: [],
  725. fTrademodeidOptions: [],
  726. warehouseOptions: [],
  727. goodsOptions: [],
  728. fLineList: [],
  729. fBookagentList: [],
  730. fMblnoOptions: [],
  731. show: false,
  732. drag: false,
  733. tableDate: [
  734. {
  735. surface: "1",
  736. label: "fCorpName",
  737. name: "船公司",
  738. checked: 0,
  739. width: 100,
  740. },
  741. {
  742. surface: "2",
  743. label: "fBilltype",
  744. name: "业务类型",
  745. checked: 0,
  746. width: 100,
  747. },
  748. {
  749. surface: "3",
  750. label: "fBillstatus",
  751. name: "状态",
  752. checked: 0,
  753. width: 100,
  754. },
  755. {
  756. surface: "4",
  757. label: "polName",
  758. name: "起运港",
  759. checked: 0,
  760. width: 100,
  761. },
  762. {
  763. surface: "5",
  764. label: "podName",
  765. name: "目的港",
  766. checked: 0,
  767. width: 100,
  768. },
  769. {
  770. surface: "5",
  771. label: "fValiddate",
  772. name: "有效期",
  773. checked: 0,
  774. width: 100,
  775. },
  776. {
  777. surface: "5",
  778. label: "createBy",
  779. name: "录入人",
  780. checked: 0,
  781. width: 100,
  782. }, {
  783. surface: "6",
  784. label: "fLineName",
  785. name: "航线",
  786. checked: 0,
  787. width: 100,
  788. }, {
  789. surface: "7",
  790. label: "fBookagentName",
  791. name: "订舱代理",
  792. checked: 0,
  793. width: 100,
  794. },
  795. {
  796. surface: "8",
  797. label: "remarks",
  798. name: "备注",
  799. checked: 0,
  800. width: 100,
  801. },
  802. ],
  803. setRowList: [],
  804. getRowList: [],
  805. allCheck: false,
  806. showSetting: false,
  807. total: 0,
  808. warehousebillsList: [],
  809. loading: true,
  810. single: true,
  811. multiple: true,
  812. formId: null,
  813. ids: [],
  814. copyStatus: null,
  815. billTypeList: [],
  816. statusList: [],
  817. polList: [],
  818. podList: [],
  819. };
  820. },
  821. // 使用子组件
  822. components: {draggable, AddOrUpdate},
  823. created() {
  824. this.setRowList = this.tableDate;
  825. this.getRowList = this.tableDate;
  826. this.getDicts("data_trademodes").then((response) => {
  827. this.fTrademodeidOptions = response.data;
  828. });
  829. listGoods({fStatus: 0, delFlag: 0}).then((response) => {
  830. this.goodsOptions = response.rows;
  831. });
  832. listWarehousesss({fStatus: 0, delFlag: 0}).then((response) => {
  833. this.warehouseOptions = response.rows;
  834. });
  835. listCorpsList().then(response => {
  836. this.fLineList = response.rows
  837. })
  838. shippingCompany().then(response => {
  839. this.fBookagentList = response.rows
  840. })
  841. listUser().then((response) => {
  842. this.userOptions = response.rows;
  843. });
  844. listCorps({type: 1}).then((response) => {
  845. this.fMblnoOptions = response.rows;
  846. });
  847. this.getDicts("data_billType").then((response) => {
  848. this.billTypeList = response.data;
  849. });
  850. this.getDicts("data_status").then((response) => {
  851. this.statusList = response.data;
  852. });
  853. // this.getDicts("port_start").then((response) => {
  854. // this.polList = response.data;
  855. // });
  856. // this.getDicts("port_end").then((response) => {
  857. // this.podList = response.data;
  858. // });
  859. listRoute({}).then(response => {
  860. this.podList = response.rows
  861. });
  862. this.getRow();
  863. this.getList();
  864. },
  865. activated() {
  866. if (this.$route.query.id) {
  867. this.handleUpdate(this.$route.query.id);
  868. }
  869. },
  870. methods: {
  871. //测算
  872. estimate(row){
  873. this.tableData = []
  874. this.dialogVisible = true
  875. for (let item of this.billTypeList){
  876. if (item.dictLabel == row.fBilltype){
  877. this.form.fBilltype = item.dictValue
  878. }
  879. }
  880. this.$set(this.form,'fQty',1)
  881. this.$set(this.form,'shippingFee',0)
  882. this.$set(this.form,'exrate',6.8)
  883. // this.$set(this.form,'landFee',0)
  884. this.$set(this.form,'rmb',0)
  885. this.$set(this.form,'fLineid',Number(row.fLineid))
  886. this.$set(this.form,'fBookagentid',Number(row.fBookagentid))
  887. this.$set(this.form,'fCorpid',row.fCorpid)
  888. this.$set(this.form,'polId',row.polId)
  889. this.$set(this.form,'podId',row.podId)
  890. },
  891. //关闭测算
  892. handleClose(done) {
  893. if (done == null){
  894. this.dialogVisible = false
  895. this.$refs["form"].resetFields();
  896. }else {
  897. this.$refs["form"].resetFields();
  898. done()
  899. }
  900. },
  901. //立即计算
  902. submit() {
  903. this.$refs["form"].validate((valid) => {
  904. if (valid) {
  905. calculationDetails(this.form).then(res=>{
  906. this.tableData = res.data
  907. })
  908. }
  909. })
  910. },
  911. //查询运费和汇率
  912. information() {
  913. if (this.form.fSpecification && this.form.fBilltype && this.form.fCorpid) {
  914. changeSelectShippingFee(this.form).then(res=>{
  915. if (res.data) {
  916. this.$set(this.form, 'shippingFee', res.data.fUnitprice)
  917. this.$set(this.form, 'exrate', res.data.fExrate)
  918. this.$set(this.form, 'rmb', res.data.rmb)
  919. }
  920. })
  921. }
  922. },
  923. //折合人民币计算
  924. amtrmb() {
  925. if (this.form.shippingFee && this.form.exrate){
  926. let landFee = this.form.landFee?Number(this.form.landFee):0
  927. this.form.rmb = (Number(this.form.shippingFee) * Number(this.form.exrate)) + Number(landFee);
  928. this.$set(this.form,'rmb',this.form.rmb.toFixed(2))
  929. }else if (this.form.landFee) {
  930. this.form.rmb = this.form.landFee.toFixed(2)
  931. }else {
  932. this.form.rmb = 0
  933. }
  934. },
  935. //列设置全选
  936. allChecked() {
  937. if (this.allCheck == true) {
  938. this.setRowList.map((e) => {
  939. return (e.checked = 0);
  940. });
  941. } else {
  942. this.setRowList.map((e) => {
  943. return (e.checked = 1);
  944. });
  945. }
  946. },
  947. //查询列数据
  948. getRow() {
  949. let that = this;
  950. this.data = {
  951. tableName: "调拨",
  952. userId: Cookies.get("userName"),
  953. };
  954. select(this.data).then((res) => {
  955. if (res.data.length != 0) {
  956. this.getRowList = res.data.filter((e) => e.checked == 0);
  957. this.setRowList = res.data;
  958. this.setRowList = this.setRowList.reduce((res, item) => {
  959. res.push({
  960. surface: item.surface,
  961. label: item.label,
  962. name: item.name,
  963. checked: item.checked,
  964. width: item.width,
  965. fixed: item.fixed,
  966. });
  967. return res;
  968. }, []);
  969. }
  970. });
  971. },
  972. //重置列表
  973. delRow() {
  974. this.data = {
  975. tableName: "调拨",
  976. userId: Cookies.get("userName"),
  977. };
  978. resetModule(this.data).then((res) => {
  979. if (res.code == 200) {
  980. this.showSetting = false;
  981. this.setRowList = this.$options.data().tableDate;
  982. this.getRowList = this.$options.data().tableDate;
  983. }
  984. });
  985. },
  986. //保存列设置
  987. save() {
  988. this.showSetting = false;
  989. this.data = {
  990. tableName: "调拨",
  991. userId: Cookies.get("userName"),
  992. sysTableSetList: this.setRowList,
  993. };
  994. addSet(this.data).then((res) => {
  995. if (res.code == 200) {
  996. this.showSetting = false;
  997. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  998. console.log(this.tableDate);
  999. }
  1000. });
  1001. },
  1002. //开始拖拽事件
  1003. onStart() {
  1004. this.drag = true;
  1005. },
  1006. //拖拽结束事件
  1007. onEnd() {
  1008. this.drag = false;
  1009. },
  1010. getList() {
  1011. //获取仓库
  1012. query(this.queryParams).then((response) => {
  1013. this.warehousebillsList = response.rows;
  1014. this.total = response.total;
  1015. this.loading = false;
  1016. });
  1017. },
  1018. //合计
  1019. getSum(param) {
  1020. const {columns, data} = param;
  1021. const sums = [];
  1022. var values = [];
  1023. columns.forEach((column, index) => {
  1024. if (index === 0) {
  1025. sums[index] = "";
  1026. return;
  1027. }
  1028. if (column.property === "fGrossweight") {
  1029. values = data.map((item) => Number(item["fGrossweight"]));
  1030. }
  1031. if (column.property === "fNetweight") {
  1032. values = data.map((item) => Number(item["fNetweight"]));
  1033. }
  1034. if (column.property === "fQty") {
  1035. values = data.map((item) => Number(item["fQty"]));
  1036. }
  1037. if (column.property === "fPlanqty") {
  1038. values = data.map((item) => Number(item.fPlanqty));
  1039. }
  1040. if (
  1041. column.property === "fGrossweight" ||
  1042. column.property === "fNetweight" ||
  1043. column.property === "fQty" ||
  1044. column.property === "fPlanqty"
  1045. ) {
  1046. sums[index] = values.reduce((prev, curr) => {
  1047. const value = Number(curr);
  1048. if (!isNaN(value)) {
  1049. return prev + curr;
  1050. } else {
  1051. return prev;
  1052. }
  1053. }, 0);
  1054. if (column.property === "fGrossweight") {
  1055. sums[index] = (sums[index] / 1000).toFixed(2) + "吨";
  1056. }
  1057. if (column.property === "fNetweight") {
  1058. sums[index] = (sums[index] / 1000).toFixed(2) + "吨";
  1059. }
  1060. if (column.property === "fQty") {
  1061. sums[index] = sums[index].toFixed(2);
  1062. }
  1063. if (column.property === "fPlanqty") {
  1064. if (sums[index]) {
  1065. sums[index] = sums[index];
  1066. }
  1067. }
  1068. }
  1069. });
  1070. return sums;
  1071. },
  1072. handleAdd() {
  1073. this.timer = new Date().getTime();
  1074. this.pageShow = false;
  1075. this.pageShow2 = true;
  1076. },
  1077. // 多选框选中数据
  1078. handleSelectionChange(selection) {
  1079. this.ids = selection.map((item) => item.fId);
  1080. this.single =
  1081. selection.length !== 1 ||
  1082. selection.map((item) => item.fBillstatus) == 6 ||
  1083. selection.map((item) => item.fBillstatus) == 4;
  1084. this.multiple = !selection.length;
  1085. },
  1086. /** 修改按钮操作 */
  1087. handleUpdate(row) {
  1088. const fId = row.fId || this.ids[0] || row;
  1089. this.copyStatus = null;
  1090. this.formId = fId;
  1091. this.$nextTick(() => {
  1092. this.$refs.addOrUpdateRef.init();
  1093. });
  1094. setTimeout(() => {
  1095. this.pageShow = false;
  1096. this.pageShow2 = true;
  1097. }, 200);
  1098. },
  1099. copyUpdate() {
  1100. this.formId = this.ids[0];
  1101. this.copyStatus = 2;
  1102. this.$nextTick(() => {
  1103. this.$refs.addOrUpdateRef.init();
  1104. });
  1105. setTimeout(() => {
  1106. this.pageShow = false;
  1107. this.pageShow2 = true;
  1108. }, 200);
  1109. },
  1110. handleDelete(row) {
  1111. const ids = row.fId || this.ids;
  1112. delstockTransfer_s(ids).then((data) => {
  1113. switch (data.msg) {
  1114. case "0": {
  1115. this.$message.error("当前数据已被其他操作员操作请刷新页面");
  1116. break;
  1117. }
  1118. case "1": {
  1119. this.delete(ids, "当前主表有数据从表无数据是否删除");
  1120. break;
  1121. }
  1122. case "2": {
  1123. this.delete(ids, "当前主表有数据从表有数据是否删除");
  1124. break;
  1125. }
  1126. default: {
  1127. return this.$message.error("未知错误,无状态");
  1128. }
  1129. }
  1130. });
  1131. },
  1132. delete(ids, tips) {
  1133. this.$confirm(tips, "警告", {
  1134. confirmButtonText: "确定",
  1135. cancelButtonText: "取消",
  1136. type: "warning",
  1137. }).then(() => {
  1138. delStockTransfer(ids);
  1139. this.msgSuccess("删除成功");
  1140. this.getList();
  1141. });
  1142. },
  1143. /** 导出按钮操作 */
  1144. handleExport() {
  1145. this.$confirm("是否确认导出所有运价数据项?", "警告", {
  1146. confirmButtonText: "确定",
  1147. cancelButtonText: "取消",
  1148. type: "warning",
  1149. }).then(() => {
  1150. return exportSeaprice(this.queryParams)
  1151. }).then(res => {
  1152. this.download(res.msg)
  1153. })
  1154. // require.ensure([], () => {
  1155. // const { export_json_to_excel } = require("../../../excel/Export2Excel");
  1156. // const tHeader = ["客户名称", "制单日期"];
  1157. // // 上面设置Excel的表格第一行的标题
  1158. // const filterVal = ["corpId", "createTime"];
  1159. // // 上面的index、nickName、name是tableData里对象的属性
  1160. // const list = this.ftmsorderbillsList; //把data里的tableData存到list
  1161. // const data = this.formatJson(filterVal, list);
  1162. // export_json_to_excel(
  1163. // tHeader,
  1164. // data,
  1165. // "列表excel",
  1166. // true,
  1167. // );
  1168. // });
  1169. },
  1170. formatJson(filterVal, jsonData) {
  1171. return jsonData.map((v) => filterVal.map((j) => v[j]));
  1172. },
  1173. /** 搜索按钮操作 */
  1174. handleQuery() {
  1175. this.queryParams.pageNum = 1;
  1176. this.getList();
  1177. },
  1178. /** 重置按钮操作 */
  1179. resetQuery() {
  1180. this.queryParams = {
  1181. pageNum: 1,
  1182. pageSize: 10,
  1183. fBilltype: null,
  1184. fCorpid: null,
  1185. polId: null,
  1186. podId: null,
  1187. fValiddate: null,
  1188. remarks: null,
  1189. };
  1190. this.handleQuery();
  1191. },
  1192. showAddOrUpdate(data) {
  1193. if (data) {
  1194. this.getList();
  1195. this.pageShow = true;
  1196. this.pageShow2 = false;
  1197. }
  1198. },
  1199. },
  1200. };
  1201. </script>
  1202. <style scoped>
  1203. ::v-deep .el-input__inner {
  1204. text-align: left !important;
  1205. }
  1206. </style>