监听查询条件,实时获取数据

dev
yujialong 3 years ago
parent 3607cfd674
commit 95c329fb0b
  1. 75
      src/views/order/AddOrder.vue

@ -181,9 +181,12 @@
<el-table-column label="操作" align="center" width="230px">
<template slot-scope="scope">
<div class="flex-c-c">
<el-button v-if="!editDisabled&&!disabled" style="margin-right:10px;"
@click="delCourseForm(scope.$index)">删除
</el-button>
<el-button
v-if="!editDisabled&&!disabled"
type="text"
@click="delCourseForm(scope.$index)"
style="margin-right:10px;"
>删除</el-button>
<el-switch
style="margin-right:10px"
v-show="scope.row.ship"
@ -191,8 +194,7 @@
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
active-text="启用"
inactive-text="禁用"
:active-text="scope.row.isEnable ? '禁用' : '启用'"
@change="handleEnable($event,scope.row)">
</el-switch>
<el-switch
@ -201,8 +203,7 @@
v-model="scope.row.ship"
:active-value="1"
:inactive-value="0"
active-text="发货"
inactive-text="未发货"
:active-text="scope.row.ship ? '发货' : '未发货'"
@change="handleDeliver($event,scope.row)">
</el-switch>
</div>
@ -317,10 +318,12 @@
<el-table-column label="操作" align="center" width="230px">
<template slot-scope="scope">
<div class="flex-c-c">
<el-button v-if="!editDisabled&&!disabled" style="margin-right:10px;"
@click="delDataForm(scope.$index)">删除
</el-button>
<!-- <el-button :disabled="disabled" v-show="scope.row.ship===true" style="margin-right:10px;" @click="configure(scope.row)">启动</el-button> -->
<el-button
v-if="!editDisabled&&!disabled"
type="text"
@click="delDataForm(scope.$index)"
style="margin-right:10px;"
>删除</el-button>
<el-switch
style="margin-right:10px"
v-show="scope.row.ship"
@ -328,8 +331,7 @@
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
active-text="启用"
inactive-text="禁用"
:active-text="scope.row.isEnable ? '禁用' : '启用'"
@change="handleEnable($event,scope.row)">
</el-switch>
<el-switch
@ -338,8 +340,7 @@
v-model="scope.row.ship"
:active-value="1"
:inactive-value="0"
active-text="发货"
inactive-text="未发货"
:active-text="scope.row.ship ? '发货' : '未发货'"
@change="handleDeliver($event,scope.row)">
</el-switch>
</div>
@ -421,15 +422,14 @@
</el-row>
<!-- 添加课程权限弹框-->
<el-dialog :visible.sync="courseVisible" width="50%" center>
<el-dialog :visible.sync="courseVisible" width="50%" center :close-on-click-modal="false" @close="closeJCourse">
<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.trim="curriculumName"
@keyup.enter.native="getCourseJurisdiction()" clearable></el-input>
<el-input placeholder="请输入课程名称" prefix-icon="el-icon-search" v-model.trim="curriculumName" clearable></el-input>
</div>
</div>
<el-table v-loading="dataLoading" :data="courseList" stripe header-align="center"
@ -459,8 +459,8 @@
</el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="courseVisible = false"> </el-button>
<el-button type="primary" v-preventReClick @click="addCourse()"> </el-button>
<el-button @click="closeJCourse"> </el-button>
<el-button type="primary" v-preventReClick @click="addCourse"> </el-button>
</span>
</el-dialog>
@ -472,8 +472,7 @@
<span>数据产品列表</span>
</div>
<div>
<el-input placeholder="请输入产品名称" prefix-icon="el-icon-search" v-model="productName"
@keyup.enter.native="getDataJurisdiction('search')" clearable></el-input>
<el-input placeholder="请输入产品名称" prefix-icon="el-icon-search" v-model="productName" clearable></el-input>
</div>
</div>
<el-table v-loading="dataLoading" :data="platformList" stripe header-align="center"
@ -717,11 +716,25 @@ export default {
platfromPage: 1,//
platformList: [],//
platformSelect: [],//
productName: ""//
productName: "",//
searchTimer: null,
};
},
watch: {
curriculumName(n) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getCourseJurisdiction();
}, 500);
},
productName(n) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getDataJurisdiction();
}, 500);
}
},
async created() {
this.token = sessionStorage.getItem("token");
//
@ -950,6 +963,10 @@ export default {
this.coursePage = val;
this.getCourseJurisdiction();
},
closeJCourse() { //
this.curriculumName = "";
this.courseVisible = false;
},
async addCourse() {
if (this.courseSelection.length > 0) {
let that = this;
@ -966,7 +983,7 @@ export default {
discountRate: "",//
accountNum: "",//
totalAmount: "",//
ship: 0,//
ship: 0,// 01
authority: 1 // 01
};
that.coursePermissions.push(obj);
@ -984,7 +1001,8 @@ export default {
fn(e);
}
});
this.courseVisible = !this.courseVisible;
this.courseVisible = false;
this.curriculumName = "";
this.platformSelect = [];
/* 调接口,判断是否为客户已有的课程 */
@ -1067,7 +1085,7 @@ export default {
discountRate: "",//
accountNum: "",//
totalAmount: "",//
ship: 0,//
ship: 0,// 01
authority: 0//
};
that.dataPlatformPermissions.push(obj);
@ -1085,7 +1103,8 @@ export default {
fn(e);
}
});
this.showPlatform = !this.showPlatform;
this.showPlatform = false;
this.productName = "";
this.platformSelect = [];
/* 调接口,判断是否为客户已有的产品功能 */

Loading…
Cancel
Save