index.vue 48 KB

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