index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="68px"
  9. >
  10. <el-form-item label="编号" prop="fNo">
  11. <el-input
  12. v-model="queryParams.fNo"
  13. placeholder="请输入编号"
  14. clearable
  15. size="small"
  16. @keyup.enter.native="handleQuery"
  17. />
  18. </el-form-item>
  19. <el-form-item label="名称" prop="fName">
  20. <el-input
  21. v-model="queryParams.fName"
  22. placeholder="请输入名称"
  23. clearable
  24. size="small"
  25. @keyup.enter.native="handleQuery"
  26. />
  27. </el-form-item>
  28. <el-form-item label="费用属性" prop="fFeetype">
  29. <el-select
  30. v-model="queryParams.fFeetype"
  31. placeholder="请选择费用属性"
  32. clearable
  33. size="small"
  34. >
  35. <el-option
  36. v-for="dict in fFeetypeOptions"
  37. :key="dict.dictValue"
  38. :label="dict.dictLabel"
  39. :value="dict.dictValue"
  40. />
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item label="计量单位" prop="fFeeunitid">
  44. <el-select
  45. v-model="queryParams.fFeeunitid"
  46. placeholder="请选择计量单位"
  47. clearable
  48. size="small"
  49. >
  50. <el-option
  51. v-for="dict in fFeeunitidOptions"
  52. :key="dict.dictValue"
  53. :label="dict.dictLabel"
  54. :value="dict.dictValue"
  55. />
  56. </el-select>
  57. </el-form-item>
  58. <el-form-item label="币种" prop="fCurrency">
  59. <el-input
  60. v-model="queryParams.fCurrency"
  61. placeholder="默认RMB"
  62. clearable
  63. size="small"
  64. @keyup.enter.native="handleQuery"
  65. />
  66. </el-form-item>
  67. <el-form-item label="状态" prop="fStatus">
  68. <!-- <el-select v-model="queryParams.fStatus" placeholder="请选择状态" clearable size="small">
  69. <el-option label="请选择字典生成" value="" />
  70. </el-select>-->
  71. <el-select
  72. v-model="queryParams.fStatus"
  73. placeholder="请选择状态"
  74. clearable
  75. size="small"
  76. style="width: 240px"
  77. >
  78. <el-option
  79. v-for="dict in fDocumentOptions"
  80. :key="dict.dictValue"
  81. :label="dict.dictLabel"
  82. :value="dict.dictValue"
  83. />
  84. </el-select>
  85. </el-form-item>
  86. <el-form-item>
  87. <el-button
  88. type="cyan"
  89. icon="el-icon-search"
  90. size="mini"
  91. @click="handleQuery"
  92. >搜索</el-button
  93. >
  94. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  95. >重置</el-button
  96. >
  97. </el-form-item>
  98. </el-form>
  99. <el-row :gutter="10" class="mb8">
  100. <el-col :span="1.5">
  101. <el-button
  102. type="primary"
  103. icon="el-icon-plus"
  104. size="mini"
  105. @click="handleAdd"
  106. v-hasPermi="['basicdata:fees:add']"
  107. >新增</el-button
  108. >
  109. </el-col>
  110. <el-col :span="1.5">
  111. <el-button
  112. type="success"
  113. icon="el-icon-edit"
  114. size="mini"
  115. :disabled="single"
  116. @click="handleUpdate"
  117. v-hasPermi="['basicdata:fees:edit']"
  118. >修改</el-button
  119. >
  120. </el-col>
  121. <el-col :span="1.5">
  122. <el-button
  123. type="danger"
  124. icon="el-icon-delete"
  125. size="mini"
  126. :disabled="multiple"
  127. @click="handleDelete"
  128. v-hasPermi="['basicdata:fees:remove']"
  129. >删除</el-button
  130. >
  131. </el-col>
  132. <el-col :span="1.5">
  133. <el-button
  134. type="warning"
  135. icon="el-icon-download"
  136. size="mini"
  137. @click="handleExport"
  138. v-hasPermi="['basicdata:fees:export']"
  139. >导出</el-button
  140. >
  141. </el-col>
  142. <div class="tabSetting">
  143. <right-toolbar
  144. :showSearch.sync="showSearch"
  145. @queryTable="getList"
  146. ></right-toolbar>
  147. <div style="margin: 0 12px">
  148. <el-tooltip
  149. class="item"
  150. effect="dark"
  151. content="列设置"
  152. placement="top"
  153. >
  154. <el-button
  155. icon="el-icon-setting"
  156. size="mini"
  157. circle
  158. @click="showSetting = !showSetting"
  159. ></el-button>
  160. </el-tooltip>
  161. </div>
  162. </div>
  163. </el-row>
  164. <el-dialog title="自定义列显示" :visible.sync="showSetting" width="700px">
  165. <div>配置排序列数据(拖动调整顺序)</div>
  166. <div style="margin-left: 17px">
  167. <el-checkbox
  168. v-model="allCheck"
  169. label="全选"
  170. @change="allChecked"
  171. ></el-checkbox>
  172. </div>
  173. <div style="padding: 4px; display: flex; justify-content: center">
  174. <draggable
  175. v-model="setRowList"
  176. group="site"
  177. animation="300"
  178. @start="onStart"
  179. @end="onEnd"
  180. handle=".indraggable"
  181. >
  182. <transition-group>
  183. <div
  184. v-for="item in setRowList"
  185. :key="item.surface"
  186. class="listStyle"
  187. >
  188. <div style="width: 500px" class="indraggable">
  189. <div class="progress" :style="{ width: item.width + 'px' }">
  190. <el-checkbox
  191. :label="item.name"
  192. v-model="item.checked"
  193. :true-label="0"
  194. :false-label="1"
  195. >{{ item.name }}
  196. </el-checkbox>
  197. </div>
  198. </div>
  199. <el-input-number
  200. v-model.number="item.width"
  201. controls-position="right"
  202. :min="1"
  203. :max="500"
  204. size="mini"
  205. ></el-input-number>
  206. </div>
  207. </transition-group>
  208. </draggable>
  209. </div>
  210. <span slot="footer" class="dialog-footer">
  211. <el-button @click="showSetting = false">取 消</el-button>
  212. <el-button @click="delRow" type="danger">重 置</el-button>
  213. <el-button type="primary" @click="save()">确 定</el-button>
  214. </span>
  215. </el-dialog>
  216. <el-table
  217. v-loading="loading"
  218. :data="feesList"
  219. @selection-change="handleSelectionChange"
  220. >
  221. <el-table-column type="selection" width="55" align="center" />
  222. <el-table-column type="index" label="序号" align="center" />
  223. <el-table-column
  224. v-for="(item, index) in getRowList"
  225. :key="index"
  226. :label="item.name"
  227. :width="item.width"
  228. :prop="item.label"
  229. align="center"
  230. :fixed="item.fixed"
  231. :show-overflow-tooltip="true"
  232. sortable
  233. />
  234. <!-- <el-table-column label="编号" align="center" prop="fNo" :show-overflow-tooltip="true" />
  235. <el-table-column label="名称" align="center" prop="fName" :show-overflow-tooltip="true" />
  236. <el-table-column label="费用属性" align="center" prop="fFeetype" :formatter="fFeetypeFormat" />
  237. <el-table-column label="收付方向" align="center" prop="fDc">
  238. <template slot-scope="scope">
  239. <span v-if="scope.row.fDc === 'D'">收</span>
  240. <span v-if="scope.row.fDc === 'C'">付</span>
  241. <span v-if="scope.row.fDc === 'DC'">收付</span>
  242. </template>
  243. </el-table-column>
  244. <el-table-column label="计量单位" align="center" prop="fFeeunitid" :formatter="fFeeunitidFormat" />
  245. <el-table-column label="币种" align="center" prop="fCurrency" :show-overflow-tooltip="true" />
  246. <el-table-column label="状态" align="center" prop="fStatus" :formatter="statusFormat" />
  247. <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> -->
  248. <el-table-column
  249. label="操作"
  250. align="center"
  251. class-name="small-padding fixed-width"
  252. width="150"
  253. fixed="right"
  254. >
  255. <template slot-scope="scope">
  256. <el-button
  257. size="mini"
  258. type="text"
  259. icon="el-icon-edit"
  260. @click="handleUpdate(scope.row)"
  261. v-hasPermi="['basicdata:fees:edit']"
  262. >修改</el-button
  263. >
  264. <el-button
  265. size="mini"
  266. type="text"
  267. icon="el-icon-delete"
  268. @click="handleDelete(scope.row)"
  269. v-hasPermi="['basicdata:fees:remove']"
  270. >删除</el-button
  271. >
  272. </template>
  273. </el-table-column>
  274. </el-table>
  275. <pagination
  276. v-show="total > 0"
  277. :total="total"
  278. :page.sync="queryParams.pageNum"
  279. :limit.sync="queryParams.pageSize"
  280. @pagination="getList"
  281. />
  282. <!-- 添加或修改费用信息对话框 -->
  283. <el-dialog
  284. v-dialogDrag
  285. :fullscreen="dialogFull"
  286. :title="title"
  287. :visible.sync="open"
  288. :close-on-click-modal="false"
  289. width="80%"
  290. append-to-body
  291. >
  292. <template slot="title">
  293. <div class="avue-crud__dialog__header">
  294. <span class="el-dialog__title">
  295. <span
  296. style="
  297. display: inline-block;
  298. width: 3px;
  299. height: 20px;
  300. margin-right: 5px;
  301. float: left;
  302. margin-top: 2px;
  303. "
  304. ></span>
  305. 添加费用信息
  306. </span>
  307. <div class="avue-crud__dialog__menu enlarge" @click="full">
  308. <i
  309. style="
  310. cursor: pointer;
  311. display: block;
  312. width: 12px;
  313. height: 12px;
  314. border: 1px solid #909399;
  315. border-top: 3px solid #909399;
  316. margin-top: -3px;
  317. "
  318. ></i>
  319. </div>
  320. </div>
  321. </template>
  322. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  323. <el-row>
  324. <el-col :span="12">
  325. <el-form-item label="编号" prop="fNo">
  326. <el-input
  327. v-model="form.fNo"
  328. placeholder="请输入编号"
  329. style="width: 80%"
  330. />
  331. </el-form-item>
  332. </el-col>
  333. <el-col :span="12">
  334. <el-form-item label="名称" prop="fName">
  335. <el-input
  336. v-model="form.fName"
  337. placeholder="请输入名称"
  338. style="width: 80%"
  339. />
  340. </el-form-item>
  341. </el-col>
  342. </el-row>
  343. <el-row>
  344. <el-col :span="12">
  345. <el-form-item label="费用属性" prop="fFeetype">
  346. <el-select
  347. v-model="form.fFeetype"
  348. placeholder="请选择费用属性"
  349. style="width: 80%"
  350. >
  351. <el-option
  352. v-for="dict in fFeetypeOptions"
  353. :key="dict.dictValue"
  354. :label="dict.dictLabel"
  355. :value="dict.dictValue"
  356. ></el-option>
  357. </el-select>
  358. </el-form-item>
  359. </el-col>
  360. <el-col :span="12">
  361. <el-form-item label="计量单位" prop="fFeeunitid">
  362. <el-select
  363. v-model="form.fFeeunitid"
  364. placeholder="请选择计量单位"
  365. style="width: 80%"
  366. >
  367. <el-option
  368. v-for="dict in fFeeunitidOptions"
  369. :key="dict.dictValue"
  370. :label="dict.dictLabel"
  371. :value="parseInt(dict.dictValue)"
  372. ></el-option>
  373. </el-select>
  374. </el-form-item>
  375. </el-col>
  376. </el-row>
  377. <el-row>
  378. <el-col :span="12">
  379. <el-form-item label="币种" prop="fCurrency">
  380. <el-input
  381. v-model="form.fCurrency"
  382. placeholder="请输入币种"
  383. style="width: 80%"
  384. />
  385. </el-form-item>
  386. </el-col>
  387. <el-col :span="12">
  388. <el-form-item label="状态">
  389. <el-select
  390. v-model="form.fStatus"
  391. placeholder="状态"
  392. style="width: 80%"
  393. >
  394. <el-option
  395. v-for="dict in fDocumentOptions"
  396. :key="dict.dictValue"
  397. :label="dict.dictLabel"
  398. :value="dict.dictValue"
  399. ></el-option>
  400. </el-select>
  401. </el-form-item>
  402. </el-col>
  403. <el-col :span="12">
  404. <el-form-item label="收付方向">
  405. <el-select v-model="form.fDc" placeholder="" style="width: 80%">
  406. <el-option label="收" value="D" />
  407. <el-option label="付" value="C" />
  408. <el-option label="收付" value="DC" />
  409. </el-select>
  410. </el-form-item>
  411. </el-col>
  412. </el-row>
  413. <el-form-item label="备注" prop="remark">
  414. <el-input
  415. v-model="form.remark"
  416. type="textarea"
  417. placeholder="请输入内容"
  418. />
  419. </el-form-item>
  420. </el-form>
  421. <div slot="footer" class="dialog-footer">
  422. <el-button type="primary" @click="submitForm">确 定</el-button>
  423. <el-button @click="cancel">取 消</el-button>
  424. </div>
  425. </el-dialog>
  426. </div>
  427. </template>
  428. <script>
  429. import {
  430. listFees,
  431. getFees,
  432. delFees,
  433. addFees,
  434. updateFees,
  435. exportFees,
  436. } from "../../../api/basicdata/fees";
  437. import Vue from "vue";
  438. import { addSet, select, resetModule } from "@/api/system/set";
  439. import Cookies from "js-cookie";
  440. import draggable from "vuedraggable";
  441. Vue.directive("dialogDrag", {
  442. bind(el, binding, vnode, oldVnode) {
  443. const dialogHeaderEl = el.querySelector(".el-dialog__header");
  444. const dragDom = el.querySelector(".el-dialog");
  445. const enlarge = el.querySelector(".enlarge");
  446. dialogHeaderEl.style.cursor = "move";
  447. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  448. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
  449. if (enlarge) {
  450. enlarge.onclick = (e) => {
  451. dragDom.style.top = "0px";
  452. dragDom.style.left = "0px";
  453. };
  454. }
  455. dialogHeaderEl.onmousedown = (e) => {
  456. // 鼠标按下,计算当前元素距离可视区的距离
  457. const disX = e.clientX - dialogHeaderEl.offsetLeft;
  458. const disY = e.clientY - dialogHeaderEl.offsetTop;
  459. // 获取到的值带px 正则匹配替换
  460. let styL, styT;
  461. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  462. if (sty.left.includes("%")) {
  463. styL =
  464. +document.body.clientWidth * (+sty.left.replace(/\%/g, "") / 100);
  465. styT =
  466. +document.body.clientHeight * (+sty.top.replace(/\%/g, "") / 100);
  467. } else {
  468. styL = +sty.left.replace(/\px/g, "");
  469. styT = +sty.top.replace(/\px/g, "");
  470. }
  471. document.onmousemove = function (e) {
  472. // 通过事件委托,计算移动的距离
  473. const l = e.clientX - disX;
  474. const t = e.clientY - disY;
  475. // 移动当前元素
  476. if (t + styT >= 0) {
  477. dragDom.style.top = `${t + styT}px`;
  478. }
  479. dragDom.style.left = `${l + styL}px`;
  480. // 将此时的位置传出去
  481. // binding.value({x:e.pageX,y:e.pageY})
  482. };
  483. document.onmouseup = function (e) {
  484. document.onmousemove = null;
  485. document.onmouseup = null;
  486. };
  487. };
  488. },
  489. });
  490. export default {
  491. name: "Fees",
  492. components: { draggable },
  493. data() {
  494. return {
  495. //全屏放大
  496. dialogFull: false,
  497. // 遮罩层
  498. loading: true,
  499. // 选中数组
  500. ids: [],
  501. // 非单个禁用
  502. single: true,
  503. // 非多个禁用
  504. multiple: true,
  505. // 显示搜索条件
  506. showSearch: true,
  507. // 总条数
  508. total: 0,
  509. // 费用信息表格数据
  510. feesList: [],
  511. // 弹出层标题
  512. title: "",
  513. // 是否显示弹出层
  514. open: false,
  515. // 费用属性(数据字典)"全部、仓储、海运、空运"字典
  516. fFeetypeOptions: [],
  517. // 计量单位(数据字典)"对应t_unitfees的f_id"字典
  518. fFeeunitidOptions: [],
  519. // 单据状态
  520. fDocumentOptions: [],
  521. // 查询参数
  522. queryParams: {
  523. pageNum: 1,
  524. pageSize: 10,
  525. fNo: null,
  526. fName: null,
  527. fFeetype: null,
  528. fFeeunitid: null,
  529. fCurrency: null,
  530. fStatus: null,
  531. },
  532. // 表单参数
  533. form: {},
  534. // 表单校验
  535. rules: {
  536. fNo: [{ required: true, message: "编号不能为空", trigger: "blur" }],
  537. fName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
  538. },
  539. showSetting: false,
  540. drag: false,
  541. setRowList: [],
  542. getRowList: [],
  543. tableDate: [
  544. {
  545. surface: "1",
  546. label: "fNo",
  547. name: "编号",
  548. checked: 0,
  549. width: 150,
  550. },
  551. {
  552. surface: "2",
  553. label: "fName",
  554. name: "名称",
  555. checked: 0,
  556. width: 150,
  557. },
  558. {
  559. surface: "3",
  560. label: "fFeetype",
  561. name: "费用属性",
  562. checked: 0,
  563. width: 150,
  564. },
  565. {
  566. surface: "4",
  567. label: "fDc",
  568. name: "收付方向",
  569. checked: 0,
  570. width: 100,
  571. },
  572. {
  573. surface: "5",
  574. label: "fFeeunitid",
  575. name: "计量单位",
  576. checked: 0,
  577. width: 100,
  578. },
  579. {
  580. surface: "6",
  581. label: "fCurrency",
  582. name: "币种",
  583. checked: 0,
  584. width: 100,
  585. },
  586. {
  587. surface: "7",
  588. label: "fStatus",
  589. name: "状态",
  590. checked: 0,
  591. width: 100,
  592. },
  593. {
  594. surface: "8",
  595. label: "remark",
  596. name: "备注",
  597. checked: 0,
  598. width: null,
  599. },
  600. ],
  601. allCheck: false,
  602. };
  603. },
  604. created() {
  605. this.setRowList = this.tableDate;
  606. this.getRowList = this.tableDate;
  607. this.getDicts("data_cost_attribute").then((response) => {
  608. this.fFeetypeOptions = response.data;
  609. });
  610. this.getDicts("document_status").then((response) => {
  611. this.fDocumentOptions = response.data;
  612. });
  613. this.getDicts("data_unitfees").then((response) => {
  614. this.fFeeunitidOptions = response.data;
  615. });
  616. this.getRow();
  617. this.getList();
  618. },
  619. methods: {
  620. //列设置全选
  621. allChecked() {
  622. if (this.allCheck == true) {
  623. this.setRowList.map((e) => {
  624. return (e.checked = 0);
  625. });
  626. } else {
  627. this.setRowList.map((e) => {
  628. return (e.checked = 1);
  629. });
  630. }
  631. },
  632. //查询列数据
  633. getRow() {
  634. let that = this;
  635. this.data = {
  636. tableName: "我的审核",
  637. userId: Cookies.get("userName"),
  638. };
  639. select(this.data).then((res) => {
  640. if (res.data.length != 0) {
  641. this.getRowList = res.data.filter((e) => e.checked == 0);
  642. this.setRowList = res.data;
  643. this.setRowList = this.setRowList.reduce((res, item) => {
  644. res.push({
  645. surface: item.surface,
  646. label: item.label,
  647. name: item.name,
  648. checked: item.checked,
  649. width: item.width,
  650. fixed: item.fixed,
  651. });
  652. return res;
  653. }, []);
  654. }
  655. });
  656. },
  657. //重置列表
  658. delRow() {
  659. this.data = {
  660. tableName: "我的审核",
  661. userId: Cookies.get("userName"),
  662. };
  663. resetModule(this.data).then((res) => {
  664. if (res.code == 200) {
  665. this.showSetting = false;
  666. this.setRowList = this.tableDate;
  667. this.getRowList = this.tableDate;
  668. }
  669. });
  670. },
  671. //保存列设置
  672. save() {
  673. this.showSetting = false;
  674. this.data = {
  675. tableName: "我的审核",
  676. userId: Cookies.get("userName"),
  677. sysTableSetList: this.setRowList,
  678. };
  679. addSet(this.data).then((res) => {
  680. if (res.code == 200) {
  681. this.showSetting = false;
  682. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  683. }
  684. });
  685. },
  686. //开始拖拽事件
  687. onStart() {
  688. this.drag = true;
  689. },
  690. //拖拽结束事件
  691. onEnd() {
  692. this.drag = false;
  693. },
  694. full() {
  695. this.dialogFull = !this.dialogFull;
  696. },
  697. // 费用属性默认为仓储、计量单位默认为毛重
  698. query() {
  699. this.$set(this.form, "fFeetype", "1");
  700. this.$set(this.form, "fFeeunitid", 1);
  701. },
  702. /** 查询费用信息列表 */
  703. getList() {
  704. this.loading = true;
  705. listFees(this.queryParams).then((response) => {
  706. response.rows.map((e) => {
  707. this.fFeetypeOptions.map((s) => {
  708. if (e.fFeetype == s.dictValue) {
  709. e.fFeetype = s.dictLabel;
  710. }
  711. });
  712. if (e.fDc) {
  713. if (e.fDc == "D") {
  714. e.fDc = "收";
  715. }
  716. if (e.fDc == "C") {
  717. e.fDc = "付";
  718. }
  719. if (e.fDc == "DC") {
  720. e.fDc = "收付";
  721. }
  722. }
  723. this.fFeeunitidOptions.map((s) => {
  724. if (e.fFeeunitid == s.dictValue) {
  725. e.fFeeunitid = s.dictLabel;
  726. }
  727. });
  728. this.fDocumentOptions.map((s) => {
  729. if (e.fStatus == s.dictValue) {
  730. e.fStatus = s.dictLabel;
  731. }
  732. });
  733. });
  734. this.feesList = response.rows;
  735. this.total = response.total;
  736. this.loading = false;
  737. });
  738. },
  739. // 费用属性(数据字典)"全部、仓储、海运、空运"字典翻译
  740. fFeetypeFormat(row, column) {
  741. return this.selectDictLabel(this.fFeetypeOptions, row.fFeetype);
  742. },
  743. // 计量单位(数据字典)"对应t_unitfees的f_id"字典翻译
  744. fFeeunitidFormat(row, column) {
  745. return this.selectDictLabel(this.fFeeunitidOptions, row.fFeeunitid);
  746. },
  747. // 字典状态字典翻译
  748. statusFormat(row, column) {
  749. return this.selectDictLabel(this.fDocumentOptions, row.fStatus);
  750. },
  751. // 取消按钮
  752. cancel() {
  753. this.open = false;
  754. this.reset();
  755. },
  756. // 表单重置
  757. reset() {
  758. this.form = {
  759. fId: null,
  760. fNo: null,
  761. fName: null,
  762. fFeetype: null,
  763. fFeeunitid: null,
  764. fCurrency: null,
  765. fStatus: "0",
  766. delFlag: null,
  767. createBy: null,
  768. createTime: null,
  769. updateBy: null,
  770. updateTime: null,
  771. remark: null,
  772. };
  773. this.resetForm("form");
  774. },
  775. /** 搜索按钮操作 */
  776. handleQuery() {
  777. this.queryParams.pageNum = 1;
  778. this.getList();
  779. },
  780. /** 重置按钮操作 */
  781. resetQuery() {
  782. this.resetForm("queryForm");
  783. this.handleQuery();
  784. },
  785. // 多选框选中数据
  786. handleSelectionChange(selection) {
  787. this.ids = selection.map((item) => item.fId);
  788. this.single = selection.length !== 1;
  789. this.multiple = !selection.length;
  790. },
  791. /** 新增按钮操作 */
  792. handleAdd() {
  793. this.reset();
  794. this.query();
  795. this.open = true;
  796. this.title = "添加费用信息";
  797. },
  798. /** 修改按钮操作 */
  799. handleUpdate(row) {
  800. this.reset();
  801. const fId = row.fId || this.ids;
  802. getFees(fId).then((response) => {
  803. this.form = response.data;
  804. this.open = true;
  805. this.title = "修改费用信息";
  806. });
  807. },
  808. /** 提交按钮 */
  809. submitForm() {
  810. this.$refs["form"].validate((valid) => {
  811. if (valid) {
  812. if (this.form.fId != null) {
  813. updateFees(this.form).then((response) => {
  814. this.msgSuccess("修改成功");
  815. this.open = false;
  816. this.getList();
  817. });
  818. } else {
  819. addFees(this.form).then((response) => {
  820. this.msgSuccess("新增成功");
  821. this.open = false;
  822. this.getList();
  823. });
  824. }
  825. }
  826. });
  827. },
  828. /** 删除按钮操作 */
  829. handleDelete(row) {
  830. const fIds = row.fId || this.ids;
  831. this.$confirm(
  832. '是否确认删除费用信息编号为"' + fIds + '"的数据项?',
  833. "警告",
  834. {
  835. confirmButtonText: "确定",
  836. cancelButtonText: "取消",
  837. type: "warning",
  838. }
  839. )
  840. .then(function () {
  841. return delFees(fIds);
  842. })
  843. .then(() => {
  844. this.getList();
  845. this.msgSuccess("删除成功");
  846. });
  847. },
  848. /** 导出按钮操作 */
  849. handleExport() {
  850. const queryParams = this.queryParams;
  851. this.$confirm("是否确认导出所有费用信息数据项?", "警告", {
  852. confirmButtonText: "确定",
  853. cancelButtonText: "取消",
  854. type: "warning",
  855. })
  856. .then(function () {
  857. return exportFees(queryParams);
  858. })
  859. .then((response) => {
  860. this.download(response.msg);
  861. });
  862. },
  863. },
  864. };
  865. </script>
  866. <style lang="scss">
  867. .avue-crud__dialog__header {
  868. display: -webkit-box;
  869. display: -ms-flexbox;
  870. display: flex;
  871. -webkit-box-align: center;
  872. -ms-flex-align: center;
  873. align-items: center;
  874. -webkit-box-pack: justify;
  875. -ms-flex-pack: justify;
  876. justify-content: space-between;
  877. }
  878. .el-dialog__title {
  879. color: rgba(0, 0, 0, 0.85);
  880. font-weight: 500;
  881. word-wrap: break-word;
  882. }
  883. .avue-crud__dialog__menu {
  884. padding-right: 20px;
  885. float: left;
  886. }
  887. .avue-crud__dialog__menu i {
  888. color: #909399;
  889. font-size: 15px;
  890. }
  891. .el-icon-full-screen {
  892. cursor: pointer;
  893. }
  894. .el-icon-full-screen:before {
  895. content: "\e719";
  896. }
  897. </style>
  898. <style lang="scss" scoped>
  899. .tabSetting {
  900. display: flex;
  901. justify-content: flex-end;
  902. }
  903. .listStyle {
  904. display: flex;
  905. border-top: 1px solid #dcdfe6;
  906. border-left: 1px solid #dcdfe6;
  907. border-right: 1px solid #dcdfe6;
  908. }
  909. .listStyle:last-child {
  910. border-bottom: 1px solid #dcdfe6;
  911. }
  912. .progress {
  913. display: flex;
  914. align-items: center;
  915. padding: 2px;
  916. background-color: rgba(0, 0, 0, 0.05);
  917. height: 100%;
  918. }
  919. </style>