Commit a6035907 by 潘际乾

按钮组件

parent 92c05d39
<!-- 引用方法 <!-- 引用方法
<c-function-btn :handleStart="handleStart" :handleCheck="handleCheck" :handleSave="handleSave" <c-function-btn :handleSubmit="handleSubmit" :handleCheck="handleCheck" :handleStash="handleStash"
></c-function-btn> ></c-function-btn>
--> -->
<template> <template>
<div class="m-Btn-eContainer" v-if="!buttonHide && ((!isReview && !funcBtnHide) || showSetBtn)"> <div class="m-Btn-eContainer" v-if="!buttonHide && ((!isReview && !funcBtnHide) || showSetBtn)">
<div class="m-funcBtn-eContainer" v-if="!isReview && !buttonHide && !funcBtnHide"> <div class="m-funcBtn-eContainer" v-if="!isReview && !buttonHide && !funcBtnHide">
<el-button <el-button type="primary" size="small" @click="start" :loading="$store.state.Status.loading.submit">提交</el-button>
type="primary" <el-button size="small" @click="check" :loading="$store.state.Status.loading.check">检核</el-button>
size="small" <el-button size="small" @click="save" :loading="$store.state.Status.loading.stash">暂存</el-button>
@click="start"
:loading="$store.state.Status.loading.start"
>提交</el-button
>
<el-button size="small" @click="check" :loading="$store.state.Status.loading.check"
>检核</el-button
>
<el-button size="small" @click="save" :loading="$store.state.Status.loading.save"
>暂存</el-button
>
<el-button size="small" @click="handleCancel">退出</el-button> <el-button size="small" @click="handleCancel">退出</el-button>
</div> </div>
<div class="m-zhanWei-forfuncBtn" v-if="!buttonHide && showSetBtn && (funcBtnHide || isReview)"></div> <div class="m-zhanWei-forfuncBtn" v-if="!buttonHide && showSetBtn && (funcBtnHide || isReview)"></div>
...@@ -53,7 +43,7 @@ ...@@ -53,7 +43,7 @@
export default { export default {
// 如果需要制裁信息按钮则给组件传 showAml 方法,如果不需要则不传 // 如果需要制裁信息按钮则给组件传 showAml 方法,如果不需要则不传
props: ["handleStart", "handleCheck", "handleSave", "handleExit", "hideFuncBtn"], props: ["handleSubmit", "handleCheck", "handleStash", "handleExit", "hideFuncBtn"],
data: function() { data: function() {
return { return {
isReview: false, isReview: false,
...@@ -90,13 +80,13 @@ export default { ...@@ -90,13 +80,13 @@ export default {
}, },
methods: { methods: {
start: async function() { start: async function() {
this.handleStart && (await this.handleStart()); this.handleSubmit && (await this.handleSubmit());
}, },
check: async function() { check: async function() {
this.handleCheck && (await this.handleCheck()); this.handleCheck && (await this.handleCheck());
}, },
save: async function() { save: async function() {
this.handleSave && (await this.handleSave()); this.handleStash && (await this.handleStash());
}, },
handleCancel: function() { handleCancel: function() {
this.$confirm("确认退出?", "", { this.$confirm("确认退出?", "", {
...@@ -113,7 +103,7 @@ export default { ...@@ -113,7 +103,7 @@ export default {
}, 500) }, 500)
} else { } else {
setTimeout(() => { setTimeout(() => {
this.$router.push('/business/home') this.$router.push('/business/office')
}, 500) }, 500)
} }
}) })
...@@ -173,7 +163,9 @@ export default { ...@@ -173,7 +163,9 @@ export default {
.m-openleft-item > span { .m-openleft-item > span {
display: inline-block; display: inline-block;
} }
.m-openleft-item .el-button+.el-button {
margin: 0;
}
.m-openleft-item > button, .m-openleft-item > button,
.m-openleft-item > span > button, .m-openleft-item > span > button,
.m-openleft-item > span > div > button { .m-openleft-item > span > div > button {
......
import Utils from "~/utils";
export default {
methods: {
// 表单提交
async handleSubmit() {
let result = await this.save();
if (result.respCode == SUCCESS) {
this.$notify({
title: "成功",
message: "保存成功",
type: "success",
});
this.$router.history.push("/business/trnrel");
} else {
this.$notify({
title: "失败",
message: "保存失败",
type: "error",
});
}
},
// 表单暂存
async handleStash() {
let result = await this.pedding();
if (result.respCode == SUCCESS) {
this.$notify({
title: "成功",
message: "暂存成功",
type: "success",
});
this.$router.history.push("/business/sptsel");
} else {
this.$notify({
title: "失败",
message: "暂存失败",
type: "error",
});
}
},
// 表单校验
async handleCheck() {
let result = await this.checkAll();
if (result.respCode != SUCCESS) {
this.$notify.error({ title: "错误", message: result.respMsg });
} else {
// 清除之前的校验状态
this.$refs.modelForm.clearValidate();
const fields = this.$refs.modelForm.fields;
const fieldErrors = result.fieldErrors;
this.updateModel(result.data);
Utils.positioningErrorMsg(fieldErrors, fields);
const tab = Utils.positioningErrorMsg(fieldErrors, fields);
if (tab) {
// tab切换之后,需出发tab-click的事件
this.tabClick(tab);
}
}
},
},
};
...@@ -13,6 +13,14 @@ const Status = { ...@@ -13,6 +13,14 @@ const Status = {
params: undefined, params: undefined,
searchParams: undefined, searchParams: undefined,
activeName: undefined activeName: undefined
},
loading: {
// 提交
submit: false,
// 校验
check: false,
// 暂存
stash: false
} }
}, },
mutations: { mutations: {
...@@ -61,6 +69,15 @@ const Status = { ...@@ -61,6 +69,15 @@ const Status = {
searchParams: undefined, searchParams: undefined,
activeName: undefined activeName: undefined
} }
},
setLoadingSubmit(state, value) {
state.loading.submit = value;
},
setLoadingCheck(state, value) {
state.loading.check = value;
},
setLoadingStash(state, value) {
state.loading.stash = value;
} }
} }
} }
......
<template> <template>
<c-page title="买方信用证开立"> <c-page title="买方信用证开立">
<div class="eContainer"> <div class="eContainer">
<c-bus-button :$pntvm="this"></c-bus-button> <!-- <c-bus-button :$pntvm="this"></c-bus-button> -->
<c-function-btn
:handleSubmit="handleSubmit"
:handleCheck="handleCheck"
:handleStash="handleStash"
>
<el-button size="small">备忘录</el-button>
<el-button size="small">影像信息</el-button>
<el-button size="small">保存模板</el-button>
<el-button size="small">使用模板</el-button>
<el-button size="small">制裁信息</el-button>
<el-button size="small">拆分报文</el-button>
<el-button size="small">提示</el-button>
</c-function-btn>
<el-form <el-form
:model="model" :model="model"
:rules="rules" :rules="rules"
...@@ -109,6 +122,7 @@ import Utils from "~/utils/index"; ...@@ -109,6 +122,7 @@ import Utils from "~/utils/index";
import CodeTable from "~/config/CodeTable"; import CodeTable from "~/config/CodeTable";
import Ditopn from "~/model/Ditopn"; import Ditopn from "~/model/Ditopn";
import CommonProcess from "~/mixin/CommonProcess"; import CommonProcess from "~/mixin/CommonProcess";
import CommonFuncs from "~/mixin/CommonFuncs";
import Pattern from "~/model/Ditopn/Pattern"; import Pattern from "~/model/Ditopn/Pattern";
import Default from "~/model/Ditopn/Default"; import Default from "~/model/Ditopn/Default";
import Check from "~/model/Ditopn/Check"; import Check from "~/model/Ditopn/Check";
...@@ -158,7 +172,7 @@ export default { ...@@ -158,7 +172,7 @@ export default {
root: this, root: this,
}; };
}, },
mixins: [CommonProcess], // 里面包含了Default、Check等的公共处理 mixins: [CommonProcess, CommonFuncs], // 里面包含了Default、Check等的公共处理
computed: {}, computed: {},
data() { data() {
return { return {
......
<template> <template>
<div class="eibs-tab"> <div class="eibs-tab">
<c-col :span="22" :offset="1"> <c-col :span="22" :offset="1">
<c-istream-table :list="data" :coluc-istream-tablemns="columns"></c-istream-table> <c-istream-table :list="data" :columns="columns"></c-istream-table>
</c-col> </c-col>
</div> </div>
</template> </template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment