Commit 878ed045 by fukai

修改

parent f703822e
<template>
<div class="bus-button">
<c-button type="primary" v-onclick="save">提交</c-button>
<c-button type="primary" v-onclick="pedding">暂存</c-button>
<c-button type="primary" v-onclick="check">校核</c-button>
<c-button v-onclick="exit">退出</c-button>
<c-button type="primary" v-on:click="save">提交</c-button>
<c-button type="primary" v-on:click="pedding">暂存</c-button>
<c-button type="primary" v-on:click="check">校核</c-button>
<c-button v-on:click="exit">退出</c-button>
</div>
</template>
<script>
import commonApi from "~/mixin/commonApi"
export default {
props:["parent"],
props:["$pntvm"],
data(){
return{
}
},
methods:{
save(){
async save(){
console.log(123)
let vm = this.getVM();
let result = await vm.save()
console.log(result)
},
pedding(){
async pedding(){
let result = await this.getVM().pedding()
console.log(result)
},
check(){
async check(){
let result = await this.getVM().checkAll()
if(result.respCode != SUCCESS)
{
this.$notify.error({title: '错误',message: result.respMsg});
}
},
exit(){
this.$history.push("/home")
},
getVM(){
return this.$pntvm
}
}
}
......
......@@ -13,7 +13,7 @@ import store from "./store"
import CustomComponent from "./components"
import VueFunc from "./utils/vuefunc"
window.SUCCESS="00000"
window.SUCCESS="AAAAAA"
Vue.use(ElementUI)
Vue.use(CustomComponent)
......
import Api from "~/service/Api"
import Utils from "../utils"
export default {
data(){
return {}
},
methods:{
init(params){
params = params||{}
return Api.post(this.declareParams.trnName+"/init",{params})
},
save(params){
params = params||{}
let data = Utils.flatObject(this.model)
return Api.post(this.declareParams.trnName+"/saveData",{...data,params})
},
exeuteCheck(rulePath,params){
params = params||{}
let data = Utils.flatObject(this.model)
return Api.post(this.declareParams.trnName+"/executeCheck/"+rulePath,{...data,params})
},
executeDefault(rulePath,params)
{
params = params||{}
let data = Utils.flatObject(this.model)
return Api.post(this.declareParams.trnName+"/default/"+rulePath,{...data,params})
},
executeRule(rulePath,params)
{
params = params||{}
let data = Utils.flatObject(this.model)
return Api.post(this.declareParams.trnName+"/executeRule/"+rulePath,{...data,params})
},
checkAll(params){
params = params||{}
let data = Utils.flatObject(this.model)
return Api.post(this.declareParams.trnName+"/checkAll",{...data,params})
},
pedding(params){
params = params||{}
let data = Utils.flatObject(this.model)
return Api.post(this.declareParams.trnName+"/pending",{...data,params})
}
}
}
\ No newline at end of file
export default{
data(){
return {
version:"1.0",
trnName:"",
}
},
computed:{
declareParams(){
return {
version:this.version,
trnName:this.trnName,
}
}
}
}
\ No newline at end of file
import commonDeclare from "./commonDeclare"
import commonApi from "./commonApi"
export default {
mixins: [],
mixins: [commonApi,commonDeclare],
data: function () {
return {
}
......
......@@ -10,6 +10,9 @@ const instance = axios.create({
method: 'post',
});
const CODE_KEY = "respCode"
const MESSAGE_KEY = "respMsg"
export default class Api
{
static pget(url,data)
......@@ -72,11 +75,11 @@ export default class Api
})
.then(response=>{
const {data} = response;
if(data && data.code != SUCCESS)
if(data && data[CODE_KEY] != SUCCESS)
{
console.log("错误码:"+data.code+" 错误信息:"+data.message)
console.log("错误码:"+data[CODE_KEY]+" 错误信息:"+data[MESSAGE_KEY])
}
if(data && data.code == 'L0003'){
if(data && data[CODE_KEY] == 'L0003'){
window.sessionStorage.removeItem("token")
window.sessionStorage.removeItem("userId")
MessageBox.alert({
......@@ -98,17 +101,17 @@ export default class Api
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
resolve({retcod:'500',retmsg:error.response.status});
resolve({[CODE_KEY]:'500',[MESSAGE_KEY]:error.response.status});
} else if (error.request) {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.log(error.request);
resolve({retcod:'501'});
resolve({[CODE_KEY]:'501'});
} else {
// Something happened in setting up the request that triggered an Error
console.log('Error', error.message);
resolve({retcod:'502',retmsg:error.message});
resolve({[CODE_KEY]:'502',[MESSAGE_KEY]:error.message});
}
console.log(error.config);
});
......
......@@ -85,13 +85,14 @@
</el-tabs>
<c-bus-button></c-bus-button>
<c-bus-button :$pntvm="this"></c-bus-button>
</el-form>
</div>
</c-page>
</template>
<script>
import Api from "~/service/Api"
import Utils from "~/utils/index"
import CodeTable from "~/config/CodeTable"
import Ditopn from "~/model/Ditopn"
import CommonProcess from "~/mixin/CommonProcess"
......@@ -142,6 +143,7 @@ export default {
},
data(){
return {
trnName:"ditopn",
model:new Ditopn().data,
checkRules: Check,
defaultRules: Default,
......@@ -164,11 +166,11 @@ export default {
},
created:async function(){
console.log("进入ditopn交易");
let rtnmsg = await Api.post("ditopn/init",{params:{}})
if(rtnmsg.retcod == SUCCESS)
let rtnmsg = await this.init()
if(rtnmsg.respCode == SUCCESS)
{
//TODO 处理数据逻辑
//更新数据
Utils.copyValueFromVO(this.model,rtnmsg.data)
}
else
{
......
......@@ -59,7 +59,7 @@ module.exports = (options = {}) => ({
port: 8010,
proxy: {
'/gjjs/': {
target: 'http://127.0.0.1:8070',
target: 'http://127.0.0.1:8081',
changeOrigin: true,
pathRewrite: {
'^/gjjs': '/gjjs'
......
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