chenlu
2024-05-16 6edc05acd8bb1de3bedbf093c618d429c62d446b
Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
7个文件已修改
1个文件已添加
141 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/hook/columnMove.js 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/product/SelectProduct.vue 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/sd/Customer.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/CustomerMapper.xml 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/hook/columnMove.js
New file
@@ -0,0 +1,41 @@
import Sortable from 'sortablejs'
import {VXETable} from "vxe-table";
/*表格拖拽*/
let sortable2 = null
 function columnDrop2(xGrid){
    const $grid = xGrid
    sortable2 = Sortable.create($grid.$el.querySelector('.body--wrapper>.vxe-table--header .vxe-header--row'), {
        handle: '.vxe-header--column',
        onEnd: (sortableEvent) => {
            const targetThElem = sortableEvent.item
            const newIndex = sortableEvent.newIndex
            const oldIndex = sortableEvent.oldIndex
            const { fullColumn, tableColumn } = $grid.getTableColumn()
            const wrapperElem = targetThElem.parentNode
            const newColumn = fullColumn[newIndex]
            if (newColumn.fixed) {
                // 错误的移动
                const oldThElem = wrapperElem.children[oldIndex]
                if (newIndex > oldIndex) {
                    wrapperElem.insertBefore(targetThElem, oldThElem)
                } else {
                    wrapperElem.insertBefore(targetThElem, oldThElem ? oldThElem.nextElementSibling : oldThElem)
                }
                VXETable.modal.message({ content: '固定列不允许拖动!', status: 'error' })
                return
            }
            // 获取列索引 columnIndex > fullColumn
            const oldColumnIndex = $grid.getColumnIndex(tableColumn[oldIndex])
            const newColumnIndex = $grid.getColumnIndex(tableColumn[newIndex])
            // 移动到目标列
            const currRow = fullColumn.splice(oldColumnIndex, 1)[0]
            fullColumn.splice(newColumnIndex, 0, currRow)
            $grid.loadColumn(fullColumn)
        }
    })
}
export {
    columnDrop2,
    sortable2
}
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -629,8 +629,9 @@
    return false;
  });
  const notFinishList = xGrid.value.getTableData().fullData.filter(item =>{
    return item.saveFlag === false
    return item.saveFlag === 0
  })
  for(let item of uniqueByOrderNum){
    if(!checkSameNumForId(notFinishList,item.order_number)){
      ElMessage.error(`请检查订单序号: ${item.order_number} 报工数量是否相同!`)
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
@@ -442,13 +442,13 @@
//初始化判断是否有id传入
onMounted(()=>{
  //启用表格拖动选中
  addListener(xGrid.value,gridOptions)
  const str = route.query.orderId || history.state.orderId
  if (typeof str === 'undefined' || str === null || str === '' || str === '\n' || str === '\r'){
    return
  }
  gridOptions.loading = true
  request.post(`/order/getOrderById/${str}`).then((res) => {
    if(res.code==200){
      titleUploadData.value = res.data.order
@@ -504,8 +504,11 @@
        item.otherColumns = JSON.parse(item.otherColumns)
      })
      otherMoney.value =res.data.orderOtherMoneyList
          //加载副表数据
      xGrid.value.reloadData(orderDetails)
      gridOptions.loading = false
    }else{
      ElMessage.error(res.msg)
    }
@@ -635,6 +638,10 @@
  const changedCustomerId = titleUploadData.value.customerId
  const customer = titleSelectJson.value.customer.filter(item => item.id === changedCustomerId)
  titleUploadData.value.customerName = customer[0].customerName
  titleUploadData.value.project = customer[0].project
  titleUploadData.value.salesmanId = customer[0].salesmanId
  titleUploadData.value.salesman = customer[0].salesman
  //titleSelectJson.value.customer
}
north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
@@ -1,7 +1,7 @@
<script setup>
  import {Search} from "@element-plus/icons-vue"
  import {useRouter} from "vue-router"
  import {computed, reactive, ref} from "vue"
  import {computed, nextTick, onUnmounted, reactive, ref} from "vue"
  import ProcessCardProgress from '@/views/pp/report/ProcessCardProgress.vue'
  import request from "@/utils/request"
  import deepClone from "@/utils/deepClone"
@@ -9,6 +9,7 @@
  import {VXETable} from "vxe-table"
  import  useUserInfoStore from '@/stores/userInfo'
  import {useI18n} from "vue-i18n"
  import {columnDrop2, sortable2} from "@/hook/columnMove";
  const { t } = useI18n()
  const userStore = useUserInfoStore()
  const router = useRouter()
@@ -302,6 +303,21 @@
  })
  let initTime = null
  nextTick(() => {
    // 加载完成之后在绑定拖动事件
    initTime = setTimeout(() => {
      columnDrop2(xGrid.value)
    }, 500)
  })
  onUnmounted(() => {
    clearTimeout(initTime)
    if (sortable2) {
      sortable2.destroy()
    }
  })
</script>
<template>
north-glass-erp/northglass-erp/src/views/sd/product/SelectProduct.vue
@@ -7,6 +7,7 @@
import {Search} from "@element-plus/icons-vue"
import GlassType from "@/components/sd/product/GlassType.vue"
import {useRouter} from  'vue-router'
import {columnDrop2,sortable2} from "@/hook/columnMove"
import Sortable from 'sortablejs'
import BasicTable from '@/components/sd/product/BasicTable.vue'
import {VXETable} from "vxe-table";
@@ -287,47 +288,15 @@
  return regex.test(value); // 返回true/false
}
/*表格拖拽*/
let sortable2: any
const columnDrop2 = () => {
  const $grid = xGrid.value
  sortable2 = Sortable.create($grid.$el.querySelector('.body--wrapper>.vxe-table--header .vxe-header--row'), {
    handle: '.vxe-header--column',
    onEnd: (sortableEvent) => {
      const targetThElem = sortableEvent.item
      const newIndex = sortableEvent.newIndex
      const oldIndex = sortableEvent.oldIndex
      const { fullColumn, tableColumn } = $grid.getTableColumn()
      const wrapperElem = targetThElem.parentNode
      const newColumn = fullColumn[newIndex]
      if (newColumn.fixed) {
        // 错误的移动
        const oldThElem = wrapperElem.children[oldIndex]
        if (newIndex > oldIndex) {
          wrapperElem.insertBefore(targetThElem, oldThElem)
        } else {
          wrapperElem.insertBefore(targetThElem, oldThElem ? oldThElem.nextElementSibling : oldThElem)
        }
        VXETable.modal.message({ content: '固定列不允许拖动!', status: 'error' })
        return
      }
      // 获取列索引 columnIndex > fullColumn
      const oldColumnIndex = $grid.getColumnIndex(tableColumn[oldIndex])
      const newColumnIndex = $grid.getColumnIndex(tableColumn[newIndex])
      // 移动到目标列
      const currRow = fullColumn.splice(oldColumnIndex, 1)[0]
      fullColumn.splice(newColumnIndex, 0, currRow)
      $grid.loadColumn(fullColumn)
    }
  })
}
let initTime: any
let initTime = null
nextTick(() => {
  // 加载完成之后在绑定拖动事件
  initTime = setTimeout(() => {
    columnDrop2()
    columnDrop2(xGrid.value)
  }, 500)
})
north-glass-erp/src/main/java/com/example/erp/entity/sd/Customer.java
@@ -1,6 +1,7 @@
package com.example.erp.entity.sd;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
@@ -15,4 +16,11 @@
    private String address;
    private String contact;
    private String phone;
    @TableField(select = false,exist = false)
    private String project;
    @TableField(select = false,exist = false)
    private Integer salesmanId;
    @TableField(select = false,exist = false)
    private String salesman;
}
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -68,11 +68,11 @@
        //查询流程卡工艺流程
        String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr);
        //定义-的位置
        int index = technologicalProcess.indexOf("-");
        //获取工艺流程第一个工序
        String interceptProcess = technologicalProcess.substring(0, index);
        String[] processList = technologicalProcess.split("->");
        //获取工艺流程第一个工序
        String interceptProcess = processList[0];
        int length = processList.length;
        //定义当前工序上下工序
north-glass-erp/src/main/resources/mapper/sd/CustomerMapper.xml
@@ -161,9 +161,18 @@
    <select id="getCustomerList">
        select
            *
            a.*,
            b.project,
            b.salesman_id,
            b.salesman
        from
            sd.customer
            sd.customer as a
        left join (select o.project,o.salesman_id,o.salesman,o.customer_id
                   from sd.order as o
                   group by o.customer_id
                   order by o.id desc) as b
        on a.id = b.customer_id
    </select>
    <select id="getSelectCustomer">
        select