| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- è®¾å¤æ
é --> |
| | | <template> |
| | | <div> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æµç¨ç¼å·ï¼</div> |
| | | <div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="search.processNumber" style="width: 100%;" |
| | | @keyup.enter.native="getTableList(clickNodeVal.value)"> |
| | | </el-input> |
| | | </div> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 30px;"> |
| | | <el-button size="small" @click="resetSearch">é ç½®</el-button> |
| | | <el-button size="small" type="primary" @click="getTableList(clickNodeVal.value)">æ¥ è¯¢</el-button> |
| | | </div> |
| | | <div class="btns"> |
| | | <el-button size="small" type="primary" @click="dialogVisible = true, addRecode()">æ°å»º</el-button> |
| | | <el-button size="small" type="primary" @click="handleDown" :loading="outLoading">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div class="tables" style="margin-top: 16px;"> |
| | | <el-table :data="faultParam" style="width: 100%" height="calc(100vh - 20em)"> |
| | | <!-- è¡¨æ ¼å --> |
| | | <el-table-column header-align="center" align="center" width="70" prop="prop" label="åºå·" |
| | | type="index"></el-table-column> |
| | | <el-table-column prop="processNumber" label="æµç¨ç¼å·" min-width="180"></el-table-column> |
| | | <el-table-column prop="deviceName" label="设å¤åç§°" min-width="150"></el-table-column> |
| | | <el-table-column prop="managementNumber" label="ç»ä¸ç¼å·" min-width="150"></el-table-column> |
| | | <el-table-column prop="faultSituation" label="æ
éæ
åµ" min-width="130"></el-table-column> |
| | | <el-table-column prop="submitPerson" label="æäº¤äºº" min-width="130"></el-table-column> |
| | | <el-table-column prop="createTime" label="æäº¤æ¥æ" min-width="150"></el-table-column> |
| | | <el-table-column prop="currentState" label="å½åç¶æ" min-width="130"></el-table-column> |
| | | <el-table-column prop="currentResponsible" label="å½å责任人" width="180"></el-table-column> |
| | | <!-- æä½æé® --> |
| | | <el-table-column label="æä½" fixed="right" min-width="150"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="small" type="text" @click="showDetailsDialog(scope.row)">æ¥ç详æ
</el-button> |
| | | <el-button type="text" size="small" @click="handleDeleteClick(scope.$index, scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="1" |
| | | style="margin-right: 5%;" :page-sizes="[10, 20, 30, 50, 100]" :page-size="search.size" |
| | | layout="->,total, sizes, prev, pager, next, jumper" :total="search.total"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | <el-dialog title="æ°å¢ç»´ä¿®è®°å½" top="5vh" :visible.sync="dialogVisible" width="60%" @open="openRecordAcceptance" |
| | | :close-on-click-modal="false" :close-on-press-escape="false"> |
| | | <el-steps :active="currentStep" finish-status="success" align-center> |
| | | <el-step v-for="(v, i) in steps" style="cursor:pointer" :title="v" :key="i" |
| | | @click.native="choiceStep(i)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="form" :model="form" label-position="right" label-width="120px"> |
| | | <!-- æäº¤ --> |
| | | <div v-show="currentStepClick == 0"> |
| | | <el-card style="margin-top: 1em;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æµç¨ç¼å·:"> |
| | | <el-input v-model="form.processNumber" size="small" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤åç§°:"> |
| | | <el-input v-model="form.deviceName" size="small" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è§æ ¼åå·:"> |
| | | <el-input v-model="form.specificationModel" size="small" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤ç¼å·:"> |
| | | <el-input v-model="form.managementNumber" size="small" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å确度éå¼:" prop="measureOfAccuracy" |
| | | :rules="[{ required: currentStep === 0, message: '请è¾å
¥å确度éå¼', trigger: 'blur' }]"> |
| | | <el-input v-model="form.measureOfAccuracy" size="small" :disabled="currentStep !== 0"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ
鿥æ:" prop="faultDate"> |
| | | <el-date-picker v-model="form.faultDate" type="date" placeholder="éæ©æ¥æ" size="small" |
| | | format="yyyy-MM-dd" style="width: 100%" value-format="yyyy-MM-dd" :disabled="currentStep !== 0"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è¦æ±ä¿®å¤æ¥æ:" prop="requestRepairDate"> |
| | | <el-date-picker v-model="form.requestRepairDate" :picker-options="{ disabledDate: this.disabledDate }" |
| | | type="date" placeholder="éæ©æ¥æ" size="small" format="yyyy-MM-dd" style="width: 100%" |
| | | value-format="yyyy-MM-dd" :disabled="currentStep !== 0"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ
éæ
åµ:" prop="faultSituation" |
| | | :rules="[{ required: currentStep === 0, message: '请è¾å
¥æ
éæ
åµ', trigger: 'blur' }]"> |
| | | <el-input v-model="form.faultSituation" type="textarea" size="small" |
| | | :disabled="currentStep !== 0"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç¸å
³éä»¶:"> |
| | | <el-input v-model="form.fileName" :disabled="true" size="small" style="width: 80%;"> |
| | | <el-button slot="append" icon="el-icon-delete-solid" @click="deleteFile" |
| | | :disabled="currentStep !== 0"></el-button> |
| | | </el-input> |
| | | <el-upload ref="upload" style="float: right;" :action="action" :show-file-list="false" |
| | | :on-success="handleSuccess"> |
| | | <el-button style="position: relative;top: -4px;" class="uploadFile" slot="trigger" size="small" |
| | | type="primary" :disabled="currentStep !== 0">éä»¶ä¸ä¼ |
| | | </el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸ç¯èè´è´£äºº:" prop="submitNextPesponsible" |
| | | :rules="[{ required: currentStep === 0, message: '请è¾å
¥ä¸ç¯èè´è´£äºº', trigger: 'change' }]"> |
| | | <el-select v-model="form.submitNextPesponsible" placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" |
| | | style="width: 100%" :disabled="currentStep !== 0"> |
| | | <el-option v-for="(v, i) in users" :label="v.name" :value="v.name" :key="i"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.submitOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.submitDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- 设å¤ç®¡çåæè§ --> |
| | | <div v-show="currentStepClick == 1"> |
| | | <el-card style="margin-top: 1em; height: 45vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç»´ä¿®æ¹å¼åè´¹ç¨:" prop="methodCost" |
| | | :rules="[{ required: currentStep === 1, message: '请è¾å
¥ç»´ä¿®æ¹å¼åè´¹ç¨', trigger: 'blur' }]"> |
| | | <el-input v-model="form.methodCost" type="textarea" size="small" |
| | | :disabled="currentStep !== 1"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="å®¡æ ¸æè§:" prop="adminAuditOption" |
| | | :rules="[{ required: currentStep === 1, message: '请è¾å
¥å®¡æ ¸æè§', trigger: 'blur' }]"> |
| | | <el-input v-model="form.adminAuditOption" type="textarea" size="small" |
| | | :disabled="currentStep !== 1"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸ç¯èè´è´£äºº:" prop="adminNextPesponsible" |
| | | :rules="[{ required: currentStep === 1, message: '请è¾å
¥ä¸ç¯èè´è´£äºº', trigger: 'change' }]"> |
| | | <el-select v-model="form.adminNextPesponsible" placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" |
| | | style="width: 100%" :disabled="currentStep !== 1"> |
| | | <el-option v-for="(v, i) in users" :label="v.name" :value="v.name" :key="i"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.adminOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.adminDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- ææ¯è´è´£äººæè§ --> |
| | | <div v-show="currentStepClick == 2"> |
| | | <el-card style="margin-top: 1em; height: 45vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="å®¡æ ¸æè§:" prop="technicalAuditOption" |
| | | :rules="[{ required: currentStep === 2, message: '请è¾å
¥å®¡æ ¸æè§', trigger: 'blur' }]"> |
| | | <el-input v-model="form.technicalAuditOption" type="textarea" size="small" |
| | | :disabled="currentStep !== 2"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸ç¯èè´è´£äºº:" prop="technicalNextPesponsible" |
| | | :rules="[{ required: currentStep === 2, message: '请è¾å
¥ä¸ç¯èè´è´£äºº', trigger: 'change' }]"> |
| | | <el-select v-model="form.technicalNextPesponsible" placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" |
| | | style="width: 100%" :disabled="currentStep !== 2"> |
| | | <el-option v-for="(v, i) in users" :label="v.name" :value="v.name" :key="i"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.technicalOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.technicalDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- ç»´ä¿®æ
åµè®°å½ --> |
| | | <div v-show="currentStepClick == 3"> |
| | | <el-card style="margin-top: 1em; height: 45vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç»´ä¿®æ
åµ:" prop="maintainSituation" |
| | | :rules="[{ required: currentStep === 3, message: '请è¾å
¥ç»´ä¿®æ
åµ', trigger: 'blur' }]"> |
| | | <el-input v-model="form.maintainSituation" type="textarea" size="small" |
| | | :disabled="currentStep !== 3"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸ç¯èè´è´£äºº:" prop="maintainNextPesponsible" |
| | | :rules="[{ required: currentStep === 3, message: '请è¾å
¥ä¸ç¯èè´è´£äºº', trigger: 'change' }]"> |
| | | <el-select v-model="form.maintainNextPesponsible" placeholder="è¯·éæ©ä¸ç¯èè´è´£äºº" size="small" |
| | | style="width: 100%" :disabled="currentStep !== 3"> |
| | | <el-option v-for="(v, i) in users" :label="v.name" :value="v.name" :key="i"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.maintainOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.maintainDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- ç»´ä¿®åç确认 --> |
| | | <div v-show="currentStepClick == 4"> |
| | | <el-card style="margin-top: 1em; height: 45vh; overflow-y: scroll;"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="éªæ¶ãç¡®è®¤ãæ ¡åæ
åµ:" prop="checkCalSituation" label-width="200" |
| | | :rules="[{ required: currentStep === 4, message: '请è¾å
¥éªæ¶ãç¡®è®¤ãæ ¡åæ
åµ', trigger: 'blur' }]"> |
| | | <el-input v-model="form.checkCalSituation" type="textarea" size="small" style="width: 100%" |
| | | :disabled="currentStep !== 4"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row style="margin-top: 1em;"> |
| | | <el-col :span="4"> |
| | | æä½äººï¼{{ form.afterMaintenanceOperatingPersonnel }} |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | æ¥æï¼{{ form.afterMaintenanceDate }} |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="submitForm('3reject')" v-if="currentStep !== 0 && currentStep !== 5" |
| | | :loading="sumbitLoading1">驳å</el-button> |
| | | <el-button @click="submitForm('2save')" v-if="currentStep === 0" :loading="sumbitLoading2">ä¿å</el-button> |
| | | <el-button type="primary" v-if="currentStep !== 5" @click="submitForm('1submit')" :loading="sumbitLoading3"> |
| | | {{ currentStep === 0 ? 'æäº¤' : 'éè¿' }} |
| | | </el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { dateFormat } from '@/utils/date' |
| | | import { mapGetters } from "vuex"; |
| | | import { |
| | | addOrUpdateDeviceFaultOne, |
| | | deleteCNASFile, deleteDeviceFaultOne, |
| | | deviceFaultOnePage, exportRewardAndPunishmentRecords, |
| | | selectDeviceByCode |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | search: { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | processNumber: '' |
| | | }, |
| | | users: [], |
| | | currentStep: 0, |
| | | currentStepClick: 0, |
| | | steps: ['æäº¤', '设å¤ç®¡çåæè§', 'ææ¯è´è´£äººæè§', 'ç»´ä¿®æ
åµè®°å½', 'ç»´ä¿®åç确认'], |
| | | outLoading: false, |
| | | form: {}, |
| | | faultParam: [], |
| | | dialogVisible: false, |
| | | sumbitLoading1: false, |
| | | sumbitLoading2: false, |
| | | sumbitLoading3: false, |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | action() { |
| | | return this.javaApi + '/personBasicInfo/saveCNASFile' |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getTableList(this.clickNodeVal.value) |
| | | }, |
| | | methods: { |
| | | //è¦æ±ä¿®å¤æ¥æ:ç¦ç¨å¨æ
鿥æåçæ¥æ |
| | | disabledDate(time) { |
| | | let selectDate = this.form.faultDate |
| | | if (selectDate) { |
| | | let selectTime = new Date(selectDate).getTime() - 28800000 |
| | | return time < selectTime |
| | | } |
| | | return false |
| | | }, |
| | | //æäº¤è¡¨å |
| | | async submitForm(saveState) { |
| | | let currentStepAction; |
| | | // 设置该æä½å¤ææ¯å¦ä¸ºæäº¤ï¼ä¿åï¼é©³åï¼éè¿ å¼å¯loding |
| | | switch (saveState) { |
| | | // æäº¤ï¼éè¿ |
| | | case '1submit': |
| | | currentStepAction = this.currentStep + 1 |
| | | this.sumbitLoading1 = true |
| | | break |
| | | // ä¿å |
| | | case '2save': |
| | | currentStepAction = this.currentStep |
| | | this.sumbitLoading2 = true |
| | | break |
| | | // 驳å |
| | | case '3reject': |
| | | currentStepAction = this.currentStep - 1 |
| | | this.sumbitLoading3 = true |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid === true || saveState !== '1submit') { |
| | | // ç»å½åç¯è设置åå»ºäººä¸æ¶é´ |
| | | const dateTime = dateFormat(new Date()) |
| | | // è·åå½åç¯èæä½äººä¸æ¥æ |
| | | switch (this.currentStep) { |
| | | case 0: |
| | | this.form.submitUser = this.nickName |
| | | this.form.submitOperatingPersonnel = this.nickName |
| | | this.form.submitDate = dateTime |
| | | break |
| | | case 1: |
| | | this.form.adminOperatingPersonnel = this.nickName |
| | | this.form.adminDate = dateTime |
| | | break |
| | | case 2: |
| | | this.form.technicalOperatingPersonnel = this.nickName |
| | | this.form.technicalDate = dateTime |
| | | break |
| | | case 3: |
| | | this.form.maintainOperatingPersonnel = this.nickName |
| | | this.form.maintainDate = dateTime |
| | | break |
| | | case 4: |
| | | this.form.afterMaintenanceOperatingPersonnel = this.nickName |
| | | this.form.afterMaintenanceDate = dateTime |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | // è·åå½åç¯èè´è´£äºº |
| | | switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) { |
| | | case 0: |
| | | this.form.currentResponsible = this.form.submitOperatingPersonnel |
| | | break |
| | | case 1: |
| | | this.form.currentResponsible = this.form.departmentOperatingPersonnel |
| | | break |
| | | case 2: |
| | | this.form.currentResponsible = this.form.measuringRoomOperatingPersonnel |
| | | break |
| | | case 3: |
| | | this.form.currentResponsible = this.form.approvalOperatingPersonnel |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | // è·åå½åç¶æ |
| | | this.form.currentState = currentStepAction === 5 ? 'å
³é' : this.steps[currentStepAction] |
| | | this.form.deviceId = this.clickNodeVal.value |
| | | addOrUpdateDeviceFaultOne(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå') |
| | | this.getTableList(this.clickNodeVal.value) |
| | | this.dialogVisible = false |
| | | } |
| | | this.closeLoading() |
| | | }) |
| | | } else { |
| | | let step = this.steps[this.currentStep] |
| | | this.$message.warning(step + ' æµç¨ä¸æå¿
填项æªå¡«ï¼'); |
| | | this.closeLoading() |
| | | } |
| | | }); |
| | | }, |
| | | closeLoading() { |
| | | this.sumbitLoading1 = false |
| | | this.sumbitLoading2 = false |
| | | this.sumbitLoading3 = false |
| | | }, |
| | | openRecordAcceptance() { |
| | | // è·å设å¤åºç¡ä¿¡æ¯ |
| | | selectDeviceByCode({id: this.clickNodeVal.value}).then(res => { |
| | | this.form.deviceName = res.data.deviceName |
| | | this.form.manufacturer = res.data.manufacturer |
| | | this.form.specificationModel = res.data.specificationModel |
| | | this.form.managementNumber = res.data.managementNumber |
| | | }); |
| | | // è·åè´è´£äººä¿¡æ¯ |
| | | this.getUserList() |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | getUserList() { |
| | | selectUserCondition().then((res) => { |
| | | this.users = res.data; |
| | | }); |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.search.size = val |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.search.current = val |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | deleteFile() { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteCNASFile({fileName: this.form.systemFileName}).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿åï¼') |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | choiceStep(index) { |
| | | this.currentStepClick = index |
| | | }, |
| | | //ææ¡£ |
| | | handleSuccess(response, file, fileList) { |
| | | if (response.code == 200) { |
| | | this.form.fileName = response.data |
| | | this.$message.success('ä¸ä¼ æå') |
| | | } else { |
| | | this.$message.error(response.msg) |
| | | } |
| | | }, |
| | | onError(error, file, fileList) { |
| | | // æä»¶ä¸ä¼ 失败æ¶çå¤çé»è¾ |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }, |
| | | resetSearch() { |
| | | this.search = { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | processNumber: '', |
| | | } |
| | | this.getTableList(this.clickNodeVal.value); |
| | | }, |
| | | //è·åææä¿¡æ¯ |
| | | getTableList(deviceId) { |
| | | const params = { |
| | | deviceId: deviceId, |
| | | size: this.search.size, |
| | | current: this.search.current, |
| | | processNumber: this.search.processNumber, |
| | | } |
| | | deviceFaultOnePage(params).then(res => { |
| | | if (res.code == 200) { |
| | | this.faultParam = res.data.records |
| | | this.search.total = res.data.total |
| | | } |
| | | }) |
| | | }, |
| | | //å¯¼åº |
| | | handleDown() { |
| | | this.outLoading = true |
| | | exportRewardAndPunishmentRecords({deviceId: this.clickNodeVal.value}).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$dowmload.saveAs(blob, 'è®¾å¤æ
é表.xlsx') |
| | | }) |
| | | }, |
| | | selectAllByOne(row) { |
| | | this.dialogVisible = true; |
| | | this.formData = this.HaveJson(row); |
| | | }, |
| | | //æ·»å è®°å½æé® |
| | | addRecode() { |
| | | this.currentStep = 0; |
| | | this.currentStepClick = 0; |
| | | }, |
| | | //æ¥ç详æ
|
| | | showDetailsDialog(row) { |
| | | this.form = { ...row } |
| | | this.currentStep = this.steps.indexOf(this.form.currentState) === -1 ? 5 : this.steps.indexOf(this.form.currentState) |
| | | this.currentStepClick = this.currentStep === 5 ? 0 : this.currentStep |
| | | this.$nextTick(() => { |
| | | this.$refs['form'].clearValidate() |
| | | }) |
| | | this.dialogVisible = true |
| | | }, |
| | | //å é¤æä½ |
| | | handleDeleteClick(index, row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteDeviceFaultOne({id: row.id}).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿å') |
| | | this.getTableList(this.clickNodeVal.value) |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | if (newVal.value) { |
| | | this.getTableList(newVal.value); |
| | | } |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (!newVal) { |
| | | this.form = {} |
| | | this.closeLoading() |
| | | this.currentStep = 0 // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | this.currentStepClick = 0 // ç¹å»æ¥éª¤æ¡åå |
| | | this.$refs['form'].clearValidate() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | h4 { |
| | | font-weight: 400; |
| | | font-size: 16px; |
| | | /* display: flex; |
| | | justify-content: space-between; */ |
| | | margin: 10px 0; |
| | | } |
| | | |
| | | /* |
| | | ä¿åæäº¤æé®æ ·å¼ |
| | | */ |
| | | h4 .title { |
| | | width: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | h4 .title .line { |
| | | display: inline-block; |
| | | width: 3px; |
| | | height: 16px; |
| | | background: #3A7BFA; |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | .tables { |
| | | width: 100%; |
| | | height: calc(100vh - 230px); |
| | | } |
| | | |
| | | .el-from { |
| | | max-width: 400px; |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .form-row { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .dialogBottom { |
| | | margin-top: 14px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .form-operation { |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .form-item { |
| | | display: flex; |
| | | margin-right: 100px; |
| | | } |
| | | |
| | | .label { |
| | | margin-right: 20px; |
| | | line-height: 40px; |
| | | } |
| | | |
| | | .value { |
| | | font-weight: normal; |
| | | line-height: 40px; |
| | | } |
| | | |
| | | .form-row .el-form-item { |
| | | flex: 1; |
| | | /* æ¯ä¸ªè¡¨åé¡¹å æ®ç¸åæ¯ä¾çç©ºé´ */ |
| | | margin-right: 100px; |
| | | /* å¯éï¼ä¸ºå³ä¾§å
ç´ æ·»å é´è· */ |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 40px; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | } |
| | | |
| | | .search_thing { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | height: 40px; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 70px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 120px); |
| | | } |
| | | |
| | | .btns { |
| | | position: absolute; |
| | | right: 0px; |
| | | top: 50%; |
| | | transform: translate(0, -50%); |
| | | } |
| | | |
| | | .form .search_label { |
| | | width: 120px; |
| | | } |
| | | </style> |