新购入库单

This commit is contained in:
bb_pan 2025-03-19 18:32:52 +08:00
parent b0212fcc5e
commit eb2ae45acb
1 changed files with 333 additions and 440 deletions

View File

@ -1,68 +1,38 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
:model="queryParams" <el-form-item prop="dateRange">
ref="queryForm" <el-date-picker
size="small" v-model="dateRange"
:inline="true" type="datetimerange"
v-show="showSearch" value-format="yyyy-MM-dd HH:mm:ss"
label-width="68px" range-separator="至"
> start-placeholder="开始日期"
<el-form-item prop="dateRange"> end-placeholder="结束日期"
<el-date-picker ></el-date-picker>
v-model="dateRange" </el-form-item>
type="datetimerange" <el-form-item prop="keyWord">
value-format="yyyy-MM-dd HH:mm:ss" <el-input
range-separator="至" v-model="queryParams.keyWord"
start-placeholder="开始日期" placeholder="请输入关键词"
end-placeholder="结束日期" clearable
> @keyup.enter.native="handleQuery"
</el-date-picker> maxlength="20"
</el-form-item> />
<el-form-item prop="keyWord"> </el-form-item>
<el-input <el-form-item prop="isFinish">
v-model="queryParams.keyWord" <el-select clearable filterable style="width: 240px" placeholder="状态筛选" v-model="queryParams.isFinish">
placeholder="请输入关键词" <el-option :key="dict.id" :label="dict.name" :value="dict.id" v-for="dict in taskStatusList" />
clearable </el-select>
@keyup.enter.native="handleQuery" </el-form-item>
maxlength="20"
/>
</el-form-item>
<el-form-item prop="isFinish">
<el-select
clearable
filterable
style="width: 240px"
placeholder="状态筛选"
v-model="queryParams.isFinish"
>
<el-option
:key="dict.id"
:label="dict.name"
:value="dict.id"
v-for="dict in taskStatusList"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
type="primary" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
icon="el-icon-search" </el-form-item>
size="mini" </el-form>
@click="handleQuery" <el-row :gutter="10" class="mb8">
>查询</el-button <!-- <el-col :span="1.5">
>
<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 <el-button
type="success" type="success"
plain plain
@ -74,184 +44,122 @@
</el-button> </el-button>
</el-col> --> </el-col> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
type="warning" </el-col>
plain </el-row>
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-col>
</el-row>
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="tableList" :data="tableList"
ref="multipleTable" ref="multipleTable"
row-key="teamId" row-key="teamId"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
border border
> >
<!-- <el-table-column <!-- <el-table-column
type="selection" type="selection"
width="55" width="55"
align="center" align="center"
:reserve-selection="true" :reserve-selection="true"
/> --> /> -->
<el-table-column <el-table-column label="序号" align="center" width="80" type="index">
label="序号" <template slot-scope="scope">
align="center" <span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
width="80" </template>
type="index" </el-table-column>
> <el-table-column label="到货时间" align="center" prop="arrivalTime" width="180" :show-overflow-tooltip="true" />
<template slot-scope="scope"> <el-table-column label="采购单号" align="center" prop="code" width="150" :show-overflow-tooltip="true" />
<span>{{ <el-table-column
(queryParams.pageNum - 1) * queryParams.pageSize + label="采购物资"
scope.$index + align="center"
1 width="150"
}}</span> prop="purchaseMaTypeName"
</template> :show-overflow-tooltip="true"
</el-table-column> />
<el-table-column <el-table-column
label="到货时间" label="采购数量"
align="center" align="center"
prop="arrivalTime" width="180" width="100"
:show-overflow-tooltip="true" prop="purchaseMaNumber"
/> :show-overflow-tooltip="true"
<el-table-column />
label="采购单号" <el-table-column
align="center" label="采购价格(元含税)"
prop="code" width="150" align="center"
:show-overflow-tooltip="true" prop="purchaseTaxPrice"
/> width="100"
<el-table-column :show-overflow-tooltip="true"
label="采购物资" />
align="center" width="150" <el-table-column
prop="purchaseMaTypeName" label="采购价格(元不含税)"
:show-overflow-tooltip="true" align="center"
/> prop="purchasePrice"
<el-table-column width="100"
label="采购数量" :show-overflow-tooltip="true"
align="center" width="100" />
prop="purchaseMaNumber" <el-table-column label="税率" align="center" prop="taxRate" :show-overflow-tooltip="true">
:show-overflow-tooltip="true" <template slot-scope="scope">
/> <span>{{ scope.row.taxRate }}%</span>
<el-table-column </template>
label="采购价格(元含税)" </el-table-column>
align="center" <el-table-column label="物资厂家" align="center" prop="supplier" width="100" :show-overflow-tooltip="true" />
prop="purchaseTaxPrice" <el-table-column label="操作人" align="center" prop="createBy" width="100" :show-overflow-tooltip="true" />
width="100" <el-table-column label="操作时间" align="center" prop="createTime" width="180" :show-overflow-tooltip="true" />
:show-overflow-tooltip="true" <el-table-column label="状态" align="center" prop="taskStatusName" :show-overflow-tooltip="true">
/> <!-- <template slot-scope="scope">-->
<el-table-column <!-- <dict-tag :options="dict.type.purchase_task_status" :value="scope.row.taskStatus"/>-->
label="采购价格(元不含税)" <!-- </template>-->
align="center" </el-table-column>
prop="purchasePrice" <el-table-column label="备注" align="center" prop="remark" />
width="100" <el-table-column label="操作" align="center" width="250" fixed="right">
:show-overflow-tooltip="true" <template slot-scope="scope">
/> <el-button size="mini" @click="handleView(scope.row)">查看</el-button>
<el-table-column label="税率" align="center" prop="taxRate" :show-overflow-tooltip="true"> <el-button
<template slot-scope="scope"> size="mini"
<span>{{ scope.row.taxRate }}%</span> type="primary"
</template> v-if="scope.row.taskStatusName == '未完成'"
</el-table-column> @click="handleUpdate(scope.row)"
<el-table-column >
label="物资厂家" 入库
align="center" </el-button>
prop="supplier" width="100" <el-button size="mini" type="warning" @click="handlePrint(scope.row)">入库单</el-button>
:show-overflow-tooltip="true" </template>
/> </el-table-column>
<el-table-column </el-table>
label="操作人"
align="center"
prop="createBy" width="100"
:show-overflow-tooltip="true"
/>
<el-table-column
label="操作时间"
align="center"
prop="createTime" width="180"
:show-overflow-tooltip="true"
/>
<el-table-column
label="状态"
align="center"
prop="taskStatusName"
:show-overflow-tooltip="true"
>
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.purchase_task_status" :value="scope.row.taskStatus"/>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" width="250" fixed="right">
<template slot-scope="scope">
<el-button size="mini" @click="handleView(scope.row)">
查看
</el-button>
<el-button
size="mini"
type="primary" v-if="scope.row.taskStatusName=='未完成'"
@click="handleUpdate(scope.row)"
>
入库
</el-button>
<!-- <el-button
size="mini"
type="warning"
@click="handlePrint(scope.row)"
>
入库单
</el-button> -->
</template>
</el-table-column>
</el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<!-- 验收单弹窗 --> <!-- 验收单弹窗 -->
<el-dialog <el-dialog :title="title" :visible.sync="openPrint" width="800px" append-to-body>
:title="title" <div style="height: 500px; overflow-y: scroll">
:visible.sync="openPrint" <vue-easy-print tableShow ref="remarksPrintRef" class="print" style="margin: 0 20px">
width="1100px" <div style="text-align: center; font-weight: 600; font-size: 30px">机具设备新购入库单</div>
append-to-body <div style="margin-top: 10px; display: flex; flex-wrap: wrap; justify-content: space-between; width: 95%">
> <div style="flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
<div style="height: 500px; overflow-y: scroll"> <span>单据编号{{ printData.code }}</span>
<vue-easy-print tableShow ref="remarksPrintRef" class="print"> </div>
<div class="title" style="text-align: center;font-weight: 600;font-size: 16px;"> <!-- <div class="item" style=" flex-shrink: 0; margin-bottom: 5px; font-size: 14px;">
机具设备到货验收单
</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> <span>生产厂家供应商{{printData.supplierName}}</span>
</div> </div> -->
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;"> <div class="item" style="flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
<span>到货日期{{ printData.arrivalDate }}</span> <span>入库日期{{ printData.arrivalDate }}</span>
</div> </div>
</div> </div>
<el-table :data="printTableData" class="table" border <el-table :data="printTableData" class="table" border style="margin-top: 20px; padding: 1px">
style="margin-top: 20px;width: 1000px;padding-bottom: 1px;"> <!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column type="selection" width="55" align="center" />--> <el-table-column label="序号" align="center" type="index" row="2" />
<el-table-column 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="maTypeName" <el-table-column label="单位" align="center" prop="unitName" />
/> <el-table-column label="入库数量" align="center" prop="inputNum" />
<el-table-column label="规格型号" align="center" prop="typeName" <!-- <el-table-column label="配送信息" align="center">
/>
<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="purchaseNum"
/> />
<el-table-column <el-table-column
@ -270,238 +178,223 @@
align="center" align="center"
/> />
</el-table-column> </el-table-column>
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column label="备注" align="center" prop="remark" />
label="备注"
align="center"
prop="remark"
/>
<!-- <el-table-column--> <!-- <el-table-column-->
<!-- label="合格证及技术资料"--> <!-- label="合格证及技术资料"-->
<!-- align="center"--> <!-- align="center"-->
<!-- prop=""--> <!-- prop=""-->
<!-- />--> <!-- />-->
<!-- <el-table-column label="包装" align="center" prop="" />--> <!-- <el-table-column label="包装" align="center" prop="" />-->
</el-table> </el-table>
<div <div class="fillIn" style="margin-top: 20px; display: flex; justify-content: space-between">
class="fillIn" <div class="item" style="width: 33%">
style=" <div>
margin-top: 20px; <span>供应科{{ printData.supplyDept }}</span>
display: flex; </div>
justify-content: space-between;
"
>
<div class="item" style="width: 33%">
<div>
<span>供应科{{ printData.supplyDept }}</span>
</div>
</div>
<div class="item" style="width: 33%">
<div>
<span
>生产技术科{{
printData.productionTechDept
}}</span
>
</div>
</div>
<div class="item" style="width: 33%">
<div>
<span
>库管班{{ printData.warehouseTeam }}</span
>
</div>
</div>
</div>
</vue-easy-print>
</div> </div>
<div slot="footer" class="dialog-footer" style="text-align: center"> <div class="item" style="width: 33%">
<el-button type="primary" @click="print"> </el-button> <div>
<el-button @click="openPrint = false"> </el-button> <span>生产技术科{{ printData.productionTechDept }}</span>
</div>
</div> </div>
</el-dialog>
</div> <div class="item" style="width: 33%">
<div>
<span>库管班{{ printData.warehouseTeam }}</span>
</div>
</div>
</div>
</vue-easy-print>
</div>
<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> </template>
<script> <script>
import { import { getPurchaseList, acceptancePurchase, getPurchaseCheckFormByTaskId } from '@/api/purchase/goodsAccept'
getPurchaseList,
acceptancePurchase,
getPurchaseCheckFormByTaskId,
} from '@/api/purchase/goodsAccept'
import { downloadFile } from '@/utils/download' import { downloadFile } from '@/utils/download'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import vueEasyPrint from 'vue-easy-print'
export default { export default {
name: 'GoodsAcceptList', name: 'GoodsAcceptList',
dicts: ['purchase_task_status'], dicts: ['purchase_task_status'],
data() { components: { vueEasyPrint },
return { data() {
// return {
loading: false, //
// loading: false,
single: true, //
// single: true,
multiple: true, //
// multiple: true,
showSearch: true, //
showHouse: false, showSearch: true,
dateRange: [], showHouse: false,
taskStatusList:[{id:'0',name:'未完成'},{id:'1',name:'已完成'}], dateRange: [],
ids: [], taskStatusList: [
// { id: '0', name: '未完成' },
total: 0, { id: '1', name: '已完成' }
// ],
tableList: [], ids: [],
// //
title: '', total: 0,
// //
open: false, tableList: [],
// //
queryParams: { title: '',
pageNum: 1, //
pageSize: 10, open: false,
keyWord: undefined, //
// taskStatus: 4, queryParams: {
}, pageNum: 1,
openPrint: false, pageSize: 10,
printData: {}, keyWord: undefined
printTableData: [], // taskStatus: 4,
} },
openPrint: false,
printData: {},
printTableData: []
}
},
created() {
if (this.$route.query.code) {
this.queryParams.keyWord = this.$route.query.code
}
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.statusList=[3,13,4,14,19]
this.queryParams.taskStage = 4
// this.queryParams.modelName=""
getPurchaseList(this.queryParams).then(response => {
this.tableList = response.data.rows
this.total = response.data.total
this.loading = false
})
}, },
created() { /** 重置按钮操作 */
if(this.$route.query.code){ resetQuery() {
this.queryParams.keyWord=this.$route.query.code this.resetForm('queryForm')
} this.dateRange = []
this.getList() 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() {
console.log('打印')
this.$refs.remarksPrintRef.print()
}, },
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.statusList=[3,13,4,14,19]
this.queryParams.taskStage = 4
// this.queryParams.modelName=""
getPurchaseList(this.queryParams).then((response) => {
this.tableList = response.data.rows
this.total = response.data.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()
},
handleExport() { handleExport() {
this.download( this.download(
"/material/purchase_check_info/export", '/material/purchase_check_info/export',
{ ...this.queryParams,statusList:[3,13,4,14,19],taskStage: 4 }, { ...this.queryParams, statusList: [3, 13, 4, 14, 19], taskStage: 4 },
`新购到货入库_${new Date().getTime()}.xlsx` `新购到货入库_${new Date().getTime()}.xlsx`
); )
}, }
}, }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.uploadImg { .uploadImg {
padding-top: 20px; padding-top: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.deviceCode { .deviceCode {
margin-top: 10px; margin-top: 10px;
padding-bottom: 20px; padding-bottom: 20px;
font-size: 18px; font-size: 18px;
} }
::v-deep.el-table .fixed-width .el-button--mini { ::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important; width: 60px !important;
margin-bottom: 10px; margin-bottom: 10px;
} }
//css //css
::v-deep.disabled { ::v-deep.disabled {
.el-upload--picture-card { .el-upload--picture-card {
display: none; display: none;
} }
} }
</style> </style>