| | |
| | | @sort-change="sortChange" |
| | | > |
| | | <el-table-column |
| | | prop="RowNum" |
| | | prop="rowNum" |
| | | width="50" |
| | | fixed |
| | | label="åºå·" |
| | | /> |
| | | <el-table-column |
| | | prop="define_name" |
| | | prop="filename" |
| | | 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-if="row.filename">{{ row.filename }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="filetype_name" |
| | | prop="filetypename" |
| | | label="æä»¶ç±»å" |
| | | min-width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.filetype_name">{{ row.filetype_name }}</div> |
| | | <div v-if="row.filetypename">{{ row.filetypename }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="file_version" |
| | | prop="version" |
| | | label="çæ¬å·" |
| | | min-width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.file_version">{{ row.file_version }}</div> |
| | | <div v-if="row.version">{{ row.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" |
| | | prop="eqptypename" |
| | | 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="eqpname" |
| | | label="设å¤ä¿¡æ¯" |
| | | min-width="110" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="username" |
| | | min-width="110" |
| | |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top"> |
| | | <i class="el-icon-delete" @click="del(row)" /> |
| | | <i class="el-icon-delete" style="cursor: pointer;color:#42b983;" @click="del(row)" /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="getSystemSopSearch" |
| | | @pagination="getDeviceSopSearch" |
| | | /> |
| | | </div> |
| | | |
| | |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="设å¤ç±»å" prop="devicetvpecode"> |
| | | <el-form-item label="设å¤ç±»å" prop="devicetypecode"> |
| | | <el-select |
| | | v-model="dialogForm.devicetvpecode" |
| | | v-model="dialogForm.devicetypecode" |
| | | style="width: 200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | @change="val=>fileversionChange(val,'devicetvpecode')" |
| | | @change="devicetypecodeChange" |
| | | > |
| | | <el-option |
| | | v-for="item in devicetvpeArr" |
| | | v-for="item in devicetypeArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç©æåç§°" prop="partcode"> |
| | | <el-form-item label="设å¤ä¿¡æ¯" prop="device"> |
| | | <el-select |
| | | v-model="dialogForm.partcode" |
| | | v-model="dialogForm.device" |
| | | style="width: 200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | multiple |
| | | collapse-tags |
| | | :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" |
| | | v-for="item in deviceArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | @change="val=>fileversionChange(val,'filetypecode')" |
| | | > |
| | | <el-option |
| | | v-for="item in filetypeArr" |
| | |
| | | /> |
| | | </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="çæ¬å·">--> |
| | | <!-- <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 |
| | |
| | | :on-exceed="handleExceed" |
| | | :auto-upload="false" |
| | | :multiple="false" |
| | | accept=".mp4,.pdf" |
| | | > |
| | | <!-- accept=".mp4,.pdf"--> |
| | | <el-button |
| | | type="primary" |
| | | style="width: 200px;display: flex;justify-content: center" |
| | |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | // import { |
| | | // SystemSopDelete, |
| | | // SystemSopDeviceSearch, |
| | | // SystemSopMaxVersion, |
| | | // SystemSopSava, |
| | | // SystemSopSearch, |
| | | // SystemSopView |
| | | // } from '@/api/xtsz' |
| | | // import { PartSelect } from '@/api/zzmx' |
| | | import { DeviceSopAddSeave, DeviceSopDeleteSeave, DeviceSopSearch } from '@/api/SopManager' |
| | | import { DeviceTypeSearch } from '@/api/DeviceManager' |
| | | import { EqpTypecodeSeachEqpPermissions } from '@/api/GeneralBasicData' |
| | | |
| | | export default { |
| | | name: 'Zzjg', |
| | |
| | | tableData: [], |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | devicetvpecode: '', // 设å¤ç±»åç¼ç |
| | | partcode: '', // ç©æç¼ç |
| | | devicetypecode: '', // 设å¤ç±»åç¼ç |
| | | device: '', // ç©æç¼ç |
| | | defilename: '', |
| | | filetypecode: '', // æä»¶ç±»åç¼ç |
| | | Files: '', // æä»¶ |
| | | fileversion: ''// æä»¶çæ¬å· |
| | | }, |
| | | dialogFormRules: { |
| | | devicetvpecode: [ |
| | | devicetypecode: [ |
| | | { required: true, message: 'è¯·éæ©è®¾å¤ç±»å', trigger: ['blur', 'change'] } |
| | | ], |
| | | partcode: [ |
| | | { required: true, message: 'è¯·éæ©ç©æåç§°', trigger: ['blur', 'change'] } |
| | | device: [ |
| | | { required: true, message: 'è¯·éæ©è®¾å¤ä¿¡æ¯', trigger: ['blur', 'change'] } |
| | | ], |
| | | defilename: [ |
| | | { required: true, message: '请è¾å
¥åæä»¶ç§°', trigger: ['blur', 'change'] } |
| | |
| | | { required: true, message: 'è¯·éæ©æä»¶ç±»å', trigger: ['blur', 'change'] } |
| | | ] |
| | | }, |
| | | devicetvpeArr: [], // 设å¤ç±»å䏿å表 |
| | | partArr: [], // ç©æä¸æå表 |
| | | devicetypeArr: [], // 设å¤ç±»å䏿å表 |
| | | deviceArr: [], // ç©æä¸æå表 |
| | | filetypeArr: [// æä»¶ç±»å䏿æ°ç» |
| | | { code: 'P001', name: 'ä½ä¸æå¯¼ä¹¦' }, |
| | | { code: 'P002', name: 'æ£éªæå¯¼ä¹¦' }, |
| | |
| | | }, |
| | | |
| | | created() { |
| | | // this.getSystemSopSearch() |
| | | this.getDeviceSopSearch() |
| | | this.getDeviceTypeSearch() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | async getSystemSopSearch() { |
| | | const res = await SystemSopSearch(this.form) |
| | | async getDeviceSopSearch() { |
| | | const res = await DeviceSopSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | }, |
| | | async getDeviceTypeSearch() { |
| | | const { data: res } = await DeviceTypeSearch() |
| | | this.devicetypeArr = res |
| | | }, |
| | | // æåºæ¹åæ¶ |
| | | sortChange({ column, prop, order }) { |
| | |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getSystemSopSearch() |
| | | this.getDeviceSopSearch() |
| | | }, |
| | | // æ¥è¯¢ |
| | | search() { |
| | | this.getSystemSopSearch() |
| | | this.getDeviceSopSearch() |
| | | }, |
| | | // ææ°çæ¬æ¹åæ¶è§¦å |
| | | checkedChange(val) { |
| | | this.form.check = val ? 'Y' : 'N' |
| | | this.getSystemSopSearch() |
| | | this.getDeviceSopSearch() |
| | | }, |
| | | // æä»¶æ°éè¶
è¿éå®è§¦å |
| | | handleExceed() { |
| | | this.$message.info('æä¸æ¯æå¤æä»¶ä¸ä¼ ï¼') |
| | | }, |
| | | |
| | | async devicetypecodeChange(eqptypecode) { |
| | | const { data: res } = await EqpTypecodeSeachEqpPermissions({ eqptypecode }) |
| | | this.deviceArr = res |
| | | this.dialogForm.device = res.length > 0 ? res.map(i => i.code) : [] |
| | | }, |
| | | // éç½® |
| | | reset() { |
| | | this.form.search = '' |
| | | this.getSystemSopSearch() |
| | | this.getDeviceSopSearch() |
| | | }, |
| | | // æ°å¢æé® |
| | | 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) |
| | | window.open(process.env.VUE_APP_BASE_API_FILE + row.filepath) |
| | | }, |
| | | |
| | | // å é¤æé® |
| | |
| | | }).then(() => { |
| | | const data = { |
| | | id: row.id, |
| | | filepath: row.file_path |
| | | eqpcode: row.eqpcode, |
| | | filepath: row.filepath |
| | | } |
| | | SystemSopDelete(data).then(res => { |
| | | DeviceSopDeleteSeave(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('å 餿å!') |
| | | if (this.form.page > 1 && this.tableData.length === 1) { |
| | | this.form.page-- |
| | | } |
| | | this.getSystemSopSearch() |
| | | this.getDeviceSopSearch() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | }, |
| | | // å¯¹è¯æ¡å
³éäºä»¶ |
| | | handleClose() { |
| | | this.dialogForm.devicetvpecode = '' |
| | | this.dialogForm.partcode = '' |
| | | this.dialogForm.devicetypecode = '' |
| | | this.dialogForm.device = '' |
| | | this.dialogForm.defilename = '' |
| | | this.dialogForm.filetypecode = '' |
| | | this.dialogForm.fileversion = '' |
| | |
| | | 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('eqptypecode', this.dialogForm.devicetypecode) |
| | | formData.append('device', this.dialogForm.device.join(',')) |
| | | formData.append('filename', 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) |
| | | formData.append('file', 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 => { |
| | | DeviceSopAddSeave(formData).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('æä»¶ä¸ä¼ æåï¼') |
| | | this.dialogVisible = false |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.getSystemSopSearch() |
| | | this.getDeviceSopSearch() |
| | | } else { |
| | | this.$message.error('æä»¶ä¸ä¼ 失败ï¼') |
| | | this.$store.state.app.buttonIsDisabled = false |