AddOrUpdate.vue 33 KB

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