From 315a4b1525ce57307ea6a6fb1d983632ed40bea6 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期二, 02 九月 2025 14:34:24 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
---
components/BillListPopup/BillListPopup.vue | 468 +++++++++++++++++++++++-------------------
pages/shengchanlingliaoshengdan/form.vue | 154 ++++++++-----
2 files changed, 350 insertions(+), 272 deletions(-)
diff --git a/components/BillListPopup/BillListPopup.vue b/components/BillListPopup/BillListPopup.vue
index e5aa0c9..591e71e 100644
--- a/components/BillListPopup/BillListPopup.vue
+++ b/components/BillListPopup/BillListPopup.vue
@@ -1,236 +1,278 @@
<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="HSourceBillNo" /></view>
- </view>
- <view class="search-condition">
- <view class="title"><text>鐗╂枡: </text></view>
- <view class="right"><input type="text" v-model="HMater" /></view>
- </view>
- <view class="search-condition">
- <view class="title"><text>鍏宠仈椤�: </text></view>
- <view class="right"><input type="text" v-model="HCustom" /></view>
- </view>
- <view class="buttons">
- <view style="flex: 1;"></view>
- <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 v-for="(bill, index) in HBillList[curPage-1]" :key="index" :title="bill['鐗╂枡鍚嶇О']"
- :extra="`鏁伴噺: ${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">鐗╂枡浠g爜: </view>
- <view class="right">{{bill['鐗╂枡浠g爜']}}</view>
- </view>
- <!-- <view class="item">
+ <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="HSourceBillNo" @confirm="getBillList" /></view>
+ </view>
+ <view class="search-condition">
+ <view class="title"><text>鐗╂枡: </text></view>
+ <view class="right"><input auto-focus type="text" v-model="HMater" @confirm="getBillList" /></view>
+ </view>
+ <view class="search-condition">
+ <view class="title"><text>鍏宠仈椤�: </text></view>
+ <view class="right"><input type="text" v-model="HCustom" @confirm="getBillList" /></view>
+ </view>
+ <view class="buttons">
+ <view style="flex: 1;"></view>
+ <button size="mini" type="primary" @click="search">鎼滅储</button>
+ <button v-if="MultiSourceBill" size="mini" type="primary" @click="ret">杩斿洖</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 :is-active="bill.isActive" v-for="(bill, index) in HBillList[curPage-1]" :key="index"
+ :title="bill['鐗╂枡鍚嶇О']" :extra="`鏁伴噺: ${bill['鏁伴噺']}`"
+ @tap="clickCard(bill['HSourceInterID'], bill['鍗曟嵁鍙�'], index)">
+ <view class="item">
+ <view class="left">鍗曟嵁鍙�: </view>
+ <view class="right">{{bill['鍗曟嵁鍙�']}}</view>
+ </view>
+ <view class="item">
+ <view class="left">鐗╂枡浠g爜: </view>
+ <view class="right">{{bill['鐗╂枡浠g爜']}}</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>
- </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>
+ <view class="item">
+ <view class="left">瑙勬牸鍨嬪彿: </view>
+ <view class="right">{{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>
+ </uni-popup>
+ </view>
</template>
<script>
- import {
- CommonUtils
- } from '../../utils/common';
- export default {
- name: "BillListPopup",
- data() {
- return {
- size: 20,
- curPage: 1,
- length: 0,
- page: 0,
- HSourceBillNo: '',
- HMater: '',
- HCustom: '',
- HBillList: [],
- panelHeight: 0,
- };
- },
- 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: {
- 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()
- },
- getBillList() {
- this.HBillList = []
- this.length = 0
- this.page = 0
- this.curPage = 1
- CommonUtils.doRequest(
- "/WEBSController/GetSourceBillList_Json", {
- HBilltype: this.HBillType,
- HSourceBillType: this.HSourceBillType,
- HStockOrgID: this.HStockOrgID,
- HSourceBillNo: this.HSourceBillNo || "",
- HMater: this.HMater || "",
- HCustom: this.HCustom || ""
- },
- (res) => {
- let {
- data,
- count,
- Message
- } = res.data
- if (count == 1) {
- console.log(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
- })
- }
- }
- )
- },
- },
- }
+ import {
+ CommonUtils
+ } from '../../utils/common';
+ export default {
+ name: "BillListPopup",
+ data() {
+ return {
+ size: 20,
+ curPage: 1,
+ length: 0,
+ page: 0,
+ HSourceBillNo: '',
+ HMater: '',
+ HCustom: '',
+ HBillList: [],
+ panelHeight: 0,
+
+ multiSouceBillList: []
+ };
+ },
+ props: {
+ HBillType: {
+ type: [String, Number],
+ required: true
+ },
+ HSourceBillType: {
+ type: [String, Number],
+ required: true
+ },
+ HStockOrgID: {
+ type: [String, Number],
+ required: true
+ },
+ MultiSourceBill: {
+ type: Boolean,
+ default: false,
+ required: false
+ }
+ },
+ model: {
+ prop: "HSourceBill",
+ event: 'change'
+ },
+ methods: {
+ 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()
+ },
+ ret() {
+ uni.$emit('BillSelectComplete', {
+ HInterID: 0,
+ HBillNo: 0,
+ enableMultiSourceBill: this.MultiSourceBill,
+ MultiSourceBillList: this.multiSouceBillList
+ })
+ },
+ showPopup() {
+ this.$refs.popup.open();
+ },
+ clickCard(interid, billno, index) {
+ if (this.MultiSourceBill == false) { // 闈炲婧愬崟妯″紡
+ uni.$emit('BillSelectComplete', {
+ HInterID: interid,
+ HBillNo: billno,
+ enableMultiSourceBill: this.MultiSourceBill
+ })
+ } else {
+ this.$set(this.HBillList[this.curPage - 1][index], 'isActive', !this.HBillList[this.curPage - 1][
+ index
+ ]['isActive'])
+ console.log(this.HBillList[this.curPage - 1][index])
+ // 璁剧疆浜嗗婧愬崟妯″紡
+ this.setMultiSourceBillList({
+ HInterID: interid,
+ HBillNo: billno
+ })
+ }
+
+ // this.exit()
+ },
+ setMultiSourceBillList(billInfo) {
+ let index = this.multiSouceBillList.findIndex(item => item.HInterID == billInfo.HInterID)
+ if (index == -1) {
+ this.multiSouceBillList.push(billInfo)
+ } else {
+ this.multiSouceBillList.splice(index, 1)
+ }
+ },
+ getBillList() {
+ this.HBillList = []
+ this.length = 0
+ this.page = 0
+ this.curPage = 1
+ CommonUtils.doRequest(
+ "/WEBSController/GetSourceBillList_Json", {
+ HBilltype: this.HBillType,
+ HSourceBillType: this.HSourceBillType,
+ HStockOrgID: this.HStockOrgID,
+ HSourceBillNo: this.HSourceBillNo || "",
+ HMater: this.HMater || "",
+ HCustom: this.HCustom || ""
+ },
+ (res) => {
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ 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;
+ .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;
- gap: 20rpx;
+ .search-condition {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ gap: 20rpx;
- .title {
- width: 5rem;
- text-align: right;
- }
+ .title {
+ width: 5rem;
+ text-align: right;
+ }
- .right {
- flex: 1;
- border-radius: 22rpx;
- border: 1px solid #acacac;
- height: auto;
+ .right {
+ flex: 1;
+ border-radius: 22rpx;
+ border: 1px solid #acacac;
+ height: auto;
- input {
- width: 100%;
- padding: 8rpx 20rpx;
- font-size: 24rpx;
- }
- }
- }
+ input {
+ width: 100%;
+ padding: 8rpx 20rpx;
+ font-size: 24rpx;
+ }
+ }
+ }
- .buttons {
- display: flex;
- flex-direction: row;
- gap: 20rpx;
- justify-content: flex-end;
+ .buttons {
+ display: flex;
+ flex-direction: row;
+ gap: 20rpx;
+ justify-content: flex-end;
- >button {
- display: inline-flex;
- width: 4rem;
- }
- }
+ >button {
+ display: inline-flex;
+ width: 4rem;
+ }
+ }
- .options-wrapper {
- padding: 20rpx;
- display: grid;
- grid-template-columns: repeat(1, 1fr);
- gap: 20rpx;
+ .options-wrapper {
+ padding: 20rpx;
+ display: grid;
+ grid-template-columns: repeat(1, 1fr);
+ gap: 20rpx;
- >view {
- margin: 0 !important;
- box-sizing: border-box;
+ >view {
+ margin: 0 !important;
+ box-sizing: border-box;
- }
+ }
- .item {
- .left {
- display: inline-block;
- width: 6rem;
- }
+ .item {
+ .left {
+ display: inline-block;
+ width: 6rem;
+ }
- .right {
- display: inline-block;
- }
- }
- }
- }
+ .right {
+ display: inline-block;
+ }
+ }
+ }
+
+ .uni-card[is-active] {
+ background-color: rgba(0, 122, 255, 0.2);
+ }
+ }
</style>
\ No newline at end of file
diff --git a/pages/shengchanlingliaoshengdan/form.vue b/pages/shengchanlingliaoshengdan/form.vue
index bf3021d..d180dc6 100644
--- a/pages/shengchanlingliaoshengdan/form.vue
+++ b/pages/shengchanlingliaoshengdan/form.vue
@@ -280,7 +280,7 @@
</view>
</view>
<BillListPopupVue ref="billList" :HBillType="hform.HBillType" :HSourceBillType="hform.HMainSourceBillType"
- :HStockOrgID="hform.HStockOrgID"></BillListPopupVue>
+ :HStockOrgID="hform.HStockOrgID" :MultiSourceBill="enableMultiSourceBill"></BillListPopupVue>
<BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
</view>
</template>
@@ -409,15 +409,45 @@
this.getRelationStore()
- uni.$on('BillSelectComplete', (e) => {
- console.log("鎺ユ敹鍒扮殑娑堟伅: ", e.HBillNo)
- this.getHBarCodeData(e.HBillNo)
- this.$refs.billList.exit()
+ uni.$on('BillSelectComplete', async (e) => {
+ console.log("鎺ユ敹鍒扮殑娑堟伅: ", e)
+ console.log("鏄惁搴旂敤澶氭簮鍗�: ", e.enableMultiSourceBill)
+ if(e.enableMultiSourceBill){
+
+ for(let item of e.MultiSourceBillList) {
+ try{
+ await this.getHBarCodeData(item.HBillNo)
+ }catch {
+ return
+ }
+ }
+ this.$refs.billList.exit()
+ if(e.MultiSourceBillList.length != 0){
+ this.showHSourceBillNo = false
+ }
+
+ }else {
+ this.getHBarCodeData(e.HBillNo)
+ this.$refs.billList.exit()
+ }
+
+
+
})
},
onUnload() {
uni.$off('BillSelectComplete')
},
+ computed: {
+ enableMultiSourceBill: {
+ get() {
+ if(uni.getStorageSync("Organization").includes("娴疯瘹") && this.hform.HMainSourceBillType == 3720){
+ return true
+ }
+ return false
+ }
+ }
+ },
methods: {
async qrCodeDisplay() {
try {
@@ -909,63 +939,69 @@
}
},
//閫変腑婧愬崟
- getHBarCodeData(HBarCode) {
+ async getHBarCodeData(HBarCode) {
if (!this.hform.HFIFOWHName) {
this.hform.HFIFOWHID = 0
}
- uni.request({
- url: this.serverUrl + '/WEBSController/get_SourceBarCode_MateOut_Json',
- data: {
- HInterID: this.hform.HInterID,
- HBillNo: this.hform.HBillNo,
- HBillType: this.hform.HBillType,
- HSourceBillNo: HBarCode,
- HSourceBillType: this.hform.HMainSourceBillType,
- HMaker: this.hform.HMaker,
- HStockOrgID: this.hform.HStockOrgID,
- HFIFOWHID: this.hform.HFIFOWHID,
- HPTQty: this.hform.HPTQty || 0,
- HPlanMode: this.hform.HPlanMode || 0
- },
- success: (res) => {
- if (res.data.count == 1) {
- var data = res.data.data
- console.log(2, data);
- this.hform.HSupName = data.hSupNameField
- this.hform.HSupID = data.hSupIDField
- if (data.hDeptIDField != 0) {
- this.hform.HDeptID = data.hDeptIDField
- this.hform.HDeptName = data.hDeptNameField
- }
- this.hform.HSourceBillNo = data.hSourceBillNoField
- this.showHMainSourceBillType = false
- if (data.hMulSourceFlagField == 0) {
- this.showHSourceBillNo = false
- }
- this.tabs = 2
- this.showHSupName = false
- this.barCodeFocus = true
- this.playSound(1)
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshHSourceBillState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- this.playSound(0)
- this.refreshHSourceBillState()
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
+ return new Promise((resolve, reject) => {
+ uni.request({
+ url: this.serverUrl + '/WEBSController/get_SourceBarCode_MateOut_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillNo: this.hform.HBillNo,
+ HBillType: this.hform.HBillType,
+ HSourceBillNo: HBarCode,
+ HSourceBillType: this.hform.HMainSourceBillType,
+ HMaker: this.hform.HMaker,
+ HStockOrgID: this.hform.HStockOrgID,
+ HFIFOWHID: this.hform.HFIFOWHID,
+ HPTQty: this.hform.HPTQty || 0,
+ HPlanMode: this.hform.HPlanMode || 0
+ },
+ success: (res) => {
+ if (res.data.count == 1) {
+ var data = res.data.data
+ console.log(2, data);
+ this.hform.HSupName = data.hSupNameField
+ this.hform.HSupID = data.hSupIDField
+ if (data.hDeptIDField != 0) {
+ this.hform.HDeptID = data.hDeptIDField
+ this.hform.HDeptName = data.hDeptNameField
+ }
+ this.hform.HSourceBillNo = data.hSourceBillNoField
+ this.showHMainSourceBillType = false
+ if (data.hMulSourceFlagField == 0) {
+ this.showHSourceBillNo = false
+ }
+ this.tabs = 2
+ this.showHSupName = false
+ this.barCodeFocus = true
+ this.playSound(1)
+ this.DisBillEntryList()
+ resolve()
+ } else {
+ this.playSound(0)
+ this.refreshHSourceBillState()
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ reject()
+ }
+ },
+ fail: (res) => {
+ this.playSound(0)
+ this.refreshHSourceBillState()
+ console.log(res);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ reject()
+ },
+ });
+ })
+
},
//鎵潯鐮佸鐞�
getCode(HBarCode) {
--
Gitblit v1.9.1