From e5ea2c30e33f280ffc8a0ce78224ef99fb6679b1 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期二, 30 十二月 2025 08:16:06 +0800
Subject: [PATCH] 在制品报表导出修改

---
 north-glass-erp/northglass-erp/src/views/pp/machine/SelectMachine.vue |  247 ++++++++++++++++++++-----------------------------
 1 files changed, 100 insertions(+), 147 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/machine/SelectMachine.vue b/north-glass-erp/northglass-erp/src/views/pp/machine/SelectMachine.vue
index 8583b81..fe7219d 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/machine/SelectMachine.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/machine/SelectMachine.vue
@@ -1,25 +1,24 @@
 <script setup>
-
 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 { useI18n } from 'vue-i18n'
+import {changeFilterEvent, filterChanged} from "@/hook"
+import {Search} from "@element-plus/icons-vue";
+//璇█鑾峰彇
+const { t } = useI18n()
 let router=useRouter()
-const getTableRow = (row,type) =>{
-  switch (type) {
-    case 'edit' :{
-      //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
-      router.push({path: '/main/reportingWorks/ReportingWorkDetail', query: { id: row.id }})
-      break
-    }
-    case 'delete':{
-      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅')
-      break
-    }
-    case  'setType':{
-      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍙嶅鐘舵��')
-      break
-    }
-  }
-}
+//瀹氫箟鏁版嵁杩斿洖缁撴灉
+let produceList = ref([])
+
+const getBasicData = ref({
+  id: '',
+  basic_type: '',
+  basic_name: '',
+  d_basic_name: '',
+})
 
 //琛ㄥ熬姹傚拰
 const sumNum = (list, field) => {
@@ -30,14 +29,31 @@
   return count.toFixed(2)
 }
 
-//瀛愮粍浠舵帴鏀跺弬鏁�
+const hasDecimal = (value) => {
+  const regex = /\./; // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐�
+  return regex.test(value); // 杩斿洖true/false
+}
 
+
+//棣栨鍔犺浇
+request.post(`/maintenance/selectMachine`).then((res) => {
+  if (res.code == 200) {
+    xGrid.value.loadData(res.data.data)
+    gridOptions.loading = false
+  } else {
+    ElMessage.warning(res.msg)
+  }
+})
+
+
+//瀛愮粍浠舵帴鏀跺弬鏁�
+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: {},
@@ -50,7 +66,7 @@
     useKey: true
   },
   filterConfig: {   //绛涢�夐厤缃」
-    remote: true
+    // remote: true
   },
   customConfig: {
     storage: true
@@ -62,23 +78,17 @@
   },//琛ㄥご鍙傛暟
   columns:[
     {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: '璁惧缂栧彿', width: 120, title: '璁惧缂栧彿',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
-    {field: '鏍囧噯鍚嶇О',width: 120, title: '鏍囧噯鍚嶇О', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: '璁惧鍚嶇О', width: 130,title: '璁惧鍚嶇О', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: '璐拱鏃堕棿',width: 120, title: '璐拱鏃堕棿',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
-    {field: '瀹夎鏃堕棿', width: 100,title: '瀹夎鏃堕棿', sortable: true,showOverflow:"ellipsis"},
-    {field: '浣跨敤鍛ㄦ湡', width: 100,title: '浣跨敤鍛ㄦ湡(骞�)', sortable: true},
-    {field: '浣跨敤鐘舵��',width: 100, title: '浣跨敤鐘舵��', sortable: true},
-    {field: '缁翠慨娆℃暟',width: 120, title: '缁翠慨娆℃暟', sortable: true,showOverflow:"ellipsis"},
-    {field: '淇濆吇娆℃暟', width: 120,title: '淇濆吇娆℃暟', sortable: true},
-    {field: '鏈�鍚庣淮淇椂闂�',width: 120, title: '鏈�鍚庣淮淇椂闂�', sortable: true},
-    {field: '鏈�鍚庝繚鍏绘椂闂�',width: 120, title: '鏈�鍚庝繚鍏绘椂闂�', sortable: true},
-    {field: '缁翠慨璐圭敤',width: 120, title: '缁翠慨璐圭敤', sortable: true},
-    {field: '淇濆吇璐圭敤',width: 120, title: '淇濆吇璐圭敤', sortable: true},
-    {field: '鎵�鍦ㄥ伐鑹�',width: 120, title: '鎵�鍦ㄥ伐鑹�', sortable: true},
-    {field: '浣滃簾鐘舵��',width: 120, title: '浣滃簾鐘舵��', sortable: true},
+    { type: 'seq',fixed:"left", title: t('basicData.Number'), width: 50 },
+    {field: 'deviceId', width: 120, title: t('machine.basicId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged },
+    {field: 'deviceName', width: 130,title: t('machine.basicName') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged},
+    {field: 'type',width: 100, title:  t('machine.type'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged },
+    {field: 'faultCount',width: 120, title: t('machine.faultCount') ,showOverflow:"ellipsis"},
+    {field: 'maintenanceCount', width: 120,title: t('machine.maintenanceCount'), },
+    {field: 'faultLastTime',width: 120, title: t('machine.faultLastTime'), },
+    {field: 'maintenanceLastTime',width: 120, title: t('machine.maintenanceLastTime'), },
+    {field: 'faultCost',width: 120, title: t('machine.faultCost'), },
+    {field: 'maintenanceCost',width: 120, title: t('machine.maintenanceCost'), },
+    {field: 'process',width: 120, title: t('machine.basicCategory'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged }
   ],
   //琛ㄥご鎸夐挳
   toolbarConfig: {
@@ -92,65 +102,14 @@
     custom: true
   },
   data:  [
-    {
-      "璁惧缂栧彿": 'SB2209211',
-      '鏍囧噯鍚嶇О': '閽㈠寲鐐�(22E)',
-      '璁惧鍚嶇О': '閽㈠寲鐐�(22E)',
-      '璐拱鏃堕棿': '2022-03-16',
-      '瀹夎鏃堕棿':'2022-03-16',
-      '浣跨敤鍛ㄦ湡':'313',
-      '浣跨敤鐘舵��':'浣跨敤涓�',
-      '缁翠慨娆℃暟':'0',
-      '淇濆吇娆℃暟':'0',
-      '鏈�鍚庣淮淇椂闂�':'',
-      '鏈�鍚庝繚鍏绘椂闂�':'',
-      '缁翠慨璐圭敤':'',
-      '淇濆吇璐圭敤':'',
-      '鎵�鍦ㄥ伐鑹�':'閽㈠寲',
-      '浣滃簾鐘舵��':'姝e父',
-    },
-    {
-      "璁惧缂栧彿": 'SB2209211',
-      '鏍囧噯鍚嶇О': '閽㈠寲鐐�(22E)',
-      '璁惧鍚嶇О': '閽㈠寲鐐�(22E)',
-      '璐拱鏃堕棿': '2022-03-16',
-      '瀹夎鏃堕棿':'2022-03-16',
-      '浣跨敤鍛ㄦ湡':'313',
-      '浣跨敤鐘舵��':'浣跨敤涓�',
-      '缁翠慨娆℃暟':'0',
-      '淇濆吇娆℃暟':'0',
-      '鏈�鍚庣淮淇椂闂�':'',
-      '鏈�鍚庝繚鍏绘椂闂�':'',
-      '缁翠慨璐圭敤':'',
-      '淇濆吇璐圭敤':'',
-      '鎵�鍦ㄥ伐鑹�':'閽㈠寲',
-      '浣滃簾鐘舵��':'姝e父',
-    },
-    {
-      "璁惧缂栧彿": 'SB2209211',
-      '鏍囧噯鍚嶇О': '閽㈠寲鐐�(22E)',
-      '璁惧鍚嶇О': '閽㈠寲鐐�(22E)',
-      '璐拱鏃堕棿': '2022-03-16',
-      '瀹夎鏃堕棿':'2022-03-16',
-      '浣跨敤鍛ㄦ湡':'313',
-      '浣跨敤鐘舵��':'浣跨敤涓�',
-      '缁翠慨娆℃暟':'0',
-      '淇濆吇娆℃暟':'0',
-      '鏈�鍚庣淮淇椂闂�':'',
-      '鏈�鍚庝繚鍏绘椂闂�':'',
-      '缁翠慨璐圭敤':'',
-      '淇濆吇璐圭敤':'',
-      '鎵�鍦ㄥ伐鑹�':'閽㈠寲',
-      '浣滃簾鐘舵��':'姝e父',
-    },
   ],//table body瀹為檯鏁版嵁
   //鑴氶儴姹傚拰
   footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
-    let footList=['缁翠慨娆℃暟','淇濆吇娆℃暟','缁翠慨璐圭敤','淇濆吇璐圭敤']
+    let footList=['','','','']
     return[
       columns.map((column, columnIndex) => {
         if (columnIndex === 0) {
-          return '鍚堣:'
+          return t('basicData.total')
         }
         if (footList.includes(column.field)) {
           return sumNum(data, column.field)
@@ -168,66 +127,55 @@
 const dialogFormVisible = ref(false)
 const formLabelWidth = '140px'
 
-const form = reactive({
-  name: '',
-  region: '',
-  date1: '',
-  date2: '',
-  delivery: false,
-  type: [],
-  resource: '',
-  desc: '',
-})
+
 
 </script>
 
 <template>
-  <div class="main-div-customer">
-    <vxe-grid
-        max-height="100%"
-        @filter-change="filterChanged"
-        class="mytable-scrollbar"
-        ref="xGrid"
-        v-bind="gridOptions"
+  <div  style="width: 100%;height: 100%">
+    <div class="main-table">
+      <vxe-grid
+          height="100%"
+          class="mytable-scrollbar"
+          ref="xGrid"
+          v-bind="gridOptions"
 
-    >
-      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
-      <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
-      <template #content="{ row}">
-        <ul class="expand-wrapper">
-          <li  v-for="(item,key,index) in row">
-            <span style="font-weight: bold">{{key+':  '}}</span>
-            <span>{{ item }}</span>
-          </li>
-        </ul>
-      </template>
+      >
+        <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
+        <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
+        <template #content="{ row}">
+          <ul class="expand-wrapper">
+            <li  v-for="(item,key,index) in row">
+              <span style="font-weight: bold">{{key+':  '}}</span>
+              <span>{{ item }}</span>
+            </li>
+          </ul>
+        </template>
 
-      <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
-      <template #button_slot="{ row }">
-        <el-button @click="dialogFormVisible = true" link type="primary" size="small">缂栬緫</el-button>
-        <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">鍒犻櫎</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)"/>
+        <template #num1_filter="{ column, $panel }">
+          <div>
+            <div v-for="(option, index) in column.filters" :key="index">
+              <input type="text" v-model="option.data"
+                     @keyup.enter.native="$panel.confirmFilter()"
+                     @input="changeFilterEvent($event, option, $panel)"/>
+            </div>
           </div>
-        </div>
-      </template>
+        </template>
 
 
-    </vxe-grid>
+      </vxe-grid>
+    </div>
 
-    <el-dialog v-model="dialogFormVisible" title="璁惧缂栬緫">
+    <el-dialog v-model="dialogFormVisible" :title="$t('machine.deviceEditing')">
       <el-form :model="form">
-        <el-form-item label="鏍囧噯鍚嶇О" :label-width="formLabelWidth">
+        <el-form-item :label="$t('machine.standardName')" :label-width="formLabelWidth">
           <el-input v-model="form.name"  autocomplete="off"  style="width: 220px"/>
         </el-form-item>
-        <el-form-item label="璁惧鍚嶇О" :label-width="formLabelWidth">
+        <el-form-item :label="$t('machine.basicName')" :label-width="formLabelWidth">
           <el-input v-model="form.name"  autocomplete="off"  style="width: 220px"/>
         </el-form-item>
-        <el-form-item label="璐拱鏃堕棿" :label-width="formLabelWidth">
+        <el-form-item :label="$t('machine.purchaseTime')" :label-width="formLabelWidth">
           <el-date-picker
               v-model="value1"
               type="date"
@@ -235,7 +183,7 @@
               :size="size"
           />
         </el-form-item>
-        <el-form-item label="瀹夎鏃堕棿" :label-width="formLabelWidth">
+        <el-form-item :label="$t('machine.installationTime')" :label-width="formLabelWidth">
           <el-date-picker
               v-model="value1"
               type="date"
@@ -243,22 +191,22 @@
               :size="size"
           />
         </el-form-item>
-        <el-form-item label="淇濆吇鍛ㄦ湡" :label-width="formLabelWidth">
+        <el-form-item :label="$t('machine.maintenanceCycle')" :label-width="formLabelWidth">
           <el-input v-model="form.name"  autocomplete="off"  style="width: 220px"/>
         </el-form-item>
-        <el-form-item label="鎵�鍦ㄥ伐鑹�" :label-width="formLabelWidth">
-          <el-select v-model="form.region" placeholder="閽㈠寲" style="width: 220px">
-            <el-option label="鍒囧壊" value="shanghai" />
-            <el-option label="纾ㄨ竟" value="mobian" />
-            <el-option label="閽㈠寲" value="ganghua" />
+        <el-form-item :label="$t('machine.standardName')" :label-width="formLabelWidth">
+          <el-select v-model="form.region" :placeholder="$t('machine.tempering')" style="width: 220px">
+            <el-option :label="$t('machine.cutting')" value="shanghai" />
+            <el-option :label="$t('machine.edgeGrinding')" value="mobian" />
+            <el-option :label="$t('machine.tempering')" value="ganghua" />
           </el-select>
         </el-form-item>
       </el-form>
       <template #footer>
       <span class="dialog-footer">
-        <el-button @click="dialogFormVisible = false">鍙栨秷</el-button>
+        <el-button @click="dialogFormVisible = false">{{$t('basicData.cancelButtonText')}}</el-button>
         <el-button type="primary" @click="dialogFormVisible = false">
-          纭
+          {{$t('basicData.confirmButtonText')}}
         </el-button>
       </span>
       </template>
@@ -267,8 +215,13 @@
 </template>
 
 <style scoped>
-.main-div-customer{
-  width: 99%;
-  height: 100%;
+.head{
+  width: 100%;
+  height: 35px;
+}
+
+.main-table{
+  width: 100%;
+  height: calc(100% - 0px);
 }
 </style>
\ No newline at end of file

--
Gitblit v1.8.0