0211b730e5f0b1f10a8a3243e30fe599e22f2238..6bbceeae0a692ef60f429dbca889752fcb09ec9a
2025-07-03 houshuai
线边库和订单 基本页面搭建
6bbcee 对比 | 目录
2025-07-03 cuijian
质量管理-抽样规则、缺陷维护功能
f761b7 对比 | 目录
已添加14个文件
已修改17个文件
3191 ■■■■■ 文件已修改
src/components/jeecgbiz/JSelectBizComponent/JSelectBizComponentModal.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/jeecgbiz/JSelectMultiUser.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/FactoryManager.vue 6 ●●●● 补丁 | 查看 | 原始文档 | 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/lsw/LswMateriaView.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/LswMaterialInboundList.vue 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/LswMaterialOutboundList.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/modules/LswMaterialForm.vue 77 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/modules/LswMaterialInboundForm.vue 237 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/modules/LswMaterialInventoryForm.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/modules/LswMaterialOutboundForm.vue 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pms/PmsMaterialProcessList.vue 213 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pms/PmsProcessBillMaterialsDetailList.vue 207 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pms/PmsProcessBillMaterialsList.vue 241 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pms/modules/PmsMaterialProcessForm.vue 172 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pms/modules/PmsMaterialProcessModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pms/modules/PmsProcessBillMaterialsDetailForm.vue 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pms/modules/PmsProcessBillMaterialsDetailModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pms/modules/PmsProcessBillMaterialsForm.vue 144 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pms/modules/PmsProcessBillMaterialsModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | 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/FactoryManager.vue
@@ -119,11 +119,11 @@
  </a-row>
</template>
<script>
  import UserFactory from './modules/factoryManager/UserFactory'
  import UserFactory from './modules/FactoryManager/UserFactory'
  import { queryFactoryTreeList, searchByKeywords, deleteByFactory } from '@/api/api'
  import { httpAction, deleteAction } from '@/api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import FactoryModal from './modules/factoryManager/FactoryModal'
  import FactoryModal from './modules/FactoryManager/FactoryModal'
  export default {
    name: 'FactoryManager',
@@ -220,7 +220,7 @@
        this.iExpandedKeys = expandedKeys
        this.autoExpandParent = false
      },
      batchDel: function() {
        this.isIncludesNotLeaf = false
        this.includesNotLeaf(this.factoryTree)
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/lsw/LswMateriaView.vue
@@ -3,7 +3,39 @@
    :bordered="false"
    title="线边库物料信息"
  >
    <a-button @click="handleAdd" type="primary" icon="plus">新增物料信息-测试</a-button>
    <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="物料编码">
              <j-input placeholder="请输入物料编码" v-model="queryParam.materialNumber"></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.materialName"></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.materialModel"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="物料类型">
              <j-dict-select-tag placeholder="请输入物料类型"  dictCode="material_category" v-model="queryParam.materialCategory"></j-dict-select-tag>
            </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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
<!--    <a-button @click="handleAdd" type="primary" icon="plus">新增物料信息-测试</a-button>-->
    <a-spin :spinning="confirmLoading">
      <div>
        <!-- ä¸»è¡¨å•区域 -->
@@ -154,8 +186,8 @@
            defaultValue: ''
          },
          {
            title: '库存地ID',
            key: 'warehouseId',
            title: '库存地',
            key: 'warehouseName',
            type: JVXETypes.input,
            width: '200px',
            placeholder: '请输入${title}',
@@ -172,6 +204,7 @@
        ]
      },
      url: {
        //searchlikeQuery
        list: '/lswmaterial/lswMaterial/list',
        queryById: '/lswmaterial/lswMaterial/queryById',
        lswMaterialInventory: {
@@ -212,15 +245,17 @@
      console.log('test---->', this.selectedRowKeys[0])
    },
    async onSelectChange(selectedRowKeys) {
      this.lswMaterialInventoryTable.loading = true
      // å•选模式下,selectedRowKeys æ˜¯æ•°ç»„,但长度最多为1
      console.log('点击了---->')
      this.selectedRowKeys = selectedRowKeys
      this.lswMaterialInventoryTable.dataSource=[]
      // èŽ·å–é€‰ä¸­è¡Œçš„å®Œæ•´æ•°æ®
      if (selectedRowKeys.length > 0) {
        const selectedId = selectedRowKeys[0] // é€‰ä¸­è¡Œçš„id
        const lswMaterialInventoryResult = await getAction(this.url.lswMaterialInventory.list, { 'id': selectedId })
        this.lswMaterialInventoryTable.dataSource = lswMaterialInventoryResult.result
        this.lswMaterialInventoryTable.loading = false
      }
    }
src/views/lsw/LswMaterialInboundList.vue
@@ -4,6 +4,27 @@
    <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="物料编码">
              <j-input placeholder="请输入物料编码" v-model="queryParam.materialNumber"></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.materialName"></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.batchNumber"></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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
@@ -12,12 +33,6 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('物料入库单')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
      <!-- é«˜çº§æŸ¥è¯¢åŒºåŸŸ -->
      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
@@ -122,19 +137,14 @@
            }
          },
          {
            title:'删除标记',
            title:'产线',
            align:"center",
            dataIndex: 'delFlag'
            dataIndex: 'factoryId_dictText'
          },
          {
            title:'产线ID',
            title:'库存地',
            align:"center",
            dataIndex: 'factoryId'
          },
          {
            title:'库存地ID',
            align:"center",
            dataIndex: 'warehouseId'
            dataIndex: 'warehouseId_dictText'
          },
          {
            title:'物料编码',
@@ -166,14 +176,14 @@
            align:"center",
            dataIndex: 'receiveTime'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
          // {
          //   title: '操作',
          //   dataIndex: 'action',
          //   align:"center",
          //   fixed:"right",
          //   width:147,
          //   scopedSlots: { customRender: 'action' }
          // }
        ],
        url: {
          list: "/lswmaterialinbound/lswMaterialInbound/list",
@@ -181,7 +191,6 @@
          deleteBatch: "/lswmaterialinbound/lswMaterialInbound/deleteBatch",
          exportXlsUrl: "/lswmaterialinbound/lswMaterialInbound/exportXls",
          importExcelUrl: "lswmaterialinbound/lswMaterialInbound/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
@@ -197,6 +206,7 @@
    },
    methods: {
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
src/views/lsw/LswMaterialOutboundList.vue
@@ -4,6 +4,27 @@
    <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="物料编码">
              <j-input placeholder="请输入物料编码" v-model="queryParam.materialNumber"></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.materialName"></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.batchNumber"></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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
@@ -12,12 +33,6 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('物料出库单')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
      <!-- é«˜çº§æŸ¥è¯¢åŒºåŸŸ -->
      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
@@ -122,11 +137,6 @@
            }
          },
          {
            title:'删除标记',
            align:"center",
            dataIndex: 'delFlag'
          },
          {
            title:'物料编码',
            align:"center",
            dataIndex: 'materialNumber'
@@ -137,9 +147,9 @@
            dataIndex: 'materialName'
          },
          {
            title:'产线ID',
            title:'产线',
            align:"center",
            dataIndex: 'factoryId'
            dataIndex: 'factoryId_dictText'
          },
          {
            title:'批次号',
@@ -162,7 +172,7 @@
            dataIndex: 'quantity'
          },
          {
            title:'工单ID',
            title:'工单',
            align:"center",
            dataIndex: 'workOrderId'
          },
src/views/lsw/modules/LswMaterialForm.vue
@@ -69,6 +69,7 @@
    },
    data() {
      return {
        warehouseColOptions: [],
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
@@ -81,8 +82,6 @@
         },
        // æ–°å¢žæ—¶å­è¡¨é»˜è®¤æ·»åŠ å‡ è¡Œç©ºæ•°æ®
        addDefaultRowNum: 1,
        validatorRules: {
        },
        refKeys: ['lswMaterialInventory', ],
        tableKeys:['lswMaterialInventory', ],
        activeKey: 'lswMaterialInventory',
@@ -91,14 +90,6 @@
          loading: false,
          dataSource: [],
          columns: [
            {
              title: '物料ID',
              key: 'materialId',
               type: JVXETypes.input,
              width:"200px",
              placeholder: '请输入${title}',
              defaultValue:'',
            },
            {
              title: '批次号',
              key: 'batchNumber',
@@ -110,10 +101,12 @@
            {
              title: '库存类型',
              key: 'inventoryCategory',
               type: JVXETypes.input,
               type: JVXETypes.select,
              width:"200px",
              placeholder: '请输入${title}',
              placeholder: '请选择${title}',
              defaultValue:'',
              options:[],
              dictCode: 'inventoryCategory'
            },
            {
              title: '数量',
@@ -124,27 +117,46 @@
              defaultValue:'',
            },
            {
              title: '库存地ID',
              title: '库存地',
              key: 'warehouseId',
               type: JVXETypes.input,
              width:"200px",
              placeholder: '请输入${title}',
              defaultValue:'',
              type: JVXETypes.select,
              width: "200px",
              options: this.warehouseColOptions,
            },
            {
              title: '库存状态',
              key: 'inventoryStatus',
               type: JVXETypes.input,
               type: JVXETypes.select,
              width:"200px",
              placeholder: '请输入${title}',
              defaultValue:'',
              options:[],
              dictCode: 'inventory_status'
            },
          ]
        },
        validatorRules: {
          materialNumber: [
            { required: true, message: '物料编码是必选项', trigger: 'change' }
          ],
          materialName: [
            { required: true, message: '物料名称是必选项', trigger: 'change' }
          ],
          materialModel: [
            { required: true, message: '物料型号是必选项', trigger: 'change' }
          ],
          materialCategory: [
            { required: true, message: '物料类型是必选项', trigger: 'change' }
          ],
          materialUnit: [
            { required: true, message: '单位是必选项', trigger: 'change' }
          ],
        },
        url: {
          add: "/lswmaterial/lswMaterial/add",
          edit: "/lswmaterial/lswMaterial/edit",
          queryById: "/lswmaterial/lswMaterial/queryById",
          warehouseList:"/base/lineSideWarehouse/list",
          lswMaterialInventory: {
            list: '/lswmaterial/lswMaterial/queryLswMaterialInventoryByMainId'
          },
@@ -165,8 +177,37 @@
      },
    },
    created () {
      this.loadWarehouseOptions();
    },
    methods: {
      async loadWarehouseOptions() {
        try {
          const res = await getAction(this.url.warehouseList);
          console.log("仓库API响应:", res);
          let data = [];
          data = res.result.records;
          console.log("处理后的仓库数据:", data);
          const options = data.map(item => ({
            text: item.warehouseName || `仓库(${item.id})`, // æ˜¾ç¤ºæ–‡æœ¬
            value: item.id // å®žé™…值
          }));
          console.log("格式化后的选项:", options);
          const warehouseCol = this.lswMaterialInventoryTable.columns.find(
            col => col.key === 'warehouseId'
          );
          if (warehouseCol) {
            this.$set(warehouseCol, 'options', options);
            this.warehouseColOptions = warehouseCol.options
            console.log("更新后的列选项:", warehouseCol.options);
          }
          this.$nextTick(() => {
            this.$forceUpdate();
            console.log("已强制更新视图");
          });
        } catch (error) {
          console.error('加载仓库列表失败:', error);
        }
      },
      addBefore(){
        this.lswMaterialInventoryTable.dataSource=[]
      },
src/views/lsw/modules/LswMaterialInboundForm.vue
@@ -3,34 +3,45 @@
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-form-model-item label="产线" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId">
            <a-row :gutter="24">
              <a-col :span="24">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label=""
                >
                  <j-select-factory
                    :disabled="disabled"
                    v-model="model.factoryId"
                    :multi="true"
                    @back="backFactoryInfo"
                    :backProduction="true"
                    :treeProductOpera="true"
                  ></j-select-factory>
                </a-form-item>
              </a-col>
            </a-row>
          </a-form-model-item>
          <a-col :span="12">
            <a-form-model-item label="删除标记" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag">
              <a-input-number v-model="model.delFlag" placeholder="请输入删除标记" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="产线ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId">
              <a-input v-model="model.factoryId" placeholder="请输入产线ID"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="库存地ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseId">
              <a-input v-model="model.warehouseId" placeholder="请输入库存地ID"  ></a-input>
            <a-form-model-item label="库存地" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseId">
              <j-search-select-tag v-model="model.warehouseId" placeholder="请选择库存地"
                                   dict="base_line_side_warehouse,warehouse_name,id"></j-search-select-tag>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber">
              <a-input v-model="model.materialNumber" placeholder="请输入物料编码"  ></a-input>
              <a-input v-model="model.materialNumber" placeholder="请输入物料编码"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName">
              <a-input v-model="model.materialName" placeholder="请输入物料名称"  ></a-input>
              <a-input v-model="model.materialName" placeholder="请输入物料名称"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="批次号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchNumber">
              <a-input v-model="model.batchNumber" placeholder="请输入批次号"  ></a-input>
              <a-input v-model="model.batchNumber" placeholder="请输入批次号"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -40,12 +51,13 @@
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="接收人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver">
              <a-input v-model="model.receiver" placeholder="请输入接收人"  ></a-input>
              <j-select-user-by-dep v-model="model.receiver" placeholder="请输入接收人"></j-select-user-by-dep>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="接收时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveTime">
              <j-date placeholder="请选择接收时间"  v-model="model.receiveTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
              <j-date placeholder="请选择接收时间" v-model="model.receiveTime" :show-time="true"
                      date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -56,89 +68,128 @@
<script>
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import JDate from '@/components/jeecg/JDate'
import pick from 'lodash.pick'
import moment from 'moment'
import { duplicateCheck } from '@/api/api'//重复校验
import JTreeDict from '@/components/jeecg/JTreeDict'//分类字典树形下拉组件
import JSelectFactory from '../../../../src/components/jeecgbiz/JSelectFactory.vue'
  export default {
    name: 'LswMaterialInboundForm',
    components: {
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
export default {
  name: 'LswMaterialInboundForm',
  components: {
    JDate,
    JTreeDict,
    JSelectFactory
  },
  props: {
    //表单禁用
    disabled: {
      type: Boolean,
      default: false,
      required: false
    }
  },
  data() {
    return {
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      confirmLoading: false,
      validatorRules: {
        factoryId: [
          { required: true, message: '产线是必选项', trigger: 'change' }
        ],
        warehouseId: [
          { required: true, message: '库存地是必选项', trigger: 'change' }
        ],
        materialNumber: [
          { required: true, message: '物料编码是必选项', trigger: 'change' }
        ],
        materialName: [
          { required: true, message: '物料名称是必选项', trigger: 'change' }
        ],
        batchNumber: [
          { required: true, message: '批次号是必选项', trigger: 'change' }
        ],
        quantity: [
          { required: true, message: '入库数量是必选项', trigger: 'change' }
        ],
        receiver: [
          { required: true, message: '接收人是必选项', trigger: 'change' }
        ],
        receiveTime: [
          { required: true, message: '接收时间是必选项', trigger: 'change' }
        ]
      },
      url: {
        add: '/lswmaterialinbound/lswMaterialInbound/add',
        edit: '/lswmaterialinbound/lswMaterialInbound/edit',
        queryById: '/lswmaterialinbound/lswMaterialInbound/queryById'
      }
    }
  },
  computed: {
    formDisabled() {
      return this.disabled
    }
  },
  created() {
    //备份model原始值
    this.modelDefault = JSON.parse(JSON.stringify(this.model))
  },
  methods: {
    backFactoryInfo(info) {
      this.model.factoryIds = this.model.factoryId
      this.nextFactoryOptions = info.map((item, index, arr) => {
        let c = { label: item.text, value: item.value + '' }
        return c
      })
    },
    data () {
      return {
        model:{
         },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/lswmaterialinbound/lswMaterialInbound/add",
          edit: "/lswmaterialinbound/lswMaterialInbound/edit",
          queryById: "/lswmaterialinbound/lswMaterialInbound/queryById"
        }
      }
    add() {
      this.edit(this.modelDefault)
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    edit(record) {
      this.model = Object.assign({}, record)
      this.visible = true
    },
    created () {
       //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
    },
    methods: {
      add () {
        this.edit(this.modelDefault);
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
      },
      submitForm () {
        const that = this;
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
            })
    submitForm() {
      const that = this
      // è§¦å‘表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          that.confirmLoading = true
          let httpurl = ''
          let method = ''
          if (!this.model.id) {
            httpurl += this.url.add
            method = 'post'
          } else {
            httpurl += this.url.edit
            method = 'put'
          }
          httpAction(httpurl, this.model, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('ok')
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false
          })
        }
        })
      },
      })
    }
  }
}
</script>
src/views/lsw/modules/LswMaterialInventoryForm.vue
@@ -20,7 +20,7 @@
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
              <a-input v-model="model.quantity" placeholder="请输入数量"  ></a-input>
              <a-input-number v-model="model.quantity" placeholder="请输入数量"  ></a-input-number>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
src/views/lsw/modules/LswMaterialOutboundForm.vue
@@ -3,11 +3,26 @@
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="删除标记" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag">
              <a-input-number v-model="model.delFlag" placeholder="请输入删除标记" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-form-model-item label="产线" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId">
            <a-row :gutter="24">
              <a-col :span="24">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label=""
                >
                  <j-select-factory
                    :disabled="disabled"
                    v-model="model.factoryId"
                    :multi="true"
                    @back="backFactoryInfo"
                    :backProduction="true"
                    :treeProductOpera="true"
                  ></j-select-factory>
                </a-form-item>
              </a-col>
            </a-row>
          </a-form-model-item>
          <a-col :span="12">
            <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber">
              <a-input v-model="model.materialNumber" placeholder="请输入物料编码"  ></a-input>
@@ -19,18 +34,13 @@
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="产线ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId">
              <a-input v-model="model.factoryId" placeholder="请输入产线ID"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="批次号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchNumber">
              <a-input v-model="model.batchNumber" placeholder="请输入批次号"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="出库人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outboundStaff">
              <a-input v-model="model.outboundStaff" placeholder="请输入出库人"  ></a-input>
              <j-select-user-by-dep v-model="model.outboundStaff" placeholder="请输入出库人"  ></j-select-user-by-dep>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -40,7 +50,7 @@
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="出库数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
              <a-input v-model="model.quantity" placeholder="请输入出库数量"  ></a-input>
              <a-input-number v-model="model.quantity" placeholder="请输入出库数量"  ></a-input-number>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -58,10 +68,16 @@
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  import JTreeDict from '@/components/jeecg/JTreeDict'//分类字典树形下拉组件
  import JSelectFactory from '../../../../src/components/jeecgbiz/JSelectFactory.vue'
  import JDate from '@/components/jeecg/JDate'
  export default {
    name: 'LswMaterialOutboundForm',
    components: {
      JDate,
      JTreeDict,
      JSelectFactory
    },
    props: {
      //表单禁用
@@ -85,6 +101,30 @@
        },
        confirmLoading: false,
        validatorRules: {
          factoryId: [
            { required: true, message: '产线是必选项', trigger: 'change' }
          ],
          materialNumber: [
            { required: true, message: '物料编码是必选项', trigger: 'change' }
          ],
          materialName: [
            { required: true, message: '物料名称是必选项', trigger: 'change' }
          ],
          batchNumber: [
            { required: true, message: '批次号是必选项', trigger: 'change' }
          ],
          quantity: [
            { required: true, message: '出库数量是必选项', trigger: 'change' }
          ],
          outboundStaff: [
            { required: true, message: '出库人是必选项', trigger: 'change' }
          ],
          outboundTime: [
            { required: true, message: '出库时间是必选项', trigger: 'change' }
          ],
          workOrderId:[
            { required: true, message: '工单是必选项', trigger: 'change' }
          ],
        },
        url: {
          add: "/lswmaterialoutbound/lswMaterialOutbound/add",
@@ -103,6 +143,13 @@
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
    },
    methods: {
      backFactoryInfo(info) {
        this.model.factoryIds = this.model.factoryId
        this.nextFactoryOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
      },
      add () {
        this.edit(this.modelDefault);
      },
src/views/pms/PmsMaterialProcessList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,213 @@
<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 :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="物料编码">
              <j-input placeholder="请输入物料编码" v-model="queryParam.materialNumber"></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.materialName"></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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <!-- é«˜çº§æŸ¥è¯¢åŒºåŸŸ -->
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> æ‰¹é‡æ“ä½œ <a-icon type="down" /></a-button>
      </a-dropdown>
    </div>
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> å·²é€‰æ‹© <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            ä¸‹è½½
          </a-button>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(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="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </a-table>
    </div>
    <pms-material-process-modal ref="modalForm" @ok="modalFormOk"></pms-material-process-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import PmsMaterialProcessModal from './modules/PmsMaterialProcessModal'
  export default {
    name: 'PmsMaterialProcessList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      PmsMaterialProcessModal
    },
    data () {
      return {
        description: '物料工序管理页面',
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'物料编码',
            align:"center",
            dataIndex: 'materialNumber'
          },
          {
            title:'物料名称',
            align:"center",
            dataIndex: 'materialName'
          },
          {
            title:'产线ID(SAP工作中心)',
            align:"center",
            dataIndex: 'factoryId_dictText'
          },
          {
            title:'工序号',
            align:"center",
            dataIndex: 'processCode'
          },
          {
            title:'工序名称',
            align:"center",
            dataIndex: 'processName'
          },
          {
            title:'控制码',
            align:"center",
            dataIndex: 'controlCode'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/pms/pmsMaterialProcess/list",
          delete: "/pms/pmsMaterialProcess/delete",
          deleteBatch: "/pms/pmsMaterialProcess/deleteBatch",
          exportXlsUrl: "/pms/pmsMaterialProcess/exportXls",
          importExcelUrl: "pms/pmsMaterialProcess/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'int',value:'delFlag',text:'删除标记',dictCode:''})
        fieldList.push({type:'string',value:'materialNumber',text:'物料编码',dictCode:''})
        fieldList.push({type:'string',value:'materialName',text:'物料名称',dictCode:''})
        fieldList.push({type:'string',value:'factoryId',text:'产线ID(SAP工作中心)',dictCode:''})
        fieldList.push({type:'string',value:'processCode',text:'工序号',dictCode:''})
        fieldList.push({type:'string',value:'processName',text:'工序名称',dictCode:''})
        fieldList.push({type:'string',value:'controlCode',text:'控制码',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/pms/PmsProcessBillMaterialsDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,207 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-row :gutter="24">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="物料编码">
                <j-input placeholder="请输入物料编码" v-model="queryParam.materialNumber"></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.materialName"></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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
            </a-col>
          </a-row>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('物料清单')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
      <!-- é«˜çº§æŸ¥è¯¢åŒºåŸŸ -->
      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> æ‰¹é‡æ“ä½œ <a-icon type="down" /></a-button>
      </a-dropdown>
    </div>
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> å·²é€‰æ‹© <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            ä¸‹è½½
          </a-button>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(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="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </a-table>
    </div>
    <pms-process-bill-materials-detail-modal ref="modalForm" @ok="modalFormOk"></pms-process-bill-materials-detail-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import PmsProcessBillMaterialsDetailModal from './modules/PmsProcessBillMaterialsDetailModal'
  export default {
    name: 'PmsProcessBillMaterialsDetailList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      PmsProcessBillMaterialsDetailModal
    },
    data () {
      return {
        description: '物料清单管理页面',
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'生产物料ID',
            align:"center",
            dataIndex: 'materialId_dictText'
          },
          {
            title:'物料编码',
            align:"center",
            dataIndex: 'materialNumber'
          },
          {
            title:'物料名称',
            align:"center",
            dataIndex: 'materialName'
          },
          {
            title:'需求用量',
            align:"center",
            dataIndex: 'usageUnit'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/pms/pmsProcessBillMaterialsDetail/list",
          delete: "/pms/pmsProcessBillMaterialsDetail/delete",
          deleteBatch: "/pms/pmsProcessBillMaterialsDetail/deleteBatch",
          exportXlsUrl: "/pms/pmsProcessBillMaterialsDetail/exportXls",
          importExcelUrl: "pms/pmsProcessBillMaterialsDetail/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'materialId',text:'生产物料ID',dictCode:''})
        fieldList.push({type:'string',value:'materialNumber',text:'物料编码',dictCode:''})
        fieldList.push({type:'string',value:'materialName',text:'物料名称',dictCode:''})
        fieldList.push({type:'double',value:'usageUnit',text:'需求用量',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/pms/PmsProcessBillMaterialsList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,241 @@
<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 :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="物料编码">
              <j-input placeholder="请输入物料编码" v-model="queryParam.materialNumber"></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.materialName"></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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <!-- é«˜çº§æŸ¥è¯¢åŒºåŸŸ -->
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> æ‰¹é‡æ“ä½œ <a-icon type="down" /></a-button>
      </a-dropdown>
    </div>
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> å·²é€‰æ‹© <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            ä¸‹è½½
          </a-button>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(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="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
        <span slot="figureNum" slot-scope="text, record">
          <span v-if="record.materialNumber == null || '' == record.materialNumber">无数据</span>
          <span v-else>
            <a-popover placement="top" :title="'物料基本信息:'" arrow-point-at-center>
              <template slot="content">
              </template>
              <a-button class="fontweight" style="font-weight: bold;color: inherit;" @click="handleMaterialClick(record)">
                {{ record.materialNumber }}
              </a-button>
            </a-popover>
          </span>
        </span>
      </a-table>
    </div>
    <pms-process-bill-materials-modal ref="modalForm" @ok="modalFormOk"></pms-process-bill-materials-modal>
    <PmsProcessBillMaterialsDetailModal ref="PmsProcessBillMaterialsDetailModal"></PmsProcessBillMaterialsDetailModal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import PmsProcessBillMaterialsModal from './modules/PmsProcessBillMaterialsModal'
  import PmsProcessBillMaterialsDetailModal from './modules/PmsProcessBillMaterialsDetailModal.vue'
  import { getAction } from '@api/manage'
  export default {
    name: 'PmsProcessBillMaterialsList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      PmsProcessBillMaterialsModal,
      PmsProcessBillMaterialsDetailModal
    },
    data () {
      return {
        description: '订单BOM管理页面',
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'生成订单ID',
            align:"center",
            dataIndex: 'orderId'
          },
          {
            title:'物料编码',
            align:"center",
            dataIndex: 'materialNumber',
            defaultSortOrder: 'descend',
            scopedSlots: { customRender: 'figureNum', },
          },
          {
            title:'物料名称',
            align:"center",
            dataIndex: 'materialName'
          },
          {
            title:'BOM代码',
            align:"center",
            dataIndex: 'billMaterialsCode'
          },
          {
            title:'基本单位',
            align:"center",
            dataIndex: 'productionUnit'
          },
          {
            title:'订单数量',
            align:"center",
            dataIndex: 'productionQuantity'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/pmsprocessbillmaterials/pmsProcessBillMaterials/list",
          delete: "/pmsprocessbillmaterials/pmsProcessBillMaterials/delete",
          deleteBatch: "/pmsprocessbillmaterials/pmsProcessBillMaterials/deleteBatch",
          exportXlsUrl: "/pmsprocessbillmaterials/pmsProcessBillMaterials/exportXls",
          importExcelUrl: "pmsprocessbillmaterials/pmsProcessBillMaterials/importExcel",
          queryByMaterialId:'/pms/pmsProcessBillMaterialsDetail/queryByMaterialId'
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      handleMaterialClick(record){
        console.log('record----->',record)
        getAction(this.url.queryByMaterialId,{'materialId':record.id}).then(res=>{
          if(res.success){
            this.$refs.PmsProcessBillMaterialsDetailModal.edit(res.result);
            this.$refs.PmsProcessBillMaterialsDetailModal.title="物料清单";
            this.$refs.PmsProcessBillMaterialsDetailModal.disableSubmit = true;
          }else{
            this.$message.error('没查到数据,请联系管理员')
          }
        })
      },
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'int',value:'delFlag',text:'删除标记',dictCode:''})
        fieldList.push({type:'string',value:'orderId',text:'生成订单ID',dictCode:''})
        fieldList.push({type:'string',value:'materialNumber',text:'物料编码',dictCode:''})
        fieldList.push({type:'string',value:'materialName',text:'物料名称',dictCode:''})
        fieldList.push({type:'string',value:'billMaterialsCode',text:'BOM代码',dictCode:''})
        fieldList.push({type:'string',value:'productionUnit',text:'基本单位',dictCode:''})
        fieldList.push({type:'double',value:'productionQuantity',text:'订单数量',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/pms/modules/PmsMaterialProcessForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,172 @@
<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber">
              <a-input v-model="model.materialNumber" placeholder="请输入物料编码"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName">
              <a-input v-model="model.materialName" placeholder="请输入物料名称"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="产线ID(SAP工作中心)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId">
                <a-row :gutter="24">
                  <a-col :span="24">
                    <a-form-item
                      :labelCol="labelCol"
                      :wrapperCol="wrapperCol"
                      label=""
                    >
                      <j-select-factory
                        :disabled="disabled"
                        v-model="model.factoryId"
                        :multi="true"
                        @back="backFactoryInfo"
                        :backProduction="true"
                        :treeProductOpera="true"
                      ></j-select-factory>
                    </a-form-item>
                  </a-col>
                </a-row>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="工序号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processCode">
              <a-input v-model="model.processCode" placeholder="请输入工序号"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="工序名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processName">
              <a-input v-model="model.processName" placeholder="请输入工序名称"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="控制码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="controlCode">
              <a-input v-model="model.controlCode" placeholder="请输入控制码"  ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
  </a-spin>
</template>
<script>
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  import JSelectFactory from '@comp/jeecgbiz/JSelectFactory.vue'
  import JTreeDict from '@/components/jeecg/JTreeDict'//分类字典树形下拉组件
  export default {
    name: 'PmsMaterialProcessForm',
    components: {
      JSelectFactory,
      JTreeDict
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    data () {
      return {
        model:{
         },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
          factoryId: [
            { required: true, message: '产线是必选项', trigger: 'change' }
          ],
          materialNumber: [
            { required: true, message: '物料编码是必选项', trigger: 'change' }
          ],
          materialName: [
            { required: true, message: '物料名称是必选项', trigger: 'change' }
          ],
          processCode: [
            { required: true, message: '工序号是必选项', trigger: 'change' }
          ],
          processName: [
            { required: true, message: '工序名称是必选项', trigger: 'change' }
          ],
        },
        url: {
          add: "/pms/pmsMaterialProcess/add",
          edit: "/pms/pmsMaterialProcess/edit",
          queryById: "/pms/pmsMaterialProcess/queryById"
        }
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
       //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
    },
    methods: {
      backFactoryInfo(info) {
        this.model.factoryIds = this.model.factoryId
        this.nextFactoryOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
      },
      add () {
        this.edit(this.modelDefault);
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
      },
      submitForm () {
        const that = this;
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
            })
          }
        })
      },
    }
  }
</script>
src/views/pms/modules/PmsMaterialProcessModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">
    <pms-material-process-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></pms-material-process-form>
  </j-modal>
</template>
<script>
  import PmsMaterialProcessForm from './PmsMaterialProcessForm'
  export default {
    name: 'PmsMaterialProcessModal',
    components: {
      PmsMaterialProcessForm
    },
    data () {
      return {
        title:'',
        width:896,
        visible: false,
        disableSubmit: false
      }
    },
    methods: {
      add () {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.add();
        })
      },
      edit (record) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record);
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        this.$refs.realForm.submitForm();
      },
      submitCallback(){
        this.$emit('ok');
        this.visible = false;
      },
      handleCancel () {
        this.close()
      }
    }
  }
</script>
src/views/pms/modules/PmsProcessBillMaterialsDetailForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,141 @@
<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="生产物料ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialId">
              <j-search-select-tag v-model="model.materialId" placeholder="请输入生产物料ID" dict="pms_process_bill_materials,material_number,id" @change="handleMaterialChange"></j-search-select-tag>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber">
              <a-input v-model="model.materialNumber" placeholder="请输入物料编码"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName">
              <a-input v-model="model.materialName" placeholder="请输入物料名称"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="需求用量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="usageUnit">
              <a-input-number v-model="model.usageUnit" placeholder="请输入需求用量" style="width: 100%" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
  </a-spin>
</template>
<script>
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: 'PmsProcessBillMaterialsDetailForm',
    components: {
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    data () {
      return {
        model:{
         },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
          materialId: [
            { required: true, message: '生产物料ID是必选项', trigger: 'change' }
          ],
          materialNumber: [
            { required: true, message: '物料编码是必选项', trigger: 'change' }
          ],
          materialName: [
            { required: true, message: '物料名称是必选项', trigger: 'change' }
          ],
          usageUnit: [
            { required: true, message: '需求用量是必选项', trigger: 'change' }
          ],
        },
        url: {
          add: "/pms/pmsProcessBillMaterialsDetail/add",
          edit: "/pms/pmsProcessBillMaterialsDetail/edit",
          queryById: "/pms/pmsProcessBillMaterialsDetail/queryById",
          queryPmsProcessBillMaterials:"/pmsprocessbillmaterials/pmsProcessBillMaterials/queryById"
        }
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
       //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
    },
    methods: {
      async handleMaterialChange(value){
        console.log('value---->',value)
        this.confirmLoading = true
        const res = await getAction(this.url.queryPmsProcessBillMaterials,{'id':value})
        console.log('res.result---->',res.result)
        this.model.materialNumber = res.result.materialNumber
        this.model.materialName = res.result.materialName
        this.confirmLoading = false
      },
      add () {
        this.edit(this.modelDefault);
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
      },
      submitForm () {
        const that = this;
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
            })
          }
        })
      },
    }
  }
</script>
src/views/pms/modules/PmsProcessBillMaterialsDetailModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">
    <pms-process-bill-materials-detail-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></pms-process-bill-materials-detail-form>
  </j-modal>
</template>
<script>
  import PmsProcessBillMaterialsDetailForm from './PmsProcessBillMaterialsDetailForm'
  export default {
    name: 'PmsProcessBillMaterialsDetailModal',
    components: {
      PmsProcessBillMaterialsDetailForm
    },
    data () {
      return {
        title:'',
        width:896,
        visible: false,
        disableSubmit: false
      }
    },
    methods: {
      add () {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.add();
        })
      },
      edit (record) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record);
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        this.$refs.realForm.submitForm();
      },
      submitCallback(){
        this.$emit('ok');
        this.visible = false;
      },
      handleCancel () {
        this.close()
      }
    }
  }
</script>
src/views/pms/modules/PmsProcessBillMaterialsForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,144 @@
<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="生成订单" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId">
              <a-input v-model="model.orderId" placeholder="请输入生成订单ID"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber">
              <a-input v-model="model.materialNumber" placeholder="请输入物料编码"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName">
              <a-input v-model="model.materialName" placeholder="请输入物料名称"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="BOM代码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="billMaterialsCode">
              <a-input v-model="model.billMaterialsCode" placeholder="请输入BOM代码"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="基本单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionUnit">
              <a-input v-model="model.productionUnit" placeholder="请输入基本单位"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="订单数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionQuantity">
              <a-input-number v-model="model.productionQuantity" placeholder="请输入订单数量" style="width: 100%" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
  </a-spin>
</template>
<script>
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: 'PmsProcessBillMaterialsForm',
    components: {
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    data () {
      return {
        model:{
         },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
          orderId: [
            { required: true, message: '生成订单是必选项', trigger: 'change' }
          ],
          materialNumber: [
            { required: true, message: '物料编码是必填项', trigger: 'change' }
          ],
          materialName: [
            { required: true, message: '物料名称是必填项', trigger: 'change' }
          ],
          productionUnit: [
            { required: true, message: '基本单位是必填项', trigger: 'change' }
          ],
          productionQuantity: [
            { required: true, message: '订单数量是必填项', trigger: 'change' }
          ],
        },
        url: {
          add: "/pmsprocessbillmaterials/pmsProcessBillMaterials/add",
          edit: "/pmsprocessbillmaterials/pmsProcessBillMaterials/edit",
          queryById: "/pmsprocessbillmaterials/pmsProcessBillMaterials/queryById"
        }
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
       //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
    },
    methods: {
      add () {
        this.edit(this.modelDefault);
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
      },
      submitForm () {
        const that = this;
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
            })
          }
        })
      },
    }
  }
</script>
src/views/pms/modules/PmsProcessBillMaterialsModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">
    <pms-process-bill-materials-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></pms-process-bill-materials-form>
  </j-modal>
</template>
<script>
  import PmsProcessBillMaterialsForm from './PmsProcessBillMaterialsForm'
  export default {
    name: 'PmsProcessBillMaterialsModal',
    components: {
      PmsProcessBillMaterialsForm
    },
    data () {
      return {
        title:'',
        width:896,
        visible: false,
        disableSubmit: false
      }
    },
    methods: {
      add () {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.add();
        })
      },
      edit (record) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record);
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        this.$refs.realForm.submitForm();
      },
      submitCallback(){
        this.$emit('ok');
        this.visible = false;
      },
      handleCancel () {
        this.close()
      }
    }
  }
</script>
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>