From fcd7ece15a86fc0cb526ee801ff8262b0db22dee Mon Sep 17 00:00:00 2001
From: NNowhZzU <1539353356@qq.com>
Date: 星期一, 25 十二月 2023 11:40:34 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 north-glass-erp/northglass-erp/src/views/pp/machine/AddMachine.vue |  267 +++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 188 insertions(+), 79 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/machine/AddMachine.vue b/north-glass-erp/northglass-erp/src/views/pp/machine/AddMachine.vue
index e8a8f01..e3e81d4 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/machine/AddMachine.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/machine/AddMachine.vue
@@ -1,24 +1,157 @@
-<script lang="ts" setup>
-import {reactive, ref} from 'vue'
-import {Search} from "@element-plus/icons-vue"
-import {useRouter} from "vue-router"
-const router = useRouter()
-// do not use same name with ref
-const value = ref('')
-const options = [
-  {
-    value: 'Option1',
-    label: 'Option1',
+<script setup>
+
+import {reactive, ref} from "vue";
+import {useRouter} from  'vue-router'
+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
+    }
+  }
+}
+
+//琛ㄥ熬姹傚拰
+const sumNum = (list, field) => {
+  let count = 0
+  list.forEach(item => {
+    count += Number(item[field])
+  })
+  return count.toFixed(2)
+}
+
+//瀛愮粍浠舵帴鏀跺弬鏁�
+
+const gridOptions = reactive({
+  border:  "full",//琛ㄦ牸鍔犺竟妗�
+  keepSource: true,//淇濇寔婧愭暟鎹�
+  align: 'center',//鏂囧瓧灞呬腑
+  stripe:true,//鏂戦┈绾�
+  rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+  id: 'CustomerList',
+  showFooter: true,//鏄剧ず鑴�
+  printConfig: {},
+  importConfig: {},
+  exportConfig: {},
+  scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
+  showOverflow:true,
+  columnConfig: {
+    resizable: true,
+    useKey: true
   },
-  {
-    value: 'Option2',
-    label: 'Option2',
+  filterConfig: {   //绛涢�夐厤缃」
+    remote: true
   },
-  {
-    value: 'Option3',
-    label: 'Option3',
+  customConfig: {
+    storage: true
   },
-]
+  editConfig: {
+    trigger: 'click',
+    mode: 'row',
+    showStatus: true
+  },//琛ㄥご鍙傛暟
+  columns:[
+    { type: 'seq',fixed:"left", title: '鑷簭', width: 50 },
+
+    {field: 'standardName', title: '鏍囧噯鍚嶇О',editRender: { name: 'input', attrs: { placeholder: '' } } },
+    {field: 'deviceName', title: '璁惧鍚嶇О',editRender: { name: 'input', attrs: { placeholder: '' } } },
+    {field: 'buyingTime', title: '璐拱鏃堕棿',editRender: { name: 'input', attrs: { placeholder: '' } }},
+    {field: 'installationTime',title: '瀹夎鏃堕棿',editRender: { name: 'input', attrs: { placeholder: '' } } },
+    {field: 'serviceInterval', title: '淇濆吇鍛ㄦ湡',editRender: { name: 'input', attrs: { placeholder: '' } }},
+    {field: 'process', title: '鎵�鍦ㄥ伐鑹�', editRender: { name: 'input', attrs: { placeholder: '' } }},
+  ],//琛ㄥご鎸夐挳
+
+  toolbarConfig: {
+    buttons: [
+      {code: 'print_lck', name: '淇濆瓨',status:'primary' ,icon:'vxe-icon-save'},
+    ],
+    import: false,
+    export: true,
+    print: true,
+    zoom: true,
+    custom: true
+  },
+  data:  [
+    {
+      standardName: '',
+      deviceName: '',
+      buyingTime: '',
+      installationTime: '',
+      serviceInterval:'',
+      process:'',
+
+    },
+    {
+      standardName: '',
+      deviceName: '',
+      buyingTime: '',
+      installationTime: '',
+      serviceInterval:'',
+      process:'',
+
+    },
+    {
+      standardName: '',
+      deviceName: '',
+      buyingTime: '',
+      installationTime: '',
+      serviceInterval:'',
+      process:'',
+
+    },
+    {
+      standardName: '',
+      deviceName: '',
+      buyingTime: '',
+      installationTime: '',
+      serviceInterval:'',
+      process:'',
+
+    },
+    {
+      standardName: '',
+      deviceName: '',
+      buyingTime: '',
+      installationTime: '',
+      serviceInterval:'',
+      process:'',
+
+    },
+  ],//table body瀹為檯鏁版嵁
+  //鑴氶儴姹傚拰
+  footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
+    let footList=['maintenanceFrequency','MaintenancesFrequency']
+    return[
+      columns.map((column, columnIndex) => {
+        if (columnIndex === 0) {
+          return '鍚堣:'
+        }
+        if (footList.includes(column.field)) {
+          return sumNum(data, column.field)
+        }
+        return ''
+      })
+    ]
+  }
+
+})
+
+const size = ref<'default' | 'large' | 'small'>('default')
+
+const value1 = ref('')
+const dialogFormVisible = ref(false)
+const formLabelWidth = '140px'
+
 const form = reactive({
   name: '',
   region: '',
@@ -30,76 +163,52 @@
   desc: '',
 })
 
-
-const tableData = [
-  {
-    1: '',
-    2: '',
-    3: '',
-    4: '',
-    5:'',
-    6:'',
-
-  },
-  {
-    1: '',
-    2: '',
-    3: '',
-    4: '',
-    5:'',
-    6:'',
-
-  },
-  {
-    1: '',
-    2: '',
-    3: '',
-    4: '',
-    5:'',
-    6:'',
-
-  },
-]
 </script>
 
 <template>
-  <div>
-    <div id="selectForm">
-      <el-row :gutter="0">
+  <div class="main-div-customer">
+    <vxe-grid
+        max-height="100%"
+        @filter-change="filterChanged"
+        class="mytable-scrollbar"
+        ref="xGrid"
+        v-bind="gridOptions"
 
-        <el-button type="primary">淇濆瓨</el-button>
-      </el-row>
+    >
+      <!--      @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>
 
-    </div>
-    <el-table :data="tableData" border style="width: 100%" height="100%">
-      <el-table-column prop="1" label="鏍囧噯鍚嶇О" >
-        <el-input></el-input>
-      </el-table-column>
-      <el-table-column prop="2" label="璁惧鍚嶇О" >
-      <el-input></el-input>
-      </el-table-column>
-      <el-table-column prop="3" label="璐拱鏃堕棿" >
-      <el-input></el-input>
-      </el-table-column>
-      <el-table-column prop="4" label="瀹夎鏃堕棿">
-      <el-input></el-input>
-      </el-table-column>
-      <el-table-column prop="5" label="淇濆吇鍛ㄦ湡"  >
-      <el-input></el-input>
-      </el-table-column>
-      <el-table-column prop="6" label="鎵�鍦ㄥ伐鑹�" >
-      <el-input></el-input>
-      </el-table-column>
-    </el-table><!-- <h1>{{msg}}</h1> -->
+      <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
+      <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)"/>
+          </div>
+        </div>
+      </template>
+
+
+    </vxe-grid>
+
   </div>
 </template>
 
 <style scoped>
-#selectForm {
-  float: right;
+.main-div-customer{
+  width: 99%;
   height: 100%;
-  text-align: center;
 }
-
-
 </style>
\ No newline at end of file

--
Gitblit v1.8.0