Commit 6030efcb authored by 黄奎's avatar 黄奎

页面修改

parent c5024339
......@@ -94,9 +94,9 @@
</div>
<div class="row wrap">
<div class="col-6">
<q-select filled stack-label option-value="Id" disable option-label="SubjectName" v-model="objOption.CourseSubject"
ref="CourseSubject" :options="courseSubjectList" label="所属科目" class="col-6 q-pr-lg q-pb-lg" emit-value
map-options />
<q-select filled stack-label option-value="Id" disable option-label="SubjectName"
v-model="objOption.CourseSubject" ref="CourseSubject" :options="courseSubjectList" label="所属科目"
class="col-6 q-pr-lg q-pb-lg" emit-value map-options />
</div>
<div class="col-6">
<q-select filled stack-label option-value="Id" option-label="Name" v-model="objOption.CourseRate"
......@@ -106,22 +106,15 @@
</div>
<div class="row wrap">
<div class="col-6">
<q-select filled stack-label option-value="Id" option-label="Name" v-model="CourseEmphasis" multiple use-chips
ref="CourseEmphasis" :options="keynoteList" label="课程重点" class="col-6 q-pr-lg q-pb-lg" emit-value
map-options />
<q-select filled stack-label option-value="Id" option-label="Name" v-model="CourseEmphasis" multiple
use-chips ref="CourseEmphasis" :options="keynoteList" label="课程重点" class="col-6 q-pr-lg q-pb-lg"
emit-value map-options />
</div>
<div class="col-6 q-pb-lg q-pr-lg">
<q-uploader :style="{ backgroundImage: 'url(' + objOption.B2BIcon + ')' }"
style="width: auto; " flat hide-upload-btn max-files="1" label="图标" accept=".jpg, image/*"
:factory="uploadFile2" auto-upload>
<q-uploader :style="{ backgroundImage: 'url(' + objOption.B2BIcon + ')' }" style="width: auto; " flat
hide-upload-btn max-files="1" label="图标" accept=".jpg, image/*" :factory="uploadFile2" auto-upload>
</q-uploader>
<q-input
filled
label="背景颜色"
v-model="objOption.B2BBackground"
:rules="['anyColor']"
class="my-input"
>
<q-input filled label="背景颜色" v-model="objOption.B2BBackground" :rules="['anyColor']" class="my-input">
<template v-slot:append>
<q-icon name="colorize" class="cursor-pointer">
<q-popup-proxy transition-show="scale" transition-hide="scale">
......@@ -130,7 +123,8 @@
</q-icon>
</template>
</q-input>
<img id="background" :src="objOption.B2BIcon" height="100" width="100" crossorigin="anonymous" style="display:none"/>
<img id="background" :src="objOption.B2BIcon" height="100" width="100" crossorigin="anonymous"
style="display:none" />
</div>
</div>
<div class="text-caption q-my-md q-px-xs text-grey-6">课程介绍</div>
......@@ -221,11 +215,11 @@
CategoryList: [],
CourseRate: "", //课程等级
CourseSubject: "", //课程科目
B2BIcon:'',//图标
B2BBackground:'',//背景
CourseEmphasis:[],//课程重点 多选 英文逗号分隔
B2BIcon: '', //图标
B2BBackground: '', //背景
CourseEmphasis: [], //课程重点 多选 英文逗号分隔
},
CourseEmphasis:[],//数据临时存放
CourseEmphasis: [], //数据临时存放
optionTitle: "",
defaultArray: [],
ladderPriceList: [], //阶梯定价数组
......@@ -241,7 +235,7 @@
modifyClassifyList: [], //修改时返回的分类列表
courseLevelList: [], //课程等级列表
courseSubjectList: [], //课程科目列表
keynoteList:[],//重点枚举列表
keynoteList: [], //重点枚举列表
};
},
created() {
......@@ -249,7 +243,7 @@
this.getSaleplat();
this.getGoodsClassify();
this.getCourseRateList();
this.getCourseEmphasisList();//获取课程重点枚举列表
this.getCourseEmphasisList(); //获取课程重点枚举列表
this.initObj();
},
......@@ -272,8 +266,7 @@
return false;
},
}),
mounted() {
},
mounted() {},
methods: {
//根据系列改变获取所属科目
getCourseSubject(Id) {
......@@ -303,11 +296,11 @@
}
})
},
getCourseEmphasisList(){
getCourseEmphasisList() {
getCourseEmphasisEnumList({}).then((res) => {
if (res.Code == 1) {
this.keynoteList = res.Data;
this.keynoteList.map((x)=>{
this.keynoteList.map((x) => {
this.CourseEmphasis.push(x.Id)
})
}
......@@ -345,7 +338,7 @@
}
});
},
uploadFile2(files){
uploadFile2(files) {
UploadSelfFile("course", files[0], (res) => {
if (res.Code == 1) {
this.objOption.B2BIcon = res.FileUrl;
......@@ -353,47 +346,42 @@
}
});
},
ImgColor() {//获取图标上传的主色
ImgColor() { //获取图标上传的主色
let domImg = document.querySelector('#background');
let colorthief = new ColorThief();
domImg.addEventListener('load', () => {
// console.log('加载好了并取色', colorthief.getPalette(domImg,2));//第二个参数可选(1~10)
// console.log('加载好了并取色', colorthief.getColor(domImg));//第二个参数可选(1~10)
let color = colorthief.getColor(domImg,2)
this.objOption.B2BBackground = this.rgb2Hex( `RGB(${color[0]}, ${color[1]}, ${color[2]})` )
console.log(this.objOption.B2BBackground)
let color = colorthief.getColor(domImg, 2)
this.objOption.B2BBackground = this.rgb2Hex(`RGB(${color[0]}, ${color[1]}, ${color[2]})`)
})
},
rgb2Hex(string){//rgb转化为16进制
console.log(string)
rgb2Hex(string) { //rgb转化为16进制
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if(/^(rgb|RGB)/.test(string)){
var aColor = string.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",");
if (/^(rgb|RGB)/.test(string)) {
var aColor = string.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
var strHex = "#";
for(var i=0; i<aColor.length; i++){
for (var i = 0; i < aColor.length; i++) {
var hex = Number(aColor[i]).toString(16);
if(hex === "0"){
if (hex === "0") {
hex += hex;
}
strHex += hex;
}
if(strHex.length !== 7){
if (strHex.length !== 7) {
strHex = string;
}
return strHex;
}else if(reg.test(string)){
var aNum = string.replace(/#/,"").split("");
if(aNum.length === 6){
} else if (reg.test(string)) {
var aNum = string.replace(/#/, "").split("");
if (aNum.length === 6) {
return string;
}else if(aNum.length === 3){
} else if (aNum.length === 3) {
var numHex = "#";
for(var i=0; i<aNum.length; i+=1){
numHex += (aNum[i]+aNum[i]);
for (var i = 0; i < aNum.length; i += 1) {
numHex += (aNum[i] + aNum[i]);
}
return numHex;
}
}else{
} else {
return string;
}
......@@ -456,19 +444,19 @@
this.objOption.IsKCourse = res.Data.IsKCourse;
this.objOption.CourseRate = res.Data.CourseRate;
this.objOption.CourseSubject = res.Data.CourseSubject;
this.objOption.B2BIcon = res.Data.B2BIcon ;
this.objOption.B2BIcon = res.Data.B2BIcon;
this.objOption.B2BBackground = res.Data.B2BBackground;
this.CourseEmphasis=[]
setTimeout(()=>{//Todo 暂时不知道什么原因 偶尔会出现2个 所以加了一个延迟
if(res.Data.CourseEmphasis && res.Data.CourseEmphasis!=''){
this.CourseEmphasis=res.Data.CourseEmphasis.split(",").map(Number)
this.CourseEmphasis = []
setTimeout(() => { //Todo 暂时不知道什么原因 偶尔会出现2个 所以加了一个延迟
if (res.Data.CourseEmphasis && res.Data.CourseEmphasis != '') {
this.CourseEmphasis = res.Data.CourseEmphasis.split(",").map(Number)
}else{
this.keynoteList.map((x)=>{
} else {
this.keynoteList.map((x) => {
this.CourseEmphasis.push(x.Id)
})
}
},100)
}, 100)
if (res.Data.StepPriceList && res.Data.StepPriceList.length > 0) {
this.ladderPriceList = res.Data.StepPriceList;
......@@ -550,10 +538,10 @@
this.objOption.StepPriceList = this.ladderPriceList;
this.objOption.Teacher_Ids = Teacher_Ids;
this.objOption.Saleplat = salePlat;
if(this.CourseEmphasis.length>0){
if (this.CourseEmphasis.length > 0) {
this.objOption.CourseEmphasis = this.CourseEmphasis.join(',')
}else{
this.objOption.CourseEmphasis =''
} else {
this.objOption.CourseEmphasis = ''
}
saveCourseInfo(this.objOption)
.then((res) => {
......@@ -641,5 +629,4 @@
},
},
};
</script>
\ No newline at end of file
......@@ -81,7 +81,14 @@
},
data() {
return {
columns: [{
columns: [
{
name: 'CustomerId',
label: '客户编号',
field: 'CustomerId',
align: 'left'
},
{
name: 'CustomerName',
label: '姓名',
field: 'CustomerName',
......
......@@ -205,7 +205,6 @@
CustomerId: this.customerObj.CustomerId
}).then(res => {
var tempData = res.Data;
console.log("tempData", tempData);
this.objOption = tempData;
this.AuditMsg.CustomerId = tempData.CustomerId;
this.AuditMsg.ApproveState = tempData.ApproveState;
......
......@@ -158,7 +158,6 @@
//获取国家列表
getCountryList() {
queryCountryList({}).then(res => {
console.log("res", res);
if (res.Code == 1) {
this.CountryList=res.Data;
}
......
......@@ -3,7 +3,7 @@
<div class="page-search row items-center">
<div class="col row wrap q-col-gutter-md">
<div class="col-3">
<q-input @input="resetSearch" clearable filled v-model="msg.TaskName" label="任务名称" />
<q-input @input="resetSearch" clearable filled v-model="msg.Description" label="关键字" />
</div>
</div>
</div>
......@@ -82,9 +82,9 @@
align: 'left',
},
{
name: 'UpdateTime',
name: 'UpdateTimeStr',
label: '更新时间',
field: 'UpdateTime',
field: 'UpdateTimeStr',
align: 'left',
},
],
......@@ -96,6 +96,7 @@
pageSize: 12,
rowsPerPage: 12,
RebateType: 1,
Description:"",
},
pageCount: 0,
taskOption: null,
......@@ -104,7 +105,7 @@
},
created() {
if (this.$route.query && this.$route.query.CustomerId) {
//this.msg.CustomerId = this.$route.query.CustomerId
this.msg.CustomerId = this.$route.query.CustomerId
}
},
mounted() {
......@@ -128,7 +129,6 @@
getList() {
this.loading = true;
GetCustomerBalanceDetailPage(this.msg).then(res => {
console.log(res, '数据');
this.loading = false;
if (res.Code == 1) {
this.dataList = res.Data.PageData;
......
......@@ -3,7 +3,7 @@
<div class="page-search row items-center">
<div class="col row wrap q-col-gutter-md">
<div class="col-3">
<q-input @input="resetSearch" clearable filled v-model="msg.TaskName" label="任务名称" />
<q-input @input="resetSearch" clearable filled v-model="msg.Description" label="关键字" />
</div>
</div>
</div>
......@@ -81,9 +81,9 @@
align: 'left',
},
{
name: 'UpdateTime',
name: 'UpdateTimeStr',
label: '更新时间',
field: 'UpdateTime',
field: 'UpdateTimeStr',
align: 'left',
},
],
......@@ -95,6 +95,7 @@
pageSize: 12,
rowsPerPage: 12,
RebateType: 2,
Description:"",
},
pageCount: 0,
taskOption: null,
......@@ -103,7 +104,7 @@
},
created() {
if (this.$route.query && this.$route.query.CustomerId) {
//this.msg.CustomerId = this.$route.query.CustomerId
this.msg.CustomerId = this.$route.query.CustomerId
}
},
mounted() {
......@@ -128,7 +129,6 @@
getList() {
this.loading = true;
GetCustomerBalanceDetailPage(this.msg).then(res => {
console.log(res, '数据');
this.loading = false;
if (res.Code == 1) {
this.dataList = res.Data.PageData;
......
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