|
@@ -39,31 +39,25 @@
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table
|
|
|
- v-loading="loading"
|
|
|
- :data="locationList"
|
|
|
- row-key="id"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- :tree-props="{children: 'children', hasChildren: 'hasChildren'}
|
|
|
- ">
|
|
|
+ <el-table v-loading="loading" :data="locationList" row-key="id" @selection-change="handleSelectionChange" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<!-- <el-table-column label="位置编号" align="center" prop="number" /> -->
|
|
|
<el-table-column label="名称" align="center" prop="name" />
|
|
|
<el-table-column label="二维码" align="center" prop="number">
|
|
|
<template slot-scope="scope">
|
|
|
- <image-preview :src="getCode(scope.row.number)" :width="80" :height="80"/>
|
|
|
+ <image-preview :src="getCode(scope.row.number)" :width="80" :height="80" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="编号" align="center" prop="id" />
|
|
|
+ <el-table-column label="位置编码" align="center" prop="number" />
|
|
|
<el-table-column label="上级位置" align="center" prop="parentId" />
|
|
|
<!-- <el-table-column label="祖级列表" align="center" prop="sequence" /> -->
|
|
|
<el-table-column label="位置标签" align="center" prop="label">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag v-if="getLevel(scope.row.sequence) === 1">{{scope.row.label}}</el-tag>
|
|
|
- <el-tag type="success" v-if="getLevel(scope.row.sequence) === 2">{{scope.row.label}}</el-tag>
|
|
|
- <el-tag type="warning" v-if="getLevel(scope.row.sequence) === 3">{{scope.row.label}}</el-tag>
|
|
|
- <el-tag type="danger" v-if="getLevel(scope.row.sequence) === 4">{{scope.row.label}}</el-tag>
|
|
|
- <el-tag type="info" v-if="getLevel(scope.row.sequence) > 4">{{scope.row.label}}</el-tag>
|
|
|
+ <el-tag v-if="getLevel(scope.row.sequence) === 1">{{ scope.row.label }}</el-tag>
|
|
|
+ <el-tag type="success" v-if="getLevel(scope.row.sequence) === 2">{{ scope.row.label }}</el-tag>
|
|
|
+ <el-tag type="warning" v-if="getLevel(scope.row.sequence) === 3">{{ scope.row.label }}</el-tag>
|
|
|
+ <el-tag type="danger" v-if="getLevel(scope.row.sequence) === 4">{{ scope.row.label }}</el-tag>
|
|
|
+ <el-tag type="info" v-if="getLevel(scope.row.sequence) > 4">{{ scope.row.label }}</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
@@ -82,7 +76,7 @@
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="位置编号">
|
|
|
- <el-input v-model="form.number" placeholder="请输入位置编号" disabled/>
|
|
|
+ <el-input v-model="form.number" placeholder="请输入位置编号" disabled />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="名称" prop="name">
|
|
|
<el-input v-model="form.name" placeholder="请输入名称" />
|
|
@@ -108,8 +102,8 @@
|
|
|
|
|
|
<script>
|
|
|
import { getLocation, delLocation, addLocation, updateLocation, tree, treeSelect, selectQrCode, downloadCode } from '@/api/asset/location'
|
|
|
-import Treeselect from "@riophae/vue-treeselect";
|
|
|
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
+import Treeselect from '@riophae/vue-treeselect'
|
|
|
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
|
export default {
|
|
|
name: 'Location',
|
|
@@ -153,7 +147,7 @@ export default {
|
|
|
createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
|
|
|
updateTime: [{ required: true, message: '最后修改时间不能为空', trigger: 'blur' }],
|
|
|
},
|
|
|
- locationOption: []
|
|
|
+ locationOption: [],
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -176,13 +170,13 @@ export default {
|
|
|
this.getTreeSelect()
|
|
|
},
|
|
|
getTreeSelect() {
|
|
|
- treeSelect().then(res => {
|
|
|
+ treeSelect().then((res) => {
|
|
|
console.log('下拉树结果', res)
|
|
|
this.locationOption = res.data
|
|
|
})
|
|
|
},
|
|
|
getLevel(sequence) {
|
|
|
- return sequence.split(",").length
|
|
|
+ return sequence.split(',').length
|
|
|
},
|
|
|
getCode(number) {
|
|
|
return selectQrCode(number)
|
|
@@ -285,11 +279,7 @@ export default {
|
|
|
},
|
|
|
handleDownload() {
|
|
|
// downloadCode(this.ids)
|
|
|
- this.download(
|
|
|
- '/asset/location/download/code/' + this.ids,
|
|
|
- {},
|
|
|
- `location_${new Date().getTime()}.zip`
|
|
|
- )
|
|
|
+ this.download('/asset/location/download/code/' + this.ids, {}, `location_${new Date().getTime()}.zip`)
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|