From ea082c732bd7178cdc723a1e6c91e2cbc3595498 Mon Sep 17 00:00:00 2001
From: 李喆(开发组) <lzhe@yxqiche.com>
Date: 星期二, 24 六月 2025 13:53:11 +0800
Subject: [PATCH] 1

---
 src/views/tasks/machinereturnfiles.vue |  215 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 215 insertions(+), 0 deletions(-)

diff --git a/src/views/tasks/machinereturnfiles.vue b/src/views/tasks/machinereturnfiles.vue
new file mode 100644
index 0000000..f825989
--- /dev/null
+++ b/src/views/tasks/machinereturnfiles.vue
@@ -0,0 +1,215 @@
+<template>
+  <basic-container>
+    <avue-crud
+      :addBtn="false"
+      :option="option"
+      :table-loading="loading"
+      :data="data"
+      ref="crud"
+      v-model:search="search"
+      v-model:page="mypage"
+      @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" plain @click="handleExport">瀵煎嚭</el-button>
+      </template>
+      <template #menu="scope">
+        <el-button type="primary" text size="default" icon="el-icon-document-delete" @click.stop="rejectBtn(scope.row, scope.index)">鎷掔粷</el-button>
+        <el-button type="primary" text size="default" icon="el-icon-document-add" @click.stop="acceptBtn(scope.row, scope.index)">鎺ユ敹</el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import { exportBlob } from '@/api/common';
+import { downloadXls } from '@/utils/util';
+import { getToken } from '@/utils/auth';
+import NProgress from 'nprogress';
+import 'nprogress/nprogress.css';
+export default {
+  data() {
+    return {
+      search: {
+        keyword: "",
+        machineGroupCode: ""
+      },
+      loading: true,
+      mypage: {
+        size: 10,
+        current: 1,
+        total: 0,
+      },
+      option: {
+        index: true,
+        addBtn: false,
+        editBtn: false,
+        delBtn: false,
+        labelWidth: 120,
+        emptyBtn: false,
+        searchLabelWidth: "120",
+        searchSpan: 8,
+        column: [
+          {
+            label: '浠诲姟缂栫爜',
+            prop: 'programName',
+            hide: true
+          },
+          {
+            label: '鏂囦欢缂栧彿',
+            prop: ''
+          },
+          {
+            label: '鏈哄簥鍙�',
+            prop: 'machineCode',
+          },
+          {
+            label: '鏂囦欢鍚嶇О',
+            prop: 'name',
+          },
+          {
+            label: '鏂囦欢鍥哄寲鐘舵��',
+            prop: 'isCured',
+          },
+          {
+            label: '鏂囦欢鍒拌揪鏃堕棿',
+            prop: 'arrivedTime',
+          },
+          {
+            label: '鏂囦欢鏁版嵁搴撶紪鍙�',
+            prop: '',
+          },
+          {
+            label: '鍏抽敭淇℃伅',
+            prop: 'keyword',
+            search: true,
+            hide: true,
+          },
+          {
+            label: '鏈哄簥瑙勬牸鍨嬪彿',
+            prop: 'machineSpec',
+            search: true,
+            hide: true,
+            type: 'select',
+            dicUrl: '/blade-system/dict-biz/dictionary?code=machine_spec',
+            props: {
+              label: 'dictValue',
+              value: 'dictKey',
+            },
+            span: "8"
+          }
+        ],
+      },
+      data: [],
+    };
+  },
+  methods: {
+    acceptBtn(row) {
+      this.$confirm('纭畾瑕佹帴鏀跺悧?', {
+        confirmButtonText: '鏄�',
+        cancelButtonText: '鍚�',
+        type: 'warning',
+      }).then(() => {
+        //璋冪敤鎺ュ彛
+        this.loading = true;
+        axios({
+          url: '/blade-mdm/machineback/file/accept',
+          method: 'post',
+          data: {ids: row.id},
+        }).then(
+          res => {
+            this.loading = false;
+            this.onLoad();
+          }
+        );
+      })
+    },
+    rejectBtn(row) {
+      this.$confirm('纭畾瑕佹嫆缁濆悧?', {
+        confirmButtonText: '鏄�',
+        cancelButtonText: '鍚�',
+        type: 'warning',
+      }).then(() => {
+        //璋冪敤鎺ュ彛
+        this.loading = true;
+        axios({
+          url: '/blade-mdm/machineback/file/page',
+          method: 'get',
+          params: {ids: row.id},
+        }).then(
+          res => {
+            this.loading = false;
+            this.onLoad();
+          }
+        );
+      })
+    },
+    handleExport(row,index) {  //瀵煎嚭
+      this.$confirm('鏄惁瀵煎嚭鏈哄簥鍥炰紶鏂囦欢鏁版嵁?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning',
+      }).then(() => {
+        NProgress.start();
+        exportBlob(
+          `/blade-mdm/machineback/file/export-excel?${this.website.tokenHeader}=${getToken()}`
+        ).then(res => {
+          downloadXls(res.data, `鏈哄簥鍥炰紶鏂囦欢鏁版嵁${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`);
+          NProgress.done();
+        });
+      });
+    },
+    searchReset() {
+      //this.onLoad(this.mypage);
+    },
+    searchChange(params, done) {
+      this.mypage.current = 1;
+      this.onLoad();
+      done();
+    },
+    currentChange(current) {
+      this.mypage.current = current;
+    },
+    sizeChange(size) {
+      this.mypage.size = size;
+    },
+    refreshChange() {
+      
+    },
+    onLoad() {
+      this.loading = true;
+      var obj = {
+        keyword: this.search.keyword,
+        machineSpec: this.search.machineSpec,
+        current: this.mypage.current,
+        size: this.mypage.size,
+      }
+      axios({
+        url: '/blade-mdm/machineback/file/page',
+        method: 'get',
+        params: obj,
+      }).then(
+        res => {
+          const data = res.data.data;
+          this.mypage.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+        },
+        error => {
+            
+        }
+      );
+
+    }
+  },
+};
+</script>
+
+<style lang="scss">
+
+</style>
\ No newline at end of file

--
Gitblit v1.9.3