订单管理部分的逻辑

dev
e 3 years ago
parent 2db626b9e0
commit a7cfb4c912
  1. 2
      src/views/Login.vue
  2. 289
      src/views/order/AddOrder.vue
  3. 14
      src/views/order/selectClient.vue

@ -50,7 +50,7 @@ export default {
data: function() {
return {
param: {
account: '0621Stu',
account: 'test',
password: '111aaa',
code:'',
platform:3,

@ -27,7 +27,7 @@
<el-form-item label="订单编号">
<el-input v-model="form.orderNumber" disabled placeholder="自动生成"></el-input>
</el-form-item>
<el-form-item label="订单时间" required>
<el-form-item label="订单时间" prop="createTime" required>
<el-date-picker
style="width:100%"
v-model="form.createTime"
@ -69,7 +69,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="电话" required>
<el-form-item label="电话" prop="phone" required>
<el-input v-model="form.phone" placeholder="请输入电话号码" maxlength="11"></el-input>
</el-form-item>
<el-form-item label="订单金额" prop="orderAmount">
@ -88,7 +88,7 @@
<p class="addhr_tag"></p>
<span>课程权限</span>
</div>
<el-button type="primary" size="small" round class="mag" @click="getConfig()">添加</el-button>
<el-button type="primary" size="small" round class="mag" @click="addClassJurisdiction()">添加</el-button>
</div>
<el-table :data="jurisdictionData" class="orderTable" stripe header-align="center" show-summary :summary-method="getSummaries">
@ -268,8 +268,8 @@
</div>
<div>
<el-form ref="contractInformation" :model="contractInformation" :rules="rules" label-width="80px" class="flex-start">
<el-col :span="6" :offset="5">
<el-form ref="contractInformation" :model="contractInformation" :rules="rules" label-width="80px" >
<el-col :span="8" :offset="4">
<el-form-item label="合同名称">
<el-input v-model="contractInformation.contractInformationName" placeholder="请输入合同名称"></el-input>
</el-form-item>
@ -281,11 +281,17 @@
</el-col>
<el-col :span="6" :offset="2">
<el-col :span="8" :offset="2">
<el-form-item label="合同编号">
<el-input v-model="contractInformation.contractInformationNumber" placeholder="请输入合同编号"></el-input>
</el-form-item>
<el-form-item label="合同编号">
<el-input v-model="contractInformation.contractInformationNumber" placeholder="请输入合同编号"></el-input>
</el-form-item>
</el-col>
<el-col :span="4" :offset="4" class="flex-start">
<el-form-item label="上传合同">
<el-upload
class="contract"
@ -301,13 +307,9 @@
>
<el-button size="medium" type="plain" class="uploadTitle">上传</el-button>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="2" class="downcol">
<el-form-item>
<el-button size="medium" type="plain" class="down" @click="downLoad()">下载</el-button>
<el-button size="medium" type="plain" style="height:40px" @click="downLoad()">重新上传</el-button>
</el-form-item>
</el-col>
</el-form>
@ -317,8 +319,8 @@
</el-col>
</el-row>
<!-- 添加应用 -->
<el-dialog :visible.sync="curVisible" width="50%" center>
<!-- 添加课程权限弹框-->
<el-dialog :visible.sync="classVisible" width="50%" center>
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
@ -349,11 +351,48 @@
</el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="curVisible = false"> </el-button>
<el-button @click="classVisible = false"> </el-button>
<el-button type="primary" v-preventReClick @click="addSystem()"> </el-button>
</span>
</el-dialog>
<!-- 添加平台权限弹框 -->
<el-dialog :visible.sync="showPlatform" width="50%" center>
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>数据产品列表</span>
</div>
<div>
<el-input placeholder="请输入课程名称" prefix-icon="el-icon-search" v-model="configSearch" @keyup.enter.native="onSearch" clearable></el-input>
</div>
</div>
<el-table :data="permissionData" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="courseName" label="课程名称" align="center">
</el-table-column>
<el-table-column prop="courseType" label="课程类型" align="center">
</el-table-column>
<el-table-column label="配置的实训应用" align="center">
<template slot-scope="scope">
<span class="ellipsis">{{scope.row.systemName}}</span>
</template>
</el-table-column>
<el-table-column prop="courseHours" label="预计课时" align="center">
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="showPlatform = false"> </el-button>
<el-button type="primary" v-preventReClick @click="addPlatform()"> </el-button>
</span>
</el-dialog>
<!-- 选择IP -->
<el-dialog :visible.sync="ipVisible" width="70%" center>
<div class="flex-center mgb20">
@ -421,7 +460,7 @@ export default {
showSelectClient:false,//
token: this.$store.state.loginToken,
form: {
form: {//
orderNumber: '',
orderDate: '',
provinceId: '',
@ -435,55 +474,45 @@ export default {
orderId: this.$store.state.orderId,
customerName:''
},
contractInformation: {
contractInformation: {//
contractInformationName: '',
contractInformationNumber: '',
contractInformationSum: '',
contractInformationLink: '',
contractInformationId: '',
orderId: ''
},
orderOther:{//
},
uploadList: [],
rules: {
orderNumber: [
{ required: true, message: '请输入订单编号', trigger: 'blur' }
],
orderAmount: [
{ required: true, message: '请输入课程成交价计算订单金额', trigger: 'blur' }
],
customerName: [
{ required: true, message: '请选择订单客户', trigger: 'blur' }
],
provinceId: [
{ required: true, message: '请选择省份', trigger: 'change' }
],
cityId: [
{ required: true, message: '请选择城市', trigger: 'change' }
orderContact: [
{ required: true, message: '请输入联系人姓名', trigger: 'blur' }
],
customerId: [
{ required: true, message: '请选择客户名称', trigger: 'change' }
createTime: [
{ required: true, message: '请选择订单时间', trigger: 'change' }
],
orderType: [
{ required: true, message: '请选择订单类型', trigger: 'change' }
],
// phone: [
// { required: true, message: '', trigger: 'blur' },
// {
// pattern: /^1[3456789]\d{9}$/,
// message: '',
// trigger: 'blur'
// }
// ],
// contractInformationName: [
// { required: true, message: '', trigger: 'blur' }
// ],
contractInformationSum: [
// { required: true, message: '', trigger: 'blur' },
{ pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/, message: '请输入正确金额格式,可保留两位小数' }
phone: [
{ required: true, message: '请选择客户获取手机号', trigger: 'blur' },
{
pattern: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/,
message: '请输入正确的手机号',
trigger: 'blur'
}
],
transactionPrice: [
{ required: true, message: '请输入成交价', trigger: 'blur' },
{ pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/, message: '请输入正确金额格式,可保留两位小数' }
orderAmount: [
// { pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/, message: ',' }
{ pattern: /(?:^[1-9]([0-9]+)?(?:\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\.[0-9](?:[0-9])?$)/, message: '请输入正确金额格式,可保留两位小数' }
],
},
orderTypeList: [{
@ -521,7 +550,7 @@ export default {
}
],// data
permissionData: [],
curVisible: false,
classVisible: false,
configSearch: '',
yearList: [{
name: '1个月',
@ -654,12 +683,10 @@ export default {
//
gotoClient(){
//
console.log('下拉框触发A');
this.showSelectClient = !this.showSelectClient
},
//
backToOrder(val){
console.log(val,'接受传值');
this.showSelectClient = !this.showSelectClient
if(val.id){
this.form.customerName = val.name
@ -672,6 +699,29 @@ export default {
this.$forceUpdate()
}
},
//
addOrder(){
let param = {
contractInformation:{},//
order:{},//
orderOther:{}//
}
this.$post(this.api.orderAdd,param).then(res=>{
console.log(res,'新增订单');
})
},
//
addClassJurisdiction(){
this.classVisible = !this.classVisible
},
//
addDataJurisdiction(){
},
//
clearprovince(){
this.form.cityId = '',
@ -732,64 +782,65 @@ export default {
}).catch(res => {});
},
async saveOrder() {
try {
await Promise.all([
this.$refs.form.validate(),
this.$refs.contractInformation.validate()
]);
if(this.jurisdictionData.length == 0){
this.$message.error('请添加课程配置!');
}else{
function findCherries(fruit) {
return fruit.transactionPrice === '';
}
if(this.jurisdictionData.find(findCherries)){
this.$message.error('请先填写成交价!');
}else{
let data = {
order: this.form,
coursePermissionss: this.jurisdictionData,
contractInformation: this.contractInformation
}
if(this.form.orderId){
this.$post(this.api.updateOrder,data).then((res) => {
this.$message.success('编辑成功');
this.goback()
}).catch((res) => {})
} else {
this.$post(this.api.addOrder,data).then((res) => {
this.$message.success('添加成功');
this.goback()
}).catch((res) => {})
}
}
}
} catch (error) {
return;
}
},
//
getConfig(rows){
this.multipleSelection = []
let data = {
courseId: this.curArr,
searchContent: this.configSearch,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
this.$get(this.api.queryCourseList,data).then(res => {
res.message.rows.forEach(e => {
e.courseType = this.courseTypeStatus(e.courseType)
e.courseHours = this.hoursStatus(e.courseHours)
})
this.permissionData = res.message.rows
this.totals = res.message.total
this.curVisible = true
}).catch(res => {});
},
onSearch(){
this.getConfig()
// try {
// await Promise.all([
// this.$refs.form.validate(),
// this.$refs.contractInformation.validate()
// ]);
// if(this.jurisdictionData.length == 0){
// this.$message.error('');
// }else{
// function findCherries(fruit) {
// return fruit.transactionPrice === '';
// }
// if(this.jurisdictionData.find(findCherries)){
// this.$message.error('');
// }else{
// let data = {
// order: this.form,
// coursePermissionss: this.jurisdictionData,
// contractInformation: this.contractInformation
// }
// if(this.form.orderId){
// this.$post(this.api.updateOrder,data).then((res) => {
// this.$message.success('');
// this.goback()
// }).catch((res) => {})
// } else {
// this.$post(this.api.addOrder,data).then((res) => {
// this.$message.success('');
// this.goback()
// }).catch((res) => {})
// }
// }
// }
// } catch (error) {
// return;
// }
},
// //
// getConfig(rows){
// this.multipleSelection = []
// let data = {
// courseId: this.curArr,
// searchContent: this.configSearch,
// pageNo: this.pageNo,
// pageSize: this.pageSize,
// }
// this.$get(this.api.queryCourseList,data).then(res => {
// res.message.rows.forEach(e => {
// e.courseType = this.courseTypeStatus(e.courseType)
// e.courseHours = this.hoursStatus(e.courseHours)
// })
// this.permissionData = res.message.rows
// this.totals = res.message.total
// this.classVisible = true
// }).catch(res => {});
// },
// onSearch(){
// this.getConfig()
// },
getRowKeys(row) {
return row.courseId;
},
@ -797,20 +848,20 @@ export default {
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
addSystem() {
this.curVisible = false
let arr = this.multipleSelection
let result = arr.map(e => e.courseId).join()
this.curArr = this.curArr.concat(`,${result}`)
if (this.curArr.substr(0,1)==','){
this.curArr = this.curArr.substr(1);
}
let data = {
courseId: result,
}
this.getPermissions(data)
},
// //
// addSystem() {
// this.classVisible = false
// let arr = this.multipleSelection
// let result = arr.map(e => e.courseId).join()
// this.curArr = this.curArr.concat(`,${result}`)
// if (this.curArr.substr(0,1)==','){
// this.curArr = this.curArr.substr(1);
// }
// let data = {
// courseId: result,
// }
// this.getPermissions(data)
// },
handleCurrentChange(val) {
this.pageNo = val;
this.getConfig();
@ -818,7 +869,7 @@ export default {
//
getPermissions(val){
this.$get(this.api.queryCoursePermissions,val).then(res => {
this.curVisible = false
this.classVisible = false
var arritem = {
usePeriod: 30,
transactionPrice: '',
@ -977,7 +1028,7 @@ export default {
margin-left: 0!important;
}
.down{
margin-top: 60px;
// margin-top: 60px;
height: 40px;
}
/* 选择IP */

@ -4,12 +4,12 @@
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="goback()">
<div class="per_title" v-preventReClick @click="goback('back')">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">选择客户</span>
</div>
<el-button type="primary" size="small" round class="mag" v-preventReClick @click="goback">确定</el-button>
<el-button type="primary" size="small" round class="mag" v-preventReClick @click="goback()">确定</el-button>
</div>
</el-card>
</el-col>
@ -183,9 +183,15 @@ export default {
this.cityList = res.list
}).catch(res => {})
},
goback(){
console.log('确定选择');
goback(val){
if(val){
this.$emit('back',{show:true})
}else{
if(!this.checkedName){
return this.$message('请选择客户后再确定!')
}
this.$emit('back',{show:true,id:this.checkedID,name:this.checkedName})
}
},
initData(){
this.page = 1

Loading…
Cancel
Save