代码更新

This commit is contained in:
2022-07-20 14:42:59 +08:00
parent c503789e61
commit 7fc5ac6636
8 changed files with 207 additions and 77 deletions

View File

@@ -114,6 +114,17 @@
>
报废
</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
:disabled="crud.selections.length !== 1"
@click="downloadWord"
>
下载Word
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
@@ -161,6 +172,8 @@ import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
import DateRangePicker from '@/components/DateRangePicker'
import {download} from "@/api/data";
import {downloadFile} from "@/utils";
const defaultForm = { status: null }
export default {
@@ -267,6 +280,15 @@ export default {
} else {
return this.crud.notify('设备状态不为正常或者闲置', CRUD.NOTIFICATION_TYPE.INFO)
}
},
downloadWord() {
const _selectData = this.$refs.table.selection
const data = _selectData[0]
download('/api/devicescrap/downloadWord', { 'devicerecord_id': data.devicerecord_id }).then(result => {
const name = data.device_name + '报废档案'
this.crud.toQuery()
downloadFile(result, name, 'docx')
})
}
}
}