llj
10 天以前 ca91837812e9ab2cb69b04d8e00c52034553a1d0
pages/weiwaigxOut/Cj_StationEntrustOutBillList.vue
@@ -2,6 +2,17 @@
   <view class="content">
      <view class="form">
         <view class="form-item">
               <view class="title">流转卡号:</view>
               <view class="right">
                  <input v-model="hform.HProcExchBillNo" placeholder="请输入工序流转卡号" />
               </view>
               <view>
               <uni-icons type="scan"
                  style="background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;font-weight: 500;"
                  size="20" @click="toScanCode"></uni-icons>
               </view>
            </view>
         <view class="form-item">
            <view class="title">状态:</view>
            <view class="right">
               <picker :range="arrayStatus" :value="hform.HStatus" @change="HStatusChange">
@@ -38,17 +49,7 @@
                  <input v-model="hform.HBillNo" placeholder="请输入单据号" />
               </view>
            </view>
            <view class="form-item">
               <view class="title">流转卡号:</view>
               <view class="right">
                  <input v-model="hform.HProcExchBillNo" placeholder="请输入工序流转卡号" />
               </view>
               <view>
               <uni-icons type="scan"
                  style="background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;font-weight: 500;"
                  size="20" @click="toScanCode"></uni-icons>
               </view>
            </view>
            <view class="form-item">
               <view class="title">产品代码:</view>
               <view class="right">
@@ -213,52 +214,41 @@
            </view>
            
            <view class="op" v-if="operations == index">
               <button class="op1" size="mini" plain @tap.stop="check(item)">审核</button>
               <button class="op1" size="mini" plain @tap.stop="check(item)" v-if="item.审核人===''">审核</button>
               <!-- <button class="op2" size="mini" plain @tap.stop="antiCheck(item)">反审核</button> -->
               <button class="op1" size="mini" plain @tap.stop="firstCheck(item)" v-if="false">首检</button>
               <button class="op3" size="mini" plain @tap.stop="edit(item)" v-if="hform.HStatus === '已审核'">编辑</button>
               <button class="op3" size="mini" plain @tap.stop="edit(item)" v-if="item.审核人===''">编辑</button>
               <button class="op4" size="mini" plain @tap.stop="del(item)" v-if="false">删除</button>
               <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button>
            </view>
         </uni-card>
      </view>
      <StationOutBillPopup ref="billList"> </StationOutBillPopup>
      <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 class="popup-mask" v-if="popupVisible" @tap="cancelCheck">
         <view class="popup-content" @tap.stop>
            <view class="popup-title">审核确认</view>
            <view class="popup-item">
               <text class="popup-label">数量:</text>
               <input class="popup-input" type="number" v-model="popupForm.HQty" placeholder="请输入数量" />
            </view>
            <view class="popup-item">
               <text class="popup-label">制单人:</text>
               <input class="popup-input" v-model="popupForm.HUser" placeholder="请输入制单人" />
            </view>
            <view class="popup-btns">
               <button class="popup-btn cancel" @tap="cancelCheck">取消</button>
               <button class="popup-btn confirm" @tap="confirmCheck()">确定</button>
            </view>
         </view>
      </view>
   </view>
      
</template>
<script>
   import { getUserInfo } from "@/utils/auth.js";
   import StationOutBillPopup from "../../components/StationOutBillPopup/StationEntrustOutBillListPopup.vue"
   export default {
      components:{StationOutBillPopup},
       data() {
           return {
            popupVisible: false,
            popupItem: null,
            popupForm: {
               HQty: '',
               HUser: ''
               HUser: '',
               HWasterQty:'',//报废
               HPieceQty:'',//不良
               HSourceName:'',//生产资源
               HCenter:'',//工作中心
            },
            userInfo:getUserInfo(),
            serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
@@ -283,8 +273,9 @@
            page:1,
           }
       },
      onLoad() {
         this.getList()
         this.search()
         // console.log(this.userInfo,uni.getStorageSync('HUserName'))
      },
      onReachBottom: function() {
@@ -322,7 +313,7 @@
            })
         },
         getList(){
            this.sWhere += ` and 制单人 like '%${this.userInfo.Czymc}'`
            // this.sWhere += ` and 制单人 like '%${this.userInfo.Czymc}'`
            console.log(this.sWhere)
            uni.showLoading({
               title:'加载中...'
@@ -396,12 +387,12 @@
                   this.sWhere += " and 关闭人<>''";
                }
            }
            // if (this.hform.HBeginDate) {
            //     this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.hform.HBeginDate + "'";
            // }
            // if (this.hform.HEndDate) {
            //     this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.hform.HEndDate + "'";
            // }
            if (this.hform.HBeginDate) {
                this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.hform.HBeginDate + "'";
            }
            if (this.hform.HEndDate) {
                this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.hform.HEndDate + "'";
            }
            if (this.hform.HBillNo) {
                this.sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'";
            }
@@ -446,7 +437,7 @@
               HNumber:'',
               HName:'',
            }
            this.getList()
            this.search()
         },
         
         //首检
@@ -507,67 +498,13 @@
            });
         },
         //审核
         check(item){
          check(item){
            console.log(item)
            if (item.HBillStatus > 0) {
                // uni.showToast({
                //    title:'单据不为未审核状态!'
                // })
               this.popupItem = item;
               this.popupForm.HQty = 0;
               this.popupForm.HUser = uni.getStorageSync('HUserName');
               this.popupVisible = true;
            }
             console.log(this.$refs.billList);
            this.$refs.billList.showPopup(item)
         },
         confirmCheck(item) {
            // if (!this.popupForm.HQty) {
            //    uni.showToast({ title: '请输入数量', icon: 'none' });
            //    return;
            // }
            // if (!this.popupForm.HUser) {
            //    uni.showToast({ title: '请输入制单人', icon: 'none' });
            //    return;
            // }
            uni.request({
               url: this.serverUrl + '/Cj_StationEntrustOutBill/setOtherProperty',
               method: 'Get',
               data: {
                  HInterID: this.popupItem.HInterID,
                  HQty: this.popupForm.HQty,
                  user: this.popupForm.HUser // 制单人
               },
               success: (res) => {
                  console.log(1, res);
                  if (res.data.count == 1) {
                     this.popupVisible = false;
                     uni.showToast({
                        title: '审核成功',
                        icon: 'none'
                     });
                     this.search();
                  } else {
                     uni.showToast({
                        title: res.data.Message,
                        icon: 'none'
                     });
                  }
               },
               fail: (res) => {
                  console.log(res);
                  uni.showToast({
                     title: '接口请求失败',
                     icon: 'none'
                  });
               }
            });
         },
         cancelCheck() {
            this.popupVisible = false;
            this.popupItem = null;
            this.popupForm.HQty = '';
            this.popupForm.HUser = '';
         }
         // //反审核
         // antiCheck(item){