From 25cc86fd8a2fb3b2bb6b385cba0adaf89ff3dcdc Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期四, 18 十二月 2025 16:39:32 +0800
Subject: [PATCH] 流程卡进度打印部分代码

---
 north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue |  685 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 374 insertions(+), 311 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
index 3c8ba1d..443bbc8 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
@@ -9,18 +9,22 @@
 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 BasicTable from '@/components/sd/product/BasicTable.vue'
 import {VXETable} from "vxe-table";
 import useUserInfoStore from "@/stores/userInfo";
-import {changeFilterEvent, filterChanged} from "@/hook"
-import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove";
-import { useI18n } from 'vue-i18n'
+import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove";
+import {useI18n} from 'vue-i18n'
+import footSum from "@/hook/footSum"
+import useOrderInfoStore from "@/stores/sd/order/orderInfo"
+
 //璇█鑾峰彇
-const { t } = useI18n()
+const {t} = useI18n()
 
 let router = useRouter()
 const userStore = useUserInfoStore()
 const username = userStore.user.userName
+const orderInfo = useOrderInfoStore()
+
 const getTableRow = (row, type) => {
   switch (type) {
     case 'edit' : {
@@ -29,16 +33,12 @@
       break
     }
 
-    case  'setType': {
-      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鎺掔増鐘舵��')
-      break
-    }
   }
 }
 
 
 //宸ュ簭
-const value = ref('鍒囧壊')
+const processVal = ref(t('machine.cutting'))
 
 
 //鎺掍骇鐘舵��
@@ -54,10 +54,6 @@
   },
 ]
 
-function padLeftZero(str) {
-  return ('00' + str).substr(str.length)
-}
-
 //瀹氫箟琛ㄥ崟鍊�
 const form = reactive({
   date1: '',
@@ -70,25 +66,6 @@
 })
 
 
-//琛ㄥ熬姹傚拰
-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: {
@@ -107,33 +84,39 @@
 //瀹氫箟鏁版嵁杩斿洖缁撴灉
 let produceList = ref([])
 //瀹氫箟褰撳墠椤垫暟
-let pageNum = $ref(1)
+let pageNum = ref(1)
 let pageState = null
-
+let total = reactive({
+  pageTotal: 0,
+  dataTotal: 0,
+  pageSize: 100
+})
 
 //鑾峰彇涓冨ぉ鍓嶅埌褰撳墠鏃堕棿
 function getNowTime() {
-  const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 3)
+  const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 15)
       .toISOString()
       .replace('T', ' ')
       .slice(0, 10) //榛樿寮�濮嬫椂闂�3澶╁墠
-  const end = new Date(new Date().getTime() + 3600 * 1000 * 24)
+  const end = new Date(new Date().getTime())
       .toISOString()
       .replace('T', ' ')
       .slice(0, 10)//榛樿缁撴潫鏃堕棿褰撳墠鏃堕棿
   return [start, end]
 }
 
-onMounted(()=>{
+onMounted(() => {
   //鍚敤琛ㄦ牸鎷栧姩閫変腑
-  addListener(xGrid.value,gridOptions)
+  addListener(xGrid.value, gridOptions)
 })
 
 //绗竴娆″姞杞借幏鍙栬繎3澶╂椂闂村拰榛樿鐘舵��
-form.date1 = getNowTime()
-let startTime = form.date1[0]
-let endTime = form.date1[1]
-let selectProcesses = value.value
+if (orderInfo.workOrderDate[0]=="" && orderInfo.workOrderDate[1]==""){
+  orderInfo.workOrderDate=getNowTime()
+}
+let startTime = orderInfo.workOrderDate[0]
+let endTime = orderInfo.workOrderDate[1]
+let selectProcesses = processVal.value
 let inputVal = form.orderId
 if (inputVal == '') {
   inputVal = null
@@ -148,11 +131,12 @@
     pageTotal.value = res.data.total
     produceList = produceList.value.concat(deepClone(res.data.data))
     titleSelectJson.value.processType = res.data.process
-    xGrid.value.reloadData(produceList)
+
     gridOptions.loading = false
-    //绂佺敤鍒犻櫎銆佷繚瀛樻寜閽�
+    //绂佺敤鍒犻櫎銆佸鏍告寜閽�
     gridOptions.toolbarConfig.buttons[0].disabled = true
     gridOptions.toolbarConfig.buttons[1].disabled = true
+    gridOptions.toolbarConfig.buttons[2].disabled = true
   } else {
     ElMessage.warning(res.msg)
   }
@@ -160,9 +144,9 @@
 
 //鐐瑰嚮鏃舵煡璇�
 const getWorkOrder = () => {
-  let startTime = form.date1[0]
-  let endTime = form.date1[1]
-  let selectProcesses = value.value
+  let startTime = orderInfo.workOrderDate[0]
+  let endTime = orderInfo.workOrderDate[1]
+  let selectProcesses = processVal.value
   let selectState = stateValue.value
   let inputVal = form.orderId
   if (inputVal == '') {
@@ -171,74 +155,82 @@
   if (selectProcesses == '') {
     selectProcesses = null
   }
-  if (inputVal == null && selectState == 1) {
-    //鏍规嵁鏃堕棿鏌ヨ鏈帓浜ф暟鎹�
-    request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}/${selectProcesses}/${inputVal}`, filterData.value).then((res) => {
+  //鏍规嵁宸ュ簭鏌ヨ鏈帓浜ф暟鎹�
+  request.post(`/productionScheduling/selectScheduling/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, 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
+      if (selectState==1){
+        //绂佺敤鍒犻櫎銆佸鏍告寜閽�
+        gridOptions.toolbarConfig.buttons[0].disabled = true
+        gridOptions.toolbarConfig.buttons[1].disabled = true
+        gridOptions.toolbarConfig.buttons[2].disabled = true
+        //鍚敤淇濆瓨
+        gridOptions.toolbarConfig.buttons[3].disabled = false
+      }else{
+        //鍚敤鍒犻櫎銆佸鏍告寜閽�
+        gridOptions.toolbarConfig.buttons[0].disabled = false
+        gridOptions.toolbarConfig.buttons[1].disabled = false
+        gridOptions.toolbarConfig.buttons[2].disabled = false
+        //绂佺敤淇濆瓨
+        gridOptions.toolbarConfig.buttons[3].disabled = true
 
-      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
-        //鍚敤淇濆瓨
-        gridOptions.toolbarConfig.buttons[2].disabled = false
-      } else {
-        ElMessage.warning(res.msg)
       }
-    })
-  } 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
-        //鍚敤淇濆瓨
-        gridOptions.toolbarConfig.buttons[2].disabled = false
-      } else {
-        ElMessage.warning(res.msg)
-      }
-    })
-  } else if (inputVal == null && selectState == 2) {
-    //鏍规嵁鏃堕棿鏌ヨ宸叉帓浜ф暟鎹�
-    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
-        //绂佺敤淇濆瓨
-        gridOptions.toolbarConfig.buttons[2].disabled = true
-      } else {
-        ElMessage.warning(res.msg)
-      }
-    })
-  } else if (inputVal != null && selectState == 2) {
-    //鏍规嵁璁㈠崟鍙锋煡璇㈠凡鎺掍骇鏁版嵁
-    request.post(`/productionScheduling/selectSchedulingNot/${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
-        //绂佺敤淇濆瓨
-        gridOptions.toolbarConfig.buttons[2].disabled = true
-      } else {
-        ElMessage.warning(res.msg)
-      }
-    })
+    } else {
+      ElMessage.warning(res.msg)
+    }
+  })
+
+
+}
+
+/*浣跨敤绛涢�夛紝鍚庣鑾峰彇鏁版嵁*/
+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 = orderInfo.workOrderDate[0]
+  let endTime = orderInfo.workOrderDate[1]
+  let selectProcesses = processVal.value
+  let selectState = stateValue.value
+  let inputVal = form.orderId
+  if (inputVal == '') {
+    inputVal = null
+  }
+  if (selectProcesses == '') {
+    selectProcesses = null
+  }
+  request.post(`/productionScheduling/selectScheduling/1/${total.pageSize}/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
+    if (res.code == 200) {
+      total.dataTotal = res.data.total.total * 1
+      total.pageTotal = parseInt(res.data.total)
+      pageNum.value = 1
+      xGrid.value.loadData(res.data.data)
+      gridOptions.loading = false
+    } else {
+      ElMessage.warning(res.msg)
+    }
+  })
 }
 
 /*鍚庣杩斿洖缁撴灉澶氬眰宓屽灞曠ず*/
@@ -251,12 +243,13 @@
 //瀛愮粍浠舵帴鏀跺弬鏁�
 const xGrid = ref()
 const gridOptions = reactive({
+  loading: true,
   border: "full",//琛ㄦ牸鍔犺竟妗�
   keepSource: true,//淇濇寔婧愭暟鎹�
   align: 'center',//鏂囧瓧灞呬腑
   stripe: true,//鏂戦┈绾�
   rowConfig: {isCurrent: true, isHover: true, height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
-  id: 'CustomerList',
+  id: 'productionScheduling',
   showFooter: true,//鏄剧ず鑴�
   printConfig: {},
   importConfig: {},
@@ -268,14 +261,13 @@
     useKey: true
   },
   filterConfig: {   //绛涢�夐厤缃」
-                    // remote: true
+    remote: true
   },
   customConfig: {
     storage: true
   },
-
-    editConfig: {
-    trigger: 'click',
+  editConfig: {
+    trigger: 'dblclick',
     mode: 'row',
     showStatus: true
   },
@@ -283,112 +275,122 @@
     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 },
+          {
+            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: t('basicData.check'), width: 80},
+    {type: 'expand',fixed: "left",  slots: {content: 'content'}, width: 50},
     {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50},
+    {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80},
     {
-      field: 'scheduled_start_time',
-      width: 120,
-      editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}},
+      field: 'scheduledStartTime',
+      width: 130,
+      editRender: {name: 'input', attrs: {placeholder: '', type: 'date'},},
       title: t('processCard.scheduledStartTime')
     },
     {
-      field: 'plan_end_time',
-      width: 120,
+      field: 'planEndTime',
+      width: 130,
       editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}},
       title: t('processCard.planEndTime')
     },
-    // {field: '鎺掍骇缂栧彿', title: '鎺掍骇缂栧彿',  width: 120 },
     {
-      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',
+      field: 'schedulingQuantity',
       width: 120,
       editRender: {name: 'input', attrs: {placeholder: ''}},
       title: t('processCard.productionSchedulingQuantity'),
       sortable: true
     },
-    {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},
+
+    // {field: '鎺掍骇缂栧彿', title: '鎺掍骇缂栧彿',  width: 120 },
+    {
+      field: 'order.orderId',
+      title: t('order.orderId'),
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      width: 110,
+    },
+    {
+      field: 'order.customerName',
+      title: t('processCard.customerName'),
+      width: 110,
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+    },
+    {
+      field: 'order.project',
+      title: t('order.project'),
+      width: 100,
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+    },
+    {
+      field: 'orderNumber',
+      title: t('order.OrderNum'),
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      width: 100,
+    },
+    {
+      field: 'technologyNumber',
+      title: t('processCard.technologyNumber'),
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      width: 100,
+    },
+    {
+      field: 'orderGlassDetail.childWidth',
+      title: t('order.width'),
+      width: 60,
+    },
+    {
+      field: 'orderGlassDetail.childHeight',
+      title: t('order.height'),
+      width: 60,
+    },
+    {field: 'orderDetail.quantity', title: t('processCard.orderQuantity'), width: 90},
+    {field: 'orderGlassDetail.area', title: t('processCard.orderArea'), width: 90},
+
+    {field: 'pendingProductionQuantity', title: t('processCard.quantityToScheduled'), width: 100},
+    {field: 'pendingProductionArea', title: t('processCard.areaToScheduled'), width: 100},
+    {field: 'productionScheduledQuantity', title: t('processCard.plannedProductionQuantity'), width: 100},
+    {field: 'productionScheduledArea', title: t('processCard.plannedProductionArea'), width: 100},
+    {field: 'reviewStatus', title: t('processCard.reviewedState'), width: 80},
+    {field: 'reviewer', title: t('processCard.reviewed'), width: 80},
+    {field: 'orderDetail.productName', title: t('order.product'), width: 140},
+    {field: 'orderDetail.shape', title: t('order.shape'), width: 80},
+    {field: 'schedulingId', title: t('processCard.schedulingId'), width: 120},
   ],//琛ㄥご鎸夐挳
 
   toolbarConfig: {
     buttons: [
       {code: 'delete', name: t('basicData.delete'), status: 'primary'},
       {code: 'review', name: t('basicData.review'), status: 'primary'},
+      {code: 'cancelReview', name: t('basicData.cancelReview'), status: 'primary'},
       {code: 'save', name: t('processCard.scheduling'), status: 'primary', icon: 'vxe-icon-save'},
     ],
     import: false,
@@ -399,20 +401,22 @@
   },
   data: [],//table body瀹為檯鏁版嵁
   //鑴氶儴姹傚拰
-  // footerMethod({columns, data}) {//椤佃剼鍑芥暟
-  //   let footList = ['鏁伴噺', '闈㈢Н', '鎺掍骇鏁伴噺', '宸叉帓浜ф暟閲�', '宸叉帓浜ч潰绉�', '鏈帓浜ф暟閲�', '鏈帓浜ч潰绉�']
-  //   return [
-  //     columns.map((column, columnIndex) => {
-  //       if (columnIndex === 0) {
-  //         return '鍚堣:'
-  //       }
-  //       if (footList.includes(column.field)) {
-  //         return sumNum(data, column.field)
-  //       }
-  //       return ''
-  //     })
-  //   ]
-  // }
+  footerMethod({columns, data}) {//椤佃剼鍑芥暟
+    return [
+      columns.map((column, columnIndex) => {
+        if (columnIndex === 0) {
+          return t('basicData.total')
+        }
+        const List =
+            ["orderDetail.quantity", 'orderGlassDetail.area', 'pendingProductionQuantity',
+              'pendingProductionArea', 'productionScheduledQuantity', 'productionScheduledArea']
+        if (List.includes(column.field)) {
+          return footSum(data, column.field)
+        }
+        return ''
+      })
+    ]
+  }
 
 })
 
@@ -427,22 +431,22 @@
           if ($table) {
             const selectRecords = $table.getCheckboxRecords()
             if (selectRecords.length == 0) {
-              ElMessage.warning("璇峰嬀閫夋帓浜ф暟鎹�")
+              ElMessage.warning(t('processCard.checkProductionScheduling'))
               return;
             }
             for (let i = 0; i < selectRecords.length; i++) {
-              let start = selectRecords[i].scheduled_start_time
-              let end = selectRecords[i].plan_end_time
-              let number = selectRecords[i].scheduling_quantity
+              let start = selectRecords[i].scheduledStartTime
+              let end = selectRecords[i].planEndTime
+              let number = selectRecords[i].schedulingQuantity
               //璁″垝寮�濮嬨�佺粨鏉熸椂闂达紝鎺掍骇鏁伴噺涓嶈兘涓虹┖
               if (start == null || end == null || number == null) {
-                ElMessage.warning("璇峰~鍏ュ搴旂殑鍊煎啀杩涜淇濆瓨")
+                ElMessage.warning(t('processCard.saveCorrespondingValues'))
                 return;
               }
             }
-            let selectProcesses = value.value
+            let selectProcesses = processVal.value
             if (selectProcesses == null || selectProcesses == "") {
-              ElMessage.warning("璇烽�夋嫨鎺掍骇宸ュ簭")
+              ElMessage.warning(t('processCard.selectProductionSchedulingProcess'))
               return;
             }
 
@@ -456,12 +460,12 @@
             //淇濆瓨鎺掍骇鏁版嵁
             request.post("/productionScheduling/addScheduling", schedulingData.value).then((res) => {
               if (res.code == 200) {
-                ElMessage.success("淇濆瓨鎴愬姛")
+                ElMessage.success(t('basicData.msg.saveSuccess'))
                 // 鍚敤淇濆瓨
                 gridOptions.toolbarConfig.buttons[2].disabled = false
                 router.push({
                   path: '/main/processCard/ProductionScheduling',
-                  query: { random: Math.random()}
+                  query: {random: Math.random()}
                 })
               } else {
                 // 鍚敤淇濆瓨
@@ -481,10 +485,11 @@
           const selectRecords = $table.getCheckboxRecords()
           if ($table) {
             if (selectRecords.length == 0) {
-              ElMessage.warning("璇峰嬀閫夋帓浜ф暟鎹�")
+              ElMessage.warning(t('processCard.checkProductionScheduling'))
               return;
             }
-            const type = await VXETable.modal.confirm('鎮ㄧ‘瀹氳鍒犻櫎璇ユ暟鎹�?')
+
+            const type = await VXETable.modal.confirm(t('processCard.deleteThisData'))
             if (type === 'confirm') {
               let schedulingData = ref({
                 scheduling: selectRecords,
@@ -492,7 +497,7 @@
 
               request.post("/productionScheduling/deleteScheduling", schedulingData.value).then((res) => {
                 if (res.code == 200) {
-                  ElMessage.success("鍒犻櫎鎴愬姛")
+                  ElMessage.success(t('basicData.msg.deleteSuccess'))
                   location.reload();
                 } else {
                   ElMessage.warning(res.msg)
@@ -506,9 +511,13 @@
         case 'review': {
           const $table = xGrid.value
           const selectRecords = $table.getCheckboxRecords()
+          let date = form.date1
+          let selectProcesses = processVal.value
+          let selectState = stateValue.value
+          let inputVal = form.orderId
           if ($table) {
             if (selectRecords.length == 0) {
-              ElMessage.warning("璇峰嬀閫夋帓浜ф暟鎹�")
+              ElMessage.warning(t('processCard.checkProductionScheduling'))
               return;
             }
             let schedulingData = ref({
@@ -517,7 +526,35 @@
             })
             request.post("/productionScheduling/examineScheduling", schedulingData.value).then((res) => {
               if (res.code == 200) {
-                ElMessage.success("瀹℃牳鎴愬姛")
+                ElMessage.success(t('basicData.msg.ReviewSuccess'))
+                router.push({
+                  path: '/main/processCard/ProductionScheduling',
+                  query: {random: Math.random()}
+                })
+              } else {
+                ElMessage.warning(res.msg)
+
+              }
+            })
+
+          }
+          return;
+        }
+        case 'cancelReview': {
+          const $table = xGrid.value
+          const selectRecords = $table.getCheckboxRecords()
+          if ($table) {
+            if (selectRecords.length == 0) {
+              ElMessage.warning(t('processCard.checkProductionScheduling'))
+              return;
+            }
+            let schedulingData = ref({
+              scheduling: selectRecords,
+              userName: username//瀹℃牳浜�
+            })
+            request.post("/productionScheduling/cancelReviewScheduling", schedulingData.value).then((res) => {
+              if (res.code == 200) {
+                ElMessage.success(t('basicData.msg.cancelReviewSuccess'))
                 location.reload();
               } else {
                 ElMessage.warning(res.msg)
@@ -531,45 +568,52 @@
       }
     }
   },
-  menuClick ({ menu, row, column }) {
+  menuClick({menu, row, column}) {
     const $grid = xGrid.value
     if ($grid) {
       switch (menu.code) {
-        case 'copyChecked' :{
+        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
-              }
-            })
+          if (result.cell === "scheduledStartTime" || result.cell === "planEndTime" || result.cell === "schedulingQuantity"){
+            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
+                }
+              })
+            }
+          }
+
+          break
+        }
+        case 'copyAll' : {
+          let result = toolbarButtonClickEvent()
+          if (result.cell === "scheduledStartTime" || result.cell === "planEndTime"|| result.cell === "schedulingQuantity") {
+            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
+                }
+              })
+            }
           }
           break
         }
-        case 'copyAll' :{
+        case 'clearChecked' : {
           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
-              }
-            })
-          }
-          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] = ''
-              }
-            })
+          if (result.cell === "scheduledStartTime" || result.cell === "planEndTime"|| result.cell === "schedulingQuantity") {
+            if (result) {
+              const dataList = xGrid.value.getTableData().visibleData
+              dataList.forEach((item, index) => {
+                if (index >= result.start && index <= result.end) {
+                  item[result.cell] = ''
+                }
+              })
+            }
           }
           break
         }
@@ -583,38 +627,46 @@
   const table = $grid.getTableData().fullData
   const selectRecords = $grid.getCheckboxRecords()
   let selectState = stateValue.value
-  table.forEach((selectRecords) => {
-    if (selectRecords.scheduling_quantity > selectRecords.pendingProductionQuantity && selectState==1) {
-      ElMessage.warning("鎺掍骇鏁伴噺涓嶈兘澶т簬寰呮帓浜ф暟閲�")
+  selectRecords.forEach((selectRecords) => {
+    if (selectRecords.schedulingQuantity > selectRecords.pendingProductionQuantity) {
+      ElMessage.warning(ElMessage.warning(t('processCard.schedulingQuantityNoQuantityScheduled')))
       //绂佺敤淇濆瓨鎸夐挳
       //gridOptions.toolbarConfig.buttons[2].disabled = true
     }
-
-
   })
 }
+const checkBoxConfig = {
+  checkMethod: ({ row }) => {
+    if (row['reviewStatus']==="宸插鏍�"){
+      return row.disable
+    }else{
+      return !row.disable
+    }
 
+  },
+  reserve:true
+
+}
 
 </script>
 
 <template>
-  <div class="main-div-customer">
-    <div id="selectForm">
-      <el-row :gutter="0">
+  <div  style="width: 100%;height: 100%">
+    <div class="head">
         <el-date-picker
-            v-model="form.date1"
+            v-model="orderInfo.workOrderDate"
             :default-time="defaultTime"
-            end-placeholder="缁撴潫鏃堕棿"
+            :start-placeholder="$t('basicData.startDate')"
+            :end-placeholder="$t('basicData.endDate')"
             format="YYYY/MM/DD"
-            start-placeholder="寮�濮嬫椂闂�"
             type="daterange"
             value-format="YYYY-MM-DD"
 
         />
         &nbsp;&nbsp;
-        <el-input v-model="form.orderId" clearable :placeholder="$t('order.orderId')" style="width: 110px"></el-input>
+        <el-input v-model="form.orderId" :placeholder="$t('order.orderId')" clearable style="width: 110px"></el-input>
         &nbsp;
-        <el-select v-model="value" clearable default-value="default_city" style="width: 120px">
+        <el-select v-model="processVal" clearable default-value="default_city" style="width: 120px">
           <el-option
               v-for="item in titleSelectJson['processType']"
               :key="item.id"
@@ -623,7 +675,7 @@
           />
         </el-select>
         &nbsp;
-        <el-select v-model="stateValue" class="m-2" placeholder="鏄惁鎺掍骇" style="width: 120px">
+        <el-select v-model="stateValue" class="m-2" :placeholder="$t('processCard.whetherToScheduleProduction')" style="width: 120px">
           <el-option
               v-for="item in stateOptions"
               :key="item.value"
@@ -635,62 +687,73 @@
         <el-button
             id="select"
             :icon="Search"
-            type="primary" @click="getWorkOrder">{{$t('basicData.search')}}
+            type="primary" @click="getWorkOrder">{{ $t('basicData.search') }}
         </el-button>
-      </el-row>
 
     </div>
-    <vxe-grid
-        ref="xGrid"
-        class="mytable-scrollbar"
-        height="100%"
-        max-height="100%"
-        v-bind="gridOptions"
-        v-on="gridEvents"
-        @filter-change="filterChanged"
-        @checkbox-change="determineNum"
-    >
-      <!--      @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>
+    <div class="main-table">
+      <vxe-grid
+          ref="xGrid"
+          class="mytable-scrollbar"
+          height="100%"
+          v-bind="gridOptions"
+          v-on="gridEvents"
+          @filter-change="filterChanged"
 
-          </li>
-        </ul>
-      </template>
-      <template #num1_filter="{ column, $panel }">
-        <div>
-          <div v-for="(option, index) in column.filters" :key="index">
-            <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/>
+
+      >
+        <!--      :checkbox-config="checkBoxConfig"  @checkbox-change="determineNum"-->
+        <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
+        <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 v-model="option.data" type="type"
+                     @keyup.enter.native="$panel.confirmFilter()"
+                     @input="changeFilterEvent($event, option, $panel)"/>
+            </div>
           </div>
-        </div>
-      </template>
+        </template>
+        <template #pager>
+          <!--浣跨敤 pager 鎻掓Ы-->
+          <!--        'PrevJump','NextJump', -->
+          <vxe-pager
+              v-model:current-page="pageNum"
+              v-model:page-size="total.pageSize"
+              v-model:pager-count="total.pageTotal"
+              :layouts="[  'PrevPage', 'Jump','PageCount', 'NextPage',  'Total']"
+              :total="total.dataTotal"
+              @page-change="handlePageChange"
+          >
+          </vxe-pager>
+        </template>
 
-
-    </vxe-grid>
+      </vxe-grid>
+    </div>
   </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>
-.main-div-customer {
-  width: 99%;
-  height: 100%;
+.head{
+  width: 100%;
+  height: 35px;
 }
 
-#selectForm {
-  width: 70%;
-  height: 6%;
-  text-align: center;
+.main-table{
+  width: 100%;
+  height: calc(100% - 35px);
 }
+
 .vxe-grid {
   /* 绂佺敤娴忚鍣ㄩ粯璁ら�変腑 */
   -webkit-user-select: none;

--
Gitblit v1.8.0