Commit 18815c9b authored by 黄奎's avatar 黄奎
parents 647d7faa adbc00fe
......@@ -12,6 +12,7 @@
"dependencies": {
"@quasar/extras": "^1.0.0",
"axios": "^0.18.1",
"co": "^4.6.0",
"core-js": "^3.6.5",
"element-ui": "^2.14.1",
"js-md5": "^0.7.3",
......
......@@ -12,7 +12,7 @@ export default {
<style>
@import url('~assets/css/font.css');
@import url('//at.alicdn.com/t/font_2077629_87bihpwi52w.css');
@import url('//at.alicdn.com/t/font_2077629_d4bsno3ee9u.css');
html,
body,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -127,6 +127,31 @@ const routes = [{
component: () =>
import("pages/financial/HistoryRateQuery.vue")
},
{
path: "/financial/Maninfo", //未认款信息
component: () =>
import("pages/financial/Maninfo.vue")
},
{
path: "/financial/Manfunds", //未认款管理
component: () =>
import("pages/financial/Manfunds.vue")
},
{
path: "/financial/HuiChaImport", //汇差批量制单
component: () =>
import("pages/financial/HuiChaImport.vue")
},
{
path: "/financial/CashAccount", //汇差批量制单
component: () =>
import("pages/financial/CashAccount.vue")
},
{
path: "/financial/sellCommissionRules", //提成规则
component: () =>
import("pages/financial/sellCommissionRules.vue")
},
{
path: "/test", //API测试
component: () =>
......
import md5 from 'js-md5'
import co from 'co'
export default{
data:{
......@@ -6,6 +7,65 @@ export default{
apiurl: ''
},
install(Vue, options){
//消息成功提示
Vue.prototype.Success = function (msg) {
this.$message({
message: msg,
duration: 2000,
type: "success"
});
},
//错误提示
Vue.prototype.Error = function (msg) {
this.$message({
message: msg,
duration: 2000,
type: "error"
});
},
//一般提示
Vue.prototype.Info = function (msg) {
this.$message({
message: msg,
duration: 2000,
type: "info"
});
},
//警告提示
Vue.prototype.Warning = function (msg) {
this.$message({
message: msg,
duration: 2000,
type: "warning"
});
},
//Confirm
Vue.prototype.Confirm = function (msg, callback) {
this.$confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
if (typeof callback === 'function') {
callback();
}
})
.catch(() => {
this.Info("已取消操作");
});
},
Vue.prototype.random_string = function (len) {
len = len || 32;
var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
var maxPos = chars.length;
var pwd = '';
for (let i = 0; i < len; i++) {
pwd += chars.charAt(Math.floor(Math.random() * maxPos));
}
return pwd;
},
//ERP本地缓存
Vue.prototype.md5 = md5;
Vue.prototype.getLocalStorage = function () {
......@@ -126,7 +186,83 @@ export default{
successCall(res);
}
}, faildCall)
}
},
Vue.prototype.uploadFile = function (path, files, successCall) {
if (files && files.length > 0) {
let nameList = new Array()
for (let index = 0; index < files.length; index++) {
nameList.push(this.random_string());
}
var oss = new OSS({
region: 'oss-cn-chengdu',
accessKeyId: 'LTAIwE7l9dImZSa3',
accessKeySecret: 'j47Ajn0d0WzUCIX8Biyj3P2r8QDltI',
bucket: 'vt-im-bucket'
})
let that = this;
let checkpoint = null;
let percentage = 0;
co(function* () {
for (let index = 0; index < files.length; index++) {
let fileName = nameList[index]
fileName = "/New" + path + fileName + "." + files[index].name.split('.').pop()
var result = yield oss.multipartUpload(fileName, files[index], {
progress: function* (p) {},
mime: 'application/octet-stream'
})
successCall(result);
}
}).catch(function (err) {
});
}
},
//上传文件到本地服务器
Vue.prototype.UploadSelfFileT = function (path, files, successCall, ocr) {
if (files && files.length > 0) {
let nameList = new Array()
for (let index = 0; index < files.length; index++) {
nameList.push(this.random_string());
}
let that = this;
co(function* () {
for (let index = 0; index < files.length; index++) {
let fileName = nameList[index]
fileName = path + fileName + "." + files[index].name.split('.').pop()
var formData = new FormData();
var uploadUrl = that.domainManager().UploadUrl + "/Upload?filePath=" + path + '&ocr=' + ocr;
formData.append("myfile", files[index]);
that.$http.post(uploadUrl, formData, {})
.then(res => {
successCall(res);
}).catch(function (reason) {
that.$refs['my-upload'].clearFiles();
that.$message.error('上传失败!');
that.MsgBus.$emit('UploadSelfFileErr')
});
}
}).catch(function (err) {
that.$refs['my-upload'].clearFiles();
that.$message.error('上传失败!');
});
}
},
//价钱格式化,三位数逗号分隔,保留两位小数 duanjun
Vue.prototype.moneyFormat = function (value) {
let nStr = Number(value).toFixed(2)
nStr += '';
let x = nStr.split('.');
let x1 = x[0];
let x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}
}
}
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