小小儁爺
2026-01-05 dbae85a492c7cee07f1115757615df910583ad8a
pages/scgl/scbg.vue
@@ -40,8 +40,11 @@
      <!-- 折叠面板 -->
      <!-- <u-collapse @change="change" @close="close" @open="open"> -->
      <!-- @change="collapseChange" -->
      <u-collapse style="max-height: 590px;overflow: auto;">
      <u-collapse style="max-height: 62vh;overflow: auto;">
         <!-- :value='parseFloat(item.ordergoodqty)+"/"+parseFloat(item.orderqty)' -->
         <!--    <scroll-view scroll-y :style="{height: 590 + 'px'}" @scrolltolower="loadMore"> -->
         <u-collapse-item style="position: relative;" :title="item.ordercode" :name='item.ordercode'
            v-if='item.children.length!==0' :value='parseFloat(item.ordergoodqty)+"/"+parseFloat(item.orderqty)'
            :label="item.children.length===0?'未派发':''" :disabled='item.children.length===0'
@@ -121,8 +124,16 @@
         </u-collapse-item>
         <!-- </scroll-view> -->
      </u-collapse>
      <view class="uni-pagination-box">
         <uni-pagination show-icon :page-size="pageSize" :current="currentpage" :total="total"
            @change="pageChange" />
      </view>
      <!-- 弹出层 -->
@@ -144,6 +155,10 @@
               </u-radio-group>
            </view>
            <u--input :placeholder="'请输入'+placeholder2" style="border: 1rpx solid #eee;" :clearable='true'
               v-model="order"></u--input>
            <view style="margin-top: 20px;display: flex;align-items: center;">
               <view class="">
@@ -156,6 +171,7 @@
            </view>
            <view style="display: flex;flex-wrap: wrap;">
               <u-tag style="width:220rpx;" :text="item.name" v-for="item in tagArr" :key="item.code"
                  :closable="true" :show="item.close" @close="tagClose(item)"></u-tag>
@@ -163,7 +179,7 @@
            <view class="head" style="margin-top: 10px;">
            <!--       <view class="head" style="margin-top: 10px;">
               <view class="head_block" style="height: 80rpx; display: flex;justify-content: space-around;">
                  <u-button :plain='today' style="width: 70px;height: 25px;" @click="dateChange('today')"
                     type="primary" shape="circle" text="今日">
@@ -174,9 +190,9 @@
                  <u-button :plain='custom' style="width: 70px;height: 25px;" @click="dateChange('custom')"
                     type="primary" shape="circle" text="自定义"></u-button>
               </view>
            </view>
            </view> -->
            <view v-if="!custom" class="flex_column"
            <!--             <view v-if="!custom" class="flex_column"
               style="display: flex;justify-content: space-around;width: 100%;">
               <view class="" style="display: flex;justify-content: space-evenly;width: 100%;">
                  <view class="titleFont">开始日期</view>
@@ -189,7 +205,7 @@
               </u-button>
            </view>
            <uni-calendar ref="calendar" :range='true' :insert="false" @confirm="calendarConfirm" />
            <uni-calendar ref="calendar" :range='true' :insert="false" @confirm="calendarConfirm" /> -->
         </view>
      </u-popup>
@@ -202,21 +218,30 @@
      <view @click="scan2">
         <drag-ball :x='300' :y="600"></drag-ball>
      </view>
      <scan-code></scan-code>
   </view>
</template>
<script>
   import {
      ProductionScheduleKanban
      ProductOrderSearch
   } from '../../config/api.js';
   import scanCode from '@/components/scan-code/scan-code.vue'
   export default {
      components: {
         scanCode
      },
      onLoad(option) {
         const _this = this
         uni.$off('scancodedate') // 每次进来先 移除全局自定义事件监听器
         uni.$on('scancodedate', function(content) {
            console.log("扫描到的内容为:", content)
            _this.getCheckScanDeviceQrCodeData(content)
            // _this.getCheckScanDeviceQrCodeData(content)
         })
@@ -288,7 +313,11 @@
               //    code: '1006'
               // },
            ], //已选中的产品标签
            order: '', //单号
            placeholder2: '生产订单',
            total: 10,
            currentpage: 1, //第几页
            pageSize: 10, //每页显示多少条
         }
      },
@@ -297,7 +326,7 @@
         let that = this
         uni.startPullDownRefresh({
            success() {
               that.getProductionScheduleKanban()
               that.getProductOrderSearch(that.currentpage)
               uni.showToast({
                  title: "下拉刷新",
                  icon: 'none'
@@ -314,7 +343,7 @@
      mounted() {
         this.init()
         this.getProductionScheduleKanban()
         this.getProductOrderSearch(1)
      },
      methods: {
         init() {
@@ -346,8 +375,14 @@
            })
         },
         // 页数改变时  分页触发
         pageChange(e) {
            this.currentpage = e.current
            this.getProductOrderSearch(e.current)
         },
         // 接口获取
         async getProductionScheduleKanban() {
         async getProductOrderSearch(current) {
            let ordertype = '' // SO:销售订单  MO:生产订单  PO:生产工单
            switch (this.radiovalue) {
               case '生产工单':
@@ -356,12 +391,14 @@
                  ordertype = 'PO'
                  break
               case '生产订单':
                  this.alertTitle = '生产订单数量(共/个)'
                  // this.alertTitle = '生产订单数量(共/个)'
                  this.alertTitle = '工单数量(共/个)'
                  this.placeholder = '请输入生产订单信息'
                  ordertype = 'MO'
                  break
               case '销售订单':
                  this.alertTitle = '销售订单数量(共/个)'
                  // this.alertTitle = '销售订单数量(共/个)'
                  this.alertTitle = '工单数量(共/个)'
                  this.placeholder = '请输入销售订单信息'
                  ordertype = 'SO'
                  break
@@ -371,20 +408,29 @@
            const data = {
               ordertype,
               partcode: this.tagArr.map(i => i.code).join(','),
               Ratetime: this.calendarRange,
               ordercode: this.order,
               Ratetime: '',
               // Ratetime: this.calendarRange,
               page: current,
               rows: this.pageSize,
               prop: 'lm_date',
               sortorder: 'desc'
            }
            const {
               data: res
            } = await ProductionScheduleKanban(data)
            const res = await ProductOrderSearch(data)
            this.collapseArr = res
            this.collapseArrAll = res
            this.alertTitle = this.alertTitle.split('/')[0] + this.collapseArr.length + this.alertTitle.split('/')[
            this.total = res.count
            this.collapseArr = res.data
            this.collapseArrAll = res.data
            this.alertTitle = this.alertTitle.split('/')[0] + this.total + this.alertTitle.split('/')[
               1]
         },
         loadMore() {
         },
         //输入框回车确认事件
         confirmInputBoxValue(val) {
@@ -395,17 +441,20 @@
            switch (this.radiovalue) {
               case '生产工单':
                  this.alertTitle = '工单数量(共/个)'
                  this.alertTitle = '工单数量(共' + this.total + '个)'
                  break
               case '生产订单':
                  this.alertTitle = '生产订单数量(共/个)'
                  this.alertTitle = '工单数量(共' + this.total + '个)'
                  break
               case '销售订单':
                  this.alertTitle = '销售订单数量(共/个)'
                  this.alertTitle = '工单数量(共' + this.total + '个)'
                  break
            }
            this.alertTitle = this.alertTitle.split('/')[0] + this.collapseArr.length + this.alertTitle.split('/')[
               1]
            // this.alertTitle = this.alertTitle.split('/')[0] + this.collapseArr.length + this.alertTitle.split('/')[
            //    1]
         },
@@ -476,7 +525,7 @@
         // 弹出层收起
         popupClose() {
            this.getProductionScheduleKanban()
            this.getProductOrderSearch(1)
            this.popupShow = false
         },
@@ -561,6 +610,7 @@
         // 单选按钮切换
         groupChange(val) {
            console.log(val)
            this.placeholder2 = val
         },
@@ -653,4 +703,14 @@
   ::v-deep .u-cell__body {
      padding-bottom: 40rpx;
   }
   .uni-pagination-box {
      height: 4vh;
      margin: 1vh 0;
      display: flex;
      align-items: center;
      justify-content: center;
      // background-color: #fff;
   }
</style>