Forráskód Böngészése

商品管理 盲豆划线价,回收折扣

DELL 3 éve
szülő
commit
db8f17b2a0

+ 15 - 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" class="required"><span>*</span>回收折扣</th>
           <th rowspan="2">盲豆划线价</th>
           <th rowspan="2">采购价格(元)</th>
           <th rowspan="2">SKU编码</th>
@@ -76,6 +77,12 @@
             </el-form-item>
           </td>
 <!--          1111111111111111111111-->
+          <td>
+            <el-form-item :prop="`skuList.${index}.discountRate`" :rules="discountRateRules">
+              <!--              <p>{{ (sku.valueY * 10).toFixed(0) }}</p>-->
+              <el-input v-model="sku.discountRate" />
+            </el-form-item>
+          </td>
           <td class="pd">
             <el-form-item :prop="`skuList.${index}.originPrice`">
               <el-input v-model="sku.originPrice" />
@@ -140,6 +147,10 @@ export default {
       exchangeRules: [
         { required: true,message:'请输入盲豆数量', trigger: 'blur' },
         { pattern: /^([1-9]\d*)$/, message: "请输入正确的盲豆数量", trigger: ["blur", "change"] }
+      ],
+      discountRateRules: [
+        { 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"] }
       ]
     }
   },
@@ -177,6 +188,7 @@ export default {
         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, 'discountRate', accDiv(item.discountRate,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)
@@ -274,6 +286,7 @@ export default {
           costY: '',
           skuCode:'',
           originPrice: 0,
+          discountRate: '',
           quantity: 0,
           status: true,
           properties
@@ -309,10 +322,11 @@ export default {
       this.$refs.sku.validate((valid, items) => {
         if (valid) {
           this.skuList.forEach(item => {
-            const { valueY,exchange, costY, originPrice } = item
+            const { valueY,exchange, costY, originPrice, discountRate } = item
             item.value = accMul(valueY, 100)
             item.exchangePrice = accMul(exchange, 1)
             item.originPrice = accMul(originPrice, 1)
+            item.discountRate = accMul(discountRate, 1)
             item.cost = costY == '' ? '' : accMul(costY, 100)
             item.picUrl = item.picUrlArr.map(item => { return item.fileName }).toString()
           })

+ 8 - 2
src/views/business/ticket/create.vue

@@ -22,8 +22,11 @@
           <el-form-item label="图片" prop="picUrl">
             <Upload v-model="ticketPicUrl" :limit="3" @change="$refs.form.validateField(['picUrl'])"/>
           </el-form-item>
-          <div class="tip">
-            请上传图片,png格式;线上盲票第1张为奖品图,第2张为主题图,第3张为奖品和主题的合成图(尺寸长宽比1:1);线下盲票仅需上传盲票图
+          <div class="tip" v-if="form.type != 'offline'">
+            请上传图片,jpg、png格式;线上盲票第1张为奖品图,第2张为主题图,第3张为奖品和主题的合成图(尺寸长宽比1:1);线下盲票仅需上传盲票图
+          </div>
+          <div class="tip" v-else>
+            上传1张图片,支持jpg、png格式上传,大小不超过200k;
           </div>
           <el-form-item label="面值" prop="facePrice">
             <el-input
@@ -59,6 +62,9 @@
               <template slot="append">元</template>
             </el-input>
           </el-form-item>
+          <div class="tip">
+            划线价为0或不填,则不显示划线价
+          </div>
           <el-form-item label="盲票总数" prop="quantity">
             <el-input
               v-model="form.quantity"