index.vue 24 KB

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