Explorar el Código

花材管理优化

shish hace 2 años
padre
commit
f79c1e76e4

+ 16 - 11
ghsApp/src/admin/item/add.vue

@@ -58,6 +58,20 @@
           </picker>
         </tui-list-cell>
 
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">比例类型</div>
+          <radio-group class="tui-input" @change="ratioTypeChange">
+            <label class="list" for="fixedLink">
+              <radio id="fixedLink" value="0" :checked="form.ratioType == 0" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">固定</span>
+            </label>
+            <label class="list" for="dimLink">
+              <radio id="dimLink" value="1" :checked="form.ratioType == 1" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">模糊(若干支)</span>
+            </label>
+          </radio-group>
+        </tui-list-cell>
+
         <tui-list-cell class="line-cell" :arrow="true">
           <div class="tui-title">大单位</div>
           <picker mode="selector" :value="form.bigUnitId" :range="unitData" range-key="name" @change="changeBigUnitFn" class="tui-input" >
@@ -76,20 +90,11 @@
           </picker>
         </tui-list-cell>
 
-        <tui-list-cell class="line-cell" :hover="false">
+        <tui-list-cell class="line-cell" :hover="false" v-if="form.ratioType == 0">
           <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" />
@@ -304,7 +309,7 @@ export default {
       this.form.status = e.detail.value ? 1 : 2;
     },
     ratioTypeChange(e){
-      this.form.ratioType = e.detail.value ? 0 : 1;
+      this.form.ratioType = e.detail.value
     },
     //如果库存被修改则花材状态变化
     changeStock(event){

+ 23 - 11
ghsApp/src/admin/item/copy.vue

@@ -58,6 +58,20 @@
           </picker>
         </tui-list-cell>
 
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">比例类型</div>
+          <radio-group class="tui-input flex-center-between" @change="ratioTypeChange">
+            <label class="list" for="fixedLink">
+              <radio id="fixedLink" value="0" :checked="form.ratioType == 0" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">固定</span>
+            </label>
+            <label class="list" for="dimLink">
+              <radio id="dimLink" value="1" :checked="form.ratioType == 1" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">模糊(若干支)</span>
+            </label>
+          </radio-group>
+        </tui-list-cell>
+
         <tui-list-cell class="line-cell" :arrow="true">
           <div class="tui-title">大单位</div>
           <picker mode="selector" :value="form.bigUnitId" :range="unitData" range-key="name" @change="changeBigUnitFn" class="tui-input">
@@ -76,20 +90,11 @@
           </picker>
         </tui-list-cell>
 
-        <tui-list-cell class="line-cell" :hover="false">
+        <tui-list-cell class="line-cell" :hover="false" v-if="form.ratioType == 0">
           <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" />
@@ -140,6 +145,11 @@
             <input v-model="form.skMore" placeholder-class="phcolor" class="tui-input" name="skMore" @focus="form.skMore=''" placeholder="在成本价基础上多卖的金额" type="digit" />
           </tui-list-cell>
 
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">排序值</view>
+            <input v-model="form.inTurn" placeholder-class="phcolor" class="tui-input" name="inTurn" @focus="form.inTurn=''" placeholder="请填写金额" type="number" />
+          </tui-list-cell>
+
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">拆散单价</view>
           <input v-model="form.smallRatio" @focus="form.smallRatio=''" placeholder-class="phcolor" class="tui-input" name="smallRatio" placeholder="请填写" maxlength="50" 
@@ -192,6 +202,7 @@ export default {
         skPrice:'',
         hjPrice:'',
         skMore:6,
+        inTurn:100,
         addPrice:3,
         hjAddPrice:2,
         discountPrice:0,
@@ -306,7 +317,7 @@ export default {
       this.form.status = e.detail.value ? 1 : 2;
     },
     ratioTypeChange(e){
-      this.form.ratioType = e.detail.value ? 0 : 1;
+      this.form.ratioType = e.detail.value
     },
     //如果库存被修改则花材状态变化
     changeStock(event){
@@ -370,6 +381,7 @@ export default {
         this.form.hjAddPrice = 3
         this.form.discountPrice = 0
         this.form.cost = 0
+        this.form.inTurn = 100
       })
     },
     getDetail() {

+ 36 - 24
ghsApp/src/admin/item/detail.vue

@@ -54,7 +54,7 @@
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">库存</view>
+          <view class="tui-title" style="color:#3385FF;font-weight:bold;">库存</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"/>
           <button v-if="productData.id > 0" class="admin-button-com blue middle" @click="goStockDetail(productData)">库存变动记录</button>
         </tui-list-cell>
@@ -67,6 +67,21 @@
             <view class="tui-placeholder" style="height:45upx;" v-else>请选择</view>
           </picker>
         </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">比例类型</div>
+          <radio-group class="tui-input" @change="ratioTypeChange">
+            <label class="list" for="fixedLink">
+              <radio id="fixedLink" value="0" :checked="form.ratioType == 0" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">固定</span>
+            </label>
+            <label class="list" for="dimLink">
+              <radio id="dimLink" value="1" :checked="form.ratioType == 1" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">模糊(若干支)</span>
+            </label>
+          </radio-group>
+        </tui-list-cell>
+
         <tui-list-cell class="line-cell" :arrow="false">
           <view class="tui-title">大单位</view>
           <input v-model="form.bigUnitId" name="bigUnitId" type="text" hidden />
@@ -79,24 +94,15 @@
           <view v-if="form.smallUnitId" @click="$msg('请联系客服修改')" style="width:450upx;color:#CCCCCC;height:45upx;">{{ smallUnitSelectedData.name }}</view>
         </tui-list-cell>
 
-        <tui-list-cell class="line-cell" :arrow="false">
+        <tui-list-cell class="line-cell" :arrow="false" v-if="form.ratioType == 0">
           <view class="tui-title">单位比</view>
-          <input v-model="form.ratio" disabled="true" placeholder-class="phcolor" @click="$msg('请联系客服修改')" style="width:450upx;color:#CCCCCC;"
+          <input v-model="form.ratio" disabled="true" placeholder-class="phcolor" @click="$msg('不可修改')" style="width:450upx;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" :arrow="false">
           <view class="tui-title">每扎重量</view>
-          <input v-model="form.weight" disabled="true" placeholder-class="phcolor" @click="$msg('请联系客服修改')" style="width:450upx;color:#CCCCCC;"
+          <input v-model="form.weight" disabled="true" placeholder-class="phcolor" @click="$msg('不可修改')" style="width:450upx;color:#CCCCCC;"
           class="tui-input" name="weight" placeholder="单位为公斤" maxlength="50" type="digit" />
         </tui-list-cell>
 
@@ -108,7 +114,6 @@
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">上架状态</view>
           <view class="switch_bx">
-            <switch :checked="form.status == 2 ? false : true" @change="statusChange" style="transform: scale(0.8,0.8)" />
             <text v-if="form.status == 1">上架</text>
             <text v-else>下架</text>
           </view>
@@ -167,12 +172,19 @@
           </tui-list-cell>
 
           <tui-list-cell class="line-cell" :hover="false">
-            <view class="tui-title">虚拟库存</view>
-            <view class="switch_bx">
-              <switch :checked="form.virtualStock == 0 ? false : true" @change="virtualStockChange" style="transform: scale(0.8,0.8)" />
-              <text v-if="form.virtualStock == 0">关闭</text>
-              <text v-else>开启</text>
-            </view>
+            <view class="tui-title">库存类型</view>
+
+            <radio-group class="tui-input" @change="virtualStockChange">
+            <label class="list" for="realLink">
+              <radio id="realLink" value="0" :checked="form.virtualStock == 0" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">真实</span>
+            </label>
+            <label class="list" for="virLink">
+              <radio id="virLink" value="1" :checked="form.virtualStock == 1" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">虚拟</span>
+            </label>
+          </radio-group>
+
           </tui-list-cell>
 
       </view>
@@ -401,6 +413,9 @@ export default {
 				}
 			})
 		},
+    ratioTypeChange(e) {
+      this.form.ratioType = e.detail.value;
+    },
     fastSubmit(){
       this.dialogInputConfirm({index: 1})
     },
@@ -417,7 +432,7 @@ export default {
 				this.$util.pageTo({url: "/pagesStorehouse/stockWarn/detailed?id="+item.id+'&name='+item.name})
 		},
     virtualStockChange(e){
-      this.form.virtualStock = e.detail.value ? 1 : 0;
+      this.form.virtualStock = e.detail.value
     },
     frontHideChange(e){
       this.form.frontHide = e.detail.value ? 1 : 0;
@@ -428,9 +443,6 @@ export default {
         this.form.stock = 0
       }
     },
-    ratioTypeChange(e){
-      this.form.ratioType = e.detail.value ? 0 : 1;
-    },
     changeStock(event){
       let num = Number(event.target.value)
       if(num > 0){

+ 1 - 1
ghsApp/src/api/product/index.js

@@ -78,7 +78,7 @@ export const addProduct = data => {
 	return https.post("/product/add", data);
 };
 
-//复制花材
+//复制新建花材
 export const cloneProduct = data => {
 	return https.post("/product/clone", data);
 };

+ 1 - 1
ghsApp/src/pages.json

@@ -398,7 +398,7 @@
 				{"path": "list","style": {"navigationBarTitleText": "花材列表"}},
 				{"path": "detail","style": {"navigationBarTitleText": "花材详情"}},
 				{"path": "add","style": {"navigationBarTitleText": "添加花材"}},
-				{"path": "copy","style": {"navigationBarTitleText": "复制花材"}},
+				{"path": "copy","style": {"navigationBarTitleText": "复制新建花材"}},
 				{"path": "xj","style": {"navigationBarTitleText": "请选择颜色"}},
 				{"path": "xjSelect","style": {"navigationBarTitleText": "多颜色"}},
 				{"path": "presell","style": {"navigationBarTitleText": "预售管理"}},

+ 1 - 1
ghsApp/src/pagesPurchase/add.vue

@@ -29,7 +29,7 @@
 							{{ classItem.className }}
 						</view>
 						<template v-for="(productItem, productIndex) in classItem.child">
-							<view style="height: 180upx" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
+							<view style="height:250upx" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
 							<CommodityPurchase v-if="classItem.isActive"
 								:type="selectJobType"
 								:key="productIndex"

+ 61 - 30
ghsApp/src/pagesPurchase/components/CommodityPurchase.vue

@@ -1,39 +1,46 @@
 <template>
-  <view class="item-cmd_bx" @click="showAddModelFn">
-			<view class="img_bx" style="background:#eeeeee"> <image :src="info.cover" lazy-load="true" :lazy-load-margin="0"></image> </view>
-    <view class="cmd-info_bx">
-      <view class="tit">
-				<text style="font-size:22upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;" 
-				v-if="info.frontHide && info.frontHide == 1">隐</text>
-				<text style="font-size:22upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;" 
-				v-if="info.presell == 1">预售</text>
-        {{ info.name || "" }} 
-      </view>
-      <view class="num-open_bx">
-        <view class="price" style="position:absolute;top:105upx;">¥{{ parseFloat(info.price) }}</view>
-        <view style="position: relative;top:-14upx;">
-           <view class="kc">
-           <block v-if="info.ratioType == 0">{{info.ratio}}{{ info.smallUnit }}/{{info.bigUnit}}</block>
-           <block v-else>若干{{ info.smallUnit }}/{{info.bigUnit}}</block>
-           </view>
+  <view class="product">
+    <view class="item-cmd_bx" @click="showAddModelFn">
+      <view class="img_bx" style="background:#eeeeee"> <image :src="info.cover" lazy-load="true" :lazy-load-margin="0"></image> </view>
+      <view class="cmd-info_bx">
+        <view class="tit">
+          <text style="font-size:22upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;" 
+          v-if="info.frontHide && info.frontHide == 1">隐</text>
+          <text style="font-size:22upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;" 
+          v-if="info.presell == 1">预售</text>
+          {{ info.name || "" }} 
         </view>
-        <view>
-          <view class="open-bx">
-            <i class="iconfont iconjian" @click.stop="delItemFn" v-if="bigCount > 0 || smallCount > 0" ></i>
-            <text class="num" @click.stop="showAddModelFn" >
-              <text v-if="bigCount > 0 || smallCount > 0">{{ `${bigCount}` }}</text>
-              <text v-if="smallCount > 0">/</text>
-              <text v-if="smallCount > 0">{{ `${smallCount}` }}</text>
-            </text>
-            <i class="iconfont iconzeng" @click.stop="showAddModelFn" ></i>
+        <view class="num-open_bx">
+          <view class="price" style="position:absolute;top:105upx;">¥{{ parseFloat(info.price) }}</view>
+          <view style="position: relative;top:-14upx;">
+            <view class="kc">
+            <block v-if="info.ratioType == 0">{{info.ratio}}{{ info.smallUnit }}/{{info.bigUnit}}</block>
+            <block v-else>若干{{ info.smallUnit }}/{{info.bigUnit}}</block>
+            </view>
           </view>
-          <view class="price">
-            <text class="unit">还剩 {{ parseFloat(info.stock) }}</text>
+          <view>
+            <view class="open-bx">
+              <i class="iconfont iconjian" @click.stop="delItemFn" v-if="bigCount > 0 || smallCount > 0" ></i>
+              <text class="num" @click.stop="showAddModelFn" >
+                <text v-if="bigCount > 0 || smallCount > 0">{{ `${bigCount}` }}</text>
+                <text v-if="smallCount > 0">/</text>
+                <text v-if="smallCount > 0">{{ `${smallCount}` }}</text>
+              </text>
+              <i class="iconfont iconzeng" @click.stop="showAddModelFn" ></i>
+            </view>
+            <view class="price">
+              <text class="unit">还剩 {{ parseFloat(info.stock) }}</text>
+            </view>
           </view>
         </view>
       </view>
     </view>
-  </view>
+
+    <text class="bottom-button" @click.stop="copyCreate(info)">复制新建</text>
+    <text class="bottom-button" @click.stop="goToStockDetail(info)">库存明细</text>
+    <text class="bottom-button" @click.stop="goDetail(info)">修改花材</text>
+
+</view>
 </template>
 <script>
 export default {
@@ -77,6 +84,18 @@ export default {
 		this.userPrice = this.info.userPrice
   },
   methods: {
+		doPrintLabel(item,type){
+			this.$msg('开发中')
+		},
+		copyCreate(item){
+			this.pageTo({url: '/admin/item/copy?id='+item.id})
+		},
+    goDetail(item){
+      this.$util.pageTo({url: "/admin/item/detail?id="+item.id})
+    },
+		goToStockDetail(item){
+			this.$util.pageTo({url: "/pagesStorehouse/stockWarn/detailed?id="+item.id+'&name='+item.name})
+		},
     delItemFn () {
       this.info.bigCount = 0
       this.info.smallCount = 0
@@ -89,6 +108,19 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
+.product{
+	height:230upx;
+}
+.bottom-button{
+	font-weight:normal;
+	border:2upx solid #cccccc;
+	font-size:24upx;
+	border-radius: 20upx;
+	padding:13upx 20upx 13upx 20upx;
+	margin:0 15upx 0 0;
+	float:right;
+	color:#aaa9a9;
+}
 .item-cmd_bx {
   position: relative;
   margin-bottom: 20upx;
@@ -105,7 +137,6 @@ export default {
   }
   .cmd-info_bx {
     padding-left: 167upx;
-    margin-bottom: 40upx;
     & .tit {
       font-size: 32upx;
       font-weight: 700;