diff --git a/src/pages/order/create.vue b/src/pages/order/create.vue
index c304fa0..5361d4c 100644
--- a/src/pages/order/create.vue
+++ b/src/pages/order/create.vue
@@ -22,7 +22,14 @@
@@ -136,30 +143,6 @@
-
-
-
-
-
@@ -205,10 +188,8 @@ export default {
selectCustomer(e) {
this.selectedCustomer = this.customers[e.detail.value]
},
- addProduct() {
- this.$refs.productPopup.open()
- },
- selectProduct(product) {
+ onProductSelect(e) {
+ const product = this.productList[e.detail.value]
// 检查是否已添加
const exists = this.orderItems.find(item => item.productId === product.productId)
if (exists) {
@@ -218,6 +199,12 @@ export default {
this.orderItems.push({
productId: product.productId,
+ productName: product.name,
+ price: product.price,
+ quantity: 1
+ })
+ this.calcAmount()
+ },
productName: product.name,
spec: product.spec,
unit: product.unit,
@@ -226,7 +213,6 @@ export default {
})
this.calcAmount()
- this.$refs.productPopup.close()
},
removeItem(index) {
this.orderItems.splice(index, 1)
@@ -499,39 +485,4 @@ export default {
border-radius: 40rpx;
font-size: 28rpx;
}
-
-.product-popup {
- background: #fff;
- height: 60vh;
- border-radius: 24rpx 24rpx 0 0;
-}
-
-.popup-header {
- display: flex;
- justify-content: space-between;
- padding: 24rpx;
- border-bottom: 1rpx solid #eee;
-}
-
-.popup-search {
- padding: 20rpx;
-}
-
-.popup-search input {
- height: 60rpx;
- background: #f5f5f5;
- border-radius: 8rpx;
- padding: 0 20rpx;
-}
-
-.popup-list {
- height: calc(60vh - 140rpx);
-}
-
-.popup-item {
- display: flex;
- justify-content: space-between;
- padding: 24rpx;
- border-bottom: 1rpx solid #f5f5f5;
-}