购物车历史订单增加,代码优化

This commit is contained in:
GaoHao
2025-04-02 09:20:26 +08:00
parent 5a655ba09e
commit 5e6646b574
31 changed files with 418 additions and 357 deletions

View File

@@ -64,7 +64,7 @@
<script setup>
import { ref, computed, reactive, getCurrentInstance } from 'vue';
import { ref, computed, reactive } from 'vue';
import { onShow, onLoad } from '@dcloudio/uni-app';
import go from '@/commons/utils/go.js';
import dayjs from 'dayjs';
@@ -94,7 +94,6 @@
console.log(options)
datas.item = JSON.parse(options.item)
datas.form = Object.assign(datas.form, datas.item)
console.log(datas.form)
// 单位列表
datas.unitList = [ datas.form.conUnit, datas.form.conUnitTwo]
datas.form.bodyList.unit = datas.form.defaultUnit
@@ -104,8 +103,6 @@
onShow(() => {
getList()
})
const refs = getCurrentInstance()
function toggle() {
go.to('PAGES_ADD_SUPPLIER')
@@ -149,17 +146,11 @@
let sumbit = uni.$utils.debounce(() => {
if (!datas.form.bodyList.inOutNumber) {
refs.ctx.$refs.uToastRef.show({
type: 'default',
message: "请输入必填项",
})
uni.$utils.showToast("请输入必填项")
return
}
if (!datas.form.bodyList.purchasePrice) {
refs.ctx.$refs.uToastRef.show({
type: 'default',
message: "请输入必填项",
})
uni.$utils.showToast("请输入必填项")
return
}
@@ -172,10 +163,7 @@
vendorId: datas.list[nowStatusIndex.value].id,
amountPayable: datas.form.bodyList[0].inOutNumber * datas.form.bodyList[0].purchasePrice,
}).then(res => {
refs.ctx.$refs.uToastRef.show({
type: 'default',
message: "保存成功",
})
uni.$utils.showToast("保存成功")
setTimeout(() => {
go.back()
}, 1000)