Bläddra i källkod

商品管理 盲豆划线价

DELL 3 år sedan
förälder
incheckning
3d552b1e72
2 ändrade filer med 38 tillägg och 4 borttagningar
  1. 27 3
      src/views/business/goods/add.vue
  2. 11 1
      src/views/business/goods/components/spec.vue

+ 27 - 3
src/views/business/goods/add.vue

@@ -119,6 +119,20 @@
             </el-input>
           </el-form-item>
         </el-col>
+        <el-col :span="23">
+          <el-form-item label="回收折扣:" prop="discountRate">
+            <el-input v-model="addData.discountRate" type="number" placeholder="请输入回收折扣">
+              <template slot="append">%</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="23">
+          <el-form-item label="盲豆划线价:" >
+            <el-input v-model="addData.originPrice" type="number" placeholder="请输入盲豆数量">
+              <template slot="append">盲豆</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
         <el-col :span="23">
           <el-form-item label="采购价格:" prop="cost">
             <el-input v-model="addData.cost" type="number" placeholder="请输入商品采购价格">
@@ -192,7 +206,8 @@ export default {
       goodsTagItemsList: [],
       addData: {
         multiSku: 0,
-        description: ''
+        description: '',
+        originPrice: 0
       },
       createShow:false,
       rules: {
@@ -210,6 +225,15 @@ export default {
           { required: true,message:'请输入盲豆数量', trigger: 'blur' },
           { pattern: /^([1-9]\d*)$/, message: "请输入正确盲豆数量", trigger: ["blur", "change"] }
         ],
+        discountRate: [
+          { required: true,message:'请输入回收折扣', trigger: 'blur' },
+          {
+            pattern:
+              /^([1-9]\d*(\.\d{1,2})?|([0](\.([0][1-9]|[1-9]\d{0,1}))))$/,
+            message: "请输入合法的数字,最多两位小数",
+            trigger: ["blur", "change"],
+          },
+        ],
         cost: [
           { required: false, message: '请输入采购价格', trigger: 'blur' },
           { pattern: /^([1-9]\d*(\.\d{1,2})?|([0](\.([0][1-9]|[1-9]\d{0,1}))))$/, message: "请输入正确的金额,最多两位小数", trigger: ["blur", "change"] }
@@ -254,11 +278,11 @@ export default {
     this.getGoodsTagItems()
     if (this.id) {
       getGoodsDetail(this.id).then(res => {
-        const { goodsId, title, goodsCode, picUrl,merchantInfo, exchangeShow, multiSku, value, exchangePrice, cost, quantity, description, skuList, categoryId, supplierId, shoppingLink, tagIds } = res.data
+        const { goodsId, title, goodsCode, picUrl,merchantInfo, exchangeShow, multiSku, value, exchangePrice, originPrice, discountRate, cost, quantity, description, skuList, categoryId, supplierId, shoppingLink, tagIds } = res.data
         this.addData = {
           value: accDiv(value, 100),
           cost: cost == '' || cost == null ? '' : accDiv(cost, 100),
-          goodsId, title, goodsCode, picUrl,merchantInfo, exchangeShow, multiSku, exchangePrice, quantity, description, skuList, categoryId, supplierId, shoppingLink, tagIds
+          goodsId, title, goodsCode, picUrl,merchantInfo, exchangeShow, multiSku, exchangePrice, discountRate, originPrice, quantity, description, skuList, categoryId, supplierId, shoppingLink, tagIds
         }
         if(description) {
           this.$refs.editor.setContent(description)

+ 11 - 1
src/views/business/goods/components/spec.vue

@@ -40,6 +40,7 @@
           <th rowspan="2" class="required"><span>*</span>名称</th>
           <th rowspan="2" class="required"><span>*</span>价格(元)</th>
           <th rowspan="2" class="required"><span>*</span>兑换盲豆数量</th>
+          <th rowspan="2">盲豆划线价</th>
           <th rowspan="2">采购价格(元)</th>
           <th rowspan="2">SKU编码</th>
           <th rowspan="2" class="required"><span>*</span>库存</th>
@@ -74,6 +75,12 @@
               <el-input v-model="sku.exchange" />
             </el-form-item>
           </td>
+<!--          1111111111111111111111-->
+          <td class="pd">
+            <el-form-item :prop="`skuList.${index}.originPrice`">
+              <el-input v-model="sku.originPrice" />
+            </el-form-item>
+          </td>
           <td class="pd">
             <el-form-item :prop="`skuList.${index}.costY`" :rules="costYRules">
               <el-input v-model="sku.costY" />
@@ -169,6 +176,7 @@ export default {
       this.skuList = sku.map(item => {
         this.$set(item, 'valueY', accDiv(item.value, 100))
         this.$set(item, 'exchange', accDiv(item.exchangePrice,1))
+        this.$set(item, 'originPrice', accDiv(item.originPrice,1))
         this.$set(item, 'costY', item.cost == null ? '' : accDiv(item.cost, 100) )
         this.$set(item, 'picUrlArr', item.picUrl.split(',').map(item => { return { fileName: item }}))
         this.$set(item, 'status', !!item.quantity)
@@ -265,6 +273,7 @@ export default {
           valueY: 0.00,
           costY: '',
           skuCode:'',
+          originPrice: 0,
           quantity: 0,
           status: true,
           properties
@@ -300,9 +309,10 @@ export default {
       this.$refs.sku.validate((valid, items) => {
         if (valid) {
           this.skuList.forEach(item => {
-            const { valueY,exchange, costY } = item
+            const { valueY,exchange, costY, originPrice } = item
             item.value = accMul(valueY, 100)
             item.exchangePrice = accMul(exchange, 1)
+            item.originPrice = accMul(originPrice, 1)
             item.cost = costY == '' ? '' : accMul(costY, 100)
             item.picUrl = item.picUrlArr.map(item => { return item.fileName }).toString()
           })