| | |
| | | :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" /> |
| | |
| | | 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, |
| | |
| | | } |
| | | ], |
| | | 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: [ |
| | | { |
| | |
| | | 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') |
| | |
| | | ...mapGetters(['permissions']) |
| | | }, |
| | | methods: { |
| | | handleRemove(file, fileList) { |
| | | console.log(file, fileList); |
| | | }, |
| | | handlePreview(file) { |
| | | |
| | | }, |
| | | fileUpload(){ |
| | | this.$message.success('后台正在导入中,请稍后刷新!') |
| | | this.fileList=[] |
| | | }, |
| | | handleClose() { |
| | | this.selectDate = ""; |
| | | this.dialogVisible = false |
| | |
| | | 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")); |
| | |
| | | // this.$message.error('同步ERP失败:' + e) |
| | | }) |
| | | }, |
| | | uploadPartExcel() { |
| | | |
| | | }, |
| | | printLabel() { |
| | | if (this.multipleSelection && this.multipleSelection.length > 0) { |
| | | if (this.multipleSelection && this.multipleSelection.length === 1) { |