From 40313f93520ca907a6661ae24e00b661ee156804 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Mon, 22 May 2023 09:58:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/activity/activityList.vue | 39 ++++++++++++++++++- src/views/activity/component/addActivity.vue | 6 +++ .../productService/productServiceManage.vue | 2 +- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/views/activity/activityList.vue b/src/views/activity/activityList.vue index cdaa564..bf7d80e 100644 --- a/src/views/activity/activityList.vue +++ b/src/views/activity/activityList.vue @@ -99,6 +99,25 @@ export default { return value==0 ? '待审核':(value==1 ?'通过':'不通过') } }, + { + label:"排序", + width: 120, + prop:'sort', + align:'center', + customFn: (row) => { + return ( (this.updateSort(e, row.id, row)) + } + } + value = { + row.sort + }> + ) + } + }, { label:"活动关联方", width: 220, @@ -264,7 +283,25 @@ export default { pageChange(e){ this.select.pageIndex = e }, - + updateSort(e, id, row) { + if (e.keyCode === 13) { + if(e.target.value==row.sort){ + return + } + this.$confirm('是否确认更改排序?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.$refs['addActivity'].type = 'editor'; + this.$refs['addActivity'].id = id; + this.$refs['addActivity'].sortnumberNew = e.target.value + this.$refs['addActivity'].updateSortNumber() + }).catch(() => { + e.target.value = row.sort + }); + } + }, deleteActivity(row){ destroy({id:row.id}).then(res => { Message({ diff --git a/src/views/activity/component/addActivity.vue b/src/views/activity/component/addActivity.vue index f1b152f..8d1a5c0 100644 --- a/src/views/activity/component/addActivity.vue +++ b/src/views/activity/component/addActivity.vue @@ -568,6 +568,12 @@ companykeyword:"", return ((new Date(d1.replace(reg, '/'))) > (new Date(d2.replace(reg, '/')))) }, + async updateSortNumber(){ + await this.getDetail() + this.form.sort = this.sortnumberNew + await this.submit() + + }, submit(){ let end_date = this.form.date[1] let apply_end = this.form.applyDate[1] diff --git a/src/views/productService/productServiceManage.vue b/src/views/productService/productServiceManage.vue index a4083c6..8fe2155 100644 --- a/src/views/productService/productServiceManage.vue +++ b/src/views/productService/productServiceManage.vue @@ -247,7 +247,7 @@ this.select.pageSize = e; this.searchProducts(); }, - updateSort(e, id, row, type) { + updateSort(e, id, row) { if (e.keyCode === 13) { if(e.target.value==row.sortnumber){ return