修复订单管理bug

dev
yujialong 3 years ago
parent bcba973009
commit 29180b5c69
  1. 127
      src/views/order/AddOrder.vue
  2. 2
      src/views/order/Order.vue

@ -11,7 +11,7 @@
<span class="per_back">返回</span>
<span class="per_school">订单处理</span>
</div>
<el-button v-if="!disabled" type="primary" round class="mag" v-preventReClick
<el-button v-if="!viewDisabled" type="primary" round class="mag" v-preventReClick
@click="submitOrder">确定
</el-button>
</div>
@ -57,15 +57,15 @@
<el-col :span="6" :offset="2">
<el-form-item prop="customerName" label="订单客户">
<div v-if="!disabled&&!editDisabled&&!renewDisabled" @click="gotoClient"
<div v-if="!viewDisabled&&!editDisabled&&!renewDisabled" @click="gotoClient"
style="cursor: pointer">
<el-input v-model="form.customerName" placeholder="请选择客户"></el-input>
</div>
<el-input v-if="disabled||editDisabled||renewDisabled" disabled
<el-input v-if="viewDisabled||editDisabled||renewDisabled" disabled
v-model="form.customerName" placeholder="请选择客户"></el-input>
</el-form-item>
<el-form-item prop="orderType" label="订单类型">
<el-select :disabled="disabled||editDisabled||renewDisabled"
<el-select :disabled="viewDisabled||editDisabled||renewDisabled"
v-model="form.orderType" clearable placeholder="请选择订单类型">
<el-option v-for="(item,index) in orderTypeList" :key="index"
:label="item.name" :value="item.value"></el-option>
@ -104,7 +104,7 @@
<p class="addhr_tag"></p>
<span>课程权限</span>
</div>
<el-button v-if="!disabled&&!editDisabled&&!renewDisabled" type="primary" round
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round
class="mag"
@click="addCourseJurisdiction()">添加
</el-button>
@ -120,7 +120,7 @@
<div class="small">
<el-input onkeyup="value=this.value.replace(/\D+/g,'')"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="disabled||editDisabled" maxlength="4"
:disabled="viewDisabled||editDisabled" maxlength="4"
@change="deadLine($event,scope.row),zero($event,scope.row)"
oninput="value=value.replace(/[^0-9.]/g,'')"
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input>
@ -156,7 +156,7 @@
<template slot-scope="scope">
<div class="small">
<el-input :class="!scope.row.finalPrice&&whetherSubmit?'red':''"
:disabled="disabled||editDisabled"
:disabled="viewDisabled||editDisabled"
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
@change="[allAmount($event,scope.row),calculateDiscount($event,scope.row)]"
v-model="scope.row.finalPrice" placeholder="请输入"
@ -182,30 +182,30 @@
<template slot-scope="scope">
<div class="flex-c-c">
<el-button
v-if="!editDisabled&&!disabled"
v-if="!editDisabled&&!viewDisabled"
type="text"
@click="delCourseForm(scope.$index)"
style="margin-right:10px;"
>删除</el-button>
<el-switch
style="margin-right:10px"
v-show="scope.row.ship"
:disabled="disabled"
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
:active-text="scope.row.isEnable ? '禁用' : '启用'"
@change="handleEnable($event,scope.row)">
</el-switch>
<el-switch
v-show="!scope.row.ship"
:disabled="scope.row.ship === 1 || disabled"
:disabled="scope.row.ship === 1 || viewDisabled"
v-model="scope.row.ship"
:active-value="1"
:inactive-value="0"
: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"
:disabled="viewDisabled"
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
:active-text="scope.row.isEnable ? '启用' : '禁用'"
@change="handleEnable($event,scope.row)">
</el-switch>
</div>
</template>
</el-table-column>
@ -221,7 +221,7 @@
<p class="addhr_tag"></p>
<span>数据平台权限</span>
</div>
<el-button v-if="!disabled&&!editDisabled&&!renewDisabled" type="primary"
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary"
round class="mag" @click="addDataJurisdiction()">添加
</el-button>
</div>
@ -237,7 +237,7 @@
<div class="small">
<el-input onkeyup="value=this.value.replace(/\D+/g,'')"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="disabled||editDisabled" maxlength="4"
:disabled="viewDisabled||editDisabled" maxlength="4"
@change="deadLine($event,scope.row),zero($event,scope.row)"
oninput="value=value.replace(/[^0-9.]/g,'')"
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input>
@ -273,7 +273,7 @@
<template slot-scope="scope">
<div class="small">
<el-input :class="!scope.row.finalPrice&&whetherSubmit?'red':''"
:disabled="disabled||editDisabled"
:disabled="viewDisabled||editDisabled"
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
@change="[dealComputers($event,scope.row),calculateDiscount($event,scope.row),userAmount($event,scope.row)]"
v-model="scope.row.finalPrice" placeholder="请输入"
@ -295,7 +295,7 @@
<template slot-scope="scope">
<div class="small">
<el-input :class="!scope.row.accountNum&&whetherSubmit?'red':''"
:disabled="disabled||editDisabled"
:disabled="viewDisabled||editDisabled"
@change="[dealComputers($event,scope.row),dealBargain($event,scope.row),calculateDiscount($event,scope.row)]"
v-model="scope.row.accountNum" placeholder="请输入"
type="text"></el-input>
@ -307,7 +307,7 @@
<template slot-scope="scope">
<div class="small">
<el-input :class="!scope.row.totalAmount&&whetherSubmit?'red':''"
:disabled="disabled||editDisabled"
:disabled="viewDisabled||editDisabled"
@blur="[allAmount($event,scope.row),allAmountChange($event,scope.row),calculateDiscount($event,scope.row)]"
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
v-model="scope.row.totalAmount" placeholder="请输入"
@ -319,30 +319,30 @@
<template slot-scope="scope">
<div class="flex-c-c">
<el-button
v-if="!editDisabled&&!disabled"
v-if="!editDisabled&&!viewDisabled"
type="text"
@click="delDataForm(scope.$index)"
style="margin-right:10px;"
>删除</el-button>
<el-switch
style="margin-right:10px"
v-show="scope.row.ship"
:disabled="disabled"
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
:active-text="scope.row.isEnable ? '禁用' : '启用'"
@change="handleEnable($event,scope.row)">
</el-switch>
<el-switch
v-show="!scope.row.ship"
:disabled="scope.row.ship === 1 || disabled"
:disabled="scope.row.ship === 1 || viewDisabled"
v-model="scope.row.ship"
:active-value="1"
:inactive-value="0"
: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"
:disabled="viewDisabled"
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
:active-text="scope.row.isEnable ? '启用' : '禁用'"
@change="handleEnable($event,scope.row)">
</el-switch>
</div>
</template>
</el-table-column>
@ -357,7 +357,7 @@
<span>合同信息</span>
</div>
<div>
<el-form :disabled="disabled" ref="contract" :model="contract" :rules="rules"
<el-form :disabled="viewDisabled" ref="contract" :model="contract" :rules="rules"
label-width="80px">
<el-col :span="8" :offset="4">
<el-form-item label="合同名称">
@ -569,7 +569,8 @@ export default {
data() {
return {
loading: false,//
disabled: false,//
isAdd: false, //
viewDisabled: false,//
editDisabled: false,//
renewDisabled: false,//
dataLoading: false,//
@ -737,9 +738,14 @@ export default {
},
async created() {
this.token = sessionStorage.getItem("token");
//
if (this.$route.query.isAdd) {
this.isAdd = true;
}
//
if (this.$route.query.watch) {
this.disabled = true;
this.viewDisabled = true;
await this.getDetail(this.$route.query.watch);
}
//
@ -943,6 +949,7 @@ export default {
let param = {
pageSize: 10,
pageNum: this.platfromPage,
isEnable: 0, //
curriculumName: this.curriculumName
};
this.dataLoading = true;
@ -954,6 +961,15 @@ export default {
this.dataLoading = false;
});
},
courseSelectable(row, index) { //
let boolean = true;
this.coursePermissions.length && this.coursePermissions.some(e => {
if (e.dataOrCourseId === row.cid) {
boolean = false;
}
});
return boolean;
},
// --
handleSelectionChange(val) {
this.courseSelection = val;
@ -983,6 +999,7 @@ export default {
discountRate: "",//
accountNum: "",//
totalAmount: "",//
isEnable: 1, // 10
ship: 0,// 01
authority: 1 // 01
};
@ -1064,6 +1081,15 @@ export default {
this.dataLoading = false;
});
},
dataSelectable(row, index) { //
let boolean = true;
this.dataPlatformPermissions.length && this.dataPlatformPermissions.some(e => {
if (e.dataOrCourseId === row.id) {
boolean = false;
}
});
return boolean;
},
// --
dataPlatformSelection(val) {
this.platformSelect = val;
@ -1085,6 +1111,7 @@ export default {
discountRate: "",//
accountNum: "",//
totalAmount: "",//
isEnable: 1, // 10
ship: 0,// 01
authority: 0//
};
@ -1155,8 +1182,7 @@ export default {
// /-
handleDeliver(e, row) {
if (this.editDisabled) {
this.$post(this.api.ship + "?id=" + `${row.dataOrCourseId}`).then(res => {
});
this.$post(this.api.ship + "?id=" + `${row.dataOrCourseId}`).then(res => {});
}
},
//
@ -1400,7 +1426,6 @@ export default {
handleRemove(file, fileList) {
this.contract.contractFile = "";
},
configure() {
this.ipVisible = true;
},
@ -1409,24 +1434,6 @@ export default {
},
goBack() {
this.$router.go(-1);
},
dataSelectable(row, index) { //
let boolean = true;
this.dataPlatformPermissions.length && this.dataPlatformPermissions.some(e => {
if (e.dataOrCourseId === row.id) {
boolean = false;
}
});
return boolean;
},
courseSelectable(row, index) { //
let boolean = true;
this.coursePermissions.length && this.coursePermissions.some(e => {
if (e.dataOrCourseId === row.cid) {
boolean = false;
}
});
return boolean;
}
}
};

@ -217,7 +217,7 @@ export default {
},
addOrder() {
this.$store.commit("systemData", { order_id: "" });
this.$router.push("/addorder");
this.$router.push("/addorder?isAdd=true");
},
handle(val, row) {
this.$router.push("/addorder?" + val + "=" + row.orderId);

Loading…
Cancel
Save