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-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>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
</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-col :span="8">
<el-form-item label="业务实体名称" prop="company">
@ -196,7 +196,7 @@
<el-col :span="8">
<el-form-item label="部门名称" prop="deptName">
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" :clearable="true"
placeholder="请选择归属部门" :normalizer="normalizer" />
placeholder="请选择归属部门" :normalizer="normalizer" :disabled="treeDisabled" />
</el-form-item>
</el-col>
<el-col :span="8">
@ -345,6 +345,8 @@ export default {
Authorization: "Bearer " + getAccessToken(),
"tenant-id": getTenantId(),
}, //
uploadDisabled: undefined,
treeDisabled: undefined,
fileList: [], //
//
deptOptions: undefined,
@ -402,7 +404,14 @@ export default {
//
form: {},
//
rules: {},
rules: {
company: [
{ required: true, message: "业务实体不能为空", trigger: "change" },
],
assetCode: [
{ required: true, message: "资产编号不能为空", trigger: "change" },
],
},
organizationList: [],
siteOptions: [], //
siteArray: [], //
@ -573,11 +582,15 @@ export default {
this.fileList = [];
this.open = true;
this.optType = "add";
this.treeDisabled = false;
this.uploadDisabled = true;
this.title = "添加资产档案";
},
/** 查看按钮操作 */
handleView(row) {
this.reset();
this.treeDisabled = true;
this.uploadDisabled = false;
this.optType = "view";
const id = row.id;
getElectronicAssets(id).then((response) => {
@ -590,6 +603,8 @@ export default {
handleUpdate(row) {
this.reset();
const id = row.id;
this.treeDisabled = false;
this.uploadDisabled = true;
this.optType = "edit";
getElectronicAssets(id).then((response) => {
this.form = response.data;

Loading…
Cancel
Save