AddOrUpdate.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  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. }
  889. console.log(list)
  890. this.formfeesList.push(list)
  891. },
  892. //变更按钮
  893. change(row){
  894. console.log(row)
  895. let list = JSON.parse(JSON.stringify(row))
  896. list.fId = ''
  897. list.fBillstatus = ''
  898. list.actId = 1100
  899. list.fSrcTypeId = 10
  900. this.formfeesList.push(list)
  901. // for (let item in this.formfeesList){
  902. // if (scope.row.fId === this.formfeesList[item].fId) {
  903. // this.$message({
  904. // showClose: true,
  905. // message: '已有相同单据',
  906. // type: 'error'
  907. // });
  908. // return
  909. // }
  910. // }
  911. },
  912. //內容删除
  913. deleteRow(rows,index) {
  914. this.$confirm('是否删除此数据','提示', {
  915. confirmButtonText: "确认",
  916. cancelButtonText: "取消",
  917. type: "warning",
  918. }).then(() => {
  919. if (rows.row.fId){
  920. deleteWarehouse(rows.row.fId).then(res => {
  921. this.formfeesList.splice(index, 1);
  922. })
  923. }else {
  924. this.formfeesList.splice(index, 1);
  925. }
  926. })
  927. },
  928. //修改
  929. submitAllowChanges() {
  930. this.msgSuccess("允许修改");
  931. this.disabledtwo = false
  932. },
  933. // 保存
  934. handleSave() {
  935. let data = {
  936. warehouseId: this.warehouseId,
  937. items: this.formfeesList,
  938. itemDel: [],
  939. fDc: this.fDc,
  940. }
  941. data = Object.assign({}, this.form, data)
  942. saveWarehouseModify(data).then(res => {
  943. this.form = res.data;
  944. this.formfeesList = this.form.items
  945. this.$message.success(res.msg)
  946. })
  947. },
  948. pleaseCheckHandle() {
  949. // this.handleSave()
  950. let data = {
  951. warehouseId: this.warehouseId,
  952. items: this.formfeesList,
  953. itemDel: [],
  954. fDc: this.fDc,
  955. }
  956. data = Object.assign({}, this.form, data)
  957. checkWarehouseModify(data).then(res => {
  958. this.$message.success(res.msg)
  959. this.showDialog = false
  960. })
  961. },
  962. addOrUpdateHandle(status) {
  963. this.veiwVisible = true;
  964. this.$nextTick(() => {
  965. this.$refs.viewApproval.init(this.form.fId, 1000, status);
  966. });
  967. },
  968. addOrUpdateHand(form, status) {
  969. this.addOrUpdateVisib = true;
  970. this.$nextTick(() => {
  971. this.$refs.ApprovalComments.init(form.fId, status, 1000);
  972. });
  973. },
  974. // 查看审批流
  975. getDataList() {
  976. this.veiwVisible = false;
  977. },
  978. returnData() {
  979. this.addOrUpdateVisib = false;
  980. this.addOrUpdateVisible = false;
  981. },
  982. // 撤销审批
  983. cancelRequest() {
  984. let data = {
  985. actId: 1000,
  986. billId: this.form.fId,
  987. id: this.form.fId,
  988. fidStatus: "f_status",
  989. }
  990. cancelRequest(data).then(res => {
  991. this.$message.success('撤销成功')
  992. this.handleClose()
  993. })
  994. },
  995. //列设置全选
  996. allChecked() {
  997. if (this.allCheck == true) {
  998. this.setRowList.map((e) => {
  999. return (e.checked = 0);
  1000. });
  1001. } else {
  1002. this.setRowList.map((e) => {
  1003. return (e.checked = 1);
  1004. });
  1005. }
  1006. },
  1007. //开始拖拽事件
  1008. onStart() {
  1009. this.drag = true;
  1010. },
  1011. //拖拽结束事件
  1012. onEnd() {
  1013. this.drag = false;
  1014. },
  1015. //重置列表
  1016. delRow() {
  1017. this.data = {
  1018. tableName: "费用变更",
  1019. userId: Cookies.get("userName"),
  1020. };
  1021. resetModule(this.data).then((res) => {
  1022. if (res.code == 200) {
  1023. this.showSetting = false;
  1024. this.setRowList = this.tableDate;
  1025. console.log(this.setRowList)
  1026. this.getRowList = this.tableDate;
  1027. }
  1028. });
  1029. },
  1030. //保存列设置
  1031. save() {
  1032. this.showSetting = false;
  1033. this.data = {
  1034. tableName: "船舶信息",
  1035. userId: Cookies.get("userName"),
  1036. sysTableSetList: this.setRowList,
  1037. };
  1038. addSet(this.data).then((res) => {
  1039. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  1040. });
  1041. },
  1042. total(row) {
  1043. if (row.fQty && row.fUnitprice) {
  1044. this.$set(row, "fAmount", (Number(row.fQty) * Number(row.fUnitprice)).toFixed(2));
  1045. } else {
  1046. this.$set(row, "fAmount", 0);
  1047. }
  1048. },
  1049. },
  1050. }
  1051. </script>
  1052. <style scoped>
  1053. </style>