Compare commits

...

2 Commits

Author SHA1 Message Date
266493081c 1.硬件版本列表批次改造 2024-08-21 16:43:56 +08:00
9cce9a6fc6 1.硬件版本列表批次改造 2024-08-21 16:38:07 +08:00
2 changed files with 44 additions and 7 deletions

View File

@ -264,8 +264,10 @@ export default {
/** 查询分类列表 */ /** 查询分类列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listDept2({status: '0',pageNum:1,pageSize:999 }).then(response => { listDept(this.queryParams).then(response => {
console.log("response======",response.data)
this.deptList = this.handleTree(response.data, "classifyId"); this.deptList = this.handleTree(response.data, "classifyId");
console.log("deptList======",this.deptList)
this.loading = false; this.loading = false;
}); });
}, },

View File

@ -69,17 +69,28 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="hardwareVersionList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
row-key="id"
:default-expand-all="isExpandAll"
:data="hardwareVersionList"
@selection-change="handleSelectionChange"
:row-class-name="tableRowClassName">
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键" align="center" prop="id" />-->
<el-table-column label="版本号" align="center" prop="version" /> <el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="生产时间" align="center" prop="productionTime" width="180"> <el-table-column label="生产时间" align="center" prop="productionTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.productionTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.productionTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量" align="center" prop="quantity" /> <el-table-column label="总量" width="80" align="center" prop="quantity" :formatter="formatNum" class-name="bold-text"/><!-- 手动 -->
<el-table-column label="版本说明" align="center" prop="instructions" /> <el-table-column label="已录入" width="80" align="center" prop="entered" :formatter="formatNum" class-name="bold-text"/>
<el-table-column label="已绑定" width="80" align="center" prop="bound" :formatter="formatNum" class-name="bold-text"/>
<el-table-column label="未绑定" width="80" align="center" prop="unBound" :formatter="formatNum" class-name="bold-text"/>
<el-table-column label="未录入" width="80" align="center" prop="notEnteredNum" :formatter="formatNum" class-name="bold-text"/><!-- 手动 -->
<el-table-column label="丢损" width="80" align="center" prop="lost" :formatter="formatNum" class-name="bold-text"/>
<el-table-column label="版本说明" width="280" align="center" prop="instructions" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -122,9 +133,12 @@
placeholder="请选择生产时间"> placeholder="请选择生产时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="quantity"> <el-form-item v-if="form.parentId == 0" label="数量" prop="quantity">
<el-input v-model="form.quantity" placeholder="请输入数量" /> <el-input v-model="form.quantity" placeholder="请输入数量" />
</el-form-item> </el-form-item>
<el-form-item v-if="form.parentId == 0" label="未录入" prop="notEnteredNum">
<el-input v-model="form.notEnteredNum" placeholder="请输入未录入数" />
</el-form-item>
<el-form-item label="版本说明" prop="instructions"> <el-form-item label="版本说明" prop="instructions">
<el-input v-model="form.instructions" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.instructions" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
@ -158,6 +172,8 @@ export default {
total: 0, total: 0,
// //
hardwareVersionList: [], hardwareVersionList: [],
//
isExpandAll: true,
// //
title: "", title: "",
// //
@ -181,11 +197,21 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
tableRowClassName({row, rowIndex}) {
if (row.parentId === 0) {
return 'success-row';
}
return '';
},
formatNum(row, column, cellValue) {
return cellValue === 0 ? '' : cellValue;
},
/** 查询硬件版本列表 */ /** 查询硬件版本列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listHardwareVersion(this.queryParams).then(response => { listHardwareVersion(this.queryParams).then(response => {
this.hardwareVersionList = response.rows; this.hardwareVersionList = this.handleTree(response.rows, "id");
console.log("hardwareVersionList",this.hardwareVersionList)
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
@ -202,6 +228,7 @@ export default {
version: null, version: null,
productionTime: null, productionTime: null,
quantity: null, quantity: null,
notEnteredNum: null,
instructions: null, instructions: null,
createTime: null createTime: null
}; };
@ -278,3 +305,11 @@ export default {
} }
}; };
</script> </script>
<style lang="scss">
.el-table .success-row {
background: oldlace !important;
}
.bold-text .cell {
font-weight: bold;
}
</style>