wankeda
2025-06-24 6cc35000a6e138cfad96e7b02f8aeddcdb4ba6bf
´úÂë¹ÜÀí/NEWCode/WIDESEAWCS_PDA/pages/½ÐÁÏ/¸º¼«½ÐÁÏ.vue
@@ -36,6 +36,8 @@
               <u-gap height="10"></u-gap>
               <!-- è¾“入框,使用 v-model ç»‘定输入值 -->
               <uni-easyinput v-model="inputValue" placeholder="请输入叫料的烘烤设备" />
               <u-gap height="10"></u-gap>
               <uni-easyinput type="number" v-model="numberValue" placeholder="请输入叫料数量" />
            </view>
         </u-modal>
         <!-- ä½¿ç”¨ uni-popup ç»„件,设置为对话框类型 -->
@@ -47,6 +49,8 @@
               <view class="popup-content">{{ content }}</view>
               <!-- è¾“入框,使用 v-model ç»‘定输入值 -->
               <uni-easyinput v-model="inputValue" placeholder="请输入内容" />
               <u-gap height="10"></u-gap>
               <uni-easyinput type="number" v-model="numberValue" placeholder="请输入叫料数量" />
               <!-- æŒ‰é’®ç»„ -->
               <view class="button-group">
                  <!-- å…³é—­æŒ‰é’® -->
@@ -79,7 +83,9 @@
            content: '欢迎使用 uni-popup!',
            msgType: 'success',
            value: '',
            inputValue: ''
            inputValue: '',
            numberValue: '',
            currentAvailableQuantity: 0
         };
      },
      onLoad() {
@@ -97,17 +103,35 @@
               current: this.current,
               size: this.size
            };
            // ä½¿ç”¨åˆ›æ™ºå®Œæ•´æŽ¥å£
            this.$u.post('http://192.168.31.240:9090/makerwit/selectKHWareType', null).then(res => {
               console.log(res);
               this.$t.message.closeLoading();
               cb && cb();
               if (cb != null) this.listData = [];
               this.listData = [...this.listData, ...res.data];
               console.log(this.listData);
            }).catch((err) => {
               this.$t.message.toast(err.message);
            uni.getStorage({
               key: 'storage_key_ipAddress',
               success: (res) => {
                  this.$t.message.loading();
                  let formDataParam = {
                     current: this.current,
                     size: this.size
                  };
                  // ä½¿ç”¨åˆ›æ™ºå®Œæ•´æŽ¥å£
                  // this.$u.post('http://192.168.31.240:9090/makerwit/selectKHWareType', null).then(res => {
                  this.$u.post(res.data.CZFJiP + '/makerwit/selectKHWareType', null).then(res => {
                     console.log(res);
                     this.$t.message.closeLoading();
                     cb && cb();
                     if (cb != null) this.listData = [];
                     this.listData = [...this.listData, ...res.data];
                     console.log(this.listData);
                  }).catch((err) => {
                     this.$t.message.toast(err.message);
                  });
               },
               fail: (err) => {
                  this.$t.message.toast('请先设置IP地址');
                  uni.navigateTo({
                     url: '/pages/SetAddress/SetAddress',
                  });
               },
            });
         },
         clickLoadMore(e) {
            this.status = 'loading';
@@ -119,53 +143,70 @@
            console.log(this.$refs);
            // this.$refs.popup.open();
            this.Modalshow = true;
            this.content = `工单:${orderNo}\n型号:${productCode}\n可叫数量:${number}\n请确认是否叫任务(默认4个)`;
            this.content = `工单:${orderNo}\n型号:${productCode}\n可叫数量:${number}\n请确认是否叫任务`;
            this.currentAvailableQuantity = number;
            // this.numberValue = number > 4 ? 4 : number; // è®¾ç½®é»˜è®¤å€¼ä¸º4或可用数量
         },
         confirmInput() {
            this.$t.message.loading();
            // æå–输入框的值
            const inputValue = this.inputValue;
            const numberValue = parseInt(this.numberValue);
            // æå–工单编号
            const orderNo = this.content.match(/工单:(.*)\n/)[1];
            // æå–型号
            const productCode = this.content.match(/型号:(.*)\n/)[1];
            // æå–可叫数量
            const availableQuantity = this.content.match(/可叫数量:(.*)\n/)[1];
            if (inputValue == "") {
               this.$t.message.toast('请输入烘烤设备');
               return;
            }
            if (availableQuantity <= 0) {
               this.$t.message.toast('可叫数量为0,无法叫任务');
            if (numberValue <= 0) {
               this.$t.message.toast('叫料数量必须大于0');
               return;
            }
            if (numberValue > this.currentAvailableQuantity) {
               this.$t.message.toast('叫料数量不能超过可叫数量');
               return;
            }
            let guid =this.generateUUID()
            let formDataParam = {
               dTaskId: this.generateUUID(),
               dTaskId: guid,
               productCode: productCode,
               orderNo: orderNo,
               number: availableQuantity > 4 ? 4 : availableQuantity,
               taskNo:2,
               number: numberValue,
               inputValue: inputValue,
               DTaskId: guid,
               ProductCode: productCode,
               OrderNo: orderNo,
               Number: numberValue,
               InputValue: inputValue,
               TaskType: "负极"
               // ...其他需要传递的参数
            };
            // ä½¿ç”¨åˆ›æ™ºå®Œæ•´æŽ¥å£
            this.$u.post('/api/PDA/AddCZTask', formDataParam).then(res => {
               if (res.status) {
                  this.$u.post('http://192.168.31.240:9090/makerwit/insertTask', formDataParam).then(res => {
                  const value = uni.getStorageSync('storage_key_ipAddress');
                  // ä½¿ç”¨åˆ›æ™ºå®Œæ•´æŽ¥å£
                  this.$u.post(value.CZFJiP + '/makerwit/insertTask', formDataParam).then(res => {
                     this.$t.message.closeLoading();
                     console.log(formDataParam);
                     if (res.code == 200) {
                        this.$t.message.toast('呼叫成功');
                        this.inputValue="",
                        this.numberValue="",
                        this.$refs.popup.close();
                        // this.submit();
                     } else {
                        this.$t.message.toast(res.msg);
                        this.$t.message.toast(res.message);
                     }
                  });
                  // this.submit();
               } else {
                  this.$t.message.toast(res.msg);
                  this.$t.message.toast(res.message);
               }
            }).catch((err) => {
               this.$t.message.toast(err.message);
@@ -249,44 +290,4 @@
   .uni-ellipsis-1 {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
   }
   .uni-ellipsis-2 {
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
   }
   .popup-container {
      padding: 20px;
      text-align: center;
   }
   .popup-content {
      margin-bottom: 15px;
      font-size: 16px;
   }
   .custom-button {
      border: none;
      border-radius: 5px;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
   }
   .confirm-button:hover {
      background-color: #0056b3;
   }
   .slot-content {
      font-size: 28rpx;
      color: $u-content-color;
      padding-left: 30rpx;
   }
</style>
      white-space