Browse Source

完善采购入库单查询

master
yunuo970428 2 years ago
parent
commit
1daec36719
  1. 37
      anrui-scm/anrui-scm-ui/src/api/purchasereceipt/purchasereceipt.js
  2. 15
      anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js
  3. 377
      anrui-scm/anrui-scm-ui/src/views/purchasereceipt/purchasereceipt.vue
  4. 205
      anrui-scm/anrui-scm-ui/src/views/purchasereceipt/purchasereceiptInfo.vue

37
anrui-scm/anrui-scm-ui/src/api/purchasereceipt/purchasereceipt.js

@ -0,0 +1,37 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/scm/v1/scmapplyinboundquery/listPage',
method: 'post',
data: params,
headers: { 'Content-Type': 'application/json' }
})
},
// 通过sid作废一条或多条记录
createPdf: function(data) {
return request({
url: '/scm/v1/scmapplyinboundquery/createPdf',
method: 'post',
params: data
})
},
// 通过sid作废一条或多条记录
fetchDetailsBySid: function(data) {
return request({
url: '/scm/v1/scmapplyinboundquery/fetchDetailsBySid/' + data,
method: 'get'
})
},
// 通过sid作废一条或多条记录
ctcgykd: function(data) {
return request({
url: '/scm/v1/scmapplyinboundquery/ctcgykd',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
}
}

15
anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js

@ -740,6 +740,21 @@ const codemenu = [
meta: { title: '采购渠道', noCache: true }
}]
},
// 采购入库单
{
path: '/purchasereceipt',
component: Layout,
redirect: '/purchasereceipt',
meta: {
title: '采购入库单'
},
children: [{
path: '/purchasereceipt',
component: () => import('@/views/purchasereceipt/purchasereceipt.vue'),
name: 'PurchaseReceipt',
meta: { title: '采购入库单', noCache: true }
}]
},
// 流程审批
// 入库管理编辑

377
anrui-scm/anrui-scm-ui/src/views/purchasereceipt/purchasereceipt.vue

@ -0,0 +1,377 @@
<template>
<div class="app-container">
<!-- Start 列表页面 -->
<div v-show="viewState == 1">
<button-bar view-title="采购入库单" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
<el-form-item label="单据编号">
<el-input v-model="listQuery.params.applicationCode" clearable placeholder=""/>
</el-form-item>
<el-form-item label="采购类型">
<el-select v-model="listQuery.params.manPurOrderTypeKey" placeholder="请选择" clearable class="addinputw">
<el-option v-for="item in purchase_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
<el-form-item label="入库日期">
<el-date-picker v-model="listQuery.params.orgPriceStartDate" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
<span style="padding: 0 8px"></span>
<el-date-picker v-model="listQuery.params.orgPriceEndDate" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
</el-form-item>
<el-form-item label="采购部门">
<el-select v-model="listQuery.params.orgDeptSid" placeholder="请选择" clearable class="addinputw">
<el-option v-for="item in department_list" :key="item.sid" :label="item.name" :value="item.sid"/>
</el-select>
</el-form-item>
<el-form-item label="制单人">
<el-input v-model="listQuery.params.makeListName" clearable placeholder=""/>
</el-form-item>
<el-form-item label="供应商">
<el-select v-model="listQuery.params.manSid" placeholder="请选择" clearable class="addinputw">
<el-option v-for="item in supplier_list" :key="item.sid" :label="item.manufacturerName" :value="item.sid"/>
</el-select>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" @click="handleFilter" icon="el-icon-search" size="small">查询</el-button>
<el-button type="primary" @click="handleReset" icon="el-icon-refresh" size="small">重置</el-button>
</div>
</div>
</div>
<div class="listtop">
<div class="tit">采购入库单列表</div>
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column fixed label="序号" width="60" type="index" :index="indexMethod" align="center"/>
<el-table-column fixed label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handlePrint(scope.row)">下载打印</el-button>
</template>
</el-table-column>
<el-table-column label="单据编号" width="100px" align="center">
<template slot-scope="scope">
<span class="bluezi" @click="handleLook(scope.row)">{{ scope.row.applicationCode }}</span>
</template>
</el-table-column>
<el-table-column label="入库日期" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.orgPriceDate }}</span>
</template>
</el-table-column>
<el-table-column label="采购类型" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.manPurOrderTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="采购部门" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.orgDeptName }}</span>
</template>
</el-table-column>
<el-table-column label="供应商" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.manName }}</span>
</template>
</el-table-column>
<el-table-column label="采购系统" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.purchaseSystemName }}</span>
</template>
</el-table-column>
<el-table-column label="制单人" align="center">
<template slot-scope="scope">
<span>{{ scope.row.makeListName }}</span>
</template>
</el-table-column>
<el-table-column label="下载次数" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.downNum }}</span>
</template>
</el-table-column>
<el-table-column label="最新下载时间" align="center" width="180">
<template slot-scope="scope">
<span>{{ scope.row.newDownDate }}</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
<!-- End 列表页面 -->
<el-dialog center :visible.sync="dialogVisible" width="40%">
<el-form class="formadd">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="4" class="tleftb">
<span>打印机类型</span>
</el-col>
<el-col :span="20">
<el-form-item>
<el-radio-group v-model="print">
<el-radio label="针孔式打印机">针孔式打印机</el-radio>
<el-radio label="喷墨式打印机">喷墨式打印机</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="handleConfirm">确定</el-button>
<el-button size="small" @click="dialogVisible = false">取消</el-button>
</span>
</el-dialog>
<purchasereceiptInfo v-show="viewState == 2" ref="divInfo" @doback="resetState"/>
</div>
</template>
<script>
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import { typeValues, getOrgSidByPath, getListDeptByOrgSid, getGysByOrgSid } from '@/api/cheliang/dictcommons'
import req from '@/api/purchasereceipt/purchasereceipt'
import { getStorage } from '@/utils/auth'
import purchasereceiptInfo from './purchasereceiptInfo'
export default {
name: 'PurchaseReceipt',
components: {
Pagination,
pageye,
ButtonBar,
purchasereceiptInfo
},
data() {
return {
btndisabled: false,
viewState: 1,
dialogVisible: false,
printSid: '',
print: '',
btnList: [
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'toRepush',
btnLabel: '重推'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
// -----------
tableKey: 0,
list: [],
sids: [],
purchase_list: [],
department_list: [],
supplier_list: [],
FormLoading: false,
listLoading: false,
listQuery: {
params: {
applicationCode: '',
createOrgSid: '',
makeListName: '',
manPurOrderTypeKey: '',
manSid: '',
orgDeptSid: '',
orgPriceEndDate: '',
orgPriceStartDate: ''
},
current: 1,
size: 10,
total: 0
}
}
},
created() {
//
this.init()
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toRepush':
this.toRepush()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
init() {
typeValues({ type: 'purchaseOrderType' }).then((res) => {
if (res.success) {
this.purchase_list = res.data
}
})
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((resp) => {
if (resp.success) {
this.listQuery.params.createOrgSid = resp.data
getListDeptByOrgSid(resp.data).then((res) => {
this.department_list = res.data
})
getGysByOrgSid({ orgSid: resp.data }).then((respsone) => {
if (respsone.success) {
this.supplier_list = respsone.data
}
})
this.getList()
}
})
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push(element.sid)
})
this.sids = aa
console.log('sids', this.sids)
},
//
getList() {
this.listLoading = true
req.listPage(this.listQuery).then((response) => {
this.listLoading = false
if (response.success) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
this.list = []
this.listQuery.total = 0
}
})
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
this.listQuery = {
params: {
applicationCode: '',
createOrgSid: '',
makeListName: '',
manPurOrderTypeKey: '',
manSid: '',
orgDeptSid: '',
orgPriceEndDate: '',
orgPriceStartDate: ''
},
current: 1,
size: 10,
total: 0
}
this.init()
},
handlePrint(row) {
this.printSid = row.sid
this.print = ''
this.dialogVisible = true
},
handleConfirm() {
req.createPdf({ cgrkdSid: this.printSid, printerType: this.print }).then((resp) => {
if (resp.success && resp.data.pdfPath !== '') {
var xhr = new XMLHttpRequest()
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + resp.data.pdfPath + '&outFileName=' + '采购入库单', true)
xhr.setRequestHeader('token', getStorage())
xhr.responseType = 'blob'
xhr.onload = function(e) {
//
var blob = this.response
var filename = '采购入库单.pdf'
var a = document.createElement('a')
// blob.type="application/octet-stream";
// url
var url = URL.createObjectURL(blob)
a.href = url
a.download = filename
a.click()
// URL
window.URL.revokeObjectURL(url)
}
//
xhr.send()
this.dialogVisible = false
this.printSid = ''
}
})
},
toRepush() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行重推操作' })
return
} else if (this.sids.length > 1) {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行重推操作' })
return
} else {
req.ctcgykd(this.sids[0]).then((resp) => {
if (resp.success) {
this.$message({ showClose: true, type: 'success', message: '推送成功' })
this.getList()
}
})
}
},
handleLook(row) {
this.viewState = 2
this.$refs['divInfo'].showInfo(row)
},
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
}
}
</script>
<style scoped>
/*表格列设置fixed后固定列出现下边框的设置*/
/deep/ .el-table__fixed {
height: 100% !important;
}
/*表格列设置fixed后固定列出现下边框的设置*/
/deep/ .el-table__fixed-right {
height: 100% !important;
}
</style>

205
anrui-scm/anrui-scm-ui/src/views/purchasereceipt/purchasereceiptInfo.vue

@ -0,0 +1,205 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!--end 添加修改按钮-->
<!--end 详情按钮-->
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<div class="titwu"><span>采购订单</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="8">
<div class="span-sty spanOneWidth"><span>入库日期</span></div>
<el-form-item><span class="addinputInfo addinputOne">{{ formobj.orgPriceDate }}</span></el-form-item>
</el-col>
<el-col :span="8">
<div class="span-sty spanOneWidth"><span>采购类型</span></div>
<el-form-item>
<span class="addinputInfo addinputOne">{{ formobj.manPurOrderTypeValue }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<div class="span-sty spanOneWidth"><span>单据编号</span></div>
<el-form-item>
<span class="addinputInfo addinputOne">{{ formobj.applicationCode }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="span-sty spanOneWidth"><span>采购部门</span></div>
<el-form-item><span class="addinputInfo addinputOne">{{ formobj.orgDeptName }}</span></el-form-item>
</el-col>
<el-col :span="16">
<div class="span-sty spanOneWidth"><span>供货单位</span></div>
<el-form-item><span class="addinputInfo addinputOne">{{ formobj.manName }}</span></el-form-item>
</el-col>
</el-row>
<el-table :key="tableKey" :data="formobj.scmApplyInboundVehQueryList" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="物料编号" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.vinNo }}</span>
</template>
</el-table-column>
<el-table-column label="物料分组" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.mgroupName }}</span>
</template>
</el-table-column>
<el-table-column label="车辆类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vehicleTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="计量单位" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.iunit }}</span>
</template>
</el-table-column>
<el-table-column prop="num" label="数量" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.num }}</span>
</template>
</el-table-column>
<el-table-column prop="settleMoney" label="结算金额" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.settleMoney }}</span>
</template>
</el-table-column>
<el-table-column label="仓库" align="center">
<template slot-scope="scope">
<span>{{ scope.row.localName }}</span>
</template>
</el-table-column>
</el-table>
<el-row>
<el-col :span="24">
<div class="span-sty spanOneWidth"><span>金额合计</span></div>
<el-form-item><span class="addinputInfo addinputOne">{{ formobj.totalMoney }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="span-sty spanOneWidth"><span>制单人</span></div>
<el-form-item><span class="addinputInfo addinputOne">{{ formobj.makeListName }}</span></el-form-item>
</el-col>
<el-col :span="8">
</el-col>
<el-col :span="8">
<div class="span-sty spanOneWidth"><span>审核人</span></div>
<el-form-item>
<span class="addinputInfo addinputOne">{{ formobj.confirmName }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!--End 添加修改部分-->
</div>
</div>
</template>
<script>
import req from '@/api/purchasereceipt/purchasereceipt'
export default {
name: 'PurchaseReceiptInfo',
data() {
return {
viewState: 1,
viewTitle: '采购订单详情',
tableKey: 0,
index: 0,
formobj: {},
rules: {},
submitdisabled: false
}
},
methods: {
handleReturn() {
this.$refs['form_obj'].resetFields()
this.$emit('doback')
},
showInfo(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
req.fetchDetailsBySid(row.sid).then(resp => {
const vdata = resp.data
this.formobj = vdata
}).catch(e => {
this.formobj = row
})
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计:'
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property === 'settleMoney') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
} else if (column.property === 'num') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
} else {
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
this.amount = sums[index] += ''
} else {
sums[index] = ''
}
}
})
return sums
}
}
}
</script>
<style scoped>
.spanOneWidth {
width: 120px !important;
}
.addinputOne {
margin-left: 120px !important;
}
</style>
Loading…
Cancel
Save