|
|
@@ -1,417 +0,0 @@
|
|
|
-<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()">返回列表
|
|
|
- </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 v-if="roleName.indexOf('admin') != -1" size="small" style="margin-right: 8px"
|
|
|
- :disabled="!form.id" @click="$refs.report.openDialog()">报表设计
|
|
|
- </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)"
|
|
|
- @click="inEdit">编 辑
|
|
|
- </el-button>
|
|
|
- <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
|
|
|
- :disabled="isSaveBtn" @click="submit">保 存
|
|
|
- </el-button>
|
|
|
- <el-button v-if="form.id" class="el-button--small-yh" style="margin-left: 6px;" type="success"
|
|
|
- size="small" :disabled="form.businessStatus != '录入'" @click="application">单据请核
|
|
|
- </el-button>
|
|
|
- <el-button v-if="form.businessStatus == '提交审核'" class="el-button--small-yh" style="margin-left: 6px;"
|
|
|
- type="danger" size="small" @click="revokeApplication">撤销单据请核
|
|
|
- </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" @select="selectHandle" @row-update="rowUpdate"
|
|
|
- @resetColumn="resetColumn('crud', 'option', 'optionBack', 447)"
|
|
|
- @saveColumn="saveColumn('crud', 'option', 'optionBack', 447)">
|
|
|
- <template slot="menuLeft">
|
|
|
- <el-button type="info" plain size="small" :disabled="editDisabled"
|
|
|
- @click="allClick('一键保存')">一键保存</el-button>
|
|
|
- <el-button type="info" plain size="small" :disabled="editDisabled"
|
|
|
- @click="allClick('一键编辑')">一键编辑</el-button>
|
|
|
- <el-button size="small" style="margin-right: 8px" :disabled="!form.id"
|
|
|
- @click="$refs.print.openDialog()">打印账单
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <template slot="indexHeader" slot-scope="{row,index}">
|
|
|
- <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled" circle
|
|
|
- @click="addRow()">
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <template slot="menu" slot-scope="{ row, index }">
|
|
|
- <el-button size="small" icon="el-icon-delete" type="text"
|
|
|
- :disabled="editDisabled || form.feeCenterListD.length || form.feeCenterListC.length"
|
|
|
- @click="rowDel(row, index)">删 除</el-button>
|
|
|
- </template>
|
|
|
- </avue-crud>
|
|
|
- </trade-card>
|
|
|
- <trade-card title="费用明细">
|
|
|
-
|
|
|
- </trade-card>
|
|
|
- <trade-card title="记录信息">
|
|
|
- </trade-card>
|
|
|
- </div>
|
|
|
- <reports :id="form.id" :assemblyForm="form" businessValue="MYDL" ref="report"></reports>
|
|
|
- <!--审核弹窗-->
|
|
|
- <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>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import { submit, getDetail, removeItem, checkAgent, revokeCheckAgent, copyAgent } from "@/api/tradeAgency/tradeAgency";
|
|
|
-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 { getDicinit } from "@/api/dicSelect/index";
|
|
|
-import { dateFormat } from "@/util/date";
|
|
|
-import _ from "lodash";
|
|
|
-export default {
|
|
|
- name: "detailsPage",
|
|
|
-
|
|
|
- data() {
|
|
|
- return {
|
|
|
- selectionList: [],
|
|
|
- checkId: '', // 审核需要的id
|
|
|
- batchNo: '',
|
|
|
- checkScheduleDialog: false, // 审核弹窗
|
|
|
- editButton: false,
|
|
|
- editDisabled: false,
|
|
|
- form: {
|
|
|
- },
|
|
|
- oldForm: {},
|
|
|
- optionForm: {
|
|
|
- menuBtn: false,
|
|
|
- span: 8,
|
|
|
- disabled: false,
|
|
|
- column: [
|
|
|
- {
|
|
|
- label: '客户',
|
|
|
- prop: "corpName",
|
|
|
- disabled: false,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: '备注',
|
|
|
- prop: "remarks",
|
|
|
- type: 'textarea',
|
|
|
- disabled: false,
|
|
|
- span: 12,
|
|
|
- minRows: 2,
|
|
|
- },
|
|
|
- ]
|
|
|
- },
|
|
|
- option: {},
|
|
|
- optionBack: {
|
|
|
- height: 'auto',
|
|
|
- calcHeight: 30,
|
|
|
- menuWidth: 60,
|
|
|
- tip: false,
|
|
|
- border: true,
|
|
|
- addBtn: false,
|
|
|
- viewBtn: false,
|
|
|
- editBtn: false,
|
|
|
- delBtn: false,
|
|
|
- refreshBtn: false,
|
|
|
- selection: true,
|
|
|
- align: 'center',
|
|
|
- column: [
|
|
|
- {
|
|
|
- label: "index",
|
|
|
- prop: "index",
|
|
|
- width: "55",
|
|
|
- headerslot: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "备注",
|
|
|
- prop: "remarks",
|
|
|
- width: "120",
|
|
|
- cell: true,
|
|
|
- overHidden: true
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- }
|
|
|
- },
|
|
|
- components: {
|
|
|
- dicSelect,
|
|
|
- checkSchedule,
|
|
|
- businessReports,
|
|
|
- reports
|
|
|
- },
|
|
|
- props: {
|
|
|
- detailData: Object
|
|
|
- },
|
|
|
- async created() {
|
|
|
- this.option = await this.getColumnData(this.getColumnName(447), this.optionBack);
|
|
|
- if (this.detailData.id) {
|
|
|
- this.editButton = true
|
|
|
- this.editDisabled = true
|
|
|
- this.optionForm.disabled = true
|
|
|
- this.getDetails(this.detailData.id)
|
|
|
- }
|
|
|
- if (this.$route.query.params) {
|
|
|
- this.getDetails(this.$route.query.params)
|
|
|
- }
|
|
|
- if (this.detailData.copyId) {
|
|
|
- this.getCopydate(this.detailData.copyId)
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- dicChange(name, row) {
|
|
|
- if (name == 'corpName') {
|
|
|
- if (row) {
|
|
|
- this.form.corpId = row.id
|
|
|
- this.form.corpName = row.cnName
|
|
|
- this.form.sourceType = row.sourceType
|
|
|
- this.form.salesmanName = row.srcCnName
|
|
|
- this.form.salesmanId = row.srcId
|
|
|
- } else {
|
|
|
- this.form.corpId = null
|
|
|
- this.form.sourceType = null
|
|
|
- this.form.salesmanName = null
|
|
|
- this.form.salesmanId = null
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- rowDicChange(name, row, el) {
|
|
|
- if (name == 'hsCode') {
|
|
|
- if (row) {
|
|
|
- el.labelProductName = row.cnName
|
|
|
- el.taxRate = row.taxRate
|
|
|
- } else {
|
|
|
- el.labelProductName = null
|
|
|
- el.taxRate = null
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- rowEdit(row) {
|
|
|
- },
|
|
|
- addRow() {
|
|
|
-
|
|
|
- },
|
|
|
- selectionChange(list) {
|
|
|
- this.selectionList = list;
|
|
|
- },
|
|
|
- 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 => {
|
|
|
- this.form = res.data.data
|
|
|
- }).finally(() => {
|
|
|
- loading.close()
|
|
|
- })
|
|
|
- },
|
|
|
- getCopydate(id) {
|
|
|
- const loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '加载中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(255,255,255,0.7)'
|
|
|
- });
|
|
|
- copyAgent({ id: id }).then(res => {
|
|
|
- this.form = res.data.data
|
|
|
- }).finally(() => {
|
|
|
- loading.close()
|
|
|
- })
|
|
|
- },
|
|
|
- inEdit() {
|
|
|
- this.editButton = false
|
|
|
- if (this.form.businessStatus == '录入') {
|
|
|
- this.editDisabled = false
|
|
|
- this.optionForm.disabled = false
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- allClick(name) {
|
|
|
- if (name == '一键保存') {
|
|
|
-
|
|
|
- this.submit()
|
|
|
- }
|
|
|
- if (name == '一键编辑') {
|
|
|
- for (let row of this.form.agentItemsList) {
|
|
|
- this.$set(row, "$cellEdit", true);
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- submit(type) {
|
|
|
- this.$refs["form"].validate((valid, done) => {
|
|
|
- done();
|
|
|
- if (valid) {
|
|
|
- for (let row of this.form.agentItemsList) {
|
|
|
- // if (!row.billNo) {
|
|
|
- // 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)'
|
|
|
- });
|
|
|
- submit(this.form).then(res => {
|
|
|
- this.$message.success("保存成功");
|
|
|
- this.getDetails(res.data.data.id)
|
|
|
- }).finally(() => {
|
|
|
- loading.close();
|
|
|
- })
|
|
|
-
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- application() {
|
|
|
- this.$confirm("确定请核数据?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- let obj = {}
|
|
|
- obj = {
|
|
|
- id: this.form.id,
|
|
|
- url: '/tradeAgency/tradeAgency/index',
|
|
|
- pageStatus: '',
|
|
|
- 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) {
|
|
|
- this.$emit("goBack");
|
|
|
- },
|
|
|
- }
|
|
|
-}
|
|
|
-</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;
|
|
|
-}
|
|
|
-
|
|
|
-::v-deep .el-card__body {
|
|
|
- padding: 3px 10px;
|
|
|
-}
|
|
|
-</style>
|