From 1c13bd7a2cd2c8ba69a185da69344c8b59f4e561 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期四, 04 七月 2024 09:29:15 +0800
Subject: [PATCH] 选中求和功能以及还原双击回车才能点击单元格

---
 north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue |  514 +++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 334 insertions(+), 180 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 42bf27f..b520c74 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,9 +9,14 @@
 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 {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove";
+import {useI18n} from 'vue-i18n'
+import footSum from "@/hook/footSum"
+//璇█鑾峰彇
+const {t} = useI18n()
 
 let router = useRouter()
 const userStore = useUserInfoStore()
@@ -24,46 +29,26 @@
       break
     }
 
-    case  'setType': {
-      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鎺掔増鐘舵��')
-      break
-    }
   }
 }
 
+
 //宸ュ簭
-const value = ref('')
-const options = [
-  {
-    value: '鍒囧壊',
-    label: '鍒囧壊',
-  },
-  {
-    value: '纾ㄨ竟',
-    label: '纾ㄨ竟',
-  },
-  {
-    value: '閽㈠寲',
-    label: '閽㈠寲',
-  },
-]
+const processVal = ref('鍒囧壊')
+
 
 //鎺掍骇鐘舵��
 const stateValue = ref('1')
 const stateOptions = [
   {
     value: '2',
-    label: '宸叉帓浜�',
+    label: t('processCard.ProductionSchedulingOk'),
   },
   {
     value: '1',
-    label: '鏈帓浜�',
+    label: t('processCard.ProductionSchedulingNo'),
   },
 ]
-
-function padLeftZero(str) {
-  return ('00' + str).substr(str.length)
-}
 
 //瀹氫箟琛ㄥ崟鍊�
 const form = reactive({
@@ -71,26 +56,12 @@
   orderId: ''
 })
 
+//瀹氫箟鎺ユ敹鍔犺浇琛ㄥご涓嬫媺鏁版嵁
+const titleSelectJson = ref({
+  processType: [],
+})
 
-//琛ㄥ熬姹傚拰
-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: {
@@ -109,16 +80,20 @@
 //瀹氫箟鏁版嵁杩斿洖缁撴灉
 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 * 7)
+  const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 3)
       .toISOString()
       .replace('T', ' ')
-      .slice(0, 10) //榛樿寮�濮嬫椂闂�7澶╁墠
+      .slice(0, 10) //榛樿寮�濮嬫椂闂�3澶╁墠
   const end = new Date(new Date().getTime() + 3600 * 1000 * 24)
       .toISOString()
       .replace('T', ' ')
@@ -126,20 +101,33 @@
   return [start, end]
 }
 
-//绗竴娆″姞杞借幏鍙栬繎涓冨ぉ鏃堕棿鍜岄粯璁ょ姸鎬�
+onMounted(() => {
+  //鍚敤琛ㄦ牸鎷栧姩閫変腑
+  addListener(xGrid.value, gridOptions)
+})
+
+//绗竴娆″姞杞借幏鍙栬繎3澶╂椂闂村拰榛樿鐘舵��
 form.date1 = getNowTime()
 let startTime = form.date1[0]
 let endTime = form.date1[1]
+let selectProcesses = processVal.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))
-    xGrid.value.reloadData(produceList)
+    titleSelectJson.value.processType = res.data.process
+
     gridOptions.loading = false
-    //绂佺敤鍒犻櫎銆佷繚瀛樻寜閽�
+    //绂佺敤鍒犻櫎銆佸鏍告寜閽�
     gridOptions.toolbarConfig.buttons[0].disabled = true
     gridOptions.toolbarConfig.buttons[1].disabled = true
   } else {
@@ -149,7 +137,9 @@
 
 //鐐瑰嚮鏃舵煡璇�
 const getWorkOrder = () => {
-  let selectProcesses = value.value
+  let startTime = form.date1[0]
+  let endTime = form.date1[1]
+  let selectProcesses = processVal.value
   let selectState = stateValue.value
   let inputVal = form.orderId
   if (inputVal == '') {
@@ -158,77 +148,93 @@
   if (selectProcesses == '') {
     selectProcesses = null
   }
-  if (inputVal == null && selectState == 1) {
-    //鏍规嵁鏃堕棿鏌ヨ鏈帓浜ф暟鎹�
-    request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}`, filterData.value).then((res) => {
-
-      if (res.code == 200) {
-        pageTotal.value = res.data.total
-        xGrid.value.loadData(res.data.data)
-        gridOptions.loading = false
-        //绂佺敤鍒犻櫎銆佷繚瀛樻寜閽�
+  //鏍规嵁宸ュ簭鏌ヨ鏈帓浜ф暟鎹�
+  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
-      } 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
-      } 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[2].disabled = false
+      }else{
+        //鍚敤鍒犻櫎銆佸鏍告寜閽�
         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 = form.date1[0]
+  let endTime = form.date1[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)
+    }
+  })
+}
 
+/*鍚庣杩斿洖缁撴灉澶氬眰宓屽灞曠ず*/
+const hasDecimal = (value) => {
+  const regex = /\./; // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐�
+  return regex.test(value); // 杩斿洖true/false
 }
 
 
 //瀛愮粍浠舵帴鏀跺弬鏁�
 const xGrid = ref()
 const gridOptions = reactive({
+  loading: true,
   border: "full",//琛ㄦ牸鍔犺竟妗�
   keepSource: true,//淇濇寔婧愭暟鎹�
   align: 'center',//鏂囧瓧灞呬腑
@@ -255,57 +261,125 @@
     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: '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'}},
-      title: '璁″垝寮�濮嬫椂闂�'
+      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: '璁″垝缁撴潫鏃堕棿'
+      title: t('processCard.planEndTime')
     },
     // {field: '鎺掍骇缂栧彿', title: '鎺掍骇缂栧彿',  width: 120 },
-    {field: 'order_id', title: '閿�鍞崟鍙�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 100},
-    {field: 'customer_name', title: '瀹㈡埛鍚嶇О', width: 110, filters: [{data: ''}], slots: {filter: 'num1_filter'}},
-    {field: 'project', title: '椤圭洰鍚嶇О', width: 100, filters: [{data: ''}], slots: {filter: 'num1_filter'}},
-    {field: 'order_number', title: '搴忓彿', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 70},
-
-    {field: 'width', title: '瀹�', width: 60},
-    {field: 'height', title: '楂�', width: 60},
-    {field: 'quantity', title: '璁㈠崟鏁伴噺', width: 70},
-    {field: 'area', title: '璁㈠崟闈㈢Н', width: 90},
     {
-      field: 'scheduling_quantity',
+      field: 'orderGlassDetail.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: 'schedulingQuantity',
       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: 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: 'notes', title: t('processCard.notes'), editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120},
+    {field: 'schedulingId', 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,
@@ -315,26 +389,26 @@
   },
   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 ''
+      })
+    ]
+  }
 
 })
 
-//鍒犻櫎
-
-
+//琛ㄦ牸鎸夐挳
 const gridEvents = {
   async toolbarButtonClick({code}) {
     const $grid = xGrid.value
@@ -349,16 +423,16 @@
               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("璇峰~鍏ュ搴旂殑鍊煎啀杩涜淇濆瓨")
                 return;
               }
             }
-            let selectProcesses = value.value
+            let selectProcesses = processVal.value
             if (selectProcesses == null || selectProcesses == "") {
               ElMessage.warning("璇烽�夋嫨鎺掍骇宸ュ簭")
               return;
@@ -369,12 +443,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)
 
               }
@@ -399,7 +482,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();
@@ -424,7 +507,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();
@@ -440,15 +523,67 @@
       }
     }
   },
+  menuClick({menu, row, column}) {
+    const $grid = xGrid.value
+    if ($grid) {
+      switch (menu.code) {
+        case 'copyChecked' : {
+          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 && 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 'clearChecked' : {
+          let result = toolbarButtonClickEvent()
+          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
+        }
+      }
+    }
+  },
 }
 
 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
@@ -457,8 +592,6 @@
 
   })
 }
-
-
 
 
 </script>
@@ -478,14 +611,14 @@
 
         />
         &nbsp;&nbsp;
-        <el-input v-model="form.orderId" placeholder="閿�鍞崟鍙�" clearable 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" class="m-2" placeholder="宸ュ簭" clearable style="width: 90px;">
+        <el-select v-model="processVal" clearable default-value="default_city" style="width: 120px">
           <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
+              v-for="item in titleSelectJson['processType']"
+              :key="item.id"
+              :label="item.basic_name"
+              :value="item.basic_name"
           />
         </el-select>
         &nbsp;
@@ -501,7 +634,7 @@
         <el-button
             id="select"
             :icon="Search"
-            type="primary" @click="getWorkOrder">鏌ヨ
+            type="primary" @click="getWorkOrder">{{ $t('basicData.search') }}
         </el-button>
       </el-row>
 
@@ -509,8 +642,8 @@
     <vxe-grid
         ref="xGrid"
         class="mytable-scrollbar"
+        height="500px"
         max-height="100%"
-        height="100%"
         v-bind="gridOptions"
         v-on="gridEvents"
         @filter-change="filterChanged"
@@ -535,10 +668,23 @@
           </div>
         </div>
       </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>
   </div>
+
 </template>
 
 <style scoped>
@@ -552,4 +698,12 @@
   height: 6%;
   text-align: center;
 }
+
+.vxe-grid {
+  /* 绂佺敤娴忚鍣ㄩ粯璁ら�変腑 */
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.8.0