|
@@ -2,30 +2,28 @@
|
|
|
<div class="app-container">
|
|
|
<h1>设备调拨</h1>
|
|
|
<div class="top-info">
|
|
|
- 已对外调拨电池设备 <span>1864</span>,平台库存 <span>200</span>
|
|
|
+ 已出库设备 <span>1864</span>,可出库设备 <span>200</span>
|
|
|
</div>
|
|
|
|
|
|
- <el-form :inline="true" :model="listQuery" @keyup.enter.native="handleFilter()">
|
|
|
+ <el-form :inline="true" :model="listQuery" @keyup.enter.native="searchHandle()">
|
|
|
<el-row>
|
|
|
- <el-col :span="6">
|
|
|
+ <el-col :span="8">
|
|
|
<el-form-item label="设备SN">
|
|
|
- <el-input v-model="listQuery.type" placeholder="请输入设备SN" clearable></el-input>
|
|
|
+ <el-input v-model="listQuery.sn" placeholder="请输入设备SN" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="调拨时间">
|
|
|
- <el-input v-model="listQuery.type" placeholder="请选择" clearable></el-input>
|
|
|
+
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="出库类型">
|
|
|
+ <el-select v-model="listQuery.type">
|
|
|
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="调拨类型">
|
|
|
- <el-input v-model="listQuery.type" placeholder="请选择" clearable></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
+ <el-col :span="8">
|
|
|
<div style="float: right;">
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="handleFilter()">搜索</el-button>
|
|
|
+ <el-button type="primary" @click="searchHandle()">搜索</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button @click="resetForm()">重置</el-button>
|
|
@@ -33,63 +31,75 @@
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="出库时间">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="listQuery.time"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<el-row>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="backHandle()">调回平台</el-button>
|
|
|
+ <el-button type="primary" @click="gotoAddHandle()">新增调拨</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="addHandle()">新增调拨</el-button>
|
|
|
+ <el-button type="primary" @click="gotoBackHandle()">调回平台</el-button>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
|
|
|
<el-table
|
|
|
- v-loading="page.loading"
|
|
|
- :data="page.data"
|
|
|
+ v-loading="loading"
|
|
|
+ :data="data"
|
|
|
element-loading-text="Loading"
|
|
|
:header-cell-style="{background:'rgba(242, 242, 242, 1)',borderColor:'rgba(242, 242, 242, 1);',textAlign:'center'}"
|
|
|
:cell-style="{'text-align':'center'}"
|
|
|
fit
|
|
|
highlight-current-row
|
|
|
- @sort-change="sortChange"
|
|
|
>
|
|
|
- <el-table-column label="调拨时间" sortable="custom">
|
|
|
+ <el-table-column label="出库时间" sortable="custom">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.intime }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="调拨数量" prop="plateNumber">
|
|
|
+ <el-table-column label="设备数量" prop="plateNumber">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.code }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="调拨类型" prop="deptId">
|
|
|
+ <el-table-column label="出库类型" prop="deptId">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.total}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="用途" prop="vin">
|
|
|
+ <el-table-column label="客户">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.type }}
|
|
|
+ {{ scope.row.dt }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="客户">
|
|
|
+ <el-table-column label="接收人" prop="model" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.dt }}
|
|
|
+ {{ scope.row.into }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="调拨人" prop="model" width="80">
|
|
|
+ <el-table-column label="接收电话">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.into }}
|
|
|
+ {{ scope.row.create }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="备注">
|
|
|
+ <el-table-column label="出库人">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.create }}
|
|
|
</template>
|
|
@@ -102,73 +112,82 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
- <el-pagination style="float: right; margin-top: 30px;" :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.limit" :total="listQuery.total"
|
|
|
+ <el-pagination style="float: right; margin-top: 30px;" :current-page="listQuery.index" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.length" :total="total"
|
|
|
layout="total, sizes, prev, pager, next, jumper" @size-change="pageSizeChangeHandle"
|
|
|
@current-change="pageCurrentChangeHandle">
|
|
|
</el-pagination>
|
|
|
+ <!-- <create v-if="addVisible" ref="create" @refreshDataList="fetchData"></create> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { postJson, getSort } from '@/api/page'
|
|
|
+import { deliveryList } from '@/api/device/delivery'
|
|
|
// import Create from './create'
|
|
|
|
|
|
export default {
|
|
|
components: { },
|
|
|
data() {
|
|
|
return {
|
|
|
- page: {
|
|
|
- loading: false,
|
|
|
- data: [
|
|
|
- {code: 'SZRLCG20210001', total: 100, type: '二轮车', dt: '美顺', into: 0, create: '张三', address: '北京', to: '2021-05-18', intime: '2021-05-18 13:13:32',id: 'asdasdas'},
|
|
|
- {code: 'SZRLCG20210001', total: 100, type: '二轮车', dt: '美顺', into: 0, create: '张三', address: '北京', to: '2021-05-18', intime: '2021-05-18 13:13:32',id: 'asdasdas'},
|
|
|
- {code: 'SZRLCG20210001', total: 100, type: '二轮车', dt: '美顺', into: 0, create: '张三', address: '北京', to: '2021-05-18', intime: '2021-05-18 13:13:32',id: 'asdasdas'},
|
|
|
- {code: 'SZRLCG20210001', total: 100, type: '二轮车', dt: '美顺', into: 0, create: '张三', address: '北京', to: '2021-05-18', intime: '2021-05-18 13:13:32',id: 'asdasdas'}
|
|
|
- ],
|
|
|
- param: {
|
|
|
- index: 1,
|
|
|
- length: 10,
|
|
|
- sort: 'updateTime desc',
|
|
|
- plateNumber: ''
|
|
|
- }
|
|
|
- },
|
|
|
+ //列表加载动画
|
|
|
+ loading: false,
|
|
|
+ //总条数
|
|
|
+ total: 0,
|
|
|
+ //列表数据
|
|
|
+ data: [],
|
|
|
/**查询条件对象 */
|
|
|
listQuery: {
|
|
|
- page: 1,
|
|
|
- limit: 20,
|
|
|
- total: 3,
|
|
|
- importance: undefined,
|
|
|
- title: undefined,
|
|
|
- type: undefined,
|
|
|
+ index: 1,
|
|
|
+ length: 20,
|
|
|
+ sn: '',
|
|
|
+ type: null,
|
|
|
sort: '+id'
|
|
|
},
|
|
|
/**是否显示新增弹窗 */
|
|
|
addVisible: false,
|
|
|
-
|
|
|
+ //出库类型选项
|
|
|
+ options: [
|
|
|
+ {label: '全部', value: null},
|
|
|
+ {label: '商用', value: 1},
|
|
|
+ {label: '测试', value: 2},
|
|
|
+ {label: '试用', value: 3}
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
created() {
|
|
|
- if (this.$route.query.pageIndex !== undefined) {
|
|
|
- this.page.param.index = this.$route.query.pageIndex
|
|
|
- }
|
|
|
- if (this.$route.query.word !== undefined) {
|
|
|
- this.page.param.title = this.$route.query.word
|
|
|
- }
|
|
|
- // this.fetchData()
|
|
|
+ this.getDataList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ //搜索
|
|
|
+ searchHandle() {
|
|
|
+ this.listQuery.index = 1
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取列表数据
|
|
|
+ getDataList() {
|
|
|
+ this.loading = true
|
|
|
+ deliveryList(this.listQuery).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.data = res.data
|
|
|
+ this.total = res.total
|
|
|
+ this.loading = false
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
+ return this.$message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
// 分页, 每页条数
|
|
|
pageSizeChangeHandle (val) {
|
|
|
- this.listQuery.page = 1
|
|
|
- this.listQuery.limit = val
|
|
|
- // this.fetchData()
|
|
|
+ this.listQuery.index = 1
|
|
|
+ this.listQuery.length = val
|
|
|
+ this.getDataList()
|
|
|
},
|
|
|
// 分页, 当前页
|
|
|
pageCurrentChangeHandle (val) {
|
|
|
- this.listQuery.page = val
|
|
|
- // this.fetchData()
|
|
|
+ this.listQuery.index = val
|
|
|
+ this.getDataList()
|
|
|
},
|
|
|
|
|
|
//打开新增弹窗
|
|
@@ -178,43 +197,24 @@ export default {
|
|
|
this.$refs.create.init()
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
- /**跳转调回平台页面 */
|
|
|
- backHandle() {
|
|
|
- this.$router.push('/device/allocation/allocationBack')
|
|
|
+ //重置、
|
|
|
+ resetForm() {
|
|
|
+ this.listQuery = {
|
|
|
+ index: 1,
|
|
|
+ length: 20,
|
|
|
+ sn: '',
|
|
|
+ type: null,
|
|
|
+ sort: '+id'
|
|
|
+ }
|
|
|
+ this.searchHandle()
|
|
|
},
|
|
|
-
|
|
|
- /**跳转新增调拨页面 */
|
|
|
- addHandle() {
|
|
|
+ //跳转新增调拨页面
|
|
|
+ gotoAddHandle() {
|
|
|
this.$router.push('/device/allocation/allocationAdd')
|
|
|
},
|
|
|
-
|
|
|
- dataFormSubmitHandle() {},
|
|
|
-
|
|
|
- search() {
|
|
|
- this.page.param.index = 1
|
|
|
- // this.fetchData()
|
|
|
- },
|
|
|
- fetchData() {
|
|
|
- this.page.loading = false
|
|
|
- postJson('/api/v1/carinfo/pageQuery', this.page.param).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.page.data = response.data
|
|
|
- this.page.total = response.total
|
|
|
- this.page.loading = false
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- sortChange(data) {
|
|
|
- this.page.param.index = 1
|
|
|
- this.page.param.sort = getSort(data)
|
|
|
- this.fetchData()
|
|
|
- },
|
|
|
- add() {
|
|
|
- this.$router.push('/car/info/add')
|
|
|
- },
|
|
|
- edit(val) {
|
|
|
- this.$router.push({ path: '/car/info/add', query: { id: val, pageIndex: this.page.param.index, word: this.page.param.title }})
|
|
|
+ //跳转调回平台页面
|
|
|
+ gotoBackHandle() {
|
|
|
+ this.$router.push('/device/allocation/allocationBack')
|
|
|
},
|
|
|
del(val) {
|
|
|
this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
|