|
@@ -0,0 +1,275 @@
|
|
|
+<template>
|
|
|
+ <ContentWrap>
|
|
|
+ <div style="display: flex;flex-direction: row; height: 15em;margin-top: 10px">
|
|
|
+ <div style="flex: 1;height: 10em;margin-left: 20px">
|
|
|
+ <img :src="formData.picUrl" style="width: 30em;height: 15em"/>
|
|
|
+ </div>
|
|
|
+ <div style="flex: 2.5;height: 15em">
|
|
|
+ <el-form
|
|
|
+ ref="formRef"
|
|
|
+ :disabled="false"
|
|
|
+ :model="formData"
|
|
|
+ label-width="120px"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="资产编码:" prop="deviceCode">{{formData.deviceCode}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="设备名称:" prop="deviceName">{{formData.deviceName}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="品牌:" prop="brand">
|
|
|
+ {{formData.brandName}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="所在部门:" prop="orgId">
|
|
|
+ {{formData.deptName}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="资产类别:" prop="assetClass">
|
|
|
+ {{formData.assetClassName}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="设备状态:" prop="deviceStatus">
|
|
|
+ {{ getDictLabel(DICT_TYPE.PMS_DEVICE_STATUS, formData.deviceStatus) }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="资产性质:" prop="assetProperty">
|
|
|
+ {{getDictLabel(DICT_TYPE.PMS_ASSET_PROPERTY, formData.assetProperty)}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="规格型号:" prop="model">
|
|
|
+ <el-select
|
|
|
+ v-model="formData.model"
|
|
|
+ :model-value="modelLabel"
|
|
|
+ placeholder="请输入规格型号"
|
|
|
+ @click="openModelForm"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </ContentWrap>
|
|
|
+ <ContentWrap v-loading="formLoading">
|
|
|
+ <el-tabs v-model="activeName">
|
|
|
+ <el-tab-pane label="基础信息" name="info">
|
|
|
+ <el-form style="margin-top: 5px;margin-left: 15px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="制造商:" prop="manufacturerId">
|
|
|
+ {{formData.zzName}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="生产日期:" prop="manDate">
|
|
|
+ {{formatDate(formData.manDate,'YYYY-MM-DD')}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="供应商" prop="supplierId">
|
|
|
+ {{formData.supplierName?formData.supplierName:'-'}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="铭牌信息:" prop="nameplate">
|
|
|
+ {{formData.nameplate?formData.nameplate:'-'}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="质保到期:" prop="expires">
|
|
|
+ {{formData.expires?formatDate(formData.expires, 'YYYY-MM-DD'):'-'}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="采购价格:" prop="plPrice">
|
|
|
+ {{formData.plPrice?formData.plPrice:'-'}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="采购日期:" prop="plDate">
|
|
|
+ {{formData.plDate?formatDate(formData.plDate, 'YYYY-MM-DD'):'-'}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="折旧年限" prop="plYear">
|
|
|
+ {{formData.plYear?formData.plYear:'-'}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="折旧开始日期" prop="plStartDate">
|
|
|
+ {{formData.plStartDate?formatDate(formData.plStartDate,'YYYY-MM-DD'):'-'}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="已提折旧月数" prop="plMonthed">
|
|
|
+ {{formData.plMonthed?formData.plMonthed:'-'}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="已提折旧金额" prop="plAmounted">
|
|
|
+ {{formData.plAmounted?formData.plAmounted:'-'}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="剩余金额" prop="remainAmount">
|
|
|
+ {{formData.remainAmount?formData.remainAmount:'-'}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col v-for="field in list" :key="field.id" :span="6">
|
|
|
+ <el-form-item :label="field.label" :prop="field.model" :rules="field.rules">
|
|
|
+ {{formData[field.prop]}}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="证件信息" name="cert">
|
|
|
+ <CertList
|
|
|
+ ref="certRef"
|
|
|
+ v-model:activeName="activeName"
|
|
|
+ :propFormData="formData"
|
|
|
+ :ifAlone="false"
|
|
|
+ />
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="联系人信息" name="contact">
|
|
|
+ <ContactList
|
|
|
+ ref="contactRef"
|
|
|
+ v-model:activeName="activeName"
|
|
|
+ :propFormData="formData"
|
|
|
+ :ifAlone="false"
|
|
|
+ />
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="核心产品" name="core">
|
|
|
+ <CoreList
|
|
|
+ ref="coreRef"
|
|
|
+ v-model:activeName="activeName"
|
|
|
+ :propFormData="formData"
|
|
|
+ :ifAlone="false"
|
|
|
+ />
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="联系记录" name="connect">
|
|
|
+ <ConnectList
|
|
|
+ ref="connectRef"
|
|
|
+ v-model:activeName="activeName"
|
|
|
+ :propFormData="formData"
|
|
|
+ :ifAlone="false"
|
|
|
+ />
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <!-- <el-form>-->
|
|
|
+ <!-- <el-form-item style="float: right">-->
|
|
|
+ <!-- <el-button v-if="!isDetail" :loading="formLoading" type="primary" @click="submitForm">-->
|
|
|
+ <!-- 保存-->
|
|
|
+ <!-- </el-button>-->
|
|
|
+ <!-- <el-button @click="close">返回</el-button>-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- </el-form>-->
|
|
|
+ </ContentWrap>
|
|
|
+</template>
|
|
|
+<script lang="ts" setup>
|
|
|
+import SupplierInfoForm from '@/views/supplier/base/form/SupplierInfoForm.vue'
|
|
|
+import CertList from '@/views/supplier/certificate/index.vue'
|
|
|
+import ContactList from '@/views/supplier/contact/index.vue'
|
|
|
+import CoreList from '@/views/supplier/coreproduct/index.vue'
|
|
|
+import ConnectList from '@/views/supplier/connect/index.vue'
|
|
|
+import {IotDeviceVO, IotDeviceApi} from "@/api/pms/device";
|
|
|
+import {defaultProps} from "@/utils/tree";
|
|
|
+import {DICT_TYPE, getDictLabel, getStrDictOptions} from "@/utils/dict";
|
|
|
+import {formatDate} from "../../../utils/formatTime";
|
|
|
+
|
|
|
+defineOptions({ name: 'DeviceDetailInfo' })
|
|
|
+
|
|
|
+const { t } = useI18n() // 国际化
|
|
|
+const message = useMessage() // 消息弹窗
|
|
|
+const { params } = useRoute() // 查询参数
|
|
|
+const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
+const activeName = ref('info') // Tag 激活的窗口
|
|
|
+const infoRef = ref() // 商品信息 Ref
|
|
|
+const id = params.id as unknown as number
|
|
|
+// SPU 表单数据
|
|
|
+const formData = ref({
|
|
|
+ id: undefined,
|
|
|
+ code: undefined,
|
|
|
+ name: undefined,
|
|
|
+ classification: undefined,
|
|
|
+ type: undefined,
|
|
|
+ nature: undefined,
|
|
|
+ creditCode: undefined,
|
|
|
+ tin: undefined,
|
|
|
+ corporation: undefined,
|
|
|
+ incorporationDate: undefined,
|
|
|
+ address: undefined,
|
|
|
+ bizScope: undefined,
|
|
|
+ registeredCapital: undefined,
|
|
|
+ annualTurnove: undefined,
|
|
|
+ size: undefined,
|
|
|
+ status: undefined,
|
|
|
+ remark: undefined,
|
|
|
+ deptName: undefined
|
|
|
+})
|
|
|
+
|
|
|
+/** 获得详情 */
|
|
|
+const getDetail = async () => {
|
|
|
+ if (id) {
|
|
|
+ formLoading.value = true
|
|
|
+ try {
|
|
|
+ const res = (await IotDeviceApi.getIotDevice(id)) as IotDeviceVO
|
|
|
+ // res.skus?.forEach((item) => {
|
|
|
+ // if (isDetail.value) {
|
|
|
+ // item.price = floatToFixed2(item.price)
|
|
|
+ // item.marketPrice = floatToFixed2(item.marketPrice)
|
|
|
+ // item.costPrice = floatToFixed2(item.costPrice)
|
|
|
+ // item.firstBrokeragePrice = floatToFixed2(item.firstBrokeragePrice)
|
|
|
+ // item.secondBrokeragePrice = floatToFixed2(item.secondBrokeragePrice)
|
|
|
+ // } else {
|
|
|
+ // // 回显价格分转元
|
|
|
+ // item.price = formatToFraction(item.price)
|
|
|
+ // item.marketPrice = formatToFraction(item.marketPrice)
|
|
|
+ // item.costPrice = formatToFraction(item.costPrice)
|
|
|
+ // item.firstBrokeragePrice = formatToFraction(item.firstBrokeragePrice)
|
|
|
+ // item.secondBrokeragePrice = formatToFraction(item.secondBrokeragePrice)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ formData.value = res
|
|
|
+ } finally {
|
|
|
+ formLoading.value = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+/** 关闭按钮 */
|
|
|
+// const close = () => {
|
|
|
+// delView(unref(currentRoute))
|
|
|
+// push({ name: 'Suppliers' })
|
|
|
+// }
|
|
|
+
|
|
|
+/** 初始化 */
|
|
|
+onMounted(async () => {
|
|
|
+ await getDetail()
|
|
|
+})
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|