| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between;align-items: center"> |
| | | <el-button icon="el-icon-circle-plus-outline" type="primary" @click="add">æä»¶ä¸ä¼ </el-button> |
| | | <div style="display: flex;align-items: center"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="100px" |
| | | inline |
| | | > |
| | | <div class="elForm" style="justify-content: flex-start"> |
| | | <el-form-item style="margin-right: 30px"> |
| | | <el-checkbox v-model="checked" @change="checkedChange">ææ°çæ¬</el-checkbox> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-input v-model="form.search" placeholder="请è¾å
¥å
³é®å" style="width: 260px" /> |
| | | </el-form-item> |
| | | </div> |
| | | </el-form> |
| | | <el-button type="primary" style="margin-left: 30px" icon="el-icon-search" @click="search">æ¥è¯¢</el-button> |
| | | <el-button type="info" icon="el-icon-refresh" @click="reset">éç½®</el-button> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | class="tableFixed" |
| | | :data="tableData" |
| | | :height="isExpandForm?tableHeight:(tableHeight+40)+'px'" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | > |
| | | <el-table-column |
| | | prop="RowNum" |
| | | width="50" |
| | | fixed |
| | | label="åºå·" |
| | | /> |
| | | <el-table-column |
| | | prop="define_name" |
| | | label="æä»¶åç§°" |
| | | min-width="160" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.define_name">{{ row.define_name }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="filetype_name" |
| | | label="æä»¶ç±»å" |
| | | min-width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.filetype_name">{{ row.filetype_name }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="file_version" |
| | | label="çæ¬å·" |
| | | min-width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.file_version">{{ row.file_version }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="partcode" |
| | | label="ç©æç¼ç " |
| | | min-width="110" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.partcode">{{ row.partcode }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="partname" |
| | | label="ç©æåç§°" |
| | | min-width="110" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.partname">{{ row.partname }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="eqptype_name" |
| | | label="设å¤ç±»å" |
| | | min-width="110" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.eqptype_name">{{ row.eqptype_name }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="username" |
| | | min-width="110" |
| | | label="ä¸ä¼ 人å" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.username">{{ row.username }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="lm_date" |
| | | label="ä¸ä¼ æ¶é´" |
| | | min-width="160" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.lm_date">{{ row.lm_date }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="é¢è§" placement="top"> |
| | | <i |
| | | class="el-icon-files" |
| | | style="cursor: pointer;color:#42b983;margin-right: 15px" |
| | | @click="check(row)" |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top"> |
| | | <i class="el-icon-delete" @click="del(row)" /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!--å页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="getSystemSopSearch" |
| | | /> |
| | | </div> |
| | | |
| | | <el-dialog |
| | | title="æä»¶ä¸ä¼ " |
| | | :visible.sync="dialogVisible" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="设å¤ç±»å" prop="devicetvpecode"> |
| | | <el-select |
| | | v-model="dialogForm.devicetvpecode" |
| | | style="width: 200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | @change="val=>fileversionChange(val,'devicetvpecode')" |
| | | > |
| | | <el-option |
| | | v-for="item in devicetvpeArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç©æåç§°" prop="partcode"> |
| | | <el-select |
| | | v-model="dialogForm.partcode" |
| | | style="width: 200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | @change="val=>fileversionChange(val,'partcode')" |
| | | > |
| | | <el-option |
| | | v-for="item in partArr" |
| | | :key="item.partcode" |
| | | :label="item.partname" |
| | | :value="item.partcode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="æä»¶åç§°" prop="defilename">--> |
| | | <!-- <el-form-item label="æä»¶åç§°">--> |
| | | <!-- <el-input v-model="dialogForm.defilename" disabled style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="æä»¶ç±»å" prop="filetypecode"> |
| | | <el-select |
| | | v-model="dialogForm.filetypecode" |
| | | style="width: 200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | @change="val=>fileversionChange(val,'filetypecode')" |
| | | > |
| | | <el-option |
| | | v-for="item in filetypeArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="çæ¬å·"> |
| | | <el-input v-model="dialogForm.fileversion" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="æä»¶ä¸ä¼ " prop="Files"> |
| | | <div style="width: 200px;"> |
| | | <el-upload |
| | | ref="uploadFileRef" |
| | | style="display: inline-block;" |
| | | action="#" |
| | | :limit="1" |
| | | :show-file-list="true" |
| | | :on-exceed="handleExceed" |
| | | :auto-upload="false" |
| | | :multiple="false" |
| | | accept=".mp4,.pdf" |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | style="width: 200px;display: flex;justify-content: center" |
| | | icon="el-icon-upload2" |
| | | >éæ©æä»¶ |
| | | </el-button> |
| | | </el-upload> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button @click="dialogVisibleCancel">å æ¶</el-button> |
| | | <el-button |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleConfirm" |
| | | >ç¡® å®</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | // import { |
| | | // SystemSopDelete, |
| | | // SystemSopDeviceSearch, |
| | | // SystemSopMaxVersion, |
| | | // SystemSopSava, |
| | | // SystemSopSearch, |
| | | // SystemSopView |
| | | // } from '@/api/xtsz' |
| | | // import { PartSelect } from '@/api/zzmx' |
| | | |
| | | export default { |
| | | name: 'Zzjg', |
| | | components: { |
| | | Pagination |
| | | }, |
| | | data() { |
| | | return { |
| | | mouseHoverType: 'mouseout', |
| | | isExpandForm: false, |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | check: 'N', // æ¯å¦é䏿é«çæ¬ |
| | | search: '', // æç´¢å
³é®å |
| | | prop: 'lm_date', // æåºå段 |
| | | order: 'desc', // æåºå段 |
| | | page: 1, // 第å 页 |
| | | rows: 20 // æ¯é¡µå¤å°æ¡ |
| | | }, |
| | | checked: false, |
| | | |
| | | total: 10, |
| | | tableData: [], |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | devicetvpecode: '', // 设å¤ç±»åç¼ç |
| | | partcode: '', // ç©æç¼ç |
| | | defilename: '', |
| | | filetypecode: '', // æä»¶ç±»åç¼ç |
| | | Files: '', // æä»¶ |
| | | fileversion: ''// æä»¶çæ¬å· |
| | | }, |
| | | dialogFormRules: { |
| | | devicetvpecode: [ |
| | | { required: true, message: 'è¯·éæ©è®¾å¤ç±»å', trigger: ['blur', 'change'] } |
| | | ], |
| | | partcode: [ |
| | | { required: true, message: 'è¯·éæ©ç©æåç§°', trigger: ['blur', 'change'] } |
| | | ], |
| | | defilename: [ |
| | | { required: true, message: '请è¾å
¥åæä»¶ç§°', trigger: ['blur', 'change'] } |
| | | ], |
| | | filetypecode: [ |
| | | { required: true, message: 'è¯·éæ©æä»¶ç±»å', trigger: ['blur', 'change'] } |
| | | ] |
| | | }, |
| | | devicetvpeArr: [], // 设å¤ç±»å䏿å表 |
| | | partArr: [], // ç©æä¸æå表 |
| | | filetypeArr: [// æä»¶ç±»å䏿æ°ç» |
| | | { code: 'P001', name: 'ä½ä¸æå¯¼ä¹¦' }, |
| | | { code: 'P002', name: 'æ£éªæå¯¼ä¹¦' }, |
| | | { code: 'P003', name: 'å¾çº¸' } |
| | | ] |
| | | |
| | | } |
| | | }, |
| | | |
| | | created() { |
| | | // this.getSystemSopSearch() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | async getSystemSopSearch() { |
| | | const res = await SystemSopSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | }, |
| | | // æåºæ¹åæ¶ |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getSystemSopSearch() |
| | | }, |
| | | // æ¥è¯¢ |
| | | search() { |
| | | this.getSystemSopSearch() |
| | | }, |
| | | // ææ°çæ¬æ¹åæ¶è§¦å |
| | | checkedChange(val) { |
| | | this.form.check = val ? 'Y' : 'N' |
| | | this.getSystemSopSearch() |
| | | }, |
| | | // æä»¶æ°éè¶
è¿éå®è§¦å |
| | | handleExceed() { |
| | | this.$message.info('æä¸æ¯æå¤æä»¶ä¸ä¼ ï¼') |
| | | }, |
| | | |
| | | // éç½® |
| | | reset() { |
| | | this.form.search = '' |
| | | this.getSystemSopSearch() |
| | | }, |
| | | // æ°å¢æé® |
| | | add() { |
| | | this.dialogVisible = true |
| | | this.getSystemSopDeviceSearch() |
| | | this.getPartSelect() |
| | | }, |
| | | // è·å设å¤ç±»å |
| | | async getSystemSopDeviceSearch() { |
| | | const { data: res } = await SystemSopDeviceSearch() |
| | | this.devicetvpeArr = res |
| | | }, |
| | | // è·åç©æåç§° |
| | | async getPartSelect() { |
| | | const { data: res } = await PartSelect() |
| | | this.partArr = res |
| | | }, |
| | | // æä»¶ç±»å弿¹åæ¶ |
| | | async fileversionChange(val, type) { |
| | | const data = { |
| | | devicetypecode: type === 'devicetvpecode' ? val : this.dialogForm.devicetvpecode, |
| | | filetypecode: type === 'filetypecode' ? val : this.dialogForm.filetypecode, |
| | | partcode: type === 'partcode' ? val : this.dialogForm.partcode |
| | | } |
| | | const { data: res } = await SystemSopMaxVersion(data) |
| | | |
| | | this.dialogForm.fileversion = res |
| | | }, |
| | | // é¢è§ |
| | | async check(row) { |
| | | const { data: res } = await SystemSopView({ id: row.id, filepath: row.file_path }) |
| | | window.open(res) |
| | | }, |
| | | |
| | | // å é¤æé® |
| | | async del(row) { |
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const data = { |
| | | id: row.id, |
| | | filepath: row.file_path |
| | | } |
| | | SystemSopDelete(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('å 餿å!') |
| | | if (this.form.page > 1 && this.tableData.length === 1) { |
| | | this.form.page-- |
| | | } |
| | | this.getSystemSopSearch() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message.info('已忶å é¤') |
| | | }) |
| | | }, |
| | | // å¯¹è¯æ¡å
³éäºä»¶ |
| | | handleClose() { |
| | | this.dialogForm.devicetvpecode = '' |
| | | this.dialogForm.partcode = '' |
| | | this.dialogForm.defilename = '' |
| | | this.dialogForm.filetypecode = '' |
| | | this.dialogForm.fileversion = '' |
| | | this.dialogForm.Files = '' |
| | | this.$refs.uploadFileRef.clearFiles() |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // å¯¹è¯æ¡åæ¶ |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | }, |
| | | // å¯¹è¯æ¡ç¡®è®¤ |
| | | dialogVisibleConfirm() { |
| | | console.log(this.$refs.uploadFileRef.uploadFiles[0]) |
| | | if (!this.$refs.uploadFileRef.uploadFiles[0]) { |
| | | this.$message.info('è¯·éæ©æä»¶ä¸ä¼ ï¼') |
| | | } |
| | | |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | const formData = new FormData() |
| | | formData.append('devicetypecode', this.dialogForm.devicetvpecode) |
| | | formData.append('partcode', this.dialogForm.partcode) |
| | | formData.append('defilename', this.$refs.uploadFileRef.uploadFiles[0].name) |
| | | formData.append('filetypecode', this.dialogForm.filetypecode) |
| | | formData.append('fileversion', this.dialogForm.fileversion) |
| | | formData.append('Files', this.$refs.uploadFileRef.uploadFiles[0].raw) |
| | | // for (var [key, value] of formData) { |
| | | // console.log(key, value) |
| | | // } |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | SystemSopSava(formData).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('æä»¶ä¸ä¼ æåï¼') |
| | | this.dialogVisible = false |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.getSystemSopSearch() |
| | | } else { |
| | | this.$message.error('æä»¶ä¸ä¼ 失败ï¼') |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // è·å页é¢é«åº¦ |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 185 |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | }, |
| | | tableRowClassName({ row, rowIndex }) { |
| | | return 'custom-row' |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | .el-table .custom-row { |
| | | background: #f8f8fa; |
| | | } |
| | | </style> |