Commit 0686fa40 by qiaoyanqi

凭证中心接口方式修改

parent 8083c367
......@@ -7,7 +7,7 @@
style="width: 250px"
/>
<div slot="footer">
<Button type="primary" @click="asyncOK">确定</Button>
<Button type="primary" :loading="loading" @click="asyncOK">确定</Button>
</div>
</Modal>
</div>
......@@ -28,6 +28,7 @@ export default {
draftModal: false,
value: "",
billDefineName: null,
loading:false
};
},
mounted() {},
......@@ -37,6 +38,7 @@ export default {
this.$Message.info('请输入草稿名称');
return
}
this.loading = true;
//掉接口保存当前json 和value
let obj = {
billDefineName: this.billDefineName,
......@@ -51,6 +53,7 @@ export default {
})
.then(
function (data, textStatus, response) {
this.loading = false;
if(data.code == 0){
this.$Message.info("保存成功");
this.draftModal = false;
......@@ -60,6 +63,7 @@ export default {
}.bind(this)
)
.catch((XMLHttpRequest, textStatus, errorThrown) => {
this.loading = false;
});
},
},
......
......@@ -50,7 +50,7 @@
style="width: 250px"
/>
<div slot="footer">
<Button type="primary" @click="asyncOK">确定</Button>
<Button type="primary" :loading="loading" @click="asyncOK">确定</Button>
</div>
</Modal>
</div>
......@@ -75,6 +75,7 @@ export default {
templateName: "",
queryData: [],
currentId: null,
loading:false,
columns: [
{
title: "草稿名称",
......@@ -146,6 +147,7 @@ export default {
title: this.value,
id: this.currentId,
};
this.loading = true;
GAMS.Util.invokeServer({
path: "rbcfunc/billdraft/update",
type: "POST",
......@@ -154,6 +156,7 @@ export default {
})
.then(
function (data, textStatus, response) {
this.loading = false;
if(data.code == 0){
this.getList();
this.draftModal = false;
......@@ -162,7 +165,9 @@ export default {
}
}.bind(this)
)
.catch((XMLHttpRequest, textStatus, errorThrown) => {});
.catch((XMLHttpRequest, textStatus, errorThrown) => {
this.loading = false;
});
},
showData(row) {
let billObj = this.bill.getBuillData();
......
/*
* @Description:通用/单张生成
*/
import axios from 'axios'
export default {
execute(context, param) {
let subTable = param.subTable||'BXMXZB';
......@@ -53,15 +52,10 @@ export default {
})
},
generateVoucher(list,context){
axios({
          method: 'POST',
          url:'/mechanismVchr/singleCreateVchr',//单张生成接口
          headers: {
              Authorization:GMS.token,
          },
data:list
        }).then(res => {
          if (res.status === 200) {
GMS.$http.post('/mechanismVchr/singleCreateVchr',{
data:list
    }).then(res => {
           if (res.status === 200) {
if(res.data.data.showVoucher){//展示凭证
GMS.vbus.$emit('previewVoucher',res.data.data);
}else{
......@@ -75,8 +69,8 @@ export default {
onOk: () => {},
});
}
          }
        })
           }
        })
},
searchBillObj(billDefine, billId, index) {
return new Promise((resolve, reject) => {
......
/*
* @Description:通用/汇总生成
*/
import axios from 'axios'
export default {
execute(context, param) {
let subTable = param.subTable||'BXMXZB';
......@@ -53,30 +52,25 @@ export default {
})
},
generateVoucher(list,context){
axios({
          method: 'POST',
url:'/mechanismVchr/combineCreateVchr',//汇总生成
          headers: {
              Authorization:GMS.token,
          },
data:list
        }).then(res => {
          if (res.status === 200) {
if(res.data.data.showVoucher){//展示凭证
GMS.vbus.$emit('previewVoucher',res.data.data);
}else{
if(res.data.data.successVchrs && res.data.data.successVchrs.length > 0){
GMS.vbus.$emit('custom-query-refresh');
GMS.vbus.$emit('tab-count-refresh');
}
context.dom.$Modal.warning({
title: '信息提示',
content: res.data.data.processMsg,
onOk: () => {},
});
GMS.$http.post('/mechanismVchr/combineCreateVchr',{
data:list
    }).then(res => {
          if (res.status === 200) {
if(res.data.data.showVoucher){//展示凭证
GMS.vbus.$emit('previewVoucher',res.data.data);
}else{
if(res.data.data.successVchrs && res.data.data.successVchrs.length > 0){
GMS.vbus.$emit('custom-query-refresh');
GMS.vbus.$emit('tab-count-refresh');
}
          }
        })
context.dom.$Modal.warning({
title: '信息提示',
content: res.data.data.processMsg,
onOk: () => {},
});
}
          }
        })
},
searchBillObj(billDefine, billId ,index) {
return new Promise((resolve, reject) => {
......
/*
* @Description:通用/撤销生成
*/
import axios from 'axios'
export default {
execute(context, param) {
if (!param.billId || !param.billDefine) {
......@@ -25,15 +24,10 @@ export default {
that.deleteVchrAsync(arr,context);
},
deleteVchrAsync(list,context){
axios({
          method: 'POST',
          url:'/mechanismVchr/deleteVchr',//撤销凭证
          headers: {
              Authorization:GMS.token,
          },
data:list
        }).then(res => {
          if (res.status === 200) {
GMS.$http.post('/mechanismVchr/deleteVchr',{
data:list
    }).then(res => {
        if (res.status === 200) {
if(res.data.data.showVoucher){//展示凭证
GMS.vbus.$emit('previewVoucher',res.data.data);
}else{
......@@ -48,6 +42,6 @@ export default {
});
}
          }
        })
        })
}
}
\ No newline at end of file
/*
* @Description:通用/联查凭证
*/
import axios from 'axios'
export default {
execute(context, param) {
if (!param.billId || !param.billDefine) {
......@@ -31,15 +30,10 @@ export default {
that.showVchrAsync(obj,context);
},
showVchrAsync(obj,context){
axios({
          method: 'POST',
          url:'/mechanismVchr/showVchr',//查看凭证
          headers: {
              Authorization:GMS.token,
          },
data:obj
        }).then(res => {
          if (res.status === 200) {
GMS.$http.post('/mechanismVchr/showVchr',{
data:obj
    }).then(res => {
        if (res.status === 200) {
if(res.data.data.showVoucher){//展示凭证
let resObj = res.data.data;
resObj.previewState = 'readonly';
......@@ -51,7 +45,7 @@ export default {
onOk: () => {},
});
}
          }
        })
        }
    })
}
}
\ No newline at end of file
......@@ -7,7 +7,8 @@ const service = axios.create({
})
service.interceptors.request.use(config => {
config.headers.Authorization = nros.SDK.utils.getToken()
let token = window.nros.SDK.utils.getToken();
config.headers.Authorization = token;
return config
})
......
......@@ -51,43 +51,51 @@ export default {
window.GMS.vbus.$emit('tab-count-refresh');
},
async getCerSerName(){
const res = await getCertifyServiceName();
if (res.data.content){
this.certifyServiceName = res.data.content;
this.getNvwaCertifyData(this.certifyServiceName);
try {
const res = await getCertifyServiceName();
if (res.data.content){
this.certifyServiceName = res.data.content;
this.getNvwaCertifyData(this.certifyServiceName);
}
} catch (e) {
console.log(e)
}
},
/**
* 获取认证服务url和token信息
*/
async getNvwaCertifyData (certifyServiceId) {
let url = null;
const getCurrentUrl = await getCertifyServiceUrl();
const res = await getIdUrl(certifyServiceId);
if(getCurrentUrl.data.content){
url = getCurrentUrl.data.content;
}else{
url = res.data.url;
}
if (url){
window.GMS.url = url;
const res1 = await getSso({
appId: res.data.id,
location: '',
params:''})
if (res1.data.success){
let num = res1.data.data.lastIndexOf('?');
let urlStr = res1.data.data.substring(num);
const { status, data:data1 } = await axios({
method: 'GET',
url: url + 'nvwa-login-sso/sso/login'+urlStr,
})
if (status === 200) {
if (data1.success) {
window.GMS.token = data1.token;
try {
let url = null;
const getCurrentUrl = await getCertifyServiceUrl();
const res = await getIdUrl(certifyServiceId);
if(getCurrentUrl.data.content){
url = getCurrentUrl.data.content;
}else{
url = res.data.url;
}
if (url){
window.GMS.url = url;
const res1 = await getSso({
appId: res.data.id,
location: '',
params:''})
if (res1.data.success){
let num = res1.data.data.lastIndexOf('?');
let urlStr = res1.data.data.substring(num);
const { status, data:data1 } = await axios({
method: 'GET',
url: url + 'nvwa-login-sso/sso/login'+urlStr,
})
if (status === 200) {
if (data1.success) {
window.GMS.token = data1.token;
}
}
}
}
} catch (e) {
console.log(e)
}
},
handleTag(name) {
......
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