订单管理部分的逻辑

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

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

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

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

Loading…
Cancel
Save