瀏覽代碼

代码上传

zhangqi 1 年之前
父節點
當前提交
8049461af4
共有 2 個文件被更改,包括 27 次插入19 次删除
  1. 25 15
      src/DRP/SDrpManagement/collection/index.vue
  2. 2 4
      src/DRP/SDrpManagement/shopCart/index.vue

+ 25 - 15
src/DRP/SDrpManagement/collection/index.vue

@@ -143,6 +143,7 @@
   const checkProdsAllowed = async (type) =>{
     const allowAdd = (e)=>{
       if (e.iscustomsize == 1) {
+        console.log(!e.length || !e.width)
         if (!e.length || !e.width) {
           message.error(e.itemname + '定制信息有误,请检查!')
         } else if (e.cheekschemeid > 0 && !e.customcheek) {
@@ -155,7 +156,7 @@
           return {
             sa_orderitemsid:0,
             itemid:e.itemid,
-            qty:e.qty,
+            qty:e.favoritesqty,
             length:e.length ? e.length:0,
             width:e.width ? e.width:0,
             customcolors:e.customcolors ? e.customcolors:0,
@@ -169,7 +170,7 @@
         return {
           sa_orderitemsid:0,
           itemid:e.itemid,
-          qty:e.qty,
+          qty:e.favoritesqty,
           length:0,
           width:0,
           sa_brandid: e.sa_brandid,
@@ -177,7 +178,9 @@
         }
       }
     }
+    console.log(selectProd.value)
     let data = selectProd.value.map(e=>{
+      console.log(e)
       return allowAdd(e)
     })
     if (type == 'order') {
@@ -188,7 +191,7 @@
     
   }
   const onSubmit = (data)=> {
-    if (!checkIscustomsize()) return false
+    // if (!checkIscustomsize()) return false
     if (fieldSame.value) return false
     if (selectProd.value.length == 0)  return message.error('未选择商品无法创建订单')
     Modal.confirm({
@@ -242,16 +245,16 @@
     })
     utils.message(res,'修改成功')
   }
-  const checkIscustomsize = (val)=>{
-    let bool = true
-    selectProd.value.map(e=>{
-      if (e.iscustomsize == 1 && (!e.favoriteslength || !e.favoriteswidth)) {
-        bool = false
-        message.error(e.itemname + '定制信息有误,请检查!')
-      }
-    })
-    return bool
-  }
+  // const checkIscustomsize = (val)=>{
+  //   let bool = true
+  //   selectProd.value.map(e=>{
+  //     if (e.iscustomsize == 1 && (!e.favoriteslength || !e.favoriteswidth)) {
+  //       bool = false
+  //       message.error(e.itemname + '定制信息有误,请检查!!!')
+  //     }
+  //   })
+  //   return bool
+  // }
   const validInput = async (record,min,max,type)=>{
     if (record[type] > max) {
       record[type] = max
@@ -287,7 +290,7 @@
     
   }
   const addCart = async (data)=> {
-    if (!checkIscustomsize()) return false
+    // if (!checkIscustomsize()) return false
     let res = await Api.requested({
       "id": 20231024110003,
       "content": {
@@ -305,7 +308,7 @@
   }
   const handleOk = ()=>{
     prodData.value.record.isselect = true
-    prodlist.value.data.some((item)=>{
+    prod.value.data.some((item)=>{
       if (item.itemid == prodData.value.itemid) {
         item = prodData.value
       }
@@ -414,4 +417,11 @@
   background: #f1f2f3;
   overflow: hidden;
 }
+.label{
+  display:inline-block;
+  margin-right:10px
+}
+.mt-10{
+  margin-bottom:20px
+}
 </style>

+ 2 - 4
src/DRP/SDrpManagement/shopCart/index.vue

@@ -187,9 +187,7 @@
     let data = selectProd.value.map(e=>{
       return allowAdd(e)
     })
-    data.filter(e=>e !== undefined).length > 0 ? onSubmit(data.filter(e=>e !== undefined),'添加成功',()=>{
-      prodlist.value.tableRecord = []
-    }):''
+    data.filter(e=>e !== undefined).length > 0 ? onSubmit(data.filter(e=>e !== undefined)):''
   }
   const onSubmit = (data)=> {
     if (fieldSame.value) return false
@@ -255,7 +253,7 @@
   }
   const handleOk = ()=>{
     prodData.value.record.isselect = true
-    prodlist.value.data.some((item)=>{
+    prod.value.data.some((item)=>{
       if (item.itemid == prodData.value.itemid) {
         item = prodData.value
       }