feat: 设备信息增加字段

dev_ksck2.0
chenhc 1 year ago
parent 38332f992f
commit 531a873e99

@ -174,6 +174,22 @@
>
</deviceModifyDialog>
</el-tab-pane>
<el-tab-pane label="财务信息">
<deviceFinanceModifyDialog
:rowData="this.rowData"
:editSaveDev="editSaveDev"
:maintainsList = "this.maintainsList"
>
</deviceFinanceModifyDialog>
</el-tab-pane>
<el-tab-pane label="附属信息">
<deviceSubModifyDialog
:rowData="this.rowData"
:editSaveDev="editSaveDev"
:maintainsList = "this.maintainsList"
>
</deviceSubModifyDialog>
</el-tab-pane>
<el-tab-pane label="设备资质">
<checkResultPanel
:idQuery="filterQuery"
@ -261,6 +277,8 @@
<script>
import deviceModifyDialog from "@/views/dev/devInfoEdit.vue";
import deviceFinanceModifyDialog from "@/views/dev/deviceFinanceModifyDialog.vue";
import deviceSubModifyDialog from "@/views/dev/deviceSubModifyDialog.vue";
import {getInvListByUser} from "@/api/system/invWarehouse";
import {getDeptListByUser} from "@/api/auth/authDept";
import {getDeptDeviceList, deleteDeptDevice, printOrder, verifyTemplateFile} from "@/api/dev/deptDevice";
@ -590,10 +608,12 @@ export default {
inspectSetModifyDialog,
DeviceModelDetail,
deviceModifyDialog,
deviceFinanceModifyDialog,
invDeviceUserEditDialog,
invDeviceUsageEditDialog,
invDeviceInspectEditDialog,
invDeviceCheckEditDialog,
deviceSubModifyDialog
},
created() {
this.filterQuery = this.rowData

@ -1,7 +1,7 @@
<template>
<!-- <el-card style="margin: 5px;margin-top: -20px">-->
<el-form :model="formData" ref="dataForm" :rules="rules" label-width="100px" style="margin-bottom: -15px">
<el-button-group style="display: flex;margin: 0px 0 10px 85%; height: 35px">
<el-button-group style="display: flex;margin: 0px 20px 30px 85%; height: 35px;">
<el-button
type="primary"
@click.native="submit()"
@ -10,7 +10,7 @@
</el-button-group>
<!-- <el-row>-->
<!-- <el-col :span="10">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item class="query-form-item" prop="deptCode" label="部门:">-->
<!-- <el-select v-model="formData.deptCode"-->
<!-- placeholder="请选择部门"-->
@ -29,7 +29,7 @@
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="10">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item class="query-form-item" prop="invCode" label="仓库:">-->
<!-- <el-select v-model="formData.invCode"-->
<!-- placeholder="请选择仓库"-->
@ -49,7 +49,7 @@
<!-- </el-row>-->
<el-row>
<el-col :span="10">
<el-col :span="12">
<el-form-item class="query-form-item" prop="originCode" label="设备编码:">
<el-input v-model="formData.deviceCode" placeholder="请输入编码" show-word-limit maxlength="11"
@ -58,7 +58,7 @@
<!-- </el-button>-->
</el-form-item>
</el-col>
<el-col :span="10">
<el-col :span="12">
<el-form-item class="query-form-item" prop="code" label="物资编码:">
<el-input v-model="formData.productId" placeholder="请输入编码" style="width: 90%" clearable disabled></el-input>
</el-form-item>
@ -66,13 +66,13 @@
</el-row>
<el-row>
<el-col :span="10">
<el-col :span="12">
<el-form-item class="query-form-item" prop="deviceName" label="设备名称:">
<el-input v-model="formData.productName" placeholder="请输入设备名称" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-col :span="12">
<el-form-item class="query-form-item" prop="ggxh" label="规格型号:">
<el-input v-model="formData.ggxh" placeholder="请输入规格型号" style="width: 90%" clearable></el-input>
</el-form-item>
@ -80,21 +80,21 @@
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="批次号:">
<el-col :span="12">
<el-form-item class="query-form-item" label="批次号:">
<el-input v-model="formData.batchNo" placeholder="请输入批次号" style="width: 90%" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="序列号:">
<el-col :span="12">
<el-form-item class="query-form-item" label="序列号:">
<el-input v-model="formData.serialNo" placeholder="请输入序列号" style="width: 90%" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="生产日期:">
<el-col :span="12">
<el-form-item class="query-form-item" label="生产日期:">
<!-- <el-input v-model="formData.productionDate" placeholder="请输入生产日期" style="width: 90%"-->
<!-- clearable>-->
<el-date-picker
@ -108,8 +108,8 @@
<!-- </el-input>-->
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="失效日期:">
<el-col :span="12">
<el-form-item class="query-form-item" label="失效日期:">
<!-- <el-input v-model="formData.expireDate" placeholder="请输入失效日期" style="width: 90%"-->
<!-- clearable></el-input>-->
<el-date-picker
@ -125,28 +125,28 @@
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="生产厂家:">
<el-col :span="12">
<el-form-item class="query-form-item" label="生产厂家:">
<el-input v-model="formData.manufactory" placeholder="请输入生产厂家" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="计量单位:">
<el-col :span="12">
<el-form-item class="query-form-item" label="计量单位:">
<el-input v-model="formData.measname" placeholder="请输入计量单位" style="width: 90%" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="注册证号:">
<el-col :span="12">
<el-form-item class="query-form-item" label="注册证号:">
<el-input v-model="formData.zczbhhzbapzbh" placeholder="请输入注册备案凭证号" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="供应商:" prop="supId" style="width: 92%">
<el-col :span="12">
<el-form-item class="query-form-item" label="供应商:" prop="supId" style="width: 91%">
<!-- <el-input v-model="formData.supName" placeholder="请输入供应商" style="width: 90%" clearable></el-input>-->
<el-select
v-model="formData.supId"
@ -172,28 +172,32 @@
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>-->
<!-- <el-col :span="10">-->
<!-- <el-form-item label="负责人:">-->
<!-- <el-select v-model="formData.manager"-->
<!-- placeholder="请选择负责人"-->
<!-- clearable="true"-->
<!-- style="width: 90%"-->
<!-- >-->
<!-- <el-option v-for="item in userList"-->
<!-- :key="item.employeeName"-->
<!-- :label="item.employeeName"-->
<!-- :value="item.userId">-->
<!-- <span>{{ item.employeeName }}</span>-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="19">
<el-col :span="12" >
<el-form-item class="query-form-item" label="医保编码:" prop="ybbm">
<el-input style="width: 90%" size="small" placeholder="请输入医保编码" v-model.trim="formData.ybbm" v-debounce-input:500ms="getYbHcData" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item class="query-form-item" label="一级分类名称:" prop="catalogname1">
<el-input style="width: 90%" size="small" placeholder="请输入一级分类名称" v-model.trim="formData.catalogname1" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" >
<el-form-item class="query-form-item" label="二级分类名称:" prop="catalogname2">
<el-input style="width: 90%" size="small" placeholder="请输入二级分类名称" v-model.trim="formData.catalogname2" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item class="query-form-item" label="三级分类名称:" prop="catalogname3">
<el-input style="width: 90%" size="small" placeholder="请输入三级分类名称" v-model.trim="formData.catalogname3" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注:">
<el-input v-model="formData.remark" type="textarea" style="width: 100%" clearable></el-input>
</el-form-item>
@ -211,6 +215,7 @@ import {getDeptListByUser} from "@/api/auth/authDept";
import {getInvListByUser} from "@/api/system/invWarehouse";
import {listDeptUser} from "@/api/system/deptUser";
import {genDeviceCode} from "@/api/dev/deviceInfoApi";
import {getYbHcflDetail,disableUdi, removeDiRl, removeRl, thirdSysDetail, updatetSingleUdiInfo} from "@/api/basic/product/udiRelevance";
export default {
props: {
@ -228,6 +233,7 @@ export default {
}
},
name: "deptDeviceModifyDialog",
dicts: ['device_source_type'],
data() {
return {
deptList: [],
@ -251,6 +257,27 @@ export default {
};
},
methods: {
getYbHcData(){
let query = {
specificationCode: this.formData.ybbm
};
getYbHcflDetail(query).then((response) => {
if (response.code == 20000) {
this.ybHcflDetail = response.data
this.formData.catalogname1 = this.ybHcflDetail.catalogname1
this.formData.catalogname2 = this.ybHcflDetail.catalogname2
this.formData.catalogname3 = this.ybHcflDetail.catalogname3
this.$forceUpdate();
}else {
this.formData.catalogname1 = ""
this.formData.catalogname2 = ""
this.formData.catalogname3 = ""
this.$forceUpdate();
}
}).catch(() => {
})
},
supChange(val) {
this.formData.supName = this.maintainsList.find(item => item.id == val).name
this.formData.supId = val
@ -311,6 +338,14 @@ export default {
this.rowData.supName = this.formData.supName;
this.rowData.supId = this.formData.supId;
this.rowData.remark = this.formData.remark;
this.rowData.ybbm = this.formData.ybbm;
this.rowData.catalogname1 = this.formData.catalogname1;
this.rowData.catalogname2 = this.formData.catalogname2;
this.rowData.catalogname3 = this.formData.catalogname3;
this.rowData.catalogCode = this.formData.catalogCode;
this.rowData.catalogCode1 = this.formData.catalogCode1;
this.rowData.catalogCode2 = this.formData.catalogCode2;
this.rowData.catalogCode3 = this.formData.catalogCode3;
this.editSaveDev();
}
})
@ -334,6 +369,19 @@ export default {
})
},
},
directives: {
'debounce-input': {
inserted(el, binding) {
let timeout
el.addEventListener('input', () => {
clearTimeout(timeout)
timeout = setTimeout(() => {
binding.value()
}, parseInt(binding.arg) || 300)
})
}
}
},
created() {
console.log(this.rowData);
console.log(this.maintainsList.length);

@ -0,0 +1,438 @@
<template>
<!-- <el-card style="margin: 5px;margin-top: -20px">-->
<el-form :model="formData" ref="dataForm" :rules="rules" label-width="100px" style="margin-bottom: -15px">
<el-button-group style="display: flex;margin: 0px 20px 30px 85%; height: 35px;">
<el-button
type="primary"
@click.native="submit()"
>保存
</el-button>
</el-button-group>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="资产分类:" style="width: 91%">
<el-select v-model="formData.assetType" style="width: 100%" placeholder="请选择资产分类" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="国资分类:" style="width: 91%">
<el-select v-model="formData.sasacType" style="width: 100%" placeholder="请选择国资分类" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="资产助记码:">
<el-input v-model="formData.assetMnemonicCode" placeholder="请输入资产助记码" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="数量:">
<el-input-number :min="1" v-model="formData.number" placeholder="请输入数量" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="取得方式:" style="width: 91%">
<el-select v-model="formData.acquisitionMethod" style="width: 100%" placeholder="请选择取得方式" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="用途:" style="width: 91%">
<el-select v-model="formData.purpose" style="width: 100%" placeholder="请选择用途" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item class="query-form-item" label="折旧年:">
<el-input-number :min="0" v-model="formData.number" style="width: 100%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="折旧月:">
<el-input-number :min="0" v-model="formData.number" p style="width: 100%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="存储仓库:" style="width: 91%">
<el-select v-model="formData.purpose" style="width: 100%" placeholder="请选择存储仓库" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="预计总工时:">
<el-input-number :min="0" v-model="formData.estimatedTotalHour" placeholder="请输入预计总工时" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="单日工时:">
<el-input-number :min="0" v-model="formData.dayHour" placeholder="请输入单日工时" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="单个资产价值:">
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.assetValue" placeholder="请输入单个资产价值" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="自有资金:">
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.ownFund" placeholder="请输入自有资金" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="财政拨款:">
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.financialAppropriation" placeholder="请输入财政拨款" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="科教基金:">
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.educationFund" placeholder="请输入科教基金" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="其他资金:">
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.otherFund" placeholder="请输入其他资金" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item class="query-form-item">
<span slot="label">
<span style="font-size: 11px">非同级财政拨款:</span>
</span>
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.nonPeerFinancialAppropriation" placeholder="请输入非同级财政拨款" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="管理类别:" style="width: 91%">
<el-select v-model="formData.managementCategory" style="width: 100%" placeholder="请选择管理类别" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="使用人:">
<el-select v-model="formData.endUser"
placeholder="请输入使用人"
clearable="true"
style="width: 90%"
>
<el-option v-for="item in userList"
:key="item.employeeName"
:label="item.employeeName"
:value="item.userId">
<span>{{ item.employeeName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="预计残值:" style="font-size: 11px">
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.estimatedResidualValue" placeholder="请输入预计残值" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="币种:" style="width: 91%">
<el-select v-model="formData.currencyType" style="width: 100%" placeholder="请选择币种" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="采购类型:" style="width: 91%">
<el-select v-model="formData.purType" style="width: 100%" placeholder="请选择采购类型" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="购置日期:">
<el-date-picker
style="width: 90%"
v-model="formData.purchaseDate"
type="date"
placeholder="请输入购置日期"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="添加日期:">
<el-date-picker
style="width: 90%"
v-model="formData.addDate"
type="date"
placeholder="请输入添加日期"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import {addDeptDevice, saveDeptDevice, updateDeptDevice} from "@/api/dev/deptDevice";
import {isBlank} from "@/utils/strUtil";
import {getDeptListByUser} from "@/api/auth/authDept";
import {getInvListByUser} from "@/api/system/invWarehouse";
import {listDeptUser} from "@/api/system/deptUser";
import {genDeviceCode} from "@/api/dev/deviceInfoApi";
export default {
props: {
rowData: {
type: Object,
required: true
},
editSaveDev: {
type: Function,
required: true
},
maintainsList: {
type: Array,
required: true
}
},
name: "deptDeviceModifyDialog",
dicts: ['device_source_type'],
data() {
return {
deptList: [],
invList: [],
userList: [],
formData: {},
rules: {
// deptCode: [
// {required: true, message: '', trigger: 'change'}
// ],
// invCode: [
// {required: true, message: '', trigger: 'change'}
// ],
// deviceName: [
// {required: true, message: '', trigger: 'blur'}
// ],
// originCode: [
// {required: true, message: '', trigger: 'blur'}
// ]
}
};
},
methods: {
supChange(val) {
this.formData.supName = this.maintainsList.find(item => item.id == val).name
this.formData.supId = val
},
deptChange() {
this.formData.invCode = null;
this.formData.manager = null;
this.invList = [];
this.getInvList();
this.getDeptUserList();
},
getDeptList() {
getDeptListByUser().then((res) => {
this.deptList = res.data || [];
this.getInvList();
this.getDeptUserList();
});
},
getInvList() {
let params = {deptCode: this.formData.deptCode};
getInvListByUser(params)
.then((response) => {
this.invList = response.data || [];
this.getList();
})
.catch(() => {
});
},
getDeptUserList() {
this.userList = [];
let params = {deptId: null};
this.deptList.forEach((item) => {
if (item.code === this.formData.deptCode) {
params.deptId = item.id;
}
});
listDeptUser(params).then((res) => {
this.userList = res.data.list || [];
})
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
this.$message.error("请完善必填信息");
} else {
this.rowData.assetType = this.formData.assetType;
this.rowData.sasacType = this.formData.sasacType;
this.rowData.assetMnemonicCode = this.formData.assetMnemonicCode;
this.rowData.number = this.formData.number;
this.rowData.acquisitionMethod = this.formData.acquisitionMethod;
this.rowData.purpose = this.formData.purpose;
this.rowData.depreciationYear = this.formData.depreciationYear;
this.rowData.depreciationMonth = this.formData.depreciationMonth;
this.rowData.invCode = this.formData.invCode;
this.rowData.estimatedTotalHour = this.formData.estimatedTotalHour;
this.rowData.dayHour = this.formData.dayHour;
this.rowData.assetValue = this.formData.assetValue;
this.rowData.ownFund = this.formData.ownFund;
this.rowData.financialAppropriation = this.formData.financialAppropriation;
this.rowData.educationFund = this.formData.educationFund;
this.rowData.otherFund = this.formData.otherFund;
this.rowData.nonPeerFinancialAppropriation = this.formData.nonPeerFinancialAppropriation;
this.rowData.managementCategory = this.formData.managementCategory;
this.rowData.endUser = this.formData.endUser;
this.rowData.estimatedResidualValue = this.formData.estimatedResidualValue;
this.rowData.currencyType = this.formData.currencyType;
this.rowData.purType = this.formData.purType;
this.rowData.purchaseDate = this.formData.purchaseDate;
this.rowData.addDate = this.formData.addDate;
this.editSaveDev();
}
})
},
genCode(row) {
let loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
genDeviceCode().then(res => {
loading.close()
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.formData.deviceCode = res.data
}).catch(e => {
loading.close()
})
},
},
created() {
console.log(this.rowData);
console.log(this.maintainsList.length);
this.formData = JSON.parse(JSON.stringify(this.rowData));
console.log(this.formData);
},
}
</script>
<style scoped>
</style>

@ -0,0 +1,438 @@
<template>
<!-- <el-card style="margin: 5px;margin-top: -20px">-->
<el-form :model="formData" ref="dataForm" :rules="rules" label-width="100px" style="margin-bottom: -15px">
<el-button-group style="display: flex;margin: 0px 20px 30px 85%; height: 35px;">
<el-button
type="primary"
@click.native="submit()"
>保存
</el-button>
</el-button-group>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="资产分类:" style="width: 91%">
<el-select v-model="formData.assetType" style="width: 100%" placeholder="请选择资产分类" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="国资分类:" style="width: 91%">
<el-select v-model="formData.sasacType" style="width: 100%" placeholder="请选择国资分类" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="资产助记码:">
<el-input v-model="formData.assetMnemonicCode" placeholder="请输入资产助记码" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="数量:">
<el-input-number :min="1" v-model="formData.number" placeholder="请输入数量" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="取得方式:" style="width: 91%">
<el-select v-model="formData.acquisitionMethod" style="width: 100%" placeholder="请选择取得方式" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="用途:" style="width: 91%">
<el-select v-model="formData.purpose" style="width: 100%" placeholder="请选择用途" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item class="query-form-item" label="折旧年:">
<el-input-number :min="0" v-model="formData.number" style="width: 100%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="折旧月:">
<el-input-number :min="0" v-model="formData.number" p style="width: 100%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="存储仓库:" style="width: 91%">
<el-select v-model="formData.purpose" style="width: 100%" placeholder="请选择存储仓库" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="预计总工时:">
<el-input-number :min="0" v-model="formData.estimatedTotalHour" placeholder="请输入预计总工时" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="单日工时:">
<el-input-number :min="0" v-model="formData.dayHour" placeholder="请输入单日工时" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="单个资产价值:">
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.assetValue" placeholder="请输入单个资产价值" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="自有资金:">
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.ownFund" placeholder="请输入自有资金" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="财政拨款:">
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.financialAppropriation" placeholder="请输入财政拨款" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="科教基金:">
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.educationFund" placeholder="请输入科教基金" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="其他资金:">
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.otherFund" placeholder="请输入其他资金" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item class="query-form-item">
<span slot="label">
<span style="font-size: 11px">非同级财政拨款:</span>
</span>
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.nonPeerFinancialAppropriation" placeholder="请输入非同级财政拨款" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="管理类别:" style="width: 91%">
<el-select v-model="formData.managementCategory" style="width: 100%" placeholder="请选择管理类别" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="使用人:">
<el-select v-model="formData.endUser"
placeholder="请输入使用人"
clearable="true"
style="width: 90%"
>
<el-option v-for="item in userList"
:key="item.employeeName"
:label="item.employeeName"
:value="item.userId">
<span>{{ item.employeeName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="预计残值:" style="font-size: 11px">
<el-input-number :min="0" :precision='2' :step='1' v-model="formData.estimatedResidualValue" placeholder="请输入预计残值" style="width: 90%"
clearable></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="币种:" style="width: 91%">
<el-select v-model="formData.currencyType" style="width: 100%" placeholder="请选择币种" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="采购类型:" style="width: 91%">
<el-select v-model="formData.purType" style="width: 100%" placeholder="请选择采购类型" >
<el-option
v-for="item in dict.type.device_source_type"
:key="item.value"
:label="item.label"
:value="item.value">
<span style="float: left">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" label="购置日期:">
<el-date-picker
style="width: 90%"
v-model="formData.purchaseDate"
type="date"
placeholder="请输入购置日期"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item class="query-form-item" label="添加日期:">
<el-date-picker
style="width: 90%"
v-model="formData.addDate"
type="date"
placeholder="请输入添加日期"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import {addDeptDevice, saveDeptDevice, updateDeptDevice} from "@/api/dev/deptDevice";
import {isBlank} from "@/utils/strUtil";
import {getDeptListByUser} from "@/api/auth/authDept";
import {getInvListByUser} from "@/api/system/invWarehouse";
import {listDeptUser} from "@/api/system/deptUser";
import {genDeviceCode} from "@/api/dev/deviceInfoApi";
export default {
props: {
rowData: {
type: Object,
required: true
},
editSaveDev: {
type: Function,
required: true
},
maintainsList: {
type: Array,
required: true
}
},
name: "deptDeviceModifyDialog",
dicts: ['device_source_type'],
data() {
return {
deptList: [],
invList: [],
userList: [],
formData: {},
rules: {
// deptCode: [
// {required: true, message: '', trigger: 'change'}
// ],
// invCode: [
// {required: true, message: '', trigger: 'change'}
// ],
// deviceName: [
// {required: true, message: '', trigger: 'blur'}
// ],
// originCode: [
// {required: true, message: '', trigger: 'blur'}
// ]
}
};
},
methods: {
supChange(val) {
this.formData.supName = this.maintainsList.find(item => item.id == val).name
this.formData.supId = val
},
deptChange() {
this.formData.invCode = null;
this.formData.manager = null;
this.invList = [];
this.getInvList();
this.getDeptUserList();
},
getDeptList() {
getDeptListByUser().then((res) => {
this.deptList = res.data || [];
this.getInvList();
this.getDeptUserList();
});
},
getInvList() {
let params = {deptCode: this.formData.deptCode};
getInvListByUser(params)
.then((response) => {
this.invList = response.data || [];
this.getList();
})
.catch(() => {
});
},
getDeptUserList() {
this.userList = [];
let params = {deptId: null};
this.deptList.forEach((item) => {
if (item.code === this.formData.deptCode) {
params.deptId = item.id;
}
});
listDeptUser(params).then((res) => {
this.userList = res.data.list || [];
})
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
this.$message.error("请完善必填信息");
} else {
this.rowData.assetType = this.formData.assetType;
this.rowData.sasacType = this.formData.sasacType;
this.rowData.assetMnemonicCode = this.formData.assetMnemonicCode;
this.rowData.number = this.formData.number;
this.rowData.acquisitionMethod = this.formData.acquisitionMethod;
this.rowData.purpose = this.formData.purpose;
this.rowData.depreciationYear = this.formData.depreciationYear;
this.rowData.depreciationMonth = this.formData.depreciationMonth;
this.rowData.invCode = this.formData.invCode;
this.rowData.estimatedTotalHour = this.formData.estimatedTotalHour;
this.rowData.dayHour = this.formData.dayHour;
this.rowData.assetValue = this.formData.assetValue;
this.rowData.ownFund = this.formData.ownFund;
this.rowData.financialAppropriation = this.formData.financialAppropriation;
this.rowData.educationFund = this.formData.educationFund;
this.rowData.otherFund = this.formData.otherFund;
this.rowData.nonPeerFinancialAppropriation = this.formData.nonPeerFinancialAppropriation;
this.rowData.managementCategory = this.formData.managementCategory;
this.rowData.endUser = this.formData.endUser;
this.rowData.estimatedResidualValue = this.formData.estimatedResidualValue;
this.rowData.currencyType = this.formData.currencyType;
this.rowData.purType = this.formData.purType;
this.rowData.purchaseDate = this.formData.purchaseDate;
this.rowData.addDate = this.formData.addDate;
this.editSaveDev();
}
})
},
genCode(row) {
let loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
genDeviceCode().then(res => {
loading.close()
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.formData.deviceCode = res.data
}).catch(e => {
loading.close()
})
},
},
created() {
console.log(this.rowData);
console.log(this.maintainsList.length);
this.formData = JSON.parse(JSON.stringify(this.rowData));
console.log(this.formData);
},
}
</script>
<style scoped>
</style>

@ -292,6 +292,7 @@ export default {
editSaveDev(row) {
this.curDevRow = row;
this.deviceInfoFlag = false;
this.deviceInfoFlag = false;
},
copyRow(index) {

Loading…
Cancel
Save