This commit is contained in:
2026-04-05 10:41:05 +08:00
parent 826a698d48
commit 096187418c
3 changed files with 44 additions and 18 deletions

View File

@@ -51,8 +51,10 @@
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="_confirmMore">确认损益</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="handleSubmit">确认损益</button>
</view>
<!-- 放置弹窗组件(用户名密码) -->
<CredentialPopup ref="credentialPopup" />
</view>
</template>
@@ -78,6 +80,21 @@
this.title = options.title
},
methods: {
async handleSubmit() {
if (!this.dataList.length) {
this.disabled = false
return
}
try {
// 显示弹窗,等待用户输入
const { username, password } = await this.$refs.credentialPopup.show();
// 调用原接口,传入账号密码
this._confirmMore(username, password);
} catch (error) {
// 用户取消,不做处理
console.log('用户取消输入');
}
},
handleBlur (e) {
if (e.change_qty) {
if (e.change_qty < 0) {
@@ -115,14 +132,10 @@
this.dataList = []
}
},
async _confirmMore () {
async _confirmMore (username, password) {
this.disabled = true
if (!this.dataList.length) {
this.disabled = false
return
}
try {
let res = await confirmMore(this.dataList)
let res = await confirmMore(username, password, this.dataList)
if (res) {
uni.showToast({
title: res.message,

View File

@@ -64,8 +64,10 @@
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="_confirmPalletAssembly">确认组盘</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="handleSubmit">确认组盘</button>
</view>
<!-- 放置弹窗组件(用户名密码) -->
<CredentialPopup ref="credentialPopup" />
</view>
</template>
@@ -94,6 +96,21 @@
this.title = options.title
},
methods: {
async handleSubmit() {
if (!this.val1 || !this.dataList.length) {
this.disabled = false
return
}
try {
// 显示弹窗,等待用户输入
const { username, password } = await this.$refs.credentialPopup.show();
// 调用原接口,传入账号密码
this._confirmPalletAssembly(username, password);
} catch (error) {
// 用户取消,不做处理
console.log('用户取消输入');
}
},
toScanAdd () {
if (this.bagCode) {
this._getBagAssembly2(this.bagCode)
@@ -157,14 +174,10 @@
} catch (e) {
}
},
async _confirmPalletAssembly () {
async _confirmPalletAssembly (username, password) {
this.disabled = true
if (!this.val1 || !this.dataList.length) {
this.disabled = false
return
}
try {
let res = await confirmPalletAssembly(this.val1, this.dataList)
let res = await confirmPalletAssembly(username, password, this.val1, this.dataList)
if (res) {
uni.showToast({
title: res.message,

View File

@@ -172,9 +172,9 @@ export const getBagAssembly = (bno) => request({
data: {bag_no: bno}
})
// 组盘
export const confirmPalletAssembly = (vcode, arr) => request({
export const confirmPalletAssembly = (username, password, vcode, arr) => request({
url:'api/pdaCommon/confirmPalletAssembly',
data: {vehicle_code: vcode, group_plates: arr}
data: {username: username, password: RSAencrypt(password), vehicle_code: vcode, group_plates: arr}
})
// 物料组桶(组盘管理)共 (1) 个
@@ -268,9 +268,9 @@ export const queryMoreIvt = (vcode) => request({
data: {vehicle_code: vcode}
})
// 确认损益
export const confirmMore = (rows) => request({
export const confirmMore = (username, password, rows) => request({
url:'api/pdaWarehouse/confirmMore',
data: {rows: rows}
data: {username: username, password: RSAencrypt(password), rows: rows}
})
// 虚拟入库(仓储管理)共 (1) 个