11-wms/src/views/wmsOutStore/outStoreOperation.vue

200 lines
5.1 KiB
Vue
Raw Normal View History

2022-10-19 17:01:55 +08:00
<template>
2022-10-20 16:44:27 +08:00
<div class="app-container">
<head-form :form-config="headFormConfig" @headBtnClick="btnClick" />
<base-table
:page="listQuery.current"
:limit="listQuery.size"
:height="tableH"
:table-config="tableProps"
:table-data="list"
:is-loading="listLoading"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:method-list="tableBtn"
:width="trueWidth"
@clickBtn="handleClick"
/>
</base-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.current"
:limit.sync="listQuery.size"
@pagination="getList()"
/>
<out-store-documents-add ref="outStoreDocumentsAdd" :dialog-title="showTitle" />
</div>
2022-10-19 17:01:55 +08:00
</template>
<script>
2022-10-20 16:44:27 +08:00
import HeadForm from '@/components/basicData/HeadForm'
import BaseTable from '@/components/BaseTable'
import Pagination from '@/components/Pagination'
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
import { tableHeight } from '@/utils/index'
import outStoreDocumentsAdd from './components/outStoreDocumentsAdd.vue'
2022-11-24 08:40:39 +08:00
import { getOperationCode2List, getOutboundNoList, getStoreList, getTimeArr, getDriverCodeList } from '@/utils/wmsDic'
2022-10-20 16:44:27 +08:00
const tableProps = [
{
prop: 'operationCode',
label: '作业号'
},
{
prop: 'outboundOrderNo',
label: '出库单号'
},
{
prop: 'goodsArea',
label: '货位'
},
{
prop: 'shipmentCacheArea',
label: '缓存区号'
},
{
prop: 'startTime',
label: '开始时间'
},
{
prop: 'endTime',
label: '结束时间'
},
{
prop: 'driverCode',
label: '司机/AGV编号'
}
]
const tableBtn = [
{
type: 'complete',
btnName: 'btn.complete'
},
{
type: 'cancellation',
btnName: 'btn.cancellation'
}
]
2022-10-19 17:01:55 +08:00
export default {
2022-10-20 16:44:27 +08:00
name: 'OutStoreOperation',
components: { HeadForm, BaseTable, Pagination, MethodBtn, outStoreDocumentsAdd },
data() {
return {
headFormConfig: [
{
type: 'input',
label: '关键字',
placeholder: '作业号或出库单号',
param: 'name',
width: 300
},
{
type: 'datePicker',
label: '时间范围',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime'
},
{
type: 'button',
btnName: 'btn.search',
name: 'search',
color: 'primary'
}
],
listQuery: {
current: 1,
size: 20
},
2022-11-24 08:40:39 +08:00
tableH: tableHeight(290),
2022-10-20 16:44:27 +08:00
tableProps,
list: [],
listLoading: false,
tableBtn,
total: 0,
trueWidth: 80,
showTitle: ''
}
},
mounted() {
window.addEventListener('resize', () => {
2022-11-24 08:40:39 +08:00
this.tableH = tableHeight(290)
2022-10-20 16:44:27 +08:00
})
this.getList()
},
methods: {
getList() {
const temp = []
2022-11-24 08:40:39 +08:00
const temp2 = []
const num = 17
2022-10-20 16:44:27 +08:00
for (let i = 0; i < num; i++) {
const obj = {}
2022-10-21 14:09:21 +08:00
const timeArrList = getTimeArr()
2022-11-24 08:40:39 +08:00
obj.operationCode = 'CQ1510433590'
2022-10-21 14:09:21 +08:00
obj.outboundOrderNo = getOutboundNoList()
2022-11-18 11:08:23 +08:00
obj.store = getStoreList()
2022-11-24 08:40:39 +08:00
obj.goodsArea = '成品库C-C区-' + (i + 8)
obj.shipmentCacheArea = 'HCQC' + (2631 - i)
2022-10-21 14:09:21 +08:00
obj.startTime = timeArrList[0]
obj.endTime = timeArrList[1]
obj.driverCode = getDriverCodeList()
2022-10-20 16:44:27 +08:00
temp.push(obj)
}
2022-11-24 08:40:39 +08:00
const arr = ['备件库-13-2', '辅材库-14', '备件库-13-4']
for (let i = 0; i < 3; i++) {
const obj = {}
const timeArrList = getTimeArr()
obj.operationCode = getOperationCode2List()
obj.outboundOrderNo = getOutboundNoList()
obj.store = getStoreList()
obj.goodsArea = arr[i]
obj.shipmentCacheArea = 'HCQC' + (2897 - i)
obj.startTime = timeArrList[0]
obj.endTime = timeArrList[1]
obj.driverCode = getDriverCodeList()
temp2.push(obj)
}
this.list = temp.concat(temp2)
2022-10-21 14:09:21 +08:00
console.log(this.list)
2022-11-24 08:40:39 +08:00
this.total = 20
2022-10-20 16:44:27 +08:00
},
btnClick(val) {
console.log(val)
this.getList()
},
handleClick(val) {
// console.log(val)
if (val.type === 'complete') {
this.$confirm('确定完成[ ' + val.data.outboundOrderNo + ' ]的吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async() => {
this.$message({
type: 'success',
message: '确定完成成功'
})
this.getList()
})
} else {
this.$confirm('确定作废[ ' + val.data.outboundOrderNo + ' ]的吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async() => {
this.$message({
type: 'success',
message: '确定作废成功'
})
this.getList()
})
}
}
}
2022-10-19 17:01:55 +08:00
}
</script>