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>
-->
<template>
<div class="m-Btn-eContainer" v-if="!buttonHide && ((!isReview && !funcBtnHide) || showSetBtn)">
<div class="m-funcBtn-eContainer" v-if="!isReview && !buttonHide && !funcBtnHide">
<el-button
type="primary"
size="small"
@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 type="primary" size="small" @click="start" :loading="$store.state.Status.loading.submit">提交</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.stash">暂存</el-button>
<el-button size="small" @click="handleCancel">退出</el-button>
</div>
<div class="m-zhanWei-forfuncBtn" v-if="!buttonHide && showSetBtn && (funcBtnHide || isReview)"></div>
......@@ -53,7 +43,7 @@
export default {
// 如果需要制裁信息按钮则给组件传 showAml 方法,如果不需要则不传
props: ["handleStart", "handleCheck", "handleSave", "handleExit", "hideFuncBtn"],
props: ["handleSubmit", "handleCheck", "handleStash", "handleExit", "hideFuncBtn"],
data: function() {
return {
isReview: false,
......@@ -90,13 +80,13 @@ export default {
},
methods: {
start: async function() {
this.handleStart && (await this.handleStart());
this.handleSubmit && (await this.handleSubmit());
},
check: async function() {
this.handleCheck && (await this.handleCheck());
},
save: async function() {
this.handleSave && (await this.handleSave());
this.handleStash && (await this.handleStash());
},
handleCancel: function() {
this.$confirm("确认退出?", "", {
......@@ -113,7 +103,7 @@ export default {
}, 500)
} else {
setTimeout(() => {
this.$router.push('/business/home')
this.$router.push('/business/office')
}, 500)
}
})
......@@ -173,7 +163,9 @@ export default {
.m-openleft-item > span {
display: inline-block;
}
.m-openleft-item .el-button+.el-button {
margin: 0;
}
.m-openleft-item > button,
.m-openleft-item > span > 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 = {
params: undefined,
searchParams: undefined,
activeName: undefined
},
loading: {
// 提交
submit: false,
// 校验
check: false,
// 暂存
stash: false
}
},
mutations: {
......@@ -61,6 +69,15 @@ const Status = {
searchParams: 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>
<c-page title="买方信用证开立">
<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
:model="model"
:rules="rules"
......@@ -109,6 +122,7 @@ import Utils from "~/utils/index";
import CodeTable from "~/config/CodeTable";
import Ditopn from "~/model/Ditopn";
import CommonProcess from "~/mixin/CommonProcess";
import CommonFuncs from "~/mixin/CommonFuncs";
import Pattern from "~/model/Ditopn/Pattern";
import Default from "~/model/Ditopn/Default";
import Check from "~/model/Ditopn/Check";
......@@ -158,7 +172,7 @@ export default {
root: this,
};
},
mixins: [CommonProcess], // 里面包含了Default、Check等的公共处理
mixins: [CommonProcess, CommonFuncs], // 里面包含了Default、Check等的公共处理
computed: {},
data() {
return {
......
<template>
<div class="eibs-tab">
<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>
</div>
</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