小小儁爺
2025-11-19 0552bde02a9f07f52bcff9a044b9de3e64f868be
pages/scgl/scbg.vue
@@ -42,25 +42,26 @@
      <!-- @change="collapseChange" -->
      <u-collapse style="max-height: 590px;overflow: auto;">
         <!-- :value='parseFloat(item.ordergoodqty)+"/"+parseFloat(item.orderqty)' -->
         <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'
            v-for="item in collapseArr" :key="item.ordercode">
         <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'
               v-for="item in collapseArr" :key="item.ordercode">
            <view style="position: absolute;left: 30rpx;top:34px;font-size: 24rpx;color: #999;">
               {{item.partname}} {{item.partspec}}
            </view>
               <view style="position: absolute;left: 30rpx;top:34px;font-size: 24rpx;color: #999;">
                  {{item.partname}} {{item.partspec}}
               </view>
            <!-- <view style="position: absolute;width: 26%;left: 44%;top:16px;"> -->
            <view style="position: absolute;width: 120px;left: 44%;top:16px;color:#0659ff"
               @click="progressClick(item.ordercode)">
               <!-- {{item.partname}}{{item.partspec}} -->
               <u-line-progress :percentage="parseFloat((item.ordergoodqty*100/item.orderqty).toFixed(2))"
                  inactiveColor="#d1d6f5" height="10" activeColor="#0659ff"></u-line-progress>
            </view>
               <!-- <view style="position: absolute;width: 26%;left: 44%;top:16px;"> -->
               <view style="position: absolute;width: 120px;left: 44%;top:16px;color:#0659ff"
                  @click="progressClick(item.ordercode)">
                  <!-- {{item.partname}}{{item.partspec}} -->
                  <u-line-progress :percentage="parseFloat((item.ordergoodqty*100/item.orderqty).toFixed(2))"
                     inactiveColor="#d1d6f5" height="10" activeColor="#0659ff"></u-line-progress>
               </view>
            <!--          <view style="position: absolute;width: 100px;right: 33px;  top:13px; ">
               <!--          <view style="position: absolute;width: 100px;right: 33px;  top:13px; ">
               <view class="" style="display: flex;justify-content: flex-end;">
                  <view style="color: #0659ff;">
                     {{parseFloat(item.ordergoodqty)}}
@@ -73,55 +74,55 @@
 -->
            <view v-if="radiovalue==='生产工单'" style="margin:0 0  5px">
               <view class="flex_column">
                  <view style="display:flex">
                     <view class="titleFont" style="font-size: 14px;">产品编码:</view>
                     <view class="contentFont" style="font-size: 14px;">{{item.partcode}}</view>
                  </view>
                  <view style="display:flex">
                     <view class="titleFont" style="font-size: 14px;">产品名称:</view>
                     <view class="contentFont" style="font-size: 14px;">{{item.partname}}</view>
                  </view>
                  <view style="display:flex">
                     <view class="titleFont" style="font-size: 14px;">产品规格:</view>
                     <view class="contentFont" style="font-size: 14px;">{{item.partspec?item.partspec:'/'}}
               <view v-if="radiovalue==='生产工单'" style="margin:0 0  5px">
                  <view class="flex_column">
                     <view style="display:flex">
                        <view class="titleFont" style="font-size: 14px;">产品编码:</view>
                        <view class="contentFont" style="font-size: 14px;">{{item.partcode}}</view>
                     </view>
                  </view>
               </view>
            </view>
            <!-- {{item.children}} -->
            <!-- <u--text class="u-collapse-content"> -->
            <u-steps :current="-1" inactiveColor='#0659FF' direction="column">
               <view v-for="(it,ind) in item.children" :key="item.ordercode+it.name+ind"
                  @click="gotoPage(item.ordercode,it.code)" style="display: flex;align-items: center;">
                  <!-- <u-steps-item :title="it.code+'/'+it.name+it.spec"></u-steps-item> -->
                  <u-steps-item :title="it.code+'/'+it.name"></u-steps-item>
                  <view class="" style="width: 100px;">
                     <u-line-progress :percentage="parseFloat((it.goodqty*100/it.planqty).toFixed(2))"
                        inactiveColor="#d1d6f5" height="10" activeColor="#0659ff"></u-line-progress>
                  </view>
                  <view style="width: 30%;text-align: right;">
                     <view class="" style="display: flex;justify-content: flex-end;">
                        <view style="color: #0659ff;">
                           {{parseFloat(it.goodqty)}}
                        </view>
                        <view>
                           /{{ parseFloat(it.planqty)}}
                     <view style="display:flex">
                        <view class="titleFont" style="font-size: 14px;">产品名称:</view>
                        <view class="contentFont" style="font-size: 14px;">{{item.partname}}</view>
                     </view>
                     <view style="display:flex">
                        <view class="titleFont" style="font-size: 14px;">产品规格:</view>
                        <view class="contentFont" style="font-size: 14px;">{{item.partspec?item.partspec:'/'}}
                        </view>
                     </view>
                  </view>
               </view>
            </u-steps>
            <!-- </u--text> -->
               <!-- {{item.children}} -->
               <!-- <u--text class="u-collapse-content"> -->
               <u-steps :current="-1" inactiveColor='#0659FF' direction="column">
                  <view v-for="(it,ind) in item.children" :key="item.ordercode+it.name+ind"
                     @click="gotoPage(item.ordercode,it.code)" style="display: flex;align-items: center;">
                     <!-- <u-steps-item :title="it.code+'/'+it.name+it.spec"></u-steps-item> -->
                     <u-steps-item :title="it.code+'/'+it.name"></u-steps-item>
                     <view class="" style="width: 100px;">
                        <u-line-progress :percentage="parseFloat((it.goodqty*100/it.planqty).toFixed(2))"
                           inactiveColor="#d1d6f5" height="10" activeColor="#0659ff"></u-line-progress>
                     </view>
                     <view style="width: 30%;text-align: right;">
                        <view class="" style="display: flex;justify-content: flex-end;">
                           <view style="color: #0659ff;">
                              {{parseFloat(it.goodqty)}}
                           </view>
                           <view>
                              /{{ parseFloat(it.planqty)}}
                           </view>
                        </view>
                     </view>
                  </view>
               </u-steps>
               <!-- </u--text> -->
         </u-collapse-item>
            </u-collapse-item>
         </scroll-view>
      </u-collapse>
@@ -129,7 +130,7 @@
      <!-- closeIconPos='top-left' closeOnClickOverlay  closeable='true' -->
      <u-popup :show="popupShow" mode="right" @close="popupClose" @open="popupOpen">
         <view style="margin: 120px 10px 20px;" class="flex_column">
            <!--
            <view style="display: flex;">
               <view>
                  单据类型:
@@ -142,7 +143,11 @@
                  </u-radio>
               </u-radio-group>
            </view> -->
            </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;">
@@ -156,6 +161,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 +169,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 +180,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 +195,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>
@@ -208,7 +214,7 @@
<script>
   import {
      ProductionScheduleKanban
      ProductOrderSearch
   } from '../../config/api.js';
   export default {
      onLoad(option) {
@@ -288,9 +294,26 @@
               //    code: '1006'
               // },
            ], //已选中的产品标签
            order: '', //单号
            placeholder2: '生产订单'
         }
      },
      // 监听下拉刷新动作(UniApp 原生生命周期)
      onPullDownRefresh() {
         let that = this
         uni.startPullDownRefresh({
            success() {
               that.getProductOrderSearch()
               uni.showToast({
                  title: "下拉刷新",
                  icon: 'none'
               })
            },
            complete() {
               uni.stopPullDownRefresh()
            }
         })
      },
      created() {
@@ -298,7 +321,7 @@
      mounted() {
         this.init()
         this.getProductionScheduleKanban()
         this.getProductOrderSearch()
      },
      methods: {
         init() {
@@ -331,7 +354,7 @@
         },
         // 接口获取
         async getProductionScheduleKanban() {
         async getProductOrderSearch() {
            let ordertype = '' // SO:销售订单  MO:生产订单  PO:生产工单
            switch (this.radiovalue) {
               case '生产工单':
@@ -340,12 +363,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
@@ -355,12 +380,14 @@
            const data = {
               ordertype,
               partcode: this.tagArr.map(i => i.code).join(','),
               Ratetime: this.calendarRange,
               ordercode: this.order,
               Ratetime: '',
               // Ratetime: this.calendarRange,
            }
            const {
               data: res
            } = await ProductionScheduleKanban(data)
            } = await ProductOrderSearch(data)
            this.collapseArr = res
            this.collapseArrAll = res
@@ -368,7 +395,9 @@
               1]
         },
         loadMore() {
         },
         //输入框回车确认事件
         confirmInputBoxValue(val) {
@@ -460,7 +489,7 @@
         // 弹出层收起
         popupClose() {
            this.getProductionScheduleKanban()
            this.getProductOrderSearch()
            this.popupShow = false
         },
@@ -545,6 +574,7 @@
         // 单选按钮切换
         groupChange(val) {
            console.log(val)
            this.placeholder2 = val
         },