<template>
|
<view>
|
<uni-popup ref="popup" type="bottom" @change="popupChangeHandler">
|
<view class="content">
|
<view class="search-condition">
|
<view class="title"><text>发货通知单号: </text></view>
|
<view class="right"><input type="text" v-model="HBillNo" @confirm="search" /></view>
|
</view>
|
<view class="search-condition">
|
<view class="title"><text>客户: </text></view>
|
<view class="right"><input type="text" v-model="HCustomer" @confirm="search" /></view>
|
</view>
|
<view class="search-condition">
|
<view class="title"><text>销售员: </text></view>
|
<view class="right"><input type="text" v-model="HSeller" @confirm="search" /></view>
|
</view>
|
<view class="search-condition">
|
<view class="title">
|
条码:
|
</view>
|
<view class="right">
|
<input type="text" v-model="HBarCode" @confirm="getCode(HBarCode)" />
|
</view>
|
<view>
|
<uni-icons type="scan"
|
style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
|
size="20" @click="toScanCode"></uni-icons>
|
</view>
|
</view>
|
<view class="buttons">
|
<view style="flex: 1;"></view>
|
<button size="mini" type="primary" @click="clear">重置</button>
|
<button size="mini" type="primary" @click="search">搜索</button>
|
<button size="mini" type="primary" @click="exit">退出</button>
|
</view>
|
<scroll-view id="#BillListPanel" scroll-y="true" style="height: 55vh;">
|
<view class="options-wrapper" v-show="HBillList.length != 0">
|
<uni-card class="option-card" v-for="(bill, index) in HBillList[curPage-1]" :key="index"
|
:title="bill['物料名称']" @tap="clickCard(bill['HSourceInterID'], bill['单据号'])">
|
<view class="item">
|
<view class="left">发货通知单号: </view>
|
<view class="right">{{bill['单据号']}}</view>
|
</view>
|
<view class="item">
|
<view class="left">物料代码: </view>
|
<view class="right">{{bill['物料代码']}}</view>
|
</view>
|
<!-- <view class="item">
|
<view class="left">物料名称: </view>
|
<view class="right">{{}}</view>
|
</view> -->
|
<view class="item">
|
<view class="left">规格型号: </view>
|
<view class="right">{{bill['规格型号']}}</view>
|
</view>
|
<view class="item">
|
<view class="left">销售员: </view>
|
<view class="right">{{bill['销售员']}}</view>
|
</view>
|
<view class="item">
|
<view class="left">客户: </view>
|
<view class="right">{{bill['客户']}}</view>
|
</view>
|
<view class="item">
|
<view class="left">发货通知单数量: </view>
|
<view class="right">{{bill['数量']}}</view>
|
</view>
|
<view class="item">
|
<view class="left">剩余可出库数量: </view>
|
<view class="right">{{bill['数量'] - bill['已关联数量']}}</view>
|
</view>
|
</uni-card>
|
</view>
|
<view class="over" v-show="HBillList.length == 0">暂无数据</view>
|
</scroll-view>
|
<uni-pagination id="#pagination" title="标题文字" v-model="curPage" :pageSize="size"
|
:total="length"></uni-pagination>
|
</view>
|
</uni-popup>
|
</view>
|
</template>
|
|
<script>
|
import {
|
CommonUtils
|
} from '../../utils/common';
|
import {
|
getUserInfo
|
} from '../../utils/auth';
|
export default {
|
name: "PushSeOutStockBillPopup",
|
data() {
|
return {
|
size: 20,
|
curPage: 1,
|
length: 0,
|
page: 0,
|
HSourceBillNo: '',
|
HMater: '',
|
HCustom: '',
|
HBillList: [],
|
panelHeight: 0,
|
HBarCode: '',
|
HBillNo: '',
|
HCustomer: '',
|
HSeller: '',
|
HMaterialID: ''
|
};
|
},
|
props: {
|
HBillType: {
|
type: [String, Number],
|
required: true
|
},
|
HSourceBillType: {
|
type: [String, Number],
|
required: true
|
},
|
HStockOrgID: {
|
type: [String, Number],
|
required: true
|
},
|
},
|
model: {
|
prop: "HSourceBill",
|
event: 'change'
|
},
|
methods: {
|
clear() {
|
this.HBarCode = ''
|
this.HMaterialID = '',
|
this.HBillNo = '',
|
this.HCustom = '',
|
this.HSeller = '',
|
this.search()
|
},
|
popupChangeHandler(e) {
|
if (e.show === true) {
|
this.getBillList()
|
} else {
|
// 清理资源
|
this.size = 20
|
this.curPage = 1
|
this.length = 0
|
this.page = 0
|
this.HSourceBillNo = ''
|
this.HMater = ''
|
this.HCustom = ''
|
this.HBillList = []
|
}
|
},
|
exit() {
|
this.$refs.popup.close();
|
},
|
search() {
|
this.getBillList()
|
},
|
showPopup() {
|
this.$refs.popup.open();
|
},
|
clickCard(interid, billno) {
|
uni.$emit('BillSelectComplete', {
|
HInterID: interid,
|
HBillNo: billno
|
})
|
// this.exit()
|
},
|
toScanCode() {
|
var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
|
mpaasScanModule.mpaasScan({
|
'hideAlbum': true,
|
'timeoutInterval': '10', //超时时间
|
'timeoutText': '未识别到二维码' //超时提醒
|
}, (ret) => {
|
console.log(ret.resp_result)
|
this.HBarCode = ret.resp_result
|
this.getCode(ret.resp_result)
|
})
|
},
|
async getCode(BarCode) {
|
console.log(BarCode)
|
try {
|
let barCodeMeta = await this.getMaterialInfo(BarCode)
|
console.log('barCodeMeta: ', barCodeMeta);
|
this.HMaterialID = barCodeMeta[0]['HMaterID']
|
// this.getMater()
|
console.log('执行: getMater')
|
this.getBillList()
|
} catch (err) {
|
return
|
}
|
},
|
async getMaterialInfo(BarCode) {
|
return new Promise((resolve, reject) => {
|
CommonUtils.doRequest2({
|
url: "/Gy_BarCodeBillList/GetBarCodeBillList",
|
data: {
|
sWhere: ` and 条码编号 = N'${BarCode}'`,
|
user: getUserInfo()['Czymc']
|
},
|
resFunction: (res) => {
|
let {
|
count,
|
Message,
|
data
|
} = res.data
|
if (count == 1) {
|
resolve(data)
|
} else {
|
uni.showToast({
|
icon: 'none',
|
title: Message
|
})
|
reject()
|
}
|
},
|
errFunction: () => {
|
reject()
|
}
|
})
|
})
|
},
|
getBillList() {
|
this.HBillList = []
|
this.length = 0
|
this.page = 0
|
this.curPage = 1
|
|
let sWhere = ' and 数量 > 已关联数量'
|
if (!CommonUtils.isEmpty(this.HMaterialID)) {
|
sWhere += ` and HMaterID = ${this.HMaterialID} `
|
}
|
|
if (!CommonUtils.isEmpty(this.HBillNo)) {
|
sWhere += ` and 单据号 like N'%${this.HBillNo}%'`
|
}
|
if (!CommonUtils.isEmpty(this.HCustomer)) {
|
sWhere += ` and 客户 like N'%${this.HCustomer}%'`
|
}
|
if (!CommonUtils.isEmpty(this.HSeller)) {
|
sWhere += ` and 销售员 like N'%${this.HSeller}%'`
|
}
|
|
CommonUtils.doRequest2({
|
url: '/Xs_SeOutStockBill/list_k3',
|
data: {
|
'user': getUserInfo()['Czymc'],
|
'sWhere': sWhere
|
},
|
resFunction: (res) => {
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count > 0) {
|
console.log('Xs_SeOutStockBill data: ', data);
|
this.length = Array.from(data).length
|
const result = [];
|
for (let i = 0; i < data.length; i += this.size) {
|
result.push(data.slice(i, i + this.size));
|
}
|
this.HBillList = result
|
this.page = result.length
|
|
} else {
|
uni.showToast({
|
icon: 'none',
|
title: Message
|
})
|
}
|
}
|
})
|
},
|
},
|
}
|
</script>
|
|
<style lang="scss">
|
.content {
|
box-sizing: border-box;
|
border-radius: 15rpx 15rpx 0 0;
|
padding: 20rpx 20rpx 40rpx 20rpx;
|
background-color: #fff;
|
display: flex;
|
flex-direction: column;
|
gap: 10rpx;
|
|
.search-condition {
|
display: flex;
|
flex-direction: row;
|
align-items: center;
|
padding: 0 10rpx;
|
gap: 20rpx;
|
|
.title {
|
width: 8em;
|
text-align: right;
|
font-size: 32rpx;
|
}
|
|
.right {
|
flex: 1;
|
border-radius: 22rpx;
|
border: 1px solid #acacac;
|
height: auto;
|
|
input {
|
width: 100%;
|
padding: 8rpx 20rpx;
|
font-size: 24rpx;
|
}
|
}
|
}
|
|
.buttons {
|
display: flex;
|
flex-direction: row;
|
gap: 20rpx;
|
justify-content: flex-end;
|
|
>button {
|
display: inline-flex;
|
width: 4rem;
|
}
|
}
|
|
.options-wrapper {
|
padding: 20rpx;
|
display: grid;
|
grid-template-columns: repeat(1, 1fr);
|
gap: 20rpx;
|
|
.option-card {
|
margin: 0 !important;
|
box-sizing: border-box;
|
display: flex;
|
flex-direction: column;
|
flex-wrap: wrap;
|
gap: 10rpx;
|
|
.item {
|
display: flex;
|
flex-direction: row;
|
flex-wrap: wrap;
|
gap: 10rpx;
|
|
.right {
|
flex-wrap: wrap;
|
word-break: break-all;
|
}
|
}
|
}
|
}
|
}
|
</style>
|