8ae1654dd283f11a5be3bc155064217f3454a3f1..c08fa0486a19012b26deef229bfb8eab1e1013f6
4 天以前 zhangherong
art: 热处理入库
c08fa0 对比 | 目录
4 天以前 zhangherong
art: 热处理入库
729b38 对比 | 目录
4 天以前 zhangherong
art: 物料台账修改
900b13 对比 | 目录
4 天以前 cuilei
排产工单模块设备点检功能页面
2094d1 对比 | 目录
已添加1个文件
已修改6个文件
949 ■■■■ 文件已修改
src/views/lsw/LswMateriaView.vue 135 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/LswMaterialInboundList.vue 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/LswMaterialInventoryList.vue 271 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/modules/LswMaterialInboundForm.vue 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/modules/LswMaterialInboundModal.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/MesProductionWorkOrderListView.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/modules/MesProductionWorkOrderEquipmentInspectionModal.vue 251 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/LswMateriaView.vue
@@ -40,8 +40,7 @@
        </a-row>
      </a-form>
    </div>
    <!--    <a-button @click="handleAdd" type="primary" icon="plus">新增物料信息-测试</a-button>-->
    <a-spin :spinning="confirmLoading">
    <a-spin :spinning="loading">
      <div>
        <!-- ä¸»è¡¨å•区域 -->
        <a-table
@@ -55,6 +54,7 @@
          :pagination="ipagination"
          :loading="loading"
          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio'}"
          :customRow="customTableRow"
          @change="handleTableChange">
          <!--状态栏个性展示-->
          <span
@@ -118,24 +118,9 @@
        </a-table>
      </div>
      <!-- å­è¡¨å•区域 -->
      <a-tabs v-model="activeKey" @change="handleChangeTabs">
        <a-tab-pane tab="库存明细" :key="refKeys[0]" :forceRender="true">
          <div style="display: flex; align-items: center; margin-bottom: 10px;">
            <a-tag color="green" style="font-weight: bold;">
              åº“存总量:{{ totalInventoryQuantity }}
            </a-tag>
          </div>
          <j-vxe-table
            keep-source
            :ref="refKeys[0]"
            :loading="lswMaterialInventoryTable.loading"
            :columns="lswMaterialInventoryTable.columns"
            :dataSource="lswMaterialInventoryTable.dataSource"
            :maxHeight="300"
            :rowNumber="true"
            :rowSelection="true"
            :toolbar="false"
          />
      <a-tabs v-model="activeKey">
        <a-tab-pane tab="库存明细" key="lswMaterialInventory" :forceRender="true">
          <lsw-material-inventory-list ref="lswMaterialInventory" />
        </a-tab-pane>
      </a-tabs>
    </a-spin>
@@ -146,18 +131,16 @@
<script>
import { getAction } from '@/api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@/components/jeecg/JVxeTable'
import JFormContainer from '@/components/jeecg/JFormContainer'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import LswMaterialModal from '@views/lsw/modules/LswMaterialModal.vue'
import LswMaterialInventoryList from './LswMaterialInventoryList.vue'
export default {
  name: 'LswMaterialForm',
  mixins: [JVxeTableModelMixin, JeecgListMixin],
  name: 'LswMaterialView',
  mixins: [JeecgListMixin],
  components: {
    LswMaterialModal,
    JFormContainer
    LswMaterialInventoryList
  },
  data() {
    return {
@@ -175,8 +158,6 @@
      validatorRules: {},
      selectedRowKeys: [], // åˆå§‹åŒ–为空数组(单选时存储单个key)
      selectedRowData: null,
      refKeys: ['lswMaterialInventory'],
      tableKeys: ['lswMaterialInventory'],
      activeKey: 'lswMaterialInventory',
      columns: [
        {
@@ -226,63 +207,12 @@
          scopedSlots: { customRender: 'action' }
        }
      ],
      // ç‰©æ–™åº“存信息
      lswMaterialInventoryTable: {
        loading: false,
        dataSource: [],
        columns: [
          {
            title: '批次号',
            key: 'batchNumber',
            type: JVXETypes.input,
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
          },
          {
            title: '库存类型',
            key: 'inventoryCategory',
            type: JVXETypes.input,
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
          },
          {
            title: '数量',
            key: 'quantity',
            type: JVXETypes.input,
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
          },
          {
            title: '库存地',
            key: 'warehouseName',
            type: JVXETypes.input,
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
          },
          {
            title: '库存状态',
            key: 'inventoryStatus',
            type: JVXETypes.input,
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
          }
        ]
      },
      url: {
        //searchlikeQuery
        list: '/lsw/lswMaterial/list',
        edit: '/lsw/lswMaterial/edit',
        active: '/lsw/lswMaterial/active',
        inactive: '/lsw/lswMaterial/inactive',
        queryById: '/lsw/lswMaterial/queryById',
        lswMaterialInventory: {
          list: '/lsw/lswMaterial/queryLswMaterialInventoryByMainId'
        }
      }
    }
  },
@@ -298,15 +228,6 @@
    formDisabled() {
      return this.disabled
    },
    totalInventoryQuantity() {
      if (!this.lswMaterialInventoryTable.dataSource || this.lswMaterialInventoryTable.dataSource.length === 0) {
        return '0'
      }
      return this.lswMaterialInventoryTable.dataSource.reduce((sum, item) => {
        const quantity = Number(item.quantity) || 0
        return sum + quantity
      }, 0)
    },
  },
  created() {
  },
@@ -319,17 +240,19 @@
      return ''
    },
    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
      if (selectedRowKeys.length === 1) {
        //加载库存信息
        this.$refs.lswMaterialInventory.queryParam.materialId = this.selectedRowKeys[0]
        this.$refs.lswMaterialInventory.loadData(1)
        this.$refs.lswMaterialInventory.statisticsInventory(this.selectedRowKeys[0])
      }else {
        //库存信息清空
        this.$refs.lswMaterialInventory.queryParam.materialId = 'null'
        this.$refs.lswMaterialInventory.loadData(1)
        this.$refs.lswMaterialInventory.statisticsInventory('null')
      }
    },
    handleActive(record) {
@@ -346,8 +269,24 @@
          that.$message.warning(res.message)
        }
      })
    }
    },
    /**
     * è‡ªå®šä¹‰è¡¨æ ¼è¡Œ
     * @param record è¡¨æ ¼è¡Œä¿¡æ¯
     * @returns {{style: {cursor: string}, on: {click: *}}} æ ·å¼å¯¹è±¡ä¸Žäº‹ä»¶æ–¹æ³•
     */
    customTableRow(record) {
      return {
        style: {
          cursor: 'pointer'
        },
        on: {
          click: () => {
            this.onSelectChange([record.id])
          }
        }
      }
    },
  }
}
</script>
src/views/lsw/LswMaterialInboundList.vue
@@ -5,6 +5,17 @@
      <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-dict-select-tag placeholder="请选择线边库" v-model="queryParam.warehouseId"
                                 dictCode="base_line_side_warehouse,warehouse_name,id,del_flag=0 and warehouse_status='1'"></j-dict-select-tag>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="入库类型">
              <j-dict-select-tag placeholder="请选择入库类型" v-model="queryParam.inboundCategory" dictCode="material_inbound_category"></j-dict-select-tag>
            </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.materialNumber"></j-input>
            </a-form-item>
@@ -22,7 +33,7 @@
          <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>
              <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
@@ -32,22 +43,16 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <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>
      <a-button @click="handleAdd('HEAT_TREATMENT_INBOUND')" type="primary" icon="plus">热处理入库</a-button>
      <a-button @click="handleAdd('SMALL_INNER_RING')" type="primary" icon="plus">小内圈入库</a-button>
      <a-button @click="handleAdd('MATERIAL_INNER_TRANSFER')" type="primary" icon="plus">钢球调拨</a-button>
    </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"
@@ -61,46 +66,11 @@
        :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>
          <a @click="handleDetail(record)">详情</a>
        </span>
      </a-table>
    </div>
@@ -137,12 +107,17 @@
            }
          },
          {
            title:'产线',
            title:'来源编码',
            align:"center",
            dataIndex: 'factoryId_dictText'
            dataIndex: 'originalCode'
          },
          {
            title:'库存地',
            title:'来源名称',
            align:"center",
            dataIndex: 'originalName'
          },
          {
            title:'线边库',
            align:"center",
            dataIndex: 'warehouseId_dictText'
          },
@@ -167,60 +142,44 @@
            dataIndex: 'quantity'
          },
          {
            title:'接收人',
            title:'入库类型',
            align:"center",
            dataIndex: 'inboundCategory_dictText'
          },
          {
            title:'入库人',
            align:"center",
            dataIndex: 'receiver'
          },
          {
            title:'接收时间',
            title:'入库时间',
            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",
          delete: "/lswmaterialinbound/lswMaterialInbound/delete",
          deleteBatch: "/lswmaterialinbound/lswMaterialInbound/deleteBatch",
          exportXlsUrl: "/lswmaterialinbound/lswMaterialInbound/exportXls",
          importExcelUrl: "lswmaterialinbound/lswMaterialInbound/importExcel",
          list: "/lsw/materialInbound/list",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      handleAdd(inboundCategory) {
        this.$refs.modalForm.add(inboundCategory);
        this.$refs.modalForm.title = "新增";
        this.$refs.modalForm.disableSubmit = false;
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'int',value:'delFlag',text:'删除标记',dictCode:''})
        fieldList.push({type:'string',value:'factoryId',text:'产线ID',dictCode:''})
        fieldList.push({type:'string',value:'warehouseId',text:'库存地ID',dictCode:''})
        fieldList.push({type:'string',value:'materialNumber',text:'物料编码',dictCode:''})
        fieldList.push({type:'string',value:'materialName',text:'物料名称',dictCode:''})
        fieldList.push({type:'string',value:'batchNumber',text:'批次号',dictCode:''})
        fieldList.push({type:'int',value:'quantity',text:'入库数量',dictCode:''})
        fieldList.push({type:'string',value:'receiver',text:'接收人',dictCode:''})
        fieldList.push({type:'datetime',value:'receiveTime',text:'接收时间'})
        this.superFieldList = fieldList
      }
    }
  }
</script>
src/views/lsw/LswMaterialInventoryList.vue
@@ -1,201 +1,104 @@
<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>
      </a-form>
    <div style="display: flex; align-items: center; margin-bottom: 10px;">
      <a-tag color="blue" style="font-weight: bold; font-size: large;">
        åº“存统计:{{ inventoryStatisticsInfo}}
      </a-tag>
    </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>
    <lsw-material-inventory-modal ref="modalForm" @ok="modalFormOk"></lsw-material-inventory-modal>
    <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">
    </a-table>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import LswMaterialInventoryModal from './modules/LswMaterialInventoryModal'
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import LswMaterialInventoryModal from './modules/LswMaterialInventoryModal'
import { getAction } from '@api/manage'
  export default {
    name: 'LswMaterialInventoryList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      LswMaterialInventoryModal
    },
    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'
          },
          {
            title:'批次号',
            align:"center",
            dataIndex: 'batchNumber'
          },
          {
            title:'库存类型',
            align:"center",
            dataIndex: 'inventoryCategory'
          },
          {
            title:'数量',
            align:"center",
            dataIndex: 'quantity'
          },
          {
            title:'库存地ID',
            align:"center",
            dataIndex: 'warehouseId'
          },
          {
            title:'库存状态',
            align:"center",
            dataIndex: 'inventoryStatus'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
export default {
  name: 'LswMaterialInventoryList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    LswMaterialInventoryModal
  },
  data() {
    return {
      description: '物料库存信息管理页面',
      inventoryStatisticsInfo: "0",
      // è¡¨å¤´
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        ],
        url: {
          list: "/lswmaterialinventory/lswMaterialInventory/list",
          delete: "/lswmaterialinventory/lswMaterialInventory/delete",
          deleteBatch: "/lswmaterialinventory/lswMaterialInventory/deleteBatch",
          exportXlsUrl: "/lswmaterialinventory/lswMaterialInventory/exportXls",
          importExcelUrl: "lswmaterialinventory/lswMaterialInventory/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
        {
          title: '批次号',
          align: 'center',
          dataIndex: 'batchNumber'
        },
        {
          title: '库存类型',
          align: 'center',
          dataIndex: 'inventoryCategory_dictText'
        },
        {
          title: '数量',
          align: 'center',
          dataIndex: 'quantity'
        },
        {
          title: '库存地',
          align: 'center',
          dataIndex: 'warehouseId_dictText'
        },
        {
          title: '库存状态',
          align: 'center',
          dataIndex: 'inventoryStatus_dictText'
        },
      ],
      url: {
        list: '/lsw/materialInventory/list',
        statistics: '/lsw/materialInventory/statisticsInventory',
      },
    },
    methods: {
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'materialId',text:'物料ID',dictCode:''})
        fieldList.push({type:'string',value:'batchNumber',text:'批次号',dictCode:''})
        fieldList.push({type:'string',value:'inventoryCategory',text:'库存类型',dictCode:''})
        fieldList.push({type:'string',value:'quantity',text:'数量',dictCode:''})
        fieldList.push({type:'string',value:'warehouseId',text:'库存地ID',dictCode:''})
        fieldList.push({type:'string',value:'inventoryStatus',text:'库存状态',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  },
  created() {
  },
  computed: {
  },
  methods: {
    statisticsInventory(materialId) {
      getAction(this.url.statistics, {materialId : materialId}).then(res => {
        if(res.success) {
          this.inventoryStatisticsInfo = res.result;
        }
      })
    }
  }
}
</script>
<style scoped>
  @import '~@assets/less/common.less';
@import '~@assets/less/common.less';
</style>
src/views/lsw/modules/LswMaterialInboundForm.vue
@@ -3,40 +3,25 @@
    <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="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 label="来源编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originalCode">
              <a-input v-model="model.originalCode" placeholder="请输入来源编码"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="来源名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originalName">
              <a-input v-model="model.originalName" placeholder="请输入来源名称"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="线边库" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseId">
              <j-search-select-tag v-model="model.warehouseId" placeholder="请选择线边库"
                                   :dict-options="warehouseDictOptions" @change="warehouseSelectChange"></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>
              <j-search-select-tag :dict-options="materialDictOptions" v-model="model.materialNumber" placeholder="请选择物料编码" @change="materialSelectChange"></j-search-select-tag>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -49,15 +34,20 @@
              <a-input-number v-model="model.quantity" placeholder="请输入入库数量" style="width: 100%" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
    <j-form-container disabled>
      <a-form-model ref="form1" :model="model" slot="detail">
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="接收人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver">
              <j-select-user-by-dep v-model="model.receiver" placeholder="请输入接收人"></j-select-user-by-dep>
            <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName">
              <a-input v-model="model.materialName"></a-input>
            </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%" />
            <a-form-model-item label="入库类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inboundCategory">
              <j-search-select-tag v-model="model.inboundCategory" dict="material_inbound_category"></j-search-select-tag>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -68,21 +58,11 @@
<script>
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'
import { getAction, httpAction } from '@/api/manage'
export default {
  name: 'LswMaterialInboundForm',
  components: {
    JDate,
    JTreeDict,
    JSelectFactory
  },
  props: {
    //表单禁用
@@ -104,12 +84,17 @@
        sm: { span: 16 }
      },
      confirmLoading: false,
      warehouseDictOptions: [],
      materialDictOptions: [],
      validatorRules: {
        factoryId: [
          { required: true, message: '产线是必选项', trigger: 'change' }
        originalCode: [
          { required: true, message: '来源编码是必选项', trigger: 'change' }
        ],
        originalName: [
          { required: true, message: '来源名称是必选项', trigger: 'change' }
        ],
        warehouseId: [
          { required: true, message: '库存地是必选项', trigger: 'change' }
          { required: true, message: '线边库是必选项', trigger: 'change' }
        ],
        materialNumber: [
          { required: true, message: '物料编码是必选项', trigger: 'change' }
@@ -123,17 +108,13 @@
        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'
        add: '/lsw/materialInbound/add',
        edit: '/lsw/materialInbound/edit',
        queryById: '/lsw/materialInbound/queryById',
        queryByProductionType: '/base/lineSideWarehouse/queryByProductionType',
        queryByMaterialCategory: '/lsw/lswMaterial/queryByMaterialCategory',
      }
    }
  },
@@ -147,14 +128,20 @@
    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() {
    add(inboundCategory) {
      this.warehouseDictOptions = [];
      this.materialDictOptions = [];
      if(inboundCategory === 'HEAT_TREATMENT_INBOUND') {
        this.loadWarehouseDictOptions('OUTERFLANGE,INNERFLANGE');
        this.loadMaterialDictOptions('BLANK');
      }else if(inboundCategory === 'SMALL_INNER_RING') {
        this.loadWarehouseDictOptions('ASSEMBLE');
        this.loadMaterialDictOptions('SMALL_INNER_RING');
      } else if(inboundCategory === 'MATERIAL_INNER_TRANSFER') {
        this.loadWarehouseDictOptions('ASSEMBLE');
        this.loadMaterialDictOptions('STEEL_BALL');
      }
      this.modelDefault.inboundCategory = inboundCategory;
      this.edit(this.modelDefault)
    },
    edit(record) {
@@ -189,6 +176,38 @@
        }
      })
    },
    loadWarehouseDictOptions(productionType) {
      let params = {productionType : productionType}
      getAction(this.url.queryByProductionType, params).then(res => {
        if(res.success) {
          this.warehouseDictOptions = res.result.map(warehouse => ({...warehouse, value : warehouse.id, text: warehouse.warehouseName + '(' + warehouse.warehouseCode+')'}));
        }
      })
    },
    loadMaterialDictOptions(materialCategory) {
      let params = {materialCategory : materialCategory}
      getAction(this.url.queryByMaterialCategory, params).then(res => {
        if(res.success) {
          this.materialDictOptions = res.result.map(material => ({...material, value : material.materialNumber, text: material.materialNumber}));
        }
      })
    },
    warehouseSelectChange(value) {
      let warehouse = this.warehouseDictOptions.find(option => option.value === value)
      if(warehouse) {
        this.model.factoryId = warehouse.factoryId
      }else {
        this.model.factoryId = undefined;
      }
    },
    materialSelectChange(value) {
      let material = this.materialDictOptions.find(option => option.value === value)
      if(material) {
        this.model.materialName = material.materialName
      }else {
        this.model.materialName = undefined;
      }
    }
  }
}
src/views/lsw/modules/LswMaterialInboundModal.vue
@@ -29,10 +29,10 @@
      }
    },
    methods: {
      add () {
      add (inboundCategory) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.add();
          this.$refs.realForm.add(inboundCategory);
        })
      },
      edit (record) {
src/views/mes/MesProductionWorkOrderListView.vue
@@ -109,7 +109,7 @@
            </span>
            <span v-if="record.workOrderStatus === 'PUBLISHED' && record.completenessCheckFlag === '1' && record.equipmentInspectionFlag === '0'">
              <a-divider type="vertical" />
              <a @click="handleCompletenessCheck(record)">设备点检</a>
              <a @click="handleEquipmentInspection(record)">设备点检</a>
            </span>
            <span v-if="record.workOrderStatus === 'PUBLISHED' && record.completenessCheckFlag === '1' && record.equipmentInspectionFlag === '1' && record.processInspectionFlag === '0'">
              <a-divider type="vertical" />
@@ -195,6 +195,7 @@
    <MesProductionWorkOrderRepublishModal ref="MesProductionWorkOrderRepublishModal" @ok="modalFormOk"></MesProductionWorkOrderRepublishModal>
    <MesProductionWorkOrderReportModal ref="MesProductionWorkOrderReportModal" @ok="modalFormOk"></MesProductionWorkOrderReportModal>
    <MesProductionWorkOrderCompletenessCheckModal ref="MesProductionWorkOrderCompletenessCheckModal" @ok="modalFormOk"></MesProductionWorkOrderCompletenessCheckModal>
    <MesProductionWorkOrderEquipmentInspectionModal ref="MesProductionWorkOrderEquipmentInspectionModal" @ok="modalFormOk"></MesProductionWorkOrderEquipmentInspectionModal>
  </a-card>
</template>
@@ -212,6 +213,7 @@
import MesProductionWorkOrderRepublishModal from '@views/mes/modules/MesProductionWorkOrderRepublishModal.vue'
import MesProductionWorkOrderReportModal from '@views/mes/modules/MesProductionWorkOrderReportModal.vue'
import MesProductionWorkOrderCompletenessCheckModal from '@views/mes/modules/MesProductionWorkOrderCompletenessCheckModal.vue'
import MesProductionWorkOrderEquipmentInspectionModal from '@views/mes/modules/MesProductionWorkOrderEquipmentInspectionModal.vue'
import JSelectFactory from '@comp/jeecgbiz/JSelectFactory.vue'
import moment from 'moment/moment'
@@ -226,7 +228,8 @@
    MesProductionWorkOrderScheduleModal,
    MesProductionWorkOrderRepublishModal,
    MesProductionWorkOrderReportModal,
    MesProductionWorkOrderCompletenessCheckModal
    MesProductionWorkOrderCompletenessCheckModal,
    MesProductionWorkOrderEquipmentInspectionModal
  },
  data() {
    return {
@@ -645,6 +648,9 @@
    handleCompletenessCheck(record) {
      this.$refs.MesProductionWorkOrderCompletenessCheckModal.check(record)
    },
    handleEquipmentInspection(record) {
      this.$refs.MesProductionWorkOrderEquipmentInspectionModal.inspect(record)
    },
    async handleUnLoadingDetail(row){
      console.log('row---->',row)
      const unloadingResult = await getAction(this.url.queryUnloadingByLoadingId,{'loadingId':row.id})
src/views/mes/modules/MesProductionWorkOrderEquipmentInspectionModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,251 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item prop="standardCode" label="工单号">
              <a-input placeholder="工单号自动生成" v-model="model.orderNum" readOnly/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item prop="equipmentId" label="设备编号">
              <a-select placeholder="请选择设备" v-model="model.equipmentId" :options="inspectionEquipmentOptions" @change="handleEquipmentChange"></a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item prop="standardName" label="标准名称">
              <a-input placeholder="选择设备后自动带出" readOnly v-model="model.standardName"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item prop="standardCode" label="标准编码">
              <a-input placeholder="选择设备后自动带出" readOnly v-model="model.standardCode"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="保养周期">
              <a-input placeholder="选择设备后自动带出" v-model="model.maintenancePeriod" readOnly/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <vxe-table
            ref="table"
            border
            show-overflow
            show-header-overflow
            :scroll-x="{enabled: true}"
            :data="dataSource"
            :edit-config="{trigger: 'click', mode: 'cell'}"
            :edit-rules="editRules"
          >
            <vxe-table-column title="序号" field="itemCode" width="50" align="center"></vxe-table-column>
            <vxe-table-column title="部位" field="itemPart" align="center"></vxe-table-column>
            <vxe-table-column title="保养项目" field="itemName" align="center"></vxe-table-column>
            <vxe-table-column title="检查标准或要求" field="itemDemand" align="center"></vxe-table-column>
            <vxe-table-column title="保养要求" field="itemDemandAlias" align="center"></vxe-table-column>
            <vxe-table-column title="检查方法" field="checkMethod" align="center"></vxe-table-column>
            <vxe-table-column title="点检结果" field="inspectionResult" align="center"
                              :edit-render="{name: '$select', options: inspectionResultOptions}">
              <template #default="{ row }">
                <span v-if="row.inspectionResult">{{ getInspectionResultLabel(row.inspectionResult) }}</span>
                <span v-else class="placeholder-text">请选择点检结果</span>
              </template>
            </vxe-table-column>
            <vxe-table-column title="异常描述" field="exceptionDescription" align="center"
                              :edit-render="{name: '$input', placeholder: '请输入异常描述'}">
              <template #default="{ row }">
                <span v-if="row.inspectionResult === '2' && !row.exceptionDescription" class="placeholder-text">请输入异常描述</span>
                <span v-else-if="row.exceptionDescription">{{ row.exceptionDescription }}</span>
              </template>
              <template #edit="{ row }">
                <vxe-input v-if="row.inspectionResult === '2'" v-model="row.exceptionDescription" placeholder="请输入异常描述" />
              </template>
            </vxe-table-column>
          </vxe-table>
        </a-row>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
import { postAction, getAction, putAction } from '@api/manage'
export default {
  name: 'MesProductionWorkOrderReportModal',
  data () {
    return {
      title: '设备点检',
      width: 1200,
      visible: false,
      loading: false,
      disableSubmit: false,
      model: {},
      spinning: false,
      validatorRules: {
      },
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      inspectionResultOptions: [
        {
          label: '正常',
          value: '1'
        },
        {
          label: '异常',
          value: '2'
        }
      ],
      dataSource: [],
      editRules: {
        inspectionResult: [
          { required: true, message: '检查结果必须选择' }
        ],
        exceptionDescription: [
          {
            required: true,
            message: '异常描述不能为空',
            validator: ({ cellValue, row }) => {
              // å½“点检结果为异常时,异常描述必填
              if (row.inspectionResult === '2') {
                return cellValue && cellValue.trim() !== '' ? true : new Error('异常描述必须填写');
              }
              return true;
            }
          }
        ]
      },
      url: {
        report: '/mesworkreporting/mesWorkReporting/add',
        listInspectionEquipment: '/eam/equipment/listProductionLineInspectionEquipment',
        queryByEquipmentId: '/eam/maintenanceStandard/queryByEquipmentId',
        addInspectionOrder: '/eam/eamInspectionOrder/add',
        updateOrderInspectionStatus: '/mes/mesProductionWorkOrder/edit'
      },
      inspectionEquipmentOptions: [],
      workOrderId: null
    }
  },
  computed: {
    formDisabled(){
      return this.disabled
    }
  },
  methods: {
    getInspectionResultLabel(value) {
      const option = this.inspectionResultOptions.find(item => item.value === value);
      return option ? option.label : value;
    },
    inspect (record) {
      this.resetFormData()
      this.workOrderId = record.id
      getAction(this.url.listInspectionEquipment, {orderId: record.id}).then(res => {
        if (res.success) {
          this.inspectionEquipmentOptions = res.result
        }
      })
      this.visible = true
    },
    close () {
      this.$emit('close');
      this.visible = false;
    },
    handleEquipmentChange(id) {
      getAction(this.url.queryByEquipmentId, {equipmentId: id}).then(res => {
        if (res.success) {
          console.log(res.result)
          this.model = {
            ...this.model,
            standardId: res.result.id,
            standardName: res.result.standardName,
            standardCode: res.result.standardCode,
            maintenancePeriod: res.result.maintenancePeriod
          }
          this.dataSource = res.result.maintenanceStandardDetailList
        }
      })
    },
    handleOk () {
      this.$refs.table.validate((valid) => {
        if (valid) {
          this.$message.error("请完成所有必填信息后再提交!")
        } else {
          let tableData = this.$refs.table.getTableData().fullData
          const data = {
            ...this.model,
            workOrderId: this.workOrderId,
            tableDetailList: tableData
          }
          postAction(this.url.addInspectionOrder, data).then(res=> {
            if (res.success) {
              this.$message.success(res.message)
              getAction(this.url.listInspectionEquipment, {orderId: this.workOrderId}).then(res => {
                if (res.success) {
                  if (res.result && res.result.length > 0) {
                    // è¿˜æœ‰è®¾å¤‡éœ€è¦ç‚¹æ£€ï¼Œæ¸…空表单和表格数据
                    this.inspectionEquipmentOptions = res.result
                    this.resetFormData()
                  } else {
                    // æ²¡æœ‰éœ€è¦ç‚¹æ£€çš„设备,更新点检状态
                    putAction(this.url.updateOrderInspectionStatus, {id: this.workOrderId, equipmentInspectionFlag: '1'}).then(res => {
                      if (res.success) {
                        this.$message.success('设备点检完成')
                        this.submitCallback()
                      } else {
                        this.$message.warning(res.message)
                      }
                    })
                    this.submitCallback()
                  }
                }
              })
            } else {
              this.$message.warning(res.message)
            }
          })
        }
      })
    },
    resetFormData() {
      this.$refs.form.resetFields()
      this.model = {}
      this.dataSource = []
    },
    submitCallback(){
      this.$emit('ok');
      this.visible = false;
    },
    handleCancel () {
      this.close()
    }
  }
}
</script>
<style scoped>
.placeholder-text {
  color: #999;
  font-style: italic;
}
</style>