|
@@ -67,7 +67,7 @@
|
|
|
<el-tab-pane label="选择批次" name="second">
|
|
|
<el-form :inline="true" @keyup.enter.native="searchHandle()">
|
|
|
<el-form-item label="批次号">
|
|
|
- <el-input type="primary"></el-input>
|
|
|
+ <el-input type="primary" v-model="listQuery.batchNum"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float: right;">
|
|
|
<el-button type="primary" @click="searchHandle()">查询</el-button>
|
|
@@ -75,7 +75,7 @@
|
|
|
</el-form-item>
|
|
|
<el-row>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="searchHandle()">调拨</el-button>
|
|
|
+ <el-button type="primary" @click="addBatchHandle()">调拨</el-button>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
@@ -88,44 +88,49 @@
|
|
|
border
|
|
|
fit
|
|
|
highlight-current-row
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
>
|
|
|
- <el-table-column label="序号" type="index" width="50"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ :selectable="checkSelectable"
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
|
|
|
<el-table-column label="批次号">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.intime }}
|
|
|
+ {{ scope.row.batch_num }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="未调拨" prop="plateNumber">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.code }}
|
|
|
+ {{ scope.row.total - scope.row.transfer}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="可调拨" prop="deptId">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.total}}
|
|
|
+ {{ scope.row.total - scope.row.transfer }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="不可调拨" prop="vin">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.type }}
|
|
|
+ {{ scope.row.out_storage }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="入库时间" prop="vin">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.type }}
|
|
|
+ {{ scope.row.deliver_time }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column align="center" label="查看明细" width="180">
|
|
|
+ <!-- <el-table-column align="center" label="查看明细" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button @click="cerateHandle(scope.row.id, 1)" type="text">查看</el-button>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </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"
|
|
@@ -136,16 +141,19 @@
|
|
|
</el-tabs>
|
|
|
|
|
|
<add-or-update v-if="addVisible" ref="addOrUpdate" @refreshDataList="getDatalist"></add-or-update>
|
|
|
+
|
|
|
+ <addBatch v-if="addBatchVisible" ref="addBatch" @refreshDataList="getDataBatchlist"></addBatch>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { postJson, getSort } from '@/api/page'
|
|
|
-import { getInfoList } from '@/api/device/info'
|
|
|
+import { getInfoList, getBatchList } from '@/api/device/info'
|
|
|
import AddOrUpdate from '@/views/device/allocation/allocation-modal.vue'
|
|
|
+import addBatch from '@/views/device/allocation/allocationBatch-modal.vue'
|
|
|
|
|
|
export default {
|
|
|
- components: { AddOrUpdate },
|
|
|
+ components: { AddOrUpdate, addBatch },
|
|
|
data() {
|
|
|
return {
|
|
|
/**默认tab */
|
|
@@ -165,17 +173,37 @@ export default {
|
|
|
type: undefined,
|
|
|
sort: '',
|
|
|
sn: '',
|
|
|
+ batchNum: ''
|
|
|
},
|
|
|
/**是否显示新增弹窗 */
|
|
|
addVisible: false,
|
|
|
- /**是否显示批量导入弹窗 */
|
|
|
- upVisible: false,
|
|
|
+ /**是否显示批量弹窗 */
|
|
|
+ addBatchVisible: false,
|
|
|
+ /**批量选中的数据列表 */
|
|
|
+ multipleSelection: [],
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.getDatalist()
|
|
|
},
|
|
|
methods: {
|
|
|
+ //打开批量调拨弹窗
|
|
|
+ addBatchHandle() {
|
|
|
+ if(this.multipleSelection.length === 0) return this.$message.warning("请选择电池")
|
|
|
+ this.addBatchVisible = true
|
|
|
+ let numbers = []
|
|
|
+ this.multipleSelection.forEach(item => {
|
|
|
+ numbers.push(item.batch_num)
|
|
|
+ })
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.addBatch.init()
|
|
|
+ this.$refs.addBatch.title = '设备调拨'
|
|
|
+ this.$refs.addBatch.dataForm.batchNum = numbers
|
|
|
+ this.$refs.addBatch.number = 88
|
|
|
+ // this.$refs.addOrUpdate.packTitle = row.packTitle
|
|
|
+ // this.$refs.addOrUpdate.typeTitle = row.typeTitle
|
|
|
+ });
|
|
|
+ },
|
|
|
//返回上一页
|
|
|
goBack() {
|
|
|
this.$store.dispatch('tagsView/delView', this.$route)
|
|
@@ -184,16 +212,25 @@ export default {
|
|
|
/**tab页切换 */
|
|
|
handleClick(tab, event) {
|
|
|
this.activeName = tab.name
|
|
|
- this.getDatalist()
|
|
|
+ if(tab.name === 'first') {
|
|
|
+ this.getDatalist()
|
|
|
+ } else {
|
|
|
+ this.getDataBatchlist()
|
|
|
+ }
|
|
|
},
|
|
|
//搜索
|
|
|
searchHandle() {
|
|
|
this.listQuery.index = 1
|
|
|
- this.getDatalist()
|
|
|
+ if(this.activeName === 'first') {
|
|
|
+ this.getDatalist()
|
|
|
+ } else {
|
|
|
+ this.getDataBatchlist()
|
|
|
+ }
|
|
|
},
|
|
|
//获取列表数据
|
|
|
getDatalist() {
|
|
|
this.loading = true
|
|
|
+ this.data = []
|
|
|
getInfoList(this.listQuery).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.data = res.data
|
|
@@ -206,35 +243,58 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // getDatalist1() {
|
|
|
- // this.loading = true
|
|
|
- // transferBatch(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)
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
+ getDataBatchlist() {
|
|
|
+ this.loading = true
|
|
|
+ this.data = []
|
|
|
+ getBatchList(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)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
//重置
|
|
|
resetForm() {
|
|
|
-
|
|
|
+ this.listQuery = {
|
|
|
+ index: 1,
|
|
|
+ length: 20,
|
|
|
+ importance: undefined,
|
|
|
+ title: undefined,
|
|
|
+ type: undefined,
|
|
|
+ sort: '',
|
|
|
+ sn: '',
|
|
|
+ batchNum: ''
|
|
|
+ }
|
|
|
+ if(this.activeName === 'first') {
|
|
|
+ this.getDatalist()
|
|
|
+ } else {
|
|
|
+ this.getDataBatchlist()
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 分页, 每页条数
|
|
|
pageSizeChangeHandle (val) {
|
|
|
this.listQuery.index = 1
|
|
|
this.listQuery.length = val
|
|
|
- this.getDatalist()
|
|
|
+ if(this.activeName === 'first') {
|
|
|
+ this.getDatalist()
|
|
|
+ } else {
|
|
|
+ this.getDataBatchlist()
|
|
|
+ }
|
|
|
},
|
|
|
// 分页, 当前页
|
|
|
pageCurrentChangeHandle (val) {
|
|
|
this.listQuery.index = val
|
|
|
- this.getDatalist()
|
|
|
+ if(this.activeName === 'first') {
|
|
|
+ this.getDatalist()
|
|
|
+ } else {
|
|
|
+ this.getDataBatchlist()
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
//打开新增弹窗
|
|
@@ -268,30 +328,18 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ /**批量选择表格数据 */
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.multipleSelection = val
|
|
|
+ },
|
|
|
|
|
|
- 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
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- del(val) {
|
|
|
- this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- postJson('/api/v1/carinfo/delete', { id: val }).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.getDatalist()
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
+ /**确认哪些行禁止选择 */
|
|
|
+ checkSelectable(row) {
|
|
|
+ if (row.total - row.transfer > 0) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|