Commit 7374f700 authored by 黄奎's avatar 黄奎

页面修改

parent 1b3f93c2
......@@ -82,7 +82,8 @@
<p>{{detailsData.SurName + detailsData.Name}}</p>
</div>
<div class="right" v-if="!hiddenMenu">
<el-button class="crm-btn query-btn" @click="editCust">编辑</el-button>
<el-button class="crm-btn query-btn" @click="editCust" v-if="detailsData.IsCreate==1||detailsData.IsRead==1">编辑
</el-button>
<el-dropdown @command="handleCommand" style="top: 1px;" v-if="detailsData.IsCreate==1">
<el-button class="crm-btn crm-btn-more easy-btn margin-right0">
<i class="iconfont icongengduo"></i>
......@@ -121,7 +122,7 @@
<Business v-if="activeName === '5'" :ID="CustomerId" :detailsData="detailsData" />
</el-tab-pane>
<el-tab-pane label="订单" name="6">
<Agreement v-if="activeName === '6'" :ID="CustomerId" :detailsData="detailsData" />
<Agreement v-if="activeName === '6'" :ID="CustomerId" :detailsData="detailsData" />
</el-tab-pane>
<el-tab-pane label="财务单据" name="11">
<finance v-if="activeName === '11'" :ID="CustomerId" />
......
......@@ -16,57 +16,40 @@ import languageUtils from './assets/utils/languageUtils' //引入语言转换帮
import moment from 'moment'
import co from 'co'
import MsgBus from './plugins/event-bus'
import { location } from "./assets/utils/getLocation"
import {
location
} from "./assets/utils/getLocation"
import 'xe-utils'
import vueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import pinyin from 'pinyin'
Vue.prototype.pinyin = pinyin
// import VXETable from 'vxe-table'
// import 'vxe-table/lib/index.css'
// import tinymce from 'tinymce/tinymce'
// import Editor from '@tinymce/tinymce-vue'
// import 'tinymce/themes/silver'
// 使用Vue.use()方法就会调用工具方法中的install方法
Vue.use(htmlToPdf)
Vue.use(VueLazyload)
// Vue.use(VXETable)
Vue.use(vueQuillEditor)
// Vue.use(VueLazyload, {
// preLoad: 1.3,
// error: '../src/assets/img/banner@3x.png',
// loading: '../src/assets/img/loader.gif',
// attempt: 1
// })
Vue.config.productionTip = false
Vue.use(ElementUI)
Vue.use(plug)
Vue.http = Vue.prototype.$http = axios
Vue.commonUtils = Vue.prototype.$commonUtils=commonUtils
Vue.languageUtils=Vue.prototype.$languageUtils=languageUtils
Vue.commonUtils = Vue.prototype.$commonUtils = commonUtils
Vue.languageUtils = Vue.prototype.$languageUtils = languageUtils
Vue.prototype.MsgBus = MsgBus
Vue.prototype.$echarts = echarts
String.prototype.IsPicture = function() {
//判断是否是图片 - strFilter必须是小写列举
var strFilter=".jpeg|.gif|.jpg|.png|.bmp|.pic|"
if(this.indexOf(".")>-1)
{
var p = this.lastIndexOf(".");
//alert(p);
//alert(this.length);
var strPostfix=this.substring(p,this.length) + '|';
strPostfix = strPostfix.toLowerCase();
//alert(strPostfix);
if(strFilter.indexOf(strPostfix)>-1)
{
//alert("True");
return true;
}
}
//alert('False');
return false;
String.prototype.IsPicture = function () {
//判断是否是图片 - strFilter必须是小写列举
var strFilter = ".jpeg|.gif|.jpg|.png|.bmp|.pic|"
if (this.indexOf(".") > -1) {
var p = this.lastIndexOf(".");
var strPostfix = this.substring(p, this.length) + '|';
strPostfix = strPostfix.toLowerCase();
if (strFilter.indexOf(strPostfix) > -1) {
return true;
}
}
return false;
}
router.beforeEach((to, from, next) => {
let msg = {
......@@ -74,16 +57,16 @@ router.beforeEach((to, from, next) => {
query: from.query
}
sessionStorage.setItem("FromPath", JSON.stringify(msg));
if (to.meta.title) {
if(localStorage.g && localStorage.g!='undefined'){
if(JSON.parse(localStorage.g).i!=2)
document.title = to.meta.title.split('-')[0]+'-'+JSON.parse(localStorage.g).n
if (to.meta.title) {
if (localStorage.g && localStorage.g != 'undefined') {
if (JSON.parse(localStorage.g).i != 2)
document.title = to.meta.title.split('-')[0] + '-' + JSON.parse(localStorage.g).n
else
document.title = to.meta.title
}else{
document.title = to.meta.title
document.title = to.meta.title
} else {
document.title = to.meta.title
}
}
}
next()
})
......@@ -95,35 +78,35 @@ Vue.prototype.getLocalStorage = function () {
return null;
}
}
Vue.prototype.getNowDate = function () {
var date = new Date();
var seperator1 = "-";
var seperator2 = ":";
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
+ " " + date.getHours() + seperator2 + date.getMinutes()
+ seperator2 + date.getSeconds();
return currentdate;
Vue.prototype.getNowDate = function () {
var date = new Date();
var seperator1 = "-";
var seperator2 = ":";
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate +
" " + date.getHours() + seperator2 + date.getMinutes() +
seperator2 + date.getSeconds();
return currentdate;
}
Vue.prototype.DateDiff = function (sDate1, sDate2) {
var aDate, oDate1, oDate2, iDays
aDate = sDate1.split("-")
oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
aDate = sDate2.split("-")
oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24) //把相差的毫秒数转换为天数
return iDays
Vue.prototype.DateDiff = function (sDate1, sDate2) {
var aDate, oDate1, oDate2, iDays
aDate = sDate1.split("-")
oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
aDate = sDate2.split("-")
oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) //把相差的毫秒数转换为天数
return iDays
}
//价钱格式化,三位数逗号分隔,保留两位小数 duanjun
//价钱格式化,三位数逗号分隔,保留两位小数 duanjun
Vue.prototype.moneyFormat = function (value) {
if (!value) {
if (!value) {
return 0.00
}
let nStr = Number(value).toFixed(2)
......@@ -137,31 +120,30 @@ Vue.prototype.moneyFormat = function (value) {
}
return x1 + x2;
},
// 注册
Vue.filter('priceFormat', function (value) {
if (value == null) {
return 0.00;
}
let nStr = 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;
})
// 不要小数点
Vue.filter('NoDesnum', function (value) {
// 注册
Vue.filter('priceFormat', function (value) {
if (value == null) {
return 0.00;
}
let nStr = 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;
})
// 不要小数点
Vue.filter('NoDesnum', function (value) {
if (value == null) {
return 0.00;
}
else if(value<1){
} else if (value < 1) {
return value;
}
else{
} else {
let nStr = Number(value).toFixed(0)
nStr += '';
let x = nStr.split('.');
......@@ -173,57 +155,59 @@ Vue.filter('priceFormat', function (value) {
}
return x1 + x2;
}
})
// 时间格式YYYY-MM-DD
Vue.filter("YMD", function (date) {
return moment(date).format("YYYY-MM-DD");
})
Vue.filter("MD", function (date) {
return moment(date).format("MM月DD日");
})
Vue.filter("YMDHMS", function (date) {
return moment(date).format("YYYY-MM-DD HH:mm:ss");
})
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;
},
//上传文件到本地服务器
Vue.prototype.UploadSelfFileT = 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());
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));
}
let that = this;
co(function* () {
return pwd;
},
//上传文件到本地服务器
Vue.prototype.UploadSelfFileT = function (path, files, successCall) {
if (files && files.length > 0) {
let nameList = new Array()
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;
formData.append("myfile", files[index]);
that.$http.post(uploadUrl, formData, {})
.then(res => {
successCall(res);
})
nameList.push(this.random_string());
}
}).catch(function (err) {
console.log("上传文件出错" + err);
});
}
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;
formData.append("myfile", files[index]);
that.$http.post(uploadUrl, formData, {})
.then(res => {
successCall(res);
})
}
}).catch(function (err) {
console.log("上传文件出错" + err);
});
}
}
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
}).$mount('#app')
\ 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