cuijian
2025-07-03 f761b7eb031c316afb754c73f2d985368958d745
质量管理-抽样规则、缺陷维护功能
已添加5个文件
已修改9个文件
1361 ■■■■■ 文件已修改
src/components/jeecgbiz/JSelectBizComponent/JSelectBizComponentModal.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/jeecgbiz/JSelectMultiUser.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/ShiftGroupManager.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/ShiftManager.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/SupplierList.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/WarehouseList.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/DefectList.vue 322 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/InspectionItemList.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/InspectionToolsList.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/SamplingRulesList.vue 342 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/modules/defect/DefectModel.vue 248 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/modules/inspectionItem/InspectionItemModel.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/modules/inspectionItem/JSelectMultiInspectionTools.vue 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/modules/samplingRules/SamplingRulesModel.vue 287 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/jeecgbiz/JSelectBizComponent/JSelectBizComponentModal.vue
@@ -14,18 +14,18 @@
        <!-- æŸ¥è¯¢åŒºåŸŸ -->
        <a-form layout="inline" class="j-inline-form">
          <!-- å›ºå®šæ¡ä»¶ -->
          <a-form-item :label="(queryParamText||name)">
          <!-- <a-form-item :label="(queryParamText||name)">
            <a-input v-model="queryParam[queryParamCode||valueKey]" :placeholder="'请输入' + (queryParamText||name)" @pressEnter="searchQuery"/>
          </a-form-item>
          </a-form-item> -->
          <!-- åŠ¨æ€ç”Ÿæˆçš„æŸ¥è¯¢æ¡ä»¶ -->
          <j-select-biz-query-item v-if="queryConfig.length>0" v-show="showMoreQueryItems" :queryParam="queryParam" :queryConfig="queryConfig" @pressEnter="searchQuery"/>
          <j-select-biz-query-item v-if="queryConfig.length>0" :queryParam="queryParam" :queryConfig="queryConfig" @pressEnter="searchQuery"/>
          <!-- æŒ‰é’® -->
          <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 v-if="queryConfig.length>0" @click="showMoreQueryItems=!showMoreQueryItems" style="margin-left: 8px">
          <!-- <a v-if="queryConfig.length>0" @click="showMoreQueryItems=!showMoreQueryItems" style="margin-left: 8px">
            {{ showMoreQueryItems ? '收起' : '展开' }}
            <a-icon :type="showMoreQueryItems ? 'up' : 'down'"/>
          </a>
          </a> -->
        </a-form>
        <a-table
@@ -354,6 +354,16 @@
        }
      },
    searchQuery() {
      this.loadData(1);
      this.selectedRowKeys = []
    },
    searchReset() {
      this.queryParam = {}
      this.loadData(1);
      this.selectedRowKeys = []
    },
    }
  }
</script>
src/components/jeecgbiz/JSelectMultiUser.vue
@@ -44,20 +44,24 @@
        // å¤šæ¡ä»¶æŸ¥è¯¢é…ç½®
        queryConfigDefault: [
          {
            key: 'username',
            label: '账号',
          },
          {
            key: 'sex',
            label: '性别',
            // å¦‚果包含 dictCode,那么就会显示成下拉框
            dictCode: 'sex',
          },
          {
            key: 'birthday',
            label: '生日',
            placeholder: '请选择出生日期',
            // å¦‚果想要使用局部注册的组件,就必须要使用箭头函数
            customRender: ({key, queryParam, options}) => {
              return <j-date {...options} vModel={queryParam[key]} style="width:180px;"/>
            },
          },
          // {
          //   key: 'birthday',
          //   label: '生日',
          //   placeholder: '请选择出生日期',
          //   // å¦‚果想要使用局部注册的组件,就必须要使用箭头函数
          //   customRender: ({key, queryParam, options}) => {
          //     return <j-date {...options} vModel={queryParam[key]} style="width:180px;"/>
          //   },
          // },
        ],
      }
    },
src/views/base/ShiftGroupManager.vue
@@ -7,13 +7,13 @@
          <!-- æœç´¢åŒºåŸŸ -->
          <a-form layout="inline" @keyup.enter.native="searchQuery">
            <a-row :gutter="24">
              <a-col :md="12" :sm="8">
              <a-col :md="6" :sm="8">
                <a-form-item label="班组名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
                  <a-input placeholder="" v-model="queryParam.groupName"></a-input>
                </a-form-item>
              </a-col>
              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
            <a-col :md="12" :sm="24">
            <a-col :md="6" :sm="24">
               <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">查询</a-button>
              <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </a-col>
src/views/base/ShiftManager.vue
@@ -5,17 +5,17 @@
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="班次编号">
              <j-input placeholder="请输入班次编号" v-model="queryParam.shiftCode"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="班次名称">
              <j-input placeholder="请输入班次名称" v-model="queryParam.shiftName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
          <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>
src/views/base/SupplierList.vue
@@ -10,7 +10,7 @@
      >
        <a-row :gutter="30">
           <a-col :xl="4" :lg="7" :md="8" :sm="24">
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="供应商编号">
              <j-input
                placeholder="请输入供应商编号检索"
@@ -19,7 +19,7 @@
            </a-form-item>
          </a-col>
           <a-col :xl="4" :lg="7" :md="8" :sm="24">
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="供应商名称">
              <j-input
                placeholder="请输入供应商名称检索"
@@ -28,7 +28,7 @@
            </a-form-item>
          </a-col>
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
          <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>
src/views/base/WarehouseList.vue
@@ -10,7 +10,7 @@
      >
        <a-row :gutter="30">
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="仓库编号">
              <j-input
                placeholder="请输入仓库编号检索"
@@ -19,7 +19,7 @@
            </a-form-item>
          </a-col>
           <a-col :xl="4" :lg="7" :md="8" :sm="24">
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="仓库名称">
              <j-input
                placeholder="请输入仓库名称检索"
@@ -28,7 +28,7 @@
            </a-form-item>
          </a-col>
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
          <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>
src/views/qms/DefectList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,322 @@
<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.defectCode"
              ></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.defectName"
              ></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.defectStatus==1"
            status="success"
          />
          <span
            v-if="record.defectStatus==1"
            class="success"
          >启用</span>
          <a-badge
            v-if="record.defectStatus==0"
            status="error"
          />
          <span
            v-if="record.defectStatus==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.defectStatus == 0">
                <a-popconfirm
                  title="确定启用吗?"
                  @confirm="() => handleActive(record.id)"
                >
                  <a>启用</a>
                </a-popconfirm>
              </a-menu-item>
              <a-menu-item v-if="record.defectStatus == 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 -->
    <!-- è¡¨å•区域 -->
    <defect-model
      ref="modalForm"
      @ok="modalFormOk"
    ></defect-model>
  </a-card>
</template>
<script>
//按需引入 ç»„ä»¶
import DefectModel from './modules/defect/DefectModel'
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: 'DefectList',
  mixins: [JeecgListMixin],
  components: {
    DefectModel,
    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: 'defectCode'
        },
        {
          title: '缺陷名称',
          align: "center",
          dataIndex: 'defectName'
        },
        {
          title: '缺陷分类',
          align: "center",
          dataIndex: 'defectCategory_dictText'
        },
        {
          title: '描述',
          align: 'center',
          dataIndex: 'descreption'
        },
        {
          width: 100,
          title: '状态',
          align: 'center',
          scopedSlots: {
            customRender: 'status',
          },
          dataIndex: 'defectStatus'
        },
        {
          width: 150,
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        }
      ],
      url: {
        list: '/qms/defect/list',
        delete: '/qms/defect/delete',
        active: '/qms/defect/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("请设置url.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>
src/views/qms/InspectionItemList.vue
@@ -10,7 +10,7 @@
      >
        <a-row :gutter="30">
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="检验项目编号">
              <j-input
                placeholder="请输入检验项目编号检索"
@@ -19,7 +19,7 @@
            </a-form-item>
          </a-col>
           <a-col :xl="4" :lg="7" :md="8" :sm="24">
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="检验项目名称">
              <j-input
                placeholder="请输入检验项目名称检索"
@@ -28,7 +28,7 @@
            </a-form-item>
          </a-col>
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
          <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>
@@ -197,17 +197,17 @@
        {
          title: '检验项目分类',
          align: "center",
          dataIndex: 'itemCategory'
          dataIndex: 'itemCategoryName'
        },
        {
          title: '定量/定性',
          align: "center",
          dataIndex: 'qualitativeOrQuantitative'
          dataIndex: 'qualitativeOrQuantitativeName'
        },
        {
          title: '测量工具',
          align: "center",
          dataIndex: 'inspectionTools'
          dataIndex: 'inspectionToolsNames'
        },
        {
          title: '备注',
@@ -232,7 +232,7 @@
        }
      ],
      url: {
        list: '/qms/inspectionItem/list',
        list: '/qms/inspectionItem/queryList',
        delete: '/qms/inspectionItem/delete',
        active: '/qms/inspectionItem/active',
      },
src/views/qms/InspectionToolsList.vue
@@ -10,7 +10,7 @@
      >
        <a-row :gutter="30">
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="检验工具编码">
              <j-input
                placeholder="请输入检验工具编码检索"
@@ -19,7 +19,7 @@
            </a-form-item>
          </a-col>
           <a-col :xl="4" :lg="7" :md="8" :sm="24">
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="检验工具名称">
              <j-input
                placeholder="请输入检验工具名称检索"
@@ -28,7 +28,7 @@
            </a-form-item>
          </a-col>
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
          <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>
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("请设置url.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>
src/views/qms/modules/defect/DefectModel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,248 @@
<template>
  <a-modal
    :title="title"
    :width="800"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="缺陷编码"
            >
              <a-input
                :disabled="disableSubmit"
                allow-clear
                placeholder="请输入缺陷编码"
                v-decorator="['defectCode', validatorRules.defectCode ]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="缺陷名称"
            >
              <a-input
                :disabled="disableSubmit"
                allow-clear
                placeholder="请输入缺陷名称"
                v-decorator="['defectName', validatorRules.defectName ]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="缺陷分类"
            >
              <j-dict-select-tag
                :disabled="disableSubmit"
                placeholder="请输入缺陷分类"
                v-decorator="['defectCategory', validatorRules.defectCategory ]"
                dictCode="defect_category"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="描述"
            >
            <a-textarea :disabled="disableSubmit" placeholder="请输入描述" v-decorator="['descreption', validatorRules.descreption ]"/>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import pick from 'lodash.pick'
import { duplicateCheck } from '@/api/api'//重复校验
import JDictSelectTag from '../../../../components/dict/JDictSelectTag.vue'
export default {
  components: { JDictSelectTag },
  name: "DefectModal",
  data() {
    return {
      title: "操作",
      visible: false,
      disableSubmit: false,
      model: {},
      defectId: "", //保存缺陷id
      labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
      confirmLoading: false,
      form: this.$form.createForm(this),
      validatorRules: {
        defectCode: {
          rules: [
            { required: true, message: '请输入缺陷编码' },
            { validator: this.validateNum },
          ]
        },
        defectName: {
          rules: [
            { required: true, message: '请输入缺陷名称' },
            { validator: this.validateName },
          ]
        },
         defectCategory: {
          rules: [
            { required: true, message: '请选择缺陷分类' },
          ]
        },
      },
      url: {
        add: "/qms/defect/add",
        edit: "/qms/defect/edit",
      },
    }
  },
  created() {
  },
  methods: {
    add() {
      this.edit({});
    },
    edit(record) {
      this.form.resetFields();
      this.model = Object.assign({}, record);
      this.defectId = record.id;
      this.visible = true;
      this.$nextTick(() => {
        this.form.setFieldsValue(
          pick(this.model, 'defectCode', 'defectName','defectCategory','defectStatus','descreption')
        )
      });
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleOk() {
      const that = this;
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let httpurl = '';
          let method = '';
          if (!this.model.id) {
            httpurl += this.url.add;
            method = 'post';
          } else {
            httpurl += this.url.edit;
            method = 'put';
          }
          let formData = Object.assign(this.model, values);
          httpAction(httpurl, formData, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message);
              that.$emit('ok');
            } else {
              that.$message.warning(res.message);
            }
          }).finally(() => {
            that.confirmLoading = false;
            that.close();
          })
        }
      })
    },
    handleCancel() {
      this.close()
    },
    //验证 ç¼–号
    validateNum(rule, value, callback) {
      var params = {
        tableName: 'qms_defect',
        fieldName: 'defect_code',
        fieldVal: value,
        dataId: this.defectId,
        //数据库中存在字段del_flag并使用该字段作为未删除策略,真删除:false å‡åˆ é™¤ï¼štrue
        delFlag: 'true',
      };
      duplicateCheck(params).then((res) => {
        if (res.success) {
          callback();
        } else {
          callback("缺陷编码已存在!");
        }
      })
    },
    //验证 åç§°
    validateName(rule, value, callback) {
      var params = {
        tableName: 'qms_defect',
        fieldName: 'defect_name',
        fieldVal: value,
        dataId: this.defectId,
        //数据库中存在字段del_flag并使用该字段作为未删除策略,真删除:false å‡åˆ é™¤ï¼štrue
        delFlag: 'true',
      };
      duplicateCheck(params).then((res) => {
        if (res.success) {
          callback();
        } else {
          callback("缺陷名称已存在!");
        }
      })
    },
    // å…³é—­å¼¹çª—时清除表单校验
    removeValidate() {
      if (this.$refs.form) this.$refs.form.clearValidate()
    }
  }
}
</script>
<style scoped>
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
/** ä¸»è¡¨å•行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
</style>
src/views/qms/modules/inspectionItem/InspectionItemModel.vue
@@ -82,12 +82,11 @@
              :wrapperCol="wrapperCol"
              label="测量工具"
            >
              <a-input
                :disabled="disableSubmit"
                allow-clear
                placeholder="请选择测量工具"
                v-decorator="['inspectionTools', validatorRules.inspectionTools ]"
              />
              <j-select-multi-inspection-tools
                :disabled="disableSubmit"
                v-decorator="['inspectionTools', validatorRules.inspectionTools ]"
                valueKey="id">
              </j-select-multi-inspection-tools>
            </a-form-item>
          </a-col>
        </a-row>
@@ -111,9 +110,11 @@
import { httpAction, getAction } from '@/api/manage'
import pick from 'lodash.pick'
import { duplicateCheck } from '@/api/api'//重复校验
import JSelectMultiInspectionTools from './JSelectMultiInspectionTools'
export default {
  name: "InspectionItemModal",
  components: {JSelectMultiInspectionTools},
  data() {
    return {
      title: "操作",
@@ -229,7 +230,7 @@
    //验证 åç§°
    validateName(rule, value, callback) {
      var params = {
        tableName: 'qms_inspection_items',
        tableName: 'qms_inspection_item',
        fieldName: 'item_name',
        fieldVal: value,
        dataId: this.inspectionItemId,
src/views/qms/modules/inspectionItem/JSelectMultiInspectionTools.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,63 @@
<template>
  <!-- å®šä¹‰åœ¨è¿™é‡Œçš„参数都是不可在外部覆盖的,防止出现问题 -->
  <j-select-biz-component
    :value="value"
    :ellipsisLength="25"
    :listUrl="url.list"
    :columns="columns"
    v-on="$listeners"
    v-bind="attrs"
  />
</template>
<script>
  import JDate from '@comp/jeecg/JDate'
  import JSelectBizComponent from '../../../../components/jeecgbiz/JSelectBizComponent'
  export default {
    name: 'JSelectMultiInspectionTools',
    components: {JDate, JSelectBizComponent},
    props: {
      value: null, // any type
      queryConfig: {
        type: Array,
        default: () => []
      },
    },
    data() {
      return {
        url: { list: '/qms/inspectionTools/list' },
        columns: [
          { title: '工具编码', align: 'center', width: '25%', widthRight: '70%', dataIndex: 'toolCode' },
          { title: '工具名称', align: 'center', width: '25%', dataIndex: 'toolName' },
          { title: '工具状态', align: 'center', width: '20%', dataIndex: 'toolStatus' },
          { title: '备注', align: 'center', width: '20%', dataIndex: 'remark' }
        ],
        // å®šä¹‰åœ¨è¿™é‡Œçš„参数都是可以在外部传递覆盖的,可以更灵活的定制化使用的组件
        default: {
          name: '工具',
          width: 1200,
          displayKey: 'toolCode',
          returnKeys: ['id', 'toolName'],
          queryParamText: '工具编码',
        },
        // å¤šæ¡ä»¶æŸ¥è¯¢é…ç½®
        queryConfigDefault: [
          {
            key: 'toolName',
            label: '检验工具名称',
          },
        ],
      }
    },
    computed: {
      attrs() {
        return Object.assign(this.default, this.$attrs, {
          queryConfig: this.queryConfigDefault.concat(this.queryConfig)
        })
      }
    }
  }
</script>
<style lang="less" scoped></style>
src/views/qms/modules/samplingRules/SamplingRulesModel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,287 @@
<template>
  <a-modal
    :title="title"
    :width="800"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="规则编码"
            >
              <a-input
                :disabled="disableSubmit"
                allow-clear
                placeholder="请输入规则编码"
                v-decorator="['ruleCode', validatorRules.ruleCode ]"
              />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="规则名称"
            >
              <a-input
                :disabled="disableSubmit"
                allow-clear
                placeholder="请输入规则名称"
                v-decorator="['ruleName', validatorRules.ruleName ]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              :labelCol="{ span: 3 }"
              :wrapperCol="{ span: 21 }"
              label="规则分类"
            >
              <j-dict-select-tag
                :disabled="disableSubmit"
                placeholder="请输入规则分类"
                v-decorator="['ruleCategory', validatorRules.ruleCategory ]"
                dictCode="rule_category"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="抽样数量"
            >
              <a-input-number :disabled="disableSubmit" v-decorator="['samplingQuantity', validatorRules.samplingQuantity ]" :min="1" style="width: 100%" placeholder="请输入抽样数量" />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="最大不合格数"
            >
              <a-input-number :disabled="disableSubmit" v-decorator="['maxUnqualifiedQuantity', validatorRules.maxUnqualifiedQuantity ]" :min="1" style="width: 100%" placeholder="请输入最大不合格数" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="批量下限值"
            >
              <a-input-number :disabled="disableSubmit" v-decorator="['batchLowerLimit', validatorRules.batchLowerLimit ]" :min="1" style="width: 100%" placeholder="请输入批量下限值" />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="批量上限值"
            >
              <a-input-number :disabled="disableSubmit" v-decorator="['batchUpperLimit', validatorRules.batchUpperLimit ]" :min="1" style="width: 100%" placeholder="请输入批量上限值" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              :labelCol="{ span: 3 }"
              :wrapperCol="{ span: 21 }"
              label="备注"
            >
            <a-textarea :disabled="disableSubmit" placeholder="请输入备注" v-decorator="['remark', validatorRules.remark ]"/>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import pick from 'lodash.pick'
import { duplicateCheck } from '@/api/api'//重复校验
import JDictSelectTag from '../../../../components/dict/JDictSelectTag.vue'
export default {
  components: { JDictSelectTag },
  name: "SamplingRulesModal",
  data() {
    return {
      title: "操作",
      visible: false,
      disableSubmit: false,
      model: {},
      samplingRulesId: "", //保存抽样规则id
      labelCol: {
          xs: { span: 24 },
          sm: { span: 6 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 18 },
        },
      confirmLoading: false,
      form: this.$form.createForm(this),
      validatorRules: {
        ruleCode: {
          rules: [
            { required: true, message: '请输入规则编码' },
            { validator: this.validateNum },
          ]
        },
        ruleName: {
          rules: [
            { required: true, message: '请输入规则名称' },
            { validator: this.validateName },
          ]
        },
         ruleCategory: {
          rules: [
            { required: true, message: '请选择规则分类' },
          ]
        },
      },
      url: {
        add: "/qms/samplingRules/add",
        edit: "/qms/samplingRules/edit",
      },
    }
  },
  created() {
  },
  methods: {
    add() {
      this.edit({});
    },
    edit(record) {
      this.form.resetFields();
      this.model = Object.assign({}, record);
      this.samplingRulesId = record.id;
      this.visible = true;
      this.$nextTick(() => {
        this.form.setFieldsValue(
          pick(this.model, 'ruleCode', 'ruleName','ruleCategory','ruleStatus','maxUnqualifiedQuantity',
          'samplingQuantity','batchLowerLimit','batchUpperLimit', 'remark')
        )
      });
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleOk() {
      const that = this;
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let httpurl = '';
          let method = '';
          if (!this.model.id) {
            httpurl += this.url.add;
            method = 'post';
          } else {
            httpurl += this.url.edit;
            method = 'put';
          }
          let formData = Object.assign(this.model, values);
          httpAction(httpurl, formData, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message);
              that.$emit('ok');
            } else {
              that.$message.warning(res.message);
            }
          }).finally(() => {
            that.confirmLoading = false;
            that.close();
          })
        }
      })
    },
    handleCancel() {
      this.close()
    },
    //验证 ç¼–号
    validateNum(rule, value, callback) {
      var params = {
        tableName: 'qms_sampling_rules',
        fieldName: 'rule_code',
        fieldVal: value,
        dataId: this.samplingRulesId,
        //数据库中存在字段del_flag并使用该字段作为未删除策略,真删除:false å‡åˆ é™¤ï¼štrue
        delFlag: 'true',
      };
      duplicateCheck(params).then((res) => {
        if (res.success) {
          callback();
        } else {
          callback("规则编码已存在!");
        }
      })
    },
    //验证 åç§°
    validateName(rule, value, callback) {
      var params = {
        tableName: 'qms_sampling_rules',
        fieldName: 'rule_name',
        fieldVal: value,
        dataId: this.samplingRulesId,
        //数据库中存在字段del_flag并使用该字段作为未删除策略,真删除:false å‡åˆ é™¤ï¼štrue
        delFlag: 'true',
      };
      duplicateCheck(params).then((res) => {
        if (res.success) {
          callback();
        } else {
          callback("规则名称已存在!");
        }
      })
    },
    // å…³é—­å¼¹çª—时清除表单校验
    removeValidate() {
      if (this.$refs.form) this.$refs.form.clearValidate()
    }
  }
}
</script>
<style scoped>
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
/** ä¸»è¡¨å•行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
</style>