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