| | |
| | | <template> |
| | | <el-dialog class="command-page-view-dialog" v-model="visible" :title="dialogTitle" @closed="handleClosed" |
| | | destroy-on-close> |
| | | destroy-on-close :close-on-click-modal="false"> |
| | | <div class="detail-container" v-if="dialogReadonly"> |
| | | <div class="detail-title">设备详情</div> |
| | | <el-row> |
| | |
| | | <el-col :span="12"> |
| | | <div class="label">设备类型</div> |
| | | <div class="val">{{ formData.deviceType }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">设备编码</div> |
| | | <div class="val">{{ formData.deviceSn }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">设备属性</div> |
| | |
| | | <div class="command-table-content"> |
| | | <el-table class="command-table" :data="list"> |
| | | <el-table-column type="index" width="60" label="序号" /> |
| | | <el-table-column prop="charger" label="用户" /> |
| | | <el-table-column prop="contactPhone" label="电话" /> |
| | | <el-table-column prop="charger" label="负责人" /> |
| | | <el-table-column prop="contactPhone" label="联系电话" /> |
| | | <el-table-column prop="outTarget" label="出库去向" /> |
| | | <el-table-column prop="outTime" label="出库时间" /> |
| | | <el-table-column prop="purpose" label="用途" /> |
| | |
| | | <el-option v-for="item in dictObj.deviceType" :key="item.dictKey" :label="item.dictValue" |
| | | :value="item.dictKey" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设备编码" prop="deviceSn"> |
| | | <el-input class="command-input" v-model="formData.deviceSn" maxlength="50" |
| | | placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button color="#2B2B4C" @click="handleCancel">{{ dialogReadonly ? '关闭' : '取消' }}</el-button> |
| | | <el-button v-if="dialogMode != 'view'" color="#2B2B4C" @click="handleCancel">{{ dialogReadonly ? '关闭' : '取消' }}</el-button> |
| | | <el-button color="#284FE3" v-if="!dialogReadonly" type="primary" :loading="submitting" |
| | | :disabled="submitting" @click="handleSubmit"> |
| | | 保存 |
| | |
| | | import { getUserListApi } from '@/api/system/user' |
| | | import { fieldRules, getDictLabel } from '@ztzf/utils' |
| | | import { fwDeviceTrackPageApi } from '@/views/basicManage/deviceStock/fwDeviceTrackApi' |
| | | import { saveOperationLog } from '@ztzf/apis' |
| | | import { useRoute } from 'vue-router' |
| | | |
| | | const initForm = () => ({ |
| | | belongDept: '', // 所属部门 |
| | |
| | | contactPhone: '', // 联系电话 |
| | | deviceAtt: '', // 设备属性 |
| | | deviceType: '', // 设备类型 |
| | | deviceSn: '', // 设备编码 |
| | | deviceModel: '', // 型号 |
| | | deviceSpecification: '', // 规格 |
| | | deviceName: '', // 设备名称 |
| | |
| | | const dictObj = inject('dictObj') |
| | | const deptTree = inject('deptTree') |
| | | const emit = defineEmits(['success']) |
| | | const route = useRoute() |
| | | const formRef = ref(null) // 表单实例 |
| | | const formData = ref(initForm()) // 表单数据 |
| | | const visible = ref(false) // 弹框显隐 |
| | |
| | | const rules = { |
| | | deviceName: fieldRules(true, 50), |
| | | deviceType: fieldRules(true), |
| | | deviceSn: fieldRules(true, 50), |
| | | deviceAtt: fieldRules(true), |
| | | deviceModel: fieldRules(true, 50), |
| | | deviceSpecification: fieldRules(true, 50), |
| | |
| | | submitting.value = true |
| | | try { |
| | | await fwDeviceSubmitApi(formData.value) |
| | | const actionText = dialogMode.value === 'add' ? '建档' : '编辑' |
| | | saveOperationLog({ |
| | | requestUri: route.path, |
| | | title: `${route.name || '设备出入库'}-${actionText}`, |
| | | type: 1 |
| | | }) |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | | visible.value = false |
| | | emit('success') |