index.vue 42 KB

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