index.vue 42 KB

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