cuilei
8 小时以前 665c1372ff732ba6b5ae23e2c92d52b76cdf2beb
Merge remote-tracking branch 'origin/master'
已添加1个文件
已修改4个文件
248 ■■■■ 文件已修改
src/views/cms/CuttingInboundList.vue 183 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingList.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingToolList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/RatedLifeList.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/RatedLifeForm.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingInboundList.vue
@@ -51,10 +51,10 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <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-button type="primary" icon="download" @click="handleExportXls('刀具入库单')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload> -->
      </a-upload>
    </div>
    <!-- table区域-begin -->
@@ -128,6 +128,9 @@
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
@@ -135,6 +138,10 @@
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import CuttingInboundModal from './modules/CuttingInboundModal'
  import CuttingInboundDetailList from './CuttingInboundDetailList'
  import { downFile } from '@api/manage'
  import Vue from 'vue'
  import { ACCESS_TOKEN } from '@/store/mutation-types'
  import store from '@/store'
  export default {
@@ -198,7 +205,7 @@
          {
            title:'入库单状态',
            align:"center",
            dataIndex: 'orderStatus'
            dataIndex: 'orderStatus_dictText',
          },
          {
            title: '操作',
@@ -215,14 +222,15 @@
          deleteBatch: "/cms/cuttingInbound/deleteBatch",
          exportXlsUrl: "/cms/cuttingInbound/exportXls",
          importExcelUrl: "cms/cuttingInbound/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
      this.getSuperFieldList();
      // æ·»åŠ å­—å…¸æ•°æ®åŠ è½½
      this.initDictConfig();
    },
    computed: {
      importExcelUrl: function(){
@@ -234,43 +242,146 @@
      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')
      },
      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')
            }
              let children = e.target.parentNode.children
              for (let i = 0; i < children.length; i++) {
                children[i].classList.add('checked-td-of-add-table')
              }
            },
          },
        },
      }
    },
        }
      },
      handleExportXls(fileName){
        if(!fileName || typeof fileName != "string"){
          fileName = "导出文件"
        }
        let param = this.getQueryParams();
        if(this.selectedRowKeys && this.selectedRowKeys.length>0){
          param['selections'] = this.selectedRowKeys.join(",")
        }
        console.log("导出参数",param)
        downFile(this.url.exportXlsUrl,param).then((data)=>{
          if (!data) {
            // this.$message.warning("文件下载失败")
            this.$notification.warning({
              message:'消息',
              description:"文件下载失败"
            });
            return
          }
          if (typeof window.navigator.msSaveBlob !== 'undefined') {
            window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
          }else{
            let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
            let link = document.createElement('a')
            link.style.display = 'none'
            link.href = url
            link.setAttribute('download', fileName+'.xls')
            document.body.appendChild(link)
            link.click()
            document.body.removeChild(link); //下载完成移除元素
            window.URL.revokeObjectURL(url); //释放掉blob对象
          }
        })
      },
      /* å¯¼å…¥ */
      handleImportExcel(info){
        this.loading = true;
        if (info.file.status !== 'uploading') {
          console.log(info.file, info.fileList);
        }
        if (info.file.status === 'done') {
          this.loading = false;
          if (info.file.response.success) {
            // this.$message.success(`${info.file.name} æ–‡ä»¶ä¸Šä¼ æˆåŠŸ`);
            if (info.file.response.code === 201) {
              let { message, result: { msg, fileUrl, fileName } } = info.file.response
              let href = window._CONFIG['domianURL'] + fileUrl
              this.$warning({
                title: message,
                content: (<div>
                    <span>{msg}</span><br/>
                    <span>具体详情请 <a href={href} target="_blank" download={fileName}>点击下载</a> </span>
                  </div>
                )
              })
            } else {
              // this.$message.success(info.file.response.message || `${info.file.name} æ–‡ä»¶ä¸Šä¼ æˆåŠŸ`)
              this.$notification.success({
                message:'消息',
                description:info.file.response.message || `${info.file.name} æ–‡ä»¶ä¸Šä¼ æˆåŠŸ`
              });
            }
            this.loadData()
          } else {
            // this.$message.error(`${info.file.name} ${info.file.response.message}.`);
            this.$notification.error({
              message:'消息',
              description:`${info.file.name} ${info.file.response.message}.`
            });
          }
        } else if (info.file.status === 'error') {
          this.loading = false;
          if (info.file.response.status === 500) {
            let data = info.file.response
            const token = Vue.ls.get(ACCESS_TOKEN)
            if (token && data.message.includes("Token失效")) {
              this.$error({
                title: '登录已过期',
                content: '很抱歉,登录已过期,请重新登录',
                okText: '重新登录',
                mask: false,
                onOk: () => {
                  store.dispatch('Logout').then(() => {
                    Vue.ls.remove(ACCESS_TOKEN)
                    window.location.reload();
                  })
                }
              })
            }
          } else {
            // this.$message.error(`文件上传失败: ${info.file.msg} `);
            this.$notification.error({
              message:'消息',
              description:`文件上传失败: ${info.file.msg} `
            });
          }
        }
      },
    }
  }
</script>
src/views/cms/CuttingList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
<template >
  <a-card :bordered="false" :body-style="{ padding: '0 24px 24px 24px' }">
    <a-tabs default-active-key="1">
      <a-tab-pane key="1" tab="刀具信息">
        <cutting-tool-list ref="cuttingToolList"></cutting-tool-list>
      </a-tab-pane>
      <a-tab-pane key="2" tab="刀具库存">
        <cutting-inventory-list ref="cuttingInventoryList"></cutting-inventory-list>
      </a-tab-pane>
      <a-tab-pane key="3" tab="刀具额定寿命">
        <rated-life-list ref="RatedLifeList"></rated-life-list>
      </a-tab-pane>
    </a-tabs>
  </a-card>
</template>
<script>
import CuttingToolList from './CuttingToolList'
import CuttingInventoryList from './CuttingInventoryList'
import RatedLifeList from './RatedLifeList.vue'
export default {
  name: '刀具台账',
  components: {
    CuttingToolList,
    CuttingInventoryList,
    RatedLifeList,
  },
  data() {
    return {}
  },
  methods: {
    callback(key) {
      console.log('切换到页签:', key)
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/cms/CuttingToolList.vue
@@ -1,5 +1,5 @@
<template>
  <a-card :bordered="false">
  <a-card :bordered="false" >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
src/views/cms/RatedLifeList.vue
@@ -43,10 +43,10 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <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-button type="primary" icon="download" @click="handleExportXls('额定寿命')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload> -->
      </a-upload>
    </div>
    <!-- table区域-begin -->
@@ -147,7 +147,8 @@
          {
            title:'刀具编码',
            align:"center",
            dataIndex: 'cuttingId'
            dataIndex: 'cuttingId',
            sorter: true
          },
          {
            title:'工件材质',
@@ -174,7 +175,7 @@
          deleteBatch: "/cms/ratedLife/deleteBatch",
          exportXlsUrl: "/cms/ratedLife/exportXls",
          importExcelUrl: "cms/ratedLife/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
src/views/cms/modules/RatedLifeForm.vue
@@ -5,7 +5,14 @@
        <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-input v-model="model.cuttingId" placeholder="请输入刀具编码"  ></a-input>-->
              <j-search-select-tag
                placeholder="请选择刀具编码"
                v-model="model.cuttingId"
                :remoteSearch="true"
                :async="true"
                dict="cms_cutting_tool,cutting_code,cutting_code"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
@@ -106,7 +113,7 @@
              that.confirmLoading = false;
            })
          }
        })
      },
    }