|
|
@@ -0,0 +1,364 @@
|
|
|
+<!-- eslint-disable vue/require-valid-default-prop -->
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-dialog :title="title" :visible.sync="dialogVisible" append-to-body width="80%" :before-close="handleClose"
|
|
|
+ :close-on-click-modal="false">
|
|
|
+ <div v-if="dialogVisible">
|
|
|
+ <el-divider>费用原来信息</el-divider>
|
|
|
+ <avue-form :option="oldOption" v-model="oldForm" ref="form"></avue-form>
|
|
|
+ <el-divider>费用修改信息</el-divider>
|
|
|
+ <avue-form :option="newOption" v-model="newForm" ref="form">
|
|
|
+ <template slot="corpTypeUpdate">
|
|
|
+ <dic-select v-model="newForm.corpTypeUpdate" key="id" label="cnName" res="records"
|
|
|
+ url="/blade-los/bcorpstypedefine/list?status=0¤t=1&size=20" :filterable="true" :remote="true"
|
|
|
+ dataName="cnName" @selectChange="dicChange('corpTypeUpdate', $event)"></dic-select>
|
|
|
+ </template>
|
|
|
+ <template slot="shortNameUpdate">
|
|
|
+ <dic-select v-model="newForm.shortNameUpdate" placeholder="结算单位" :key="newForm.corpTypeUpdate"
|
|
|
+ label="shortName" res="records"
|
|
|
+ :url="'/blade-los/bcorps/selectList?status=0¤t=1&size=5&corpTypeName=' + newForm.corpTypeUpdate"
|
|
|
+ :filterable="true" :remote="true" dataName="shortName"
|
|
|
+ @selectChange="dicChange('shortNameUpdate', $event)" :slotRight="true" rightLabel="code"
|
|
|
+ :disabled="newOption.disabled"></dic-select>
|
|
|
+ </template>
|
|
|
+ <!-- <template slot="billShortNameUpdate">
|
|
|
+ <dic-select v-model="newForm.billShortNameUpdate" placeholder="客户名称" label="shortName" res="records"
|
|
|
+ url="/blade-los/bcorps/selectList?status=0¤t=1&size=5" :filterable="true" :remote="true"
|
|
|
+ dataName="shortName" @selectChange="dicChange('billShortNameUpdate', $event)" :slotRight="true"
|
|
|
+ rightLabel="code" :disabled="newOption.disabled"></dic-select>
|
|
|
+ </template> -->
|
|
|
+ <template slot="feeCnNameUpdate">
|
|
|
+ <dic-select v-model="newForm.feeCnNameUpdate" placeholder="费用名称" label="cnName" res="records"
|
|
|
+ url="/blade-los/bfees/list?status=0¤t=1&size=20" :filterable="true" :remote="true" dataName="cnName"
|
|
|
+ @selectChange="dicChange('feeCnNameUpdate', $event)" :slotRight="true" rightLabel="code"
|
|
|
+ :disabled="newOption.disabled"></dic-select>
|
|
|
+ </template>
|
|
|
+ <template slot="unitNoUpdate">
|
|
|
+ <dic-select v-model="newForm.unitNoUpdate" placeholder="费用名称" label="cnName"
|
|
|
+ url="/blade-los/bunits/listAll?status=0" :filterable="true" :slotRight="true" rightLabel="code"
|
|
|
+ :disabled="newOption.disabled"></dic-select>
|
|
|
+ </template>
|
|
|
+ <template slot="curCodeUpdate">
|
|
|
+ <dic-select v-model="newForm.curCodeUpdate" placeholder="币别" label="code"
|
|
|
+ :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.etd + ' 00:00:00' + '&type=1'"
|
|
|
+ :filterable="true" @selectChange="dicChange('curCodeUpdate', $event, row)"
|
|
|
+ :disabled="newOption.disabled"></dic-select>
|
|
|
+ </template>
|
|
|
+ <template slot="priceUpdate">
|
|
|
+ <el-input-number v-model="newForm.priceUpdate" :controls="false" placeholder="请输入 单价" size="small"
|
|
|
+ style="width: 100%;" :precision="0" @change="countChange()"
|
|
|
+ :disabled="newOption.disabled"></el-input-number>
|
|
|
+ </template>
|
|
|
+ <template slot="quantityUpdate">
|
|
|
+ <el-input-number v-model="newForm.quantityUpdate" :controls="false" placeholder="请输入 数量" size="small"
|
|
|
+ style="width: 100%;" :precision="0" @change="countChange()"
|
|
|
+ :disabled="newOption.disabled"></el-input-number>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false" size="mini">关 闭</el-button>
|
|
|
+ <el-button v-if="type" type="primary" @click="submit" size="mini">确定修改</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { applyUpdate, revokeapplyUpdate, getDetail } from '@/api/iosBasicData/feeModify.js'
|
|
|
+import dicSelect from "@/components/dicSelect/main";
|
|
|
+import _ from "lodash";
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ dicSelect
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ form: {
|
|
|
+ type: Object,
|
|
|
+ default: () => { },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ deptId: JSON.parse(localStorage.getItem('sysitemData')).deptId,
|
|
|
+ oldForm: {},
|
|
|
+ newForm: {},
|
|
|
+ dialogVisible: false,
|
|
|
+ oldOption: {
|
|
|
+ menuBtn: false,
|
|
|
+ span: 12,
|
|
|
+ disabled: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "类别",
|
|
|
+ prop: "corpType",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "结算单位",
|
|
|
+ prop: "shortName",
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // label: "客户名称",
|
|
|
+ // prop: "billShortName",
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ label: "费用名称",
|
|
|
+ prop: "feeCnName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "计量单位",
|
|
|
+ prop: "unitNo",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "币别",
|
|
|
+ prop: "curCode",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "汇率",
|
|
|
+ prop: "exrate",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "数量",
|
|
|
+ prop: "quantity",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "单价",
|
|
|
+ prop: "price",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "金额",
|
|
|
+ prop: "amount",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "备注",
|
|
|
+ prop: "remarks",
|
|
|
+ minRows: 2,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ newOption: {
|
|
|
+ menuBtn: false,
|
|
|
+ span: 12,
|
|
|
+ disabled: false,
|
|
|
+ labelWidth: 100,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "类别",
|
|
|
+ prop: "corpTypeUpdate",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "结算单位",
|
|
|
+ prop: "shortNameUpdate",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "费用名称",
|
|
|
+ prop: "feeCnNameUpdate",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "计量单位",
|
|
|
+ prop: "unitNoUpdate",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "币别",
|
|
|
+ prop: "curCodeUpdate",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "汇率",
|
|
|
+ prop: "exrateUpdate",
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "数量",
|
|
|
+ prop: "quantityUpdate",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "单价",
|
|
|
+ prop: "priceUpdate",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "金额",
|
|
|
+ prop: "amountUpdate",
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "备注",
|
|
|
+ prop: "remarksUpdate",
|
|
|
+ minRows: 2,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ type: null,
|
|
|
+ title: null,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // this.option = await this.getColumnData(this.getColumnName(309.6), this.optionBack);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ openDialog(row, type) {
|
|
|
+ if (type == 'fix') {
|
|
|
+ this.oldForm = row
|
|
|
+ this.newForm = {
|
|
|
+ corpIdUpdate: row.corpId,
|
|
|
+ corpCnNameUpdate: row.corpCnName,
|
|
|
+ corpEnNameUpdate: row.corpEnName,
|
|
|
+ shortNameUpdate: row.shortName,
|
|
|
+ // billCorpIdUpdate: row.billCorpId,
|
|
|
+ // billCorpCnNameUpdate: row.billCorpCnName,
|
|
|
+ // billCorpEnNameUpdate: row.billCorpEnName,
|
|
|
+ // billShortNameUpdate: row.billShortName,
|
|
|
+ corpTypeUpdate: row.corpType,
|
|
|
+ feeIdUpdate: row.feeId,
|
|
|
+ feeCodeUpdate: row.feeCode,
|
|
|
+ feeEnNameUpdate: row.feeEnName,
|
|
|
+ feeCnNameUpdate: row.feeCnName,
|
|
|
+ unitNoUpdate: row.unitNo,
|
|
|
+ curCodeUpdate: row.curCode,
|
|
|
+ exrateUpdate: row.exrate,
|
|
|
+ quantityUpdate: row.quantity,
|
|
|
+ priceUpdate: row.price,
|
|
|
+ amountUpdate: row.amount,
|
|
|
+ }
|
|
|
+ this.type = type
|
|
|
+ this.title = '费用申请修改'
|
|
|
+ this.dialogVisible = true
|
|
|
+ }
|
|
|
+ if (type == 'del') {
|
|
|
+ this.$confirm('是否申请费用删除?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.oldForm = row
|
|
|
+ let obj = {
|
|
|
+ ...this.oldForm,
|
|
|
+ ...this.newForm,
|
|
|
+ billDate: this.oldForm.billDate + ' 00:00:00',
|
|
|
+ etd: this.oldForm.etd + ' 00:00:00',
|
|
|
+ type: 1,
|
|
|
+ id: null,
|
|
|
+ pid: this.form.id,
|
|
|
+ itemId: this.oldForm.id,
|
|
|
+ branchId: this.form.branchId,
|
|
|
+ branchName: this.form.branchName,
|
|
|
+ url: '/iosBasicData/SeafreightExportF/bills/index',
|
|
|
+ pageStatus: "this.$store.getters.approvalDetails",
|
|
|
+ pageLabel: "海运出口(F)",
|
|
|
+ }
|
|
|
+ applyUpdate(obj).then(res => {
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.$emit('updateDetail')
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (type == 'view') {
|
|
|
+ const obj = {
|
|
|
+ id: row.id,
|
|
|
+ }
|
|
|
+ getDetail(obj).then(res => {
|
|
|
+ this.oldForm = res.data.data
|
|
|
+ this.newForm = res.data.data
|
|
|
+ this.newOption.disabled = true
|
|
|
+ this.title = '查看费用'
|
|
|
+ this.dialogVisible = true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (type == 'revoke') {
|
|
|
+ let obj = {
|
|
|
+ billId: this.form.id,
|
|
|
+ itemId: row.id
|
|
|
+ }
|
|
|
+ revokeapplyUpdate(obj).then(res => {
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.$emit('updateDetail')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ countChange() {
|
|
|
+ this.newForm.amountUpdate = _.round(_.multiply(this.newForm.priceUpdate, this.newForm.quantityUpdate), 2)
|
|
|
+ },
|
|
|
+ dicChange(name, row) {
|
|
|
+ if (name == 'corpTypeUpdate') {
|
|
|
+ this.newForm.corpIdUpdate = null
|
|
|
+ this.newForm.corpCnNameUpdate = null
|
|
|
+ this.newForm.corpEnNameUpdate = null
|
|
|
+ this.newForm.shortNameUpdate = null
|
|
|
+ }
|
|
|
+ if (name == 'shortNameUpdate') {
|
|
|
+ if (row) {
|
|
|
+ this.newForm.corpIdUpdate = row.id
|
|
|
+ this.newForm.corpCnNameUpdate = row.cnName
|
|
|
+ this.newForm.corpEnNameUpdate = row.enName
|
|
|
+ } else {
|
|
|
+ this.newForm.corpIdUpdate = null
|
|
|
+ this.newForm.corpCnNameUpdate = null
|
|
|
+ this.newForm.corpEnNameUpdate = null
|
|
|
+ this.newForm.shortNameUpdate = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (name == 'billShortNameUpdate') {
|
|
|
+ if (row) {
|
|
|
+ this.newForm.billCorpIdUpdate = row.id
|
|
|
+ this.newForm.billCorpCnNameUpdate = row.cnName
|
|
|
+ this.newForm.billCorpEnNameUpdate = row.enName
|
|
|
+ } else {
|
|
|
+ this.newForm.billCorpIdUpdate = null
|
|
|
+ this.newForm.billCorpCnNameUpdate = null
|
|
|
+ this.newForm.billCorpEnNameUpdate = null
|
|
|
+ this.newForm.billShortNameUpdate = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (name == 'feeCnNameUpdate') {
|
|
|
+ if (row) {
|
|
|
+ this.newForm.feeIdUpdate = row.id
|
|
|
+ this.newForm.feeCodeUpdate = row.code
|
|
|
+ this.newForm.feeEnNameUpdate = row.enName
|
|
|
+ } else {
|
|
|
+ this.newForm.feeIdUpdate = null
|
|
|
+ this.newForm.feeCodeUpdate = null
|
|
|
+ this.newForm.feeEnNameUpdate = null
|
|
|
+ this.newForm.feeCnNameUpdate = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (name == 'curCodeUpdate') {
|
|
|
+ if (row) {
|
|
|
+ // console.log()
|
|
|
+ this.newForm.exrateUpdate = this.getExchangeRate(row.code, this.oldForm.dc, 1)
|
|
|
+ } else {
|
|
|
+ this.newForm.exrateUpdate = null
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submit() {
|
|
|
+ let obj = {
|
|
|
+ ...this.oldForm,
|
|
|
+ ...this.newForm,
|
|
|
+ billDate: this.oldForm.billDate + ' 00:00:00',
|
|
|
+ etd: this.oldForm.etd + ' 00:00:00',
|
|
|
+ type: 0,
|
|
|
+ id: null,
|
|
|
+ pid: this.form.id,
|
|
|
+ itemId: this.oldForm.id,
|
|
|
+ branchId: this.form.branchId,
|
|
|
+ branchName: this.form.branchName,
|
|
|
+ url: '/iosBasicData/SeafreightExportF/bills/index',
|
|
|
+ pageStatus: "this.$store.getters.approvalDetails",
|
|
|
+ pageLabel: "海运出口(F)",
|
|
|
+ }
|
|
|
+ applyUpdate(obj).then(res => {
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.$emit('updateDetail')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ },
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+::v-deep .el-dialog__body {
|
|
|
+ padding: 6px 20px !important;
|
|
|
+}
|
|
|
+</style>
|