123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <template>
- <div class="app-container">
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- plain
- icon="el-icon-key"
- size="mini"
- @click="handleKey"
- v-hasPermi="['otaMr:otaMr:key']"
- >填写密钥</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['otaMr:otaMr:add']"
- >添加商品</el-button>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" :search="false" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-table ref="tables" v-loading="loading" :data="dataList" border>
- <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
- <el-table-column label="门店POIID" align="center" prop="poiId" />
- <el-table-column label="商品类目ID" align="center" prop="categoryId">
- <template slot-scope="scope">
- <dict-tag :options="dict.type.tiktok_category" :value="scope.row.categoryId"/>
- </template>
- </el-table-column>
- <el-table-column label="演出厅" align="center" prop="performHallName" />
- <el-table-column label="剧目名称" align="center" prop="performName" />
- <el-table-column label="商品名称" align="center" prop="goodsName" />
- <el-table-column label="时刻信息" align="center" prop="goodsName1">
- <template slot-scope="scope">
- <span>{{ scope.row.times }}</span>
- </template>
- </el-table-column>
- <el-table-column label="抖音审核状态" align="center" prop="process">
- <template slot-scope="scope">
- <dict-tag :options="dict.type.tiktok_process" :value="scope.row.process"/>
- </template>
- </el-table-column>
- <el-table-column label="商品上架/下架" align="center" prop="status">
- <template slot-scope="scope">
- <dict-tag :options="dict.type.tiktok_online" :value="scope.row.status"/>
- </template>
- </el-table-column>
- <el-table-column label="最新上架时间" align="center" prop="goodsName3" />
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <span v-hasPermi="['otaMr:tiktok:push']" style="display: inline-block;margin-left: 10px;">
- <el-button
- size="mini"
- type="text"
- @click="handlePush(scope.row,scope.index)"
- v-if="(scope.row.status == 0 || scope.row.status == 1) && scope.row.process == 4"
- >{{ scope.row.status == 0 ? '上线' : '下线' }}</el-button>
- </span>
- <span v-hasPermi="['otaMr:tiktok:push']" style="display: inline-block;margin-left: 10px;">
- <el-button
- size="mini"
- type="text"
- @click="handleInventory(scope.row,scope.index)"
- v-if="scope.row.status == 1"
- >日历库存推送</el-button>
- </span>
- <el-button
- size="mini"
- type="text"
- @click="handleUpdate(scope.row,scope.index)"
- v-hasPermi="['otaMr:tiktok:scheduling']"
- >排期推送</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 新增/编辑弹框 -->
- <add-and-edit
- ref="addAndEdit"
- :dict="dict"
- @getList="getList"
- />
- <!-- 编辑商品弹框 -->
- <data-edit
- ref="dataEdit"
- @getList="getList"
- :dict="dict"></data-edit>
- </div>
- </template>
- <script>
- import { pageList, updateById,stockUpdateById } from '@/api/otaMr/tiktok'
- import addAndEdit from "./dialog/addAndEdit.vue";
- import dataEdit from "./dialog/dataEdit.vue";
- export default {
- name: "agreement",
- dicts: ['tiktok_process','tiktok_online','tiktok_category'],
- components: { addAndEdit, dataEdit },
- data() {
- return {
- // 遮罩层
- loading: true,
- otaLoading: false,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 用户表格数据
- dataList: null,
- // 弹出层标题
- title: "",
- otaType: '1',
- // 是否显示弹出层
- open: false,
- // 日期范围
- dateRange: [],
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- },
- visibleStatus: false,
- newObj: {},
- visibleType: '',
- otaForm: {},
- otaRules: {
- name: [{ required: true, message: "请输入供应商id", trigger: ["change","blur"] }],
- otaKey: [{ required: true, message: "请输入client id", trigger: ["change","blur"] }],
- otaValue: [{ required: true, message: "请输入client secret", trigger: ["change","blur"] }]
- },
- };
- },
- created() {
- this.getList();
- },
- methods: {
- /** 查询列表 */
- getList() {
- this.loading = true;
- pageList(this.addDateRange(this.queryParams, this.dateRange))
- .then(response => {
- this.dataList = response.data.rows;
- this.total = response.data.total?Number(response.data.total):0;
- this.loading = false;
- }
- ).catch(()=>{
- this.dataList = []
- this.total = 0;
- this.loading = false;
- })
- },
- // 取消按钮
- cancel() {
- this.open = false;
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.dateRange = [];
- this.dataList = [];
- this.queryParams.pageNum = 1;
- this.handleQuery();
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.$refs["addAndEdit"].openDialog("新增数据", this.queryParams);
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.$refs["dataEdit"].openDialog("修改数据", row);
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- this.$modal.confirm('是否确认删除商品名称为"' + row.goodsName + '"的数据项?').then(function() {
- return deleteById(row.id);
- }).then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- }).catch(() => {});
- },
- /** 推送 */
- handlePush(row) {
- this.$modal.confirm(`是否确认${ row.status == 0 ? '上线': row.status == 1 ?'下线':''}此商品吗?`).then(function() {
- return updateById({
- id: row.id,
- status: row.status == 0 ? 1 : 0
- });
- }).then(() => {
- this.$modal.msgSuccess(`${ row.status == 0 ? '上线': row.status == 1 ?'下线':''}成功`);
- this.getList();
- }).catch(() => {
- });
- },
- handleInventory(row) {
- this.$modal.confirm(`是否确认推送此商品的日历库存?`).then(function() {
- return stockUpdateById({
- id: row.id,
- });
- }).then(() => {
- this.$modal.msgSuccess(`推送成功`);
- this.getList();
- }).catch(() => {
- });
- },
- }
- };
- </script>
|