|
@@ -0,0 +1,315 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <!-- 设备台账全部信息 -->
|
|
|
+ <el-dialog v-if="visible" :title="title" width="55%" custom-class="dialog-max" top="5vh"
|
|
|
+ :before-close="dialogClose" :visible.sync="visible" :close-on-click-modal="false" :append-to-body="true">
|
|
|
+ <el-form ref="deviceLedgerForm" :model="deviceLedgerForm" label-width="120px"
|
|
|
+ label-position="right">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="设备类别" prop="deviceType" >
|
|
|
+ <el-input v-model="deviceLedgerForm.deviceType" readonly placeholder="请选择设备类别" maxlength="10">
|
|
|
+ <el-button type="primary" slot="append" @click="chooseDeviceType">选择</el-button>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="设备名称" prop="deviceName" >
|
|
|
+ <el-input v-model="deviceLedgerForm.deviceName" placeholder="请输入设备名称" maxlength="10"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="设备编号" prop="deviceNum" >
|
|
|
+ <el-input v-model="deviceLedgerForm.deviceNum" placeholder="请输入设备编号" maxlength="10"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="设备等级" prop="deviceLevel" >
|
|
|
+ <el-select clearable v-model="deviceLedgerForm.deviceLevel" placeholder="请选择设备等级">
|
|
|
+ <el-option v-for="deviceLevel in deviceLevelList" :key="deviceLevel.id"
|
|
|
+ :label="deviceLevel.dictValue" :value="deviceLevel.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="设备规格型号" prop="deviceModel" >
|
|
|
+ <el-input v-model="deviceLedgerForm.deviceModel" placeholder="请输入设备规格型号" maxlength="10"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="设备位置" prop="deviceLocation" >
|
|
|
+ <el-input v-model="deviceLedgerForm.deviceLocation" placeholder="请输入设备位置" maxlength="10"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="设备健康状态" prop="deviceHealth" >
|
|
|
+ <el-select clearable v-model="deviceLedgerForm.deviceHealth" placeholder="请选择健康状态">
|
|
|
+ <el-option v-for="deviceHealth in deviceHealthList" :key="deviceHealth.id"
|
|
|
+ :label="deviceHealth.dictValue" :value="deviceHealth.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="使用部门" prop="deviceDeptName" >
|
|
|
+ <el-input v-model="deviceLedgerForm.deviceDeptName" readonly placeholder="请选择使用部门"
|
|
|
+ maxlength="10">
|
|
|
+ <el-button slot="append" @click="chooseDept">选择</el-button>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="责任人" prop="devicePersonName" >
|
|
|
+ <el-input v-model="deviceLedgerForm.devicePersonName" readonly placeholder="请选择责任人"
|
|
|
+ maxlength="10">
|
|
|
+ <el-button type="primary" slot="append" @click="chooseDevicePerson">选择</el-button>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="供应商" prop="supplier" >
|
|
|
+ <el-select clearable v-model="deviceLedgerForm.supplier" placeholder="请选择供应商">
|
|
|
+ <el-option v-for="supplier in supplierList" :key="supplier.id" :label="supplier.dictValue"
|
|
|
+ :value="supplier.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="制造商" prop="manufacturer" >
|
|
|
+ <el-select clearable v-model="deviceLedgerForm.manufacturer" placeholder="请选择制作商">
|
|
|
+ <el-option v-for="manufacturer in manufacturerList" :key="manufacturer.id"
|
|
|
+ :label="manufacturer.dictValue" :value="manufacturer.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="设备序列号" prop="serialNumber" >
|
|
|
+ <el-input v-model="deviceLedgerForm.serialNumber" placeholder="请输入设备序列号" maxlength="10"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="运行条件" prop="runCondition" >
|
|
|
+ <el-input v-model="deviceLedgerForm.runCondition" placeholder="请选择运行条件" maxlength="10"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="使用状态" prop="deviceState" >
|
|
|
+ <el-select clearable v-model="deviceLedgerForm.deviceState" placeholder="请选择使用状态">
|
|
|
+ <el-option v-for="deviceState in deviceStateList" :key="deviceState.id"
|
|
|
+ :label="deviceState.dictValue" :value="deviceState.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="是否展示" prop="isShow" >
|
|
|
+ <el-select clearable v-model="deviceLedgerForm.isShow" placeholder="请选择单位">
|
|
|
+ <el-option v-for="isShow in isShowList" :key="isShow.value" :label="isShow.label"
|
|
|
+ :value="isShow.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" style="text-align: right">
|
|
|
+ <el-button size="mini" v-show="queryShow" type="primary" @click="queryDeviceLedgerEvent">搜索</el-button>
|
|
|
+ <el-button type="info" size="mini" @click="resetForm('deviceLedgerForm')">重置</el-button>
|
|
|
+ <el-button size="mini" @click="dialogClose">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 选择设备类别 -->
|
|
|
+ <ChooseDeviceType ref="chooseDeviceType" @receiveChooseDeviceType="receiveChooseDeviceType"></ChooseDeviceType>
|
|
|
+ <!-- 选择部门 -->
|
|
|
+ <ChooseDept ref="chooseDept" @receiveChooseDept="receiveChooseDept"></ChooseDept>
|
|
|
+ <!-- 选择责任人 -->
|
|
|
+ <ChooseStaff ref="chooseDevicePerson" @receiveChooseStaff="receiveChooseStaff"></ChooseStaff>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import SelectTree from '@/components/SelectTree/index.vue'
|
|
|
+import ChooseDeviceType from '@/views/device/deviceType/chooseDeviceType.vue'
|
|
|
+import ChooseDept from '@/views/system/dept/chooseDept.vue'
|
|
|
+import ChooseStaff from '@/views/system/staff/chooseStaff.vue'
|
|
|
+import { getDictListByType } from '@/api/system/dict';
|
|
|
+import {
|
|
|
+ addDeviceLedger,
|
|
|
+ updateDeviceLedger
|
|
|
+} from '@/api/device/deviceLedger'
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ SelectTree,
|
|
|
+ ChooseDeviceType,
|
|
|
+ ChooseDept,
|
|
|
+ ChooseStaff
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getDictListByType('device_level', (data) => {
|
|
|
+ this.deviceLevelList = data
|
|
|
+ })
|
|
|
+ this.getDictListByType('device_health', (data) => {
|
|
|
+ this.deviceHealthList = data
|
|
|
+ })
|
|
|
+ this.getDictListByType('supplier', (data) => {
|
|
|
+ this.supplierList = data
|
|
|
+ })
|
|
|
+ this.getDictListByType('manufacturer', (data) => {
|
|
|
+ this.manufacturerList = data
|
|
|
+ })
|
|
|
+ this.getDictListByType('device_state', (data) => {
|
|
|
+ this.deviceStateList = data
|
|
|
+ })
|
|
|
+ this.getDictListByType('device_unit', (data) => {
|
|
|
+ this.deviceUnitList = data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ title: '新增设备台账',
|
|
|
+ queryShow: false,
|
|
|
+ //表单参数
|
|
|
+ deviceLedgerForm: {
|
|
|
+ id: null,
|
|
|
+ directoryId: null,
|
|
|
+ deviceTypeId: null,
|
|
|
+ deviceType: null,
|
|
|
+ deviceName: null,
|
|
|
+ deviceNum: null,
|
|
|
+ deviceLevel: null,
|
|
|
+ deviceModel: null,
|
|
|
+ deviceLocation: null,
|
|
|
+ deviceHealth: null,
|
|
|
+ deviceDeptId: null,
|
|
|
+ deviceDeptName: null,
|
|
|
+ devicePerson: null,
|
|
|
+ devicePersonName: null,
|
|
|
+ buyTime: null,
|
|
|
+ useTime: null,
|
|
|
+ supplier: null,
|
|
|
+ manufacturer: null,
|
|
|
+ serialNumber: null,
|
|
|
+ technicalDataList: [],
|
|
|
+ runCondition: null,
|
|
|
+ deviceState: null,
|
|
|
+ deviceUnit:null,
|
|
|
+ pictureList: [],
|
|
|
+ unit: null,
|
|
|
+ sortNum: null,
|
|
|
+ isShow: null,
|
|
|
+ remark: null,
|
|
|
+ upkeepPeriod:null,
|
|
|
+ periodType:null
|
|
|
+ },
|
|
|
+ periodTypeList: [
|
|
|
+ { name: '日', value: 0 },
|
|
|
+ { name: '月', value: 1 },
|
|
|
+ { name: '年', value: 2 }
|
|
|
+ ],
|
|
|
+ //字典回显参数
|
|
|
+ deviceLevelList: [],
|
|
|
+ deviceHealthList: [],
|
|
|
+ supplierList: [],
|
|
|
+ manufacturerList: [],
|
|
|
+ deviceStateList: [],
|
|
|
+ deviceUnitList: [],
|
|
|
+ //字典回显参数
|
|
|
+ isShowList: [{
|
|
|
+ value: 0,
|
|
|
+ label: '否'
|
|
|
+ }, {
|
|
|
+ value: 1,
|
|
|
+ label: '是'
|
|
|
+ }],
|
|
|
+ //设备技术参数得到的文件
|
|
|
+ technicalDataFiles: [],
|
|
|
+ //图片上传得到的文件
|
|
|
+ pictureFiles: [],
|
|
|
+ //修改时,删除的技术参数文件名
|
|
|
+ delTechnicalNameList: [],
|
|
|
+ //修改时,删除的图片文件名
|
|
|
+ delPictureNameList: [],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 关闭弹出层 */
|
|
|
+ dialogClose() {
|
|
|
+ this.resetForm('deviceLedgerForm')
|
|
|
+ this.visible = false
|
|
|
+ this.queryShow = false
|
|
|
+ },
|
|
|
+ /** 重置表单 */
|
|
|
+ resetForm(formName) {
|
|
|
+ this.$refs[formName].resetFields();
|
|
|
+ },
|
|
|
+ /** 获取字典数据 */
|
|
|
+ getDictListByType(params, callback) {
|
|
|
+ getDictListByType({ keyType: params }).then(res => {
|
|
|
+ callback(res.data);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 高级查询 */
|
|
|
+ queryDeviceLedgerEvent() {
|
|
|
+ let params = JSON.parse(JSON.stringify(this.deviceLedgerForm));
|
|
|
+ this.$emit('getDeviceLedgerPage',params)
|
|
|
+ this.visible = false
|
|
|
+ this.queryShow = false
|
|
|
+ },
|
|
|
+ /** 选择设备类别 */
|
|
|
+ chooseDeviceType() {
|
|
|
+ this.$refs.chooseDeviceType.visible = true
|
|
|
+ },
|
|
|
+ /** 接收选择设备类别传过来的值 */
|
|
|
+ receiveChooseDeviceType(data) {
|
|
|
+ this.deviceLedgerForm.deviceTypeId = data.id
|
|
|
+ this.deviceLedgerForm.deviceType = data.deviceType
|
|
|
+ },
|
|
|
+ /** 选择部门 */
|
|
|
+ chooseDept() {
|
|
|
+ this.$refs.chooseDept.visible = true
|
|
|
+ },
|
|
|
+ /** 接收选择部门传过来的值 */
|
|
|
+ receiveChooseDept(data) {
|
|
|
+ this.deviceLedgerForm.deviceDeptId = data.id
|
|
|
+ this.deviceLedgerForm.deviceDeptName = data.departmentName
|
|
|
+ },
|
|
|
+ /** 选择责任人 */
|
|
|
+ chooseDevicePerson() {
|
|
|
+ this.$refs.chooseDevicePerson.visible = true
|
|
|
+ },
|
|
|
+ receiveChooseStaff(data) {
|
|
|
+ this.deviceLedgerForm.devicePerson = data.id
|
|
|
+ this.deviceLedgerForm.devicePersonName = data.staffName
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style rel="stylesheet/scss" lang="scss" scoped>
|
|
|
+.dialog-max {
|
|
|
+ height: 90vh;
|
|
|
+
|
|
|
+ .el-dialog__body {
|
|
|
+ height: 77vh;
|
|
|
+ overflow: auto;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.el-upload-list {
|
|
|
+ // height: 40px;
|
|
|
+ overflow: auto;
|
|
|
+}
|
|
|
+</style>
|