index.vue 48 KB

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