index.vue 50 KB

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