From 34feb4908ec7b7e5b51adf6355603978c67bd3a4 Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期四, 05 六月 2025 09:53:14 +0800
Subject: [PATCH] 申请单入库

---
 src/views/dnc/base/DeviceCustomTypeManagement.vue |  189 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 189 insertions(+), 0 deletions(-)

diff --git a/src/views/dnc/base/DeviceCustomTypeManagement.vue b/src/views/dnc/base/DeviceCustomTypeManagement.vue
new file mode 100644
index 0000000..a7f8603
--- /dev/null
+++ b/src/views/dnc/base/DeviceCustomTypeManagement.vue
@@ -0,0 +1,189 @@
+<template>
+  <a-card :bordered="false">
+
+    <!-- 鏌ヨ鍖哄煙 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col :md="4" :sm="4">
+            <a-form-item label="杞﹂棿">
+              <a-select v-model="queryParam.productionId" placeholder="璇烽�夋嫨杞﹂棿">
+                <a-select-option v-for="item in workshopTreeData" :key="item.id">
+                  {{ item.productionName }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+
+          <a-col :md="4" :sm="4">
+            <a-form-item label="鏁版帶绯荤粺绫诲埆">
+              <a-input placeholder="璇疯緭鍏ユ暟鎺х郴缁熺被鍒�" v-model="queryParam.deviceManagementName"></a-input>
+            </a-form-item>
+          </a-col>
+
+          <a-col :md="4" :sm="4">
+            <a-space>
+              <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>
+            </a-space>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
+    <div class="table-operator" style="border-top: 5px">
+      <a-button @click="handleAdd" type="primary" icon="plus">娣诲姞璁惧绫�</a-button>
+      <!--      <a-button type="primary" icon="download" @click="handleExportXls('璁惧绫讳俊鎭�')">瀵煎嚭</a-button>-->
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay" @click="handleMenuClick">
+          <a-menu-item key="1">
+            <a-icon type="delete" @click="batchDel"/>
+            鍒犻櫎
+          </a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px">
+          鎵归噺鎿嶄綔
+          <a-icon type="down"/>
+        </a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table鍖哄煙-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i>宸查�夋嫨&nbsp;<a style="font-weight: 600">{{
+          selectedRowKeys.length
+        }}</a>椤�&nbsp;&nbsp;
+        <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a>
+      </div>
+
+      <a-table
+        ref="table"
+        bordered
+        size="middle"
+        rowKey="id"
+        :scroll="{y:465}"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        @change="handleTableChange">
+        <template slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">缂栬緫</a>
+
+          <a-divider type="vertical"/>
+
+          <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">
+            <a>鍒犻櫎</a>
+          </a-popconfirm>
+        </template>
+      </a-table>
+    </div>
+    <!-- table鍖哄煙-end -->
+
+    <DeviceCustomTypeManagementModal ref="modalForm" :workshopTreeData="workshopTreeData" @ok="loadData"/>
+  </a-card>
+</template>
+
+<script>
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import dncApi from '@/api/dnc'
+import DeviceCustomTypeManagementModal
+  from '@views/dnc/base/modules/DeviceCustomTypeManagement/DeviceCustomTypeManagementModal.vue'
+
+export default {
+  name: 'DeviceCustomTypeManagement',
+  mixins: [JeecgListMixin],
+  components: {
+    DeviceCustomTypeManagementModal
+  },
+  data() {
+    return {
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function(t, r, index) {
+            return parseInt(index) + 1
+          }
+        },
+        {
+          title: '杞﹂棿',
+          align: 'center',
+          width: 200,
+          dataIndex: 'productionId_dictText'
+        },
+        {
+          title: '杞存暟',
+          align: 'center',
+          width: 200,
+          dataIndex: 'deviceManagementCode'
+        },
+        {
+          title: '鏁版帶绯荤粺绫诲埆',
+          align: 'center',
+          width: 200,
+          dataIndex: 'deviceManagementName'
+        },
+        {
+          title: '璁惧缁勭紪鍙�',
+          align: 'center',
+          dataIndex: 'equipmentIds',
+          width: 400,
+          ellipsis: true
+        },
+        {
+          title: '鎿嶄綔',
+          dataIndex: 'action',
+          scopedSlots: { customRender: 'action' },
+          align: 'center',
+          width: 80
+        }
+      ],
+      url: {
+        list: '/nc/deviceManagement/query',
+        delete: '/nc/deviceManagement/delete',
+        deleteBatch: '/nc/deviceManagement/deleteBatch'
+      },
+      workshopTreeData: []
+    }
+  },
+  created() {
+    this.getWorkshopListByApi()
+  },
+  methods: {
+    // 璋冪敤鎺ュ彛鑾峰彇鏌ヨ鍖哄煙杞﹂棿鏍戝垪琛�
+    getWorkshopListByApi() {
+      dncApi.getHasPermissionWorkshopTreeApi()
+        .then(res => {
+          if (res.success) {
+            this.workshopTreeData = res.result
+          }
+        })
+    },
+
+    handleAdd: function() {
+      this.$refs.modalForm.add()
+      this.$refs.modalForm.title = '鏂板'
+      this.$refs.modalForm.disabledEdit = false
+    },
+
+    handleEdit: function(record) {
+      this.$refs.modalForm.edit(record)
+      this.$refs.modalForm.title = '缂栬緫'
+      this.$refs.modalForm.disabledEdit = true
+    },
+
+    handleMenuClick(e) {
+      if (e.key == 1) {
+        this.batchDel()
+      }
+    }
+  }
+}
+</script>
\ No newline at end of file

--
Gitblit v1.9.3