<template>
|
<view class="content">
|
<view class="tabs">
|
<view :class="tabs == 0 ? 'on':''" @tap="changeTab(0)">
|
{{ $t("SellOutCheckBillList.cacheList") == "SellOutCheckBillList.cacheList" ? "缓存列表" : $t("SellOutCheckBillList.cacheList") }}
|
</view>
|
<view :class="tabs == 1 ? 'on':''" @tap="changeTab(1)">
|
{{ $t("SellOutCheckBillList.checkedList") == "SellOutCheckBillList.checkedList" ? "已校验列表" : $t("SellOutCheckBillList.checkedList") }}
|
</view>
|
</view>
|
|
<view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
|
|
<view class="form" v-if="tabs == 0">
|
<view class="buttons" @tap="add">
|
<uni-icons type="plus" style="margin-right: 10rpx;" size="22"></uni-icons>
|
{{ $t("SellOutCheckBillList.btnAdd") == "SellOutCheckBillList.btnAdd" ? "新增" : $t("SellOutCheckBillList.btnAdd") }}
|
</view>
|
</view>
|
<view class="form" v-if="tabs == 1">
|
<view class="form-item">
|
<view class="title">{{ $t("SellOutCheckBillList.billNo") == "SellOutCheckBillList.billNo" ? "单据号:" : $t("SellOutCheckBillList.billNo") }}:</view>
|
<view class="right">
|
<input v-model="hform.HBillNo" :placeholder="$t('SellOutCheckBillList.billNoPlaceholder') == 'SellOutCheckBillList.billNoPlaceholder' ? '请输入单据号' : $t('SellOutCheckBillList.billNoPlaceholder')" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">{{ $t("Gy.HMainSourceBillNo") == "Gy.HMainSourceBillNo" ? "源单单号:" : $t("Gy.HMainSourceBillNo") }}:</view>
|
<view class="right">
|
<input v-model="hform.HSourceBillNo" :placeholder="$t('SellOutCheckBillList.sourceBillNoPlaceholder') == 'SellOutCheckBillList.sourceBillNoPlaceholder' ? '请输入源单单号' : $t('SellOutCheckBillList.sourceBillNoPlaceholder')" />
|
</view>
|
</view>
|
<view class="buttons">
|
<button class="btn-a" size="mini" type="default" @tap="clear">
|
{{ $t("SellOutCheckBillList.btn_Reset") == "SellOutCheckBillList.btn_Reset" ? "重置" : $t("SellOutCheckBillList.btn_Reset") }}
|
</button>
|
<button class="btn-c" size="mini" type="default" @tap="search">
|
{{ $t("SellOutCheckBillList.btn_Query") == "SellOutCheckBillList.btn_Query" ? "查询" : $t("SellOutCheckBillList.btn_Query") }}
|
</button>
|
</view>
|
</view>
|
|
<view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
|
|
<view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0">
|
<uni-card :title="item.制单日期.substr(0,10)" :extra="item.单据号" style="margin: 10px;"
|
@tap="showDetail = showDetail==index?-1:index">
|
<view class="card-detail">
|
<view class="detail" v-if="item.制单人">
|
<text>{{ $t("Gy.HMaker") == "Gy.HMaker" ? "制单人:" : $t("Gy.HMaker") }}:</text>{{item.制单人}}
|
</view>
|
<view class="detail" v-if="item.单据内码">
|
<text>{{ $t("SellOutCheckBillList.table_BillID") == "SellOutCheckBillList.table_BillID" ? "单据内码:" : $t("SellOutCheckBillList.table_BillID") }}:</text>{{item.单据内码}}
|
</view>
|
<view class="detail" v-if="item.数量">
|
<text>{{ $t("Gy.HQty") == "Gy.HQty" ? "数量:" : $t("Gy.HQty") }}:</text>{{item.数量}}
|
</view>
|
<view class="detail" v-if="item.源单单号">
|
<text>{{ $t("Gy.HMainSourceBillNo") == "Gy.HMainSourceBillNo" ? "源单单号:" : $t("Gy.HMainSourceBillNo") }}:</text>{{item.源单单号}}
|
</view>
|
<view class="detail" v-if="item.组织">
|
<text>{{ $t("Gy.CurrentOrganization") == "Gy.CurrentOrganization" ? "组织:" : $t("Gy.CurrentOrganization") }}:</text>{{item.组织}}
|
</view>
|
</view>
|
|
<view class="more">
|
<view class="part" style="border-right: 1px solid #eee;color: #3a78ff;" @tap.stop="edit(item)">
|
<uni-icons type="compose" style="color: #3a78ff;margin-right: 10rpx;" size="18"></uni-icons>
|
{{ $t("SellOutCheckBillList.btn_Edit") == "SellOutCheckBillList.btn_Edit" ? "编辑" : $t("SellOutCheckBillList.btn_Edit") }}
|
</view>
|
<view class="part" style="color: #da0000;" @tap.stop="del(item)">
|
<uni-icons type="trash" style="color: #da0000;margin-right: 10rpx;" size="18"></uni-icons>
|
{{ $t("SellOutCheckBillList.btn_Del") == "SellOutCheckBillList.btn_Del" ? "删除" : $t("SellOutCheckBillList.btn_Del") }}
|
</view>
|
</view>
|
</uni-card>
|
</view>
|
<view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==1">
|
<uni-card :title="item.日期" :extra="item.单据号" style="margin: 10px;"
|
@tap="showDetail = showDetail==index?-1:index">
|
<view class="card-detail">
|
<view class="detail" v-if="item.制单人">
|
<text>{{ $t("Gy.HMaker") == "Gy.HMaker" ? "制单人:" : $t("Gy.HMaker") }}:</text>{{item.制单人}}
|
</view>
|
<view class="detail" v-if="item.数量">
|
<text>{{ $t("Gy.HQty") == "Gy.HQty" ? "数量:" : $t("Gy.HQty") }}:</text>{{item.数量}}
|
</view>
|
<view class="detail" v-if="item.源单单号">
|
<text>{{ $t("Gy.HMainSourceBillNo") == "Gy.HMainSourceBillNo" ? "源单单号:" : $t("Gy.HMainSourceBillNo") }}:</text>{{item.源单单号}}
|
</view>
|
<view class="detail" v-if="item.物料代码">
|
<text>{{ $t("SellOutCheckBillList.table_MaterNumber") == "SellOutCheckBillList.table_MaterNumber" ? "物料代码:" : $t("SellOutCheckBillList.table_MaterNumber") }}:</text>{{item.物料代码}}
|
</view>
|
<view class="detail" v-if="item.物料名称">
|
<text>{{ $t("SellOutCheckBillList.table_MaterName") == "SellOutCheckBillList.table_MaterName" ? "物料名称:" : $t("SellOutCheckBillList.table_MaterName") }}:</text>{{item.物料名称}}
|
</view>
|
<view class="detail" v-if="item.规格型号">
|
<text>{{ $t("SellOutCheckBillList.table_MaterModel") == "SellOutCheckBillList.table_MaterModel" ? "规格型号:" : $t("SellOutCheckBillList.table_MaterModel") }}:</text>{{item.规格型号}}
|
</view>
|
<view class="detail" v-if="item.组织">
|
<text>{{ $t("Gy.CurrentOrganization") == "Gy.CurrentOrganization" ? "组织:" : $t("Gy.CurrentOrganization") }}:</text>{{item.组织}}
|
</view>
|
</view>
|
|
<view class="more">
|
<view class="part" style="color: #d98d00;width: 100%;" @tap.stop="revoke(item)">
|
<uni-icons type="undo" style="color: #d98d00;margin-right: 10rpx;" size="18"></uni-icons>
|
{{ $t("SellOutCheckBillList.btn_Revoke") == "SellOutCheckBillList.btn_Revoke" ? "撤销" : $t("SellOutCheckBillList.btn_Revoke") }}
|
</view>
|
</view>
|
</uni-card>
|
</view>
|
|
<view class="over" v-if="!listData || listData.length == 0">
|
{{ $t("SellOutCheckBillList.noDate") == "SellOutCheckBillList.noDate" ? "暂无数据" : $t("SellOutCheckBillList.noDate") }}
|
</view>
|
<view class="over" v-if="listData.length != 0 && listData.length != showList.length">
|
{{ $t("SellOutCheckBillList.Loading") == "SellOutCheckBillList.Loading" ? "加载中..." : $t("SellOutCheckBillList.Loading") }}
|
</view>
|
<view class="over" v-if="listData.length != 0 && listData.length == showList.length">
|
{{ $t("SellOutCheckBillList.bottom") == "SellOutCheckBillList.bottom" ? "已到底" : $t("SellOutCheckBillList.bottom") }}
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import {
|
getUserInfo
|
} from "@/utils/auth.js";
|
export default {
|
data() {
|
return {
|
userInfo: getUserInfo(),
|
serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
|
tabs: 0,
|
urls: '/WEBSController/GetKf_PonderationBillMain_TempList_BillCheck_Json',
|
MvarReportTitle: this.$t('SellOutCheckBillList.reportTitle') == 'SellOutCheckBillList.reportTitle' ? '销售出库单校验缓存列表' : this.$t('SellOutCheckBillList.reportTitle'),
|
hform: {
|
HBillNo: '',
|
HSourceBillNo: '',
|
HBillType: 1205,
|
HMaker: uni.getStorageSync('HUserName'),
|
HStockOrgID: uni.getStorageSync('OrganizationID'),
|
},
|
sWhere: '',
|
listData: [],
|
showList: [],
|
showDetail: -1,
|
|
page: 1,
|
}
|
},
|
onLoad() {
|
//用户模块权限判断
|
this.CheckModRight()
|
this.changeTab(0)
|
console.log(this.userInfo, uni.getStorageSync('HUserName'))
|
},
|
onReachBottom: function() {
|
this.page++
|
setTimeout(() => {
|
this.showList = this.showList.concat(this.getPage(this.page, this.listData))
|
}, 100)
|
},
|
onPullDownRefresh: function() {
|
this.clear()
|
setTimeout(() => {
|
uni.stopPullDownRefresh();
|
}, 1000);
|
},
|
methods: {
|
CheckModRight() {
|
uni.request({
|
url: this.serverUrl + '/WEBSController/CheckModRight_Json',
|
data: {
|
ModRightName: 'CE_MateOutCheck',
|
HUserName: uni.getStorageSync('HUserName')
|
},
|
success: (res) => {
|
if (res.data.count == 1) {} else {
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: this.$t('SellOutCheckBillList.requestFailed') == 'SellOutCheckBillList.requestFailed' ? '接口请求失败' : this.$t('SellOutCheckBillList.requestFailed'),
|
icon: 'none'
|
})
|
},
|
});
|
},
|
getPage(page, list) {
|
let sindex = (parseInt(page) - 1) * 20
|
let eindex = parseInt(page) * 20
|
let newList = list.slice(sindex, eindex)
|
return newList
|
},
|
changeTab(e) {
|
this.tabs = e
|
this.page = 1
|
this.showList = []
|
|
if (this.tabs == 0) {
|
this.urls = '/WEBSController/GetKf_PonderationBillMain_TempList_BillCheck_Json'
|
}
|
if (this.tabs == 1) {
|
this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_BillCheck_Json'
|
}
|
this.getList()
|
},
|
getList() {
|
uni.showLoading({
|
title: this.$t('SellOutCheckBillList.loadingTitle') == 'SellOutCheckBillList.loadingTitle' ? '加载中...' : this.$t('SellOutCheckBillList.loadingTitle')
|
})
|
uni.request({
|
url: this.serverUrl + this.urls,
|
data: this.hform,
|
success: (res) => {
|
console.log(1, res);
|
if (res.data.count == 1) {
|
this.listData = res.data.data
|
this.showList = this.getPage(this.page, this.listData)
|
setTimeout(() => {
|
uni.hideLoading()
|
}, 1000)
|
} else {
|
uni.hideLoading()
|
this.listData = []
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.hideLoading()
|
uni.showToast({
|
title: this.$t('SellOutCheckBillList.requestFailed') == 'SellOutCheckBillList.requestFailed' ? '接口请求失败' : this.$t('SellOutCheckBillList.requestFailed'),
|
icon: 'none'
|
})
|
},
|
});
|
},
|
search() {
|
this.sWhere = ''
|
this.listData = []
|
this.page = 1
|
this.showList = []
|
|
console.log(this.hform)
|
// if (this.hform.HBillNo) {
|
// this.sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'";
|
// }
|
// if (this.hform.HSourceBillNo) {
|
// this.sWhere += " and 设备类型 like '%" + this.hform.HSourceBillNo + "%'";
|
// }
|
this.getList()
|
},
|
clear() {
|
this.listData = []
|
this.page = 1
|
this.showList = []
|
|
this.sWhere = ''
|
this.hform = {
|
HBillNo: '',
|
HSourceBillNo: '',
|
HBillType: 1205,
|
HMaker: uni.getStorageSync('HUserName'),
|
HStockOrgID: uni.getStorageSync('OrganizationID'),
|
}
|
this.getList()
|
},
|
add() {
|
uni.navigateTo({
|
url: './SellOutCheckBill?OperationType=1'
|
})
|
},
|
//编辑
|
edit(item) {
|
console.log(item)
|
uni.navigateTo({
|
url: './SellOutCheckBill?OperationType=2&HBillNo=' + item.HBillNo
|
})
|
// uni.request({
|
// url: this.serverUrl + '/WEBSController/TempList_Modify_Json',
|
// data:{ "HInterID": item.HInterID, "HBillNo": item.单据号, "HBillType": this.hform.HBillType },
|
// success: (res) => {
|
// console.log(1,res);
|
// if(res.data.count == 1){
|
|
// }else{
|
// uni.showToast({
|
// title:res.data.Message,
|
// icon:'none'
|
// })
|
// }
|
|
// },
|
// fail: (res) => {
|
// console.log(res);
|
// uni.hideLoading()
|
// uni.showToast({
|
// title:'接口请求失败',
|
// icon:'none'
|
// })
|
// },
|
// })
|
},
|
//删除
|
del(item) {
|
// console.log(item.hmainid,uni.getStorageSync('HUserName'))
|
uni.showModal({
|
title: this.$t('SellOutCheckBillList.confirmTitle') == 'SellOutCheckBillList.confirmTitle' ? '提示' : this.$t('SellOutCheckBillList.confirmTitle'),
|
content: this.$t('SellOutCheckBillList.delConfirm') == 'SellOutCheckBillList.delConfirm' ? '确认要删除记录?删除后不能恢复' : this.$t('SellOutCheckBillList.delConfirm'),
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
uni.request({
|
url: this.serverUrl +
|
'/WEBSController/DeleteTempBillList_BillCheck_Json',
|
data: {
|
HInterID: item.HInterID,
|
HBillNo: item.单据号,
|
HBillType: this.hform.HBillType,
|
HMaker: uni.getStorageSync('HUserName'),
|
HStockOrgID: this.hform.HStockOrgID,
|
MvarReportTitle: this.MvarReportTitle,
|
},
|
success: (res) => {
|
console.log(1, res);
|
if (res.data.count == 1) {
|
this.clear()
|
}
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.hideLoading()
|
uni.showToast({
|
title: this.$t('SellOutCheckBillList.requestFailed') == 'SellOutCheckBillList.requestFailed' ? '接口请求失败' : this.$t('SellOutCheckBillList.requestFailed'),
|
icon: 'none'
|
})
|
},
|
});
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
}
|
}
|
});
|
},
|
//撤销
|
revoke(item) {
|
// console.log(item.hmainid,uni.getStorageSync('HUserName'))
|
uni.showModal({
|
title: this.$t('SellOutCheckBillList.confirmTitle') == 'SellOutCheckBillList.confirmTitle' ? '提示' : this.$t('SellOutCheckBillList.confirmTitle'),
|
content: this.$t('SellOutCheckBillList.revokeConfirm') == 'SellOutCheckBillList.revokeConfirm' ? '是否确认撤销' : this.$t('SellOutCheckBillList.revokeConfirm'),
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
uni.request({
|
url: this.serverUrl +
|
'/WEBSController/set_DeleteICStockBillAndWMS_BillCheck_Json',
|
data: {
|
HInterID: item.HInterID,
|
HBillNo: item.单据号,
|
HBillType: this.hform.HBillType,
|
HMaker: uni.getStorageSync('HUserName'),
|
HStockOrgID: this.hform.HStockOrgID,
|
MvarReportTitle: this.MvarReportTitle,
|
},
|
success: (res) => {
|
console.log(1, res);
|
if (res.data.count == 1) {
|
this.clear()
|
}
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.hideLoading()
|
uni.showToast({
|
title: this.$t('SellOutCheckBillList.requestFailed') == 'SellOutCheckBillList.requestFailed' ? '接口请求失败' : this.$t('SellOutCheckBillList.requestFailed'),
|
icon: 'none'
|
})
|
},
|
});
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
}
|
}
|
});
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.form {
|
width: 640rpx;
|
margin: 20rpx auto;
|
margin-top: 90rpx;
|
}
|
|
.tabs {
|
width: 100%;
|
position: fixed;
|
left: 0;
|
z-index: 9;
|
display: flex;
|
background-color: #e5e5e5;
|
|
view {
|
width: 50%;
|
font-size: 30rpx;
|
color: #333;
|
text-align: center;
|
padding: 16rpx 0;
|
}
|
|
.on {
|
color: #3a78ff;
|
font-weight: bold;
|
border-bottom: 3px solid #3a78ff;
|
}
|
}
|
|
.buttons {
|
width: 100%;
|
display: flex;
|
justify-content: center;
|
margin-top: 20rpx;
|
|
button {
|
border-radius: 50rpx;
|
width: 180rpx;
|
height: 66rpx;
|
line-height: 66rpx;
|
font-size: 28rpx;
|
}
|
|
.btn-a {
|
background-color: #acacac;
|
color: #fff;
|
}
|
|
.btn-b {
|
background-color: #41a863;
|
color: #fff;
|
}
|
|
.btn-c {
|
background-color: #3a78ff;
|
color: #fff;
|
}
|
}
|
|
.form-item {
|
display: flex;
|
align-items: center;
|
font-size: 28rpx;
|
padding: 6rpx 0;
|
|
.title {
|
width: 180rpx;
|
|
text {
|
color: red;
|
font-weight: bold;
|
}
|
}
|
|
.right {
|
width: 450rpx;
|
border-radius: 22rpx;
|
border: 1px solid #acacac;
|
}
|
|
.righton {
|
width: 450rpx;
|
border-radius: 22rpx;
|
border: 1px solid #e4e4e4;
|
background-color: #e4e4e4;
|
}
|
|
input {
|
width: 100%;
|
padding: 8rpx 20rpx;
|
font-size: 30rpx;
|
}
|
}
|
|
.list {
|
width: 100%;
|
|
.card-detail {
|
width: 100%;
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
line-height: 120%;
|
|
.detail {
|
// width: 50%;
|
font-size: 26rpx;
|
margin-bottom: 12rpx;
|
color: #555;
|
margin-right: 20rpx;
|
|
text {
|
color: #999;
|
font-size: 26rpx;
|
}
|
}
|
}
|
|
.more {
|
color: #888;
|
font-size: 26rpx;
|
display: flex;
|
border-top: 1px solid #eee;
|
padding-top: 20rpx;
|
|
.part {
|
width: 50%;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
}
|
}
|
</style>
|