Parcourir la source

非固定比例

shish il y a 3 ans
Parent
commit
e5ac9123be
3 fichiers modifiés avec 58 ajouts et 19 suppressions
  1. 19 6
      ghsApp/src/admin/item/add.vue
  2. 19 6
      ghsApp/src/admin/item/copy.vue
  3. 20 7
      ghsApp/src/admin/item/detail.vue

+ 19 - 6
ghsApp/src/admin/item/add.vue

@@ -29,11 +29,6 @@
           <input v-model="form.discountPrice" placeholder-class="phcolor" class="tui-input" name="discountPrice" @focus="form.discountPrice=''" placeholder="不做特价填0" maxlength="50" type="digit" />
         </tui-list-cell>
 
-        <tui-list-cell class="line-cell" :hover="false">
-          <div class="tui-title">单位比</div>
-          <input v-model="form.ratio" placeholder-class="phcolor" class="tui-input" name="ratio" placeholder="如:1扎=20支,请填写20" maxlength="50" type="number" />
-        </tui-list-cell>
-
 
         <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">库存</div>
@@ -68,6 +63,20 @@
           </picker>
         </tui-list-cell>
 
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">单位比</div>
+          <input v-model="form.ratio" placeholder-class="phcolor" class="tui-input" name="ratio" placeholder="如:1扎=20支,请填写20" maxlength="50" type="number" />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">单位比类型</div>
+          <div class="switch_bx">
+            <switch :checked="form.ratioType == 0 ? true : false" @change="ratioTypeChange" style="transform: scale(0.8,0.8)" />
+            <text v-if="form.ratioType == 0">固定比例</text>
+            <text v-else>模糊比例(显示若干)</text>
+          </div>
+        </tui-list-cell>
+
         <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">每扎重量</div>
           <input v-model="form.weight" placeholder-class="phcolor" class="tui-input" name="weight" placeholder="单位为公斤,参考红玫每扎1.2公斤" maxlength="50" type="digit" />
@@ -203,7 +212,8 @@ export default {
         variety:0,
         smallRatio:1,
         smallShow:0,
-        scanNum:0
+        scanNum:0,
+        ratioType:0
       },
       itemClassSelectedData:{},
       itemClassData:[],
@@ -243,6 +253,9 @@ export default {
     statusChange(e){
       this.form.status = e.detail.value ? 1 : 2;
     },
+    ratioTypeChange(e){
+      this.form.ratioType = e.detail.value ? 0 : 1;
+    },
     delStatusChange(e){
       this.form.delStatus = e.detail.value ? 0 : 1;
     },

+ 19 - 6
ghsApp/src/admin/item/copy.vue

@@ -29,11 +29,6 @@
           <input v-model="form.discountPrice" placeholder-class="phcolor" class="tui-input" name="discountPrice" @focus="form.discountPrice=''" placeholder="不做特价填0" maxlength="50" type="digit" />
         </tui-list-cell>
 
-        <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">单位比</view>
-          <input v-model="form.ratio" placeholder-class="phcolor" class="tui-input" name="ratio" @focus="form.ratio=''" placeholder="如:1扎=20支,请填写20" maxlength="50" type="number" />
-        </tui-list-cell>
-
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">库存</view>
           <input v-model="form.stock" style="width:260upx;" placeholder-class="phcolor" @focus="form.stock=''" @input="changeStock($event)" class="tui-input" name="stock" placeholder="请输入" type="digit"/>
@@ -67,6 +62,20 @@
           </picker>
         </tui-list-cell>
 
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">单位比</view>
+          <input v-model="form.ratio" placeholder-class="phcolor" class="tui-input" name="ratio" @focus="form.ratio=''" placeholder="如:1扎=20支,请填写20" maxlength="50" type="number" />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">单位比类型</div>
+          <div class="switch_bx">
+            <switch :checked="form.ratioType == 0 ? true : false" @change="ratioTypeChange" style="transform: scale(0.8,0.8)" />
+            <text v-if="form.ratioType == 0">固定比例</text>
+            <text v-else>模糊比例(若干支)</text>
+          </div>
+        </tui-list-cell>
+
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">每扎重量</view>
           <input v-model="form.weight" placeholder-class="phcolor" class="tui-input" name="weight" @focus="form.weight=''" placeholder="单位为公斤,参考红玫每扎1.2公斤" maxlength="50" type="digit" />
@@ -202,7 +211,8 @@ export default {
         variety:0,
         smallRatio:1,
         smallShow:0,
-        scanNum:0
+        scanNum:0,
+        ratioType:0
       },
       itemClassSelectedData:{},
       itemClassData:[],
@@ -239,6 +249,9 @@ export default {
     statusChange(e){
       this.form.status = e.detail.value ? 1 : 2;
     },
+    ratioTypeChange(e){
+      this.form.ratioType = e.detail.value ? 0 : 1;
+    },
     delStatusChange(e){
       this.form.delStatus = e.detail.value ? 0 : 1;
     },

+ 20 - 7
ghsApp/src/admin/item/detail.vue

@@ -29,12 +29,6 @@
           <input v-model="form.discountPrice" placeholder-class="phcolor" class="tui-input" name="discountPrice" @focus="form.discountPrice=''" placeholder="不做特价填0" maxlength="50" type="digit" />
         </tui-list-cell>
 
-        <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">单位比</view>
-          <input v-model="form.ratio" disabled="true" placeholder-class="phcolor" @click="$msg('不可修改')" style="color:#CCCCCC;"
-          class="tui-input" name="ratio" placeholder="如:1扎=20支,请填写20" maxlength="50" type="number" />
-        </tui-list-cell>
-
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">库存</view>
           <input v-model="form.stock" style="width:260upx;" placeholder-class="phcolor" @focus="form.stock=''" @input="changeStock($event)" class="tui-input" name="stock" placeholder="请输入" type="digit"/>
@@ -61,6 +55,21 @@
           <view v-if="form.smallUnitId" @click="$msg('不可修改')" style="color:#CCCCCC;width:450upx;height:45upx;">{{ smallUnitSelectedData.name }}</view>
         </tui-list-cell>
 
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">单位比</view>
+          <input v-model="form.ratio" disabled="true" placeholder-class="phcolor" @click="$msg('不可修改')" style="color:#CCCCCC;"
+          class="tui-input" name="ratio" placeholder="如:1扎=20支,请填写20" maxlength="50" type="number" />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">单位比类型</div>
+          <div class="switch_bx">
+            <switch :checked="form.ratioType == 0 ? true : false" @change="ratioTypeChange" style="transform: scale(0.8,0.8)" />
+            <text v-if="form.ratioType == 0">固定比例</text>
+            <text v-else>模糊比例(若干支)</text>
+          </div>
+        </tui-list-cell>
+
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">每扎重量</view>
           <input v-model="form.weight" disabled="true" placeholder-class="phcolor" @click="$msg('不可修改')" style="color:#CCCCCC;"
@@ -228,7 +237,8 @@ export default {
         variety:0,
         smallRatio:1,
         smallShow:0,
-        frontHide:0
+        frontHide:0,
+        ratioType:0
       },
       itemClassSelectedData:{},
       itemClassData:[],
@@ -334,6 +344,9 @@ export default {
     statusChange(e){
       this.form.status = e.detail.value ? 1 : 2;
     },
+    ratioTypeChange(e){
+      this.form.ratioType = e.detail.value ? 0 : 1;
+    },
     delStatusChange(e){
       this.form.delStatus = e.detail.value ? 0 : 1;
     },