更新
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 15:41:11
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2022-01-12 16:27:58
|
||||
* @LastEditTime: 2022-01-13 15:49:01
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -27,20 +27,20 @@
|
||||
<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 equipmentList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
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 equipmentList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in VehicleNameList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -66,7 +66,14 @@
|
||||
: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"
|
||||
@@ -74,15 +81,17 @@
|
||||
:limit.sync="formData.size"
|
||||
@pagination="getList()"
|
||||
/>
|
||||
<historical-task-info v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { equipmentInfoList } from '@/api/basicData/Equipment/equipmentInfo'
|
||||
import { HistoricalTaskList } from '@/api/basicData/Warehouse/HistoricalTask'
|
||||
import HistoricalTaskInfo from './components/HistoricalTaskInfo.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接口注释
|
||||
@@ -100,6 +109,12 @@ import Pagination from '@/components/Pagination' // Secondary package based on e
|
||||
*
|
||||
*/
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'view',
|
||||
btnName: 'btn.see'
|
||||
}
|
||||
]
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'taskCode',
|
||||
@@ -165,11 +180,13 @@ const tableProps = [
|
||||
|
||||
export default {
|
||||
name: 'ScrapInfo',
|
||||
components: { Pagination, BaseTable },
|
||||
components: { Pagination, BaseTable, MethodBtn, HistoricalTaskInfo },
|
||||
data() {
|
||||
return {
|
||||
trueWidth: 200,
|
||||
trueWidth: 100,
|
||||
addOrUpdateVisible: false,
|
||||
tableProps,
|
||||
tableBtn,
|
||||
list: [],
|
||||
total: 0,
|
||||
listLoading: false,
|
||||
@@ -193,26 +210,26 @@ export default {
|
||||
'label': '流转',
|
||||
'value': 2
|
||||
}],
|
||||
equipmentList: []
|
||||
TaskStatusList: [{
|
||||
'label': '初始化',
|
||||
'value': 0
|
||||
}, {
|
||||
'label': '损坏',
|
||||
'value': 1
|
||||
}],
|
||||
VehicleNameList: [{
|
||||
'label': '小车1',
|
||||
'value': 0
|
||||
}, {
|
||||
'label': '小车2',
|
||||
'value': 1
|
||||
}]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
const listQuery = {
|
||||
current: 1,
|
||||
size: 500
|
||||
}
|
||||
this.equipmentList.splice(0, this.equipmentList.length)
|
||||
equipmentInfoList(listQuery).then(response => {
|
||||
if (response.data.records) {
|
||||
this.equipmentList = response.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
if (this.formData.timeSlot) {
|
||||
this.formData.startTime = this.formData.timeSlot[0]
|
||||
@@ -231,6 +248,17 @@ export default {
|
||||
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)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user