guoyuji
2024-02-23 3bee17a52f3ee1f493048465f3e07b31c2102ee5
north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue
@@ -226,19 +226,26 @@
      switch (code) {
        case 'add': {
          const selectRecords = $grid.getCheckboxRecords()
          console.log(selectRecords)
          if (selectRecords.length === 0) {
            ElMessage.warning("未选中数据")
            return
          }
          let order_id=""
          const array=[];
          for (let i=0;i<selectRecords.length;i++){
            array.push(selectRecords[i].customerId)
            if(i+1===selectRecords.length){
              order_id+=selectRecords[i].orderId
            }else{
              order_id+=selectRecords[i].orderId+"|"
            }
          }
          //判断所选客户是否相同
          if(!isAllEqual(array)){
            ElMessage.warning("请选择相同的客户订单")
            return
          }
          router.push({path: '/main/delivery/createDelivery', query: { orderId: order_id }})
@@ -249,6 +256,17 @@
  }
}
//数组数据验重
function isAllEqual(array){
  if(array.length>0){
    return !array.some(function(value,index){
      return value !== array[0];
    });
  }else{
    return true;
  }
}