shish 3 лет назад
Родитель
Сommit
04cacdd33f

+ 1 - 1
ghsApp/src/admin/home/workbench.vue

@@ -189,8 +189,8 @@ export default {
 				{ name: "改价", img: 'ghs/home/gj.png', url: "/admin/changePrice/list" },
 				{ name: "花材", img: 'ghs/home/hcgl.png', url: "/admin/item/list" },
 				{ name: "采购", img: 'ghs/home/icon_caigou.png', url: "/pagesPurchase/order" },
-				{ name: "拆散", img: 'ghs/home/kcyjs.png', url: "/admin/part/list" },
 				{ name: "损耗", img: 'ghs/home/kcyjs.png', url: "/admin/breakage/list" },
+				{ name: "拆散", img: 'ghs/home/kcyjs.png', url: "/admin/part/list" },
 				{ name: "调拨入库", img: 'ghs/home/dbrk.png', url: "/pagesStorehouse/allot/allotPut" },
 				{ name: "调拨出库", img: 'ghs/home/dbck.png', url: "/pagesStorehouse/allot/allotEx" },
 				{name : "结账记录", img : "ghs/home/kcyjs.png", url : "/admin/clear/customList"},

+ 48 - 35
ghsApp/src/admin/part/confirm.vue

@@ -6,26 +6,28 @@
         <view class="module-com">
           <view class="commodity-view">
             <view class="commodity-list">
-              <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
-                <image class="item-icon" :src="item.cover" alt="商品图" />
-                <view class="item-info">
-                  <view class="info-line">
-                    <text class="item-name">{{ item.itemName }}</text>
-                    <text class="item-price">
-                      <text class="unit"></text>
-                      <text class="price">
-                        <text v-if="item.bigCount > 0">{{`${item.bigCount}`}}扎</text>
-                        <text v-if="item.smallCount > 0">{{`${item.smallCount}`}}支</text>
+              <template v-if="!$util.isEmpty(selectList)">
+                <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
+                  <image class="item-icon" :src="item.cover" />
+                  <view class="item-info">
+                    <view class="info-line">
+                      <text class="item-name">{{ item.name || '' }}</text>
+                      <text class="item-price">
+                        <text class="unit"></text>
+                        <text class="price">
+                          <text v-if="item.bigCount > 0">{{`${item.bigCount}`}}{{item.bigUnit}}</text>
+                          <text v-if="item.smallCount > 0">{{`${item.smallCount}`}}{{item.smallUnit}}</text>
+                        </text>
                       </text>
-                    </text>
-                  </view>
-                  <view class="info-line">
-                    <text class="item-type"></text>
-                    <text class="item-count">
-                    </text>
+                    </view>
+                    <view class="info-line">
+                      <text class="item-type" v-if="item.ratioType == 0">{{item.ratio}}{{item.smallUnit}}/{{item.bigUnit}}</text>
+                      <text class="item-type" v-else>若干{{item.smallUnit}}/{{item.bigUnit}}</text>
+                      <text class="item-count"></text>
+                    </view>
                   </view>
                 </view>
-              </view>
+              </template>
             </view>
             <view class="summary-bar">
               <view class="operate-view" @click="gobackEvent">
@@ -51,9 +53,12 @@
     </view>
     <view class="under-bar">
       <view class="price-view"></view>
-      <button class="admin-button-com blue big" @click="affirmFormSubmit">提交</button>
+      <button class="admin-button-com blue big" style="width:200upx;" @click="affirmFormSubmit">提交</button>
     </view>
 
+    <view v-if="isScanEnv" @click="changeGet" style="width:125upx;height:125upx;display:flex;justify-content:center;align-items:center;font-size:60upx;
+    background:#3385ff;color:white;z-index:9999;position:fixed;bottom:160upx;right:40upx;border-radius:60upx;">{{calc=='add'?'+':'-'}}</view>
+
   </view>
 </view>
 </template>
@@ -68,6 +73,7 @@ import appFormRadioBtn from "@/components/app-formRadio-btn";
 import appAddressGroup from "@/components/app-address-group";
 import appSendTime from "@/components/app-send-time";
 import appFormSend from "@/components/app-form-send";
+const formUtil = require("@/utils/formValidation.js");
 import { partItem } from "@/api/part";
 import { mapActions, mapGetters } from "vuex";
 export default {
@@ -111,8 +117,9 @@ export default {
         needPrint:1,
       },
       money: "",
-      showCustomer: false,
 			selectJobType: "part",
+      calc:'add',
+      isScanEnv:false
     };
   },
   onLoad (option) {
@@ -134,14 +141,19 @@ export default {
     if(option.customName){
       this.form.customName = option.customName
     }
+
+   // #ifdef APP-PLUS
+    if(this.$util.isScanEnv()){
+      this.isScanEnv = true
+    }
+    // #endif
+
+    this.listenScanItem()
+
   },
-	onShow(){
-		if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
-			this.showCustomer = true;
-		}
-	},
 	onUnload(){
-			uni.removeStorageSync('newClient');
+			uni.removeStorageSync('newClient')
+      uni.$off('listenGetScanCode')
 	},
   computed: {
     ...mapGetters(["getMerchantInfo", "getLoginInfo"]),
@@ -150,6 +162,9 @@ export default {
     ...mapActions(["initMerchantInfo"]),
     init () {
       this._getDet();
+    },
+    changeGet(){
+      this.calc = this.calc == 'add' ? 'sub' : 'add'
     },
 		payWayChange(e){
 			let index = e.detail.value
@@ -211,12 +226,12 @@ export default {
           bigNum: ele.bigCount,
           smallNum: ele.smallCount,
           classId: ele.classId,
-          itemId: ele.itemId
+          itemId: ele.itemId,
+          ratio:ele.ratio
         };
       });
       that.$util.confirmModal({content:'确认拆散?'},() => {
           partItem({product:JSON.stringify(product),remark:that.form.remark}).then((res) => {
-            //删除记忆
             that.removeFromSaveDirect()
             const {data: { id, orderSn },} = res;
             that.pageTo({url: '/admin/part/result',type:2})
@@ -271,14 +286,15 @@ export default {
               justify-content: space-between;
               align-items: flex-end;
               .item-name {
-                color: #666;
-                font-size: 28upx;
+                color: #333333;
+                font-size: 32upx;
+                font-weight: bold;
               }
               .item-price {
                 color: #333;
                 font-size: 22upx;
                 .price {
-                  font-size: 32upx;
+                  font-size: 30upx;
                   font-weight: bold;
                 }
               }
@@ -309,8 +325,8 @@ export default {
           font-size: 30upx;
           font-weight:bold;
           .iconfont {
-            margin-right: 20upx;
-            font-size: 40upx;
+            margin-right:10upx;
+            font-size:32upx;
           }
         }
         .describe-view {
@@ -402,9 +418,6 @@ export default {
         }
       }
     }
-    .admin-button-com {
-      width: 200upx;
-    }
   }
 }
 </style>

+ 1 - 1
ghsApp/src/admin/part/index.vue

@@ -163,7 +163,7 @@ export default {
 				this.$msg('请选择花材')
 				return false
 			}
-			this.$util.pageTo({ url: "/admin/breakage/confirm",type:2})
+			this.$util.pageTo({ url: "/admin/part/confirm",type:2})
 		}
 	}
 };

+ 2 - 2
ghsApp/src/admin/part/info.vue

@@ -24,8 +24,8 @@
 				<view class="commodity-view">
 					<view class="commodity-list">
 						<view v-for="(s, idx) in itemList" :key="idx" class="commodity-item" >
-							<image class="item-icon" :src="s.cover" />
-							<view class="item-info">
+							<image class="item-icon" :src="s.cover" @click="pageTo({url:'/admin/item/detail',query:{id: s.productId}})" />
+							<view class="item-info" @click="pageTo({url:'/admin/item/detail',query:{id: s.productId}})">
 								<view class="info-line">
 									<text class="item-name">{{ s.name }}</text>
 									<text class="item-price">