Procházet zdrojové kódy

Merge branch 'develop_yh50' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh50

lilei před 6 měsíci
rodič
revize
ca2254f862

+ 12 - 9
src/views/salesManagement/salesQueryNew/edit.vue

@@ -361,7 +361,6 @@ export default {
     },
     // 添加活动产品成功的回调,刷新产品列表
     refashTableData (type) {
-      console.log(type, 'refashTableData')
       // 如果是活动产品
       if (type == 'promo') {
         // 刷新正常产品列表
@@ -463,12 +462,6 @@ export default {
             }
           })
           _this.spinning = false
-          // 售价是否低于参考成本价
-        } else if (vaildActive && vaildActive.length) {
-          _this.spinning = false
-          _this.tempData.salesPromoDetailEntityList = vaildActive
-          _this.tempData.message = '共' + vaildActive.length + '款产品售价小于等于0'
-          _this.openVaildPriceModal = true
         } else {
           _this.submitOrder(data)
         }
@@ -484,8 +477,18 @@ export default {
       this.spinning = true
       const res = await salesWriteSubmit(data)
       if (res.status == 200) {
-        this.handleBack()
-        this.$message.success(res.message)
+        // 售价是否低于参考成本价
+        if (res.data && res.data.length) {
+          const objData = {
+            salesPromoDetailEntityList: res.data,
+            message: '共' + res.data.length + '款产品售价小于等于0'
+          }
+          this.tempData = objData
+          this.openVaildPriceModal = true
+        } else {
+          this.handleBack()
+          this.$message.success(res.message)
+        }
       }
       this.spinning = false
     },

+ 6 - 4
src/views/salesManagement/salesQueryNew/vaildPriceModal.vue

@@ -68,7 +68,7 @@ export default {
     dataList () {
       const list = this.dataObj && this.dataObj.salesPromoDetailEntityList || []
       list.map(item => {
-        item.totalAmount = item.promotionPrice * item.qty
+        item.totalAmount = this.modalType == 0 ? item.promotionPrice * item.qty : item.totalAmount
         item.totalCostAmount = item.showCost * item.qty
         item.totalKsAmount = item.totalAmount - item.totalCostAmount
       })
@@ -79,16 +79,18 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center', customRender: function (text, row, index) { return index + 1 } },
         { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'promotionPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '销售数量', dataIndex: 'qty', width: '10%', align: 'center', isShow: false, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'product.unit', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '售价小计', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
-
       ]
       if (_this.modalType == 0) {
         arr.splice(2, 0, { title: '参考成本价', dataIndex: 'showCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(3, 0, { title: '售价', dataIndex: 'promotionPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(5, 0, { title: '单位', dataIndex: 'product.unit', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         arr.push({ title: '参考成本价小计', dataIndex: 'totalCostAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '亏损金额', dataIndex: 'totalKsAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      } else {
+        arr.splice(2, 0, { title: '售价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(4, 0, { title: '单位', dataIndex: 'productEntity.unit', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }