2021-09-17

完成功能

1.修改商品

相关界面:

在这里插入图片描述

2.订单管理的日期选择

相关界面:

在这里插入图片描述

相关代码:

 let searchLogo=require("../../../assets/img/查询.svg")
      let lastYear=ref(2021)
      let lastMonth=ref(9)
      let lastDay=ref(5)

      let nextYear=ref(new Date().getFullYear())
      let nextMonth=ref(new Date().getMonth()+1)
      let nextDay=ref(new Date().getDate())

      let lastYearList=reactive({
        list:[]
      })
      let lastMonthList=reactive({
        list:[]
      })
      let lastDayList=reactive({
        list:[]
      })

      let nextYearList=reactive({
        list:[]
      })
      let nextMonthList=reactive({
        list:[]
      })
      let nextDayList=reactive({
        list:[]
      })

      let year=new Date().getFullYear();
  
      for(let i=2021;i<=Number(year);i++){
        lastYearList.list.push(i);
        nextYearList.list.push(i);
      }

      for(let i=1;i<=new Date().getMonth()+1;i++){
        lastMonthList.list.push(i)
        nextMonthList.list.push(i)
      }

      for(let i=1;i<=new Date().getDate();i++){
        lastDayList.list.push(i)
        nextDayList.list.push(i)
      }

      watch(
          lastYear,
          ()=>{
            lastMonthList.list.splice(0,lastMonthList.list.length)
            lastMonth.value=''
            if(lastYear.value<new Date().getFullYear()){
              for(let i=1;i<=12;i++){
                lastMonthList.list[i-1]=i
              }
            }else {
              for(let i=1;i<=new Date().getMonth()+1;i++){
                lastMonthList.list[i-1]=i
              }
            }
          }
      )

      watch(
          nextYear,
          ()=>{
            nextMonthList.list.splice(0,nextMonthList.list.length)
            nextMonth.value=''
            if(nextYear.value<new Date().getFullYear()){
              for(let i=1;i<=12;i++){
                nextMonthList.list[i-1]=i
              }
            }else {
              for(let i=1;i<=new Date().getMonth()+1;i++){
                nextMonthList.list[i-1]=i
              }
            }
          }
      )

      watch(
          lastMonth,
          ()=>{
            lastDayList.list.splice(0,lastDayList.list.length)
            lastDay.value=''
            if(lastMonth.value==(new Date().getMonth()+1)&&lastYear.value==year){
              for(let i=1;i<=new Date().getDate();i++){
                lastDayList.list[i-1]=i
              }
            }else {
              for(let i=1;i<=new Date(lastYear.value,lastMonth.value,0).getDate();i++){
                lastDayList.list[i-1]=i
              }
            }
          }
      )

      watch(
          nextMonth,
          ()=>{
           nextDayList.list.splice(0, nextDayList.list.length)
            lastDay.value=''
            if(nextMonth.value==(new Date().getMonth()+1)&&nextYear.value==year){
              for(let i=1;i<=new Date().getDate();i++){
                nextDayList.list[i-1]=i
              }
            }else {
              for(let i=1;i<=new Date(nextYear.value,nextMonth.value,0).getDate();i++){
                nextDayList.list[i-1]=i
              }
            }
          }
      )

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值