index.vue 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="tablefilter"
  5. ref="queryParams_s"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="68px"
  9. >
  10. <el-form-item label="货权方" prop="fCtrlcorpid">
  11. <el-input
  12. v-model="tablefilter.fCtrlcorpid"
  13. placeholder="请输入客户名称"
  14. filterable
  15. remote
  16. clearable
  17. size="small"
  18. style="width:200px"
  19. @keyup.enter.native="handleQuery"
  20. :remote-method="corpsRemoteMethod"
  21. />
  22. </el-form-item>
  23. <el-form-item label="结算单位" prop="fCorpid">
  24. <el-select
  25. v-model="tablefilter.fCorpid"
  26. placeholder="请选择结算单位"
  27. filterable
  28. remote
  29. clearable
  30. size="small"
  31. style="width: 200px"
  32. @keyup.enter.native="handleQuery"
  33. :remote-method="corpsRemoteMethod"
  34. >
  35. <el-option
  36. v-for="(dict, index) in fMblnoOptions"
  37. :key="index.fId"
  38. :label="dict.fName"
  39. :value="dict.fId"
  40. ></el-option>
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item label="对账日期" prop="dateRange">
  44. <el-date-picker
  45. v-model="tablefilter.dateRange"
  46. size="small"
  47. style="width: 240px"
  48. value-format="yyyy-MM-dd"
  49. type="daterange"
  50. range-separator="-"
  51. start-placeholder="开始日期"
  52. end-placeholder="结束日期"
  53. ></el-date-picker>
  54. </el-form-item>
  55. <el-form-item label="系统编号" prop="fBillno">
  56. <el-input
  57. v-model="tablefilter.fBillno"
  58. placeholder="请输入系统编号"
  59. clearable
  60. size="small"
  61. style="width:200px"
  62. @keyup.enter.native="handleQuery"
  63. />
  64. </el-form-item>
  65. <el-form-item>
  66. <el-button
  67. type="cyan"
  68. icon="el-icon-search"
  69. size="mini"
  70. @click="handleQuery"
  71. >搜索</el-button
  72. >
  73. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  74. >重置</el-button
  75. >
  76. </el-form-item>
  77. </el-form>
  78. <el-row :gutter="10" class="mb8">
  79. <el-col :span="1.5">
  80. <el-button
  81. type="primary"
  82. icon="el-icon-plus"
  83. size="mini"
  84. @click="handleAdd"
  85. v-hasPermi="['finance:contrast:add']"
  86. >新增</el-button
  87. >
  88. </el-col>
  89. <el-col :span="1.5">
  90. <el-button
  91. type="success"
  92. icon="el-icon-edit"
  93. size="mini"
  94. :disabled="single"
  95. @click="handleUpdate"
  96. v-hasPermi="['warehouse:contrast:edit']"
  97. >修改</el-button
  98. >
  99. </el-col>
  100. <el-col :span="1.5">
  101. <el-button
  102. type="warning"
  103. icon="el-icon-download"
  104. size="mini"
  105. @click="handleExport"
  106. v-hasPermi="['finance:contrast:export']"
  107. >导出</el-button
  108. >
  109. </el-col>
  110. <right-toolbar
  111. :showSearch.sync="showSearch"
  112. @queryTable="getList"
  113. ></right-toolbar>
  114. </el-row>
  115. <el-table
  116. v-loading="loading"
  117. :data="contrastList"
  118. @selection-change="handleSelectionChange"
  119. show-summary
  120. :summary-method="listTotal"
  121. >
  122. <el-table-column width="50" align="center" type="selection"/>
  123. <!-- <el-table-column label="制单部门" align="center" prop="fId" /> -->
  124. <el-table-column label="行号" align="center" type="index"/>
  125. <el-table-column label="系统编号" align="center" prop="fBillno" show-overflow-tooltip width="120"/>
  126. <el-table-column label="货权方" align="center" show-overflow-tooltip prop="fCtrlcorpid" width="120"/>
  127. <el-table-column label="结算单位" align="center" prop="fCorpidName" show-overflow-tooltip width="120"/>
  128. <el-table-column label="账单日期" align="center" prop="fAccbilldate" width="120">
  129. <template slot-scope="scope">
  130. <span>{{ parseTime(scope.row.fAccbilldate, "{y}-{m}-{d}") }}</span>
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="提单号" align="center" prop="tMblno" width="120"/>
  134. <el-table-column label="金额" align="center" prop="fAmtdr" width="120"/>
  135. <el-table-column label="对账金额" align="center" prop="fAmtcr" width="120"/>
  136. <!-- <el-table-column label="单据类型" align="center" prop="fBilltype" />-->
  137. <el-table-column label="备注" align="center" show-overflow-tooltip prop="fRemarks" width="120"/>
  138. <el-table-column label="状态" align="center" prop="fBillstatus" width="120">
  139. <template slot-scope="scope">
  140. <span v-if="scope.row.fBillstatus == '1'">保存</span>
  141. <span v-else-if="scope.row.fBillstatus == '2'">暂存</span>
  142. <span v-else-if="scope.row.fBillstatus == '3'">审批驳回</span>
  143. <span v-else-if="scope.row.fBillstatus == '4'">提交审核</span>
  144. <span v-else-if="scope.row.fBillstatus == '5'">审核中</span>
  145. <span v-else-if="scope.row.fBillstatus == '6'">审核完成</span>
  146. </template>
  147. </el-table-column>
  148. <!-- <el-table-column label="制单部门" align="center" prop="fDeptid" /> -->
  149. <el-table-column
  150. label="操作"
  151. align="center"
  152. class-name="small-padding fixed-width"
  153. width="160"
  154. >
  155. <template slot-scope="scope">
  156. <el-button
  157. size="mini"
  158. type="text"
  159. icon="el-icon-view"
  160. @click="check(scope.row,0)"
  161. v-hasPermi="['finance:contrast:edit']"
  162. >查看</el-button
  163. >
  164. <el-button
  165. size="mini"
  166. type="text"
  167. icon="el-icon-view"
  168. @click="check(scope.row,1)"
  169. v-hasPermi="['finance:contrast:edit']"
  170. v-if="scope.row.fBillstatus == 4 || scope.row.fBillstatus == 5"
  171. >审批进度</el-button>
  172. <el-button
  173. size="mini"
  174. type="text"
  175. icon="el-icon-edit"
  176. @click="handleUpdate(scope.row)"
  177. v-hasPermi="['finance:contrast:edit']"
  178. v-if="scope.row.fBillstatus <= 3">
  179. 修改</el-button>
  180. <el-button
  181. size="mini"
  182. type="text"
  183. icon="el-icon-delete"
  184. @click="handleDelete(scope.row)"
  185. v-hasPermi="['finance:contrast:remove']"
  186. v-if="scope.row.fBillstatus <= 3"
  187. >删除</el-button
  188. >
  189. </template>
  190. </el-table-column>
  191. </el-table>
  192. <pagination
  193. v-show="total > 0"
  194. :total="total"
  195. :page.sync="queryParams.pageNum"
  196. :limit.sync="queryParams.pageSize"
  197. @pagination="getList"
  198. />
  199. <!-- 对账表 -->
  200. <el-dialog
  201. :visible.sync="open"
  202. width="70%"
  203. append-to-body
  204. :close-on-click-modal="false"
  205. :show-close="colseButton"
  206. >
  207. <el-form
  208. ref="ruless"
  209. :model="queryParams"
  210. :rules="ruless"
  211. label-width="68px"
  212. :inline="true"
  213. v-show="showSearch"
  214. >
  215. <el-form-item label="货权方" prop="fCtrlcorpid">
  216. <el-input
  217. v-model="queryParams.fCtrlcorpid"
  218. clearable
  219. size="small"
  220. style="width:200px"
  221. @keyup.enter.native="handleQuery"
  222. :disabled="notChange"
  223. placeholder="请输入客户名称"
  224. />
  225. </el-form-item>
  226. <el-form-item label="结算单位" label-width="78px" prop="fCorpid">
  227. <el-select
  228. v-model="queryParams.fCorpid"
  229. placeholder="请选择结算单位"
  230. filterable
  231. remote
  232. clearable
  233. :disabled="doNot"
  234. style="width: 200px"
  235. size="small"
  236. @keyup.enter.native="handleQuery"
  237. :remote-method="corpsRemoteMethod"
  238. >
  239. <el-option
  240. v-for="(dict, index) in fMblnoOptions"
  241. :key="index.fId"
  242. :label="dict.fName"
  243. :value="dict.fId"
  244. ></el-option>
  245. </el-select>
  246. </el-form-item>
  247. <!-- <el-form-item label="提单号" prop="tMblno">
  248. <el-input v-model="TWareHouseFees.tMblno" placeholder="" :disabled="true"/>
  249. </el-form-item> -->
  250. <el-form-item label="对账日期" prop="fAccbilldate" label-width="78px">
  251. <el-date-picker
  252. v-model="queryParams.fAccbilldate"
  253. size="small"
  254. style="width: 200px"
  255. value-format="yyyy-MM-dd"
  256. type="date"
  257. :disabled="notChange"
  258. placeholder="选择账单日期"
  259. >
  260. </el-date-picker>
  261. </el-form-item>
  262. <el-form-item label="系统编号" prop="fBillno">
  263. <el-input
  264. v-model="queryParams.fBillno"
  265. placeholder=""
  266. clearable
  267. size="small"
  268. :disabled="true"
  269. style="width: 200px"
  270. @keyup.enter.native="handleQuery"
  271. />
  272. </el-form-item>
  273. <el-form-item label="录入人" prop="createBy">
  274. <el-input v-model="queryParams.createBy" disabled/>
  275. </el-form-item>
  276. <el-form-item label="备注" prop="fRemarks">
  277. <el-input v-model="queryParams.fRemarks" size="small" style="width:200px" :disabled="notChange"/>
  278. </el-form-item>
  279. <div style="width: 100%">
  280. <el-button type="warning" size="small" @click="reconciliation" :disabled="notChange" v-if="queryParams.fBillstatus < '4'"
  281. >对账</el-button>
  282. <el-button type="primary" size="small" @click="confirmReconciliation" :disabled="notChange" v-if="queryParams.fBillstatus < '4'">确认对账</el-button>
  283. <el-button type="warning" size="small" @click="handleExportItems">导出</el-button>
  284. <el-button type="success" size="small" @click="backrRconciliation" v-if="queryParams.fBillstatus === '6'">撤销对账</el-button>
  285. <!-- <el-button type="info" size="small" @click="exportData">导出</el-button>-->
  286. <el-button type="danger" size="small" :disabled="disappear" v-if="queryParams.fBillstatus === '4'" @click="backApproval">撤销审批</el-button>
  287. </div>
  288. <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
  289. </el-form>
  290. <el-table
  291. v-loading="loading"
  292. :data="DzfeeList"
  293. @selection-change="handleSelectionChange_s"
  294. >
  295. <el-table-column label="行号" align="center" type="index" />
  296. <el-table-column label="提单号" align="center" prop="fMblno" />
  297. <el-table-column label="业务日期" align="center" prop="fBsdate">
  298. <template slot-scope="scope">
  299. <span>{{scope.row.fBsdate.slice(0, 10)}}</span>
  300. </template>
  301. </el-table-column>
  302. <el-table-column label="费用名称" align="center" prop="fFeeName" />
  303. <el-table-column label="收/付" align="center" prop="fSrcdc">
  304. <template slot-scope="scope">
  305. <span v-if="scope.row.fSrcdc == 'D'">收</span>
  306. <span v-else-if="scope.row.fSrcdc == 'C'">付</span>
  307. </template>
  308. </el-table-column>
  309. <el-table-column label="金额" align="center" prop="fAmtdr" />
  310. <el-table-column label="计价单位" align="center" prop="fFeeunitid" />
  311. <el-table-column label="数量" align="center" prop="fQty" />
  312. <el-table-column label="单价" align="center" prop="fUnitprice" />
  313. <el-table-column label="本次金额" align="center" prop="fAmt" />
  314. <el-table-column label="作业类型" align="center" prop="fBusinessType" />
  315. <el-table-column label="业务类型" align="center" prop="fBilltype">
  316. <template slot-scope="scope">
  317. <span v-if="scope.row.fBilltype == 'SJRK'">入库</span>
  318. <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
  319. <span v-else-if="scope.row.fBilltype == 'CKDB'">调拨</span>
  320. <span v-else-if="scope.row.fBilltype == 'HQZY'">货权转移</span>
  321. <span v-else-if="scope.row.fBilltype == 'JSCCF'">仓储费</span>
  322. <span v-else>{{scope.row.fBilltype}}</span>
  323. </template>
  324. </el-table-column>
  325. <el-table-column label="来源编号" align="center" prop="srcBillNo" />
  326. <el-table-column label="提单号" align="center" prop="fMblno" />
  327. <el-table-column label="货物品名" align="center" prop="fProductName" />
  328. <el-table-column label="品牌" align="center" prop="fMarks" />
  329. <el-table-column label="计费起始日期" align="center" prop="fChargedate">
  330. <template slot-scope="scope">
  331. <span>{{scope.row.fChargedate.slice(0, 10)}}</span>
  332. </template>
  333. </el-table-column>
  334. <el-table-column label="计费截止日期" align="center" prop="fBillingDeadline">
  335. <template slot-scope="scope">
  336. <span>{{scope.row.fBillingDeadline.slice(0, 10)}}</span>
  337. </template>
  338. </el-table-column>
  339. <el-table-column label="计费天数" align="center" prop="fBillingDays" />
  340. <el-table-column label="库存天数" align="center" prop="fInventoryDays" />
  341. <el-table-column label="备注" align="center" prop="fRemarks"/>
  342. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  343. <template slot-scope="scope">
  344. <el-button
  345. size="mini"
  346. type="text"
  347. icon="el-icon-delete"
  348. :disabled="notChange"
  349. @click.native.prevent="deleteRow(scope.$index,DzfeeList)"
  350. >删除
  351. </el-button>
  352. </template>
  353. </el-table-column>
  354. </el-table>
  355. <div slot="footer" class="dialog-footer">
  356. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  357. <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
  358. <el-button v-if="approve === true" @click="goApproval">审批</el-button>
  359. <el-button type="primary" v-if="queryParams.fBillstatus >= '3'"@click="addOrUpdateHandle()">查看审批流</el-button>
  360. <el-button type="primary" @click="submitForm" :disabled="notChange">保 存</el-button>
  361. <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
  362. <el-button v-if="cancelButton === false" @click="homePage">取消</el-button>
  363. </div>
  364. <!-- 添加或修改财务数据主对话框 -->
  365. <el-dialog
  366. :close-on-click-modal="false"
  367. width="70%"
  368. :title="title"
  369. :visible.sync="innerVisible"
  370. append-to-body
  371. >
  372. <el-form
  373. :model="TWareHouseFees"
  374. ref="feeListRules"
  375. :rules="feeListRules"
  376. label-width="80px"
  377. :inline="true"
  378. >
  379. <el-form-item
  380. label="货权方"
  381. prop="fCorpid"
  382. >
  383. <el-select
  384. v-model="TWareHouseFees.fCorpid"
  385. filterable
  386. remote
  387. clearable
  388. size="small"
  389. style="width: 200px"
  390. @keyup.enter.native="handleQuery"
  391. :remote-method="corpsRemoteMethod"
  392. placeholder="请输入客户名称"
  393. >
  394. <el-option
  395. v-for="(dict, index) in fMblnoOptions"
  396. :key="index.fId"
  397. :label="dict.fName"
  398. :value="dict.fId"
  399. ></el-option>
  400. </el-select>
  401. </el-form-item>
  402. <el-form-item label="结算单位" prop="fToCorpid">
  403. <el-select
  404. v-model="TWareHouseFees.fToCorpid"
  405. placeholder="请选择结算单位"
  406. :disabled="doNot"
  407. filterable
  408. remote
  409. clearable
  410. style="width: 200px"
  411. size="small"
  412. @keyup.enter.native="handleQuery"
  413. :remote-method="corpsRemoteMethod"
  414. >
  415. <el-option
  416. v-for="(dict, index) in fMblnoOptions"
  417. :key="index.fId"
  418. :label="dict.fName"
  419. :value="dict.fId"
  420. ></el-option>
  421. </el-select>
  422. </el-form-item>
  423. <el-form-item label="提单号" prop="fMblno">
  424. <el-input
  425. clearable
  426. v-model="TWareHouseFees.fMblno"
  427. placeholder="请输入提单号"
  428. style="width: 200px"
  429. size="small"
  430. />
  431. </el-form-item>
  432. <el-form-item label="收付" prop="fDc">
  433. <el-col :span="8">
  434. <el-select v-model="TWareHouseFees.fDc" size="small" style="width: 200px">
  435. <el-option label="收" value="D" />
  436. <el-option label="付" value="C" />
  437. </el-select>
  438. </el-col>
  439. </el-form-item>
  440. <el-form-item label="是否对账" prop="fReconciliation">
  441. <el-col :span="8">
  442. <el-select
  443. v-model="TWareHouseFees.fReconciliation"
  444. size="small"
  445. style="width: 200px"
  446. >
  447. <el-option label="是" value="1" />
  448. <el-option label="否" value="0" />
  449. </el-select>
  450. </el-col>
  451. </el-form-item>
  452. <el-form-item label="费用名称" prop="fFeeid">
  453. <template>
  454. <el-select
  455. v-model="TWareHouseFees.fFeeid"
  456. filterable
  457. :disabled="browseStatus"
  458. remote
  459. size="small"
  460. style="width:200px"
  461. :remote-method="fWRemoteMethod"
  462. placeholder="费用名称"
  463. multiple
  464. >
  465. <el-option
  466. v-for="item in fWbuOptions"
  467. :key="item.fId"
  468. :label="item.fName"
  469. :value="item.fId"
  470. >
  471. </el-option>
  472. </el-select>
  473. </template>
  474. </el-form-item>
  475. <el-form-item label="仓储业务" prop="fFeeid">
  476. <el-select
  477. v-model="TWareHouseFees.fBilltype"
  478. size="small"
  479. style="width:200px"
  480. @change="changefBilltype"
  481. placeholder="请选择仓储业务"
  482. >
  483. <el-option label="入库" value="SJRK"></el-option>
  484. <el-option label="出库" value="SJCK"></el-option>
  485. <el-option label="货权转移" value="HQZY"></el-option>
  486. </el-select>
  487. </el-form-item>
  488. <el-form-item label="作业类型" prop="fBusinessType">
  489. <el-select
  490. v-model="TWareHouseFees.fBusinessType"
  491. filterable
  492. :disabled="browseStatus"
  493. remote
  494. size="small"
  495. style="width:200px"
  496. placeholder="作业类型"
  497. multiple
  498. >
  499. <el-option
  500. v-for="dict in businessTypeOption"
  501. :key="dict.dictValue"
  502. :label="dict.dictLabel"
  503. :value="dict.dictValue"
  504. >
  505. </el-option>
  506. </el-select>
  507. </el-form-item>
  508. <el-form-item label="审核日期" prop="timeExamine">
  509. <el-date-picker
  510. style="width: 240px"
  511. size="small"
  512. v-model="TWareHouseFees.timeExamine"
  513. type="daterange"
  514. start-placeholder="开始日期"
  515. end-placeholder="结束日期"
  516. value-format="yyyy-MM-dd"
  517. :default-time="['00:00:00', '23:59:59']"
  518. >
  519. </el-date-picker>
  520. </el-form-item>
  521. <el-form-item label="对账日期" label-width="85px" prop="timeReconci" v-if="TWareHouseFees.fReconciliation == '1'">
  522. <el-date-picker
  523. v-model="TWareHouseFees.timeReconci"
  524. size="small"
  525. style="width: 240px"
  526. value-format="yyyy-MM-dd"
  527. type="daterange"
  528. start-placeholder="开始日期"
  529. end-placeholder="结束日期"
  530. :default-time="['00:00:00', '23:59:59']"
  531. ></el-date-picker>
  532. </el-form-item>
  533. <el-form-item>
  534. <!-- <el-button class="btnColor" type="info" size="mini">导入</el-button> -->
  535. <el-button
  536. type="cyan"
  537. size="mini"
  538. @click="searchFee"
  539. >搜索</el-button
  540. >
  541. <el-button
  542. type="info"
  543. size="mini"
  544. @click="resetQuery_s"
  545. >重置</el-button
  546. >
  547. </el-form-item>
  548. <el-table
  549. v-loading="loading"
  550. :data="feeList"
  551. ref="feeList"
  552. show-summary
  553. :summary-method="getSum"
  554. @selection-change="handleSelectionChange_s"
  555. >
  556. <el-table-column type="selection" width="55" align="center" />
  557. <!-- <el-table-column label="制单部门" align="center" prop="fId" /> -->
  558. <el-table-column label="行号" align="center" type="index"/>
  559. <el-table-column label="货权方" align="center" prop="fName" show-overflow-tooltip/>
  560. <el-table-column label="结算单位" align="center" prop="fFeesName" show-overflow-tooltip/>
  561. <!-- <el-table-column label="账单日期" align="center" prop="fAccbilldate"/> -->
  562. <el-table-column label="提单号" align="center" prop="fMblno" />
  563. <el-table-column label="品名" align="center" prop="fProductName" />
  564. <el-table-column label="业务日期" align="center" prop="fBsdate" />
  565. <el-table-column label="业务类型" align="center" prop="fBilltype">
  566. <template slot-scope="scope">
  567. <span v-if="scope.row.fBilltype == 'SJRK'">入库</span>
  568. <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
  569. <span v-else-if="scope.row.fBilltype == 'CKDB'">调拨</span>
  570. <span v-else-if="scope.row.fBilltype == 'HQZY'">货权转移</span>
  571. <span v-else-if="scope.row.fBilltype == 'JSCCF'">仓储费</span>
  572. </template>
  573. </el-table-column>
  574. <el-table-column label="作业类型" align="center" prop="fBusinessType" />
  575. <!-- <el-table-column label="单据类型" align="center" prop="fBilltype" />-->
  576. <el-table-column
  577. label="审核日期"
  578. align="center"
  579. prop="fReviewDate"
  580. />
  581. <el-table-column label="金额" align="center" prop="fAmtdr" />
  582. <el-table-column label="本次金额" align="center" prop="fAmt" width="100">
  583. <template slot-scope="scope">
  584. <el-input
  585. v-model="scope.row.fAmt"
  586. placeholder="请输入本次金额"
  587. clearable
  588. size="small"
  589. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  590. @change="imgChangeI(scope.row)"
  591. />
  592. </template>
  593. </el-table-column>
  594. <el-table-column label="费用名称" align="center" prop="fFeeName" />
  595. <el-table-column label="备注" align="center" prop="fRemarks">
  596. <template slot-scope="scope">
  597. <el-input
  598. v-model="scope.row.fRemarks"
  599. placeholder="请输入备注"
  600. clearable
  601. size="small"
  602. width="100"
  603. />
  604. </template>
  605. </el-table-column>
  606. </el-table>
  607. </el-form>
  608. <div slot="footer" class="dialog-footer">
  609. <el-button type="primary" @click="confirmImport">确 定</el-button>
  610. <el-button @click="signOut">取 消</el-button>
  611. </div>
  612. </el-dialog>
  613. </el-dialog>
  614. <!-- 打印页面 -->
  615. <!-- <el-dialog-->
  616. <!-- :visible.sync="openPrint"-->
  617. <!-- width="80%"-->
  618. <!-- append-to-body-->
  619. <!-- :close-on-click-modal="false"-->
  620. <!-- title="对账单"-->
  621. <!-- >-->
  622. <!-- <el-table-->
  623. <!-- ref="table"-->
  624. <!-- id="print_area2"-->
  625. <!-- v-loading="loading"-->
  626. <!-- :data="printObject"-->
  627. <!-- @selection-change="handleSelectionChange_s">-->
  628. <!-- <el-table-column label="行号" align="center" type="index" width="70"/>-->
  629. <!-- <el-table-column label="提单号" align="center" prop="fMblno" />-->
  630. <!-- <el-table-column label="业务日期" align="center" prop="fBsdate">-->
  631. <!-- <template slot-scope="scope">-->
  632. <!-- <span>{{scope.row.fBsdate.slice(0,10)}}</span>-->
  633. <!-- </template>-->
  634. <!-- </el-table-column>-->
  635. <!-- <el-table-column label="费用名称" align="center" prop="fFeeName" />-->
  636. <!-- <el-table-column label="收/付" align="center" prop="fSrcdc">-->
  637. <!-- <template slot-scope="scope">-->
  638. <!-- <span v-if="scope.row.fSrcdc == 'D'">收</span>-->
  639. <!-- <span v-else-if="scope.row.fSrcdc == 'C'">付</span>-->
  640. <!-- </template>-->
  641. <!-- </el-table-column>-->
  642. <!-- <el-table-column label="金额" align="center" prop="fAmtdr" />-->
  643. <!-- <el-table-column label="本次金额" align="center" prop="fAmt"/>-->
  644. <!-- <el-table-column label="业务类型" align="center" prop="fBilltype">-->
  645. <!-- <template slot-scope="scope">-->
  646. <!-- <span v-if="scope.row.fBilltype == 'SJRK'">入库</span>-->
  647. <!-- <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>-->
  648. <!-- <span v-else-if="scope.row.fBilltype == 'CKDB'">调拨</span>-->
  649. <!-- <span v-else-if="scope.row.fBilltype == 'HQZY'">货权转移</span>-->
  650. <!-- <span v-else>{{scope.row.fBilltype}}</span>-->
  651. <!-- </template>-->
  652. <!-- </el-table-column>-->
  653. <!-- </el-table>-->
  654. <!-- <span slot="footer" class="dialog-footer">-->
  655. <!-- <el-button type="primary" style="marginTop:10px" @click="printSomething">打印</el-button>-->
  656. <!-- <el-button @click="openPrint = false">取消</el-button>-->
  657. <!-- </span>-->
  658. <!-- </el-dialog>-->
  659. </div>
  660. </template>
  661. <script>
  662. import { RevocationApproval, backFee, detailFee, Cfee, listFee, getFee, delFee, addFee, updateFee, exportFee, importFee,exportWarehousebillsitems} from "@/api/finance/contrast";
  663. import { listCorps } from '@/api/basicdata/corps'
  664. import { listFees } from '@/api/basicdata/fees'
  665. import AddOrUpdate from '@/views/viewApproval'
  666. import { queryUserVal } from '@/api/warehouseBusiness/agreement'
  667. import moment from 'moment'
  668. import print from "print-js"
  669. import ApprovalComments from '@/views/startApproval'
  670. import Global from '@/layout/components/global'
  671. export default {
  672. name: "Fee",
  673. data() {
  674. return {
  675. //控制结算单位是否可操作
  676. doNot:false,
  677. jFeetunitOptions:[],
  678. // 总条数
  679. total: 0,
  680. totAL:0,
  681. Ttime:0,
  682. colseButton:true,
  683. approval:[],
  684. disappear:false,
  685. addIndex:[],
  686. addOrUpdateVisible: false,
  687. addOrUpdateVisib:false,
  688. contrastId:210,
  689. // 审批状态
  690. approve:false,
  691. // 打印表
  692. printObject:[],
  693. //登陆人
  694. Lander:'',
  695. openPrint:false,
  696. statrGo:true,
  697. state_s: true,
  698. notChange:false,
  699. browseStatus:false,
  700. options:'',
  701. dateRange:"",
  702. // 遮罩层
  703. loading: true,
  704. fAccbilldate: '',
  705. // 选中数组
  706. ids: [],
  707. // 非单个禁用
  708. single: true,
  709. // 非多个禁用
  710. multiple: true,
  711. // 显示搜索条件
  712. showSearch: true,
  713. // 财务数据主表格数据
  714. feeList: [],
  715. // 客户(客户数据)
  716. fMblnoOptions: [],
  717. fFeeunitidOptions: [],
  718. fWbuOptions: [],
  719. KHblnoOptions: [],
  720. //打开内部弹窗
  721. innerVisible: false,
  722. selection: '',
  723. // 弹出层标题
  724. title: "",
  725. // 操作人
  726. Operator:'',
  727. // 是否显示弹出层
  728. open: false,
  729. dialogVisible: false,
  730. // 财务对账表格
  731. DzfeeList: [],
  732. // 财务主页面表格
  733. contrastList: [],
  734. empty:[],
  735. nothing:[],
  736. Fee:[],
  737. //导入从表传主表
  738. pass:{
  739. fAmtdr:'', //应收合计
  740. fAmtcr:'', //应付合计
  741. fMblno:'', //提单号
  742. fName:'', //货权方
  743. fFeesName:'', //结算单位
  744. fCorpid:'' //结算单位ID
  745. },
  746. hide:false,
  747. cancelButton:true,
  748. businessTypeOption:[],
  749. // 传值对象
  750. TWareHouseFees:{
  751. fCorpid:'',
  752. fToCorpid:'',
  753. fMblno:'',
  754. fStatementNo:'',
  755. fFeeid :'',
  756. timeExamine:'',
  757. timeInterval:'',
  758. fDc:'D',
  759. fReconciliation:'0',
  760. timeReconci:'',
  761. fBusinessType:'',
  762. fBilltype:'SJRK'
  763. },
  764. // 查询参数
  765. queryParams: {
  766. pageNum: 1,
  767. pageSize: 10,
  768. fBillno: null,
  769. fCtrlcorpid: null,
  770. fCorpid: null,
  771. tMblno: null,
  772. fAmtdr: null,
  773. fAmtcr: null,
  774. fId:null,
  775. fBilltype: null,
  776. fBillstatus: null,
  777. fRemarks: null,
  778. fAccbilldate: null,
  779. fDeptid: null,
  780. createBy: null,
  781. timeReconci: null
  782. },
  783. // 主表查询参数
  784. tablefilter: {
  785. pageNum: 1,
  786. pageSize: 10,
  787. fBillno: null,
  788. fCtrlcorpid: null,
  789. fId:null,
  790. fCorpid: null,
  791. tMblno: null,
  792. fAmtdr: null,
  793. fAmtcr: null,
  794. fBilltype: null,
  795. fBillstatus: null,
  796. fRemarks: null,
  797. fAccbilldate: null,
  798. fDeptid: null
  799. },
  800. // 表单参数
  801. form: {},
  802. // 表单校验
  803. ruless:{
  804. fCtrlcorpid: [
  805. { required: true, message: ' ', trigger: 'blur' }
  806. ],
  807. fCorpid: [
  808. { required: true, message: ' ', trigger: 'blur' }
  809. ],
  810. fAccbilldate: [
  811. { required: true, message: ' ', trigger: 'blur' }
  812. ]
  813. },
  814. feeListRules: {
  815. fDc: [
  816. { required:true,message: ' ', trigger:'blur' }
  817. ],
  818. fToCorpid: [
  819. { required:true,message:' ', trigger:'blur'}
  820. ],
  821. fReconciliation: [
  822. { required:true,message:' ', trigger:'blur'}
  823. ],
  824. timeExamine: [
  825. { required: true, message: ' ', trigger: 'blur' }
  826. ]
  827. }
  828. };
  829. },
  830. components: {
  831. AddOrUpdate,
  832. ApprovalComments
  833. },
  834. created() {
  835. this.getList()
  836. this.register()
  837. this.getDicts("data_unitfees").then((response) => {
  838. this.jFeetunitOptions = response.data;
  839. });
  840. this.getDicts("st_in_type").then((response) => {
  841. this.businessTypeOption = response.data;
  842. });
  843. },
  844. activated(){
  845. this.Jump()
  846. },
  847. methods: {
  848. //对账页面合计
  849. listTotal(param){
  850. const { columns, data } = param
  851. const sums = []
  852. columns.forEach((column, index) => {
  853. if (index === 0) {
  854. sums[index] = '合计'
  855. } else if (index ===7 || index ===8 ) {
  856. const values = data.map(item => Number(item[column.property]))
  857. if (!values.every(value => isNaN(value))) {
  858. sums[index] = values.reduce((prev, curr) => {
  859. const value = Number(curr)
  860. if (!isNaN(value)) {
  861. return prev + curr
  862. } else {
  863. return prev
  864. }
  865. }, 0)
  866. }
  867. }
  868. })
  869. return sums
  870. },
  871. //财务主取消
  872. signOut(){
  873. if(this.DzfeeList.length == 0){
  874. this.doNot = false
  875. }else{
  876. this.doNot = true
  877. }
  878. this.innerVisible = false
  879. this.feeList = []
  880. },
  881. // 审批跳转
  882. Jump(){
  883. this.approval = this.$route.query.data
  884. if(this.approval){
  885. this.colseButton = false
  886. this.approval = JSON.parse(this.approval)
  887. this.hide = false
  888. this.doNot = true
  889. this.notChange = true
  890. this.approve = true
  891. this.disappear = true
  892. this.cancelButton = false
  893. this.reset()
  894. this.pass = {
  895. fAmtdr: '', //应收合计
  896. fAmtcr: '', //应付合计
  897. fMblno: '', //提单号
  898. fName: '', //货权方
  899. fFeesName: '', //结算单位
  900. fCorpid: '' //结算单位ID
  901. }
  902. getFee(this.approval.billId).then(response => {
  903. this.Operator = response.data.tFee.createBy
  904. this.DzfeeList = response.data.feeDoList
  905. this.fWbuOptions = response.data.feesList
  906. this.queryParams = response.data.tFee
  907. this.fWbuOptions = response.data.feesList
  908. this.fMblnoOptions = response.data.corps
  909. this.open = true;
  910. this.title = "修改财务数据主"
  911. })
  912. }
  913. },
  914. homepaGe(){
  915. let view = {
  916. fullPath: "/finance/contrast",
  917. hash: "",
  918. matched: Array(2),
  919. meta: Object,
  920. name: "Contrast",
  921. params: Object,
  922. path: "/finance/contrast",
  923. query: Object,
  924. title: "对账"
  925. }
  926. this.$router.push({ path: '/index'})
  927. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  928. if (this.isActive(view)) {
  929. this.toLastView(visitedViews, view)
  930. }
  931. })
  932. Global.$emit("removeCache", "closeSelectedTag", view);
  933. },
  934. homePage() {
  935. this.open = false
  936. let view = {
  937. fullPath: "/finance/contrast",
  938. hash: "",
  939. matched: Array(2),
  940. meta: Object,
  941. name: "Contrast",
  942. params: Object,
  943. path: "/finance/contrast",
  944. query: Object,
  945. title: "对账"
  946. }
  947. this.$router.push({ path: '/index' })
  948. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  949. if (this.isActive(view)) {
  950. this.toLastView(visitedViews, view)
  951. }
  952. })
  953. Global.$emit("removeCache", "closeSelectedTag", view);
  954. },
  955. // 撤销审批
  956. backApproval(){
  957. let data = {
  958. id:this.queryParams.fId,
  959. actId:this.contrastId,
  960. billId:this.queryParams.fId
  961. }
  962. RevocationApproval(data).then(response => {
  963. this.msgSuccess("撤销审批成功")
  964. this.disappear = true
  965. this.open = false
  966. this.getList()
  967. })
  968. },
  969. returnData(){
  970. this.addOrUpdateVisib = false
  971. this.open = false
  972. this.homepaGe()
  973. },
  974. getDataList(){
  975. this.addOrUpdateVisible = false
  976. },
  977. // 审批按钮
  978. goApproval(){
  979. this.addOrUpdateVisib = true
  980. this.$nextTick(() => {
  981. this.$refs.ApprovalComments.init(this.queryParams.fId,this.contrastId)
  982. })
  983. },
  984. // 查看审批流
  985. addOrUpdateHandle(){
  986. this.addOrUpdateVisible = true
  987. this.addOrUpdateVisib = false
  988. let id = '448'
  989. let actId = '110'
  990. this.$nextTick(() => {
  991. this.$refs.addOrUpdate.init(this.queryParams.fId,this.contrastId)
  992. })
  993. },
  994. // 撤销对账
  995. backrRconciliation(){
  996. this.queryParams.fBillstatus = '1'
  997. let formDate = new window.FormData()
  998. formDate.append('tFee',JSON.stringify(this.queryParams))
  999. formDate.append("tFeeDo", JSON.stringify(this.DzfeeList))
  1000. backFee(formDate).then(response=>{
  1001. this.msgSuccess("撤回成功")
  1002. this.open = false
  1003. this.reset()
  1004. this.getList()
  1005. })
  1006. },
  1007. // 打印功能
  1008. printing() {
  1009. if(this.DzfeeList.length !== 0){
  1010. this.openPrint = true
  1011. this.printObject = this.DzfeeList
  1012. }else {
  1013. this.$message.error('无数据,请检查是否有数据');
  1014. }
  1015. },
  1016. // 确认打印
  1017. printSomething() {
  1018. // 此处的style即为打印时的样式
  1019. const style ='table tr td,th { border-collapse: collapse;padding:15px;border:.5px #000 solid;text-align:center;}'
  1020. // "@media print {} }";
  1021. print({
  1022. printable: "print_area2",
  1023. type: "html",
  1024. header:"对账表",
  1025. headerStyle: 'text-align:center;color:#000;width:100%;',
  1026. style: style,// 亦可使用引入的外部css;
  1027. scanStyles: false,
  1028. });
  1029. },
  1030. // 确认对账按钮功能
  1031. confirmReconciliation(){
  1032. this.$refs['ruless'].validate(valid => {
  1033. if(valid){
  1034. if(this.DzfeeList.length){
  1035. // this.queryParams.fBillstatus = '4'
  1036. let formDate = new window.FormData()
  1037. formDate.append('tFee',JSON.stringify(this.queryParams))
  1038. formDate.append("tFeeDo", JSON.stringify(this.DzfeeList))
  1039. Cfee(formDate).then(response=>{
  1040. this.open = false
  1041. this.msgSuccess("操作成功")
  1042. this.getList()
  1043. })
  1044. }else{
  1045. this.$message.error('表单为空不允许操作');
  1046. }
  1047. }
  1048. })
  1049. },
  1050. //导出
  1051. handleExportItems() {
  1052. const fIds = this.queryParams.fId
  1053. if(fIds !== null){
  1054. this.$confirm("是否确认导出所有计费物资明细数据?", "警告", {
  1055. confirmButtonText: "确定",
  1056. cancelButtonText: "取消",
  1057. type: "warning",
  1058. })
  1059. .then(function () {
  1060. return exportWarehousebillsitems(fIds);
  1061. })
  1062. .then((response) => {
  1063. this.download(response.msg);
  1064. });
  1065. }else{
  1066. this.$message("请先保存")
  1067. }
  1068. },
  1069. // 对账按钮功能
  1070. reconciliation(){
  1071. this.queryParameter = {
  1072. fToCorpid: this.queryParams.fCorpid,
  1073. }
  1074. this.innerVisible = true
  1075. this.feeList = []
  1076. this.TWareHouseFees = {
  1077. fCorpid:'',
  1078. fToCorpid:this.queryParams.fCorpid,
  1079. fMblno:'',
  1080. fStatementNo:'',
  1081. fFeeid :'',
  1082. timeExamine:'',
  1083. timeInterval:'',
  1084. fSrcdc:'',
  1085. fReconciliation:'0',
  1086. timeReconci: '',
  1087. fDc:'D',
  1088. fBilltype:''
  1089. }
  1090. if(this.queryParams.fCorpid){
  1091. this.doNot = true
  1092. }
  1093. },
  1094. // 默认录入人
  1095. register() {
  1096. queryUserVal().then((response)=>{
  1097. this.Lander = response.user.userName
  1098. })
  1099. },
  1100. // 合计
  1101. getSum(param){
  1102. const {columns,data} = param;
  1103. const sums = [];
  1104. columns.forEach((column, index) => {
  1105. sums[0] = '合计'
  1106. sums[10] = this.totAL.toFixed(2)
  1107. sums[9] = this.Ttime.toFixed(2)
  1108. });
  1109. return sums;
  1110. },
  1111. // 导入多选框
  1112. handleSelectionChange_s(selection) {
  1113. this.totAL = 0
  1114. this.Ttime = 0
  1115. this.selection = selection
  1116. if(this.selection.length == 0){
  1117. for (let item in this.feeList){
  1118. this.totAL += Number(this.feeList[item].fAmt)
  1119. this.Ttime += Number(this.feeList[item].fAmtdr)
  1120. }
  1121. }else{
  1122. for (let index in selection){
  1123. this.totAL += Number(selection[index].fAmt)
  1124. this.Ttime += Number(selection[index].fAmtdr)
  1125. }
  1126. }
  1127. },
  1128. // 多选框选中数据
  1129. handleSelectionChange(selection) {
  1130. this.totAL = 0
  1131. this.ids = selection.map(item => item.fId)
  1132. this.single = selection.length !== 1
  1133. this.multiple = !selection.length
  1134. },
  1135. // 金额筛选
  1136. imgChangeI(row){
  1137. if (row.fAmt && Number(row.fAmt) > Number(row.fAmtdr)){
  1138. this.$set(row, 'fAmt', row.fAmtdr)
  1139. this.state_s = true
  1140. }
  1141. if (this.selection.length !== 0){
  1142. this.totAL = 0
  1143. this.Ttime = 0
  1144. for (let item in this.selection){
  1145. this.totAL += Number(this.selection[item].fAmt)
  1146. this.Ttime += Number(this.selection[item].fAmtdr)
  1147. }
  1148. }else {
  1149. this.totAL = 0
  1150. this.Ttime = 0
  1151. for (let item in this.feeList){
  1152. this.totAL += Number(this.feeList[item].fAmt)
  1153. this.Ttime += Number(this.feeList[item].fAmtdr)
  1154. }
  1155. }
  1156. },
  1157. /* 添加财务数据主 导入*/
  1158. confirmImport(){
  1159. this.doNot = true
  1160. this.hide = true
  1161. this.pass.fAmtdr = 0
  1162. this.pass.fAmtcr = 0
  1163. for (let item in this.selection) {
  1164. this.pass.fAmtcr = Number(this.pass.fAmtcr)
  1165. this.pass.fAmtdr = Number(this.pass.fAmtdr)
  1166. this.pass.fAmtcr += Number(this.selection[item].fAmt)
  1167. this.pass.fAmtdr += Number(this.selection[item].fAmtdr.toFixed(2))
  1168. }
  1169. this.pass.fAmtcr.toFixed(2)
  1170. if(this.state_s == true) {
  1171. if (this.selection.length == '0') {
  1172. this.$message.error('未选择导入行');
  1173. } else {
  1174. for (let item in this.selection){
  1175. this.empty.push(this.selection[item].fMblno)
  1176. this.nothing.push(this.selection[item].fName)
  1177. if(this.DzfeeList.length === 0) {
  1178. this.DzfeeList = this.DzfeeList.concat(this.selection)
  1179. //去重提单号
  1180. this.empty = new Set(this.empty)
  1181. this.empty = Array.from(this.empty)
  1182. //去重货权方
  1183. this.nothing = new Set(this.nothing)
  1184. this.nothing = Array.from(this.nothing)
  1185. if(this.empty.length <= 1){
  1186. this.pass.fMblno = this.empty[0]
  1187. }else {
  1188. this.pass.fMblno = this.empty[0] + "..."
  1189. }
  1190. if (this.nothing.length <= 1){
  1191. this.pass.fName = this.nothing[0]
  1192. }else {
  1193. this.pass.fName = this.nothing[0] + "..."
  1194. }
  1195. // this.DzfeeList = this.DzfeeList.concat(this.Fee)
  1196. this.queryParams.tMblno = this.pass.fMblno //提单号
  1197. this.queryParams.fCorpid = this.TWareHouseFees.fToCorpid
  1198. this.queryParams.fCtrlcorpid = this.pass.fName
  1199. this.queryParams.fAmtcr = this.pass.fAmtcr
  1200. this.queryParams.fAmtdr = this.pass.fAmtdr
  1201. this.innerVisible = false
  1202. this.feeList = []
  1203. // this.feeList = this.DzfeeList
  1204. this.TWareHouseFees = {
  1205. fCorpid:'',
  1206. fToCorpid:'',
  1207. fMblno:'',
  1208. fStatementNo:'',
  1209. fFeeid :'',
  1210. timeExamine:'',
  1211. timeInterval:'',
  1212. fSrcdc:'',
  1213. fReconciliation:'0',
  1214. timeReconci: '',
  1215. fDc:'D'
  1216. }
  1217. return
  1218. }else{
  1219. for(let li in this.DzfeeList){
  1220. if(this.selection[item].fSrcid !== this.DzfeeList[li].fSrcid){
  1221. this.Fee = this.DzfeeList.concat(this.selection)
  1222. console.log(this.Fee)
  1223. let result = [];
  1224. let obj = {};
  1225. for(let lis in this.Fee){
  1226. if(!obj[this.Fee[lis].fSrcid]){
  1227. result.push(this.Fee[lis]);
  1228. obj[this.Fee[lis].fSrcid] = true;
  1229. }
  1230. }
  1231. //去重提单号
  1232. this.empty = new Set(this.empty)
  1233. this.empty = Array.from(this.empty)
  1234. //去重货权方
  1235. this.nothing = new Set(this.nothing)
  1236. this.nothing = Array.from(this.nothing)
  1237. if(this.empty.length <= 1){
  1238. this.pass.fMblno = this.empty[0]
  1239. }else {
  1240. this.pass.fMblno = this.empty[0] + "..."
  1241. }
  1242. if (this.nothing.length <= 1){
  1243. this.pass.fName = this.nothing[0]
  1244. }else {
  1245. this.pass.fName = this.nothing[0] + "..."
  1246. }
  1247. // this.DzfeeList = this.DzfeeList.concat(this.Fee)
  1248. this.queryParams.tMblno = this.pass.fMblno //提单号
  1249. this.queryParams.fCorpid = this.TWareHouseFees.fToCorpid
  1250. this.queryParams.fCtrlcorpid = this.pass.fName
  1251. this.queryParams.fAmtcr = this.pass.fAmtcr
  1252. this.queryParams.fAmtdr = this.pass.fAmtdr
  1253. this.innerVisible = false
  1254. this.feeList = []
  1255. // this.feeList = this.DzfeeList
  1256. this.TWareHouseFees = {
  1257. fCorpid:'',
  1258. fToCorpid:'',
  1259. fMblno:'',
  1260. fStatementNo:'',
  1261. fFeeid :'',
  1262. timeExamine:'',
  1263. timeInterval:'',
  1264. fSrcdc:'',
  1265. fReconciliation:'0',
  1266. timeReconci: '',
  1267. fDc:'D'
  1268. }
  1269. this.DzfeeList = result
  1270. }else{
  1271. let i = Number(item)+1
  1272. this.$message.error('行号为'+ i +'重复')
  1273. }
  1274. }
  1275. }
  1276. }
  1277. }
  1278. }else if(this.state_s == false){
  1279. this.$message.error('本次金额不能大于原定金额');
  1280. }
  1281. },
  1282. // imgChangeI(fAmtdr,fAmt){
  1283. // if (fAmt <= fAmtdr){
  1284. // this.state_s = true
  1285. // }else if(fAmt > fAmtdr){
  1286. // this.$message.error('本次金额不能大于原定金额');
  1287. // this.state_s = false
  1288. // }
  1289. // },
  1290. // 导入搜索
  1291. searchFee() {
  1292. this.feeList = []
  1293. this.$refs['feeListRules'].validate(valid => {
  1294. if (valid){
  1295. importFee(this.TWareHouseFees).then(response =>{
  1296. this.feeList = response.rows
  1297. if(this.feeList.length !== 0){
  1298. this.$message.success("查询成功")
  1299. this.totAL = 0
  1300. this.Ttime = 0
  1301. for (let item in this.feeList){
  1302. this.totAL += Number(this.feeList[item].fAmt)
  1303. this.Ttime += Number(this.feeList[item].fAmtdr)
  1304. }
  1305. }else{
  1306. this.$message.error("暂无数据")
  1307. }
  1308. })
  1309. }
  1310. })
  1311. },
  1312. /** 打开导入表弹窗 */
  1313. openImportTable() {
  1314. this.$refs.import.show();
  1315. },
  1316. /** 查询财务数据主列表 */
  1317. getList() {
  1318. this.loading = true;
  1319. this.getDicts("approval_process").then(response => {
  1320. // this.feeList = response.rows;
  1321. this.options = response.data
  1322. });
  1323. listFee(this.tableFilter).then(response => {
  1324. this.contrastList = response.rows
  1325. this.total = response.total
  1326. this.loading = false
  1327. })
  1328. },
  1329. // 取消按钮
  1330. cancel() {
  1331. this.open = false;
  1332. // this.feeList = []
  1333. this.reset();
  1334. this.getList()
  1335. },
  1336. // 表单重置
  1337. reset() {
  1338. this.form = {
  1339. fId: null,
  1340. fBillno: null,
  1341. fCtrlcorpid: null,
  1342. fCorpid: null,
  1343. tMblno: null,
  1344. fAmtdr: null,
  1345. fAmtcr: null,
  1346. fBilltype: null,
  1347. fBillstatus: "0",
  1348. fRemarks: null,
  1349. fAccbilldate: null,
  1350. delFlag: null,
  1351. createBy: null,
  1352. fDeptid: null,
  1353. createTime: null,
  1354. updateBy: null,
  1355. updateTime: null
  1356. };
  1357. this.resetForm("form");
  1358. },
  1359. /** 搜索按钮操作 */
  1360. handleQuery() {
  1361. this.queryParams.pageNum = 1;
  1362. this.getList();
  1363. // this.searchFee()
  1364. },
  1365. changefBilltype(){
  1366. this.businessTypeOption = []
  1367. if (this.TWareHouseFees.fBilltype == 'SJRK'){
  1368. this.getDicts("st_in_type").then((response) => {
  1369. this.businessTypeOption = response.data;
  1370. });
  1371. }else if (this.TWareHouseFees.fBilltype == 'SJCK'){
  1372. this.getDicts("st_out_type").then((response) => {
  1373. this.businessTypeOption = response.data;
  1374. });
  1375. }else if(this.TWareHouseFees.fBilltype == 'HQZY'){
  1376. this.getDicts("st_trans_type").then((response) => {
  1377. this.businessTypeOption = response.data;
  1378. });
  1379. }
  1380. },
  1381. /** 重置按钮操作 */
  1382. resetQuery() {
  1383. // this.resetForm("queryParams_s");
  1384. this.tableFilter = {
  1385. pageNum: 1,
  1386. pageSize: 10,
  1387. fBillno: null,
  1388. fCtrlcorpid: null,
  1389. fId: null,
  1390. fCorpid: null,
  1391. tMblno: null,
  1392. fAmtdr: null,
  1393. fAmtcr: null,
  1394. fBilltype: null,
  1395. fBillstatus: null,
  1396. fRemarks: null,
  1397. fAccbilldate: null,
  1398. fDeptid: null
  1399. }
  1400. this.queryParams_s = {
  1401. pageNum: 1,
  1402. pageSize: 10,
  1403. fBillno: null,
  1404. fCtrlcorpid: null,
  1405. fId: null,
  1406. fCorpid: null,
  1407. tMblno: null,
  1408. fAmtdr: null,
  1409. fAmtcr: null,
  1410. fBilltype: null,
  1411. fBillstatus: null,
  1412. fRemarks: null,
  1413. fAccbilldate: null,
  1414. fDeptid: null
  1415. }
  1416. this.handleQuery();
  1417. this.TWareHouseFees={
  1418. fCorpid:'',
  1419. fToCorpid:'',
  1420. fMblno:'',
  1421. fStatementNo:'',
  1422. fFeeid :'',
  1423. timeExamine:'',
  1424. timeInterval:'',
  1425. fSrcdc:'',
  1426. fReconciliation:'0'
  1427. }
  1428. },
  1429. //导入重置按钮
  1430. resetQuery_s() {
  1431. this.TWareHouseFees = {
  1432. fCorpid: '',
  1433. fToCorpid: '',
  1434. fMblno: '',
  1435. fStatementNo: '',
  1436. fFeeid: '',
  1437. timeExamine: '',
  1438. timeInterval: '',
  1439. fDc:'D',
  1440. fReconciliation:'0'
  1441. }
  1442. },
  1443. // 多选框选中数据
  1444. // handleSelectionChange(selection) {
  1445. // this.ids = selection.map(item => item.fId)
  1446. // this.single = selection.length!==1
  1447. // this.multiple = !selection.length
  1448. // },
  1449. // handleSelectionChanGe(selection){
  1450. // if(selection.length > 0) {
  1451. // this.statrGo = false
  1452. // }else{
  1453. // this.statrGo = true
  1454. // }
  1455. // },
  1456. /** 新增按钮操作 */
  1457. handleAdd() {
  1458. queryUserVal().then((response) => {
  1459. this.queryParams.createBy = response.user.userName
  1460. })
  1461. this.doNot = false
  1462. this.notChange = false
  1463. this.hide = true
  1464. this.reset()
  1465. this.DzfeeList = []
  1466. this.pass = {
  1467. fAmtdr: '', //应收合计
  1468. fAmtcr: '', //应付合计
  1469. fMblno: '', //提单号
  1470. fName: '', //货权方
  1471. fFeesName: '', //结算单位
  1472. fCorpid: '' //结算单位ID
  1473. }
  1474. this.open = true
  1475. this.title = '添加财务数据主'
  1476. this.queryParams = {
  1477. pageNum: 1,
  1478. pageSize: 10,
  1479. fBillno: null,
  1480. fCtrlcorpid: null,
  1481. fCorpid: null,
  1482. tMblno: null,
  1483. fAmtdr: null,
  1484. fId: null,
  1485. fAmtcr: null,
  1486. fBilltype: null,
  1487. fBillstatus: null,
  1488. fRemarks: null,
  1489. fAccbilldate: null,
  1490. fDeptid: null,
  1491. createBy: null,
  1492. timeReconci: null
  1493. }
  1494. },
  1495. // 查看按钮
  1496. check(row, res) {
  1497. this.doNot = true
  1498. this.notChange = true
  1499. getFee(row.fId).then(response => {
  1500. this.Operator = response.data.tFee.createBy
  1501. this.DzfeeList = response.data.feeDoList
  1502. this.fWbuOptions = response.data.feesList
  1503. this.queryParams = response.data.tFee
  1504. this.fWbuOptions = response.data.feesList
  1505. this.fMblnoOptions = response.data.corps
  1506. this.open = true
  1507. this.disappear = true
  1508. this.title = '修改财务数据主'
  1509. if (res == 1) {
  1510. this.notChange = true
  1511. if (this.Operator == this.Lander) {
  1512. this.disappear = false
  1513. this.reset()
  1514. this.pass = {
  1515. fAmtdr: '', //应收合计
  1516. fAmtcr: '', //应付合计
  1517. fMblno: '', //提单号
  1518. fName: '', //货权方
  1519. fFeesName: '', //结算单位
  1520. fCorpid: '' //结算单位ID
  1521. }
  1522. const fId = row.fId || this.ids
  1523. getFee(fId).then(response => {
  1524. this.DzfeeList = response.data.feeDoList
  1525. this.fWbuOptions = response.data.feesList
  1526. this.queryParams = response.data.tFee
  1527. this.fWbuOptions = response.data.feesList
  1528. this.fMblnoOptions = response.data.corps
  1529. this.open = true
  1530. })
  1531. } else {
  1532. this.notChange = true
  1533. }
  1534. } else {
  1535. this.notChange = true
  1536. this.reset()
  1537. this.pass = {
  1538. fAmtdr: '', //应收合计
  1539. fAmtcr: '', //应付合计
  1540. fMblno: '', //提单号
  1541. fName: '', //货权方
  1542. fFeesName: '', //结算单位
  1543. fCorpid: '' //结算单位ID
  1544. }
  1545. const fId = row.fId || this.ids
  1546. getFee(fId).then(response => {
  1547. this.DzfeeList = response.data.feeDoList
  1548. this.fWbuOptions = response.data.feesList
  1549. this.queryParams = response.data.tFee
  1550. this.fWbuOptions = response.data.feesList
  1551. this.fMblnoOptions = response.data.corps
  1552. this.open = true
  1553. this.open = true
  1554. })
  1555. }
  1556. })
  1557. },
  1558. /** 修改按钮操作 */
  1559. handleUpdate(row) {
  1560. this.notChange = false
  1561. this.hide = false
  1562. this.reset();
  1563. this.pass={
  1564. fAmtdr:'', //应收合计
  1565. fAmtcr:'', //应付合计
  1566. fMblno:'', //提单号
  1567. fName:'', //货权方
  1568. fFeesName:'', //结算单位
  1569. fCorpid:'' //结算单位ID
  1570. }
  1571. const fId = row.fId || this.ids
  1572. getFee(fId).then(response => {
  1573. this.Operator = response.data.tFee.createBy
  1574. this.DzfeeList = response.data.feeDoList
  1575. this.fWbuOptions = response.data.feesList
  1576. this.queryParams = response.data.tFee
  1577. this.fMblnoOptions = response.data.corps
  1578. this.open = true;
  1579. this.title = "修改财务数据主";
  1580. if(this.DzfeeList){
  1581. this.doNot = true
  1582. }else{
  1583. this.doNot = false
  1584. }
  1585. });
  1586. },
  1587. /** 远程模糊查询用户 */
  1588. corpsRemoteMethod(name) {
  1589. if (name == null || name === "") {
  1590. return false;
  1591. }
  1592. let queryParams = { pageNum: 1, pageSize: 10, fName: name, type: 1 };
  1593. listCorps(queryParams).then((response) => {
  1594. this.fMblnoOptions = response.rows;
  1595. this.KHblnoOptions = response.rows;
  1596. });
  1597. },
  1598. /** 提交按钮 */
  1599. submitForm() {
  1600. this.$refs['ruless'].validate(valid => {
  1601. if (valid) {
  1602. if (!this.queryParams.fId) {
  1603. this.queryParams.fBillstatus = '1'
  1604. let formData = new window.FormData()
  1605. formData.append('tFee', JSON.stringify(this.queryParams))
  1606. formData.append('tFeeDo', JSON.stringify(this.DzfeeList))
  1607. updateFee(formData).then(response => {
  1608. console.log(response)
  1609. this.queryParams = response.data.tFee
  1610. this.msgSuccess('新增成功')
  1611. // this.DzfeeList = []
  1612. // this.open = false;
  1613. this.getList()
  1614. })
  1615. } else {
  1616. this.pass.fAmtcr = 0
  1617. this.pass.fAmtdr = 0
  1618. for (let item in this.DzfeeList) {
  1619. this.pass.fAmtcr += Number(this.DzfeeList[item].fAmt)
  1620. this.pass.fAmtdr += Number(this.DzfeeList[item].fAmtdr)
  1621. }
  1622. this.queryParams.fAmtcr = Number(this.pass.fAmtcr.toFixed(2))
  1623. this.queryParams.fAmtdr = Number(this.pass.fAmtdr.toFixed(2))
  1624. this.pass.fAmtcr.toFixed(2)
  1625. this.queryParams.fBillstatus = '1'
  1626. let formData = new window.FormData()
  1627. formData.append('tFee', JSON.stringify(this.queryParams))
  1628. formData.append('tFeeDo', JSON.stringify(this.DzfeeList))
  1629. addFee(formData).then(response => {
  1630. this.msgSuccess('修改成功')
  1631. // this.DzfeeList = []
  1632. // this.open = false;
  1633. this.getList()
  1634. })
  1635. }
  1636. }
  1637. })
  1638. },
  1639. /** 删除按钮操作 */
  1640. handleDelete(row) {
  1641. const fIds = row.fId || this.ids
  1642. let tips = ''
  1643. detailFee(fIds).then(res => {
  1644. switch (res.msg) {
  1645. case '0': {
  1646. this.$message.error('当前数据已被其他操作员操作,请刷新页面')
  1647. break
  1648. }
  1649. case '1': {
  1650. tips = '当前主表有数据,从表无数据,确认是否删除?'
  1651. this.delete_s(fIds, tips)
  1652. break
  1653. }
  1654. case '2': {
  1655. tips = '当前主表有数据,从表有数据,确认是否删除?'
  1656. this.delete_s(fIds, tips)
  1657. break
  1658. }
  1659. default: {
  1660. return this.$message.error('未知错误,无状态')
  1661. }
  1662. }
  1663. })
  1664. },
  1665. delete_s(fIds, tips) {
  1666. this.$confirm(tips, '警告', {
  1667. confirmButtonText: '确定',
  1668. cancelButtonText: '取消',
  1669. type: 'warning'
  1670. }).then(function() {
  1671. return delFee(fIds)
  1672. }).then(() => {
  1673. this.getList()
  1674. this.msgSuccess('删除成功')
  1675. })
  1676. },
  1677. // 远程模糊查询费用名称
  1678. fWRemoteMethod(name) {
  1679. this.fWbuOptions = []
  1680. if (name == null || name === "") {
  1681. return false;
  1682. }
  1683. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  1684. listFees(queryParams).then((response) => {
  1685. this.fWbuOptions = response.rows
  1686. });
  1687. },
  1688. /** 导出按钮操作 */
  1689. handleExport() {
  1690. const queryParams = this.queryParams;
  1691. this.$confirm('是否确认导出所有财务数据主数据项?', "警告", {
  1692. confirmButtonText: "确定",
  1693. cancelButtonText: "取消",
  1694. type: "warning"
  1695. }).then(function() {
  1696. return exportFee(queryParams);
  1697. }).then(response => {
  1698. this.download(response.msg);
  1699. })
  1700. },
  1701. exportData(){
  1702. // 在这里判断筛选DzfeeList={}
  1703. const DzfeeList = this.DzfeeList
  1704. this.$confirm('是否确认导出所有财务数据主数据项?', "警告", {
  1705. confirmButtonText: "确定",
  1706. cancelButtonText: "取消",
  1707. type: "warning"
  1708. }).then(function(){
  1709. return
  1710. }).then(function(){
  1711. this.download(response.msg);
  1712. })
  1713. },
  1714. //清空一行
  1715. deleteRow(index, rows) {
  1716. this.queryParams.fAmtdr = 0
  1717. this.queryParams.fAmtcr = 0
  1718. rows.splice(index, 1)
  1719. for(let item in this.DzfeeList) {
  1720. this.queryParams.fAmtcr = this.DzfeeList[item].fAmt
  1721. this.queryParams.fAmtdr = this.DzfeeList[item].fAmtdr
  1722. }
  1723. if(this.DzfeeList == 0){
  1724. console.log("111")
  1725. this.doNot = false
  1726. }else{
  1727. this.doNot = true
  1728. }
  1729. },
  1730. },
  1731. };
  1732. </script>
  1733. <style lang="scss" scoped>
  1734. </style>