wtt
2025-10-16 a6bc138c8b7ba4f8411e8731c412df8a9574c93d
pages/gongxuOutSendWork/table.vue
@@ -1,7 +1,11 @@
<template>
   <view class="content">
      <view class="list" v-for="(item,index) in showList" :key="index">
         <uni-card :title="item.任务单" :extra="item.单据号" style="margin: 10px;" @tap="showDetail = showDetail==index?-1:index">
         <uni-card :title="item.任务单号"
         :extra="item.单据号"
         style="margin: 10px;"
         @tap="showDetail = showDetail==index?-1:index"
         :id="'card-'+index">
            <view class="card-detail">
               <view class="detail" v-if="item.工序流转卡号">
                  <text>流转卡号:</text>{{item.工序流转卡号}}
@@ -15,11 +19,14 @@
               <view class="detail" v-if="item.款号">
                  <text>款号:</text>{{item.款号}}
               </view>
               <view class="detail" v-if="item.当前工序">
                  <text>当前工序:</text>{{item.当前工序}}
               <view class="detail" v-if="item.工序名称">
                  <text>工序名称:</text>{{item.工序名称}}
               </view>
               <view class="detail" v-if="item.当前工序代码">
                  <text>工序代码:</text>{{item.当前工序代码}}
               <view class="detail" v-if="item.工序代码">
                  <text>工序代码:</text>{{item.工序代码}}
               </view>
               <view class="detail" v-if="item.剩余数量">
                  <text>剩余数量:</text>{{item.剩余数量}}
               </view>
               <view class="detail" v-if="item.日期">
                  <text>日期:</text>{{item.日期.substr(0,10)}}
@@ -32,69 +39,32 @@
               <view class="detail" v-if="item.流水号">
                  <text>流水号:</text>{{item.流水号}}
               </view>
               <view class="detail" v-if="item.出站数量">
                  <text>出站数量:</text>{{item.出站数量}}
               <view class="detail" v-if="item.流转卡数量">
                  <text>流转卡数量:</text>{{item.流转卡数量}}
               </view>
               <view class="detail" v-if="item.不良数量">
                  <text>不良数量:</text>{{item.不良数量}}
               <view class="detail" v-if="item.操作工名称">
                  <text>操作工:</text>{{item.操作工名称}}
               </view>
               <view class="detail" v-if="item.报废数量">
                  <text>报废数量:</text>{{item.报废数量}}
               <view class="detail" v-if="item.操作工代码">
                  <text>操作工代码:</text>{{item.操作工代码}}
               </view>
               <view class="detail" v-if="item.包装标识">
                  <text>包装标识:</text>{{item.包装标识}}
               </view>
               <view class="detail" v-if="item.包装标识代码">
                  <text>包装标识代码:</text>{{item.包装标识代码}}
               </view>
               <view class="detail" v-if="item.出站时间">
                  <text>出站时间:</text>{{item.出站时间.substr(0,19)}}
               </view>
               <view class="detail" v-if="item.操作员">
                  <text>操作员:</text>{{item.操作员}}
               </view>
               <view class="detail" v-if="item.操作员代码">
                  <text>操作员代码:</text>{{item.操作员代码}}
               </view>
               <view class="detail" v-if="item.生产资源">
                  <text>生产资源:</text>{{item.生产资源}}
               <view class="detail" v-if="item.生产资源名称">
                  <text>生产资源:</text>{{item.生产资源名称}}
               </view>
               <view class="detail" v-if="item.生产资源代码">
                  <text>生产资源代码:</text>{{item.生产资源代码}}
               </view>
               <view class="detail" v-if="item.生产班组">
                  <text>生产班组:</text>{{item.生产班组}}
               <view class="detail" v-if="item.班组名称">
                  <text>生产班组:</text>{{item.班组名称}}
               </view>
               <view class="detail" v-if="item.生产班组代码">
                  <text>生产班组代码:</text>{{item.生产班组代码}}
               </view>
               <view class="detail" v-if="item.LOT数量">
                  <text>LOT数量:</text>{{item.LOT数量}}
               <view class="detail" v-if="item.班组代码">
                  <text>生产班组代码:</text>{{item.班组代码}}
               </view>
               <view class="detail" v-if="item.制单人">
                  <text>制单人:</text>{{item.制单人}}
                  <text>派单人:</text>{{item.制单人}}
               </view>
               <view class="detail" v-if="item.制单日期">
                  <text>制单日期:</text>{{item.制单日期.substr(0,10)}}
               </view>
               <view class="detail" v-if="item.修改人">
                  <text>修改人:</text>{{item.修改人}}
               </view>
               <view class="detail" v-if="item.修改日期">
                  <text>修改日期:</text>{{item.修改日期.substr(0,10)}}
               </view>
               <view class="detail" v-if="item.审核人">
                  <text>审核人:</text>{{item.审核人}}
               </view>
               <view class="detail" v-if="item.审核日期">
                  <text>审核日期:</text>{{item.审核日期.substr(0,10)}}
               </view>
               <view class="detail" v-if="item.关闭人">
                  <text>关闭人:</text>{{item.关闭人}}
               </view>
               <view class="detail" v-if="item.关闭日期">
                  <text>关闭日期:</text>{{item.关闭日期.substr(0,10)}}
               </view>
               <view class="detail" v-if="item.备注">
                  <text>备注:</text>{{item.备注}}
@@ -105,7 +75,7 @@
               <view class="part" style="border-right: 1px solid #eee;">
                  <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>收起
               </view>
               <view class="part" @tap.stop="operations = operations==index?-1:index">
               <view class="part" @tap.stop="showStationOutBill(item,index)">
                  <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>报工
               </view>
            </view>
@@ -113,33 +83,40 @@
               <view class="part" style="border-right: 1px solid #eee;">
                  <uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>更多信息
               </view>
               <view class="part" @tap.stop="operations = operations==index?-1:index">
               <view class="part" @tap.stop="showStationOutBill(item,index)">
                  <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>报工
               </view>
            </view>
         </uni-card>
      </view>
      
      <BillListPopupVue ref="billList"></BillListPopupVue>
      <view class="over" v-if="listData.length == 0">暂无数据</view>
      <view class="over" v-if="listData.length != 0 && listData.length != showList.length">加载中...</view>
      <view class="over" v-if="listData.length != 0 && listData.length == showList.length">已到底</view>
      <!-- 占位元素,确保页面可滚动 -->
      <view style="height: 75vh;"></view>
   </view>
</template>
<script>
   import { getUserInfo } from "@/utils/auth.js";
   import BillListPopupVue from '../../components/StationOutBillPopup/StationOutBillPopup.vue';
   export default {
       data() {
           return {
            userInfo:getUserInfo(),
            serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
            sWhere:'',
            sWhere:' and 1=1',
            listData:[],
            showList:[],
            showDetail:-1,
            page:1,
           }
       },
      components: {
          BillListPopupVue
      },
      onLoad() {
         this.getList()
         // console.log(this.userInfo,uni.getStorageSync('HUserName'))
@@ -157,6 +134,19 @@
         }, 1000);
      },
       methods: {
         //出站汇报显示
         showStationOutBill(e,index) {
            console.log(e);
            console.log(index);
            uni.pageScrollTo({
               //scrollTop: 20,
               selector:`#card-${index}`,
               duration: 100,
            });
            const hBarCode = e.工序流转卡号+"@"+e.工序号+"@"+e.序列号;
             this.$refs.billList.showPopup(hBarCode);
         },
         getPage(page,list){
            let sindex = (parseInt(page) - 1) * 20
            let eindex = parseInt(page) * 20
@@ -171,17 +161,16 @@
               })
               return false;
            }
            this.sWhere += ` and HEmpID = ${this.userInfo.HEmpID}
            and CONVERT(DATE, 日期) = CONVERT(DATE, GETDATE())`
            this.sWhere += ` and CONVERT(DATE, 日期) = CONVERT(DATE, GETDATE())`
            uni.showLoading({
               title:'加载中...'
            })
            uni.request({
                url: this.serverUrl + '/Sc_ProcExchSendWorkBill/Sc_ProcExchSendWorkBillList',
                url: this.serverUrl + '/Sc_ProcExchSendWorkBill/Sc_ProcExchSendWorkBillListByEmp',
               data:{ 
                  sWhere: this.sWhere,
                  user: uni.getStorageSync('HUserName'),
                  HBillSubType:'',
                  HEmpID:this.userInfo.HEmpID,
               },
                success: (res) => {
                  // console.log(1,res.data.data);
@@ -210,7 +199,16 @@
            });
            this.sWhere = ``
         },
         //重置
         clear(){
            this.listData = []
            this.page = 1
            this.showList = []
            this.sWhere = ' and 1=1'
            this.showDetail = -1,
            this.getList()
         },
       }
   }
</script>