|
|
|
@ -2,122 +2,809 @@ |
|
|
|
|
<basic-container> |
|
|
|
|
<avue-tabs :option="option" |
|
|
|
|
@change="handleChange"></avue-tabs> |
|
|
|
|
<span v-if="type.prop==='tab1'"> |
|
|
|
|
选项卡内容1 |
|
|
|
|
<span v-if="type.prop==='information'"> |
|
|
|
|
<avue-form :option="tab1_option" |
|
|
|
|
v-model="tab1_form"></avue-form> |
|
|
|
|
v-model="tab1_form" |
|
|
|
|
ref="tab1_form" |
|
|
|
|
:class="frame_class"> |
|
|
|
|
</avue-form> |
|
|
|
|
</span> |
|
|
|
|
<span v-else-if="type.prop==='tab2'"> |
|
|
|
|
选项卡内容2 https://avuejs.com/crud/crud-fun.html |
|
|
|
|
<avue-crud :data="tab2_data" |
|
|
|
|
:option="tab2_option" |
|
|
|
|
@row-save="tab2_rowSave"></avue-crud> |
|
|
|
|
<span v-else-if="type.prop==='parameters'"> |
|
|
|
|
<avue-crud :data="parameters_data" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:option="optionParam" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
:before-open="beforeOpen" |
|
|
|
|
:header-cell-class-name="headerClass" |
|
|
|
|
v-model="form" |
|
|
|
|
ref="crud" |
|
|
|
|
:page="page" |
|
|
|
|
@row-del="parameters_rowDel" |
|
|
|
|
@row-update="parameters_rowUpdate" |
|
|
|
|
@row-save="parameters_rowSave" |
|
|
|
|
@on-load="onLoad"> |
|
|
|
|
</avue-crud> |
|
|
|
|
</span> |
|
|
|
|
<span v-else-if="type.prop==='tab3'"> |
|
|
|
|
选项卡内容3 https://avuejs.com/crud/crud-fun.html |
|
|
|
|
<avue-crud :data="tab3_data" |
|
|
|
|
:option="tab3_option" |
|
|
|
|
@row-save="tab3_rowSave"></avue-crud> |
|
|
|
|
<span v-else-if="type.prop==='document'"> |
|
|
|
|
<!-- 选项卡内容3 https://avuejs.com/crud/crud-fun.html--> |
|
|
|
|
<avue-crud :option="document_option" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="document_data" |
|
|
|
|
:page="page" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
:before-open="beforeOpen" |
|
|
|
|
:header-cell-class-name="headerClass" |
|
|
|
|
v-model="form" |
|
|
|
|
ref="crud" |
|
|
|
|
@row-update="document_rowUpdate" |
|
|
|
|
@row-save="document_rowSave" |
|
|
|
|
@row-del="document_rowDel" |
|
|
|
|
@on-load="onLoad"> |
|
|
|
|
</avue-crud> |
|
|
|
|
</span> |
|
|
|
|
<div> |
|
|
|
|
<span > |
|
|
|
|
<el-button type="primary" |
|
|
|
|
size="small" |
|
|
|
|
@click="$refs.form.submit()">按钮</el-button> |
|
|
|
|
<!-- <el-button size="small"--> |
|
|
|
|
<!-- @click="$refs.form.resetForm()">取消</el-button>--> |
|
|
|
|
@click="handleFormSubmit" |
|
|
|
|
v-if="addUpdateShowButton"> |
|
|
|
|
确定</el-button> |
|
|
|
|
<el-button size="small" |
|
|
|
|
@click="back">返回</el-button> |
|
|
|
|
@click="back" |
|
|
|
|
v-if="addUpdateShowButton"> |
|
|
|
|
取消</el-button> |
|
|
|
|
<el-button size="small" |
|
|
|
|
@click="auditing" |
|
|
|
|
v-if="shouldShowButton"> |
|
|
|
|
审核</el-button> |
|
|
|
|
<el-button size="small" |
|
|
|
|
@click="reject" |
|
|
|
|
v-if="shouldShowButton"> |
|
|
|
|
驳回</el-button> |
|
|
|
|
<el-button size="small" |
|
|
|
|
@click="seachToUpdate" |
|
|
|
|
v-if="shouldShowButton"> |
|
|
|
|
修改</el-button> |
|
|
|
|
<el-button size="small" |
|
|
|
|
@click="back" |
|
|
|
|
v-if="shouldShowButton"> |
|
|
|
|
删除</el-button> |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
</basic-container> |
|
|
|
|
<!-- https://avuejs.com/form/form-rules.html#%E5%A4%96%E7%BD%AE%E9%AA%8C%E8%AF%81--> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import {getList, getDetail, add, update, remove} from "@/api/leger/equipmentledger"; |
|
|
|
|
import { |
|
|
|
|
parameters_add, |
|
|
|
|
parameters_update, |
|
|
|
|
parameters_remove, |
|
|
|
|
parameters_getListBylegerId |
|
|
|
|
} from "@/api/leger/techparameters"; |
|
|
|
|
import { |
|
|
|
|
document_insert, |
|
|
|
|
document_update, |
|
|
|
|
document_remove, |
|
|
|
|
document_getListBylegerId |
|
|
|
|
} from "@/api/leger/inventorydocument"; |
|
|
|
|
import {mapGetters} from "vuex"; |
|
|
|
|
import website from "@/config/website"; |
|
|
|
|
import {readonly} from "vue"; |
|
|
|
|
import {getToken} from "@/util/auth"; |
|
|
|
|
export default { |
|
|
|
|
name: "equipmentledgerDetail", |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
frame_class: '', |
|
|
|
|
type: {}, |
|
|
|
|
shouldShowButton:{}, |
|
|
|
|
addUpdateShowButton:{}, |
|
|
|
|
readonlyForm:{}, |
|
|
|
|
option: { |
|
|
|
|
column: [{ |
|
|
|
|
icon: 'el-icon-info', |
|
|
|
|
label: '选项卡1', |
|
|
|
|
prop: 'tab1', |
|
|
|
|
}, { |
|
|
|
|
icon: 'el-icon-warning', |
|
|
|
|
label: '选项卡2', |
|
|
|
|
prop: 'tab2', |
|
|
|
|
}, { |
|
|
|
|
icon: 'el-icon-question', |
|
|
|
|
label: '选项卡3', |
|
|
|
|
prop: 'tab3', |
|
|
|
|
}] |
|
|
|
|
label: '基本信息', |
|
|
|
|
prop: 'information', |
|
|
|
|
} |
|
|
|
|
// , { |
|
|
|
|
// label: '技术参数', |
|
|
|
|
// prop: 'parameters', |
|
|
|
|
// }, { |
|
|
|
|
// label: '文档清册', |
|
|
|
|
// prop: 'document', |
|
|
|
|
// } |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
tab1_form: {}, |
|
|
|
|
tab1_option: { |
|
|
|
|
submitBtn: false, |
|
|
|
|
emptyBtn: false, |
|
|
|
|
column: [{ |
|
|
|
|
label: "测试", |
|
|
|
|
prop: "test" |
|
|
|
|
}] |
|
|
|
|
column: [ |
|
|
|
|
{ |
|
|
|
|
label: "设备台账编码", |
|
|
|
|
prop: "eqLedgerCode", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入设备台账编码", |
|
|
|
|
trigger: "blur", |
|
|
|
|
}], |
|
|
|
|
span: 6, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "设备描述", |
|
|
|
|
prop: "deviceDescription", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入设备描述", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
offset:6, |
|
|
|
|
span: 12, |
|
|
|
|
row:true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "用户状态", |
|
|
|
|
prop: "userStatus", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入用户状态", |
|
|
|
|
trigger: "blur", |
|
|
|
|
}], |
|
|
|
|
type: "select", |
|
|
|
|
dicUrl: "/api/daf-system/dict/dictionary?code=user_status", |
|
|
|
|
props: { |
|
|
|
|
label: "dictValue", |
|
|
|
|
value: "dictKey" |
|
|
|
|
}, |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "KKS编码", |
|
|
|
|
prop: "kksEncoding", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入KKS编码", |
|
|
|
|
trigger: "blur", |
|
|
|
|
}], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "KKS描述", |
|
|
|
|
prop: "kksDescription", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入KKS描述", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
span: 12 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "设备种类", |
|
|
|
|
prop: "eqType", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入设备种类", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "专业", |
|
|
|
|
prop: "major", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入专业", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "场站", |
|
|
|
|
prop: "station", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入场站", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
type: "select", |
|
|
|
|
dicUrl: "/api/daf-system/dict/dictionary?code=station", |
|
|
|
|
props: { |
|
|
|
|
label: "dictValue", |
|
|
|
|
value: "dictKey" |
|
|
|
|
}, |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "系统状态", |
|
|
|
|
prop: "systemState", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入系统状态", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "计划员组", |
|
|
|
|
prop: "plannerGroup", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入计划员组", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "计划工厂", |
|
|
|
|
prop: "plannedFactory", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "工厂区域", |
|
|
|
|
prop: "factoryArea", |
|
|
|
|
// rules: [{ |
|
|
|
|
// required: true, |
|
|
|
|
// message: "请输入工厂区域", |
|
|
|
|
// trigger: "blur" |
|
|
|
|
// }], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "资产编码", |
|
|
|
|
prop: "assetCode", |
|
|
|
|
// rules: [{ |
|
|
|
|
// required: true, |
|
|
|
|
// message: "请输入资产编码", |
|
|
|
|
// trigger: "blur" |
|
|
|
|
// }], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "设备定级", |
|
|
|
|
prop: "eqRank", |
|
|
|
|
// rules: [{ |
|
|
|
|
// required: true, |
|
|
|
|
// message: "请输入设备定级", |
|
|
|
|
// trigger: "blur" |
|
|
|
|
// }], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "设备责任人姓名", |
|
|
|
|
prop: "eqResponsibleName", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入设备责任人姓名", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "设备责任人工号", |
|
|
|
|
prop: "eqResponsibleNo", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "检修班组", |
|
|
|
|
prop: "maintenanceTeam", |
|
|
|
|
span: 6, |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "制造商", |
|
|
|
|
prop: "manufacturer", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "制造商国家", |
|
|
|
|
prop: "manufacturerCountry", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "制造商零件号", |
|
|
|
|
prop: "manufacturerPartNo", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "制造年月", |
|
|
|
|
prop: "manufactureDate", |
|
|
|
|
type: "date", |
|
|
|
|
format: 'yyyy/MM/dd', |
|
|
|
|
valueFormat: "yyyyMMdd", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "供应商", |
|
|
|
|
prop: "supplier", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入供应商", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "型号", |
|
|
|
|
prop: "model", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入型号", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "大小尺寸", |
|
|
|
|
prop: "sizeAndSize", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "制造序列号", |
|
|
|
|
prop: "manufacturingSerialNo", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "出厂编号", |
|
|
|
|
prop: "factoryNo", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "出厂日期", |
|
|
|
|
prop: "productionDate", |
|
|
|
|
type: "date", |
|
|
|
|
format: 'yyyy/MM/dd', |
|
|
|
|
valueFormat: "yyyyMMdd", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "设计单位", |
|
|
|
|
prop: "designUnit", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "对象重量", |
|
|
|
|
prop: "objectWeight", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "安装日期", |
|
|
|
|
prop: "installDate", |
|
|
|
|
type: "date", |
|
|
|
|
format: 'yyyy/MM/dd', |
|
|
|
|
valueFormat: "yyyyMMdd", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "调试单位", |
|
|
|
|
prop: "debuggingUnit", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "投运日期", |
|
|
|
|
prop: "operationDate", |
|
|
|
|
type: "date", |
|
|
|
|
format: 'yyyy/MM/dd', |
|
|
|
|
valueFormat: "yyyyMMdd", |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入投运日期", |
|
|
|
|
trigger: "blur" |
|
|
|
|
}], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "安装单位", |
|
|
|
|
prop: "installationUnit", |
|
|
|
|
// rules: [{ |
|
|
|
|
// required: true, |
|
|
|
|
// message: "请输入安装单位", |
|
|
|
|
// trigger: "blur" |
|
|
|
|
// }], |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "设备分类", |
|
|
|
|
prop: "eqClass", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "图纸编码", |
|
|
|
|
prop: "drawingCode", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "安装位置", |
|
|
|
|
prop: "installationLocation", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "成本中心", |
|
|
|
|
prop: "costCenter", |
|
|
|
|
span: 6 |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
tab2_page: { |
|
|
|
|
pageSize: 20, |
|
|
|
|
pagerCount: 5 |
|
|
|
|
}, |
|
|
|
|
tab2_data: [], |
|
|
|
|
tab2_option: { |
|
|
|
|
parameters_data: [], |
|
|
|
|
optionParam: { |
|
|
|
|
align: 'center', |
|
|
|
|
menuAlign: 'center', |
|
|
|
|
height: 'auto', |
|
|
|
|
calcHeight: 210, |
|
|
|
|
searchShow: true, |
|
|
|
|
searchMenuSpan: 6, |
|
|
|
|
tip: false, |
|
|
|
|
border: true, |
|
|
|
|
indexLabel: "序号", |
|
|
|
|
index: true, |
|
|
|
|
column: [ |
|
|
|
|
{ |
|
|
|
|
label: '姓名', |
|
|
|
|
prop: 'name' |
|
|
|
|
label: "分类", |
|
|
|
|
prop: "classification", |
|
|
|
|
span: 20, |
|
|
|
|
rules: [{ |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '性别', |
|
|
|
|
prop: 'sex' |
|
|
|
|
} |
|
|
|
|
label: "分类描述", |
|
|
|
|
prop: "description", |
|
|
|
|
span: 20, |
|
|
|
|
type: "textarea", |
|
|
|
|
rules: [{ |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "技术参数", |
|
|
|
|
prop: "techParameters", |
|
|
|
|
span: 20, |
|
|
|
|
rules: [{ |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "参数", |
|
|
|
|
prop: "parameters", |
|
|
|
|
span: 20, |
|
|
|
|
rules: [{ |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
tab3_page: { |
|
|
|
|
pageSize: 20, |
|
|
|
|
pagerCount: 5 |
|
|
|
|
}, |
|
|
|
|
tab3_data: [], |
|
|
|
|
tab3_option: { |
|
|
|
|
document_data: [], |
|
|
|
|
document_option: { |
|
|
|
|
align: 'center', |
|
|
|
|
menuAlign: 'center', |
|
|
|
|
height: 'auto', |
|
|
|
|
calcHeight: 210, |
|
|
|
|
searchShow: true, |
|
|
|
|
searchMenuSpan: 6, |
|
|
|
|
tip: false, |
|
|
|
|
border: true, |
|
|
|
|
indexLabel: "序号", |
|
|
|
|
index: true, |
|
|
|
|
column: [ |
|
|
|
|
{ |
|
|
|
|
label: '主题', |
|
|
|
|
prop: 'name' |
|
|
|
|
label: "标题", |
|
|
|
|
prop: "title", |
|
|
|
|
span: 20, |
|
|
|
|
rules: [{ |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '附件', |
|
|
|
|
prop: 'sex' |
|
|
|
|
} |
|
|
|
|
label: "作者", |
|
|
|
|
prop: "author", |
|
|
|
|
span: 20, |
|
|
|
|
rules: [{ |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "日期", |
|
|
|
|
prop: "date", |
|
|
|
|
type: "date", |
|
|
|
|
format: 'yyyy/MM/dd', |
|
|
|
|
valueFormat: "yyyyMMdd", |
|
|
|
|
span: 20, |
|
|
|
|
rules: [{ |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "页数", |
|
|
|
|
prop: "pages", |
|
|
|
|
span: 20, |
|
|
|
|
rules: [{ |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "关键字", |
|
|
|
|
prop: "keyword", |
|
|
|
|
span: 20, |
|
|
|
|
rules: [{ |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "主题", |
|
|
|
|
prop: "thead", |
|
|
|
|
span: 20, |
|
|
|
|
rules: [{ |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "附件", |
|
|
|
|
prop: "accessory", |
|
|
|
|
span: 20, |
|
|
|
|
type: 'upload', |
|
|
|
|
multiple: true, |
|
|
|
|
dataType: "string", |
|
|
|
|
propsHttp: { |
|
|
|
|
url: 'url', |
|
|
|
|
name: 'name', |
|
|
|
|
res: 'data' |
|
|
|
|
}, |
|
|
|
|
action: 'https://api.avuejs.com/imgupload', |
|
|
|
|
rules: [{ |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
...mapGetters(["permission"]), |
|
|
|
|
permissionList() { |
|
|
|
|
return { |
|
|
|
|
addBtn: true, |
|
|
|
|
viewBtn: this.vaildData(this.permission.techparameters_view, false), |
|
|
|
|
delBtn: true, |
|
|
|
|
editBtn: true |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
created () { |
|
|
|
|
this.type = this.option.column[0]; |
|
|
|
|
if(this.$route.query.frameMode == "search"){ |
|
|
|
|
this.option.column.push({ label: '技术参数', prop: 'parameters' },{ label: '文档清册', prop: 'document' }); |
|
|
|
|
this.readonlyForm=true; |
|
|
|
|
this.shouldShowButton=true; |
|
|
|
|
this.addUpdateShowButton=false; |
|
|
|
|
this.frame_class = 'frame_class1'; |
|
|
|
|
}else{ |
|
|
|
|
this.readonlyForm=false; |
|
|
|
|
this.shouldShowButton=false; |
|
|
|
|
this.addUpdateShowButton=true; |
|
|
|
|
this.frame_class = null; |
|
|
|
|
} |
|
|
|
|
this.SearchDetail(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
handleFormSubmit() { |
|
|
|
|
const form = this.$refs.tab1_form; |
|
|
|
|
form.validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
this.Submit(); |
|
|
|
|
} else { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "warning", |
|
|
|
|
message: "请输入必要信息!" |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 处理表单提交 |
|
|
|
|
Submit() { |
|
|
|
|
if(this.$route.query.frameMode=="add"){ |
|
|
|
|
add(this.tab1_form).then(()=>{ |
|
|
|
|
this.$router.push({ |
|
|
|
|
path: "/leger/equipmentledger", |
|
|
|
|
query: { |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}).catch((error) => { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "error", |
|
|
|
|
message: "操作失败!" |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}else { |
|
|
|
|
update(this.tab1_form).then(()=>{ |
|
|
|
|
this.$router.push({ |
|
|
|
|
path: "/leger/equipmentledger", |
|
|
|
|
query: { |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}).catch((error) => { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "error", |
|
|
|
|
message: "操作失败!" |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
back() { |
|
|
|
|
this.$router.push({ path: "/leger/equipmentledger"}); |
|
|
|
|
}, |
|
|
|
|
seachToUpdate () { |
|
|
|
|
this.shouldShowButton=false; |
|
|
|
|
this.addUpdateShowButton=true; |
|
|
|
|
this.readonlyForm=false; |
|
|
|
|
this.frame_class = null; |
|
|
|
|
}, |
|
|
|
|
handleChange (column) { |
|
|
|
|
this.type = column |
|
|
|
|
this.$message.success(JSON.stringify(column)) |
|
|
|
|
}, |
|
|
|
|
tab2_rowSave (form, done, loading) { |
|
|
|
|
// 技术参数 新增按钮处理 |
|
|
|
|
parameters_rowSave (form, done, loading) { |
|
|
|
|
loading(); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
form.eqLedgerId = this.$route.query.id; |
|
|
|
|
parameters_add(form).then(() => { |
|
|
|
|
done(form); |
|
|
|
|
}, 2000) |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}, error => { |
|
|
|
|
window.console.log(error); |
|
|
|
|
loading(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 技术参数 编辑按钮处理 |
|
|
|
|
parameters_rowUpdate (form, index, done, loading) { |
|
|
|
|
parameters_update(form).then(() => { |
|
|
|
|
done(form); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}, error => { |
|
|
|
|
window.console.log(error); |
|
|
|
|
loading(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 技术参数 删除按钮处理 |
|
|
|
|
parameters_rowDel (form, index,done) { |
|
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
return parameters_remove(form.id); |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 文档清册 新增按钮处理 |
|
|
|
|
document_rowSave (form, done, loading) { |
|
|
|
|
loading(); |
|
|
|
|
form.eqLedgerId = this.$route.query.id; |
|
|
|
|
document_insert(form).then(() => { |
|
|
|
|
done(form); |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}, error => { |
|
|
|
|
window.console.log(error); |
|
|
|
|
loading(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 文档清册 编辑按钮处理 |
|
|
|
|
document_rowUpdate (form, index, done, loading) { |
|
|
|
|
document_update(form).then(() => { |
|
|
|
|
done(form); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}, error => { |
|
|
|
|
window.console.log(error); |
|
|
|
|
loading(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 文档清册 删除按钮处理 |
|
|
|
|
document_rowDel (form, index,done) { |
|
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
return document_remove(form.id); |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
SearchDetail() { |
|
|
|
|
debugger |
|
|
|
|
getDetail(this.$route.query.id).then(res => { |
|
|
|
|
console.log(res); |
|
|
|
|
this.tab1_form = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
auditing() { |
|
|
|
|
this.$confirm("是否将数据审核?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.tab1_form.checkStatus="1" |
|
|
|
|
this.Submit(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
reject() { |
|
|
|
|
this.$confirm("是否将数据审核?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.tab1_form.checkStatus="2" |
|
|
|
|
this.Submit(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
headerClass(){ |
|
|
|
|
return 'head-style' |
|
|
|
|
}, |
|
|
|
|
onLoad(row, params = {}) { |
|
|
|
|
this.loading = true; |
|
|
|
|
parameters_getListBylegerId(this.$route.query.id).then(res => { |
|
|
|
|
this.parameters_data = res.data.data; |
|
|
|
|
this.loading = false; |
|
|
|
|
}); |
|
|
|
|
document_getListBylegerId(this.$route.query.id).then(res => { |
|
|
|
|
this.document_data = res.data.data; |
|
|
|
|
this.loading = false; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<style> |
|
|
|
|
.head-style{ |
|
|
|
|
background-color: #1e9fff !important; |
|
|
|
|
color: #FFFFFF !important; |
|
|
|
|
} |
|
|
|
|
.frame_class1 input.el-input__inner { |
|
|
|
|
border: none; |
|
|
|
|
box-shadow: none; |
|
|
|
|
outline: none; |
|
|
|
|
pointer-events: none; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|