cuijian
2025-07-28 64c031d2ba1659b7fc111ce4f5101ef8a222a89c
刀具管理
已添加48个文件
8388 ■■■■■ 文件已修改
src/views/cms/CuttingInboundDetailList.vue 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingInboundInventoryList.vue 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingInboundList.vue 279 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingInventoryList.vue 212 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingPropertiesList.vue 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingReceiveDetailList.vue 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingReceiveList.vue 314 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingScrapDetailList.vue 176 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingScrapList.vue 278 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingToolList.vue 301 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/EdgeGrindingDetailList.vue 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/EdgeGrindingList.vue 309 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/RatedLifeList.vue 206 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/ToolStocktakingDetailList.vue 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/ToolStocktakingInventoryChangeList.vue 195 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/ToolStocktakingList.vue 204 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingInboundDetailForm.vue 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingInboundDetailModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingInboundForm.vue 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingInboundInventoryForm.vue 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingInboundInventoryModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingInboundModal.vue 314 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingInventoryForm.vue 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingInventoryModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingPropertiesForm.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingPropertiesModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingReceiveDetailForm.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingReceiveDetailModal.vue 359 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingReceiveForm.vue 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingReceiveModal.vue 379 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingScrapDetailForm.vue 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingScrapDetailModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingScrapForm.vue 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingScrapModal.vue 310 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingToolModal.vue 434 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/EdgeGrindingDetailForm.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/EdgeGrindingDetailModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/EdgeGrindingForm.vue 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/EdgeGrindingModal.vue 362 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/JSelectToolingModal.vue 242 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/RatedLifeForm.vue 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/RatedLifeModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/ToolStocktakingDetailForm.vue 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/ToolStocktakingDetailModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/ToolStocktakingForm.vue 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/ToolStocktakingInventoryChangeForm.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/ToolStocktakingInventoryChangeModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/ToolStocktakingModal.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingInboundDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,156 @@
<template>
  <a-card :bordered="false">
    <!-- 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"
        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>
    <cutting-inbound-detail-modal ref="modalForm" @ok="modalFormOk"></cutting-inbound-detail-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import CuttingInboundDetailModal from './modules/CuttingInboundDetailModal'
  export default {
    name: 'CuttingInboundDetailList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      CuttingInboundDetailModal
    },
    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: 'cuttingCode'
          },
          {
            title:'刀具名称',
            align:"center",
            dataIndex: 'cuttingName'
          },
          {
            title:'入库数量',
            align:"center",
            dataIndex: 'receiveNumber'
          },
        ],
        url: {
          list: "/cms/cuttingInbound/detailList",
          delete: "/cms/cuttingInboundDetail/delete",
          deleteBatch: "/cms/cuttingInboundDetail/deleteBatch",
          exportXlsUrl: "/cms/cuttingInboundDetail/exportXls",
          importExcelUrl: "cms/cuttingInboundDetail/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
        disableMixinCreated:true
      }
    },
    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:'入库单'})
        fieldList.push({type:'string',value:'cuttingId',text:'刀具ID'})
        fieldList.push({type:'int',value:'receiveNumber',text:'入库数量'})
        this.superFieldList = fieldList
      }
    },
     mounted() {
    this.$bus.$on('getToolingStorageData', (data) => {
      this.queryParam.orderId = data.id;
      this.searchQuery();
    })
  }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/CuttingInboundInventoryList.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>
    <cutting-inbound-inventory-modal ref="modalForm" @ok="modalFormOk"></cutting-inbound-inventory-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import CuttingInboundInventoryModal from './modules/CuttingInboundInventoryModal'
  export default {
    name: 'CuttingInboundInventoryList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      CuttingInboundInventoryModal
    },
    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: "/cms/cuttingInboundInventory/list",
          delete: "/cms/cuttingInboundInventory/delete",
          deleteBatch: "/cms/cuttingInboundInventory/deleteBatch",
          exportXlsUrl: "/cms/cuttingInboundInventory/exportXls",
          importExcelUrl: "cms/cuttingInboundInventory/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'})
        fieldList.push({type:'string',value:'inventoryId',text:'库存ID'})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/CuttingInboundList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,279 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
   <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="入库单状态">
              <j-search-select-tag
                  placeholder="请选择入库单状态"
                  v-model="queryParam.orderStatus"
                  dict="order_status"
                />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="入库人">
                <j-search-select-tag
                  placeholder="请选择入库人"
                  v-model="queryParam.receiver"
                  dict="sys_user,realname,id,del_flag!=1"
                />
              </a-form-item>
            </a-col>
            <a-col
            :md="6"
            :sm="8"
          >
            <span
              style="float: left;overflow: hidden;"
              class="table-page-search-submitButtons"
            >
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <!-- <a-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> -->
    </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"
        class="j-table-force-nowrap"
        :customRow="customRow"
        @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>
    <a-tabs defaultActiveKey="1">
      <a-tab-pane tab="刀具入库明细" key="1">
        <cutting-inbound-detail-list ref="cuttingInbounDetailList"></cutting-inbound-detail-list>
      </a-tab-pane>
    </a-tabs>
    <cutting-inbound-modal ref="modalForm" @ok="modalFormOk"></cutting-inbound-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import CuttingInboundModal from './modules/CuttingInboundModal'
  import CuttingInboundDetailList from './CuttingInboundDetailList'
  export default {
    name: 'CuttingInboundList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      CuttingInboundModal,
      CuttingInboundDetailList
    },
    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: 'receiver_dictText'
          },
          {
            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_dictText'
          },
          {
            title:'确认时间',
            align:"center",
            dataIndex: 'confirmTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'确认意见',
            align:"center",
            dataIndex: 'confirmComment'
          },
          {
            title:'入库单状态',
            align:"center",
            dataIndex: 'orderStatus'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/cms/cuttingInbound/list",
          delete: "/cms/cuttingInbound/delete",
          deleteBatch: "/cms/cuttingInbound/deleteBatch",
          exportXlsUrl: "/cms/cuttingInbound/exportXls",
          importExcelUrl: "cms/cuttingInbound/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      searchReset() {
      this.queryParam = {}
      this.$refs.cuttingInbounDetailList.dataSource = []
      this.loadData(1);
    },
      handleEdit: function (record) {
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = '编辑'
        this.$refs.modalForm.disableSubmit = false
    },
    handleAdd() {
      this.$refs.modalForm.add()
      this.$refs.modalForm.title = '新增'
      this.$refs.modalForm.disableSubmit = false
    },
    handleDetail:function(record){
      this.$refs.modalForm.edit(record);
      this.$refs.modalForm.title="详情";
      this.$refs.modalForm.disableSubmit = true;
    },
     customRow(record) {
      return {
        on: {
          click: (e) => {
            //将当前选中的记录传到子页面
            this.$bus.$emit('getToolingStorageData', record)
            //点击当前行变色
            let oldList = document.querySelectorAll('.checked-td-of-add-table')
            if (oldList) {
              for (let j = 0; j < oldList.length; j++) {
                oldList[j].classList.remove('checked-td-of-add-table')
              }
            }
            let children = e.target.parentNode.children
            for (let i = 0; i < children.length; i++) {
              children[i].classList.add('checked-td-of-add-table')
            }
          },
        },
      }
    },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/CuttingInventoryList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,212 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
   <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="刀具编码">
              <a-input placeholder="请输入刀具编码" v-model="queryParam.cuttingId" />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="刀具条码">
                <a-input placeholder="请输入刀具条码" v-model="queryParam.cuttingBarcode" />
              </a-form-item>
            </a-col>
            <a-col
            :md="6"
            :sm="8"
          >
            <span
              style="float: left;overflow: hidden;"
              class="table-page-search-submitButtons"
            >
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
      <!-- <a-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> -->
    </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>
    <cutting-inventory-modal ref="modalForm" @ok="modalFormOk"></cutting-inventory-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import CuttingInventoryModal from './modules/CuttingInventoryModal'
  export default {
    name: 'CuttingInventoryList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      CuttingInventoryModal
    },
    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: 'cuttingId'
          },
          {
            title:'刀具条码',
            align:"center",
            dataIndex: 'cuttingBarcode'
          },
          {
            title:'库存状态',
            align:"center",
            dataIndex: 'inventoryStatus'
          },
          {
            title:'当前寿命(百分比)',
            align:"center",
            dataIndex: 'currentLife'
          },
          // {
          //   title: '操作',
          //   dataIndex: 'action',
          //   align:"center",
          //   fixed:"right",
          //   width:147,
          //   scopedSlots: { customRender: 'action' }
          // }
        ],
        url: {
          list: "/cms/cuttingInventory/list",
          delete: "/cms/cuttingInventory/delete",
          deleteBatch: "/cms/cuttingInventory/deleteBatch",
          exportXlsUrl: "/cms/cuttingInventory/exportXls",
          importExcelUrl: "cms/cuttingInventory/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:'cuttingId',text:'刀具ID'})
        fieldList.push({type:'string',value:'cuttingBarcode',text:'刀具条码'})
        fieldList.push({type:'string',value:'inventoryStatus',text:'库存状态'})
        fieldList.push({type:'number',value:'currentLife',text:'当前寿命(百分比)'})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/CuttingPropertiesList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,150 @@
<template>
  <a-card :bordered="false">
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        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>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  export default {
    name: 'CuttingPropertiesList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
    },
    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: 'propertyCode'
          },
          {
            title:'属性名称',
            align:"center",
            dataIndex: 'propertyName'
          },
          {
            title:'计量单位',
            align:"center",
            dataIndex: 'propertyUnit'
          },
          {
            title:'属性值',
            align:"center",
            dataIndex: 'propertyValue'
          }
        ],
        url: {
          list: "/cms/cuttingProperties/list",
          delete: "/cms/cuttingProperties/delete",
          deleteBatch: "/cms/cuttingProperties/deleteBatch",
          exportXlsUrl: "/cms/cuttingProperties/exportXls",
          importExcelUrl: "cms/cuttingProperties/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:'cuttingId',text:'刀具ID'})
        fieldList.push({type:'string',value:'propertyCode',text:'属性编码'})
        fieldList.push({type:'string',value:'propertyName',text:'属性名称'})
        fieldList.push({type:'string',value:'propertyUnit',text:'计量单位'})
        fieldList.push({type:'string',value:'propertyValue',text:'属性值'})
        this.superFieldList = fieldList
      },
      getCuttingProperties(cuttingId) {
      this.queryParam.cuttingId = cuttingId;
      this.loadData(1);
    },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/CuttingReceiveDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,160 @@
<template>
  <a-card :bordered="false">
    <!-- 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"
        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>
    <cutting-receive-detail-modal ref="modalForm" @ok="modalFormOk"></cutting-receive-detail-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  export default {
    name: 'CuttingReceiveDetailList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
    },
    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: 'cuttingCode'
          },
          {
            title:'刀具名称',
            align:"center",
            dataIndex: 'cuttingName'
          },
          {
            title:'工件材质',
            align:"center",
            dataIndex: 'workpieceMaterial'
          },
          {
            title:'使用寿命',
            align:"center",
            dataIndex: 'usedLife'
          },
        ],
        url: {
          list: "/cms/cuttingReceive/detailList",
          delete: "/cms/cuttingReceiveDetail/delete",
          deleteBatch: "/cms/cuttingReceiveDetail/deleteBatch",
          exportXlsUrl: "/cms/cuttingReceiveDetail/exportXls",
          importExcelUrl: "cms/cuttingReceiveDetail/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
        disableMixinCreated:true
      }
    },
    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'})
        fieldList.push({type:'string',value:'cuttingId',text:'刀具ID'})
        fieldList.push({type:'string',value:'inventoryId',text:'库存ID'})
        fieldList.push({type:'string',value:'workpieceMaterial',text:'工件材质'})
        fieldList.push({type:'int',value:'usedLife',text:'使用寿命'})
        this.superFieldList = fieldList
      }
    },
     mounted() {
    this.$bus.$on('getToolingStorageData', (data) => {
      this.queryParam.orderId = data.id;
      this.searchQuery();
    })
  }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/CuttingReceiveList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,314 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="领用单状态">
              <j-search-select-tag
                  placeholder="请选择领用单状态"
                  v-model="queryParam.orderStatus"
                  dict="order_status"
                />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="领用人">
                <j-search-select-tag
                  placeholder="请选择领用人"
                  v-model="queryParam.receiver"
                  dict="sys_user,realname,id,del_flag!=1"
                />
              </a-form-item>
            </a-col>
            <a-col
            :md="6"
            :sm="8"
          >
            <span
              style="float: left;overflow: hidden;"
              class="table-page-search-submitButtons"
            >
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <!-- <a-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> -->
    </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"
        class="j-table-force-nowrap"
        :customRow="customRow"
        @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>
<a-tabs defaultActiveKey="1">
      <a-tab-pane tab="刀具领用明细" key="1">
        <cutting-receive-detail-list ref="cuttingReceiveDetailList"></cutting-receive-detail-list>
      </a-tab-pane>
    </a-tabs>
    <cutting-receive-modal ref="modalForm" @ok="modalFormOk"></cutting-receive-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import CuttingReceiveModal from './modules/CuttingReceiveModal'
  import CuttingReceiveDetailList from './CuttingReceiveDetailList'
  export default {
    name: 'CuttingReceiveList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      CuttingReceiveModal,
      CuttingReceiveDetailList
    },
    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: 'receiver_dictText'
          },
          {
            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_dictText'
          },
          {
            title:'确认时间',
            align:"center",
            dataIndex: 'confirmTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'确认意见',
            align:"center",
            dataIndex: 'confirmComment'
          },
          {
            title:'是否会归还',
            align:"center",
            dataIndex: 'returnFlag'
          },
          {
            title:'归还时间',
            align:"center",
            dataIndex: 'returnTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'归还说明',
            align:"center",
            dataIndex: 'returnComment'
          },
          {
            title:'归还确认人',
            align:"center",
            dataIndex: 'returnConfirmer_dictText'
          },
          {
            title:'归还确认时间',
            align:"center",
            dataIndex: 'returnConfirmTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'归还确认意见',
            align:"center",
            dataIndex: 'returnConfirmComment'
          },
          {
            title:'领用单状态',
            align:"center",
            dataIndex: 'orderStatus'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/cms/cuttingReceive/list",
          delete: "/cms/cuttingReceive/delete",
          deleteBatch: "/cms/cuttingReceive/deleteBatch",
          exportXlsUrl: "/cms/cuttingReceive/exportXls",
          importExcelUrl: "cms/cuttingReceive/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
     searchReset() {
      this.queryParam = {}
      this.$refs.cuttingReceiveDetailList.dataSource = []
      this.loadData(1);
    },
      handleEdit: function (record) {
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = '编辑'
        this.$refs.modalForm.disableSubmit = false
    },
    handleAdd() {
      this.$refs.modalForm.add()
      this.$refs.modalForm.title = '新增'
      this.$refs.modalForm.disableSubmit = false
    },
    handleDetail:function(record){
      this.$refs.modalForm.edit(record);
      this.$refs.modalForm.title="详情";
      this.$refs.modalForm.disableSubmit = true;
    },
     customRow(record) {
      return {
        on: {
          click: (e) => {
            //将当前选中的记录传到子页面
            this.$bus.$emit('getToolingStorageData', record)
            //点击当前行变色
            let oldList = document.querySelectorAll('.checked-td-of-add-table')
            if (oldList) {
              for (let j = 0; j < oldList.length; j++) {
                oldList[j].classList.remove('checked-td-of-add-table')
              }
            }
            let children = e.target.parentNode.children
            for (let i = 0; i < children.length; i++) {
              children[i].classList.add('checked-td-of-add-table')
            }
          },
        },
      }
    },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/CuttingScrapDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,176 @@
<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> -->
    </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"
        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>
    <cutting-scrap-detail-modal ref="modalForm" @ok="modalFormOk"></cutting-scrap-detail-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import CuttingScrapDetailModal from './modules/CuttingScrapDetailModal'
  export default {
    name: 'CuttingScrapDetailList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      CuttingScrapDetailModal
    },
    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: 'cuttingCode'
          },
          {
            title:'刀具名称',
            align:"center",
            dataIndex: 'cuttingName'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/cms/cuttingScrap/detailList",
          delete: "/cms/cuttingScrapDetail/delete",
          deleteBatch: "/cms/cuttingScrapDetail/deleteBatch",
          exportXlsUrl: "/cms/cuttingScrapDetail/exportXls",
          importExcelUrl: "cms/cuttingScrapDetail/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
        disableMixinCreated:true
      }
    },
    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'})
        fieldList.push({type:'string',value:'cuttingId',text:'刀具ID'})
        fieldList.push({type:'string',value:'inventoryId',text:'库存ID'})
        this.superFieldList = fieldList
      }
    },
     mounted() {
    this.$bus.$on('getToolingStorageData', (data) => {
      this.queryParam.orderId = data.id;
      this.searchQuery();
    })
  }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/CuttingScrapList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,278 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="报废单状态">
              <j-search-select-tag
                  placeholder="请选择报废单状态"
                  v-model="queryParam.orderStatus"
                  dict="order_status"
                />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="申请人">
                <j-search-select-tag
                  placeholder="请选择申请人"
                  v-model="queryParam.applicant"
                  dict="sys_user,realname,id,del_flag!=1"
                />
              </a-form-item>
            </a-col>
            <a-col
            :md="6"
            :sm="8"
          >
            <span
              style="float: left;overflow: hidden;"
              class="table-page-search-submitButtons"
            >
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <!-- <a-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> -->
    </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"
        class="j-table-force-nowrap"
        :customRow="customRow"
        @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>
<a-tabs defaultActiveKey="1">
      <a-tab-pane tab="刀具报废明细" key="1">
        <cutting-scrap-detail-list ref="cuttingScrapDetailList"></cutting-scrap-detail-list>
      </a-tab-pane>
    </a-tabs>
    <cutting-scrap-modal ref="modalForm" @ok="modalFormOk"></cutting-scrap-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import CuttingScrapModal from './modules/CuttingScrapModal'
  import CuttingScrapDetailList from './CuttingScrapDetailList'
  export default {
    name: 'CuttingScrapList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      CuttingScrapModal,
      CuttingScrapDetailList
    },
    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: 'applicant_dictText'
          },
          {
            title:'申请时间',
            align:"center",
            dataIndex: 'applicationTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'申请说明',
            align:"center",
            dataIndex: 'applicationComment'
          },
          {
            title:'确认人',
            align:"center",
            dataIndex: 'confirmer_dictText'
          },
          {
            title:'确认时间',
            align:"center",
            dataIndex: 'confirmTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'确认意见',
            align:"center",
            dataIndex: 'confirmComment'
          },
           {
            title:'报废单状态',
            align:"center",
            dataIndex: 'orderStatus'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/cms/cuttingScrap/list",
          delete: "/cms/cuttingScrap/delete",
          deleteBatch: "/cms/cuttingScrap/deleteBatch",
          exportXlsUrl: "/cms/cuttingScrap/exportXls",
          importExcelUrl: "cms/cuttingScrap/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
     searchReset() {
      this.queryParam = {}
      this.$refs.cuttingScrapDetailList.dataSource = []
      this.loadData(1);
    },
      handleEdit: function (record) {
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = '编辑'
        this.$refs.modalForm.disableSubmit = false
    },
    handleAdd() {
      this.$refs.modalForm.add()
      this.$refs.modalForm.title = '新增'
      this.$refs.modalForm.disableSubmit = false
    },
    handleDetail:function(record){
      this.$refs.modalForm.edit(record);
      this.$refs.modalForm.title="详情";
      this.$refs.modalForm.disableSubmit = true;
    },
     customRow(record) {
      return {
        on: {
          click: (e) => {
            //将当前选中的记录传到子页面
            this.$bus.$emit('getToolingStorageData', record)
            //点击当前行变色
            let oldList = document.querySelectorAll('.checked-td-of-add-table')
            if (oldList) {
              for (let j = 0; j < oldList.length; j++) {
                oldList[j].classList.remove('checked-td-of-add-table')
              }
            }
            let children = e.target.parentNode.children
            for (let i = 0; i < children.length; i++) {
              children[i].classList.add('checked-td-of-add-table')
            }
          },
        },
      }
    },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/CuttingToolList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,301 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="刀具编码">
              <a-input placeholder="请输入刀具编码" v-model="queryParam.cuttingCode" />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="刀具名称">
                <a-input placeholder="请输入刀具名称" v-model="queryParam.cuttingName" />
              </a-form-item>
            </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="刀具分类">
                <j-search-select-tag
                  placeholder="请选择刀具分类"
                  v-model="queryParam.cuttingCategory"
                  dict="cutting_category"
                />
              </a-form-item>
            </a-col>
            <a-col
            :md="6"
            :sm="8"
          >
            <span
              style="float: left;overflow: hidden;"
              class="table-page-search-submitButtons"
            >
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <!-- <a-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> -->
    </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,type:'radio'}"
        class="j-table-force-nowrap"
        :customRow="customRow"
        @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>
    <a-tabs defaultActiveKey="1">
      <a-tab-pane tab="扩展属性" key="1">
        <cutting-properties-list ref="cuttingPropertiesList"></cutting-properties-list>
      </a-tab-pane>
      <!-- <a-tab-pane tab="额定寿命" key="2">
        <rated-life-list ref="ratedLifeList"></rated-life-list>
      </a-tab-pane> -->
    </a-tabs>
    <!-- table区域-end -->
    <cutting-tool-modal ref="modalForm" @ok="modalFormOk"></cutting-tool-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import CuttingToolModal from './modules/CuttingToolModal'
  import CuttingPropertiesList from './CuttingPropertiesList'
  import JDictSelectTag from '@/components/dict/JDictSelectTag'
  import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  export default {
    name: 'CuttingToolList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      CuttingToolModal,CuttingPropertiesList, JDictSelectTag,
    JSearchSelectTag
    },
    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: 'cuttingCode'
          },
          {
            title:'刀具名称',
            align:"center",
            dataIndex: 'cuttingName'
          },
          {
            title:'刀具分类',
            align:"center",
            dataIndex: 'cuttingCategory'
          },
          {
            title:'存放位置',
            align:"center",
            dataIndex: 'storeLocation'
          },
          {
            title:'供应商',
            align:"center",
            dataIndex: 'supplierId'
          },
          {
            title:'最小包装单位',
            align:"center",
            dataIndex: 'minimumPackageUnit'
          },
          {
            title:'刀具材质',
            align:"center",
            dataIndex: 'cuttingMaterial'
          },
          {
            title:'型号',
            align:"center",
            dataIndex: 'cuttingModel'
          },
          {
            title:'图号',
            align:"center",
            dataIndex: 'drawingNumber'
          },
          {
            title:'库存预警值',
            align:"center",
            dataIndex: 'inventoryWarning'
          },
          {
            title:'备注',
            align:"center",
            dataIndex: 'remark'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/cms/cuttingTool/getCuttingToolList",
          delete: "/cms/cuttingTool/delete",
          deleteBatch: "/cms/cuttingTool/deleteBatch",
          exportXlsUrl: "/cms/cuttingTool/exportXls",
          importExcelUrl: "cms/cuttingTool/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
      this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      customRow(record) {
        return {
        on: {
          click: e => {
            this.onSelectChange(record.id.split(","), [record]);
          }
        }
      };
      },
      onSelectChange(selectedRowKeys) {
      this.selectedRowKeys = selectedRowKeys;
      this.$refs.cuttingPropertiesList.getCuttingProperties(selectedRowKeys[0]);
    },
    handleEdit: function (record) {
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = '编辑'
        this.$refs.modalForm.disableSubmit = false
    },
    handleAdd() {
      this.$refs.modalForm.add()
      this.$refs.modalForm.title = '新增'
      this.$refs.modalForm.disableSubmit = false
    },
    handleDetail:function(record){
      this.$refs.modalForm.edit(record);
      this.$refs.modalForm.title="详情";
      this.$refs.modalForm.disableSubmit = true;
    },
    searchQuery() {
      this.selectedRowKeys = [];
      this.$refs.cuttingPropertiesList.getCuttingProperties("-1");
      this.$refs.cuttingPropertiesList.loadData();
      this.$refs.cuttingPropertiesList.selectedRowKeys = [];
      this.loadData();
    },
    searchReset() {
      this.queryParam.cuttingCode = '';
      this.queryParam.cuttingName = '';
      this.queryParam.cuttingCategory = '';
      this.$refs.cuttingPropertiesList.getCuttingProperties("-1");
      this.loadData();
    },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/EdgeGrindingDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,157 @@
<template>
  <a-card :bordered="false">
    <!-- 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"
        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>
    <edge-grinding-detail-modal ref="modalForm" @ok="modalFormOk"></edge-grinding-detail-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  export default {
    name: 'EdgeGrindingDetailList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
    },
    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: 'cuttingCode'
          },
          {
            title:'刀具名称',
            align:"center",
            dataIndex: 'cuttingName'
          },
          {
            title:'新刀具编码',
            align:"center",
            dataIndex: 'newCuttingId'
          },
        ],
        url: {
          list: "/cms/edgeGrinding/detailList",
          delete: "/cms/edgeGrindingDetail/delete",
          deleteBatch: "/cms/edgeGrindingDetail/deleteBatch",
          exportXlsUrl: "/cms/edgeGrindingDetail/exportXls",
          importExcelUrl: "cms/edgeGrindingDetail/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
        disableMixinCreated:true
      }
    },
    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'})
        fieldList.push({type:'string',value:'cuttingId',text:'刀具ID'})
        fieldList.push({type:'string',value:'inventoryId',text:'库存ID'})
        fieldList.push({type:'string',value:'newCuttingId',text:'新刀具ID'})
        fieldList.push({type:'string',value:'newInventoryId',text:'新库存ID'})
        this.superFieldList = fieldList
      }
    },
     mounted() {
    this.$bus.$on('getToolingStorageData', (data) => {
      this.queryParam.orderId = data.id;
      this.searchQuery();
    })
  }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/EdgeGrindingList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,309 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="修磨单状态">
              <j-search-select-tag
                  placeholder="请选择修磨单状态"
                  v-model="queryParam.orderStatus"
                  dict="order_status"
                />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="申请人">
                <j-search-select-tag
                  placeholder="请选择申请人"
                  v-model="queryParam.applicant"
                  dict="sys_user,realname,id,del_flag!=1"
                />
              </a-form-item>
            </a-col>
            <a-col
            :md="6"
            :sm="8"
          >
            <span
              style="float: left;overflow: hidden;"
              class="table-page-search-submitButtons"
            >
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <!-- <a-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> -->
    </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"
        class="j-table-force-nowrap"
        :customRow="customRow"
        @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>
<a-tabs defaultActiveKey="1">
      <a-tab-pane tab="刀具修磨明细" key="1">
        <edge-grinding-detail-list ref="edgeGrindingDetailList"></edge-grinding-detail-list>
      </a-tab-pane>
    </a-tabs>
    <edge-grinding-modal ref="modalForm" @ok="modalFormOk"></edge-grinding-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import EdgeGrindingModal from './modules/EdgeGrindingModal'
  import EdgeGrindingDetailList from './EdgeGrindingDetailList'
  export default {
    name: 'EdgeGrindingList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      EdgeGrindingModal,
      EdgeGrindingDetailList
    },
    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: 'applicant_dictText'
          },
          {
            title:'申请时间',
            align:"center",
            dataIndex: 'applicationTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'申请说明',
            align:"center",
            dataIndex: 'applicationComment'
          },
          {
            title:'确认人',
            align:"center",
            dataIndex: 'confirmer_dictText'
          },
          {
            title:'确认时间',
            align:"center",
            dataIndex: 'confirmTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'确认意见',
            align:"center",
            dataIndex: 'confirmComment'
          },
          {
            title:'归还时间',
            align:"center",
            dataIndex: 'returnTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'归还说明',
            align:"center",
            dataIndex: 'returnComment'
          },
          {
            title:'归还确认人',
            align:"center",
            dataIndex: 'returnConfirmer_dictText'
          },
          {
            title:'归还确认时间',
            align:"center",
            dataIndex: 'returnConfirmTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'归还确认意见',
            align:"center",
            dataIndex: 'returnConfirmComment'
          },
          {
            title:'修磨单状态',
            align:"center",
            dataIndex: 'orderStatus'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/cms/edgeGrinding/list",
          delete: "/cms/edgeGrinding/delete",
          deleteBatch: "/cms/edgeGrinding/deleteBatch",
          exportXlsUrl: "/cms/edgeGrinding/exportXls",
          importExcelUrl: "cms/edgeGrinding/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      searchReset() {
      this.queryParam = {}
      this.$refs.edgeGrindingDetailList.dataSource = []
      this.loadData(1);
    },
      handleEdit: function (record) {
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = '编辑'
        this.$refs.modalForm.disableSubmit = false
    },
    handleAdd() {
      this.$refs.modalForm.add()
      this.$refs.modalForm.title = '新增'
      this.$refs.modalForm.disableSubmit = false
    },
    handleDetail:function(record){
      this.$refs.modalForm.edit(record);
      this.$refs.modalForm.title="详情";
      this.$refs.modalForm.disableSubmit = true;
    },
     customRow(record) {
      return {
        on: {
          click: (e) => {
            //将当前选中的记录传到子页面
            this.$bus.$emit('getToolingStorageData', record)
            //点击当前行变色
            let oldList = document.querySelectorAll('.checked-td-of-add-table')
            if (oldList) {
              for (let j = 0; j < oldList.length; j++) {
                oldList[j].classList.remove('checked-td-of-add-table')
              }
            }
            let children = e.target.parentNode.children
            for (let i = 0; i < children.length; i++) {
              children[i].classList.add('checked-td-of-add-table')
            }
          },
        },
      }
    },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/RatedLifeList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,206 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="刀具编码">
              <a-input placeholder="请输入刀具编码" v-model="queryParam.cuttingId" />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="工件材质">
                <a-input placeholder="请输入工件材质" v-model="queryParam.workpieceMaterial" />
              </a-form-item>
            </a-col>
            <a-col
            :md="6"
            :sm="8"
          >
            <span
              style="float: left;overflow: hidden;"
              class="table-page-search-submitButtons"
            >
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <!-- <a-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> -->
    </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>
    <rated-life-modal ref="modalForm" @ok="modalFormOk"></rated-life-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import RatedLifeModal from './modules/RatedLifeModal'
  export default {
    name: 'RatedLifeList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      RatedLifeModal
    },
    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: 'cuttingId'
          },
          {
            title:'工件材质',
            align:"center",
            dataIndex: 'workpieceMaterial'
          },
          {
            title:'额定寿命',
            align:"center",
            dataIndex: 'ratedLife'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/cms/ratedLife/list",
          delete: "/cms/ratedLife/delete",
          deleteBatch: "/cms/ratedLife/deleteBatch",
          exportXlsUrl: "/cms/ratedLife/exportXls",
          importExcelUrl: "cms/ratedLife/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:'cuttingId',text:'刀具ID'})
        fieldList.push({type:'string',value:'workpieceMaterial',text:'工件材质'})
        fieldList.push({type:'number',value:'ratedLife',text:'额定寿命'})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/ToolStocktakingDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,189 @@
<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>
    <tool-stocktaking-detail-modal ref="modalForm" @ok="modalFormOk"></tool-stocktaking-detail-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ToolStocktakingDetailModal from './modules/ToolStocktakingDetailModal'
  export default {
    name: 'ToolStocktakingDetailList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      ToolStocktakingDetailModal
    },
    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: '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: "/cms/toolStocktakingDetail/list",
          delete: "/cms/toolStocktakingDetail/delete",
          deleteBatch: "/cms/toolStocktakingDetail/deleteBatch",
          exportXlsUrl: "/cms/toolStocktakingDetail/exportXls",
          importExcelUrl: "cms/toolStocktakingDetail/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'})
        fieldList.push({type:'number',value:'beforeNumber',text:'盘点前数量'})
        fieldList.push({type:'number',value:'actualNumber',text:'实际盘点数量'})
        fieldList.push({type:'string',value:'stocktakingResult',text:'盘点结果'})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/ToolStocktakingInventoryChangeList.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>
    <tool-stocktaking-inventory-change-modal ref="modalForm" @ok="modalFormOk"></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 ToolStocktakingInventoryChangeModal from './modules/ToolStocktakingInventoryChangeModal'
  export default {
    name: 'ToolStocktakingInventoryChangeList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      ToolStocktakingInventoryChangeModal
    },
    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: "/cms/toolStocktakingInventoryChange/list",
          delete: "/cms/toolStocktakingInventoryChange/delete",
          deleteBatch: "/cms/toolStocktakingInventoryChange/deleteBatch",
          exportXlsUrl: "/cms/toolStocktakingInventoryChange/exportXls",
          importExcelUrl: "cms/toolStocktakingInventoryChange/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'})
        fieldList.push({type:'string',value:'inventoryId',text:'库存ID'})
        fieldList.push({type:'string',value:'toolBarcode',text:'刀具条码'})
        fieldList.push({type:'number',value:'number',text:'数量(默认1)'})
        fieldList.push({type:'string',value:'changeType',text:'变更类型;正常/出库/入库'})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/ToolStocktakingList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,204 @@
<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>
    <tool-stocktaking-modal ref="modalForm" @ok="modalFormOk"></tool-stocktaking-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ToolStocktakingModal from './modules/ToolStocktakingModal'
  export default {
    name: 'ToolStocktakingList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      ToolStocktakingModal
    },
    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: 'delFlag'
          },
          {
            title:'盘点单号',
            align:"center",
            dataIndex: 'orderCode'
          },
          {
            title:'盘点状态',
            align:"center",
            dataIndex: 'orderStatus'
          },
          {
            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: 'remark'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/cms/toolStocktaking/list",
          delete: "/cms/toolStocktaking/delete",
          deleteBatch: "/cms/toolStocktaking/deleteBatch",
          exportXlsUrl: "/cms/toolStocktaking/exportXls",
          importExcelUrl: "cms/toolStocktaking/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'int',value:'delFlag',text:'删除标记'})
        fieldList.push({type:'string',value:'orderCode',text:'盘点单号'})
        fieldList.push({type:'string',value:'orderStatus',text:'盘点状态'})
        fieldList.push({type:'string',value:'operator',text:'盘点人'})
        fieldList.push({type:'date',value:'operateTime',text:'盘点时间'})
        fieldList.push({type:'string',value:'remark',text:'备注'})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/cms/modules/CuttingInboundDetailForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,114 @@
<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="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="cuttingId">
              <a-input v-model="model.cuttingId" 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>
    </j-form-container>
  </a-spin>
</template>
<script>
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: 'CuttingInboundDetailForm',
    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: "/cms/cuttingInboundDetail/add",
          edit: "/cms/cuttingInboundDetail/edit",
          queryById: "/cms/cuttingInboundDetail/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/cms/modules/CuttingInboundDetailModal.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="关闭">
    <cutting-inbound-detail-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cutting-inbound-detail-form>
  </j-modal>
</template>
<script>
  import CuttingInboundDetailForm from './CuttingInboundDetailForm'
  export default {
    name: 'CuttingInboundDetailModal',
    components: {
      CuttingInboundDetailForm
    },
    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/cms/modules/CuttingInboundForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,139 @@
<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="delFlag">
              <a-input-number v-model="model.delFlag" placeholder="请输入删除标记" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <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="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-input v-model="model.receiveComment" placeholder="请输入入库说明"  ></a-input>
            </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-spin>
</template>
<script>
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: 'CuttingInboundForm',
    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: "/cms/cuttingInbound/add",
          edit: "/cms/cuttingInbound/edit",
          queryById: "/cms/cuttingInbound/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/cms/modules/CuttingInboundInventoryForm.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: 'CuttingInboundInventoryForm',
    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: "/cms/cuttingInboundInventory/add",
          edit: "/cms/cuttingInboundInventory/edit",
          queryById: "/cms/cuttingInboundInventory/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/cms/modules/CuttingInboundInventoryModal.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="关闭">
    <cutting-inbound-inventory-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cutting-inbound-inventory-form>
  </j-modal>
</template>
<script>
  import CuttingInboundInventoryForm from './CuttingInboundInventoryForm'
  export default {
    name: 'CuttingInboundInventoryModal',
    components: {
      CuttingInboundInventoryForm
    },
    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/cms/modules/CuttingInboundModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,314 @@
<template>
  <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel">
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="入库人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择入库人"
                v-decorator="['receiver', { rules: [{ required: true, message: '请选择入库人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="入库日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['receiveTime', validatorRules.receiveTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="入库说明" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入入库说明" v-decorator="['receiveComment', validatorRules.receiveComment]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择确认人"
                v-decorator="['confirmer', { rules: [{ required: false, message: '请选择确认人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="确认日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['confirmTime', validatorRules.confirmTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="确认意见" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入确认意见" v-decorator="['confirmComment', validatorRules.confirmComment]" />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()"
      >选择刀具</a-button
    >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
    >
      <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" 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" type="primary">提交</a-button>
    </template>
    <template slot="footer" v-if="disableSubmit == true">
      <a-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
    </template>
    <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal>
  </a-modal>
</template>
<script>
  import pick from 'lodash.pick'
  import JSelectToolingModal from './JSelectToolingModal'
  import moment from 'moment'
  import { getAction, postAction, requestPut } from '@/api/manage'
  import JDictSelectTag from '@/components/dict/JDictSelectTag'
  import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
  import { filterObj } from '@/utils/util'
  import store from '@/store/'
  export default {
    name: 'CuttingInboundModal',
    components: {
    JSelectToolingModal,
    JMultiSelectTag,
    JDictSelectTag,
    store,
    moment,
  },
    data () {
      return {
         /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      title:'新增',
         visible: false,
         selectedRowKeys: {},
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      loading: false,
      form: this.$form.createForm(this),
      dataSource: [],
      param: {},
      validatorRules: {
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '刀具编码',
          align: 'center',
          dataIndex: 'cuttingCode',
          width: 150,
        },
        {
          title: '刀具名称',
          align: 'center',
          dataIndex: 'cuttingName',
        },
        {
          title: '入库数量',
          align: 'center',
          dataIndex: 'receiveNumber',
          scopedSlots: { customRender: 'receiveNumber' },
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
      ],
      url: {
        add: '/cms/cuttingInbound/add',
        detailList: '/cms/cuttingInbound/detailList',
      },
      orderId:'',
      disableSubmit:false
      }
    },
    methods: {
      modalFormOk(){
      },
       getQueryParams() {
      this.param.pageNo = this.ipagination.current
      this.param.pageSize = this.ipagination.pageSize
      return filterObj(this.param)
    },
      add() {
      let receiver = store.getters.userInfo.id
      let receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
      this.edit({ receiver: receiver, receiveTime: receiveTime })
    },
    edit(record) {
      record.receiver = store.getters.userInfo.id
      record.receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
      this.form.resetFields()
      this.model = Object.assign({}, record)
      this.visible = true
      this.disableSubmit = false
      if (record.id) {
        this.orderId = record.id
        this.detailList(this.orderId)
      }
      this.$nextTick(() => {
        this.form.setFieldsValue(
          pick(this.model, 'receiver', 'receiveTime', 'receiveComment', 'confirmer', 'confirmTime', 'confirmComment')
        )
      })
    },
     handleDelete(record, index) {
      this.dataSource.splice(index, 1)
    },
    handleChange(value, key, column, index) {
      //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index
      const temp = [...this.dataSource]
      const target = temp.filter((item) => key === item.key)[index]
      if (target) {
        target[column.dataIndex] = value
        this.dataSource = temp
      }
    },
    selectTooling: function () {
      let ids = []
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].cuttingId)
      }
      this.$refs.toolingModalForm.showModal(ids)
      this.$refs.toolingModalForm.title = '选择刀具'
      this.$refs.toolingModalForm.disableSubmit = false
    },
    detailList(orderId) {
      this.param.orderId = orderId
      getAction(this.url.detailList, this.getQueryParams()).then((res) => {
        if (res.success) {
          this.dataSource = res.result
        }
      })
    },
    filterOption(input, option) {
      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
    },
    handleOk() {
      if (this.dataSource.length == 0) {
        this.$message.error('请先选择入库刀具')
        return
      }
      const that = this
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = Object.assign(this.model, values)
          formData.detailData = this.dataSource
          postAction(that.url.add, formData)
            .then((res) => {
              if (res.success) {
                that.$message.success('入库成功')
                that.$emit('ok', new Date())
              } else {
                that.$message.warning(res.message)
              }
            })
            .finally(() => {
              that.confirmLoading = false
              that.close()
            })
        }
      })
    },
    handleCancel() {
      this.close()
    },
    close() {
      this.$emit('close')
      this.dataSource = []
      this.visible = false
      this.disableSubmit = false
    },
    },
    mounted() {
    this.$bus.$on('selectionRows', (data) => {
      //getCurrSelected äº‹ä»¶ æŽ¥æ”¶ç»„件传递的参数
      for (let i = 0; i < data.length; i++) {
        this.dataSource.push({
          cuttingId: data[i].id,
          cuttingCode: data[i].cuttingCode,
          cuttingName: data[i].cuttingName
        })
      }
    })
  },
  }
</script>
src/views/cms/modules/CuttingInventoryForm.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="cuttingId">
              <a-input v-model="model.cuttingId" placeholder="请输入刀具编码"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="刀具条码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cuttingBarcode">
              <a-input v-model="model.cuttingBarcode" 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: 'CuttingInventoryForm',
    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: "/cms/cuttingInventory/add",
          edit: "/cms/cuttingInventory/edit",
          queryById: "/cms/cuttingInventory/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/cms/modules/CuttingInventoryModal.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="关闭">
    <cutting-inventory-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cutting-inventory-form>
  </j-modal>
</template>
<script>
  import CuttingInventoryForm from './CuttingInventoryForm'
  export default {
    name: 'CuttingInventoryModal',
    components: {
      CuttingInventoryForm
    },
    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/cms/modules/CuttingPropertiesForm.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="cuttingId">
              <a-input v-model="model.cuttingId" placeholder="请输入刀具ID"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="属性编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="propertyCode">
              <a-input v-model="model.propertyCode" placeholder="请输入属性编码"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="属性名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="propertyName">
              <a-input v-model="model.propertyName" placeholder="请输入属性名称"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="propertyUnit">
              <a-input v-model="model.propertyUnit" placeholder="请输入计量单位"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="属性值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="propertyValue">
              <a-input v-model="model.propertyValue" 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: 'CuttingPropertiesForm',
    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: "/cms/cuttingProperties/add",
          edit: "/cms/cuttingProperties/edit",
          queryById: "/cms/cuttingProperties/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/cms/modules/CuttingPropertiesModal.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="关闭">
    <cutting-properties-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cutting-properties-form>
  </j-modal>
</template>
<script>
  import CuttingPropertiesForm from './CuttingPropertiesForm'
  export default {
    name: 'CuttingPropertiesModal',
    components: {
      CuttingPropertiesForm
    },
    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/cms/modules/CuttingReceiveDetailForm.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="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="cuttingId">
              <a-input v-model="model.cuttingId" 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="workpieceMaterial">
              <a-input v-model="model.workpieceMaterial" placeholder="请输入工件材质"  ></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>
    </j-form-container>
  </a-spin>
</template>
<script>
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: 'CuttingReceiveDetailForm',
    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: "/cms/cuttingReceiveDetail/add",
          edit: "/cms/cuttingReceiveDetail/edit",
          queryById: "/cms/cuttingReceiveDetail/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/cms/modules/CuttingReceiveDetailModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,359 @@
<template>
  <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel">
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="领用人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择领用人"
                v-decorator="['receiver', { rules: [{ required: true, message: '请选择领用人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="领用日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['receiveTime', validatorRules.receiveTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="领用说明" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入领用说明" v-decorator="['receiveComment', validatorRules.receiveComment]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择确认人"
                v-decorator="['confirmer', { rules: [{ required: false, message: '请选择确认人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="确认日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['confirmTime', validatorRules.confirmTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="确认意见" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入确认意见" v-decorator="['confirmComment', validatorRules.confirmComment]" />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="是否会归还" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit"  placeholder="请输入是否会归还" v-decorator="['returnFlag', validatorRules.returnFlag]" ></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="归还日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['returnTime', validatorRules.returnTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="归还说明" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入归还说明" v-decorator="['returnComment', validatorRules.returnComment]" />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="归还确认人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择归还确认人"
                v-decorator="['returnConfirmer', { rules: [{ required: false, message: '请选择归还确认人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="归还确认日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['returnConfirmTime', validatorRules.returnConfirmTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="归还确认意见" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入归还确认意见" v-decorator="['returnConfirmComment', validatorRules.returnConfirmComment]" />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()"
      >选择刀具</a-button
    >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
    >
      <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" 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" type="primary">提交</a-button>
    </template>
    <template slot="footer" v-if="disableSubmit == true">
      <a-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
    </template>
    <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal>
  </a-modal>
</template>
<script>
  import pick from 'lodash.pick'
  import JSelectToolingModal from './JSelectToolingModal'
  import moment from 'moment'
  import { getAction, postAction, requestPut } from '@/api/manage'
  import JDictSelectTag from '@/components/dict/JDictSelectTag'
  import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
  import { filterObj } from '@/utils/util'
  import store from '@/store/'
  export default {
    name: 'CuttingInboundModal',
    components: {
    JSelectToolingModal,
    JMultiSelectTag,
    JDictSelectTag,
    store,
    moment,
  },
    data () {
      return {
         /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      title:'新增',
         visible: false,
         selectedRowKeys: {},
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      loading: false,
      form: this.$form.createForm(this),
      dataSource: [],
      param: {},
      validatorRules: {
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '刀具编码',
          align: 'center',
          dataIndex: 'cuttingCode',
          width: 150,
        },
        {
          title: '刀具名称',
          align: 'center',
          dataIndex: 'cuttingName',
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
      ],
      url: {
        add: '/cms/cuttingReceive/add',
        detailList: '/cms/cuttingInbound/detailList',
      },
      orderId:'',
      disableSubmit:false
      }
    },
    methods: {
      modalFormOk(){
      },
       getQueryParams() {
      this.param.pageNo = this.ipagination.current
      this.param.pageSize = this.ipagination.pageSize
      return filterObj(this.param)
    },
      add() {
      let receiver = store.getters.userInfo.id
      let receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
      this.edit({ receiver: receiver, receiveTime: receiveTime })
    },
    edit(record) {
      record.receiver = store.getters.userInfo.id
      record.receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
      this.form.resetFields()
      this.model = Object.assign({}, record)
      this.visible = true
      this.disableSubmit = false
      if (record.id) {
        this.orderId = record.id
        this.detailList(this.orderId)
      }
      this.$nextTick(() => {
        this.form.setFieldsValue(
          pick(this.model, 'receiver', 'receiveTime', 'receiveComment', 'confirmer', 'confirmTime', 'confirmComment')
        )
      })
    },
     handleDelete(record, index) {
      this.dataSource.splice(index, 1)
    },
    handleChange(value, key, column, index) {
      //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index
      const temp = [...this.dataSource]
      const target = temp.filter((item) => key === item.key)[index]
      if (target) {
        target[column.dataIndex] = value
        this.dataSource = temp
      }
    },
    selectTooling: function () {
      let ids = []
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].cuttingId)
      }
      this.$refs.toolingModalForm.showModal(ids)
      this.$refs.toolingModalForm.title = '选择刀具'
      this.$refs.toolingModalForm.disableSubmit = false
    },
    detailList(orderId) {
      this.param.orderId = orderId
      getAction(this.url.detailList, this.getQueryParams()).then((res) => {
        if (res.success) {
          this.dataSource = res.result
        }
      })
    },
    filterOption(input, option) {
      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
    },
    handleOk() {
      if (this.dataSource.length == 0) {
        this.$message.error('请先选择入库刀具')
        return
      }
      const that = this
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = Object.assign(this.model, values)
          formData.detailData = this.dataSource
          postAction(that.url.add, formData)
            .then((res) => {
              if (res.success) {
                that.$message.success('领用成功')
                that.$emit('ok', new Date())
              } else {
                that.$message.warning(res.message)
              }
            })
            .finally(() => {
              that.confirmLoading = false
              that.close()
            })
        }
      })
    },
    handleCancel() {
      this.close()
    },
    close() {
      this.$emit('close')
      this.dataSource = []
      this.visible = false
      this.disableSubmit = false
    },
    },
    mounted() {
    this.$bus.$on('selectionRows', (data) => {
      //getCurrSelected äº‹ä»¶ æŽ¥æ”¶ç»„件传递的参数
      for (let i = 0; i < data.length; i++) {
        this.dataSource.push({
          cuttingId: data[i].id,
          cuttingCode: data[i].cuttingCode,
          cuttingName: data[i].cuttingName
        })
      }
    })
  },
  }
</script>
src/views/cms/modules/CuttingReceiveForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,169 @@
<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="delFlag">
              <a-input-number v-model="model.delFlag" placeholder="请输入删除标记" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <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="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-input v-model="model.receiveComment" placeholder="请输入领用说明"  ></a-input>
            </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-col :span="24">
            <a-form-model-item label="是否会归还" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnFlag">
              <a-input v-model="model.returnFlag" placeholder="请输入是否会归还"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <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="24">
            <a-form-model-item label="归还说明" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnComment">
              <a-input v-model="model.returnComment" placeholder="请输入归还说明"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <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="24">
            <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="24">
            <a-form-model-item label="归还确认意见" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmComment">
              <a-input v-model="model.returnConfirmComment" 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: 'CuttingReceiveForm',
    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: "/cms/cuttingReceive/add",
          edit: "/cms/cuttingReceive/edit",
          queryById: "/cms/cuttingReceive/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/cms/modules/CuttingReceiveModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,379 @@
<template>
  <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel">
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="领用人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择领用人"
                v-decorator="['receiver', { rules: [{ required: true, message: '请选择领用人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="领用日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['receiveTime', validatorRules.receiveTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="领用说明" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入领用说明" v-decorator="['receiveComment', validatorRules.receiveComment]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择确认人"
                v-decorator="['confirmer', { rules: [{ required: false, message: '请选择确认人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="确认日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['confirmTime', validatorRules.confirmTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="确认意见" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入确认意见" v-decorator="['confirmComment', validatorRules.confirmComment]" />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="是否会归还" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit"  placeholder="请输入是否会归还" v-decorator="['returnFlag', validatorRules.returnFlag]" ></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="归还日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['returnTime', validatorRules.returnTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="归还说明" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入归还说明" v-decorator="['returnComment', validatorRules.returnComment]" />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="归还确认人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择归还确认人"
                v-decorator="['returnConfirmer', { rules: [{ required: false, message: '请选择归还确认人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="归还确认日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['returnConfirmTime', validatorRules.returnConfirmTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="归还确认意见" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入归还确认意见" v-decorator="['returnConfirmComment', validatorRules.returnConfirmComment]" />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()"
      >选择刀具</a-button
    >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
    >
      <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index">
        <div :key="col.dataIndex">
         <a-input
                    :value="text"
                    :disabled="disableSubmit"
                    v-if="col.dataIndex == 'workpieceMaterial'"
                    @change="(e)=>handleChange(e.target.value, record.key, col, index)"
                  />
                  <a-input-number
            v-if="col.dataIndex == 'usedLife'"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="1"
          />
        </div>
      </template>
      <span slot="action" 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" type="primary">提交</a-button>
    </template>
    <template slot="footer" v-if="disableSubmit == true">
      <a-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
    </template>
    <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal>
  </a-modal>
</template>
<script>
  import pick from 'lodash.pick'
  import JSelectToolingModal from './JSelectToolingModal'
  import moment from 'moment'
  import { getAction, postAction, requestPut } from '@/api/manage'
  import JDictSelectTag from '@/components/dict/JDictSelectTag'
  import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
  import { filterObj } from '@/utils/util'
  import store from '@/store/'
  export default {
    name: 'CuttingInboundModal',
    components: {
    JSelectToolingModal,
    JMultiSelectTag,
    JDictSelectTag,
    store,
    moment,
  },
    data () {
      return {
         /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      title:'新增',
         visible: false,
         selectedRowKeys: {},
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      loading: false,
      form: this.$form.createForm(this),
      dataSource: [],
      param: {},
      validatorRules: {
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '刀具编码',
          align: 'center',
          dataIndex: 'cuttingCode',
          width: 150,
        },
        {
          title: '刀具名称',
          align: 'center',
          dataIndex: 'cuttingName',
        },
        {
          title: '工件材质',
          align: 'center',
          dataIndex: 'workpieceMaterial',
          scopedSlots: { customRender: 'workpieceMaterial' },
        },
        {
          title: '使用寿命',
          align: 'center',
          dataIndex: 'usedLife',
          scopedSlots: { customRender: 'usedLife' },
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
      ],
      url: {
        add: '/cms/cuttingReceive/add',
        detailList: '/cms/cuttingReceive/detailList',
      },
      orderId:'',
      disableSubmit:false
      }
    },
    methods: {
      modalFormOk(){
      },
       getQueryParams() {
      this.param.pageNo = this.ipagination.current
      this.param.pageSize = this.ipagination.pageSize
      return filterObj(this.param)
    },
      add() {
      let receiver = store.getters.userInfo.id
      let receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
      this.edit({ receiver: receiver, receiveTime: receiveTime })
    },
    edit(record) {
      record.receiver = store.getters.userInfo.id
      record.receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
      this.form.resetFields()
      this.model = Object.assign({}, record)
      this.visible = true
      this.disableSubmit = false
      if (record.id) {
        this.orderId = record.id
        this.detailList(this.orderId)
      }
      this.$nextTick(() => {
        this.form.setFieldsValue(
          pick(this.model, 'receiver', 'receiveTime', 'receiveComment', 'confirmer', 'confirmTime', 'confirmComment'
            , 'returnFlag', 'returnTime', 'returnComment', 'returnConfirmer', 'returnConfirmTime', 'returnConfirmComment')
        )
      })
    },
     handleDelete(record, index) {
      this.dataSource.splice(index, 1)
    },
    handleChange(value, key, column, index) {
      //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index
      const temp = [...this.dataSource]
      const target = temp.filter((item) => key === item.key)[index]
      if (target) {
        target[column.dataIndex] = value
        this.dataSource = temp
      }
    },
    selectTooling: function () {
      let ids = []
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].cuttingId)
      }
      this.$refs.toolingModalForm.showModal(ids)
      this.$refs.toolingModalForm.title = '选择刀具'
      this.$refs.toolingModalForm.disableSubmit = false
    },
    detailList(orderId) {
      this.param.orderId = orderId
      getAction(this.url.detailList, this.getQueryParams()).then((res) => {
        if (res.success) {
          this.dataSource = res.result
        }
      })
    },
    filterOption(input, option) {
      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
    },
    handleOk() {
      if (this.dataSource.length == 0) {
        this.$message.error('请先选择入库刀具')
        return
      }
      const that = this
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = Object.assign(this.model, values)
          formData.detailData = this.dataSource
          postAction(that.url.add, formData)
            .then((res) => {
              if (res.success) {
                that.$message.success('领用成功')
                that.$emit('ok', new Date())
              } else {
                that.$message.warning(res.message)
              }
            })
            .finally(() => {
              that.confirmLoading = false
              that.close()
            })
        }
      })
    },
    handleCancel() {
      this.close()
    },
    close() {
      this.$emit('close')
      this.dataSource = []
      this.visible = false
      this.disableSubmit = false
    },
    },
    mounted() {
    this.$bus.$on('selectionRows', (data) => {
      //getCurrSelected äº‹ä»¶ æŽ¥æ”¶ç»„件传递的参数
      for (let i = 0; i < data.length; i++) {
        this.dataSource.push({
          cuttingId: data[i].id,
          cuttingCode: data[i].cuttingCode,
          cuttingName: data[i].cuttingName
        })
      }
    })
  },
  }
</script>
src/views/cms/modules/CuttingScrapDetailForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,114 @@
<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="cuttingId">
              <a-input v-model="model.cuttingId" 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: 'CuttingScrapDetailForm',
    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: "/cms/cuttingScrapDetail/add",
          edit: "/cms/cuttingScrapDetail/edit",
          queryById: "/cms/cuttingScrapDetail/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/cms/modules/CuttingScrapDetailModal.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="关闭">
    <cutting-scrap-detail-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cutting-scrap-detail-form>
  </j-modal>
</template>
<script>
  import CuttingScrapDetailForm from './CuttingScrapDetailForm'
  export default {
    name: 'CuttingScrapDetailModal',
    components: {
      CuttingScrapDetailForm
    },
    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/cms/modules/CuttingScrapForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,139 @@
<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="delFlag">
              <a-input-number v-model="model.delFlag" placeholder="请输入删除标记" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <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-input v-model="model.applicationComment" placeholder="请输入申请说明"  ></a-input>
            </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-spin>
</template>
<script>
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: 'CuttingScrapForm',
    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: "/cms/cuttingScrap/add",
          edit: "/cms/cuttingScrap/edit",
          queryById: "/cms/cuttingScrap/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/cms/modules/CuttingScrapModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,310 @@
<template>
  <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel">
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="申请人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择申请人"
                v-decorator="['applicant', { rules: [{ required: true, message: '请选择申请人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="申请日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['applicationTime', validatorRules.applicationTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="申请说明" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入申请说明" v-decorator="['applicationComment', validatorRules.applicationComment]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择确认人"
                v-decorator="['confirmer', { rules: [{ required: false, message: '请选择确认人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="确认日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['confirmTime', validatorRules.confirmTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="确认意见" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入确认意见" v-decorator="['confirmComment', validatorRules.confirmComment]" />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()"
      >选择刀具</a-button
    >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
    >
      <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index">
        <div :key="col.dataIndex">
         <a-input
                    :value="text"
                    :disabled="disableSubmit"
                    v-if="col.dataIndex == 'newCuttingId'"
                    @change="(e)=>handleChange(e.target.value, record.key, col, index)"
                  />
        </div>
      </template>
      <span slot="action" 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" type="primary">提交</a-button>
    </template>
    <template slot="footer" v-if="disableSubmit == true">
      <a-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
    </template>
    <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal>
  </a-modal>
</template>
<script>
  import pick from 'lodash.pick'
  import JSelectToolingModal from './JSelectToolingModal'
  import moment from 'moment'
  import { getAction, postAction, requestPut } from '@/api/manage'
  import JDictSelectTag from '@/components/dict/JDictSelectTag'
  import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
  import { filterObj } from '@/utils/util'
  import store from '@/store/'
  export default {
    name: 'CuttingInboundModal',
    components: {
    JSelectToolingModal,
    JMultiSelectTag,
    JDictSelectTag,
    store,
    moment,
  },
    data () {
      return {
         /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      title:'新增',
         visible: false,
         selectedRowKeys: {},
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      loading: false,
      form: this.$form.createForm(this),
      dataSource: [],
      param: {},
      validatorRules: {
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '刀具编码',
          align: 'center',
          dataIndex: 'cuttingCode',
          width: 150,
        },
        {
          title: '刀具名称',
          align: 'center',
          dataIndex: 'cuttingName',
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
      ],
      url: {
        add: '/cms/cuttingScrap/add',
        detailList: '/cms/cuttingScrap/detailList',
      },
      orderId:'',
      disableSubmit:false
      }
    },
    methods: {
      modalFormOk(){
      },
       getQueryParams() {
      this.param.pageNo = this.ipagination.current
      this.param.pageSize = this.ipagination.pageSize
      return filterObj(this.param)
    },
      add() {
      let applicant = store.getters.userInfo.id
      let applicationTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
      this.edit({ applicant: applicant, applicationTime: applicationTime })
    },
    edit(record) {
      record.applicant = store.getters.userInfo.id
      record.applicationTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
      this.form.resetFields()
      this.model = Object.assign({}, record)
      this.visible = true
      this.disableSubmit = false
      if (record.id) {
        this.orderId = record.id
        this.detailList(this.orderId)
      }
      this.$nextTick(() => {
        this.form.setFieldsValue(
          pick(this.model, 'applicant', 'applicationTime', 'applicationComment', 'confirmer', 'confirmTime', 'confirmComment')
        )
      })
    },
     handleDelete(record, index) {
      this.dataSource.splice(index, 1)
    },
    handleChange(value, key, column, index) {
      //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index
      const temp = [...this.dataSource]
      const target = temp.filter((item) => key === item.key)[index]
      if (target) {
        target[column.dataIndex] = value
        this.dataSource = temp
      }
    },
    selectTooling: function () {
      let ids = []
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].cuttingId)
      }
      this.$refs.toolingModalForm.showModal(ids)
      this.$refs.toolingModalForm.title = '选择刀具'
      this.$refs.toolingModalForm.disableSubmit = false
    },
    detailList(orderId) {
      this.param.orderId = orderId
      getAction(this.url.detailList, this.getQueryParams()).then((res) => {
        if (res.success) {
          this.dataSource = res.result
        }
      })
    },
    filterOption(input, option) {
      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
    },
    handleOk() {
      if (this.dataSource.length == 0) {
        this.$message.error('请先选择报废刀具')
        return
      }
      const that = this
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = Object.assign(this.model, values)
          formData.detailData = this.dataSource
          postAction(that.url.add, formData)
            .then((res) => {
              if (res.success) {
                that.$message.success('报废成功')
                that.$emit('ok', new Date())
              } else {
                that.$message.warning(res.message)
              }
            })
            .finally(() => {
              that.confirmLoading = false
              that.close()
            })
        }
      })
    },
    handleCancel() {
      this.close()
    },
    close() {
      this.$emit('close')
      this.dataSource = []
      this.visible = false
      this.disableSubmit = false
    },
    },
    mounted() {
    this.$bus.$on('selectionRows', (data) => {
      //getCurrSelected äº‹ä»¶ æŽ¥æ”¶ç»„件传递的参数
      for (let i = 0; i < data.length; i++) {
        this.dataSource.push({
          cuttingId: data[i].id,
          cuttingCode: data[i].cuttingCode,
          cuttingName: data[i].cuttingName
        })
      }
    })
  },
  }
</script>
src/views/cms/modules/CuttingToolModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,434 @@
<template>
  <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel">
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="刀具编码">
              <a-input :disabled="disableSubmit" placeholder="请输入刀具编码" v-decorator="['cuttingCode', validatorRules.cuttingCode]" />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="刀具名称">
              <a-input :disabled="disableSubmit" placeholder="请输入刀具名称" v-decorator="['cuttingName', validatorRules.cuttingName]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="刀具分类">
              <j-search-select-tag
                :disabled="isEdit"
                placeholder="请选择刀具分类"
                v-decorator="['cuttingCategory', validatorRules.cuttingCategory]"
                dict="cutting_category"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item label="存放位置" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit" placeholder="请输入存放位置" v-decorator="['storeLocation', validatorRules.storeLocation]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit" placeholder="请输入供应商" v-decorator="['supplierId', validatorRules.supplierId]" />
            </a-form-item>
          </a-col>
           <a-col :span="24 / 2">
            <a-form-item label="最小包装单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit" placeholder="请输入最小包装单位" v-decorator="['minimumPackageUnit', validatorRules.minimumPackageUnit]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item label="刀具材质" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit" placeholder="请输入刀具材质" v-decorator="['cuttingMaterial', validatorRules.cuttingMaterial]" />
            </a-form-item>
          </a-col>
           <a-col :span="24 / 2">
            <a-form-item label="型号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit" placeholder="请输入型号" v-decorator="['cuttingModel', validatorRules.cuttingModel]" />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item label="图号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit" placeholder="请输入图号" v-decorator="['drawingNumber', validatorRules.drawingNumber]" />
            </a-form-item>
          </a-col>
           <a-col :span="24 / 2">
            <a-form-item label="库存预警值" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input-number :disabled="disableSubmit" style="width: 100%" :min=1 placeholder="请输入库存预警值" v-decorator="['inventoryWarning', validatorRules.inventoryWarning]" />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="备注" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入备注" v-decorator="['remark', validatorRules.remark]" />
            </a-form-item>
          </a-col>
        </a-row>
        <!-- å­è¡¨æ ¼ä¿¡æ¯-->
        <a-tabs defaultActiveKey="1">
          <a-tab-pane
            tab="刀具明细"
            key="1"
          >
            <a-table
              ref="table"
              bordered
              size="middle"
              rowKey="id"
              :columns="columns"
              :dataSource="dataSource"
              :pagination=false
            >
              <template
                v-for="col in columns"
                :slot="col.dataIndex"
                slot-scope='text, record, index'
              >
                <div :key="col.dataIndex">
                  <a-input
                    :value="text"
                    :disabled="disableSubmit"
                    v-if="col.dataIndex == 'propertyCode'"
                    @change="(e)=>handleChange(e.target.value, record.key, col, index)"
                  />
                  <a-input
                    :value="text"
                    :disabled="disableSubmit"
                    v-else-if="col.dataIndex == 'propertyName'"
                    @change="(e)=>handleChange(e.target.value, record.key, col, index)"
                  />
                  <a-input
                    :value="text"
                    :disabled="disableSubmit"
                    v-else-if="col.dataIndex == 'propertyUnit'"
                    @change="(e)=>handleChange(e.target.value, record.key, col, index)"
                  />
                  <a-input
                    :value="text"
                    :disabled="disableSubmit"
                    v-else-if="col.dataIndex == 'propertyValue'"
                    @change="(e)=>handleChange(e.target.value, record.key, col, index)"
                  />
                </div>
              </template>
              <template
                slot="action"
                slot-scope="text,record,index"
              >
                <a-popconfirm
                  title="是否要删除此行?"
                  @confirm="handleDelete(text,record,index)"
                >
                  <Tooltip
                    placement="top"
                    title="删除"
                  >
                    <!-- shape="circle" -->
                    <a-button
                      :disabled="disableSubmit"
                      icon="delete"
                    />
                  </Tooltip>
                </a-popconfirm>
              </template>
            </a-table>
            <a-button
              :disabled="disableSubmit"
              style="width: 100%; margin-top: 16px; margin-bottom: 8px"
              type="dashed"
              icon="plus"
              @click="addPropertiesList"
            >添加扩展属性</a-button>
          </a-tab-pane>
        </a-tabs>
        <!-- å­è¡¨æ ¼ä¿¡æ¯ç»“束-->
      </a-form>
    </a-spin>
    <template slot="footer" v-if="disableSubmit == false">
      <a-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
      <a-button @click="handleOk" :disabled="isDisabled" type="primary">提交</a-button>
    </template>
    <template slot="footer" v-if="disableSubmit == true">
      <a-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
    </template>
  </a-modal>
</template>
<script>
import pick from 'lodash.pick'
import { ajaxGetDictItems } from '@/api/api'
import moment from 'moment'
import { getAction, postAction, requestPut } from '@/api/manage'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
import { filterObj } from '@/utils/util'
import store from '@/store/'
export default {
  name: 'CuttingToolModel',
  components: {
    JMultiSelectTag,
    JDictSelectTag,
    store,
    moment,
  },
  data() {
    return {
      /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      isDisabled: false,
      selectedRowKeys: {},
      state: {
        show: false,
        maintenanceValue: 1,
        checkValue: 1,
        maintenanceState: false,
        checkState: false,
      },
      disableSubmit: false,
      title: '操作',
      visible: false,
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      loading: false,
      form: this.$form.createForm(this),
      dataSource: [],
      param: {},
      validatorRules: {
        cuttingCode: {
          rules: [
            {
              required: true,
              message: '请输入刀具编码!',
            },
          ],
        },
        cuttingName: {
          rules: [
            {
              required: true,
              message: '请输入刀具名称!',
            },
          ],
        },
        cuttingCategory: {
          rules: [
            {
              required: true,
              message: '请选择刀具分类!',
            },
          ],
        },
      },
      url: {
        add: '/cms/cuttingTool/add',
        edit: '/cms/cuttingTool/edit',
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '属性编码',
          align: 'center',
          dataIndex: 'propertyCode',
          width: 150,
          scopedSlots: { customRender: 'propertyCode' },
        },
        {
          title: '属性名称',
          align: 'center',
          dataIndex: 'propertyName',
          scopedSlots: { customRender: 'propertyName' },
        },
        {
          title: '属性单位',
          align: 'center',
          dataIndex: 'propertyUnit',
          scopedSlots: { customRender: 'propertyUnit' },
        },
        {
          title: '属性值',
          align: 'center',
          dataIndex: 'propertyValue',
          scopedSlots: { customRender: 'propertyValue' },
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
      ],
      cuttingId:'',
      deletePropertiesIds: [],
    }
  },
  created() {
  },
  methods: {
    add() {
      this.edit()
    },
    edit(record) {
      this.form.resetFields()
      this.model = Object.assign({}, record)
      this.visible = true
      if (record.id) {
        this.dataSource = record.cuttingPropertiesList
      }
      this.$nextTick(() => {
        this.form.setFieldsValue(
          pick(this.model, 'cuttingCode', 'cuttingName', 'cuttingCategory', 'storeLocation','cuttingModel', 'supplierId', 'minimumPackageUnit',
          'cuttingMaterial','drawingNumber','inventoryWarning','remark')
        )
      })
    },
    handleChange(value, key, column, index) {
      const temp = [...this.dataSource]
      const target = temp.filter((item) => key === item.key)[index]
      if (target) {
        target[column.dataIndex] = value
        this.dataSource = temp
      }
    },
    close() {
      this.$emit('close')
      this.dataSource = []
      this.visible = false
      this.disableSubmit = false
    },
    handleDelete(text, record, index) {
      this.dataSource.splice(index, 1);
      if (undefined != record.id) {
        this.deletePropertiesIds.push(record.id);
      }
    },
    handleOk() {
      const that = this
      let dataSource = that.dataSource;
      let deletePropertiesIds = this.deletePropertiesIds;
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let formData = Object.assign(this.model, values);
          formData.cuttingPropertiesList = dataSource;
          formData.deletePropertiesIds = deletePropertiesIds;
          let obj;
          if (!this.model.id) {
            obj = postAction(this.url.add, formData);
          } else {
            obj = requestPut(this.url.edit, formData, { id: this.model.id });
          }
          obj.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();
          })
        }
      }).catch((e) => { })
    },
    handleCancel() {
      this.close()
    },
    //添加扩展属性
    addPropertiesList() {
      const temp = [...(this.dataSource || [])]
      temp.push({})
      this.dataSource = temp
    },
    filterOption(input, option) {
      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
    },
  },
  watch: {},
  computed: {
  },
  mounted() {
  },
}
</script>
<style  lang="less" scoped>
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
/** ä¸»è¡¨å•行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
/deep/ .notshow {
  display: none;
}
</style>
src/views/cms/modules/EdgeGrindingDetailForm.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="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="cuttingId">
              <a-input v-model="model.cuttingId" 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="新刀具ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="newCuttingId">
              <a-input v-model="model.newCuttingId" 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="newInventoryId">
              <a-input v-model="model.newInventoryId" 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: 'EdgeGrindingDetailForm',
    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: "/cms/edgeGrindingDetail/add",
          edit: "/cms/edgeGrindingDetail/edit",
          queryById: "/cms/edgeGrindingDetail/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/cms/modules/EdgeGrindingDetailModal.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="关闭">
    <edge-grinding-detail-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></edge-grinding-detail-form>
  </j-modal>
</template>
<script>
  import EdgeGrindingDetailForm from './EdgeGrindingDetailForm'
  export default {
    name: 'EdgeGrindingDetailModal',
    components: {
      EdgeGrindingDetailForm
    },
    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/cms/modules/EdgeGrindingForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,164 @@
<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="delFlag">
              <a-input-number v-model="model.delFlag" placeholder="请输入删除标记" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <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-input v-model="model.applicationComment" placeholder="请输入申请说明"  ></a-input>
            </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-col :span="24">
            <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="24">
            <a-form-model-item label="归还说明" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnComment">
              <a-input v-model="model.returnComment" placeholder="请输入归还说明"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <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="24">
            <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="24">
            <a-form-model-item label="归还确认意见" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmComment">
              <a-input v-model="model.returnConfirmComment" 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: 'EdgeGrindingForm',
    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: "/cms/edgeGrinding/add",
          edit: "/cms/edgeGrinding/edit",
          queryById: "/cms/edgeGrinding/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/cms/modules/EdgeGrindingModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,362 @@
<template>
  <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel">
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="申请人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择申请人"
                v-decorator="['applicant', { rules: [{ required: true, message: '请选择申请人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="申请日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['applicationTime', validatorRules.applicationTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="申请说明" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入申请说明" v-decorator="['applicationComment', validatorRules.applicationComment]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择确认人"
                v-decorator="['confirmer', { rules: [{ required: false, message: '请选择确认人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="确认日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['confirmTime', validatorRules.confirmTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="确认意见" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入确认意见" v-decorator="['confirmComment', validatorRules.confirmComment]" />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="归还日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['returnTime', validatorRules.returnTime]"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item label="归还说明" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入归还说明" v-decorator="['returnComment', validatorRules.returnComment]" />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
           <a-col :span="24 / 2">
            <a-form-item label="归还确认人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="disableSubmit"
                placeholder="请选择归还确认人"
                v-decorator="['returnConfirmer', { rules: [{ required: false, message: '请选择归还确认人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="归还确认日期">
              <a-date-picker
                :disabled="disableSubmit"
                style="width: 100%"
                v-decorator="['returnConfirmTime', validatorRules.returnConfirmTime]"
              />
            </a-form-item>
          </a-col>
        </a-row>
         <a-row style="width: 100%">
          <a-col :span="24">
            <a-form-item label="归还确认意见" :labelCol="{span:3}" :wrapperCol="{span:21}">
              <a-textarea :disabled="disableSubmit" placeholder="请输入归还确认意见" v-decorator="['returnConfirmComment', validatorRules.returnConfirmComment]" />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()"
      >选择刀具</a-button
    >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
    >
      <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index">
        <div :key="col.dataIndex">
         <a-input
                    :value="text"
                    :disabled="disableSubmit"
                    v-if="col.dataIndex == 'newCuttingId'"
                    @change="(e)=>handleChange(e.target.value, record.key, col, index)"
                  />
        </div>
      </template>
      <span slot="action" 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" type="primary">提交</a-button>
    </template>
    <template slot="footer" v-if="disableSubmit == true">
      <a-button :style="{ marginRight: '8px' }" @click="handleCancel">关闭</a-button>
    </template>
    <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal>
  </a-modal>
</template>
<script>
  import pick from 'lodash.pick'
  import JSelectToolingModal from './JSelectToolingModal'
  import moment from 'moment'
  import { getAction, postAction, requestPut } from '@/api/manage'
  import JDictSelectTag from '@/components/dict/JDictSelectTag'
  import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
  import { filterObj } from '@/utils/util'
  import store from '@/store/'
  export default {
    name: 'CuttingInboundModal',
    components: {
    JSelectToolingModal,
    JMultiSelectTag,
    JDictSelectTag,
    store,
    moment,
  },
    data () {
      return {
         /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      title:'新增',
         visible: false,
         selectedRowKeys: {},
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      loading: false,
      form: this.$form.createForm(this),
      dataSource: [],
      param: {},
      validatorRules: {
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '刀具编码',
          align: 'center',
          dataIndex: 'cuttingCode',
          width: 150,
        },
        {
          title: '刀具名称',
          align: 'center',
          dataIndex: 'cuttingName',
        },
        {
          title: '新刀具编码',
          align: 'center',
          dataIndex: 'newCuttingId',
          scopedSlots: { customRender: 'newCuttingId' },
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
      ],
      url: {
        add: '/cms/edgeGrinding/add',
        detailList: '/cms/edgeGrinding/detailList',
      },
      orderId:'',
      disableSubmit:false
      }
    },
    methods: {
      modalFormOk(){
      },
       getQueryParams() {
      this.param.pageNo = this.ipagination.current
      this.param.pageSize = this.ipagination.pageSize
      return filterObj(this.param)
    },
      add() {
      let applicant = store.getters.userInfo.id
      let applicationTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
      this.edit({ applicant: applicant, applicationTime: applicationTime })
    },
    edit(record) {
      record.applicant = store.getters.userInfo.id
      record.applicationTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
      this.form.resetFields()
      this.model = Object.assign({}, record)
      this.visible = true
      this.disableSubmit = false
      if (record.id) {
        this.orderId = record.id
        this.detailList(this.orderId)
      }
      this.$nextTick(() => {
        this.form.setFieldsValue(
          pick(this.model, 'applicant', 'applicationTime', 'applicationComment', 'confirmer', 'confirmTime', 'confirmComment'
            , 'returnFlag', 'returnTime', 'returnComment', 'returnConfirmer', 'returnConfirmTime', 'returnConfirmComment')
        )
      })
    },
     handleDelete(record, index) {
      this.dataSource.splice(index, 1)
    },
    handleChange(value, key, column, index) {
      //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index
      const temp = [...this.dataSource]
      const target = temp.filter((item) => key === item.key)[index]
      if (target) {
        target[column.dataIndex] = value
        this.dataSource = temp
      }
    },
    selectTooling: function () {
      let ids = []
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].cuttingId)
      }
      this.$refs.toolingModalForm.showModal(ids)
      this.$refs.toolingModalForm.title = '选择刀具'
      this.$refs.toolingModalForm.disableSubmit = false
    },
    detailList(orderId) {
      this.param.orderId = orderId
      getAction(this.url.detailList, this.getQueryParams()).then((res) => {
        if (res.success) {
          this.dataSource = res.result
        }
      })
    },
    filterOption(input, option) {
      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
    },
    handleOk() {
      if (this.dataSource.length == 0) {
        this.$message.error('请先选择修磨刀具')
        return
      }
      const that = this
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = Object.assign(this.model, values)
          formData.detailData = this.dataSource
          postAction(that.url.add, formData)
            .then((res) => {
              if (res.success) {
                that.$message.success('修磨发起成功')
                that.$emit('ok', new Date())
              } else {
                that.$message.warning(res.message)
              }
            })
            .finally(() => {
              that.confirmLoading = false
              that.close()
            })
        }
      })
    },
    handleCancel() {
      this.close()
    },
    close() {
      this.$emit('close')
      this.dataSource = []
      this.visible = false
      this.disableSubmit = false
    },
    },
    mounted() {
    this.$bus.$on('selectionRows', (data) => {
      //getCurrSelected äº‹ä»¶ æŽ¥æ”¶ç»„件传递的参数
      for (let i = 0; i < data.length; i++) {
        this.dataSource.push({
          cuttingId: data[i].id,
          cuttingCode: data[i].cuttingCode,
          cuttingName: data[i].cuttingName
        })
      }
    })
  },
  }
</script>
src/views/cms/modules/JSelectToolingModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,242 @@
<template>
  <!--支持全屏缩放-->
  <j-modal
    :visible="visible"
    :title="title"
    switchFullscreen
    :width="1200"
    @ok="handleSubmit"
    @cancel="close"
    style="top: 50px"
    cancelText="关闭"
  >
    <a-card :bordered="false">
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="刀具编码">
                <a-input placeholder="请输入刀具编码,支持模糊查询" v-model="queryParam.cuttingCode"></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.cuttingName"></a-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"
        :scroll="scrollTrigger"
        size="middle"
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :rowSelection="rowSelection"
        :loading="loading"
        @change="handleTableChange"
      >
      </a-table>
    </a-card>
  </j-modal>
</template>
<script>
import { filterObj } from '@/utils/util'
import { getAction } from '@/api/manage'
export default {
  name: 'JSelectToolingModal',
  components: {},
  props: {},
  data() {
    return {
      queryParam: {},
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '刀具编码',
          align: 'center',
          dataIndex: 'cuttingCode',
          sorter: true,
        },
        {
          title: '刀具名称',
          align: 'center',
          dataIndex: 'cuttingName',
          sorter: true,
        },
        {
          title: '刀具分类',
          align: 'center',
          dataIndex: 'cuttingCategory',
          sorter: true,
        },
      ],
      selectedRowKeys: [],
      oldSlelectRows: [],
      scrollTrigger: {},
      dataSource: [],
      selectionRows: [],
      title: '根据查询结果选择刀具',
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['5', '10', '20'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      isorter: {
        column: 'num',
        order: 'desc',
      },
      departTree: [],
      visible: false,
      loading: false,
      url: {
         list: '/cms/cuttingTool/getCuttingToolList',
      },
    }
  },
  computed: {
    rowSelection() {
      return {
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.onSelectChange(selectedRows)
        },
        getCheckboxProps: (record) => ({
          props: {
            disabled: record.distable,
          },
        }),
        selectedRowKeys: this.selectedRowKeys,
      }
    },
  },
  watch: {},
  created() {},
  methods: {
    async loadData(arg) {
      if (arg === 1) {
        this.ipagination.current = 1
      }
      let that = this
      this.loading = true
      let params = this.getQueryParams() //查询条件
      await getAction(this.url.list, params).then((res) => {
        if (res.success) {
          for (let i = 0; i < res.result.records.length; i++) {
            if (that.oldSlelectRows.indexOf(res.result.records[i].id) > -1) {
              res.result.records[i].distable = true
            } else {
              res.result.records[i].distable = false
            }
          }
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
    showModal(oldSlelectRows) {
      this.oldSlelectRows = oldSlelectRows
      this.visible = true
      this.loadData(1)
    },
    getQueryParams() {
      let param = Object.assign({}, this.queryParam, this.isorter)
      param.field = this.getQueryField()
      param.pageNo = this.ipagination.current
      param.pageSize = this.ipagination.pageSize
      return filterObj(param)
    },
    //查询条件处理
    getQueryField() {
      let str = 'id,'
      for (let a = 0; a < this.columns.length; a++) {
        str += ',' + this.columns[a].dataIndex
      }
      return str
    },
    searchReset(num) {
      let that = this
      if (num !== 0) {
        that.loadData(1)
      }
      that.selectborrowIds = []
    },
    close() {
      this.searchReset(0)
      this.selectedRowKeys = []
      this.visible = false
    },
    handleTableChange(pagination, filters, sorter) {
      //TODO ç­›é€‰
      if (Object.keys(sorter).length > 0) {
        this.isorter.column = sorter.field
        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
      }
      this.ipagination = pagination
      this.loadData()
    },
    handleSubmit() {
      this.$bus.$emit('selectionRows', this.selectionRows)
      this.searchReset(0)
      this.close()
    },
    onSelectChange(selectionRows) {
      this.selectionRows = selectionRows
    },
    onSearch() {
      this.loadData(1)
    },
     searchQuery() {
      this.loadData(1);
    },
    searchReset() {
      this.queryParam = {}
      this.loadData(1)
    },
  },
}
</script>
<style scoped>
.ant-table-tbody .ant-table-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}
#components-layout-demo-custom-trigger .trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}
</style>
src/views/cms/modules/RatedLifeForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,114 @@
<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="cuttingId">
              <a-input v-model="model.cuttingId" placeholder="请输入刀具编码"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="工件材质" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workpieceMaterial">
              <a-input v-model="model.workpieceMaterial" placeholder="请输入工件材质"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="额定寿命" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ratedLife">
              <a-input-number v-model="model.ratedLife" 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: 'RatedLifeForm',
    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: "/cms/ratedLife/add",
          edit: "/cms/ratedLife/edit",
          queryById: "/cms/ratedLife/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/cms/modules/RatedLifeModal.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="关闭">
    <rated-life-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rated-life-form>
  </j-modal>
</template>
<script>
  import RatedLifeForm from './RatedLifeForm'
  export default {
    name: 'RatedLifeModal',
    components: {
      RatedLifeForm
    },
    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/cms/modules/ToolStocktakingDetailForm.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="刀具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>
    </j-form-container>
  </a-spin>
</template>
<script>
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: 'ToolStocktakingDetailForm',
    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: "/cms/toolStocktakingDetail/add",
          edit: "/cms/toolStocktakingDetail/edit",
          queryById: "/cms/toolStocktakingDetail/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/cms/modules/ToolStocktakingDetailModal.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="关闭">
    <tool-stocktaking-detail-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tool-stocktaking-detail-form>
  </j-modal>
</template>
<script>
  import ToolStocktakingDetailForm from './ToolStocktakingDetailForm'
  export default {
    name: 'ToolStocktakingDetailModal',
    components: {
      ToolStocktakingDetailForm
    },
    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/cms/modules/ToolStocktakingForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,129 @@
<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="delFlag">
              <a-input-number v-model="model.delFlag" placeholder="请输入删除标记" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <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="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="operator">
              <a-input v-model="model.operator" placeholder="请输入盘点人"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <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="24">
            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
              <a-input v-model="model.remark" 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: 'ToolStocktakingForm',
    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: "/cms/toolStocktaking/add",
          edit: "/cms/toolStocktaking/edit",
          queryById: "/cms/toolStocktaking/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/cms/modules/ToolStocktakingInventoryChangeForm.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: 'ToolStocktakingInventoryChangeForm',
    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: "/cms/toolStocktakingInventoryChange/add",
          edit: "/cms/toolStocktakingInventoryChange/edit",
          queryById: "/cms/toolStocktakingInventoryChange/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/cms/modules/ToolStocktakingInventoryChangeModal.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="关闭">
    <tool-stocktaking-inventory-change-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tool-stocktaking-inventory-change-form>
  </j-modal>
</template>
<script>
  import ToolStocktakingInventoryChangeForm from './ToolStocktakingInventoryChangeForm'
  export default {
    name: 'ToolStocktakingInventoryChangeModal',
    components: {
      ToolStocktakingInventoryChangeForm
    },
    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/cms/modules/ToolStocktakingModal.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="关闭">
    <tool-stocktaking-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tool-stocktaking-form>
  </j-modal>
</template>
<script>
  import ToolStocktakingForm from './ToolStocktakingForm'
  export default {
    name: 'ToolStocktakingModal',
    components: {
      ToolStocktakingForm
    },
    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>