From bac10733d14f935a026ea9c3f8beeb9fd7b5d803 Mon Sep 17 00:00:00 2001
From: Houjie <714924425@qq.com>
Date: 星期一, 26 五月 2025 10:30:52 +0800
Subject: [PATCH] 刀具刃磨/  工具盘点/工具报损

---
 src/views/tms/lossBound/modules/JSelectLossboundToolModal.vue |  221 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 221 insertions(+), 0 deletions(-)

diff --git a/src/views/tms/lossBound/modules/JSelectLossboundToolModal.vue b/src/views/tms/lossBound/modules/JSelectLossboundToolModal.vue
new file mode 100644
index 0000000..ad06f5d
--- /dev/null
+++ b/src/views/tms/lossBound/modules/JSelectLossboundToolModal.vue
@@ -0,0 +1,221 @@
+<template>
+  <!--鏀寔鍏ㄥ睆缂╂斁-->
+  <j-modal
+    :visible="visible"
+    :width="1200"
+    :title="title"
+    switchFullscreen
+    @ok="handleSubmit"
+    @cancel="close"
+    style="top: 50px"
+    cancelText="鍏抽棴"
+  >
+    <a-card :bordered="false">
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="searchQuery">
+          <a-row :gutter="24">
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="宸ュ叿缂栫爜">
+                <a-input placeholder="璇疯緭鍏ュ伐鍏风紪鐮�,鏀寔妯$硦鏌ヨ" v-model="queryParam.toolCode"></a-input>
+              </a-form-item>
+            </a-col>
+            <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
+            <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
+          </a-row>
+        </a-form>
+      </div>
+      <!--鍑哄簱鍗曞垪琛�-->
+      <a-table
+        ref="table"
+        size="middle"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :rowSelection="rowSelection"
+        :loading="loading"
+        @change="handleTableChange"
+      >
+      </a-table>
+    </a-card>
+  </j-modal>
+</template>
+
+<script>
+import { filterObj } from '@/utils/util'
+import { getAction } from '@api/manage'
+
+export default {
+  name: 'JSelectLossboundToolModal',
+  components: {},
+  props: {},
+  data() {
+    return {
+      title: '閫夋嫨鍑哄簱宸ュ叿',
+      queryParam: {},
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: (_, __, index) => parseInt(index) + 1
+        },
+        {
+          title: '宸ュ叿缂栫爜',
+          align: 'center',
+          dataIndex: 'toolCode'
+        },
+        {
+          title: '涓枃鍚嶇О',
+          align: 'center',
+          dataIndex: 'chineseName'
+        },
+        {
+          title: '鍨嬪彿/鍥惧彿',
+          align: 'center',
+          dataIndex: 'toolModel'
+        }
+      ],
+      selectedRowKeys: [],
+      oldSelectRow: [],
+      scrollTrigger: { x: 1500, y: 500 },
+      dataSource: [],
+      selectionRows: [],
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['5', '10', '20'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�'
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0,
+      },
+      isorter: {
+        column: 'toolCode',
+        order: 'asc',
+      },
+      departTree: [],
+      visible: false,
+      loading: false,
+      prepareKnifeDetailList:[],
+      url: {
+        list: '/tms/baseTools/listWithLedgerAndConfig'
+      },
+    }
+  },
+  computed: {
+    rowSelection() {
+      return {
+        type: 'checkbox',
+        onChange: (selectedRowKeys, selectedRows) => {
+          this.selectedRowKeys = selectedRowKeys
+          this.onSelectChange(selectedRows)
+        },
+        getCheckboxProps: (record) => ({
+          props: {
+            disabled: record.disabled,
+          },
+        }),
+      }
+    },
+  },
+  watch: {
+  },
+  created() {
+  },
+  methods: {
+    async loadData(arg) {
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      this.loading = true
+      let params = this.getQueryParams() //鏌ヨ鏉′欢
+      console.log(params)
+      await getAction(this.url.list, params).then((res) => {
+        if (res.success) {
+          this.dataSource = res.result.records
+          this.ipagination.total = res.result.total
+        }
+        if (res.code === 510) {
+          this.$message.warning(res.message)
+        }
+        this.loading = false
+      })
+    },
+    showModal(oldSelectRow) {
+      this.oldSelectRow = oldSelectRow
+      this.visible = true
+      this.queryParam.status = '1'
+      this.queryParam.excludeIds = oldSelectRow
+      this.loadData(1)
+    },
+    getQueryParams() {
+      let param = Object.assign({}, this.queryParam, this.isorter)
+      param.field = this.getQueryField()
+      param.pageNo = this.ipagination.current
+      param.pageSize = this.ipagination.pageSize
+      return filterObj(param)
+    },
+    //鏌ヨ鏉′欢澶勭悊
+    getQueryField() {
+      let fields = ['id'];
+      for (let a = 0; a < this.columns.length; a++) {
+        fields.push(this.columns[a].dataIndex);
+      }
+      return fields.join(',');
+    },
+    searchReset() {
+      this.queryParam = {}
+      this.loadData(1)
+    },
+    close() {
+      this.queryParam = {}
+      // this.searchReset(0)
+      this.selectedRowKeys = []
+      this.selectionRows = []
+      this.visible = false
+    },
+    handleTableChange(pagination, filters, sorter) {
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
+      }
+      this.ipagination = pagination
+      this.loadData()
+    },
+    handleSubmit() {
+      if (this.selectionRows.length > 0) {
+        this.$bus.$emit('selectionRows', this.selectionRows)
+        // this.searchReset(0)
+        this.close()
+      } else {
+        this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�')
+      }
+    },
+    onSelectChange(selectionRows) {
+      this.selectionRows = selectionRows
+    },
+    searchQuery() {
+      this.loadData(1)
+    },
+  },
+}
+</script>
+
+<style scoped>
+.ant-table-tbody .ant-table-row td {
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
+
+#components-layout-demo-custom-trigger .trigger {
+  font-size: 18px;
+  line-height: 64px;
+  padding: 0 24px;
+  cursor: pointer;
+  transition: color 0.3s;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3