123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409 |
- <template>
- <div>
- <el-container>
- <el-header style="height: 120px">
- <div id="header-one">
- <h3 class="el-icon-search" style="margin-left: 10px">筛选搜索</h3>
- <div id="header-one-btu">
- <el-button @click="empty">重置</el-button>
- <el-button type="primary" @click="check">搜索</el-button>
- </div>
- </div>
- <div id="header-two">
- <el-row>
- <el-col :span="5" id="header-two-left">
- <el-form ref="anFormRef" label-width="80px">
- <el-form-item label="藏品名称(套):" label-width="102px">
- <el-input
- v-model="input.value1"
- class="anInput"
- placeholder="筛选藏品标题"
- center
- ></el-input>
- </el-form-item>
- </el-form>
- </el-col>
- <el-col :span="12">
- <el-form label-width="80px">
- <el-form-item label="创建时间:">
- <el-date-picker
- v-model="input.value2"
- type="datetimerange"
- class="up-input-right"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- align="right"
- >
- </el-date-picker>
- </el-form-item>
- </el-form>
- </el-col>
- </el-row>
- </div>
- </el-header>
- <el-main style="height: 110px">
- <h3 class="el-icon-tickets">套系列表 共有{{ total }}条数据</h3>
- <el-button id="main-btu" @click="addSet">添加</el-button>
- </el-main>
- <div class="footer">
- <el-row class="state">
- <el-button
- :class="flag == 0 ? 'active' : ''"
- size="small"
- @click="onSalel"
- >在售</el-button
- >
- <el-button
- :class="flag == 1 ? 'active' : ''"
- size="small"
- @click="preSale"
- >预售</el-button
- >
- <el-button
- :class="flag == 2 ? 'active' : ''"
- size="small"
- @click="expired"
- >已过期</el-button
- >
- </el-row>
- <el-table :data="tableData" border style="width: 100%">
- <el-table-column
- prop="tetherId"
- label="id"
- width="110"
- align="center"
- >
- </el-table-column>
- <el-table-column
- prop="tetherName"
- label="藏品名称(套)"
- width="220"
- align="center"
- >
- </el-table-column>
- <el-table-column
- prop="showTimeStart"
- label="创建时间"
- width="220"
- align="center"
- >
- </el-table-column>
- <el-table-column
- prop="showTimeEnd"
- label="结束时间"
- width="220"
- align="center"
- >
- </el-table-column>
- <el-table-column
- prop="total"
- label="藏品数量"
- width="195"
- align="center"
- >
- </el-table-column>
- <el-table-column
- prop="sellStatus"
- label="状态"
- width="200"
- align="center"
- >
- <template slot-scope="scope">
- <el-tag size="medium" :type=" scope.row.grounding == '0' ? 'success' : 'warning' ">
- {{ scope.row.grounding == "0" ? "已上架" : "未上架" }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column prop="edit" label="操作" width="280" align="center">
- <template slot-scope="scope">
- <el-button type="text" @click="sList(scope.row)"
- >藏品列表</el-button
- >
- <el-row>
- <el-button type="text" @click="upJia(scope.row)"
- >上架</el-button
- >
- <el-button type="text" @click="CurendTime(scope.row)"
- >修改时间</el-button
- >
- </el-row>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @current-change="handleCurrentChange"
- background
- layout="total, prev, pager, next"
- :total="total"
- id="page"
- :page-size="10"
- >
- </el-pagination>
- </div>
- <el-dialog
- title="修改时间"
- :visible.sync="dialogFormVisible"
- :style="{ width: '100%' }"
- >
- <el-form>
- <el-form-item label="结束时间" label-width="80px">
- <el-date-picker
- v-model="showendtime"
- type="datetime"
- placeholder="选择结束时间"
- value-format="yyyy-MM-dd hh:mm:ss"
- >
- </el-date-picker>
- </el-form-item>
- <span id="tab"
- >当前结束时间为{{ showEnd }},结束日期需大于当前结束日期</span
- >
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible = false">取 消</el-button>
- <el-button type="primary" @click="submitTime">确 定</el-button>
- </div>
- </el-dialog>
- </el-container>
- </div>
- </template>
- <script>
- import {
- selectether,
- sellingList,
- advanceList,
- selledList,
- updataEndtime,
- Grounding,
- } from "@/api/sets/index";
- export default {
- data() {
- return {
- dialogFormVisible: false,
- pageInfo: {
- // 分页信息
- pageNum: 1,
- pageSize: 10,
- },
- input: {
- value1: "", // 搜索姓名
- value2: "", // 搜索时间
- },
- total: 1,
- flag: 0,
- tableData: [],
- startTime: [],
- endTime: [],
- showEnd: "",
- showendtime: "",
- tetherId: "",
- grounding: "",
- };
- },
- mounted() {
- this.flag = 0;
- this.sellingsList();
- },
- methods: {
- submitTime(data) {
- this.dialogFormVisible = false;
- if (!this.showendtime) return;
- console.log(this.showendtime);
- let time = {
- showTimeEnd: this.showendtime,
- tetherId: this.tetherId,
- };
- console.log(time);
- let { code } = updataEndtime(time).catch((err) => err);
- // console.log(code);
- this.$message("修改成功,请刷新界面");
- // this.sellingsList();
- // this.advancesList();
- // this.selledsList();
- },
- CurendTime(data) {
- console.log(data);
- this.dialogFormVisible = true;
- this.showEnd = data.showTimeEnd;
- this.tetherId = data.tetherId;
- },
- handleCurrentChange(newPage) {
- this.pageInfo.pageNum = newPage;
- this.setsList();
- },
- // 在售
- sellingsList() {
- sellingList(this.pageInfo).then((res) => {
- this.tableData = res.rows;
- this.total = res.total;
- });
- },
- // 预售
- advancesList() {
- advanceList(this.pageInfo).then((res) => {
- this.tableData = res.rows;
- this.total = res.total;
- });
- },
- // 已过期
- selledsList() {
- selledList(this.pageInfo).then((res) => {
- this.tableData = res.rows;
- this.total = res.total;
- });
- },
- // 点击标签切换修改后
- onSalel() {
- this.flag = 0;
- this.sellingsList();
- },
- preSale() {
- this.flag = 1;
- this.advancesList();
- },
- expired() {
- this.flag = 2;
- this.selledsList();
- },
- // 重置
- empty() {
- this.input.value1 = "";
- this.dataput = "";
- },
- // 搜索
- check() {
- if (this.input.value1 || this.input.value2) {
- let startTime = this.$formatDate(
- this.input.value2[0],
- "yyyy-MM-dd hh:mm:ss"
- );
- let endTime = this.$formatDate(
- this.input.value2[1],
- "yyyy-MM-dd hh:mm:ss"
- );
- let searchCon = {
- tetherName: this.input.value1,
- tetherTimeStart: startTime,
- tetherTimeEnd: endTime,
- };
- selectether(searchCon).then((res) => {
- this.tableData = res.rows;
- this.total = res.total;
- });
- } else {
- this.setsList();
- }
- },
- // 添加
- addSet() {
- this.$router.push("./addSet");
- },
- // 藏品列表
- sList(rows) {
- this.$router.push({ name: "collectionList", params: { rows } });
- },
- // 上架
- upJia(row) {
- this.$confirm("是否要上架商品?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- row.grounding = 0;
- Grounding(row.grounding, row.tetherId).then(() => {
- this.$message({
- type: "success",
- message: "上架成功!",
- });
- });
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "已取消",
- });
- });
- },
- // 修改时间
- editTime() {
- console.log("修改时间");
- },
- },
- };
- </script>
- <style scoped>
- #tab {
- color: red;
- }
- .el-main {
- color: #333;
- border: 1px solid #d3d7d4;
- border-radius: 5px;
- margin-left: 30px;
- margin-right: 30px;
- }
- .el-header {
- color: #333;
- border: 1px solid #d3d7d4;
- border-radius: 5px;
- margin: 30px;
- }
- /* .el-footer {} */
- #footer-t {
- color: #333;
- border: 1px solid #d3d7d4;
- border-radius: 5px;
- margin-left: 10px;
- margin-top: 30px;
- }
- /* #header-one {} */
- #header-two {
- /* background-color: aqua; */
- margin-left: 90px;
- }
- #header-one-btu {
- margin: 20px 20px 0px 0px;
- float: right;
- }
- #header-two-left {
- margin-right: 150px;
- }
- #main-btu {
- float: right;
- margin-top: 10px;
- }
- #page {
- float: right;
- margin-top: 15px;
- }
- .footer {
- margin: 20px auto;
- width: 97%;
- }
- .state button {
- margin: 0;
- }
- .active {
- color: white;
- background-color: #409eff;
- }
- </style>
|