廖井涛
2025-03-26 7a0527e207c59cdcce0b1f7a41bd7457a236ab23
north-glass-erp/northglass-erp/src/views/sd/order/UpdateOrderCraft.vue
@@ -6,12 +6,16 @@
import {changeFilterEvent,filterChanged} from "@/hook"
import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove"
import {useI18n} from "vue-i18n"
import companyInfo from "@/stores/sd/companyInfo"
import UpdateOrderCraft from "@/components/sd/order/UpdateOrderCraft.vue"
const { t } = useI18n()
const router = useRouter()
const route = useRoute()
let dialogTableVisible = ref(false)
let craftVisible = ref(false)
const iconNickname = ref()
const company = companyInfo()
const xGrid = ref()
const trademarkLocation=ref([t('craft.upperLeft'),t('craft.upperRight'),t('craft.lowLeft'),t('craft.lowRight')])
const gridOptions = reactive({
@@ -26,6 +30,7 @@
  importConfig: {},
  exportConfig: {},
  scrollY:{ enabled: true,gt:13 },//开启虚拟滚动
  scrollX:{ enabled: true,gt:7 },//开启虚拟滚动
  showOverflow:true,
  columnConfig: {
    resizable: true,
@@ -46,9 +51,9 @@
  columns:[
    {title: t('basicData.operate'), width: 220, slots: { default: 'button_slot' },fixed:"left",},
    {field: 'orderNumber',fixed:"left",width:120,  title: t('order.OrderNum'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'orderDetail.productId',fixed:"left",width:120,  title: t('order.productId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'orderDetail.productId',fixed:"left",width:120,  title: t('order.productId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'orderDetail.productName',fixed:"left",width:120,  title: t('order.product'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'technologyNumber',width:120,  title: t('craft.glassAddress'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'technologyNumber',width:120, fixed:"left", title: t('craft.glassAddress'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'glassChild',width:120,  title: t('craft.glassChild'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'orderDetail.width',width:120,  title: t('craft.width'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'orderDetail.height',width:120,  title: t('craft.height'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
@@ -56,6 +61,7 @@
    {field: 'totalArea',width:120,  title: t('craft.totalArea'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'childWidth',width:120,  title: t('craft.childWidth'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'childHeight',width:120,  title: t('craft.childHeight'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'arc',width:120,  title: t('craft.arc'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'area',width:120,  title: t('craft.area'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'orderDetail.quantity',width:120,  title: t('order.quantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'process',width:120,  title: t('craft.process'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
@@ -80,8 +86,9 @@
            { code: 'copyChecked', name: t('basicData.selectSame'), prefixIcon: 'vxe-icon-copy', visible: true, disabled: false },
            { code: 'copyAll', name: t('basicData.sameAfterwards'), prefixIcon: 'vxe-icon-feedback', visible: true, disabled: false },
            { code: 'clearChecked', name: t('basicData.clearSelection'), prefixIcon: 'vxe-icon-indicator', visible: true, disabled: false },
            { code: 'computedSize', name: '科学计数', prefixIcon: 'vxe-icon-chart-line', visible: true, disabled: false },
            { code: 'paste', name: '粘贴', prefixIcon: 'vxe-icon-paste', visible: true, disabled: false },
            { code: 'computedSize', name: t('basicData.computedSize'), prefixIcon: 'vxe-icon-chart-line', visible: true, disabled: false },
            { code: 'paste', name: t('basicData.paste'), prefixIcon: 'vxe-icon-paste', visible: true, disabled: false },
            { code: 'sort', name: t('craft.sort'), prefixIcon: 'vxe-icon-sort-asc', visible: true, disabled: false },
          ]
      ]
    }
@@ -218,9 +225,29 @@
                  data[i+flag][column] = text[i]
                }
              })
          break
        }
        case 'sort' :{
          const uniqueArray = xGrid.value.getTableData().fullData.filter((item, index, self) =>
                  index === self.findIndex((t) => (
                      t.orderNumber === item.orderNumber
                  ))
          )
          for (let i=0; i<uniqueArray.length; i++)  {
            const sameOrderNumber  =  xGrid.value.getTableData().fullData.filter((item) =>
              parseInt(item.orderNumber) === i+1
            )
            let widthList = []
            sameOrderNumber.forEach((item) =>
              widthList.push(item.childWidth)
            )
            widthList = widthList.sort();
            sameOrderNumber.forEach((item,index) =>{
              item.childWidth = widthList[index]
            })
          }
          break
        }
      }
@@ -279,6 +306,10 @@
request.get(`/basicData/BasicDataByType/order/icon`).then((res) =>{
  if (res.code==200){
    trademarkList.value = res.data
    trademarkList.value.forEach(item =>{
      item.basicName
    })
  }
})
@@ -318,6 +349,11 @@
  if(row.icon!=null){
    trademarkAttr.value = JSON.parse(row.icon)
  }
  trademarkList.value.forEach(item =>{
    if(item.basicName===trademarkAttr.value.trademark){
      iconNickname.value=item.nickname
    }
  })
  rowIndex.value = row
}
@@ -334,21 +370,14 @@
  newCraft: [],
  oldCraft: []
})
const resetCraft = () => {
  craftObj.newCraft = []
}
const saveCraft = () => {
  rowIndex.value.process = craftObj.newCraft.join('->')
  craftVisible.value= false
}
const newCraftComputed = computed(() =>{
  return craftObj.newCraft.join('->')
})
const oldCraftComputed = computed(() =>{
  return craftObj.oldCraft.join('->')
})
//初始化判断是否有id传入
onMounted(()=>{
@@ -413,6 +442,22 @@
  }
}
const iconChange = () => {
  trademarkList.value.forEach(item =>{
    if(item.basicName===trademarkAttr.value.trademark){
      iconNickname.value=item.nickname
    }
  })
  if(trademarkAttr.value.trademark===company.icon){
    trademarkAttr.value.xMargin=66
  }
}
let enlargementFlag = ref(false)
const trademarkenlargement = () => {
  enlargementFlag.value = !enlargementFlag.value
}
</script>
@@ -473,7 +518,10 @@
        <template #num1_filter="{ column, $panel }">
          <div>
            <div v-for="(option, index) in column.filters" :key="index">
              <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/>
              <input type="type"
                     v-model="option.data"
                     @keyup.enter.native="$panel.confirmFilter()"
                     @input="changeFilterEvent($event, option, $panel)"/>
            </div>
          </div>
        </template>
@@ -498,29 +546,12 @@
               :close-on-click-modal="false"
               :close-on-press-escape="false"
               style="width: 60%;height:60% ;position: relative;" >
      <h5>{{$t('craft.processAttribute')}}</h5>
      <el-checkbox
          v-model="craftObj.newCraft"
          v-for="item in process"
          :label="item.basicName"
          class="glass-process-checkbox"
          size="small" />
      <el-row style="width: 90%;border: 0;position: absolute;bottom: 1rem; left: 50%;transform: translateX(-50%);">
        <span class="ml-3 w-35 text-gray-600 inline-flex items-center"
        >{{$t('craft.oldProcess')}}:
        </span>
        <el-input :value="oldCraftComputed" disabled class="w-50 m-2" />
        <span class="ml-3 w-35 text-gray-600 inline-flex items-center"
        >{{$t('craft.newProcess')}}:
        </span>
        <el-input :value="newCraftComputed" disabled class="w-50 m-2" />
        <el-col style="margin-top: 0.5rem">
          <el-button type="primary" @click="resetCraft">{{$t('craft.reset')}}</el-button>
          <el-button type="primary" @click="saveCraft">{{$t('basicData.save')}}</el-button>
        </el-col>
      </el-row>
      <update-order-craft
          :craftObj="craftObj"
          :process="process"
          @saveCraft="saveCraft"
      />
    </el-dialog>
    <el-dialog
        id="trademark"
@@ -534,8 +565,7 @@
        <el-row style="">
          <el-col :span="4">{{$t('craft.TrademarkOptions')}}:</el-col>
          <el-col :span="6">
            <el-select v-model="trademarkAttr.trademark"
                        >
            <el-select v-model="trademarkAttr.trademark" @change ="iconChange" filterable>
              <el-option :value="item.basicName" v-for="item in trademarkList" />
            </el-select>
          </el-col>
@@ -545,8 +575,8 @@
          <el-col :span="4">{{$t('craft.xImage')}}:</el-col>
          <el-col :span="6">
            <el-select v-model="trademarkAttr.xImage">
              <el-option :value="true" :label="'是'"/>
              <el-option :value="false" :label="'否'"/>
              <el-option :value="true" :label="$t('basicData.true')"/>
              <el-option :value="false" :label="$t('basicData.false')"/>
            </el-select>
          </el-col>
        </el-row>
@@ -555,8 +585,8 @@
          <el-col :span="4">{{$t('craft.yImage')}}:</el-col>
          <el-col :span="6">
            <el-select v-model="trademarkAttr.yImage">
              <el-option :value="true" :label="'是'"/>
              <el-option :value="false" :label="'否'"/>
              <el-option :value="true" :label="$t('basicData.true')"/>
              <el-option :value="false" :label="$t('basicData.false')"/>
            </el-select>
          </el-col>
        </el-row>
@@ -565,8 +595,8 @@
          <el-col :span="4">{{$t('craft.tag')}}:</el-col>
          <el-col :span="6">
            <el-select v-model="trademarkAttr.tag">
              <el-option :value="true" :label="'是'"/>
              <el-option :value="false" :label="'否'"/>
              <el-option :value="true" :label="$t('basicData.true')"/>
              <el-option :value="false" :label="$t('basicData.false')"/>
            </el-select>
          </el-col>
        </el-row>
@@ -575,8 +605,8 @@
          <el-col :span="4">{{$t('craft.tag2')}}:</el-col>
          <el-col :span="6">
            <el-select v-model="trademarkAttr.tag2">
              <el-option :value="true" :label="'是'"/>
              <el-option :value="false" :label="'否'"/>
              <el-option :value="true" :label="$t('basicData.true')"/>
              <el-option :value="false" :label="$t('basicData.false')"/>
            </el-select>
          </el-col>
        </el-row>
@@ -585,21 +615,21 @@
          <el-col :span="4">{{$t('craft.tag3')}}:</el-col>
          <el-col :span="6">
            <el-select v-model="trademarkAttr.tag3">
              <el-option :value="true" :label="'是'"/>
              <el-option :value="false" :label="'否'"/>
              <el-option :value="true" :label="$t('basicData.true')"/>
              <el-option :value="false" :label="$t('basicData.false')"/>
            </el-select>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">{{$t('craft.xMargin')}}:</el-col>
          <el-col :span="4">{{$t('order.width')}}:</el-col>
          <el-col :span="6">
            <el-input-number v-model="trademarkAttr.xMargin"/>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">{{$t('craft.yMargin')}}:</el-col>
          <el-col :span="4">{{$t('order.height')}}:</el-col>
          <el-col :span="6">
            <el-input-number v-model="trademarkAttr.yMargin"/>
          </el-col>
@@ -619,75 +649,90 @@
          </el-col>
        </el-row>
      </div>
      <div style="width: 400px;height: 250px;border: 2px solid #000;float: left;position: relative;">
      <div v-if="!enlargementFlag" style="width: 400px;height: 250px;border: 2px solid #000;float: left;position: relative;">
        <div
            v-if="tagCheck(t('craft.upperLeft'))"
            style="float: left;width: 60px;height: 60px;margin-left: 1rem">
          <el-row>
            <el-col :span="20"><el-image :class="{'xStyle':trademarkAttr.xImage,'yStyle':trademarkAttr.yImage}" src="/trademark.png"/></el-col>
            style="float: left;width: 50px;height: 90px;margin-left: 1rem;margin-top: 15px">
          <el-row class="icon">
            <el-col class="icon" >
              <el-image @dblclick="trademarkenlargement" style="width: 100%;height: 100%" :class="{'xStyle':trademarkAttr.xImage,'yStyle':trademarkAttr.yImage}"  :src="iconNickname"/>
            </el-col>
          </el-row>
          <el-row style="margin-top: -25px" >
            <el-col :span="5" >X:</el-col>
            <el-col :span="2" >{{trademarkAttr.xMargin}}</el-col>
          <el-row  >
            <el-col :span="12" >{{$t('order.width')}}:</el-col>
            <el-col :span="12" >{{trademarkAttr.xMargin}}</el-col>
          </el-row>
          <el-row >
            <el-col :span="5" >Y:</el-col>
            <el-col :span="2" >{{trademarkAttr.yMargin}}</el-col>
            <el-col :span="12" >{{$t('order.height')}}:</el-col>
            <el-col :span="12" >{{trademarkAttr.yMargin}}</el-col>
          </el-row>
        </div>
        <div
            v-if="tagCheck(t('craft.upperRight'))"
            style="float: right;width: 60px;height: 60px;margin-right: 1rem">
          <el-row>
            <el-col :span="20"><el-image  :class="{'xStyle':trademarkAttr.xImage,'yStyle':trademarkAttr.yImage}" src="/trademark.png"/></el-col>
            style="float: right;width: 50px;height: 90px;margin-right: 1rem;margin-top: 15px">
          <el-row class="icon">
            <el-col class="icon" >
              <el-image @dblclick="trademarkenlargement" style="width: 100%;height: 100%" :class="{'xStyle':trademarkAttr.xImage,'yStyle':trademarkAttr.yImage}"  :src="iconNickname"/>
            </el-col>
          </el-row>
          <el-row style="margin-top: -25px" >
            <el-col :span="5" >X:</el-col>
            <el-col :span="2" >{{trademarkAttr.xMargin}}</el-col>
          <el-row  >
            <el-col :span="12" >{{$t('order.width')}}:</el-col>
            <el-col :span="12" >{{trademarkAttr.xMargin}}</el-col>
          </el-row>
          <el-row >
            <el-col :span="5" >Y:</el-col>
            <el-col :span="2" >{{trademarkAttr.yMargin}}</el-col>
            <el-col :span="12" >{{$t('order.height')}}:</el-col>
            <el-col :span="12" >{{trademarkAttr.yMargin}}</el-col>
          </el-row>
        </div>
        <div
            v-if="tagCheck(t('craft.lowLeft'))"
            style="width: 60px;height: 60px;margin-left: 1rem;float: left;position: absolute;bottom: 15px">
          <el-row>
            <el-col :span="20"><el-image :class="{'xStyle':trademarkAttr.xImage,'yStyle':trademarkAttr.yImage}"  src="/trademark.png"/></el-col>
          </el-row>
          <el-row style="margin-top: -25px" >
            <el-col :span="5" >X:</el-col>
            <el-col :span="2" >{{trademarkAttr.xMargin}}</el-col>
            style="width: 50px;height: 90px;margin-left: 1rem;float: left;position: absolute;bottom: 15px" >
          <el-row  >
            <el-col :span="12" >{{$t('order.width')}}:</el-col>
            <el-col :span="12" >{{trademarkAttr.xMargin}}</el-col>
          </el-row>
          <el-row >
            <el-col :span="5" >Y:</el-col>
            <el-col :span="2" >{{trademarkAttr.yMargin}}</el-col>
            <el-col :span="12" >{{$t('order.height')}}:</el-col>
            <el-col :span="12" >{{trademarkAttr.yMargin}}</el-col>
          </el-row>
          <el-row class="icon">
            <el-col class="icon" >
              <el-image @dblclick="trademarkenlargement" style="width: 100%;height: 100%" :class="{'xStyle':trademarkAttr.xImage,'yStyle':trademarkAttr.yImage}"  :src="iconNickname"/>
            </el-col>
          </el-row>
        </div>
        <div
            v-if="tagCheck(t('craft.lowRight'))"
            style="width: 60px;height: 60px;position: absolute;bottom: 15px;right: 1rem">
            style="width: 50px;height: 90px;position: absolute;bottom: 15px;right: 1rem">
          <el-row>
            <el-col :span="20">
              <el-image :class="{'xStyle':trademarkAttr.xImage,'yStyle':trademarkAttr.yImage}"  src="/trademark.png"/>
            <el-col :span="12" >{{$t('order.width')}}:</el-col>
            <el-col :span="12" >{{trademarkAttr.xMargin}}</el-col>
          </el-row>
          <el-row>
            <el-col :span="12" >{{$t('order.height')}}:</el-col>
            <el-col :span="12" >{{trademarkAttr.yMargin}}</el-col>
          </el-row>
          <el-row class="icon">
            <el-col class="icon">
              <el-image style="width: 100%;height: 100%"  @dblclick="trademarkenlargement" :class="{'xStyle':trademarkAttr.xImage,'yStyle':trademarkAttr.yImage}"  :src="iconNickname"/>
            </el-col>
          </el-row>
          <el-row style="margin-top: -25px">
            <el-col :span="5" >X:</el-col>
            <el-col :span="2" >{{trademarkAttr.xMargin}}</el-col>
          </el-row>
          <el-row >
            <el-col :span="5" >Y:</el-col>
            <el-col :span="2" >{{trademarkAttr.yMargin}}</el-col>
          </el-row>
        </div>
        <div style="position: absolute;left: 405px;top: 115px;color: red">{{$t('order.height')}}</div>
        <div style="position: absolute;left: 200px;top: 250px;color: red">{{$t('order.width')}}</div>
      </div>
      <div v-if="enlargementFlag" style="width: 400px;height: 250px;float: left;position: relative;">
        <el-image  @dblclick="trademarkenlargement" style="z-index: 9999;max-width: 100%;max-height: 100%" :src="iconNickname"/>
      </div>
    </el-dialog>
@@ -732,4 +777,8 @@
.yStyle{
  transform : rotateX(180deg)
}
.icon{
  width: 50px;
  height: 50px;
}
</style>