bonus-ui/src/views/material/purchase/goodsEntry/index.vue

577 lines
20 KiB
Vue
Raw Normal View History

2024-11-05 13:57:31 +08:00
<template>
2024-11-08 17:41:07 +08:00
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item prop="dateRange">
<el-date-picker
v-model="dateRange"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键词"
clearable
@keyup.enter.native="handleQuery"
maxlength="20"
/>
</el-form-item>
<el-form-item prop="taskStatus">
<el-select
v-model="queryParams.taskStatus"
placeholder="请选择任务状态"
clearable
>
<el-option
v-for="item in taskStatusList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
2024-11-05 13:57:31 +08:00
2024-11-08 17:41:07 +08:00
<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="success"
plain
size="mini"
:disabled="multiple"
@click="acceptancePurchase"
>
入库
</el-button>
</el-col>
2024-11-05 13:57:31 +08:00
2024-11-08 17:41:07 +08:00
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-col>
</el-row>
2024-11-05 13:57:31 +08:00
2024-11-08 17:41:07 +08:00
<el-table
v-loading="loading"
:data="tableList"
ref="multipleTable"
row-key="teamId"
@selection-change="handleSelectionChange"
border
>
<el-table-column
type="selection"
width="55"
align="center"
:reserve-selection="true"
/>
<el-table-column
label="序号"
align="center"
width="80"
type="index"
>
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * queryParams.pageSize +
scope.$index +
1
}}</span>
</template>
</el-table-column>
<el-table-column
label="到货时间"
align="center"
prop="arrivalTime"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购单号"
align="center"
prop="code"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购物资"
align="center"
prop="purchaseMaTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购数量"
align="center"
prop="purchaseMaNumber"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购价格(元含税)"
align="center"
prop="purchaseTaxPrice"
width="80"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购价格(元不含税)"
align="center"
prop="purchasePrice"
width="80"
:show-overflow-tooltip="true"
/>
<el-table-column
label="税率"
align="center"
prop="taxRate"
:show-overflow-tooltip="true"
/>
<el-table-column
label="物资厂家"
align="center"
prop="supplier"
:show-overflow-tooltip="true"
/>
<el-table-column
label="操作人"
align="center"
prop="createBy"
:show-overflow-tooltip="true"
/>
<el-table-column
label="操作时间"
align="center"
prop="createTime"
:show-overflow-tooltip="true"
/>
<el-table-column
label="状态"
align="center"
prop="taskStatus"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<span v-if="scope.row.taskStatus == 0">待提交</span>
<span v-if="scope.row.taskStatus == 1">待通知</span>
<span v-if="scope.row.taskStatus == 2">待验收</span>
<span v-if="scope.row.taskStatus == 3">待绑定</span>
<span v-if="scope.row.taskStatus == 4">待入库</span>
<span v-if="scope.row.taskStatus == 5">已完成</span>
<span v-if="scope.row.taskStatus == 6">驳回待验收</span>
<span v-if="scope.row.taskStatus == 7">驳回待绑定</span>
<span v-if="scope.row.taskStatus == 8">驳回待入库</span>
<span v-if="scope.row.taskStatus == 9">入库进行中</span>
<span v-if="scope.row.taskStatus == 10">未完成</span>
<!-- <span v-else>/</span> -->
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-button size="mini" @click="handleView(scope.row)">
查看
</el-button>
<el-button
size="mini"
type="primary"
@click="handleUpdate(scope.row)"
>
入库
</el-button>
<el-button
size="mini"
type="warning"
@click="handlePrint(scope.row)"
>
入库单
</el-button>
</template>
</el-table-column>
</el-table>
2024-11-05 13:57:31 +08:00
2024-11-08 17:41:07 +08:00
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
2024-11-08 09:30:26 +08:00
2024-11-08 17:41:07 +08:00
<!-- 验收单弹窗 -->
<el-dialog
:title="title"
:visible.sync="openPrint"
width="1100px"
append-to-body
>
<div style="height: 500px; overflow-y: scroll">
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
<div
class="title"
style="
text-align: center;
font-weight: 600;
font-size: 16px;
"
>
机具设备到货验收单
</div>
<div
class="info"
style="margin-top: 10px; display: flex; flex-wrap: wrap"
>
<div
class="item"
style="
width: 100%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>单据编号{{ printData.code }}</span>
</div>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span
>生产厂家供应商{{
printData.supplierName
}}</span
>
</div>
2024-11-08 09:30:26 +08:00
2024-11-08 17:41:07 +08:00
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>到货日期{{ printData.arrivalDate }}</span>
</div>
</div>
<el-table
:data="printTableData"
class="table"
style="
margin-top: 20px;
width: 1000px;
padding-bottom: 1px;
"
border
>
<!-- <el-table-column type="selection" width="55" align="center" />-->
2024-11-08 09:30:26 +08:00
<el-table-column
2024-11-08 17:41:07 +08:00
label="序号"
align="center"
type="index"
row="2"
/>
<el-table-column
label="物资名称"
align="center"
prop="maTypeName"
/>
<el-table-column
label="规格型号"
align="center"
prop="typeName"
/>
<el-table-column
label="单位"
align="center"
prop="unitName"
/>
<el-table-column label="配送信息" align="center">
<el-table-column
label="采购数量"
align="center"
prop="purchaseNum"
/>
<el-table-column
label="验收结论"
align="center"
prop="checkResult"
/>
<el-table-column label="质保质量" align="center">
<el-table-column
label="实收份数"
align="center"
prop="checkNum"
/>
<el-table-column
label="符合要求"
align="center"
/>
</el-table-column>
</el-table-column>
<el-table-column
label="备注"
align="center"
prop="remark"
/>
2024-11-08 09:30:26 +08:00
2024-11-08 17:41:07 +08:00
<!-- <el-table-column-->
<!-- label="合格证及技术资料"-->
<!-- align="center"-->
<!-- prop=""-->
<!-- />-->
<!-- <el-table-column label="包装" align="center" prop="" />-->
</el-table>
2024-11-08 09:30:26 +08:00
2024-11-08 17:41:07 +08:00
<div
class="fillIn"
style="
margin-top: 20px;
display: flex;
justify-content: space-between;
"
>
<div class="item" style="width: 33%">
<div>
<span>供应科{{ printData.supplyDept }}</span>
</div>
</div>
2024-11-08 09:30:26 +08:00
2024-11-08 17:41:07 +08:00
<div class="item" style="width: 33%">
<div>
<span
>生产技术科{{
printData.productionTechDept
}}</span
>
</div>
</div>
2024-11-08 09:30:26 +08:00
2024-11-08 17:41:07 +08:00
<div class="item" style="width: 33%">
<div>
<span
>库管班{{ printData.warehouseTeam }}</span
>
</div>
</div>
</div>
</vue-easy-print>
</div>
2024-11-08 09:30:26 +08:00
2024-11-08 17:41:07 +08:00
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="print"> </el-button>
<el-button @click="openPrint = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
2024-11-05 13:57:31 +08:00
2024-11-08 17:41:07 +08:00
<script>
import {
getPurchaseList,
acceptancePurchase,
getPurchaseCheckFormByTaskId,
} from '@/api/purchase/goodsAccept'
2024-11-05 13:57:31 +08:00
import { downloadFile } from '@/utils/download'
import { getToken } from '@/utils/auth'
export default {
2024-11-08 17:41:07 +08:00
name: 'GoodsAcceptList',
data() {
return {
// 遮罩层
loading: false,
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
showHouse: false,
dateRange: [],
taskStatusList: [
{ id: '1', name: '待验收' },
{ id: '2', name: '验收合格' },
{ id: '3', name: '验收未通过' },
],
ids: [],
// 总条数
total: 0,
//表格数据
tableList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: undefined,
taskStatus: 4,
},
openPrint: false,
printData: {},
printTableData: [],
}
},
created() {
this.getList()
},
methods: {
/** 查询列表 */
getList() {
this.loading = true
if (this.dateRange.length > 0) {
this.queryParams.startTime = this.dateRange[0]
this.queryParams.endTime = this.dateRange[1]
} else {
this.queryParams.startTime = undefined
this.queryParams.endTime = undefined
}
// this.queryParams.modelName="新购验收"
getPurchaseList(this.queryParams).then((response) => {
this.tableList = response.rows
this.total = response.total
this.loading = false
})
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.dateRange = []
this.queryParams.keyWord = null
this.handleQuery()
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id)
this.single = selection.length != 1
this.multiple = !selection.length
},
handleUpdate(row) {
console.log(row)
let query = { Id: row.id, taskId: row.taskId, isView: 'false' }
this.$tab.closeOpenPage({
path: '/purchase/goodsEntryDetail',
query,
})
},
//查看
handleView(row) {
console.log(row)
let query = { Id: row.id, taskId: row.taskId, isView: 'true' }
this.$tab.closeOpenPage({
path: '/purchase/goodsEntryDetail',
query,
})
},
//批量合格
acceptancePurchase() {
acceptancePurchase(this.ids)
.then((response) => {
this.$modal.msgSuccess('操作成功')
this.getList()
})
.catch(() => {
this.$modal.msgError('操作失败')
})
},
//查看验收单
handlePrint(row) {
// this.query.taskId = row.taskId
this.getPrintTable(row.taskId)
this.openPrint = true
this.title = '新购工机具验收单'
},
//获取验收单数据
getPrintTable(taskId) {
getPurchaseCheckFormByTaskId(taskId).then((response) => {
this.printData = response.data
this.printTableData = response.data.materialList
// let supplierList = []
// this.printTableData.forEach((e) => {
// if (e.supplier) {
// supplierList.push(e.supplier)
// }
// })
// supplierList = [...new Set(supplierList)]
// this.supplierStr = supplierList.join(',')
})
},
//打印
print() {
this.$refs.remarksPrintRef.print()
},
2024-11-08 09:30:26 +08:00
2024-11-08 17:41:07 +08:00
handleExport() {
// this.download('/material/ma_machine/export', {
// ...this.queryParams
// }, `仓库管理_${new Date().getTime()}.xlsx`)
},
},
}
2024-11-05 13:57:31 +08:00
</script>
<style lang="scss" scoped>
.uploadImg {
2024-11-08 17:41:07 +08:00
padding-top: 20px;
display: flex;
align-items: center;
justify-content: center;
2024-11-05 13:57:31 +08:00
}
.deviceCode {
margin-top: 10px;
padding-bottom: 20px;
font-size: 18px;
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
//隐藏图片上传框的css
::v-deep.disabled {
.el-upload--picture-card {
display: none;
}
}
2024-11-08 17:41:07 +08:00
</style>