From 6bbceeae0a692ef60f429dbca889752fcb09ec9a Mon Sep 17 00:00:00 2001
From: houshuai <17802598606@163.com>
Date: 星期四, 03 七月 2025 19:42:01 +0800
Subject: [PATCH] 线边库和订单 基本页面搭建

---
 src/views/qms/SamplingRulesList.vue |  342 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 342 insertions(+), 0 deletions(-)

diff --git a/src/views/qms/SamplingRulesList.vue b/src/views/qms/SamplingRulesList.vue
new file mode 100644
index 0000000..28882b9
--- /dev/null
+++ b/src/views/qms/SamplingRulesList.vue
@@ -0,0 +1,342 @@
+<template>
+  <a-card
+    :bordered="false"
+  >
+    <!-- 鏌ヨ鍖哄煙 -->
+    <div class="table-page-search-wrapper">
+      <a-form
+        layout="inline"
+        @keyup.enter.native="searchQuery"
+      >
+        <a-row :gutter="30">
+
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="瑙勫垯缂栫爜">
+              <j-input
+                placeholder="璇疯緭鍏ヨ鍒欑紪鐮佹绱�"
+                v-model="queryParam.ruleCode"
+              ></j-input>
+            </a-form-item>
+          </a-col>
+
+           <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="瑙勫垯鍚嶇О">
+              <j-input
+                placeholder="璇疯緭鍏ヨ鍒欏悕绉版绱�"
+                v-model="queryParam.ruleName"
+              ></j-input>
+            </a-form-item>
+          </a-col>
+
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
+              <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
+    <div class="table-operator">
+      <a-button
+        @click="handleAdd"
+        type="primary"
+        icon="plus"
+      >鏂板</a-button>
+    </div>
+
+    <!-- table鍖哄煙-begin -->
+    <div>
+      <a-table
+        ref="table"
+        size="middle"
+        bordered
+        rowKey="id"
+        filterMultiple="filterMultiple"
+        :columns="columns"
+        :rowClassName="tableRowClass"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+      >
+        <!--鐘舵�佹爮涓�у睍绀�-->
+        <span
+          slot="status"
+          slot-scope="text,record"
+        >
+          <a-badge
+            v-if="record.ruleStatus==1"
+            status="success"
+          />
+          <span
+            v-if="record.ruleStatus==1"
+            class="success"
+          >鍚敤</span>
+          <a-badge
+            v-if="record.ruleStatus==0"
+            status="error"
+          />
+          <span
+            v-if="record.ruleStatus==0"
+            class="error"
+          >绂佺敤</span>
+        </span>
+        <span
+          slot="action"
+          slot-scope="text, record"
+        >
+          <a
+            href="javascript:;"
+            @click="handleDetail(record)"
+          >璇︽儏</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">鏇村
+              <a-icon type="down" />
+            </a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleEdit(record)">缂栬緫</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm
+                  title="纭畾鍒犻櫎鍚�?"
+                  @confirm="() => handleDelete(record.id)"
+                >
+                  <a>鍒犻櫎</a>
+                </a-popconfirm>
+
+              </a-menu-item>
+              <a-menu-item v-if="record.ruleStatus == 0">
+                <a-popconfirm
+                  title="纭畾鍚敤鍚�?"
+                  @confirm="() => handleActive(record.id)"
+                >
+                  <a>鍚敤</a>
+                </a-popconfirm>
+              </a-menu-item>
+              <a-menu-item v-if="record.ruleStatus == 1">
+                <a-popconfirm
+                  title="纭畾绂佺敤鍚�?"
+                  @confirm="() => handleActive(record.id)"
+                >
+                  <a>绂佺敤</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+    <!-- table鍖哄煙-end -->
+
+    <!-- 琛ㄥ崟鍖哄煙 -->
+    <sampling-rules-model
+      ref="modalForm"
+      @ok="modalFormOk"
+    ></sampling-rules-model>
+  </a-card>
+</template>
+
+<script>
+//鎸夐渶寮曞叆 缁勪欢
+import SamplingRulesModel from './modules/samplingRules/SamplingRulesModel'
+
+import { deleteAction, requestPut, getAction } from '@/api/manage'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import JEllipsis from '@/components/jeecg/JEllipsis'
+import JInput from '@/components/jeecg/JInput'
+
+export default {
+  name: 'SamplingRulesList',
+  mixins: [JeecgListMixin],
+  components: {
+    SamplingRulesModel,
+    JEllipsis,
+    JInput,
+  },
+  data() {
+    return {
+      dataSource: [],
+      /* 鍒嗛〉鍙傛暟 */
+      ipagination: {
+        current: 1,
+        pageSize: 5,
+        pageSizeOptions: ['5', '10', '20'],
+        showTotal: (total, range) => {
+          return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�"
+        },
+        total: 0
+      },
+      // 琛ㄥご
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: "center",
+          customRender: function (t, r, index) {
+            return parseInt(index) + 1;
+          }
+        },
+        {
+          title: '鎶芥牱瑙勫垯缂栫爜',
+          align: "center",
+          dataIndex: 'ruleCode'
+        },
+        {
+          title: '鎶芥牱瑙勫垯鍚嶇О',
+          align: "center",
+          dataIndex: 'ruleName'
+        },
+        {
+          title: '鎶芥牱瑙勫垯鍒嗙被',
+          align: "center",
+          dataIndex: 'ruleCategory_dictText'
+        },
+        {
+          title: '鎶芥牱鏁伴噺',
+          align: "center",
+          dataIndex: 'samplingQuantity'
+        },
+        {
+          title: '鎵归噺涓婇檺鍊�',
+          align: "center",
+          dataIndex: 'batchUpperLimit'
+        },
+        {
+          title: '鎵归噺涓嬮檺鍊�',
+          align: "center",
+          dataIndex: 'batchLowerLimit'
+        },
+        {
+          title: '鏈�澶т笉鍚堟牸鏁�',
+          align: "center",
+          dataIndex: 'maxUnqualifiedQuantity'
+        },
+        {
+          title: '澶囨敞',
+          align: 'center',
+          dataIndex: 'remark'
+        },
+        {
+          width: 100,
+          title: '鐘舵��',
+          align: 'center',
+          scopedSlots: {
+            customRender: 'status',
+          },
+          dataIndex: 'ruleStatus'
+        },
+        {
+          width: 150,
+          title: '鎿嶄綔',
+          dataIndex: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' },
+        }
+      ],
+      url: {
+        list: '/qms/samplingRules/list',
+        delete: '/qms/samplingRules/delete',
+        active: '/qms/samplingRules/active',
+      },
+    }
+  },
+  mounted() {
+  },
+  methods: {
+    loadData(arg) {
+      if (arg === 1) {
+        this.ipagination.current = 1;
+      }
+      var params = this.getQueryParams();//鏌ヨ鏉′欢
+      this.loading = true;
+      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;
+      })
+    },
+    //绂佺敤鐘舵�佹牱寮�
+    tableRowClass(record, index) {
+      if (record.warehouseStatus != "1") {
+        return "frozenRowClass";
+      }
+      return "";
+    },
+    //鍚敤绂佺敤
+    handleActive(id) {
+      if (!this.url.active) {
+        this.$message.error("璇疯缃畊rl.active!")
+        return
+      }
+      let that = this;
+      requestPut(that.url.active, {}, { id: id }).then((res) => {
+        if (res.success) {
+          that.$message.success(res.message);
+          that.loadData();
+        } else {
+          that.$message.warning(res.message);
+        }
+      });
+    },
+  },
+
+}
+</script>
+<style lang="less" scoped>
+@import '~@assets/less/common.less';
+.frozenRowClass {
+  color: #c9c9c9;
+}
+.success {
+  color: green;
+}
+.error {
+  color: red;
+}
+.fontweight {
+  font-weight: bold;
+}
+.ant-card-body .table-operator {
+  margin-bottom: 18px;
+}
+
+.ant-table-tbody .ant-table-row td {
+  padding-top: 15px;
+  padding-bottom: 15px;
+}
+
+.anty-row-operator button {
+  margin: 0 5px;
+}
+
+/deep/.ant-btn-danger {
+  background-color: #ffffff;
+}
+
+.ant-modal-cust-warp {
+  height: 100%;
+}
+
+.ant-modal-cust-warp .ant-modal-body {
+  height: calc(100% - 110px) !important;
+  overflow-y: auto;
+}
+
+.ant-modal-cust-warp .ant-modal-content {
+  height: 90% !important;
+  overflow-y: hidden;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3