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

@ -228,7 +228,21 @@ export default {
this.$router.push("/addorder?isAdd=true"); this.$router.push("/addorder?isAdd=true");
}, },
handle(val, row) { 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) { handleDelete(row) {

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

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

Loading…
Cancel
Save