From 4dfdc774c2e742764848177e44e75b7de518f285 Mon Sep 17 00:00:00 2001
From: Houjie <714924425@qq.com>
Date: 星期一, 15 九月 2025 19:46:19 +0800
Subject: [PATCH] 设备台账导入

---
 src/views/cms/CuttingScrapList.vue |  314 +++++++++++++++++++++++++++++++---------------------
 1 files changed, 188 insertions(+), 126 deletions(-)

diff --git a/src/views/cms/CuttingScrapList.vue b/src/views/cms/CuttingScrapList.vue
index cb27f29..f6c0d4b 100644
--- a/src/views/cms/CuttingScrapList.vue
+++ b/src/views/cms/CuttingScrapList.vue
@@ -7,22 +7,22 @@
           <a-col :md="6" :sm="8">
             <a-form-item label="鎶ュ簾鍗曠姸鎬�">
               <j-search-select-tag
-                  placeholder="璇烽�夋嫨鎶ュ簾鍗曠姸鎬�"
-                  v-model="queryParam.orderStatus"
-                  dict="order_status"
-                />
+                placeholder="璇烽�夋嫨鎶ュ簾鍗曠姸鎬�"
+                v-model="queryParam.orderStatus"
+                dict="order_status"
+              />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="8">
-              <a-form-item label="鐢宠浜�">
-                <j-search-select-tag
-                  placeholder="璇烽�夋嫨鐢宠浜�"
-                  v-model="queryParam.applicant"
-                  dict="sys_user,realname,id,del_flag!=1"
-                />
-              </a-form-item>
-            </a-col>
-            <a-col
+            <a-form-item label="鐢宠浜�">
+              <j-search-select-tag
+                placeholder="璇烽�夋嫨鐢宠浜�"
+                v-model="queryParam.applicant"
+                dict="sys_user,realname,id,del_flag!=1"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col
             :md="6"
             :sm="8"
           >
@@ -60,7 +60,8 @@
     <!-- table鍖哄煙-begin -->
     <div>
       <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-        <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a
+        style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�
         <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a>
       </div>
 
@@ -83,7 +84,8 @@
         </template>
         <template slot="imgSlot" slot-scope="text,record">
           <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span>
-          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt=""
+               style="max-width:80px;font-size: 12px;font-style: italic;" />
         </template>
         <template slot="fileSlot" slot-scope="text">
           <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span>
@@ -108,6 +110,11 @@
               <a-menu-item>
                 <a @click="handleDetail(record)">璇︽儏</a>
               </a-menu-item>
+
+              <a-menu-item v-if="record.orderStatus != '2'">
+                  <a @click="handleSubmit(record.id)" :disabled="record.orderStatus == '3'">鎻愪氦</a>
+              </a-menu-item>
+
               <a-menu-item>
                 <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">
                   <a>鍒犻櫎</a>
@@ -119,7 +126,7 @@
 
       </a-table>
     </div>
-<a-tabs defaultActiveKey="1">
+    <a-tabs defaultActiveKey="1">
       <a-tab-pane tab="鍒�鍏锋姤搴熸槑缁�" key="1">
         <cutting-scrap-detail-list ref="cuttingScrapDetailList"></cutting-scrap-detail-list>
       </a-tab-pane>
@@ -130,126 +137,181 @@
 
 <script>
 
-  import '@/assets/less/TableExpand.less'
-  import { mixinDevice } from '@/utils/mixin'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import CuttingScrapModal from './modules/CuttingScrapModal'
-  import CuttingScrapDetailList from './CuttingScrapDetailList'
+import '@/assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import CuttingScrapModal from './modules/CuttingScrapModal'
+import CuttingScrapDetailList from './CuttingScrapDetailList'
+import { httpAction } from '@api/manage'
 
-  export default {
-    name: 'CuttingScrapList',
-    mixins:[JeecgListMixin, mixinDevice],
-    components: {
-      CuttingScrapModal,
-      CuttingScrapDetailList
-    },
-    data () {
-      return {
-        description: '鍒�鍏锋姤搴熺鐞嗛〉闈�',
-        // 琛ㄥご
-        columns: [
-          {
-            title: '#',
-            dataIndex: '',
-            key:'rowIndex',
-            width:60,
-            align:"center",
-            customRender:function (t,r,index) {
-              return parseInt(index)+1;
-            }
-          },
-          {
-            title:'鐢宠浜�',
-            align:"center",
-            dataIndex: 'applicant_dictText'
-          },
-          {
-            title:'鐢宠鏃堕棿',
-            align:"center",
-            dataIndex: 'applicationTime',
-            customRender:function (text) {
-              return !text?"":(text.length>10?text.substr(0,10):text)
-            }
-          },
-          {
-            title:'鐢宠璇存槑',
-            align:"center",
-            dataIndex: 'applicationComment'
-          },
-          {
-            title:'纭浜�',
-            align:"center",
-            dataIndex: 'confirmer_dictText'
-          },
-          {
-            title:'纭鏃堕棿',
-            align:"center",
-            dataIndex: 'confirmTime',
-            customRender:function (text) {
-              return !text?"":(text.length>10?text.substr(0,10):text)
-            }
-          },
-          {
-            title:'纭鎰忚',
-            align:"center",
-            dataIndex: 'confirmComment'
-          },
-           {
-            title:'鎶ュ簾鍗曠姸鎬�',
-            align:"center",
-            dataIndex: 'orderStatus'
-          },
-          {
-            title: '鎿嶄綔',
-            dataIndex: 'action',
-            align:"center",
-            fixed:"right",
-            width:147,
-            scopedSlots: { customRender: 'action' }
+export default {
+  name: 'CuttingScrapList',
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    CuttingScrapModal,
+    CuttingScrapDetailList
+  },
+  data() {
+    return {
+      description: '鍒�鍏锋姤搴熺鐞嗛〉闈�',
+      // 琛ㄥご
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function(t, r, index) {
+            return parseInt(index) + 1
           }
-        ],
-        url: {
-          list: "/cms/cuttingScrap/list",
-          delete: "/cms/cuttingScrap/delete",
-          deleteBatch: "/cms/cuttingScrap/deleteBatch",
-          exportXlsUrl: "/cms/cuttingScrap/exportXls",
-          importExcelUrl: "cms/cuttingScrap/importExcel",
-          
         },
-        dictOptions:{},
-        superFieldList:[],
-      }
-    },
-    created() {
-    this.getSuperFieldList();
-    },
-    computed: {
-      importExcelUrl: function(){
-        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+        {
+          title: '鐢宠浜�',
+          align: 'center',
+          dataIndex: 'applicant_dictText'
+        },
+        {
+          title: '鐢宠鏃堕棿',
+          align: 'center',
+          dataIndex: 'applicationTime',
+          customRender: function(text) {
+            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
+          }
+        },
+        {
+          title: '鐢宠璇存槑',
+          align: 'center',
+          dataIndex: 'applicationComment'
+        },
+        {
+          title: '纭浜�',
+          align: 'center',
+          dataIndex: 'confirmer_dictText'
+        },
+        {
+          title: '纭鏃堕棿',
+          align: 'center',
+          dataIndex: 'confirmTime',
+          customRender: function(text) {
+            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
+          }
+        },
+        {
+          title: '纭鎰忚',
+          align: 'center',
+          dataIndex: 'confirmComment'
+        },
+        {
+          title: '鎶ュ簾鍗曠姸鎬�',
+          align: 'center',
+          dataIndex: 'orderStatus_dictText'
+        },
+        {
+          title: '鎿嶄綔',
+          dataIndex: 'action',
+          align: 'center',
+          fixed: 'right',
+          width: 147,
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      url: {
+        list: '/cms/cuttingScrap/list',
+        delete: '/cms/cuttingScrap/delete',
+        deleteBatch: '/cms/cuttingScrap/deleteBatch',
+        exportXlsUrl: '/cms/cuttingScrap/exportXls',
+        importExcelUrl: 'cms/cuttingScrap/importExcel'
+
       },
-    },
-    methods: {
-     searchReset() {
+      dictOptions: {},
+      superFieldList: []
+    }
+  },
+  created() {
+    this.getSuperFieldList()
+  },
+  computed: {
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+    }
+  },
+  methods: {
+    searchReset() {
       this.queryParam = {}
       this.$refs.cuttingScrapDetailList.dataSource = []
-      this.loadData(1);
+      this.loadData(1)
     },
-      handleEdit: function (record) {
-        this.$refs.modalForm.edit(record)
-        this.$refs.modalForm.title = '缂栬緫'
-        this.$refs.modalForm.disableSubmit = false
+    handleEdit: function(record) {
+      this.$refs.modalForm.edit(record)
+      this.$refs.modalForm.title = '缂栬緫'
+      this.$refs.modalForm.disableSubmit = false
     },
     handleAdd() {
       this.$refs.modalForm.add()
       this.$refs.modalForm.title = '鏂板'
       this.$refs.modalForm.disableSubmit = false
     },
-    handleDetail:function(record){
-      this.$refs.modalForm.edit(record);
-      this.$refs.modalForm.title="璇︽儏";
-      this.$refs.modalForm.disableSubmit = true;
+    handleDetail: function(record) {
+      this.$refs.modalForm.edit(record)
+      this.$refs.modalForm.title = '璇︽儏'
+      this.$refs.modalForm.disableSubmit = true
     },
-     customRow(record) {
+
+    //  鍗曟嵁鎻愪氦
+    handleSubmit: function(id) {
+      if (!this.url.submit) {
+        this.$message.error('璇疯缃畊rl.submit灞炴��!')
+        return
+      }
+
+      let targetId = id // 浠庡弬鏁拌幏鍙朓D
+      // 濡傛灉娌℃湁閫氳繃鍙傛暟浼犻�扞D锛屽垯妫�鏌ラ�変腑鐨勮褰�
+      if (!targetId) {
+        if (this.selectedRowKeys.length != 1) {
+          this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒')
+          return
+        } else {
+          targetId = this.selectedRowKeys[0]
+        }
+      }
+
+      // 灏嗗弬鏁颁綔涓烘煡璇㈠弬鏁伴檮鍔犲埌URL涓�
+      let httpurl = this.url.submit + '?orderId=' + encodeURIComponent(targetId)
+      let method = 'get'
+      var params = {}  // 娓呯┖params锛屽洜涓哄弬鏁板凡缁忓湪URL涓紶閫�
+
+      const that = this
+
+      this.$confirm({
+        title: '纭鎻愪氦锛�',
+        // content: '姝e湪鎻愪氦鏁版嵁锛岃鑰愬績绛夊緟...',
+        okText: '纭',
+        cancelText: '鍙栨秷',
+        onOk() {
+          // 鏄剧ず鍔犺浇鎻愮ず
+          const hide = that.$message.loading('姝e湪鎻愪氦鏁版嵁锛岃鑰愬績绛夊緟...', 0)
+
+          // 鍙戦�佽姹�
+          return httpAction(httpurl, params, method).then((res) => {
+            hide() // 闅愯棌鍔犺浇鎻愮ず
+            if (res.success) {
+              that.$message.success(res.message)
+              that.loadData()
+            } else {
+              that.$message.warning(res.message)
+            }
+          }).catch(error => {
+            hide() // 闅愯棌鍔犺浇鎻愮ず
+            that.$message.error('鎻愪氦澶辫触: ' + error.message)
+          }).finally(() => {
+            that.loading = false
+          })
+        }
+      })
+    },
+
+    customRow(record) {
       return {
         on: {
           click: (e) => {
@@ -266,13 +328,13 @@
             for (let i = 0; i < children.length; i++) {
               children[i].classList.add('checked-td-of-add-table')
             }
-          },
-        },
+          }
+        }
       }
-    },
     }
   }
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
 </style>
\ No newline at end of file

--
Gitblit v1.9.3