123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <!-- 图库管理 -->
- <template>
- <el-dialog title="选择图纸"
- width="70%"
- :close-on-click-modal="false"
- :visible.sync="visible">
- <div class="draw-management">
- <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
- <el-form-item label="名称">
- <el-input v-model="dataForm.keyword" placeholder="名称" clearable/>
- </el-form-item>
- <el-form-item>
- <el-button @click="search()">查询</el-button>
- <el-button type="primary" @click="addSubmit">确认添加</el-button>
- <el-button type="text" @click="gotoPage">没有找到?去上传</el-button>
- </el-form-item>
- </el-form>
- <el-table
- :data="dataList"
- border
- v-loading="dataListLoading"
- @selection-change="selectionChangeHandle"
- style="width: 100%;">
- <el-table-column type="selection"></el-table-column>
- <el-table-column
- label="序号"
- type="index"
- width="50"
- align="center">
- </el-table-column>
- <el-table-column
- prop="drawingCode"
- header-align="center"
- align="center"
- min-width="100"
- :show-tooltip-when-overflow="true"
- label="图纸编码">
- </el-table-column>
- <el-table-column
- prop="drawingName"
- header-align="center"
- align="center"
- min-width="120"
- :show-tooltip-when-overflow="true"
- label="图纸名称">
- </el-table-column>
- <el-table-column
- prop="drawingNo"
- header-align="center"
- align="center"
- min-width="120"
- :show-tooltip-when-overflow="true"
- label="图号">
- </el-table-column>
- <el-table-column
- prop="source"
- header-align="center"
- align="center"
- min-width="200"
- :show-overflow-tooltip="true"
- label="来源">
- </el-table-column>
- <el-table-column
- prop="creatorName"
- header-align="center"
- align="center"
- min-width="100"
- label="上传者">
- </el-table-column>
- <el-table-column
- prop="notes"
- header-align="center"
- align="center"
- min-width="180"
- :show-overflow-tooltip="true"
- label="备注">
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="sizeChangeHandle"
- @current-change="currentChangeHandle"
- :current-page="pageIndex"
- :page-sizes="[10, 20, 50, 100]"
- :page-size="pageSize"
- :total="totalPage"
- layout="total, sizes, prev, pager, next, jumper">
- </el-pagination>
- </div>
- </el-dialog>
- </template>
-
- <script>
- import { getDrawList } from '@/api/product'
- import ProductComponent from '@/views/modules/common/product-component'
- export default {
- name: 'draw-template-choose',
- components: {
- ProductComponent
- },
- data () {
- return {
- visible: false,
- detailVisible: false,
- dataForm: {
- keyword: ''
- },
- optionsProducts: [],
- dataList: [],
- pageIndex: 1,
- pageSize: 10,
- totalPage: 0,
- dataListLoading: false,
- dataListSelections: []
- }
- },
- created () {
- this.getDataList()
- },
- methods: {
- init () {
- this.visible = true
- },
- onChose () {
- this.addOrUpdateVisible = false
- this.detailVisible = false
- },
- // 查询
- search () {
- this.pageIndex = 1
- this.getDataList()
- },
- // 获取数据列表
- getDataList () {
- this.addOrUpdateVisible = false
- this.dataListLoading = true
- let params = {
- 'current': this.pageIndex,
- 'size': this.pageSize,
- 'keyword': this.dataForm.keyword,
- 'createTime': this.dataForm.createTime ? this.dataForm.createTime : null,
- 'productId': this.dataForm.productId ? this.dataForm.productId : null
- }
- getDrawList(params).then(({data}) => {
- if (data && data.code === '200') {
- this.dataList = data.data.records
- this.totalPage = Number(data.data.total)
- } else {
- this.dataList = []
- this.totalPage = 0
- }
- this.dataListLoading = false
- })
- },
- // 每页数
- sizeChangeHandle (val) {
- this.pageSize = val
- this.pageIndex = 1
- this.getDataList()
- },
- // 当前页
- currentChangeHandle (val) {
- this.pageIndex = val
- this.getDataList()
- },
- // 多选
- selectionChangeHandle (val) {
- this.dataListSelections = val
- },
- addSubmit () {
- if (this.dataListSelections.length === 0) {
- this.$message.warning('请选择')
- return
- }
- this.visible = false
- this.$emit('addItems', this.dataListSelections)
- },
- // 跳转上传图纸页面
- gotoPage () {
- this.visible = false
- this.$router.push('/tech-draw-management')
- }
- }
- }
- </script>
-
- <style scoped>
-
- </style>
-
|