| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="所属区域" prop="areaId"> |
| | | <el-tree-select |
| | | v-model="form.areaId" |
| | | :data="areaTree" |
| | | node-key="id" |
| | | :props="{ label: 'label', children: 'children' }" |
| | | check-strictly |
| | | clearable |
| | | placeholder="请选择所属区域" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="供应商" prop="supplierName"> |
| | | <el-input v-model="form.supplierName" placeholder="请输入供应商" /> |
| | | </el-form-item> |
| | |
| | | import useFormData from "@/hooks/useFormData"; |
| | | // import useUserStore from "@/store/modules/user"; |
| | | import { getLedgerById } from "@/api/equipmentManagement/ledger"; |
| | | import { getDeviceAreaTree } from "@/api/equipmentManagement/area"; |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | calculateTaxIncludeTotalPrice, |
| | |
| | | name: "设备台账表单", |
| | | }); |
| | | const formRef = ref(null); |
| | | const areaTree = ref([]); |
| | | const operationType = ref(''); |
| | | // 设备类型固定选项 |
| | | const deviceTypeOptions = ref([ |
| | |
| | | deviceModel: undefined, // 规格型号 |
| | | deviceBrand: undefined, // 设备品牌 |
| | | type: undefined, // 设备类型 |
| | | areaId: undefined, // 所属区域 |
| | | supplierName: undefined, // 供应商 |
| | | storageLocation: undefined, // 存放位置 |
| | | isDepr: 2, // 是否启用折旧 1-是 2-否 |
| | |
| | | } |
| | | }); |
| | | |
| | | const loadAreaTree = () => { |
| | | getDeviceAreaTree().then((res) => { |
| | | areaTree.value = res.data || []; |
| | | }); |
| | | }; |
| | | loadAreaTree(); |
| | | |
| | | const loadForm = async (id) => { |
| | | loadAreaTree(); |
| | | if (id) { |
| | | operationType.value = 'edit' |
| | | } |
| | |
| | | form.deviceBrand = data.deviceBrand; |
| | | form.type = data.type; |
| | | form.supplierName = data.supplierName; |
| | | form.areaId = data.areaId; |
| | | form.storageLocation = data.storageLocation; |
| | | form.isDepr = data.isDepr; |
| | | form.annualDepreciationAmount = data.annualDepreciationAmount; |