From e2f33becdfbe80f9c792006740b2037a6e4eb527 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期四, 13 十一月 2025 15:07:46 +0800
Subject: [PATCH] 调整 页面url
---
pages/zutuo_xiaowei/form_xiaowei.vue | 436 +++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 315 insertions(+), 121 deletions(-)
diff --git a/pages/zutuosaoma/form.vue b/pages/zutuo_xiaowei/form_xiaowei.vue
similarity index 71%
copy from pages/zutuosaoma/form.vue
copy to pages/zutuo_xiaowei/form_xiaowei.vue
index be0f767..08b7514 100644
--- a/pages/zutuosaoma/form.vue
+++ b/pages/zutuo_xiaowei/form_xiaowei.vue
@@ -2,18 +2,6 @@
<view class="form">
<view class="form-base-info">
<view class="form-item">
- <view class="title">鎵樻潯鐮�</view>
- <view class="right">
- <input type="text" :focus="HBarCodePackFocus" v-model="HBarCode_Pack"
- @confirm="GetMeesageByBarCode_Pack(HBarCode_Pack)" />
- </view>
- <view class="right-icon">
- <uni-icons class="right-icon" :class="[EnableScanBarCodePack?'disabled':'']" type="scan"
- style="background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;" size="20"
- @click="toScanCode"></uni-icons>
- </view>
- </view>
- <view class="form-item">
<view class="title">鏉$爜</view>
<view class="right">
<input type="text" :focus="HBarCodeFocus" v-model="HBarCode"
@@ -29,6 +17,8 @@
<view class="tabs">
<view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">瑁呯淇℃伅</view>
<view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">鍗曟嵁淇℃伅</view>
+ <!-- 鍒犻櫎杩欒澶氫綑鐨勪唬鐮� -->
+ <!-- <view :class="tabs == 'closeResultTable' ? 'on':''" @tap="tabs = 1">鍗曟嵁淇℃伅</view> -->
</view>
<!-- 瑁呯淇℃伅 -->
<view v-if="tabs == 0">
@@ -95,6 +85,31 @@
<button class="btn-d" size="mini" @tap="cmdDelete">鍒犻櫎</button>
<button class="btn-c" size="mini" @tap="cmdExit">閫�鍑�</button>
</view>
+
+ <view v-if="showResultTable" class="result-modal">
+ <view class="modal-mask" @tap="closeResultTable"></view>
+ <view class="modal-content">
+ <view class="modal-header">
+ <text class="modal-title">瑁呯缁撴灉</text>
+ <uni-icons type="close" size="20" @tap="closeResultTable"></uni-icons>
+ </view>
+ <view class="modal-body">
+ <zb-table
+ :fit="true"
+ :style="{height: '400px'}"
+ :columns="resultTableColumns"
+ :data="resultTableData"
+ :show-header="true"
+ :border="true"
+ :row-key="row => row.index" />
+ </view>
+ <view class="modal-footer">
+ <button class="btn-a" size="mini" @tap="toAddNew">鏂板</button>
+ <view style="flex: 1;"></view>
+ <button class="btn-c" size="mini" @tap="closeResultTable">鍏抽棴</button>
+ </view>
+ </view>
+ </view>
</view>
</template>
@@ -109,6 +124,7 @@
import {
MpaasScan
} from "@/utils/mpaasScan.js"
+import getdateTime from '../../utils/getdateTime';
export default {
data() {
return {
@@ -172,17 +188,90 @@
titleData: [], //涓嶉渶瑕佹樉绀虹殑瀛楁
OperationType: 1, //浠庣紦瀛樺垪琛ㄤ腑杩斿洖鏁版嵁绫诲瀷锛�1鏂板銆�2浠庣紦瀛樺垪琛ㄤ腑杩斿洖锛�
HBarCode_Pack_Temp: "", //浠庣紦瀛樺垪琛ㄤ腑杩斿洖绠辨潯鐮�
+
+ //灞曠ず琛ㄥ崟
+ showResultTable: false, // 鎺у埗缁撴灉琛ㄦ牸鏄剧ず
+ resultTableData: [], // 缁撴灉琛ㄦ牸鏁版嵁
+ resultTableColumns: [
+ {
+ name: '鏍堟澘鐮�',
+ label: '鏍堟澘鐮�',
+ width: 120,
+ },
+ {
+ name: '涓鐮�',
+ label: '涓鐮�',
+ width: 120,
+ },
+ {
+ name: '鏃ユ湡',
+ label: '鏃ユ湡',
+ width: 100,
+ },
+ {
+ name: '鐗╂枡',
+ label: '鐗╂枡',
+ width: 100,
+ }
+ ],
+ //
// 琛ㄥ崟鎻愪氦鍊�
hform: {
HDate: dayjs(new Date()).format('YYYY-MM-DD'),
HMaker: getUserInfo()['Czymc'],
- HBillNo: '',
HInterID: '',
HStockOrgName: uni.getStorageSync("Organization"),
HStockOrgID: uni.getStorageSync("OrganizationID"),
HQualityApproval: false,
+
+ HMainID:'',
+ HSubID:'',
+ HSourceBillSEQ:'',
+ HBillNo:'',
+ HMaterNumber:'',
+ HMaterID:'',
+ HMaterName:'',
+ HMaterModel:'',
+ HCusModel:'',
+ HCusMaterName:'',
+ HEmpID:getUserInfo()['Czybm'],
+ HEmpNumber:uni.getStorageSync("HEmpNumber"),
+ HEmpName:getUserInfo()['Czymc'],
+ HGroupID:0,
+ HGroupNumber:'',
+ HGroupName:'',
+ HMTONo:'',
+ HCheckEmpName:'',
+ HExpiryDate:dayjs(new Date()).format('YYYY-MM-DD'),
+ HExpirationDateFlag:0,
+ HRemark:'',
+ HCoilNO:'',
+ HFurnaceNO:'',
+ HFactory:'',
+ HAuxQty:0,
+ HheatNO:'',
+ HProduceDate:dayjs(new Date()).format('YYYY-MM-DD'),
+ HSPID:0,
+ HSPCode:'',
+ HSPName:'',
+ HWHID:0,
+ HWHCode:'',
+ HWHName:'',
+ HQtyMust:0,
+ HQty:1,
+ HBQty:1,
+ HMinQty:1,
+ HPackQty:0,
+ HPrice:0,
+ HMoney:0,
+ HUseLife:0,
+ HLeaveLife:0,
+ HDesignLife:0,
+
+ //鎵樻潯鐮侊細
+
},
// 鍒嗛〉妯″潡鍏冩暟鎹�
paginationMeta: {
@@ -219,52 +308,7 @@
await this.$nextTick()
this.HBarCodePackFocus = true
},
- toScanCode() {
- MpaasScan.scanCode((scanCode) => {
- this.HBarCode_Pack = scanCode
- this.GetMeesageByBarCode_Pack(HBarCode_Pack)
- })
- },
- GetMeesageByBarCode_Pack(HBarCode_Pack) {
- // 鑾峰彇鎵樻潯鐮佸搴旂殑鏁版嵁
- CommonUtils.doRequest2({
- url: '/WEBSController/Get_PackBarCode_PackUnionBill_Json',
- data: {
- HInterID: this.hform.HInterID || 0,
- HBillNo: this.hform.HBillNo,
- HBillType: this.HBillType,
- HBarCode_Pack: HBarCode_Pack,
- HMaker: getUserInfo()['Czymc'],
- HStockOrgID: uni.getStorageSync('OrganizationID')
- },
- resFunction: (res) => {
- let {
- data,
- count,
- Message,
- list
- } = res.data
- if (count == 1) {
- CommonUtils.playSound(1)
- this.hform.HBillNo = data[0].HBillNo
- this.hform.HInterID = data[0].HInterID
- this.HMaterNumber_Pack = data[0].HMaterNumber
- this.DisBillEntryList();
- uni.showToast({
- icon: 'none',
- title: Message
- })
- } else {
- CommonUtils.playSound(0)
- this.HBarCodePackFocusRefresh()
- uni.showToast({
- icon: 'none',
- title: Message
- })
- }
- }
- })
- },
+
toScanCode2() {
MpaasScan.scanCode((scanCode) => {
this.HBarCode = scanCode
@@ -277,13 +321,6 @@
let sOldBarCode = this.HBarCode
let HDeleteFlag = sOldBarCode.substring(0, 1)
let sBarCode = sOldBarCode.slice(1)
- if (!HBarCode_Pack) {
- return uni.showToast({
- icon: 'none',
- title: '鎵樻潯鐮佷笉鑳戒负绌猴紝璇峰厛鎵弿鎵樻潯鐮侊紒',
- })
- }
-
if (HDeleteFlag == '*') {
if (!sBarCode) {
return uni.showToast({
@@ -327,13 +364,15 @@
})
}
CommonUtils.doRequest2({
- url: '/WEBSController/Get_BarCode_PackUnionBill_Json',
+ url: '/WEBSController/get_BarCode_PackUnionBill_New_Json_xiaowei',
data: {
"HInterID": this.hform.HInterID,
"HBarCode": sBarCode,
"HBillType": this.HBillType,
+ "HBillSubType":this.HBillSubType,
+ "HBarCode_Pack":'',
"HBillNo": this.hform.HBillNo,
- "HBarCode_Pack": HBarCode_Pack,
+ "HMaterNumber_Pack":this.HMaterNumber_Pack,
"HMaker": this.hform.HMaker,
"HStockOrgID": this.hform.HStockOrgID
},
@@ -345,6 +384,8 @@
} = res.data
if (count == 1) {
CommonUtils.playSound(1)
+ console.log(sBarCode)
+ this.FindMaterial(sBarCode)
this.HBarCodeFocusRefresh()
this.DisBillEntryList()
} else {
@@ -359,6 +400,34 @@
})
}
},
+ FindMaterial(sBarCode)
+ {
+ CommonUtils.doRequest2({
+ url: '/Gy_Material/findMaterialByNumber',
+ data: {
+ "HbarCode": sBarCode,
+ "HSTOCKORGID": this.HStockOrgID,
+ },
+ resFunction: (res) => {
+ let {
+ count,
+ data,
+ Message
+ } = res.data
+ if (count == 1) {
+ console.log(res.data)
+ this.hform.HMaterID=data[0].HMaterID
+ this.hform.HMaterName=data[0].HMaterName
+ this.hform.HMaterModel=data[0].HMaterModel
+ }else {
+ uni.showToast({
+ icon: 'none',
+ title: Message
+ })
+ }
+ }
+ })
+ },
DisBillEntryList() {
CommonUtils.doRequest2({
url: '/WEBSController/GetBillEntry_Tmp_Pack_Json',
@@ -492,58 +561,128 @@
}
})
},
- cmdSubmit() {
- let checkRes = this.submitPreCheck()
- if (!checkRes) {
- return
- }
- this.EnableSubmit = false
- CommonUtils.doRequest2({
- url: '/WEBSController/set_SavePackUnionBill_Json',
- data: {
- "HInterID": this.hform.HInterID,
- "HBillType": this.HBillType,
- "HBillNo": this.hform.HBillNo,
- "HBarCode_Pack": this.HBarCode_Pack,
- "HMaker": this.hform.HMaker,
- "HStockOrgID": this.hform.HStockOrgID
- },
- resFunction: (res) => {
- let {
- data,
- count,
- Message
- } = res.data
- if (count == 1) {
- uni.showModal({
- title: '娓╅Θ鎻愮ず',
- content: Message,
- confirmText: "鏂板",
- cancelText: '鍏抽棴',
- success: ({
- confirm,
- cancel
- }) => {
- if (confirm) {
- uni.redirectTo({
- url: "/pages/zutuosaoma/form"
- })
- }
-
- if (cancel) {
- uni.navigateBack()
- }
- }
- })
- } else {
- uni.showToast({
- icon: 'none',
- title: Message
- })
- }
- }
- })
- },
+ getBarCode_pack() {
+ return new Promise((resolve, reject) => {
+ var sMainStr = JSON.stringify(this.hform);
+ var omain = sMainStr + ';' + this.hform.HStockOrgName + ';' + this.hform.HEmpName;
+
+ CommonUtils.doRequest2({
+ url: '/Sc_BarCode/Sub_SaveBill_xiaowei',
+ method: 'POST',
+ data: {
+ "msg": omain
+ },
+ resFunction: (res) => {
+ let { data, count, Message } = res.data;
+ if (count == 1) {
+ console.log('鏉$爜鐢熸垚鎴愬姛:', res.data.data[0]['鏉$爜缂栧彿']);
+ this.HBarCode_Pack = res.data.data[0]['鏉$爜缂栧彿'];
+ resolve(this.HBarCode_Pack); // 瑙f瀽Promise
+ } else {
+ uni.showToast({
+ icon: 'none',
+ title: Message || '鏉$爜鐢熸垚澶辫触'
+ });
+ this.EnableSubmit = true;
+ reject(Message);
+ }
+ },
+ errorFunction: (error) => {
+ console.error('璇锋眰澶辫触:', error);
+ uni.showToast({
+ icon: 'none',
+ title: '缃戠粶璇锋眰澶辫触'
+ });
+ this.EnableSubmit = true;
+ reject(error);
+ }
+ });
+ });
+ },
+ async cmdSubmit() {
+ let checkRes = this.submitPreCheck()
+ if (!checkRes) {
+ return
+ }
+ this.EnableSubmit = false
+
+ try {
+ await this.getBarCode_pack();
+ console.log('鑾峰彇鍒扮殑鏉$爜:', this.HBarCode_Pack);
+
+ // 浣跨敤 await 纭繚鎻愪氦瀹屾垚鍚庡啀鑾峰彇鏁版嵁
+ await CommonUtils.doRequest2({
+ url: '/WEBSController/set_SavePackUnionBill_Json',
+ data: {
+ "HInterID": this.hform.HInterID,
+ "HBillType": this.HBillType,
+ "HBillNo": this.hform.HBillNo,
+ "HBarCode_Pack": this.HBarCode_Pack,
+ "HMaker": this.hform.HMaker,
+ "HStockOrgID": this.hform.HStockOrgID
+ },
+ resFunction: async (res) => {
+ let { data, count, Message } = res.data
+ if (count == 1) {
+ // 绛夊緟鏁版嵁鑾峰彇瀹屾垚鍚庡啀鏄剧ず琛ㄦ牸
+ await this.getResultTableData();
+ } else {
+ uni.showToast({
+ icon: 'none',
+ title: Message
+ })
+ this.EnableSubmit = true;
+ }
+ }
+ })
+ } catch (error) {
+ console.error('鎻愪氦澶辫触:', error);
+ this.EnableSubmit = true;
+ }
+ },
+ getResultTableData() {
+ console.log('寮�濮嬭幏鍙栫粨鏋滄暟鎹紝鏉$爜:', this.HBarCode_Pack);
+
+ CommonUtils.doRequest2({
+ url: '/WEBSController/get_SavePackUnion_xiaowei',
+ data: {
+ "HBarCode_Pack": this.HBarCode_Pack
+ },
+ resFunction: (res) => {
+ console.log('缁撴灉鎺ュ彛杩斿洖:', res);
+ let { data, count, Message } = res.data
+ if (count == 1) {
+ console.log('鑾峰彇鍒扮粨鏋滄暟鎹�:', data);
+ this.resultTableData = data;
+ this.showResultTable = true; // 鏄剧ず缁撴灉琛ㄦ牸
+ console.log('showResultTable 璁剧疆涓�:', this.showResultTable);
+ } else {
+ uni.showToast({
+ icon: 'none',
+ title: Message || '鑾峰彇鏁版嵁澶辫触'
+ })
+ this.EnableSubmit = true;
+ }
+ }
+ })
+ },
+ // 鏂板鏂规硶
+ toAddNew() {
+ // 閲嶇疆鏁版嵁锛屽噯澶囨柊澧�
+ this.showResultTable = false;
+ this.resultTableData = [];
+ this.HBarCode_Pack = '';
+ this.HBarCode = '';
+ this.listData = [];
+ this.getMaxNo(); // 閲嶆柊鑾峰彇鏂扮殑鍗曟嵁鍙�
+ this.HBarCodePackFocusRefresh(); // 閲嶆柊鑱氱劍
+ },
+
+ // 鍏抽棴缁撴灉琛ㄦ牸
+ closeResultTable() {
+ this.showResultTable = false;
+ uni.navigateBack();
+ },
cmdExit() {
uni.navigateBack()
}
@@ -587,7 +726,7 @@
if (this.OperationType == 1) {
this.getMaxNo()
} else if (this.OperationType == 2) {
- this.GetMeesageByBarCode_Pack(this.HBarCode_Pack)
+ // this.GetMeesageByBarCode_Pack(this.HBarCode_Pack)
this.DisBillEntryList()
this.tabs = 0
}
@@ -723,4 +862,59 @@
color: #fff;
}
}
+ .result-modal {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 9999;
+
+ .modal-mask {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background: rgba(0, 0, 0, 0.5);
+ }
+
+ .modal-content {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 90%;
+ max-width: 700rpx;
+ background: #fff;
+ border-radius: 20rpx;
+ overflow: hidden;
+
+ .modal-header {
+ padding: 30rpx;
+ border-bottom: 1px solid #eee;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ .modal-title {
+ font-size: 32rpx;
+ font-weight: bold;
+ }
+ }
+
+ .modal-body {
+ padding: 30rpx;
+ max-height: 60vh;
+ overflow-y: auto;
+ }
+
+ .modal-footer {
+ padding: 30rpx;
+ border-top: 1px solid #eee;
+ display: flex;
+ align-items: center;
+ }
+ }
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.1