zk 1 year ago
parent d26bf29bf8
commit 9f13ee3a62

@ -178,12 +178,12 @@
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-upload class="upload-demo" drag :limit="1" :action="uploadUrl" :file-list="fileList" :headers="headers" <el-upload class="upload-demo" drag :limit="1" :action="uploadUrl" :file-list="fileList" :headers="headers"
:on-success="handleSuccess" name="multipartFile" :multiple="false" :accept="imgType"> :on-success="handleSuccess" name="multipartFile" :multiple="false" :accept="imgType" v-show="uploadDisabled">
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
</el-upload> </el-upload>
<el-form ref="form" :model="form" :rules="rules" label-width="98px" style="margin-top: 20px"> <el-form ref="form" :model="form" :rules="rules" label-width="98px" style="margin-top: 20px" :disabled="this.title === '查看资产档案'">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="业务实体名称" prop="company"> <el-form-item label="业务实体名称" prop="company">
@ -196,7 +196,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="部门名称" prop="deptName"> <el-form-item label="部门名称" prop="deptName">
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" :clearable="true" <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" :clearable="true"
placeholder="请选择归属部门" :normalizer="normalizer" /> placeholder="请选择归属部门" :normalizer="normalizer" :disabled="treeDisabled" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -345,6 +345,8 @@ export default {
Authorization: "Bearer " + getAccessToken(), Authorization: "Bearer " + getAccessToken(),
"tenant-id": getTenantId(), "tenant-id": getTenantId(),
}, // }, //
uploadDisabled: undefined,
treeDisabled: undefined,
fileList: [], // fileList: [], //
// //
deptOptions: undefined, deptOptions: undefined,
@ -402,7 +404,14 @@ export default {
// //
form: {}, form: {},
// //
rules: {}, rules: {
company: [
{ required: true, message: "业务实体不能为空", trigger: "change" },
],
assetCode: [
{ required: true, message: "资产编号不能为空", trigger: "change" },
],
},
organizationList: [], organizationList: [],
siteOptions: [], // siteOptions: [], //
siteArray: [], // siteArray: [], //
@ -573,11 +582,15 @@ export default {
this.fileList = []; this.fileList = [];
this.open = true; this.open = true;
this.optType = "add"; this.optType = "add";
this.treeDisabled = false;
this.uploadDisabled = true;
this.title = "添加资产档案"; this.title = "添加资产档案";
}, },
/** 查看按钮操作 */ /** 查看按钮操作 */
handleView(row) { handleView(row) {
this.reset(); this.reset();
this.treeDisabled = true;
this.uploadDisabled = false;
this.optType = "view"; this.optType = "view";
const id = row.id; const id = row.id;
getElectronicAssets(id).then((response) => { getElectronicAssets(id).then((response) => {
@ -590,6 +603,8 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id; const id = row.id;
this.treeDisabled = false;
this.uploadDisabled = true;
this.optType = "edit"; this.optType = "edit";
getElectronicAssets(id).then((response) => { getElectronicAssets(id).then((response) => {
this.form = response.data; this.form = response.data;

Loading…
Cancel
Save