|
|
@ -6,9 +6,10 @@ |
|
|
|
:page="page" |
|
|
|
:page="page" |
|
|
|
:permission="permissionList" |
|
|
|
:permission="permissionList" |
|
|
|
:before-open="beforeOpen" |
|
|
|
:before-open="beforeOpen" |
|
|
|
|
|
|
|
:search.sync="search" |
|
|
|
|
|
|
|
:header-cell-class-name="headerClass" |
|
|
|
v-model="form" |
|
|
|
v-model="form" |
|
|
|
ref="crud" |
|
|
|
ref="crud" |
|
|
|
@row-update="rowUpdate" |
|
|
|
|
|
|
|
@row-save="rowSave" |
|
|
|
@row-save="rowSave" |
|
|
|
@row-del="rowDel" |
|
|
|
@row-del="rowDel" |
|
|
|
@search-change="searchChange" |
|
|
|
@search-change="searchChange" |
|
|
@ -23,17 +24,43 @@ |
|
|
|
icon="el-icon-delete" |
|
|
|
icon="el-icon-delete" |
|
|
|
plain |
|
|
|
plain |
|
|
|
v-if="permission.toolinventoryrecord_delete" |
|
|
|
v-if="permission.toolinventoryrecord_delete" |
|
|
|
@click="handleDelete">删 除 |
|
|
|
@click="handleDelete">批量删除 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot="menuRight"> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
plain |
|
|
|
|
|
|
|
@click="handleDetailAdd">新增 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
plain |
|
|
|
|
|
|
|
@click="handleAuditing">批量审核 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
plain |
|
|
|
|
|
|
|
@click="handleReject">批量驳回 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
plain |
|
|
|
|
|
|
|
@click="handleExport">导出 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<template #menu="{row,index,size}"> |
|
|
|
|
|
|
|
<el-button @click="handleDetailSearch(row,index)" type="text">查看</el-button> |
|
|
|
|
|
|
|
<el-button @click="rowDel(row)" type="text">删除</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
</avue-crud> |
|
|
|
</avue-crud> |
|
|
|
</basic-container> |
|
|
|
</basic-container> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import {getList, getDetail, add, update, remove} from "@/api/leger/toolinventoryrecord"; |
|
|
|
import {getList, getDetail, add, remove, reject, auditing} from "@/api/leger/toolinventoryrecord"; |
|
|
|
import {mapGetters} from "vuex"; |
|
|
|
import {mapGetters} from "vuex"; |
|
|
|
|
|
|
|
import {getToken} from "@/util/auth"; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
@ -53,153 +80,83 @@ |
|
|
|
searchMenuSpan: 6, |
|
|
|
searchMenuSpan: 6, |
|
|
|
tip: false, |
|
|
|
tip: false, |
|
|
|
border: true, |
|
|
|
border: true, |
|
|
|
index: true, |
|
|
|
index: false, |
|
|
|
viewBtn: true, |
|
|
|
viewBtn: true, |
|
|
|
selection: true, |
|
|
|
selection: true, |
|
|
|
column: [ |
|
|
|
column: [ |
|
|
|
{ |
|
|
|
|
|
|
|
label: "主键", |
|
|
|
|
|
|
|
prop: "id", |
|
|
|
|
|
|
|
rules: [{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入主键", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "工器具编码", |
|
|
|
label: "工器具编码", |
|
|
|
prop: "toolCode", |
|
|
|
prop: "toolsCodeId", |
|
|
|
rules: [{ |
|
|
|
search: true, |
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入工器具编码", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "工器具名称", |
|
|
|
label: "工器具名称", |
|
|
|
prop: "toolName", |
|
|
|
prop: "toolName", |
|
|
|
rules: [{ |
|
|
|
search: true, |
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入工器具名称", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "规格型号", |
|
|
|
label: "工器具类别", |
|
|
|
prop: "modelSpecification", |
|
|
|
prop: "toolCategory", |
|
|
|
rules: [{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入规格型号", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "配置日期", |
|
|
|
label: "工器具类别描述", |
|
|
|
prop: "configurationDate", |
|
|
|
prop: "toolTypeDescription", |
|
|
|
rules: [{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入配置日期", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "责任班组", |
|
|
|
label: "规格型号", |
|
|
|
prop: "responsibleTeam", |
|
|
|
prop: "modelSpecification", |
|
|
|
rules: [{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入责任班组", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "场站", |
|
|
|
label: "工器具状态", |
|
|
|
prop: "stations", |
|
|
|
prop: "toolStatus", |
|
|
|
rules: [{ |
|
|
|
search: true, |
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入场站", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "工器具类别", |
|
|
|
label: "工器具状态描述", |
|
|
|
prop: "toolCategory", |
|
|
|
prop: "toolStatusDescription", |
|
|
|
rules: [{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入工器具类别", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "工器具状态", |
|
|
|
label: "配置日期", |
|
|
|
prop: "toolStatus", |
|
|
|
prop: "configurationDate", |
|
|
|
rules: [{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入工器具状态", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "已用年限", |
|
|
|
label: "已用年限", |
|
|
|
prop: "yearsInUsed", |
|
|
|
prop: "yearsInUsed", |
|
|
|
rules: [{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入已用年限", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: "责任人", |
|
|
|
|
|
|
|
prop: "responsiblPerson", |
|
|
|
|
|
|
|
rules: [{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入责任人", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "工器具类别描述", |
|
|
|
label: "出厂编号", |
|
|
|
prop: "toolTypeDescription", |
|
|
|
prop: "factoryNo", |
|
|
|
rules: [{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入工器具类别描述", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "工器具状态描述", |
|
|
|
label: "责任班组", |
|
|
|
prop: "toolStatusDescription", |
|
|
|
prop: "responsibleTeam", |
|
|
|
rules: [{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入工器具状态描述", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "出厂编号", |
|
|
|
label: "责任人", |
|
|
|
prop: "factoryNo", |
|
|
|
prop: "responsiblPerson", |
|
|
|
rules: [{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入出厂编号", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "是否检验周期内", |
|
|
|
label: "是否检验周期内", |
|
|
|
prop: "isInspectionPeriod", |
|
|
|
prop: "isInspectionPeriod", |
|
|
|
rules: [{ |
|
|
|
type: "select", |
|
|
|
required: true, |
|
|
|
search: true, |
|
|
|
message: "请输入是否检验周期内", |
|
|
|
dicUrl: "/api/daf-system/dict/dictionary?code=yes_no", |
|
|
|
trigger: "blur" |
|
|
|
props: { |
|
|
|
}] |
|
|
|
label: "dictValue", |
|
|
|
|
|
|
|
value: "dictKey" |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "审核状态", |
|
|
|
label: "场站", |
|
|
|
prop: "checkStatus", |
|
|
|
prop: "stations", |
|
|
|
rules: [{ |
|
|
|
type: "select", |
|
|
|
required: true, |
|
|
|
search: true, |
|
|
|
message: "请输入审核状态", |
|
|
|
dicUrl: "/api/daf-system/dict/dictionary?code=station", |
|
|
|
trigger: "blur" |
|
|
|
props: { |
|
|
|
}] |
|
|
|
label: "dictValue", |
|
|
|
|
|
|
|
value: "dictKey" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
] |
|
|
|
] |
|
|
|
}, |
|
|
|
}, |
|
|
@ -209,14 +166,14 @@ |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
...mapGetters(["permission"]), |
|
|
|
...mapGetters(["permission"]), |
|
|
|
permissionList() { |
|
|
|
permissionList() { |
|
|
|
this.option.column = this.option.column.filter(v => { |
|
|
|
// this.option.column = this.option.column.filter(v => { |
|
|
|
return this.permission['toolinventoryrecord_col_' + v.prop] |
|
|
|
// return this.permission['toolinventoryrecord_col_' + v.prop] |
|
|
|
}) |
|
|
|
// }) |
|
|
|
return { |
|
|
|
return { |
|
|
|
addBtn: this.validData(this.permission.toolinventoryrecord_add, false), |
|
|
|
addBtn: false, |
|
|
|
viewBtn: this.validData(this.permission.toolinventoryrecord_view, false), |
|
|
|
viewBtn: false, |
|
|
|
delBtn: this.validData(this.permission.toolinventoryrecord_delete, false), |
|
|
|
delBtn: false, |
|
|
|
editBtn: this.validData(this.permission.toolinventoryrecord_edit, false) |
|
|
|
editBtn: false |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
ids() { |
|
|
|
ids() { |
|
|
@ -241,19 +198,6 @@ |
|
|
|
loading(); |
|
|
|
loading(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
rowUpdate(row, index, done, loading) { |
|
|
|
|
|
|
|
update(row).then(() => { |
|
|
|
|
|
|
|
done(); |
|
|
|
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
|
|
|
this.$message({ |
|
|
|
|
|
|
|
type: "success", |
|
|
|
|
|
|
|
message: "操作成功!" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, error => { |
|
|
|
|
|
|
|
window.console.log(error); |
|
|
|
|
|
|
|
loading(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
rowDel(row) { |
|
|
|
rowDel(row) { |
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
confirmButtonText: "确定", |
|
|
@ -271,6 +215,27 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 新增按钮处理 |
|
|
|
|
|
|
|
handleDetailAdd() { |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: "/leger/toolinventoryrecordDetail", |
|
|
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
frameMode:"add" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 查看操作处理 |
|
|
|
|
|
|
|
handleDetailSearch(row) { |
|
|
|
|
|
|
|
debugger |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: "/leger/toolinventoryrecordDetail", |
|
|
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
frameMode:"search", |
|
|
|
|
|
|
|
id: row.id |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 批量删除按钮处理 |
|
|
|
handleDelete() { |
|
|
|
handleDelete() { |
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
this.$message.warning("请选择至少一条数据"); |
|
|
|
this.$message.warning("请选择至少一条数据"); |
|
|
@ -293,6 +258,62 @@ |
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 批量审核按钮处理 |
|
|
|
|
|
|
|
handleAuditing() { |
|
|
|
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
|
|
|
this.$message.warning("请选择至少一条数据"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$confirm("是否将选择数据审核?", { |
|
|
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
|
|
type: "warning" |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(() => { |
|
|
|
|
|
|
|
return auditing(this.ids); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(() => { |
|
|
|
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
|
|
|
this.$message({ |
|
|
|
|
|
|
|
type: "success", |
|
|
|
|
|
|
|
message: "操作成功!" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 批量驳回按钮处理 |
|
|
|
|
|
|
|
handleReject() { |
|
|
|
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
|
|
|
this.$message.warning("请选择至少一条数据"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$confirm("是否将选择数据审核?", { |
|
|
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
|
|
type: "warning" |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(() => { |
|
|
|
|
|
|
|
return reject(this.ids); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(() => { |
|
|
|
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
|
|
|
this.$message({ |
|
|
|
|
|
|
|
type: "success", |
|
|
|
|
|
|
|
message: "操作成功!" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 导出按钮处理 |
|
|
|
|
|
|
|
handleExport() { |
|
|
|
|
|
|
|
this.$confirm("是否导出数据?", "提示", { |
|
|
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
|
|
type: "warning" |
|
|
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
window.open(`/api/equipmentledger/export?daf-auth=${getToken()}`); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
beforeOpen(done, type) { |
|
|
|
beforeOpen(done, type) { |
|
|
|
if (["edit", "view"].includes(type)) { |
|
|
|
if (["edit", "view"].includes(type)) { |
|
|
|
getDetail(this.form.id).then(res => { |
|
|
|
getDetail(this.form.id).then(res => { |
|
|
@ -333,10 +354,17 @@ |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
this.selectionClear(); |
|
|
|
this.selectionClear(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
headerClass() { |
|
|
|
|
|
|
|
return 'header-class' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style> |
|
|
|
<style> |
|
|
|
|
|
|
|
.header-class{ |
|
|
|
|
|
|
|
background-color: #3366cc !important; |
|
|
|
|
|
|
|
color: #FFFFFF !important; |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|