| | |
| | | <!-- |
| | | * @Date: 2025-06-18 09:17:09 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2025-06-20 09:32:54 |
| | | * @LastEditTime: 2025-07-20 12:27:48 |
| | | * @FilePath: /mdmweb/src/views/tasks/machinereturnfileop.vue |
| | | --> |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" |
| | | @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange" |
| | | @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @selection-change="selectionChange"> |
| | | <template #menu-left> |
| | | <el-button type="primary" plain @click="exportWebSite">导出回传涉密网</el-button> |
| | | <el-button type="primary" plain @click="reassign">挂载车床程序库</el-button> |
| | |
| | | selection: true, |
| | | // viewBtn: true, |
| | | menuWidth: 100, |
| | | menu: false, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | |
| | | |
| | | { |
| | | label: '程序编号', |
| | | prop: 'programName', |
| | | prop: 'code', |
| | | }, |
| | | { |
| | | label: '回传机床', |
| | |
| | | |
| | | { |
| | | label: '文件名称', |
| | | prop: '', |
| | | formatter: (val, value, label) => { |
| | | return `${val?.variables?.machineCode}`; |
| | | }, |
| | | prop: 'name' |
| | | }, |
| | | { |
| | | label: '文件固化状态', |
| | | prop: 'machineCode', |
| | | prop: 'isCured', |
| | | formatter: (val, value, label) => { |
| | | return `${val==0?'未固化':"已固化"}`; |
| | | }, |
| | | }, |
| | | { |
| | | label: '文件到达时间', |
| | |
| | | type: 'datetime', |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | }, |
| | | { |
| | | label: '文件数据库编号', |
| | | prop: '', |
| | | }, |
| | | } |
| | | ], |
| | | selectedList: [], |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | selectionChange (list) { |
| | | this.selectedList = list; |
| | | }, |
| | | exportWebSite() { |
| | | if (this.selectedList.length === 0) { |
| | | this.$message.warning('请先选择需要导出的数据'); |
| | | return; |
| | | } |
| | | this.$confirm('是否导出?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | exportBlob( |
| | | `/blade-mdm/machineback/filehandle/export-to-inner?${this.website.tokenHeader}=${getToken()}` |
| | | `/blade-mdm/machineback/filehandle/export-to-inner`, |
| | | { |
| | | ids: this.selectedList.map(item => item.id).join(','), |
| | | } |
| | | ).then(res => { |
| | | downloadXls(res.data, `导出回传涉密网${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`); |
| | | NProgress.done(); |
| | |
| | | }); |
| | | }, |
| | | exportExcel() { |
| | | if (this.selectedList.length === 0) { |
| | | this.$message.warning('请先选择需要导出的数据'); |
| | | return; |
| | | } |
| | | this.$confirm('是否导出?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | |
| | | // keyword: params.keyword || '' |
| | | // } |
| | | data = { |
| | | confirmTimeBegin: params.createTimeBegin, |
| | | confirmTimeEnd: params.createTimeEnd, |
| | | confirmTimeBegin: params.confirmTimeBegin, |
| | | confirmTimeEnd: params.confirmTimeEnd, |
| | | } |
| | | this.query = data |
| | | this.onLoad(this.page, data); |
| | | done(); |
| | | }, |
| | |
| | | /** * 页面加载时获取数据 |
| | | */ |
| | | onLoad(page, params = {}) { |
| | | console.log('onLoad', page, params); |
| | | const query = { |
| | | ...this.query, |
| | | // category: params.category ? flowCategory(params.category) : null, |
| | | mode: this.mode, |
| | | }; |
| | | try { |
| | | delete query.processCreateTime; // 删除不必要的查询条件 |
| | | delete query.confirmTime; // 删除不必要的查询条件 |
| | | } catch (error) { |
| | | console.error('日期格式化错误', error); |
| | | } |