Lius
2025-07-28 37d5d7292db5674ac33d859a8a08acfb7580e8d1
Merge remote-tracking branch 'origin/master'
已添加34个文件
6020 ■■■■■ 文件已修改
src/views/tms/TmsToolHistoryList.vue 237 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolInboundDetailList.vue 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolInboundInventoryList.vue 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolInboundList.vue 312 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolInventoryList.vue 209 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolReceiveDetailList.vue 192 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolReceiveList.vue 327 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolScrapDetailList.vue 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolScrapList.vue 286 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolStocktakingDetailList.vue 197 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolStocktakingInventoryChangeList.vue 195 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolStocktakingList.vue 262 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolsList.vue 252 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/JSelectInboundToolModal.vue 283 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolHistoryForm.vue 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolHistoryModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolInboundDetailModal.vue 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolInboundForm.vue 206 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolInboundInventoryForm.vue 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolInboundInventoryModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolInboundModal.vue 326 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolInventoryForm.vue 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolInventoryModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolReceiveDetailModal.vue 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolReceiveModal.vue 179 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolScrapDetailModal.vue 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolScrapForm.vue 206 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolScrapModal.vue 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolStocktakingDetailModal.vue 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolStocktakingInventoryChangeForm.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolStocktakingInventoryChangeModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolStocktakingModal.vue 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolsForm.vue 171 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/TmsToolsModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/TmsToolHistoryList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,237 @@
<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="工装条码">
              <a-input placeholder="请输入工装条码" v-model="queryParam.toolBarcode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="操作人">
              <a-input placeholder="请输入操作人" v-model="queryParam.operator"></a-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="操作类型">
                <a-input placeholder="请输入操作类型" v-model="queryParam.operateType"></a-input>
              </a-form-item>
            </a-col>
          </template>
          <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 @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </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>-->
<!--      &lt;!&ndash; é«˜çº§æŸ¥è¯¢åŒºåŸŸ &ndash;&gt;-->
<!--      <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>
    <tms-tool-history-modal ref="modalForm" @ok="modalFormOk"></tms-tool-history-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolHistoryModal from './modules/TmsToolHistoryModal'
  export default {
    name: 'TmsToolHistoryList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      TmsToolHistoryModal
    },
    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: 'inventoryId'
          },
          {
            title:'工装条码',
            align:"center",
            dataIndex: 'toolBarcode'
          },
          {
            title:'操作人',
            align:"center",
            dataIndex: 'operator'
          },
          {
            title:'操作时间',
            align:"center",
            dataIndex: 'operateTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'操作类型',
            align:"center",
            dataIndex: 'operateType'
          },
          {
            title:'业务主表',
            align:"center",
            dataIndex: 'businessTable'
          },
          // {
          //   title:'业务id',
          //   align:"center",
          //   dataIndex: 'businessId'
          // },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/tms/tmsToolHistory/list",
          delete: "/tms/tmsToolHistory/delete",
          deleteBatch: "/tms/tmsToolHistory/deleteBatch",
          exportXlsUrl: "/tms/tmsToolHistory/exportXls",
          importExcelUrl: "tms/tmsToolHistory/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:'inventoryId',text:'库存ID',dictCode:''})
        fieldList.push({type:'string',value:'toolBarcode',text:'工装条码',dictCode:''})
        fieldList.push({type:'string',value:'operator',text:'操作人',dictCode:''})
        fieldList.push({type:'date',value:'operateTime',text:'操作时间'})
        fieldList.push({type:'string',value:'operateType',text:'操作类型',dictCode:''})
        fieldList.push({type:'string',value:'businessTable',text:'业务主表',dictCode:''})
        fieldList.push({type:'string',value:'businessId',text:'业务id',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/tms/TmsToolInboundDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,203 @@
<template>
  <a-card :bordered="false" :class="'cust-erp-sub-tab'">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
<!--    <div class="table-operator" v-if="mainId">-->
<!--      <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>-->
<!--      <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"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="null"
        @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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
    <tmsToolInboundDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></tmsToolInboundDetail-modal>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolInboundDetailModal from './modules/TmsToolInboundDetailModal'
  export default {
    name: "TmsToolInboundDetailList",
    mixins:[JeecgListMixin],
    components: { TmsToolInboundDetailModal },
    props:{
      mainId:{
        type:String,
        default:'',
        required:false
      }
    },
    watch:{
      mainId:{
        immediate: true,
        handler(val) {
          if(!this.mainId){
            this.clearList()
          }else{
            this.queryParam['orderId'] = val
            this.loadData(1);
          }
        }
      }
    },
    data () {
      return {
        description: '工装入库管理页面',
        disableMixinCreated:true,
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'工装名称',
            align:"center",
            dataIndex: 'toolName'
          },
          {
            title:'工装分类',
            align:"center",
            dataIndex: 'toolCategory'
          },
          {
            title:'工装编码',
            align:"center",
            dataIndex: 'toolCode'
          },
          {
            title:'型号',
            align:"center",
            dataIndex: 'toolModel'
          },
          {
            title:'规格',
            align:"center",
            dataIndex: 'toolSpecification'
          },
          {
            title:'入库数量',
            align:"center",
            dataIndex: 'receiveNumber'
          },
          // {
          //   title: '操作',
          //   dataIndex: 'action',
          //   align:"center",
          //   fixed:"right",
          //   width:147,
          //   scopedSlots: { customRender: 'action' },
          // }
        ],
        url: {
          list: "/tms/tmsToolInbound/listTmsToolInboundDetailByMainId",
          delete: "/tms/tmsToolInbound/deleteTmsToolInboundDetail",
          deleteBatch: "/tms/tmsToolInbound/deleteBatchTmsToolInboundDetail",
          exportXlsUrl: "/tms/tmsToolInbound/exportTmsToolInboundDetail",
          importUrl: "/tms/tmsToolInbound/importTmsToolInboundDetail",
        },
        dictOptions:{
         orderStatus:[],
        }
      }
    },
    created() {
    },
    computed: {
      importExcelUrl(){
        return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
      }
    },
    methods: {
      clearList(){
        this.dataSource=[]
        this.selectedRowKeys=[]
        this.ipagination.current = 1
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
src/views/tms/TmsToolInboundInventoryList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,177 @@
<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>
    <!-- æŸ¥è¯¢åŒºåŸŸ-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>
    <tms-tool-inbound-inventory-modal ref="modalForm" @ok="modalFormOk"></tms-tool-inbound-inventory-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolInboundInventoryModal from './modules/TmsToolInboundInventoryModal'
  export default {
    name: 'TmsToolInboundInventoryList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      TmsToolInboundInventoryModal
    },
    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: 'orderId'
          },
          {
            title:'库存ID',
            align:"center",
            dataIndex: 'inventoryId'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/tms/tmsToolInboundInventory/list",
          delete: "/tms/tmsToolInboundInventory/delete",
          deleteBatch: "/tms/tmsToolInboundInventory/deleteBatch",
          exportXlsUrl: "/tms/tmsToolInboundInventory/exportXls",
          importExcelUrl: "tms/tmsToolInboundInventory/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:'orderId',text:'入库单ID',dictCode:''})
        fieldList.push({type:'string',value:'inventoryId',text:'库存ID',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/tms/TmsToolInboundList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,312 @@
<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="入库单状态">
              <a-input placeholder="请输入入库单状态" v-model="queryParam.orderStatus"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="入库人">
              <a-input placeholder="请输入入库人" v-model="queryParam.receiver"></a-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="入库时间">
                <j-date placeholder="请选择入库时间" v-model="queryParam.receiveTime"></j-date>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="确认人">
                <a-input placeholder="请输入确认人" v-model="queryParam.confirmer"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="确认时间">
                <j-date placeholder="请选择确认时间" v-model="queryParam.confirmTime"></j-date>
              </a-form-item>
            </a-col>
          </template>
          <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 @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </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>-->
    </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"
        bordered
        rowKey="id"
        class="j-table-force-nowrap"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
        :customRow="clickThenSelect"
        @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="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>
          </a-dropdown>
        </span>
      </a-table>
    </div>
    <a-tabs defaultActiveKey="1">
      <a-tab-pane tab="工装入库明细" key="1" >
        <TmsToolInboundDetailList ref="tmsToolInboundDetailList" :mainId="tmsToolInboundDetailMainId" />
      </a-tab-pane>
    </a-tabs>
    <tmsToolInbound-modal ref="modalForm" @ok="modalFormOk"></tmsToolInbound-modal>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolInboundModal from './modules/TmsToolInboundModal'
  import { getAction } from '@/api/manage'
  import TmsToolInboundDetailList from './TmsToolInboundDetailList'
  import '@/assets/less/TableExpand.less'
  export default {
    name: "TmsToolInboundList",
    mixins:[JeecgListMixin],
    components: {
      TmsToolInboundDetailList,
      TmsToolInboundModal
    },
    data () {
      return {
        description: '工装入库管理页面',
        // è¡¨å¤´
        columns: [
          // {
          //   title:'入库单状态',
          //   align:"center",
          //   dataIndex: 'orderStatus_dictText',
          // },
          {
            title:'入库人',
            align:"center",
            dataIndex: 'receiver'
          },
          {
            title:'入库时间',
            align:"center",
            dataIndex: 'receiveTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'入库说明',
            align:"center",
            dataIndex: 'receiveComment'
          },
          {
            title:'确认人',
            align:"center",
            dataIndex: 'confirmer'
          },
          {
            title:'确认时间',
            align:"center",
            dataIndex: 'confirmTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'确认意见',
            align:"center",
            dataIndex: 'confirmComment'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/tms/tmsToolInbound/list",
          delete: "/tms/tmsToolInbound/delete",
          deleteBatch: "/tms/tmsToolInbound/deleteBatch",
          exportXlsUrl: "/tms/tmsToolInbound/exportXls",
          importExcelUrl: "tms/tmsToolInbound/importExcel",
        },
        dictOptions:{
         orderStatus:[],
        },
        /* åˆ†é¡µå‚æ•° */
        ipagination:{
          current: 1,
          pageSize: 5,
          pageSizeOptions: ['5', '10', '50'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " å…±" + total + "条"
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        selectedMainId:'',
        superFieldList:[],
        tmsToolInboundDetailMainId: '',
      }
    },
    created() {
      this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      modalFormOk() {
        this.$refs.tmsToolInboundDetailList.clearList()
        this.loadData();
      },
      searchReset() {
        this.queryParam = {}
        this.onClearSelected()
        this.$refs.tmsToolInboundDetailList.clearList()
        this.loadData(1);
      },
      initDictConfig(){
      },
      clickThenSelect(record) {
        return {
          on: {
            click: () => {
              this.onSelectChange(record.id.split(","), [record]);
            }
          }
        }
      },
      onClearSelected() {
        this.selectedRowKeys = [];
        this.selectionRows = [];
        this.selectedMainId = ''
        this.tmsToolInboundDetailMainId = ''
      },
      onSelectChange(selectedRowKeys, selectionRows) {
        this.selectedMainId=selectedRowKeys[0]
        this.selectedRowKeys = selectedRowKeys;
        this.selectionRows = selectionRows;
        this.tmsToolInboundDetailMainId = selectionRows[0]['id']
      },
      loadData(arg) {
        if(!this.url.list){
          this.$message.error("请设置url.list属性!")
          return
        }
        //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
        if (arg === 1) {
          this.ipagination.current = 1;
        }
        this.onClearSelected()
        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;
        })
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'orderStatus',text:'入库单状态',dictCode:''})
        fieldList.push({type:'string',value:'receiver',text:'入库人',dictCode:''})
        fieldList.push({type:'date',value:'receiveTime',text:'入库时间'})
        fieldList.push({type:'string',value:'receiveComment',text:'入库说明',dictCode:''})
        fieldList.push({type:'string',value:'confirmer',text:'确认人',dictCode:''})
        fieldList.push({type:'date',value:'confirmTime',text:'确认时间'})
        fieldList.push({type:'string',value:'confirmComment',text:'确认意见',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
src/views/tms/TmsToolInventoryList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,209 @@
<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="工装条码">
              <a-input placeholder="请输入工装条码" v-model="queryParam.toolBarcode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="库存状态">
              <a-input placeholder="请输入库存状态" v-model="queryParam.inventoryStatus"></a-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>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </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>-->
<!--      &lt;!&ndash; é«˜çº§æŸ¥è¯¢åŒºåŸŸ &ndash;&gt;-->
<!--      <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>
    <tms-tool-inventory-modal ref="modalForm" @ok="modalFormOk"></tms-tool-inventory-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolInventoryModal from './modules/TmsToolInventoryModal'
  export default {
    name: 'TmsToolInventoryList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      TmsToolInventoryModal
    },
    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: 'toolId'
          },
          {
            title:'工装条码',
            align:"center",
            dataIndex: 'toolBarcode'
          },
          {
            title:'库存状态',
            align:"center",
            dataIndex: 'inventoryStatus'
          },
          {
            title:'当前寿命(百分比)',
            align:"center",
            dataIndex: 'currentLife'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/tms/tmsToolInventory/list",
          delete: "/tms/tmsToolInventory/delete",
          deleteBatch: "/tms/tmsToolInventory/deleteBatch",
          exportXlsUrl: "/tms/tmsToolInventory/exportXls",
          importExcelUrl: "tms/tmsToolInventory/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:'toolId',text:'工装ID',dictCode:''})
        fieldList.push({type:'string',value:'toolBarcode',text:'工装条码',dictCode:''})
        fieldList.push({type:'string',value:'inventoryStatus',text:'库存状态',dictCode:''})
        fieldList.push({type:'BigDecimal',value:'currentLife',text:'当前寿命(百分比)',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/tms/TmsToolReceiveDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,192 @@
<template>
  <a-card :bordered="false" :class="'cust-erp-sub-tab'">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator" v-if="mainId">
      <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>
      <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"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
    <tmsToolReceiveDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></tmsToolReceiveDetail-modal>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolReceiveDetailModal from './modules/TmsToolReceiveDetailModal'
  export default {
    name: "TmsToolReceiveDetailList",
    mixins:[JeecgListMixin],
    components: { TmsToolReceiveDetailModal },
    props:{
      mainId:{
        type:String,
        default:'',
        required:false
      }
    },
    watch:{
      mainId:{
        immediate: true,
        handler(val) {
          if(!this.mainId){
            this.clearList()
          }else{
            this.queryParam['orderId'] = val
            this.loadData(1);
          }
        }
      }
    },
    data () {
      return {
        description: '工装领用管理页面',
        disableMixinCreated:true,
        // è¡¨å¤´
        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:'工装ID',
            align:"center",
            dataIndex: 'toolId'
          },
          {
            title:'库存ID',
            align:"center",
            dataIndex: 'inventoryId'
          },
          {
            title:'使用寿命(百分比)',
            align:"center",
            dataIndex: 'usedLife'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/tms/tmsToolReceive/listTmsToolReceiveDetailByMainId",
          delete: "/tms/tmsToolReceive/deleteTmsToolReceiveDetail",
          deleteBatch: "/tms/tmsToolReceive/deleteBatchTmsToolReceiveDetail",
          exportXlsUrl: "/tms/tmsToolReceive/exportTmsToolReceiveDetail",
          importUrl: "/tms/tmsToolReceive/importTmsToolReceiveDetail",
        },
        dictOptions:{
        }
      }
    },
    created() {
    },
    computed: {
      importExcelUrl(){
        return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
      }
    },
    methods: {
      clearList(){
        this.dataSource=[]
        this.selectedRowKeys=[]
        this.ipagination.current = 1
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
src/views/tms/TmsToolReceiveList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,327 @@
<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="领用单状态">
              <a-input placeholder="请输入领用单状态" v-model="queryParam.orderStatus"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="领用人">
              <a-input placeholder="请输入领用人" v-model="queryParam.receiver"></a-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="领用时间">
                <j-date placeholder="请选择领用时间" v-model="queryParam.receiveTime"></j-date>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="确认人">
                <a-input placeholder="请输入确认人" v-model="queryParam.confirmer"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="确认时间">
                <j-date placeholder="请选择确认时间" v-model="queryParam.confirmTime"></j-date>
              </a-form-item>
            </a-col>
          </template>
          <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 @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </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>-->
<!--      &lt;!&ndash; é«˜çº§æŸ¥è¯¢åŒºåŸŸ &ndash;&gt;-->
<!--      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
    </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"
        bordered
        rowKey="id"
        class="j-table-force-nowrap"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
        :customRow="clickThenSelect"
        @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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </a-table>
    </div>
<!--    <a-tabs defaultActiveKey="1">-->
<!--      <a-tab-pane tab="工装领用明细" key="1" >-->
<!--        <TmsToolReceiveDetailList :mainId="tmsToolReceiveDetailMainId" />-->
<!--      </a-tab-pane>-->
<!--    </a-tabs>-->
    <tmsToolReceive-modal ref="modalForm" @ok="modalFormOk"></tmsToolReceive-modal>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolReceiveModal from './modules/TmsToolReceiveModal'
  import { getAction } from '@/api/manage'
  import TmsToolReceiveDetailList from './TmsToolReceiveDetailList'
  import '@/assets/less/TableExpand.less'
  export default {
    name: "TmsToolReceiveList",
    mixins:[JeecgListMixin],
    components: {
      TmsToolReceiveDetailList,
      TmsToolReceiveModal
    },
    data () {
      return {
        description: '工装领用管理页面',
        // è¡¨å¤´
        columns: [
          // {
          //   title:'领用单状态',
          //   align:"center",
          //   dataIndex: 'orderStatus'
          // },
          {
            title:'领用人',
            align:"center",
            dataIndex: 'receiver'
          },
          {
            title:'领用时间',
            align:"center",
            dataIndex: 'receiveTime'
          },
          {
            title:'领用说明',
            align:"center",
            dataIndex: 'receiveComment'
          },
          {
            title:'确认人',
            align:"center",
            dataIndex: 'confirmer'
          },
          {
            title:'确认时间',
            align:"center",
            dataIndex: 'confirmTime'
          },
          {
            title:'确认意见',
            align:"center",
            dataIndex: 'confirmComment'
          },
          {
            title:'是否会归还',
            align:"center",
            dataIndex: 'returnFlag'
          },
          {
            title:'归还时间',
            align:"center",
            dataIndex: 'returnTime'
          },
          {
            title:'归还说明',
            align:"center",
            dataIndex: 'returnComment'
          },
          {
            title:'归还确认人',
            align:"center",
            dataIndex: 'returnConfirmer'
          },
          {
            title:'归还确认时间',
            align:"center",
            dataIndex: 'returnConfirmTime'
          },
          {
            title:'归还确认意见',
            align:"center",
            dataIndex: 'returnConfirmComment'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/tms/tmsToolReceive/list",
          delete: "/tms/tmsToolReceive/delete",
          deleteBatch: "/tms/tmsToolReceive/deleteBatch",
          exportXlsUrl: "/tms/tmsToolReceive/exportXls",
          importExcelUrl: "tms/tmsToolReceive/importExcel",
        },
        dictOptions:{
        },
        /* åˆ†é¡µå‚æ•° */
        ipagination:{
          current: 1,
          pageSize: 5,
          pageSizeOptions: ['5', '10', '50'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " å…±" + total + "条"
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        selectedMainId:'',
        superFieldList:[],
        tmsToolReceiveDetailMainId: '',
      }
    },
    created() {
      this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      initDictConfig(){
      },
      clickThenSelect(record) {
        return {
          on: {
            click: () => {
              this.onSelectChange(record.id.split(","), [record]);
            }
          }
        }
      },
      onClearSelected() {
        this.selectedRowKeys = [];
        this.selectionRows = [];
        this.selectedMainId=''
      },
      onSelectChange(selectedRowKeys, selectionRows) {
        this.selectedMainId=selectedRowKeys[0]
        this.selectedRowKeys = selectedRowKeys;
        this.selectionRows = selectionRows;
        this.tmsToolReceiveDetailMainId = selectionRows[0]['id']
      },
      loadData(arg) {
        if(!this.url.list){
          this.$message.error("请设置url.list属性!")
          return
        }
        //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
        if (arg === 1) {
          this.ipagination.current = 1;
        }
        this.onClearSelected()
        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;
        })
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'orderStatus',text:'领用单状态',dictCode:''})
        fieldList.push({type:'string',value:'receiver',text:'领用人',dictCode:''})
        fieldList.push({type:'date',value:'receiveTime',text:'领用时间'})
        fieldList.push({type:'string',value:'receiveComment',text:'领用说明',dictCode:''})
        fieldList.push({type:'string',value:'confirmer',text:'确认人',dictCode:''})
        fieldList.push({type:'date',value:'confirmTime',text:'确认时间'})
        fieldList.push({type:'string',value:'confirmComment',text:'确认意见',dictCode:''})
        fieldList.push({type:'string',value:'returnFlag',text:'是否会归还',dictCode:''})
        fieldList.push({type:'date',value:'returnTime',text:'归还时间'})
        fieldList.push({type:'string',value:'returnComment',text:'归还说明',dictCode:''})
        fieldList.push({type:'string',value:'returnConfirmer',text:'归还确认人',dictCode:''})
        fieldList.push({type:'date',value:'returnConfirmTime',text:'归还确认时间'})
        fieldList.push({type:'string',value:'returnConfirmComment',text:'归还确认意见',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
src/views/tms/TmsToolScrapDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,187 @@
<template>
  <a-card :bordered="false" :class="'cust-erp-sub-tab'">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator" v-if="mainId">
      <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>
      <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"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
    <tmsToolScrapDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></tmsToolScrapDetail-modal>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolScrapDetailModal from './modules/TmsToolScrapDetailModal'
  export default {
    name: "TmsToolScrapDetailList",
    mixins:[JeecgListMixin],
    components: { TmsToolScrapDetailModal },
    props:{
      mainId:{
        type:String,
        default:'',
        required:false
      }
    },
    watch:{
      mainId:{
        immediate: true,
        handler(val) {
          if(!this.mainId){
            this.clearList()
          }else{
            this.queryParam['orderId'] = val
            this.loadData(1);
          }
        }
      }
    },
    data () {
      return {
        description: '工装报废管理页面',
        disableMixinCreated:true,
        // è¡¨å¤´
        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:'工装ID',
            align:"center",
            dataIndex: 'toolId'
          },
          {
            title:'库存ID',
            align:"center",
            dataIndex: 'inventoryId'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/tms/tmsToolScrap/listTmsToolScrapDetailByMainId",
          delete: "/tms/tmsToolScrap/deleteTmsToolScrapDetail",
          deleteBatch: "/tms/tmsToolScrap/deleteBatchTmsToolScrapDetail",
          exportXlsUrl: "/tms/tmsToolScrap/exportTmsToolScrapDetail",
          importUrl: "/tms/tmsToolScrap/importTmsToolScrapDetail",
        },
        dictOptions:{
        }
      }
    },
    created() {
    },
    computed: {
      importExcelUrl(){
        return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
      }
    },
    methods: {
      clearList(){
        this.dataSource=[]
        this.selectedRowKeys=[]
        this.ipagination.current = 1
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
src/views/tms/TmsToolScrapList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,286 @@
<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="报废单状态">
              <a-input placeholder="请输入报废单状态" v-model="queryParam.orderStatus"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="申请人">
              <a-input placeholder="请输入申请人" v-model="queryParam.applicant"></a-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="申请时间">
                <j-date placeholder="请选择申请时间" v-model="queryParam.applicationTime"></j-date>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="确认人">
                <a-input placeholder="请输入确认人" v-model="queryParam.confirmer"></a-input>
              </a-form-item>
            </a-col>
          </template>
          <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 @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </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>-->
<!--      &lt;!&ndash; é«˜çº§æŸ¥è¯¢åŒºåŸŸ &ndash;&gt;-->
<!--      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
    </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"
        bordered
        rowKey="id"
        class="j-table-force-nowrap"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
        :customRow="clickThenSelect"
        @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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </a-table>
    </div>
<!--    <a-tabs defaultActiveKey="1">-->
<!--      <a-tab-pane tab="工装报废明细" key="1" >-->
<!--        <TmsToolScrapDetailList :mainId="tmsToolScrapDetailMainId" />-->
<!--      </a-tab-pane>-->
<!--    </a-tabs>-->
    <tmsToolScrap-modal ref="modalForm" @ok="modalFormOk"></tmsToolScrap-modal>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolScrapModal from './modules/TmsToolScrapModal'
  import { getAction } from '@/api/manage'
  import TmsToolScrapDetailList from './TmsToolScrapDetailList'
  import '@/assets/less/TableExpand.less'
  export default {
    name: "TmsToolScrapList",
    mixins:[JeecgListMixin],
    components: {
      TmsToolScrapDetailList,
      TmsToolScrapModal
    },
    data () {
      return {
        description: '工装报废管理页面',
        // è¡¨å¤´
        columns: [
          // {
          //   title:'报废单状态',
          //   align:"center",
          //   dataIndex: 'orderStatus'
          // },
          {
            title:'申请人',
            align:"center",
            dataIndex: 'applicant'
          },
          {
            title:'申请时间',
            align:"center",
            dataIndex: 'applicationTime'
          },
          {
            title:'申请说明',
            align:"center",
            dataIndex: 'applicationComment'
          },
          {
            title:'确认人',
            align:"center",
            dataIndex: 'confirmer'
          },
          {
            title:'确认时间',
            align:"center",
            dataIndex: 'confirmTime'
          },
          {
            title:'确认意见',
            align:"center",
            dataIndex: 'confirmComment'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/tms/tmsToolScrap/list",
          delete: "/tms/tmsToolScrap/delete",
          deleteBatch: "/tms/tmsToolScrap/deleteBatch",
          exportXlsUrl: "/tms/tmsToolScrap/exportXls",
          importExcelUrl: "tms/tmsToolScrap/importExcel",
        },
        dictOptions:{
        },
        /* åˆ†é¡µå‚æ•° */
        ipagination:{
          current: 1,
          pageSize: 5,
          pageSizeOptions: ['5', '10', '50'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " å…±" + total + "条"
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        selectedMainId:'',
        superFieldList:[],
        tmsToolScrapDetailMainId: '',
      }
    },
    created() {
      this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      initDictConfig(){
      },
      clickThenSelect(record) {
        return {
          on: {
            click: () => {
              this.onSelectChange(record.id.split(","), [record]);
            }
          }
        }
      },
      onClearSelected() {
        this.selectedRowKeys = [];
        this.selectionRows = [];
        this.selectedMainId=''
      },
      onSelectChange(selectedRowKeys, selectionRows) {
        this.selectedMainId=selectedRowKeys[0]
        this.selectedRowKeys = selectedRowKeys;
        this.selectionRows = selectionRows;
        this.tmsToolScrapDetailMainId = selectionRows[0]['id']
      },
      loadData(arg) {
        if(!this.url.list){
          this.$message.error("请设置url.list属性!")
          return
        }
        //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
        if (arg === 1) {
          this.ipagination.current = 1;
        }
        this.onClearSelected()
        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;
        })
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'orderStatus',text:'报废单状态',dictCode:''})
        fieldList.push({type:'string',value:'applicant',text:'申请人',dictCode:''})
        fieldList.push({type:'date',value:'applicationTime',text:'申请时间'})
        fieldList.push({type:'string',value:'applicationComment',text:'申请说明',dictCode:''})
        fieldList.push({type:'string',value:'confirmer',text:'确认人',dictCode:''})
        fieldList.push({type:'date',value:'confirmTime',text:'确认时间'})
        fieldList.push({type:'string',value:'confirmComment',text:'确认意见',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
src/views/tms/TmsToolStocktakingDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,197 @@
<template>
  <a-card :bordered="false" :class="'cust-erp-sub-tab'">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator" v-if="mainId">
      <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>
      <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"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
    <tmsToolStocktakingDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></tmsToolStocktakingDetail-modal>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolStocktakingDetailModal from './modules/TmsToolStocktakingDetailModal'
  export default {
    name: "TmsToolStocktakingDetailList",
    mixins:[JeecgListMixin],
    components: { TmsToolStocktakingDetailModal },
    props:{
      mainId:{
        type:String,
        default:'',
        required:false
      }
    },
    watch:{
      mainId:{
        immediate: true,
        handler(val) {
          if(!this.mainId){
            this.clearList()
          }else{
            this.queryParam['orderId'] = val
            this.loadData(1);
          }
        }
      }
    },
    data () {
      return {
        description: '工装盘点管理页面',
        disableMixinCreated:true,
        // è¡¨å¤´
        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:'工装ID',
            align:"center",
            dataIndex: 'toolId'
          },
          {
            title:'盘点前数量',
            align:"center",
            dataIndex: 'beforeNumber'
          },
          {
            title:'实际盘点数量',
            align:"center",
            dataIndex: 'actualNumber'
          },
          {
            title:'盘点结果',
            align:"center",
            dataIndex: 'stocktakingResult'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/tms/tmsToolStocktaking/listTmsToolStocktakingDetailByMainId",
          delete: "/tms/tmsToolStocktaking/deleteTmsToolStocktakingDetail",
          deleteBatch: "/tms/tmsToolStocktaking/deleteBatchTmsToolStocktakingDetail",
          exportXlsUrl: "/tms/tmsToolStocktaking/exportTmsToolStocktakingDetail",
          importUrl: "/tms/tmsToolStocktaking/importTmsToolStocktakingDetail",
        },
        dictOptions:{
        }
      }
    },
    created() {
    },
    computed: {
      importExcelUrl(){
        return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
      }
    },
    methods: {
      clearList(){
        this.dataSource=[]
        this.selectedRowKeys=[]
        this.ipagination.current = 1
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
src/views/tms/TmsToolStocktakingInventoryChangeList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,195 @@
<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>
    <!-- æŸ¥è¯¢åŒºåŸŸ-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>
    <tms-tool-stocktaking-inventory-change-modal ref="modalForm" @ok="modalFormOk"></tms-tool-stocktaking-inventory-change-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolStocktakingInventoryChangeModal from './modules/TmsToolStocktakingInventoryChangeModal'
  export default {
    name: 'TmsToolStocktakingInventoryChangeList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      TmsToolStocktakingInventoryChangeModal
    },
    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: 'detailId'
          },
          {
            title:'库存ID',
            align:"center",
            dataIndex: 'inventoryId'
          },
          {
            title:'工装条码',
            align:"center",
            dataIndex: 'toolBarcode'
          },
          {
            title:'数量(默认1)',
            align:"center",
            dataIndex: 'number'
          },
          {
            title:'变更类型;正常/出库/入库',
            align:"center",
            dataIndex: 'changeType'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/tms/tmsToolStocktakingInventoryChange/list",
          delete: "/tms/tmsToolStocktakingInventoryChange/delete",
          deleteBatch: "/tms/tmsToolStocktakingInventoryChange/deleteBatch",
          exportXlsUrl: "/tms/tmsToolStocktakingInventoryChange/exportXls",
          importExcelUrl: "tms/tmsToolStocktakingInventoryChange/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:'detailId',text:'盘点明细ID',dictCode:''})
        fieldList.push({type:'string',value:'inventoryId',text:'库存ID',dictCode:''})
        fieldList.push({type:'string',value:'toolBarcode',text:'工装条码',dictCode:''})
        fieldList.push({type:'BigDecimal',value:'number',text:'数量(默认1)',dictCode:''})
        fieldList.push({type:'string',value:'changeType',text:'变更类型;正常/出库/入库',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/tms/TmsToolStocktakingList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,262 @@
<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="盘点单号">
              <a-input placeholder="请输入盘点单号" v-model="queryParam.orderCode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="盘点状态">
              <a-input placeholder="请输入盘点状态" v-model="queryParam.orderStatus"></a-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>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </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>-->
<!--      &lt;!&ndash; é«˜çº§æŸ¥è¯¢åŒºåŸŸ &ndash;&gt;-->
<!--      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
    </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"
        bordered
        rowKey="id"
        class="j-table-force-nowrap"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
        :customRow="clickThenSelect"
        @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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </a-table>
    </div>
<!--    <a-tabs defaultActiveKey="1">-->
<!--      <a-tab-pane tab="工装盘点明细" key="1" >-->
<!--        <TmsToolStocktakingDetailList :mainId="tmsToolStocktakingDetailMainId" />-->
<!--      </a-tab-pane>-->
<!--    </a-tabs>-->
    <tmsToolStocktaking-modal ref="modalForm" @ok="modalFormOk"></tmsToolStocktaking-modal>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolStocktakingModal from './modules/TmsToolStocktakingModal'
  import { getAction } from '@/api/manage'
  import TmsToolStocktakingDetailList from './TmsToolStocktakingDetailList'
  import '@/assets/less/TableExpand.less'
  export default {
    name: "TmsToolStocktakingList",
    mixins:[JeecgListMixin],
    components: {
      TmsToolStocktakingDetailList,
      TmsToolStocktakingModal
    },
    data () {
      return {
        description: '工装盘点管理页面',
        // è¡¨å¤´
        columns: [
          {
            title:'盘点单号',
            align:"center",
            dataIndex: 'orderCode'
          },
          // {
          //   title:'盘点状态',
          //   align:"center",
          //   dataIndex: 'orderStatus'
          // },
          {
            title:'盘点人',
            align:"center",
            dataIndex: 'operator'
          },
          {
            title:'盘点时间',
            align:"center",
            dataIndex: 'operateTime'
          },
          {
            title:'备注',
            align:"center",
            dataIndex: 'remark'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/tms/tmsToolStocktaking/list",
          delete: "/tms/tmsToolStocktaking/delete",
          deleteBatch: "/tms/tmsToolStocktaking/deleteBatch",
          exportXlsUrl: "/tms/tmsToolStocktaking/exportXls",
          importExcelUrl: "tms/tmsToolStocktaking/importExcel",
        },
        dictOptions:{
        },
        /* åˆ†é¡µå‚æ•° */
        ipagination:{
          current: 1,
          pageSize: 5,
          pageSizeOptions: ['5', '10', '50'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " å…±" + total + "条"
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        selectedMainId:'',
        superFieldList:[],
        tmsToolStocktakingDetailMainId: '',
      }
    },
    created() {
      this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      initDictConfig(){
      },
      clickThenSelect(record) {
        return {
          on: {
            click: () => {
              this.onSelectChange(record.id.split(","), [record]);
            }
          }
        }
      },
      onClearSelected() {
        this.selectedRowKeys = [];
        this.selectionRows = [];
        this.selectedMainId=''
      },
      onSelectChange(selectedRowKeys, selectionRows) {
        this.selectedMainId=selectedRowKeys[0]
        this.selectedRowKeys = selectedRowKeys;
        this.selectionRows = selectionRows;
        this.tmsToolStocktakingDetailMainId = selectionRows[0]['id']
      },
      loadData(arg) {
        if(!this.url.list){
          this.$message.error("请设置url.list属性!")
          return
        }
        //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
        if (arg === 1) {
          this.ipagination.current = 1;
        }
        this.onClearSelected()
        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;
        })
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'orderCode',text:'盘点单号',dictCode:''})
        fieldList.push({type:'string',value:'orderStatus',text:'盘点状态',dictCode:''})
        fieldList.push({type:'string',value:'operator',text:'盘点人',dictCode:''})
        fieldList.push({type:'date',value:'operateTime',text:'盘点时间'})
        fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
src/views/tms/TmsToolsList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,252 @@
<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.toolName"></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.toolCode"></j-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="工装分类">
                <a-input placeholder="请输入工装分类" v-model="queryParam.toolCategory"></a-input>
              </a-form-item>
            </a-col>
          </template>
          <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 @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </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>
    <tms-tools-modal ref="modalForm" @ok="modalFormOk"></tms-tools-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TmsToolsModal from './modules/TmsToolsModal'
  export default {
    name: 'TmsToolsList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      TmsToolsModal
    },
    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: 'toolName'
          },
          {
            title:'工装编码',
            align:"center",
            dataIndex: 'toolCode'
          },
          {
            title:'工装分类',
            align:"center",
            dataIndex: 'toolCategory'
          },
          {
            title:'型号',
            align:"center",
            dataIndex: 'toolModel'
          },
          {
            title:'规格',
            align:"center",
            dataIndex: 'toolSpecification'
          },
          {
            title:'单位',
            align:"center",
            dataIndex: 'toolUnit'
          },
          {
            title:'存放位置',
            align:"center",
            dataIndex: 'storeLocation'
          },
          {
            title:'供应商',
            align:"center",
            dataIndex: 'supplierId'
          },
          {
            title:'库存预警值',
            align:"center",
            dataIndex: 'inventoryWarning'
          },
          {
            title:'备注',
            align:"center",
            dataIndex: 'remark'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/tms/tmsTools/list",
          delete: "/tms/tmsTools/delete",
          deleteBatch: "/tms/tmsTools/deleteBatch",
          exportXlsUrl: "/tms/tmsTools/exportXls",
          importExcelUrl: "tms/tmsTools/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:'toolName',text:'工装名称',dictCode:''})
        fieldList.push({type:'string',value:'toolCode',text:'工装编码',dictCode:''})
        fieldList.push({type:'string',value:'toolCategory',text:'工装分类',dictCode:''})
        fieldList.push({type:'string',value:'toolModel',text:'型号',dictCode:''})
        fieldList.push({type:'string',value:'toolSpecification',text:'规格',dictCode:''})
        fieldList.push({type:'string',value:'toolUnit',text:'单位',dictCode:''})
        fieldList.push({type:'string',value:'storeLocation',text:'存放位置',dictCode:''})
        fieldList.push({type:'string',value:'supplierId',text:'供应商',dictCode:''})
        fieldList.push({type:'int',value:'inventoryWarning',text:'库存预警值',dictCode:''})
        fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/tms/modules/JSelectInboundToolModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,283 @@
<template>
  <!--支持全屏缩放-->
  <j-modal
    :visible="visible"
    :width="1200"
    :title="title"
    switchFullscreen
    @ok="handleSubmit"
    @cancel="close"
    style="top: 50px"
    cancelText="关闭"
  >
    <a-card :bordered="false">
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="工装名称">
                <j-input placeholder="请输入工装名称,支持模糊查询" v-model="queryParam.toolName"></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.toolCode"></j-input>
              </a-form-item>
            </a-col>
            <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
            <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
          </a-row>
        </a-form>
      </div>
      <!--出库单列表-->
      <a-table
        ref="table"
        size="middle"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :rowSelection="rowSelection"
        :loading="loading"
        @change="handleTableChange"
        :rowClassName="getRowClassName"
      >
      </a-table>
    </a-card>
  </j-modal>
</template>
<script>
import { filterObj } from '@/utils/util'
import { getAction } from '@api/manage'
export default {
  name: 'JSelectSharpenOutboundToolModal',
  components: {},
  props: {},
  data() {
    return {
      title: '选择入库工装',
      queryParam: {},
      columns: [
        {
          title: '#',
          dataIndex: '',
          key:'rowIndex',
          width:60,
          align:"center",
          customRender:function (t,r,index) {
            return parseInt(index)+1;
          }
        },
        {
          title:'工装名称',
          align:"center",
          dataIndex: 'toolName'
        },
        {
          title:'工装编码',
          align:"center",
          dataIndex: 'toolCode'
        },
        {
          title:'工装分类',
          align:"center",
          dataIndex: 'toolCategory'
        },
        {
          title:'型号',
          align:"center",
          dataIndex: 'toolModel'
        },
        {
          title:'规格',
          align:"center",
          dataIndex: 'toolSpecification'
        },
        {
          title:'单位',
          align:"center",
          dataIndex: 'toolUnit'
        },
        {
          title:'存放位置',
          align:"center",
          dataIndex: 'storeLocation'
        },
        {
          title:'供应商',
          align:"center",
          dataIndex: 'supplierId'
        },
        {
          title:'备注',
          align:"center",
          dataIndex: 'remark'
        }
      ],
      selectedRowKeys: [],
      oldSelectRow: [],
      scrollTrigger: { x: 1500, y: 500 },
      dataSource: [],
      selectionRows: [],
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['5', '10', '20'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      isorter: {
        column: 'toolCode',
        order: 'asc',
      },
      departTree: [],
      visible: false,
      loading: false,
      prepareKnifeDetailList:[],
      url: {
        list: "/tms/tmsTools/list"
      },
    }
  },
  computed: {
    rowSelection() {
      return {
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.onSelectChange(selectedRows)
        },
        getCheckboxProps: (record) => ({
          props: {
            disabled: record.alreadySelected,
          },
        }),
      }
    },
  },
  watch: {
  },
  created() {
  },
  methods: {
    getRowClassName(record, index) {
      return record.alreadySelected ? 'disabled-row' : '';
    },
    async loadData(arg) {
      if (arg === 1) {
        this.ipagination.current = 1
      }
      this.loading = true
      let params = this.getQueryParams() //查询条件
      console.log(params)
      await getAction(this.url.list, params).then((res) => {
        if (res.success) {
          // å¤„理数据,标记已选择的记录
          this.dataSource = res.result.records.map(item => {
            // æ£€æŸ¥å½“前记录是否在已选择列表中
            if (this.oldSelectRow && this.oldSelectRow.includes(item.id)) {
              return { ...item, alreadySelected: true }
            }
            return { ...item, alreadySelected: false }; // æ˜Žç¡®è®¾ç½®ä¸º false
          })
          this.ipagination.total = res.result.total
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
    showOrderModal(oldSelectRow) {
      this.oldSelectRow = oldSelectRow ? oldSelectRow.split(',') : []
      this.visible = true
      this.loadData(1)
    },
    getQueryParams() {
      let param = Object.assign({}, this.queryParam, this.isorter)
      param.field = this.getQueryField()
      param.pageNo = this.ipagination.current
      param.pageSize = this.ipagination.pageSize
      return filterObj(param)
    },
    //查询条件处理
    getQueryField() {
      let fields = ['id'];
      for (let a = 0; a < this.columns.length; a++) {
        fields.push(this.columns[a].dataIndex);
      }
      return fields.join(',');
    },
    searchReset() {
      this.queryParam = {}
      this.loadData(1)
    },
    close() {
      this.queryParam = {}
      this.selectedRowKeys = []
      this.selectionRows = []
      this.visible = false
    },
    handleTableChange(pagination, filters, sorter) {
      if (Object.keys(sorter).length > 0) {
        this.isorter.column = sorter.field
        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
      }
      this.ipagination = pagination
      this.loadData()
    },
    handleSubmit() {
      if (this.selectionRows.length > 0) {
        this.$bus.$emit('selectionRows', this.selectionRows)
        // this.searchReset(0)
        this.close()
      } else {
        this.$message.warning('请至少选择一条数据')
      }
    },
    onSelectChange(selectionRows) {
      this.selectionRows = selectionRows
    },
    searchQuery() {
      this.loadData(1)
    },
  },
}
</script>
<style scoped>
.ant-table-tbody .ant-table-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}
#components-layout-demo-custom-trigger .trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}
/* ç¦ç”¨è¡Œçš„æ ·å¼ */
.disabled-row {
  color: #999 !important; /* ç°è‰²æ–‡å­— */
  background-color: #f5f5f5 !important; /* ç°è‰²èƒŒæ™¯ */
}
/* ç¡®ä¿ç¦ç”¨è¡Œçš„复选框也显示为禁用状态 */
.disabled-row .ant-checkbox-wrapper {
  color: #999;
}
/* ç¦ç”¨è¡Œä¸­çš„æ‰€æœ‰å…ƒç´  */
.disabled-row * {
  color: #999 !important;
  cursor: not-allowed !important;
}
</style>
src/views/tms/modules/TmsToolHistoryForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,134 @@
<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="inventoryId">
              <a-input v-model="model.inventoryId" placeholder="请输入库存ID"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="工装条码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolBarcode">
              <a-input v-model="model.toolBarcode" placeholder="请输入工装条码"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="操作人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator">
              <a-input v-model="model.operator" placeholder="请输入操作人"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="操作时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operateTime">
              <j-date placeholder="请选择操作时间" v-model="model.operateTime"  style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="操作类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operateType">
              <a-input v-model="model.operateType" placeholder="请输入操作类型"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="业务主表" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="businessTable">
              <a-input v-model="model.businessTable" placeholder="请输入业务主表"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="业务名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="businessId">
              <a-input v-model="model.businessId" placeholder="请输入业务id"  ></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'
  export default {
    name: 'TmsToolHistoryForm',
    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: {
        },
        url: {
          add: "/tms/tmsToolHistory/add",
          edit: "/tms/tmsToolHistory/edit",
          queryById: "/tms/tmsToolHistory/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/tms/modules/TmsToolHistoryModal.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="关闭">
    <tms-tool-history-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tms-tool-history-form>
  </j-modal>
</template>
<script>
  import TmsToolHistoryForm from './TmsToolHistoryForm'
  export default {
    name: 'TmsToolHistoryModal',
    components: {
      TmsToolHistoryForm
    },
    data () {
      return {
        title:'',
        width:800,
        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/tms/modules/TmsToolInboundDetailModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,133 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-row>
          <a-col :span="24">
            <a-form-model-item label="入库单" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId">
              <a-input v-model="model.orderId"placeholder="请输入入库单" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="工装ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId">
              <a-input v-model="model.toolId"placeholder="请输入工装ID" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="入库数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveNumber">
              <a-input-number v-model="model.receiveNumber"placeholder="请输入入库数量" style="width: 100%" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
  import { httpAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: "TmsToolInboundDetailModal",
    components: {
    },
    props:{
      mainId:{
        type:String,
        required:false,
        default:''
      }
    },
    data () {
      return {
        title:"操作",
        width:800,
        visible: false,
        model:{
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/tms/tmsToolInbound/addTmsToolInboundDetail",
          edit: "/tms/tmsToolInbound/editTmsToolInboundDetail",
        }
      }
    },
    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;
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.form.clearValidate();
      },
      handleOk () {
        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';
            }
            this.model['orderId'] = this.mainId
            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;
              that.close();
            })
          }else{
             return false
          }
        })
      },
      handleCancel () {
        this.close()
      },
    }
  }
</script>
src/views/tms/modules/TmsToolInboundForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,206 @@
<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="24" >
            <a-form-model-item label="入库单状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus">
              <j-dict-select-tag type="list" v-model="model.orderStatus" dictCode="" placeholder="请选择入库单状态" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="入库人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver">
              <a-input v-model="model.receiver" placeholder="请输入入库人" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="入库时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveTime">
              <j-date placeholder="请选择入库时间" v-model="model.receiveTime" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="入库说明" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveComment">
              <a-textarea v-model="model.receiveComment" rows="4" placeholder="请输入入库说明" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer">
              <a-input v-model="model.confirmer" placeholder="请输入确认人" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="确认时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime">
              <j-date placeholder="请选择确认时间" v-model="model.confirmTime" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="确认意见" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment">
              <a-input v-model="model.confirmComment" placeholder="请输入确认意见" ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
      <!-- å­è¡¨å•区域 -->
    <a-tabs v-model="activeKey" @change="handleChangeTabs">
      <a-tab-pane tab="工装入库明细" :key="refKeys[0]" :forceRender="true">
        <j-vxe-table
          keep-source
          :ref="refKeys[0]"
          :loading="tmsToolInboundDetailTable.loading"
          :columns="tmsToolInboundDetailTable.columns"
          :dataSource="tmsToolInboundDetailTable.dataSource"
          :maxHeight="300"
          :disabled="formDisabled"
          :rowNumber="true"
          :rowSelection="true"
          :toolbar="true"
          />
      </a-tab-pane>
    </a-tabs>
  </a-spin>
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  import { JVXETypes } from '@/components/jeecg/JVxeTable'
  import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
  import { validateDuplicateValue } from '@/utils/util'
  import JFormContainer from '@/components/jeecg/JFormContainer'
  export default {
    name: 'TmsToolInboundForm',
    mixins: [JVxeTableModelMixin],
    components: {
      JFormContainer,
    },
    data() {
      return {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        model:{
         },
        // æ–°å¢žæ—¶å­è¡¨é»˜è®¤æ·»åŠ å‡ è¡Œç©ºæ•°æ®
        addDefaultRowNum: 1,
        validatorRules: {
        },
        refKeys: ['tmsToolInboundDetail', ],
        tableKeys:['tmsToolInboundDetail', ],
        activeKey: 'tmsToolInboundDetail',
        // å·¥è£…入库明细
        tmsToolInboundDetailTable: {
          loading: false,
          dataSource: [],
          columns: [
            {
              title: '入库单',
              key: 'orderId',
               type: JVXETypes.input,
              width:"200px",
              placeholder: '请输入${title}',
              defaultValue:'',
            },
            {
              title: '工装ID',
              key: 'toolId',
               type: JVXETypes.input,
              width:"200px",
              placeholder: '请输入${title}',
              defaultValue:'',
            },
            {
              title: '入库数量',
              key: 'receiveNumber',
               type: JVXETypes.input,
              width:"200px",
              placeholder: '请输入${title}',
              defaultValue:'',
            },
          ]
        },
        url: {
          add: "/tms/tmsToolInbound/add",
          edit: "/tms/tmsToolInbound/edit",
          queryById: "/tms/tmsToolInbound/queryById",
          tmsToolInboundDetail: {
            list: '/tms/tmsToolInbound/queryTmsToolInboundDetailByMainId'
          },
        }
      }
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
    },
    methods: {
      addBefore(){
        this.tmsToolInboundDetailTable.dataSource=[]
      },
      getAllTable() {
        let values = this.tableKeys.map(key => getRefPromise(this, key))
        return Promise.all(values)
      },
      /** è°ƒç”¨å®Œedit()方法之后会自动调用此方法 */
      editAfter() {
        this.$nextTick(() => {
        })
        // åŠ è½½å­è¡¨æ•°æ®
        if (this.model.id) {
          let params = { id: this.model.id }
          this.requestSubTableData(this.url.tmsToolInboundDetail.list, params, this.tmsToolInboundDetailTable)
        }
      },
      //校验所有一对一子表表单
        validateSubForm(allValues){
            return new Promise((resolve,reject)=>{
              Promise.all([
              ]).then(() => {
                resolve(allValues)
              }).catch(e => {
                if (e.error === VALIDATE_FAILED) {
                  // å¦‚果有未通过表单验证的子表,就自动跳转到它所在的tab
                  this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
                } else {
                  console.error(e)
                }
              })
            })
        },
      /** æ•´ç†æˆformData */
      classifyIntoFormData(allValues) {
        let main = Object.assign(this.model, allValues.formValue)
        return {
          ...main, // å±•å¼€
          tmsToolInboundDetailList: allValues.tablesValue[0].tableData,
        }
      },
      validateError(msg){
        this.$message.error(msg)
      },
    }
  }
</script>
<style scoped>
</style>
src/views/tms/modules/TmsToolInboundInventoryForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,109 @@
<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="24">
            <a-form-model-item label="入库单ID" :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="24">
            <a-form-model-item label="库存ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId">
              <a-input v-model="model.inventoryId" placeholder="请输入库存ID"  ></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'
  export default {
    name: 'TmsToolInboundInventoryForm',
    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: {
        },
        url: {
          add: "/tms/tmsToolInboundInventory/add",
          edit: "/tms/tmsToolInboundInventory/edit",
          queryById: "/tms/tmsToolInboundInventory/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/tms/modules/TmsToolInboundInventoryModal.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="关闭">
    <tms-tool-inbound-inventory-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tms-tool-inbound-inventory-form>
  </j-modal>
</template>
<script>
  import TmsToolInboundInventoryForm from './TmsToolInboundInventoryForm'
  export default {
    name: 'TmsToolInboundInventoryModal',
    components: {
      TmsToolInboundInventoryForm
    },
    data () {
      return {
        title:'',
        width:800,
        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/tms/modules/TmsToolInboundModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,326 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-row>
<!--          <a-col :span="12">-->
<!--            <a-form-model-item label="入库单状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus">-->
<!--&lt;!&ndash;              <j-dict-select-tag type="list" v-model="model.orderStatus" dictCode="" placeholder="请选择入库单状态" />&ndash;&gt;-->
<!--              <a-input type="list" v-model="model.orderStatus" placeholder="请选择入库单状态" />-->
<!--            </a-form-model-item>-->
<!--          </a-col>-->
          <a-col :span="12">
            <a-form-model-item label="入库人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver">
              <a-input :disabled="disableSubmit" v-model="model.receiver" placeholder="请输入入库人" ></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 :disabled="disableSubmit" :show-time="true" dateFormat="YYYY-MM-DD HH:mm" placeholder="请选择入库时间" v-model="model.receiveTime" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="入库说明" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveComment">
              <a-textarea :disabled="disableSubmit" v-model="model.receiveComment" rows="4" placeholder="请输入入库说明" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer">
              <a-input :disabled="disableSubmit" v-model="model.confirmer" placeholder="请输入确认人" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="确认时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime">
              <j-date :disabled="disableSubmit" :show-time="true" dateFormat="YYYY-MM-DD HH:mm" placeholder="请选择确认时间" v-model="model.confirmTime" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="确认意见" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment">
              <a-textarea :disabled="disableSubmit" v-model="model.confirmComment" placeholder="请输入确认意见" ></a-textarea>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
    <a-button v-show="selectInboundToolFlag" type="primary" :style="{ marginBottom: '8px' }" @click="selectInboundTool">选择入库工装</a-button>
    <a-table
      ref="table"
      size="middle"
      bordered
      rowKey="id"
      :scroll="{x:true}"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      :rowSelection="null"
      @change="handleTableChange">
      <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index">
        <div :key="col.dataIndex">
          <a-input-number
            v-if="col.dataIndex === 'receiveNumber'"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="1"
          />
        </div>
      </template>
      <span slot="action" v-if="disableSubmit === false" slot-scope="text, record, index">
        <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record, index)">
          <a>删除</a>
        </a-popconfirm>
      </span>
    </a-table>
    <template slot="footer" v-if="disableSubmit === false">
      <a-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
      <a-button @click="handleOk" :disabled="isDisabled" type="primary">确定</a-button>
    </template>
    <j-select-inbound-tool-modal ref="selectInboundToolModal"></j-select-inbound-tool-modal>
  </j-modal>
</template>
<script>
  import { httpAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  import JSelectInboundToolModal from './JSelectInboundToolModal.vue'
  import { getAction } from '../../../api/manage'
  export default {
    name: "TmsToolInboundModal",
    components: {
      JSelectInboundToolModal
    },
    data () {
      return {
        title:"",
        width:1200,
        visible: false,
        model:{
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          list: "/tms/tmsToolInbound/listTmsToolInboundDetailByMainId",
          add: "/tms/tmsToolInbound/add",
          edit: "/tms/tmsToolInbound/edit",
        },
        disableSubmit: false,
        isDisabled: false,
        selectInboundToolFlag: true,
        loading: false,
        //表格参数
        ipagination: {
          current: 1,
          pageSize: 10,
          total: 0,
        },
        dataSource: [],
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'工装名称',
            align:"center",
            dataIndex: 'toolName'
          },
          {
            title:'工装编码',
            align:"center",
            dataIndex: 'toolCode'
          },
          {
            title:'工装分类',
            align:"center",
            dataIndex: 'toolCategory'
          },
          {
            title:'型号',
            align:"center",
            dataIndex: 'toolModel'
          },
          {
            title:'规格',
            align:"center",
            dataIndex: 'toolSpecification'
          },
          {
            title:'单位',
            align:"center",
            dataIndex: 'toolUnit'
          },
          {
            title:'存放位置',
            align:"center",
            dataIndex: 'storeLocation'
          },
          {
            title:'供应商',
            align:"center",
            dataIndex: 'supplierId'
          },
          {
            title:'入库数量',
            align:"center",
            dataIndex: 'receiveNumber',
            scopedSlots: { customRender: 'receiveNumber' },
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            scopedSlots: { customRender: 'action' },
          }
        ],
      }
    },
    created () {
    //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
    },
    mounted() {
      this.$bus.$on('selectionRows', (data) => {
        for (let i = 0; i < data.length; i++) {
          this.dataSource.push({
            id: data[i].id,
            toolId: data[i].id,
            toolName:data[i].toolName,
            toolCode:data[i].toolCode,
            toolCategory: data[i].toolCategory,
            toolModel: data[i].toolModel,
            toolSpecification: data[i].toolSpecification,
            toolUnit: data[i].toolUnit,
            storeLocation: data[i].storeLocation,
            supplierId: data[i].supplierId
          })
        }
        this.ipagination.total = this.dataSource.length
      })
    },
    methods: {
      handleDelete(record, index) {
        this.dataSource.splice(index, 1)
      },
      handleChange(value, key, column, index) {
        console.log(value, key, column, index)
        const temp = [...this.dataSource]
        const target = temp.filter(item => key === item.key)[index];
        if (target) {
          target[column.dataIndex] = value
          this.dataSource = temp
          if(column.dataIndex === 'receiveNumber'){
            if(target['receiveNumber']<1){
              this.$message.error('入库数量不能小于1!')
              this.isDisabled = true
            }else{
              this.isDisabled = false
            }
          }
          this.dataSource = temp
        }
      },
      selectInboundTool() {
        console.log(this.dataSource)
        let ids = this.dataSource.map(item => item.toolId).join(',')
        this.$refs.selectInboundToolModal.showOrderModal(ids)
      },
      add () {
        this.edit(this.modelDefault);
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
        if (record.id) {
          getAction(this.url.list, { orderId: record.id }).then(res => {
            if (res.success) {
              this.dataSource = res.result.records
              this.ipagination.total = res.result.length
            }
            this.selectInboundToolFlag = this.title !== '详情';
          })
        }
      },
      handleTableChange(pagination, filters, sorter) {
        this.ipagination = pagination
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.selectInboundToolFlag = true
        this.dataSource = []
        this.$refs.form.clearValidate();
      },
      handleOk () {
        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';
            }
            this.model.tmsToolInboundDetailList = this.dataSource.map(
              item => {
                return {
                  toolId: item.toolId,
                  receiveNumber: item.receiveNumber
                }
              }
            )
            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;
              that.close();
            })
          }else{
             return false
          }
        })
      },
      handleCancel () {
        this.close()
      },
    }
  }
</script>
src/views/tms/modules/TmsToolInventoryForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,119 @@
<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="24">
            <a-form-model-item label="工装名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId">
              <a-input v-model="model.toolId" placeholder="请输入工装名称"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="工装条码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolBarcode">
              <a-input v-model="model.toolBarcode" placeholder="请输入工装条码"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="库存状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryStatus">
              <a-input v-model="model.inventoryStatus" placeholder="请输入库存状态"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="当前寿命(百分比)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="currentLife">
              <a-input-number v-model="model.currentLife" 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: 'TmsToolInventoryForm',
    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: {
        },
        url: {
          add: "/tms/tmsToolInventory/add",
          edit: "/tms/tmsToolInventory/edit",
          queryById: "/tms/tmsToolInventory/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/tms/modules/TmsToolInventoryModal.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="关闭">
    <tms-tool-inventory-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tms-tool-inventory-form>
  </j-modal>
</template>
<script>
  import TmsToolInventoryForm from './TmsToolInventoryForm'
  export default {
    name: 'TmsToolInventoryModal',
    components: {
      TmsToolInventoryForm
    },
    data () {
      return {
        title:'',
        width:800,
        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/tms/modules/TmsToolReceiveDetailModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,138 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-row>
          <a-col :span="24">
            <a-form-model-item label="领用单ID" :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="24">
            <a-form-model-item label="工装ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId">
              <a-input v-model="model.toolId"placeholder="请输入工装ID" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="库存ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId">
              <a-input v-model="model.inventoryId"placeholder="请输入库存ID" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="使用寿命(百分比)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="usedLife">
              <a-input-number v-model="model.usedLife"placeholder="请输入使用寿命(百分比)" style="width: 100%" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
  import { httpAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: "TmsToolReceiveDetailModal",
    components: {
    },
    props:{
      mainId:{
        type:String,
        required:false,
        default:''
      }
    },
    data () {
      return {
        title:"操作",
        width:800,
        visible: false,
        model:{
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/tms/tmsToolReceive/addTmsToolReceiveDetail",
          edit: "/tms/tmsToolReceive/editTmsToolReceiveDetail",
        }
      }
    },
    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;
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.form.clearValidate();
      },
      handleOk () {
        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';
            }
            this.model['orderId'] = this.mainId
            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;
              that.close();
            })
          }else{
             return false
          }
        })
      },
      handleCancel () {
        this.close()
      },
    }
  }
</script>
src/views/tms/modules/TmsToolReceiveModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,179 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="领用单状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus">
              <a-input v-model="model.orderStatus" placeholder="请输入领用单状态" ></a-input>
            </a-form-model-item>
          </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>
            </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" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="领用说明" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveComment">
              <a-textarea v-model="model.receiveComment" rows="4" placeholder="请输入领用说明" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer">
              <a-input v-model="model.confirmer" placeholder="请输入确认人" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="确认时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime">
              <j-date placeholder="请选择确认时间" v-model="model.confirmTime" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="确认意见" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment">
              <a-textarea v-model="model.confirmComment" rows="4" placeholder="请输入确认意见" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="是否会归还" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnFlag">
<!--              <a-input v-model="model.returnFlag" placeholder="请输入是否会归还" ></a-input>-->
              <a-radio-group v-model="model.returnFlag">
                <a-radio value="1">是</a-radio>
                <a-radio value="0">否</a-radio>
              </a-radio-group>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="归还时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnTime">
              <j-date placeholder="请选择归还时间" v-model="model.returnTime" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="归还说明" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnComment">
              <a-textarea v-model="model.returnComment" rows="4" placeholder="请输入归还说明" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="归还确认人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmer">
              <a-input v-model="model.returnConfirmer" placeholder="请输入归还确认人" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="归还确认时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmTime">
              <j-date placeholder="请选择归还确认时间" v-model="model.returnConfirmTime" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="归还确认意见" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmComment">
              <a-textarea v-model="model.returnConfirmComment" rows="4" placeholder="请输入归还确认意见" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
  import { httpAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: "TmsToolReceiveModal",
    components: {
    },
    data () {
      return {
        title:"操作",
        width:1000,
        visible: false,
        model:{
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/tms/tmsToolReceive/add",
          edit: "/tms/tmsToolReceive/edit",
        }
      }
    },
    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;
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.form.clearValidate();
      },
      handleOk () {
        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;
              that.close();
            })
          }else{
             return false
          }
        })
      },
      handleCancel () {
        this.close()
      },
    }
  }
</script>
src/views/tms/modules/TmsToolScrapDetailModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,133 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-row>
          <a-col :span="24">
            <a-form-model-item label="报废单ID" :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="24">
            <a-form-model-item label="工装ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId">
              <a-input v-model="model.toolId"placeholder="请输入工装ID" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="库存ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId">
              <a-input v-model="model.inventoryId"placeholder="请输入库存ID" ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
  import { httpAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: "TmsToolScrapDetailModal",
    components: {
    },
    props:{
      mainId:{
        type:String,
        required:false,
        default:''
      }
    },
    data () {
      return {
        title:"操作",
        width:800,
        visible: false,
        model:{
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/tms/tmsToolScrap/addTmsToolScrapDetail",
          edit: "/tms/tmsToolScrap/editTmsToolScrapDetail",
        }
      }
    },
    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;
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.form.clearValidate();
      },
      handleOk () {
        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';
            }
            this.model['orderId'] = this.mainId
            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;
              that.close();
            })
          }else{
             return false
          }
        })
      },
      handleCancel () {
        this.close()
      },
    }
  }
</script>
src/views/tms/modules/TmsToolScrapForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,206 @@
<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="24" >
            <a-form-model-item label="报废单状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus">
              <a-input v-model="model.orderStatus" placeholder="请输入报废单状态" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="申请人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicant">
              <a-input v-model="model.applicant" placeholder="请输入申请人" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="申请时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationTime">
              <j-date placeholder="请选择申请时间" v-model="model.applicationTime" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="申请说明" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationComment">
              <a-textarea v-model="model.applicationComment" rows="4" placeholder="请输入申请说明" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer">
              <a-input v-model="model.confirmer" placeholder="请输入确认人" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="确认时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime">
              <j-date placeholder="请选择确认时间" v-model="model.confirmTime" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="确认意见" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment">
              <a-textarea v-model="model.confirmComment" rows="4" placeholder="请输入确认意见" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
      <!-- å­è¡¨å•区域 -->
    <a-tabs v-model="activeKey" @change="handleChangeTabs">
      <a-tab-pane tab="工装报废明细" :key="refKeys[0]" :forceRender="true">
        <j-vxe-table
          keep-source
          :ref="refKeys[0]"
          :loading="tmsToolScrapDetailTable.loading"
          :columns="tmsToolScrapDetailTable.columns"
          :dataSource="tmsToolScrapDetailTable.dataSource"
          :maxHeight="300"
          :disabled="formDisabled"
          :rowNumber="true"
          :rowSelection="true"
          :toolbar="true"
          />
      </a-tab-pane>
    </a-tabs>
  </a-spin>
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  import { JVXETypes } from '@/components/jeecg/JVxeTable'
  import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
  import { validateDuplicateValue } from '@/utils/util'
  import JFormContainer from '@/components/jeecg/JFormContainer'
  export default {
    name: 'TmsToolScrapForm',
    mixins: [JVxeTableModelMixin],
    components: {
      JFormContainer,
    },
    data() {
      return {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        model:{
         },
        // æ–°å¢žæ—¶å­è¡¨é»˜è®¤æ·»åŠ å‡ è¡Œç©ºæ•°æ®
        addDefaultRowNum: 1,
        validatorRules: {
        },
        refKeys: ['tmsToolScrapDetail', ],
        tableKeys:['tmsToolScrapDetail', ],
        activeKey: 'tmsToolScrapDetail',
        // å·¥è£…报废明细
        tmsToolScrapDetailTable: {
          loading: false,
          dataSource: [],
          columns: [
            {
              title: '报废单ID',
              key: 'orderId',
               type: JVXETypes.input,
              width:"200px",
              placeholder: '请输入${title}',
              defaultValue:'',
            },
            {
              title: '工装ID',
              key: 'toolId',
               type: JVXETypes.input,
              width:"200px",
              placeholder: '请输入${title}',
              defaultValue:'',
            },
            {
              title: '库存ID',
              key: 'inventoryId',
               type: JVXETypes.input,
              width:"200px",
              placeholder: '请输入${title}',
              defaultValue:'',
            },
          ]
        },
        url: {
          add: "/tms/tmsToolScrap/add",
          edit: "/tms/tmsToolScrap/edit",
          queryById: "/tms/tmsToolScrap/queryById",
          tmsToolScrapDetail: {
            list: '/tms/tmsToolScrap/queryTmsToolScrapDetailByMainId'
          },
        }
      }
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
    },
    methods: {
      addBefore(){
        this.tmsToolScrapDetailTable.dataSource=[]
      },
      getAllTable() {
        let values = this.tableKeys.map(key => getRefPromise(this, key))
        return Promise.all(values)
      },
      /** è°ƒç”¨å®Œedit()方法之后会自动调用此方法 */
      editAfter() {
        this.$nextTick(() => {
        })
        // åŠ è½½å­è¡¨æ•°æ®
        if (this.model.id) {
          let params = { id: this.model.id }
          this.requestSubTableData(this.url.tmsToolScrapDetail.list, params, this.tmsToolScrapDetailTable)
        }
      },
      //校验所有一对一子表表单
        validateSubForm(allValues){
            return new Promise((resolve,reject)=>{
              Promise.all([
              ]).then(() => {
                resolve(allValues)
              }).catch(e => {
                if (e.error === VALIDATE_FAILED) {
                  // å¦‚果有未通过表单验证的子表,就自动跳转到它所在的tab
                  this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
                } else {
                  console.error(e)
                }
              })
            })
        },
      /** æ•´ç†æˆformData */
      classifyIntoFormData(allValues) {
        let main = Object.assign(this.model, allValues.formValue)
        return {
          ...main, // å±•å¼€
          tmsToolScrapDetailList: allValues.tablesValue[0].tableData,
        }
      },
      validateError(msg){
        this.$message.error(msg)
      },
    }
  }
</script>
<style scoped>
</style>
src/views/tms/modules/TmsToolScrapModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,145 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="报废单状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus">
              <a-input v-model="model.orderStatus" placeholder="请输入报废单状态" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="申请人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicant">
              <a-input v-model="model.applicant" placeholder="请输入申请人" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="申请时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationTime">
              <j-date placeholder="请选择申请时间" v-model="model.applicationTime" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="申请说明" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationComment">
              <a-textarea v-model="model.applicationComment" rows="4" placeholder="请输入申请说明" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer">
              <a-input v-model="model.confirmer" placeholder="请输入确认人" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="确认时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime">
              <j-date placeholder="请选择确认时间" v-model="model.confirmTime" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="确认意见" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment">
              <a-textarea v-model="model.confirmComment" rows="4" placeholder="请输入确认意见" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
  import { httpAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: "TmsToolScrapModal",
    components: {
    },
    data () {
      return {
        title:"操作",
        width:1000,
        visible: false,
        model:{
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/tms/tmsToolScrap/add",
          edit: "/tms/tmsToolScrap/edit",
        }
      }
    },
    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;
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.form.clearValidate();
      },
      handleOk () {
        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;
              that.close();
            })
          }else{
             return false
          }
        })
      },
      handleCancel () {
        this.close()
      },
    }
  }
</script>
src/views/tms/modules/TmsToolStocktakingDetailModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,143 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-row>
          <a-col :span="24">
            <a-form-model-item label="盘点单ID" :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="24">
            <a-form-model-item label="工装ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId">
              <a-input v-model="model.toolId"placeholder="请输入工装ID" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="盘点前数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="beforeNumber">
              <a-input-number v-model="model.beforeNumber"placeholder="请输入盘点前数量" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="实际盘点数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualNumber">
              <a-input-number v-model="model.actualNumber"placeholder="请输入实际盘点数量" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="盘点结果" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stocktakingResult">
              <a-input v-model="model.stocktakingResult"placeholder="请输入盘点结果" ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
  import { httpAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: "TmsToolStocktakingDetailModal",
    components: {
    },
    props:{
      mainId:{
        type:String,
        required:false,
        default:''
      }
    },
    data () {
      return {
        title:"操作",
        width:800,
        visible: false,
        model:{
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/tms/tmsToolStocktaking/addTmsToolStocktakingDetail",
          edit: "/tms/tmsToolStocktaking/editTmsToolStocktakingDetail",
        }
      }
    },
    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;
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.form.clearValidate();
      },
      handleOk () {
        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';
            }
            this.model['orderId'] = this.mainId
            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;
              that.close();
            })
          }else{
             return false
          }
        })
      },
      handleCancel () {
        this.close()
      },
    }
  }
</script>
src/views/tms/modules/TmsToolStocktakingInventoryChangeForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,124 @@
<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="24">
            <a-form-model-item label="盘点明细ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="detailId">
              <a-input v-model="model.detailId" placeholder="请输入盘点明细ID"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="库存ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId">
              <a-input v-model="model.inventoryId" placeholder="请输入库存ID"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="工装条码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolBarcode">
              <a-input v-model="model.toolBarcode" placeholder="请输入工装条码"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="数量(默认1)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number">
              <a-input-number v-model="model.number" placeholder="请输入数量(默认1)" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="变更类型;正常/出库/入库" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="changeType">
              <a-input v-model="model.changeType" 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'
  export default {
    name: 'TmsToolStocktakingInventoryChangeForm',
    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: {
        },
        url: {
          add: "/tms/tmsToolStocktakingInventoryChange/add",
          edit: "/tms/tmsToolStocktakingInventoryChange/edit",
          queryById: "/tms/tmsToolStocktakingInventoryChange/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/tms/modules/TmsToolStocktakingInventoryChangeModal.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="关闭">
    <tms-tool-stocktaking-inventory-change-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tms-tool-stocktaking-inventory-change-form>
  </j-modal>
</template>
<script>
  import TmsToolStocktakingInventoryChangeForm from './TmsToolStocktakingInventoryChangeForm'
  export default {
    name: 'TmsToolStocktakingInventoryChangeModal',
    components: {
      TmsToolStocktakingInventoryChangeForm
    },
    data () {
      return {
        title:'',
        width:800,
        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/tms/modules/TmsToolStocktakingModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,135 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="盘点单号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCode">
              <a-input v-model="model.orderCode" placeholder="请输入盘点单号" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="盘点状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus">
              <a-input v-model="model.orderStatus" placeholder="请输入盘点状态" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="盘点人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator">
              <a-input v-model="model.operator" placeholder="请输入盘点人" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="盘点时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operateTime">
              <j-date placeholder="请选择盘点时间" v-model="model.operateTime" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
              <a-textarea v-model="model.remark" rows="4" placeholder="请输入备注" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
  import { httpAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: "TmsToolStocktakingModal",
    components: {
    },
    data () {
      return {
        title:"操作",
        width:1000,
        visible: false,
        model:{
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/tms/tmsToolStocktaking/add",
          edit: "/tms/tmsToolStocktaking/edit",
        }
      }
    },
    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;
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.form.clearValidate();
      },
      handleOk () {
        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;
              that.close();
            })
          }else{
             return false
          }
        })
      },
      handleCancel () {
        this.close()
      },
    }
  }
</script>
src/views/tms/modules/TmsToolsForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,171 @@
<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="toolName">
              <a-input v-model="model.toolName" placeholder="请输入工装名称"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="工装编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolCode">
              <a-input v-model="model.toolCode" placeholder="请输入工装编码"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="工装分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolCategory">
              <a-input v-model="model.toolCategory" placeholder="请输入工装分类"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolModel">
              <a-input v-model="model.toolModel" placeholder="请输入型号"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolSpecification">
              <a-input v-model="model.toolSpecification" placeholder="请输入规格"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolUnit">
              <a-input v-model="model.toolUnit" placeholder="请输入单位"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="存放位置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="storeLocation">
              <a-input v-model="model.storeLocation" placeholder="请输入存放位置"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="supplierId">
              <a-input v-model="model.supplierId" placeholder="请输入供应商"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="库存预警值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryWarning">
              <a-input-number v-model="model.inventoryWarning" placeholder="请输入库存预警值" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
              <a-textarea v-model="model.remark" rows="4" placeholder="请输入备注" />
            </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: 'TmsToolsForm',
    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: {
           toolName: [
              { required: true, message: '请输入工装名称!'},
           ],
           toolCode: [
              { required: true, message: '请输入工装编码!'},
              { validator: (rule, value, callback) => validateDuplicateValue('tms_tools', 'tool_code', value, this.model.id, callback)},
           ],
           toolCategory: [
              { required: true, message: '请输入工装分类!'},
           ],
           toolModel: [
              { required: true, message: '请输入型号!'},
           ],
           toolSpecification: [
              { required: true, message: '请输入规格!'},
           ],
           storeLocation: [
              { required: true, message: '请输入存放位置!'},
           ],
           inventoryWarning: [
              { required: true, message: '请输入库存预警值!'},
           ],
        },
        url: {
          add: "/tms/tmsTools/add",
          edit: "/tms/tmsTools/edit",
          queryById: "/tms/tmsTools/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/tms/modules/TmsToolsModal.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="关闭">
    <tms-tools-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tms-tools-form>
  </j-modal>
</template>
<script>
  import TmsToolsForm from './TmsToolsForm'
  export default {
    name: 'TmsToolsModal',
    components: {
      TmsToolsForm
    },
    data () {
      return {
        title:'',
        width:1000,
        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>