AddOrUpdate.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065
  1. <template>
  2. <div>
  3. <el-dialog
  4. :title="title"
  5. :visible.sync="showDialog"
  6. width="80%"
  7. :close-on-click-modal="false"
  8. @close="handleClose"
  9. >
  10. <el-form
  11. ref="form"
  12. :model="form"
  13. label-width="110px"
  14. >
  15. <el-row>
  16. <el-col :span="6">
  17. <el-form-item label="业务类型" prop="fBilltype">
  18. <el-select
  19. placeholder="请选择原业务类型"
  20. clearable
  21. size="small"
  22. style="width: 100%"
  23. :disabled="isDisabled"
  24. v-model="form.fBilltype"
  25. >
  26. <el-option
  27. v-for="(dict, index) in billTypeList"
  28. :key="index.dictValue"
  29. :label="dict.dictLabel"
  30. :value="dict.dictValue"
  31. />
  32. </el-select>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="6">
  36. <el-form-item label="客户名称">
  37. <el-select
  38. placeholder="请选择客户名称"
  39. clearable
  40. size="small"
  41. style="width: 100%"
  42. :disabled="isDisabled"
  43. v-model="form.fCorpid"
  44. >
  45. <el-option
  46. v-for="(dict, index) in fMblnoOptions"
  47. :key="index.fId"
  48. :label="dict.fName"
  49. :value="dict.fId"
  50. />
  51. </el-select>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="6">
  55. <el-form-item label="系统编码" prop="fBillno">
  56. <el-input
  57. placeholder="请输入系统编码"
  58. size="small"
  59. style="width: 100%"
  60. :disabled="isDisabled"
  61. v-model="form.fBillno"
  62. ></el-input>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :span="6">
  66. <el-form-item label="提单号" prop="">
  67. <el-input
  68. placeholder="请输入提单号"
  69. size="small"
  70. style="width: 100%"
  71. :disabled="isDisabled"
  72. v-model="form.fMblno"
  73. ></el-input>
  74. </el-form-item>
  75. </el-col>
  76. </el-row>
  77. <el-row>
  78. <el-col :span="6">
  79. <el-form-item label="业务日期" prop="fBstime">
  80. <el-date-picker
  81. v-model="form.fBstime"
  82. style="width: 80%"
  83. type="date"
  84. placeholder="业务日期"
  85. :disabled="isDisabled"
  86. >
  87. </el-date-picker>
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="6">
  91. <el-form-item label="仓库" prop="">
  92. <el-select
  93. v-model="form.fWarehouseid"
  94. style="width: 100%"
  95. :disabled="isDisabled"
  96. placeholder="请输入仓库"
  97. size="small"
  98. >
  99. <el-option
  100. v-for="(item, index) in warehouseOptions"
  101. :key="index.fId"
  102. :label="item.fName"
  103. :value="item.fId"
  104. ></el-option>
  105. </el-select>
  106. </el-form-item>
  107. </el-col>
  108. <el-col :span="6">
  109. <el-form-item label="品名" prop="">
  110. <el-select
  111. v-model="form.fGoodsid"
  112. style="width: 100%"
  113. :disabled="isDisabled"
  114. placeholder="请输入品名"
  115. size="small"
  116. >
  117. <el-option
  118. v-for="(item, index) in goodsOptions"
  119. :key="index.fId"
  120. :label="item.fName"
  121. :value="item.fId"
  122. ></el-option>
  123. </el-select>
  124. </el-form-item>
  125. </el-col>
  126. <el-col :span="6">
  127. <div style="display: flex;justify-content: flex-end">
  128. <el-button
  129. type="primary"
  130. v-if="!isDisabled"
  131. >查询</el-button>
  132. </div>
  133. </el-col>
  134. </el-row>
  135. </el-form>
  136. <el-collapse v-model="collapselist">
  137. <el-collapse-item :name="1">
  138. <template slot="title">
  139. <span style="font-size: 16px; font-weight: bolder; margin-left: 5px"
  140. >原业务费用信息</span>
  141. </template>
  142. <el-row :gutter="10" style="padding-bottom: 10px">
  143. <div style="display: flex;justify-content: flex-end">
  144. <div style="margin: 0 12px">
  145. <el-button
  146. icon="el-icon-setting"
  147. size="mini"
  148. circle
  149. @click="showSetting = !showSetting"
  150. ></el-button>
  151. </div>
  152. </div>
  153. </el-row>
  154. <el-dialog title="自定义列显示" append-to-body :visible.sync="showSetting" width="700px">
  155. <div>配置排序列数据(拖动调整顺序)</div>
  156. <div style="margin-left: 17px">
  157. <el-checkbox
  158. v-model="allCheck"
  159. label="全选"
  160. @change="allChecked"
  161. ></el-checkbox>
  162. </div>
  163. <div style="padding: 4px; display: flex; justify-content: center">
  164. <draggable
  165. v-model="setRowList"
  166. group="site"
  167. animation="300"
  168. @start="onStart"
  169. @end="onEnd"
  170. handle=".indraggable"
  171. >
  172. <transition-group>
  173. <div
  174. v-for="item in setRowList"
  175. :key="item.surface"
  176. class="listStyle"
  177. >
  178. <div style="width: 500px" class="indraggable">
  179. <div class="progress" :style="{ width: item.width + 'px' }">
  180. <el-checkbox
  181. :label="item.name"
  182. v-model="item.checked"
  183. :true-label="0"
  184. :false-label="1"
  185. >{{ item.name }}
  186. </el-checkbox>
  187. </div>
  188. </div>
  189. <el-input-number
  190. v-model.number="item.width"
  191. controls-position="right"
  192. :min="1"
  193. :max="500"
  194. size="mini"
  195. ></el-input-number>
  196. </div>
  197. </transition-group>
  198. </draggable>
  199. </div>
  200. <span slot="footer" class="dialog-footer">
  201. <el-button @click="showSetting = false">取 消</el-button>
  202. <el-button @click="delRow" type="danger">重 置</el-button>
  203. <el-button type="primary" @click="save()">确 定</el-button>
  204. </span>
  205. </el-dialog>
  206. <el-table :data="feesList" style="width: 100%">
  207. <el-table-column
  208. v-for="(item, index) in getRowList"
  209. :key="index"
  210. :label="item.name"
  211. :width="item.width"
  212. :prop="item.label"
  213. align="center"
  214. sortable
  215. :fixed="item.fixed"
  216. >
  217. <template slot-scope="scope">
  218. <span id="span1" v-if="item.label == 'fCorpid'">
  219. <el-select
  220. v-model="scope.row.fCorpid"
  221. placeholder="请输入客户名称"
  222. :clearable="true"
  223. filterable
  224. size="mini"
  225. :disabled="true"
  226. >
  227. <el-option
  228. v-for="(dict, index) in fMblnoOptions"
  229. :key="index.fId"
  230. :label="dict.fName"
  231. :value="dict.fId"
  232. />
  233. </el-select>
  234. </span>
  235. <span v-else-if="item.label == 'fFeeid'">
  236. <el-select
  237. v-model="scope.row.fFeeid"
  238. filterable
  239. :disabled="true"
  240. remote
  241. placeholder="费用名称"
  242. >
  243. <el-option
  244. v-for="(dict, index) in fNameOptions"
  245. :key="index.fId"
  246. :label="dict.fName"
  247. :value="dict.fId"
  248. ></el-option>
  249. </el-select>
  250. </span>
  251. <span v-else-if="item.label == 'fDc'">
  252. <el-select
  253. v-model="scope.row.fDc"
  254. placeholder="请选择"
  255. :disabled="true"
  256. >
  257. <el-option label="收" value="D"></el-option>
  258. <el-option label="付" value="C"></el-option>
  259. </el-select>
  260. </span>
  261. <span v-else-if="item.label == 'fFeeunitid'">
  262. <el-select
  263. v-model="scope.row.fFeeunitid"
  264. placeholder="请选择计费单位"
  265. :disabled="true"
  266. clearable
  267. >
  268. <el-option
  269. v-for="dict in jFeetunitOptions"
  270. :key="dict.dictValue"
  271. :label="dict.dictLabel"
  272. :value="dict.dictValue"
  273. />
  274. </el-select>
  275. </span>
  276. <span v-else-if="item.label == 'fQty'">
  277. <el-input
  278. v-model="scope.row.fQty"
  279. :disabled="true"
  280. placeholder="请输入计费数量"
  281. @input="total(scope.row)"
  282. v-input-limit="2"
  283. ></el-input>
  284. </span>
  285. <span v-else-if="item.label == 'fUnitprice'">
  286. <el-input
  287. v-model="scope.row.fUnitprice"
  288. :disabled="true"
  289. placeholder="请输入单价"
  290. @input="total(scope.row)"
  291. v-input-limit="2"
  292. ></el-input>
  293. </span>
  294. <span v-else-if="item.label == 'fCurrency'">
  295. <el-input
  296. v-model="scope.row.fCurrency"
  297. :disabled="true"
  298. placeholder="请输入币种"
  299. ></el-input>
  300. </span>
  301. <span v-else-if="item.label == 'fExrate'">
  302. <el-input
  303. v-model="scope.row.fExrate"
  304. :disabled="true"
  305. placeholder="请输入汇率"
  306. ></el-input>
  307. </span>
  308. <span v-else-if="item.label == 'fAmount'">
  309. <el-input
  310. v-model="scope.row.fAmount"
  311. :disabled="true"
  312. placeholder="请输入金额"
  313. ></el-input>
  314. </span>
  315. <span v-else-if="item.label == 'fTaxrate'">
  316. <el-input
  317. v-model="scope.row.fTaxrate"
  318. :disabled="true"
  319. placeholder="请输入税率"
  320. ></el-input>
  321. </span>
  322. <span v-else-if="item.label == 'remarks'">
  323. <el-input
  324. v-model="scope.row.remarks"
  325. :disabled="true"
  326. placeholder="请输入备注"
  327. ></el-input>
  328. </span>
  329. <span v-else-if="item.label == 'fSrcTypeId'">
  330. <span v-if="scope.row.fSrcTypeId == 0">手动录入</span>
  331. <span v-if="scope.row.fSrcTypeId == 1">协议导入</span>
  332. <span v-if="scope.row.fSrcTypeId == 2">凯和订单</span>
  333. <span v-if="scope.row.fSrcTypeId == 10">费用变更</span>
  334. </span>
  335. <span v-else>{{ scope.row[item.label] }}</span>
  336. </template>
  337. </el-table-column>
  338. <el-table-column
  339. label="操作"
  340. align="center"
  341. class-name="small-padding fixed-width"
  342. fixed="right"
  343. width="100px"
  344. >
  345. <template slot-scope="scope">
  346. <el-button
  347. size="mini"
  348. type="text"
  349. icon="el-icon-circle-plus"
  350. @click.native.prevent="change(scope.row)"
  351. :disabled="form.fStatus > 3"
  352. >导入</el-button>
  353. </template>
  354. </el-table-column>
  355. </el-table>
  356. </el-collapse-item>
  357. <el-collapse-item :name="2">
  358. <template slot="title">
  359. <span style="font-size: 16px; font-weight: bolder; margin-left: 5px"
  360. >更改费用信息</span>
  361. </template>
  362. <div>
  363. <div style="display: flex; justify-content: space-between; margin: 10px 0">
  364. <div>
  365. <el-button
  366. type="primary"
  367. icon="el-icon-plus"
  368. size="mini"
  369. @click="handleSave"
  370. v-hasPermi="['warehouse:modify:remove']"
  371. >保 存</el-button>
  372. <el-button
  373. type="primary"
  374. icon="el-icon-plus"
  375. size="mini"
  376. @click="hanldeAdd"
  377. v-hasPermi="['warehouse:modify:remove']"
  378. :disabled="form.fStatus > 3"
  379. >新 行</el-button>
  380. </div>
  381. </div>
  382. </div>
  383. <el-table :data="formfeesList" style="width: 100%">
  384. <el-table-column
  385. prop="fCorpid"
  386. label="结算单位"
  387. align="center"
  388. width="180"
  389. >
  390. <template slot-scope="scope">
  391. <el-select
  392. v-model="scope.row.fCorpid"
  393. placeholder="请输入计算单位"
  394. :clearable="true"
  395. filterable
  396. size="mini"
  397. style="width: 160px"
  398. :disabled="disabledtwo"
  399. >
  400. <el-option
  401. v-for="(dict, index) in fMblnoOptions"
  402. :key="index.fId"
  403. :label="dict.fName"
  404. :value="dict.fId"
  405. />
  406. </el-select>
  407. </template>
  408. </el-table-column>
  409. <el-table-column
  410. prop="fFeeid"
  411. label="费用名称"
  412. align="center"
  413. width="120"
  414. >
  415. <template slot-scope="scope">
  416. <el-select
  417. v-model="scope.row.fFeeid"
  418. filterable
  419. :disabled="disabledtwo"
  420. remote
  421. placeholder="费用名称"
  422. >
  423. <el-option
  424. v-for="(dict, index) in fNameOptions"
  425. :key="index.fId"
  426. :label="dict.fName"
  427. :value="dict.fId"
  428. ></el-option>
  429. </el-select>
  430. </template>
  431. </el-table-column>
  432. <el-table-column prop="fDc" label="收付" align="center" width="100">
  433. <template slot-scope="scope">
  434. <el-select
  435. v-model="scope.row.fDc"
  436. placeholder="请选择"
  437. disabled
  438. >
  439. <el-option label="收" value="D"></el-option>
  440. <el-option label="付" value="C"></el-option>
  441. </el-select>
  442. </template>
  443. </el-table-column>
  444. <el-table-column
  445. prop="fFeeunitid"
  446. label="计费单位"
  447. align="center"
  448. width="100"
  449. >
  450. <template slot-scope="scope">
  451. <el-select
  452. v-model="scope.row.fFeeunitid"
  453. placeholder="请选择计费单位"
  454. :disabled="disabledtwo"
  455. clearable
  456. >
  457. <el-option
  458. v-for="dict in jFeetunitOptions"
  459. :key="dict.dictValue"
  460. :label="dict.dictLabel"
  461. :value="dict.dictValue"
  462. />
  463. </el-select>
  464. </template>
  465. </el-table-column>
  466. <el-table-column
  467. prop="fQty"
  468. label="计费数量"
  469. align="center"
  470. width="100"
  471. >
  472. <template slot-scope="scope">
  473. <el-input
  474. v-model="scope.row.fQty"
  475. :disabled="disabledtwo"
  476. placeholder="请输入内容"
  477. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  478. @input="total(scope.row)"
  479. ></el-input>
  480. </template>
  481. </el-table-column>
  482. <el-table-column
  483. prop="fUnitprice"
  484. label="单价"
  485. align="center"
  486. width="100"
  487. >
  488. <template slot-scope="scope">
  489. <el-input
  490. v-model="scope.row.fUnitprice"
  491. :disabled="disabledtwo"
  492. placeholder="请输入内容"
  493. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  494. @input="total(scope.row)"
  495. ></el-input>
  496. </template>
  497. </el-table-column>
  498. <el-table-column
  499. prop="fCurrency"
  500. label="币种"
  501. align="center"
  502. width="100">
  503. <template slot-scope="scope">
  504. <el-input
  505. v-model="scope.row.fCurrency"
  506. :disabled="disabledtwo"
  507. placeholder="请输入内容"></el-input>
  508. </template>
  509. </el-table-column>
  510. <el-table-column prop="fExrate" label="汇率" align="center" width="100">
  511. <template slot-scope="scope">
  512. <el-input
  513. v-model="scope.row.fExrate"
  514. :disabled="disabledtwo"
  515. placeholder="请输入内容"
  516. ></el-input>
  517. </template>
  518. </el-table-column>
  519. <el-table-column prop="fAmount" label="金额" align="center" width="100">
  520. <template slot-scope="scope">
  521. <el-input
  522. v-model="scope.row.fAmount"
  523. :disabled="disabledtwo"
  524. placeholder="请输入内容"
  525. ></el-input>
  526. </template>
  527. </el-table-column>
  528. <el-table-column
  529. prop="fTaxrate"
  530. label="税率"
  531. align="center"
  532. width="100"
  533. >
  534. <template slot-scope="scope">
  535. <el-input
  536. v-model="scope.row.fTaxrate"
  537. :disabled="disabledtwo"
  538. placeholder="请输入内容"
  539. ></el-input>
  540. </template>
  541. </el-table-column>
  542. <el-table-column prop="fSrcTypeId" label="费用来源" align="center">
  543. <template slot-scope="scope">
  544. <span v-if="scope.row.fSrcTypeId == 0">手动录入</span>
  545. <span v-if="scope.row.fSrcTypeId == 1">协议导入</span>
  546. <span v-if="scope.row.fSrcTypeId == 2">凯和订单</span>
  547. <span v-if="scope.row.fSrcTypeId == 10">费用变更</span>
  548. </template>
  549. </el-table-column>
  550. <el-table-column prop="remarks" label="录入人" align="center"></el-table-column>
  551. <el-table-column prop="remarks" label="录入日期" align="center"></el-table-column>
  552. <el-table-column prop="remarks" label="审核人" align="center"></el-table-column>
  553. <el-table-column prop="remarks" label="审核日期" align="center"></el-table-column>
  554. <el-table-column prop="remarks" label="备注" align="center" width="180">
  555. <template slot-scope="scope">
  556. <el-input
  557. v-model="scope.row.remarks"
  558. :disabled="disabledtwo"
  559. placeholder="请输入内容"
  560. ></el-input>
  561. </template>
  562. </el-table-column>
  563. <el-table-column
  564. label="操作"
  565. align="center"
  566. class-name="small-padding fixed-width"
  567. fixed="right"
  568. width="140px"
  569. >
  570. <template slot-scope="scope">
  571. <el-button
  572. size="mini"
  573. type="text"
  574. icon="el-icon-delete"
  575. :disabled="form.fStatus > 3"
  576. @click.native.prevent="deleteRow(scope,scope.$index)"
  577. v-hasPermi="['warehouse:modify:remove']"
  578. >删除</el-button>
  579. <!-- <el-button-->
  580. <!-- size="mini"-->
  581. <!-- type="text"-->
  582. <!-- icon="el-icon-delete"-->
  583. <!-- :disabled="scope.row.fBillstatus === 6"-->
  584. <!-- v-if="scope.row.fId"-->
  585. <!-- @click.native.prevent="changerequest(scope)"-->
  586. <!-- >请核</el-button>-->
  587. </template>
  588. </el-table-column>
  589. </el-table>
  590. </el-collapse-item>
  591. </el-collapse>
  592. <span slot="footer">
  593. <approval-comments
  594. v-if="addOrUpdateVisib"
  595. ref="ApprovalComments"
  596. @refreshDataList="returnData"
  597. ></approval-comments>
  598. <el-button
  599. type="primary"
  600. v-if="approVal && form.fStatus >= 4 && form.fStatus < 6"
  601. @click="addOrUpdateHand(form, 'f_status')"
  602. >审 批</el-button>
  603. <el-button
  604. type="primary"
  605. v-if="form.fStatus > 3"
  606. @click="addOrUpdateHandle('f_status')"
  607. >查看审批</el-button>
  608. <el-button
  609. type="success"
  610. @click="submitAllowChanges"
  611. :disabled="form.fStatus > 3"
  612. >修 改</el-button>
  613. <el-button
  614. type="primary"
  615. @click="handleSave"
  616. >保 存</el-button>
  617. <el-button
  618. type="primary"
  619. @click="pleaseCheckHandle"
  620. v-if="form.fStatus <= 3"
  621. >请 核</el-button>
  622. <el-button
  623. type="danger"
  624. @click="cancelRequest"
  625. v-if="form.fStatus >= 4 && form.fStatus < 6"
  626. >撤销审批</el-button>
  627. <el-button @click="handleClose">取 消</el-button>
  628. </span>
  629. </el-dialog>
  630. <add-or-update
  631. ref="viewApproval"
  632. v-if="veiwVisible"
  633. @refreshDataList="getDataList"
  634. ></add-or-update>
  635. </div>
  636. </template>
  637. <script>
  638. import {saveWarehouseModify,
  639. checkWarehouseModify,
  640. deleteWarehouse,
  641. cancelRequest} from "@/api/warehouseBusiness/wareHouseModify";
  642. import { listCorps } from "@/api/basicdata/corps";
  643. import {listFees} from "@/api/basicdata/fees";
  644. import { addSet, resetModule, select } from '@/api/system/set';
  645. import Cookies from 'js-cookie';
  646. import draggable from "vuedraggable";
  647. import ApprovalComments from "@/views/startApproval";
  648. import AddOrUpdate from "@/views/viewApproval";
  649. export default {
  650. name: "AddOrUpdate1",
  651. props: {
  652. addOrUpdateVisible: {
  653. type: Boolean,
  654. default: false,
  655. },
  656. title: {
  657. type: String,
  658. required: ''
  659. },
  660. // 主表
  661. form: Object,
  662. // 原业务费用信息表
  663. feesList: {
  664. type: Array,
  665. default: () => [],
  666. },
  667. goodsOptions: {
  668. type: Array,
  669. default: () => [],
  670. },
  671. warehouseOptions: {
  672. type: Array,
  673. default: () => [],
  674. },
  675. // 更改费用信息
  676. formfeesList: {
  677. type: Array,
  678. default: () => [],
  679. },
  680. // 新增FALSE,查看/跳转TRUE
  681. isDisabled: {
  682. type: Boolean
  683. },
  684. fDc: {
  685. type: String
  686. },
  687. warehouseId: {
  688. type: Number
  689. },
  690. disabledtwo: {
  691. type: Boolean,
  692. default: false,
  693. },
  694. approVal: {
  695. type: Boolean,
  696. default: false
  697. },
  698. },
  699. components: {
  700. draggable,
  701. AddOrUpdate,
  702. ApprovalComments,
  703. },
  704. data() {
  705. return {
  706. // 控制弹出框显示隐藏
  707. showDialog: false,
  708. // 折叠面板激活
  709. collapselist: [1, 2],
  710. billTypeList: [],
  711. fMblnoOptions: [],
  712. tableDate: [
  713. {
  714. surface: "1",
  715. label: "fCorpid",
  716. name: "结算单位",
  717. checked: 0,
  718. width: 150,
  719. },
  720. {
  721. surface: "2",
  722. label: "fFeeid",
  723. name: "费用名称",
  724. checked: 0,
  725. width: 120,
  726. },
  727. {
  728. surface: "3",
  729. label: "fDc",
  730. name: "收付",
  731. checked: 0,
  732. width: 100,
  733. },
  734. {
  735. surface: "4",
  736. label: "fFeeunitid",
  737. name: "计费单位",
  738. checked: 0,
  739. width: 120,
  740. },
  741. {
  742. surface: "5",
  743. label: "fQty",
  744. name: "计费数量",
  745. checked: 0,
  746. width: 100,
  747. },
  748. {
  749. surface: "6",
  750. label: "fUnitprice",
  751. name: "单价",
  752. checked: 0,
  753. width: 100,
  754. },
  755. {
  756. surface: "7",
  757. label: "fCurrency",
  758. name: "币种",
  759. checked: 0,
  760. width: 100,
  761. },
  762. {
  763. surface: "8",
  764. label: "fExrate",
  765. name: "汇率",
  766. checked: 0,
  767. width: 100,
  768. },
  769. {
  770. surface: "9",
  771. label: "fAmount",
  772. name: "金额",
  773. checked: 0,
  774. width: 100,
  775. },
  776. {
  777. surface: "10",
  778. label: "fTaxrate",
  779. name: "税率",
  780. checked: 0,
  781. width: 100,
  782. },
  783. {
  784. surface: "11",
  785. label: "remarks",
  786. name: "备注",
  787. checked: 0,
  788. width: 150,
  789. },
  790. {
  791. surface: "12",
  792. label: "fSrcTypeId",
  793. name: "费用来源",
  794. checked: 0,
  795. width: 100,
  796. },
  797. ],
  798. setRowList: [],
  799. getRowList: [],
  800. // 自定义列弹窗显示
  801. showSetting: false,
  802. //自定义列宽
  803. allCheck: false,
  804. drag: false,
  805. fNameOptions: [],
  806. jFeetunitOptions: [],
  807. veiwVisible: false,
  808. addOrUpdateVisib: false
  809. }
  810. },
  811. created() {
  812. this.setRowList = this.tableDate;
  813. this.getRowList = this.tableDate;
  814. this.getDicts("data_billtype_type").then((response) => {
  815. console.log(response)
  816. this.billTypeList = response.data;
  817. });
  818. this.getDicts("data_unitfees").then((response) => {
  819. if (response.data) {
  820. this.jFeetunitOptions = response.data;
  821. this.jFeetunitOptions.forEach(item => {
  822. item.dictValue = parseInt(item.dictValue)
  823. })
  824. }
  825. });
  826. listCorps().then((response) => {
  827. this.fMblnoOptions = response.rows;
  828. });
  829. // this.$nextTick(() => {
  830. // console.log(this.fDc)
  831. // if (this.fDc == 'D') {
  832. // listFees({fDc: "D"}).then((response) => {
  833. // this.fNameOptions = response.rows;
  834. // });
  835. // } else if(this.fDc == 'C') {
  836. // listFees({fDc: "C"}).then((response) => {
  837. // this.fNameOptions = response.rows;
  838. // });
  839. // }
  840. // })
  841. },
  842. watch: {
  843. addOrUpdateVisible(oldVal, newWal) {
  844. this.showDialog = this.addOrUpdateVisible;
  845. }
  846. },
  847. methods: {
  848. init() {
  849. let fDc = '';
  850. if (this.fDc) {
  851. fDc = this.fDc
  852. } else {
  853. fDc = this.form.fDc
  854. }
  855. listFees({fDc: fDc}).then((response) => {
  856. this.fNameOptions = response.rows;
  857. });
  858. },
  859. // 弹出框关闭后触发
  860. handleClose() {
  861. // 子组件调用父组件方法,并传递参数
  862. this.disabledtwo = true
  863. this.$emit("changeShow", "false");
  864. this.collapses = [];
  865. },
  866. // 添加新行
  867. hanldeAdd() {
  868. let DC = null
  869. if (this.form.fDc) {
  870. DC = this.form.fDc
  871. } else {
  872. DC = this.fDc
  873. }
  874. let list = {
  875. fId: null,
  876. fCorpid: null,
  877. fDc: DC,
  878. fFeeunitid: null,
  879. fQty: null,
  880. fUnitprice: null,
  881. fCurrency: null,
  882. fExrate: null,
  883. fAmount: null,
  884. fTaxrate: null,
  885. fSrcTypeId: 10,
  886. fBillstatus: null,
  887. actId: 1000,
  888. fBilltype: this.form.fBilltype
  889. }
  890. console.log(list)
  891. this.formfeesList.push(list)
  892. },
  893. //变更按钮
  894. change(row){
  895. console.log(row)
  896. let list = JSON.parse(JSON.stringify(row))
  897. list.fId = ''
  898. list.fBillstatus = ''
  899. list.actId = 1100
  900. list.fSrcTypeId = 10
  901. this.formfeesList.push(list)
  902. // for (let item in this.formfeesList){
  903. // if (scope.row.fId === this.formfeesList[item].fId) {
  904. // this.$message({
  905. // showClose: true,
  906. // message: '已有相同单据',
  907. // type: 'error'
  908. // });
  909. // return
  910. // }
  911. // }
  912. },
  913. //內容删除
  914. deleteRow(rows,index) {
  915. this.$confirm('是否删除此数据','提示', {
  916. confirmButtonText: "确认",
  917. cancelButtonText: "取消",
  918. type: "warning",
  919. }).then(() => {
  920. if (rows.row.fId){
  921. deleteWarehouse(rows.row.fId).then(res => {
  922. this.formfeesList.splice(index, 1);
  923. })
  924. }else {
  925. this.formfeesList.splice(index, 1);
  926. }
  927. })
  928. },
  929. //修改
  930. submitAllowChanges() {
  931. this.msgSuccess("允许修改");
  932. this.disabledtwo = false
  933. },
  934. // 保存
  935. handleSave() {
  936. let data = {
  937. warehouseId: this.warehouseId,
  938. items: this.formfeesList,
  939. itemDel: [],
  940. fDc: this.fDc,
  941. }
  942. data = Object.assign({}, this.form, data)
  943. saveWarehouseModify(data).then(res => {
  944. this.form = res.data;
  945. this.formfeesList = this.form.items
  946. this.$message.success(res.msg)
  947. })
  948. },
  949. pleaseCheckHandle() {
  950. // this.handleSave()
  951. let data = {
  952. warehouseId: this.warehouseId,
  953. items: this.formfeesList,
  954. itemDel: [],
  955. fDc: this.fDc,
  956. }
  957. data = Object.assign({}, this.form, data)
  958. checkWarehouseModify(data).then(res => {
  959. this.$message.success(res.msg)
  960. this.showDialog = false
  961. })
  962. },
  963. addOrUpdateHandle(status) {
  964. this.veiwVisible = true;
  965. this.$nextTick(() => {
  966. this.$refs.viewApproval.init(this.form.fId, 1000, status);
  967. });
  968. },
  969. addOrUpdateHand(form, status) {
  970. this.addOrUpdateVisib = true;
  971. this.$nextTick(() => {
  972. this.$refs.ApprovalComments.init(form.fId, status, 1000);
  973. });
  974. },
  975. // 查看审批流
  976. getDataList() {
  977. this.veiwVisible = false;
  978. },
  979. returnData() {
  980. this.addOrUpdateVisib = false;
  981. this.addOrUpdateVisible = false;
  982. },
  983. // 撤销审批
  984. cancelRequest() {
  985. let data = {
  986. actId: 1000,
  987. billId: this.form.fId,
  988. id: this.form.fId,
  989. fidStatus: "f_status",
  990. }
  991. cancelRequest(data).then(res => {
  992. this.$message.success('撤销成功')
  993. this.handleClose()
  994. })
  995. },
  996. //列设置全选
  997. allChecked() {
  998. if (this.allCheck == true) {
  999. this.setRowList.map((e) => {
  1000. return (e.checked = 0);
  1001. });
  1002. } else {
  1003. this.setRowList.map((e) => {
  1004. return (e.checked = 1);
  1005. });
  1006. }
  1007. },
  1008. //开始拖拽事件
  1009. onStart() {
  1010. this.drag = true;
  1011. },
  1012. //拖拽结束事件
  1013. onEnd() {
  1014. this.drag = false;
  1015. },
  1016. //重置列表
  1017. delRow() {
  1018. this.data = {
  1019. tableName: "费用变更",
  1020. userId: Cookies.get("userName"),
  1021. };
  1022. resetModule(this.data).then((res) => {
  1023. if (res.code == 200) {
  1024. this.showSetting = false;
  1025. this.setRowList = this.tableDate;
  1026. console.log(this.setRowList)
  1027. this.getRowList = this.tableDate;
  1028. }
  1029. });
  1030. },
  1031. //保存列设置
  1032. save() {
  1033. this.showSetting = false;
  1034. this.data = {
  1035. tableName: "船舶信息",
  1036. userId: Cookies.get("userName"),
  1037. sysTableSetList: this.setRowList,
  1038. };
  1039. addSet(this.data).then((res) => {
  1040. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  1041. });
  1042. },
  1043. total(row) {
  1044. if (row.fQty && row.fUnitprice) {
  1045. this.$set(row, "fAmount", (Number(row.fQty) * Number(row.fUnitprice)).toFixed(2));
  1046. } else {
  1047. this.$set(row, "fAmount", 0);
  1048. }
  1049. },
  1050. },
  1051. }
  1052. </script>
  1053. <style scoped>
  1054. </style>