廖井涛
2024-08-19 1d193f2cc23f54634ef8ed73c11436fbe76bb575
north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
@@ -74,13 +74,14 @@
const orderOtherMoney = ref(null)
let maxProcseeId=null
//第一次加载数据
request.post(`/processCard/selectNoCard/${orderId}/${productionId}`, filterData.value).then((res) => {
  if (res.code == 200) {
    pageTotal.value = res.data.total
    maxProcseeId=res.data.maxFlowCard[0].process_id
    orderOtherMoney.value = res.data.orderOtherMoney
    orderOtherMoney.value.forEach(item => {
      let column = {
@@ -354,7 +355,32 @@
    index = leftData[0].landingSequence + 1
    //index = index.toString().padStart(2, '0')
  }
  const processId = productionId + index.toString().padStart(3, '0')
  let processId= null
  // if (leftData.length !== 0){
  //   processId = productionId + index.toString().padStart(3, '0')
  // }
  // else {
    if (maxProcseeId!== null || maxProcseeId!== undefined|| maxProcseeId!== ''){
      if (leftData.length !== 0){
        const str=leftData[0].processId
        const lastThree = str.slice(-3);
        const result =  lastThree*1 + 1;
        processId= productionId + result.toString().padStart(3, '0')
      }
      else {
        // 截取后三位
        const lastThree = maxProcseeId.slice(-3);
        const result =  lastThree*1 + 1;
        processId= productionId + result.toString().padStart(3, '0')
      }
    }
    else {
      processId = productionId + index.toString().padStart(3, '0')
    }
  //}
  const regex = /^(\d+|)$/;
  if (!regex.test(checkedNum.value)) {
    ElMessage.warning(t('processCard.schedulingNo'))