Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdmweb
| | |
| | | @on-load="onLoad" |
| | | > |
| | | <template #menu-left> |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleView">导åº</el-button> |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">导åº</el-button> |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleView">导å
¥</el-button> |
| | | <!-- <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleAdd">æ°å¢</el-button> --> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleEdit(scope.row, scope.index)">ç¼è¾</el-button> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleView(scope.row, scope.index)">å é¤</el-button> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleView(scope.row, scope.index)">äº§çæºåºåä¼ æºææ </el-button> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleDel(scope.row, scope.index)">å é¤</el-button> |
| | | <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleUp(scope.row, scope.index)">äº§çæºåºåä¼ æºææ </el-button> |
| | | </template> |
| | | |
| | | <template #status="{ row }"> |
| | |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-dialog title="ç¼è¾" append-to-body v-model="editBox" width="60%"> |
| | | <avue-form ref="editFormModal" :option="editFormModal" v-model="form" @submit="formSubmit" /> |
| | | <el-dialog :title="machineTitle" append-to-body v-model="editBox" width="60%"> |
| | | <avue-form ref="editFormModal1" :option="editFormModal" v-model="editForm" @submit="formSubmit" @resetForm="resetForm"/> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { exportBlob } from '@/api/common'; |
| | | import { getToken } from '@/utils/auth'; |
| | | import NProgress from 'nprogress'; |
| | | import { downloadXls } from '@/utils/util'; |
| | | import 'nprogress/nprogress.css'; |
| | | export default { |
| | | data() { |
| | | var that = this; |
| | | return { |
| | | machineTitle: "æ°å¢", |
| | | isAdd: true, |
| | | editBox: false, |
| | | search: { |
| | | keyword: "", |
| | |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | editForm: {}, |
| | | option: { |
| | | index: true, |
| | | addBtn: false, |
| | |
| | | }, |
| | | { |
| | | label: 'æºåºåå·', |
| | | prop: '', |
| | | prop: 'name', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: 'æºåºç±»å', |
| | | prop: '', |
| | | prop: 'machineSpec', |
| | | type: 'select', |
| | | span: 12, |
| | | dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group', |
| | | dicUrl: '/blade-system/dict-biz/dictionary?code=machine_spec', |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'dictKey', |
| | |
| | | }, |
| | | { |
| | | label: 'æå±æºåºç»', |
| | | prop: '', |
| | | prop: 'machineGroupCode', |
| | | type: 'select', |
| | | span: 12, |
| | | dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group', |
| | |
| | | }, |
| | | { |
| | | label: 'æä½å', |
| | | prop: '', |
| | | prop: 'operator', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: 'æå±ç»ç»', |
| | | prop: '', |
| | | type: 'select', |
| | | prop: 'ownerDept', |
| | | type: 'tree', |
| | | span: 12, |
| | | dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group', |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'dictKey', |
| | | } |
| | | label: 'deptName', |
| | | value: 'id' |
| | | }, |
| | | dicUrl: `/blade-system/dept/lazy-list` |
| | | }, |
| | | { |
| | | label: 'ç产å', |
| | | prop: '', |
| | | prop: 'manufacturer', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: '轮询æ¶é´ï¼å°æ¶ï¼', |
| | | prop: '', |
| | | prop: 'pollingHours', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: 'ç³»ç»æ§å¶', |
| | | prop: '', |
| | | prop: 'controlSystem', |
| | | type: 'select', |
| | | span: 12, |
| | | dicUrl: '/blade-system/dict-biz/dictionary?code=machine_control_system', |
| | |
| | | }, |
| | | { |
| | | label: 'ç¶æ', |
| | | prop: 'checkbox', |
| | | prop: 'status', |
| | | type: 'checkbox', |
| | | span: 12, |
| | | dicData: [{ |
| | |
| | | }, |
| | | { |
| | | label: 'ç¨åºä¸åç®å½', |
| | | prop: '', |
| | | prop: 'progSendDir', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: 'ç¨åºåä¼ ç®å½', |
| | | prop: '', |
| | | prop: 'progReceiveDir', |
| | | type: 'input', |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | label: '夿³¨', |
| | | prop: '', |
| | | prop: 'remark', |
| | | type: 'textarea', |
| | | span: 24, |
| | | dataType: 'string', |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleEdit() { |
| | | handleAdd() { |
| | | this.machineTitle = "æ°å¢"; |
| | | this.isAdd = true; |
| | | this.editBox = true; |
| | | this.$refs.editFormModal1.resetForm(); |
| | | }, |
| | | formSubmit() { |
| | | |
| | | handleEdit(row,index) { |
| | | this.machineTitle = "ç¼è¾"; |
| | | this.isAdd = false; |
| | | axios({ |
| | | url: '/blade-mdm/machine/detail', |
| | | method: 'get', |
| | | params: {id: row.id}, |
| | | }).then( |
| | | res => { |
| | | res.data.data.status = [res.data.data.status]; |
| | | this.editForm = res.data.data; |
| | | this.editBox = true; |
| | | }, |
| | | error => { |
| | | this.loading = false; |
| | | } |
| | | ); |
| | | }, |
| | | handleDel(row,index) { |
| | | this.loading = true; |
| | | axios({ |
| | | url: '/blade-mdm/machine/remove', |
| | | method: 'post', |
| | | params: {ids: row.id}, |
| | | }).then( |
| | | res => { |
| | | this.loading = false; |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æä½æå!', |
| | | }); |
| | | this.onLoad(); |
| | | done(); |
| | | }, |
| | | error => { |
| | | this.loading = false; |
| | | } |
| | | ); |
| | | }, |
| | | handleUp(row,index) { |
| | | this.loading = true; |
| | | axios({ |
| | | url: '/blade-mdm/machine/gen-fileback-dirs', |
| | | method: 'post', |
| | | params: {id: row.id}, |
| | | }).then( |
| | | res => { |
| | | this.loading = false; |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æä½æå!', |
| | | }); |
| | | this.onLoad(); |
| | | done(); |
| | | }, |
| | | error => { |
| | | this.loading = false; |
| | | } |
| | | ); |
| | | }, |
| | | handleExport() { |
| | | this.$confirm('æ¯å¦å¯¼åº?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | exportBlob( |
| | | `/blade-mdm/machine/export?${this.website.tokenHeader}=${getToken()}` |
| | | ).then(res => { |
| | | downloadXls(res.data, `å¯¼åºæºåº${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`); |
| | | NProgress.done(); |
| | | }); |
| | | }); |
| | | }, |
| | | formSubmit(params, done) { |
| | | var obj = {...params}; |
| | | if(params.status.length == 0) { |
| | | obj.status = "0"; |
| | | }else { |
| | | obj.status = "1"; |
| | | } |
| | | if(this.isAdd) { //æ°å¢ |
| | | var url = '/blade-mdm/machine/save'; |
| | | }else { |
| | | var url = '/blade-mdm/machine/update'; |
| | | } |
| | | this.loading = true; |
| | | axios({ |
| | | url: url, |
| | | method: 'post', |
| | | data: obj, |
| | | }).then( |
| | | res => { |
| | | this.loading = false; |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æä½æå!', |
| | | }); |
| | | this.editBox = false; |
| | | this.onLoad(); |
| | | done(); |
| | | }, |
| | | error => { |
| | | |
| | | } |
| | | ); |
| | | }, |
| | | handleView() { |
| | | |
| | |
| | | refreshChange() { |
| | | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | onLoad() { |
| | | this.loading = true; |
| | | var obj = { |
| | | keyword: this.search.keyword, |
| | |
| | | |
| | | } |
| | | ); |
| | | |
| | | } |
| | | }, |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud |
| | | :addBtn="false" |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model:search="search" |
| | | v-model:page="mypage" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <template #menu-left> |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleEdit">导å
¥</el-button> |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleEdit">å
¥åº</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | search: {}, |
| | | loading: true, |
| | | mypage: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | option: { |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | labelWidth: 120, |
| | | emptyBtn: false, |
| | | searchSpan: 8, |
| | | selection: true, |
| | | menu: false, |
| | | column: [ |
| | | { |
| | | label: 'æä»¶è·¯å¾', |
| | | type: 'input', |
| | | prop: 'keyword', |
| | | search: true, |
| | | hide: true |
| | | }, |
| | | { |
| | | label: 'ä»»å¡ç¼å·', |
| | | prop: '' |
| | | }, |
| | | { |
| | | label: 'ç¨åºåç§°', |
| | | prop: '', |
| | | }, |
| | | { |
| | | label: 'æä»¶å°è¾¾æ¶é´', |
| | | prop: '', |
| | | }, |
| | | { |
| | | label: 'æä»¶æ°æ®åºç¼å·', |
| | | prop: '', |
| | | }, |
| | | { |
| | | label: 'å¤çç¶æ', |
| | | prop: '', |
| | | }, |
| | | { |
| | | label: 'å¤çæ¹å¼', |
| | | prop: '' |
| | | }, |
| | | { |
| | | label: 'å¤çæ¶é´', |
| | | prop: '' |
| | | }, |
| | | { |
| | | label: 'å¤ç人', |
| | | prop: '' |
| | | }, |
| | | { |
| | | label: 'MD5å¼', |
| | | prop: '' |
| | | } |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleEdit(row,index) { |
| | | |
| | | }, |
| | | searchReset() { |
| | | //this.onLoad(this.mypage); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.mypage.current = 1; |
| | | this.onLoad(); |
| | | done(); |
| | | }, |
| | | currentChange(current) { |
| | | this.mypage.current = current; |
| | | }, |
| | | sizeChange(size) { |
| | | this.mypage.size = size; |
| | | }, |
| | | refreshChange() { |
| | | |
| | | }, |
| | | onLoad() { |
| | | this.loading = true; |
| | | var obj = { |
| | | keyword: this.search.keyword, |
| | | machineSpec: "", |
| | | current: this.mypage.current, |
| | | size: this.mypage.size, |
| | | } |
| | | axios({ |
| | | url: '/blade-mdm/machineback/file/page', |
| | | method: 'get', |
| | | params: obj, |
| | | }).then( |
| | | res => { |
| | | const data = res.data.data; |
| | | this.mypage.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }, |
| | | error => { |
| | | |
| | | } |
| | | ); |
| | | |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | |
| | | </style> |