canyin-project/ybcy/views/admin/apply/platform_recycle.php

283 lines
13 KiB
PHP
Raw Permalink Normal View History

2024-11-01 16:07:54 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<?php if($this->params['site_image']):?>
<link rel="shortcut icon" type="image/x-icon" href="<?php echo $this->params['site_image'];?>" />
<?php else:?>
<link rel="shortcut icon" type="image/x-icon" href="<?=Yii::$app->request->baseUrl?>/web/favicon.ico" />
<?php endif;?>
<title> <?php if($this->params['site_title']):?>
<?php echo $this->params['site_title']; ?>
<?php else:?>
应用管理后台
<?php endif;?>-回收站</title>
<link rel="stylesheet" type="text/css" href="<?=Yii::$app->request->baseUrl?>/web/static/css/globle.css"/>
<script src="<?=Yii::$app->request->baseUrl?>/web/static/js/config.js" type="text/javascript" charset="utf-8"></script>
</head>
<style>
.main-search-con .elinput {
width: 300px;
}
.search-button .el-button, .tit-button .el-button {
width: 104px;
height: 38px;
}
.tjpt .el-button {
width: 130px;
height: 38px;
}
.namelogo {
width: 40px;
height: 40px;
border-radius: 50%;
}
</style>
<body>
<div class="pHead">
<div class="publicHeader"><?php echo $this->render('@app/views/admin/public/publicHeader.html');?></div>
</div>
<div class="pLeft">
<div class="publicAside hei"><?php echo $this->render('@app/views/admin/public/publicAside.html');?></div>
</div>
<div class="yb_body">
<div class="layout" id="platformList" v-cloak v-loading="cardLoading">
<el-container>
<el-container>
<el-main>
<div class="main" style="min-width: 800px">
<div class="main-search pad_30 ba_f bor_rad5">
<div class="main-search-tit t_l fon_16 wei">回收站</div>
<div class="main-search-con fon_14">
<div class="flex pad_tb_20">
<!-- <div class="mar_r30">-->
<!-- <el-select v-model="formInline.apply_type" placeholder="应用类型筛选">-->
<!-- <el-option v-for="item in options" :key="item.id" :label="item.app_name"-->
<!-- :value="item.id"></el-option>-->
<!-- </el-select>-->
<!-- </div>-->
<div class="mar_r30">
<el-input v-model="formInline.apply_name" placeholder="搜索平台名称"
class="elinput"></el-input>
</div>
<div class="search-button">
<el-button type="primary" @click="search(formInline)">查询</el-button>
</div>
</div>
</div>
</div>
<div class="main-table pad_30 mar_t30 ba_f bor_rad5">
<div class="table-tit flex-bet">
<div class="flex">
<!--<div class="">-->
<!--<el-checkbox v-model="checked">全选</el-checkbox>-->
<!--</div>-->
<div class="color_9 fon_14">已选择<span class="mar_lr10 color_rb wei">{{lengthNum || 0}}</span>个平台
</div>
<div class="mar_l50 tit-button">
<el-button @click="deactivation(1)" type="success" plain>恢复</el-button>
<el-button @click="deactivation(3)" type="danger" plain>删除</el-button>
</div>
</div>
</div>
<div class="mar_t30 fon_14 color_3">
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark"
style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="平台名称" prop="image">
<template slot-scope="scope">
<div class="flex pad_tb_10">
<div class=""><img class="namelogo" :src="scope.row.apply_image"/>
</div>
<div class="flex-col mar_l20">
<div class="overflowlnr">{{ scope.row.apply_name }}</div>
<!-- <div class="color_9 fon_12">类型:-->
<!-- <span v-if="scope.row.apply_type=='1'">连锁版</span>-->
<!-- <span v-if="scope.row.apply_type=='2'">O2O版</span>-->
<!-- <span v-if="scope.row.apply_type=='3'">单店版</span>-->
<!-- </div>-->
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="end_time" label="到期时间">
<template slot-scope="scope">
<div class="t_l">
<div v-if="scope.row.time_type=='1'">
{{scope.row.end_time}}
</div>
<div v-else class="color_9">永久</div>
</div>
</template>
</el-table-column>
<el-table-column prop="userName" label="操作员"
show-overflow-tooltip>
<template slot-scope="scope">
<div class="t_l">
<div>{{scope.row.userName}}</div>
<div v-show="scope.row.phone" class="fon_12 color_9">
关联手机号:{{scope.row.phone}}
</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<div class="textbutton">
<el-button type="text" class="fon_14"
@click="deactivation(1,scope.row.id)">恢复
</el-button>
<el-button type="text" class="fon_14"
@click="deactivation(3,scope.row.id)">删除
</el-button>
</div>
</template>
</el-table-column>
</el-table>
<div class="t_l">
<el-pagination background layout="prev, pager, next" :total="total"
:page-size="pagesize"
@current-change="current_change">
</el-pagination>
</div>
</div>
</div>
</div>
</el-main>
</el-container>
</el-container>
</div>
</div>
<script>
$(document).ready(function () {
$(".slimScrollDiv ul .main-nav-li a").eq(1).addClass("menu_active");
$(".main-nav .main-nav-li .submenu").eq(1).addClass("block");
$(".main-nav .main-nav-li .submenu").children().children().eq(2).addClass("menu_active2")
// console.log('1233123', $(".main-nav .main-nav-li .submenu").children().children().eq(2).addClass("menu_active2"))
// console.log('1235',$(".main-nav .main-nav-li .submenu").eq(1).addClass("block"))
});
</script>
<script>
new Vue({
el: '#platformList',
created() {
this.init();
},
data: function () {
return {
cardLoading: true,
formInline: {
apply_type: '',
apply_name: '',
apply_status:2
},
options: [],
checked: true,
tableData: [],
checkId: [],
lengthNum: '',
total: 0,
pagesize: 10,
currentPage: 1,
}
},
methods: {
//初始化
async init() {
var params = {
page: this.currentPage,
status: 3,
}
res = await utils.requestPost({
data: params,
url: "admin/apply/getrecycle"
},this)
if (res.code == 1) {
this.cardLoading= false
this.tableData = res.data
this.total = res.count
}
this.applist()
},
//应用下拉框列表
async applist() {
res = await utils.requestPost({data: '', url: "admin/app/applist"},this)
if (res.code == 1) {
this.options = res.data
// console.log('options',res.data)
}
},
//搜索
async search(formInline) {
this.tableData = []
res = await utils.requestPost({
data: this.formInline,
url: "admin/apply/applybysearch"
},this)
if (res.code == 1) {
this.tableData = res.data
this.total = res.count
}
},
//切换分页
current_change: function (currentPage) {
this.currentPage = currentPage;
this.init()
},
edit(id) {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_edit');?>"+"?id="+id;
},
//表格选择框数据
handleSelectionChange(val) {
console.log(val)
if (val) {
let setctId = []
this.lengthNum = val.length
val.forEach(row => {
setctId.push(row.id);
});
this.checkId = setctId
}
},
//点击恢复/删除
async deactivation(status, id) {
if (status == 1) {
await utils.showConfirm({content: '此操作将恢复该项目, 是否继续?'},this)
}
if (status == 3) {
await utils.showConfirm({content: '此操作将彻底删除该项目, 是否继续?'},this)
}
var requstData = {
id: id ? id : this.checkId,
status: status,
}
//console.log(requstData);
//return;
res = await utils.requestPost({
data: requstData,
url: "admin/apply/delapply"
},this)
if (res.code == 1) {
this.$message({
type: 'success',
message: '操作成功!',
duration: 1000,
onClose: () => {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_recycle');?>";
},
});
}
}
}
})
</script>
</body>
</html>