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

页面修改

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