cuijian
2025-07-04 e2ca529f2d095293d737b5a2f0b7562e85919418
检验方案
已添加5个文件
已修改17个文件
1486 ■■■■■ 文件已修改
src/views/base/SupplierList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/WarehouseList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/modules/FactoryManager/FactoryModal.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/modules/FactoryManager/SelectUserModal.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/modules/group/GroupModal.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/modules/group/SelectUserModal.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/modules/shift/ShiftModel.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/modules/supplier/SupplierModel.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/modules/warehouse/WarehouseModel.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/DefectList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/InspectionItemList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/InspectionPlanList.vue 429 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/InspectionToolsList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/SamplingRulesList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/modules/defect/DefectModel.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/modules/inspectionItem/InspectionItemModel.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/modules/inspectionPlan/InspectionPlanItemList.vue 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/modules/inspectionPlan/InspectionPlanModel.vue 525 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/modules/inspectionPlan/JSelectInspectionItemListModal.vue 258 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/modules/inspectionPlan/MaterialListModal.vue 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/modules/inspectionTools/InspectionToolsModel.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qms/modules/samplingRules/SamplingRulesModel.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/SupplierList.vue
@@ -102,7 +102,7 @@
              <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
              <a-menu-item v-if="record.supplierStatus==1">
                <a @click="handleEdit(record)">编辑</a>
              </a-menu-item>
              <a-menu-item>
src/views/base/WarehouseList.vue
@@ -98,7 +98,7 @@
              <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
              <a-menu-item v-if="record.warehouseStatus==1">
                <a @click="handleEdit(record)">编辑</a>
              </a-menu-item>
              <a-menu-item>
src/views/base/modules/FactoryManager/FactoryModal.vue
@@ -5,6 +5,7 @@
    :ok=false
    :visible="visible"
    :confirmLoading="confirmLoading"
    :maskClosable="false"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
src/views/base/modules/FactoryManager/SelectUserModal.vue
@@ -5,6 +5,7 @@
      :title="title"
      :width="1000"
      :visible="visible"
      :maskClosable="false"
      @ok="handleOk"
      @cancel="handleCancel"
      cancelText="关闭">
src/views/base/modules/group/GroupModal.vue
@@ -4,6 +4,7 @@
    :width="800"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :maskClosable="false"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
src/views/base/modules/group/SelectUserModal.vue
@@ -5,6 +5,7 @@
      :title="title"
      :width="1000"
      :visible="visible"
      :maskClosable="false"
      @ok="handleOk"
      @cancel="handleCancel"
      cancelText="关闭">
src/views/base/modules/shift/ShiftModel.vue
@@ -1,6 +1,14 @@
<template>
  <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" :okButtonProps="{ props: {disabled: disableSubmit} }"
           @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
  <a-modal
  :title="title"
  :width="800"
  :visible="visible"
  :maskClosable="false"
  :confirmLoading="confirmLoading"
  :okButtonProps="{ props: {disabled: disableSubmit} }"
  @ok="handleOk"
  @cancel="handleCancel"
  cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row :gutter="24">
src/views/base/modules/supplier/SupplierModel.vue
@@ -3,6 +3,7 @@
    :title="title"
    :width="800"
    :visible="visible"
    :maskClosable="false"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
src/views/base/modules/warehouse/WarehouseModel.vue
@@ -4,6 +4,7 @@
    :width="800"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :maskClosable="false"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
src/views/qms/DefectList.vue
@@ -98,7 +98,7 @@
              <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
              <a-menu-item v-if="record.defectStatus==1">
                <a @click="handleEdit(record)">编辑</a>
              </a-menu-item>
              <a-menu-item>
src/views/qms/InspectionItemList.vue
@@ -98,7 +98,7 @@
              <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
              <a-menu-item v-if="record.itemStatus==1">
                <a @click="handleEdit(record)">编辑</a>
              </a-menu-item>
              <a-menu-item>
src/views/qms/InspectionPlanList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,429 @@
<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="6" :sm="8">
            <a-form-item label="检验方案编码">
              <a-input placeholder="请输入检验方案编码" v-model="queryParam.planCode" />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="检验方案分类">
                <j-search-select-tag
                  placeholder="请选择检验方案分类"
                  v-model="queryParam.planCategory"
                  dict="plan_category"
                />
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="8">
              <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 -->
    <a-table
      ref="table"
      size="middle"
      bordered
      rowKey="id"
      :customRow="customRow"
      :rowClassName="tableRowClass"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}"
      @change="handleTableChange"
    >
      <!--状态栏个性展示-->
        <span
          slot="status"
          slot-scope="text,record"
        >
          <a-badge
            v-if="record.planStatus==1"
            status="success"
          />
          <span
            v-if="record.planStatus==1"
            class="success"
          >启用</span>
          <a-badge
            v-if="record.planStatus==0"
            status="error"
          />
          <span
            v-if="record.planStatus==0"
            class="error"
          >禁用</span>
        </span>
        <span
          slot="publishStatus"
          slot-scope="text,record"
        >
          <a-badge
            v-if="record.publishStatus==1"
            status="success"
          />
          <span
            v-if="record.publishStatus==1"
            class="success"
          >已发布</span>
          <a-badge
            v-if="record.publishStatus==0"
            status="error"
          />
          <span
            v-if="record.publishStatus==0"
            class="error"
          >待发布</span>
        </span>
        <span
          slot="version"
          slot-scope="text,record"
        >
          <span
            v-if="record.planStatus==1"
            class="success"
          >{{record.version}}</span>
          <span
            v-if="record.planStatus==0"
            class="error"
          >{{record.version}}</span>
        </span>
        <span
          slot="action"
          slot-scope="text, record"
          v-if="record.isNewVersion == 1"
        >
          <a-popconfirm
            v-if="record.publishStatus == 0 && record.planStatus == 1"
            title="确定发布吗?"
            @confirm="() => handlePublish(record.id)"
          >
            <a>发布</a>
          </a-popconfirm>
          <a-popconfirm
            v-if="record.publishStatus == 1 && record.planStatus == 1"
            title="确定取消发布吗?"
            @confirm="() => handlePublish(record.id)"
          >
            <a>取消发布</a>
          </a-popconfirm>
          <a-divider type="vertical" v-if="record.publishStatus == 1 && record.planStatus == 1"/>
           <a-popconfirm
            v-if="record.publishStatus == 1 && record.planStatus == 1"
            title="确定升版吗?"
            @confirm="() => handleVersion(record.id)"
          >
            <a>升版</a>
          </a-popconfirm>
          <a-divider type="vertical" v-if="record.planStatus == 1"/>
          <a-dropdown>
            <a class="ant-dropdown-link">更多
              <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item v-if="record.planStatus==1 && record.publishStatus==0">
                <a @click="handleEdit(record)">编辑</a>
              </a-menu-item>
              <a-menu-item>
                <a
                  href="javascript:;"
                  @click="handleDetail(record)"
                >详情</a>
              </a-menu-item>
              <a-menu-item v-if="record.publishStatus==0">
                <a-popconfirm
                  title="确定删除吗?"
                  @confirm="() => handleDelete(record.id)"
                >
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
              <a-menu-item v-if="record.planStatus == 0">
                <a-popconfirm
                  title="确定启用吗?"
                  @confirm="() => handleActive(record.id)"
                >
                  <a>启用</a>
                </a-popconfirm>
              </a-menu-item>
              <a-menu-item v-if="record.planStatus == 1 && record.publishStatus == 0">
                <a-popconfirm
                  title="确定禁用吗?"
                  @confirm="() => handleActive(record.id)"
                >
                  <a>禁用</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
    </a-table>
    <a-tabs defaultActiveKey="1">
      <a-tab-pane tab="检验方案检验项明细" key="1">
        <inspection-plan-item-list ref="inspectionPlanItemList"></inspection-plan-item-list>
      </a-tab-pane>
    </a-tabs>
    <!-- table区域-end -->
    <inspection-plan-model ref="modalForm" @ok="modalFormOk"></inspection-plan-model>
  </a-card>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import InspectionPlanModel from './modules/inspectionPlan/InspectionPlanModel'
import InspectionPlanItemList from './modules/inspectionPlan/InspectionPlanItemList'
import { requestPut,postAction,getAction } from '@/api/manage'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
export default {
  name: 'InspectionPlanList',
  mixins: [JeecgListMixin],
  components: {
    InspectionPlanModel,
    InspectionPlanItemList,
    JDictSelectTag,
    JSearchSelectTag,
  },
  data() {
    return {
      description: '检验方案',
      url: {
        list: '/qms/inspectionPlan/list',
        importExcelUrl: '/qms/inspectionPlan/importExcel',
        exportXlsUrl: '/qms/inspectionPlan/exportXls',
        edit:'/qms/inspectionPlan/edit',
        submit:'/qms/inspectionPlan/submit',
        active: '/qms/inspectionPlan/active',
        publish:'/qms/inspectionPlan/publish',
        version:'/qms/inspectionPlan/version'
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '检验方案编码',
          align: 'center',
          dataIndex: 'planCode',
          sorter: true,
        },
        {
          title: '检验方案名称',
          align: 'center',
          dataIndex: 'planName',
        },
        {
          title: '检验方案分类',
          align: 'center',
          dataIndex: 'planCategory_dictText',
        },
        {
          title: '物料编码',
          align: 'center',
          dataIndex: 'materialNumber',
        },
        {
          title: '物料名称',
          align: 'center',
          dataIndex: 'materialName',
        },
        {
          title: '抽样规则',
          align: 'center',
          dataIndex: 'ruleId_dictText',
        },
        {
          title: '方案描述',
          align: 'center',
          dataIndex: 'descreption',
        },
        {
          title: '版本',
          align: 'center',
          scopedSlots: {
            customRender: 'version',
          },
          dataIndex: 'version',
        },
        {
          title: '方案状态',
          align: 'center',
          scopedSlots: {
            customRender: 'status',
          },
          dataIndex: 'planStatus',
        },
        {
          title: '发布状态',
          align: 'center',
          scopedSlots: {
            customRender: 'publishStatus',
          },
          dataIndex: 'publishStatus',
        },
        {
          width: 180,
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
      ],
      loading:false
    }
  },
  computed: {
    /* å¯¼å…¥è·¯å¾„页面重新计算 */
    importExcelUrl: function () {
      //  return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;//开发环境指向
      return `${window._CONFIG['hxFileURL']}/${this.url.importExcelUrl}`
    },
  },
  methods: {
    searchQuery(){
      this.selectedRowKeys = []
      this.$refs.inspectionPlanItemList.dataSource = []
      this.loadData(1);
    },
    searchReset() {
      this.queryParam = {}
      this.selectedRowKeys = []
      this.$refs.inspectionPlanItemList.dataSource = []
      this.loadData(1);
    },
    customRow(record) {
      return {
        on: {
          click: (e) => {
            this.onSelectChange(record.id.split(","), [record]);
          },
        },
      }
    },
    onSelectChange(selectedRowKeys, selectionRows) {
        this.selectedRowKeys = selectedRowKeys;
        this.selectionRows = selectionRows;
        //将当前选中的记录传到子页面
        this.$bus.$emit('getInspectionPlanItemData', this.selectionRows[0])
      },
    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
    },
    handleSubmit(record) {
        let that = this;
        that.loading = true
        getAction(that.url.submit, { id:record.id}).then((res) => {
          if (res.success) {
            that.$message.success(res.message);
            that.loadData();
          } else {
            that.$message.warning(res.message);
          }
        }).finally(() => {
          that.loading = false
        })
      },
       //启用禁用
    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);
        }
      });
    },
    //发布
    handlePublish(id) {
      if (!this.url.publish) {
        this.$message.error("请设置url.publish!")
        return
      }
      let that = this;
      requestPut(that.url.publish, {}, { id: id }).then((res) => {
        if (res.success) {
          that.$message.success(res.message);
          that.loadData();
        } else {
          that.$message.warning(res.message);
        }
      });
    },
    //升版
    handleVersion(id) {
      if (!this.url.version) {
        this.$message.error("请设置url.version!")
        return
      }
      let that = this;
      requestPut(that.url.version, {}, { id: id }).then((res) => {
        if (res.success) {
          that.$message.success(res.message);
          that.loadData();
        } else {
          that.$message.warning(res.message);
        }
      });
    },
    tableRowClass(record, index) {
      if (record.isNewVersion != '1') {
        return "frozenRowClass";
      }
      return "";
    },
  },
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
/deep/ .frozenRowClass {
  color: #c9c9c9;
}
/deep/ .notshow {
  display: none;
}
/deep/ .checked-td-of-add-table {
  background-color: rgba(220, 220, 220, 1);
}
</style>
src/views/qms/InspectionToolsList.vue
@@ -98,7 +98,7 @@
              <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
              <a-menu-item v-if="record.toolStatus==1">
                <a @click="handleEdit(record)">编辑</a>
              </a-menu-item>
              <a-menu-item>
src/views/qms/SamplingRulesList.vue
@@ -98,7 +98,7 @@
              <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
              <a-menu-item v-if="record.ruleStatus==1">
                <a @click="handleEdit(record)">编辑</a>
              </a-menu-item>
              <a-menu-item>
src/views/qms/modules/defect/DefectModel.vue
@@ -4,6 +4,7 @@
    :width="800"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :maskClosable="false"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
src/views/qms/modules/inspectionItem/InspectionItemModel.vue
@@ -3,6 +3,7 @@
    :title="title"
    :width="800"
    :visible="visible"
    :maskClosable="false"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
src/views/qms/modules/inspectionPlan/InspectionPlanItemList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,103 @@
<template>
  <a-card
    :bordered="false"
    class="card-area"
  >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
    </a-table>
  </a-card>
</template>
<script>
import { requestPut } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
  name: 'InspectionPlanItemList',
  mixins: [JeecgListMixin],
  components: {},
  data() {
    return {
      url: {
        list: '/qms/inspectionItem/queryListByPlanId',
      },
      queryParam: {},
      nodeType: 0,
      dataSource: [],
      disableMixinCreated:true,
      columns: [
        {
          title: '检验项目编码',
          align: 'center',
          dataIndex: 'itemCode',
          width: '10%',
        },
        {
          title: '检验项目名称',
          dataIndex: 'itemName',
          align: 'center',
        },
        {
          title: '检验项目分类',
          dataIndex: 'itemCategoryName',
          align: 'center',
        },
        {
          title: '定量/定性',
          dataIndex: 'qualitativeOrQuantitativeName',
          align: 'center',
        },
         {
          title: '测量工具',
          dataIndex: 'inspectionToolsNames',
          align: 'center',
        },
        {
          title: '排序',
          dataIndex: 'sorter',
          align: 'center',
        },
        {
          title: '标准值',
          dataIndex: 'standardValue',
          align: 'center',
        },
        {
          title: '上公差',
          dataIndex: 'maxValue',
          align: 'center',
        },
        {
          title: '下公差',
          dataIndex: 'minValue',
          align: 'center',
        }
      ]
    }
  },
  methods: {
  },
  mounted() {
    this.$bus.$on('getInspectionPlanItemData', (data) => {
      this.queryParam.inspectionPlanId = data.id;
      this.searchQuery();
    })
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/qms/modules/inspectionPlan/InspectionPlanModel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,525 @@
<template>
  <a-modal
    :title="title"
    :visible="visible"
    :fullScreen="true"
    :width="1200"
    @ok="handleOk"
    @cancel="handleCancel"
    :maskClosable="false"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="检验方案编码">
              <a-input :disabled="disableSubmit" placeholder="请输入检验方案编码" v-decorator="['planCode', validatorRules.planCode]" />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="检验方案名称">
              <a-input :disabled="disableSubmit" placeholder="请输入检验方案名称" v-decorator="['planName', validatorRules.planName]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="检验方案分类">
              <j-dict-select-tag
                :disabled="disableSubmit"
                type="list"
                v-decorator="['planCategory', validatorRules.planCategory]"
                :triggerChange="true"
                dictCode="plan_category"
                placeholder="请选择检验方案分类"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="抽样规则">
             <a-select
                :disabled="disableSubmit"
                :triggerChange="true"
                :options="ruleOptions"
                v-decorator="[ 'ruleId', validatorRules.ruleId ]"
                placeholder='请选择抽样规则'
              />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="物料编码">
             <a-input-search v-decorator="['materialNumber', validatorRules.materialNumber]" :disabled="disableSubmit" @search="materialSearch" enter-button
                              placeholder='请选择物料信息'/>
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="物料名称">
             <a-input :disabled="true" v-decorator="['materialName', validatorRules.materialName]" placeholder='选择物料后自动带出' />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item :labelCol="{ span: 3 }" :wrapperCol="{ span: 21 }" label="方案描述">
              <a-textarea
                :disabled="disableSubmit"
                :rows="2"
                placeholder="..."
                v-decorator="['descreption', validatorRules.descreption]"
              />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectInspectionItemList()" :disabled="disableSubmit">选择检验项目</a-button>
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
       @change="handleTableChange"
    >
    <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index">
        <div :key="col.dataIndex">
          <a-input-number
            :disabled="disableSubmit"
            v-if="col.dataIndex == 'sorter'"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="1"
          />
        </div>
        <div :key="col.dataIndex">
          <a-input-number
            :disabled="disableSubmit"
            v-if="col.dataIndex == 'standardValue'"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="0"
          />
        </div>
        <div :key="col.dataIndex">
          <a-input-number
            :disabled="disableSubmit"
            v-if="col.dataIndex == 'maxValue'"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="0"
          />
        </div>
        <div :key="col.dataIndex">
          <a-input-number
            :disabled="disableSubmit"
            v-if="col.dataIndex == 'minValue'"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="0"
          />
        </div>
      </template>
    <span slot="action" slot-scope="text, record, index">
        <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record, index)" :disabled="disableSubmit">
          <a>删除</a>
        </a-popconfirm>
      </span>
    </a-table>
    <template slot="footer" v-if="disableSubmit == false">
      <a-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
      <a-button @click="handleOk" :disabled="isDisabled" type="primary">确定</a-button>
    </template>
    <template slot="footer" v-if="disableSubmit == true">
      <a-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
    </template>
    <j-select-inspection-item-list-modal ref="inspectionItemForm" @ok="modalFormOk"></j-select-inspection-item-list-modal>
    <material-list-modal ref="materialListModel" @sendSelectionRows="getMaterialRows"></material-list-modal>
  </a-modal>
</template>
<script>
import pick from 'lodash.pick'
import { ajaxGetDictItems } from '@/api/api'
import moment from 'moment'
import { getAction, postAction, requestPut } from '@/api/manage'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
import { filterObj } from '@/utils/util'
import JSelectInspectionItemListModal from './JSelectInspectionItemListModal'
import store from '@/store'
import MaterialListModal from './MaterialListModal'
export default {
  name: 'InspectionPlanModel',
  components: {
    JMultiSelectTag,
    JDictSelectTag,
    JSelectInspectionItemListModal,
    JSearchSelectTag,
    store,
    MaterialListModal
  },
  data() {
    return {
     /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      isDisabled: false,
      selectedRowKeys: {},
      state: {
        show: false,
        maintenanceValue: 1,
        checkValue: 1,
        maintenanceState: false,
        checkState: false,
      },
      inboundDate: '',
      applicationDate: '',
      supplierShow: false,
      disableSubmit: false,
      numDisable:false,
      quantityDisable:false,
      onlyCodeDisable:true,
      returnShow:false,
      toolingShow:false,
      sharpenShow:false,
      addDisable:false,
      toolinngOptions:[],
      title: '操作',
      visible: false,
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      loading: false,
      form: this.$form.createForm(this),
      dataSource: [],
      toolingTreeData:[],
      warehouseOptions:[],
      locationOptions:[],
      allToolingList:[],
      param: {},
      barcodeCurrentType: false,
      planId:'',
      validatorRules: {
        planCode: {
          rules: [
            {
              required: true,
              message: '请输入检验方案编码!',
            },
          ],
        },
        planName: {
          rules: [
            {
              required: true,
              message: '请输入检验方案名称!',
            },
          ],
        },
        planCategory: {
          rules: [
            {
              required: true,
              message: '请选择检验方案分类!',
            },
          ],
        },
      },
      url: {
        add: '/qms/inspectionPlan/add',
        edit: '/qms/inspectionPlan/edit',
        inpspectionItemList:'/qms/inspectionItem/list',
        detailList:'/qms/inspectionItem/queryList',
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
           width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '检验项目编码',
          align: 'center',
          dataIndex: 'itemCode',
          width: 150,
        },
        {
          title: '检验项目名称',
          align: 'center',
          dataIndex: 'itemName'
        },
        {
          title: '检验项目分类',
          align: 'center',
          dataIndex: 'itemCategoryName',
        },
        {
          title: '定量/定性',
          align: 'center',
          dataIndex: 'qualitativeOrQuantitativeName'
        },
        {
          title: '测量工具',
          align: 'center',
          dataIndex: 'inspectionToolsNames',
        },
        {
          title: '排序',
          dataIndex: 'sorter',
          align: 'center',
          scopedSlots: { customRender: 'sorter' },
        },
        {
          title: '标准值',
          dataIndex: 'standardValue',
          align: 'center',
          scopedSlots: { customRender: 'standardValue' },
        },
        {
          title: '上公差',
          dataIndex: 'maxValue',
          align: 'center',
          scopedSlots: { customRender: 'maxValue' },
        },
        {
          title: '下公差',
          dataIndex: 'minValue',
          align: 'center',
          scopedSlots: { customRender: 'minValue' },
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
      ],
      ruleOptions:[]
    }
  },
  created() {
    ajaxGetDictItems("qms_sampling_rules,rule_name,id", null).then((res) => {
        if (res.success) {
          this.ruleOptions = res.result
        }
      })
  },
  methods: {
    materialSearch() {
        this.$refs.materialListModel.openPage()
        this.$refs.materialListModel.title = '选择物料'
        this.$refs.materialListModel.disableSubmit = false
      },
      getMaterialRows(val) {
        if (val.materialNumber) {
          const initialData = {
            materialNumber: val.materialNumber,
            materialName: val.materialName
          };
          this.form.setFieldsValue(initialData);
        }
      },
      handleChange(value, key, column, index) {
        const temp = [...this.dataSource]
        const target = temp.filter(item => key === item.key)[index];
        if (target) {
          target[column.dataIndex] = value
          this.dataSource = temp
        }
    },
    modalFormOk() {
    },
    getQueryParams() {
      this.param.pageNo = this.ipagination.current
      this.param.pageSize = this.ipagination.pageSize
      return filterObj(this.param)
    },
    add() {
      this.handle = store.getters.userInfo.username
      this.edit({})
    },
    edit(record) {
      let that = this
      this.form.resetFields()
      this.model = Object.assign({}, record)
      this.visible = true
      this.isDisabled = false
      this.disableSubmit = false
      if (record.id) {
        this.planId = record.id
        this.detailList(this.planId)
      }
      this.$nextTick(() => {
        this.form.setFieldsValue(
          pick(this.model, 'planCode', 'planName', 'planCategory', 'materialNumber', 'materialName','ruleId','planStatus','descreption')
        )
      })
    },
    close() {
      this.$emit('close')
      this.dataSource = []
      this.visible = false
      this.supplierShow = false,
       this.disableSubmit = false,
       this.numDisable = false,
      this.quantityDisable = false,
       this.onlyCodeDisable = true,
       this.returnShow = false,
       this.toolingShow = false,
       this.sharpenShow = false,
       this.addDisable = false
    },
    handleTableChange(pagination, filters, sorter) {
      this.ipagination = pagination
      this.detailList(this.planId);
    },
    handleOk() {
      const that = this
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = Object.assign(this.model, values)
          formData.detailData = this.dataSource
          let http = ''
          if(this.model.id){
            http = this.url.edit
          }else{
            http = this.url.add
          }
          postAction(http, formData)
            .then((res) => {
              if (res.success) {
                that.$message.success(res.message)
                that.$emit('ok', new Date())
              } else {
                that.$message.warning(res.message)
              }
            })
            .finally(() => {
              that.confirmLoading = false
              that.close()
            })
        }
      })
    },
    handleCancel() {
      this.close()
    },
    //选择工具
    selectInspectionItemList: function () {
      let ids = []
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].id)
      }
      this.$refs.inspectionItemForm.showModal(ids)
      this.$refs.inspectionItemForm.title = '选择检验项目'
      this.$refs.inspectionItemForm.disableSubmit = false
    },
    handleDelete(record, index) {
      this.dataSource.splice(index, 1)
    },
    onChange() {},
    //手选人员值
    selectCurrentUserChange(e) {
      console.log('当前手选', e)
      // this.form.setFieldsValue({
      //   // userName: e,
      //   userNameId: e,
      // })
    },
    detailList(planId) {
      this.param.planId = planId
      getAction(this.url.detailList, this.getQueryParams()).then((res) => {
        if (res.success) {
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total;
        }
      })
    },
     filterOption(input, option) {
      return (
        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
      );
    },
  },
  watch: {},
  mounted() {
    this.$bus.$on('selectionRows', (data) => {
      //getCurrSelected äº‹ä»¶ æŽ¥æ”¶ç»„件传递的参数
      for (let i = 0; i < data.length; i++) {
        this.dataSource.push({
          id:data[i].id,
          itemCode: data[i].itemCode,
          itemName: data[i].itemName,
          inspectionTools: data[i].inspectionTools,
          inspectionToolsNames: data[i].inspectionToolsNames,
          itemCategory: data[i].itemCategory,
          itemCategoryName:data[i].itemCategoryName,
          itemStatus:data[i].itemStatus,
          qualitativeOrQuantitative:data[i].qualitativeOrQuantitative,
          qualitativeOrQuantitativeName:data[i].qualitativeOrQuantitativeName
        })
      }
      //this.ipaginationm.total = this.dataSource.length
    })
  },
}
</script>
<style  lang="less" 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;
}
/deep/ .notshow {
  display: none;
}
</style>
src/views/qms/modules/inspectionPlan/JSelectInspectionItemListModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,258 @@
<template>
  <!--支持全屏缩放-->
  <j-modal
    :visible="visible"
    :title="title"
    switchFullscreen
    :maskClosable="false"
    :width="1200"
    @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.itemCode"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="检验项目名称">
                <a-input placeholder="请输入检验项目名称,支持模糊查询" v-model="queryParam.itemName"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="检验项目分类">
               <j-search-select-tag
                  placeholder="请选择检验项目分类"
                  v-model="queryParam.itemCategory"
                  dict="item_category"
                />
              </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"
        :scroll="scrollTrigger"
        size="middle"
        rowKey="id"
        :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'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
export default {
  name: 'JSelectInspectionItemListModal',
  components: {JDictSelectTag,JSearchSelectTag},
  props: {
  },
  data() {
    return {
      queryParam: {},
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '检验项目编码',
          align: 'center',
          dataIndex: 'itemCode',
        },
        {
          title: '检验项目名称',
          align: 'center',
          dataIndex: 'itemName',
        },
         {
          title: '检验项目分类',
          align: 'center',
          dataIndex: 'itemCategoryName',
        },
        {
          title: '定量/定性',
          align: 'center',
          dataIndex: 'qualitativeOrQuantitativeName',
        },
        {
          title: '测量工具',
          align: 'center',
          dataIndex: 'inspectionToolsNames',
        }
      ],
      selectedRowKeys: [],
      oldSlelectRows: [],
      scrollTrigger: {},
      dataSource: [],
      selectionRows: [],
      title: '根据查询结果选择检验项目',
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['5', '10', '20'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      departTree: [],
      visible: false,
      loading: false,
      url: {
         list: '/qms/inspectionItem/queryList',
      },
    }
  },
  computed: {
    rowSelection() {
      return {
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.onSelectChange(selectedRows)
        },
        getCheckboxProps: (record) => ({
          props: {
            disabled: record.distable,
          },
        }),
        selectedRowKeys: this.selectedRowKeys,
      }
    },
  },
  watch: {},
  created() {},
  methods: {
    async loadData(arg) {
      if (arg === 1) {
        this.ipagination.current = 1
      }
      let that = this
      this.loading = true
      let params = this.getQueryParams() //查询条件
      await getAction(this.url.list, params).then((res) => {
        if (res.success) {
          for (let i = 0; i < res.result.records.length; i++) {
            if (that.oldSlelectRows.indexOf(res.result.records[i].id) > -1) {
              res.result.records[i].distable = true
            } else {
              res.result.records[i].distable = false
            }
          }
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
    showModal(oldSlelectRows) {
      this.oldSlelectRows = oldSlelectRows
      this.visible = true
      this.loadData(1)
    },
    getQueryParams() {
      let param = Object.assign({}, this.queryParam)
      param.field = this.getQueryField()
      param.pageNo = this.ipagination.current
      param.pageSize = this.ipagination.pageSize
      return filterObj(param)
    },
    //查询条件处理
    getQueryField() {
      let str = 'id,'
      for (let a = 0; a < this.columns.length; a++) {
        str += ',' + this.columns[a].dataIndex
      }
      return str
    },
    searchReset(num) {
      let that = this
      if (num !== 0) {
        that.loadData(1)
      }
      that.selectborrowIds = []
    },
    close() {
      this.searchReset(0)
      this.selectedRowKeys = []
      this.visible = false
    },
    handleTableChange(pagination, filters, sorter) {
      //TODO ç­›é€‰
      // 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() {
      this.$bus.$emit('selectionRows', this.selectionRows)
      this.searchReset(0)
      this.close()
    },
    onSelectChange(selectionRows) {
      this.selectionRows = selectionRows
    },
    onSearch() {
      this.loadData(1)
    },
     searchQuery() {
      this.loadData(1);
    },
    searchReset() {
      this.queryParam = {}
      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>
src/views/qms/modules/inspectionPlan/MaterialListModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,137 @@
<template>
  <a-modal :title="title" :width="1000" :visible="visible" :maskClosable="false" @ok="handleOk" @cancel="handleCancel"
           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 :md="9" :sm="9">
              <a-form-item label="物料编码">
                <a-input placeholder="请输入物料编码" v-model="queryParam.materialNumber"></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="9" :sm="9">
              <a-form-item label="物料名称">
                <a-input placeholder="请输入物料名称" v-model="queryParam.materialName"></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="3" :sm="3">
              <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>
      <!-- table区域-begin -->
      <div>
        <a-table bordered rowKey="materialNumber" :scroll="{  y: 300 }" :columns="columns"
                 :dataSource="dataSource" :pagination="ipagination" :loading="loading" :customRow="customRow"
                 :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
                 @change="handleTableChange">
        </a-table>
      </div>
      <!-- table区域-end -->
    </a-card>
  </a-modal>
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  export default {
    name: 'MaterialListModal',
    mixins: [JeecgListMixin],
    data() {
      return {
        title: '',
        visible: false,
        disableMixinCreated: true,
        columns: [
          {
            title: '物料编码',
            align: 'center',
            dataIndex: 'materialNumber'
          },
          {
            title: '物料名称',
            align: 'center',
            dataIndex: 'materialName'
          },
          {
            title: '物料型号',
            align: 'center',
            dataIndex: 'materialModel'
          },
          {
            title: '物料类型',
            align: 'center',
            dataIndex: 'materialCategory'
          },
          {
            title: '单位',
            align: 'center',
            dataIndex: 'materialUnit'
          }
        ],
        /* æŽ’序参数 */
        isorter: {
          column: '',
          order: ''
        },
        url: {
          list: '/lswmaterial/lswMaterial/list'
        }
      }
    },
    methods: {
      openPage() {
        this.visible = true
        this.onClearSelected()
        this.dataSource = []
        this.loadData()
      },
      /**
       * è‡ªå®šä¹‰è¡¨æ ¼è¡Œ
       * @param record è¡¨æ ¼è¡Œä¿¡æ¯
       * @returns {{style: {cursor: string}, on: {click: on.click}}}
       */
      customRow(record) {
        return {
          style: {
            cursor: 'pointer'
          },
          on: {
            click: () => {
              this.onSelectChange([record.materialNumber], [record])
            }
          }
        }
      },
      close() {
        this.$emit('close')
        this.visible = false
      },
      handleCancel() {
        this.close()
      },
      handleOk() {
        this.$emit('sendSelectionRows', this.selectionRows[0])
        this.close()
      }
    }
  }
</script>
<style>
  @import '~@assets/less/common.less';
</style>
src/views/qms/modules/inspectionTools/InspectionToolsModel.vue
@@ -4,6 +4,7 @@
    :width="800"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :maskClosable="false"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
src/views/qms/modules/samplingRules/SamplingRulesModel.vue
@@ -4,6 +4,7 @@
    :width="800"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :maskClosable="false"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"