From fcd6de629c4f6b8d9e610da854f15ef40115b058 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期二, 07 五月 2024 17:03:49 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue |  400 +++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 260 insertions(+), 140 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue b/north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue
index 2c01ce5..cb15553 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue
@@ -1,8 +1,25 @@
 <script setup>
 
 import {reactive, ref} from "vue";
-import {useRouter} from  'vue-router'
-let router=useRouter()
+import {useRouter} from 'vue-router'
+import request from "@/utils/request";
+import deepClone from "@/utils/deepClone";
+import {ElDatePicker, ElMessage} from "element-plus";
+import {useI18n} from 'vue-i18n'
+import {changeFilterEvent, filterChanged} from "@/hook"
+//璇█鑾峰彇
+const {t} = useI18n()
+let router = useRouter()
+let filterData = ref({})
+//鎻愪氦鐨勮〃鍗�
+const form = reactive({
+  date1: '',
+  orderId: '',
+  project: ''
+})
+
+//宸ュ簭
+const value = ref('纾ㄨ竟')
 
 //琛ㄥ熬姹傚拰
 const sumNum = (list, field) => {
@@ -13,27 +30,190 @@
   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 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 selectProcesses = value.value
+let inputVal = form.orderId
+if (inputVal == '') {
+  inputVal = null
+}
+let inputProject = form.project
+if (inputProject == '') {
+  inputProject = null
+}
+let total = reactive({
+  pageTotal: 0,
+  dataTotal: 0,
+  pageSize: 100
+})
+//瀹氫箟鎺ユ敹鍔犺浇琛ㄥご涓嬫媺鏁版嵁
+const titleSelectJson = ref({
+  processType: [],
+})
+//绗竴娆″姞杞芥暟鎹�
+request.post(`/report/workInProgress/${startTime}/${endTime}/${inputVal}/${inputProject}/${selectProcesses}`, 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
+    console.log(res.data.data)
+    produceList = produceList.value.concat(deepClone(res.data.data))
+    titleSelectJson.value.processType = res.data.process
+    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(`/report/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 selectProcesses = value.value
+  let inputVal = form.orderId
+  if (inputVal == '') {
+    inputVal = null
+  }
+  let inputProject = form.project
+  if (inputProject == '') {
+    inputProject = null
+  }
+  console.log(startTime, endTime)
+  request.post(`/report/workInProgress/${startTime}/${endTime}/${inputVal}/${inputProject}/${selectProcesses}`, 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
+      console.log(res.data.data)
+      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
+//   }
+//
+//   gridOptions.loading = true
+//
+// }
+
+/*鍚庣杩斿洖缁撴灉澶氬眰宓屽灞曠ず*/
+const hasDecimal = (value) => {
+  const regex = /\./; // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐�
+  return regex.test(value); // 杩斿洖true/false
+}
+
+//瀛愮粍浠舵帴鏀跺弬鏁�
+const xGrid = ref()
 const gridOptions = reactive({
-  border:  "full",//琛ㄦ牸鍔犺竟妗�
+  border: "full",//琛ㄦ牸鍔犺竟妗�
   keepSource: true,//淇濇寔婧愭暟鎹�
   align: 'center',//鏂囧瓧灞呬腑
-  stripe:true,//鏂戦┈绾�
-  rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+  stripe: true,//鏂戦┈绾�
+  rowConfig: {isCurrent: true, isHover: true, height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
   id: 'CustomerList',
   showFooter: true,//鏄剧ず鑴�
   printConfig: {},
   importConfig: {},
   exportConfig: {},
-  scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
-  showOverflow:true,
+  scrollY: {enabled: true},//寮�鍚櫄鎷熸粴鍔�
+  showOverflow: true,
   columnConfig: {
     resizable: true,
     useKey: true
   },
   filterConfig: {   //绛涢�夐厤缃」
-    remote: true
+    // remote: true
   },
   customConfig: {
     storage: true
@@ -43,26 +223,49 @@
     mode: 'row',
     showStatus: true
   },//琛ㄥご鍙傛暟
-  columns:[
-    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
-    { type: 'seq',fixed:"left", title: '鑷簭', width: 50 },
-    {field: '1', width: 120, title: '宸ュ簭',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
-    {field: '2',width: 120, title: '娴佺▼鍗″彿', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: '3', width: 130,title: '瀹㈡埛鍚嶇О', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: '4',width: 120, title: '椤圭洰鍚嶇О',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
-    {field: '5', width: 100,title: '鎵规', sortable: true,showOverflow:"ellipsis"},
-    {field: '6', width: 100,title: '搴忓彿', sortable: true},
-    {field: '7',width: 100, title: '褰㈢姸', sortable: true},
-    {field: '8',width: 120, title: '妤煎眰缂栧彿', sortable: true,showOverflow:"ellipsis"},
-    {field: '9', width: 120,title: '宸ヨ壓娴佺▼', sortable: true},
-    {field: '10', width: 120,title: '璁㈠崟鏁�', sortable: true},
-    {field: '11',width: 120, title: '瀹�', sortable: true},
-    {field: '12',width: 120, title: '楂�', sortable: true},
-    {field: '13',width: 120, title: '搴撳瓨鏁�', sortable: true},
-    {field: '14',width: 120, title: '搴撳瓨闈㈢Н', sortable: true},
-    {field: '15',width: 120, title: '鎴愬搧鍚嶇О', sortable: true},
-    {field: '16',width: 120, title: '鍦ㄥ埗鍝佸悕绉�', sortable: true},
-    {field: '17',width: 120, title: '寮挗鍗婂緞', sortable: true},
+  columns: [
+    {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50},
+    {type: 'seq', fixed: "left", title: '鑷簭', width: 50},
+    {
+      field: 'thisProcess', width: 120, title: '宸ュ簭', filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      filterMethod: filterChanged
+    },
+    {
+      field: 'process_id',
+      width: 120,
+      title: '娴佺▼鍗″彿',
+      showOverflow: "ellipsis",
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      filterMethod: filterChanged
+    },
+    {
+      field: 'customer_name', width: 130, title: '瀹㈡埛鍚嶇О', filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      filterMethod: filterChanged
+    },
+    {
+      field: 'project', width: 120, title: '椤圭洰鍚嶇О', filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      filterMethod: filterChanged
+    },
+    {
+      field: 'batch', width: 100, title: '鎵规', filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      filterMethod: filterChanged
+    },
+    {field: 'order_number', width: 100, title: '搴忓彿'},
+    {field: 'technology_number', width: 120, title: '灏忕墖椤哄簭', showOverflow: "ellipsis"},
+    {field: 'shape', width: 100, title: '褰㈢姸'},
+    {field: 'process', width: 120, title: '宸ヨ壓娴佺▼'},
+    {field: 'quantity', width: 120, title: '璁㈠崟鏁�'},
+    {field: 'child_width', width: 120, title: '瀹�'},
+    {field: 'child_height', width: 120, title: '楂�'},
+    {field: 'stockNum', width: 120, title: '搴撳瓨鏁�'},
+    {field: 'stockArea', width: 120, title: '搴撳瓨闈㈢Н'},
+    {field: 'product_name', width: 120, title: '鎴愬搧鍚嶇О'},
+    {field: 'bend_radius', width: 120, title: '寮挗鍗婂緞'},
   ],//琛ㄥご鎸夐挳
 
   toolbarConfig: {
@@ -75,72 +278,11 @@
     zoom: true,
     custom: true
   },
-  data:  [
-    {
-      1:'纾ㄨ竟',
-      2:'NG22091906A02/1',
-      3:'涓浗寤虹瓚瑁呴グ闆嗗洟鏈夐檺鍏徃',
-      4:'閾跺窛缁垮湴涓績鍗楀(25鎵�2)',
-      5:'25鎵�2',
-      6:'褰㈢姸',
-      7:'2',
-      8:'25-BL19',
-      9:'鍒囧壊->闀�鑶�->纾ㄨ竟->閽㈠寲->鍖呰',
-      10:'40',
-      11:'1345',
-      12:'1556',
-      13:'1',
-      14:'1.99',
-      15:'8mm瓒呯櫧銆怢YTM-46銆戝钩閽�',
-      16:'8mm瓒呯櫧銆怢YTM-46銆戝钩閽�',
-      17:'0',
-
-    },
-    {
-      1:'纾ㄨ竟',
-      2:'NG22091906A02/1',
-      3:'涓浗寤虹瓚瑁呴グ闆嗗洟鏈夐檺鍏徃',
-      4:'閾跺窛缁垮湴涓績鍗楀(25鎵�2)',
-      5:'25鎵�2',
-      6:'褰㈢姸',
-      7:'2',
-      8:'25-BL19',
-      9:'鍒囧壊->闀�鑶�->纾ㄨ竟->閽㈠寲->鍖呰',
-      10:'40',
-      11:'1345',
-      12:'1556',
-      13:'1',
-      14:'1.99',
-      15:'8mm瓒呯櫧銆怢YTM-46銆戝钩閽�',
-      16:'8mm瓒呯櫧銆怢YTM-46銆戝钩閽�',
-      17:'0',
-
-    },
-    {
-      1:'纾ㄨ竟',
-      2:'NG22091906A02/1',
-      3:'涓浗寤虹瓚瑁呴グ闆嗗洟鏈夐檺鍏徃',
-      4:'閾跺窛缁垮湴涓績鍗楀(25鎵�2)',
-      5:'25鎵�2',
-      6:'褰㈢姸',
-      7:'2',
-      8:'25-BL19',
-      9:'鍒囧壊->闀�鑶�->纾ㄨ竟->閽㈠寲->鍖呰',
-      10:'40',
-      11:'1345',
-      12:'1556',
-      13:'1',
-      14:'1.99',
-      15:'8mm瓒呯櫧銆怢YTM-46銆戝钩閽�',
-      16:'8mm瓒呯櫧銆怢YTM-46銆戝钩閽�',
-      17:'0',
-
-    },
-  ],//table body瀹為檯鏁版嵁
+  data: [],//table body瀹為檯鏁版嵁
   //鑴氶儴姹傚拰
-  footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
-    let footList=['finishedNumber','finishedArea','wornNumber','wornArea']
-    return[
+  footerMethod({columns, data}) {//椤佃剼鍑芥暟
+    let footList = ['']
+    return [
       columns.map((column, columnIndex) => {
         if (columnIndex === 0) {
           return '鍚堣:'
@@ -155,33 +297,6 @@
 
 })
 
-const value = ref('')
-const options = [
-  {
-    value: 'Option1',
-    label: 'Option1',
-  },
-  {
-    value: 'Option2',
-    label: 'Option2',
-  },
-  {
-    value: 'Option3',
-    label: 'Option3',
-  },
-]
-
-const form = reactive({
-  name: '',
-  region: '',
-  date1: '',
-  date2: '',
-  delivery: false,
-  type: [],
-  resource: '',
-  desc: '',
-
-})
 
 </script>
 
@@ -194,30 +309,34 @@
 
         <el-date-picker
             v-model="form.date1"
-            type="daterange"
-            start-placeholder="寮�濮嬫椂闂�"
             end-placeholder="缁撴潫鏃堕棿"
-            :default-time="defaultTime"
+            format="YYYY/MM/DD"
+            start-placeholder="寮�濮嬫椂闂�"
             style="width: 100px"
+            type="daterange"
+            value-format="YYYY-MM-DD"
         />
         &nbsp;&nbsp;
-        <el-select v-model="value" class="m-2" placeholder="鏌ヨ绫诲瀷">
+        <el-input v-model="form.orderId" :placeholder="$t('order.orderId')" clearable style="width: 130px"></el-input>
+        &nbsp;&nbsp;
+        <el-input v-model="form.project" clearable placeholder="椤圭洰鍚嶇О" style="width: 130px"></el-input>
+        &nbsp;
+        <el-select v-model="value" 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>
-        <el-button type="primary">鏌ヨ</el-button>
+        <el-button type="primary" @click="getWorkOrder">鏌ヨ</el-button>
       </el-row>
 
     </div>
     <vxe-grid
-        max-height="100%"
-        @filter-change="filterChanged"
-        class="mytable-scrollbar"
         ref="xGrid"
+        class="mytable-scrollbar"
+        max-height="100%"
         v-bind="gridOptions"
 
     >
@@ -225,8 +344,8 @@
       <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
       <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>
+          <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>
         </ul>
@@ -234,15 +353,15 @@
 
       <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
       <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>
+        <el-button link size="small" type="primary" @click="getTableRow(row,'edit')">缂栬緫</el-button>
+        <el-button link size="small" type="primary" @click="getTableRow(row,'setType')">鍙嶅</el-button>
+        <el-button link size="small" type="primary" @click="getTableRow(row,'delete')">鍒犻櫎</el-button>
       </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)"/>
+            <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/>
           </div>
         </div>
       </template>
@@ -253,10 +372,11 @@
 </template>
 
 <style scoped>
-.main-div-customer{
+.main-div-customer {
   width: 99%;
   height: 100%;
 }
+
 #selectForm {
   width: 60%;
   text-align: center;

--
Gitblit v1.8.0