bonus-ui/src/views/material/purchase/goodsBind/component/home.vue

295 lines
9.2 KiB
Vue
Raw Normal View History

2024-10-29 18:03:15 +08:00
<template>
2024-11-08 17:41:07 +08:00
<!-- 新购验收绑定主页列表 -->
2024-10-29 18:03:15 +08:00
<div>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
2024-11-08 17:41:07 +08:00
label-width="100px"
2024-10-29 18:03:15 +08:00
>
2024-11-08 17:41:07 +08:00
<el-form-item label="日期">
2024-10-29 18:03:15 +08:00
<el-date-picker
2024-11-08 17:41:07 +08:00
type="daterange"
v-model="queryTime"
range-separator="-"
style="width: 240px"
value-format="yyyy-MM-dd"
end-placeholder="结束日期"
start-placeholder="开始日期"
@change="onTimeChange"
2024-10-29 18:03:15 +08:00
></el-date-picker>
</el-form-item>
2024-11-08 17:41:07 +08:00
<el-form-item label="设备状态" prop="status">
2024-10-29 18:03:15 +08:00
<el-select
clearable
filterable
style="width: 240px"
2024-11-08 17:41:07 +08:00
placeholder="请选择设备状态"
v-model="queryParams.status"
2024-10-29 18:03:15 +08:00
>
<el-option
2024-11-08 17:41:07 +08:00
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="dict in dict.type.purchase_task_status"
2024-10-29 18:03:15 +08:00
/>
</el-select>
</el-form-item>
2024-11-08 17:41:07 +08:00
<el-form-item label="关键字" prop="keyWord">
2024-10-29 18:03:15 +08:00
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>查询</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出数据</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
2024-11-08 17:41:07 +08:00
border
2024-10-29 18:03:15 +08:00
:data="bindList"
2024-11-08 17:41:07 +08:00
v-loading="loading"
2024-10-29 18:03:15 +08:00
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
2024-11-08 17:41:07 +08:00
<el-table-column align="center" label="序号" type="index" />
2024-10-29 18:03:15 +08:00
<el-table-column
align="center"
label="到货时间"
2024-11-11 18:32:47 +08:00
prop="arrivalTime" width="150"
2024-11-08 17:41:07 +08:00
show-overflow-tooltip
2024-10-29 18:03:15 +08:00
/>
<el-table-column
label="采购单号"
align="center"
2024-11-11 18:32:47 +08:00
prop="code" width="150"
2024-11-08 17:41:07 +08:00
show-overflow-tooltip
2024-10-29 18:03:15 +08:00
/>
<el-table-column
label="采购物资"
align="center"
2024-11-08 17:41:07 +08:00
prop="purchaseMaTypeName"
show-overflow-tooltip
2024-10-29 18:03:15 +08:00
/>
<el-table-column
label="采购数量"
align="center"
2024-11-08 17:41:07 +08:00
prop="purchaseMaNumber"
show-overflow-tooltip
2024-10-29 18:03:15 +08:00
/>
<el-table-column
label="创建人"
align="center"
prop="createBy"
2024-11-08 17:41:07 +08:00
show-overflow-tooltip
2024-10-29 18:03:15 +08:00
/>
<el-table-column
label="创建时间"
align="center"
2024-11-11 18:32:47 +08:00
prop="createTime" width="150"
2024-11-08 17:41:07 +08:00
show-overflow-tooltip
2024-10-29 18:03:15 +08:00
/>
2024-11-08 17:41:07 +08:00
<el-table-column label="状态" align="center" show-overflow-tooltip>
<template slot-scope="{ row }">
<dict-tag
:value="row.taskStatus"
:options="dict.type.purchase_task_status"
/>
</template>
2024-10-29 18:03:15 +08:00
</el-table-column>
<el-table-column
label="备注"
align="center"
prop="remark"
2024-11-08 17:41:07 +08:00
show-overflow-tooltip
2024-10-29 18:03:15 +08:00
/>
2024-11-08 17:41:07 +08:00
2024-10-29 18:03:15 +08:00
<el-table-column label="操作" align="center" width="400">
2024-11-08 17:41:07 +08:00
<template slot-scope="{ row }">
2024-10-29 18:03:15 +08:00
<el-button
2024-11-08 17:41:07 +08:00
plain
2024-10-29 18:03:15 +08:00
size="mini"
type="primary"
icon="el-icon-zoom-in"
2024-11-08 17:41:07 +08:00
@click="handleView(row)"
2024-10-29 18:03:15 +08:00
>查看</el-button
>
<el-button
2024-11-08 17:41:07 +08:00
plain
2024-10-29 18:03:15 +08:00
size="mini"
type="warning"
2024-11-08 17:41:07 +08:00
@click="handleBind(row)"
2024-10-29 18:03:15 +08:00
>
2024-11-08 17:41:07 +08:00
<svg-icon icon-class="bind-icon" />
编码绑定
</el-button>
2024-10-29 18:03:15 +08:00
<el-button
2024-11-08 17:41:07 +08:00
plain
2024-10-29 18:03:15 +08:00
size="mini"
type="danger"
icon="el-icon-close"
2024-11-08 17:41:07 +08:00
@click="handleNotice(row)"
2024-10-29 18:03:15 +08:00
>驳回</el-button
2024-11-08 17:41:07 +08:00
>
2024-10-29 18:03:15 +08:00
<el-button
2024-11-08 17:41:07 +08:00
plain
2024-10-29 18:03:15 +08:00
size="mini"
type="success"
2024-11-08 17:41:07 +08:00
@click="onDownloadQr(row)"
2024-10-29 18:03:15 +08:00
>
2024-11-08 17:41:07 +08:00
<svg-icon icon-class="qr-icon" />
下载
</el-button>
2024-10-29 18:03:15 +08:00
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
2024-11-08 17:41:07 +08:00
v-show="total > 0"
2024-10-29 18:03:15 +08:00
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
2024-11-08 17:41:07 +08:00
import { getNewBuyBindListApi } from '@/api/purchase/goodsBind'
2024-10-29 18:03:15 +08:00
export default {
name: 'Home',
2024-11-08 17:41:07 +08:00
dicts: ['purchase_task_status'],
2024-10-29 18:03:15 +08:00
data() {
return {
2024-11-08 17:41:07 +08:00
total: 0, // 总条数
loading: true, // 遮罩层
showSearch: true, // 显示搜索条件
bindList: [], // 列表数据源
queryTime: [], // 日期数据源
selectList: [], // 列表选中数据
// 列表查询参数
2024-10-29 18:03:15 +08:00
queryParams: {
pageNum: 1,
pageSize: 10,
2024-11-08 17:41:07 +08:00
status: '',
endTime: '',
2024-10-29 18:03:15 +08:00
keyWord: '',
2024-11-08 17:41:07 +08:00
startTime: '',
2024-11-16 15:48:33 +08:00
// taskStatus: 3,
2024-10-29 18:03:15 +08:00
},
}
},
created() {
this.getList()
},
methods: {
2024-11-08 17:41:07 +08:00
// 日期change
onTimeChange(val) {
if (val.length > 0) {
const [time_1, time_2] = val
this.queryParams.startTime = time_1
this.queryParams.endTime = time_2
} else {
this.queryParams.startTime = ''
this.queryParams.endTime = ''
}
2024-10-29 18:03:15 +08:00
},
2024-11-08 17:41:07 +08:00
// 获取列表
async getList() {
2024-10-29 18:03:15 +08:00
this.loading = true
2024-11-11 18:32:47 +08:00
this.queryParams.statusList=[3,13]
2024-11-08 17:41:07 +08:00
const res = await getNewBuyBindListApi(this.queryParams)
this.bindList = res.rows
this.total = res.total
this.loading = false
2024-10-29 18:03:15 +08:00
},
2024-11-08 17:41:07 +08:00
// 搜索按钮
2024-10-29 18:03:15 +08:00
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
2024-11-08 17:41:07 +08:00
// 重置按钮
2024-10-29 18:03:15 +08:00
resetQuery() {
2024-11-08 17:41:07 +08:00
this.queryTime = []
2024-10-29 18:03:15 +08:00
this.resetForm('queryForm')
2024-11-08 17:41:07 +08:00
this.queryParams.pageNum = 1
this.queryParams.endTime = ''
this.queryParams.pageSize = 10
this.queryParams.startTime = ''
this.getList()
2024-10-29 18:03:15 +08:00
},
2024-11-08 17:41:07 +08:00
// 查看
2024-10-29 18:03:15 +08:00
handleView(row) {
2024-11-08 17:41:07 +08:00
this.$emit('openBindTools', row.taskId, row.id, 1)
2024-10-29 18:03:15 +08:00
},
2024-11-08 17:41:07 +08:00
// 绑定
2024-10-29 18:03:15 +08:00
handleBind(row) {
2024-11-08 17:41:07 +08:00
this.$emit('openBindTools', row.taskId, row.id, 2)
2024-10-29 18:03:15 +08:00
},
2024-11-08 17:41:07 +08:00
// 驳回
handleNotice(row) {
this.$confirm('是否确定驳回', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
2024-10-29 18:03:15 +08:00
})
2024-11-08 17:41:07 +08:00
.then(() => {})
2024-10-29 18:03:15 +08:00
.catch(() => {})
},
2024-11-08 17:41:07 +08:00
// 下载二维码
onDownloadQr() {
console.log('二维码下载')
2024-10-29 18:03:15 +08:00
},
2024-11-08 17:41:07 +08:00
// 导出数据
2024-10-29 18:03:15 +08:00
handleExport() {
2024-11-08 17:41:07 +08:00
console.log('数据导出')
2024-10-29 18:03:15 +08:00
},
2024-11-08 17:41:07 +08:00
// 列表复选框
handleSelectionChange(list) {
this.selectList = list
2024-10-29 18:03:15 +08:00
},
},
}
</script>