廖井涛
2024-03-15 5a5e59f8aaa2a030511ef245886bf6d1db9bf774
Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
39个文件已修改
1个文件已添加
3262 ■■■■ 已修改文件
north-glass-erp/.idea/dataSources.local.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/router/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/ProcessCard.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue 270 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectDetailProcessCard.vue 276 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue 299 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/ReportingWorks.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/SelectReportingWorks.vue 376 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/workOrder/AddWorkOrder.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/workOrder/WorkOrder.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/UpdateOrderCraft.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/pp/DamageDetails.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/pp/ReportingWork.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkDetailMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderProcessDetailMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml 261 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml 257 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReportingWorkDetail.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetail.xml 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/FolwCard.xml 261 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/ReportingWork.xml 257 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/ReportingWorkDetail.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/OrderProcessDetail.xml 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/.idea/dataSources.local.xml
@@ -23,7 +23,6 @@
      <database-info product="MySQL" version="8.0.19" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-java-8.0.25 (Revision: 08be9e9b4cba6aa115f9b27b215887af40b159e0)" dbms="MYSQL" exact-version="8.0.19" exact-driver-version="8.0">
        <extra-name-characters>#@</extra-name-characters>
        <identifier-quote-string>`</identifier-quote-string>
        <jdbc-catalog-is-schema>true</jdbc-catalog-is-schema>
      </database-info>
      <case-sensitivity plain-identifiers="lower" quoted-identifiers="lower" />
      <secret-storage>master_key</secret-storage>
north-glass-erp/northglass-erp/src/router/index.js
@@ -266,6 +266,11 @@
              component: () => import('../views/pp/processCard/ProductionScheduling.vue'),
            },
            {
              path: 'selectDetailProcessCard',
              name: 'selectDetailProcessCard',
              component: () => import('../views/pp/processCard/SelectDetailProcessCard.vue'),
            },
            {
              path: '',
              redirect:'/main/processCard/SelectProcessCard'
            }
north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
@@ -12,7 +12,9 @@
import BasicTable from '@/components/basic/BasicTable.vue'
import {VXETable} from "vxe-table";
import useUserInfoStore from "@/stores/userInfo";
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
let productGlassTypeStore = useProductGlassTypeStore()
let router = useRouter()
const userStore = useUserInfoStore()
@@ -30,11 +32,11 @@
    case 'delete': {
      request.post(`/processCard/deleteFlowCard/${row.orderId}/${row.processId}`).then((res) => {
        if (res.code == 200) {
          ElMessage.success("删除成功")
          ElMessage.success(t('workOrder.deleteOk'))
          location.reload();
        } else {
          ElMessage.warning(res.msg)
          router.push("/login")
         // router.push("/login")
        }
      })
      break
@@ -166,17 +168,17 @@
    showStatus: true
  },//表头参数
  columns: [
    {type: 'checkbox', fixed: "left", title: '选择'},
    {type: 'checkbox', fixed: "left", title: t('basicData.check')},
    {
      field: 'orderNumber',
      title: '订序',
      title: t('basicData.check'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'shape',
      title: '形状',
      title: t('order.shape'),
      showOverflow: "ellipsis",
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
@@ -184,7 +186,7 @@
    },
    {
      field: 'width',
      title: '宽',
      title: t('order.width'),
      sortable: true,
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
@@ -193,18 +195,18 @@
    },
    {
      field: 'height',
      title: '高',
      title: t('order.height'),
      sortable: true,
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged,
      width: '60px'
    },
    {field: 'baiscQuantity', title: '待分数量', showOverflow: "ellipsis", width: '60px'},
    {field: 'computeGrossArea', title: '待分面积', width: '60px'},
    {field: 'totalThickness', title: '总厚度', width: '80px'},
    {field: 'thickness', title: '玻璃厚度', width: '60px'},
    {field: 'weight', title: '重量'}
    {field: 'baiscQuantity', title: t('processCard.quantityToDivided'), showOverflow: "ellipsis", width: '60px'},
    {field: 'computeGrossArea', title: t('processCard.areaToDivided'), width: '60px'},
    {field: 'totalThickness', title: t('processCard.totalThickness'), width: '80px'},
    {field: 'thickness', title: t('processCard.glassThickness'), width: '60px'},
    {field: 'weight', title: t('processCard.weight')}
  ],//表头按钮
  toolbarConfig: {
@@ -224,7 +226,7 @@
    return [
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
          return t('basicData.total')
        }
        if (footList.includes(column.field)) {
          return sumNum(data, column.field)
@@ -267,10 +269,10 @@
    showStatus: true
  },//表头参数
  columns: [
    {type: 'checkbox', fixed: "left", title: '选择'},
    {type: 'checkbox', fixed: "left", title: t('basicData.check')},
    {
      field: 'processId',
      title: '流程卡号',
      title: t('processCard.processId'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      width: 130,
@@ -278,7 +280,7 @@
    },
    {
      field: 'orderNumber',
      title: '订序',
      title: t('order.OrderNum'),
      showOverflow: "ellipsis",
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'}
@@ -286,21 +288,21 @@
    },
    {
      field: 'landingSequence',
      title: '小片顺序',
      title: t('processCard.technologyNumber'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {field: 'shape', title: '形状', filters: [{data: ''}], slots: {filter: 'num1_filter'}, filterMethod: filterChanged},
    {field: 'width', title: '宽', showOverflow: "ellipsis"},
    {field: 'height', title: '高'},
    {field: 'quantity', title: '总数量'},
    {field: 'totalThickness', title: '总厚度'},
    {field: 'shape', title: t('order.shape'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, filterMethod: filterChanged},
    {field: 'width', title: t('order.width'), showOverflow: "ellipsis"},
    {field: 'height', title: t('order.height')},
    {field: 'quantity', title: t('order.quantity')},
    {field: 'totalThickness', title: t('processCard.totalThickness')},
  ],//表头按钮
  toolbarConfig: {
    buttons: [
      {code: 'saveFlowCard', name: '保存', status: 'primary', icon: 'vxe-icon-save'},
      {code: 'saveFlowCard', name: t('basicData.save'), status: 'primary', icon: 'vxe-icon-save'},
    ],
    // import: false,
    // export: true,
@@ -315,7 +317,7 @@
    return [
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
          return t('basicData.total')
        }
        if (footList.includes(column.field)) {
          return sumNum(data, column.field)
@@ -326,13 +328,15 @@
  }
})
//定义输入数量
let checkedNum = ref('')
//创建流程卡
const createProcessCard = () => {
  const $grid = xGrid.value
  const checkedList = $grid.getCheckboxRecords()
  if (checkedList.length === 0) {
    ElMessage.warning("请先选择右侧数据")
    ElMessage.warning(t('processCard.schedulingOk'))
    return
  }
  //productionId
@@ -344,23 +348,61 @@
    //index = index.toString().padStart(2, '0')
  }
  const processId = productionId + index.toString().padStart(2, '0')
  checkedList.forEach((item) => {
    item.processId = processId
    item.landingSequence = index
    item.quantity = item.baiscQuantity
  })
  checkedList.forEach((item) => {
    delete item._X_ROW_KEY
  })
  $gridLeft.insertAt(checkedList)
  $grid.remove(checkedList)
  if ($gridLeft || $grid) {
  const regex = /^(\d+|)$/;
  if (!regex.test(checkedNum.value)) {
    ElMessage.warning(t('processCard.schedulingNo'))
    return
  }
  //判断正整数
  if (/^[1-9]\d*$/.test(checkedNum.value)) {
    checkedList.forEach((item) => {
      //定义key值保持
      //判断可用数量是否大于等于输入的数量,不满足则抛出异常
      if (item.baiscQuantity * 1 < checkedNum.value * 1) throw new Error(t('processCard.schedulingQuantity'));
      item.quantity =  checkedNum.value
      item.processId = processId
      item.landingSequence = index
      item.baiscQuantity=item.baiscQuantity - checkedNum.value
    })
    //删除key
    checkedList.forEach((item) => {
      let key = item._X_ROW_KEY
      delete item._X_ROW_KEY
      if (item.baiscQuantity===0){
        $grid.remove(checkedList)
      }
      $gridLeft.insertAt(checkedList)
      item._X_ROW_KEY = key
    })
//清除两边复选框
    $gridLeft.clearCheckboxRow()
    $grid.clearCheckboxRow()
  }
  else if (checkedNum.value === '') {//判断数量输入框无输入数字
    checkedList.forEach((item) => {
      item.processId = processId
      item.landingSequence = index
      item.quantity = item.baiscQuantity
    })
    //删除key
    checkedList.forEach((item) => {
      delete item._X_ROW_KEY
    })
    $gridLeft.insertAt(checkedList)
    $grid.remove(checkedList)
    //清除两边复选框
    $gridLeft.clearCheckboxRow()
    $grid.clearCheckboxRow()
  }
}
let checkedNum = ref('')
//向右边表格添加数据
const addRight = () => {
@@ -373,12 +415,12 @@
    const checkedList = $gridLeft.getCheckboxRecords()
    //判断左边表格是否有选中的数据
    if (checkedList.length === 0) {
      ElMessage.warning("请先选择左侧数据")
      ElMessage.warning(t('processCard.schedulingArea'))
      return
    }
    const regex = /^(\d+|)$/;
    if (!regex.test(checkedNum.value)) {
      ElMessage.warning("请输入正整数")
      ElMessage.warning(t('processCard.schedulingNo'))
      return
    }
    //判断正整数
@@ -386,7 +428,7 @@
      //对选中的左边表格数据进行循环
      checkedList.forEach((item) => {
        //判断可用数量是否大于等于输入的数量,不满足则抛出异常
        if (item.quantity < checkedNum.value) throw new Error("请输入小于等于可用数量的数字");
        if (item.quantity < checkedNum.value) throw new Error(t('processCard.schedulingQuantity'));
        //左边表格可用数量减去输入的数量
        item.quantity = item.quantity - checkedNum.value
        //右边表格数据
@@ -409,7 +451,7 @@
          $grid.insert(item)
        }
      })
    } else if (checkedNum.value === '') {//判断数量输入框有无输入数字
    } else if (checkedNum.value === '') {//判断数量输入框无输入数字
      checkedList.forEach((item) => {
        let rightData = $grid.getTableData().fullData
@@ -427,6 +469,7 @@
    }
    //清除两边复选框
    $gridLeft.clearCheckboxRow()
    $grid.clearCheckboxRow()
  } catch (e) {
@@ -446,23 +489,23 @@
    const checkedListLeft = $gridLeft.getCheckboxRecords()
    //判断右边表格是否有选中的数据
    if (checkedList.length * 1 === 0) {
      ElMessage.warning("请先选择右侧数据")
      ElMessage.warning(t('processCard.schedulingOk'))
      return
    }
    if (checkedListLeft.length !== 1) {
      ElMessage.warning("请先选择左侧一条数据")
      ElMessage.warning(t('processCard.schedulingTime'))
      return
    }
    const regex = /^(\d+|)$/;
    if (!regex.test(checkedNum.value)) {
      ElMessage.warning("请输入正整数")
      ElMessage.warning(t('processCard.schedulingNo'))
      return
    }
    //判断正整数
    if (/^[1-9]\d*$/.test(checkedNum.value)) {
      checkedList.forEach((item) => {
        //判断可用数量是否大于等于输入的数量,不满足则抛出异常
        if (item.baiscQuantity * 1 < checkedNum.value * 1) throw new Error("请输入小于等于可用数量的数字");
        if (item.baiscQuantity * 1 < checkedNum.value * 1) throw new Error("请输入小于等于待分数量的数字");
        item.baiscQuantity = item.baiscQuantity - checkedNum.value
        //定义key值保持
        let key = item._X_ROW_KEY
@@ -491,9 +534,6 @@
          }
        } else {
          // if (){
          //
          // }
          //如果勾选两个值不同则插入同流程卡
          item.quantity = checkedNum.value
          item.processId = checkedListLeft[0].processId
@@ -521,18 +561,6 @@
              break
            }
          }
          // leftData.forEach((items) => {
          //   console.log(items.processId, item.processId,"——————",items.orderNumber, item.orderNumber)
          //   if (items.orderNumber === item.orderNumber && items.processId===item.processId) {
          //     console.log("测试333")
          //
          //   }
          //   else{
          //
          //   }
          //
          // })
        }
      })
@@ -546,6 +574,7 @@
      $gridLeft.insertAt(checkedList)
      $grid.remove(checkedList)
    }
    //清除两边复选框
    if ($gridLeft || $grid) {
      $gridLeft.clearCheckboxRow()
      $grid.clearCheckboxRow()
@@ -568,12 +597,14 @@
          const $tableRight = xGrid.value
          if ($table) {
            const selectRecords = $table.getCheckboxRecords()
            const selectRight = $tableRight.getCheckboxRecords()
          //  const selectRight = $tableRight.getCheckboxRecords()
            let leftData = $tableRight.getTableData().fullData
            if (selectRecords.length === 0) {
              ElMessage.warning("请先选择保存的数据")
              return
            }
            if (selectRight.length > 0) {
            if (leftData.length > 0) {
              ElMessage.warning("请先将右侧数据全部建立流程卡后保存")
              return;
            }
@@ -623,7 +654,7 @@
            style="float: left"
            type="primary"
            @click="intoCreateProduct">
          {{ flag ? '返回' : '返回' }}
          {{ flag ? t('processCard.return') : t('processCard.return') }}
        </el-button>
        <!--      <el-button  type="primary">保存分架</el-button>-->
        <!--              <el-button type="primary" :hidden="true">分架汇总</el-button>-->
@@ -676,14 +707,14 @@
        <div width="12%">
          <el-main style="">
            <span>选中数量:<el-input v-model="checkedNum" clearable type="number"></el-input></span><br>
            <span>{{$t('processCard.selectedQuantity')}}:<el-input v-model="checkedNum" clearable type="number"></el-input></span><br>
            <el-button type="primary" @click="addRight"> →</el-button>
            <br>
            <br>
            <el-button type="primary" @click="addLeft"> ←</el-button>
            <br>
            <br>
            <el-button type="primary" @click="createProcessCard">建立流程卡</el-button>
            <el-button type="primary" @click="createProcessCard">{{$t('processCard.establishProcessCards')}}</el-button>
          </el-main>
        </div>
north-glass-erp/northglass-erp/src/views/pp/processCard/ProcessCard.vue
@@ -6,7 +6,9 @@
import {ElMessage} from "element-plus";
import {useRouter,useRoute,onBeforeRouteUpdate} from "vue-router";
import  GlassType from '@/components/basic/product/GlassType.vue'
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
const route = useRoute()
const router = useRouter()
let indexFlag=$ref(1)
@@ -19,9 +21,12 @@
  <div id="main">
    <div id="div-title">
      <el-breadcrumb :separator-icon="ArrowRight">
        <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/processCard/SelectProcessCard' }">流程卡管理</el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/processCard/SelectAddProcess' }">分架</el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(3)" :class="indexFlag===3?'indexTag':''" :to="{ path: '/main/processCard/ProductionScheduling' }">排产</el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/processCard/SelectProcessCard' }">{{$t('processCard.processCardManagement')}}
        </el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/processCard/SelectAddProcess' }">{{$t('processCard.splitFrame')}}
        </el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(3)" :class="indexFlag===3?'indexTag':''" :to="{ path: '/main/processCard/ProductionScheduling' }">{{$t('processCard.scheduling')}}
        </el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(4)" :class="indexFlag===4?'indexTag':''" :to="{ path: '/main/processCard/SelectPrintFlowCard' }" style="display: none">打印</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
@@ -12,7 +12,11 @@
import BasicTable from '@/components/basic/BasicTable.vue'
import {VXETable} from "vxe-table";
import useUserInfoStore from "@/stores/userInfo";
import {changeFilterEvent,filterChanged} from "@/hook"
import {changeFilterEvent, filterChanged} from "@/hook"
import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove";
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
let router = useRouter()
const userStore = useUserInfoStore()
@@ -32,8 +36,9 @@
  }
}
//工序
const value = ref('')
const value = ref('cutting')
//排产状态
@@ -41,11 +46,11 @@
const stateOptions = [
  {
    value: '2',
    label: '已排产',
    label: t('processCard.ProductionSchedulingOk'),
  },
  {
    value: '1',
    label: '未排产',
    label: t('processCard.ProductionSchedulingNo'),
  },
]
@@ -119,21 +124,32 @@
  return [start, end]
}
onMounted(()=>{
  //启用表格拖动选中
  addListener(xGrid.value,gridOptions)
})
//第一次加载获取近七天时间和默认状态
form.date1 = getNowTime()
let startTime = form.date1[0]
let endTime = form.date1[1]
let selectProcesses = value.value
let inputVal = form.orderId
if (inputVal == '') {
  inputVal = null
}
if (selectProcesses == '') {
  selectProcesses = null
}
//第一次加载数据
request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}`, filterData.value).then((res) => {
request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}/${selectProcesses}/${inputVal}`, filterData.value).then((res) => {
  if (res.code == 200) {
    pageTotal.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    titleSelectJson.value.processType=res.data.process
    titleSelectJson.value.processType = res.data.process
    xGrid.value.reloadData(produceList)
    gridOptions.loading = false
    console.log(res.data)
    //禁用删除、保存按钮
    gridOptions.toolbarConfig.buttons[0].disabled = true
    gridOptions.toolbarConfig.buttons[1].disabled = true
@@ -157,13 +173,13 @@
  }
  if (inputVal == null && selectState == 1) {
    //根据时间查询未排产数据
    request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}`, filterData.value).then((res) => {
    request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}/${selectProcesses}/${inputVal}`, filterData.value).then((res) => {
      if (res.code == 200) {
        pageTotal.value = res.data.total
        xGrid.value.loadData(res.data.data)
        gridOptions.loading = false
        //禁用删除、保存按钮
        //禁用删除、审核按钮
        gridOptions.toolbarConfig.buttons[0].disabled = true
        gridOptions.toolbarConfig.buttons[1].disabled = true
        //启用保存
@@ -172,16 +188,14 @@
        ElMessage.warning(res.msg)
      }
    })
  } else
    if (inputVal != null && selectState == 1) {
  } else if (inputVal != null && selectState == 1) {
    //根据工序查询未排产数据
    request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
      if (res.code == 200) {
        pageTotal.value = res.data.total
        xGrid.value.loadData(res.data.data)
        gridOptions.loading = false
        //禁用删除、保存按钮
        //禁用删除、审核按钮
        gridOptions.toolbarConfig.buttons[0].disabled = true
        gridOptions.toolbarConfig.buttons[1].disabled = true
        //启用保存
@@ -192,13 +206,12 @@
    })
  } else if (inputVal == null && selectState == 2) {
    //根据时间查询已排产数据
    console.log(startTime, endTime, selectProcesses, selectState)
    request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
      if (res.code == 200) {
        pageTotal.value = res.data.total
        xGrid.value.loadData(res.data.data)
        gridOptions.loading = false
        //启用删除、保存按钮
        //启用删除、审核按钮
        gridOptions.toolbarConfig.buttons[0].disabled = false
        gridOptions.toolbarConfig.buttons[1].disabled = false
        //禁用保存
@@ -214,7 +227,7 @@
        pageTotal.value = res.data.total
        xGrid.value.loadData(res.data.data)
        gridOptions.loading = false
        //启用删除、保存按钮
        //启用删除、审核按钮
        gridOptions.toolbarConfig.buttons[0].disabled = false
        gridOptions.toolbarConfig.buttons[1].disabled = false
        //禁用保存
@@ -228,6 +241,12 @@
}
/*后端返回结果多层嵌套展示*/
const hasDecimal = (value) => {
  const regex = /\./; // 定义正则表达式,查找小数点
  return regex.test(value); // 返回true/false
}
//子组件接收参数
const xGrid = ref()
@@ -236,7 +255,7 @@
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe: true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮
  rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮
  id: 'CustomerList',
  showFooter: true,//显示脚
  printConfig: {},
@@ -249,66 +268,128 @@
    useKey: true
  },
  filterConfig: {   //筛选配置项
    // remote: true
                    // remote: true
  },
  customConfig: {
    storage: true
  },
  editConfig: {
    editConfig: {
    trigger: 'click',
    mode: 'row',
    showStatus: true
  },//表头参数
  },
  menuConfig: {
    body: {
      options: [
        [
          { 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 },
        ]
      ]
    }
  },
  //表头参数
  columns: [
    {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50},
    {type: 'checkbox', fixed: "left", title: '选择', width: 80},
    {type: 'seq', fixed: "left", title: '自序', width: 50},
    {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80},
    {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50},
    {
      field: 'scheduled_start_time',
      width: 120,
      editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}},
      title: '计划开始时间'
      title: t('processCard.scheduledStartTime')
    },
    {
      field: 'plan_end_time',
      width: 120,
      editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}},
      title: '计划结束时间'
      title: t('processCard.planEndTime')
    },
    // {field: '排产编号', title: '排产编号',  width: 120 },
    {field: 'order_id', title: '销售单号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 100,filterMethod:filterChanged},
    {field: 'customer_name', title: '客户名称', width: 110, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged},
    {field: 'project', title: '项目名称', width: 100, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged},
    {field: 'order_number', title: '序号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 70,filterMethod:filterChanged},
    {field: 'width', title: '宽', width: 60,filters: [{data: ''}],slots: {filter: 'num1_filter'},filterMethod:filterChanged},
    {field: 'height', title: '高', width: 60,filters: [{data: ''}],slots: {filter: 'num1_filter'},filterMethod:filterChanged},
    {field: 'quantity', title: '订单数量', width: 70},
    {field: 'area', title: '订单面积', width: 90},
    {
      field: 'order_id',
      title: t('order.orderId'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      width: 100,
      filterMethod: filterChanged
    },
    {
      field: 'customer_name',
      title: t('processCard.customerName'),
      width: 110,
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'project',
      title: t('order.project'),
      width: 100,
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'order_number',
      title: t('order.OrderNum'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      width: 70,
      filterMethod: filterChanged
    },
    {
      field: 'technology_number',
      title: t('processCard.technologyNumber'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      width: 70,
      filterMethod: filterChanged
    },
    {
      field: 'child_width',
      title: t('order.width'),
      width: 60,
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'child_height',
      title: t('order.height'),
      width: 60,
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {field: 'quantity', title: t('processCard.orderQuantity'), width: 70},
    {field: 'area', title: t('processCard.orderArea'), width: 90},
    {
      field: 'scheduling_quantity',
      width: 120,
      editRender: {name: 'input', attrs: {placeholder: ''}},
      title: '排产数量',
      title: t('processCard.productionSchedulingQuantity'),
      sortable: true
    },
    {field: 'pendingProductionQuantity', title: '待排产数量', width: 120},
    {field: 'pendingProductionArea', title: '待排产面积', width: 120},
    {field: 'productionScheduledQuantity', title: '已排产数量', width: 120},
    {field: 'productionScheduledArea', title: '已排产面积', width: 120},
    {field: 'review_status', title: '审核状态', width: 140},
    {field: 'reviewer', title: '审核人', width: 140},
    {field: 'product_name', title: '产品名称', width: 140},
    {field: 'shape', title: '形状', width: 80},
    {field: 'notes', title: '备注', editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120},
    {field: 'scheduling_id', title: '排产编号',width: 120},
    {field: 'pendingProductionQuantity', title: t('processCard.quantityToScheduled'), width: 120},
    {field: 'pendingProductionArea', title: t('processCard.areaToScheduled'), width: 120},
    {field: 'productionScheduledQuantity', title: t('processCard.plannedProductionQuantity'), width: 120},
    {field: 'productionScheduledArea', title: t('processCard.plannedProductionArea'), width: 120},
    {field: 'review_status', title: t('processCard.reviewedState'), width: 140},
    {field: 'reviewer', title: t('processCard.reviewed'), width: 140},
    {field: 'glass_child', title: t('order.product'), width: 140},
    {field: 'shape', title: t('order.shape'), width: 80},
    {field: 'notes', title: t('processCard.notes'), editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120},
    {field: 'scheduling_id', title: t('processCard.schedulingId'), width: 120},
  ],//表头按钮
  toolbarConfig: {
    buttons: [
      {code: 'delete', name: '删除', status: 'primary'},
      {code: 'review', name: '审核', status: 'primary'},
      {code: 'save', name: '排产', status: 'primary', icon: 'vxe-icon-save'},
      {code: 'delete', name: t('basicData.delete'), status: 'primary'},
      {code: 'review', name: t('basicData.review'), status: 'primary'},
      {code: 'save', name: t('processCard.scheduling'), status: 'primary', icon: 'vxe-icon-save'},
    ],
    import: false,
    // export: true,
@@ -335,9 +416,7 @@
})
//删除
//表格按钮
const gridEvents = {
  async toolbarButtonClick({code}) {
    const $grid = xGrid.value
@@ -372,12 +451,21 @@
              processes: selectProcesses,//工序
              userName: username//审核人
            })
            //禁用保存
            gridOptions.toolbarConfig.buttons[2].disabled = true
            //保存排产数据
            request.post("/productionScheduling/addScheduling", schedulingData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success("保存成功")
                location.reload();
                // 启用保存
                gridOptions.toolbarConfig.buttons[2].disabled = false
                router.push({
                  path: '/main/processCard/ProductionScheduling',
                  query: { random: Math.random()}
                })
              } else {
                // 启用保存
                gridOptions.toolbarConfig.buttons[2].disabled = false
                ElMessage.warning(res.msg)
              }
@@ -402,7 +490,7 @@
                scheduling: selectRecords,
              })
              request.post("/productionScheduling/deleteScheduling",schedulingData.value).then((res) => {
              request.post("/productionScheduling/deleteScheduling", schedulingData.value).then((res) => {
                if (res.code == 200) {
                  ElMessage.success("删除成功")
                  location.reload();
@@ -427,7 +515,7 @@
              scheduling: selectRecords,
              userName: username//审核人
            })
            request.post("/productionScheduling/examineScheduling",schedulingData.value).then((res) => {
            request.post("/productionScheduling/examineScheduling", schedulingData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success("审核成功")
                location.reload();
@@ -443,15 +531,63 @@
      }
    }
  },
  menuClick ({ menu, row, column }) {
    const $grid = xGrid.value
    if ($grid) {
      switch (menu.code) {
        case 'copyChecked' :{
          let result = toolbarButtonClickEvent()
          if(result){
            const dataList = xGrid.value.getTableData().visibleData
            const val = dataList[result.start][result.cell]
            dataList.forEach((item,index) =>{
              if(index>=result.start && index<=result.end){
                item[result.cell] = val
              }
            })
          }
          gridOptions.menuConfig.body.options[0][5].disabled=false
          break
        }
        case 'copyAll' :{
          let result = toolbarButtonClickEvent()
          if(result){
            const dataList = xGrid.value.getTableData().visibleData
            const val = dataList[result.start][result.cell]
            dataList.forEach((item,index) =>{
              if(index>=result.start ){
                item[result.cell] = val
              }
            })
          }
          gridOptions.menuConfig.body.options[0][5].disabled=false
          break
        }
        case 'clearChecked' :{
          let result = toolbarButtonClickEvent()
          if(result){
            const dataList = xGrid.value.getTableData().visibleData
            dataList.forEach((item,index) =>{
              if(index>=result.start && index<=result.end){
                item[result.cell] = ''
              }
            })
          }
          gridOptions.menuConfig.body.options[0][5].disabled=false
          break
        }
      }
    }
  },
}
const determineNum = () => {
  const $grid = xGrid.value
  const table = $grid.getTableData().fullData
  const selectRecords = $grid.getCheckboxRecords()
  let selectState = stateValue.value
  table.forEach((selectRecords) => {
    if (selectRecords.scheduling_quantity > selectRecords.pendingProductionQuantity) {
    if (selectRecords.scheduling_quantity > selectRecords.pendingProductionQuantity && selectState==1) {
      ElMessage.warning("排产数量不能大于待排产数量")
      //禁用保存按钮
      //gridOptions.toolbarConfig.buttons[2].disabled = true
@@ -460,8 +596,6 @@
  })
}
</script>
@@ -481,9 +615,9 @@
        />
        &nbsp;&nbsp;
        <el-input v-model="form.orderId" placeholder="销售单号" clearable style="width: 110px"></el-input>
        <el-input v-model="form.orderId" clearable :placeholder="$t('order.orderId')" style="width: 110px"></el-input>
        &nbsp;
        <el-select v-model="value" clearable placeholder="请选择工序" style="width: 120px">
        <el-select v-model="value" clearable default-value="default_city" style="width: 120px">
          <el-option
              v-for="item in titleSelectJson['processType']"
              :key="item.id"
@@ -504,7 +638,7 @@
        <el-button
            id="select"
            :icon="Search"
            type="primary" @click="getWorkOrder">查询
            type="primary" @click="getWorkOrder">{{$t('basicData.search')}}
        </el-button>
      </el-row>
@@ -512,8 +646,8 @@
    <vxe-grid
        ref="xGrid"
        class="mytable-scrollbar"
        max-height="100%"
        height="100%"
        max-height="100%"
        v-bind="gridOptions"
        v-on="gridEvents"
        @filter-change="filterChanged"
@@ -542,6 +676,11 @@
    </vxe-grid>
  </div>
  <div class="vxe-table--cell-area" ref="cellArea" >
    <span  class="vxe-table--cell-main-area"  ></span>
    <span class="vxe-table--cell-active-area"  ></span>
  </div>
</template>
<style scoped>
@@ -555,4 +694,11 @@
  height: 6%;
  text-align: center;
}
.vxe-grid {
  /* 禁用浏览器默认选中 */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
</style>
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue
@@ -6,6 +6,9 @@
import deepClone from "@/utils/deepClone";
import {ElDatePicker, ElMessage} from "element-plus";
import {Search} from "@element-plus/icons-vue";
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
let router=useRouter()
const getTableRow = (row,type) =>{
  switch (type) {
@@ -202,18 +205,18 @@
  },//表头参数
  columns:[
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    {title: '操作', width: 80, slots: { default: 'button_slot' },fixed:"left"},
    { type: 'seq',fixed:"left", title: '自序', width: 50 },
    {field: 'order.orderId',  title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' } , },
    {field: 'order.customerName', title: '客户名称',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.project', title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.batch', title: '批次',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, },
    {field: 'order.otherRemarks', title: '原片要求' ,showOverflow:"ellipsis",filters:[{ data: '' },],slots: { filter: 'num1_filter' }},
    {field: 'order.icon', title: '商标选项',filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
    {field: 'order.orderType', title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
    {field: 'order.salesman', title: '业务员',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.processingNote', title: '加工要求',showOverflow:"ellipsis"},
    {field: 'order.deliveryAddress', title: '送货地址',},
    {title: t('basicData.operate'), width: 80, slots: { default: 'button_slot' },fixed:"left"},
    { type: 'seq',fixed:"left", title: t('basicData.Number'), width: 50 },
    {field: 'order.orderId',  title: t('order.orderId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' } , },
    {field: 'order.customerName', title: t('processCard.customerName'),showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.project', title: t('order.project'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.batch', title: t('order.batch'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, },
    {field: 'order.otherRemarks', title: t('processCard.otherRemarks') ,showOverflow:"ellipsis",filters:[{ data: '' },],slots: { filter: 'num1_filter' }},
    {field: 'order.icon', title:t('order.icon'),filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
    {field: 'order.orderType', title: t('order.orderType'),filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
    {field: 'order.salesman', title: t('order.salesman'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.processingNote', title: t('order.processingNote'),showOverflow:"ellipsis"},
    {field: 'order.deliveryAddress', title: t('order.deliveryAddress'),},
  ],//表头按钮
  toolbarConfig: {
@@ -233,7 +236,7 @@
    return[
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
          return t('basicData.total')
        }
        // if (footList.includes(column.field)) {
        //   return sumNum(data, column.field)
@@ -258,8 +261,8 @@
            type="daterange"
            format="YYYY/MM/DD"
            value-format="YYYY-MM-DD"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            :start-placeholder="$t('basicData.startDate')"
            :end-placeholder="$t('basicData.endDate')"
            :default-time="defaultTime"
        />
@@ -268,7 +271,7 @@
        <el-button
            @click="getWorkOrder"
            id="select"
            type="primary" :icon="Search">查询
            type="primary" :icon="Search">{{$t('basicData.search')}}
        </el-button>
      </el-row>
@@ -296,7 +299,7 @@
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button>
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button>
      </template>
      <template #num1_filter="{ column, $panel }">
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectDetailProcessCard.vue
New file
@@ -0,0 +1,276 @@
<script setup>
import request from "@/utils/request"
import deepClone from "@/utils/deepClone"
import {ElDatePicker, ElMessage} from "element-plus"
import useProductGlassTypeStore from "@/stores/sd/product/productGlassType"
import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue"
import {Search} from "@element-plus/icons-vue"
import GlassType from "@/components/sd/product/GlassType.vue"
import {useRouter} from 'vue-router'
import Sortable from 'sortablejs'
import BasicTable from '@/components/basic/BasicTable.vue'
import {VXETable} from "vxe-table";
let productGlassTypeStore = useProductGlassTypeStore()
let router = useRouter()
let props = defineProps({
  rowIndex:{}
})
//表尾求和
const sumNum = (list, field) => {
  let count = 0
  list.forEach(item => {
    count += Number(item[field])
  })
  return count.toFixed(2)
}
//定义滚动条高度
let scrollTop = ref(null)
let scrollHeight = ref(null)
let clientHeight = ref(null)
const scrollEvnt = (row) => {
  // 内容高度
  scrollTop.value = row.$event.target.scrollTop
  scrollHeight.value = row.$event.target.scrollHeight
  clientHeight.value = row.$event.target.clientHeight
}
//筛选条件,有外键需要先定义明细里面的数据
let filterData = ref({
  order: {
    project: ''
  },
  orderDetail: {
    productId: '',
    productName: '',
    computeGrossArea: '',
    processingNote: '',
  }
})
//定义页面总页数
let pageTotal = ref('')
//定义数据返回结果
let produceList = ref([])
//定义当前页数
let pageNum=ref(1)
let pageState = null
//第一次加载
const {currentRoute} = useRouter()
const route = currentRoute.value
let processId = route.query.processId
//第一次加载数据
request.post(`/processCard/flowCardDetail/${processId}`, filterData.value).then((res) => {
  if (res.code == 200) {
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
    gridOptions.loading = false
  } else {
    ElMessage.warning(res.msg)
  }
})
//页脚翻页查询
const selectPageList = ()=>{
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  request.post(`/processCard/flowCard/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}`,filterData.value).then((res) => {
    if(res.code==200){
      produceList = deepClone(res.data.data)
      xGrid.value.reloadData(produceList)
    }else{
      ElMessage.warning(res.msg)
    }
  })
}
//页脚跳转
const handlePageChange = ({ currentPage, pageSize }) => {
  pageNum.value=currentPage
  total.pageTotal    = pageSize
  selectPageList()
}
/*使用筛选,后端获取数据*/
const changeFilterEvent = (event, option, $panel,) => {
  // 手动触发筛选
  $panel.changeOption(event, !!option.data, option)
}
function filterChanged(column) {
  gridOptions.loading = true
  //筛选条件发生变化条件发生变化
  let value = column.datas[0] != undefined ? column.datas[0] : ''
  value = value.trim()
  //判断是否存在外键
  if (column.property.indexOf('.') > -1) {
    const columnArr = column.property.split('.')
    filterData.value[columnArr[0]] = {
      [columnArr[1]]: value
    }
  } else {
    filterData.value[column.property] = value
  }
//获取选中时间
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  request.post(`/processCard/detailFlowCard/1/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => {
    if(res.code==200){
      pageTotal.value=res.data.total
      total.pageTotal=parseInt(res.data.total)
      pageNum.value=1
      produceList = deepClone(res.data.data)
      xGrid.value.loadData(produceList)
      gridOptions.loading=false
    }else{
      ElMessage.warning(res.msg)
    }
  })
}
/*后端返回结果多层嵌套展示*/
const hasDecimal = (value) => {
  const regex = /\./; // 定义正则表达式,查找小数点
  return regex.test(value); // 返回true/false
}
//子组件接收参数
const xGrid = ref()
const gridOptions = reactive({
  border:  "full",//表格加边框
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe:true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮
  id: 'CustomerList',
  showFooter: true,//显示脚
  printConfig: {},
  importConfig: {},
  exportConfig: {},
  scrollY:{ enabled: true },//开启虚拟滚动
  showOverflow:true,
  columnConfig: {
    resizable: true,
    useKey: true
  },
  filterConfig: {   //筛选配置项
    //remote: true
  },
  customConfig: {
    storage: true
  },
  editConfig: {
    trigger: 'click',
    mode: 'row',
    showStatus: true
  },//表头参数
  columns:[
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    { type: 'seq',fixed:"left", title: '自序', width: 50 },
    {field: 'order_id', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 80 },
    {field: 'process_id', width: 130, title: '流程卡号' ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order_number', title: '订单序号' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },},
    {field: 'quantity', title: '数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 180},
    {field: 'area', title: '面积' ,showOverflow:"ellipsis"},
    {field: 'product_name', title: '产品名称', },
    {field: 'founder', title: '分架员', },
    {field: 'splitFrame_time', title: '分架时间', },
  ],//表头按钮
  toolbarConfig: {
    // buttons: [{
    //
    // }],
    import: false,
    // export: true,
    // print: true,
    zoom: true,
    custom: true
  },
  data:  [
  ],//table body实际数据
  //脚部求和
  footerMethod ({ columns, data }) {//页脚函数
    return[
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
        }
        // if (props.tableProp.footList.includes(column.field)) {
        //   return sumNum(data, column.field)
        // }
        return ''
      })
    ]
  }
})
</script>
<template>
  <div class="main-div-customer">
    <vxe-grid
        max-height="100%"
        @filter-change="filterChanged"
        class="mytable-scrollbar"
        ref="xGrid"
        v-bind="gridOptions"
    >
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
      <!--      下拉显示所有信息插槽-->
      <template #content="{ row }">
        <ul class="expand-wrapper">
          <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
            <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
            <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span>
            <span v-else>{{ row[item.field] }}</span>
          </li>
        </ul>
      </template>
      <!--左边固定显示的插槽-->
      <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)"/>
          </div>
        </div>
      </template>
    </vxe-grid>
  </div>
</template>
<style scoped>
.main-div-customer{
  width: 99%;
  height: 100%;
}
#selectForm {
  width: 40%;
  text-align: center;
}
</style>
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
@@ -11,7 +11,9 @@
import Sortable from 'sortablejs'
import BasicTable from '@/components/basic/BasicTable.vue'
import {VXETable} from "vxe-table";
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
let productGlassTypeStore = useProductGlassTypeStore()
let router = useRouter()
let props = defineProps({
@@ -21,9 +23,9 @@
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  switch (type) {
    case 'edit' : {
      // console.log(row)
      // router.push({path: '/main/processCard/PrintFlowCard', query: {id: row.id}})
    case 'select' : {
      console.log(row.processId)
      router.push({path: '/main/processCard/SelectDetailProcessCard', query: { processId: row.processId }})
      break
    }
    case 'setType': {
@@ -32,7 +34,8 @@
      if (state=='可排版'){
        request.post(`/processCard/updateLayoutStatus/${row.processId}/2`).then((res) => {
          if (res.code == 200) {
            ElMessage.success("排版成功")
            ElMessage.success(t('processCard.typesettingSuccess')
            )
            router.push({path: '/main/processCard/SelectProcessCard', query: {random:Math.random()}})
          } else {
@@ -43,7 +46,7 @@
      else if(state=='不可排版'){
        request.post(`/processCard/updateLayoutStatus/${row.processId}/1`).then((res) => {
          if (res.code == 200) {
            ElMessage.success("修改成功")
            ElMessage.success(t('processCard.modifySuccessfully'))
            router.push({path: '/main/processCard/SelectProcessCard', query: {random:Math.random()}})
          } else {
@@ -57,7 +60,7 @@
    case 'delete': {
      request.post(`/processCard/deleteFlowCard/${row.orderId}/${row.processId}`).then((res) => {
        if (res.code == 200) {
          ElMessage.success("删除成功")
          ElMessage.success(t('workOrder.deleteOk'))
          router.push({path: '/main/processCard/SelectProcessCard', query: {random:Math.random()}})
        } else {
@@ -279,18 +282,18 @@
  },//表头参数
  columns:[
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    {title: '操作', width: 160, slots: { default: 'button_slot' },fixed:"left"},
    { type: 'seq',fixed:"left", title: '自序', width: 50 },
    {field: 'orderId', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 80 },
    {field: 'processId', width: 130, title: '流程卡号' ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.productId', title: '产品编号' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },},
    {field: 'orderDetail.productName', title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 180},
    {field: 'order.project', title: '项目名称' ,showOverflow:"ellipsis"},
    {field: 'quantity', title: '数量', },
    {field: 'orderDetail.computeGrossArea', title: '面积', },
    {field: 'founder', title: '分架员', },
    {field: 'orderDetail.processingNote', title: '加工要求', },
    {field: 'layoutStatus', title: '排版状态', }
    {title: t('basicData.operate'), width: 160, slots: { default: 'button_slot' },fixed:"left"},
    { type: 'seq',fixed:"left", title: t('basicData.Number'), width: 50 },
    {field: 'orderId', title: t('order.orderId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 80 },
    {field: 'processId', width: 130, title: t('processCard.processId') ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.productId', title: t('order.productId') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },},
    {field: 'orderDetail.productName', title: t('order.product'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 180},
    {field: 'order.project', title: t('order.project') ,showOverflow:"ellipsis"},
    {field: 'quantity', title: t('order.quantity'), },
    {field: 'orderDetail.computeGrossArea', title: t('order.area'), },
    {field: 'founder', title: t('processCard.founder'), },
    {field: 'orderDetail.processingNote', title: t('order.processingNote'), },
    {field: 'layoutStatus', title: t('processCard.layoutStatus'), }
  ],//表头按钮
  toolbarConfig: {
@@ -311,7 +314,7 @@
    return[
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
          return t('basicData.total')
        }
        // if (props.tableProp.footList.includes(column.field)) {
        //   return sumNum(data, column.field)
@@ -336,8 +339,8 @@
            type="daterange"
            format="YYYY/MM/DD"
            value-format="YYYY-MM-DD"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            :start-placeholder="$t('basicData.startDate')"
            :end-placeholder="$t('basicData.endDate')"
            :default-time="defaultTime"
        />
@@ -345,7 +348,8 @@
        <el-button
            @click="getWorkOrder"
            id="select"
            type="primary" :icon="Search">查询
            type="primary" :icon="Search">{{$t('basicData.search')}}
        </el-button>
      </el-row>
@@ -374,11 +378,12 @@
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }" >
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">打印</el-button>
        <el-button v-if="row.layoutStatus=='可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">排版</el-button>
        <el-button v-else-if="row.layoutStatus=='不可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">可排版</el-button>
        <el-button v-else-if="row.layoutStatus=='已排版'" disabled @click="getTableRow(row,'setType')" link type="primary" size="small">排版</el-button>
        <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button>
        <el-button @click="getTableRow(row,'select')" link type="primary" size="small">{{$t('basicData.edit')}}
        </el-button>
        <el-button v-if="row.layoutStatus=='可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composing')}}</el-button>
        <el-button v-else-if="row.layoutStatus=='不可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composingOk')}}</el-button>
        <el-button v-else-if="row.layoutStatus=='已排版'" disabled @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.typesetter')}}</el-button>
        <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.delete')}}</el-button>
      </template>
      <template #num1_filter="{ column, $panel }">
north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue
@@ -11,6 +11,9 @@
import Sortable from 'sortablejs'
import BasicTable from '@/components/basic/BasicTable.vue'
import {VXETable} from "vxe-table";
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
let router=useRouter()
const getTableRow = (row,type) =>{
  switch (type) {
@@ -163,15 +166,15 @@
  },//表头参数
  columns:[
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    {title: '操作', width: 80, slots: { default: 'button_slot' },fixed:"left"},
    { type: 'seq',fixed:"left", title: '自序', width: 50 },
    {field: 'orderId',  title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },  },
    {field: 'orderGlassDetail.productionId', title: '生产订单号', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.productId', title: '产品编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.productName', title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' },},
    {field: 'orderDetail.quantity', title: '总数量',showOverflow:"ellipsis"},
    {field: 'orderDetail.computeGrossArea', title: '总面积', },
    {field: 'orderDetail.perimeter', title: '周长',},
    {title: t('basicData.operate'), width: 80, slots: { default: 'button_slot' },fixed:"left"},
    { type: 'seq',fixed:"left", title: t('basicData.Number'), width: 50 },
    {field: 'orderId',  title: t('order.orderId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },  },
    {field: 'orderGlassDetail.productionId', title: t('workOrder.productionId'), showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.productId', title: t('order.productId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.productName', title: t('order.product'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },},
    {field: 'orderDetail.quantity', title: t('order.quantity'),showOverflow:"ellipsis"},
    {field: 'orderDetail.computeGrossArea', title: t('order.area'), },
    {field: 'orderDetail.perimeter', title: t('workOrder.perimeter'),},
  ],//表头按钮
  toolbarConfig: {
@@ -191,7 +194,7 @@
    return[
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
          return t('basicData.total')
        }
        if (footList.includes(column.field)) {
          return sumNum(data, column.field)
@@ -232,7 +235,7 @@
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button>
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button>
      </template>
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -7,6 +7,9 @@
import {indexOf} from "xe-utils";
import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove";
import userInfo from "@/stores/userInfo"
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
let brokenVisible = ref(false)
const xGrid = ref()
const brokenGrid =ref()
@@ -15,6 +18,7 @@
const user=userInfo()
//定义表头数据
const titleUploadData = ref({
  reportingWorkId: null,
  //流程卡号
  processId: 'NG24030804A02/1',
  //销售单号
@@ -76,22 +80,32 @@
})
let inputDisabled = ref(false)
onMounted(() =>{
  if(route.query.processId !== undefined && route.query.processId!=='' && route.query.processId!=null ){
    titleUploadData.value.processId = route.query.processId
  }
   //route.query.reportingWorkId = 'BG2403150004'
  //判断是否传入报工编号
  if(route.query.reportingWorkId!== undefined && route.query.reportingWorkId!=='' && route.query.reportingWorkId!=null){
  if(route.query.reportingWorkId !== '' && route.query.reportingWorkId!=null){
    request.post(`reportingWork/selectUpdateReportingWork/${route.query.reportingWorkId}`).then(res=>{
      if(res.code === '200'){
        titleUploadData.value = res.data.reportingWork
        console.log(res.data)
        titleSelectJson.value = res.data.basic
        xGrid.value.reloadData(res.data.reportingWorkDetails)
        let button =  {
          code: 'update',
          name: '修改',
          status: 'primary',
        }
        gridOptions.toolbarConfig.buttons.push(button)
      }
      inputDisabled.value = true
    })
  }
})
const data = [{id:1,num:2},{id:1,num:3},{id:2,num:2},{id:1,num:2}];
//表尾求和
@@ -153,14 +167,14 @@
    //  {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    {
      field: 'order_number',
      title: '序号',
      title: t('order.OrderNum'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'glass_child',
      title: '单片名称',
      title: t('reportingWorks.glassChild'),
      showOverflow: "ellipsis",
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
@@ -168,21 +182,21 @@
    },
    {
      field: 'technology_number',
      title: '标记',
      title: t('processCard.technologyNumber'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'glass_address',
      title: '片标记',
      title: t('reportingWorks.glassAddress'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'quantity_card',
      title: '流程卡数量',
      title: t('reportingWorks.numberProcessCards'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      showOverflow: "ellipsis",
@@ -190,29 +204,29 @@
    },
    {
      field: 'child_width',
      title: '宽',
      title: t('order.width'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'child_height',
      title: '高',
      title: t('order.height'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'shape',
      title: '形状',
      title: t('order.shape'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      showOverflow: "ellipsis",
      filterMethod: filterChanged
    },
    {field: 'quantity', title: '可报数量',},
    {field: 'quantity', title: t('reportingWorks.reportableQuantityOk'),},
    {
      field: 'completedQuantity', title: '完工数量',width: 120,
      field: 'completedQuantity', title: t('reportingWorks.completedQuantity'),width: 120,
      editRender: {
        name: 'input',
        attrs: {placeholder: ''}
@@ -220,10 +234,10 @@
    },
    {
      field: 'breakageQuantity',  title: '次破数量',
      field: 'breakageQuantity',  title: t('reportingWorks.quantityBroken'),
    },
    {field: 'completed', width: 90, title: '已完工',},
    {field: 'onceBroken', width: 90, title: '已次破',},
    {field: 'completed', width: 90, title:t('reportingWorks.completed'),},
    {field: 'onceBroken', width: 90, title: t('reportingWorks.onceBroken'),},
  ],
//表单验证
@@ -239,6 +253,9 @@
          }else if((row.completedQuantity*1+brokenNum*1)>row.quantity*1){
            return new Error((`${row.completedQuantity}+${brokenNum}>${row.quantity}`))
          }
          if(titleUploadData.value.reportingWorkId!=null  && row.completedQuantity<row.minQuantity){
            return new Error(`请输入大于等于${row.minQuantity}的数字`)
          }
        }
      }
@@ -251,8 +268,8 @@
      // {code: 'sameDamage', name: '次破相同'},
      // {code: 'sameOneCompletion', name: '完工一列相同'},
      // {code: 'sameOneDamage', name: '次破一列相同'},
      {code: 'saveReportingWork', name: '保存', status: 'primary', icon: 'vxe-icon-save',disabled:true},
      {code: 'saveReportingWorkReview', name: '保存并审核', status: 'primary', icon: 'vxe-icon-save',disabled:true},
      {code: 'saveReportingWork', name: t('basicData.save'), status: 'primary', icon: 'vxe-icon-save',disabled:true},
      {code: 'saveReportingWorkReview', name: t('reportingWorks.saveAndReview'), status: 'primary', icon: 'vxe-icon-save',disabled:true},
    ],
    // import: false,
    // export: true,
@@ -266,7 +283,7 @@
    return [
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
          return t('basicData.total')
        }
        return ''
      })
@@ -275,7 +292,12 @@
})
let brokenRow = ref()
let brokenRow = ref({
  glass_child:'',
  order_number:'',
  technology_number:''
})
const gridEvents = {
  async toolbarButtonClick({code}) {
    const $grid = xGrid.value
@@ -287,7 +309,7 @@
            ElMessage.error(`校验不通过!`)
            return
          }
          saveReportingWork(0)
          saveReportingWork(0,'save')
          break
        }
        case 'saveReportingWorkReview':  {
@@ -296,7 +318,16 @@
            ElMessage.error(`校验不通过!`)
            return
          }
          saveReportingWork(1)
          saveReportingWork(1,'save')
          break
        }
        case 'update':  {
          const errMap = await $grid.validate(true)
          if (errMap) {
            ElMessage.error(`校验不通过!`)
            return
          }
          saveReportingWork(0,'update')
          break
        }
      }
@@ -311,7 +342,6 @@
    //brokenGrid.value.reloadData(brokenRow.damageDetail)
    //改变brokenVisible的值触发openedBrokenTable()方法
    brokenVisible.value = true
    //console.log(brokenGrid.value)
  }
}
@@ -347,7 +377,7 @@
    showStatus: true
  },//表头参数
  columns: [
    {type: 'seq',fixed:"left", title: '自序', width: 80 },
    {type: 'seq',fixed:"left", title: t('basicData.Number'), width: 80 },
    // {
    //   field: 'order_number',
    //   title: '序号'
@@ -355,48 +385,48 @@
    {
      field: 'breakageQuantity',
      title: '次破数量',
      title: t('reportingWorks.quantityBroken'),
      editRender: {name: 'input', attrs: {placeholder: ''}}
    },
    {field: 'available',
      title: '可利用',
      title: t('reportingWorks.available'),
      slots: {default: 'available'}
    },
    {field: 'returnProcess', title: '退回工序',
    {field: 'returnProcess', title: t('reportingWorks.returnProcess'),
      editRender: {},
      slots: {default: 'returnProcess_default', edit: 'returnProcess'}
    },
    {
      field: 'breakageType', title: '次破类型',
      field: 'breakageType', title: t('reportingWorks.breakageType'),
      editRender: {},
      slots: {default: 'breakageType_default', edit: 'breakageType'}
    },
    {
      field: 'breakageReason', title: '次破原因',
      field: 'breakageReason', title: t('reportingWorks.breakageReason'),
      editRender: {},
      slots: {default: 'breakageReason_default', edit: 'breakageReason'}
    },
    {
      field: 'responsibleProcess', title: '责任工序',
      field: 'responsibleProcess', title: t('reportingWorks.responsibleProcess'),
      editRender: {},
      slots: {default: 'responsibleProcess_default', edit: 'responsibleProcess'}
    },
    {
      field: 'responsibleEquipment',
      title: '责任设备',
      title: t('reportingWorks.responsibleEquipment'),
      editRender: {},
      slots: {default: 'reportingDeviceSort_default', edit: 'reportingDeviceSort'}
      // editRender: {name: 'input', attrs: {placeholder: ''}}
    },
    {
      field: 'responsibleTeam',  title: '责任班组',
      field: 'responsibleTeam',  title: t('reportingWorks.responsibleTeam'),
      editRender: {},
      slots: {default: 'responsibleTeam_default', edit: 'responsibleTeam'}
    },
    {
      field: 'responsiblePersonnel',
      title: '责任人员',
      title: t('reportingWorks.responsiblePersonnel'),
      editRender: {name: 'input', attrs: {placeholder: ''}}
    },
@@ -442,8 +472,8 @@
  },
  toolbarConfig: {//表头按钮
    buttons: [
      {code: 'addRow', name: '添加', status: 'primary', icon: 'vxe-icon-square-plus'},
      {code: 'removeRow', name: '删除', status: 'primary', icon: 'vxe-icon-delete'},
      {code: 'addRow', name: t('reportingWorks.increase'), status: 'primary', icon: 'vxe-icon-square-plus'},
      {code: 'removeRow', name: t('basicData.delete'), status: 'primary', icon: 'vxe-icon-delete'},
    ],
    // import: false,
    // export: true,
@@ -476,7 +506,6 @@
  addListener(brokenGrid.value,brokenGridOptions)
  let damage =ref(brokenRow.value.damageDetails)
  brokenGrid.value.reloadData(damage.value)
  //console.log(brokenRow.value)
}
@@ -497,16 +526,29 @@
  })
  let reportingWorkNum = isNaN(brokenRow.value.completedQuantity*1)?0:brokenRow.value.completedQuantity*1
  if((breakageQuantityCount+reportingWorkNum>brokenRow.value.quantity*1) ){
  if((breakageQuantityCount>brokenRow.value.quantity*1) ){
    ElMessage.warning(`损耗数:'${breakageQuantityCount}'
                               完工数:'${reportingWorkNum}'之和${breakageQuantityCount+reportingWorkNum}
                               不能大于${brokenRow.value.quantity*1}`)
    return false
  }
  brokenRow.value.completedQuantity = brokenRow.value.quantity-breakageQuantityCount
  breakageQuantityCount = breakageQuantityCount === 0 ? null : breakageQuantityCount
  brokenRow.value.breakageQuantity = breakageQuantityCount
  brokenRow.value.damageDetails=brokenGrid.value.getTableData().fullData
  // xGrid.value.getTableData().fullData.forEach(
  //
  // )
  const equalByOrderNum = xGrid.value.getTableData().fullData.filter((row) =>{
    return row.order_number === brokenRow.value.order_number
  })
  const maxQuantity =  Math.max(...equalByOrderNum.map(item =>item.breakageQuantity || 0))
  equalByOrderNum.forEach((row) =>{
    row.completedQuantity= brokenRow.value.quantity*1-maxQuantity
  })
  getQuantity()
  done()
}
@@ -521,11 +563,38 @@
  }
})
const saveReportingWork = (type) => {
function checkSameNumForId(data, targetId) {
  // 初始化一个对象来存储遇到的id及其对应的num值
  const idNums = {};
  let firstNum = null;
  for (const item of data) {
    if (item.order_number === targetId) {
      // 如果找到了目标id,检查num是否与第一个遇到的num相同
      if (firstNum === null) {
        // 如果是第一个遇到的,记录num值
        firstNum = item.completedQuantity;
      } else if (item.completedQuantity !== firstNum) {
        // 如果num值与第一个遇到的num不同,返回false
        return false;
      }
    }
  }
  // 如果遍历完数组后没有返回false,那么所有具有目标id的对象都具有相同的num值
  return true;
}
const saveReportingWork = (state,saveType) => {
  if(xGrid.value.getTableData().fullData.length===0){
    ElMessage.warning(`请选择流程卡数据`)
    return false
    return
  }
  const device = titleUploadData.value.deviceName
  if(device === null || device === undefined || device === ''){
@@ -537,6 +606,28 @@
    ElMessage.error('请选择报工设备!')
    return
  }
  const seenIds = {}
  const uniqueByOrderNum = xGrid.value.getTableData().fullData.filter(item => {
    // 检查item的id是否已经在seenIds中
    if (!seenIds[item.order_number]) {
      // 如果不在,添加它并返回true以保留这个对象
      seenIds[item.order_number] = true;
      return true;
    }
    // 如果已经在seenIds中,返回false以过滤掉这个对象
    return false;
  });
  const notFinishList = xGrid.value.getTableData().fullData.filter(item =>{
    return item.saveFlag === false
  })
  for(let item of uniqueByOrderNum){
    if(!checkSameNumForId(notFinishList,item.order_number)){
      ElMessage.error(`请检查订单序号: ${item.order_number} 报工数量是否相同!`)
      return false
    }
  }
  titleUploadData.value.creator = user.user.userName
  titleUploadData.value.creatorId = user.user.userId
@@ -553,10 +644,19 @@
  const requestData = {
    title:titleUploadData.value,
    detail:xGrid.value.getTableData().fullData,
    type:type//审核状态
    type:state//审核状态
  }
  gridOptions.toolbarConfig.buttons[0].disabled=true
  gridOptions.toolbarConfig.buttons[1].disabled=true
  if(saveType==='save'){
    saveReportingWorkRequest(requestData)
  }else{
    updateReportingWorkRequest(requestData)
  }
}
const saveReportingWorkRequest = (requestData) =>{
  request.post(`/reportingWork/saveReportingWork`,requestData).then(res =>{
    if (res.code == 200){
      ElMessage.success("报工成功")
@@ -564,18 +664,33 @@
    }else{
      const errorObj = JSON.parse(res.msg)
      const msg = "序号:"+errorObj.orderNumber+'\n'
                +'小片顺序:'+errorObj.technologyNumber+'\n'
                +"实际可报工数量:"+errorObj.processNum+'<'+
                "报工数量:"+errorObj.sumNum+'\n'
                +"请刷新界面重新报工"
          +'小片顺序:'+errorObj.technologyNumber+'\n'
          +"实际可报工数量:"+errorObj.processNum+'<'+
          "报工数量:"+errorObj.sumNum+'\n'
          +"请刷新界面重新报工"
      ElMessage.error(msg)
    }
  }).catch(err =>{
    ElMessage.error(err.message)
  }).finally(()=>{
    gridOptions.toolbarConfig.buttons[0].disabled=false
    gridOptions.toolbarConfig.buttons[1].disabled=false
  })
}
//更新报工数据
const updateReportingWorkRequest = (requestData) =>{
  request.post(`/reportingWork/updateReportingWork`,requestData).then(res =>{
    if (res.code == 200){
      ElMessage.success("报工修改成功")
      router.push({path:'/main/reportingWorks/AddReportingWork',
        query:{
          processId:titleUploadData.value.processId,
          random:Math.random()}
      })
    }
  })
}
@@ -656,17 +771,17 @@
const getWork = () => {
  let processId = titleUploadData.value.processId
  if (processId.indexOf("/") < 0) {
    ElMessage.warning("请输入正确格式流程卡")
    return
  }
  let indexOfChar = processId.indexOf("/")
  let leftString = processId.slice(0, indexOfChar)
  if (leftString.length != 13) {
    ElMessage.warning("请输入正确位数的流程卡")
    return
  }
  // if (processId.indexOf("/") < 0) {
  //
  //   ElMessage.warning("请输入正确格式流程卡")
  //   return
  // }
  // let indexOfChar = processId.indexOf("/")
  // let leftString = processId.slice(0, indexOfChar)
  // if (leftString.length != 13) {
  //   ElMessage.warning("请输入正确位数的流程卡")
  //   return
  // }
//工序
  let process = titleUploadData.value.thisProcess
  if (process == "" || process == null) {
@@ -719,7 +834,7 @@
      }
      //判断早晚班
      titleUploadData.value.classes='早班'
      titleUploadData.value.classes=t('reportingWorks.early')
      titleUploadData.value.reportingWorkTime = formatCurrentTime()
      //绑定下方表格
      detail.value = res.data.Detail
@@ -781,7 +896,26 @@
        item.completedQuantity=row.completedQuantity
      }
    })
    getQuantity()
  }
}
const  getQuantity = () => {
  const arr = xGrid.value.getTableData().fullData
  const returnArr =  arr.filter((obj, index, self) =>
      self.findIndex((t) => t.order_number === obj.order_number) === index
  )
  let sumBreak = 0
  let sumQuantity = 0
  returnArr.forEach((item)=>{
    sumQuantity+=Number(item.completedQuantity*1)
  })
  arr.forEach((item)=>{
    sumBreak+=Number(item.breakageQuantity) || 0
  })
  titleUploadData.value.thisCompletedQuantity = sumQuantity
  titleUploadData.value.thisWornQuantity = sumBreak
}
</script>
@@ -789,9 +923,10 @@
<template>
  <div style="height: 100%;width: 100%">
    <div id="head" style="height: 5%;width: 100%;margin-bottom: 5px">
      <el-input v-model="titleUploadData.processId" placeholder="流程卡号" style="width: 200px" @keyup.enter.native="getWork"/>
      <el-input :disabled="inputDisabled" v-if="titleUploadData.reportingWorkId" v-model="titleUploadData.reportingWorkId" placeholder="报工编号" style="width: 200px" />
      <el-input :disabled="inputDisabled" v-model="titleUploadData.processId" placeholder="流程卡号" style="width: 200px" @keyup.enter.native="getWork"/>
      &nbsp;
      <el-select v-model="titleUploadData.thisProcess" clearable placeholder="请选择工序" style="width: 120px"
      <el-select :disabled="inputDisabled" v-model="titleUploadData.thisProcess" clearable placeholder="请选择工序" style="width: 120px"
                 @change="getWork">
        <el-option
            v-for="item in titleSelectJson['processType']"
@@ -801,39 +936,40 @@
        />
      </el-select>
      &nbsp;
      <el-button :disabled="disabledFlag" :loading="loadingFlag" @click="reviewReportingWork" type="primary">审核通过</el-button>
      <el-button :disabled="disabledFlag" :loading="loadingFlag" @click="reviewReportingWork" type="primary">{{$t('reportingWorks.passAudit')}}
      </el-button>
<!--      <el-button type="primary">审核不通过</el-button>-->
      &nbsp;
      <label>流程卡面积:xxx平方米</label>
      <label>{{$t('reportingWorks.processCardArea')}}:</label>
    </div>
    <div style="background-color: white;margin-bottom: 5px;height: 17%;width: 100%">
      <el-row>
        <el-col :span="2">
          <el-text>销售单号:</el-text>
          <el-text>{{$t('order.orderId')}}:</el-text>
        </el-col>
        <el-col :span="3">
          <el-text>{{ titleUploadData.orderId }}</el-text>
        </el-col>
        <el-col :span="2">
          <el-text>生产订单号:</el-text>
          <el-text>{{$t('workOrder.productionId')}}:</el-text>
        </el-col>
        <el-col :span="3">
          <el-text>{{ titleUploadData.productionId }}</el-text>
        </el-col>
        <el-col :span="2">
          <el-text>客户编码:</el-text>
          <el-text>{{$t('processCard.customerId')}}:</el-text>
        </el-col>
        <el-col :span="2">
          <el-text>{{ titleUploadData.order.customerId }}</el-text>
        </el-col>
        <el-col :span="2">
          <el-text>客户名称:</el-text>
          <el-text>{{$t('processCard.customerName')}}:</el-text>
        </el-col>
        <el-col :span="3">
          <el-text class="customClass"></el-text>
        </el-col>
        <el-col :span="2">
          <el-text>项目名称:</el-text>
          <el-text>{{$t('order.project')}}:</el-text>
        </el-col>
        <el-col :span="3">
          <el-text wrap-text="false">{{ titleUploadData.order.project }}</el-text>
@@ -842,10 +978,10 @@
      </el-row>
      <el-row>
        <el-col :span="2">
          <el-text>报工设备:</el-text>
          <el-text>{{$t('reportingWorks.deviceType')}}:</el-text>
        </el-col>
        <el-col :span="3">
          <el-select v-model="titleUploadData.deviceName" clearable placeholder="请选择设备">
          <el-select v-model="titleUploadData.deviceName" clearable :placeholder="$t('reportingWorks.pleaseDevice')">
            <el-option
                v-for="item in titleSelectJson['deviceType']"
                :key="item.id"
@@ -855,27 +991,27 @@
          </el-select>
        </el-col>
        <el-col :span="2">
          <el-text>上工序:</el-text>
          <el-text>{{$t('reportingWorks.previousProcess')}}:</el-text>
        </el-col>
        <el-col :span="3">
          <el-text>{{ titleUploadData.previousProcess }}</el-text>
        </el-col>
        <el-col :span="2">
          <el-text>可报工数量:</el-text>
          <el-text>{{$t('reportingWorks.numberReported')}}:</el-text>
        </el-col>
        <el-col :span="2">
          <el-text>{{ titleUploadData.previousProcessQuantity }}</el-text>
        </el-col>
        <el-col :span="2">
          <el-text>本工序完工:</el-text>
          <el-text>{{$t('reportingWorks.thisCompletedQuantity')}}:</el-text>
        </el-col>
        <el-col :span="3">
          <el-text>{{ titleUploadData.thisCompletedQuantity }}</el-text>
        </el-col>
        <el-col :span="2">
          <el-text>本工序次破:</el-text>
          <el-text>{{$t('reportingWorks.thisWornQuantity')}}:</el-text>
        </el-col>
        <el-col :span="3">
          <el-text>{{ titleUploadData.thisWornQuantity }}</el-text>
@@ -884,10 +1020,10 @@
      </el-row>
      <el-row>
        <el-col :span="2">
          <el-text>报工班组:</el-text>
          <el-text>{{$t('reportingWorks.teamsType')}}:</el-text>
        </el-col>
        <el-col :span="3">
          <el-select v-model="titleUploadData.teamsGroupsName" clearable placeholder="请选择班组">
          <el-select v-model="titleUploadData.teamsGroupsName" clearable :placeholder="$t('reportingWorks.selectTeam')">
            <el-option
                v-for="item in titleSelectJson['teamsType']"
                :key="item.id"
@@ -897,10 +1033,10 @@
          </el-select>
        </el-col>
        <el-col :span="2">
          <el-text>班次:</el-text>
          <el-text>{{$t('reportingWorks.classes')}}:</el-text>
        </el-col>
        <el-col :span="3">
          <el-select v-model="titleUploadData.classes" class="processesSt" placeholder="">
          <el-select v-model="titleUploadData.classes" class="processesSt" :placeholder="$t('reportingWorks.selectClasses')">
            <el-option
                v-for="item in classesOption"
                :key="item.value"
@@ -910,14 +1046,14 @@
          </el-select>
        </el-col>
        <el-col :span="2">
          <el-text>下工序:</el-text>
          <el-text>{{$t('reportingWorks.nextProcess')}}:</el-text>
        </el-col>
        <el-col :span="2">
          <el-text>{{ titleUploadData.nextProcess }}</el-text>
        </el-col>
        <el-col :span="2">
          <el-text>报工日期:</el-text>
          <el-text>{{$t('reportingWorks.reportingWorkTime')}}:</el-text>
        </el-col>
        <el-col :span="3">
          <el-date-picker
@@ -930,7 +1066,7 @@
          />
        </el-col>
        <el-col :span="2">
          <el-text>备注:</el-text>
          <el-text>{{$t('basicData.remarks')}}:</el-text>
        </el-col>
        <el-col :span="3">
          <el-input v-model="titleUploadData.notes" placeholder="" />
@@ -968,7 +1104,8 @@
          v-model="brokenVisible"
          :close-on-click-modal="false"
          :close-on-press-escape="false"
          title="破损列表"
          :title="$t('reportingWorks.damageList')+':'
          +brokenRow.glass_child+'.'+brokenRow.order_number+'.'+brokenRow.technology_number"
          style="width: 80%;height:75% ">
        <vxe-grid
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/ReportingWorks.vue
@@ -6,7 +6,9 @@
import {ElMessage} from "element-plus";
import {useRouter,useRoute} from "vue-router";
import  GlassType from '@/components/basic/product/GlassType.vue'
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
const router = useRouter()
const route = useRoute()
@@ -20,9 +22,9 @@
  <div id="main">
    <div id="div-title">
      <el-breadcrumb :separator-icon="ArrowRight">
        <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/reportingWorks/SelectReportingWorks' }">报工管理</el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/reportingWorks/AddReportingWork' }">报工新增</el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(3)" :class="indexFlag===3?'indexTag':''" :to="{ path: '/main/reportingWorks/QualityInspectionReview' }">质检审核</el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/reportingWorks/SelectReportingWorks' }">{{$t('reportingWorks.WorkReportingManagement')}}</el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/reportingWorks/AddReportingWork' }">{{$t('reportingWorks.addReportingWorks')}}</el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(3)" :class="indexFlag===3?'indexTag':''" :to="{ path: '/main/reportingWorks/QualityInspectionReview' }">{{$t('reportingWorks.qualityInspectionReview')}}</el-breadcrumb-item>
        <el-breadcrumb-item :to="{ path: '/main/processCard/SelectPrintFlowCard' }" style="display: none">打印</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/SelectReportingWorks.vue
@@ -1,17 +1,34 @@
<script setup>
import {reactive} from "vue";
import {reactive, ref} from "vue";
import {useRouter} from  'vue-router'
import request from "@/utils/request";
import deepClone from "@/utils/deepClone";
import {ElDatePicker, ElMessage} from "element-plus";
import {Search} from "@element-plus/icons-vue";
import { useI18n } from 'vue-i18n'
import SelectProduct from "@/views/sd/product/SelectProduct.vue";
//语言获取
const { t } = useI18n()
let router=useRouter()
const getTableRow = (row,type) =>{
  switch (type) {
    case 'edit' :{
      //alert('我接收到子组件传送的编辑信息')
      router.push({path: '/main/reportingWorks/AddReportingWork', query: { id: row.id }})
     // router.push({path: '/main/reportingWorks/AddReportingWork', query: { id: row.id }})
      break
    }
    case 'delete':{
      alert('我接收到子组件传送的删除信息')
      request.post(`/reportingWork/deleteWork/${row.reportingWorkId}/${row.processId}/${row.thisProcess}`).then((res) => {
        if (res.code == 200) {
          ElMessage.success(t('workOrder.deleteOk'))
          router.push({path: '/main/reportingWorks/SelectReportingWorks', query: {random:Math.random()}})
        } else {
          ElMessage.warning(res.msg)
        }
      })
      break
    }
    case  'setType':{
@@ -20,6 +37,17 @@
    }
  }
}
function padLeftZero(str) {
  return ('00' + str).substr(str.length)
}
//提交的表单
const form = reactive({
  date1: '',
  orderId: ''
})
//表尾求和
const sumNum = (list, field) => {
@@ -30,14 +58,181 @@
  return count.toFixed(2)
}
//子组件接收参数
//定义滚动条高度
let scrollTop = ref(null)
let scrollHeight = ref(null)
let clientHeight = ref(null)
const scrollEvnt = (row) => {
  // 内容高度
  scrollTop.value = row.$event.target.scrollTop
  scrollHeight.value = row.$event.target.scrollHeight
  clientHeight.value = row.$event.target.clientHeight
}
//筛选条件,有外键需要先定义明细里面的数据
let filterData = ref({
  order: {
    project: '',
    batch:''
  },
  orderGlassDetail: {
    completedArea:'',
    wornArea:''
  }
})
//定义页面总页数
let pageTotal = ref('')
//定义数据返回结果
let produceList = ref([])
//定义当前页数
let pageNum=ref(1)
let pageState = null
//获取七天前到当前时间
function getNowTime() {
  const start = new Date(new Date().getTime()- 3600 * 1000 * 24 * 7)
      .toISOString()
      .replace('T', ' ')
      .slice(0,10) //默认开始时间7天前
  const end = new Date(new Date().getTime()+3600 * 1000 * 24)
      .toISOString()
      .replace('T', ' ')
      .slice(0,10)//默认结束时间当前时间
  return [start, end]
}
//第一次加载获取近七天时间和默认状态
form.date1=getNowTime()
let startTime = form.date1[0]
let endTime = form.date1[1]
let inputVal = form.orderId
if (inputVal == '') {
  inputVal = null
}
let total = reactive({
  pageTotal : 0,
  dataTotal : 0,
  pageSize : 100
})
//第一次加载数据
request.post(`/reportingWork/selectReportingWork/1/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => {
  if (res.code == 200) {
    console.log(res.data.data);
    total.dataTotal = res.data.total.total*1
    total.pageTotal= res.data.total.pageTotal
    pageTotal.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
    gridOptions.loading = false
  } else {
    ElMessage.warning(res.msg)
  }
})
//页脚翻页查询
const selectPageList = ()=>{
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  let inputVal = form.orderId
  if (inputVal == '') {
    inputVal = null
  }
  request.post(`/reportingWork/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`,filterData.value).then((res) => {
    if(res.code==200){
      produceList = deepClone(res.data.data)
      xGrid.value.reloadData(produceList)
    }else{
      ElMessage.warning(res.msg)
    }
  })
}
//点击查询
const getWorkOrder = () => {
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  let inputVal = form.orderId
  if (inputVal == '') {
    inputVal = null
  }
  request.post(`/reportingWork/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => {
    if (res.code == 200) {
      total.dataTotal = res.data.total.total*1
      total.pageTotal= res.data.total.pageTotal
      pageTotal.value = res.data.total
      xGrid.value.loadData(res.data.data)
      gridOptions.loading = false
    } else {
      ElMessage.warning(res.msg)
    }
  })
}
//页脚跳转
const handlePageChange = ({ currentPage, pageSize }) => {
  pageNum.value=currentPage
  total.pageTotal    = pageSize
  selectPageList()
}
/*使用筛选,后端获取数据*/
const changeFilterEvent = (event, option, $panel,) => {
  // 手动触发筛选
  $panel.changeOption(event, !!option.data, option)
}
function filterChanged(column) {
  gridOptions.loading = true
  //筛选条件发生变化条件发生变化
  let value = column.datas[0] != undefined ? column.datas[0] : ''
  value = value.trim()
  //判断是否存在外键
  if (column.property.indexOf('.') > -1) {
    const columnArr = column.property.split('.')
    filterData.value[columnArr[0]] = {
      [columnArr[1]]: value
    }
  } else {
    filterData.value[column.property] = value
  }
//获取选中时间
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  request.post(`/reportingWork/selectReportingWork/1/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => {
    if(res.code==200){
      pageTotal.value=res.data.total
      total.pageTotal=parseInt(res.data.total)
      pageNum.value=1
      produceList = deepClone(res.data.data)
      xGrid.value.loadData(produceList)
      gridOptions.loading=false
    }else{
      ElMessage.warning(res.msg)
    }
  })
}
/*后端返回结果多层嵌套展示*/
const hasDecimal = (value) => {
  const regex = /\./; // 定义正则表达式,查找小数点
  return regex.test(value); // 返回true/false
}
//子组件接收参数
const xGrid = ref()
const gridOptions = reactive({
  border:  "full",//表格加边框
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe:true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮
  rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮
  id: 'CustomerList',
  showFooter: true,//显示脚
  printConfig: {},
@@ -64,18 +259,22 @@
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    {title: '操作', width: 140, slots: { default: 'button_slot' },fixed:"left"},
    { type: 'seq',fixed:"left", title: '自序', width: 50 },
    {field: 'reportingWorkNo', width: 120, title: '报工编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
    {field: 'reportingWorkTime',width: 120, title: '报工时间', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'processCard', width: 130,title: '流程卡号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'entryName',width: 120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'batch', width: 100,title: '批次', sortable: true,showOverflow:"ellipsis"},
    {field: 'device', width: 100,title: '设备', sortable: true},
    {field: 'thisProcess',width: 100, title: '本工序', sortable: true},
    {field: 'finishedNumber',width: 120, title: '本工序完工', sortable: true,showOverflow:"ellipsis"},
    {field: 'finishedArea', width: 120,title: '完工面积', sortable: true},
    {field: 'wornNumber',width: 120, title: '本工序次破', sortable: true},
    {field: 'wornArea',width: 120, title: '次破面积', sortable: true},
    {field: 'teamName',width: 120, title: '班组名称', sortable: true}
    {field: 'reportingWorkId', width: 120, title: '报工编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, },
    {field: 'reportingWorkTime',width: 120, title: '报工时间' ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderId', width: 130,title: '销售单号' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'processId', width: 130,title: '流程卡号' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.project',width: 120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, },
    {field: 'order.batch', width: 100,title: '批次' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'thisProcess',width: 100, title: '本工序',filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
    {field: 'thisCompletedQuantity',width: 120, title: '本工序完工' },
    {field: 'completedArea', width: 120,title: '完工面积', },
    {field: 'thisWornQuantity',width: 120, title: '本工序次破', },
    {field: 'wornArea',width: 120, title: '次破面积', },
    {field: 'deviceName', width: 100,title: '报工设备', },
    {field: 'teamsGroupsName',width: 120, title: '报工班组', },
    {field: 'reviewedState',width: 120, title: '审核状态', },
  ],//表头按钮
  toolbarConfig: {
@@ -88,95 +287,10 @@
    zoom: true,
    custom: true
  },
  data:  [
    {
      reportingWorkNo: 'BG2312080011',
      reportingWorkTime: '2023-12-08 09:05:58',
      processCard: 'NG23120801A01',
      entryName: '信合春天里',
      batch: '四批二',
      device:'大海利宁',
      thisProcess: '切割',
      finishedNumber: '13',
      finishedArea: '44.22',
      wornNumber: '',
      wornArea: '',
      teamName:'切割一班'
    },
    {
      reportingWorkNo: 'BG2312080013',
      reportingWorkTime: '2023-12-08 09:05:58',
      processCard: 'NG23120801A01',
      entryName: '信合春天里',
      batch: '一批二',
      device:'大海利宁',
      thisProcess: '切割',
      finishedNumber: '13',
      finishedArea: '44.22',
      wornNumber: '',
      wornArea: '',
      teamName:'切割一班'
    },
    {
      reportingWorkNo: 'BG2311080025',
      reportingWorkTime: '2023-12-08 09:05:58',
      processCard: 'NG23120801A01',
      entryName: '信合春天里',
      batch: '一批二',
      device:'大海利宁',
      thisProcess: '切割',
      finishedNumber: '13',
      finishedArea: '44.22',
      wornNumber: '',
      wornArea: '',
      teamName:'切割一班'
    },
    {
      reportingWorkNo: 'BG2303080025',
      reportingWorkTime: '2023-12-08 09:05:58',
      processCard: 'NG23120801A01',
      entryName: '信合春天里',
      batch: '一批二',
      device:'大海利宁',
      thisProcess: '切割',
      finishedNumber: '13',
      finishedArea: '44.22',
      wornNumber: '',
      wornArea: '',
      teamName:'切割一班'
    },
    {
      reportingWorkNo: 'BG2312080001',
      reportingWorkTime: '2023-12-08 09:05:58',
      processCard: 'NG23120801A01',
      entryName: '信合春天里',
      batch: '一批二',
      device:'大海利宁',
      thisProcess: '切割',
      finishedNumber: '13',
      finishedArea: '44.22',
      wornNumber: '',
      wornArea: '',
      teamName:'切割一班'
    },
    {
      reportingWorkNo: 'BG2312080015',
      reportingWorkTime: '2023-12-08 09:05:58',
      processCard: 'NG23120801A01',
      entryName: '信合春天里',
      batch: '一批二',
      device:'大海利宁',
      thisProcess: '切割',
      finishedNumber: '13',
      finishedArea: '44.22',
      wornNumber: '',
      wornArea: '',
      teamName:'切割一班'
    },
  ],//table body实际数据
  data:  [],//table body实际数据
  //脚部求和
  footerMethod ({ columns, data }) {//页脚函数
    let footList=['finishedNumber','finishedArea','wornNumber','wornArea']
    let footList=['','','','']
    return[
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
@@ -193,16 +307,6 @@
})
const form = reactive({
  name: '',
  region: '',
  date1: '',
  date2: '',
  delivery: false,
  type: [],
  resource: '',
  desc: '',
})
</script>
<template>
@@ -212,12 +316,22 @@
        <el-date-picker
            v-model="form.date1"
            type="daterange"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            format="YYYY/MM/DD"
            value-format="YYYY-MM-DD"
            :start-placeholder="$t('basicData.startDate')"
            :end-placeholder="$t('basicData.endDate')"
            :default-time="defaultTime"
        />
        &nbsp;&nbsp;
        <el-button type="primary">查询</el-button>
        <el-input v-model="form.orderId" clearable :placeholder="$t('order.orderId')" style="width: 130px"></el-input>
        &nbsp;
        <el-button
            @click="getWorkOrder"
            id="select"
            type="primary" :icon="Search">{{$t('basicData.search')}}
        </el-button>
      </el-row>
    </div>
@@ -233,9 +347,11 @@
      <!--      下拉显示所有信息插槽-->
      <template #content="{ row }">
        <ul class="expand-wrapper">
          <li  v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
            <span style="font-weight: bold">{{item.title+':  '}}</span>
            <span>{{ row[item.field] }}</span>
          <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
            <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
            <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span>
            <span v-else>{{ row[item.field] }}</span>
          </li>
        </ul>
      </template>
@@ -243,7 +359,6 @@
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button>
        <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">反审</el-button>
        <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button>
      </template>
@@ -254,9 +369,24 @@
          </div>
        </div>
      </template>
      <template #pager>
        <!--使用 pager 插槽-->
        <!--        'PrevJump','NextJump', -->
        <vxe-pager
            @page-change="handlePageChange"
            :layouts="[  'PrevPage', 'Jump','PageCount', 'NextPage',  'Total']"
            v-model:current-page="pageNum"
            v-model:page-size="total.pageSize"
            v-model:pager-count="total.pageTotal"
            :total="total.dataTotal"
        >
        </vxe-pager>
      </template>
    </vxe-grid>
<!--    <el-dialog v-model="updateWork"  style="width: 80%;height:75% ">-->
<!--      <select-product :rowIndex="rowIndex" @getProductRow="getProductRow" style="width: 100%;height: 100%" />-->
<!--    </el-dialog>-->
  </div>
</template>
@@ -266,7 +396,7 @@
  height: 100%;
}
#selectForm {
  width: 40%;
  width: 45%;
  text-align: center;
}
</style>
north-glass-erp/northglass-erp/src/views/pp/workOrder/AddWorkOrder.vue
@@ -12,7 +12,9 @@
import BasicTable from '@/components/basic/BasicTable.vue'
import {VXETable} from "vxe-table";
import useUserInfoStore from "@/stores/userInfo";
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
let router = useRouter()
const userStore = useUserInfoStore()
const username = userStore.user.userName
@@ -165,19 +167,19 @@
  },//表头参数
  columns: [
    {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50},
    {type: 'checkbox', fixed: "left", title: '选择', width: 80},
    {type: 'seq', fixed: "left", title: '自序', width: 50},
    {field: 'orderId', title: '销售单号', filters: [{data: ''}], slots: {filter: 'num1_filter'},},
    {field: 'productId',title: '产品编号',showOverflow: "ellipsis",filters: [{data: ''}],slots: {filter: 'num1_filter'}},
    {field: 'productName', title: '产品名称', filters: [{data: ''}], slots: {filter: 'num1_filter'}, },
    {field: 'quantity', title: '总数量', },
    {field: 'computeGrossArea', title: '总面积', },
    {field: 'perimeter', title: '周长', showOverflow: "ellipsis"}
    {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80},
    {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50},
    {field: 'orderId', title: t('order.orderId'), filters: [{data: ''}], slots: {filter: 'num1_filter'},},
    {field: 'productId',title: t('order.productId'),showOverflow: "ellipsis",filters: [{data: ''}],slots: {filter: 'num1_filter'}},
    {field: 'productName', title: t('order.product'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, },
    {field: 'quantity', title: t('order.quantity'), },
    {field: 'computeGrossArea', title: t('order.area'), },
    {field: 'perimeter', title: t('workOrder.perimeter'), showOverflow: "ellipsis"}
  ],//表头按钮
  toolbarConfig: {
    buttons: [
      {code: 'saveWorkOrder', name: '保存', status: 'primary', icon: 'vxe-icon-save'},
      {code: 'saveWorkOrder', name: t('basicData.save'), status: 'primary', icon: 'vxe-icon-save'},
    ],
    // import: false,
    // export: true,
@@ -192,7 +194,7 @@
    return [
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
          return  t('basicData.total')
        }
        if (footList.includes(column.field)) {
          return sumNum(data, column.field)
@@ -221,11 +223,11 @@
            request.post("/workOrder/addOrderWork", workOrderData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success("保存成功")
                ElMessage.success(t('basicData.msg.saveSuccess'))
                location.reload();
              } else {
                ElMessage.warning(res.msg)
                router.push("/login")
               // router.push("/login")
              }
            })
north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue
@@ -10,7 +10,9 @@
import Sortable from 'sortablejs'
import BasicTable from '@/components/basic/BasicTable.vue'
import {VXETable} from "vxe-table";
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
let productGlassTypeStore = useProductGlassTypeStore()
let router = useRouter()
@@ -26,7 +28,7 @@
    case 'delete': {
        request.post(`/workOrder/deleteOrderWork/${row.orderId}/${row.orderDetail.productName}`).then((res) => {
        if (res.code == 200) {
          ElMessage.success("删除成功")
          ElMessage.success(t('workOrder.deleteOk'))
          location.reload();
        } else {
          ElMessage.warning(res.msg)
@@ -54,11 +56,11 @@
const options = [
  {
    value: '0',
    label: '已转',
    label: t('workOrder.convert'),
  },
  {
    value: '1',
    label: '未转',
    label: t('workOrder.unConverted'),
  },
]
@@ -238,25 +240,25 @@
  },//表头参数
  columns: [
    {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50},
    {title: '操作', width: 110, slots: {default: 'button_slot'}, fixed: "left"},
    {type: 'seq', fixed: "left", title: '自序', width: 50},
    {field: 'orderId', title: '销售单号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110},
    {title: t('basicData.operate'), width: 110, slots: {default: 'button_slot'}, fixed: "left"},
    {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50},
    {field: 'orderId', title: t('order.orderId'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110},
    {
      field: 'productionId',
      title: '生产订单号',
      title: t('workOrder.productionId'),
      showOverflow: "ellipsis",
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'}
      , width: 130
    },
    {field: 'order.batch', title: '批次', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110},
    {field: 'orderDetail.productName', title: '产品名称', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 210},
    {field: 'orderDetail.computeArea', title: '单片总面积', showOverflow: "ellipsis", width: 110},
    {field: 'orderDetail.quantity', title: '总数量', width: 70},
    {field: 'orderDetail.computeGrossArea', title: '成品总面积',},
    {field: 'orderDetail.perimeter', title: '周长', showOverflow: "ellipsis"},
    {field: 'orderDetail.bendRadius', title: '半径',},
    {field: 'orderDetail.processingNote', title: '加工要求',}
    {field: 'order.batch', title: t('order.batch'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110},
    {field: 'orderDetail.productName', title: t('order.product'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 210},
    {field: 'orderDetail.computeArea', title: t('order.computeArea'), showOverflow: "ellipsis", width: 110},
    {field: 'orderDetail.quantity', title: t('order.quantity'), width: 70},
    {field: 'orderDetail.computeGrossArea', title: t('order.trueGrossArea'),},
    {field: 'orderDetail.perimeter', title: t('workOrder.perimeter'), showOverflow: "ellipsis"},
    {field: 'orderDetail.bendRadius', title: t('order.bendRadius'),},
    {field: 'orderDetail.processingNote', title: t('order.processingNote'),}
  ],//表头按钮
  data: null,//表格数据
  toolbarConfig: {
@@ -275,7 +277,7 @@
    return [
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
          return t('basicData.total')
        }
        if (footList.includes(column.field)) {
          return sumNum(data, column.field)
@@ -299,14 +301,14 @@
            type="daterange"
            format="YYYY/MM/DD"
            value-format="YYYY-MM-DD"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            :start-placeholder="$t('basicData.startDate')"
            :end-placeholder="$t('basicData.endDate')"
            :default-time="defaultTime"
        />
        &nbsp;&nbsp;
        <el-select :default-first-option="true" ref="getSelect" style="width: 120px" v-model="optionVal" class="m-2"
                   placeholder="是否转工单">
        <el-select :default-first-option="true" ref="getSelect" style="width: 130px" v-model="optionVal" class="m-2"
                   >
          <el-option
              v-for="item in options"
              :key="item.value"
@@ -319,7 +321,7 @@
            @click="getWorkOrder(isButtonDisabled)"
            :disabled="isButtonDisabled"
            id="select"
            type="primary" :icon="Search">查询
            type="primary" :icon="Search">{{$t('basicData.search')}}
        </el-button>
      </el-row>
@@ -347,8 +349,8 @@
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
        <el-button :class="{disable: optionVal== 0}" :disabled="optionVal == 0" @click="getTableRow(row,'edit')" link type="primary" size="small">转工单</el-button>
        <el-button :class="{disable: optionVal== 1}" :disabled="optionVal == 1" @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button>
        <el-button :class="{disable: optionVal== 0}" :disabled="optionVal == 0" @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('workOrder.transferOrder')}}</el-button>
        <el-button :class="{disable: optionVal== 1}" :disabled="optionVal == 1" @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.delete')}}</el-button>
      </template>
      <template #num1_filter="{ column, $panel }">
north-glass-erp/northglass-erp/src/views/pp/workOrder/WorkOrder.vue
@@ -6,8 +6,12 @@
import {ElMessage} from "element-plus";
import {useRoute, useRouter} from "vue-router";
import  GlassType from '@/components/basic/product/GlassType.vue'
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
const router = useRouter()
const route = useRoute()
let indexFlag=$ref(1)
function changeRouter(index){
  indexFlag=index
@@ -18,7 +22,7 @@
  <div id="main">
    <div id="div-title">
      <el-breadcrumb :separator-icon="ArrowRight">
        <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/workOrder/SelectWorkOrder' }">工单管理</el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/workOrder/SelectWorkOrder' }">{{$t('workOrder.workOrder')}}</el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/processCard/SelectPrintFlowCard' }" style="display: none">打印</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
@@ -540,7 +540,7 @@
  list.forEach((item)=>{
    countMoney += parseFloat(item.grossAmount)
  })
  return countMoney
  return parseFloat((countMoney).toFixed(2))
}
//导入功能
const importEvent = async () => {
north-glass-erp/northglass-erp/src/views/sd/order/UpdateOrderCraft.vue
@@ -224,7 +224,7 @@
    if(res.code==200){
      gridOptions.toolbarConfig.buttons[2].disabled = true
      if(state==2){
        ElMessage.success(t('basicData.msg.reviewSuccess'))
        ElMessage.success(t('basicData.msg.ReviewSuccess'))
      }else if (state==0){
        ElMessage.success(t('basicData.msg.cancelReviewSuccess'))
      }
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
@@ -59,8 +59,8 @@
    }
    //删除工单
    @ApiOperation("删除工单接口")
    //删除流程卡
    @ApiOperation("删除流程卡接口")
    @PostMapping("/deleteFlowCard/{orderId}/{processId}")
    public Result deleteOrderWork(
            @PathVariable String orderId,
@@ -135,5 +135,13 @@
        return Result.seccess(flowCardService.selectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,flowCard));
    }
    //查询排产数据
    @ApiOperation("流程卡明细查询接口")
    @PostMapping  ("/flowCardDetail/{processId}")
    public Result flowCardDetail(
            @PathVariable String processId,
            @RequestBody FlowCard flowCard){
        return Result.seccess(flowCardService.flowCardDetailSv(processId,flowCard));
    }
}
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java
@@ -22,12 +22,14 @@
    //查询第一次排版数据
    @ApiOperation("加载时查询排版数据接口")
    @PostMapping  ("/selectLastScheduling/{selectTime1}/{selectTime2}")
    @PostMapping  ("/selectLastScheduling/{selectTime1}/{selectTime2}/{processes}/{orderId}")
    public Result selectLastScheduling(
            @PathVariable String selectTime1,
            @PathVariable String selectTime2,
            @PathVariable String processes,
            @PathVariable String orderId,
            @RequestBody ProductionScheduling productionScheduling){
        return Result.seccess(productionSchedulingService.selectLastScheduling(selectTime1,selectTime2,productionScheduling));
        return Result.seccess(productionSchedulingService.selectLastScheduling(selectTime1,selectTime2,processes,orderId,productionScheduling));
    }
    //点击查询排版数据
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java
@@ -2,6 +2,7 @@
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.pp.ReportingWork;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.pp.ReportingWorkService;
@@ -53,6 +54,33 @@
    public Result SelectUpdateReportingWork(@PathVariable String reportingWorkId)  {
        return  Result.seccess(reportingWorkService.selectUpdateReportingWorkSv(reportingWorkId));
    }
    @ApiOperation("报工修改")
    @PostMapping  ("/updateReportingWork")
    public Result updateReportingWork(@RequestBody Map<String,Object> reportingWork)  {
        return  Result.seccess(reportingWorkService.updateReportingWork(reportingWork));
    }
    @ApiOperation("报工查询接口")
    @PostMapping  ("/selectReportingWork/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}/{orderId}")
    public Result selectReportingWork(
            @PathVariable Integer pageNum,
            @PathVariable Integer pageSize,
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @PathVariable String orderId,
            @RequestBody ReportingWork reportingWork){
        return Result.seccess(reportingWorkService.selectReportingWorkSv(pageNum,pageSize,selectTime1,selectTime2,orderId,reportingWork));
    }
    @ApiOperation("删除报工接口")
    @PostMapping("/deleteWork/{reportingWorkId}/{processId}/{thisProcess}")
    public Result deleteWork(@PathVariable String reportingWorkId,@PathVariable String processId,@PathVariable String thisProcess){
        if(reportingWorkService.deleteWorkSv(reportingWorkId,processId,thisProcess)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"删除失败,请检查是否符合删除条件");
        }
    }
}
north-glass-erp/src/main/java/com/example/erp/entity/pp/DamageDetails.java
@@ -26,7 +26,7 @@
    //类型
    private String breakageType;
    //可利用
    private Integer available;
    private Boolean available;
    //退回工序
    private String returnProcess;
    //责任工序
north-glass-erp/src/main/java/com/example/erp/entity/pp/ReportingWork.java
@@ -3,7 +3,10 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.example.erp.entity.sd.DeliveryDetail;
import com.example.erp.entity.sd.Order;
import com.example.erp.entity.sd.OrderGlassDetail;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.time.LocalDate;
@@ -33,11 +36,11 @@
    //本工序
    private String thisProcess;
    //上工序数量
    private Integer thisProcessQuantity;
    private int thisProcessQuantity;
    //本工序完工数量
    private Integer thisCompletedQuantity;
    private int thisCompletedQuantity;
    //本工序次破数量
    private Integer thisWornQuantity;
    private int thisWornQuantity;
    //下工序
    private String nextProcess;
    //班次
@@ -59,6 +62,7 @@
    //包装方式
    private String packagingMethod;
    //报工时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime reportingWorkTime;
    //审核时间
    private LocalDate examineTime;
@@ -83,4 +87,15 @@
//    private ReportingWork reportingWork;
    @TableField(select = false,exist= false)
    private  ReportingWorkDetail reportingWorkDetail;
    @TableField(select = false,exist= false)
    private OrderGlassDetail orderGlassDetail;
    //定义的完工面积
    @TableField(select = false,exist= false)
    private String completedArea;
    //次破面积
    @TableField(select = false,exist= false)
    private String wornArea;
}
north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
@@ -61,4 +61,8 @@
    Integer selectFlowCardCount(String orderId);
    List<Map<String, String>> flowCardDetailMp(String processId, FlowCard flowCard);
    Boolean deleteReportingWork(String processId);
}
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java
@@ -19,13 +19,13 @@
    List<Map<String,String>> selectNoSchedulingMp(String selectTime1, String selectTime2,String orderId,String processes, ProductionScheduling  productionScheduling);
    List<Map<String,String>> selectLastSchedulingMp(String selectTime1, String selectTime2, ProductionScheduling productionScheduling);
    List<Map<String,String>> selectLastSchedulingMp(String selectTime1, String selectTime2,String processes,String orderId, ProductionScheduling productionScheduling);
    List<Map<String,String>> selectSchedulingNotMp(String selectTime1, String selectTime2, String orderId, String processes, ProductionScheduling productionScheduling);
    Integer selectMaxId();
    Boolean insertSelective(String schedulingId, String orderId, String orderNumber, String processes, Integer schedulingQuantity, LocalDate scheduledStartTime, LocalDate planEndTime, String notes);
    Boolean insertSelective(String schedulingId, String orderId, String orderNumber,String technologyNumber, String processes, Integer schedulingQuantity, LocalDate scheduledStartTime, LocalDate planEndTime, String notes);
    Boolean examineSchedulingMp(String schedulingId, String userName);
@@ -33,5 +33,5 @@
    List<Map<String,String>> selectProcess();
    Integer selectNumberMp(String orderId, String orderNumber, String processes);
//    Integer selectNumberMp(String orderId, String orderNumber, String processes);
}
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkDetailMapper.java
@@ -26,5 +26,4 @@
                                               @Param("sDate") String startTime,@Param("eDate") String endTime,ReportingWorkDetail reportingWorkDetail);
    List<ReportingWorkDetail> selectByreportingWorkId(String reportingWorkId);
}
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java
@@ -2,11 +2,10 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.erp.entity.pp.BasicDataProduce;
import com.example.erp.entity.pp.ReportingWork;
import com.example.erp.entity.pp.ReportingWorkDetail;
import com.example.erp.entity.sd.OrderGlassDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.sql.Date;
import java.util.List;
import java.util.Map;
@@ -45,4 +44,27 @@
    int selectGlassProcessNum(String orderNumber, String technologyNumber, String processId, String thisProcess);
    int selectFlowCardNum(String orderNumber, String technologyNumber, String processId, String thisProcess);
    List<Map<String,Object>> selectByReportingWorkId(String reportingWorkId,String nextProcess);
    Map<String, Integer> getPageTotal(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, String orderId, ReportingWork reportingWork);
    String selectNextProcess(String reportingWorkId);
    Integer selectCountByProcessId(String processId, String nextProcess);
    List<Map<String, Object>> reportingWorkDate(String reportingWorkId);
    Boolean updateWorkProcess(String processId, Object orderNumber, Object technologyNumber, Object completedQuantity, Object breakageQuantity, String thisProcess);
    Boolean deleteWork(String reportingWorkId);
    String selectLastProcess(String processId);
    Map<String, Object> selectReceiptQuantity(String processId);
    Integer selectCompletedQuantity(String reportingWorkId);
    Boolean updateInventoryQuantity(String processId, Object orderNumber, Object technologyNumber, Object completedQuantity);
    List<ReportingWork> selectReportingWorkMp(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, String orderId, ReportingWork reportingWork);
}
north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderProcessDetailMapper.java
@@ -12,4 +12,6 @@
@DS("sd")
public interface OrderProcessDetailMapper extends BaseMapper<OrderProcessDetail> {
    boolean insertOrderProcessDetail(@Param("processDetailList") List<OrderProcessDetail> processDetailList);
    void updateQuantity(String reportingWorkId,String process,String type);
}
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -71,6 +71,8 @@
                //修改分架状态
                flowCardMapper.updateDeleteState(orderId, processId);
                //删除报工流程明细表数据
                flowCardMapper.deleteReportingWork(processId);
                //删除分架明细
                flowCardMapper.deleteFlowCardMp(orderId, processId);
                //判断该订单流程卡是否全部删除
@@ -187,4 +189,10 @@
        map.put("data", flowCardMapper.selectLastSchedulingMp(selectTime1, selectTime2, flowCard));
        return map;
    }
    public Object flowCardDetailSv(String processId, FlowCard flowCard) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", flowCardMapper.flowCardDetailMp(processId, flowCard));
        return map;
    }
}
north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java
@@ -47,9 +47,16 @@
    //首次查询排产数据
    public Map<String, Object> selectLastScheduling(String selectTime1, String selectTime2,ProductionScheduling productionScheduling ) {
    public Map<String, Object> selectLastScheduling(String selectTime1, String selectTime2,String processes,String orderId,ProductionScheduling productionScheduling ) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", productionSchedulingMapper.selectLastSchedulingMp(selectTime1, selectTime2, productionScheduling));
        if(orderId.equals("null")){
            orderId="";
        }
        if (processes.equals("null")){
            processes="";
        }
        map.put("data", productionSchedulingMapper.selectLastSchedulingMp(selectTime1, selectTime2,processes,orderId, productionScheduling));
        map.put("process", productionSchedulingMapper.selectProcess());
        return map;
    }
@@ -84,10 +91,10 @@
        if (!schedulinglist.isEmpty()) {
            for (ProductionScheduling productionScheduling : schedulinglist) {
                //查询已排产工序数量
              Integer num =  productionSchedulingMapper.selectNumberMp(productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),processes);
             // Integer num =  productionSchedulingMapper.selectNumberMp(productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),processes);
               productionSchedulingMapper.insertSelective(schedulingId,productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),processes,productionScheduling.getSchedulingQuantity(),productionScheduling.getScheduledStartTime(),productionScheduling.getPlanEndTime(),productionScheduling.getNotes());
               // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId());
             productionSchedulingMapper.insertSelective(schedulingId,productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),productionScheduling.getTechnologyNumber(),processes,productionScheduling.getSchedulingQuantity(),productionScheduling.getScheduledStartTime(),productionScheduling.getPlanEndTime(),productionScheduling.getNotes());
                //System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getTechnologyNumber());
            }
            return true;
        }
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -174,17 +174,30 @@
        }
        //主表插入
        reportingWorkMapper.insert(reportingWork);
        //副表循环插入,并且插入次破信息表。再根据次破信息修改订单玻璃流程表的完工数量与刺破数量
        reportingWorkDetails.forEach(reportingWorkDetail -> {
//            reportingWork.setThisProcessQuantity(
//                    reportingWork.getThisProcessQuantity()
//                            +reportingWorkDetail.getCompletedQuantity()
//                            +reportingWorkDetail.getBreakageQuantity());
//            reportingWork.setThisCompletedQuantity(
//                    reportingWork.getThisCompletedQuantity()+reportingWorkDetail.getCompletedQuantity());
//            reportingWork.setThisWornQuantity(
//                    reportingWork.getThisWornQuantity()+reportingWorkDetail.getBreakageQuantity());
            reportingWorkDetail.setReportingWorkId(reportingWorkId);
            List<DamageDetails> damageDetails = reportingWorkDetail.getDamageDetails();
            //次破明细表插入数据
            if(damageDetails!=null && !damageDetails.isEmpty()){
                damageDetails.forEach(damageDetail ->{
                    damageDetail.setReportingWorkId(reportingWorkId);
                    damageDetail.setOrderNumber(reportingWorkDetail.getOrderNumber());
                    damageDetail.setProcessId(reportingWork.getProcessId());
                    damageDetail.setTechnologyNumber(reportingWorkDetail.getTechnologyNumber());
                    if(damageDetail.getResponsibleProcess()!=reportingWork.getThisProcess()){
                        damageDetail.setQualityInsStatus(1);
                    }
                    damageDetailsMapper.insert(damageDetail);
                });
            }
@@ -241,7 +254,12 @@
                    .setSql("reporting_work_num =reporting_work_num +"+orderProcessDetail.getReportingWorkNum())
                    .setSql("broken_num =broken_num +"+orderProcessDetail.getBrokenNum());
            orderProcessDetailMapper.update(null,updateWrapper);
            reportingWorkDetailMapper.insert(reportingWorkDetail);
            //判断完工数量和刺破数量是否为0,为0则不插入到数据库
            if(!(reportingWorkDetail.getCompletedQuantity()==0 && reportingWorkDetail.getBreakageQuantity()==0)){
                reportingWorkDetailMapper.insert(reportingWorkDetail);
            }
            //更新流程卡表的报工数量
            if(Objects.equals(reportingWork.getNextProcess(), "")){
                LambdaUpdateWrapper<FlowCard> flowCardLambdaUpdateWrapper =
@@ -256,6 +274,7 @@
        });
        return  true;
    }
@@ -277,21 +296,179 @@
        return  true;
    }
    //报工修改查询
    public Map<String,Object> selectUpdateReportingWorkSv(String reportingWorkId) {
        //查询报工主表信息
        ReportingWork reportingWork =reportingWorkMapper.selectOne(new LambdaQueryWrapper<ReportingWork>()
                                        .eq(ReportingWork::getReportingWorkId,reportingWorkId));
        //根据报工信息查询订单主表信息
        reportingWork.setOrder(
            orderMapper.selectOne(new LambdaQueryWrapper<Order>()
                                        .eq(Order::getOrderId,reportingWork.getOrderId())));
        reportingWork.setFlowCard(new FlowCard());
        List<ReportingWorkDetail> reportingWorkDetails = reportingWorkDetailMapper.selectByreportingWorkId(reportingWorkId);
        List<Map<String,Object>> reportingWorkDetails = reportingWorkMapper.selectByReportingWorkId(reportingWorkId,reportingWork.getNextProcess());
        reportingWorkDetails.forEach(reportingWorkDetail ->{
            List<DamageDetails> damageDetailsList = new  ArrayList<>();
            damageDetailsList = damageDetailsMapper.selectList(new LambdaQueryWrapper<DamageDetails>()
                    .eq(DamageDetails::getReportingWorkId,reportingWorkId)
                    .eq(DamageDetails::getOrderNumber,reportingWorkDetail.get("order_number"))
                    .eq(DamageDetails::getTechnologyNumber,reportingWorkDetail.get("technology_number"))
            );
            reportingWorkDetail.put("damageDetails",damageDetailsList);
        });
        Map<String,Object> map = new HashMap<>();
        map.put("reportingWork",reportingWork);
        map.put("reportingWorkDetails",reportingWorkDetails);
        map.put("basic",getReportingWorkBase(reportingWork.getProcessId(),reportingWork.getThisProcess()));
        return map;
    }
    private Map<String,Object> getReportingWorkBase(String processId, String thisProcess) {
        Map<String,Object> map = new HashMap<>();
        //设备下拉框
        map.put("deviceType", reportingWorkMapper.SelectWorkBasicDeviceMp(thisProcess));
        //班组下拉框
        map.put("teamsType", reportingWorkMapper.SelectWorkBasicTeamsMp(thisProcess));
        map.put("breakageType",reportingWorkMapper.selectBasicNameByType("breakagetype"));
        map.put("breakageReason",reportingWorkMapper.selectBasicNameByType("breakagereason"));
        //获取该流程卡号历史报工工序
        String historyProcess =reportingWorkMapper.historyProcessMp(processId);
        //历史报工工序设备
        map.put("historyDevice",reportingWorkMapper.historyDeviceMp(historyProcess,thisProcess));
        //历史报工工序班组
        map.put("historyTeams",reportingWorkMapper.historyTeamsMp(processId,thisProcess));
        //历史工序
        map.put("historyProcess",reportingWorkMapper.SelectHistoryProcessMp(historyProcess,thisProcess));
        return map;
    }
    @Transactional
    //报工修改
    public Boolean updateReportingWork(Map<String, Object> reportingWorkMap) {
        //接收解析主附表信息
        JSONObject reportingWorkJson = new JSONObject(reportingWorkMap);
        ReportingWork reportingWork = JSONObject.parseObject(JSONObject.toJSONString(reportingWorkJson.get("title")), ReportingWork.class);
        List<ReportingWorkDetail> reportingWorkDetails = JSONArray.parseArray(JSONObject.toJSONString(reportingWorkJson.get("detail")), ReportingWorkDetail.class);
        //删除刺破明细表刺破数据
        damageDetailsMapper.delete(
                new LambdaQueryWrapper<DamageDetails>()
                .eq(DamageDetails::getReportingWorkId,reportingWork.getReportingWorkId())
        );
        //修改小片流程表数量
        orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(),reportingWork.getThisProcess(),"delete");
        //删除报工明细表数据
        reportingWorkDetailMapper
                .delete(new LambdaQueryWrapper<ReportingWorkDetail>()
                        .eq(ReportingWorkDetail::getReportingWorkId,reportingWork.getReportingWorkId()));
        //更细报工主表
        reportingWorkMapper.updateById(reportingWork);
        reportingWorkDetails.forEach(reportingWorkDetail->{
            List<DamageDetails>  damageDetails =  reportingWorkDetail.getDamageDetails();
            //每一条报工数据循环插入次破明细表
            if(damageDetails!=null && !damageDetails.isEmpty()){
                damageDetails.forEach(damageDetail->{
                    if(!Objects.equals(reportingWork.getThisProcess(), damageDetail.getResponsibleProcess())){
                        damageDetail.setQualityInsStatus(1);
                    }
                    damageDetailsMapper.insert(damageDetail);
                });
            }
            //插入报工数据
            reportingWorkDetailMapper.insert(reportingWorkDetail);
        });
        //修改小片流程表数量为报工明细表数量
        orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(),reportingWork.getThisProcess(),"add");
        return  true;
    }
    //报工管理查询
    public Map<String, Object> selectReportingWorkSv(Integer pageNum, Integer pageSize, java.sql.Date selectTime1, java.sql.Date selectTime2, String orderId, ReportingWork reportingWork) {
        Integer offset = (pageNum - 1) * pageSize;
        if (orderId.equals("null")) {
            orderId = "";
        }
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportingWorkMapper.selectReportingWorkMp(offset, pageSize, selectTime1, selectTime2, orderId, reportingWork));
        map.put("total", reportingWorkMapper.getPageTotal(offset, pageSize, selectTime1, selectTime2, orderId, reportingWork));
        //System.out.println(map.get("data"));
        return map;
    }
    public Boolean deleteWorkSv(String reportingWorkId, String processId, String thisProcess) {
        if (!reportingWorkId.isEmpty() && !processId.isEmpty() && !thisProcess.isEmpty()) {
            //获取当前报工编号下工序
            String nextProcess = reportingWorkMapper.selectNextProcess(reportingWorkId);
            //查询当前报工编号下工序是否报工
            Integer count = reportingWorkMapper.selectCountByProcessId(processId, nextProcess);
            //获取最后一道工序
            String lastProcess = reportingWorkMapper.selectLastProcess(processId);
            //判断是否是入库工序
            if (lastProcess.equals(thisProcess)) {//是入库工序
                //查询该流程卡数量、可入库数量、已入库数量
                Map<String, Object> list = reportingWorkMapper.selectReceiptQuantity(processId);
                // System.out.println(list.get("quantity")+"--"+list.get("inventoryQuantity")+"---"+list.get("receivedQuantity"));
                if (list.get("quantity") == list.get("receiptQuantity")) {
                    return false;
                } else {
                    //转换类型:已入库数量
                    Integer receiptQuantity = Integer.parseInt(list.get("receivedQuantity").toString());
                    //转换类型:可入库数量
                    Integer inventoryQuantity = Integer.parseInt(list.get("inventoryQuantity").toString());
                    //查询该报工编号本工序完工数量
                    Integer completedQuantity = reportingWorkMapper.selectCompletedQuantity(reportingWorkId);
                    //当该工序完工数量小于等于已入库数量时
                    //System.out.println("inventoryQuantity:" + inventoryQuantity +"completedQuantity:" + completedQuantity + "---receiptQuantity:" + receiptQuantity);
                    //可入库数量-已入库数量>=报工编号本工序完工数量
                    if (inventoryQuantity - receiptQuantity >= completedQuantity) {
                        //查询当前报工编号完工次破数量的数据
                        List<Map<String, Object>> workDateList = reportingWorkMapper.reportingWorkDate(reportingWorkId);
                        for (Map<String, Object> item : workDateList) {
                            //更新流程卡可入库数量
                            reportingWorkMapper.updateInventoryQuantity(processId, item.get("order_number"), item.get("technology_number"), item.get("completed_quantity"));
                            //更新报工流程表数据
                            reportingWorkMapper.updateWorkProcess(processId, item.get("order_number"), item.get("technology_number"), item.get("completed_quantity"), item.get("breakage_quantity"), thisProcess);
                        }
                        //删除报工,将审核状态改为-1
                        reportingWorkMapper.deleteWork(reportingWorkId);
                        return true;
                    } else {
                        return false;
                    }
                }
            }
          else{//不是入库工序
              if (count==0){
                  //查询当前报工编号完工次破数量的数据
                  List<Map<String, Object>> workDateList=reportingWorkMapper.reportingWorkDate(reportingWorkId);
                  for (Map<String, Object> item : workDateList) {
                      //更新报工流程表数据
                      reportingWorkMapper.updateWorkProcess(processId,item.get("order_number"),item.get("technology_number"),item.get("completed_quantity"),item.get("breakage_quantity"),thisProcess);
                  }
                  //删除报工,将审核状态改为-1
                  reportingWorkMapper.deleteWork(reportingWorkId);
                  return true;
              }
            else {
                return false;
            }
          }
        } else {
            return false;
        }
    }
}
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -62,25 +62,25 @@
        a.founder,
        c.processing_note,
        if(a.layout_status=0,"不可排版",if(a.layout_status=1,"可排版","已排版")) as layout_status
        from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id
        from (select  id,order_id,process_id,order_number, quantity,founder,layout_status,create_time from flow_card group by process_Id,order_number) as a left join sd.`order` as b on a.order_Id=b.order_id
        left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
        where a.create_time between #{selectTime1} and #{selectTime2}
                    <if test="flowCard.orderId != null and flowCard.orderId != ''">
                        and a.order_id regexp #{flowCard.orderId}
                    </if>
                    <if test="flowCard.processId != null and flowCard.processId != ''">
                        and a.process_Id regexp #{flowCard.processId}
                    </if>
                    <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
                        and c.product_id regexp #{flowCard.orderDetail.productId}
                    </if>
                    <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">
                        and c.product_name regexp #{flowCard.orderDetail.productName}
                    </if>
        <if test="flowCard.orderId != null and flowCard.orderId != ''">
            and a.order_id regexp #{flowCard.orderId}
        </if>
        <if test="flowCard.processId != null and flowCard.processId != ''">
            and a.process_Id regexp #{flowCard.processId}
        </if>
        <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
            and c.product_id regexp #{flowCard.orderDetail.productId}
        </if>
        <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">
            and c.product_name regexp #{flowCard.orderDetail.productName}
        </if>
                    <if test="flowCard.order.project != null and flowCard.order.project!= ''">
                        and b.project regexp #{flowCard.order.project}
                    </if>
        <if test="flowCard.order.project != null and flowCard.order.project!= ''">
            and b.project regexp #{flowCard.order.project}
        </if>
        group by a.process_Id
@@ -131,7 +131,8 @@
        o.delivery_address
        from sd.`order` as o
        left join sd.order_glass_detail ogd on o.order_id = ogd.order_id
        where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and #{selectTime2}
        where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and
        #{selectTime2}
        <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''">
            and o.order_id regexp #{flowCard.order.orderId}
@@ -165,7 +166,7 @@
        ;
    </select>
<!--    分架明细查询-->
    <!--    分架明细查询-->
    <select id="detailsSelectMp" resultMap="flowCardMap">
        select od.order_id,
        ogd.production_id,
@@ -174,7 +175,7 @@
        SUM( od.quantity) as quantity,
        SUM(od.compute_gross_area) as compute_gross_area,
        od.perimeter
        from  sd.order_detail as od left join
        from sd.order_detail as od left join
        (select order_id,order_number,production_id,splitting_status from sd.order_glass_detail
        GROUP BY order_id,order_number
        ) as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number
@@ -199,43 +200,47 @@
    <update id="updateDeleteState">
        update
            sd.order_glass_detail as ogd left join flow_card as fc
                on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number
                on ogd.order_id = fc.order_id and ogd.order_number = fc.order_number
        set ogd.splitting_status=0
        where ogd.order_id=#{orderId}  and fc.process_id=#{processId}
        where ogd.order_id = #{orderId}
          and fc.process_id = #{processId}
    </update>
    <!--    删除流程卡-->
    <update id="deleteFlowCardMp">
        delete from flow_card as fc where fc.process_id=#{processId}
        delete
        from flow_card as fc
        where fc.production_id = left(#{processId},11)
    </update>
    <!--    分架新增明细查询-->
    <!--resultMap="flowCardMap"-->
    <select id="selectNoCardMp" >
    <select id="selectNoCardMp">
        select
        od.order_number,
        od.order_number AS 'orderNumber',
        od.width,
        od.height,
        od.shape,
        od.quantity,
        od.compute_gross_area,
        p.total_thickness,
        od.quantity as baiscQuantity,
        od.compute_gross_area as 'computeGrossArea',
        p.total_thickness AS 'totalThickness',
        p.thickness,
        od.weight
        from
        sd.order_detail as od
        left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number
        left join sd.product as p on od.product_name=p.product_name
        where od.order_id=#{orderId} and ogd.production_id=#{productionId} and ogd.splitting_status=0
        select od.order_number,
               od.order_number       AS 'orderNumber',
               od.width,
               od.height,
               od.shape,
               od.quantity,
               od.compute_gross_area,
               p.total_thickness,
               od.quantity           as baiscQuantity,
               od.compute_gross_area as 'computeGrossArea',
               p.total_thickness     AS 'totalThickness',
               p.thickness,
               od.weight
        from sd.order_detail as od
                 left join sd.order_glass_detail as ogd
                           on od.order_id = ogd.order_id and od.order_number = ogd.order_number
                 left join sd.product as p on od.product_name = p.product_name
        where od.order_id = #{orderId}
          and ogd.production_id = #{productionId}
          and ogd.splitting_status = 0
        GROUP BY od.order_number
        order by od.id desc
        order by od.id
    </select>
@@ -246,7 +251,7 @@
        where fc.process_id = #{processId}
    </update>
<!--    查询对应流程卡号排版状态-->
    <!--    查询对应流程卡号排版状态-->
    <select id="selectLayoutStatus">
        select fc.layout_status
        from flow_card as fc
@@ -254,109 +259,153 @@
        LIMIT 1
    </select>
<!--    查询报工表内是否有对应流程卡-->
    <!--    查询报工表内是否有对应流程卡-->
    <select id="reportingWorkCount">
        select COUNT(rw.process_id)
        from reporting_work as rw
        where rw.process_id = #{processId}
    </select>
<!--    插入Flow_card表-->
    <!--    插入Flow_card表-->
    <insert id="addFlowCardMp">
        insert into
            flow_card (
            order_id,
            production_id,
            process_id,
            landing_sequence,
            order_number,
            technology_number,
            quantity,
            founder,
            layers_number,
            splitFrame_time,
            create_time
        )
        select
            ogd.order_id,
            ogd.production_id,
            #{processId},
            #{landingSequence},
            ogd.order_number,
            ogd.technology_number,
            #{quantity},
            #{userName},
            #{layer},
            NOW(),
            NOW()
        insert into flow_card (order_id,
                               production_id,
                               process_id,
                               landing_sequence,
                               order_number,
                               technology_number,
                               quantity,
                               founder,
                               layers_number,
                               splitFrame_time,
                               create_time)
        select ogd.order_id,
               ogd.production_id,
               #{processId},
               #{landingSequence},
               ogd.order_number,
               ogd.technology_number,
               #{quantity},
               #{userName},
               #{layer},
               NOW(),
               NOW()
        from sd.order_glass_detail as ogd
        where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
        where ogd.production_id = #{productionId}
          and ogd.order_number = #{orderNumber}
        GROUP BY ogd.technology_number
    </insert>
<!--    更新分架状态-->
    <!--    更新分架状态-->
    <update id="updateFlowState">
        update sd.order_glass_detail as ogd
        set ogd.splitting_status=1
        where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
        where ogd.production_id = #{productionId}
          and ogd.order_number = #{orderNumber}
    </update>
<!--    查询未分架的条数-->
    <!--    查询未分架的条数-->
    <select id="selectFlowCount">
        select COUNT(*)
        from sd.order_glass_detail as ogd
        where ogd.order_id = left(#{productionId},10)
        where ogd.order_id = left(#{productionId}, 10)
          and ogd.splitting_status = 0
    </select>
<!--   修改订单表分架状态-->
    <!--   修改订单表分架状态-->
    <update id="updateProcessingCard">
        update sd.`order` as o
        set o.processing_card=#{state}
        where o.order_id=left(#{productionId},10)
        where o.order_id = left(#{productionId}, 10)
    </update>
<!--    查询已排版数据-->
    <!--    查询已排版数据-->
    <select id="selectOkSchedulingMp">
        select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
               round(od.width*od.height*od.quantity/1000000,2),
               (od.quantity-IFNULL(ps.scheduling_quantity,0)),
               round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2),
               IFNULL(ps.scheduling_quantity,0),
               round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2),
               od.product_name,od.shape
        from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
                                   left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
        where od.order_id=#{orderId} and ps.processes=#{processes} and ps.scheduling_id IS NOT NULL
        select od.order_id,
               o.customer_name,
               o.project,
               od.order_number,
               od.width,
               od.height,
               od.quantity,
               round(od.width * od.height * od.quantity / 1000000, 2),
               (od.quantity - IFNULL(ps.scheduling_quantity, 0)),
               round(od.width * od.height * (od.quantity - IFNULL(ps.scheduling_quantity, 0)) / 1000000, 2),
               IFNULL(ps.scheduling_quantity, 0),
               round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000, 2),
               od.product_name,
               od.shape
        from sd.order_detail as od
                 left join sd.order as o on od.order_id = o.order_id
                 left join production_scheduling as ps
                           on ps.order_id = od.order_id and ps.order_number = od.order_number
        where od.order_id = #{orderId}
          and ps.processes = #{processes}
          and ps.scheduling_id IS NOT NULL
        order by ps.id desc
    </select>
<!--    查询未排版数据-->
    <!--    查询未排版数据-->
    <select id="selectNoSchedulingMp">
    </select>
<!--    首次查询排版数据-->
    <!--    首次查询排版数据-->
    <select id="selectLastSchedulingMp">
        select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
               round(od.width*od.height*od.quantity/1000000,2) as area,
               (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
               round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
               IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity,
               round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea,
               od.product_name,od.shape
        from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
                                   left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
        select od.order_id,
               o.customer_name,
               o.project,
               od.order_number,
               od.width,
               od.height,
               od.quantity,
               round(od.width * od.height * od.quantity / 1000000, 2)                                       as area,
               (od.quantity - IFNULL(ps.scheduling_quantity, 0))                                            as pendingProductionQuantity,
               round(od.width * od.height * (od.quantity - IFNULL(ps.scheduling_quantity, 0)) / 1000000,
                     2)                                                                                     as pendingProductionArea,
               IFNULL(ps.scheduling_quantity, 0)                                                            as productionScheduledQuantity,
               round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000,
                     2)                                                                                     as productionScheduledArea,
               od.product_name,
               od.shape
        from sd.order_detail as od
                 left join sd.order as o on od.order_id = o.order_id
                 left join production_scheduling as ps
                           on ps.order_id = od.order_id and ps.order_number = od.order_number
        where od.create_time between #{selectTime1} and #{selectTime2}
    </select>
<!--   查询对应序号的层数-->
    <!--   查询对应序号的层数-->
    <select id="selectLayer">
        select COUNT(ogd.order_number)
        from sd.order_glass_detail as ogd
        where ogd.production_id = #{productionId}
          and ogd.order_number=#{orderNumber}
          and ogd.order_number = #{orderNumber}
    </select>
<!--  查询该订单流程卡条数  -->
    <!--  查询该订单流程卡条数  -->
    <select id="selectFlowCardCount">
        select COUNT(*) from flow_card where order_id=#{orderId}
        select COUNT(*)
        from flow_card
        where order_id = #{orderId}
    </select>
    <select id="flowCardDetailMp">
        select fc.order_id,
               fc.process_id,
               fc.order_number,
               fc.quantity,
               round(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area,
               od.product_name,
               fc.founder,
               date(fc.splitFrame_time) as splitFrame_time
        from flow_card as fc
                 left join sd.order_glass_detail as ogd
                           on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and
                              fc.technology_number = ogd.technology_number
                 left join sd.order_detail as od on od.order_id = ogd.order_id and od.order_number = ogd.order_number
        where fc.process_id = #{processId}
        GROUP BY fc.order_id, fc.process_id, fc.order_number
    </select>
    <delete id="deleteReportingWork">
        delete from sd.order_process_detail
        where  left(process_id,11) = left(#{processId},11)
    </delete>
</mapper>
north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml
@@ -91,7 +91,7 @@
               od.quantity,
               round(od.width * od.height * od.quantity / 1000000, 2) as area,
               ps.scheduling_quantity,
               (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity,
               (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as scheduling_quantity,
               round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, 2)
                                                                      as pendingProductionArea,
               IFNULL(ps.scheduling_quantity, 0)                      as productionScheduledQuantity,
@@ -115,62 +115,77 @@
    </select>
    <!--    查询未排产数据-->
    <select id="selectNoSchedulingMp">
        select od.order_id,
        select ogd.order_id,
               o.customer_name,
               o.project,
               od.order_number,
               od.width,
               od.height,
               ogd.order_number,
               ogd.technology_number,
               ogd.child_width,
               ogd.child_height,
               od.quantity,
               round(od.width * od.height * od.quantity / 1000000, 2) as area,
               (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity,
               round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, 2)
                                                                      as pendingProductionArea,
               IFNULL(ps.scheduling_quantity, 0)                      as productionScheduledQuantity,
               round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000,
               round(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as area,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as scheduling_quantity,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as pendingProductionQuantity,
               round(ogd.child_width * ogd.child_height * (od.quantity - IFNULL((ps.schedulingQuantity), 0)) / 1000000, 2)
                                                                                    as pendingProductionArea,
               IFNULL(ps.schedulingQuantity, 0)                      as productionScheduledQuantity,
               round(ogd.child_width * ogd.child_height * (IFNULL(ps.schedulingQuantity, 0)) / 1000000,
                     2)                                               as productionScheduledArea,
               od.product_name,
               ogd.glass_child,
               od.shape
        from sd.order_detail as od
                 left join sd.order as o on od.order_id = o.order_id
                 left join production_scheduling as ps
                           on ps.order_id = od.order_id and ps.order_number = od.order_number
        where (od.quantity - IFNULL((ps.scheduling_quantity), 0)) > 0
          and od.create_time between #{selectTime1} and #{selectTime2}
        from sd.order_glass_detail as ogd
          and position(#{orderId} in ps.order_id)
          and position(#{processes} in ps.processes)
                 left join sd.order as o on ogd.order_id = o.order_id
                 left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number
                 left join sd.order_process_detail as opd on opd.order_id=ogd.order_id and opd.order_number=ogd.order_number and opd.technology_number=ogd.technology_number
                 left join
             (select order_id,order_number,technology_number,SUM(scheduling_quantity) as schedulingQuantity from production_scheduling where processes=#{processes} group by order_id,order_number,technology_number) as ps on ps.order_id = ogd.order_id and ps.order_number = ogd.order_number and ps.technology_number=ogd.technology_number
        group by od.order_id, od.order_number
        order by ps.id desc
        where (od.quantity - IFNULL((ps.schedulingQuantity), 0)) > 0
          and od.create_time between #{selectTime1} and #{selectTime2} and opd.reporting_work_num_count=0
          and position(#{orderId} in ogd.order_id)
--           and position("切割" in ps.processes)
        group by ogd.order_id, ogd.order_number,ogd.technology_number
        order by ogd.order_id desc
    </select>
    <!--    首次查询排产数据-->
    <select id="selectLastSchedulingMp">
        select od.order_id,
        select ogd.order_id,
               o.customer_name,
               o.project,
               od.order_number,
               od.width,
               od.height,
               ogd.order_number,
               ogd.technology_number,
               ogd.child_width,
               ogd.child_height,
               od.quantity,
               round(od.width * od.height * od.quantity / 1000000, 2) as area,
               (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity,
               round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000,
                     2)                                               as pendingProductionArea,
               IFNULL(sum(ps.scheduling_quantity), 0)                 as productionScheduledQuantity,
               round(od.width * od.height * (IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000,
               round(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as area,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as scheduling_quantity,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as pendingProductionQuantity,
               round(ogd.child_width * ogd.child_height * (od.quantity - IFNULL((ps.schedulingQuantity), 0)) / 1000000, 2)
                                                                                    as pendingProductionArea,
               IFNULL(ps.schedulingQuantity, 0)                      as productionScheduledQuantity,
               round(ogd.child_width * ogd.child_height * (IFNULL(ps.schedulingQuantity, 0)) / 1000000,
                     2)                                               as productionScheduledArea,
               od.product_name,
               ogd.glass_child,
               od.shape
        from sd.order_detail as od
                 left join sd.order as o on od.order_id = o.order_id
                 left join production_scheduling as ps
                           on ps.order_id = od.order_id and ps.order_number = od.order_number
        where od.create_time between #{selectTime1} and #{selectTime2}
          and (od.quantity - IFNULL((ps.scheduling_quantity), 0)) > 0
        from sd.order_glass_detail as ogd
        group by od.order_id, od.order_number
        order by ps.id desc
                 left join sd.order as o on ogd.order_id = o.order_id
                 left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number
                 left join sd.order_process_detail as opd on opd.order_id=ogd.order_id and opd.order_number=ogd.order_number and opd.technology_number=ogd.technology_number
                 left join
             (select order_id,order_number,technology_number,SUM(scheduling_quantity) as schedulingQuantity from production_scheduling where processes=#{processes} group by order_id,order_number,technology_number) as ps on ps.order_id = ogd.order_id and ps.order_number = ogd.order_number and ps.technology_number=ogd.technology_number
        where (od.quantity - IFNULL((ps.schedulingQuantity), 0)) > 0
          and od.create_time between #{selectTime1} and #{selectTime2} and opd.reporting_work_num_count=0
          and position(#{orderId} in ogd.order_id)
--           and position("切割" in ps.processes)
        group by ogd.order_id, ogd.order_number,ogd.technology_number
        order by ogd.order_id desc
    </select>
    <select id="selectMaxId">
@@ -183,6 +198,7 @@
        insert into production_scheduling(scheduling_id,
                                          order_id,
                                          order_number,
                                          technology_number,
                                          processes,
                                          scheduling_quantity,
                                          scheduled_start_time,
@@ -192,6 +208,7 @@
        VALUES (#{schedulingId},
                #{orderId},
                #{orderNumber},
                #{technologyNumber},
                #{processes},
                #{schedulingQuantity},
                #{scheduledStartTime},
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -11,10 +11,22 @@
        <result property="thisProcess" column="this_process"/>
        <result property="reviewedState" column="reviewed_state"/>
        <result property="previousProcessQuantity" column="previous_process_quantity"/>
        <result property="reportingWorkTime" column="reporting_work_time"/>
        <result property="thisCompletedQuantity" column="this_completed_quantity"/>
        <result property="thisWornQuantity" column="this_worn_quantity"/>
        <result property="deviceName" column="device_name"/>
        <result property="teamsGroupsName" column="teams_groups_name"/>
        <result property="reviewedState" column="reviewed_state"/>
        <result property="reportingWorkId" column="reporting_work_id"/>
        <result property="processId" column="process_id"/>
        <result property="completedArea" column="completedArea"/>
        <result property="wornArea" column="wornArea"/>
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result property="customerId" column="customer_id"/>
            <result property="customerName" column="customer_name"/>
            <result property="project" column="project"/>
            <result property="batch" column="batch"/>
        </association>
        <association property="flowCard" javaType="com.example.erp.entity.pp.FlowCard">
            <result property="orderId" column="order_id"/>
@@ -22,6 +34,9 @@
        </association>
        <association property="reportingWorkDetail" javaType="com.example.erp.entity.pp.ReportingWorkDetail">
            <result property="completedQuantity" column="completed_quantity"/>
        </association>
        <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail">
            <result property="area" column="area"/>
        </association>
    </resultMap>
@@ -88,8 +103,10 @@
            ogd.child_height,
            od.shape,
            fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity,
            odpd.reporting_work_num_count as completed,
            odpd.broken_num as onceBroken
            fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as completedQuantity,
            odpd.reporting_work_num as completed,
            odpd.broken_num as onceBroken,
            if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交
        FROM
            sd.order_detail AS od
        LEFT JOIN sd.order_glass_detail AS ogd
@@ -131,9 +148,11 @@
            ogd.child_height,
            od.shape,
            odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity,
            odpd.reporting_work_num_count as completed,
            odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as completedQuantity,
            odpd.reporting_work_num as completed,
            odpd.broken_num as onceBroken,
            ogd.`group`
            ogd.`group`,
            if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交
        FROM
@@ -307,4 +326,234 @@
          and a.order_number = #{orderNumber}
          and a.technology_number = #{technologyNumber}
    </select>
<!--查询修改报工明细数据-->
    <select id="selectByReportingWorkId" >
        select
            a.reporting_work_id,
            d.order_number,
            d.glass_child,
            d.technology_number,
            d.glass_address,
            c.quantity as quantity_card,
            d.child_width,
            d.child_height,
            e.shape,
            a.completed_quantity+a.breakage_quantity as 'quantity', -- 可报工数
            a.completed_quantity as 'completedQuantity', -- 完工数
            a.breakage_quantity as 'breakageQuantity', -- 破损数
            f.completed_quantity as thisQuantitySum ,-- 本工序完工和
            if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag,
            <if test="nextProcess != null and nextProcess != ''">  -- 非最后一道工序
                ifnull(g.completed_quantity,0) as nextQuantitySum,  -- 后工序已完成
                if((f.completed_quantity
                    -ifnull(g.completed_quantity,0))
                    &gt;=
                   a.completed_quantity,
                    0,
                   (a.completed_quantity-f.completed_quantity
                       +ifnull(g.completed_quantity,0))
                    )  as minQuantity -- 修改最小数
            </if>
            <if test="nextProcess == null or nextProcess == ''">  -- 最后一道工序
#               c.received_quantity, -- 已入库数量
#               c.inventory_quantity, --   库存数量
              if(ifnull(inventory_quantity,0)
                 -ifnull(c.received_quantity,0)
                 &gt;= a.completed_quantity,0,
                (a.completed_quantity-(ifnull(c.inventory_quantity,0)
                    -ifnull(c.received_quantity,0)))
                )
                as minQuantity -- 修改最小数
            </if>
            -- e.thisQuantitySum
        from
            reporting_work_detail as a
            left join reporting_work as b
                on  a.reporting_work_id = b.reporting_work_id
            left join  flow_card as c
                on c.process_id = b.process_id
                and c.technology_number = a.technology_number
            left join  sd.order_glass_detail as d
                on d.order_id = c.order_id
                and c.order_number = d.order_number
                and d.technology_number = c.technology_number
            left join sd.order_detail as e
                on e.order_id = d.order_id and e.order_number = d.order_number
            left join (select sum(completed_quantity) as completed_quantity ,
                              rw.process_id,
                              rwd.order_number,
                              rwd.technology_number,
                              rw.this_process
                       from reporting_work as rw
                       left join  reporting_work_detail  as rwd
                       on rw.reporting_work_id = rwd.reporting_work_id
                       group by rw.process_id,
                                rw.this_process,
                                rwd.order_number,
                                rwd.technology_number
                       ) as f
            on f.process_id = b.process_id
            and f.this_process = b.this_process
            and f.order_number = a.order_number
            and f.technology_number = a.technology_number
        <if test="nextProcess != null and nextProcess != ''">
            left join (select ifnull(sum(completed_quantity),0) as completed_quantity ,
                            rw.process_id,
                            rwd.order_number,
                            rwd.technology_number,
                            rw.this_process
                           from reporting_work as rw
                           left join  reporting_work_detail  as rwd
                           on rw.reporting_work_id = rwd.reporting_work_id
                           group by rw.process_id,
                                    rw.this_process,
                                    rwd.order_number,
                                    rwd.technology_number
                    ) as g
                  on g.process_id = b.process_id
                  and g.this_process = b.next_process
                  and g.order_number = a.order_number
                  and g.technology_number = a.technology_number
        </if>
        where a.reporting_work_id = #{reportingWorkId}
    </select>
<select id="selectReportingWorkMp" resultMap="reportingWorkMap">
        select rw.reporting_work_id,
               (rw.reporting_work_time) as reporting_work_time,
               o.order_id,
               rw.process_id,
               o.project,
               o.batch,
               rw.this_process,
               rw.this_completed_quantity,
               (ogd.area * rw.this_completed_quantity) as completedArea,
               rw.this_worn_quantity,
               (ogd.area * rw.this_worn_quantity)      as wornArea,
               rw.device_name,
               rw.teams_groups_name,
               rw.reviewed_state
        # (IF(rw.reviewed_state = 0, '未审核', IF(rw.reviewed_state = 1, '审核通过', '审核不通过'))) as reviewed_state
        from sd.order as o
                 left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id
                 left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id
                 left join reporting_work_detail as rwd
                           on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and
                              rwd.technology_number = ogd.technology_number
        where rw.reviewed_state != 2
          and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id)
          and rw.reviewed_state!=-1
        <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''">
            and rw.reporting_work_id regexp #{reportingWork.reportingWorkId}
        </if>
        <if test="reportingWork.orderId != null and reportingWork.orderId != ''">
            and o.order_id regexp #{reportingWork.orderId}
        </if>
        <if test="reportingWork.processId != null and reportingWork.processId != ''">
            and rw.process_id regexp #{reportingWork.processId}
        </if>
        <if test="reportingWork.order.project != null and reportingWork.order.project != ''">
            and o.project regexp #{reportingWork.order.project}
        </if>
        <if test="reportingWork.order.batch != null and reportingWork.order.batch != ''">
            and o.batch regexp #{reportingWork.order.batch}
        </if>
        <if test="reportingWork.thisProcess != null and reportingWork.thisProcess != ''">
            and rw.this_process regexp #{reportingWork.thisProcess}
        </if>
        GROUP BY rw.reporting_work_id
        ORDER BY rw.reporting_work_id desc
        limit #{offset},#{pageSize};
    </select>
    <select id="getPageTotal">
        select CEILING(count(rw.reporting_work_id)/#{pageSize}) as 'pageTotal',
               count(distinct rw.reporting_work_id) as 'total'
             from sd.order as o
                 left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id
                 left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id
                 left join reporting_work_detail as rwd
                           on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and
                              rwd.technology_number = ogd.technology_number
        where rw.reviewed_state != 2
          and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id)
          and rw.reviewed_state!=-1
        ORDER BY rw.reporting_work_id desc
        limit #{offset},#{pageSize};
    </select>
<!--    根据报工编号查询下工序-->
    <select id="selectNextProcess">
        select next_process from reporting_work where reporting_work_id=#{reportingWorkId}
    </select>
<!--    查询下工序是否报工-->
    <select id="selectCountByProcessId">
        select count(reporting_work_id) from reporting_work where this_process=#{nextProcess} and process_id=#{processId}
    </select>
<!--    查询完工次破数量-->
    <select id="reportingWorkDate">
        select rw.process_id,
               rwd.order_number,
               rwd.technology_number,
               rwd.completed_quantity,
               IFNULL(SUM(dd.breakage_quantity), 0) as breakage_quantity
        from reporting_work as rw
                 left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id
                 left join damage_details as dd
                           on dd.reporting_work_id = rwd.reporting_work_id and dd.order_number = rwd.order_number and
                              dd.technology_number = rwd.technology_number
        where rw.reporting_work_id = #{reportingWorkId}
        GROUP BY rwd.order_number, rwd.technology_number
    </select>
<!--    修改报工流程卡表数据-->
    <update id="updateWorkProcess">
        update sd.order_process_detail
        set reporting_work_num_count=reporting_work_num_count - #{completedQuantity},
            reporting_work_num=reporting_work_num - #{completedQuantity},
            broken_num=broken_num - #{breakageQuantity}
        where process_id = #{processId}
          and order_number = #{orderNumber}
          and technology_number = #{technologyNumber}
          and process = #{thisProcess}
    </update>
<!--    删除报工-->
    <update id="deleteWork">
        update reporting_work set reviewed_state=-1
        where reporting_work_id = #{reportingWorkId}
    </update>
<!--    获取最后一道工序-->
    <select id="selectLastProcess">
        select process
        from sd.order_process_detail
        where process_id = #{processId}
          and order_number = 1
          and technology_number = 1
        order by id desc
        LIMIT 1
    </select>
<!--    查询可入库、已入库数量-->
    <select id="selectReceiptQuantity">
        select ifnull(SUM(quantity),0)                     as quantity,
               ifnull(SUM(inventory_quantity), 0) as inventoryQuantity,
               ifnull(SUM(received_quantity), 0) as receivedQuantity
        from flow_card
        where process_id = #{processId}
          and technology_number = 1
        GROUP BY process_id
    </select>
<!--    查询报工编号完工数量-->
    <select id="selectCompletedQuantity">
        select ifnull(this_completed_quantity,0) from reporting_work where reporting_work_id=#{reportingWorkId}
    </select>
<!--    更新流程卡可入库数量-->
    <update id="updateInventoryQuantity">
        update flow_card
        set inventory_quantity = inventory_quantity - #{completedQuantity}
        where process_id = #{processId}
          and order_number = #{orderNumber}
          and technology_number = #{technologyNumber}
    </update>
</mapper>
north-glass-erp/src/main/resources/mapper/pp/ReportingWorkDetail.xml
@@ -154,6 +154,7 @@
    </select>
    <!--查询detail明细-->
    <select id="reportingWorkId">
        select * from reporting_work_detail
north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetail.xml
@@ -26,5 +26,47 @@
    </insert>
    <update id="updateQuantity">
        update sd.order_process_detail as a
        inner join
        (select
             rwd.completed_quantity,
             rwd.breakage_quantity,
             rw.process_id,
             rwd.order_number,
             rwd.technology_number
              from pp.reporting_work_detail as rwd
            left join pp.reporting_work as rw
                on rwd.reporting_work_id =  rw.reporting_work_id
            where rwd.reporting_work_id =#{reportingWorkId} )  as b
        on a.process_id = b.process_id
        and a.order_number = b.order_number
        and a.technology_number = b.technology_number
        <if test="type == 'delete'">
            set a.reporting_work_num_count
                = a.reporting_work_num_count-b.completed_quantity,
            a.reporting_work_num
                = a.reporting_work_num-b.completed_quantity,
            a.broken_num
                = a.broken_num-b.breakage_quantity
        </if>
        <if test="type == 'add'">
            set a.reporting_work_num_count
            = a.reporting_work_num_count+b.completed_quantity,
            a.reporting_work_num
            = a.reporting_work_num+b.completed_quantity,
            a.broken_num
            = a.broken_num+b.breakage_quantity
        </if>
        where a.process = #{process}
    </update>
</mapper>
north-glass-erp/target/classes/mapper/pp/FolwCard.xml
@@ -62,25 +62,25 @@
        a.founder,
        c.processing_note,
        if(a.layout_status=0,"不可排版",if(a.layout_status=1,"可排版","已排版")) as layout_status
        from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id
        from (select  id,order_id,process_id,order_number, quantity,founder,layout_status,create_time from flow_card group by process_Id,order_number) as a left join sd.`order` as b on a.order_Id=b.order_id
        left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
        where a.create_time between #{selectTime1} and #{selectTime2}
                    <if test="flowCard.orderId != null and flowCard.orderId != ''">
                        and a.order_id regexp #{flowCard.orderId}
                    </if>
                    <if test="flowCard.processId != null and flowCard.processId != ''">
                        and a.process_Id regexp #{flowCard.processId}
                    </if>
                    <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
                        and c.product_id regexp #{flowCard.orderDetail.productId}
                    </if>
                    <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">
                        and c.product_name regexp #{flowCard.orderDetail.productName}
                    </if>
        <if test="flowCard.orderId != null and flowCard.orderId != ''">
            and a.order_id regexp #{flowCard.orderId}
        </if>
        <if test="flowCard.processId != null and flowCard.processId != ''">
            and a.process_Id regexp #{flowCard.processId}
        </if>
        <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
            and c.product_id regexp #{flowCard.orderDetail.productId}
        </if>
        <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">
            and c.product_name regexp #{flowCard.orderDetail.productName}
        </if>
                    <if test="flowCard.order.project != null and flowCard.order.project!= ''">
                        and b.project regexp #{flowCard.order.project}
                    </if>
        <if test="flowCard.order.project != null and flowCard.order.project!= ''">
            and b.project regexp #{flowCard.order.project}
        </if>
        group by a.process_Id
@@ -131,7 +131,8 @@
        o.delivery_address
        from sd.`order` as o
        left join sd.order_glass_detail ogd on o.order_id = ogd.order_id
        where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and #{selectTime2}
        where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and
        #{selectTime2}
        <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''">
            and o.order_id regexp #{flowCard.order.orderId}
@@ -165,7 +166,7 @@
        ;
    </select>
<!--    分架明细查询-->
    <!--    分架明细查询-->
    <select id="detailsSelectMp" resultMap="flowCardMap">
        select od.order_id,
        ogd.production_id,
@@ -174,7 +175,7 @@
        SUM( od.quantity) as quantity,
        SUM(od.compute_gross_area) as compute_gross_area,
        od.perimeter
        from  sd.order_detail as od left join
        from sd.order_detail as od left join
        (select order_id,order_number,production_id,splitting_status from sd.order_glass_detail
        GROUP BY order_id,order_number
        ) as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number
@@ -199,43 +200,47 @@
    <update id="updateDeleteState">
        update
            sd.order_glass_detail as ogd left join flow_card as fc
                on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number
                on ogd.order_id = fc.order_id and ogd.order_number = fc.order_number
        set ogd.splitting_status=0
        where ogd.order_id=#{orderId}  and fc.process_id=#{processId}
        where ogd.order_id = #{orderId}
          and fc.process_id = #{processId}
    </update>
    <!--    删除流程卡-->
    <update id="deleteFlowCardMp">
        delete from flow_card as fc where fc.process_id=#{processId}
        delete
        from flow_card as fc
        where fc.production_id = left(#{processId},11)
    </update>
    <!--    分架新增明细查询-->
    <!--resultMap="flowCardMap"-->
    <select id="selectNoCardMp" >
    <select id="selectNoCardMp">
        select
        od.order_number,
        od.order_number AS 'orderNumber',
        od.width,
        od.height,
        od.shape,
        od.quantity,
        od.compute_gross_area,
        p.total_thickness,
        od.quantity as baiscQuantity,
        od.compute_gross_area as 'computeGrossArea',
        p.total_thickness AS 'totalThickness',
        p.thickness,
        od.weight
        from
        sd.order_detail as od
        left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number
        left join sd.product as p on od.product_name=p.product_name
        where od.order_id=#{orderId} and ogd.production_id=#{productionId} and ogd.splitting_status=0
        select od.order_number,
               od.order_number       AS 'orderNumber',
               od.width,
               od.height,
               od.shape,
               od.quantity,
               od.compute_gross_area,
               p.total_thickness,
               od.quantity           as baiscQuantity,
               od.compute_gross_area as 'computeGrossArea',
               p.total_thickness     AS 'totalThickness',
               p.thickness,
               od.weight
        from sd.order_detail as od
                 left join sd.order_glass_detail as ogd
                           on od.order_id = ogd.order_id and od.order_number = ogd.order_number
                 left join sd.product as p on od.product_name = p.product_name
        where od.order_id = #{orderId}
          and ogd.production_id = #{productionId}
          and ogd.splitting_status = 0
        GROUP BY od.order_number
        order by od.id desc
        order by od.id
    </select>
@@ -246,7 +251,7 @@
        where fc.process_id = #{processId}
    </update>
<!--    查询对应流程卡号排版状态-->
    <!--    查询对应流程卡号排版状态-->
    <select id="selectLayoutStatus">
        select fc.layout_status
        from flow_card as fc
@@ -254,109 +259,153 @@
        LIMIT 1
    </select>
<!--    查询报工表内是否有对应流程卡-->
    <!--    查询报工表内是否有对应流程卡-->
    <select id="reportingWorkCount">
        select COUNT(rw.process_id)
        from reporting_work as rw
        where rw.process_id = #{processId}
    </select>
<!--    插入Flow_card表-->
    <!--    插入Flow_card表-->
    <insert id="addFlowCardMp">
        insert into
            flow_card (
            order_id,
            production_id,
            process_id,
            landing_sequence,
            order_number,
            technology_number,
            quantity,
            founder,
            layers_number,
            splitFrame_time,
            create_time
        )
        select
            ogd.order_id,
            ogd.production_id,
            #{processId},
            #{landingSequence},
            ogd.order_number,
            ogd.technology_number,
            #{quantity},
            #{userName},
            #{layer},
            NOW(),
            NOW()
        insert into flow_card (order_id,
                               production_id,
                               process_id,
                               landing_sequence,
                               order_number,
                               technology_number,
                               quantity,
                               founder,
                               layers_number,
                               splitFrame_time,
                               create_time)
        select ogd.order_id,
               ogd.production_id,
               #{processId},
               #{landingSequence},
               ogd.order_number,
               ogd.technology_number,
               #{quantity},
               #{userName},
               #{layer},
               NOW(),
               NOW()
        from sd.order_glass_detail as ogd
        where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
        where ogd.production_id = #{productionId}
          and ogd.order_number = #{orderNumber}
        GROUP BY ogd.technology_number
    </insert>
<!--    更新分架状态-->
    <!--    更新分架状态-->
    <update id="updateFlowState">
        update sd.order_glass_detail as ogd
        set ogd.splitting_status=1
        where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
        where ogd.production_id = #{productionId}
          and ogd.order_number = #{orderNumber}
    </update>
<!--    查询未分架的条数-->
    <!--    查询未分架的条数-->
    <select id="selectFlowCount">
        select COUNT(*)
        from sd.order_glass_detail as ogd
        where ogd.order_id = left(#{productionId},10)
        where ogd.order_id = left(#{productionId}, 10)
          and ogd.splitting_status = 0
    </select>
<!--   修改订单表分架状态-->
    <!--   修改订单表分架状态-->
    <update id="updateProcessingCard">
        update sd.`order` as o
        set o.processing_card=#{state}
        where o.order_id=left(#{productionId},10)
        where o.order_id = left(#{productionId}, 10)
    </update>
<!--    查询已排版数据-->
    <!--    查询已排版数据-->
    <select id="selectOkSchedulingMp">
        select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
               round(od.width*od.height*od.quantity/1000000,2),
               (od.quantity-IFNULL(ps.scheduling_quantity,0)),
               round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2),
               IFNULL(ps.scheduling_quantity,0),
               round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2),
               od.product_name,od.shape
        from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
                                   left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
        where od.order_id=#{orderId} and ps.processes=#{processes} and ps.scheduling_id IS NOT NULL
        select od.order_id,
               o.customer_name,
               o.project,
               od.order_number,
               od.width,
               od.height,
               od.quantity,
               round(od.width * od.height * od.quantity / 1000000, 2),
               (od.quantity - IFNULL(ps.scheduling_quantity, 0)),
               round(od.width * od.height * (od.quantity - IFNULL(ps.scheduling_quantity, 0)) / 1000000, 2),
               IFNULL(ps.scheduling_quantity, 0),
               round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000, 2),
               od.product_name,
               od.shape
        from sd.order_detail as od
                 left join sd.order as o on od.order_id = o.order_id
                 left join production_scheduling as ps
                           on ps.order_id = od.order_id and ps.order_number = od.order_number
        where od.order_id = #{orderId}
          and ps.processes = #{processes}
          and ps.scheduling_id IS NOT NULL
        order by ps.id desc
    </select>
<!--    查询未排版数据-->
    <!--    查询未排版数据-->
    <select id="selectNoSchedulingMp">
    </select>
<!--    首次查询排版数据-->
    <!--    首次查询排版数据-->
    <select id="selectLastSchedulingMp">
        select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
               round(od.width*od.height*od.quantity/1000000,2) as area,
               (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
               round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
               IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity,
               round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea,
               od.product_name,od.shape
        from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
                                   left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
        select od.order_id,
               o.customer_name,
               o.project,
               od.order_number,
               od.width,
               od.height,
               od.quantity,
               round(od.width * od.height * od.quantity / 1000000, 2)                                       as area,
               (od.quantity - IFNULL(ps.scheduling_quantity, 0))                                            as pendingProductionQuantity,
               round(od.width * od.height * (od.quantity - IFNULL(ps.scheduling_quantity, 0)) / 1000000,
                     2)                                                                                     as pendingProductionArea,
               IFNULL(ps.scheduling_quantity, 0)                                                            as productionScheduledQuantity,
               round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000,
                     2)                                                                                     as productionScheduledArea,
               od.product_name,
               od.shape
        from sd.order_detail as od
                 left join sd.order as o on od.order_id = o.order_id
                 left join production_scheduling as ps
                           on ps.order_id = od.order_id and ps.order_number = od.order_number
        where od.create_time between #{selectTime1} and #{selectTime2}
    </select>
<!--   查询对应序号的层数-->
    <!--   查询对应序号的层数-->
    <select id="selectLayer">
        select COUNT(ogd.order_number)
        from sd.order_glass_detail as ogd
        where ogd.production_id = #{productionId}
          and ogd.order_number=#{orderNumber}
          and ogd.order_number = #{orderNumber}
    </select>
<!--  查询该订单流程卡条数  -->
    <!--  查询该订单流程卡条数  -->
    <select id="selectFlowCardCount">
        select COUNT(*) from flow_card where order_id=#{orderId}
        select COUNT(*)
        from flow_card
        where order_id = #{orderId}
    </select>
    <select id="flowCardDetailMp">
        select fc.order_id,
               fc.process_id,
               fc.order_number,
               fc.quantity,
               round(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area,
               od.product_name,
               fc.founder,
               date(fc.splitFrame_time) as splitFrame_time
        from flow_card as fc
                 left join sd.order_glass_detail as ogd
                           on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and
                              fc.technology_number = ogd.technology_number
                 left join sd.order_detail as od on od.order_id = ogd.order_id and od.order_number = ogd.order_number
        where fc.process_id = #{processId}
        GROUP BY fc.order_id, fc.process_id, fc.order_number
    </select>
    <delete id="deleteReportingWork">
        delete from sd.order_process_detail
        where  left(process_id,11) = left(#{processId},11)
    </delete>
</mapper>
north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml
@@ -91,7 +91,7 @@
               od.quantity,
               round(od.width * od.height * od.quantity / 1000000, 2) as area,
               ps.scheduling_quantity,
               (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity,
               (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as scheduling_quantity,
               round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, 2)
                                                                      as pendingProductionArea,
               IFNULL(ps.scheduling_quantity, 0)                      as productionScheduledQuantity,
@@ -115,62 +115,77 @@
    </select>
    <!--    查询未排产数据-->
    <select id="selectNoSchedulingMp">
        select od.order_id,
        select ogd.order_id,
               o.customer_name,
               o.project,
               od.order_number,
               od.width,
               od.height,
               ogd.order_number,
               ogd.technology_number,
               ogd.child_width,
               ogd.child_height,
               od.quantity,
               round(od.width * od.height * od.quantity / 1000000, 2) as area,
               (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity,
               round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, 2)
                                                                      as pendingProductionArea,
               IFNULL(ps.scheduling_quantity, 0)                      as productionScheduledQuantity,
               round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000,
               round(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as area,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as scheduling_quantity,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as pendingProductionQuantity,
               round(ogd.child_width * ogd.child_height * (od.quantity - IFNULL((ps.schedulingQuantity), 0)) / 1000000, 2)
                                                                                    as pendingProductionArea,
               IFNULL(ps.schedulingQuantity, 0)                      as productionScheduledQuantity,
               round(ogd.child_width * ogd.child_height * (IFNULL(ps.schedulingQuantity, 0)) / 1000000,
                     2)                                               as productionScheduledArea,
               od.product_name,
               ogd.glass_child,
               od.shape
        from sd.order_detail as od
                 left join sd.order as o on od.order_id = o.order_id
                 left join production_scheduling as ps
                           on ps.order_id = od.order_id and ps.order_number = od.order_number
        where (od.quantity - IFNULL((ps.scheduling_quantity), 0)) > 0
          and od.create_time between #{selectTime1} and #{selectTime2}
        from sd.order_glass_detail as ogd
          and position(#{orderId} in ps.order_id)
          and position(#{processes} in ps.processes)
                 left join sd.order as o on ogd.order_id = o.order_id
                 left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number
                 left join sd.order_process_detail as opd on opd.order_id=ogd.order_id and opd.order_number=ogd.order_number and opd.technology_number=ogd.technology_number
                 left join
             (select order_id,order_number,technology_number,SUM(scheduling_quantity) as schedulingQuantity from production_scheduling where processes=#{processes} group by order_id,order_number,technology_number) as ps on ps.order_id = ogd.order_id and ps.order_number = ogd.order_number and ps.technology_number=ogd.technology_number
        group by od.order_id, od.order_number
        order by ps.id desc
        where (od.quantity - IFNULL((ps.schedulingQuantity), 0)) > 0
          and od.create_time between #{selectTime1} and #{selectTime2} and opd.reporting_work_num_count=0
          and position(#{orderId} in ogd.order_id)
--           and position("切割" in ps.processes)
        group by ogd.order_id, ogd.order_number,ogd.technology_number
        order by ogd.order_id desc
    </select>
    <!--    首次查询排产数据-->
    <select id="selectLastSchedulingMp">
        select od.order_id,
        select ogd.order_id,
               o.customer_name,
               o.project,
               od.order_number,
               od.width,
               od.height,
               ogd.order_number,
               ogd.technology_number,
               ogd.child_width,
               ogd.child_height,
               od.quantity,
               round(od.width * od.height * od.quantity / 1000000, 2) as area,
               (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity,
               round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000,
                     2)                                               as pendingProductionArea,
               IFNULL(sum(ps.scheduling_quantity), 0)                 as productionScheduledQuantity,
               round(od.width * od.height * (IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000,
               round(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as area,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as scheduling_quantity,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as pendingProductionQuantity,
               round(ogd.child_width * ogd.child_height * (od.quantity - IFNULL((ps.schedulingQuantity), 0)) / 1000000, 2)
                                                                                    as pendingProductionArea,
               IFNULL(ps.schedulingQuantity, 0)                      as productionScheduledQuantity,
               round(ogd.child_width * ogd.child_height * (IFNULL(ps.schedulingQuantity, 0)) / 1000000,
                     2)                                               as productionScheduledArea,
               od.product_name,
               ogd.glass_child,
               od.shape
        from sd.order_detail as od
                 left join sd.order as o on od.order_id = o.order_id
                 left join production_scheduling as ps
                           on ps.order_id = od.order_id and ps.order_number = od.order_number
        where od.create_time between #{selectTime1} and #{selectTime2}
          and (od.quantity - IFNULL((ps.scheduling_quantity), 0)) > 0
        from sd.order_glass_detail as ogd
        group by od.order_id, od.order_number
        order by ps.id desc
                 left join sd.order as o on ogd.order_id = o.order_id
                 left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number
                 left join sd.order_process_detail as opd on opd.order_id=ogd.order_id and opd.order_number=ogd.order_number and opd.technology_number=ogd.technology_number
                 left join
             (select order_id,order_number,technology_number,SUM(scheduling_quantity) as schedulingQuantity from production_scheduling where processes=#{processes} group by order_id,order_number,technology_number) as ps on ps.order_id = ogd.order_id and ps.order_number = ogd.order_number and ps.technology_number=ogd.technology_number
        where (od.quantity - IFNULL((ps.schedulingQuantity), 0)) > 0
          and od.create_time between #{selectTime1} and #{selectTime2} and opd.reporting_work_num_count=0
          and position(#{orderId} in ogd.order_id)
--           and position("切割" in ps.processes)
        group by ogd.order_id, ogd.order_number,ogd.technology_number
        order by ogd.order_id desc
    </select>
    <select id="selectMaxId">
@@ -183,6 +198,7 @@
        insert into production_scheduling(scheduling_id,
                                          order_id,
                                          order_number,
                                          technology_number,
                                          processes,
                                          scheduling_quantity,
                                          scheduled_start_time,
@@ -192,6 +208,7 @@
        VALUES (#{schedulingId},
                #{orderId},
                #{orderNumber},
                #{technologyNumber},
                #{processes},
                #{schedulingQuantity},
                #{scheduledStartTime},
north-glass-erp/target/classes/mapper/pp/ReportingWork.xml
@@ -11,10 +11,22 @@
        <result property="thisProcess" column="this_process"/>
        <result property="reviewedState" column="reviewed_state"/>
        <result property="previousProcessQuantity" column="previous_process_quantity"/>
        <result property="reportingWorkTime" column="reporting_work_time"/>
        <result property="thisCompletedQuantity" column="this_completed_quantity"/>
        <result property="thisWornQuantity" column="this_worn_quantity"/>
        <result property="deviceName" column="device_name"/>
        <result property="teamsGroupsName" column="teams_groups_name"/>
        <result property="reviewedState" column="reviewed_state"/>
        <result property="reportingWorkId" column="reporting_work_id"/>
        <result property="processId" column="process_id"/>
        <result property="completedArea" column="completedArea"/>
        <result property="wornArea" column="wornArea"/>
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result property="customerId" column="customer_id"/>
            <result property="customerName" column="customer_name"/>
            <result property="project" column="project"/>
            <result property="batch" column="batch"/>
        </association>
        <association property="flowCard" javaType="com.example.erp.entity.pp.FlowCard">
            <result property="orderId" column="order_id"/>
@@ -22,6 +34,9 @@
        </association>
        <association property="reportingWorkDetail" javaType="com.example.erp.entity.pp.ReportingWorkDetail">
            <result property="completedQuantity" column="completed_quantity"/>
        </association>
        <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail">
            <result property="area" column="area"/>
        </association>
    </resultMap>
@@ -88,8 +103,10 @@
            ogd.child_height,
            od.shape,
            fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity,
            odpd.reporting_work_num_count as completed,
            odpd.broken_num as onceBroken
            fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as completedQuantity,
            odpd.reporting_work_num as completed,
            odpd.broken_num as onceBroken,
            if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交
        FROM
            sd.order_detail AS od
        LEFT JOIN sd.order_glass_detail AS ogd
@@ -131,9 +148,11 @@
            ogd.child_height,
            od.shape,
            odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity,
            odpd.reporting_work_num_count as completed,
            odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as completedQuantity,
            odpd.reporting_work_num as completed,
            odpd.broken_num as onceBroken,
            ogd.`group`
            ogd.`group`,
            if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交
        FROM
@@ -307,4 +326,234 @@
          and a.order_number = #{orderNumber}
          and a.technology_number = #{technologyNumber}
    </select>
<!--查询修改报工明细数据-->
    <select id="selectByReportingWorkId" >
        select
            a.reporting_work_id,
            d.order_number,
            d.glass_child,
            d.technology_number,
            d.glass_address,
            c.quantity as quantity_card,
            d.child_width,
            d.child_height,
            e.shape,
            a.completed_quantity+a.breakage_quantity as 'quantity', -- 可报工数
            a.completed_quantity as 'completedQuantity', -- 完工数
            a.breakage_quantity as 'breakageQuantity', -- 破损数
            f.completed_quantity as thisQuantitySum ,-- 本工序完工和
            if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag,
            <if test="nextProcess != null and nextProcess != ''">  -- 非最后一道工序
                ifnull(g.completed_quantity,0) as nextQuantitySum,  -- 后工序已完成
                if((f.completed_quantity
                    -ifnull(g.completed_quantity,0))
                    &gt;=
                   a.completed_quantity,
                    0,
                   (a.completed_quantity-f.completed_quantity
                       +ifnull(g.completed_quantity,0))
                    )  as minQuantity -- 修改最小数
            </if>
            <if test="nextProcess == null or nextProcess == ''">  -- 最后一道工序
#               c.received_quantity, -- 已入库数量
#               c.inventory_quantity, --   库存数量
              if(ifnull(inventory_quantity,0)
                 -ifnull(c.received_quantity,0)
                 &gt;= a.completed_quantity,0,
                (a.completed_quantity-(ifnull(c.inventory_quantity,0)
                    -ifnull(c.received_quantity,0)))
                )
                as minQuantity -- 修改最小数
            </if>
            -- e.thisQuantitySum
        from
            reporting_work_detail as a
            left join reporting_work as b
                on  a.reporting_work_id = b.reporting_work_id
            left join  flow_card as c
                on c.process_id = b.process_id
                and c.technology_number = a.technology_number
            left join  sd.order_glass_detail as d
                on d.order_id = c.order_id
                and c.order_number = d.order_number
                and d.technology_number = c.technology_number
            left join sd.order_detail as e
                on e.order_id = d.order_id and e.order_number = d.order_number
            left join (select sum(completed_quantity) as completed_quantity ,
                              rw.process_id,
                              rwd.order_number,
                              rwd.technology_number,
                              rw.this_process
                       from reporting_work as rw
                       left join  reporting_work_detail  as rwd
                       on rw.reporting_work_id = rwd.reporting_work_id
                       group by rw.process_id,
                                rw.this_process,
                                rwd.order_number,
                                rwd.technology_number
                       ) as f
            on f.process_id = b.process_id
            and f.this_process = b.this_process
            and f.order_number = a.order_number
            and f.technology_number = a.technology_number
        <if test="nextProcess != null and nextProcess != ''">
            left join (select ifnull(sum(completed_quantity),0) as completed_quantity ,
                            rw.process_id,
                            rwd.order_number,
                            rwd.technology_number,
                            rw.this_process
                           from reporting_work as rw
                           left join  reporting_work_detail  as rwd
                           on rw.reporting_work_id = rwd.reporting_work_id
                           group by rw.process_id,
                                    rw.this_process,
                                    rwd.order_number,
                                    rwd.technology_number
                    ) as g
                  on g.process_id = b.process_id
                  and g.this_process = b.next_process
                  and g.order_number = a.order_number
                  and g.technology_number = a.technology_number
        </if>
        where a.reporting_work_id = #{reportingWorkId}
    </select>
<select id="selectReportingWorkMp" resultMap="reportingWorkMap">
        select rw.reporting_work_id,
               (rw.reporting_work_time) as reporting_work_time,
               o.order_id,
               rw.process_id,
               o.project,
               o.batch,
               rw.this_process,
               rw.this_completed_quantity,
               (ogd.area * rw.this_completed_quantity) as completedArea,
               rw.this_worn_quantity,
               (ogd.area * rw.this_worn_quantity)      as wornArea,
               rw.device_name,
               rw.teams_groups_name,
               rw.reviewed_state
        # (IF(rw.reviewed_state = 0, '未审核', IF(rw.reviewed_state = 1, '审核通过', '审核不通过'))) as reviewed_state
        from sd.order as o
                 left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id
                 left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id
                 left join reporting_work_detail as rwd
                           on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and
                              rwd.technology_number = ogd.technology_number
        where rw.reviewed_state != 2
          and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id)
          and rw.reviewed_state!=-1
        <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''">
            and rw.reporting_work_id regexp #{reportingWork.reportingWorkId}
        </if>
        <if test="reportingWork.orderId != null and reportingWork.orderId != ''">
            and o.order_id regexp #{reportingWork.orderId}
        </if>
        <if test="reportingWork.processId != null and reportingWork.processId != ''">
            and rw.process_id regexp #{reportingWork.processId}
        </if>
        <if test="reportingWork.order.project != null and reportingWork.order.project != ''">
            and o.project regexp #{reportingWork.order.project}
        </if>
        <if test="reportingWork.order.batch != null and reportingWork.order.batch != ''">
            and o.batch regexp #{reportingWork.order.batch}
        </if>
        <if test="reportingWork.thisProcess != null and reportingWork.thisProcess != ''">
            and rw.this_process regexp #{reportingWork.thisProcess}
        </if>
        GROUP BY rw.reporting_work_id
        ORDER BY rw.reporting_work_id desc
        limit #{offset},#{pageSize};
    </select>
    <select id="getPageTotal">
        select CEILING(count(rw.reporting_work_id)/#{pageSize}) as 'pageTotal',
               count(distinct rw.reporting_work_id) as 'total'
             from sd.order as o
                 left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id
                 left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id
                 left join reporting_work_detail as rwd
                           on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and
                              rwd.technology_number = ogd.technology_number
        where rw.reviewed_state != 2
          and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id)
          and rw.reviewed_state!=-1
        ORDER BY rw.reporting_work_id desc
        limit #{offset},#{pageSize};
    </select>
<!--    根据报工编号查询下工序-->
    <select id="selectNextProcess">
        select next_process from reporting_work where reporting_work_id=#{reportingWorkId}
    </select>
<!--    查询下工序是否报工-->
    <select id="selectCountByProcessId">
        select count(reporting_work_id) from reporting_work where this_process=#{nextProcess} and process_id=#{processId}
    </select>
<!--    查询完工次破数量-->
    <select id="reportingWorkDate">
        select rw.process_id,
               rwd.order_number,
               rwd.technology_number,
               rwd.completed_quantity,
               IFNULL(SUM(dd.breakage_quantity), 0) as breakage_quantity
        from reporting_work as rw
                 left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id
                 left join damage_details as dd
                           on dd.reporting_work_id = rwd.reporting_work_id and dd.order_number = rwd.order_number and
                              dd.technology_number = rwd.technology_number
        where rw.reporting_work_id = #{reportingWorkId}
        GROUP BY rwd.order_number, rwd.technology_number
    </select>
<!--    修改报工流程卡表数据-->
    <update id="updateWorkProcess">
        update sd.order_process_detail
        set reporting_work_num_count=reporting_work_num_count - #{completedQuantity},
            reporting_work_num=reporting_work_num - #{completedQuantity},
            broken_num=broken_num - #{breakageQuantity}
        where process_id = #{processId}
          and order_number = #{orderNumber}
          and technology_number = #{technologyNumber}
          and process = #{thisProcess}
    </update>
<!--    删除报工-->
    <update id="deleteWork">
        update reporting_work set reviewed_state=-1
        where reporting_work_id = #{reportingWorkId}
    </update>
<!--    获取最后一道工序-->
    <select id="selectLastProcess">
        select process
        from sd.order_process_detail
        where process_id = #{processId}
          and order_number = 1
          and technology_number = 1
        order by id desc
        LIMIT 1
    </select>
<!--    查询可入库、已入库数量-->
    <select id="selectReceiptQuantity">
        select ifnull(SUM(quantity),0)                     as quantity,
               ifnull(SUM(inventory_quantity), 0) as inventoryQuantity,
               ifnull(SUM(received_quantity), 0) as receivedQuantity
        from flow_card
        where process_id = #{processId}
          and technology_number = 1
        GROUP BY process_id
    </select>
<!--    查询报工编号完工数量-->
    <select id="selectCompletedQuantity">
        select ifnull(this_completed_quantity,0) from reporting_work where reporting_work_id=#{reportingWorkId}
    </select>
<!--    更新流程卡可入库数量-->
    <update id="updateInventoryQuantity">
        update flow_card
        set inventory_quantity = inventory_quantity - #{completedQuantity}
        where process_id = #{processId}
          and order_number = #{orderNumber}
          and technology_number = #{technologyNumber}
    </update>
</mapper>
north-glass-erp/target/classes/mapper/pp/ReportingWorkDetail.xml
@@ -154,6 +154,7 @@
    </select>
    <!--查询detail明细-->
    <select id="reportingWorkId">
        select * from reporting_work_detail
north-glass-erp/target/classes/mapper/sd/OrderProcessDetail.xml
@@ -26,5 +26,47 @@
    </insert>
    <update id="updateQuantity">
        update sd.order_process_detail as a
        inner join
        (select
             rwd.completed_quantity,
             rwd.breakage_quantity,
             rw.process_id,
             rwd.order_number,
             rwd.technology_number
              from pp.reporting_work_detail as rwd
            left join pp.reporting_work as rw
                on rwd.reporting_work_id =  rw.reporting_work_id
            where rwd.reporting_work_id =#{reportingWorkId} )  as b
        on a.process_id = b.process_id
        and a.order_number = b.order_number
        and a.technology_number = b.technology_number
        <if test="type == 'delete'">
            set a.reporting_work_num_count
                = a.reporting_work_num_count-b.completed_quantity,
            a.reporting_work_num
                = a.reporting_work_num-b.completed_quantity,
            a.broken_num
                = a.broken_num-b.breakage_quantity
        </if>
        <if test="type == 'add'">
            set a.reporting_work_num_count
            = a.reporting_work_num_count+b.completed_quantity,
            a.reporting_work_num
            = a.reporting_work_num+b.completed_quantity,
            a.broken_num
            = a.broken_num+b.breakage_quantity
        </if>
        where a.process = #{process}
    </update>
</mapper>