detailsPage.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="goBack(0)">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <!-- <el-button size="small" style="margin-right: 8px" :disabled="!form.id"
  11. @click="$refs.print.openDialog()">打印账单
  12. </el-button>
  13. <el-button size="small" style="margin-right: 8px" :disabled="!form.id"
  14. @click="$refs.report.openDialog()">报表设计
  15. </el-button> -->
  16. <el-button v-if="!editDisabled" class="el-button--small-yh" type="success" size="small"
  17. :disabled="isSaveBtn || form.firstStatus != '审核通过' || form.orderStatus == '已确认'" @click="setPay">确认付款
  18. </el-button>
  19. <el-button v-if="!editDisabled" class="el-button--small-yh" type="warning" size="small"
  20. :disabled="isSaveBtn || form.firstStatus != '审核通过' || form.orderStatus != '已确认'" @click="revokeFee">撤销付款
  21. </el-button>
  22. <el-button v-if="!editDisabled" class="el-button--small-yh" type="danger" size="small"
  23. :disabled="isSaveBtn || form.firstStatus != '审核通过'" @click="revokeApplication">撤销申请付款
  24. </el-button>
  25. <el-button v-if="!editDisabled" class="el-button--small-yh" type="warning" size="small"
  26. :disabled="isSaveBtn || form.firstStatus == '审核通过'" @click="application">申请付款请核
  27. </el-button>
  28. <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
  29. v-if="editDisabled" @click="inEdit"
  30. :disabled="showLock || !(roleName.indexOf('admin') != -1 || roleName.indexOf('允许修改他人业务') != -1 || saberUserInfo.user_id == form.createUser)">编
  31. </el-button>
  32. <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
  33. @click="submit">保 存
  34. </el-button>
  35. <el-dropdown style="line-height: 0">
  36. <el-button class="el-button--small-yh" style="margin-left: 6px;" type="warning" :disabled="!form.id"
  37. size="small">
  38. 审 批<i class="el-icon-arrow-down el-icon--right"></i>
  39. </el-button>
  40. <el-dropdown-menu slot="dropdown">
  41. <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
  42. </el-dropdown-item>
  43. </el-dropdown-menu>
  44. </el-dropdown>
  45. </div>
  46. </div>
  47. <div style="margin-top: 50px">
  48. <trade-card title="基础信息">
  49. <avue-form :option="optionForm" v-model="form" ref="form">
  50. </avue-form>
  51. </trade-card>
  52. <!-- <trade-card title="货物明细">
  53. <avue-crud :option="option" :data="form.agentItemsList" id="out-table" ref="crud"
  54. @selection-change="selectionChange" @resetColumn="resetColumn('crud', 'option', 'optionBack', 384)"
  55. @saveColumn="saveColumn('crud', 'option', 'optionBack', 384)">
  56. <template slot="menuLeft">
  57. </template>
  58. </avue-crud>
  59. </trade-card> -->
  60. <trade-card title="费用明细">
  61. <fee-infosimple ref="feeInfo" feeType="C" :form="form"
  62. :disabled="editDisabled || form.orderStatus == '已确认'" @getDetails="getDetails"></fee-infosimple>
  63. </trade-card>
  64. <containerTitle title="上传附件"></containerTitle>
  65. <c-upload :data="form.filesCenterList" :enumerationValue="76"
  66. deleteUrl="/api/blade-los/filescenter/remove" display
  67. :disabled="editDisabled || form.orderStatus == '已确认'"></c-upload>
  68. <!--审核弹窗-->
  69. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  70. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  71. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  72. </el-dialog>
  73. </div>
  74. <el-dialog title="确认付费" :visible.sync="dialogVisible" width="400px" :before-close="handleClose"
  75. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag
  76. append-to-body>
  77. <span>
  78. <avue-form v-model="feeForm" :option="feeOption"></avue-form>
  79. </span>
  80. <span slot="footer" class="dialog-footer">
  81. <el-button @click="dialogVisible = false">取 消</el-button>
  82. <el-button type="primary" @click="submitFee">确 定</el-button>
  83. </span>
  84. </el-dialog>
  85. <!-- <business-reports :id="form.id" ref="print" businessValue="MYDL" :type="true"></business-reports>
  86. <reports :id="form.id" :assemblyForm="form" businessValue="MYDL" ref="report"></reports> -->
  87. </div>
  88. </template>
  89. <script>
  90. import { submit, getDetail, checkAgent, revokeCheckAgent, confirmThePayment, confirmReceived, revokeConfirmThePayment } from "@/api/tradeAgency/exchangePurchasing";
  91. import { contrastObj, contrastList } from "@/util/contrastData";
  92. import feeInfosimple from "@/components/tradeAgency/fee-infosimple";
  93. import dicSelect from "@/components/dicSelect/main";
  94. import checkSchedule from "@/components/checkH/checkSchedule.vue";
  95. import businessReports from "@/components/tradeAgency/businessReports.vue";
  96. import reports from "@/components/tradeAgency/reports.vue";
  97. import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
  98. import { dateFormat } from "@/util/date";
  99. import _ from "lodash";
  100. export default {
  101. name: "detailsPage",
  102. data() {
  103. return {
  104. feeForm: {},
  105. dialogVisible: false,
  106. checkId: '', // 审核需要的id
  107. batchNo: '',
  108. checkScheduleDialog: false, // 审核弹窗
  109. editDisabled: false,
  110. form: {},
  111. oldForm: {},
  112. optionForm: {
  113. menuBtn: false,
  114. disabled: true,
  115. span: 8,
  116. column: [
  117. {
  118. label: '客户',
  119. prop: "corpName",
  120. disabled: true,
  121. },
  122. {
  123. label: '业务号',
  124. prop: "businessNo",
  125. disabled: true,
  126. },
  127. {
  128. label: '合同号',
  129. prop: "contractNo",
  130. disabled: true,
  131. },
  132. {
  133. label: '业务日期',
  134. prop: "businessDate",
  135. type: "date",
  136. format: "yyyy-MM-dd",
  137. valueFormat: "yyyy-MM-dd HH:mm:ss",
  138. disabled: false,
  139. rules: [{
  140. required: true,
  141. message: " ",
  142. trigger: "blur"
  143. }]
  144. },
  145. {
  146. label: '金额',
  147. prop: "goodsValue",
  148. disabled: true,
  149. },
  150. {
  151. label: '付汇美元金额',
  152. prop: "paymentInUsd",
  153. disabled: true,
  154. },
  155. {
  156. label: '当天汇率',
  157. prop: "exchangeRate",
  158. disabled: false,
  159. },
  160. {
  161. label: '实付金额',
  162. prop: "actualAmount",
  163. disabled: true,
  164. },
  165. {
  166. label: '邮电费',
  167. prop: "postElectricFee",
  168. disabled: true,
  169. },
  170. {
  171. label: '手续费',
  172. prop: "serviceCharge",
  173. disabled: true,
  174. },
  175. {
  176. label: '申报单号',
  177. prop: "declarationNumber",
  178. disabled: false,
  179. },
  180. {
  181. label: '付费方式',
  182. prop: "advanceRatio",
  183. type: "select",
  184. dicUrl: "/api/blade-system/dict-biz/dictionary?code=advance_ratio",
  185. props: {
  186. label: "dictValue",
  187. value: "dictValue"
  188. },
  189. disabled: false
  190. },
  191. {
  192. label: '国外发货人',
  193. prop: "abroadConsignorCname",
  194. disabled: true,
  195. },
  196. {
  197. label: '银行助记码',
  198. prop: "abroadBankMnemonicCode",
  199. disabled: true,
  200. },
  201. {
  202. label: '银行',
  203. prop: "abroadBank",
  204. disabled: true,
  205. },
  206. {
  207. label: '币别',
  208. prop: "abroadCurrency",
  209. disabled: true,
  210. },
  211. {
  212. label: '利润',
  213. prop: "profit",
  214. disabled: true,
  215. },
  216. {
  217. label: '所属公司',
  218. prop: "affiliatedCompanyName",
  219. disabled: true,
  220. },
  221. {
  222. label: '备注',
  223. prop: "remarks",
  224. type: 'textarea',
  225. span: 12,
  226. disabled: false,
  227. minRows: 2,
  228. }
  229. ]
  230. },
  231. option: {},
  232. optionBack: {
  233. height: 'auto',
  234. calcHeight: 30,
  235. menuWidth: 140,
  236. border: true,
  237. index: true,
  238. addBtn: false,
  239. viewBtn: false,
  240. editBtn: false,
  241. delBtn: false,
  242. menu: false,
  243. refreshBtn: false,
  244. align: 'center',
  245. column: [
  246. {
  247. label: "提单号",
  248. prop: "billNo",
  249. overHidden: true
  250. },
  251. {
  252. label: "箱号",
  253. prop: "boxNo",
  254. overHidden: true
  255. },
  256. {
  257. label: "铅封号",
  258. prop: "leadSealNo",
  259. overHidden: true
  260. },
  261. {
  262. label: "开船日期",
  263. prop: "etd",
  264. overHidden: true
  265. },
  266. {
  267. label: "预计到港",
  268. prop: "estimateReachHarbor",
  269. width: "120",
  270. overHidden: true
  271. },
  272. {
  273. label: "HSCODE",
  274. prop: "hsCode",
  275. overHidden: true
  276. },
  277. {
  278. label: "厂号",
  279. prop: "factoryNumber",
  280. overHidden: true
  281. },
  282. {
  283. label: "标签品名",
  284. prop: "labelProductName",
  285. overHidden: true
  286. },
  287. {
  288. label: "商品类别",
  289. prop: "goodsType",
  290. overHidden: true
  291. },
  292. {
  293. label: "件数",
  294. prop: "quantity",
  295. overHidden: true
  296. },
  297. {
  298. label: "净重(kg)",
  299. prop: "netWeight",
  300. overHidden: true
  301. },
  302. {
  303. label: "单价",
  304. prop: "price",
  305. overHidden: true
  306. },
  307. {
  308. label: "毛重(kg)",
  309. prop: "grossWeight",
  310. overHidden: true
  311. },
  312. {
  313. label: "金额",
  314. prop: "amount",
  315. overHidden: true
  316. },
  317. {
  318. label: "备注",
  319. prop: "remarks",
  320. overHidden: true
  321. }
  322. ]
  323. },
  324. feeOption: {
  325. labelPosition: 'top',
  326. menuBtn: false,
  327. span: 24,
  328. column: [
  329. {
  330. label: '结算汇率',
  331. prop: "exchangeRate",
  332. },
  333. {
  334. label: '优惠汇率',
  335. prop: "discountRate",
  336. },
  337. ]
  338. },
  339. showLock: false,
  340. roleName: [],
  341. saberUserInfo: ''
  342. }
  343. },
  344. components: {
  345. dicSelect,
  346. feeInfosimple,
  347. checkSchedule,
  348. businessReports,
  349. reports
  350. },
  351. props: {
  352. detailData: Object
  353. },
  354. async created() {
  355. this.roleName = localStorage.getItem('roleName').split(',')
  356. this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content
  357. this.option = await this.getColumnData(this.getColumnName(384), this.optionBack);
  358. if (this.detailData.id) {
  359. this.showLock = true
  360. this.editDisabled = true
  361. this.getDetails(this.detailData.id)
  362. }
  363. if (this.$route.query.billNo) {
  364. this.showLock = true
  365. this.editDisabled = true
  366. this.getDetails(this.$route.query.billNo)
  367. }
  368. if (this.$route.query.billId) {
  369. this.showLock = true
  370. this.editDisabled = true
  371. this.getDetails(this.$route.query.billId)
  372. }
  373. if (this.$route.query.params) {
  374. this.showLock = true
  375. this.getDetails(this.$route.query.params)
  376. }
  377. },
  378. methods: {
  379. setPay() {
  380. bcurrencyGetExrate({ date: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'), dc: "D" }).then(res => {
  381. res.data.data.forEach(e => {
  382. if (e.code == 'USD') {
  383. this.feeForm.exchangeRate = e.exrate
  384. this.feeForm.discountRate = e.exrate
  385. }
  386. })
  387. })
  388. this.dialogVisible = true
  389. },
  390. handleClose() {
  391. this.feeForm = {}
  392. this.dialogVisible = false
  393. },
  394. inLock() {
  395. const data = {
  396. moduleName: "MYDL-C",
  397. tableName: "MYDL-C_Detail",
  398. billId: this.form.id,
  399. no: localStorage.getItem("browserID"),
  400. billNo: this.form.contractNo
  401. };
  402. this.inDetailsKey(this.$route.name, {
  403. moduleName: "MYDL-C",
  404. tableName: "MYDL-C_Detail",
  405. billId: this.form.id,
  406. billNo: this.form.contractNo
  407. });
  408. this.checkLock(data).then(res => {
  409. if (res.data.code == 200) {
  410. this.onLock(data).then(res => {
  411. if (res.data.code == 200) {
  412. this.showLock = false
  413. }
  414. });
  415. }
  416. });
  417. },
  418. getDetails(id) {
  419. const loading = this.$loading({
  420. lock: true,
  421. text: '加载中',
  422. spinner: 'el-icon-loading',
  423. background: 'rgba(255,255,255,0.7)'
  424. });
  425. getDetail({ id: id }).then(res => {
  426. if (res.data.data.firstStatus == '审核通过') this.optionForm.disabled = true
  427. this.form = res.data.data
  428. this.oldForm = this.deepClone(res.data.data)
  429. this.inLock()
  430. }).finally(() => {
  431. loading.close()
  432. })
  433. },
  434. inEdit() {
  435. this.editDisabled = false
  436. if (this.form.firstStatus != '审核通过') {
  437. this.optionForm.disabled = false
  438. }
  439. },
  440. submit(type) {
  441. this.$refs["form"].validate((valid, done) => {
  442. done();
  443. if (valid) {
  444. if (this.$refs.feeInfo.submitValidate()) {
  445. const loading = this.$loading({
  446. lock: true,
  447. text: '加载中',
  448. spinner: 'el-icon-loading',
  449. background: 'rgba(255,255,255,0.7)'
  450. });
  451. submit(this.form).then(res => {
  452. this.$message.success("保存成功");
  453. if (type == 'goBack') {
  454. if (this.form.id) {
  455. this.unLock({
  456. moduleName: "MYDL-C",
  457. tableName: "MYDL-C_Detail",
  458. billId: this.form.id,
  459. billNo: this.form.contractNo
  460. });
  461. }
  462. this.$emit("goBack", type);
  463. this.$emit('updateKey')
  464. }
  465. this.getDetails(res.data.data.id)
  466. }).finally(() => {
  467. loading.close();
  468. })
  469. }
  470. } else {
  471. return false;
  472. }
  473. });
  474. },
  475. submitFee() {
  476. this.dialogVisible = false
  477. let obj = {
  478. ...this.form,
  479. ...this.feeForm
  480. }
  481. confirmReceived(obj).then(res => {
  482. this.$confirm(res.data.data + '?', '提示', {
  483. confirmButtonText: '确定',
  484. cancelButtonText: '取消',
  485. type: 'warning'
  486. }).then(() => {
  487. const loading = this.$loading({
  488. lock: true,
  489. text: '加载中',
  490. spinner: 'el-icon-loading',
  491. background: 'rgba(255,255,255,0.7)'
  492. });
  493. confirmThePayment(obj).then(res => {
  494. this.getDetails(res.data.data.id)
  495. this.$message.success("确认成功");
  496. }).finally(() => {
  497. loading.close();
  498. })
  499. })
  500. })
  501. },
  502. revokeFee() {
  503. this.$confirm('撤销付款?', '提示', {
  504. confirmButtonText: '确定',
  505. cancelButtonText: '取消',
  506. type: 'warning'
  507. }).then(() => {
  508. const loading = this.$loading({
  509. lock: true,
  510. text: '加载中',
  511. spinner: 'el-icon-loading',
  512. background: 'rgba(255,255,255,0.7)'
  513. });
  514. revokeConfirmThePayment(this.form).then(res => {
  515. this.getDetails(res.data.data.id)
  516. this.$message.success("撤销成功");
  517. }).finally(() => {
  518. loading.close();
  519. })
  520. })
  521. },
  522. application() {
  523. this.$confirm("确定请核数据?", {
  524. confirmButtonText: "确定",
  525. cancelButtonText: "取消",
  526. type: "warning"
  527. }).then(() => {
  528. let obj = {}
  529. obj = {
  530. id: this.form.id,
  531. url: '/tradeAgency/exchangePurchasing/index',
  532. pageStatus: 'this.$store.getters.exchangePurStatus',
  533. pageLabel: '付费申请(T)',
  534. }
  535. const loading = this.$loading({
  536. lock: true,
  537. text: '加载中',
  538. spinner: 'el-icon-loading',
  539. background: 'rgba(255,255,255,0.7)'
  540. });
  541. checkAgent(obj).then(res => {
  542. this.$message.success("请核成功");
  543. this.getDetails(res.data.data.id)
  544. }).finally(() => {
  545. loading.close();
  546. })
  547. });
  548. },
  549. revokeApplication() {
  550. this.$confirm("确定撤销请核?", {
  551. confirmButtonText: "确定",
  552. cancelButtonText: "取消",
  553. type: "warning"
  554. }).then(() => {
  555. let obj = {}
  556. obj = {
  557. id: this.form.id,
  558. }
  559. const loading = this.$loading({
  560. lock: true,
  561. text: '加载中',
  562. spinner: 'el-icon-loading',
  563. background: 'rgba(255,255,255,0.7)'
  564. });
  565. revokeCheckAgent(obj).then(res => {
  566. this.$message.success("撤销请核成功");
  567. this.getDetails(res.data.data.id)
  568. this.editDisabled = false
  569. this.optionForm.disabled = false
  570. }).finally(() => {
  571. loading.close();
  572. })
  573. });
  574. },
  575. //请核关闭
  576. choceScheduleFun() {
  577. this.checkScheduleDialog = false
  578. },
  579. //自定义列保存
  580. async saveColumn(ref, option, optionBack, code) {
  581. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  582. if (inSave) {
  583. this.$message.success("保存成功");
  584. //关闭窗口
  585. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  586. }
  587. },
  588. //自定义列重置
  589. async resetColumn(ref, option, optionBack, code) {
  590. this[option] = this[optionBack];
  591. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  592. if (inSave) {
  593. this.$message.success("重置成功");
  594. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  595. }
  596. },
  597. goBack(type) {
  598. if (contrastObj(this.form, this.oldForm) || contrastList(this.form.feeCenterListC, this.oldForm.feeCenterListC) || contrastList(this.form.filesCenterList, this.oldForm.filesCenterList)) {
  599. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  600. confirmButtonText: "确定",
  601. cancelButtonText: "取消",
  602. type: "warning"
  603. })
  604. .then(() => {
  605. this.submit('goBack')
  606. })
  607. .catch(() => {
  608. if (this.form.id) {
  609. this.unLock({
  610. moduleName: "MYDL-C",
  611. tableName: "MYDL-C_Detail",
  612. billId: this.form.id,
  613. billNo: this.form.contractNo
  614. });
  615. }
  616. this.$emit("goBack", type);
  617. this.$emit('updateKey')
  618. });
  619. } else {
  620. if (this.form.id) {
  621. this.unLock({
  622. moduleName: "MYDL-C",
  623. tableName: "MYDL-C_Detail",
  624. billId: this.form.id,
  625. billNo: this.form.contractNo
  626. });
  627. }
  628. this.$emit("goBack", type);
  629. this.$emit('updateKey')
  630. }
  631. },
  632. }
  633. }
  634. </script>
  635. <style lang="scss" scoped>
  636. ::v-deep .el-form-item {
  637. margin-bottom: 8px !important;
  638. }
  639. ::v-deep .el-table .cell {
  640. padding: 0 2px !important;
  641. .el-form-item {
  642. margin-bottom: 0px !important;
  643. }
  644. }
  645. ::v-deep .avue-crud .el-table .el-form-item__label {
  646. left: -1px;
  647. }
  648. ::v-deep#out-table .back-one {
  649. background: #ecf5ff !important;
  650. }
  651. ::v-deep#out-table .back-two {
  652. background: #ecf5ff !important;
  653. }
  654. ::v-deep .el-table--small td,
  655. .el-table--small th {
  656. padding: 2px !important;
  657. }
  658. </style>