commit
60e5294caf
10 changed files with 1645 additions and 152 deletions
@ -0,0 +1,198 @@ |
||||
<template> |
||||
<basic-container> |
||||
<avue-crud :option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
:search.sync="search" |
||||
:header-cell-class-name="headerClass" |
||||
v-model="form" |
||||
ref="crud" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@selection-change="selectionChange" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@on-load="onLoad"> |
||||
<template #menu="{row,index,size}"> |
||||
<el-button @click="handleDetailSearch(row,index)" type="text">查看详情</el-button> |
||||
</template> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import {getList, getDetail, add, update, remove, reject, auditing} from "@/api/leger/equipmentledger"; |
||||
import {mapGetters} from "vuex"; |
||||
import website from "@/config/website"; |
||||
import {getToken} from "@/util/auth"; |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
search: {}, |
||||
query: {}, |
||||
loading: true, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0 |
||||
}, |
||||
selectionList: [], |
||||
option: { |
||||
height: 'auto', |
||||
calcHeight: 210, |
||||
searchShow: true, |
||||
searchMenuSpan: 22, |
||||
searchBtnText: '查询', |
||||
emptyBtnText: '重置', |
||||
tip: false, |
||||
border: true, |
||||
indexLabel: "序号", |
||||
index: true, |
||||
viewBtn: false, |
||||
selection: false, |
||||
column: [ |
||||
{ |
||||
label: "场站", |
||||
prop: "station", |
||||
type: "select", |
||||
search: true, |
||||
hide: true, |
||||
dicUrl: "/api/daf-system/dict/dictionary?code=station", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey" |
||||
}, |
||||
}, |
||||
{ |
||||
label: "KKS编码", |
||||
prop: "kksEncoding", |
||||
search: true, |
||||
|
||||
}, |
||||
{ |
||||
label: "KKS描述", |
||||
prop: "kksDescription", |
||||
}, |
||||
{ |
||||
label: "工单", |
||||
prop: "workorder", |
||||
}, |
||||
{ |
||||
label: "工作票", |
||||
prop: "workticket", |
||||
}, |
||||
{ |
||||
label: "操作票", |
||||
prop: "operation", |
||||
}, |
||||
{ |
||||
label: "开始日期", |
||||
prop: "startDate", |
||||
search: true, |
||||
hide: true, |
||||
}, |
||||
{ |
||||
label: "结束日期", |
||||
prop: "endDate", |
||||
search: true, |
||||
hide: true, |
||||
}, |
||||
] |
||||
}, |
||||
data: [] |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
// this.option.column = this.option.column.filter(v => { |
||||
// return this.permission['equipmentledger_col_' + v.prop] |
||||
// }) |
||||
return { |
||||
addBtn: false, |
||||
viewBtn: false, |
||||
delBtn: false, |
||||
editBtn: false |
||||
}; |
||||
}, |
||||
ids() { |
||||
let ids = []; |
||||
this.selectionList.forEach(ele => { |
||||
ids.push(ele.id); |
||||
}); |
||||
return ids.join(","); |
||||
} |
||||
}, |
||||
methods: { |
||||
handleDetailSearch(row) { |
||||
debugger |
||||
this.$router.push({ |
||||
path: "/leger/dynamicledgerDetail", |
||||
query: { |
||||
frameMode:"search", |
||||
id: row.id, |
||||
station: row.station, |
||||
kksEncoding: row.kksEncoding, |
||||
kksDescription: row.kksDescription |
||||
}, |
||||
}); |
||||
}, |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then(res => { |
||||
this.form = res.data.data; |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
selectionChange(list) { |
||||
this.selectionList = list; |
||||
}, |
||||
selectionClear() { |
||||
this.selectionList = []; |
||||
this.$refs.crud.toggleSelection(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
this.selectionClear(); |
||||
}); |
||||
}, |
||||
headerClass() { |
||||
return 'header-class' |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style> |
||||
.header-class { |
||||
background-color: #3366cc !important; |
||||
color: #FFFFFF !important; |
||||
} |
||||
</style> |
@ -0,0 +1,355 @@ |
||||
<template> |
||||
<basic-container> |
||||
<template> |
||||
<el-row :span="24"> |
||||
<el-col :span="5"> |
||||
场站: |
||||
<el-select v-model="stationValue" disabled="disabled"> |
||||
<el-option |
||||
v-for="item in options" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.value"> |
||||
</el-option> |
||||
</el-select> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
KKS编码:<el-input |
||||
type="text" |
||||
resize="none" |
||||
v-model="kksEncodingValue" |
||||
style="width: 300px;" |
||||
disabled="disabled"> |
||||
</el-input> |
||||
</el-col> |
||||
<el-col :span="9"> |
||||
KKS描述:<el-input |
||||
type="text" |
||||
resize="none" |
||||
v-model="kksDesValue" |
||||
style="width: 500px;" |
||||
disabled="disabled"> |
||||
</el-input> |
||||
</el-col> |
||||
</el-row> |
||||
</template> |
||||
<avue-tabs :option="option" |
||||
@change="handleChange"></avue-tabs> |
||||
<span v-if="type.prop==='workorder'"> |
||||
<div> |
||||
<avue-crud :data="workorder_data" |
||||
:table-loading="loading" |
||||
:option="optionWorkOrder" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
:header-cell-class-name="headerClass" |
||||
v-model="workorder_form" |
||||
ref="workorder_crud"> |
||||
</avue-crud> |
||||
</div> |
||||
</span> |
||||
<span v-else-if="type.prop==='workticket'"> |
||||
<avue-crud :data="workticket_data" |
||||
:table-loading="loading" |
||||
:option="optionWorkTicket" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
:header-cell-class-name="headerClass" |
||||
v-model="workticket_form" |
||||
ref="workticket_crud"> |
||||
</avue-crud> |
||||
</span> |
||||
<span v-else-if="type.prop==='operation'"> |
||||
<div id="operation"> |
||||
<avue-crud :option="optionOperation" |
||||
:table-loading="loading" |
||||
:data="operation_data" |
||||
:permission="permissionList" |
||||
:header-cell-class-name="headerClass" |
||||
v-model="operation_form" |
||||
ref="operation_crud"> |
||||
</avue-crud> |
||||
</div> |
||||
</span> |
||||
</basic-container> |
||||
</template> |
||||
<script> |
||||
import {getList, getDetail, add, update, remove} from "@/api/leger/equipmentledger"; |
||||
import { |
||||
parameters_add, |
||||
parameters_update, |
||||
parameters_remove, |
||||
parameters_getListBylegerId, |
||||
parameters_Del |
||||
} from "@/api/leger/techparameters"; |
||||
import { |
||||
document_add, |
||||
document_update, |
||||
document_remove, |
||||
document_getListBylegerId, |
||||
document_Del |
||||
} 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: "dynamicledgerDetail", |
||||
data () { |
||||
return { |
||||
stationValue: this.$route.query.station, |
||||
options: [{ |
||||
value: 1, |
||||
label: '景和光伏' |
||||
}, { |
||||
value: 2, |
||||
label: '北沙一光伏' |
||||
}, { |
||||
value: 3, |
||||
label: '北沙二光伏' |
||||
}, { |
||||
value: 4, |
||||
label: '达坂城风电一场' |
||||
}], |
||||
kksEncodingValue:this.$route.query.kksEncoding, |
||||
kksDesValue:this.$route.query.kksDescription, |
||||
frame_class: '', |
||||
type: {}, |
||||
shouldShowButton:{}, |
||||
addUpdateShowButton:{}, |
||||
readonlyForm:{}, |
||||
option: { |
||||
column: [{ |
||||
label: '工单', |
||||
prop: 'workorder', |
||||
}, { |
||||
label: '工作票', |
||||
prop: 'workticket', |
||||
},{ |
||||
label: '操作票', |
||||
prop: 'operation', |
||||
} |
||||
] |
||||
}, |
||||
workorder_form: {}, |
||||
optionWorkOrder: { |
||||
align: 'center', |
||||
menuAlign: 'center', |
||||
height: 'auto', |
||||
calcHeight: 210, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
menu: false, |
||||
tip: false, |
||||
border: true, |
||||
indexLabel: "序号", |
||||
index: true, |
||||
column: [ |
||||
{ |
||||
label: "工单编号", |
||||
prop: "orderNo", |
||||
}, |
||||
{ |
||||
label: "工单类型", |
||||
prop: "orderType", |
||||
}, |
||||
{ |
||||
label: "内容描述", |
||||
prop: "orderDescription", |
||||
}, |
||||
{ |
||||
label: "维护作业类型", |
||||
prop: "maintenenceType", |
||||
}, |
||||
{ |
||||
label: "用户状态", |
||||
prop: "userStatus", |
||||
}, |
||||
{ |
||||
label: "发生时间", |
||||
prop: "happenDate", |
||||
}, |
||||
{ |
||||
label: "处理时间", |
||||
prop: "processDate", |
||||
}, |
||||
{ |
||||
label: "处理结果", |
||||
prop: "processResult", |
||||
}, |
||||
] |
||||
}, |
||||
tab2_page: { |
||||
pageSize: 20, |
||||
pagerCount: 5 |
||||
}, |
||||
workticket_data: [], |
||||
optionWorkTicket: { |
||||
align: 'center', |
||||
menuAlign: 'center', |
||||
height: 'auto', |
||||
calcHeight: 210, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
menu: false, |
||||
tip: false, |
||||
border: true, |
||||
indexLabel: "序号", |
||||
index: true, |
||||
column: [ |
||||
{ |
||||
label: "工作票编号", |
||||
prop: "ticketNo", |
||||
}, |
||||
{ |
||||
label: "工作票类型", |
||||
prop: "ticketType", |
||||
}, |
||||
{ |
||||
label: "工作负责人", |
||||
prop: "workPrincipal", |
||||
}, |
||||
{ |
||||
label: "许可人", |
||||
prop: "licensor", |
||||
}, |
||||
{ |
||||
label: "签发人", |
||||
prop: "signer", |
||||
}, |
||||
{ |
||||
label: "许可时间", |
||||
prop: "permissionDate", |
||||
}, |
||||
{ |
||||
label: "状态", |
||||
prop: "workStatus", |
||||
}, |
||||
] |
||||
}, |
||||
tab3_page: { |
||||
pageSize: 20, |
||||
pagerCount: 5 |
||||
}, |
||||
operation_data: [], |
||||
optionOperation: { |
||||
align: 'center', |
||||
menuAlign: 'center', |
||||
height: 'auto', |
||||
calcHeight: 210, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
menu: false, |
||||
tip: false, |
||||
border: true, |
||||
indexLabel: "序号", |
||||
index: true, |
||||
column: [ |
||||
{ |
||||
label: "操作票编号", |
||||
prop: "operationNo", |
||||
}, |
||||
{ |
||||
label: "状态", |
||||
prop: "operationStatus", |
||||
}, |
||||
{ |
||||
label: "操作任务", |
||||
prop: "operationTask", |
||||
}, |
||||
{ |
||||
label: "操作开始时间", |
||||
prop: "operationStateData", |
||||
}, |
||||
{ |
||||
label: "操作结束时间", |
||||
prop: "operationEndData", |
||||
}, |
||||
{ |
||||
label: "操作人", |
||||
prop: "operator", |
||||
}, |
||||
{ |
||||
label: '监护人', |
||||
prop: 'guardian', |
||||
}, |
||||
{ |
||||
label: "发令人", |
||||
prop: "enforcer", |
||||
}, |
||||
{ |
||||
label: "操作人所属班组", |
||||
prop: "operationTeam", |
||||
}, |
||||
{ |
||||
label: '风险等级', |
||||
prop: 'risk', |
||||
}, |
||||
{ |
||||
label: '是否合格', |
||||
prop: 'isQualified', |
||||
} |
||||
] |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
addBtn: false, |
||||
viewBtn: false, |
||||
delBtn: false, |
||||
editBtn: false |
||||
}; |
||||
}, |
||||
}, |
||||
created () { |
||||
this.type = this.option.column[0]; |
||||
}, |
||||
methods: { |
||||
handleChange (column) { |
||||
this.type = column |
||||
// if (column.prop == 'workodrder') { |
||||
// this.workodrder_onLoad(); |
||||
// }if (column.prop == 'workticket') { |
||||
// this.workticket_onLoad(); |
||||
// }if (column.prop == 'operation') { |
||||
// this.operation_onLoad(); |
||||
// } |
||||
}, |
||||
|
||||
headerClass(){ |
||||
return 'head-style' |
||||
}, |
||||
// workodrder_onLoad(row, params = {}) { |
||||
// this.loading = true; |
||||
// workodrder_getListBylegerId(this.$route.query.id).then(res => { |
||||
// this.parameters_data = res.data.data; |
||||
// this.loading = false; |
||||
// }); |
||||
// }, |
||||
// workticket_onLoad(row, params = {}) { |
||||
// this.loading = true; |
||||
// workticket_getListBylegerId(this.$route.query.id).then(res => { |
||||
// this.document_data = res.data.data; |
||||
// this.loading = false; |
||||
// }); |
||||
// }, |
||||
// operation_onLoad(row, params = {}) { |
||||
// this.loading = true; |
||||
// operation_getListBylegerId(this.$route.query.id).then(res => { |
||||
// this.document_data = res.data.data; |
||||
// this.loading = false; |
||||
// }); |
||||
// } |
||||
|
||||
} |
||||
} |
||||
</script> |
||||
<style> |
||||
.head-style{ |
||||
background-color: #3366cc !important; |
||||
color: #FFFFFF !important; |
||||
} |
||||
</style> |
@ -0,0 +1,836 @@ |
||||
<template> |
||||
<basic-container> |
||||
<avue-tabs :option="option" |
||||
@change="handleChange"></avue-tabs> |
||||
<span v-if="type.prop==='information'"> |
||||
<avue-form :option="tab1_option" |
||||
v-model="tab1_form" |
||||
ref="tab1_form" |
||||
:class="frame_class"> |
||||
</avue-form> |
||||
</span> |
||||
<span v-else-if="type.prop==='inspection'"> |
||||
<div> |
||||
<avue-crud :data="inspection_data" |
||||
:table-loading="loading" |
||||
:option="optionInspection" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
:header-cell-class-name="headerClass" |
||||
v-model="inspection_form" |
||||
ref="crud" |
||||
@row-del="inspection_rowDel" |
||||
@row-update="inspection_rowUpdate" |
||||
@row-save="inspection_rowSave"> |
||||
</avue-crud> |
||||
</div> |
||||
</span> |
||||
<span v-else-if="type.prop==='parameters'"> |
||||
<div> |
||||
<avue-crud :data="parameters_data" |
||||
:table-loading="loading" |
||||
:option="optionParam" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
:header-cell-class-name="headerClass" |
||||
v-model="parameters_form" |
||||
ref="crud" |
||||
@row-del="parameters_rowDel" |
||||
@row-update="parameters_rowUpdate" |
||||
@row-save="parameters_rowSave"> |
||||
</avue-crud> |
||||
</div> |
||||
</span> |
||||
<span v-else-if="type.prop==='document'"> |
||||
<avue-crud :option="optionDoc" |
||||
:table-loading="loading" |
||||
:data="document_data" |
||||
:permission="permissionList" |
||||
:header-cell-class-name="headerClass" |
||||
v-model="document_form" |
||||
ref="crud2" |
||||
@row-update="document_rowUpdate" |
||||
@row-save="document_rowSave" |
||||
@row-del="document_rowDel" |
||||
:upload-after="uploadAfter" |
||||
:upload-preview="(file) => handleUploadPreview(file)" |
||||
:upload-delete="(file) => handleUploadDelete(file)"> |
||||
<template #accessoryName="scope"> |
||||
<el-link type="primary" :underline="false" @click="handleDownload(scope.row)">{{scope.row.prAccessoryName}}</el-link> |
||||
</template> |
||||
<template #menu="{row,index,size}"> |
||||
<el-button size="small" type="text" @click="handleDownload(row)" icon="el-icon-download">下 载</el-button> |
||||
</template> |
||||
</avue-crud> |
||||
</span> |
||||
<div class="container"> |
||||
<span > |
||||
<el-button type="text" |
||||
size="large" |
||||
@click="back" |
||||
v-if="addUpdateShowButton"> |
||||
取消</el-button> |
||||
<el-button type="primary" |
||||
size="large" |
||||
@click="handleFormSubmit" |
||||
v-if="addUpdateShowButton"> |
||||
确定</el-button> |
||||
<el-button type="primary" |
||||
size="small" |
||||
@click="auditing" |
||||
v-if="shouldShowButton"> |
||||
审核</el-button> |
||||
<el-button type="primary" |
||||
size="small" |
||||
@click="reject" |
||||
v-if="shouldShowButton"> |
||||
驳回</el-button> |
||||
<el-button type="primary" |
||||
size="small" |
||||
@click="seachToUpdate" |
||||
v-if="shouldShowButton"> |
||||
修改</el-button> |
||||
<el-button type="primary" |
||||
size="small" |
||||
@click="del" |
||||
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/toolinventoryrecord"; |
||||
import { |
||||
inspection_add, |
||||
inspection_update, |
||||
inspection_remove, |
||||
inspection_getListBylegerId, |
||||
inspection_Del |
||||
} from "@/api/leger/inspectionstandards"; |
||||
import { |
||||
parameters_add, |
||||
parameters_update, |
||||
parameters_remove, |
||||
parameters_tools_getListBylegerId, |
||||
parameters_Del |
||||
} from "@/api/leger/techparameters"; |
||||
import { |
||||
document_add, |
||||
document_update, |
||||
document_remove, |
||||
document_tools_getListBylegerId, |
||||
document_Del |
||||
} 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:{}, |
||||
document_form:{}, |
||||
option: { |
||||
column: [{ |
||||
label: '基本信息', |
||||
prop: 'information', |
||||
} |
||||
] |
||||
}, |
||||
tab1_form: {}, |
||||
tab1_option: { |
||||
submitBtn: false, |
||||
emptyBtn: false, |
||||
column: [ |
||||
{ |
||||
label: "工器具编码", |
||||
prop: "toolsCodeId", |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入工器具编码", |
||||
trigger: "blur" |
||||
}], |
||||
span: 24, |
||||
}, |
||||
{ |
||||
label: "工器具名称", |
||||
prop: "toolName", |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入工器具名称", |
||||
trigger: "blur" |
||||
}], |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "工器具类别", |
||||
prop: "toolCategory", |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入工器具类别", |
||||
trigger: "blur" |
||||
}], |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "工器具类别描述", |
||||
prop: "toolTypeDescription", |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "规格型号", |
||||
prop: "modelSpecification", |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "工器具状态", |
||||
prop: "toolStatus", |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入工器具状态", |
||||
trigger: "blur" |
||||
}], |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "工器具状态描述", |
||||
prop: "toolStatusDescription", |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "配置日期", |
||||
prop: "configurationDate", |
||||
type: "date", |
||||
format: 'yyyy/MM/dd', |
||||
valueFormat: "yyyyMMdd", |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "已用年限", |
||||
prop: "yearsInUsed", |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "出厂编号", |
||||
prop: "factoryNo", |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "责任班组", |
||||
prop: "responsibleTeam", |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "责任人", |
||||
prop: "responsiblPerson", |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "是否检验周期内", |
||||
prop: "isInspectionPeriod", |
||||
type: "select", |
||||
search: true, |
||||
dicUrl: "/api/daf-system/dict/dictionary?code=yes_no", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey" |
||||
}, |
||||
span: 8, |
||||
}, |
||||
{ |
||||
label: "场站", |
||||
prop: "stations", |
||||
type: "select", |
||||
search: true, |
||||
dicUrl: "/api/daf-system/dict/dictionary?code=station", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey" |
||||
}, |
||||
span: 8, |
||||
}, |
||||
] |
||||
}, |
||||
inspection_data: [], |
||||
optionInspection: { |
||||
align: 'center', |
||||
menuAlign: 'center', |
||||
height: 'auto', |
||||
calcHeight: 210, |
||||
tip: false, |
||||
border: true, |
||||
indexLabel: "序号", |
||||
index: true, |
||||
column: [ |
||||
{ |
||||
label: "检验内容", |
||||
prop: "inspectionContent", |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入检验内容", |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: "检验标准", |
||||
prop: "inspectionStandards", |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入检验标准", |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
] |
||||
}, |
||||
tab2_page: { |
||||
pageSize: 20, |
||||
pagerCount: 5 |
||||
}, |
||||
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: "classification", |
||||
span: 20, |
||||
rules: [{ |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
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 |
||||
}, |
||||
document_data: [], |
||||
optionDoc: { |
||||
align: 'center', |
||||
menuAlign: 'center', |
||||
height: 'auto', |
||||
calcHeight: 210, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
tip: false, |
||||
border: true, |
||||
indexLabel: "序号", |
||||
index: true, |
||||
column: [ |
||||
{ |
||||
label: "标题", |
||||
prop: "title", |
||||
span: 20, |
||||
rules: [{ |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
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: "page", |
||||
span: 20, |
||||
rules: [{ |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: "关键字", |
||||
prop: "keyword", |
||||
span: 20, |
||||
rules: [{ |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: "主题", |
||||
prop: "thead", |
||||
span: 20, |
||||
rules: [{ |
||||
trigger: "blur" |
||||
}] |
||||
}, |
||||
{ |
||||
label: '附件', |
||||
prop: 'accessoryName', |
||||
dataType: 'object', |
||||
fileType: 'img',//img/video/audio |
||||
type: 'upload', |
||||
// hide: true, |
||||
limit: 1, |
||||
propsHttp: { |
||||
res: 'data', |
||||
}, |
||||
data: { |
||||
fileType: "1"// 静态台账-文档清册 |
||||
}, |
||||
headers: { |
||||
}, |
||||
span: 20, |
||||
action: './api/system/file/upload' |
||||
} |
||||
] |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
addBtn: true, |
||||
viewBtn: false, |
||||
delBtn: true, |
||||
editBtn: true |
||||
}; |
||||
}, |
||||
}, |
||||
created () { |
||||
this.type = this.option.column[0]; |
||||
if(this.$route.query.frameMode == "search"){ |
||||
this.option.column.push({ label: '检验标准', prop: 'inspection' },{ 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"){ |
||||
this.$confirm("是否新增所填数据?", "提示", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}).then(() => { |
||||
this.tab1_form.checkStatus="1" |
||||
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 { |
||||
this.$confirm("是否修改所填数据?", "提示", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}).then(() => { |
||||
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() { |
||||
if(this.$route.query.frameMode=="add") { |
||||
this.$router.push({path: "/leger/equipmentledger"}); |
||||
}else{ |
||||
this.updateToSearch(); |
||||
this.SearchDetail(); |
||||
} |
||||
}, |
||||
seachToUpdate () { |
||||
this.shouldShowButton=false; |
||||
this.addUpdateShowButton=true; |
||||
this.readonlyForm=false; |
||||
this.frame_class = null; |
||||
}, |
||||
updateToSearch () { |
||||
this.readonlyForm=true; |
||||
this.shouldShowButton=true; |
||||
this.addUpdateShowButton=false; |
||||
this.frame_class = 'frame_class1'; |
||||
}, |
||||
handleChange (column) { |
||||
this.type = column |
||||
if (column.prop == 'parameters') { |
||||
this.parameters_onLoad(); |
||||
}if (column.prop == 'document') { |
||||
this.document_onLoad(); |
||||
}if (column.prop == 'inspection') { |
||||
this.inspection_onLoad(); |
||||
} |
||||
}, |
||||
// 检验标准 新增按钮处理 |
||||
inspection_rowSave (form, done, loading) { |
||||
loading(); |
||||
form.toolsCodeId = this.$route.query.id; |
||||
inspection_add(form).then(() => { |
||||
done(form); |
||||
this.inspection_onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}, error => { |
||||
window.console.log(error); |
||||
loading(); |
||||
}); |
||||
}, |
||||
// 检验标准 编辑按钮处理 |
||||
inspection_rowUpdate(form, index, done, loading) { |
||||
inspection_update(form).then(() => { |
||||
done(form); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}, error => { |
||||
window.console.log(error); |
||||
loading(); |
||||
}); |
||||
|
||||
}, |
||||
// 检验标准 删除按钮处理 |
||||
inspection_rowDel(form, index, done) { |
||||
this.$confirm("确定将选择数据删除?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}) |
||||
.then(() => { |
||||
return inspection_remove(form.id); |
||||
}) |
||||
.then(() => { |
||||
this.inspection_onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}); |
||||
}, |
||||
// 技术参数 新增按钮处理 |
||||
parameters_rowSave (form, done, loading) { |
||||
loading(); |
||||
form.toolsCodeId = this.$route.query.id; |
||||
parameters_add(form).then(() => { |
||||
done(form); |
||||
this.parameters_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.parameters_onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}); |
||||
}, |
||||
// 文档清册 新增按钮处理 |
||||
document_rowSave(form, done, loading) { |
||||
loading(); |
||||
form.toolsCodeId = this.$route.query.id; |
||||
document_add(form).then(() => { |
||||
done(form); |
||||
this.document_onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}, error => { |
||||
window.console.log(error); |
||||
loading(); |
||||
}); |
||||
}, |
||||
// 文档清册 编辑按钮处理 |
||||
document_rowUpdate(form, index, done, loading) { |
||||
console.log(form) |
||||
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.document_onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}); |
||||
}, |
||||
SearchDetail() { |
||||
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 = "2" |
||||
this.submitRejectOrauditing(); |
||||
}); |
||||
}, |
||||
reject() { |
||||
this.$confirm("是否将数据审核?", "提示", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}).then(() => { |
||||
this.tab1_form.checkStatus = "3" |
||||
this.submitRejectOrauditing(); |
||||
}); |
||||
}, |
||||
submitRejectOrauditing() { |
||||
update(this.tab1_form).then(() => { |
||||
this.$router.push({ |
||||
path: "/leger/equipmentledger", |
||||
query: {}, |
||||
}); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}).catch((error) => { |
||||
this.$message({ |
||||
type: "error", |
||||
message: "操作失败!" |
||||
}); |
||||
}); |
||||
}, |
||||
del() { |
||||
this.$confirm("是否将选择数据审核?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}).then(() => { |
||||
remove(this.tab1_form.id).then(() => { |
||||
this.$router.push({ |
||||
path: "/leger/equipmentledger", |
||||
query: {}, |
||||
}); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}).catch((error) => { |
||||
this.$message({ |
||||
type: "error", |
||||
message: "操作失败!" |
||||
}); |
||||
}); |
||||
}) |
||||
}, |
||||
headerClass() { |
||||
return 'head-style' |
||||
}, |
||||
inspection_onLoad(row, params = {}) { |
||||
this.loading = true; |
||||
inspection_getListBylegerId(this.$route.query.id).then(res => { |
||||
this.inspection_data = res.data.data; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
parameters_onLoad(row, params = {}) { |
||||
this.loading = true; |
||||
parameters_tools_getListBylegerId(this.$route.query.id).then(res => { |
||||
this.parameters_data = res.data.data; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
document_onLoad(row, params = {}) { |
||||
this.loading = true; |
||||
document_tools_getListBylegerId(this.$route.query.id).then(res => { |
||||
this.document_data = res.data.data; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
handleDownload(row) { |
||||
window.open(`/api/system/file/download?daf-auth=${getToken()}&fileName=${row.accessoryName}`); |
||||
}, |
||||
uploadAfter(response, done) { |
||||
// response 是服务器响应 |
||||
this.document_form.accessoryName = response.fileName; |
||||
this.document_form.prAccessoryName = response.name; |
||||
done(); |
||||
}, |
||||
handleUploadPreview(file) { |
||||
// 禁止文件预览 |
||||
return false; |
||||
}, |
||||
handleUploadDelete(file) { |
||||
this.document_form.accessoryName = ''; |
||||
this.document_form.prAccessoryName = ''; |
||||
} |
||||
} |
||||
} |
||||
</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; |
||||
} |
||||
|
||||
.frame_class1 .el-input__icon { |
||||
display: none; |
||||
} |
||||
|
||||
.frame_class1 .el-input--prefix .el-input__inner { |
||||
padding-left: 15px; |
||||
} |
||||
|
||||
.container { |
||||
display: flex; |
||||
justify-content: flex-end; /* 将子元素推到容器的末端 */ |
||||
} |
||||
</style> |
Loading…
Reference in new issue