Fixiaobai
2023-10-31 54d5ec8ed84113f7d928c4b6e86bc9d640bffc71
src/views/basic/part/index.vue
@@ -5,6 +5,10 @@
        :prelang="prelang" :options="options" :bottomOffset="125" :ajaxFun="ajaxFun" ref="partTable">
        <template #toolbar></template>
      </ttable>
      <el-upload :headers="{'Authorization': 'Bearer ' + yourToken}" class="upload-demo" action="/mes/part/uploadExcel" :on-preview="handlePreview"
        :on-remove="handleRemove" :file-list="fileList" :on-success="fileUpload"  :limit="1">
        <el-button size="small" type="primary">点击Excel导入</el-button>
      </el-upload>
      <!-- 弹窗, 新增 / 修改 -->
      <table-form v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getData"></table-form>
      <PrintLabelForm :currshowlist.sync="showPrintLabelForm" :printLabelInfo="printLabelInfo" />
@@ -33,16 +37,18 @@
import { mapGetters } from 'vuex'
import ttable from '@/views/common/ztt-table.vue'
import { remote } from '../../../api/admin/dict'
import { dateFormat,dateFormatYearMonthDate,dateFormatPlus } from '@/util/date'
import { dateFormat, dateFormatYearMonthDate, dateFormatPlus } from '@/util/date'
import PrintLabelForm from './print-label-form.vue'
export default {
  data() {
    return {
      fileList: [],
      selectDate: "",
      dialogVisible: false,
      ajaxFun: fetchList,
      addOrUpdateVisible: false,
      multipleSelection: [],
      yourToken: "",
      uploadInfo: {
        // 是否展示上传EXCEL以及对应的url
        isShow: true,
@@ -357,23 +363,29 @@
          }
        ],
        toolbar: [
          {
            text: '新增',
            type: 'primary',
            fun: this.addOrUpdateHandle
          },
          {
            text: '获取IFS零件',
            type: 'primary',
            fun: this.syncISDate,
            loading: false
          },
          {
            text: '大标签',
            type: 'primary',
            fun: this.printLabel,
            loading: false
          }
          // {
          //   text: '新增',
          //   type: 'primary',
          //   fun: this.addOrUpdateHandle
          // },
          // {
          //   text: '获取IFS零件',
          //   type: 'primary',
          //   fun: this.syncISDate,
          //   loading: false
          // },
          // {
          //   text: '大标签',
          //   type: 'primary',
          //   fun: this.printLabel,
          //   loading: false
          // },
          // {
          //   text: 'Excel导入',
          //   type: 'primary',
          //   fun: this.uploadPartExcel,
          //   loading: false
          // },
        ],
        operator: [
          {
@@ -412,6 +424,8 @@
    PrintLabelForm
  },
  created() {
    let token=JSON.parse(sessionStorage.getItem("ztt-access_token")).content
    this.yourToken=token
    this.table.column.find((e) => e.label === 'IFS启用批次管理').isTrue = false
    this.table.column.find((e) => e.label === '计划方法').isTrue = false
    this.getUnitType('unit')
@@ -427,6 +441,16 @@
    ...mapGetters(['permissions'])
  },
  methods: {
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePreview(file) {
    },
    fileUpload(){
      this.$message.success('后台正在导入中,请稍后刷新!')
      this.fileList=[]
    },
    handleClose() {
      this.selectDate = "";
      this.dialogVisible = false
@@ -650,9 +674,9 @@
      let datas = new FormData()
      let times = null;
      if (this.selectDate != '' && this.selectDate != null) {
        times=dateFormatPlus(this.selectDate)
      }else{
        times=null
        times = dateFormatPlus(this.selectDate)
      } else {
        times = null
      }
      datas.set("date", times)
      // console.log(datas.get("date"));
@@ -683,6 +707,9 @@
          // this.$message.error('同步ERP失败:' + e)
        })
    },
    uploadPartExcel() {
    },
    printLabel() {
      if (this.multipleSelection && this.multipleSelection.length > 0) {
        if (this.multipleSelection && this.multipleSelection.length === 1) {