You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

565 lines
18 KiB

<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="收货单管理" :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 :inline="true" class="tab-header">
<el-form-item label="单据编号">
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
</el-form-item>
<el-form-item label="单据日期">
<el-date-picker v-model="queryParams.params.createTimeStart" type="date" placeholder="选择日期"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>至
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
</el-form-item>
<el-form-item label="预期到货通知单号">
<el-input v-model="queryParams.params.sourceBillNo" placeholder="" clearable />
</el-form-item>
<el-form-item label="业务类型">
<el-select v-model="queryParams.params.busTypeKey" placeholder="请选择" style="width: 200px;">
<el-option v-for="(item,i) in busTypeList" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="供应商">
<el-input v-model="queryParams.params.supplierName" placeholder="" clearable />
</el-form-item>
<el-form-item label="到货日期">
<el-date-picker v-model="queryParams.params.deliveryDateStart" type="date" placeholder="选择日期"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
<el-date-picker v-model="queryParams.params.deliveryDateEnd" type="date" placeholder="选择日期"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
</el-form-item>
<el-form-item label="单据状态">
<el-select v-model="queryParams.params.billState" placeholder="请选择" style="width: 200px;">
<el-option v-for="(item,i) in billStateList" :key="i" :label="item.name" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="分配状态">
<el-select v-model="queryParams.params.distributeType" placeholder="请选择" style="width: 200px;">
<el-option v-for="(item,i) in distributeTypeList" :key="i" :label="item.name" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">收货单列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center" />
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column fixed label="操作" align="center" width="150">
<template slot-scope="scope">
<el-button type="primary" size="mini" :disabled="scope.row.billState=='已完成'"
@click="toEdit(scope.row)">办理</el-button>
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">查看</el-button>
</template>
</el-table-column>
<el-table-column prop="billNo" width="180" label="单据编号" align="center" />
<el-table-column prop="createTime" label="单据日期" width="120" align="center" />
<el-table-column prop="createByName" label="制单人" width="120" align="center" />
<el-table-column prop="sourceBillNo" label="预期到货通知单号" width="200" align="center" />
<el-table-column prop="distributeType" label="分配状态" width="120" align="center" />
<el-table-column prop="busTypeValue" label="业务类型" width="120" align="center" />
<el-table-column prop="supplierName" label="供应商" width="220" align="center" />
<el-table-column prop="deliveryDate" label="到货日期" width="120" align="center" />
<el-table-column prop="billState" label="单据状态" width="100" align="center" />
<el-table-column label="上架单" align="center" width="100">
<template slot-scope="scope">
<div style="color: #1890FF; text-decoration: underline ;cursor:pointer;"
@click="showUpShelfList(scope.row)">
{{ scope.row.upShlefNum }}
</div>
</template>
</el-table-column>
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
<divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList" />
<divAddupShelfRecord v-show="viewState == 5" ref="divAddupShelfRecord" @doback="resetState"
@reloadlist="loadList" />
<upShelfInfo v-show="viewState == 6" ref="upShelfInfo" @doback2="resetState2" @reloadlist="loadList" />
<el-dialog title="上架单列表" :visible.sync="dialogVisible" :before-close="handleClose">
<el-table :data="upShelfList" border style="width: 100%;margin-top: -30px;">
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod2" align="center" />
<el-table-column label="单据编号" align="center">
<template slot-scope="scope">
<div style="color: #1890FF; text-decoration: underline ;cursor:pointer;"
@click="showUpShelfBill(scope.row)">
{{ scope.row.billNo }}
</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="单据日期" align="center" />
<el-table-column prop="createByName" label="制单人" align="center" />
<el-table-column prop="sourceBillNo" label="来源单号" align="center" />
<el-table-column prop="billState" label="单据状态" align="center" />
</el-table>
</el-dialog>
</div>
</template>
<script>
import req from '@/api/storage/receivingGoods.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './receivingGoodsAdd.vue'
import divInfo from './receivingGoodsInfo.vue'
import divAddupShelfRecord from './upShelfAddRecord.vue'
import upShelfInfo from './upShelfInfo.vue'
import {
typeValues
} from '@/api/Common/dictcommons'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
divInfo,
divAddupShelfRecord,
upShelfInfo
},
data() {
return {
dialogVisible: false,
formobj: {
sid: "",
reviewStatus: "",
remarks: ''
},
btndisabled: false,
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [
// {
// type: 'primary',
// size: 'small',
// icon: 'plus',
// btnKey: 'toAudit',
// btnLabel: '新增'
// },
// {
// type: 'danger',
// size: 'small',
// icon: 'del',
// btnKey: 'doDel',
// btnLabel: '删除'
// },
{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toPrint',
btnLabel: '打印入库单'
},
{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增上架单'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: [],
selectionList: [],
busTypeList: [],
billStateList: [{
name: "新建",
sid: "0"
},
{
name: "已完成",
sid: "1"
},
],
distributeTypeList: [{
name: "未分配",
sid: "0"
},
{
name: "部分分配",
sid: "2"
},
{
name: "已分配",
sid: "1"
},
],
upShelfList: [
// {
// billSid: '单据sid',
// billNo: '单据编号',
// createTime: '单据日期',
// createByName: '制单人',
// sourceBillNo: '来源单号',
// billState: '单据状态'
// },
]
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
typeValues({
type: 'wms_busType'
}).then((res) => {
if (res.success) {
this.busTypeList = res.data
}
})
},
methods: {
showUpShelfList(row) {
console.log("val", row);
req.getUpShlefList(row.sid).then((resp) => {
this.upShelfList = resp.data
this.dialogVisible = true
}).catch(() => {})
},
showUpShelfBill(row) {
this.dialogVisible = false
this.viewState = 6
this.$refs['upShelfInfo'].showEdit(row.billSid)
},
resetState2() {
this.viewState = 1
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
saveExamine() {
},
changeTheme() {
},
toAudit() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
selectTime1() {
},
selectTime2() {
},
selectionLineChangeHandle(val) {
console.log("val", val);
this.selectionList = val
const aa = []
val.forEach(element => {
aa.push(element.sid)
})
this.sids = aa
},
// 搜索条件效果
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAudit':
this.toAudit()
break
case 'doDel':
this.doDel()
break
case 'toPrint':
this.toPrint()
break
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
this.queryParams.params.menuUrl = this.$route.path
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// 根据resp.code进行异常情况处理
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
// 序号
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
indexMethod2(index) {
return index + 1
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
doDel() {
if (this.sids.length > 0) {
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteBySids(this.sids).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
} else {
this.$message({
showClose: true,
message: '请至少选择一条记录进行删除操作'
})
}
},
toPrint() {
for (var i = 0; i < this.selectionList.length; i++) {
if (this.selectionList[i].billState != '已完成') {
this.$message({
type: 'warning',
message: "只能选择已完成的记录。",
showClose: true
})
return
}
}
this.$message({
type: 'warning',
message: "打印功能正在完善中。",
showClose: true
})
},
toAdd() {
if (this.selectionList.length != 1) {
this.$message({
type: 'warning',
message: "请选择一条数据。",
showClose: true
})
return
}
if (this.selectionList[0].billState == '新建') {
this.$message({
type: 'warning',
message: "此记录未完成,不可操作。",
showClose: true
})
return
}
if (this.selectionList[0].distributeType == '已分配') {
this.$message({
type: 'warning',
message: "此记录已全部分配,不可操作。",
showClose: true
})
return
}
this.viewState = 5
this.$refs['divAddupShelfRecord'].showEdit(this.selectionList[0])
},
toEdit(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 4
this.$refs['divinfo'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// 根据resp.code进行异常情况处理
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // 根据resp.code进行异常情况处理
}
}).catch(e => {
console.log(e)
})
}
}
}
</script>
<style scoped>
</style>