廖井涛
7 天以前 a660db06773007b1be690e0674829c00a57aeb7b
north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabelXJTwo.vue
@@ -31,13 +31,17 @@
  faceOrientation:null,//内外面
  type:null,//标签模板
  lableType:null,//标签类型
  switch:null//判断是否为新打印
  switch:null,//判断是否为新打印
  dataType:null,
  projectNo:null
})
const {currentRoute} = useRouter()
const route = currentRoute.value
let type = props.type
let dataType = props.dataType
let faceOrientation = props.faceOrientation
let projectNo=props.projectNo
if (type.indexOf("英文")>-1 && faceOrientation==="此面为室内面"){
  faceOrientation='INSIDE'
}
@@ -45,36 +49,77 @@
  faceOrientation='OUTSIDE'
}
let lableType = props.lableType
data.value.printList = JSON.parse(props.list)
let switchType = props.switch
onMounted(() => {
      request.post(`/processCard/getSelectPrintCustomLabelDetails/${type}/${lableType}`, data.value).then((res) => {
        if (res.code == 200) {
  if(parseInt(dataType)===1){
    data.value.printList = JSON.parse(props.list)
    request.post(`/processCard/getSelectPrintCustomLabelDetails/${type}/${lableType}`, data.value).then((res) => {
      if (res.code == 200) {
          produceList.value = deepClone(res.data.title)
          list.value = deepClone(res.data.data)
          const data = produceList.value[0].value
          dataList = JSON.parse(`[${data}]`);
          if (switchType===true){
            labelList = props.titleList
          }else {
            labelList = dataList[0]
          }
          for (let i = 0; i < list.value.length; i++) {
            let count = list.value[i].data.length
            for (let j = 0; j < count; j++) {
              for (let k = 0; k < list.value[i].data[j].quantity; k++) {
                lastList.value.push(list.value[i].data[j])
              }
        produceList.value = deepClone(res.data.title)
        list.value = deepClone(res.data.data)
        const data = produceList.value[0].value
        dataList = JSON.parse(`[${data}]`);
        if (switchType===true){
          labelList = props.titleList
        }else {
          labelList = dataList[0]
        }
        for (let i = 0; i < list.value.length; i++) {
          let count = list.value[i].data.length
          for (let j = 0; j < count; j++) {
            for (let k = 0; k < list.value[i].data[j].quantity; k++) {
              lastList.value.push(list.value[i].data[j])
            }
          }
        } else {
          ElMessage.warning(res.msg)
        }
      })
      } else {
        ElMessage.warning(res.msg)
      }
    })
  }else if(parseInt(dataType)===2){
    request.post(`/processCard/getPrintCustomDataProjectNo/${type}/${projectNo}`, data.value).then((res) => {
      if (res.code == 200) {
        produceList.value = deepClone(res.data.title)
        list.value = deepClone(res.data.data)
        const data = produceList.value[0].value
        dataList = JSON.parse(`[${data}]`);
        if (switchType===true){
          labelList = props.titleList
        }else {
          labelList = dataList[0]
        }
        lastList.value = deepClone(res.data.data)
      } else {
        ElMessage.warning(res.msg)
      }
    })
  }else if(parseInt(dataType)===3){
    data.value.printList = JSON.parse(props.list)
    request.post(`/processCard/getPrintCustomDataProjectNoDetail/${type}`, data.value).then((res) => {
      if (res.code == 200) {
        produceList.value = deepClone(res.data.title)
        list.value = deepClone(res.data.data)
        const data = produceList.value[0].value
        dataList = JSON.parse(`[${data}]`);
        if (switchType===true){
          labelList = props.titleList
        }else {
          labelList = dataList[0]
        }
        for (let i = 0; i < list.value.length; i++) {
          let count = list.value[i].data.length
          for (let j = 0; j < count; j++) {
              lastList.value.push(list.value[i].data[j])
    }
)
          }
        }
      } else {
        ElMessage.warning(res.msg)
      }
    })
  }
})
//修改相同产品名称标签
const updateProductName = (event, index,id) => {