123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673 |
- <template>
- <div>
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="goBack(0)">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <!-- <el-button size="small" style="margin-right: 8px" :disabled="!form.id"
- @click="$refs.print.openDialog()">打印账单
- </el-button>
- <el-button size="small" style="margin-right: 8px" :disabled="!form.id"
- @click="$refs.report.openDialog()">报表设计
- </el-button> -->
- <el-button v-if="!editDisabled" class="el-button--small-yh" type="success" size="small"
- :disabled="isSaveBtn || form.firstStatus != '审核通过' || form.orderStatus == '已确认'" @click="setPay">确认付款
- </el-button>
- <el-button v-if="!editDisabled" class="el-button--small-yh" type="warning" size="small"
- :disabled="isSaveBtn || form.firstStatus != '审核通过' || form.orderStatus != '已确认'" @click="revokeFee">撤销付款
- </el-button>
- <el-button v-if="!editDisabled" class="el-button--small-yh" type="danger" size="small"
- :disabled="isSaveBtn || form.firstStatus != '审核通过'" @click="revokeApplication">撤销申请付款
- </el-button>
- <el-button v-if="!editDisabled" class="el-button--small-yh" type="warning" size="small"
- :disabled="isSaveBtn || form.firstStatus == '审核通过'" @click="application">申请付款请核
- </el-button>
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
- v-if="editDisabled" @click="inEdit"
- :disabled="showLock || !(roleName.indexOf('admin') != -1 || roleName.indexOf('允许修改他人业务') != -1 || saberUserInfo.user_id == form.createUser)">编
- 辑
- </el-button>
- <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
- @click="submit">保 存
- </el-button>
- <el-dropdown style="line-height: 0">
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="warning" :disabled="!form.id"
- size="small">
- 审 批<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </div>
- <div style="margin-top: 50px">
- <trade-card title="基础信息">
- <avue-form :option="optionForm" v-model="form" ref="form">
- </avue-form>
- </trade-card>
- <!-- <trade-card title="货物明细">
- <avue-crud :option="option" :data="form.agentItemsList" id="out-table" ref="crud"
- @selection-change="selectionChange" @resetColumn="resetColumn('crud', 'option', 'optionBack', 384)"
- @saveColumn="saveColumn('crud', 'option', 'optionBack', 384)">
- <template slot="menuLeft">
- </template>
- </avue-crud>
- </trade-card> -->
- <trade-card title="费用明细">
- <fee-infosimple ref="feeInfo" feeType="C" :form="form"
- :disabled="editDisabled || form.orderStatus == '已确认'" @getDetails="getDetails"></fee-infosimple>
- </trade-card>
- <containerTitle title="上传附件"></containerTitle>
- <c-upload :data="form.filesCenterList" :enumerationValue="76"
- deleteUrl="/api/blade-los/filescenter/remove" display
- :disabled="editDisabled || form.orderStatus == '已确认'"></c-upload>
- <!--审核弹窗-->
- <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
- <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
- </el-dialog>
- </div>
- <el-dialog title="确认付费" :visible.sync="dialogVisible" width="400px" :before-close="handleClose"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag
- append-to-body>
- <span>
- <avue-form v-model="feeForm" :option="feeOption"></avue-form>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="submitFee">确 定</el-button>
- </span>
- </el-dialog>
- <!-- <business-reports :id="form.id" ref="print" businessValue="MYDL" :type="true"></business-reports>
- <reports :id="form.id" :assemblyForm="form" businessValue="MYDL" ref="report"></reports> -->
- </div>
- </template>
- <script>
- import { submit, getDetail, checkAgent, revokeCheckAgent, confirmThePayment, confirmReceived, revokeConfirmThePayment } from "@/api/tradeAgency/exchangePurchasing";
- import { contrastObj, contrastList } from "@/util/contrastData";
- import feeInfosimple from "@/components/tradeAgency/fee-infosimple";
- import dicSelect from "@/components/dicSelect/main";
- import checkSchedule from "@/components/checkH/checkSchedule.vue";
- import businessReports from "@/components/tradeAgency/businessReports.vue";
- import reports from "@/components/tradeAgency/reports.vue";
- import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
- import { dateFormat } from "@/util/date";
- import _ from "lodash";
- export default {
- name: "detailsPage",
- data() {
- return {
- feeForm: {},
- dialogVisible: false,
- checkId: '', // 审核需要的id
- batchNo: '',
- checkScheduleDialog: false, // 审核弹窗
- editDisabled: false,
- form: {},
- oldForm: {},
- optionForm: {
- menuBtn: false,
- disabled: true,
- span: 8,
- column: [
- {
- label: '客户',
- prop: "corpName",
- disabled: true,
- },
- {
- label: '业务号',
- prop: "businessNo",
- disabled: true,
- },
- {
- label: '合同号',
- prop: "contractNo",
- disabled: true,
- },
- {
- label: '业务日期',
- prop: "businessDate",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- disabled: false,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- {
- label: '金额',
- prop: "goodsValue",
- disabled: true,
- },
- {
- label: '付汇美元金额',
- prop: "paymentInUsd",
- disabled: true,
- },
- {
- label: '当天汇率',
- prop: "exchangeRate",
- disabled: false,
- },
- {
- label: '实付金额',
- prop: "actualAmount",
- disabled: true,
- },
- {
- label: '邮电费',
- prop: "postElectricFee",
- disabled: true,
- },
- {
- label: '手续费',
- prop: "serviceCharge",
- disabled: true,
- },
- {
- label: '申报单号',
- prop: "declarationNumber",
- disabled: false,
- },
- {
- label: '付费方式',
- prop: "advanceRatio",
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=advance_ratio",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- disabled: false
- },
- {
- label: '国外发货人',
- prop: "abroadConsignorCname",
- disabled: true,
- },
- {
- label: '银行助记码',
- prop: "abroadBankMnemonicCode",
- disabled: true,
- },
- {
- label: '银行',
- prop: "abroadBank",
- disabled: true,
- },
- {
- label: '币别',
- prop: "abroadCurrency",
- disabled: true,
- },
- {
- label: '利润',
- prop: "profit",
- disabled: true,
- },
- {
- label: '所属公司',
- prop: "affiliatedCompanyName",
- disabled: true,
- },
- {
- label: '备注',
- prop: "remarks",
- type: 'textarea',
- span: 12,
- disabled: false,
- minRows: 2,
- }
- ]
- },
- option: {},
- optionBack: {
- height: 'auto',
- calcHeight: 30,
- menuWidth: 140,
- border: true,
- index: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- menu: false,
- refreshBtn: false,
- align: 'center',
- column: [
- {
- label: "提单号",
- prop: "billNo",
- overHidden: true
- },
- {
- label: "箱号",
- prop: "boxNo",
- overHidden: true
- },
- {
- label: "铅封号",
- prop: "leadSealNo",
- overHidden: true
- },
- {
- label: "开船日期",
- prop: "etd",
- overHidden: true
- },
- {
- label: "预计到港",
- prop: "estimateReachHarbor",
- width: "120",
- overHidden: true
- },
- {
- label: "HSCODE",
- prop: "hsCode",
- overHidden: true
- },
- {
- label: "厂号",
- prop: "factoryNumber",
- overHidden: true
- },
- {
- label: "标签品名",
- prop: "labelProductName",
- overHidden: true
- },
- {
- label: "商品类别",
- prop: "goodsType",
- overHidden: true
- },
- {
- label: "件数",
- prop: "quantity",
- overHidden: true
- },
- {
- label: "净重(kg)",
- prop: "netWeight",
- overHidden: true
- },
- {
- label: "单价",
- prop: "price",
- overHidden: true
- },
- {
- label: "毛重(kg)",
- prop: "grossWeight",
- overHidden: true
- },
- {
- label: "金额",
- prop: "amount",
- overHidden: true
- },
- {
- label: "备注",
- prop: "remarks",
- overHidden: true
- }
- ]
- },
- feeOption: {
- labelPosition: 'top',
- menuBtn: false,
- span: 24,
- column: [
- {
- label: '结算汇率',
- prop: "exchangeRate",
- },
- {
- label: '优惠汇率',
- prop: "discountRate",
- },
- ]
- },
- showLock: false,
- roleName: [],
- saberUserInfo: ''
- }
- },
- components: {
- dicSelect,
- feeInfosimple,
- checkSchedule,
- businessReports,
- reports
- },
- props: {
- detailData: Object
- },
- async created() {
- this.roleName = localStorage.getItem('roleName').split(',')
- this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content
- this.option = await this.getColumnData(this.getColumnName(384), this.optionBack);
- if (this.detailData.id) {
- this.showLock = true
- this.editDisabled = true
- this.getDetails(this.detailData.id)
- }
- if (this.$route.query.billNo) {
- this.showLock = true
- this.editDisabled = true
- this.getDetails(this.$route.query.billNo)
- }
- if (this.$route.query.billId) {
- this.showLock = true
- this.editDisabled = true
- this.getDetails(this.$route.query.billId)
- }
- if (this.$route.query.params) {
- this.showLock = true
- this.getDetails(this.$route.query.params)
- }
- },
- methods: {
- setPay() {
- bcurrencyGetExrate({ date: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'), dc: "D" }).then(res => {
- res.data.data.forEach(e => {
- if (e.code == 'USD') {
- this.feeForm.exchangeRate = e.exrate
- this.feeForm.discountRate = e.exrate
- }
- })
- })
- this.dialogVisible = true
- },
- handleClose() {
- this.feeForm = {}
- this.dialogVisible = false
- },
- inLock() {
- const data = {
- moduleName: "MYDL-C",
- tableName: "MYDL-C_Detail",
- billId: this.form.id,
- no: localStorage.getItem("browserID"),
- billNo: this.form.contractNo
- };
- this.inDetailsKey(this.$route.name, {
- moduleName: "MYDL-C",
- tableName: "MYDL-C_Detail",
- billId: this.form.id,
- billNo: this.form.contractNo
- });
- this.checkLock(data).then(res => {
- if (res.data.code == 200) {
- this.onLock(data).then(res => {
- if (res.data.code == 200) {
- this.showLock = false
- }
- });
- }
- });
- },
- getDetails(id) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- getDetail({ id: id }).then(res => {
- if (res.data.data.firstStatus == '审核通过') this.optionForm.disabled = true
- this.form = res.data.data
- this.oldForm = this.deepClone(res.data.data)
- this.inLock()
- }).finally(() => {
- loading.close()
- })
- },
- inEdit() {
- this.editDisabled = false
- if (this.form.firstStatus != '审核通过') {
- this.optionForm.disabled = false
- }
- },
- submit(type) {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- if (this.$refs.feeInfo.submitValidate()) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submit(this.form).then(res => {
- this.$message.success("保存成功");
- if (type == 'goBack') {
- if (this.form.id) {
- this.unLock({
- moduleName: "MYDL-C",
- tableName: "MYDL-C_Detail",
- billId: this.form.id,
- billNo: this.form.contractNo
- });
- }
- this.$emit("goBack", type);
- this.$emit('updateKey')
- }
- this.getDetails(res.data.data.id)
- }).finally(() => {
- loading.close();
- })
- }
- } else {
- return false;
- }
- });
- },
- submitFee() {
- this.dialogVisible = false
- let obj = {
- ...this.form,
- ...this.feeForm
- }
- confirmReceived(obj).then(res => {
- this.$confirm(res.data.data + '?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- confirmThePayment(obj).then(res => {
- this.getDetails(res.data.data.id)
- this.$message.success("确认成功");
- }).finally(() => {
- loading.close();
- })
- })
- })
- },
- revokeFee() {
- this.$confirm('撤销付款?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- revokeConfirmThePayment(this.form).then(res => {
- this.getDetails(res.data.data.id)
- this.$message.success("撤销成功");
- }).finally(() => {
- loading.close();
- })
- })
- },
- application() {
- this.$confirm("确定请核数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let obj = {}
- obj = {
- id: this.form.id,
- url: '/tradeAgency/exchangePurchasing/index',
- pageStatus: 'this.$store.getters.exchangePurStatus',
- pageLabel: '付费申请(T)',
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- checkAgent(obj).then(res => {
- this.$message.success("请核成功");
- this.getDetails(res.data.data.id)
- }).finally(() => {
- loading.close();
- })
- });
- },
- revokeApplication() {
- this.$confirm("确定撤销请核?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let obj = {}
- obj = {
- id: this.form.id,
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- revokeCheckAgent(obj).then(res => {
- this.$message.success("撤销请核成功");
- this.getDetails(res.data.data.id)
- this.editDisabled = false
- this.optionForm.disabled = false
- }).finally(() => {
- loading.close();
- })
- });
- },
- //请核关闭
- choceScheduleFun() {
- this.checkScheduleDialog = false
- },
- //自定义列保存
- async saveColumn(ref, option, optionBack, code) {
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumn(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- goBack(type) {
- if (contrastObj(this.form, this.oldForm) || contrastList(this.form.feeCenterListC, this.oldForm.feeCenterListC) || contrastList(this.form.filesCenterList, this.oldForm.filesCenterList)) {
- this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.submit('goBack')
- })
- .catch(() => {
- if (this.form.id) {
- this.unLock({
- moduleName: "MYDL-C",
- tableName: "MYDL-C_Detail",
- billId: this.form.id,
- billNo: this.form.contractNo
- });
- }
- this.$emit("goBack", type);
- this.$emit('updateKey')
- });
- } else {
- if (this.form.id) {
- this.unLock({
- moduleName: "MYDL-C",
- tableName: "MYDL-C_Detail",
- billId: this.form.id,
- billNo: this.form.contractNo
- });
- }
- this.$emit("goBack", type);
- this.$emit('updateKey')
- }
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- ::v-deep .el-table .cell {
- padding: 0 2px !important;
- .el-form-item {
- margin-bottom: 0px !important;
- }
- }
- ::v-deep .avue-crud .el-table .el-form-item__label {
- left: -1px;
- }
- ::v-deep#out-table .back-one {
- background: #ecf5ff !important;
- }
- ::v-deep#out-table .back-two {
- background: #ecf5ff !important;
- }
- ::v-deep .el-table--small td,
- .el-table--small th {
- padding: 2px !important;
- }
- </style>
|