chenhaozhe
2025-10-23 64aba338beb7018c8264cfcf1b7b6c9b2abc9987
pages/MJGL/shangmudan/table.vue
@@ -5,6 +5,7 @@
            <view class="title">状态:</view>
            <view class="right">
               <picker :range="arrayStatus" :value="hform.HStatus" @change="HStatusChange">
                  <view class="picker-overlay"></view>
                  <input name="HStatus" disabled :value="hform.HStatus" placeholder="请选择状态" />
               </picker>
            </view>
@@ -13,6 +14,7 @@
            <view class="title">开始时间:</view>
            <view class="right">
               <picker mode="date" :value="hform.HBeginDate" @change="HBeginDateChange">
                  <view class="picker-overlay"></view>
                  <input name="HBeginDate" disabled :value="hform.HBeginDate" placeholder="请选择" />
               </picker>
            </view>
@@ -21,6 +23,7 @@
            <view class="title">结束时间:</view>
            <view class="right">
               <picker mode="date" :value="hform.HEndDate" @change="HEndDateChange">
                  <view class="picker-overlay"></view>
                  <input name="HEndDate" disabled :value="hform.HEndDate" placeholder="请选择" />
               </picker>
            </view>
@@ -234,8 +237,8 @@
            arrayStatus: ['全部', '未审核', '已审核', '已关闭'],
            hform: {
               HStatus: '全部',
               HBeginDate: '',
               HEndDate: '',
               HBeginDate: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0],
               HEndDate: new Date().toISOString().split('T')[0],
               HICMOBillNo: '',
               HBillNo: '',
               HProcExchBillNo: '',               
@@ -265,6 +268,36 @@
         }, 1000);
      },
      methods: {
         SearchWhere() { //过滤条件
            this.sWhere = ''; // 先清空条件
            if (this.hform.HStatus) {
               if (this.hform.HStatus == '全部') {
                  this.sWhere += "";
               } else if (this.hform.HStatus == '未审核') {
                  this.sWhere += " and 审核人=''";
               } else if (this.hform.HStatus == '已审核') {
                  this.sWhere += " and 审核人<>''";
               } else if (this.hform.HStatus == '已关闭') {
                  this.sWhere += " and 关闭人<>''";
               }
            }
            if (this.hform.BenginHCreateDate) {
               this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.hform.BenginHCreateDate + "'";
            }
            if (this.hform.EndHCreateDate) {
               this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.hform.EndHCreateDate + "'";
            }
            if (this.hform.HBillNo) {
               this.sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'";
            }
            if (this.hform.HICMOBillNo) {
               this.sWhere += " and 生产订单号 like '%" + this.hform.HICMOBillNo + "%'";
            }
            if (this.hform.HProcExchBillNo) {
               this.sWhere += " and 流转卡号 like '%" + this.hform.HProcExchBillNo + "%'";
            }
            return this.sWhere
         },
         getPage(page, list) {
            let sindex = (parseInt(page) - 1) * 20
            let eindex = parseInt(page) * 20
@@ -272,6 +305,7 @@
            return newList
         },
         getList() {
            this.sWhere = this.SearchWhere()
            uni.showLoading({
               title: '加载中...'
            })
@@ -328,36 +362,7 @@
            this.listData = []
            this.page = 1
            this.showList = []
            console.log(this.hform)
            if (this.hform.HStatus) {
               if (this.hform.HStatus == '全部') {
                  this.sWhere += "";
               } else if (this.hform.HStatus == '未审核') {
                  this.sWhere += " and 审核人=''";
               } else if (this.hform.HStatus == '已审核') {
                  this.sWhere += " and 审核人<>''";
               } else if (this.hform.HStatus == '已关闭') {
                  this.sWhere += " and 关闭人<>''";
               }
            }
            if (this.hform.BenginHCreateDate) {
               this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.hform.BenginHCreateDate + "'";
            }
            if (this.hform.EndHCreateDate) {
               this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.hform.EndHCreateDate + "'";
            }
            if (this.hform.HBillNo) {
               this.sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'";
            }
            if (this.hform.HICMOBillNo) {
               this.sWhere += " and 生产订单号 like '%" + this.hform.HICMOBillNo + "%'";
            }
            if (this.hform.HProcExchBillNo) {
               this.sWhere += " and 流转卡号 like '%" + this.hform.HProcExchBillNo + "%'";
            }
            this.getList()
         },
         //新增
@@ -378,8 +383,8 @@
               this.operations = -1,
               this.hform = {
                  HStatus: '全部',
                  HBeginDate: '',
                  HEndDate: '',
                  HBeginDate: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0],
                  HEndDate: new Date().toISOString().split('T')[0],
                  HICMOBillNo: '',
                  HBillNo: '',
                  HProcExchBillNo: '',