|
|
@@ -7,12 +7,12 @@
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="add-customer-btn">
|
|
|
- <el-button size="small" style="margin-right: 8px" :disabled="!form.id"
|
|
|
+ <!-- <el-button size="small" style="margin-right: 8px" :disabled="!form.id"
|
|
|
@click="$refs.print.openDialog()">预 览
|
|
|
</el-button>
|
|
|
<el-button v-if="roleName.indexOf('admin') != -1" size="small" style="margin-right: 8px"
|
|
|
:disabled="!form.id" @click="$refs.report.openDialog()">报表设计
|
|
|
- </el-button>
|
|
|
+ </el-button> -->
|
|
|
<el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
|
|
|
v-if="editButton"
|
|
|
:disabled="showLock || !(roleName.indexOf('admin') != -1 || roleName.indexOf('允许修改他人业务') != -1 || saberUserInfo.user_id == form.createUser)"
|
|
|
@@ -146,7 +146,8 @@
|
|
|
@click="allClick('一键保存')">一键保存</el-button>
|
|
|
<el-button type="info" plain size="small" :disabled="editDisabled"
|
|
|
@click="allClick('一键编辑')">一键编辑</el-button>
|
|
|
- <el-button type="danger" plain size="small" :disabled="editDisabled || selectionList.length == 0"
|
|
|
+ <el-button type="danger" plain size="small"
|
|
|
+ :disabled="editDisabled || selectionList.length == 0"
|
|
|
@click="allClick('批量删除')">批量删除</el-button>
|
|
|
</template>
|
|
|
<template slot="indexHeader" slot-scope="{row,index}">
|
|
|
@@ -206,11 +207,14 @@
|
|
|
@saveColumn="saveColumn('crud2', 'polOption', 'polOptionBack', 448)">
|
|
|
<template slot="menuLeft">
|
|
|
<el-button type="info" plain size="small" :disabled="editDisabled"
|
|
|
- @click="allClick('一键保存')">一键保存</el-button>
|
|
|
+ @click="allClick('POL一键保存')">一键保存</el-button>
|
|
|
<el-button type="info" plain size="small" :disabled="editDisabled"
|
|
|
@click="allClick('POL一键编辑')">一键编辑</el-button>
|
|
|
- <el-button type="danger" plain size="small" :disabled="editDisabled || selectionPolList.length == 0"
|
|
|
+ <el-button type="danger" plain size="small"
|
|
|
+ :disabled="editDisabled || selectionPolList.length == 0"
|
|
|
@click="allClick('POL批量删除')">批量删除</el-button>
|
|
|
+ <el-button type="success" plain size="small" :disabled="editDisabled"
|
|
|
+ @click="allClick('POL费用模板')">费用模板</el-button>
|
|
|
</template>
|
|
|
<template slot="indexHeader" slot-scope="{row,index}">
|
|
|
<el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled" circle
|
|
|
@@ -287,11 +291,14 @@
|
|
|
@saveColumn="saveColumn('crud3', 'podOption', 'podOptionBack', 449)">
|
|
|
<template slot="menuLeft">
|
|
|
<el-button type="info" plain size="small" :disabled="editDisabled"
|
|
|
- @click="allClick('一键保存')">一键保存</el-button>
|
|
|
+ @click="allClick('POD一键保存')">一键保存</el-button>
|
|
|
<el-button type="info" plain size="small" :disabled="editDisabled"
|
|
|
@click="allClick('POD一键编辑')">一键编辑</el-button>
|
|
|
- <el-button type="danger" plain size="small" :disabled="editDisabled || selectionPodList.length == 0"
|
|
|
+ <el-button type="danger" plain size="small"
|
|
|
+ :disabled="editDisabled || selectionPodList.length == 0"
|
|
|
@click="allClick('POD批量删除')">批量删除</el-button>
|
|
|
+ <el-button type="success" plain size="small" :disabled="editDisabled"
|
|
|
+ @click="allClick('POD费用模板')">费用模板</el-button>
|
|
|
</template>
|
|
|
<template slot="indexHeader" slot-scope="{row,index}">
|
|
|
<el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled" circle
|
|
|
@@ -368,11 +375,14 @@
|
|
|
@saveColumn="saveColumn('crud4', 'potOption', 'potOptionBack', 450)">
|
|
|
<template slot="menuLeft">
|
|
|
<el-button type="info" plain size="small" :disabled="editDisabled"
|
|
|
- @click="allClick('一键保存')">一键保存</el-button>
|
|
|
+ @click="allClick('POT一键保存')">一键保存</el-button>
|
|
|
<el-button type="info" plain size="small" :disabled="editDisabled"
|
|
|
@click="allClick('POT一键编辑')">一键编辑</el-button>
|
|
|
- <el-button type="danger" plain size="small" :disabled="editDisabled || selectionPotList.length == 0"
|
|
|
+ <el-button type="danger" plain size="small"
|
|
|
+ :disabled="editDisabled || selectionPotList.length == 0"
|
|
|
@click="allClick('POT批量删除')">批量删除</el-button>
|
|
|
+ <el-button type="success" plain size="small" :disabled="editDisabled"
|
|
|
+ @click="allClick('POT费用模板')">费用模板</el-button>
|
|
|
</template>
|
|
|
<template slot="indexHeader" slot-scope="{row,index}">
|
|
|
<el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled" circle
|
|
|
@@ -452,11 +462,35 @@
|
|
|
: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>
|
|
|
+ <el-dialog append-to-body title="费用模板" :visible.sync="templateDialog" width="60%" :before-close="handleClose">
|
|
|
+ <span>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-scrollbar>
|
|
|
+ <basic-container>
|
|
|
+ <avue-tree :option="treeOption" :data="templateData" @node-click="nodeClick">
|
|
|
+ </avue-tree>
|
|
|
+ </basic-container>
|
|
|
+ </el-scrollbar>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="19">
|
|
|
+ <avue-crud :data="templateList" :option="templateOption"
|
|
|
+ @selection-change="templateChange"></avue-crud>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </span>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="templateDialog = false" size="mini">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="importTemplate" size="mini">导 入</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { submit, getDetail, removeItem, feeRemove, checkAgent, revokeCheckAgent, copyAgent } from "@/api/iosBasicData/costcenter/soc";
|
|
|
+import { submit, submitItemList, submitFeeList, getDetail, removeItem, feeRemove, checkAgent, revokeCheckAgent, copyAgent } from "@/api/iosBasicData/costcenter/soc";
|
|
|
+import { losbfeestemplateGetListTemplate } from "@/api/iosBasicData/bills";
|
|
|
+import { losbfeestemplateDetail } from "@/api/iosBasicData/losbfeestemplate";
|
|
|
import dicSelect from "@/components/dicSelect/main";
|
|
|
import checkSchedule from "@/components/checkH/checkSchedule.vue";
|
|
|
import businessReports from "@/components/tradeAgency/businessReports.vue";
|
|
|
@@ -465,10 +499,62 @@ import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
|
|
|
import { getDicinit } from "@/api/dicSelect/index";
|
|
|
import { dateFormat } from "@/util/date";
|
|
|
import _ from "lodash";
|
|
|
+import { Header } from "element-ui";
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
|
data() {
|
|
|
return {
|
|
|
+ selectionTemplateList: [],
|
|
|
+ feeType: null,
|
|
|
+ treeOption: {
|
|
|
+ nodeKey: "id",
|
|
|
+ // lazy: true,
|
|
|
+ addBtn: false,
|
|
|
+ menu: false,
|
|
|
+ size: "small",
|
|
|
+ props: {
|
|
|
+ labelText: "标题",
|
|
|
+ label: "cnName",
|
|
|
+ value: "value",
|
|
|
+ children: "children"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ templateData: [],
|
|
|
+ templateList: [],
|
|
|
+ templateOption: {
|
|
|
+ height: 500,
|
|
|
+ menu: false,
|
|
|
+ addBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ viewBtn: false,
|
|
|
+ header: false,
|
|
|
+ index: true,
|
|
|
+ selection: true,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: '费用',
|
|
|
+ prop: 'feeCnName',
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '成本价',
|
|
|
+ prop: 'price',
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '币别',
|
|
|
+ prop: 'curCode',
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '汇率',
|
|
|
+ prop: 'curCode',
|
|
|
+ overHidden: true,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ templateDialog: false,
|
|
|
selectionList: [],
|
|
|
selectionPolList: [],
|
|
|
selectionPodList: [],
|
|
|
@@ -1798,6 +1884,7 @@ export default {
|
|
|
return this.$message.error("请保存数据");
|
|
|
}
|
|
|
this.form.costItemList.push({
|
|
|
+ pid: this.form.id,
|
|
|
salesPrice: 0,
|
|
|
costPrice: 0,
|
|
|
totalProfit: 0,
|
|
|
@@ -1812,22 +1899,28 @@ export default {
|
|
|
},
|
|
|
polAddRow() {
|
|
|
this.polFeeList.push({
|
|
|
+ pid: this.form.id,
|
|
|
busType: 'POL',
|
|
|
$cellEdit: true
|
|
|
})
|
|
|
},
|
|
|
podAddRow() {
|
|
|
this.podFeeList.push({
|
|
|
+ pid: this.form.id,
|
|
|
busType: 'POD',
|
|
|
$cellEdit: true
|
|
|
})
|
|
|
},
|
|
|
potAddRow() {
|
|
|
this.potFeeList.push({
|
|
|
+ pid: this.form.id,
|
|
|
busType: 'POT',
|
|
|
$cellEdit: true
|
|
|
})
|
|
|
},
|
|
|
+ templateChange(list) {
|
|
|
+ this.selectionTemplateList = list;
|
|
|
+ },
|
|
|
selectionChange(list) {
|
|
|
this.selectionList = list;
|
|
|
},
|
|
|
@@ -1960,7 +2053,27 @@ export default {
|
|
|
},
|
|
|
allClick(name) {
|
|
|
if (name == '一键保存') {
|
|
|
- this.submit()
|
|
|
+ if (!this.form.costItemList.length) {
|
|
|
+ return this.$message.error("请添加数据");
|
|
|
+ }
|
|
|
+ for (let row of this.form.costItemList) {
|
|
|
+ if (!row.boxType || !row.curCode || !row.salesPrice) {
|
|
|
+ this.$refs.crud.rowCell(row, row.$index)
|
|
|
+ return this.$message.error("请完善明细信息");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ submitItemList(this.form.costItemList).then(res => {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.form.costItemList = res.data.data
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
}
|
|
|
if (name == '一键编辑') {
|
|
|
for (let row of this.form.costItemList) {
|
|
|
@@ -2003,6 +2116,29 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ if (name == 'POL一键保存') {
|
|
|
+ if (!this.polFeeList.length) {
|
|
|
+ return this.$message.error("请添加数据");
|
|
|
+ }
|
|
|
+ for (let row of this.polFeeList) {
|
|
|
+ if (!row.type || !row.boxType || !row.feeName || !row.curCode || !row.curCode || !row.salesPrice || !row.costPrice) {
|
|
|
+ this.$refs.crud2.rowCell(row, row.$index)
|
|
|
+ return this.$message.error("请完善POL杂费明细");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ submitFeeList(this.polFeeList).then(res => {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.polFeeList = res.data.data
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ }
|
|
|
if (name == 'POL一键编辑') {
|
|
|
for (let row of this.polFeeList) {
|
|
|
this.$set(row, "$cellEdit", true);
|
|
|
@@ -2044,6 +2180,29 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ if (name == 'POD一键保存') {
|
|
|
+ if (!this.podFeeList.length) {
|
|
|
+ return this.$message.error("请添加数据");
|
|
|
+ }
|
|
|
+ for (let row of this.podFeeList) {
|
|
|
+ if (!row.type || !row.boxType || !row.feeName || !row.curCode || !row.curCode || !row.salesPrice || !row.costPrice) {
|
|
|
+ this.$refs.crud3.rowCell(row, row.$index)
|
|
|
+ return this.$message.error("请完善POL杂费明细");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ submitFeeList(this.podFeeList).then(res => {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.podFeeList = res.data.data
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ }
|
|
|
if (name == 'POD一键编辑') {
|
|
|
for (let row of this.podFeeList) {
|
|
|
this.$set(row, "$cellEdit", true);
|
|
|
@@ -2085,6 +2244,29 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ if (name == 'POT一键保存') {
|
|
|
+ if (!this.potFeeList.length) {
|
|
|
+ return this.$message.error("请添加数据");
|
|
|
+ }
|
|
|
+ for (let row of this.potFeeList) {
|
|
|
+ if (!row.type || !row.boxType || !row.feeName || !row.curCode || !row.curCode || !row.salesPrice || !row.costPrice) {
|
|
|
+ this.$refs.crud4.rowCell(row, row.$index)
|
|
|
+ return this.$message.error("请完善POL杂费明细");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ submitFeeList(this.potFeeList).then(res => {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.potFeeList = res.data.data
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ }
|
|
|
if (name == 'POT一键编辑') {
|
|
|
for (let row of this.potFeeList) {
|
|
|
this.$set(row, "$cellEdit", true);
|
|
|
@@ -2126,6 +2308,160 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ if (name == 'POL费用模板') {
|
|
|
+ this.templateData=[]
|
|
|
+ this.templateList=[]
|
|
|
+ this.feeType = 'POL'
|
|
|
+ this.templateDialog = true
|
|
|
+ let obj = {
|
|
|
+ status: 0,
|
|
|
+ type: 'SOC',
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ losbfeestemplateGetListTemplate(1, 50, obj).then(res => {
|
|
|
+ this.templateData = res.data.data.records
|
|
|
+ if (res.data.data.records.length) {
|
|
|
+ losbfeestemplateDetail(res.data.data.records[0].id).then(res => {
|
|
|
+ this.templateList = res.data.data.feesTemplateItemsList
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (name == 'POD费用模板') {
|
|
|
+ this.templateData=[]
|
|
|
+ this.templateList=[]
|
|
|
+ this.feeType = 'POD'
|
|
|
+ this.templateDialog = true
|
|
|
+ let obj = {
|
|
|
+ status: 0,
|
|
|
+ type: 'SOC',
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ losbfeestemplateGetListTemplate(1, 50, obj).then(res => {
|
|
|
+ this.templateData = res.data.data.records
|
|
|
+ if (res.data.data.records.length) {
|
|
|
+ losbfeestemplateDetail(res.data.data.records[0].id).then(res => {
|
|
|
+ this.templateList = res.data.data.feesTemplateItemsList
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (name == 'POT费用模板') {
|
|
|
+ this.templateData=[]
|
|
|
+ this.templateList=[]
|
|
|
+ this.feeType = 'POT'
|
|
|
+ this.templateDialog = true
|
|
|
+ let obj = {
|
|
|
+ status: 0,
|
|
|
+ type: 'SOC',
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ losbfeestemplateGetListTemplate(1, 50, obj).then(res => {
|
|
|
+ this.templateData = res.data.data.records
|
|
|
+ if (res.data.data.records.length) {
|
|
|
+ losbfeestemplateDetail(res.data.data.records[0].id).then(res => {
|
|
|
+ this.templateList = res.data.data.feesTemplateItemsList
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ importTemplate() {
|
|
|
+ if (!this.selectionTemplateList.length) {
|
|
|
+ return this.$message.error("请选择模板");
|
|
|
+ }
|
|
|
+ this.selectionTemplateList.forEach(e => {
|
|
|
+ if (this.feeType == 'POL') {
|
|
|
+ bcurrencyGetExrate({ date: this.form.exrateDate, dc: 'D' }).then(res => {
|
|
|
+ res.data.data.forEach(item => {
|
|
|
+ if (e.curCode == item.code) {
|
|
|
+ this.polFeeList.push({
|
|
|
+ pid: this.form.id,
|
|
|
+ busType: 'POL',
|
|
|
+ feeName: e.feeCnName,
|
|
|
+ feeCode: e.feeCode,
|
|
|
+ feeId: e.feeId,
|
|
|
+ costPrice: e.price,
|
|
|
+ curCode: e.curCode,
|
|
|
+ exrate: item.exrate,
|
|
|
+ $cellEdit: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.feeType == 'POD') {
|
|
|
+ bcurrencyGetExrate({ date: this.form.exrateDate, dc: 'D' }).then(res => {
|
|
|
+ res.data.data.forEach(item => {
|
|
|
+ if (e.curCode == item.code) {
|
|
|
+ this.podFeeList.push({
|
|
|
+ pid: this.form.id,
|
|
|
+ busType: 'POD',
|
|
|
+ feeName: e.feeCnName,
|
|
|
+ feeCode: e.feeCode,
|
|
|
+ feeId: e.feeId,
|
|
|
+ costPrice: e.price,
|
|
|
+ curCode: e.curCode,
|
|
|
+ exrate: item.exrate,
|
|
|
+ $cellEdit: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ if (this.feeType == 'POT') {
|
|
|
+ bcurrencyGetExrate({ date: this.form.exrateDate, dc: 'D' }).then(res => {
|
|
|
+ res.data.data.forEach(item => {
|
|
|
+ if (e.curCode == item.code) {
|
|
|
+ this.potFeeList.push({
|
|
|
+ pid: this.form.id,
|
|
|
+ busType: 'POT',
|
|
|
+ feeName: e.feeCnName,
|
|
|
+ feeCode: e.feeCode,
|
|
|
+ feeId: e.feeId,
|
|
|
+ costPrice: e.price,
|
|
|
+ curCode: e.curCode,
|
|
|
+ exrate: item.exrate,
|
|
|
+ $cellEdit: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.templateDialog = false
|
|
|
+ },
|
|
|
+ // 左侧选择
|
|
|
+ nodeClick(e) {
|
|
|
+ losbfeestemplateDetail(e.id).then(res => {
|
|
|
+ this.templateList = res.data.data.feesTemplateItemsList
|
|
|
+ })
|
|
|
},
|
|
|
submit(type) {
|
|
|
this.$refs["form"].validate((valid, done) => {
|