From 422edd1fa40ac1f6f00c6d8c4aa97bfe58c81625 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期五, 19 九月 2025 18:12:16 +0800
Subject: [PATCH] 增加现场编制查询列表

---
 src/views/dataex/programonmachineimp.vue |  148 +++++++++++++++++++++++++++++++++++++++++++++++-
 src/api/dataex/programonmachine.js       |   18 ++++++
 2 files changed, 161 insertions(+), 5 deletions(-)

diff --git a/src/api/dataex/programonmachine.js b/src/api/dataex/programonmachine.js
new file mode 100644
index 0000000..27fbc6e
--- /dev/null
+++ b/src/api/dataex/programonmachine.js
@@ -0,0 +1,18 @@
+/*
+ * @Date: 2025-06-12 22:38:05
+ * @LastEditors: gaoshp
+ * @LastEditTime: 2025-06-20 08:32:12
+ * @FilePath: /mdmweb/src/api/tasks/machinereturnfileop.js
+ */
+import request from '@/axios';
+export const getList = (current, size, params) => {
+  return request({
+    url: '/blade-mdm/program/mdmimport/program-on-machine-page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    },
+  })
+};
\ No newline at end of file
diff --git a/src/views/dataex/programonmachineimp.vue b/src/views/dataex/programonmachineimp.vue
index 7ccbec7..34a73fd 100644
--- a/src/views/dataex/programonmachineimp.vue
+++ b/src/views/dataex/programonmachineimp.vue
@@ -8,14 +8,23 @@
 -->
 <template>
   <basic-container>
-    <avue-form ref="form" :option="formOption" v-model="form" :upload-after="uploadAfter">
-      
-    </avue-form>
+    <avue-crud :option="option" :table-loading="loading" :data="tableData" :query="query" v-model:page="page" v-model="form" ref="crud"
+            @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange"
+            @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
+            <template #menu-left>
+                <el-button type="primary" size="default" icon="el-icon-circle-plus" @click="importData">瀵煎叆</el-button>
+            </template>
+        </avue-crud>
+        <el-dialog title="瀵煎叆鐜板満缂栧埗璁板綍" append-to-body v-model="excelBox" width="305px">
+          <avue-form :option="formOption" v-model="form" :upload-after="uploadAfter">
+          </avue-form>
+    </el-dialog>
+    
   </basic-container>
 </template>
 
 <script>
-
+import { getList } from '@/api/dataex/programonmachine.js';
 export default {
   watch: {
    
@@ -23,14 +32,83 @@
   data() {
     return {
       form: {},
+      query:{},
+      loading:false,
+      tableData:[],
+      excelBox: false,
+      page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0,
+      },
       
+      option: {
+        addBtn: false,
+        editBtn: false,
+        delBtn: false,
+        columnBtn: false,
+        tip: false,
+        // simplePage: true,
+        searchShow: true,
+        searchMenuSpan: 6,
+        dialogWidth: '60%',
+        // tree: true,
+        border: true,
+        index: true,
+        //selection: true,
+        // viewBtn: true,
+        menuWidth: 100,
+        menu: false,
+        dialogClickModal: false,
+        column: [
+            {
+                label: '闆剁粍浠跺彿',
+                prop: 'drawingNo',
+                search:true,
+                searchType:'input'
+            },
+            {
+                label: '宸ュ簭鍙�',
+                prop: 'processNo'
+            },
+            {
+                label: '宸ュ簭鐗堟',
+                prop: 'processEdition'
+            },
+            {
+                label: '涓存椂鏇存敼鍗�',
+                prop: 'deviation'
+            },
+            {
+                label: '鏈哄簥缂栧彿',
+                prop: 'machineCode',
+            },
+            
+            {
+                label: '瀵煎叆鏃堕棿',
+                prop: 'createTime',
+                type: 'datetime',
+                format: 'YYYY-MM-DD HH:mm:ss',
+            },
+            {
+                label: '瀵煎叆鏃堕棿',
+                prop: 'createTime',
+                type: 'date',
+                format: 'YYYY-MM-DD',
+                valueFormat: 'YYYY-MM-DD',
+                search: true,
+                searchRange: true,
+                hide: true,
+            },
+           
+          ],
+      },
       formOption: {
         labelWidth: 160,
         submitBtn: false,
         emptyBtn: false,
         tip: false,
         column: [
-          
           {
             label: '涓婁紶鐜板満缂栧埗璁板綍',
             prop: 'file',
@@ -45,14 +123,74 @@
     };
   },
   methods: {
+    importData() {
+      this.excelBox = true;
+    },
    uploadAfter(res, done, loading, column) {
       if(res.data>0){
         this.$message.success("鎴愬姛瀵煎叆"+res.data+"鏉¤褰�")
       }else{
         this.$message.warning("鏂囦欢鏁版嵁涓虹┖")
       }
+      this.onLoad(this.page,{});
       done();
     },
+    searchChange(params, done) {
+        let data = {}
+        this.query = params;
+        this.page.currentPage = 1;
+        params.createTimeBegin = params?.createTime?.[0] || '';
+        params.createTimeEnd = params?.createTime?.[1] || '';
+        
+        data = {
+            createTimeBegin: params.createTimeBegin,
+            createTimeEnd: params.createTimeEnd,
+            drawingNo: params.drawingNo,
+        }
+        this.query = data;
+
+         this.onLoad(this.page, data);
+        done();
+      },
+      searchReset() {
+          let data = {}
+          
+          this.onLoad(this.page, data);
+          done();
+      },
+      currentChange(currentPage) {
+          this.page.currentPage = currentPage;
+          // this.onLoad();
+      },
+      sizeChange(pageSize) {
+          this.page.pageSize = pageSize;
+      },
+      refreshChange() {
+          this.onLoad(this.page, this.query);
+      },
+      /** * 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
+       */
+      onLoad(page, params = {}) {
+          console.log('onLoad', this.query,this.form);
+          const query = {
+              ...this.query,
+          };
+        
+          this.loading = true;
+          getList(page.currentPage, page.pageSize, Object.assign(query, params)).then(res => {
+              const data = res.data.data;
+              this.page.total = data.total;
+              this.tableData = data.records;
+              this.loading = false;
+          }, () => {
+              this.tableData = [];
+              this.loading = false;
+          }).catch(err => {
+              this.data = [];
+              this.loading = false;
+          });
+      }
+    
   },
   mounted() {
     

--
Gitblit v1.9.3