Commit 1dbd5f81 authored by zhengke's avatar zhengke

修改

parent ab10abb4
......@@ -406,7 +406,7 @@ export default {
Commission: [
{ required: true, message: this.$t('rule.qsrptsxufei'), trigger: "blur" },
{
pattern: this.$commonUtils.Regex.el_IsdecimalTrr,
pattern: /^\d+(\.\d{0,8})?$/,
message: this.$t('rule.qsrzqxufei')
}
],
......@@ -419,7 +419,7 @@ export default {
Initialbalance: [
{ required: true, message: this.$t('rule.qsrcsyue'), trigger: "blur" },
{
pattern: this.$commonUtils.Regex.el_IsInventer,
pattern: /^(\-|\+?)\d+(\.\d+)?$/,
message: this.$t('rule.qsrzqdyue')
}
],
......@@ -1167,6 +1167,26 @@ export default {
},
InitTime() {
},
calcPageSize(itemHeight){
let yuHeight = itemHeight
try {
let obj = null
document.querySelectorAll('.frame-box').forEach(x => {
if (x.style.display != 'none') {
obj = x
}
})
let dom = obj.offsetHeight
yuHeight = dom - (obj.querySelector('.v-table-header') ? obj.querySelector('.v-table-header').offsetHeight : 39) - 50 //减去面包屑,减去表格头部,减去分页,减去偏量
//减去其它同级元素
obj.childNodes[0].childNodes.forEach(x => {
if (x.className && x.className.indexOf('v-table-views') == -1) {
yuHeight -= x.offsetHeight ? x.offsetHeight : 0
}
})
} catch (error) {}
return Math.floor(yuHeight / itemHeight)
}
},
mounted() {
......
......@@ -466,4 +466,55 @@ export function downloadFileWithBuffer(data, name, type) {
downloadElement.click() // 点击下载
document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象
}
//ERP本地缓存
export function getLocalStorage(){
var localStorageData = window.localStorage["userInfo"];
if (localStorageData !== undefined && localStorageData != 'undefined') {
return JSON.parse(localStorageData);
} else {
return null;
}
}
export function apipost(cmd, msg, successCall, faildCall, isOnline){
var timestamp = (new Date()).valueOf();
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var token = "";
var key = "";
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
}
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
var postData = {
"msg": msg,
"cmd": cmd,
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"languageId": tempLanguage
}
// return reuest({
// method:'post',
// })
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
} else if (res.resultCode == 10005) {
} else {
successCall(res);
}
}, faildCall)
}
\ No newline at end of file
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