chenhaozhe
2025-10-30 69360d971adb03d0f3f120096aa742d85f10160d
pages/gongxuOut/form.vue
@@ -4,7 +4,7 @@
            <view class="form-item">
                <view class="title"><text>*</text>条形码:</view>
                <view class="right" style="width: 380rpx;">
                    <input name="HBarCode" v-model="hform.HBarCode" placeholder="请扫描条码" @confirm="toInCode(e)" />
                    <input name="HBarCode" v-model="hform.HBarCode" placeholder="请扫描条码" @confirm="toInCode" />
                </view>
                <uni-icons type="scan"
                    style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
@@ -23,9 +23,12 @@
                    <input v-model="hform.HProcNo" placeholder="请输入(或扫描)流水号"
                        @blur="getHProcNoData2(hform.HBarCode,hform.HProcNo,hform.HSEQNumber)" />
                </view>
                <uni-icons type="scan"
                <!-- <uni-icons type="scan"
                    style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
                    size="20" @click="toScanProcNo"></uni-icons>
                    size="20" @click="toScanProcNo"></uni-icons> -->
            <view class="icon-wrapper" >
               <uni-icons type="search" size="20" @click="showBillList"></uni-icons>
            </view>
            </view>
         <view class="form-item">
             <view class="title">工序编码:</view>
@@ -488,11 +491,13 @@
                    @tap="check">审核</button>
                <button v-if="btnType != 0 && btnType == 3" class="btn-d" style="margin-left: 20rpx;" size="mini"
                    @tap="abandonCheck">反审核</button>
                <flex style="flex: 1;"></flex>
                <!-- <flex style="flex: 1;"></flex> -->
                <button class="btn-b" size="mini" @tap="addNew">新增</button>
                <button class="btn-c" size="mini" @tap="goBack">退出</button>
            </view>
        </view>
      <ProcListPopupVue ref="billList" :HProcExchHBillNo="hform.HProcExchBillNo" :HProcExchHInteID="hform.HProcExchHinteID"
          ></ProcListPopupVue>
    </view>
</template>
<script>
@@ -501,7 +506,9 @@
        getUserInfo
    } from "@/utils/auth.js";
import { CommonUtils } from '../../utils/common';
import ProcListPopupVue from '../../components/ProcListPopup/ProcListPopup.vue';
    export default {
      components: { ProcListPopupVue },
        data() {
            return {
                userInfo: getUserInfo(),
@@ -648,10 +655,11 @@
            } else {
                this.getNewData()
            if(e.HBarCode){
               console.log(e.HBarCode)
               this.hform.HBarCode=e.HBarCode
               setTimeout(() => {
                  this.toInCode(e);
               }, 1000)
                  this.toInCode();
               }, 500)
            }
            
            }
@@ -664,9 +672,30 @@
            this.getHCenterList()
            this.getDefValByUser()
         uni.$on('HProcNoSelectComplete', (e) => {
             console.log("接收到的消息: ", e.HProcNo)
             this.hform.HProcNo=e.HProcNo;
            this.hform.HSEQNumber = e.HSEQNumber;
            this.getHProcNoData2(this.hform.HBarCode,this.hform.HProcNo,this.hform.HSEQNumber)
            this.$refs.billList.exit()
         })
        },
      onUnload() {
          uni.$off('HProcNoSelectComplete')
      },
        methods: {
         //选择工序
         showBillList() {
            if(this.hform.HProcExchBillNo!=""){
               this.$refs.billList.showPopup()
            }else{
               uni.showToast({
                   title: '请先扫描流转卡',
                   icon: 'none'
               })
            }
         },
         //选中全部文本
         selectAllText(e) {
           console.log(e.target)
@@ -774,7 +803,7 @@
                //     }
                // });
            },
            toInCode(e) {
            toInCode() {
                var str = this.hform.HBarCode
                if (str.includes('@')) {
                    const parts = str.split('@');
@@ -1544,7 +1573,10 @@
                    },
                });
            },
            getHProcNoData2(HBarCode, HProcNo,HSEQNumber) {
            getHProcNoData2(HBarCode,HProcNo,HSEQNumber) {
            if(HProcNo==""){
               return;
            }
                uni.request({
                    url: this.serverUrl + '/Cj_StationOutBill/txtHProcNo_KeyDown',
                    data: {
@@ -1922,15 +1954,19 @@
                    console.log(1, res);
                    if (res.data.count == 1) {
                     let processList = res.data.data
                     let self = this;
                     console.log(this.hform)
                     console.log(self.hform)
                     // 1. 先过滤出 HSEQNumber === 'N' 的数据
                     processList = processList.filter(item => item.HSEQNumber === this.hform.HSEQNumber);
                     
                     //当前工序编号
                     const currentIndex = processList.findIndex(item => item["工序号"] === this.hform.HProcNo);
                     const currentIndex = processList.findIndex(item => item["工序号"] == this.hform.HProcNo);
                     // 获取下一个工序(如果存在)
                     const nextProcess = currentIndex !== -1 && currentIndex < processList.length - 1 
                       ? processList[currentIndex + 1] : null;
                      console.log(currentIndex,nextProcess,processList);
                     if(!nextProcess){
                        uni.showToast({
                            title: '没有下一道工序即将跳转新增页面',
@@ -1969,6 +2005,19 @@
</script>
<style lang="scss" scoped>
   .icon-wrapper {
       background-color: #3A78FF;
       border-radius: 100%;
       width: 52rpx;
       height: 52rpx;
       display: flex;
       justify-content: center;
       align-items: center;
       .uni-icons {
           color: #fff !important;
       }
   }
    .form {
        width: 668rpx;
        margin: 20rpx auto;