|
@@ -0,0 +1,234 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <h1>设备出库</h1>
|
|
|
+ <div class="top-info">
|
|
|
+ 已出库设备 <span>1864</span>,可出库设备 <span>200</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-form :inline="true" :model="listQuery" @keyup.enter.native="searchHandle()">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="设备SN">
|
|
|
+ <el-input v-model="listQuery.sn" placeholder="请输入设备SN" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <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="8">
|
|
|
+ <div style="float: right;">
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="searchHandle()">搜索</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click="resetForm()">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </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="cerateHandle()">新增出库</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="resetForm()">批次出库</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ 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
|
|
|
+ >
|
|
|
+ <el-table-column label="出库时间">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.intime }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="设备数量">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.code }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="出库类型">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.total}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="客户">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.dt }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="接收人">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.into }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="接收人电话">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.create }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="出库人">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.create }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="操作" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="edit(scope.row.id)" type="text">查看详情</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <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="add" @refreshDataList="getDataList"></Create>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { deliveryList } from '@/api/device/delivery'
|
|
|
+import Create from '@/views/device/delivery/delivery-add.vue'
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: { Create },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ //列表加载动画
|
|
|
+ loading: false,
|
|
|
+ //总条数
|
|
|
+ total: 0,
|
|
|
+ //列表数据
|
|
|
+ data: [],
|
|
|
+ /**查询条件对象 */
|
|
|
+ listQuery: {
|
|
|
+ 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() {
|
|
|
+ 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.index = 1
|
|
|
+ this.listQuery.length = val
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+ // 分页, 当前页
|
|
|
+ pageCurrentChangeHandle (val) {
|
|
|
+ this.listQuery.index = val
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+
|
|
|
+ //打开新增弹窗
|
|
|
+ cerateHandle() {
|
|
|
+ this.addVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.add.init()
|
|
|
+ });
|
|
|
+ },
|
|
|
+ del(val) {
|
|
|
+ this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ postJson('/api/v1/carinfo/delete', { id: val }).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.fetchData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .top-info {
|
|
|
+ height: 53px;
|
|
|
+ line-height: 53px;
|
|
|
+ width: 100%;
|
|
|
+ background-color: rgba(242, 242, 242, 1);
|
|
|
+ box-shadow: none;
|
|
|
+ text-align: left;
|
|
|
+ color: #7F7F7F;
|
|
|
+ font-size: 13px;
|
|
|
+ padding-left: 20px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ >span {
|
|
|
+ color: #0000FF;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|