Prechádzať zdrojové kódy

ota管理,京东模块功能开发

shipeng556 4 mesiacov pred
rodič
commit
b5ad9f8906

+ 92 - 0
src/api/otaMr/jingdong.js

@@ -0,0 +1,92 @@
+import request from '@/utils/request'
+// 分页查询
+export const pageList = (query) => {
+  return request({
+    url: '/thirdapi/jingdong/product/list',
+    method: 'post',
+    data: query
+  })
+}
+
+/** 系统-京东-ota-(商品推送)  */
+export const pushById = (data) => {
+    return request({
+        url: '/thirdapi/jingdong/product/push',
+        method: 'post',
+        data: data
+    })
+}
+
+/** 系统-京东(商品上下架)  */
+export const updateById = (data) => {
+  return request({
+      url: '/thirdapi/jingdong/product/update',
+      method: 'post',
+      data: data
+  })
+}
+
+/** 系统-京东(商品批量更新库存)  */
+export const stockUpdateById = (data) => {
+  return request({
+      url: '/thirdapi/jingdong/product/update',
+      method: 'post',
+      data: data
+  })
+}
+
+/** 系统-猫眼(商品批量更新库存)  */
+export const stockUpdateByIdApi = (data) => {
+  return request({
+      url: '/thirdapi/jingdong/product/stock/push',
+      method: 'post',
+      data: data
+  })
+}
+
+
+/** 系统-京东-ota(已推送商品sku查看)  */
+export const getPushListApi = (params) => {
+  return request({
+      url: '/thirdapi/jingdong/product/list/push',
+      method: 'get',
+      params: params
+  })
+}
+
+
+/** 系统-京东-ota(日历价格-获取)  */
+export const getCalendarPriceApi = (data) => {
+  return request({
+      url: '/thirdapi/jingdong/product/calendar/get',
+      method: 'post',
+      data: data
+  })
+}
+
+/** 系统-京东-ota(日历价格-更新)  */
+export const setCalendarPriceApi = (data) => {
+  return request({
+      url: '/thirdapi/jingdong/product/calendar',
+      method: 'post',
+      data: data
+  })
+}
+
+/** 系统-京东-ota(日历价格-删除)  */
+export const deleteCalendarPriceApi = (data) => {
+  return request({
+      url: '/thirdapi/jingdong/product/calendar/delete',
+      method: 'delete',
+      data
+  })
+}
+
+/** 获取城市列表  */
+// export const getCityListApi = (params) => {
+//   return request({
+//       url: '/thirdapi/jingdong/city/list',
+//       method: 'get',
+//       params: params
+//   })
+// }

+ 809 - 0
src/views/otaMr/jingdong/dialog/dataEdit.vue

@@ -0,0 +1,809 @@
+<!--
+ * @Description: 新增/编辑弹框
+ * @Author: ShiPeng
+ * @Date: 2025-10-15 09:00:00
+-->
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="open"
+    width="70vw"
+    append-to-body
+    :close-on-click-modal="false"
+    @close="cancel"
+  >
+    <div class="dialog">
+      <!-- <div>
+        <el-form :model="form" ref="form" size="small" :rules="rules" :inline="true" label-width="68px">
+          <el-form-item label="商品类目ID" prop="category" label-width="110px">
+            <el-select
+              v-model="form.category"
+              placeholder="商品类目ID"
+              clearable
+              style="width: 240px"
+            >
+              <el-option
+                v-for="dict in dict.type.maoyan_category"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="城市" prop="cityId">
+            <el-cascader
+            v-model="form.cityId"
+            :options="cityList"
+            style="width: 400px;"
+            :disabled="isFlag"
+            :props="{
+                children: 'child',
+                label: 'name',
+                value: 'value',
+                checkStrictly: true,
+                emitPath: false,
+              }"
+            clearable></el-cascader>
+          </el-form-item> 
+        </el-form>
+      </div> -->
+      <el-table 
+      row-key="tableId"
+      ref="tables" 
+      v-loading="loading" 
+      :data="goodsList" 
+      border 
+      @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55"></el-table-column>
+        <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
+        <el-table-column label="座位类型" align="center" prop="priceName" />
+        <el-table-column label="开始时间" align="center" prop="timeStart" />
+        <el-table-column label="结束时间" align="center" prop="timeEnd" />
+        <el-table-column label="京东排期状态" align="center" prop="status">
+          <template slot-scope="scope">
+            <dict-tag :options="dict.type.tiktok_scheduling_status" :value="scope.row.status"/>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            v-if="scope.row.status"
+            @click="openCalendarFun(scope.row)"
+          >日历价格配置</el-button>
+          <!-- <el-button
+            size="mini"
+            type="text"
+            @click="submitForm1(scope.row)"
+          >{{ scope.row.status == 1  ? '下架':'上架' }}</el-button> -->
+        </template>
+      </el-table-column>
+      </el-table>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button  @click="cancel">取消</el-button>
+      <el-button
+        type="primary"
+        @click="submitForm"
+        :disabled="!multipleSelection || multipleSelection.length == 0"
+        :loading="loading"
+      >
+        <span v-if="loading">提交中...</span>
+        <span v-else>推送已选</span>
+      </el-button>
+    </span>
+    <!--  选择日期 价格  -->
+    <el-dialog
+      :visible.sync="openCalendar"
+      width="70%"
+      class="text-dia-log-class"
+      append-to-body
+      :close-on-click-modal="false"
+      @close="openPrice = false"
+    >
+      <div class="dialog calendar-dialog" v-loading="calendarLoading">
+        <div>
+          <el-button type="primary" @click="openCalendarPrice()">价格设置</el-button>
+          <el-button type="primary" @click="checkIsClear()">一键清空</el-button>
+        </div>
+        <el-calendar v-model="timeValue">
+          <template
+            slot="dateCell"
+            slot-scope="{date, data}">
+            <div :class="['calendar_box', selectTime(data)]" @mouseover="mouseoverFun(data)" @click.stop="clickTimeFun(data)">
+              <span>{{ data.day.split('-').slice(1).join('-') }}</span>
+              <div style="width: 100%; display: flex;flex-wrap: wrap;" >
+                <div 
+                :key="index"
+                v-for="(item,index) in getPerFormList(data)"
+                >
+                {{ item.title }}:{{ item.money }}
+                </div>
+              </div>
+              
+            </div>
+            
+          </template>
+        </el-calendar>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="openCalendar = false">返回</el-button>
+      </span>
+    </el-dialog>
+
+    <!-- 设置价格  -->
+    <el-dialog
+      title="价格设置"
+      :visible.sync="openPrice"
+      width="400px"
+      class="text-dia-log-class"
+      append-to-body
+      :close-on-click-modal="false"
+      @close="openPrice = false"
+    >
+      <div v-loading="priceLoading">
+        <el-form :model="formPrice" ref="formPrice" size="small" :rules="rulesPrice" label-width="100px">
+          <el-form-item label="日期区间">
+            {{ showDate() }}
+          </el-form-item>
+          <el-form-item label="票面价" prop="originalAmount">
+            <el-input-number v-model="formPrice.originalAmount" controls-position="right" :min="0"></el-input-number>
+            元
+          </el-form-item>
+          <el-form-item label="售卖价格" prop="saleAmount">
+            <el-input-number v-model="formPrice.saleAmount" controls-position="right" @change="handleChange" :min="0"></el-input-number>
+            元
+          </el-form-item>
+          <el-form-item label="比例" prop="discount">
+            <el-input-number v-model="formPrice.discount" controls-position="right" @blur="blurChange" :min="0" :max="100"></el-input-number>
+            %
+          </el-form-item>
+          <el-form-item label="结算价" prop="costAmount">
+            <el-input-number v-model="formPrice.costAmount" controls-position="right" :min="0"></el-input-number>
+            元
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="openPrice = false">返回</el-button>
+        <el-button :loading="isLoading" @click="submitFormPrice('formPrice','calendarPrice')">提交</el-button>
+      </span>
+    </el-dialog>
+  </el-dialog>
+</template>
+
+<script>
+import { 
+  pushById,
+  getCalendarPriceApi,
+  setCalendarPriceApi,
+  getPushListApi,
+  deleteCalendarPriceApi,
+  // getCityListApi
+ } from "@/api/otaMr/jingdong";
+import moment from "moment"
+export default {
+  name: "dataEdit",
+  dicts: ['maoyan_category','tiktok_scheduling_status'],
+  data() {
+    return {
+      title: "编辑",
+      model: "EDIT",
+      open: false,
+      loading: false,
+      goodsList: [],
+      form: {},
+      rules: {
+        poiId: [{ required: true, message: "请输入门店POIID", trigger: ["change","blur"] }],
+        // category: [{ required: true, message: "请选择商品类目ID", trigger: ["change","blur"] }],
+        // cityId: [{ required: true, message: "请选择城市", trigger: ["change","blur"] }],
+      },
+      multipleSelection: [],
+
+      openCalendar: false,
+      timeValue: new Date(),
+      timeValueObj: {
+        prev: null,
+        next: null,
+        hover: null
+      },
+      calendarLoading: false,
+      perFormList: [],
+
+      openPrice: false,
+      priceLoading: false,
+      formPrice: {},
+      rulesPrice: {
+        originalAmount: [{ required: true, message: "请输入票面价", trigger: ["change","blur"] }],
+        saleAmount: [{ required: true, message: "请输入售卖价格", trigger: ["change","blur"] }],
+        costAmount: [{ required: true, message: "请输入结算价", trigger: ["change","blur"] }],
+      },
+      seatTypeId: null,
+      calendarId: null,
+
+      // cityList: [],
+      isFlag: false,
+      isLoading: false,
+    };
+  },
+  created() {
+    // this.getCityListFun()
+  },
+  methods: {
+    // 输入比例计算结算价
+    blurChange() {
+      if(this.formPrice.saleAmount && this.formPrice.discount) {
+        let costPrice =  this.formPrice.saleAmount * this.formPrice.discount / 100
+        this.formPrice.costAmount =  costPrice.toFixed(2)
+      } else {
+        this.$set(this.formPrice, 'costAmount', null)
+      }
+    },
+    //销售价改变 计算结算价格
+    handleChange(newVal, oldVal) {
+      if(newVal != oldVal) {
+        this.$set(this.formPrice, 'costAmount', null)
+        // this.$set(this.formPrice,'discount',null)
+        if(this.formPrice.discount) {
+          let costPrice =  this.formPrice.saleAmount * this.formPrice.discount / 100
+          this.formPrice.costAmount =  costPrice.toFixed(2)
+        } else {
+          this.$set(this.formPrice,'costAmount',null)
+        }
+      }
+    },
+    /**
+     * 打开弹框
+     * @date 2023-11-22
+     * @param {any} obj
+     * @returns {any}
+     */
+    async openDialog(title, obj, type) {
+      this.open = true;
+      this.goodsList = []
+      this.multipleSelection = []
+      this.timeValueObj = {}
+      this.form = JSON.parse(JSON.stringify({
+        ...obj
+        // category: obj.category?obj.category.toString():obj.category
+      }))
+      // if(this.form.cityId) {
+      //   this.isFlag = true
+      // }
+      
+      // await this.getPushListFun(obj,type)
+      if(type == 'yesPush') {
+        await this.getPushListFun(obj,type)
+      } else {
+        let list1 = []
+        if(obj.sku?.length > 0) {
+          obj.sku.forEach((item,index)=>{
+            list1.push({
+              ...item,
+              tableId: "id_" + index
+            })
+          })
+        }
+        this.goodsList = JSON.parse(JSON.stringify(list1));
+      }
+
+      this.$nextTick(()=>{
+        this.goodsList.forEach((item)=>{
+          if(item.checkFlag == 1) {
+            this.$refs.tables.toggleRowSelection(item,true)
+          }
+        })
+        this.$refs["form"].clearValidate()
+      })
+    },
+    /**  获取城市  */
+    // async getCityListFun() {
+    //   try {
+    //     let res = await getCityListApi()
+    //     if(res.code == 200) {
+    //       let list = []
+    //       list = this.setTreeData(res.data)
+    //       // console.log("list===",list)
+    //       this.cityList = list
+    //     }
+    //   } catch (error) {
+    //     console.error(error)
+    //   }
+    // },
+    setTreeData(list) {
+      let listCopy = []
+      list.forEach((item,index)=>{
+        listCopy.push({
+          ...item
+        })
+        if(item.child && item.child.length>0){
+          listCopy[index]['child'] = this.setTreeData(item.child)
+        }else {
+          listCopy[index]['child'] = null
+        }
+      })
+      return listCopy
+    },
+     /**  获取设置的日历价格  */
+     async getPushListFun(obj,type) {
+      try {
+        let res = await getPushListApi({
+          id: obj.id
+        })
+        if(res.code == 200) {
+          let list = []
+          if(type == 'yesPush') {
+            list = res.data
+          } else {
+            // if( res.data && res.data.length > 0){
+            //   obj.sku.forEach((item,index)=>{
+            //     let obj1 = JSON.parse(JSON.stringify(item))
+            //     res.data.forEach((item1,index1)=>{
+            //       if(item1.id == obj1.id){
+            //         obj1 =  JSON.parse(JSON.stringify(item1))
+            //       }
+                  
+            //     })
+            //     list.push({
+            //       ...obj1,
+            //       tableId: "id_" + index
+            //     })
+            //   })
+              
+            //   this.goodsList = res.data
+            // }else {
+            //   obj.sku.forEach((item,index)=>{
+            //     list.push({
+            //       ...item,
+            //       tableId: "id_" + index
+            //     })
+            //   })
+            // }
+
+            // 调整为 取list中sku数据 2025.06/23
+            if(obj.sku?.length > 0) {
+              obj.sku.forEach((item,index)=>{
+                list.push({
+                  ...item,
+                  tableId: "id_" + index
+                })
+              })
+            }
+          }
+          
+          this.goodsList = JSON.parse(JSON.stringify(list))
+        }
+      } catch (error) {
+        this.loading = false
+      }
+    },
+    /**
+     * 保存
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    submitForm() {
+      this.$refs["form"].validate(async (valid) => {
+        if (valid) {
+          try {
+            if(!this.multipleSelection && this.multipleSelection.length <= 0) {
+              this.$message.error("请选择上推送的数据!!!");
+              return
+            } 
+            // this.setTreeDataCopy(this.cityList,this.form.cityId)
+            let flog = false
+            let list = []
+            this.multipleSelection.forEach((item)=>{
+              list.push({
+                ...item,
+                checkFlag: 1
+              })
+              // if((!item.actualAmount && item.actualAmount !=0) || (!item.originAmount && item.originAmount !=0)) {
+              //   flog = true
+              // } 
+            })
+            // if(flog) {
+            //   this.$message.error("请输入售卖价格和结算价!!!");
+            //   return
+            // }
+            this.loading = true;
+            const { code } = await pushById({ 
+              ...this.form,
+              sku: list
+            });
+            if (code === 200) {
+              this.$message.success("操作成功!");
+              this.$emit("getList");
+              this.cancel();
+            }
+          } catch (error) {
+            console.error("error====",error)
+          } finally {
+            this.loading = false;
+          }
+        }else {
+
+        }
+      })
+    },
+    setTreeDataCopy(list,value) {
+      list.forEach((item,index)=>{
+        if(item.value == value) {
+          this.form.cityName = item.name
+        }
+        if(item.child && item.child.length>0){
+          this.setTreeDataCopy(item.child,value)
+        }else {
+          
+        }
+      })
+    },
+    /**
+     * 重置
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    reset() {
+      this.$refs["form"].clearValidate()
+    },
+    /**
+     * 关闭弹框
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    cancel() {
+      this.reset();
+      this.open = false;
+      this.isFlag = false;
+    },
+    isCheck(row){
+      let flog = false
+      this.multipleSelection.forEach((item,index)=>{
+        if(item.tableId == row.tableId) {
+          flog = true
+        }
+      })
+      return flog
+    },
+    handleSelectionChange(val) {
+      // console.log("选中了====", val)
+      this.multipleSelection = val;
+    },
+
+    getPerFormList(data) {
+      let list = []
+      this.perFormList.forEach((item,index)=>{
+        if(item.priceDate && item.priceDate.indexOf(data.day) != -1) {
+          list = [
+            { title: '票面价', money: item.originalAmount + '元'  },
+            { title: '售卖价格', money: item.saleAmount + '元' },
+            { title: '结算价', money: item.costAmount + '元' },
+          ]
+        }
+      })
+      return list
+    },
+    /**  打开价格设置   */
+    openCalendarPrice(){
+      if( this.timeValueObj.prev && this.timeValueObj.next ) {
+        this.openPrice = true
+        this.formPrice = {}
+        this.$nextTick(()=>{
+          this.$refs.formPrice.clearValidate()
+        })
+      }else {
+        this.$message.error("请选择时间区间!!!");
+      }
+      
+    }, 
+    checkIsClear(){
+      if (this.timeValueObj.prev && this.timeValueObj.next) {
+        let minTime = moment(this.timeValueObj.prev).valueOf()
+        let maxTime = moment(this.timeValueObj.next).valueOf()
+        let startDate = null
+        let endDate = null
+        if (minTime > maxTime) {
+          startDate = this.timeValueObj.next
+          endDate = this.timeValueObj.prev
+        } else {
+          startDate = this.timeValueObj.prev
+          endDate = this.timeValueObj.next
+        }
+        this.$modal.confirm('确定要清空勾选"' + startDate + '——' + endDate + '"的日期范围内的数据吗?').then(()=> {
+          this.clearCalendarPrice()
+        }).catch(() => {});
+      } else {
+        this.$message.error("请选择时间区间!!!");
+      }
+      
+    }, 
+    /** 一键清除  */
+    async clearCalendarPrice() {
+      try {
+        if( this.timeValueObj.prev && this.timeValueObj.next ) {
+          let minTime = moment(this.timeValueObj.prev).valueOf()
+          let maxTime = moment(this.timeValueObj.next).valueOf()
+          let startDate = null
+          let endDate = null
+          if(minTime > maxTime){
+            startDate = this.timeValueObj.next
+            endDate = this.timeValueObj.prev
+          }else {
+            startDate = this.timeValueObj.prev
+            endDate = this.timeValueObj.next
+          }
+          let daysList = [];
+          let SDate = moment(startDate);
+          let EDate = moment(endDate);
+          daysList.push({
+            "priceDate":  SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
+          });
+          while (SDate.add(1, "days").isBefore(EDate)) { // 注意这里add方法处理后SDate对象已经改变。      
+            daysList.push({
+              "priceDate":  SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
+            });
+          }
+          if(this.timeValueObj.next != this.timeValueObj.prev){
+            daysList.push({
+              "priceDate": EDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
+            });
+          }
+          let res = await deleteCalendarPriceApi({
+            "id": this.form.id,
+            "goodsId": this.form.goodsId,
+            "seatTypeId": this.seatTypeId,
+            "data": daysList
+          })
+          if(res.code == 200) {
+            this.openPrice = false
+            this.$modal.msgSuccess(res.msg);
+            this.getCalendarPrice()
+          }
+        }else {
+          this.$message.error("请选择时间区间!!!");
+        }
+      } catch (error) {
+        
+      }
+    },
+    submitFormPrice(formName,funName) {
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            this[funName]()
+          } else {
+            console.log('error submit!!');
+            return false;
+          }
+        });
+    },
+    openCalendarFun(row){
+      this.seatTypeId = row.seatTypeId
+      this.calendarId = row.id
+      this.$set(this,'timeValue',new Date())
+      this.getCalendarPrice()
+      
+    },
+    /**  获取设置的日历价格  */
+    async getCalendarPrice() {
+      try {
+        this.timeValueObj = {}
+        let res = await getCalendarPriceApi({
+          "goodsId": this.form.goodsId,
+          "seatTypeId": this.seatTypeId
+        })
+        if(res.code == 200) {
+          this.openCalendar = true
+          this.perFormList = res.data
+        }
+      } catch (error) {
+        
+      }
+    },
+    /**  设置价格  */
+    async calendarPrice(type){
+      try {
+        this.isLoading = true
+        if( this.timeValueObj.prev && this.timeValueObj.next ) {
+          let minTime = moment(this.timeValueObj.prev).valueOf()
+          let maxTime = moment(this.timeValueObj.next).valueOf()
+          let startDate = null
+          let endDate = null
+          if(minTime > maxTime){
+            startDate = this.timeValueObj.next
+            endDate = this.timeValueObj.prev
+          }else {
+            startDate = this.timeValueObj.prev
+            endDate = this.timeValueObj.next
+          }
+          let daysList = [];
+          let SDate = moment(startDate);
+          let EDate = moment(endDate);
+          daysList.push({
+              "id": null,
+              "priceDate":  SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
+              "originalAmount": this.formPrice.originalAmount,
+              "saleAmount": this.formPrice.saleAmount,
+              "costAmount": this.formPrice.costAmount
+            });
+          while (SDate.add(1, "days").isBefore(EDate)) { // 注意这里add方法处理后SDate对象已经改变。      
+            daysList.push({
+              "id": null,
+              "priceDate":  SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
+              "originalAmount": this.formPrice.originalAmount,
+              "saleAmount": this.formPrice.saleAmount,
+              "costAmount": this.formPrice.costAmount
+            });
+          }
+          if(this.timeValueObj.next != this.timeValueObj.prev){
+            daysList.push({
+             "id": null,
+              "priceDate": EDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
+              "originalAmount": this.formPrice.originalAmount,
+              "saleAmount": this.formPrice.saleAmount,
+              "costAmount": this.formPrice.costAmount
+            });
+          }
+          // console.log("daysList===",daysList)
+          daysList.forEach((item,index)=>{
+            this.perFormList.forEach((item1,index1)=>{
+              if(moment(item.priceDate).format("YYYY-MM-DD") == moment(item1.priceDate).format("YYYY-MM-DD") ) {
+                daysList[index].id = item1.id
+              }
+            })
+          })
+          let res = await setCalendarPriceApi({
+            "id": this.calendarId,
+            "goodsId": this.form.goodsId,
+            "seatTypeId": this.seatTypeId,
+            "data": daysList
+          })
+          if(res.code == 200) {
+            this.openPrice = false
+            this.isLoading = false
+            this.getCalendarPrice()
+          }
+        }else {
+          this.isLoading = false
+          this.$message.error("请选择时间区间!!!");
+        }
+      } catch (error) {
+        this.isLoading = false
+        
+      }
+      
+    },
+
+    /** 选中得时间  */
+    selectTime(data) {
+      let srt = ''
+      let newTime = moment(data.day).startOf('day').valueOf()
+      let newTime1 = moment().startOf('day').valueOf()
+      if(newTime < newTime1 ) {
+        return "disable_time"
+      }
+      if( this.timeValueObj ) {
+        if( this.timeValueObj.prev && this.timeValueObj.next ) {
+          let minTime = moment(this.timeValueObj.prev).valueOf()
+          let maxTime = moment(this.timeValueObj.next).valueOf()
+          if(minTime > maxTime){
+            if(minTime >= newTime && maxTime <= newTime){
+              srt = 'is-select_time'
+            }
+          }else {
+            if(minTime <= newTime && maxTime >= newTime){
+              srt = 'is-select_time'
+            }
+          }
+        }else if( this.timeValueObj.prev && !this.timeValueObj.next && this.timeValueObj.hover ){
+          let minTime = moment(this.timeValueObj.prev).valueOf()
+          let maxTime = moment(this.timeValueObj.hover).valueOf()
+          if(minTime > maxTime){
+            if(minTime >= newTime && maxTime <= newTime){
+              srt = 'is-select_time_hover'
+            }
+          }else {
+            if(minTime <= newTime && maxTime >= newTime){
+              srt = 'is-select_time_hover'
+            }
+          }
+        }
+      }
+      return srt
+    },
+    clickTimeFun(data) {
+      let newTime1 = moment(data.day).startOf('day').valueOf()
+      let newTime = moment().startOf('day').valueOf()
+      if(newTime1 < newTime ) {
+        return 
+      }
+      if(moment(data.day).format("YYYY-MM") != moment(this.timeValue).format("YYYY-MM") ) {
+        return
+      }
+      if( !this.timeValueObj || !this.timeValueObj.prev ) {
+        this.timeValueObj.prev = moment(data.day).format("YYYY-MM-DD")
+      }else if( this.timeValueObj.prev && !this.timeValueObj.next ){
+        this.timeValueObj.next = moment(data.day).format("YYYY-MM-DD")
+      }else if( this.timeValueObj.prev && this.timeValueObj.next ) {
+        this.timeValueObj.prev = moment(data.day).format("YYYY-MM-DD")
+        this.timeValueObj.next = null
+      }
+    },
+    mouseoverFun(data) {
+      if(moment(data.day).format("YYYY-MM") != moment(this.timeValue).format("YYYY-MM") ) {
+        return
+      }
+      if( this.timeValueObj.prev && !this.timeValueObj.next ){
+        this.timeValueObj.hover = moment(data.day).format("YYYY-MM-DD")
+        this.timeValue = new Date(this.timeValueObj.hover)
+      }
+    },
+    showDate(){
+      let srt = ''
+      let minTime = moment(this.timeValueObj.prev).valueOf()
+      let maxTime = moment(this.timeValueObj.next).valueOf()
+      let startDate = null
+      let endDate = null
+      if (minTime > maxTime) {
+        startDate = this.timeValueObj.next
+        endDate = this.timeValueObj.prev
+      } else {
+        startDate = this.timeValueObj.prev
+        endDate = this.timeValueObj.next
+      }
+      return startDate + "至" + endDate
+    }
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.dialog {
+  padding: 0 30px;
+  max-height: 65vh;
+  overflow-y: auto;
+}
+.dialog {
+  padding: 0 30px;
+  .upload-btn {
+    width: 100px;
+    height: 100px;
+    background-color: #fbfdff;
+    border: dashed 1px #c0ccda;
+    border-radius: 5px;
+    i {
+      font-size: 30px;
+      margin-top: 20px;
+    }
+    &-text {
+      margin-top: -10px;
+    }
+  }
+  .avatar {
+    cursor: pointer;
+  }
+}
+
+.calendar-dialog ::v-deep .el-calendar-table .el-calendar-day {
+  padding: none !important;
+  height: auto;
+}
+
+.calendar_box {
+  width: 100%;
+  min-height: 86px;
+}
+
+.disable_time {
+  user-select: none;
+  cursor: not-allowed;
+}
+
+.is-select_time {
+  background-color: rgba(30,144,255,0.8);
+}
+
+.is-select_time_hover {
+  background-color: rgba(30,144,255,0.4);
+}
+</style>

+ 200 - 0
src/views/otaMr/jingdong/index.vue

@@ -0,0 +1,200 @@
+<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" max-height="580px" border>
+      <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
+      <el-table-column label="京东ID" align="center" prop="goodsId" />
+      <!-- <el-table-column label="项目ID" align="center" prop="goodsId" /> -->
+      <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:jingdong: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:jingdong: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:jingdong: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:jingdong: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, stockUpdateByIdApi } from '@/api/otaMr/jingdong'
+import dataEdit from "./dialog/dataEdit.vue";
+
+export default {
+  name: "Jingdong",
+  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 stockUpdateByIdApi({
+          id: row.id,
+        });
+      }).then(() => {
+        this.$modal.msgSuccess(`推送成功`);
+        this.getList();
+      }).catch(() => {
+
+      });
+    },
+  }
+};
+</script>

+ 1 - 1
src/views/otaMr/maoyan/index.vue

@@ -75,7 +75,7 @@ import { pageList, updateById,stockUpdateById, stockUpdateByIdApi } from '@/api/
 import dataEdit from "./dialog/dataEdit.vue";
 
 export default {
-  name: "Meituan",
+  name: "Maoyan",
   dicts: ['tiktok_process','tiktok_online','tiktok_category'],
   components: { dataEdit },
   data() {