Commit 281e47bd by 董有沛

销售订单修改

parent a009a81a
......@@ -2,7 +2,7 @@ import { axios } from '@/utils/request'
const api = {
user: '/api/user',
role: '/api/role',
role: '/api/role',downFilePost,
service: '/api/service',
permission: '/api/permission',
permissionNoPager: '/api/permission/no-pager'
......
......@@ -17,7 +17,7 @@ let addPartner = (params) => postAction(prefix + "/school/partner/addPartner" ,
// 获取县分下拉列表
let getSubstList = (params) => postAction(prefix + "/school/schoolManagement/substList" , params);
// 获取县分下拉列表
// 获取学校下拉列表
let getSchoolList = (params) => postAction(prefix + "/school/schoolManagement/schoolList" , params);
// 获取学子公司职位下级成员列表
......
......@@ -10,10 +10,13 @@ let addActivity = (params) => postAction(prefix + "/activity/addActivity" , para
// 编辑
let updateActivity = (params) => postAction(prefix + "/activity/updateActivity" , params);
//新增
// 删除
let deleteActivity = (params) => postAction(prefix + "/activity/deleteActivity" , params);
// 上传图片
let uploadImg = (params) => postAction(prefix + "/activity/uploadImg" , params);
export {
getList,addActivity,updateActivity,deleteActivity
getList,addActivity,updateActivity,deleteActivity,uploadImg
}
......@@ -486,8 +486,8 @@
this.$message.error( '身份证不合法', 5);
return null;
}
if(this.addForm.password.length != 8){
this.$message.error( '密码长度不对', 5);
if(this.addForm.password.length <= 8){
this.$message.error( '密码长度必须大于8', 5);
return null;
}
if(this.addForm.password != this.addForm.repassword){
......@@ -611,9 +611,9 @@
changeSubst(type){
let schoolParams = {};
if(type == 1){
schoolParams.subName = this.addForm.subName;
schoolParams.substName = this.addForm.subName;
}else{
schoolParams.subName = this.modifyForm.subName;
schoolParams.substName = this.modifyForm.subName;
}
this.schoolList = [];
......@@ -627,7 +627,7 @@
},
changeSchool(schoolId){
let schoolParams = {};
schoolParams.subName = this.modifyForm.subName;
schoolParams.substName = this.modifyForm.subName;
this.schoolList = [];
getSchoolList(schoolParams).then(res => {
......
......@@ -15,8 +15,8 @@
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}" label="活动类型">
<a-select placeholder="请选择" v-model="queryParam.activityType">
<a-select-option key="">请选择</a-select-option>
<a-select-option key="1">个人活动</a-select-option>
<a-select-option key="2">团队活动</a-select-option>
<a-select-option key="个人活动">个人活动</a-select-option>
<a-select-option key="团队活动">团队活动</a-select-option>
</a-select>
</a-form-item>
</a-col>
......@@ -45,9 +45,16 @@
<!--列表-->
<s-table :locale="emptyText" :columns="columns" :data="rowdata" bordered ref="table" size="small" class="flex-filling">
<template slot="imageUrl" slot-scope="text">
<img style="width: 20%" :src="apis + text" @click="imgClick(text)">
</template>
<template slot="operation" slot-scope="text,record">
<a @click="modifyfunction(record)">编辑</a>
<a-divider type="vertical"/>
<a-popconfirm title="是否要删除此行?" @confirm="deleteActivity(record.id)">
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical"/>
</template>
</s-table>
......@@ -62,7 +69,7 @@
<a-input placeholder="活动详情" v-decorator="[ 'desc', {rules: [{ required: true, message: '活动详情不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动积分">
<a-input placeholder="活动积分" v-decorator="[ 'integral', {rules: [{ required: true, message: '活动积分不能为空!' ,whitespace:true}]} ]"></a-input>
<a-input placeholder="活动积分" v-decorator="[ 'integral', {rules: [{ required: false, type:'number', message: '活动积分不能为空!' ,transform:(value)=> {return Number(value)} }]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动类型">
<a-radio-group v-decorator="['activityType', {rules: [{ required: true, message: '活动类型不能为空!'}]} ]">
......@@ -81,18 +88,39 @@
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动封面图片">
<a-upload :beforeUpload="uploadPicture" >
<a-button> <a-icon type="upload" /> 上传图片 </a-button>
</a-upload>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="排序号">
<a-input v-decorator="[ 'sort', {rules: [{ required: true, message: '活动小类不能为空!' ,whitespace:true}]} ]"></a-input>
<a-input v-decorator="[ 'sort', {rules: [{ required: true, type:'number', message: '排序号不能为空!' ,whitespace:true,transform:(value)=> {return Number(value)} }]} ]"></a-input>
</a-form-item>
</a-form>
</a-modal>
<!----弹框-->
<a-drawer
title="活动图片"
placement="right"
:closable="false"
@close="pictureOnClose"
:visible="visiblepicture"
width="30%"
>
<div >
<img class="bg-img" :src="imgInfo">
</div>
</a-drawer>
</div>
</template>
<script>
import STable from '@/components/table';
import {getList,addActivity,updateActivity,deleteActivity} from "@/api/school-center/activityAPI"
import {getList,addActivity,updateActivity,deleteActivity,uploadImg} from "@/api/school-center/activityAPI"
import {cloneObject} from '@/utils/util';
export default {
name: "activity",
......@@ -106,7 +134,7 @@
previewImage: '',
fileList: [
],
apis:'',
fileid:{},
brackgroundurl:"manager/ciop/school/schoolManagement/qrcodeUpload",
// form
......@@ -135,12 +163,15 @@
status: '',
},
modifyvisible: false,
visiblepicture: false,
columns: [
{dataIndex: 'title', width: 200, title: '活动标题', align: "center"},
{dataIndex: 'desc', width: 200, title: '活动详情', align: "center"},
{dataIndex: 'integral', width: 200, title: '活动积分', align: "center"},
{dataIndex: 'imageUrl', title: '图片 ', scopedSlots: {customRender: 'imageUrl'},align: 'center'},
{dataIndex: 'activityType', width: 200, title: '活动类型', align: "center"},
{dataIndex: 'subclass', width: 200, title: '活动小类', align: "center"},
{dataIndex: 'sort', width: 200, title: '排序号', align: "center"},
{dataIndex: 'creator', width: 200, title: '创建人', align: "center"},
{dataIndex: 'createTime', width: 200, title: '创建时间', align: "center"},
{
......@@ -153,6 +184,11 @@
}]
,
rowdata: parameter => {
const env = process.env.NODE_ENV; //获取当前环境
if(env === 'development'){ //测试环境默认添加前缀
this.apis = '/api/';
}
let params = {
pageNo: parameter.pageNo,
pageSize: parameter.pageSize
......@@ -187,67 +223,60 @@
}
},
methods:{
getuuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
},
baseuploadUrl(){
const env = process.env.NODE_ENV; //获取当前环境
let apis = "/";
if(env === 'development'){ //测试环境默认添加前缀
apis = '/api/';
}
return apis
},
uploadUrl(){
return this.baseuploadUrl() + this.brackgroundurl
}
,
//背景图
handleCancel() {
this.previewVisible = false;
},
handlePreview(file) {
this.previewImage = file.url || file.thumbUrl;
this.previewVisible = true;
},
handleChange(obj) {
if (this.fileList.length==2){
this.fileList.splice(0,1)
}else{
this.fileList = obj.fileList;
}
// getuuid() {
// return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
// var r = Math.random() * 16 | 0,
// v = c == 'x' ? r : (r & 0x3 | 0x8);
// return v.toString(16);
// });
// },
// baseuploadUrl(){
// const env = process.env.NODE_ENV; //获取当前环境
// let apis = "/";
// if(env === 'development'){ //测试环境默认添加前缀
// apis = '/api/';
// }
// return apis
// },
// uploadUrl(){
// return this.baseuploadUrl() + this.brackgroundurl
// }
// ,
// //背景图
// handleCancel() {
// this.previewVisible = false;
// },
// handlePreview(file) {
// this.previewImage = file.url || file.thumbUrl;
// this.previewVisible = true;
// },
// handleChange(obj) {
// if (this.fileList.length==2){
// this.fileList.splice(0,1)
// }else{
// this.fileList = obj.fileList;
// }
//
// },
deleteActivity(id){
let params = {};
params.id = id;
},
delet(deletdata){
let status=0;
if(deletdata.status==0){
status=1
}
let parent = {
id: deletdata.id,
status: status
}
hidestatus(parent).then(res=>{
deleteActivity(params).then(res=>{
if (res.state=="success"){
this.$message.success(res.data ? res.data : '修改成功!', 5);
this.$message.success(res.data ? res.data : '删除成功!', 5);
this.search();
return null
}
this.$message.error(res.data ? res.data : '修改失败!', 5);
this.$message.error(res.data ? res.data : '删除失败!', 5);
})
},
chosePagesfunction(data){
this.chosePages=data
},
search() {
this.$refs.table.refresh({search: true})
},
add(){
this.titleName="添加"
this.modifyForm.id = '';
setTimeout(()=>{
this.Formtable.setFieldsValue({
id: '',
......@@ -258,7 +287,7 @@
subclass: '',
imageUrl: '',
range: '',
sort: '',
sort: '666',
})
},0)
this.modifyvisible=true;
......@@ -266,52 +295,21 @@
modifyfunction(data){
//初始化
this.titleName="编辑"
let choosepagespare={
id:data.id
}
this.fileid={
id:data.id
}
// let url=this.baseuploadUrl()+"manager/"+data.serviceQrcode.replace("enclosure","ciop")
// if (!(data.serviceQrcode == null || data.serviceQrcode=="")) {
// //下载图片浏览
// this.fileList.push({
// uid: this.getuuid(),
// name: '找不到图片',
// status: 'done',
// url: url,
// })
// }
// this.modifyForm.id=data.id
// //查询中间表
// choosepages(choosepagespare).then(res=>{
// if (res.state == 'success'){
// let d= res.data.choosepages
// for (let i = 0; i <d.length ; i++) {
// this.chosePages.push(d[i])
// }
// }
// })
// let showband="0"
// if (data.isShowband=="1"){
// showband=data.isShowband
// }
// let isShowrh="0"
// if (data.isShowrh=="1"){
// isShowrh=data.isShowrh
// }
this.modifyForm.id = data.id
setTimeout(()=>{
this.Formtable.setFieldsValue({
title: data.title,
desc: data.title,
integral: data.title,
activityType: data.title,
subclass: data.title,
imageUrl: data.title,
range: data.title,
sort:"",
desc: data.desc,
integral: data.integral,
activityType: data.activityType,
subclass: data.subclass,
imageUrl: data.imgageUrl,
range: data.range,
sort:data.sort,
})
},0)
this.customimg="./img/custom"+data.serviceQrcode
this.modifyvisible=true;
},
......@@ -381,7 +379,59 @@
this.modifyForm.chosePages=""
this.chosePages.splice(0,this.chosePages.length)
this.modifyvisible=false;
}
},
uploadPicture(file) {
let fileSize = file.size/1024/1024
console.log(fileSize)
if(fileSize > this.pictureSize){
this.$message.error('上传失败!图片大小不能超过'+this.pictureSize+'M',5);
return new Promise(resolve => {
console.log(resolve);
})
}else {
return new Promise(resolve => {
console.log(resolve);
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => {
const img = document.createElement('img');
img.src = reader.result;
img.onload = () => {
const limitWidth = arguments[2] ? arguments[2] : 640;
const width = img.width > limitWidth ? limitWidth : img.width;
const height = img.width > limitWidth ? parseInt((img.height * limitWidth) / img.width) : img.height;
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
canvas.width = width
canvas.height = height
ctx.fillStyle = '#fff'
ctx.fillRect(0,0,canvas.width,canvas.height)
ctx.drawImage(img,0,0,width,height)
const picture = canvas.toDataURL('image/jpeg')
console.log(picture.length)
return uploadImg({picture}).then(res => {
if(res == 'error'){
this.$message.error('上传失败!',5);
}
if(res.state == 'success'){
this.modifyForm.imageUrl = res.data;
this.$message.success('上传成功',5);
}
})
};
};
});
}
},
imgClick(res){
this.imgInfo=this.apis + res
this.visiblepicture=true
},
pictureOnClose() {
this.imgInfo=''
this.visiblepicture = false;
},
}
}
</script>
......
......@@ -363,6 +363,8 @@
netPhone:"0",
isShowrh:"0",
isRecv:"0",
networkCode: '',
networkName: '',
})
},0)
this.modifyvisible=true;
......@@ -415,6 +417,8 @@
netPhone:new String(data.netPhone).toString(),
isShowrh:isShowrh,
isRecv:new String(data.isRecv).toString(),
networkName: data.networkName,
networkCode: data.networkCode
})
},0)
this.customimg="./img/custom"+data.serviceQrcode
......
......@@ -7,7 +7,7 @@
<a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-form-item label="时间选择:">
<a-range-picker @change="onChange" />
<a-range-picker @change="onChange" format="YYYY-MM" />
</a-form-item>
</a-col>
<a-col :md="4" :sm="12">
......@@ -766,11 +766,11 @@ export default {
//时间事件
onChange(date, dateString) {
if (dateString.length == 0) {
this.queryParam.startTime = "";
this.queryParam.endTime = "";
this.queryParam.createTimeStart = "";
this.queryParam.createTimeEnd = "";
} else {
this.queryParam.startTime = dateString[0];
this.queryParam.endTime = dateString[1];
this.queryParam.createTimeStart = dateString[0];
this.queryParam.createTimeEnd = dateString[1];
}
},
handleSubmit() {
......
......@@ -43,8 +43,8 @@
<span class="table-page-search-submitButtons" style="float: left; overflow: hidden;">
<a-col :md="4" :sm="24">
<a-button @click="search()" type="primary">查询</a-button>
<a-button v-show="!callback" @click="handleSubmit" style="margin-left: 10px">导出</a-button>
<a-button v-show="callback" style="margin-left: 10px">导出中<a-spin style="margin-left: 5px" size="small"/></a-button>
<a-button v-show="!callback" @click="handleSubmit" style="margin-left: 10px">导出</a-button>
<a-button v-show="callback" style="margin-left: 10px">导出中<a-spin style="margin-left: 5px" size="small"/></a-button>
</a-col>
</span>
......
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