index.vue 50 KB

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