index.vue 43 KB

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