index.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. :rules="rules"
  9. label-width="80px"
  10. >
  11. <el-form-item label="客户名称" prop="fToCorpid">
  12. <el-select
  13. v-model="queryParams.fToCorpid"
  14. filterable
  15. remote
  16. clearable
  17. size="small"
  18. style="width: 200px"
  19. @keyup.enter.native="handleQuery"
  20. :remote-method="corpsRemoteMethod"
  21. placeholder="请输入客户名称"
  22. >
  23. <el-option
  24. v-for="(dict, index) in fMblnoOptions"
  25. :key="index.fId"
  26. :label="dict.fName"
  27. :value="dict.fId"
  28. ></el-option>
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item label="结算单位" prop="fCorpid">
  32. <el-select
  33. v-model="queryParams.fCorpid"
  34. filterable
  35. remote
  36. clearable
  37. :disabled="doNot"
  38. size="small"
  39. style="width: 200px"
  40. @keyup.enter.native="handleQuery"
  41. :remote-method="corpsRemoteMethod"
  42. placeholder="请输入结算单位"
  43. >
  44. <el-option
  45. v-for="(dict, index) in fMblnoOptions"
  46. :key="index.fId"
  47. :label="dict.fName"
  48. :value="dict.fId"
  49. ></el-option>
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item label="提单号" prop="fMblno">
  53. <el-input
  54. type="daterange"
  55. size="small"
  56. style="width: 200px"
  57. v-model="queryParams.fMblno"
  58. >
  59. </el-input>
  60. </el-form-item>
  61. <el-form-item label="应收/付" prop="fDc">
  62. <el-select
  63. type="daterange"
  64. size="small"
  65. style="width: 200px"
  66. v-model="queryParams.fDc"
  67. >
  68. <el-option label="应收" value="D"/>
  69. <el-option label="应付" value="C"/>
  70. </el-select>
  71. </el-form-item>
  72. <el-form-item label="费用名称" prop="fFeeid">
  73. <el-select
  74. v-model="queryParams.fFeeid"
  75. filterable
  76. remote
  77. clearable
  78. size="small"
  79. style="width: 200px">
  80. <el-option
  81. v-for="(dict, index) in fDNameOptions"
  82. :key="index.fId"
  83. :label="dict.fName"
  84. :value="dict.fId"
  85. ></el-option>
  86. </el-select>
  87. </el-form-item>
  88. <!-- <el-form-item label="业务类型" prop="fBusinessType">-->
  89. <!-- <el-select-->
  90. <!-- v-model="queryParams.fBusinessType"-->
  91. <!-- filterable-->
  92. <!-- remote-->
  93. <!-- size="small"-->
  94. <!-- style="width: 200px"-->
  95. <!-- placeholder="请选择业务类型"-->
  96. <!-- multiple-->
  97. <!-- >-->
  98. <!-- <el-option-->
  99. <!-- v-for="dict in businessTypeOptions"-->
  100. <!-- :key="dict.dictValue"-->
  101. <!-- :label="dict.dictLabel"-->
  102. <!-- :value="dict.dictValue"-->
  103. <!-- ></el-option>-->
  104. <!-- </el-select>-->
  105. <!-- </el-form-item>-->
  106. <el-form-item label="是否对账" prop="fReconciliation">
  107. <el-select
  108. size="small"
  109. style="width: 200px"
  110. v-model="queryParams.fReconciliation"
  111. >
  112. <el-option label="是" value="1"/>
  113. <el-option label="否" value="0"/>
  114. </el-select>
  115. </el-form-item>
  116. <el-form-item label="单据类型" prop="fBilltype" v-if="typevalue == 1 || typevalue == 3">
  117. <el-select
  118. v-model="queryParams.fBilltype"
  119. size="small"
  120. style="width: 200px"
  121. placeholder="请选择单据类型"
  122. >
  123. <el-option label="入库" value="SJRK"></el-option>
  124. <el-option label="出库" value="SJCK"></el-option>
  125. <el-option label="货权转移" value="HQZY"></el-option>
  126. <el-option label="内贸" value="KHDD"></el-option>
  127. <el-option label="开票申请" value="ApplyFP"></el-option>
  128. </el-select>
  129. </el-form-item>
  130. <el-form-item label="作业类型" prop="fBusinessType" v-if="typevalue == 1 || typevalue == 3">
  131. <el-select
  132. v-model="queryParams.fBusinessType"
  133. filterable
  134. remote
  135. size="small"
  136. style="width: 200px"
  137. placeholder="作业类型"
  138. multiple
  139. >
  140. <el-option
  141. v-for="(dict, index) in businessTypeOption"
  142. :key="index.dictValue"
  143. :label="dict.dictLabel"
  144. :value="dict.dictValue"
  145. >
  146. </el-option>
  147. </el-select>
  148. </el-form-item>
  149. <el-form-item label="船名" prop="fVslid" v-if="typevalue == 1 || typevalue == 3">
  150. <el-select
  151. filterable
  152. v-model="queryParams.fVslid"
  153. size="small"
  154. style="width: 200px"
  155. placeholder="请选择仓储业务"
  156. >
  157. <el-option
  158. v-for="item in vesselOptions"
  159. :key="item.fId"
  160. :label="item.fName"
  161. :value="item.fId"/>
  162. </el-select>
  163. </el-form-item>
  164. <el-form-item label="航次" prop="fVoyid" v-if="typevalue == 1 || typevalue == 3">
  165. <el-input
  166. v-model="queryParams.fVoyid"
  167. size="small"
  168. style="width: 200px"
  169. placeholder="请输入航次"
  170. >
  171. </el-input>
  172. </el-form-item>
  173. <el-form-item label="业务类型" prop="fSystemType">
  174. <el-select
  175. v-model="queryParams.fSystemType"
  176. placeholder="请选择业务类型"
  177. size="small"
  178. disabled
  179. style="width: 200px"
  180. >
  181. <el-option
  182. v-for="item in typeoptions"
  183. :key="item.value"
  184. :label="item.label"
  185. :value="item.value"
  186. >
  187. </el-option>
  188. </el-select>
  189. </el-form-item>
  190. <el-form-item
  191. label="审核日期"
  192. prop="timeExamine"
  193. v-if="typevalue == 1 || typevalue == 3"
  194. >
  195. <el-date-picker
  196. v-model="queryParams.timeExamine"
  197. type="daterange"
  198. range-separator="至"
  199. @change="timeMethods"
  200. value-format="yyyy-MM-dd"
  201. style="width: 250px"
  202. start-placeholder="开始日期"
  203. end-placeholder="结束日期">
  204. </el-date-picker>
  205. </el-form-item>
  206. <el-form-item label="业务区间" prop="createTimeList">
  207. <el-date-picker
  208. v-model="queryParams.createTimeList"
  209. type="daterange"
  210. range-separator="至"
  211. style="width: 250px"
  212. value-format="yyyy-MM-dd"
  213. @change="changeTime"
  214. start-placeholder="开始日期"
  215. end-placeholder="结束日期">
  216. </el-date-picker>
  217. </el-form-item>
  218. </el-form>
  219. <el-row :gutter="10" class="mb8">
  220. <el-col :span="1.5">
  221. <el-dropdown @command="handleCommand">
  222. <el-button
  223. type="cyan"
  224. icon="el-icon-search"
  225. size="mini"
  226. >搜索</el-button
  227. >
  228. <el-dropdown-menu slot="dropdown">
  229. <el-dropdown-item command="SF">收费</el-dropdown-item>
  230. <el-dropdown-item command="FF">付费</el-dropdown-item>
  231. <el-dropdown-item command="DZ">对账</el-dropdown-item>
  232. <el-dropdown-item command="invoiceFP">确认发票</el-dropdown-item>
  233. <el-dropdown-item command="ApplyFP">申请发票</el-dropdown-item>
  234. </el-dropdown-menu>
  235. </el-dropdown>
  236. </el-col>
  237. <el-col :span="1.5">
  238. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  239. >重置</el-button
  240. >
  241. </el-col>
  242. <el-col :span="1.5">
  243. <el-button
  244. type="primary"
  245. icon="el-icon-plus"
  246. size="mini"
  247. @click="Submit"
  248. :disabled="queryParams.billsType != 'DZ'"
  249. v-hasPermi="['finance:charge:add']"
  250. >对账确认
  251. </el-button>
  252. </el-col>
  253. <el-col :span="1.5">
  254. <el-button
  255. type="success"
  256. icon="el-icon-edit"
  257. size="mini"
  258. @click="Submit"
  259. :disabled="queryParams.billsType != 'SF'"
  260. v-hasPermi="['finance:charge:edit']"
  261. >收款确认
  262. </el-button>
  263. </el-col>
  264. <el-col :span="1.5">
  265. <el-button
  266. type="danger"
  267. icon="el-icon-delete"
  268. size="mini"
  269. @click="Submit"
  270. :disabled="queryParams.billsType != 'FF' || multiple"
  271. v-hasPermi="['finance:charge:remove']"
  272. >付款确认
  273. </el-button>
  274. </el-col>
  275. <el-col :span="1.5">
  276. <el-button
  277. type="warning"
  278. icon="el-icon-download"
  279. size="mini"
  280. @click="Submit"
  281. v-hasPermi="['finance:charge:export']"
  282. >付款申请
  283. </el-button>
  284. </el-col>
  285. <el-col :span="1.5">
  286. <el-button
  287. type="info"
  288. icon="el-icon-download"
  289. size="mini"
  290. :disabled="queryParams.billsType != 'ApplyFP' || multiple"
  291. @click="Submit(1)"
  292. v-hasPermi="['agreement:agreementStorage:export']"
  293. >开票申请
  294. </el-button>
  295. </el-col>
  296. <el-col :span="1.5">
  297. <el-button
  298. type="info"
  299. icon="el-icon-download"
  300. size="mini"
  301. :disabled="queryParams.billsType != 'invoiceFP' || multiple"
  302. @click="Submit"
  303. v-hasPermi="['agreement:agreementStorage:export']"
  304. >开票确认
  305. </el-button>
  306. </el-col>
  307. <div class="tabSetting">
  308. <right-toolbar
  309. :showSearch.sync="showSearch"
  310. @queryTable="getList"
  311. ></right-toolbar>
  312. <div style="margin: 0 12px">
  313. <el-button
  314. icon="el-icon-setting"
  315. size="mini"
  316. circle
  317. @click="showSetting = !showSetting"
  318. ></el-button>
  319. </div>
  320. </div>
  321. </el-row>
  322. <el-dialog
  323. title="自定义列显示"
  324. :visible.sync="showSetting"
  325. width="700px"
  326. v-dialogDrag
  327. >
  328. <template slot="title">
  329. <div class="avue-crud__dialog__header">
  330. <span class="el-dialog__title">
  331. <span
  332. style="
  333. display: inline-block;
  334. width: 3px;
  335. height: 20px;
  336. margin-right: 5px;
  337. float: left;
  338. margin-top: 2px;
  339. "
  340. ></span>
  341. </span>
  342. </div>
  343. </template>
  344. <div>配置排序列数据(拖动调整顺序)</div>
  345. <div style="margin-left: 17px">
  346. <el-checkbox
  347. v-model="allCheck"
  348. label="全选"
  349. @change="allChecked"
  350. ></el-checkbox>
  351. </div>
  352. <div style="padding: 4px; display: flex; justify-content: center">
  353. <draggable
  354. v-model="setRowList"
  355. group="site"
  356. animation="300"
  357. @start="onStart"
  358. @end="onEnd"
  359. handle=".indraggable"
  360. >
  361. <transition-group>
  362. <div
  363. v-for="item in setRowList"
  364. :key="item.surface"
  365. class="listStyle"
  366. >
  367. <div style="width: 500px" class="indraggable">
  368. <div class="progress" :style="{ width: item.width + 'px' }">
  369. <el-checkbox
  370. :label="item.name"
  371. v-model="item.checked"
  372. :true-label="0"
  373. :false-label="1"
  374. >{{ item.name }}
  375. </el-checkbox>
  376. </div>
  377. </div>
  378. <el-input-number
  379. v-model.number="item.width"
  380. controls-position="right"
  381. :min="1"
  382. :max="500"
  383. size="mini"
  384. ></el-input-number>
  385. </div>
  386. </transition-group>
  387. </draggable>
  388. </div>
  389. <span slot="footer" class="dialog-footer">
  390. <el-button @click="showSetting = false">取 消</el-button>
  391. <el-button @click="delRow" type="danger">重 置</el-button>
  392. <el-button type="primary" @click="save()">确 定</el-button>
  393. </span>
  394. </el-dialog>
  395. <el-table
  396. :data="chargeList"
  397. @selection-change="handleSelectionChange"
  398. show-summary
  399. :summary-method="listTotal"
  400. >
  401. <el-table-column type="selection" width="100" align="center" />
  402. <el-table-column
  403. label="序号"
  404. type="index"
  405. width="55"
  406. align="center"
  407. fixed
  408. />
  409. <el-table-column
  410. v-for="(item, index) in getRowList"
  411. :key="index"
  412. :label="item.name"
  413. :width="item.width"
  414. :prop="item.label"
  415. align="center"
  416. :show-overflow-tooltip="true"
  417. sortable
  418. :fixed="item.fixed"
  419. >
  420. <template slot-scope="scope">
  421. <span v-if="item.label == 'srcBillNo'">{{scope.row.srcBillNo}}</span>
  422. <span v-if="item.label == 'boatName'">{{scope.row.boatName}}</span>
  423. <span v-if="item.label == 'voyageName'">{{scope.row.voyageName}}</span>
  424. <span v-if="item.label == 'fMblno'">{{scope.row.fMblno}}</span>
  425. <span v-if="item.label == 'createTime'">{{(scope.row.createTime).slice(0,10)}}</span>
  426. <span v-if="item.label == 'fFeeName'">{{scope.row.fFeeName}}</span>
  427. <span v-if="item.label == 'fSrcdcName'">{{scope.row.fSrcdcName}}</span>
  428. <span v-if="item.label == 'fAmtdr'">{{scope.row.fAmtdr}}</span>
  429. <el-input v-model="scope.row.fAmt" @input="amountCheck(scope.row)" v-if="item.label == 'fAmt'"/>
  430. <span v-if="item.label == 'fFeeunitid'">{{scope.row.fFeeunitid}}</span>
  431. <span v-if="item.label == 'fQty'">{{scope.row.fQty}}</span>
  432. <span v-if="item.label == 'fUnitprice'">{{scope.row.fUnitprice}}</span>
  433. <span v-if="item.label == 'fBusinessType'">{{scope.row.fBusinessType}}</span>
  434. <span v-if="item.label == 'fBilltype'">{{scope.row.fBilltype}}</span>
  435. <span v-if="item.label == 'fProductName'">{{scope.row.fProductName}}</span>
  436. <span v-if="item.label == 'fMarks'">{{scope.row.fMarks}}</span>
  437. <span v-if="item.label == 'fChargedate'">{{scope.row.fChargedate}}</span>
  438. <span v-if="item.label == 'fBillingDeadline'">{{scope.row.fBillingDeadline}}</span>
  439. <span v-if="item.label == 'fBillingDays'">{{scope.row.fBillingDays}}</span>
  440. <span v-if="item.label == 'fInventoryDays'">{{scope.row.fInventoryDays}}</span>
  441. <span v-if="item.label == 'fRemarks'">{{scope.row.fRemarks}}</span>
  442. </template>
  443. </el-table-column>
  444. </el-table>
  445. <pagination
  446. v-show="total > 0"
  447. :total="total"
  448. :page.sync="queryParams.pageNum"
  449. :limit.sync="queryParams.pageSize"
  450. @pagination="getList"
  451. />
  452. </div>
  453. </template>
  454. <script>
  455. import { getcontrastList, addPreservation} from "@/api/finance/generalLedger";
  456. import { listFees } from "@/api/basicdata/fees";
  457. import { listCorps } from "@/api/finance/contrast";
  458. import print from "print-js";
  459. import AddOrUpdate from "@/views/viewApproval";
  460. import ApprovalComments from "@/views/startApproval";
  461. import { queryUserVal } from "@/api/warehouseBusiness/agreement";
  462. import Global from "@/layout/components/global";
  463. import draggable from "vuedraggable";
  464. import Vue from "vue";
  465. import Cookies from "js-cookie";
  466. import { addSet, select } from "@/api/system/set";
  467. import { getVesselName, listChange } from '@/api/finance/applyForInvoice/feeDetail'
  468. import { MessageBox } from 'element-ui'
  469. import store from '@/store'
  470. Vue.directive("dialogDrag", {
  471. bind(el, binding, vnode, oldVnode) {
  472. const dialogHeaderEl = el.querySelector(".el-dialog__header");
  473. const dragDom = el.querySelector(".el-dialog");
  474. const enlarge = el.querySelector(".enlarge");
  475. dialogHeaderEl.style.cursor = "move";
  476. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  477. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
  478. if (enlarge) {
  479. enlarge.onclick = (e) => {
  480. dragDom.style.top = "0px";
  481. dragDom.style.left = "0px";
  482. };
  483. }
  484. dialogHeaderEl.onmousedown = (e) => {
  485. // 鼠标按下,计算当前元素距离可视区的距离
  486. const disX = e.clientX - dialogHeaderEl.offsetLeft;
  487. const disY = e.clientY - dialogHeaderEl.offsetTop;
  488. // 获取到的值带px 正则匹配替换
  489. let styL, styT;
  490. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  491. if (sty.left.includes("%")) {
  492. styL =
  493. +document.body.clientWidth * (+sty.left.replace(/\%/g, "") / 100);
  494. styT =
  495. +document.body.clientHeight * (+sty.top.replace(/\%/g, "") / 100);
  496. } else {
  497. styL = +sty.left.replace(/\px/g, "");
  498. styT = +sty.top.replace(/\px/g, "");
  499. }
  500. document.onmousemove = function (e) {
  501. // 通过事件委托,计算移动的距离
  502. const l = e.clientX - disX;
  503. const t = e.clientY - disY;
  504. // 移动当前元素
  505. if (t + styT >= 0) {
  506. dragDom.style.top = `${t + styT}px`;
  507. }
  508. dragDom.style.left = `${l + styL}px`;
  509. // 将此时的位置传出去
  510. // binding.value({x:e.pageX,y:e.pageY})
  511. };
  512. document.onmouseup = function (e) {
  513. document.onmousemove = null;
  514. document.onmouseup = null;
  515. };
  516. };
  517. },
  518. });
  519. export default {
  520. name: "Charge",
  521. data() {
  522. return {
  523. doNot:false,
  524. rules: {
  525. fCorpid:[{ required: true, message: "客户名称不能为空", trigger: "blur"}],
  526. fToCorpid: [{ required: true, message: "结算单位不能为空", trigger: "blur" }],
  527. fBilltype: [{ required: true, message: "单据类型不能为空", trigger: "blur" }]
  528. },
  529. vesselOptions:[],
  530. fDNameOptions: [],
  531. typevalue: "",
  532. typeoptions: [
  533. {
  534. value: "1",
  535. label: "仓储",
  536. },
  537. {
  538. value: "2",
  539. label: "车队",
  540. },
  541. {
  542. value: "3",
  543. label: "船务",
  544. }
  545. ],
  546. businessTypeOption:[],
  547. drag: false,
  548. tableDate: [
  549. {
  550. surface: "1",
  551. label: "srcBillNo",
  552. name: "来源编号",
  553. checked: 0,
  554. width: 100,
  555. },
  556. {
  557. surface: "2",
  558. label: "boatName",
  559. name: "船名",
  560. checked: 0,
  561. width: 100,
  562. },
  563. {
  564. surface: "3",
  565. label: "voyageName",
  566. name: "航次",
  567. checked: 0,
  568. width: 100,
  569. },
  570. {
  571. surface: "4",
  572. label: "fMblno",
  573. name: "提单号",
  574. checked: 0,
  575. width: 100,
  576. },
  577. {
  578. surface: "5",
  579. label: "createTime",
  580. name: "业务日期",
  581. checked: 0,
  582. width: 100,
  583. },
  584. {
  585. surface: "6",
  586. label: "fFeeName",
  587. name: "费用名称",
  588. checked: 0,
  589. width: 100,
  590. },
  591. {
  592. surface: "7",
  593. label: "fSrcdcName",
  594. name: "收/付",
  595. checked: 0,
  596. width: 100,
  597. },
  598. {
  599. surface: "8",
  600. label: "fAmtdr",
  601. name: "金额",
  602. checked: 0,
  603. width: 100,
  604. },
  605. {
  606. surface: "9",
  607. label: "fAmt",
  608. name: "本次金额",
  609. checked: 0,
  610. width: 100,
  611. },
  612. {
  613. surface: "10",
  614. label: "fFeeunitid",
  615. name: "计价单位",
  616. checked: 0,
  617. width: 100,
  618. },
  619. {
  620. surface: "11",
  621. label: "fQty",
  622. name: "数量",
  623. checked: 0,
  624. width: 100,
  625. },
  626. {
  627. surface: "12",
  628. label: "fUnitprice",
  629. name: "单价",
  630. checked: 0,
  631. width: 100,
  632. },
  633. {
  634. surface: "13",
  635. label: "fBusinessType",
  636. name: "作业类型",
  637. checked: 0,
  638. width: 100,
  639. },
  640. {
  641. surface: "14",
  642. label: "fBilltype",
  643. name: "业务类型",
  644. checked: 0,
  645. width: 100,
  646. },
  647. {
  648. surface: "15",
  649. label: "fProductName",
  650. name: "货物品名",
  651. checked: 0,
  652. width: 100,
  653. },
  654. {
  655. surface: "16",
  656. label: "fMarks",
  657. name: "品牌",
  658. checked: 0,
  659. width: 100,
  660. },
  661. {
  662. surface: "17",
  663. label: "fChargedate",
  664. name: "计费起始日期",
  665. checked: 0,
  666. width: 100,
  667. },
  668. {
  669. surface: "18",
  670. label: "fBillingDeadline",
  671. name: "计费截止日期",
  672. checked: 0,
  673. width: 100,
  674. },
  675. {
  676. surface: "19",
  677. label: "fBillingDays",
  678. name: "计费天数",
  679. checked: 0,
  680. width: 100,
  681. },
  682. {
  683. surface: "20",
  684. label: "fInventoryDays",
  685. name: "库存天数",
  686. checked: 0,
  687. width: 100,
  688. },
  689. {
  690. surface: "21",
  691. label: "fRemarks",
  692. name: "备注",
  693. checked: 0,
  694. width: 100,
  695. },
  696. ],
  697. setRowList: [],
  698. getRowList: [],
  699. //自定义列宽
  700. allCheck: false,
  701. showSetting:false,
  702. Lander: "",
  703. Operator: "",
  704. tablefilter: false,
  705. //打印表
  706. fWbuOptions: [],
  707. // 遮罩层
  708. loading: true,
  709. selection: "",
  710. // 选中数组
  711. ids: [],
  712. // 非单个禁用
  713. single: true,
  714. // 非多个禁用
  715. multiple: true,
  716. // 显示搜索条件
  717. showSearch: true,
  718. // 总条数
  719. total: 0,
  720. moneys:'',
  721. moneye:'',
  722. // 财务数据主表格数据
  723. chargeList: [],
  724. // 弹出层标题
  725. title: "",
  726. // 客户(客户数据)
  727. fMblnoOptions: [],
  728. // 主表查询参数
  729. queryParams: {
  730. pageNum: 1,
  731. pageSize: 10,
  732. fSystemType: Cookies.get("sysType"),
  733. fCorpid:null,
  734. fToCorpid:null,
  735. fMblno:null,
  736. fDc:null,
  737. fFeeid:null,
  738. fReconciliation:null,
  739. fBilltype:null,
  740. fBusinessType:null,
  741. fVslid:null,
  742. fVoyid:null,
  743. timeExamine:null,
  744. createTimeList:null,
  745. billsType:null
  746. },
  747. };
  748. },
  749. components: {
  750. draggable,
  751. AddOrUpdate,
  752. ApprovalComments,
  753. },
  754. created() {
  755. this.setRowList = this.tableDate;
  756. this.getRowList = this.tableDate;
  757. this.typevalue = Cookies.get("sysType");
  758. let query = { pageNum: 1, fDc: "D" };
  759. listFees(query).then((response) => {
  760. this.fDNameOptions = response.rows;
  761. });
  762. // this.getDicts("data_billType").then((response) => {
  763. // if (response.data) {
  764. // this.businessTypeOptions = response.data
  765. // }
  766. // });
  767. this.getDicts("st_in_type").then((response) => {
  768. this.businessTypeOption = response.data;
  769. });
  770. this.vessleRemthod()
  771. this.corpsRemoteMethod()
  772. // this.getList();
  773. // this.getRow();
  774. },
  775. activated() {
  776. if(this.$route.query.data){
  777. listCorps().then((response) => {
  778. this.fMblnoOptions = response;
  779. let data = JSON.parse(this.$route.query.data)
  780. let queryParams = {}
  781. this.queryParams.fCorpid = data.fCorpid
  782. queryParams.fCorpid = data.fCorpid
  783. queryParams.fCorpid = data.fCorpid
  784. queryParams.fSrcidList = data.fSrcid
  785. queryParams.fSrcpidList = data.fSrcpid
  786. queryParams.billsType = data.billsType
  787. this.queryParams.fId = data.fId
  788. // let list = queryParams
  789. for (let item in this.fMblnoOptions){
  790. if (data.fCorpid == this.fMblnoOptions[item].fName){
  791. this.doNot = true
  792. queryParams.fCorpid = this.fMblnoOptions[item].fId
  793. this.queryParams.fCorpid = this.fMblnoOptions[item].fId
  794. console.log(queryParams.fCorpid)
  795. getcontrastList(queryParams).then(response=>{
  796. console.log(response)
  797. if(response.rows){
  798. this.chargeList = response.rows
  799. }
  800. })
  801. }
  802. }
  803. });
  804. }
  805. },
  806. methods: {
  807. //提交按钮
  808. Submit(value){
  809. this.$refs["queryForm"].validate((valid) => {
  810. if (valid) {
  811. if (this.chargeList.length === 0) {
  812. return false
  813. }else{
  814. if (this.chargeList.length > 1){
  815. this.queryParams.fMblno = this.chargeList[0].fMblno + '...'
  816. }else {
  817. this.queryParams.fMblno = this.chargeList[0].fMblno
  818. }
  819. }
  820. if(value === 1 ){
  821. for(let item in this.fMblnoOptions){
  822. if(this.queryParams.fCtrlcorpid == this.fMblnoOptions[item].fId){
  823. this.queryParams.fCtrlcorpid = this.fMblnoOptions[item].fName
  824. }
  825. console.log(this.fMblnoOptions[item].fName)
  826. }
  827. }
  828. let aug = []
  829. let bug = []
  830. for (let item in this.selection) {
  831. for (let li in this.selection) {
  832. if (item != li) {
  833. if (this.selection[item].fSrcid == this.selection[li].fSrcid) {
  834. console.log(this.selection[item], this.selection[li])
  835. aug.push({
  836. index: this.selection[item].fSrcid,
  837. id: item,
  838. index2: this.selection[li].fSrcid,
  839. id2: li
  840. })
  841. }
  842. }
  843. }
  844. }
  845. console.log(aug)
  846. let add =''
  847. let addold =''
  848. for(let li in aug){
  849. for(let item in aug)
  850. if(aug[item].id == aug[li].id2 && aug[item].id2 == aug[li].id){
  851. aug.splice(item, 1);
  852. }
  853. }
  854. if(aug.length != 0){
  855. for (let item in aug){
  856. addold = parseInt(aug[item].id2)+1
  857. add += Number(aug[item].id)+1 +'行、'+ addold + '行/'
  858. }
  859. MessageBox.confirm("第" + add + "重复,请重新选择",{
  860. confirmButtonText: '确定',
  861. cancelButtonText: '取消',
  862. type: 'warning'
  863. }
  864. ).then(() => {
  865. return
  866. })
  867. }else {
  868. this.queryParams.tMblno = this.queryParams.fMblno
  869. for(let item in this.fMblnoOptions){
  870. if(this.queryParams.fToCorpid == this.fMblnoOptions[item].fId){
  871. this.queryParams.fToCorpid = this.fMblnoOptions[item].fName
  872. }
  873. }
  874. let formData = new window.FormData();
  875. formData.append('tFee',JSON.stringify(this.queryParams))
  876. formData.append('tFeeDo',JSON.stringify(this.selection))
  877. formData.append('billsType',this.queryParams.billsType)
  878. formData.append('tFeeInvoice','')
  879. addPreservation(formData).then(response=>{
  880. this.$message.success("操作成功")
  881. if(this.queryParams.billsType == 'ApplyFP'){
  882. this.$router.push({path:'/finance/invoiceInformation'})
  883. }else if(this.queryParams.billsType == 'DZ'){
  884. this.$router.push({path:'/finance/contrast'})
  885. }else if(this.queryParams.billsType == 'SF'){
  886. this.$router.push({path:'/finance/charge'})
  887. }else if(this.queryParams.billsType == 'FF'){
  888. this.$router.push({path:'/finance/payment'})
  889. }else if(this.queryParams.billsType == 'invoiceFP'){
  890. this.$router.push({path:'/finance/controlOverInvoices/invoice'})
  891. }
  892. })
  893. }
  894. }
  895. })
  896. },
  897. amountCheck(row){
  898. if(row.fAmtdr < row.fAmt){
  899. this.$message.error("本次金额不能大于金额")
  900. row.fAmt = ''
  901. }
  902. },
  903. //搜索按钮下拉选项搜索数据
  904. handleCommand(command){
  905. this.queryParams.billsType = command
  906. this.getList()
  907. },
  908. //获取船名
  909. vessleRemthod(){
  910. getVesselName().then(response=>{
  911. this.vesselOptions = response.rows
  912. })
  913. },
  914. //搜索时间截取时分秒
  915. timeMethods(){
  916. this.queryParams.timeExamine[0] = this.queryParams.timeExamine[0]+" 00:00:00"
  917. this.queryParams.timeExamine[1] = this.queryParams.timeExamine[1]+" 23:59:59"
  918. },
  919. changeTime(){
  920. this.queryParams.createTimeList[0] = this.queryParams.createTimeList[0]+" 00:00:00"
  921. this.queryParams.createTimeList[1] = this.queryParams.createTimeList[1]+" 23:59:59"
  922. },
  923. //导出明细
  924. handleExportItems() {
  925. const fIds = this.queryParams.fId;
  926. if (fIds !== null) {
  927. this.$confirm("是否确认导出所有计费物资明细数据?", "警告", {
  928. confirmButtonText: "确定",
  929. cancelButtonText: "取消",
  930. type: "warning",
  931. })
  932. .then(function () {
  933. return exportWarehousebillsitems(fIds);
  934. })
  935. .then((response) => {
  936. this.download(response.msg);
  937. });
  938. } else {
  939. this.$message("请先保存");
  940. }
  941. },
  942. //列设置全选
  943. allChecked() {
  944. if (this.allCheck == true) {
  945. this.setRowList.map((e) => {
  946. return (e.checked = 0);
  947. });
  948. } else {
  949. this.setRowList.map((e) => {
  950. return (e.checked = 1);
  951. });
  952. }
  953. },
  954. //查询列数据
  955. getRow() {
  956. let that = this;
  957. this.data = {
  958. tableName: "申请费用",
  959. userId: Cookies.get("userName"),
  960. };
  961. select(this.data).then((res) => {
  962. if (res.data.length != 0) {
  963. this.getRowList = res.data.filter((e) => e.checked == 0);
  964. this.setRowList = res.data;
  965. this.setRowList = this.setRowList.reduce((res, item) => {
  966. res.push({
  967. surface: item.surface,
  968. label: item.label,
  969. name: item.name,
  970. checked: item.checked,
  971. width: item.width,
  972. fixed: item.fixed,
  973. });
  974. return res;
  975. }, []);
  976. }
  977. });
  978. },
  979. //保存列设置
  980. save() {
  981. this.showSetting = false;
  982. this.data = {
  983. tableName: "收费",
  984. userId: Cookies.get("userName"),
  985. sysTableSetList: this.setRowList,
  986. };
  987. addSet(this.data).then((res) => {
  988. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  989. });
  990. },
  991. //重置列表
  992. delRow() {
  993. this.data = {
  994. tableName: "收费",
  995. userId: Cookies.get("userName"),
  996. };
  997. resetModule(this.data).then((res) => {
  998. if (res.code == 200) {
  999. this.showSetting = false;
  1000. this.setRowList = this.tableDate;
  1001. this.getRowList = this.tableDate;
  1002. }
  1003. });
  1004. },
  1005. //开始拖拽事件
  1006. onStart() {
  1007. this.drag = true;
  1008. },
  1009. //拖拽结束事件
  1010. onEnd() {
  1011. this.drag = false;
  1012. },
  1013. //收费页面合计
  1014. listTotal(param) {
  1015. this.total = 0
  1016. const { columns, data } = param;
  1017. const sums = [];
  1018. if(this.selection.length === 0){
  1019. columns.forEach((column, index) => {
  1020. if (index === 0) {
  1021. sums[index] = "合计";
  1022. } else if (column.label == '金额'|| column.label == '本次金额') {
  1023. const values = data.map((item) => Number(item[column.property]));
  1024. if (!values.every((value) => isNaN(value))) {
  1025. sums[index] = values.reduce((prev, curr) => {
  1026. const value = Number(curr);
  1027. if (!isNaN(value)) {
  1028. return prev + curr;
  1029. } else {
  1030. return prev;
  1031. }
  1032. }, 0);
  1033. }
  1034. }
  1035. });
  1036. }else{
  1037. columns.forEach((column, index) => {
  1038. if (index === 0) {
  1039. sums[index] = "合计";
  1040. } else if (column.label == '金额') {
  1041. const values = this.selection.map((selection) => Number(selection[column.property]));
  1042. if (!values.every((value) => isNaN(value))) {
  1043. sums[index] = values.reduce((prev, curr) => {
  1044. const value = Number(curr);
  1045. if (!isNaN(value)) {
  1046. return prev + curr;
  1047. } else {
  1048. return prev;
  1049. }
  1050. }, 0);
  1051. }
  1052. }else if(column.label == '本次金额'){
  1053. const values = this.selection.map((selection) => Number(selection[column.property]));
  1054. if (!values.every((value) => isNaN(value))) {
  1055. sums[index] = values.reduce((prev, curr) => {
  1056. const value = Number(curr);
  1057. if (!isNaN(value)) {
  1058. return prev + curr;
  1059. } else {
  1060. return prev;
  1061. }
  1062. }, 0);
  1063. }
  1064. this.queryParams.fAmtdr = sums[index]
  1065. }
  1066. });
  1067. }
  1068. return sums;
  1069. },
  1070. // 查看按钮
  1071. check(row, status) {
  1072. let res = {
  1073. fId:row.fId,
  1074. Num:status
  1075. }
  1076. this.$router.push({
  1077. path:'/applyForInvoice/feeDetail',
  1078. query: { data: res }
  1079. })
  1080. },
  1081. // 多选框选中数据
  1082. handleSelectionChange(selection) {
  1083. this.selection = selection
  1084. this.totAL = 0;
  1085. this.ids = selection.map((item) => item.fId);
  1086. this.single =
  1087. selection.length !== 1 ||
  1088. selection.map((item) => item.fBillstatus) == 6 ||
  1089. selection.map((item) => item.fBillstatus) == 4;
  1090. this.multiple = !selection.length;
  1091. },
  1092. /** 查询财务数据主列表 */
  1093. getList() {
  1094. this.loading = true;
  1095. getcontrastList(this.queryParams).then((response) => {
  1096. if(this.doNot == true){
  1097. this.chargeList = this.chargeList.concat(response.rows)
  1098. }else {
  1099. this.chargeList = response.rows;
  1100. }
  1101. this.total = response.total;
  1102. this.loading = false;
  1103. });
  1104. },
  1105. // 取消按钮
  1106. cancel() {
  1107. this.getList();
  1108. this.reset();
  1109. },
  1110. // 表单重置
  1111. reset() {
  1112. this.form = {
  1113. fId: null,
  1114. fBillno: null,
  1115. fCtrlcorpid: null,
  1116. fCorpid: null,
  1117. tMblno: null,
  1118. fAmtdr: null,
  1119. fAmtcr: null,
  1120. fBilltype: null,
  1121. fBillstatus: "0",
  1122. fRemarks: null,
  1123. fAccbilldate: null,
  1124. delFlag: null,
  1125. createBy: null,
  1126. fDeptid: null,
  1127. createTime: null,
  1128. updateBy: null,
  1129. updateTime: null,
  1130. };
  1131. this.resetForm("ta");
  1132. },
  1133. /** 搜索按钮操作 */
  1134. handleQuery() {
  1135. this.queryParams.pageNum = 1;
  1136. // this.getList();
  1137. },
  1138. /** 远程模糊查询用户 */
  1139. corpsRemoteMethod(name) {
  1140. if (name == null || name === "") {
  1141. return false;
  1142. }
  1143. let queryParams = { fName: name };
  1144. listCorps(queryParams).then((response) => {
  1145. this.fMblnoOptions = response;
  1146. // this.KHblnoOptions = response;
  1147. });
  1148. },
  1149. /** 重置按钮操作 */
  1150. resetQuery() {
  1151. this.tableFilter = {
  1152. pageNum: 1,
  1153. pageSize: 10,
  1154. fBillno: null,
  1155. fCtrlcorpid: null,
  1156. fCorpid: null,
  1157. timeInterval: null,
  1158. };
  1159. this.handleQuery();
  1160. },
  1161. // 远程模糊查询费用名称
  1162. fWRemoteMethod(name) {
  1163. this.fWbuOptions = [];
  1164. if (name == null || name === "") {
  1165. return false;
  1166. }
  1167. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  1168. listFees(queryParams).then((response) => {
  1169. this.fWbuOptions = response.rows;
  1170. });
  1171. },
  1172. /** 新增按钮操作 */
  1173. handleAdd() {
  1174. this.$router.push({path:'/applyForInvoice/feeDetail'})
  1175. },
  1176. /** 修改按钮操作 */
  1177. handleUpdate(row,status) {
  1178. let res = {
  1179. fId:row.fId,
  1180. Num:status
  1181. }
  1182. this.$router.push({
  1183. path:'/applyForInvoice/feeDetail',
  1184. query:{ data : res }
  1185. })
  1186. },
  1187. /** 删除按钮操作 */
  1188. handleDelete(row) {
  1189. const fIds = row.fId || this.ids;
  1190. let tips = "";
  1191. if (Cookies.get("sysType") == 1) {
  1192. //大木
  1193. delCharge_s(fIds).then((data) => {
  1194. switch (data.msg) {
  1195. case "0": {
  1196. this.$message.error("当前数据已被其他操作员操作请刷新页面");
  1197. break;
  1198. }
  1199. case "1": {
  1200. tips = "当前主表有数据从表无数据是否删除";
  1201. this.delete_S(fIds, tips);
  1202. break;
  1203. }
  1204. case "2": {
  1205. tips = "当前主表有数据从表有数据是否删除";
  1206. this.delete_S(fIds, tips);
  1207. break;
  1208. }
  1209. default: {
  1210. return this.$message.error("未知错误,无状态");
  1211. }
  1212. }
  1213. });
  1214. } else if (Cookies.get("sysType") == 2) {
  1215. // 车队;
  1216. delCharge_ss(fIds).then((data) => {
  1217. switch (data.msg) {
  1218. case "0": {
  1219. this.$message.error("当前数据已被其他操作员操作请刷新页面");
  1220. break;
  1221. }
  1222. case "1": {
  1223. tips = "当前主表有数据从表无数据是否删除";
  1224. this.delete_S(fIds, tips);
  1225. break;
  1226. }
  1227. case "2": {
  1228. tips = "当前主表有数据从表有数据是否删除";
  1229. this.delete_S(fIds, tips);
  1230. break;
  1231. }
  1232. default: {
  1233. return this.$message.error("未知错误,无状态");
  1234. }
  1235. }
  1236. });
  1237. }
  1238. },
  1239. delete_S(fIds, tips) {
  1240. this.$confirm(tips, "警告", {
  1241. confirmButtonText: "确定",
  1242. cancelButtonText: "取消",
  1243. type: "warning",
  1244. })
  1245. .then(function () {
  1246. if (Cookies.get("sysType") == 1) {
  1247. return delCharge(fIds);
  1248. } else if (Cookies.get("sysType") == 2) {
  1249. return delCharges(fIds);
  1250. }
  1251. })
  1252. .then(() => {
  1253. this.getList();
  1254. this.msgSuccess("删除成功");
  1255. });
  1256. },
  1257. /** 导出按钮操作 */
  1258. handleExport() {
  1259. const queryParams = this.queryParams;
  1260. this.$confirm("是否确认导出所有财务数据主数据项?", "警告", {
  1261. confirmButtonText: "确定",
  1262. cancelButtonText: "取消",
  1263. type: "warning",
  1264. })
  1265. .then(function () {
  1266. return exportCharge(queryParams);
  1267. })
  1268. .then((response) => {
  1269. this.download(response.msg);
  1270. });
  1271. },
  1272. //清空一行
  1273. deleteRow(index, rows) {
  1274. this.queryParams.fAmtcr = 0;
  1275. this.queryParams.fAmtdr = 0;
  1276. rows.splice(index, 1);
  1277. },
  1278. },
  1279. };
  1280. </script>
  1281. <style lang="scss" scoped>
  1282. .tabSetting {
  1283. display: flex;
  1284. justify-content: flex-end;
  1285. }
  1286. .listStyle {
  1287. display: flex;
  1288. border-top: 1px solid #dcdfe6;
  1289. border-left: 1px solid #dcdfe6;
  1290. border-right: 1px solid #dcdfe6;
  1291. }
  1292. .listStyle:last-child {
  1293. border-bottom: 1px solid #dcdfe6;
  1294. }
  1295. .progress {
  1296. display: flex;
  1297. align-items: center;
  1298. padding: 2px;
  1299. background-color: rgba(0, 0, 0, 0.05);
  1300. height: 100%;
  1301. }
  1302. .avue-crud__dialog__header {
  1303. display: -webkit-box;
  1304. display: -ms-flexbox;
  1305. display: flex;
  1306. -webkit-box-align: center;
  1307. -ms-flex-align: center;
  1308. align-items: center;
  1309. -webkit-box-pack: justify;
  1310. -ms-flex-pack: justify;
  1311. justify-content: space-between;
  1312. }
  1313. .el-dialog__title {
  1314. color: rgba(0, 0, 0, 0.85);
  1315. font-weight: 500;
  1316. word-wrap: break-word;
  1317. }
  1318. .avue-crud__dialog__menu {
  1319. padding-right: 20px;
  1320. float: left;
  1321. }
  1322. .avue-crud__dialog__menu i {
  1323. color: #909399;
  1324. font-size: 15px;
  1325. }
  1326. .el-icon-full-screen {
  1327. cursor: pointer;
  1328. }
  1329. .el-icon-full-screen:before {
  1330. content: "\e719";
  1331. }
  1332. </style>
  1333. <style lang="scss">
  1334. .el-table {
  1335. .el-table__body-wrapper {
  1336. z-index: 2;
  1337. }
  1338. }
  1339. </style>