| | |
| | | <template> |
| | | <el-dialog v-model="visible" :title="dialogTitle" @closed="handleClosed" destroy-on-close> |
| | | <div v-if="dialogReadonly"> |
| | | <h3>设备详情</h3> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <div>设备信息: {{ formData.deviceName }}</div> |
| | |
| | | <div>用途: {{ formData.purpose }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div>所属部门: {{ formData.belongDept }}</div> |
| | | <div>所属部门: {{ formData.belongDeptName }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div>负责人: {{ formData.charger }}</div> |
| | |
| | | <div>联系电话: {{ formData.contactPhone }}</div> |
| | | </el-col> |
| | | </el-row> |
| | | <h3>出库去向详情</h3> |
| | | <el-table v-loading="loading" :data="list"> |
| | | <el-table-column type="index" width="60" label="序号" /> |
| | | <el-table-column prop="charger" label="用户" /> |
| | |
| | | :data="deptTree" |
| | | :props="treeProps" |
| | | check-strictly |
| | | @change="getUserList" |
| | | @change="belongDeptChange" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="负责人" prop="charger"> |
| | | <el-select v-model="formData.charger" placeholder="请选择" :disabled="!formData.belongDept" clearable> |
| | | <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id" /> |
| | | <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.name" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <script setup> |
| | | import { computed, ref } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { fwDeviceDetailApi, fwDevicePageApi, fwDeviceSubmitApi } from '@/views/basicManage/deviceStock/fwDevice' |
| | | import { fwDeviceDetailApi, fwDeviceSubmitApi } from '@/views/basicManage/deviceStock/fwDevice' |
| | | import { getUserListApi } from '@/api/system/user' |
| | | import { fieldRules, getDictLabel } from '@ztzf/utils' |
| | | import { fwDeviceTrackPageApi } from '@/views/basicManage/deviceStock/fwDeviceTrackApi' |
| | |
| | | |
| | | const rules = { |
| | | deviceName: fieldRules(true, 50), |
| | | deviceType: fieldRules(true, 0), |
| | | deviceAtt: fieldRules(true, 0), |
| | | deviceType: fieldRules(true), |
| | | deviceAtt: fieldRules(true), |
| | | deviceModel: fieldRules(true, 50), |
| | | deviceSpecification: fieldRules(true, 50), |
| | | manufacturer: fieldRules(true, 50), |
| | | source: fieldRules(true, 50), |
| | | purpose: fieldRules(true, 50), |
| | | belongDept: fieldRules(true, 50), |
| | | belongDept: fieldRules(true), |
| | | contactPhone: fieldRules(true, 50), |
| | | charger: fieldRules(true, 0), |
| | | charger: fieldRules(true), |
| | | } |
| | | |
| | | const userList = ref([]) |
| | | function getUserList(val) { |
| | | |
| | | function belongDeptChange() { |
| | | formData.value.charger = '' |
| | | if (val) { |
| | | getUserListApi(val).then(res => { |
| | | userList.value = res.data.data.records |
| | | }) |
| | | } |
| | | } |
| | | |
| | | function getUserList() { |
| | | getUserListApi(formData.value.belongDept).then(res => { |
| | | userList.value = res.data.data.records |
| | | }) |
| | | } |
| | | |
| | | watch(() => formData.value.belongDept, getUserList) |
| | | |
| | | // 关闭弹框 |
| | | function handleCancel() { |
| | |
| | | // 打开弹框 |
| | | async function open({ mode, row } = {}) { |
| | | dialogMode.value = mode || 'add' |
| | | formData.value = row |
| | | visible.value = true |
| | | if (dialogMode.value === 'add') { |
| | | formData.value = initForm() |
| | | } else { |
| | | formData.value = row |
| | | await loadDetail() |
| | | getList() |
| | | } |