| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 | <template>  <div class="app-container">    <el-row :gutter="10" class="mb8">      <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="美团ID" align="center" prop="id" />      <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" class-name="small-padding fixed-width">        <template slot-scope="scope">          <span v-hasPermi="['otaMr:meituan:push']" style="display: inline-block;">            <el-button              size="mini"              type="text"              style="margin-right: 10px;"              @click="handlePush(scope.row,scope.index)"            >{{ (scope.row.status == -1 || !scope.row.status) ? '上线' : '下线' }}</el-button>          </span>          <span v-hasPermi="['otaMr:meituan:tuisong']" style="display: inline-block;">            <el-button              size="mini"              type="text"              style="margin-left: 10px;"              @click="handleInventory(scope.row,scope.index)"              v-if="scope.row.status == 1"            >日历库存推送</el-button>          </span>          <span v-hasPermi="['otaMr:meituan:time']" style="display: inline-block;margin-right: 10px;">            <el-button              size="mini"              type="text"              style="margin-left: 10px;"              @click="handleUpdate(scope.row,'yesPush')"            >价格日历</el-button>          </span>          <el-button            size="mini"            type="text"            @click="handleUpdate(scope.row,scope.index,'noPush')"            v-hasPermi="['otaMr:meituan: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"    />    <!-- 编辑商品弹框 -->    <data-edit      ref="dataEdit"      @getList="getList"      :dict="dict"></data-edit>  </div></template><script>import { pageList, updateById, stockUpdateById, stockPushById } from '@/api/otaMr/meituan'import dataEdit from "./dialog/dataEdit.vue";export default {  name: "Meituan",  dicts: ['tiktok_process','tiktok_online','tiktok_category'],  components: { 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();    },    /** 修改按钮操作 */    handleUpdate(row,type) {      this.$refs["dataEdit"].openDialog("修改数据", row,type);    },    /** 删除按钮操作 */    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) ? '上线': row.status == 1 ?'下线':''}此商品吗?`).then(function() {        return updateById({          id: row.id,          status: (row.status === 0 || !row.status) ? 1 : 0        });      }).then(() => {        this.$modal.msgSuccess(`${ (row.status === 0 || !row.status) ? '上线': row.status == 1 ?'下线':''}成功`);        this.getList();      }).catch(() => {      });    },    handleInventory(row) {      this.$modal.confirm(`是否确认推送此商品的日历库存?`).then(function() {        return stockPushById({          id: row.id,        });      }).then(() => {        this.$modal.msgSuccess(`推送成功`);        this.getList();      }).catch(() => {      });    },  }};</script>
 |