shish 4 anni fa
parent
commit
719335f4b9

+ 78 - 9
ghsApp/src/admin/home/pda.vue

@@ -21,17 +21,30 @@
                   <view class="info-line">
                     <text class="item-type"></text>
                     <text class="item-count">
-                      <text v-if="item.bigCount > 0 || item.smallCount > 0">{{`${item.bigCount}`}}</text>
-                      <text v-if="item.smallCount > 0">/</text>
-                      <text v-if="item.smallCount > 0">{{`${item.smallCount}`}}</text>
+
+
+
+					<view class="open-bx" >
+						<i class="iconfont iconjian" :class="delAnimationData?'animation':''" @click.stop="delEvent(info.variety)" v-if="item.bigCount > 0 || item.smallCount > 0"></i>
+						<text class="num" >
+							<text v-if="item.bigCount > 0 || smallCount > 0">{{ `${item.bigCount}` }}</text>
+							<text v-if="item.smallCount > 0">/</text>
+							<text v-if="item.smallCount > 0">{{ `${item.smallCount}` }}</text>
+						</text>
+						<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click.stop="addEvents(info.variety)"></i>
+					</view>
+
+
+
+
                     </text>
                   </view>
                 </view>
               </view>
             </view>
             <view class="summary-bar">
-              <view class="operate-view" @click="gobackEvent">
-                <text class="iconfont icongouwuche"></text>重选花材
+              <view class="operate-view" @click="removeMemory()">
+                <text class="iconfont iconshanchu1"></text>清除花材
               </view>
               <view class="describe-view">
                 共{{ selectList.length }}种,合计 ¥<text class="price">{{ allPrice }}</text>
@@ -41,9 +54,10 @@
         </view>
         <view class="module-com input-line-wrap">
 					<view class="" v-if="isBilling">
-          <tui-list-cell class="line-cell" :hover="false" :arrow="false" @click="selectCustom">
+          <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectCustom">
             <view class="tui-title">客户</view>
-            <view class="tui-input">{{ form.customName }}</view>
+            <view class="tui-input" v-if="form.customId" >{{ form.customName }}</view>
+            <view class="tui-placeholder" style="width: 100%" v-else >请选择客户</view>
           </tui-list-cell>
 
           <tui-list-cell class="line-cell" :hover="false" :arrow="false">
@@ -219,6 +233,7 @@ export default {
       this._getDet();
     },
     selectCustom(){
+      this.$util.pageTo({ url: '/admin/custom/selectCustom',query: {style:2}})
     },
 		payWayChange(e){
 			let index = e.detail.value
@@ -438,6 +453,61 @@ export default {
               .item-count {
                 color: #666;
                 font-size: 24upx;
+
+			& .open-bx {
+				display: flex;
+				align-items: center;
+				& .iconfont {
+					//margin-left: 15upx;
+					color: #3385ff;
+					font-size: 42upx;
+				}
+
+				.position{
+					display: block;
+					width: 70upx;
+					text-align: center;
+				}
+				.iconcachu {
+					margin: 0 6px 0 20upx;
+					color: #ccc;
+					&.edit {
+						color: #3385ff;
+					}
+				}
+				& > .num {
+					display: inline-block;
+					width: 120upx;
+					height:45upx;
+					text-align:center;
+					margin: 0 8upx;
+					color: #868686;
+					border-radius: 22upx;
+					background-color: #f5f5f5;
+					padding: 3px 0;
+					font-size: 25upx;
+				}
+				.change-input {
+					width: 164upx;
+					height: 60upx;
+					line-height: 60upx;
+					text-align: center;
+					background: #ffffff;
+					border: 1px solid #dddddd;
+					border-radius: 4upx;
+					font-size: 25upx;
+				}
+				.btn-box{
+					width: 100upx;
+					height: 60upx;
+					line-height: 60upx;
+					color: #ffffff;
+					background: #3385ff;
+					text-align: center;
+					border-radius: 10upx;
+				}
+			}
+
               }
             }
           }
@@ -524,8 +594,7 @@ export default {
     width: 100%;
     height: 100upx;
     background-color: #fff;
-
-    box-shadow: 0px -1px 6px 0px rgba(4, 0, 0, 0.06);
+    box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
     .price-view {
       display: flex;
       align-items: center;

+ 43 - 109
ghsApp/src/admin/home/workbench.vue

@@ -3,7 +3,7 @@
 		<!-- 今日概况 -->
 		<div class="user-wrap">
 			<div class="user-top">
-				<div class="app-size-28">今日概况</div>
+				<div class="app-size-28">今日概况</div><text @click="pageTo({url:'/admin/home/pda'})">PDA开单</text>
 			</div>
 			<div class="income-amount">
 				<div>收入金额</div>
@@ -108,6 +108,8 @@ import noneHd from "@/components/none-hd";
 import loginModel from "@/components/login-model";
 import {appLogin} from '@/api/common'
 import { getDictionaries } from '@/api/mini'
+import { allProduct } from '@/api/product'
+import productMins from "@/mixins/product";
 export default {
 	name: "admin-workbench",
 	components: {
@@ -117,6 +119,7 @@ export default {
     	noneHd,
 		loginModel,
 	},
+	mixins: [productMins],
 	data() {
 		return {
 			getappIdList: {},
@@ -134,116 +137,31 @@ export default {
 				}
 			},
 			orderData: [
-				{
-					name: "待付款",
-					url: "/admin/home/order",
-					type: 4,
-					query: {
-						tabIndex: 1
-					},
-					value: 0
-				},
-				{
-					name: "待配送",
-					value: 0,
-					url: "/admin/home/order",
-					type: 4,
-					query: {
-						tabIndex: 2
-					}
-				},
-				{
-					name: "配送中",
-					value: 0,
-					url: "/admin/home/order",
-					type: 4,
-					query: {
-						tabIndex: 3
-					}
-				}
+				{ name: "待付款", url: "/admin/home/order", type: 4, query: { tabIndex: 1 }, value: 0 },
+				{ name: "待配送", value: 0, url: "/admin/home/order", type: 4, query: { tabIndex: 2 } },
+				{ name: "配送中", value: 0, url: "/admin/home/order", type: 4, query: { tabIndex: 3 } }
 			],
 			tabsData: [
-				{
-					name: "商城",
-					img: 'ghs/home/shop.png',
-					url: "/admin/home/mall"
-				},
-				{
-					name: "改价",
-					img: 'ghs/home/gj.png',
-					url: "/admin/changePrice/list"
-				},
-				{
-					name: "供应商",
-					img: 'ghs/home/icon_ghs.png',
-					url: "/pagesPurchase/supplier"
-				},
-				{
-					name: "报损单",
-					img: 'ghs/home/kcyjs.png',
-					url: "/admin/breakage/list"
-				},
-				{
-					name: "库存预警",
-					img: 'ghs/home/kcyjs.png',
-					url: "/pagesStorehouse/stockWarn/manage"
-				},
-				{
-					name: "花材",
-					img: 'ghs/home/hcgl.png',
-					url: "/admin/item/list"
-				},
-				{
-					name: "调拨出库",
-					img: 'ghs/home/dbck.png',
-					url: "/pagesStorehouse/allot/allotEx"
-				},
-				{
-					name: "调拨入库",
-					img: 'ghs/home/dbrk.png',
-					url: "/pagesStorehouse/allot/allotPut"
-				}
+				{ name: "商城", img: 'ghs/home/shop.png', url: "/admin/home/mall" },
+				{ name: "改价", img: 'ghs/home/gj.png', url: "/admin/changePrice/list" },
+				{ name: "供应商", img: 'ghs/home/icon_ghs.png', url: "/pagesPurchase/supplier" },
+				{ name: "报损单", img: 'ghs/home/kcyjs.png', url: "/admin/breakage/list" },
+				{ name: "库存预警", img: 'ghs/home/kcyjs.png', url: "/pagesStorehouse/stockWarn/manage" },
+				{ name: "花材", img: 'ghs/home/hcgl.png', url: "/admin/item/list" },
+				{ name: "调拨出库", img: 'ghs/home/dbck.png', url: "/pagesStorehouse/allot/allotEx" },
+				{ name: "调拨入库", img: 'ghs/home/dbrk.png', url: "/pagesStorehouse/allot/allotPut" }
 			],
 			totalData: [
-				{
-					name: "客户数",
-					value: 0,
-					url:'/admin/home/member',
-					type:4
-				},
-				{
-					name: "总访客",
-					value: 0,
-					url:'/admin/custom/visit',
-					type:1,
-				},
-				{
-					name: "总订单",
-					value: 0,
-					url:'/admin/home/order',
-					type:4
-				},
-				{
-					name: "总收入(元)",
-					value: 0.00,
-					url:'/pagesStore/me/incomeExpenses',
-					type:1
-				},
-				{
-					name: "总支出(元)",
-					value: 0.00,
-					url:'/pagesStore/me/incomeExpenses',
-					type:1
-				},
-				{
-					name: "总采购(元)",
-					value: 0.00,
-					url:'/admin/statistics/cgStat',
-					type:1
-				}
+				{ name: "客户数", value: 0, url:'/admin/home/member', type:4 },
+				{ name: "总访客", value: 0, url:'/admin/custom/visit', type:1, },
+				{ name: "总订单", value: 0, url:'/admin/home/order', type:4 },
+				{ name: "总收入(元)", value: 0.00, url:'/pagesStore/me/incomeExpenses', type:1 },
+				{ name: "总支出(元)", value: 0.00, url:'/pagesStore/me/incomeExpenses', type:1 },
+				{ name: "总采购(元)", value: 0.00, url:'/admin/statistics/cgStat', type:1 }
 			],
 			skSrc: `${this.$constant.imgUrl}/ghs/home/sk.jpg`,
-			pfSrc: `${this.$constant.imgUrl}/ghs/home/pf.jpg`
+			pfSrc: `${this.$constant.imgUrl}/ghs/home/pf.jpg`,
+			allProduct:[]
 		};
 	},
 	onShareAppMessage(res) {
@@ -270,6 +188,7 @@ export default {
 	},
 	onLoad(option) {
 
+		// #ifdef APP-PLUS
 		//pda扫码开单
 		let that = this
 		var main = plus.android.runtimeMainActivity(); //获取activity
@@ -280,7 +199,11 @@ export default {
 		var filter = new IntentFilter();
 		filter.addAction("nlscan.action.SCANNER_RESULT"); //监听扫描
 		main.registerReceiver(receiver, filter); //注册监听
+		// #endif
 
+		allProduct().then(res=>{
+			this.allProduct = res.data.list
+		})
 
 	},
 	onPullDownRefresh() {
@@ -291,20 +214,31 @@ export default {
 	},
 	methods: {
 		...mapActions(['setUserShopAll']),
+
+		// #ifdef APP-PLUS
 		//pda扫码开单
 		doReceive(context, intent) {
 			//通过intent实例引入intent类,方便以后的'.'操作
 			plus.android.importClass(intent)
-			var barcodeBytes1 = intent.getStringExtra("SCAN_BARCODE1")
-			console.log(barcodeBytes1)
+			var productIdCode = intent.getStringExtra("SCAN_BARCODE1")
+			let that = this
+			this.allProduct.forEach(function(product,index,array){
+				if(product.id == productIdCode){
+					console.log(product)
+					that.kdType = 'PDA'
+					product.userPrice = product.bigPrice
+					that.addEvent(product)
+				}
+			});
+
 			var pages = getCurrentPages()
 			let currentRoute  = pages[pages.length-1].route;
 			if(currentRoute != 'admin/home/pda'){
 				this.$util.pageTo({url: '/admin/home/pda'})
-			}else{
-				console.log('vvvvvvv')
 			}
 		},
+		// #endif
+
 		loginFun(mobile,password){
 
 			//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login

+ 5 - 0
ghsApp/src/api/product/index.js

@@ -74,4 +74,9 @@ export const py = data => {
 //生成价格表 shish 20210922
 export const generatePriceTable = data => {
 	return https.get("/product/generate-price-table", data);
+};
+
+//所有花材
+export const allProduct = data => {
+	return https.get("/product/all", data);
 };

+ 2 - 2
ghsApp/src/constant/index.js

@@ -4,9 +4,9 @@ import { ProjectName,APIHOST,IMGHOST } from '@/config'
 const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
 // #endif
 
-//#ifdef APP-PLUS
+// #ifdef APP-PLUS
 const extConfig = {apiHost:APIHOST,imgHost:IMGHOST,}
-//#endif
+// #endif
 
 // 常量索引
 const envVal = {

+ 69 - 40
ghsApp/src/mixins/product.js

@@ -6,7 +6,7 @@ export default {
 		return {
 			pageType: "bill", //选择商品页面类别  用于区分不同功能的数据
 			isCut:false,
-			productInfo: [], //商品信息
+			productInfoList: [], //商品信息
 			classIndex: 0, //当前商品类别下标
 			py: "", //拼音搜索条件
 			type: "", //库存预警时,固定为waring,其他情况不传或者传空
@@ -17,7 +17,8 @@ export default {
 			top_list:'',
 			//id动态切换
 			scroll_into_view:"",
-			timeFun:""
+			timeFun:"",
+			kdType:''//开单方式,notPDA PDA
 		};
 	},
 	onLoad(options) {
@@ -34,11 +35,10 @@ export default {
 			return this.getSelectInfo[this.pageType] || [];
 		},
 		scrollClassId() {
-			const curClass = this.productInfo[this.classIndex];
+			const curClass = this.productInfoList[this.classIndex];
 			if (curClass) {
 				return `class_${curClass.classId}`;
 			}
-
 			return "";
 		},
 		//选择商品总价
@@ -147,16 +147,26 @@ export default {
 		},
 		//清除已记忆花材
 		removeMemory(customId){
-			if(customId){
-				uni.removeStorageSync('selectList'+this.pageType+'_custom_'+customId);
-
-				//删除小菊的记忆
-				uni.removeStorageSync("xj"+customId)
+			let that = this
+			uni.showModal({
+				title: '提示',
+				content: '确认清除花材?',
+				success: function (res) {
+					if (res.confirm) {
+
+						if(customId){
+							uni.removeStorageSync('selectList'+that.pageType+'_custom_'+customId);
+							//删除小菊的记忆
+							uni.removeStorageSync("xj"+customId)
+						}else{
+							uni.removeStorageSync('selectList'+that.pageType);
+						}
+						that.resetSelectInfoByType(that.pageType);
+						that.$msg('已清除')
 
-			}else{
-				uni.removeStorageSync('selectList'+this.pageType);
-			}
-			this.resetSelectInfoByType(this.pageType);
+					}
+				}
+			});
 		},
 		//请求商品数据
 		async initData(extendInfo) {
@@ -181,7 +191,7 @@ export default {
 							child.userPrice = 0;
 						});
 				});
-				this.productInfo = data;
+				this.productInfoList = data;
 				//修改花材
 				if(this.option.modifyProductKey){
 					if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
@@ -234,7 +244,7 @@ export default {
 		},
 		//滚动或切换分类 获取更多数据
 		scrollPushList(){
-			let list = copyObject(this.productInfo);
+			let list = copyObject(this.productInfoList);
 			let classList = [];
 			for (let i=0;i<list.length;i++){
 				if(i<2){
@@ -294,8 +304,8 @@ export default {
 			};
 
 			const productItem =
-				this.productInfo &&
-				this.productInfo.find(ele => {
+				this.productInfoList &&
+				this.productInfoList.find(ele => {
 					return ele.classId == classId;
 				});
 			if (productItem && productItem.child) {
@@ -338,7 +348,25 @@ export default {
 									list[index] = { ...element, bigCount: ++element.bigCount };
 								}
 							}else{
-								this.$msg("库存不足");
+
+//没有库存声音提醒
+const innerAudioContext = uni.createInnerAudioContext();
+innerAudioContext.autoplay = true;
+innerAudioContext.src = `${this.$constant.imgUrl}/noStock.mp3`;
+innerAudioContext.onPlay(() => {
+  console.log('开始播放');
+});
+innerAudioContext.onError((res) => {
+  console.log(res.errMsg);
+  console.log(res.errCode);
+});
+innerAudioContext.onPause(function() {
+	console.log('end');
+	innerAudioContext.destroy();
+});
+
+
+								this.$msg("库存不足!");
 								return;
 							}
 						} else {
@@ -352,13 +380,10 @@ export default {
 							const { bigCount, smallCount } = list[index];
 							//超过库存时 设置为库存最大值
 							const ratio = Number(item.ratio);
-							if (
-								Number(bigCount) * ratio + Number(smallCount) >
-								Number(item.bigNum) * ratio + Number(item.smallNum)
-							) {
+							if (Number(bigCount) * ratio + Number(smallCount) >Number(item.bigNum) * ratio + Number(item.smallNum)) {
 								list[index].bigCount = Number(item.bigNum);
 								list[index].smallCount = Number(item.smallNum);
-								this.$msg("库存不足");
+								this.$msg("库存不足。");
 							}
 						}
 					}
@@ -367,16 +392,24 @@ export default {
 			}
 			if (!has) {
 				let info = { classId: item.classId, id: item.id };
-				const classInfo =
-					this.productInfo &&
-					this.productInfo.find(element => {
-						return element.classId == item.classId && element.child;
-					});
-				if (classInfo) {
-					info = classInfo.child.find(ele => {
-						return ele.id == item.id;
-					});
+
+				if(this.kdType == 'notPDA'){
+
+					const classInfo =
+						this.productInfoList &&
+						this.productInfoList.find(element => {
+							return element.classId == item.classId && element.child;
+						});
+					if (classInfo) {
+						info = classInfo.child.find(ele => {
+							return ele.id == item.id;
+						});
+					}
+
+				}else if(this.kdType == 'PDA'){
+					info = item
 				}
+
 				let params = {
 					...info,
 					bigCount: this.isSmallCount?0:1, //扎数
@@ -389,7 +422,7 @@ export default {
 					if(this.offVerifyRepertory){//盘点页面没有库存验证
 						list.push(params);
 					}else{
-						this.$msg("库存不足");
+						this.$msg("库存不足..");
 						return;
 					}
 				}
@@ -403,12 +436,8 @@ export default {
 				}
 			});
 
-			console.log('花材列表',list)
-
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 
-			console.log('this.selectList',this.selectList)
-
 			//记忆已经选择的花材
 			this.rememberProduct()
 
@@ -419,8 +448,8 @@ export default {
 				let info = { classId: item.classId, id: item.id };
 
 				const classInfo =
-					this.productInfo &&
-					this.productInfo.find(element => {
+					this.productInfoList &&
+					this.productInfoList.find(element => {
 						return element.classId == item.classId && element.child;
 					});
 				if (classInfo) {
@@ -634,7 +663,7 @@ export default {
 		},
 		//搜索对应花材
 		searchFn() {
-			let list = copyObject(this.productInfo);
+			let list = copyObject(this.productInfoList);
 			if(!this.$util.isEmpty(this.py)){
 				//大于等于2个字符才开始搜索 shish 20210622
 				if(this.py.length <=1){

+ 3 - 4
ghsApp/src/mixins/productContrapose.js

@@ -1,5 +1,4 @@
-// import { getProductDataApi } from "@/api/product/index";
-import { getProductDataApi,getAllProductDataApi } from "@/api/product/index";
+import { getAllProductDataApi } from "@/api/product/index";
 import { STOCK_TYPE } from "@/utils/declare";
 import { mapGetters, mapActions } from "vuex";
 import { copyObject } from "@/utils/util";
@@ -7,7 +6,7 @@ export default {
 	data() {
 		return {
 			pageType: "bill", //选择商品页面类别  用于区分不同功能的数据
-			productInfo: [], //商品信息
+			productInfoList: [], //商品信息
 			classIndex: 0, //当前商品类别下标
 			py: "", //拼音搜索条件
 			type: "", //库存预警时,固定为waring,其他情况不传或者传空
@@ -64,7 +63,7 @@ export default {
 			if(this.filterProductInfoContrapose.length==data.totalNum){
 				this.isMore = false;
 			}
-			this.productInfo = data.list;
+			this.productInfoList = data.list;
 			uni.stopPullDownRefresh();
 			uni.hideLoading();
 		},

+ 2 - 4
ghsApp/src/mixins/ptProductContrapose.js

@@ -1,12 +1,10 @@
 import { ptItemList } from "@/api/pt-item/index";
-import { STOCK_TYPE } from "@/utils/declare";
 import { mapGetters, mapActions } from "vuex";
-import { copyObject } from "@/utils/util";
 export default {
 	data() {
 		return {
 			pageType: "ptProductList", //选择商品页面类别  用于区分不同功能的数据
-			productInfo: [], //商品信息
+			productInfoList: [], //商品信息
 			classIndex: 0, //当前商品类别下标
 			py: "", //拼音搜索条件
 			type: "", //库存预警时,固定为waring,其他情况不传或者传空
@@ -58,7 +56,7 @@ export default {
 			if(this.filterProductInfoContrapose.length==data.totalNum){
 				this.isMore = false;
 			}
-			this.productInfo = data.list;
+			this.productInfoList = data.list;
 			uni.stopPullDownRefresh();
 			uni.hideLoading();
 		},

+ 1 - 1
ghsApp/src/pages.json

@@ -1,7 +1,7 @@
 {
 	"pages": [
 		{"path": "admin/home/workbench","style": {"navigationBarTitleText": "","enablePullDownRefresh": true}},
-		{"path": "admin/home/pda","style": {"navigationBarTitleText": "开单","enablePullDownRefresh": true}},
+		{"path": "admin/home/pda","style": {"navigationBarTitleText": "开单","enablePullDownRefresh": false}},
 		{"path": "admin/home/result","style": {"navigationBarTitleText": "","enablePullDownRefresh": true}},
 		{"path": "admin/home/callback","style": {"navigationBarTitleText": "","enablePullDownRefresh": true}},
 		{"path": "admin/home/console","style": {"navigationBarTitleText": ""}},