guoyujie
2025-08-25 8a63774671aef17807569d6fb631eca20d4696f0
Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
1个文件已添加
7个文件已修改
1480 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/components/sd/order/UpdateAlienEditor.vue 200 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/sd/order/UpdateAlienEditor2.vue 1015 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder2.vue 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetailMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/sd/order/UpdateAlienEditor.vue
@@ -155,27 +155,27 @@
//绘制自由多边形
const getproject = () => {
    validate1()
    if(leafer!==undefined){
      leafer.clear()
    }
    leafer=new Leafer({ view: 'canvas' })
    points.value = [datas1.value + (parseInt(data5.value) / big), datas2.value - (parseInt(data6.value) / big), datas3.value + (parseInt(data1.value) / big), datas4.value + (parseInt(data2.value) / big),
      datas5.value - (parseInt(data3.value) / big), datas6.value + (parseInt(data4.value) / big), datas7.value - (parseInt(data7.value) / big), datas8.value - (parseInt(data8.value) / big)]
    fileJson.value.quadrilateral=[parseInt(data5.value),parseInt(data6.value),parseInt(data1.value),parseInt(data2.value),
      parseInt(data3.value),parseInt(data4.value),parseInt(data7.value),parseInt(data8.value)]
    fileJson.value.polygon=null
    states.value=false
  validate1()
  if(leafer!==undefined){
    leafer.clear()
  }
  leafer=new Leafer({ view: 'canvas' })
  points.value = [datas1.value + (parseInt(data5.value) / big), datas2.value - (parseInt(data6.value) / big), datas3.value + (parseInt(data1.value) / big), datas4.value + (parseInt(data2.value) / big),
    datas5.value - (parseInt(data3.value) / big), datas6.value + (parseInt(data4.value) / big), datas7.value - (parseInt(data7.value) / big), datas8.value - (parseInt(data8.value) / big)]
  fileJson.value.quadrilateral=[parseInt(data5.value),parseInt(data6.value),parseInt(data1.value),parseInt(data2.value),
    parseInt(data3.value),parseInt(data4.value),parseInt(data7.value),parseInt(data8.value)]
  fileJson.value.polygon=null
  states.value=false
    const polygon = new Polygon({
      points: points.value,
      stroke: '#f00',
      zIndex: 1
    })
    leafer.add(polygon)
    load()
    state.value=true
    exportToDXF(1)
  const polygon = new Polygon({
    points: points.value,
    stroke: '#f00',
    zIndex: 1
  })
  leafer.add(polygon)
  load()
  state.value=true
  exportToDXF(1)
}
@@ -188,8 +188,8 @@
    let r=parseInt(circle.value.r)
    if(x>0 && y>0 && r>0){
      const ellipse = new Ellipse({
        x:x/ big,
        y:(y-r*2)/ big,
        x:(x-r)/ big,
        y:(y-r)/ big,
        width: r*2 / big,
        height: r*2 / big,
        stroke: '#f00',
@@ -342,40 +342,40 @@
      for (let i=0;i<list.length;i++) {
        let curr=list[i]
      // 排除自身坐标
      if (curr[0] == xy[0] && curr[1] == xy[1]) {
        continue;
      }
      // 筛选x≥目标x的坐标(只考虑递增方向的候选)
      if (curr[0] < xy[0]) {
        continue;
      }
      // 第一次找到候选,直接赋值
      if (best == null) {
        best = xy;
        continue;
      }
      if (curr[0] == best[0]) {
        // x相同则比较y:y更小则更优
        if (curr[1] < best[1]) {
          best = curr;
          index=i
        // 排除自身坐标
        if (curr[0] == xy[0] && curr[1] == xy[1]) {
          continue;
        }
        // 筛选x≥目标x的坐标(只考虑递增方向的候选)
        if (curr[0] < xy[0]) {
          continue;
        }
        // 第一次找到候选,直接赋值
        if (best == null) {
          best = xy;
          continue;
        }
        if (curr[0] == best[0]) {
          // x相同则比较y:y更小则更优
          if (curr[1] < best[1]) {
            best = curr;
            index=i
          }
        }
      }
    }
      break;
    case 2: // x轴递减:找x≤当前x的坐标中,x最大的;x相同则y最大的
      for (let i=0;i<list.length;i++) {
        let curr=list[i]
      // 排除自身坐标
      if (curr[0] == xy[0] && curr[1] == xy[1]) {
        continue;
      }
      // 筛选x≤目标x的坐标(只考虑递减方向的候选)
      if (curr[0] > xy[0]) {
        continue;
      }
        // 排除自身坐标
        if (curr[0] == xy[0] && curr[1] == xy[1]) {
          continue;
        }
        // 筛选x≤目标x的坐标(只考虑递减方向的候选)
        if (curr[0] > xy[0]) {
          continue;
        }
        // 第一次找到候选,直接赋值
        if (best == null) {
          best = xy;
@@ -388,20 +388,20 @@
            index=i
          }
        }
    }
      }
      break;
    case 3: // y轴递增:找y≥当前y的坐标中,y最小的;y相同则x最小的
      for (let i=0;i<list.length;i++) {
        let curr=list[i]
      // 排除自身坐标
      if (curr[0] == xy[0] && curr[1] == xy[1]) {
        continue;
      }
      // 筛选y≥目标y的坐标(只考虑递增方向的候选)
      if (curr[1] < xy[1]) {
        continue;
      }
        // 排除自身坐标
        if (curr[0] == xy[0] && curr[1] == xy[1]) {
          continue;
        }
        // 筛选y≥目标y的坐标(只考虑递增方向的候选)
        if (curr[1] < xy[1]) {
          continue;
        }
        // 第一次找到候选,直接赋值
        if (best == null) {
          best = xy;
@@ -414,24 +414,24 @@
            index=i
          }
        }
    }
      }
      break;
    case 4: // y轴递减:找y≤当前y的坐标中,y最大的;y相同则x最大的
      for (let i=0;i<list.length;i++) {
        let curr=list[i]
      // 排除自身坐标
      if (curr[0] == xy[0] && curr[1] == xy[1]) {
        continue;
      }
      // 筛选y≤目标y的坐标(只考虑递减方向的候选)
      if (curr[1] > xy[1]) {
        continue;
      }
      if (best == null) {
        best = xy;
        continue;
      }
        // 排除自身坐标
        if (curr[0] == xy[0] && curr[1] == xy[1]) {
          continue;
        }
        // 筛选y≤目标y的坐标(只考虑递减方向的候选)
        if (curr[1] > xy[1]) {
          continue;
        }
        if (best == null) {
          best = xy;
          continue;
        }
        if (curr[1] == best[1]) {
          // y相同则比较x:x更小则更优
          if (curr[0] > best[0]) {
@@ -439,7 +439,7 @@
            index=i
          }
        }
    }
      }
      break;
    default: // 无效方向
@@ -600,8 +600,8 @@
    pointsRect.value.forEach(rect => {
      if(rect.type=="round"){
        const x = rect.x+rect.width;
        const y = maxY-minY-rect.y+rect.width;
        const x = rect.x;
        const y = maxY-minY-rect.y;
        const radius = rect.width;
        if (dxf.drawCircle) {
          dxf.drawCircle(x, y, radius, { layer: '0' });
@@ -804,37 +804,37 @@
            pointsRect.value.push({id:pointsRect.value.length+1,type:'rect',shap:"▢",x:entity.vertices[0].x,y:entity.vertices[0].y,
              width:entity.vertices[2].x-entity.vertices[0].x,
              height:entity.vertices[1].y-entity.vertices[0].y
                ,x1:entity.vertices[0].x,y1:entity.vertices[0].y})
              ,x1:round(entity.vertices[0].x),y1:round(entity.vertices[0].y)})
          }
            const polygon = new Polygon({
              points: point,
              stroke: '#f00',
              zIndex: 1
            })
            setTimeout(() => {
              leafer.add(polygon);
            }, 30);
          const polygon = new Polygon({
            points: point,
            stroke: '#f00',
            zIndex: 1
          })
          setTimeout(() => {
            leafer.add(polygon);
          }, 30);
          break;
        case 'CIRCLE':
            let CIRCLEX=(entity.center.x-minX-entity.radius)/big
            let CIRCLEY=((maxY - minY)-(entity.center.y-minY+entity.radius))/big
            if(big<(entity.radius * 2) / 400){
              big = (entity.radius * 2) / 400
              main.style.width = entity.radius * 2 / big + "px"
              main.style.height = entity.radius * 2 / big + "px"
              width.innerHTML = round(entity.radius * 2, 2)
              height.innerHTML = round(entity.radius * 2, 2)
              CIRCLEX=0
              CIRCLEY=0
            }
            let x=entity.center.x-minX-entity.radius
            let y=(maxY - minY)-(entity.center.y-minY-entity.radius)
          let CIRCLEX=(entity.center.x-minX-entity.radius)/big
          let CIRCLEY=((maxY - minY)-(entity.center.y-minY+entity.radius))/big
          if(big<(entity.radius * 2) / 400){
            big = (entity.radius * 2) / 400
            main.style.width = entity.radius * 2 / big + "px"
            main.style.height = entity.radius * 2 / big + "px"
            width.innerHTML = round(entity.radius * 2, 2)
            height.innerHTML = round(entity.radius * 2, 2)
            CIRCLEX=0
            CIRCLEY=0
          }
          let x=entity.center.x-minX
          let y=(maxY - minY)-(entity.center.y-minY)
          pointsRect.value.push({id:pointsRect.value.length+1,type:'round',shap:"〇",x:x,y:y,width:entity.radius,
            x1:x,y1:entity.center.y-minY-entity.radius})
            x1:round(x),y1:round(entity.center.y-minY)})
          const ellipse = new Ellipse({
            x:CIRCLEX,
            y:CIRCLEY,
@@ -1243,8 +1243,8 @@
        let y=parseInt(rect.y)
        let r=parseInt(rect.width)
        const ellipse = new Ellipse({
          x:x/ big,
          y:(y-r*2)/ big,
          x:(x-r)/ big,
          y:(y-r)/ big,
          width: r*2 / big,
          height: r*2 / big,
          stroke: '#f00',
@@ -1311,7 +1311,7 @@
    <el-button type="primary" @click="save()">{{$t('basicData.save')}}</el-button>
  </div>
 <div style="position: absolute;margin-top: 373px;margin-left: 300px;">
  <div style="position: absolute;margin-top: 373px;margin-left: 300px;">
    <el-select v-model="select1" @change="handleChange" style="width: 100px;height: 40px;font-size: 8px">
      <el-option value="1" :label="$t('order.edgeAngleCurvature')"></el-option>
north-glass-erp/northglass-erp/src/components/sd/order/UpdateAlienEditor2.vue
New file
@@ -0,0 +1,1015 @@
<script setup>
import {computed, onMounted, onUpdated, reactive, ref, watch} from "vue"
import {filterChanged} from "@/hook"
import {useI18n} from "vue-i18n"
import {ElMessage, ElMessageBox,} from "element-plus"
import request from "@/utils/request"
import {useRouter,useRoute} from "vue-router"
import {Ellipse, Leafer, Line, Path, Polygon,Rect} from "leafer-ui";
import {round} from "xe-utils";
import DxfParser from "dxf-parser";
import { saveAs } from 'file-saver';
import DXFWriter from 'dxf-writer';
import footSum from "@/hook/footSum";
import deepClone from "@/utils/deepClone";
const { t } = useI18n()
const router = useRouter()
const route = useRoute()
let width = ref("")
let height = ref("null")
let rowIndex = ref(null)
const xGrid = ref()
//用于接收父组件参数
const emits = defineEmits(['getUploadPicture'])
let fileName=ref(null)
let fileDate=ref(null)
let fileJson=ref({
  quadrilateral:null,
  polygon:null
})
let dxfData=ref(null)
let state=ref(false)
let states=ref(false)
let points=ref([])
let pointsRound=ref([])
let pointsRect=ref([])
let pointsDrilling=ref([])
let circle=ref({
  x:0,
  y:0,
  r:0
})
let rect=ref({
  x:0,
  y:0,
  w:0,
  h:0
})
let drilling=ref({
  coordinates:0,
  w:0,
  h:0,
})
let data1=ref(0);let data2=ref(0);let data3=ref(0);let data4=ref(0)
let data5=ref(0);let data6=ref(0);let data7=ref(0);let data8=ref(0)
let datas1=ref(0);let datas2=ref(0);let datas3=ref(0);let datas4=ref(0)
let datas5=ref(0);let datas6=ref(0);let datas7=ref(0);let datas8=ref(0)
let a1=ref(0);let a2=ref(0);let b1=ref(0);let b2=ref(0)
let c1=ref(0);let c2=ref(0);let d1=ref(0);let d2=ref(0)
let aValue=ref("0");let bValue=ref("0");let cValue=ref("0");let dValue=ref("0")
let select1=ref("2");let select2=ref("2");let select3=ref("2");let select4=ref("2");let select5=ref("1")
let big=0
let leafer;
let parsedDXFData = ref([]);
let orderDetailWidth=ref(0)
let orderDetailHeight=ref(0)
let widthAgv=ref(0)
let heightAgv=ref(0)
const ongetproject = (row) =>  {
  rowIndex.value=row
  validate1()
  validate2()
  if(row==undefined||row.width==null){
    const main = document.getElementById('main2')
    const width = document.getElementById('width2')
    const height = document.getElementById('height2')
    main.style.backgroundColor = "#ffffff"
    width.innerHTML = 0
    height.innerHTML = 0
    if (leafer !== undefined) {
      leafer.clear()
    }
    return
  }
  pointsRect.value=[]
  if(row.fileName==null||row.fileName==""){
    orderDetailWidth.value=row.width
    orderDetailHeight.value=row.height
    const main =document.getElementById('main2')
    const width =document.getElementById('width2')
    const height =document.getElementById('height2')
    width.innerHTML = orderDetailWidth.value
    height.innerHTML = orderDetailHeight.value
    if(orderDetailWidth.value/500>orderDetailHeight.value/350){
      big=orderDetailWidth.value/500
    }else{
      big=orderDetailHeight.value/350
    }
    let widthAgv=orderDetailWidth.value/big
    let heightAgv=orderDetailHeight.value/big
    main.style.width=widthAgv+"px"
    main.style.height=heightAgv+"px"
    main.style.backgroundColor = "#8d9095"
    datas2.value=heightAgv
    datas8.value=heightAgv
    datas5.value=widthAgv
    datas7.value=widthAgv
    if(leafer!==undefined){
      leafer.clear()
    }
    leafer=new Leafer({ view: 'canva2' })
    points.value=[0, heightAgv, 0, 0, widthAgv, 0, widthAgv,heightAgv]
    const polygon = new Polygon({
      points: points.value,
      stroke: '#f00',
      strokeWidth: 0,
    })
    setTimeout(() => {
      leafer.add(polygon);
    }, 30)
    state.value=true
    states.value=true
  }else{
    const b64Data = row.fileData;
    if(row.fileJson!=null){
      if(typeof row.fileJson === 'object' && row.fileJson !== null && !Array.isArray(row.fileJson)){
        fileJson.value=row.fileJson
      }else{
        fileJson.value =JSON.parse(row.fileJson);
      }
      selectData(fileJson.value)
    }
    const byteCharacters = atob(b64Data);
    const parser = new DxfParser();
    dxfData.value = parser.parseSync(byteCharacters)
    handleFileUpload1()
  }
}
const getproject = () => {
    validate1()
    if(leafer!==undefined){
      leafer.clear()
    }
    leafer=new Leafer({ view: 'canva2' })
    points.value = [datas1.value + (parseInt(data5.value) / big), datas2.value - (parseInt(data6.value) / big), datas3.value + (parseInt(data1.value) / big), datas4.value + (parseInt(data2.value) / big),
      datas5.value - (parseInt(data3.value) / big), datas6.value + (parseInt(data4.value) / big), datas7.value - (parseInt(data7.value) / big), datas8.value - (parseInt(data8.value) / big)]
    fileJson.value.quadrilateral=[parseInt(data5.value),parseInt(data6.value),parseInt(data1.value),parseInt(data2.value),
      parseInt(data3.value),parseInt(data4.value),parseInt(data7.value),parseInt(data8.value)]
    fileJson.value.polygon=null
    states.value=false
    const polygon = new Polygon({
      points: points.value,
      stroke: '#f00',
      zIndex: 1
    })
    leafer.add(polygon)
    load()
    state.value=true
    exportToDXF(1)
}
const getproject2 = () => {
  states.value=true
  if (states.value){
    validate2()
    if(leafer!==undefined){
      leafer.clear()
    }
    leafer=new Leafer({ view: 'canva2' })
    substringData()
    points.value=[]
    let state=0
    if(select3.value=="3"){
      points.value.push(datas1.value +parseInt(a1.value)/big,datas2.value,datas1.value +a1.value/big,datas2.value-parseInt(a2.value)/big,datas1.value,datas2.value-parseInt(a2.value)/big)
    }else if(select3.value=="2"){
      points.value.push(datas1.value +parseInt(a1.value)/big,datas2.value,datas1.value,datas2.value-parseInt(a2.value)/big)
    }else if(select3.value=="1"&&aValue.value!=="0"&&aValue.value!==""){
      state=parseInt(a1.value)
      const radius = state/big
      const cornerPoints = []
      const segments = 8 // 圆弧分段数,越多越平滑
      for (let i = 0; i <= segments; i++) {
        const angle = (Math.PI / 2) * (i / segments);
        const x = radius - radius * Math.sin(angle);
        const y = datas2.value - radius * (1 - Math.cos(angle));
        cornerPoints.push(x, y);
      }
      points.value.push(...cornerPoints, 0, datas2.value-radius)
    }else{
      points.value.push(datas1.value - (parseInt(data3.value) / big), datas2.value + (parseInt(data4.value) / big))
    }
    if(select1.value=="3"){
      points.value.push(datas3.value,datas4.value+parseInt(parseInt(b2.value))/big,datas3.value +parseInt(b1.value)/big,datas4.value+parseInt(b2.value)/big,datas3.value +parseInt(b1.value)/big,datas4.value)
    }else if(select1.value=="2"){
      points.value.push(datas3.value,datas4.value+parseInt(parseInt(b2.value))/big,datas3.value +parseInt(b1.value)/big,datas4.value)
    }else if(select1.value=="1"&&bValue.value!=="0"&&bValue.value!==""){
      state=parseInt(b1.value)
      const radius = state/big
      const cornerPoints = []
      const segments = 8 // 圆弧分段数,越多越平滑
      for (let i = 0; i <= segments; i++) {
        const angle = (Math.PI / 2) * (i / segments) // 90度角分段
        const x = radius - radius * Math.cos(angle)
        const y = radius - radius * Math.sin(angle)
        cornerPoints.push(x, y)
      }
      points.value.push(...cornerPoints, radius, 0)
    }else{
      points.value.push(datas3.value + (parseInt(data5.value) / big), datas4.value - (parseInt(data6.value) / big))
    }
    if(select2.value=="3"){
      points.value.push(datas5.value-parseInt(c1.value)/big,datas6.value,datas5.value -parseInt(c1.value)/big,datas6.value+parseInt(c2.value)/big,datas5.value,datas6.value +parseInt(c2.value)/big)
    }else if(select2.value=="2"){
      points.value.push(datas5.value-parseInt(c1.value)/big,datas6.value,datas5.value,datas6.value +parseInt(c2.value)/big)
    }else if(select2.value=="1"&&cValue.value!=="0"&&cValue.value!==""){
      state=parseInt(c1.value)
      const radius = state/big
      const cornerPoints = []
      const segments = 8 // 圆弧分段数,越多越平滑
      for (let i = 0; i <= segments; i++) {
        const angle = (Math.PI / 2) * (i / segments);
        const x = (datas5.value -radius) + radius * Math.sin(angle);
        const y =  radius *  (1 - Math.cos(angle));
        cornerPoints.push(x, y);
      }
      points.value.push(...cornerPoints, datas5.value, radius)
    }else{
      points.value.push(datas5.value + (parseInt(data1.value) / big), datas6.value + (parseInt(data2.value) / big))
    }
    if(select4.value=="3"){
      points.value.push(datas7.value,datas8.value-parseInt(d2.value)/big,datas7.value -parseInt(d1.value)/big,datas8.value-parseInt(d2.value)/big,datas7.value -parseInt(d1.value)/big,datas8.value)
    }else if(select4.value=="2"){
      points.value.push(datas7.value,datas8.value-parseInt(d2.value)/big,datas7.value -parseInt(d1.value)/big,datas8.value)
    }else if(select4.value=="1"&&dValue.value!=="0"&&dValue.value!==""){
      state=parseInt(d1.value)
      const radius = state/big
      const cornerPoints = []
      const segments = 8 // 圆弧分段数,越多越平滑
      for (let i = 0; i <= segments; i++) {
        const angle = (Math.PI / 2) * (i / segments);
        const x = datas5.value -(radius- radius * Math.cos(angle));
        const y = datas2.value -(radius- radius * Math.sin(angle));
        cornerPoints.push(x, y);
      }
      points.value.push(...cornerPoints, datas5.value-radius, datas2.value)
    }else{
      points.value.push(datas7.value - (parseInt(data7.value) / big), datas8.value - (parseInt(data8.value) / big))
    }
    const polygon = new Polygon({
      points: points.value,
      stroke: '#f00',
      zIndex:2,
    })
    leafer.add(polygon)
    fileJson.value.polygon=[parseInt(a1.value),parseInt(a2.value),parseInt(b1.value),parseInt(b2.value),
      parseInt(c1.value),parseInt(c2.value),parseInt(d1.value),parseInt(d2.value),select1.value,select2.value,select3.value,select4.value]
    load()
    exportToDXF(1)
  }
}
const exportToDXF = async (value) => {
  const dxf = new DXFWriter();
  let arr=[]
  for (let i=0;i<points.value.length;i++){
    let a=[]
    if(i % 2 === 0){
      a.push(points.value[i]*big)
      a.push((points.value[i+1]*big))
      a.push(0)
      arr.push(a)
    }
  }
  let minX = Infinity, minY = Infinity;
  let maxX = -Infinity, maxY = -Infinity;
  arr.forEach(p => {
    minX = Math.min(Math.abs(p[0]),minX );
    minY = Math.min(Math.abs(p[1]),minY);
    maxX = Math.max(Math.abs(p[0]),maxX );
    maxY = Math.max(Math.abs(p[1]),maxY);
  });
  arr.forEach(p => {
    p[1]=maxY-minY-p[1]
  });
  dxf.drawPolyline(arr,{ closed: true, layer: '0' })
  if (pointsRect.value.length > 0) {
    pointsRect.value.forEach(rect => {
      if(rect.type=="round"){
        const x = rect.x+rect.width;
        const y = maxY-minY-rect.y+rect.width;
        const radius = rect.width;
        if (dxf.drawCircle) {
          dxf.drawCircle(x, y, radius, { layer: '0' });
        }
      }else{
        let poist=[rect.x,rect.y, rect.x,(rect.y+rect.height),(rect.x+rect.width),(rect.y+rect.height),(rect.x+rect.width),rect.y]
        let arr=[]
        for (let i=0;i<poist.length;i++){
          let a=[]
          if(i % 2 === 0){
            a.push(poist[i])
            a.push((poist[i+1]))
            a.push(0)
            arr.push(a)
          }
        }
        let minX = Infinity, minY = Infinity;
        let maxX = -Infinity, maxY = -Infinity;
        arr.forEach(p => {
          minX = Math.min(Math.abs(p[0]),minX );
          minY = Math.min(Math.abs(p[1]),minY);
          maxX = Math.max(Math.abs(p[0]),maxX );
          maxY = Math.max(Math.abs(p[1]),maxY);
        });
        dxf.drawPolyline(arr,{ closed: true, layer: '0' })
      }
    });
  }
  const blob = new Blob([dxf.toDxfString()], {type: 'text/plain;charset=utf-8'});
  const base64 = await fileToBase64(blob);
  if(value===1){
    fileName.value="map.dxf"
    fileDate.value=base64.replace(/^data:.+;base64,/, "")
  }
  else if(value===2&&state.value){
    saveAs(blob, 'map.dxf');
  }else{
    ElMessage.warning("该格式不支持导出")
  }
}
const fileToBase64 = (file) => {
  return new Promise((resolve, reject) => {
    const reader = new FileReader();
    reader.onload = () => resolve(reader.result);
    reader.onerror = reject;
    reader.readAsDataURL(file);
  });
};
function toBottomOrigin(y, canvasHeight) {
  return canvasHeight - y; // 将左上角Y坐标转换为左下角坐标系
}
const handleFile1 =  async (event) => {
  state.value=false
  const main = document.getElementById('main2')
  const width = document.getElementById('width')
  const height = document.getElementById('height')
  //validate()
  if(leafer!==undefined){
    leafer.clear()
  }
  leafer = new Leafer({view: 'canva2'});
  const file = event.target.files[0];
  if (file) {
    const reader = new FileReader();
    reader.onload = async (e) => {
      const text = e.target.result;
      try {
        const base64 = await fileToBase64(file);
        const parser = new DxfParser();
        dxfData.value = parser.parseSync(text);
        fileJson.value.quadrilateral=null
        fileJson.value.polygon=null
        handleFileUpload1()
        fileName.value=file.name
        fileDate.value=base64.replace(/^data:.+;base64,/, "")
      } catch (error) {
        console.error('解析DXF文件时出错:', error);
      }
    };
    reader.readAsText(file);
  }
}
const handleFileUpload1 =  () => {
  const main =document.getElementById('main2')
  const width =document.getElementById('width2')
  const height =document.getElementById('height2')
  if(leafer!==undefined){
    leafer.clear()
  }
  leafer = new Leafer({ view: 'canva2' });
  try {
    let type=0;
    let minX = Infinity, minY = Infinity;
    let maxX = -Infinity, maxY = -Infinity;
    dxfData.value.entities.forEach(entity => {
      if (entity.type === 'LINE' || entity.type === 'LWPOLYLINE') {
        entity.vertices.forEach(vertices => {
          minX = Math.min(vertices.x, minX);
          minY = Math.min(vertices.y, minY);
          maxX = Math.max(vertices.x, maxX);
          maxY = Math.max(vertices.y, maxY);
        })
      }
      if (entity.type === 'ARC') {
        type=1
        const center = {x: entity.center.x, y: entity.center.y};
        const radius = entity.radius;
        const startAngle = entity.startAngle * (180 / Math.PI);
        const endAngle = entity.endAngle * (180 / Math.PI);
        const points = [];
        const steps = 32;
        for (let i = 0; i <= steps; i++) {
          const angle = startAngle + (endAngle - startAngle) * (i / steps);
          const x = center.x + radius * Math.cos(angle * Math.PI / 180);
          const y = center.y + radius * Math.sin(angle * Math.PI / 180);
          points.push({x, y});
        }
        points.forEach(p => {
          minX = Math.min(minX, p.x);
          minY = Math.min(minY, p.y);
          maxX = Math.max(maxX, p.x);
          maxY = Math.max(maxY, p.y);
        });
      }
      if (entity.type === 'CIRCLE') {
        type=1
        minX = Math.min(minX, entity.center.x-entity.radius);
        minY = Math.min(minY, entity.center.y-entity.radius);
        maxX = Math.max(maxX, entity.center.x+entity.radius);
        maxY = Math.max(maxY, entity.center.y+entity.radius);
      }
    });
    if ((maxX - minX) / 500 > (maxY - minY) / 350) {
      big = (maxX - minX) / 500
    } else {
      big = (maxY - minY) / 350
    }
    let indexNumber=0
    Object.values(dxfData.value.entities).forEach(entity => {
      switch (entity.type) {
        case 'LINE':
          main.style.width = (maxX - minX) / big + "px"
          main.style.height = (maxY - minY) / big + "px"
          main.style.backgroundColor = "#8d9095"
          width.innerHTML = round(maxX - minX, 2)
          height.innerHTML = round(maxY - minY, 2)
          const line = new Line({
            points: [(entity.vertices[0].x - minX) / big, ((maxY - minY) - (entity.vertices[0].y- minY)) / big,
              (entity.vertices[1].x - minX) / big, ((maxY - minY) - (entity.vertices[1].y - minY)) / big],
            stroke: '#f00',
            strokeWidth: 1,
            zIndex: 1
          })
          setTimeout(() => {
            leafer.add(line);
          }, 30);
          break;
        case 'LWPOLYLINE':
          let point = entity.vertices.map(v => [
            (v.x - minX) / big,
            toBottomOrigin((v.y - minY) / big, (maxY - minY) / big),
          ]).flat()
          if(indexNumber==0){
            main.style.width = (maxX - minX) / big + "px"
            main.style.height = (maxY - minY) / big + "px"
            main.style.backgroundColor = "#8d9095"
            width.innerHTML = round(maxX - minX, 2)
            height.innerHTML = round(maxY - minY, 2)
            if(fileJson.value!=null&&(fileJson.value.polygon!=null||fileJson.value.quadrilateral!=null)){
              points.value=point
              isQuadrilateral(maxY,minY,maxX,minX,point)
            }
            indexNumber=1
          }else{
            let point = entity.vertices.map(v => [
              (v.x - minX) / big,
              (v.y - minY) / big,
            ]).flat()
            pointsRect.value.push({id:pointsRect.value.length+1,type:'rect',shap:"▢",x:entity.vertices[0].x,y:entity.vertices[0].y,
              width:entity.vertices[2].x-entity.vertices[0].x,
              height:entity.vertices[1].y-entity.vertices[0].y
              ,x1:round(entity.vertices[0].x),y1:round(entity.vertices[0].y)})
          }
            const polygon = new Polygon({
              points: point,
              stroke: '#f00',
              zIndex: 1
            })
            setTimeout(() => {
              leafer.add(polygon);
            }, 30);
          break;
        case 'CIRCLE':
            let CIRCLEX=(entity.center.x-minX-entity.radius)/big
            let CIRCLEY=((maxY - minY)-(entity.center.y-minY+entity.radius))/big
            if(big<(entity.radius * 2) / 500){
              big = (entity.radius * 2) / 500
              main.style.width = entity.radius * 2 / big + "px"
              main.style.height = entity.radius * 2 / big + "px"
              width.innerHTML = round(entity.radius * 2, 2)
              height.innerHTML = round(entity.radius * 2, 2)
              CIRCLEX=0
              CIRCLEY=0
            }
            let x=entity.center.x-minX-entity.radius
            let y=(maxY - minY)-(entity.center.y-minY-entity.radius)
          pointsRect.value.push({id:pointsRect.value.length+1,type:'round',shap:"〇",x:x,y:y,width:entity.radius,
            x1:round(x),y1:round(entity.center.y-minY)})
          const ellipse = new Ellipse({
            x:CIRCLEX,
            y:CIRCLEY,
            width: entity.radius * 2 / big,
            height: entity.radius * 2 / big,
            //fill: "#32cd79"
            stroke: '#f00',
            zIndex: 3
          })
          setTimeout(() => {
            leafer.add(ellipse);
          }, 30);
          break;
        case 'ELLIPSE':
          console.log(entity)
          const {majorAxisEndPoint, axisRatio} = entity;
          const dx = majorAxisEndPoint.x;
          const dy = majorAxisEndPoint.y;
          const a = Math.sqrt(dx ** 2 + dy ** 2);
          const c = a * axisRatio;
          const θ = Math.atan2(dy, dx);
          const l = axisRatio * (180 / Math.PI);
          if ((a * 2) / 500 > (c * 2) / 350) {
            big = (a * 2) / 500
          } else {
            big = (c * 2) / 350
          }
          main.style.width = a * 2 / big + "px"
          main.style.height = c * 2 / big + "px"
          width.innerHTML = round(a * 2, 2)
          height.innerHTML = round(c * 2, 2)
          const ellipse2 = new Ellipse({
            width: a * 2 / big,
            height: c * 2 / big,
            stroke: '#f00',
          })
          setTimeout(() => {
            leafer.add(ellipse2);
          }, 30);
          break;
        case 'ARC':
          const center = {x: entity.center.x, y: entity.center.y};
          const radius = entity.radius;
          const startAngle = entity.startAngle * (180 / Math.PI);
          const endAngle = entity.endAngle * (180 / Math.PI);
          if ((maxX - minX) / 500 > (maxY - minY) / 350) {
            big = (maxX - minX) / 500
          } else {
            big = (maxY - minY) / 350
          }
          // 计算圆弧的起点和终点
          const startX = (center.x + radius * Math.cos(entity.startAngle) - minX);
          const startY = (maxY - minY) - ((center.y + radius * Math.sin(entity.startAngle)) - minY);
          const endX = (center.x + radius * Math.cos(entity.endAngle) - minX);
          const endY = (maxY - minY) - ((center.y + radius * Math.sin(entity.endAngle)) - minY);
          // 创建圆弧路径
          const path = new Path({
            path: `M ${startX / big} ${startY / big} A ${radius / big} ${radius / big} 0 ${endAngle - startAngle > 180 ? 1 : 0} 0 ${endX / big} ${endY / big}`,
            stroke: '#f00',
            strokeWidth: 1,
          });
          setTimeout(() => {
            leafer.add(path);
          }, 30);
          break;
      }
    })
  } catch (error) {
    console.error('解析DXF文件时出错:', error);
  }
};
const selectData =  (item) => {
  if(item.quadrilateral!=null){
    state.value=true
    data1.value=item.quadrilateral[2]
    data2.value=item.quadrilateral[3]
    data3.value=item.quadrilateral[4]
    data4.value=item.quadrilateral[5]
    data5.value=item.quadrilateral[0]
    data6.value=item.quadrilateral[1]
    data7.value=item.quadrilateral[6]
    data8.value=item.quadrilateral[7]
  }
  if(item.polygon!=null){
    a1.value=item.polygon[0]
    a2.value=item.polygon[1]
    b1.value=item.polygon[2]
    b2.value=item.polygon[3]
    c1.value=item.polygon[4]
    c2.value=item.polygon[5]
    d1.value=item.polygon[6]
    d2.value=item.polygon[7]
    if(item.polygon[0]==item.polygon[1]){
      aValue.value=item.polygon[0]+""
    }else{
      aValue.value=item.polygon[0]+"/"+item.polygon[1]
    }
    if(item.polygon[2]==item.polygon[3]){
      bValue.value=item.polygon[2]+""
    }else{
      bValue.value=item.polygon[2]+"/"+item.polygon[3]
    }
    if(item.polygon[4]==item.polygon[5]){
      cValue.value=item.polygon[4]+""
    }else{
      cValue.value=item.polygon[4]+"/"+item.polygon[5]
    }
    if(item.polygon[6]==item.polygon[7]){
      dValue.value=item.polygon[6]+""
    }else{
      dValue.value=item.polygon[6]+"/"+item.polygon[7]
    }
    select1.value=item.polygon[8]
    select2.value=item.polygon[9]
    select3.value=item.polygon[10]
    select4.value=item.polygon[11]
  }
}
const validate = async () => {
  data1.value=0
  data2.value=0
  data3.value=0
  data4.value=0
  data5.value=0
  data6.value=0
  data7.value=0
  data8.value=0
  big=0
  return true
}
const validate1 = async () => {
  a1.value=0
  a2.value=0
  b1.value=0
  b2.value=0
  c1.value=0
  c2.value=0
  d1.value=0
  d2.value=0
  aValue.value="0"
  bValue.value="0"
  cValue.value="0"
  dValue.value="0"
}
const validate2 = async () => {
  data1.value=0
  data2.value=0
  data3.value=0
  data4.value=0
  data5.value=0
  data6.value=0
  data7.value=0
  data8.value=0
}
defineExpose({
  validate,
  ongetproject
})
const save =  () => {
  if(fileName.value!=null&&fileDate.value!=null){
    fileJson.value.quadrilateral=[parseInt(data5.value),parseInt(data6.value),parseInt(data1.value),parseInt(data2.value),
      parseInt(data3.value),parseInt(data4.value),parseInt(data7.value),parseInt(data8.value)]
    if(fileJson.value.quadrilateral==null&&fileJson.value.polygon==null){
      fileJson.value=null
    }
    emits('getUploadPicture', fileName.value,fileDate.value,fileJson.value)
  }else{
    ElMessage.warning("未参与修改")
  }
}
const reset =  () => {
  if(rowIndex.value!==null){
    validate1()
    validate2()
    orderDetailWidth.value=rowIndex.value.width
    orderDetailHeight.value=rowIndex.value.height
    const main =document.getElementById('main2')
    const width =document.getElementById('width2')
    const height =document.getElementById('height2')
    if(orderDetailWidth.value/500>orderDetailHeight.value/350){
      big=orderDetailWidth.value/500
    }else{
      big=orderDetailHeight.value/350
    }
    let widthAgv=orderDetailWidth.value/big
    let heightAgv=orderDetailHeight.value/big
    main.style.width=widthAgv+"px"
    main.style.height=heightAgv+"px"
    main.style.backgroundColor = "#8d9095"
    datas2.value=heightAgv
    datas8.value=heightAgv
    datas5.value=widthAgv
    datas7.value=widthAgv
    if(leafer!==undefined){
      leafer.clear()
    }
    leafer=new Leafer({ view: 'canva2' })
    points.value=[0, heightAgv, 0, 0, widthAgv, 0, widthAgv,heightAgv]
    const polygon = new Polygon({
      points: points.value,
      stroke: '#f00',
      strokeWidth: 0,
    })
    setTimeout(() => {
      leafer.add(polygon);
    }, 30)
    state.value=true
    states.value=true
    pointsRect.value=[]
    exportToDXF(1)
  }
}
const handleChange=(value)=> {
  getproject2()
}
const  substringData = () =>{
  const indexA = aValue.value.indexOf("/");
  if(indexA==-1){
    a1.value=aValue.value
    a2.value=aValue.value
  }else{
    a1.value = aValue.value.substring(0, indexA);
    a2.value = aValue.value.substring(indexA + 1);
  }
  const indexB = bValue.value.indexOf("/");
  if(indexB==-1){
    b1.value=bValue.value
    b2.value=bValue.value
  }else{
    b1.value = bValue.value.substring(0, indexB);
    b2.value = bValue.value.substring(indexB + 1);
  }
  const indexC = cValue.value.indexOf("/");
  if(indexC==-1){
    c1.value=cValue.value
    c2.value=cValue.value
  }else{
    c1.value = cValue.value.substring(0, indexC);
    c2.value = cValue.value.substring(indexC + 1);
  }
  const indexD = dValue.value.indexOf("/");
  if(indexD==-1){
    d1.value=dValue.value
    d2.value=dValue.value
  }else{
    d1.value = dValue.value.substring(0, indexD);
    d2.value = dValue.value.substring(indexD + 1);
  }
}
const isQuadrilateral =  (maxY,minY,maxX,minX,point) => {
  state.value=true
  datas1.value=0
  datas2.value=(maxY - minY) / big
  datas3.value=0
  datas4.value=0
  datas5.value=(maxX - minX) / big
  datas6.value=0
  datas7.value=(maxX - minX) / big
  datas8.value=(maxY - minY) / big
}
const gridOptions = reactive({
  border:  "full",//表格加边框
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮
  id: 'UpdateAlienEditor',
  //表头参数
  columns:[
    {title: t('basicData.operate'), width: 60, slots: { default: 'button_slot' },fixed:"left"},
    {field: 'shap',width:60,  title: t('order.shape')},
    {field: 'x1',width:60,  title: t('X')},
    {field: 'y1',width:60,  title: t('Y')},
    {field: 'width',width:60,  title: t('')},
    {field: 'height',width:60,  title: t('')},
  ]
})
const load= () =>{
  if (pointsRect.value.length > 0) {
    pointsRect.value.forEach(rect => {
      if(rect.type=="round"){
        const height = document.getElementById('height')
        let x=parseInt(rect.x)
        let y=parseInt(rect.y)
        let r=parseInt(rect.width)
        const ellipse = new Ellipse({
          x:x/ big,
          y:(y-r*2)/ big,
          width: r*2 / big,
          height: r*2 / big,
          stroke: '#f00',
          zIndex: 3
        })
        leafer.add(ellipse);
      }else{
        const height = document.getElementById('height')
        let x=parseInt(rect.x)
        let ydesc=parseInt(height.innerHTML)-parseInt(rect.y)
        let y=parseInt(rect.y)
        let w=parseInt(rect.width)
        let h=parseInt(rect.width)
        const rects = new Rect({
          x:x/big,
          y:(ydesc-h)/big,
          width:w/big,
          height:h/big,
          stroke: '#f00',
          zIndex:2,
        })
        leafer.add(rects);
      }
    });
  }
}
</script>
<template>
  <div style="width: 504px;height: 354px;border: 2px solid #000;float: left;
      position: relative;display: flex;justify-content: center;align-content: center;margin-left: -280px;margin-top: 20px;">
    <div id="main2" ref="parent"  >
      <canvas  id="canva2" ></canvas>
    </div>
  </div>
  <div id="width2" style="width: 60px;position: absolute;top: 0px;left: -80px;">{{orderDetailWidth}}</div>
  <div id="height2" style="width: 60px;position: absolute;top: 205px;left: -330px;">{{orderDetailHeight}}</div>
  <div style="float: left;margin-top: -132px;margin-left: 330px">
    <el-input class="contactNumber" @blur="getproject" type="text" v-model="data1" />
    <el-input class="contactNumber" @blur="getproject" type="text" v-model="data2"  />&nbsp;&nbsp;&nbsp;
    <el-input class="contactNumber" @blur="getproject" type="text" v-model="data3"  />
    <el-input class="contactNumber" @blur="getproject" type="text" v-model="data4"  /><br>
    <el-input class="contactNumber" @blur="getproject" type="text" v-model="data5"  />
    <el-input class="contactNumber" @blur="getproject" type="text" v-model="data6"  />&nbsp;&nbsp;&nbsp;
    <el-input class="contactNumber" @blur="getproject" type="text" v-model="data7"  />
    <el-input class="contactNumber" @blur="getproject" type="text" v-model="data8"  /><br>
  </div>
  <div style="height: 20px;position: absolute;top: 245px;left: 295px;">{{$t('order.upper')}}</div>
  <div style="height: 20px;position: absolute;top: 264px;left: 295px;">{{$t('order.down')}}</div>
  <div style="height: 20px;position: absolute;top: 210px;left: 340px;">{{$t('order.horizontal')}}</div>
  <div style="height: 20px;position: absolute;top: 210px;left: 400px;">{{$t('order.vertical')}}</div>
  <div style="height: 20px;position: absolute;top: 210px;left: 475px;">{{$t('order.horizontal')}}</div>
  <div style="height: 20px;position: absolute;top: 210px;left: 535px;">{{$t('order.vertical')}}</div>
  <div style="float: left;margin-top: -50px;margin-left: 280px;margin-bottom: 20px">
    <label for="file-upload1" class="custom-file-upload">
      {{$t('order.selectFile')}}
    </label>
    <input id="file-upload1" style="width: 180px;display: none;"  type="file" @change="handleFile1" accept=".dxf" />
    <el-button type="primary" style="margin-left: 20px" @click="exportToDXF(2)">{{$t('order.exportDXF')}}</el-button>
    <el-button type="primary" @click="reset()">{{$t('craft.reset')}}</el-button>
    <el-button type="primary" @click="save()">{{$t('basicData.save')}}</el-button>
  </div>
 <div style="position: absolute;margin-top: 20px;margin-left: 280px;">
    <el-select v-model="select1" @change="handleChange" style="width: 100px;height: 40px;font-size: 8px">
      <el-option value="1" :label="$t('order.edgeAngleCurvature')"></el-option>
      <el-option value="2" :label="$t('order.cuttingCorners')"></el-option>
      <el-option value="3" :label="$t('order.fourCornerExcavation')"></el-option>
    </el-select>
    <el-select v-model="select2" @change="handleChange" style="width: 100px;height: 40px;font-size: 8px">
      <el-option value="1" :label="$t('order.edgeAngleCurvature')"></el-option>
      <el-option value="2" :label="$t('order.cuttingCorners')"></el-option>
      <el-option value="3" :label="$t('order.fourCornerExcavation')"></el-option>
    </el-select><br>
    <el-input class="contactNumber1" @blur="getproject2" type="text" v-model="bValue" />
    <el-input class="contactNumber1" @blur="getproject2" type="text" v-model="cValue"  /><br><br>
    <el-select v-model="select3" @change="handleChange" style="width: 100px;height: 40px;font-size: 8px">
      <el-option value="1" :label="$t('order.edgeAngleCurvature')"></el-option>
      <el-option value="2" :label="$t('order.cuttingCorners')"></el-option>
      <el-option value="3" :label="$t('order.fourCornerExcavation')"></el-option>
    </el-select>
    <el-select v-model="select4" @change="handleChange" style="width: 100px;height: 40px;font-size: 8px">
      <el-option value="1" :label="$t('order.edgeAngleCurvature')"></el-option>
      <el-option value="2" :label="$t('order.cuttingCorners')"></el-option>
      <el-option value="3" :label="$t('order.fourCornerExcavation')"></el-option>
    </el-select><br>
    <el-input class="contactNumber1" @blur="getproject2" type="text" v-model="aValue"  />
    <el-input class="contactNumber1" @blur="getproject2" type="text" v-model="dValue"  />
  </div>
</template>
<style scoped>
.contactNumber{
  width: 60px;
  height:20px;
  box-shadow: none;
  font-size: 15px;
}
.contactNumber1{
  width: 100px;
  height:20px;
  border: none;
  box-shadow: none;
  font-size: 15px;
}
.custom-file-upload {
  border: 1px solid #ccc;
  display: inline-block;
  padding: 6px 12px;
  cursor: pointer;
  background-color: #f9f9f9;
}
#main2 {
  position: relative;
}
</style>
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
@@ -390,6 +390,24 @@
            const grossAreaList = $grid.getTableData().fullData.filter(
                item=>item.grossArea === 0
            )
            //判断宽高相乘与字段结算面积是否相同
            $grid.getTableData().fullData.forEach((item,index)=>{
            })
            for (const i in $grid.getTableData().fullData) {
              const item = $grid.getTableData().fullData[i]
              const grossArea =  countArea(item)
              if(item.grossArea !== grossArea ){
                ElMessage.warning(`${t('order.OrderNum')}
                ${Number(i)+1}${t('order.area')}: ${grossArea} != ${item.grossArea}`)
                return
              }
            }
            const errorAreaList = $grid.getTableData().fullData.filter(
                item=>(item.width*item.height/1000000 < errorArea.value*1)
            )
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder2.vue
@@ -13,6 +13,7 @@
import OrderOtherMoney from "@/components/sd/order/OrderOtherMoney.vue"
import OrderSizeCheck from "@/components/sd/order/OrderSizeCheck.vue"
import UpdateAlienEditor from "@/components/sd/order/UpdateAlienEditor.vue"
import UpdateAlienEditor2 from "@/components/sd/order/UpdateAlienEditor2.vue"
import SelectAlienEditor from "@/components/sd/order/SelectAlienEditor.vue"
import {changeFilterEvent,filterChanged} from "@/hook"
import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove"
@@ -151,7 +152,7 @@
    useKey: true
  },
  filterConfig: {   //筛选配置项
    //remote: true  //远端筛选
                    //remote: true  //远端筛选
  },
  customConfig: {
    storage: true
@@ -958,9 +959,10 @@
        item.otherColumns = JSON.parse(item.otherColumns)
        if(res.data.orderFile!=null){
          res.data.orderFile.forEach(items=>{
            if(items.order_number==item.orderNumber)
            if(items.order_number==item.orderNumber){
              item.fileData=items.file_data
            item.fileJson=items.file_json
              item.fileJson=items.file_json
            }
          })
        }
      })
@@ -1057,7 +1059,6 @@
          //columns.push(column)
          gridOptions.columns.push(column)
          console.log(gridOptions.columns)
        })
      }
@@ -1120,7 +1121,7 @@
      if(titleUploadData.value.orderId.trim()===""){
        router.push({path:'/main/order/selectOrder'})
      }else{
        router.push({path:'/main/order/createOrder',query:{
        router.push({path:'/main/order/createOrder2',query:{
            orderId:titleUploadData.value.orderId,
            random:Math.random()}})
      }
@@ -1134,7 +1135,7 @@
        // autofocus: false,
        confirmButtonText: 'OK',
        callback: (action: Action) => {
          router.push({path:'/main/order/createOrder',query:{
          router.push({path:'/main/order/createOrder2',query:{
              orderId:titleUploadData.value.orderId,
              random:Math.random()}})
        },
@@ -1148,7 +1149,7 @@
  request.post(`/order/saveOrderTitle`,order).then((res) => {
    if(res.code==200){
      ElMessage.success(t('basicData.msg.saveSuccess'))
      router.push({path:'/main/order/createOrder',query:{
      router.push({path:'/main/order/createOrder2',query:{
          orderId:titleUploadData.value.orderId,
          random:Math.random()}})
    }else {
@@ -1423,6 +1424,7 @@
//行单元格修改修改触发此事件
const editClosedEvent = ({ row, column }) => {
  //判断修改相应的数值修改面积与金额
  if (['width', 'height', 'quantity', 'price'].includes(column.property)) {
    if(titleUploadData.value?.orderReview!==2){
@@ -1588,7 +1590,7 @@
    let nextRowIndex = xGrid.value.getRowIndex(row) + 1
    refSelectAlienEditor.value.ongetprojectOrder(xGrid.value.getTableData().fullData[nextRowIndex])
    refSelectAlienEditor.value.ongetproject(xGrid.value.getTableData().fullData[nextRowIndex])
    switch (column.field){
@@ -1641,7 +1643,7 @@
    if (nextRowIndex < xGrid.value.getTableData().fullData.length && nextRowIndex>=0) {
      xGrid.value.setCurrentRow(xGrid.value.getTableData().fullData[nextRowIndex]);
      refSelectAlienEditor.value.ongetprojectOrder(xGrid.value.getTableData().fullData[nextRowIndex])
      refSelectAlienEditor.value.ongetproject(xGrid.value.getTableData().fullData[nextRowIndex])
    }
  }
@@ -1653,7 +1655,7 @@
    if (nextRowIndex < xGrid.value.getTableData().fullData.length) {
      xGrid.value.setCurrentRow(xGrid.value.getTableData().fullData[nextRowIndex]);
      refSelectAlienEditor.value.ongetprojectOrder(xGrid.value.getTableData().fullData[nextRowIndex])
      refSelectAlienEditor.value.ongetproject(xGrid.value.getTableData().fullData[nextRowIndex])
    }
  }
@@ -1692,7 +1694,7 @@
}
const handleClick = ({ row }) => {
  refSelectAlienEditor.value.ongetprojectOrder(row)
  refSelectAlienEditor.value.ongetproject(row)
}
//图片上传名称
@@ -1702,7 +1704,7 @@
  row.fileData = fileData
  row.fileJson = fileJson
  row.shape=2
  ElMessage.success("保存成功")
  ElMessage.success(t('basicData.msg.saveSuccess'))
  alienEditorVisible.value=false
}
@@ -1715,7 +1717,6 @@
    reader.readAsDataURL(file);
  });
};
// 用列的 field 做 key;值是字符串(输入框的内容)
const form = reactive({})
@@ -1833,7 +1834,7 @@
  const val = isNumberLike(raw) ? Number(raw) : raw
  setByPath(row, field, val)
  editClosedEvent({ row, column: { property: field } })
  xGrid.value?.reloadRow(row)
  xGrid.value?.reloadRow(row) // 可选
}
//点击/切换行 显示上方数据
@@ -1879,8 +1880,8 @@
    <div class="order-primary" style="background-color: white;display: flex;">
      <div style="width: 70%;">
        <el-row>
          <el-col  :span="3"><el-text>*{{$t('order.project')}}:</el-text></el-col>
          <el-col  :span="3">
          <el-col  :span="4"><el-text>*{{$t('order.project')}}:</el-text></el-col>
          <el-col  :span="4">
            <!--          <el-input v-model.trim="titleUploadData.project"/>-->
            <el-select v-model.trim="titleUploadData.project"
                       @change="changeProject"
@@ -1892,8 +1893,8 @@
          </el-col>
          <el-col  :span="3"><el-text>*{{$t('order.customers')}}:</el-text></el-col>
          <el-col  :span="3">
          <el-col  :span="4"><el-text>*{{$t('order.customers')}}:</el-text></el-col>
          <el-col  :span="4">
            <el-select  v-model="titleUploadData.customerId"
                        @change="changeCustomer"
                        filterable
@@ -1911,8 +1912,13 @@
              </template>
            </el-select>
          </el-col>
          <el-col  :span="3"><el-text>*{{$t('order.orderType')}}:</el-text></el-col>
          <el-col  :span="3">
          <!--      <el-col :span="2"><el-text  /></el-col>-->
        </el-row>
        <el-row>
          <el-col  :span="4"><el-text>*{{$t('order.orderType')}}:</el-text></el-col>
          <el-col  :span="4">
            <el-select v-model="titleUploadData.orderType"  clearable placeholder=""  >
              <el-option
                  v-for="item in titleSelectJson['orderType']"
@@ -1922,8 +1928,8 @@
              />
            </el-select>
          </el-col>
          <el-col  :span="3"><el-text>{{$t('order.orderClassify')}}:</el-text></el-col>
          <el-col  :span="3">
          <el-col  :span="4"><el-text>{{$t('order.orderClassify')}}:</el-text></el-col>
          <el-col  :span="4">
            <el-select v-model="titleUploadData.orderClassify"  clearable placeholder=" " >
              <el-option
                  v-for="item in titleSelectJson['orderClassify']"
@@ -1933,12 +1939,10 @@
              />
            </el-select>
          </el-col>
          <!--      <el-col :span="2"><el-text  /></el-col>-->
        </el-row>
        <el-row>
          <el-col  :span="3"><el-text>{{$t('order.icon')}}:</el-text></el-col>
          <el-col  :span="3">
          <el-col  :span="4"><el-text>{{$t('order.icon')}}:</el-text></el-col>
          <el-col  :span="4">
            <el-select v-model="titleUploadData.icon"  clearable placeholder=" " allow-create  filterable default-first-option>
              <el-option  v-for="item in titleSelectJson['icon']"
                          :key="item.id"
@@ -1946,8 +1950,8 @@
                          :value="item.basicName"/>
            </el-select>
          </el-col>
          <el-col  :span="3"><el-text>{{$t('order.packType')}}:</el-text></el-col>
          <el-col  :span="3">
          <el-col  :span="4"><el-text>{{$t('order.packType')}}:</el-text></el-col>
          <el-col  :span="4">
            <el-select v-model="titleUploadData.packType"  clearable placeholder=" " allow-create  filterable >
              <el-option v-for="item in titleSelectJson['packType']"
                         :key="item.id"
@@ -1955,10 +1959,13 @@
                         :value="item.basicName"/>
            </el-select>
          </el-col>
          <el-col  :span="3"><el-text>{{$t('order.orderId')}}:</el-text></el-col>
          <el-col  :span="3"><el-text  >{{titleUploadData.orderId}}</el-text></el-col>
          <el-col  :span="3"><el-text>{{$t('order.deliveryDate')}}:</el-text></el-col>
          <el-col  :span="3">
        </el-row>
        <el-row>
          <el-col  :span="4"><el-text>{{$t('order.orderId')}}:</el-text></el-col>
          <el-col  :span="4"><el-text  >{{titleUploadData.orderId}}</el-text></el-col>
          <el-col  :span="4"><el-text>{{$t('order.deliveryDate')}}:</el-text></el-col>
          <el-col  :span="4">
            <el-date-picker
                v-model="titleUploadData.deliveryDate"
                type="date"
@@ -1970,10 +1977,10 @@
        </el-row>
        <el-row>
          <el-col  :span="3"><el-text>{{$t('order.batch')}}:</el-text></el-col>
          <el-col  :span="3"><el-input  v-model="titleUploadData.batch"/></el-col>
          <el-col  :span="3"><el-text>{{$t('order.calculateType')}}:</el-text></el-col>
          <el-col  :span="3">
          <el-col  :span="4"><el-text>{{$t('order.batch')}}:</el-text></el-col>
          <el-col  :span="4"><el-input  v-model="titleUploadData.batch"/></el-col>
          <el-col  :span="4"><el-text>{{$t('order.calculateType')}}:</el-text></el-col>
          <el-col  :span="4">
            <el-select @change="changeCalculateType" v-model="titleUploadData.calculateType"   placeholder=" " >
              <el-option :value="1" :label="t('order.areaAmountPerPiece')"/>
              <el-option :value="2" :label="t('order.areaAmountAge')"/>
@@ -1981,8 +1988,11 @@
              <el-option :value="4" :label="t('order.allAmount')"/>
            </el-select>
          </el-col>
          <el-col  :span="3"><el-text>*{{$t('order.salesman')}}:</el-text></el-col>
          <el-col  :span="3">
        </el-row>
        <el-row>
          <el-col  :span="4"><el-text>*{{$t('order.salesman')}}:</el-text></el-col>
          <el-col  :span="4">
            <el-select
                v-model="titleUploadData.salesmanId"
                @change = "changeSaleMan"
@@ -1995,8 +2005,8 @@
                         :value="item.id"/>
            </el-select>
          </el-col>
          <el-col  :span="3"><el-text style="white-space: nowrap;">{{$t('order.alType')}}</el-text></el-col>
          <el-col  :span="3">
          <el-col  :span="4"><el-text style="white-space: nowrap;">{{$t('order.alType')}}</el-text></el-col>
          <el-col  :span="4">
            <el-select v-model="titleUploadData.alType" clearable placeholder=" " >
              <el-option v-for="item in titleSelectJson['alType']"
                         :key="item.id"
@@ -2006,32 +2016,39 @@
          </el-col>
        </el-row>
        <el-row>
          <el-col  :span="3"><el-text>{{$t('order.money')}}:</el-text></el-col>
          <el-col  :span="3"><el-text >{{titleUploadData.money}}</el-text></el-col>
          <el-col  :span="3"><el-text>{{$t('order.contractId')}}:</el-text></el-col>
          <el-col  :span="3"><el-input v-model="titleUploadData.contractId"/></el-col>
          <el-col  :span="3"><el-text>{{$t('order.customerBatch')}}:</el-text></el-col>
          <el-col  :span="3"><el-input v-model="titleUploadData.customerBatch"/></el-col>
          <el-col  :span="3"><el-text>{{$t('order.contacts')}}:</el-text></el-col>
          <el-col  :span="3"><el-input v-model="titleUploadData.contacts" /></el-col>
          <el-col  :span="4"><el-text>{{$t('order.money')}}:</el-text></el-col>
          <el-col  :span="4"><el-text >{{titleUploadData.money}}</el-text></el-col>
          <el-col  :span="4"><el-text>{{$t('order.contractId')}}:</el-text></el-col>
          <el-col  :span="4"><el-input v-model="titleUploadData.contractId"/></el-col>
        </el-row>
        <el-row>
          <el-col  :span="3"><el-text>{{$t('order.contactNumber')}}:</el-text></el-col>
          <el-col  :span="3"><el-input v-model="titleUploadData.contactNumber"/></el-col>
          <el-col  :span="3"><el-text >{{$t('order.deliveryAddress')}}:</el-text></el-col>
          <el-col  :span="3"><el-input v-model="titleUploadData.deliveryAddress"/></el-col>
          <el-col  :span="3"><el-text>{{$t('order.ownerForProduction')}}:</el-text></el-col>
          <el-col  :span="3"><el-input v-model="ownerForProduction"/></el-col>
          <el-col  :span="3"><el-text>{{$t('order.surtax')}}:</el-text></el-col>
          <el-col  :span="3"><el-input v-model="surtax"/></el-col>
          <el-col  :span="4"><el-text>{{$t('order.customerBatch')}}:</el-text></el-col>
          <el-col  :span="4"><el-input v-model="titleUploadData.customerBatch"/></el-col>
          <el-col  :span="4"><el-text>{{$t('order.contacts')}}:</el-text></el-col>
          <el-col  :span="4"><el-input v-model="titleUploadData.contacts" /></el-col>
        </el-row>
        <el-row>
          <el-col  :span="3"><el-text>{{$t('order.valueAddedTax')}}:</el-text></el-col>
          <el-col  :span="3"><el-input v-model="valueAddedTax"/></el-col>
          <el-col  :span="3"><el-text>{{$t('order.cuttingTransport')}}:</el-text></el-col>
          <el-col  :span="3"><el-input v-model="cuttingTransport"/></el-col>
          <el-col  :span="4"><el-text>{{$t('order.contactNumber')}}:</el-text></el-col>
          <el-col  :span="4"><el-input v-model="titleUploadData.contactNumber"/></el-col>
          <el-col  :span="4"><el-text >{{$t('order.deliveryAddress')}}:</el-text></el-col>
          <el-col  :span="4"><el-input v-model="titleUploadData.deliveryAddress"/></el-col>
        </el-row>
        <el-row>
          <el-col  :span="4"><el-text>{{$t('order.ownerForProduction')}}:</el-text></el-col>
          <el-col  :span="4"><el-input v-model="ownerForProduction"/></el-col>
          <el-col  :span="4"><el-text>{{$t('order.surtax')}}:</el-text></el-col>
          <el-col  :span="4"><el-input v-model="surtax"/></el-col>
        </el-row>
        <el-row>
          <el-col  :span="4"><el-text>{{$t('order.valueAddedTax')}}:</el-text></el-col>
          <el-col  :span="4"><el-input v-model="valueAddedTax"/></el-col>
          <el-col  :span="4"><el-text>{{$t('order.cuttingTransport')}}:</el-text></el-col>
          <el-col  :span="4"><el-input v-model="cuttingTransport"/></el-col>
        </el-row>
        <!--      <el-row>-->
@@ -2042,14 +2059,14 @@
        <!--      </el-row>-->
      </div>
      <div style="width: 30%;position: relative;">
        <select-alien-editor
      <div style="width: 40%;position: relative;">
        <update-alien-editor2
            ref="refSelectAlienEditor"
            @getUploadPicture="getUploadPicture"
            style="width: 100%;height: 100%" />
      </div>
    </div>
    <div class="ipDiv order-primary" style="background:#fff;margin-top:10px;padding:6px 8px;">
      <template v-for="(group, gIdx) in formGroups" :key="gIdx">
        <el-row :gutter="8" style="margin-bottom:6px">
@@ -2081,6 +2098,7 @@
        </el-row>
      </template>
    </div>
    <div class="order-detail">
      <vxe-grid
          height="100%"
@@ -2185,7 +2203,7 @@
               :close-on-click-modal="false"
               :close-on-press-escape="false"
               destroy-on-close
               style="width: 1014px;height:570px ">
               style="width: 1114px;height:600px ">
      <update-alien-editor
          ref="refAlienEditor"
          :rowIndex="rowIndex"
@@ -2246,7 +2264,7 @@
.el-col{
  border: #181818 1px solid;
}
:deep(.order-primary .el-input__wrapper ) {
:deep(.order-primary .el-input__wrapper) {
  box-shadow: 0 0 0 0 var(--el-input-border-color, var(--el-border-color)) inset;
  cursor: default;
  border: none !important;
@@ -2257,7 +2275,7 @@
}
.order-detail{
  width: 100%;
  height: 45%;
  height: 44%;
}
.vxe-grid {
  /* 禁用浏览器默认选中 */
north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java
@@ -59,6 +59,8 @@
    Integer findDeliverydetailsum(String deliveryId,Integer deliveryDetailState);
    Integer findFinishedOperateLogQuantity(String orderId);
    Boolean updateInventory(@Param("flowCard") FlowCard flowCard,
                            @Param("storageRegion") String storageRegion,
                            @Param("remark") String remark, @Param("container") String container);
north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java
@@ -924,6 +924,11 @@
            Integer deliverysum = finishedGoodsInventoryMapper.findDeliveryQuantity(orderDetail.getDeliveryDetail().getDeliveryId());
            //获取已经出库的数量
            Integer deliverydetailsum = finishedGoodsInventoryMapper.findDeliverydetailsum(orderDetail.getDeliveryDetail().getDeliveryId(),0);
            Integer finishedOperateLogQuantitySum = finishedGoodsInventoryMapper.findFinishedOperateLogQuantity(orderDetail.getDeliveryDetail().getOrderId());
            if(finishedOperateLogQuantitySum==null){
                finishedOperateLogQuantitySum=0;
            }
            if(deliverydetailsum==null){
                deliverydetailsum=0;
            }
@@ -954,7 +959,7 @@
                        //修改订单表发货状态
                        finishedGoodsInventoryMapper.updateOrderDeliveryState(orderDetail.getDeliveryDetail().getOrderId(),1);
                        //判断订单是否全部发货
                        if (orderNumberdsum==orderNumberdDeliverysum) {
                        if (ordersum==finishedOperateLogQuantitySum) {
                            //if (ordersum == (orderDeliveryQuantitySum + orderDetail.getWarehouseNum())) {
                            //修改订单表发货状态
                            finishedGoodsInventoryMapper.updateOrderDeliveryState(orderDetail.getDeliveryDetail().getOrderId(),2);
north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml
@@ -149,26 +149,51 @@
        update mm.finished_goods_inventory
        set quantity_available=quantity_available+#{quantity},
            update_time=now(),area=actual_signal_area*quantity_available
        where order_number=#{orderNumber}  and order_id=#{orderId} and trim(box_no) = trim(#{boxNo})
        where order_number=#{orderNumber}  and order_id=#{orderId}
        <if test="boxNo != null and boxNo != ''">
            and trim(box_no) = trim(#{boxNo})
        </if>
        <if test="boxNo == null ">
            and box_no  is null
        </if>
    </update>
    <update id="updateInventoryquantityOut">
        update mm.finished_goods_inventory
        set quantity_available=quantity_available-#{quantity},
            update_time=now(),area=actual_signal_area*quantity_available
        where order_id=#{orderId}  and order_number=#{orderNumber}  and trim(box_no) = trim(#{boxNo})
        where order_id=#{orderId}  and order_number=#{orderNumber}
        <if test="boxNo != null and boxNo != ''">
            and trim(box_no) = trim(#{boxNo})
        </if>
        <if test="boxNo == null ">
            and box_no  is null
        </if>
    </update>
    <update id="updateInventoryInventoryInt">
        update mm.finished_goods_inventory
        set inventory=inventory+#{quantity}
        where order_number=#{orderNumber}  and order_id=#{orderId} and trim(box_no) = trim(#{remarks})
        where order_number=#{orderNumber}  and order_id=#{orderId}
        <if test="remarks != null and remarks != ''">
            and trim(box_no) = trim(#{remarks})
        </if>
        <if test="remarks == null ">
            and box_no  is null
        </if>
    </update>
    <update id="updateInventoryInventoryOut">
        update mm.finished_goods_inventory
        set inventory=inventory-#{quantity}
        where order_number=#{orderNumber}  and order_id=#{orderId} and trim(box_no) = trim(#{boxNo})
        where order_number=#{orderNumber}  and order_id=#{orderId}
        <if test="boxNo != null and boxNo != ''">
            and trim(box_no) = trim(#{boxNo})
        </if>
        <if test="boxNo == null ">
            and box_no  is null
        </if>
    </update>
    <select id="getSelectAllocate"  resultMap="selectDeliveryFinishedGoodsInventory">
@@ -292,7 +317,13 @@
    <update id="updateDeliveryDetailState">
        update sd.delivery_detail
        set delivery_detail_state=#{state}
        where order_number=#{orderNumber}  and order_id=#{orderId} and delivery_id=#{deliveryId} and trim(box_no) = trim(#{remarks})
        where order_number=#{orderNumber}  and order_id=#{orderId} and delivery_id=#{deliveryId}
        <if test="remarks != null and remarks != ''">
            and trim(box_no) = trim(#{remarks})
        </if>
        <if test="remarks == null ">
            and box_no  is null
        </if>
    </update>
    <update id="updateInventoryquantityavailable">
@@ -471,6 +502,10 @@
        select ifnull(sum(quantity),0) from sd.`delivery_detail`  where delivery_id=#{deliveryId} and delivery_detail_state=#{deliveryDetailState}
    </select>
    <select id="findFinishedOperateLogQuantity"  >
        select sum(quantity) from mm.finished_operate_log  where operate_type='出库' and status='未审核' and order_id=#{orderId}
    </select>
    <update id="updateOrderWarehousingState">
        update sd.`order`
        set warehousing=#{state}
@@ -533,7 +568,14 @@
        <if test="container != null and container != ''">
            , box_no= #{container}
        </if>
        where order_number=#{flowCard.orderNumber}  and order_id=#{flowCard.order.orderId} and box_no= #{container}
        where order_number=#{flowCard.orderNumber}  and order_id=#{flowCard.order.orderId}
        <if test="container != null and container != ''">
            and box_no= #{container}
        </if>
        <if test="container == null ">
            and box_no  is null
        </if>
    </update>
    <update id="updateInventoryOut">
@@ -541,7 +583,12 @@
        set inventory=inventory-${finishedOperateLog.quantity},quantity_available=quantity_available-${finishedOperateLog.quantity},
        update_time=now(),area=actual_signal_area*quantity_available
        where order_number=#{finishedOperateLog.operationNumber}  and order_id=#{finishedOperateLog.orderId}
        and box_no=#{finishedOperateLog.remarks}
        <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''">
            and box_no=#{finishedOperateLog.remarks}
        </if>
        <if test="finishedOperateLog.remarks == null ">
            and box_no  is null
        </if>
    </update>
    <insert id="insertFinishedGoodsInventory"  useGeneratedKeys="true"  >
@@ -572,14 +619,26 @@
    <select id="findOrderNumberdcount" >
        select count(*)
        from  mm.`finished_goods_inventory`
        where order_number = #{orderNumber} and order_id=#{orderId} and box_no=#{boxNo};
        where order_number = #{orderNumber} and order_id=#{orderId}
        <if test="boxNo != null and boxNo != ''">
            and box_no=#{boxNo}
        </if>
        <if test="boxNo == null ">
            and box_no  is null
        </if>
    </select>
    <select id="findOrderNumberdContainercount" >
        select count(*)
        from  mm.`finished_goods_inventory`
        where order_number = #{orderNumber} and order_id=#{orderId} and box_no=#{container};
        where order_number = #{orderNumber} and order_id=#{orderId}
        <if test="container != null and container != ''">
            and box_no=#{container}
        </if>
        <if test="container == null ">
            and box_no  is null
        </if>
    </select>
@@ -1040,7 +1099,12 @@
          and order_id=#{orderId}
          and delivery_id=#{deliveryId}
          and delivery_detail_state=0
        and trim(#{boxNo}) =box_no
        <if test="boxNo != null and boxNo != ''">
            and  box_no=trim(#{boxNo})
        </if>
        <if test="boxNo == null ">
            and  box_no is null
        </if>
    </select>
    <select id="getSelectDeliveryDetailDeliveryId"  resultMap="selectDelivery">
north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetailMapper.xml
@@ -217,11 +217,11 @@
        select *
        <if test="step != null and step != ''">
            ,sum(e.break) as 'breakage_quantity'
            ,Round(sum(e.break)*e.area,2) as 'breakage_quantity'
            ,Round(sum(e.break)*e.area,2) as 'breakage_area'
        </if>
        <if test="step == null || step == ''">
            ,e.break as 'breakage_quantity'
            ,Round(e.break*e.area,2) as 'breakage_quantity'
            ,Round(e.break*e.area,2) as 'breakage_area'
        </if>
        from(select CAST(concat(b.order_id,'/',a.order_number,'/',a.technology_number) as char ) as 'order_id',
               c.child_width,