Commit 281e47bd by 董有沛

销售订单修改

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