wangguoyu 1 месяц назад
Родитель
Сommit
1fbc8c9673
2 измененных файлов с 62 добавлено и 27 удалено
  1. 13 1
      api/jiazheng.js
  2. 49 26
      pages/admin/Jiazheng/kechengBind.vue

+ 13 - 1
api/jiazheng.js

@@ -380,4 +380,16 @@ export function getAdminClassify(data = {}) {
     data,
     timeout: 20000
   })
-}
+}
+
+export function kechengReset(data = {}) {
+  return request({
+    url: '/app/kecheng/guanliyuan/classify',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}

+ 49 - 26
pages/admin/Jiazheng/kechengBind.vue

@@ -49,9 +49,9 @@
 								</view> -->
 								<view class="bind-btn-row">
 									<button type="default" size="mini" class="kc-bind-btn phone-green-btn"
-										@click.stop="toDelete(item)">重置</button>			
+										@click="toReset(item)">重置</button>			
 									<button type="default" size="mini" class="kc-bind-btn phone-white-btn"
-										@click.stop="toDelete(item)">删除</button>
+										@click="toDelete(item)">删除</button>
 								</view>
 							</view>
 						</view>
@@ -75,7 +75,8 @@
 		jiazhengKcList,
 		jiazhengKcAdd,
 		jiazhengKcDelete,
-		getAdminClassify
+		getAdminClassify,
+		kechengReset
 	} from "@/api/jiazheng.js";
 	import commonDialog from '@/components/dialog/commonDialog.vue';
 	import kechengLeixingVue from "./common/kechengLeixing.vue";
@@ -123,7 +124,25 @@
 		},
 		methods: {
 			toReset(data){
-				
+			let req = {
+				kcId: data.kcId,
+				id: this.id
+			}
+			kechengReset(req).then(res => {
+				if (res.code == 0) {
+					this.getList()
+					uni.showToast({
+						title: '成功',
+						icon: 'success'
+					});
+				} else {
+					uni.showToast({
+						title: '失败',
+						icon: 'success'
+					});
+					return false
+				}
+			})
 			},
 			searchBtn() {
 				this.$refs.searchRef.handleShow()
@@ -157,32 +176,36 @@
 				})
 			},
 			toAdd(data) {
-				debounce(()=>{
-					let req = {
-						kcIds: [data.kcId],
-						id: this.id
-					}
-					jiazhengKcAdd(req).then(res => {
-						if (res.code == 0) {
-							this.getList()
-							uni.showToast({
-								title: '添加成功',
-								icon: 'success'
-							});
-						} else {
-							uni.showToast({
-								title: '添加失败',
-								icon: 'success'
-							});
-							return false
-						}
-					})
-				},500)
+				debounce(
+					this.jzAdd(data)
+				,500)
 			
 			},
+			
+			jzAdd(data){
+				let req = {
+					kcIds: [data.kcId],
+					id: this.id
+				}
+				jiazhengKcAdd(req).then(res => {
+					if (res.code == 0) {
+						this.getList()
+						uni.showToast({
+							title: '添加成功',
+							icon: 'success'
+						});
+					} else {
+						uni.showToast({
+							title: '添加失败',
+							icon: 'success'
+						});
+						return false
+					}
+				})
+			},
 			deleteQuerenBtn() {
 				let req = {
-					kcId: this.kcId,
+					kcIds: this.kcId,
 					id: this.id
 				}
 				jiazhengKcDelete(req).then(res => {