no message
parent
0c06eb3381
commit
35f64249f4
|
|
@ -23,7 +23,7 @@
|
|||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="query.stockTypeCode"
|
||||
v-model="query.stockType"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="容器类型"
|
||||
|
|
@ -32,10 +32,10 @@
|
|||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stockTypes"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
v-for="item in dict.stock_type"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
|
|
@ -83,10 +83,10 @@
|
|||
<el-form-item label="类型" prop="stockType">
|
||||
<el-select v-model="form.stockType" value-key="id" filterable placeholder="请选择" style="width: 180px;">
|
||||
<el-option
|
||||
v-for="item in stockTypes"
|
||||
v-for="item in dict.stock_type"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
<el-table-column prop="code" label="代码"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="stockType" label="类型">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.row.stockType.name }}</div>
|
||||
<div>{{ scope.row.stockType }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="area" label="状态">
|
||||
|
|
@ -189,12 +189,11 @@
|
|||
<script>
|
||||
import crudStock from '@/api/stock'
|
||||
import CRUD, {presenter, header, form, crud} from '@crud/crud'
|
||||
import {queryPointList, updatePointOk} from "@/api/point";
|
||||
import {queryPointList} from "@/api/point";
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import {getStockTypes} from '@/api/stockType'
|
||||
import DonMessage from "@/utils/message";
|
||||
import {getToken} from "@/utils/auth";
|
||||
import {getAres} from "@/api/area";
|
||||
|
|
@ -233,7 +232,7 @@ export default {
|
|||
name: 'Stock',
|
||||
components: {CallContainer, ReturnContainer, ContainerIn, pagination, crudOperation, rrOperation, udOperation},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
dicts: ['base_staus', 'use_status'],
|
||||
dicts: ['base_staus', 'use_status', 'stock_type'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '容器', url: 'api/stock', idField: 'id', sort: 'id,desc', crudMethod: {...crudStock},
|
||||
|
|
@ -252,7 +251,6 @@ export default {
|
|||
//地标点数据
|
||||
fileList: [],
|
||||
areas: [],
|
||||
pointListData: [],
|
||||
ContainerIn: {
|
||||
containerCode: '',
|
||||
position: ''
|
||||
|
|
@ -263,7 +261,6 @@ export default {
|
|||
edit: ['admin', 'stock:edit'],
|
||||
del: ['admin', 'stock:del']
|
||||
},
|
||||
stockTypes: [],
|
||||
rules: {
|
||||
id: [
|
||||
{required: true, message: '容器ID不能为空', trigger: 'blur'}
|
||||
|
|
@ -279,14 +276,11 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.getArea();
|
||||
this.getStockType();
|
||||
//获取点位表的数据
|
||||
this.getPointListData();
|
||||
},
|
||||
methods: {
|
||||
handleSuccess(response, file, fileList, crud) {
|
||||
let myError = response.toString();//转字符串
|
||||
DonMessage.success("" + response['message'])
|
||||
this.crud.notify(response['message'], CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
crud.toQuery()
|
||||
},
|
||||
handleErr(err, file, fileList) {
|
||||
|
|
@ -294,35 +288,12 @@ export default {
|
|||
let myError = err.toString();//转字符串
|
||||
myError = myError.replace("Error: ", "") // 去掉前面的" Error: "
|
||||
myError = JSON.parse(myError);//转对象
|
||||
|
||||
DonMessage.error("" + myError['message'])
|
||||
this.crud.notify(myError['message'], CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
getStockType() {
|
||||
getStockTypes({}).then(res => {
|
||||
this.stockTypes = res.content.map(function (obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
//获取点位表的数据
|
||||
getPointListData() {
|
||||
queryPointList().then(res => {
|
||||
for (const re of res) {
|
||||
if (re.status === "FREE" && re.area.name === "轴承座空车区") {
|
||||
this.pointListData.push(re);
|
||||
}
|
||||
}
|
||||
}).catch(e => {
|
||||
DonMessage.error("点位表数据获取失败")
|
||||
})
|
||||
},
|
||||
// 改变状态
|
||||
changeEnabled(data, val) {
|
||||
this.$confirm('此操作将 "' + this.dict.label.base_staus[val] + '" ' + data.code + ', 是否继续?', '提示', {
|
||||
|
|
|
|||
Loading…
Reference in New Issue