index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991
  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="状态">-->
  380. <!-- <el-select-->
  381. <!-- v-model="form.fStatus"-->
  382. <!-- placeholder="状态"-->
  383. <!-- style="width: 80%"-->
  384. <!-- >-->
  385. <!-- <el-option-->
  386. <!-- v-for="dict in fDocumentOptions"-->
  387. <!-- :key="dict.dictValue"-->
  388. <!-- :label="dict.dictLabel"-->
  389. <!-- :value="dict.dictValue"-->
  390. <!-- ></el-option>-->
  391. <!-- </el-select>-->
  392. <!-- </el-form-item>-->
  393. <!-- </el-col>-->
  394. <!-- <el-col :span="12">-->
  395. <!-- <el-form-item label="币种" prop="fCurrency">-->
  396. <!-- <el-input-->
  397. <!-- v-model="form.fCurrency"-->
  398. <!-- placeholder="请输入币种"-->
  399. <!-- style="width: 80%"-->
  400. <!-- />-->
  401. <!-- </el-form-item>-->
  402. <!-- </el-col>-->
  403. <!-- </el-row>-->
  404. <!-- <el-row>-->
  405. <!-- <el-col :span="12">-->
  406. <!-- <el-form-item label="收付方向">-->
  407. <!-- <el-select v-model="form.fDc" placeholder="" style="width: 80%">-->
  408. <!-- <el-option label="收" value="D" />-->
  409. <!-- <el-option label="付" value="C" />-->
  410. <!-- <el-option label="收付" value="DC" />-->
  411. <!-- </el-select>-->
  412. <!-- </el-form-item>-->
  413. <!-- </el-col>-->
  414. <el-col :span="12">
  415. <el-form-item label="税务类别">
  416. <el-input v-model="form.fTaxSort" style="width: 80%"></el-input>
  417. </el-form-item>
  418. </el-col>
  419. <el-col :span="12">
  420. <el-form-item label="含税标识">
  421. <el-input v-model="form.fTaxTag" placeholder="" style="width: 80%">
  422. </el-input>
  423. </el-form-item>
  424. </el-col>
  425. </el-row>
  426. <el-row>
  427. <el-col :span="12">
  428. <el-form-item label="税务代码">
  429. <el-input v-model="form.fTaxCode" placeholder="" style="width: 80%">
  430. </el-input>
  431. </el-form-item>
  432. </el-col>
  433. <el-col :span="12">
  434. <el-form-item label="税率(%)">
  435. <el-input v-model="form.fTaxRate" style="width: 80%" oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'></el-input>
  436. </el-form-item>
  437. </el-col>
  438. </el-row>
  439. <el-row>
  440. <el-col :span="12">
  441. <el-form-item label="备注" prop="remark">
  442. <el-input
  443. style="width: 80%"
  444. v-model="form.remark"
  445. type="textarea"
  446. placeholder="请输入内容"
  447. />
  448. </el-form-item>
  449. </el-col>
  450. <el-col :span="12">
  451. <el-form-item label="是否享受优惠正常" label-width="140px">
  452. <template>
  453. <el-radio v-model="form.fDiscounts" label="0">是</el-radio>
  454. <el-radio v-model="form.fDiscounts" label="1">否</el-radio>
  455. </template>
  456. <!-- <el-input v-model="form.fTaxRate" style="width: 80%"></el-input>-->
  457. </el-form-item>
  458. </el-col>
  459. </el-row>
  460. </el-form>
  461. <div slot="footer" class="dialog-footer">
  462. <el-button type="primary" @click="submitForm">确 定</el-button>
  463. <el-button @click="cancel">取 消</el-button>
  464. </div>
  465. </el-dialog>
  466. </div>
  467. </template>
  468. <script>
  469. import {
  470. listFees,
  471. getFees,
  472. delFees,
  473. addFees,
  474. updateFees,
  475. exportFees,
  476. } from "../../../api/basicdata/fees";
  477. import Vue from "vue";
  478. import { addSet, select, resetModule } from "@/api/system/set";
  479. import Cookies from "js-cookie";
  480. import draggable from "vuedraggable";
  481. Vue.directive("dialogDrag", {
  482. bind(el, binding, vnode, oldVnode) {
  483. const dialogHeaderEl = el.querySelector(".el-dialog__header");
  484. const dragDom = el.querySelector(".el-dialog");
  485. const enlarge = el.querySelector(".enlarge");
  486. dialogHeaderEl.style.cursor = "move";
  487. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  488. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
  489. if (enlarge) {
  490. enlarge.onclick = (e) => {
  491. dragDom.style.top = "0px";
  492. dragDom.style.left = "0px";
  493. };
  494. }
  495. dialogHeaderEl.onmousedown = (e) => {
  496. // 鼠标按下,计算当前元素距离可视区的距离
  497. const disX = e.clientX - dialogHeaderEl.offsetLeft;
  498. const disY = e.clientY - dialogHeaderEl.offsetTop;
  499. // 获取到的值带px 正则匹配替换
  500. let styL, styT;
  501. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  502. if (sty.left.includes("%")) {
  503. styL =
  504. +document.body.clientWidth * (+sty.left.replace(/\%/g, "") / 100);
  505. styT =
  506. +document.body.clientHeight * (+sty.top.replace(/\%/g, "") / 100);
  507. } else {
  508. styL = +sty.left.replace(/\px/g, "");
  509. styT = +sty.top.replace(/\px/g, "");
  510. }
  511. document.onmousemove = function (e) {
  512. // 通过事件委托,计算移动的距离
  513. const l = e.clientX - disX;
  514. const t = e.clientY - disY;
  515. // 移动当前元素
  516. if (t + styT >= 0) {
  517. dragDom.style.top = `${t + styT}px`;
  518. }
  519. dragDom.style.left = `${l + styL}px`;
  520. // 将此时的位置传出去
  521. // binding.value({x:e.pageX,y:e.pageY})
  522. };
  523. document.onmouseup = function (e) {
  524. document.onmousemove = null;
  525. document.onmouseup = null;
  526. };
  527. };
  528. },
  529. });
  530. export default {
  531. name: "Fees",
  532. components: { draggable },
  533. data() {
  534. return {
  535. //全屏放大
  536. dialogFull: false,
  537. // 遮罩层
  538. loading: true,
  539. // 选中数组
  540. ids: [],
  541. // 非单个禁用
  542. single: true,
  543. // 非多个禁用
  544. multiple: true,
  545. // 显示搜索条件
  546. showSearch: true,
  547. // 总条数
  548. total: 0,
  549. // 费用信息表格数据
  550. feesList: [],
  551. // 弹出层标题
  552. title: "",
  553. // 是否显示弹出层
  554. open: false,
  555. // 费用属性(数据字典)"全部、仓储、海运、空运"字典
  556. fFeetypeOptions: [],
  557. // 计量单位(数据字典)"对应t_unitfees的f_id"字典
  558. fFeeunitidOptions: [],
  559. // 单据状态
  560. fDocumentOptions: [],
  561. // 查询参数
  562. queryParams: {
  563. pageNum: 1,
  564. pageSize: 10,
  565. fNo: null,
  566. fName: null,
  567. fFeetype: null,
  568. fFeeunitid: null,
  569. fCurrency: null,
  570. fStatus: null,
  571. },
  572. // 表单参数
  573. form: {},
  574. // 表单校验
  575. rules: {
  576. fNo: [{ required: true, message: "编号不能为空", trigger: "blur" }],
  577. fName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
  578. },
  579. showSetting: false,
  580. drag: false,
  581. setRowList: [],
  582. getRowList: [],
  583. tableDate: [
  584. {
  585. surface: "1",
  586. label: "fNo",
  587. name: "编号",
  588. checked: 0,
  589. width: 150,
  590. },
  591. {
  592. surface: "2",
  593. label: "fName",
  594. name: "名称",
  595. checked: 0,
  596. width: 150,
  597. },
  598. {
  599. surface: "3",
  600. label: "fFeetype",
  601. name: "物料类别",
  602. checked: 0,
  603. width: 150,
  604. },
  605. {
  606. surface: "4",
  607. label: "fTaxSort",
  608. name: "税务类别",
  609. checked: 0,
  610. width: 100,
  611. },
  612. {
  613. surface: "5",
  614. label: "fFeeunitid",
  615. name: "计量单位",
  616. checked: 0,
  617. width: 100,
  618. },
  619. {
  620. surface: "6",
  621. label: "fTaxCode",
  622. name: "税务代码",
  623. checked: 0,
  624. width: 100,
  625. },
  626. {
  627. surface: "7",
  628. label: "fTaxRate",
  629. name: "税率",
  630. checked: 0,
  631. width: 100,
  632. },{
  633. surface: "8",
  634. label: "fTaxTag",
  635. name: "含税标识",
  636. checked: 0,
  637. width: 100,
  638. },{
  639. surface: "9",
  640. label: "fDiscountsName",
  641. name: "是否享受优惠政策",
  642. checked: 0,
  643. width: 100,
  644. },
  645. {
  646. surface: "10",
  647. label: "remark",
  648. name: "备注",
  649. checked: 0,
  650. width: 100,
  651. },
  652. ],
  653. allCheck: false,
  654. };
  655. },
  656. created() {
  657. this.setRowList = this.tableDate;
  658. this.getRowList = this.tableDate;
  659. this.getDicts("data_cost_attribute").then((response) => {
  660. this.fFeetypeOptions = response.data;
  661. });
  662. this.getDicts("document_status").then((response) => {
  663. this.fDocumentOptions = response.data;
  664. });
  665. this.getDicts("data_unitfees").then((response) => {
  666. this.fFeeunitidOptions = response.data;
  667. });
  668. this.getRow();
  669. this.getList();
  670. },
  671. methods: {
  672. //列设置全选
  673. allChecked() {
  674. if (this.allCheck == true) {
  675. this.setRowList.map((e) => {
  676. return (e.checked = 0);
  677. });
  678. } else {
  679. this.setRowList.map((e) => {
  680. return (e.checked = 1);
  681. });
  682. }
  683. },
  684. //查询列数据
  685. getRow() {
  686. let that = this;
  687. this.data = {
  688. tableName: "我的审核",
  689. userId: Cookies.get("userName"),
  690. };
  691. select(this.data).then((res) => {
  692. if (res.data.length != 0) {
  693. this.getRowList = res.data.filter((e) => e.checked == 0);
  694. this.setRowList = res.data;
  695. this.setRowList = this.setRowList.reduce((res, item) => {
  696. res.push({
  697. surface: item.surface,
  698. label: item.label,
  699. name: item.name,
  700. checked: item.checked,
  701. width: item.width,
  702. fixed: item.fixed,
  703. });
  704. return res;
  705. }, []);
  706. }
  707. });
  708. },
  709. //重置列表
  710. delRow() {
  711. this.data = {
  712. tableName: "我的审核",
  713. userId: Cookies.get("userName"),
  714. };
  715. resetModule(this.data).then((res) => {
  716. if (res.code == 200) {
  717. this.showSetting = false;
  718. this.setRowList = this.tableDate;
  719. this.getRowList = this.tableDate;
  720. }
  721. });
  722. },
  723. //保存列设置
  724. save() {
  725. this.showSetting = false;
  726. this.data = {
  727. tableName: "我的审核",
  728. userId: Cookies.get("userName"),
  729. sysTableSetList: this.setRowList,
  730. };
  731. addSet(this.data).then((res) => {
  732. if (res.code == 200) {
  733. this.showSetting = false;
  734. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  735. }
  736. });
  737. },
  738. //开始拖拽事件
  739. onStart() {
  740. this.drag = true;
  741. },
  742. //拖拽结束事件
  743. onEnd() {
  744. this.drag = false;
  745. },
  746. full() {
  747. this.dialogFull = !this.dialogFull;
  748. },
  749. // 费用属性默认为仓储、计量单位默认为毛重
  750. query() {
  751. this.$set(this.form, "fFeetype", "1");
  752. this.$set(this.form, "fFeeunitid", 1);
  753. },
  754. /** 查询费用信息列表 */
  755. getList() {
  756. this.loading = true;
  757. listFees(this.queryParams).then((response) => {
  758. response.rows.map((e) => {
  759. this.fFeetypeOptions.map((s) => {
  760. if (e.fFeetype == s.dictValue) {
  761. e.fFeetype = s.dictLabel;
  762. }
  763. });
  764. if (e.fDc) {
  765. if (e.fDc == "D") {
  766. e.fDc = "收";
  767. }
  768. if (e.fDc == "C") {
  769. e.fDc = "付";
  770. }
  771. if (e.fDc == "DC") {
  772. e.fDc = "收付";
  773. }
  774. }
  775. this.fFeeunitidOptions.map((s) => {
  776. if (e.fFeeunitid == s.dictValue) {
  777. e.fFeeunitid = s.dictLabel;
  778. }
  779. });
  780. this.fDocumentOptions.map((s) => {
  781. if (e.fStatus == s.dictValue) {
  782. e.fStatus = s.dictLabel;
  783. }
  784. });
  785. });
  786. this.feesList = response.rows;
  787. this.total = response.total;
  788. this.loading = false;
  789. });
  790. },
  791. // 费用属性(数据字典)"全部、仓储、海运、空运"字典翻译
  792. fFeetypeFormat(row, column) {
  793. return this.selectDictLabel(this.fFeetypeOptions, row.fFeetype);
  794. },
  795. // 计量单位(数据字典)"对应t_unitfees的f_id"字典翻译
  796. fFeeunitidFormat(row, column) {
  797. return this.selectDictLabel(this.fFeeunitidOptions, row.fFeeunitid);
  798. },
  799. // 字典状态字典翻译
  800. statusFormat(row, column) {
  801. return this.selectDictLabel(this.fDocumentOptions, row.fStatus);
  802. },
  803. // 取消按钮
  804. cancel() {
  805. this.open = false;
  806. this.reset();
  807. },
  808. // 表单重置
  809. reset() {
  810. this.form = {
  811. fId: null,
  812. fNo: null,
  813. fName: null,
  814. fFeetype: null,
  815. fFeeunitid: null,
  816. fCurrency: null,
  817. fStatus: "0",
  818. delFlag: null,
  819. createBy: null,
  820. createTime: null,
  821. updateBy: null,
  822. updateTime: null,
  823. remark: null,
  824. };
  825. this.resetForm("form");
  826. },
  827. /** 搜索按钮操作 */
  828. handleQuery() {
  829. this.queryParams.pageNum = 1;
  830. this.getList();
  831. },
  832. /** 重置按钮操作 */
  833. resetQuery() {
  834. this.resetForm("queryForm");
  835. this.handleQuery();
  836. },
  837. // 多选框选中数据
  838. handleSelectionChange(selection) {
  839. this.ids = selection.map((item) => item.fId);
  840. this.single = selection.length !== 1;
  841. this.multiple = !selection.length;
  842. },
  843. /** 新增按钮操作 */
  844. handleAdd() {
  845. this.reset();
  846. this.query();
  847. this.open = true;
  848. this.title = "添加物资信息";
  849. },
  850. /** 修改按钮操作 */
  851. handleUpdate(row) {
  852. this.reset();
  853. const fId = row.fId || this.ids;
  854. getFees(fId).then((response) => {
  855. this.form = response.data;
  856. this.$set(this.form,'fDiscounts',JSON.stringify(this.form.fDiscounts))
  857. this.open = true;
  858. this.title = "修改费用信息";
  859. });
  860. },
  861. /** 提交按钮 */
  862. submitForm() {
  863. this.$refs["form"].validate((valid) => {
  864. if (valid) {
  865. if (this.form.fId != null) {
  866. updateFees(this.form).then((response) => {
  867. this.msgSuccess("修改成功");
  868. this.open = false;
  869. this.getList();
  870. });
  871. } else {
  872. addFees(this.form).then((response) => {
  873. this.msgSuccess("新增成功");
  874. this.open = false;
  875. this.getList();
  876. });
  877. }
  878. }
  879. });
  880. },
  881. /** 删除按钮操作 */
  882. handleDelete(row) {
  883. const fIds = row.fId || this.ids;
  884. this.$confirm(
  885. '是否确认删除费用信息编号为"' + fIds + '"的数据项?',
  886. "警告",
  887. {
  888. confirmButtonText: "确定",
  889. cancelButtonText: "取消",
  890. type: "warning",
  891. }
  892. )
  893. .then(function () {
  894. return delFees(fIds);
  895. })
  896. .then(() => {
  897. this.getList();
  898. this.msgSuccess("删除成功");
  899. });
  900. },
  901. /** 导出按钮操作 */
  902. handleExport() {
  903. const queryParams = this.queryParams;
  904. this.$confirm("是否确认导出所有费用信息数据项?", "警告", {
  905. confirmButtonText: "确定",
  906. cancelButtonText: "取消",
  907. type: "warning",
  908. })
  909. .then(function () {
  910. return exportFees(queryParams);
  911. })
  912. .then((response) => {
  913. this.download(response.msg);
  914. });
  915. },
  916. },
  917. };
  918. </script>
  919. <style lang="scss">
  920. .avue-crud__dialog__header {
  921. display: -webkit-box;
  922. display: -ms-flexbox;
  923. display: flex;
  924. -webkit-box-align: center;
  925. -ms-flex-align: center;
  926. align-items: center;
  927. -webkit-box-pack: justify;
  928. -ms-flex-pack: justify;
  929. justify-content: space-between;
  930. }
  931. .el-dialog__title {
  932. color: rgba(0, 0, 0, 0.85);
  933. font-weight: 500;
  934. word-wrap: break-word;
  935. }
  936. .avue-crud__dialog__menu {
  937. padding-right: 20px;
  938. float: left;
  939. }
  940. .avue-crud__dialog__menu i {
  941. color: #909399;
  942. font-size: 15px;
  943. }
  944. .el-icon-full-screen {
  945. cursor: pointer;
  946. }
  947. .el-icon-full-screen:before {
  948. content: "\e719";
  949. }
  950. </style>
  951. <style lang="scss" scoped>
  952. .tabSetting {
  953. display: flex;
  954. justify-content: flex-end;
  955. }
  956. .listStyle {
  957. display: flex;
  958. border-top: 1px solid #dcdfe6;
  959. border-left: 1px solid #dcdfe6;
  960. border-right: 1px solid #dcdfe6;
  961. }
  962. .listStyle:last-child {
  963. border-bottom: 1px solid #dcdfe6;
  964. }
  965. .progress {
  966. display: flex;
  967. align-items: center;
  968. padding: 2px;
  969. background-color: rgba(0, 0, 0, 0.05);
  970. height: 100%;
  971. }
  972. </style>