Просмотр исходного кода

特价 花材修改成本价和售价 欠款支付灵活显示 搜索点击优化

shish 4 лет назад
Родитель
Сommit
a83df2d319

+ 1 - 2
ghsApp/src/admin/billing/index.vue

@@ -7,9 +7,8 @@
 			<view style="float:right">
 				<button class="admin-button-com middle blue" @click="removeMemory()">清除花材</button>
 			</view>
-
 		</view>
-		
+
 		<view class="scroll-middle_bx">
 
 			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop" >

+ 42 - 12
ghsApp/src/admin/item/detail.vue

@@ -12,6 +12,7 @@
             name="name"
             placeholder="请填写名称"
             @input="fillName($event)"
+            @focus="form.name=''"
             maxlength="50"
             type="text"
           />
@@ -96,13 +97,28 @@
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
-          <div class="tui-title">每扎成本</div>
+          <div class="tui-title">售价</div>
           <input
-            v-model="form.cost"
+            v-model="form.price"
             placeholder-class="phcolor"
             class="tui-input"
-            name="cost"
-            placeholder="请填写成本价"
+            name="price"
+            @focus="form.price=''"
+            placeholder="请填写售价"
+            maxlength="50"
+            type="digit"
+          />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">特价</div>
+          <input
+            v-model="form.discountPrice"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="discountPrice"
+            @focus="form.discountPrice=''"
+            placeholder="填0表示特价"
             maxlength="50"
             type="digit"
           />
@@ -116,6 +132,7 @@
             class="tui-input"
             name="addPrice"
             placeholder="请填写加价"
+            @focus="form.addPrice=''"
             maxlength="50"
             type="digit"
           />
@@ -129,6 +146,7 @@
             class="tui-input"
             name="weight"
             placeholder="单位:公斤"
+            @focus="form.weight=''"
             maxlength="50"
             type="digit"
           />
@@ -142,6 +160,7 @@
             class="tui-input"
             name="stockWarning"
             placeholder="请填写"
+            @focus="form.stockWarning=''"
             maxlength="50"
             type="number"
           />
@@ -213,8 +232,9 @@ export default {
         bigUnitId:1,
         smallUnitId:2,
         classId:'',
-        cost:'',
+        price:'',
         addPrice:'',
+        discountPrice:'',
         weight:'',
         cover:'',
         stockWarning:'',
@@ -308,9 +328,9 @@ export default {
         this.form.status = 1
         this.form.delStatus = 0
         this.form.id = 0
-        this.form.cost = ''
+        this.form.price = ''
         this.form.addPrice =''
-
+        this.form.discountPrice = ''
       })
     },
     getDetail() {
@@ -322,6 +342,7 @@ export default {
           this.form[i] = res.data[i];
         });
 
+        this.form.price = res.data.prePrice
         this.form.cover = [res.data.shortCover]
 
         this.itemClassSelectedData = this.itemClassData.filter(
@@ -397,8 +418,12 @@ export default {
 					uni.showToast({title:"请填写库存,没有请填0",icon:"none"})
 					return;
 				}
-				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.cost) == false){
-					uni.showToast({title:"请填写成本价",icon:"none"})
+				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.discountPrice) == false){
+					uni.showToast({title:"请填写特价,没有特价请填0",icon:"none"})
+					return;
+				}
+				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.price) == false){
+					uni.showToast({title:"请填写售价",icon:"none"})
 					return;
 				}
 				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.addPrice) == false){
@@ -458,14 +483,19 @@ export default {
           msg: ["请填写单位比"]
         },
         {
-          name: "cost",
+          name: "price",
           rule: ["required"],
-          msg: ["请填写成本价"]
+          msg: ["请填写价"]
         },
         {
           name: "addPrice",
           rule: ["required"],
-          msg: ["请填写加价"]
+          msg: ["请填写每扎加价"]
+        },
+        {
+          name: "discountPrice",
+          rule: ["required"],
+          msg: ["不做特价请填0"]
         },
         {
           name: "weight",

+ 2 - 2
ghsApp/src/components/module/app-commodity.vue

@@ -6,8 +6,8 @@
 		<view class="cmd-info_bx">
 			<view class="tit" >{{ info.itemName || "" }}</view>
 			<view class="kc num-open_bx flex-end" v-if="type == COMMODITY_TYPE.COMMON">
-				<view class="price csss" v-if="!offPrice">¥{{ info.price }}</view>
-				<view class="price" v-else></view>
+				<view class="price csss" v-if="Number(info.discountPrice)>0 && Number(info.discountPrice)<Number(info.price)">¥{{ info.discountPrice }}</view>
+				<view class="price csss" v-else>¥{{ info.price }}</view>
 				<view style="text-align: right" >
 					<view class="open-bx" >
 						<i class="iconfont iconjian" :class="delAnimationData?'animation':''" @click.stop="delEvent" v-if="bigCount > 0 || smallCount > 0"></i>

+ 0 - 1
ghsApp/src/components/module/app-search.vue

@@ -110,7 +110,6 @@ export default {
 			});
 		},
 		inputEmptyFn(e) {
-			return
 			this.search = '';
 			this.$emit("input", this.search);
 		}

+ 2 - 2
hdApp/src/admin/billing/affirmGhs.vue

@@ -486,8 +486,8 @@ export default {
 				success: function (res) {
 					if (res.confirm) {
 						createOrder(parameter).then(res => {
-							const {data: { orderSn,realPrice,count }} = res;
-							self.pageTo({url: `/pagesPurchase/wechatPay?type=2&orderSn=${orderSn}&realPrice=${realPrice}&count=${count}`, type: 2})
+							const {data: { orderSn,realPrice,count,hasDebtPay }} = res;
+							self.pageTo({url: `/pagesPurchase/wechatPay?type=2&orderSn=${orderSn}&realPrice=${realPrice}&count=${count}&hasDebtPay=${hasDebtPay}`, type: 2})
 							setTimeout(() => {
 								uni.removeStorageSync('selectCouponInfo')
 								self.resetSelectInfoByType(self.pageType);

+ 6 - 11
hdApp/src/components/module/app-commodity.vue

@@ -7,13 +7,14 @@
 			<view class="tit" >{{ info.itemName || "" }}</view>
 			<view class="kc num-open_bx flex-space" v-if="type == COMMODITY_TYPE.COMMON">
 				<view v-if="!offPrice">
-					<view class="flex-space" style="margin-bottom: 50rpx;margin-top:15rpx" v-if="isDiscounts&&Number(oldPrice)>Number(info.price)">
+					<view class="flex-space" style="margin-bottom: 50rpx;margin-top:15rpx" v-if="Number(info.discountPrice)>0 && Number(info.discountPrice)<Number(info.price)">
 						<view style="padding:3rpx 10rpx 3rpx 10rpx;text-align: center;color: red;border: 1px solid red;margin-right: 20rpx;line-height: 1;font-size: 20rpx">
-							{{((Number(info.price)/Number(oldPrice)).toFixed(2)*10).toFixed(1)+'折'}}
+							{{((Number(info.discountPrice)/Number(info.price)).toFixed(2)*10).toFixed(1)+'折'}}
 						</view>
-						<text style="text-decoration:line-through;color:#A9A9A9">¥{{oldPrice}}</text>
+						<text style="text-decoration:line-through;color:#A9A9A9">¥{{info.price}}</text>
 					</view>
-					<view class="price" >¥{{ info.price }}</view>
+					<view v-if="Number(info.discountPrice)>0 && Number(info.discountPrice)<Number(info.price)" class="price" >¥{{ info.discountPrice }}</view>
+					<view v-else class="price" >¥{{ info.price }}</view>
 				</view>
 
 				<view class="price" v-else></view>
@@ -36,7 +37,7 @@
 
 				<view class="open-bx" style="padding-bottom: 40rpx" >
 					<allSelectInput :inputType="'digit'" :isActive="isAloneAllActive" :isFocus="isAloneAllFocus" :value="changeAutoPrice" :placeholder="'自动调价'"
-																					@deleteInputVal="deleteInputVal" @initAllInput="initAloneAllInput" @moveAllInput="moveAllInput">
+									@deleteInputVal="deleteInputVal" @initAllInput="initAloneAllInput" @moveAllInput="moveAllInput">
 					</allSelectInput>
 					<!--<input class="change-input" v-model="changeAutoPrice" type="digit" placeholder="自动调价"  selection-start="0" selection-end="1" />-->
 					<i :class="isShowSucceed?'position iconfont iconjihuo':'position'" ></i>
@@ -98,10 +99,6 @@ export default {
 			type: Boolean,
 			default: false
 		},
-		isDiscounts: {
-			type: Boolean,
-			default: false
-		},
 	},
 	data() {
 		return {
@@ -113,7 +110,6 @@ export default {
 			isShowSucceed:false,
 			changeAutoPrice:'',
 			showPrice:0.00,
-			oldPrice:0.00,
 			ifFocus:false,
 			showMaxStock:230,//囤货时显示的最大库存
 		};
@@ -127,7 +123,6 @@ export default {
 			this.changeAutoPrice = this.info.price
 		}
 		this.showPrice = this.info.price;
-		this.oldPrice = (Number(this.info.cost) + Number(this.info.addPrice)).toFixed(2)
 	},
 	methods: {
 		//input点击删除按键

+ 0 - 1
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -46,7 +46,6 @@
 								<Commondity v-if="classItem.isActive"
 									:info="productItem"
 									:offVerifyRepertory="true"
-									:isDiscounts="false"
 									:bigCount="getSelectItemById(productItem.id, classItem.classId).bigCount"
 									:smallCount="getSelectItemById(productItem.id, classItem.classId).smallCount"
 									@customNum="customNum"

+ 5 - 3
hdApp/src/pagesPurchase/wechatPay.vue

@@ -27,7 +27,7 @@
             <button
               class="button-com green pay-wx"
               @click="postponePay"
-              v-if="type === '2'"
+              v-if="hasDebtPay === '1'"
             >延期支付</button>
             <button
               class="button-com green pay-wx"
@@ -44,7 +44,7 @@
             <button
               class="button-com default pay-wx"
               disabled="true"
-              v-if="type === '2'"
+              v-if="hasDebtPay === '1'"
             >延期支付</button>
             <button
               class="button-com default pay-wx"
@@ -100,13 +100,15 @@ export default {
       realPrice: '',
       _type: '1',
       pageId: '',
-      count:10
+      count:10,
+      hasDebtPay:0
     };
   },
   onLoad (options) {
     this.orderSn = options.orderSn;
     this.realPrice = options.realPrice;
     this.type = options.type
+    this.hasDebtPay = options.hasDebtPay
     let that = this
     this.count = options.count
     let t =setInterval(function(){