277 lines
7.3 KiB
Vue
277 lines
7.3 KiB
Vue
<!--
|
|
* @Author: zwq
|
|
* @Date: 2020-12-29 15:41:11
|
|
* @LastEditors: zwq
|
|
* @LastEditTime: 2022-03-22 10:36:05
|
|
* @Description:
|
|
-->
|
|
<template>
|
|
<div class="app-container">
|
|
<el-form
|
|
ref="formData"
|
|
:model="formData"
|
|
:inline="true"
|
|
size="medium"
|
|
>
|
|
<el-form-item :label="$t('module.basicData.Warehouse.TaskType')" prop="taskType">
|
|
<el-select v-model="formData.taskType" filterable :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.Warehouse.TaskType')])" clearable>
|
|
<el-option
|
|
v-for="item in taskTypeList"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('module.basicData.Warehouse.TaskStatus')" prop="status">
|
|
<el-select v-model="formData.status" filterable :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.Warehouse.TaskStatus')])" clearable>
|
|
<el-option
|
|
v-for="item in TaskStatusList"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('module.basicData.Warehouse.VehicleName')" prop="equipmentId">
|
|
<el-select v-model="formData.equipmentId" filterable :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.Warehouse.VehicleName')])" clearable>
|
|
<el-option
|
|
v-for="item in VehicleNameList"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" @click="getList()"> {{ 'btn.search' | i18nFilter }} </el-button>
|
|
<el-button type="primary" @click="manualTask()"> {{ $t('module.basicData.Warehouse.PerformTaskManual') | i18nFilter }} </el-button>
|
|
<el-button type="primary" @click="publishTask()"> {{ $t('module.basicData.Warehouse.publishTask') | i18nFilter }} </el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<base-table
|
|
:page="formData.current"
|
|
:limit="formData.size"
|
|
:table-config="tableProps"
|
|
:table-data="list"
|
|
:is-loading="listLoading"
|
|
>
|
|
<method-btn
|
|
slot="handleBtn"
|
|
:width="trueWidth"
|
|
:method-list="tableBtn"
|
|
@clickBtn="handleClick"
|
|
/>
|
|
</base-table>
|
|
<pagination
|
|
v-show="total > 0"
|
|
:total="total"
|
|
:page.sync="formData.current"
|
|
:limit.sync="formData.size"
|
|
@pagination="getList()"
|
|
/>
|
|
<current-task-info v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getList" />
|
|
<current-task-add v-if="manualTaskVisible" ref="manualTaskRef" @refreshDataList="getList" />
|
|
<publish-task v-if="publishTaskVisible" ref="publishTask" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { CurrentTaskList } from '@/api/basicData/Warehouse/HistoricalTask'
|
|
import CurrentTaskInfo from './components/CurrentTaskInfo.vue'
|
|
import CurrentTaskAdd from './components/CurrentTask-add.vue'
|
|
import PublishTask from './components/PublishTask.vue'
|
|
import i18n from '@/lang'
|
|
import BaseTable from '@/components/BaseTable'
|
|
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
|
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
|
import { timeFormatter } from '@/filters'
|
|
/**
|
|
* 表格表头配置项 TypeScript接口注释
|
|
* tableConfig<ConfigItem> = []
|
|
*
|
|
* Interface ConfigItem = {
|
|
* prop: string,
|
|
* label: string,
|
|
* width: string,
|
|
* align: string,
|
|
* subcomponent: function,
|
|
* filter: function
|
|
* }
|
|
*
|
|
*
|
|
*/
|
|
|
|
const tableBtn = [
|
|
{
|
|
type: 'view',
|
|
btnName: 'btn.see'
|
|
}
|
|
]
|
|
const tableProps = [
|
|
{
|
|
prop: 'taskCode',
|
|
label: i18n.t('module.basicData.Warehouse.Code'),
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'createTime',
|
|
label: i18n.t('module.basicData.Warehouse.ExecutionTime'),
|
|
filter: timeFormatter,
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'taskSource',
|
|
label: i18n.t('module.basicData.Warehouse.TaskSource'),
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'taskType',
|
|
label: i18n.t('module.basicData.Warehouse.TaskType'),
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'fullCode',
|
|
label: i18n.t('module.basicData.Warehouse.TaskBoxNumber'),
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'emptyCode',
|
|
label: i18n.t('module.basicData.Warehouse.FullBoxNumber'),
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'wcurrProcessCode',
|
|
label: i18n.t('module.basicData.Warehouse.PreviousOperation'),
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'wnextProcessCode',
|
|
label: i18n.t('module.basicData.Warehouse.NextOperation'),
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'anotherCurrLocation',
|
|
label: i18n.t('module.basicData.Warehouse.StartLocation'),
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'anotherTargetLocation',
|
|
label: i18n.t('module.basicData.Warehouse.TargetLocation'),
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'currLocation',
|
|
label: i18n.t('module.basicData.Warehouse.FullBoxStartLocation'),
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'name',
|
|
label: i18n.t('module.basicData.Warehouse.VehicleName'),
|
|
align: 'center'
|
|
}
|
|
]
|
|
|
|
export default {
|
|
name: 'ScrapInfo',
|
|
components: { Pagination, BaseTable, MethodBtn, CurrentTaskInfo, CurrentTaskAdd, PublishTask },
|
|
data() {
|
|
return {
|
|
trueWidth: 100,
|
|
addOrUpdateVisible: false,
|
|
manualTaskVisible: false,
|
|
publishTaskVisible: false,
|
|
tableProps,
|
|
tableBtn,
|
|
list: [],
|
|
total: 0,
|
|
listLoading: false,
|
|
formData: {
|
|
taskType: '',
|
|
status: '',
|
|
equipmentId: '',
|
|
current: 1,
|
|
size: 10
|
|
},
|
|
taskTypeList: [{
|
|
'label': i18n.t('module.basicData.Warehouse.ExWarehouse'),
|
|
'value': 0
|
|
}, {
|
|
'label': i18n.t('module.basicData.Warehouse.InWarehouse'),
|
|
'value': 1
|
|
}, {
|
|
'label': i18n.t('module.basicData.Warehouse.Circulation'),
|
|
'value': 2
|
|
}],
|
|
TaskStatusList: [{
|
|
'label': i18n.t('module.basicData.Warehouse.Initialization'),
|
|
'value': 0
|
|
}, {
|
|
'label': i18n.t('module.basicData.Warehouse.Damage'),
|
|
'value': 1
|
|
}],
|
|
VehicleNameList: [{
|
|
'label': '小车1',
|
|
'value': 0
|
|
}, {
|
|
'label': '小车2',
|
|
'value': 1
|
|
}]
|
|
}
|
|
},
|
|
created() {
|
|
this.getList()
|
|
},
|
|
methods: {
|
|
getList() {
|
|
this.listLoading = true
|
|
CurrentTaskList(this.formData).then(response => {
|
|
if (response.data.records) {
|
|
this.list = response.data.records
|
|
} else {
|
|
this.list.splice(0, this.list.length)
|
|
}
|
|
this.total = response.data.total
|
|
this.listLoading = false
|
|
})
|
|
},
|
|
handleClick(raw) {
|
|
console.log(raw)
|
|
this.addNew(raw.data.id)
|
|
},
|
|
// 新增 / 修改
|
|
addNew(id) {
|
|
this.addOrUpdateVisible = true
|
|
this.$nextTick(() => {
|
|
this.$refs.addOrUpdate.init(id)
|
|
})
|
|
},
|
|
// 手动执行任务
|
|
manualTask() {
|
|
this.manualTaskVisible = true
|
|
this.$nextTick(() => {
|
|
this.$refs.manualTaskRef.init()
|
|
})
|
|
},
|
|
// 发布任务
|
|
publishTask() {
|
|
this.publishTaskVisible = true
|
|
this.$nextTick(() => {
|
|
this.$refs.publishTask.init()
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.edit-input {
|
|
padding-right: 100px;
|
|
}
|
|
.cancel-btn {
|
|
position: absolute;
|
|
right: 15px;
|
|
top: 10px;
|
|
}
|
|
</style>
|