dev
e 3 years ago
parent 275fd03c09
commit 4820e0d740
  1. 103
      src/views/order/AddOrder.vue
  2. 16
      src/views/order/Order.vue
  3. 14
      src/views/order/selectClient.vue
  4. 10
      src/views/user/User.vue

@ -9,7 +9,7 @@
<div class="per_title" v-preventReClick @click="goBack()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">订单处理</span>
<span class="per_school">{{ titlesw }}</span>
</div>
<el-button v-if="!viewDisabled" type="primary" round class="mag" v-preventReClick
@click="submitOrder">确定
@ -188,17 +188,15 @@
style="margin-right:10px;"
>删除</el-button>
<el-switch
v-show="!scope.row.ship"
:disabled="scope.row.ship === 1 || viewDisabled"
v-if='dispose || (!editDisabled&&!viewDisabled)'
v-model="scope.row.ship"
:active-value="1"
:inactive-value="0"
:active-text="scope.row.ship ? '发货' : '未发货'"
:active-text="scope.row.ship ? '发货' : '未发货'"
@change="handleDeliver($event,scope.row)">
</el-switch>
<el-button v-if="scope.row.ship && isAdd" type="text" disabled style="margin-right:10px">已发货</el-button>
<el-switch
v-show="scope.row.ship && !isAdd"
v-show="scope.row.ship && !isAdd && !dispose"
:disabled="viewDisabled"
v-model="scope.row.isEnable"
:active-value="1"
@ -327,17 +325,15 @@
style="margin-right:10px;"
>删除</el-button>
<el-switch
v-show="!scope.row.ship"
:disabled="scope.row.ship === 1 || viewDisabled"
v-if='dispose || (!editDisabled&&!viewDisabled)'
v-model="scope.row.ship"
:active-value="1"
:inactive-value="0"
:active-text="scope.row.ship ? '发货' : '未发货'"
:active-text="scope.row.ship ? '发货' : '未发货'"
@change="handleDeliver($event,scope.row)">
</el-switch>
<el-button v-if="scope.row.ship && isAdd" type="text" disabled style="margin-right:10px">已发货</el-button>
<el-switch
v-show="scope.row.ship && !isAdd"
v-show="scope.row.ship && !isAdd && !dispose"
:disabled="viewDisabled"
v-model="scope.row.isEnable"
:active-value="1"
@ -576,9 +572,8 @@ export default {
editDisabled: false,//
renewDisabled: false,//
dataLoading: false,//
whetherSubmit: false,/* 提交否 */
dispose:false,
showSelectClient: false,//
form: {//
// orderNumber: '',//
@ -595,7 +590,6 @@ export default {
},
coursePermissions: [],//
dataPlatformPermissions: [],//
contract: { //
contractName: "", //
contractFile: "", //
@ -606,12 +600,8 @@ export default {
// orderId: '', // id
},
contractTime: [],//
token: "",
orderOther: {//
},
uploadList: [],
rules: {
@ -624,7 +614,6 @@ export default {
orderContact: [
{ required: true, message: "请输入联系人姓名", trigger: "blur" }
],
orderType: [
{ required: true, message: "请选择订单类型", trigger: "change" }
],
@ -644,11 +633,9 @@ export default {
trigger: "blur"
}
],
orderAmount: [
// { pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/, message: ',' }
{ required: true, message: "请输入订单金额", trigger: "blur" }
// { pattern: /(?:^[1-9]([0-9]+)?(?:\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\.[0-9](?:[0-9])?$)/, message: ',', trigger: 'blur'}
]
},
@ -663,8 +650,6 @@ export default {
provinceList: this.$store.state.provinceList,
cityList: [],
schoolList: [],
yearList: [
{ name: "1个月", value: 30 },
{ name: "2个月", value: 60 },
@ -673,7 +658,6 @@ export default {
{ name: "2年", value: 730 },
{ name: "3年", value: 1095 }
],
//
courseVisible: false,
courseTotals: 0,
@ -685,8 +669,6 @@ export default {
0: "理论",
1: "实训"
}, //
ipVisible: false,
IPData: [
{
@ -712,7 +694,6 @@ export default {
],
curArr: "",
test: [],
//
showPlatform: false,//
platfromTotals: 0,//
@ -721,7 +702,7 @@ export default {
platformSelect: [],//
productName: "",//
searchTimer: null,
titlesw:'',
};
},
watch: {
@ -741,28 +722,35 @@ export default {
async created() {
this.token = sessionStorage.getItem("token");
//
if (this.$route.query.isAdd) {
if (this.$route.query.val == 'isAdd') {
this.titlesw = '新建订单'
this.isAdd = true;
this.getCityData();//
}
//
if (this.$route.query.watch) {
if (this.$route.query.val == 'watch') {
this.titlesw = '查看订单'
this.viewDisabled = true;
await this.getDetail(this.$route.query.watch);
await this.getDetail(this.$route.query.orderId);
}
//
if (this.$route.query.edit) {
if (this.$route.query.val == 'edit') {
if(this.$route.query.orderStatus == 0){
this.titlesw = '处理订单'
this.dispose = true;
}else{
this.titlesw = '修改订单'
}
this.editDisabled = true;
await this.getDetail(this.$route.query.edit);
await this.getDetail(this.$route.query.orderId);
}
/* 处于续费状态 */
if (this.$route.query.renew) {
if (this.$route.query.val == 'renew') {
this.titlesw = '订单续费'
this.renewDisabled = true;
await this.getDetail(this.$route.query.renew);
await this.getDetail(this.$route.query.orderId);
}
},
methods: {
//
getDetail(id) {
@ -790,7 +778,6 @@ export default {
}
return e;
});//
if (this.renewDisabled) { //
this.contract = {
contractName: "",
@ -817,7 +804,6 @@ export default {
this.contractTime = [contract.startTime, contract.endTime];
}
}
this.form = {
orderNumber: form.orderNumber,
createTime: form.createTime,
@ -832,11 +818,8 @@ export default {
orderAmount: form.orderAmount,
orderId: form.orderId
};
this.coursePermissions = list.filter(i => i.authority === 1);
this.dataPlatformPermissions = list.filter(i => i.authority === 0);
this.$nextTick(() => {
if(this.form.provinceId){
this.getCityData()
@ -867,7 +850,6 @@ export default {
return this.$message.error("请把课程参数输入完整");
}
}
//
if (this.dataPlatformPermissions.length) {
let dataVerify =
@ -887,7 +869,6 @@ export default {
}
}
}
this.$refs["form"].validate((valid) => {
if (valid) {
let tempArr = [...this.dataPlatformPermissions, ...this.coursePermissions];
@ -913,7 +894,6 @@ export default {
this.$router.back();
}).catch(err => {
this.loading = false;
});
} else {
this.$post(this.api.orderAdd, param).then(res => {
@ -943,14 +923,15 @@ export default {
},
//
backToOrder(val) {
console.log(val)
this.showSelectClient = !this.showSelectClient;
if (val.id) {
this.form.customerName = val.name;
this.form.customerId = val.id;
if (val.customerId) {
this.form.customerName = val.customerName;
this.form.customerId = val.customerId;
this.form.phone = val.phone;
this.form.email = val.email;
this.form.orderContact = val.name;
this.$get(this.api.queryCustomerDetails, { customerId: val.id }).then(res => {
this.$get(this.api.queryCustomerDetails, { customerId: val.customerId }).then(res => {
this.form.provinceId = res.result.customer.provinceId;
this.form.cityId = res.result.customer.cityId;
this.getCityData();
@ -1041,7 +1022,6 @@ export default {
this.courseVisible = false;
this.curriculumName = "";
this.platformSelect = [];
/* 调接口,判断是否为客户已有的课程 */
let params = {
authority: 1,
@ -1153,7 +1133,6 @@ export default {
this.showPlatform = false;
this.productName = "";
this.platformSelect = [];
/* 调接口,判断是否为客户已有的产品功能 */
let params = {
authority: 0,
@ -1232,14 +1211,12 @@ export default {
courseArr.push(+e.finalPrice);
});
let courseTotalPrice = courseArr.reduce((a, b) => a + b, 0);
//
let dataArr = [];
this.dataPlatformPermissions.map(e => {
dataArr.push(+e.totalAmount);
});
let dataTotalPrice = dataArr.reduce((a, b) => a + b, 0);
this.form.orderAmount = courseTotalPrice * 10000 + dataTotalPrice;
},
// --
@ -1274,13 +1251,11 @@ export default {
if (value == 0) return "12";
return value < 10 ? "0" + value : value;
}
let char = "-";
let nowDate = new Date();
let day = nowDate.getDate();
let month = nowDate.getMonth() + 1;
let year = nowDate.getFullYear();
if (this.renewDisabled || row.renew) {/* 处于续费状态 */
if (!e) return row.endTime = "";
let arr = row.startTime.split("-");
@ -1401,7 +1376,6 @@ export default {
this.form.orderAmount = sums;
return sums;
},
//
handleExceed(files, fileList) {
this.$message.warning(
@ -1419,7 +1393,6 @@ export default {
this.$message.error("上传头像图片大小不能超过 10MB!");
}
return str && size;
},
//
uploadSuccess(res, file, fileList) {
@ -1464,71 +1437,55 @@ export default {
<style lang="scss" scoped>
/deep/ .course-input .el-input__inner {
width: 100px;
}
/deep/ .course-input .red .el-input__inner {
border: 1px solid red;
}
/deep/ .small .red .el-input__inner {
border: 1px solid red;
}
/deep/ .small .el-input__inner {
width: 100%;
margin-right: 5px;
}
/deep/ .discountRate .el-input__inner {
width: 85px;
}
/deep/ .contractDate .el-date-editor--daterange.el-input__inner {
width: 100%;
}
.mag {
margin-right: 20px;
}
.uploadTitle {
width: 100%;
height: 40px;
font-size: 16px;
}
.application_input {
width: 250px;
}
.contract .el-upload {
width: 100% !important;
}
.downcol .el-form-item__content {
margin-left: 0 !important;
}
.down {
// margin-top: 60px;
height: 40px;
}
/* 选择IP */
.tab_temp label {
width: 60px;
}
.mar10 {
margin-top: 10px;
}
.radio_icon {
font-size: 26px;
color: #9278FF;
}
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;

@ -228,7 +228,21 @@ export default {
this.$router.push("/addorder?isAdd=true");
},
handle(val, row) {
this.$router.push("/addorder?" + val + "=" + row.orderId);
let orderStatus
if(row.orderStatus == '已完成'){
orderStatus = 1
}else{
orderStatus = 0
}
this.$router.push({
path:'/AddOrder',
query:{
val:val,
orderId:row.orderId,
orderStatus:orderStatus
}
})
// this.$router.push("/addorder?" + val + "=" + row.orderId+"&orderStatus="+orderStatus);
},
//
handleDelete(row) {

@ -141,8 +141,8 @@ export default {
provinceList: [],
cityList: [],
checkedID: "",// ID
checkedName: ""//
checkedName: "",//
data:{},
};
},
created() {
@ -222,13 +222,13 @@ export default {
};
await this.$get(this.api.queryCustomerDetails, { customerId: this.checkedID }).then(res => {
console.log(res, "当前的res");
let data = res.result.customer;
param.email = data.email;
param.phone = data.phone;
param.name = data.customerName;
this.data = res.result.customer;
param.email = this.data.email;
param.phone = this.data.phone;
param.name = this.data.customerName;
});
this.$emit("back", param);
this.$emit("back", this.data);
}
},
initData() {

@ -11,7 +11,7 @@
<div>
<el-form label-width="80px">
<el-row>
<el-col :span="4">
<el-col :span="5">
<!--
<el-form-item label="国家">
<el-select v-model="form.countries" clearable placeholder="请选择国家">
@ -25,7 +25,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="5">
<el-form-item label="城市">
<el-select v-model="form.city" clearable placeholder="请选择城市"
:disabled="form.provinces ? false : true" @clear="clearcity()" @change="initData">
@ -33,7 +33,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="5">
<el-form-item label="来源">
<el-select v-model="form.platformId" clearable placeholder="请选择来源" @change="initData">
<el-option
@ -45,7 +45,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="5">
<el-form-item label="学校">
<el-select v-model="form.schoolId" clearable filterable placeholder="请选择学校" @change="initData">
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
@ -68,7 +68,7 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="自定义">
<el-date-picker
v-model="form.date"

Loading…
Cancel
Save