@@ -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 */
diff --git a/src/views/order/selectClient.vue b/src/views/order/selectClient.vue
index c54f313..7bd6e6d 100644
--- a/src/views/order/selectClient.vue
+++ b/src/views/order/selectClient.vue
@@ -4,12 +4,12 @@
-
@@ -183,9 +183,15 @@ export default {
this.cityList = res.list
}).catch(res => {})
},
- goback(){
- console.log('确定选择');
- this.$emit('back',{show:true,id:this.checkedID,name:this.checkedName})
+ 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