index.vue 50 KB

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