Commit 0686fa40 by qiaoyanqi

凭证中心接口方式修改

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