文档清册

main
Dayu 12 months ago
parent 7d419acae7
commit 95db529c3e
  1. 52
      src/views/leger/equipmentledgerDetail.vue

@ -20,24 +20,21 @@
ref="crud" ref="crud"
@row-del="parameters_rowDel" @row-del="parameters_rowDel"
@row-update="parameters_rowUpdate" @row-update="parameters_rowUpdate"
@row-save="parameters_rowSave" @row-save="parameters_rowSave">
@on-load="onLoad">
</avue-crud> </avue-crud>
</span> </span>
<span v-else-if="type.prop==='document'"> <span v-else-if="type.prop==='document'">
<!-- 选项卡内容3 https://avuejs.com/crud/crud-fun.html--> <!-- 选项卡内容3 https://avuejs.com/crud/crud-fun.html-->
<avue-crud :option="document_option" <avue-crud :option="optionDoc"
:table-loading="loading" :table-loading="loading"
:data="document_data" :data="document_data"
:permission="permissionList" :permission="permissionList"
:before-open="beforeOpen"
:header-cell-class-name="headerClass" :header-cell-class-name="headerClass"
v-model="document_form" v-model="document_form"
ref="crud" ref="crud2"
@row-update="document_rowUpdate" @row-update="document_rowUpdate"
@row-save="document_rowSave" @row-save="document_rowSave"
@row-del="document_rowDel" @row-del="document_rowDel">
@on-load="onLoad">
</avue-crud> </avue-crud>
</span> </span>
<div> <div>
@ -479,7 +476,7 @@
pagerCount: 5 pagerCount: 5
}, },
document_data: [], document_data: [],
document_option: { optionDoc: {
align: 'center', align: 'center',
menuAlign: 'center', menuAlign: 'center',
height: 'auto', height: 'auto',
@ -546,15 +543,15 @@
label: "附件", label: "附件",
prop: "accessory", prop: "accessory",
span: 20, span: 20,
type: 'upload', // type: 'upload',
multiple: true,
dataType: "string", // dataType: "string",
propsHttp: { // propsHttp: {
url: 'url', // url: 'url',
name: 'name', // name: 'name',
res: 'data' // res: 'data'
}, // },
action: 'https://api.avuejs.com/imgupload', // action: 'https://api.avuejs.com/imgupload',
rules: [{ rules: [{
trigger: "blur" trigger: "blur"
}] }]
@ -568,7 +565,7 @@
permissionList() { permissionList() {
return { return {
addBtn: true, addBtn: true,
viewBtn: this.vaildData(this.permission.techparameters_view, false), viewBtn: false,
delBtn: true, delBtn: true,
editBtn: true editBtn: true
}; };
@ -653,6 +650,12 @@
}, },
handleChange (column) { handleChange (column) {
this.type = column this.type = column
if (column.prop == 'parameters') {
this.parameters_onLoad();
}if (column.prop == 'document') {
this.document_onLoad();
}
}, },
// //
parameters_rowSave (form, done, loading) { parameters_rowSave (form, done, loading) {
@ -660,7 +663,7 @@
form.eqLedgerId = this.$route.query.id; form.eqLedgerId = this.$route.query.id;
parameters_add(form).then(() => { parameters_add(form).then(() => {
done(form); done(form);
this.onLoad(this.page); this.parameters_onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!" message: "操作成功!"
@ -695,7 +698,7 @@
return parameters_remove(form.id); return parameters_remove(form.id);
}) })
.then(() => { .then(() => {
this.onLoad(this.page); this.parameters_onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!" message: "操作成功!"
@ -708,7 +711,7 @@
form.eqLedgerId = this.$route.query.id; form.eqLedgerId = this.$route.query.id;
document_add(form).then(() => { document_add(form).then(() => {
done(form); done(form);
this.onLoad(this.page); this.document_onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!" message: "操作成功!"
@ -744,7 +747,7 @@
return document_remove(form.id); return document_remove(form.id);
}) })
.then(() => { .then(() => {
this.onLoad(this.page); this.document_onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!" message: "操作成功!"
@ -781,12 +784,15 @@
headerClass(){ headerClass(){
return 'head-style' return 'head-style'
}, },
onLoad(row, params = {}) { parameters_onLoad(row, params = {}) {
this.loading = true; this.loading = true;
parameters_getListBylegerId(this.$route.query.id).then(res => { parameters_getListBylegerId(this.$route.query.id).then(res => {
this.parameters_data = res.data.data; this.parameters_data = res.data.data;
this.loading = false; this.loading = false;
}); });
},
document_onLoad(row, params = {}) {
this.loading = true;
document_getListBylegerId(this.$route.query.id).then(res => { document_getListBylegerId(this.$route.query.id).then(res => {
this.document_data = res.data.data; this.document_data = res.data.data;
this.loading = false; this.loading = false;

Loading…
Cancel
Save