AddOrUpdate.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  1. <template>
  2. <div>
  3. <div
  4. style="display: flex; justify-content: space-between; margin-bottom: 15px"
  5. >
  6. <div style="display: flex; align-items: center">
  7. <el-breadcrumb separator="/">
  8. <el-breadcrumb-item
  9. ><span style="font-weight: 700">运费规则</span></el-breadcrumb-item
  10. >
  11. <el-breadcrumb-item
  12. ><span style="font-weight: 700">运价维护</span></el-breadcrumb-item
  13. >
  14. </el-breadcrumb>
  15. <el-button
  16. style="margin-left: 10px"
  17. size="mini"
  18. icon="el-icon-arrow-left"
  19. @click="goBack"
  20. >返回列表</el-button
  21. >
  22. </div>
  23. </div>
  24. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  25. <el-row>
  26. <el-col :span="8">
  27. <el-form-item label="船公司" prop="fCorpid">
  28. <el-select
  29. size="small"
  30. v-model="form.fCorpid"
  31. clearable
  32. filterable
  33. placeholder="请输入关键词"
  34. style="width: 80%"
  35. :disabled="formStatus"
  36. >
  37. <el-option
  38. v-for="(item, index) in fMblnoOptions"
  39. :key="index.fId"
  40. :label="item.fName"
  41. :value="item.fId"
  42. ></el-option>
  43. </el-select>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :span="8">
  47. <el-form-item label="起运港" prop="polId">
  48. <el-select
  49. size="small"
  50. v-model="form.polId"
  51. clearable
  52. filterable
  53. placeholder="请输入关键词"
  54. style="width: 80%"
  55. :disabled="formStatus"
  56. >
  57. <el-option
  58. v-for="(item, index) in podList"
  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="8">
  67. <el-form-item label="目的港" prop="podId">
  68. <el-select
  69. size="small"
  70. v-model="form.podId"
  71. clearable
  72. filterable
  73. placeholder="请输入关键词"
  74. style="width: 80%"
  75. :disabled="formStatus"
  76. >
  77. <el-option
  78. v-for="(item, index) in podList"
  79. :key="index.fId"
  80. :label="item.fName"
  81. :value="item.fId"
  82. ></el-option>
  83. </el-select>
  84. </el-form-item>
  85. </el-col>
  86. </el-row>
  87. <el-row>
  88. <el-col :span="8">
  89. <el-form-item label="有效期" prop="fValiddate">
  90. <el-date-picker
  91. v-model="form.fValiddate"
  92. type="date"
  93. placeholder="选择有效期"
  94. size="small"
  95. style="width: 80%"
  96. value-format="timestamp"
  97. :disabled="formStatus"
  98. >
  99. </el-date-picker>
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="8">
  103. <el-form-item label="录入人" prop="createBy">
  104. <el-input
  105. size="small"
  106. v-model="form.createBy"
  107. style="width: 80%"
  108. disabled
  109. laceholder="录入人"
  110. >
  111. </el-input>
  112. </el-form-item>
  113. </el-col>
  114. <el-col :span="8">
  115. <el-form-item label="业务类型" prop="fBilltype">
  116. <el-select
  117. size="small"
  118. v-model="form.fBilltype"
  119. placeholder="请选择结算方式"
  120. clearable
  121. style="width: 80%"
  122. :disabled="formStatus"
  123. >
  124. <el-option
  125. v-for="(item, index) in billTypeList"
  126. :key="index.dictValue"
  127. :label="item.dictLabel"
  128. :value="item.dictValue"
  129. />
  130. </el-select>
  131. </el-form-item>
  132. </el-col>
  133. </el-row>
  134. <el-row>
  135. <el-col :span="8">
  136. <el-form-item label="状态" prop="fBillstatus">
  137. <el-select
  138. size="small"
  139. clearable
  140. filterable
  141. placeholder="请选择"
  142. style="width: 80%"
  143. v-model="form.fBillstatus"
  144. :disabled="formStatus"
  145. >
  146. <el-option
  147. v-for="(item, index) in statusList"
  148. :key="index.dictValue"
  149. :label="item.dictLabel"
  150. :value="item.dictValue"
  151. />
  152. </el-select>
  153. </el-form-item>
  154. </el-col>
  155. <el-col :span="8">
  156. <el-form-item label="航线" prop="fLineid">
  157. <el-select
  158. size="small"
  159. clearable
  160. filterable
  161. placeholder="请选择"
  162. style="width: 80%"
  163. v-model="form.fLineid"
  164. :disabled="formStatus"
  165. >
  166. <el-option
  167. v-for="(item, index) in fLineList"
  168. :key="index.fId"
  169. :label="item.fName"
  170. :value="item.fId"
  171. />
  172. </el-select>
  173. </el-form-item>
  174. </el-col>
  175. <el-col :span="8">
  176. <el-form-item label="订舱代理" prop="fBookagentid">
  177. <el-select
  178. size="small"
  179. clearable
  180. filterable
  181. placeholder="请选择"
  182. style="width: 80%"
  183. v-model="form.fBookagentid"
  184. :disabled="formStatus"
  185. >
  186. <el-option
  187. v-for="(item, index) in fBookagentList"
  188. :key="index.fId"
  189. :label="item.fName"
  190. :value="item.fId"
  191. />
  192. </el-select>
  193. </el-form-item>
  194. </el-col>
  195. </el-row>
  196. <el-row>
  197. <el-col :span="24">
  198. <el-form-item label="备注" prop="remarks">
  199. <el-input
  200. style="width: 94.5%"
  201. v-model="form.remarks"
  202. type="textarea"
  203. placeholder="请输入内容"
  204. :disabled="formStatus"
  205. />
  206. </el-form-item>
  207. </el-col>
  208. </el-row>
  209. </el-form>
  210. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  211. <el-tab-pane label="海运费" name="1">
  212. <div>
  213. <div
  214. style="
  215. display: flex;
  216. justify-content: space-between;
  217. margin-bottom: 10px;
  218. "
  219. >
  220. <div>
  221. <el-button
  222. type="primary"
  223. size="mini"
  224. @click="addDetailRow"
  225. :disabled="formStatus"
  226. >新增</el-button
  227. >
  228. <el-button
  229. type="success"
  230. size="mini"
  231. @click="saveForm"
  232. :disabled="formStatus"
  233. >保存</el-button
  234. >
  235. <el-button type="warning" size="mini" :disabled="formStatus"
  236. >打印</el-button
  237. >
  238. <el-button
  239. type="danger"
  240. size="mini"
  241. @click="submitForm"
  242. :disabled="formStatus"
  243. >请核</el-button
  244. >
  245. <el-button
  246. size="mini"
  247. type="info"
  248. @click="fixForm"
  249. :disabled="!formStatus"
  250. >修改</el-button
  251. >
  252. </div>
  253. <div>
  254. <el-button
  255. icon="el-icon-setting"
  256. size="mini"
  257. circle
  258. @click="showSetting = !showSetting"
  259. ></el-button>
  260. </div>
  261. </div>
  262. <el-table
  263. :data="detailList"
  264. tooltip-effect="dark"
  265. stripe
  266. @selection-change="Selectinventory"
  267. >
  268. <el-table-column type="selection" width="55" align="center" fixed />
  269. <el-table-column label="序号" type="index" width="50" fixed />
  270. <el-table-column
  271. v-for="(item, index) in getRowList"
  272. :key="index"
  273. :label="item.name"
  274. :width="item.width"
  275. :prop="item.label"
  276. align="center"
  277. :fixed="item.fixed"
  278. sortable
  279. >
  280. <template slot-scope="scope">
  281. <span v-if="item.label == 'fFeeid'">
  282. <el-select
  283. v-model="scope.row.fFeeid"
  284. filterable
  285. placeholder="请选择"
  286. :disabled="formStatus"
  287. >
  288. <el-option
  289. v-for="(item, index) in listFeesList"
  290. :key="index.fId"
  291. :label="item.fName"
  292. :value="item.fId"
  293. ></el-option>
  294. </el-select>
  295. </span>
  296. <span v-else-if="item.label == 'fSpecification1'">
  297. <el-input
  298. v-model="scope.row.fSpecification1"
  299. placeholder="请输入"
  300. v-input-limit="2"
  301. :disabled="formStatus"
  302. />
  303. </span>
  304. <span v-else-if="item.label == 'fSpecification2'">
  305. <el-input
  306. v-model="scope.row.fSpecification2"
  307. placeholder="请输入"
  308. v-input-limit="2"
  309. :disabled="formStatus"
  310. />
  311. </span>
  312. <span v-else-if="item.label == 'fSpecification3'">
  313. <el-input
  314. v-model="scope.row.fSpecification3"
  315. placeholder="请输入"
  316. v-input-limit="2"
  317. :disabled="formStatus"
  318. />
  319. </span>
  320. <span v-else-if="item.label == 'fSpecification4'">
  321. <el-input
  322. v-model="scope.row.fSpecification4"
  323. placeholder="请输入"
  324. v-input-limit="2"
  325. :disabled="formStatus"
  326. />
  327. </span>
  328. <span v-else-if="item.label == 'fSpecification5'">
  329. <el-input
  330. v-model="scope.row.fSpecification5"
  331. placeholder="请输入"
  332. v-input-limit="2"
  333. :disabled="formStatus"
  334. />
  335. </span>
  336. <span v-else-if="item.label == 'fSpecification6'">
  337. <el-input
  338. v-model="scope.row.fSpecification6"
  339. placeholder="请输入"
  340. v-input-limit="2"
  341. :disabled="formStatus"
  342. />
  343. </span>
  344. <span v-else-if="item.label == 'fExrate'">
  345. <el-input
  346. v-model="scope.row.fExrate"
  347. placeholder="请输入"
  348. v-input-limit="2"
  349. :disabled="formStatus"
  350. />
  351. </span>
  352. <span v-else-if="item.label == 'createTime'">
  353. {{ scope.row.createTime | fBsdateFormat }}
  354. </span>
  355. <span v-else-if="item.label == 'updateTime'">
  356. {{ scope.row.updateTime | fBsdateFormat }}
  357. </span>
  358. <span v-else-if="item.label == 'remark'">
  359. <el-input
  360. v-model="scope.row.remark"
  361. placeholder="备注"
  362. show-word-limit
  363. :disabled="formStatus"
  364. />
  365. </span>
  366. <span v-else>{{ scope.row[item.label] }}</span>
  367. </template>
  368. </el-table-column>
  369. <el-table-column
  370. header-align="center"
  371. align="center"
  372. label="操作"
  373. width="130px"
  374. fixed="right"
  375. >
  376. <template slot-scope="scope">
  377. <el-button
  378. type="text"
  379. @click.native.prevent="
  380. DeldetailRow(scope.row, scope.$index, detailList, 0)
  381. "
  382. size="small"
  383. :disabled="formStatus"
  384. >移除</el-button
  385. >
  386. </template>
  387. </el-table-column>
  388. </el-table>
  389. </div>
  390. <el-dialog
  391. title="自定义列显示"
  392. :visible.sync="showSetting"
  393. width="700px"
  394. v-dialogDrag
  395. :close-on-click-modal="false"
  396. >
  397. <template slot="title">
  398. <div class="avue-crud__dialog__header">
  399. <span class="el-dialog__title">
  400. <span
  401. style="
  402. display: inline-block;
  403. width: 3px;
  404. height: 20px;
  405. margin-right: 5px;
  406. float: left;
  407. margin-top: 2px;
  408. "
  409. ></span>
  410. </span>
  411. </div>
  412. </template>
  413. <div>配置排序列数据(拖动调整顺序)</div>
  414. <div style="margin-left: 17px">
  415. <el-checkbox
  416. v-model="allCheck"
  417. label="全选"
  418. @change="allChecked"
  419. ></el-checkbox>
  420. </div>
  421. <div style="padding: 4px; display: flex; justify-content: center">
  422. <draggable
  423. v-model="setRowList"
  424. group="site"
  425. animation="300"
  426. @start="onStart"
  427. @end="onEnd"
  428. handle=".indraggable"
  429. >
  430. <transition-group>
  431. <div
  432. v-for="item in setRowList"
  433. :key="item.surface"
  434. class="listStyle"
  435. >
  436. <div style="width: 500px" class="indraggable">
  437. <div class="progress" :style="{ width: item.width + 'px' }">
  438. <el-checkbox
  439. :label="item.name"
  440. v-model="item.checked"
  441. :true-label="0"
  442. :false-label="1"
  443. >{{ item.name }}
  444. </el-checkbox>
  445. </div>
  446. </div>
  447. <el-input-number
  448. v-model.number="item.width"
  449. controls-position="right"
  450. :min="1"
  451. :max="500"
  452. size="small"
  453. ></el-input-number>
  454. </div>
  455. </transition-group>
  456. </draggable>
  457. </div>
  458. <span slot="footer" class="dialog-footer">
  459. <el-button @click="showSetting = false">取 消</el-button>
  460. <el-button @click="delRow" type="danger">重 置</el-button>
  461. <el-button type="primary" @click="save()">确 定</el-button>
  462. </span>
  463. </el-dialog>
  464. </el-tab-pane>
  465. <el-tab-pane label="杂项费" name="2">
  466. <div>
  467. <div style="display: flex; margin-bottom: 10px">
  468. <div>
  469. <el-button
  470. type="primary"
  471. size="mini"
  472. @click="addDetailRow2"
  473. :disabled="formStatus"
  474. >新增</el-button
  475. >
  476. <el-button
  477. type="success"
  478. size="mini"
  479. @click="saveForm"
  480. :disabled="formStatus"
  481. >保存</el-button
  482. >
  483. <el-button type="warning" size="mini" :disabled="formStatus"
  484. >打印</el-button
  485. >
  486. <el-button
  487. type="danger"
  488. size="mini"
  489. @click="submitForm"
  490. :disabled="formStatus"
  491. >请核</el-button
  492. >
  493. <el-button
  494. size="mini"
  495. type="info"
  496. @click="fixForm"
  497. :disabled="!formStatus"
  498. >修改</el-button
  499. >
  500. </div>
  501. </div>
  502. <el-table
  503. :data="detailList2"
  504. tooltip-effect="dark"
  505. stripe
  506. @selection-change="Selectinventory"
  507. >
  508. <el-table-column type="selection" width="55" align="center" fixed />
  509. <el-table-column label="序号" type="index" width="50" fixed />
  510. <el-table-column label="费用" prop="fFeeid" align="center" sortable>
  511. <template slot-scope="scope">
  512. <el-select
  513. v-model="scope.row.fFeeid"
  514. filterable
  515. placeholder="请选择"
  516. :disabled="formStatus"
  517. >
  518. <el-option
  519. v-for="(item, index) in listFeesList"
  520. :key="index.fId"
  521. :label="item.fName"
  522. :value="item.fId"
  523. ></el-option>
  524. </el-select>
  525. </template>
  526. </el-table-column>
  527. <el-table-column
  528. label="单价"
  529. prop="fUnitprice"
  530. align="center"
  531. sortable
  532. >
  533. <template slot-scope="scope">
  534. <el-input
  535. v-model="scope.row.fUnitprice"
  536. placeholder="请输入"
  537. v-input-limit="2"
  538. :disabled="formStatus"
  539. />
  540. </template>
  541. </el-table-column>
  542. <el-table-column label="备注" prop="remark" align="center" sortable>
  543. <template slot-scope="scope">
  544. <el-input
  545. v-model="scope.row.remark"
  546. placeholder="请输入"
  547. :disabled="formStatus"
  548. />
  549. </template>
  550. </el-table-column>
  551. <el-table-column
  552. label="录入人"
  553. prop="createBy"
  554. align="center"
  555. sortable
  556. />
  557. <el-table-column
  558. label="录入时间"
  559. prop="createTime"
  560. align="center"
  561. sortable
  562. >
  563. <template slot-scope="scope">
  564. {{ scope.row.createTime | fBsdateFormat }}
  565. </template>
  566. </el-table-column>
  567. <el-table-column
  568. label="最新修改人"
  569. prop="updateBy"
  570. align="center"
  571. sortable
  572. />
  573. <el-table-column
  574. label="最新修改时间"
  575. prop="updateTime"
  576. align="center"
  577. sortable
  578. >
  579. <template slot-scope="scope">
  580. {{ scope.row.updateTime | fBsdateFormat }}
  581. </template>
  582. </el-table-column>
  583. <el-table-column
  584. header-align="center"
  585. align="center"
  586. label="操作"
  587. width="130px"
  588. fixed="right"
  589. >
  590. <template slot-scope="scope">
  591. <el-button
  592. type="text"
  593. @click.native.prevent="
  594. DeldetailRow(scope.row, scope.$index, detailList2, 1)
  595. "
  596. size="small"
  597. :disabled="formStatus"
  598. >移除</el-button
  599. >
  600. </template>
  601. </el-table-column>
  602. </el-table>
  603. </div>
  604. </el-tab-pane>
  605. </el-tabs>
  606. <br />
  607. <div
  608. style="display: flex; justify-content: flex-end; margin-top: 10px"
  609. ></div>
  610. </div>
  611. </template>
  612. <script>
  613. import {
  614. checkCode,
  615. saveSeaprice,
  616. addSeaprice,
  617. getForm,
  618. listCorpsList,
  619. shippingCompany, listRoute
  620. } from "@/api/warehouseBusiness/shipping";
  621. import { listCorps } from "@/api/basicdata/corps";
  622. import { listFees } from "@/api/basicdata/fees";
  623. import { queryUserVal } from "@/api/system/user";
  624. import ApprovalComments from "@/views/startApproval";
  625. import AddOrUpdate from "@/views/viewApproval";
  626. import Treeselect from "@riophae/vue-treeselect";
  627. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  628. import Cookies from "js-cookie";
  629. import { addSet, select, resetModule } from "@/api/system/set";
  630. import draggable from "vuedraggable";
  631. export default {
  632. name: "inStock",
  633. props: {
  634. chiId: {
  635. type: Number,
  636. required: null,
  637. },
  638. copyStatus: {
  639. type: Number,
  640. required: null,
  641. },
  642. },
  643. components: {
  644. Treeselect,
  645. AddOrUpdate,
  646. ApprovalComments,
  647. draggable,
  648. },
  649. data() {
  650. return {
  651. pageNum: 1,
  652. pageSize: 10,
  653. fMblnoOptions: [],
  654. form: {},
  655. rules: {
  656. fBilltype: [{ required: true, message: " ", trigger: "blur" }],
  657. fCorpid: [{ required: true, message: " ", trigger: "blur" }],
  658. fBillstatus: [{ required: true, message: " ", trigger: "blur" }],
  659. polId: [{ required: true, message: " ", trigger: "blur" }],
  660. podId: [{ required: true, message: " ", trigger: "blur" }],
  661. fValiddate: [{ required: true, message: " ", trigger: "blur" }],
  662. },
  663. drag: false,
  664. tableDate: [
  665. {
  666. surface: "1",
  667. label: "fFeeid",
  668. name: "费用",
  669. checked: 0,
  670. width: 120,
  671. },
  672. {
  673. surface: "2",
  674. label: "fSpecification1",
  675. name: "20GP",
  676. checked: 0,
  677. width: 120,
  678. },
  679. {
  680. surface: "3",
  681. label: "fSpecification2",
  682. name: "40GP",
  683. checked: 0,
  684. width: 100,
  685. },
  686. {
  687. surface: "4",
  688. label: "fSpecification3",
  689. name: "40HC",
  690. checked: 0,
  691. width: 100,
  692. },
  693. {
  694. surface: "5",
  695. label: "fSpecification4",
  696. name: "45HC",
  697. checked: 0,
  698. width: 100,
  699. },
  700. {
  701. surface: "6",
  702. label: "fSpecification5",
  703. name: "20RH",
  704. checked: 0,
  705. width: 100,
  706. },
  707. {
  708. surface: "7",
  709. label: "fSpecification6",
  710. name: "40RH",
  711. checked: 0,
  712. width: 100,
  713. },
  714. {
  715. surface: "8",
  716. label: "fExrate",
  717. name: "汇率",
  718. checked: 0,
  719. width: 120,
  720. },
  721. {
  722. surface: "10",
  723. label: "remark",
  724. name: "备注",
  725. checked: 0,
  726. width: 120,
  727. },
  728. {
  729. surface: "11",
  730. label: "createBy",
  731. name: "录入人",
  732. checked: 0,
  733. width: 120,
  734. },
  735. {
  736. surface: "12",
  737. label: "createTime",
  738. name: "录入时间",
  739. checked: 0,
  740. width: 120,
  741. },
  742. {
  743. surface: "13",
  744. label: "updateBy",
  745. name: "最新修改人",
  746. checked: 0,
  747. width: 150,
  748. },
  749. {
  750. surface: "14",
  751. label: "updateTime",
  752. name: "最新修改时间",
  753. checked: 0,
  754. width: 150,
  755. },
  756. ],
  757. setRowList: [],
  758. getRowList: [],
  759. allCheck: false,
  760. showSetting: false,
  761. activeName: "1",
  762. detailList: [],
  763. detailList2: [],
  764. billTypeList: [],
  765. statusList: [],
  766. polList: [],
  767. podList: [],
  768. listFeesList: [],
  769. formStatus: false,
  770. deleteItem0: [],
  771. deleteItem1: [],
  772. fLineList: [],
  773. fBookagentList: [],
  774. };
  775. },
  776. created() {
  777. this.setRowList = this.tableDate;
  778. this.getRowList = this.tableDate;
  779. listCorps({ type: 1 }).then((response) => {
  780. this.fMblnoOptions = response.rows;
  781. });
  782. listFees().then((response) => {
  783. this.listFeesList = response.rows;
  784. });
  785. this.getDicts("data_billType").then((response) => {
  786. this.billTypeList = response.data;
  787. console.log(this.billTypeList)
  788. });
  789. listCorpsList().then( response =>{
  790. this.fLineList = response.rows
  791. })
  792. shippingCompany().then( response =>{
  793. this.fBookagentList = response.rows
  794. })
  795. this.getDicts("data_status").then((response) => {
  796. console.log(response.data)
  797. this.statusList = response.data;
  798. });
  799. // this.getDicts("port_start").then((response) => {
  800. // this.polList = response.data;
  801. // });
  802. // this.getDicts("port_end").then((response) => {
  803. // this.podList = response.data;
  804. // });
  805. listRoute({}).then(response => {
  806. response.rows.forEach(item=>item.fId = JSON.stringify(item.fId))
  807. this.podList = response.rows
  808. });
  809. this.queryUser();
  810. this.getRow();
  811. },
  812. filters: {
  813. fBsdateFormat(row) {
  814. if (row) {
  815. const dateMat = new Date(row);
  816. const year = dateMat.getFullYear();
  817. const month = dateMat.getMonth() + 1;
  818. const day = dateMat.getDate();
  819. const timeFormat = year + "-" + month + "-" + day;
  820. return timeFormat;
  821. }
  822. },
  823. },
  824. methods: {
  825. init() {
  826. this.resetForm("form");
  827. if(!this.copyStatus){
  828. this.formStatus = true;
  829. }
  830. this.getForm();
  831. },
  832. //列设置全选
  833. allChecked() {
  834. if (this.allCheck == true) {
  835. this.setRowList.map((e) => {
  836. return (e.checked = 0);
  837. });
  838. } else {
  839. this.setRowList.map((e) => {
  840. return (e.checked = 1);
  841. });
  842. }
  843. },
  844. //查询列数据
  845. getRow() {
  846. let that = this;
  847. this.data = {
  848. tableName: "运费规则",
  849. userId: Cookies.get("userName"),
  850. };
  851. select(this.data).then((res) => {
  852. if (res.data.length != 0) {
  853. this.getRowList = res.data.filter((e) => e.checked == 0);
  854. this.setRowList = res.data;
  855. this.setRowList = this.setRowList.reduce((res, item) => {
  856. res.push({
  857. surface: item.surface,
  858. label: item.label,
  859. name: item.name,
  860. checked: item.checked,
  861. width: item.width,
  862. fixed: item.fixed,
  863. });
  864. return res;
  865. }, []);
  866. }
  867. });
  868. },
  869. //重置列表
  870. delRow() {
  871. this.data = {
  872. tableName: "运费规则",
  873. userId: Cookies.get("userName"),
  874. };
  875. resetModule(this.data).then((res) => {
  876. if (res.code == 200) {
  877. this.showSetting = false;
  878. this.setRowList = this.$options.data().tableDate;
  879. this.getRowList = this.$options.data().tableDate;
  880. }
  881. });
  882. },
  883. //保存列设置
  884. save() {
  885. this.showSetting = false;
  886. this.data = {
  887. tableName: "运费规则",
  888. userId: Cookies.get("userName"),
  889. sysTableSetList: this.setRowList,
  890. };
  891. addSet(this.data).then((res) => {
  892. if (res.code == 200) {
  893. this.showSetting = false;
  894. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  895. }
  896. });
  897. },
  898. //开始拖拽事件
  899. onStart() {
  900. this.drag = true;
  901. },
  902. //拖拽结束事件
  903. onEnd() {
  904. this.drag = false;
  905. },
  906. handleClick(tab, event) {
  907. console.log(tab, event);
  908. },
  909. Selectinventory() {},
  910. addDetailRow() {
  911. this.detailList.push({
  912. fFeeid: null,
  913. fSpecification1: null,
  914. fSpecification2: null,
  915. fSpecification3: null,
  916. fSpecification4: null,
  917. fSpecification5: null,
  918. fSpecification6: null,
  919. fExrate: null,
  920. createBy: this.userVal.userName,
  921. createTime: Date.parse(new Date()),
  922. updateBy: this.userVal.userName,
  923. updateTime: Date.parse(new Date()),
  924. });
  925. },
  926. addDetailRow2() {
  927. this.detailList2.push({
  928. fFeeid: null,
  929. fUnitprice: null,
  930. remarks: null,
  931. createBy: this.userVal.userName,
  932. createTime: Date.parse(new Date()),
  933. updateBy: this.userVal.userName,
  934. updateTime: Date.parse(new Date()),
  935. });
  936. },
  937. DeldetailRow(row, index, rows, status) {
  938. if (status == 0 && row.fId) {
  939. this.deleteItem0.push(row.fId);
  940. this.form.deleteItem0 = this.deleteItem0;
  941. console.log(this.form.deleteItem0);
  942. }
  943. if (status == 1 && row.fId) {
  944. this.deleteItem1.push(row.fId);
  945. this.form.deleteItem1 = this.deleteItem1;
  946. console.log(this.form.deleteItem1);
  947. }
  948. rows.splice(index, 1);
  949. },
  950. TFformdata(data) {
  951. data.fBilltype = data.fBilltype ? data.fBilltype.toString() : null;
  952. data.fBillstatus = JSON.stringify(data.fBillstatus).length > 0?JSON.stringify(data.fBillstatus):null
  953. data.polId = data.polId ? data.polId.toString() : null;
  954. data.podId = data.podId ? data.podId.toString() : null;
  955. data.fLineid = data.fLineid ? Number(data.fLineid):null
  956. data.fBookagentid = data.fBookagentid ? Number(data.fBookagentid):null
  957. data.fValiddate = data.fValiddate ? Date.parse(data.fValiddate) : null;
  958. this.form = data;
  959. },
  960. getForm() {
  961. getForm(this.chiId).then((response) => {
  962. this.TFformdata(response.data.seaprice);
  963. this.detailList = response.data.seapriceItem;
  964. this.detailList2 = response.data.seapriceFees;
  965. if (this.copyStatus) {
  966. this.form.fId = null;
  967. this.form.fDateChanged = null;
  968. this.detailList.map((e) => {
  969. e.fId = null;
  970. e.fPid = null;
  971. });
  972. this.detailList2.map((e) => {
  973. e.fId = null;
  974. e.fPid = null;
  975. });
  976. // this.$set(this.form, "fId", null);
  977. // this.detailList;
  978. // this.$set(this.detailList, index);
  979. }
  980. });
  981. },
  982. fixForm() {
  983. let checkData = {
  984. fId: this.form.fId,
  985. fType: "freight",
  986. codeVal: this.form.fDateChanged,
  987. };
  988. checkCode(checkData).then((response) => {
  989. if (!response) {
  990. this.$confirm("数据发生变化,请更新一下数据?", "提示", {
  991. confirmButtonText: "确认",
  992. cancelButtonText: "取消",
  993. type: "warning",
  994. }).then(() => {
  995. this.getForm();
  996. });
  997. } else {
  998. this.formStatus = false;
  999. }
  1000. });
  1001. },
  1002. saveForm() {
  1003. let checkData = {
  1004. fId: this.form.fId,
  1005. fType: "freight",
  1006. codeVal: this.form.fDateChanged,
  1007. };
  1008. checkCode(checkData).then((response) => {
  1009. if (!response) {
  1010. this.$confirm("数据发生变化,请更新一下数据?", "提示", {
  1011. confirmButtonText: "确认",
  1012. cancelButtonText: "取消",
  1013. type: "warning",
  1014. }).then(() => {
  1015. this.getForm();
  1016. });
  1017. } else {
  1018. this.$refs["form"].validate((valid) => {
  1019. if (valid) {
  1020. let formData = new window.FormData();
  1021. formData.append("seaprice", JSON.stringify(this.form));
  1022. // 库存明细1
  1023. formData.append("seapriceItem", JSON.stringify(this.detailList));
  1024. // 库存明细2
  1025. formData.append(
  1026. "seapriceFlees",
  1027. JSON.stringify(this.detailList2)
  1028. );
  1029. saveSeaprice(formData).then((response) => {
  1030. if (response.code == 200) {
  1031. this.TFformdata(response.data.seaprice);
  1032. this.detailList=response.data.itemList?response.data.itemList:[]
  1033. this.detailList2=response.data.itemList2?response.data.itemList2:[]
  1034. this.msgSuccess("保存成功");
  1035. }
  1036. });
  1037. }
  1038. });
  1039. }
  1040. });
  1041. },
  1042. submitForm() {
  1043. let checkData = {
  1044. fId: this.form.fId,
  1045. fType: "freight",
  1046. codeVal: this.form.fDateChanged,
  1047. };
  1048. checkCode(checkData).then((response) => {
  1049. if (!response) {
  1050. this.$confirm("数据发生变化,请更新一下数据?", "提示", {
  1051. confirmButtonText: "确认",
  1052. cancelButtonText: "取消",
  1053. type: "warning",
  1054. }).then(() => {
  1055. this.getForm();
  1056. });
  1057. } else {
  1058. this.$refs["form"].validate((valid) => {
  1059. if (valid) {
  1060. if (!this.detailList.length) {
  1061. return this.$message.error("海运费不能为空");
  1062. }
  1063. for (let item in this.detailList) {
  1064. if (!this.detailList[item].fFeeid) {
  1065. return this.$message.error(
  1066. "海运费第" + (Number(item) + 1) + "行费用不能为空"
  1067. );
  1068. }
  1069. if (this.detailList[item].fSpecification1.length < 1) {
  1070. return this.$message.error(
  1071. "海运费第" + (Number(item) + 1) + "行20GP不能为空"
  1072. );
  1073. }
  1074. if (this.detailList[item].fSpecification2.length < 1) {
  1075. return this.$message.error(
  1076. "海运费第" + (Number(item) + 1) + "行40GP不能为空"
  1077. );
  1078. }
  1079. if (this.detailList[item].fSpecification3.length < 1) {
  1080. return this.$message.error(
  1081. "海运费第" + (Number(item) + 1) + "行40HC不能为空"
  1082. );
  1083. }
  1084. if (this.detailList[item].fSpecification4.length < 1) {
  1085. return this.$message.error(
  1086. "海运费第" + (Number(item) + 1) + "行45HC不能为空"
  1087. );
  1088. }
  1089. if (this.detailList[item].fSpecification5.length < 1) {
  1090. return this.$message.error(
  1091. "海运费第" + (Number(item) + 1) + "行20RH不能为空"
  1092. );
  1093. }
  1094. if (this.detailList[item].fSpecification6.length < 1) {
  1095. return this.$message.error(
  1096. "海运费第" + (Number(item) + 1) + "行40RH不能为空"
  1097. );
  1098. }
  1099. if (this.detailList[item].fExrate.length < 1) {
  1100. return this.$message.error(
  1101. "海运费第" + (Number(item) + 1) + "行汇率不能为空"
  1102. );
  1103. }
  1104. }
  1105. if (!this.detailList2.length) {
  1106. this.$message.error("杂项费不能为空");
  1107. }
  1108. for (let item in this.detailList2) {
  1109. if (!this.detailList2[item].fFeeid) {
  1110. return this.$message.error(
  1111. "杂项费第" + (Number(item) + 1) + "行费用不能为空"
  1112. );
  1113. }
  1114. if (!this.detailList2[item].fUnitprice) {
  1115. return this.$message.error(
  1116. "杂项费第" + (Number(item) + 1) + "行单价不能为空"
  1117. );
  1118. }
  1119. }
  1120. let formData = new window.FormData();
  1121. formData.append("seaprice", JSON.stringify(this.form));
  1122. formData.append("seapriceItem", JSON.stringify(this.detailList));
  1123. formData.append(
  1124. "seapriceFlees",
  1125. JSON.stringify(this.detailList2)
  1126. );
  1127. addSeaprice(formData).then((response) => {
  1128. if (response.code == 200) {
  1129. this.msgSuccess("请核成功");
  1130. this.cancel();
  1131. }
  1132. });
  1133. }
  1134. });
  1135. }
  1136. });
  1137. },
  1138. //获取登陆人
  1139. queryUser() {
  1140. queryUserVal().then((response) => {
  1141. if (response.user !== null) {
  1142. this.userVal = response.user;
  1143. this.$set(this.form, "fDeptid", this.userVal.deptId);
  1144. this.$set(this.form, "createBy", this.userVal.userName);
  1145. this.$set(this.form, "fStorekeeper", this.userVal.nickName);
  1146. this.$set(this.form, "fIfdamage", "1");
  1147. this.$set(this.form, "fIfweigh", "1");
  1148. this.$set(this.form, "fTrademodeid", "1");
  1149. this.$set(this.form, "createTime", Date.parse(new Date()));
  1150. this.$set(this.form, "fBstime", Date.parse(new Date()));
  1151. }
  1152. if (response.dept !== null) {
  1153. this.deptOptions = [];
  1154. this.deptOptions.push(response.dept);
  1155. }
  1156. });
  1157. },
  1158. cancel() {
  1159. if (this.$route.query.id) {
  1160. this.$router.push({ query: {} });
  1161. }
  1162. this.resetForm("form");
  1163. this.$emit("changeShow", "true");
  1164. },
  1165. goBack() {
  1166. this.$confirm("是否确定返回列表?", "提示", {
  1167. confirmButtonText: "确认返回",
  1168. cancelButtonText: "立即保存",
  1169. type: "warning",
  1170. })
  1171. .then(() => {
  1172. this.cancel();
  1173. })
  1174. .catch(() => {
  1175. this.saveForm();
  1176. });
  1177. },
  1178. },
  1179. watch: {
  1180. // 监听 addOrUpdateVisible 改变
  1181. addOrUpdateVisible(oldVal, newVal) {
  1182. this.showDialog = this.addOrUpdateVisible;
  1183. },
  1184. },
  1185. };
  1186. </script>
  1187. <style lang="scss" scoped>
  1188. .tag-hover:hover {
  1189. background-color: #d9ebfb;
  1190. }
  1191. .tag-hover {
  1192. border-top-left-radius: 0;
  1193. border-bottom-left-radius: 0;
  1194. height: 15px;
  1195. padding: 0px 1px;
  1196. line-height: 12px;
  1197. }
  1198. .print-div {
  1199. color: #000;
  1200. }
  1201. .print_table {
  1202. table {
  1203. border-right: 1px solid #000;
  1204. border-bottom: 1px solid #000;
  1205. font-size: 12px;
  1206. margin-bottom: 5px;
  1207. }
  1208. table td {
  1209. border-left: 1px solid #000;
  1210. border-top: 1px solid #000;
  1211. vertical-align: middle;
  1212. padding: 2px;
  1213. text-align: center;
  1214. }
  1215. }
  1216. .print_form {
  1217. font-size: 12px;
  1218. }
  1219. </style>