shish před 4 roky
rodič
revize
bb4a5b8cec

+ 20 - 54
ghsApp/src/admin/item/add.vue

@@ -16,43 +16,19 @@
 
 
         <tui-list-cell class="line-cell" :hover="false">
         <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">拼音缩写</div>
           <div class="tui-title">拼音缩写</div>
-          <input
-            v-model="form.py"
-            placeholder-class="phcolor"
-            class="tui-input"
-            name="py"
-            placeholder="请填写拼音首字母缩写"
-            maxlength="50"
-            type="text"
-          />
+          <input v-model="form.py" placeholder-class="phcolor" class="tui-input" name="py" placeholder="请填写拼音首字母缩写" maxlength="50" type="text" />
         </tui-list-cell>
         </tui-list-cell>
 
 
         <tui-list-cell class="line-cell" :hover="false">
         <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">花店价</div>
           <div class="tui-title">花店价</div>
-          <input
-            v-model="form.price"
-            placeholder-class="phcolor"
-            class="tui-input"
-            name="price"
-            @focus="form.price=''"
-            placeholder="请填写"
-            maxlength="50"
-            type="digit"
-          />
+          <input v-model="form.price" style="width:140upx;" placeholder-class="phcolor" class="tui-input" name="price" @focus="form.price=''" placeholder="请填写" maxlength="50" type="digit" />
+          <text style="color:#666666;margin-right:20upx;">散客比花店贵:</text>
+          <input v-model="form.skMore" style="width:110upx;" placeholder-class="phcolor" class="tui-input" name="skMore" @focus="form.skMore=''" placeholder="请填写" type="digit" />
         </tui-list-cell>
         </tui-list-cell>
 
 
         <tui-list-cell class="line-cell" :hover="false">
         <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"
-          />
+          <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" />
         </tui-list-cell>
         </tui-list-cell>
 
 
         <tui-list-cell class="line-cell" :hover="false">
         <tui-list-cell class="line-cell" :hover="false">
@@ -63,14 +39,7 @@
 
 
         <tui-list-cell class="line-cell" :arrow="true">
         <tui-list-cell class="line-cell" :arrow="true">
           <div class="tui-title">分类</div>
           <div class="tui-title">分类</div>
-          <picker
-            mode="selector"
-            :value="form.classId"
-            :range="itemClassData"
-            range-key="name"
-            @change="changeItemClassFn"
-            class="tui-input"
-          >
+          <picker mode="selector" :value="form.classId" :range="itemClassData" range-key="name" @change="changeItemClassFn" class="tui-input" >
             <input v-model="form.classId" name="classId" type="text" hidden />
             <input v-model="form.classId" name="classId" type="text" hidden />
             <div v-if="form.classId" style="height:45upx;" >{{ itemClassSelectedData.name }}</div>
             <div v-if="form.classId" style="height:45upx;" >{{ itemClassSelectedData.name }}</div>
             <div class="tui-placeholder" style="height:45upx;" v-else>请选择</div>
             <div class="tui-placeholder" style="height:45upx;" v-else>请选择</div>
@@ -79,14 +48,7 @@
 
 
         <tui-list-cell class="line-cell" :arrow="true">
         <tui-list-cell class="line-cell" :arrow="true">
           <div class="tui-title">大单位</div>
           <div class="tui-title">大单位</div>
-          <picker
-            mode="selector"
-            :value="form.bigUnitId"
-            :range="unitData"
-            range-key="name"
-            @change="changeBigUnitFn"
-            class="tui-input"
-          >
+          <picker mode="selector" :value="form.bigUnitId" :range="unitData" range-key="name" @change="changeBigUnitFn" class="tui-input" >
             <input v-model="form.bigUnitId" name="bigUnitId" type="text" hidden />
             <input v-model="form.bigUnitId" name="bigUnitId" type="text" hidden />
             <div v-if="form.bigUnitId">{{ bigUnitSelectedData.name }}</div>
             <div v-if="form.bigUnitId">{{ bigUnitSelectedData.name }}</div>
             <div class="tui-placeholder" style="height:45upx;" v-else>请选择</div>
             <div class="tui-placeholder" style="height:45upx;" v-else>请选择</div>
@@ -95,14 +57,7 @@
 
 
         <tui-list-cell class="line-cell" :arrow="true">
         <tui-list-cell class="line-cell" :arrow="true">
           <div class="tui-title">小单位</div>
           <div class="tui-title">小单位</div>
-          <picker
-            mode="selector"
-            :value="form.smallUnitId"
-            :range="unitData"
-            range-key="name"
-            @change="changeSmallUnitFn"
-            class="tui-input"
-          >
+          <picker mode="selector" :value="form.smallUnitId" :range="unitData" range-key="name" @change="changeSmallUnitFn" class="tui-input" >
             <input v-model="form.smallUnitId" name="smallUnitId" type="text" hidden />
             <input v-model="form.smallUnitId" name="smallUnitId" type="text" hidden />
             <div v-if="form.smallUnitId">{{ smallUnitSelectedData.name }}</div>
             <div v-if="form.smallUnitId">{{ smallUnitSelectedData.name }}</div>
             <div class="tui-placeholder" v-else>请选择</div>
             <div class="tui-placeholder" v-else>请选择</div>
@@ -247,6 +202,7 @@ export default {
         smallUnitId:2,
         smallUnitId:2,
         classId:'',
         classId:'',
         price:'',
         price:'',
+        skMore:'',
         skAddPrice:'',
         skAddPrice:'',
         addPrice:'',
         addPrice:'',
         discountPrice:'',
         discountPrice:'',
@@ -351,6 +307,7 @@ export default {
         this.form.id = 0
         this.form.id = 0
         this.form.price = ''
         this.form.price = ''
         this.form.skAddPrice =''
         this.form.skAddPrice =''
+        this.form.skMore =''
         this.form.addPrice =''
         this.form.addPrice =''
         this.form.discountPrice = ''
         this.form.discountPrice = ''
       })
       })
@@ -463,6 +420,10 @@ export default {
 					uni.showToast({title:"请填写花店加价",icon:"none"})
 					uni.showToast({title:"请填写花店加价",icon:"none"})
 					return;
 					return;
 				}
 				}
+				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skMore) == false){
+					uni.showToast({title:"请填写散客比花店贵多少",icon:"none"})
+					return;
+				}
       }
       }
       let form = JSON.parse(JSON.stringify(this.form))
       let form = JSON.parse(JSON.stringify(this.form))
       uni.showLoading({mask:true})
       uni.showLoading({mask:true})
@@ -527,6 +488,11 @@ export default {
           rule: ["required"],
           rule: ["required"],
           msg: ["请填写散客加价"]
           msg: ["请填写散客加价"]
         },
         },
+        {
+          name: "skMore",
+          rule: ["required"],
+          msg: ["请填写散客比花店贵多少"]
+        },
         {
         {
           name: "addPrice",
           name: "addPrice",
           rule: ["required"],
           rule: ["required"],

+ 16 - 3
ghsApp/src/admin/item/copy.vue

@@ -21,12 +21,14 @@
         </tui-list-cell>
         </tui-list-cell>
 
 
         <tui-list-cell class="line-cell" :hover="false">
         <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">售价</view>
-          <input v-model="form.price" placeholder-class="phcolor" class="tui-input" name="price" @focus="form.price=''" placeholder="请填写售价" maxlength="50" type="digit" />
+          <view class="tui-title">花店价</view>
+          <input v-model="form.price" style="width:140upx;" placeholder-class="phcolor" class="tui-input" name="price" @focus="form.price=''" placeholder="请填写" maxlength="50" type="digit" />
+          <text style="color:#666666;margin-right:20upx;">散客比花店贵:</text>
+          <input v-model="form.skMore" style="width:110upx;" placeholder-class="phcolor" class="tui-input" name="skMore" @focus="form.skMore=''" placeholder="请填写" type="digit" />
         </tui-list-cell>
         </tui-list-cell>
 
 
         <tui-list-cell class="line-cell" :hover="false">
         <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">今日特价</view>
+          <view class="tui-title">花店今日特价</view>
           <input v-model="form.discountPrice" placeholder-class="phcolor" class="tui-input" name="discountPrice" @focus="form.discountPrice=''" placeholder="不做特价填0" maxlength="50" type="digit" />
           <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>
 
 
@@ -167,6 +169,7 @@ export default {
         classId:'',
         classId:'',
         price:'',
         price:'',
         skAddPrice:'',
         skAddPrice:'',
+        skMore:'',
         addPrice:'',
         addPrice:'',
         discountPrice:'',
         discountPrice:'',
         weight:'',
         weight:'',
@@ -277,6 +280,7 @@ export default {
         this.form.id = 0
         this.form.id = 0
         this.form.price = ''
         this.form.price = ''
         this.form.skAddPrice =''
         this.form.skAddPrice =''
+        this.form.skMore=''
         this.form.addPrice =''
         this.form.addPrice =''
         this.form.discountPrice = ''
         this.form.discountPrice = ''
       })
       })
@@ -390,6 +394,10 @@ export default {
 					uni.showToast({title:"请填写普店加价",icon:"none"})
 					uni.showToast({title:"请填写普店加价",icon:"none"})
 					return;
 					return;
 				}
 				}
+				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skMore) == false){
+					uni.showToast({title:"请填写散客比花店贵多少",icon:"none"})
+					return;
+				}
       }
       }
       let form = JSON.parse(JSON.stringify(this.form))
       let form = JSON.parse(JSON.stringify(this.form))
       uni.showLoading({mask:true})
       uni.showLoading({mask:true})
@@ -469,6 +477,11 @@ export default {
           rule: ["required"],
           rule: ["required"],
           msg: ["不做特价请填0"]
           msg: ["不做特价请填0"]
         },
         },
+        {
+          name: "skMore",
+          rule: ["required"],
+          msg: ["请填写散客比花店贵多少"]
+        },
         {
         {
           name: "weight",
           name: "weight",
           rule: ["required"],
           rule: ["required"],

+ 1 - 1
ghsApp/src/admin/item/detail.vue

@@ -23,7 +23,7 @@
           <view class="tui-title">花店价</view>
           <view class="tui-title">花店价</view>
           <input v-model="form.price" style="width:140upx;" placeholder-class="phcolor" class="tui-input" name="price" @focus="form.price=''" placeholder="请填写" type="digit" />
           <input v-model="form.price" style="width:140upx;" placeholder-class="phcolor" class="tui-input" name="price" @focus="form.price=''" placeholder="请填写" type="digit" />
           <text style="color:#666666;margin-right:20upx;">散客比花店贵:</text>
           <text style="color:#666666;margin-right:20upx;">散客比花店贵:</text>
-          <input v-model="form.price" style="width:110upx;" placeholder-class="phcolor" class="tui-input" name="skMore" @focus="form.skMore=''" placeholder="请填写" type="digit" />
+          <input v-model="form.skMore" style="width:110upx;" placeholder-class="phcolor" class="tui-input" name="skMore" @focus="form.skMore=''" placeholder="请填写" type="digit" />
         </tui-list-cell>
         </tui-list-cell>
 
 
         <tui-list-cell class="line-cell" :hover="false">
         <tui-list-cell class="line-cell" :hover="false">

+ 11 - 12
ghsApp/src/admin/itemClass/addPrice.vue

@@ -4,18 +4,18 @@
 			<t-table :headerBackgroundColor="'#F0F2F6'">
 			<t-table :headerBackgroundColor="'#F0F2F6'">
 				<t-tr header>
 				<t-tr header>
                     <t-th>名称</t-th>
                     <t-th>名称</t-th>
-					<t-th>散客</t-th>
-					<t-th>花店</t-th>>
+					<t-th>花店加价</t-th>
+					<t-th>散客比花店</t-th>
 				</t-tr>
 				</t-tr>
 				<view v-for="(item, index) in list.data" :key="index">
 				<view v-for="(item, index) in list.data" :key="index">
 					<t-tr>
 					<t-tr>
                         <t-td align="center" color="info"><view>{{item.name}}</view></t-td>
                         <t-td align="center" color="info"><view>{{item.name}}</view></t-td>
 						<t-td align="center" color="info">
 						<t-td align="center" color="info">
-                            <view><input v-model="item.skAddPrice" @focus="item.skAddPrice=''" name="skAddPrice" type="digit" style="border:1upx solid #cccccc;" /></view>
+                            <view><input v-model="item.addPrice" @focus="item.addPrice=''" name="price" type="digit" style="border:1upx solid #cccccc;" /></view>
                         </t-td>
                         </t-td>
 						<t-td align="center" color="info">
 						<t-td align="center" color="info">
-                            <view><input v-model="item.addPrice" @focus="item.addPrice=''" name="price" type="digit" style="border:1upx solid #cccccc;" /></view>
-                            </t-td>
+                            <view><input v-model="item.skMore" @focus="item.skMore=''" name="skMore" type="digit" style="border:1upx solid #cccccc;" /></view>
+                        </t-td>
 					</t-tr>
 					</t-tr>
 				</view>
 				</view>
 			</t-table>
 			</t-table>
@@ -26,8 +26,7 @@
         <view class="app-footer">
         <view class="app-footer">
             <view class="admin-button-com middle blue" @click="showBatchUpdate('add')">整列累加</view>
             <view class="admin-button-com middle blue" @click="showBatchUpdate('add')">整列累加</view>
             <view style="margin-left:20upx;" class="admin-button-com middle blue" @click="showBatchUpdate('update')">整列改为</view>
             <view style="margin-left:20upx;" class="admin-button-com middle blue" @click="showBatchUpdate('update')">整列改为</view>
-            <view style="margin-left:20upx;" class="admin-button-com middle blue" @click="pageTo({url: '/admin/item/list'})">花材</view>
-		    <view style="margin-left:20upx;" class="admin-button-com middle blue" @click="savePrice">全部保存</view>
+		    <view style="margin-left:20upx;" class="admin-button-com middle blue" @click="savePrice">保存修改</view>
 		</view>
 		</view>
 
 
 		<modal-module :show="batchModel" @click="affirmBatch" title="批量操作" color="#333" :size="32" padding="30upx 30upx" >
 		<modal-module :show="batchModel" @click="affirmBatch" title="批量操作" color="#333" :size="32" padding="30upx 30upx" >
@@ -72,7 +71,7 @@ export default {
 
 
             this.batchStyle = styleInfo
             this.batchStyle = styleInfo
 			let self = this
 			let self = this
-			let levelList = ['请选择列:','散客', '花店']
+			let levelList = ['请选择列:','散客比花店贵', '花店加价']
 			uni.showActionSheet({
 			uni.showActionSheet({
 				itemList: levelList,
 				itemList: levelList,
 				success: function (respond) {
 				success: function (respond) {
@@ -95,7 +94,7 @@ export default {
                 this.list.data.forEach(function(value,index,array){
                 this.list.data.forEach(function(value,index,array){
                     if(that.batchStyle =='add'){
                     if(that.batchStyle =='add'){
                         if(that.levelIndex == 1){
                         if(that.levelIndex == 1){
-                            array[index].skAddPrice =  parseFloat((Number(array[index].skAddPrice) + currentPrice).toFixed(2))
+                            array[index].skMore =  parseFloat((Number(array[index].skMore) + currentPrice).toFixed(2))
                         }else if(that.levelIndex == 2){
                         }else if(that.levelIndex == 2){
                             array[index].addPrice =  parseFloat((Number(array[index].addPrice) + currentPrice).toFixed(2))
                             array[index].addPrice =  parseFloat((Number(array[index].addPrice) + currentPrice).toFixed(2))
                         }else{
                         }else{
@@ -103,7 +102,7 @@ export default {
                         }
                         }
                     }else{
                     }else{
                         if(that.levelIndex == 1){
                         if(that.levelIndex == 1){
-                            array[index].skAddPrice =  parseFloat((currentPrice).toFixed(2))
+                            array[index].skMore =  parseFloat((currentPrice).toFixed(2))
                         }else if(that.levelIndex == 2){
                         }else if(that.levelIndex == 2){
                             array[index].addPrice =  parseFloat((currentPrice).toFixed(2))
                             array[index].addPrice =  parseFloat((currentPrice).toFixed(2))
                         }else{
                         }else{
@@ -121,7 +120,7 @@ export default {
            uni.showLoading({mask:true})
            uni.showLoading({mask:true})
            this.list.data.forEach(function(value,index,array){
            this.list.data.forEach(function(value,index,array){
 
 
-               if(that.$util.isMoney(value.skAddPrice) == false){
+               if(that.$util.isMoney(value.skMore) == false){
                    that.$msg('【'+value.name+'】的散客加价填写错误')
                    that.$msg('【'+value.name+'】的散客加价填写错误')
                    return false
                    return false
                }
                }
@@ -130,7 +129,7 @@ export default {
                    return false
                    return false
                }
                }
 
 
-                addData.push({id:value.id,skAddPrice:value.skAddPrice,addPrice:value.addPrice})
+                addData.push({id:value.id,skMore:value.skMore,addPrice:value.addPrice})
            })
            })
            let addString = JSON.stringify(addData)
            let addString = JSON.stringify(addData)
            batchChangeAddPrice({addData:addString}).then(res=>{
            batchChangeAddPrice({addData:addString}).then(res=>{

+ 21 - 16
ghsApp/src/pagesPurchase/components/pageSuccess.vue

@@ -6,14 +6,15 @@
 				<view class="iconfont iconchenggong"></view>
 				<view class="iconfont iconchenggong"></view>
 				<view class="result-title">采购成功</view>
 				<view class="result-title">采购成功</view>
 
 
-				<view class="flowers-list-box">
+				<view style="margin-left:150upx;">
 					<view class="flex title">建议修改以下花材售价:</view>
 					<view class="flex title">建议修改以下花材售价:</view>
 					<checkbox-group @change="checkboxChange">
 					<checkbox-group @change="checkboxChange">
 						<view v-for="(res,i) in flowersList" :key="i">
 						<view v-for="(res,i) in flowersList" :key="i">
 							<view class="product-area">
 							<view class="product-area">
-								<view class="first-area"><text>{{res.name}}</text><input type="digit" v-model="res.autoPrice" @focus="priceFocus(i,res)" @input="modifyPrice(res)"> 元</view>
-								<view class="second-area">
-									<view class="two">成本 ¥{{parseFloat(res.cost)}},加价 ¥{{parseFloat(res.addPrice)}}</view>
+								<view class="first-area">
+									<text class="name">{{res.name}}</text>
+									<input type="digit" v-model="res.hdPrice" placeholder="花店价" @focus="priceFocus(i,res)" @input="modifyPrice(res)" />
+									<input type="digit" v-model="res.skPrice" placeholder="散客价" />
 								</view>
 								</view>
 							</view>
 							</view>
 						</view>
 						</view>
@@ -53,9 +54,9 @@ export default {
 			this.costChangeIds = e.detail.value
 			this.costChangeIds = e.detail.value
 		},
 		},
 		priceFocus(i,res){
 		priceFocus(i,res){
-			this.flowersList[i].autoPrice = ''
+			this.flowersList[i].hdPrice = ''
 			let id = res.id
 			let id = res.id
-			if(parseFloat(res.autoPrice)==parseFloat(Number(res.addPrice)+Number(res.cost)) || parseFloat(Number(res.autoPrice)-Number(res.cost)) < 0){
+			if(parseFloat(res.hdPrice)==parseFloat(Number(res.addPrice)+Number(res.cost)) || parseFloat(Number(res.hdPrice)-Number(res.cost)) < 0){
 				let i = this.costChangeIds.indexOf(id)
 				let i = this.costChangeIds.indexOf(id)
 				if(i > -1){
 				if(i > -1){
 					this.costChangeIds.splice(i,1)
 					this.costChangeIds.splice(i,1)
@@ -70,15 +71,15 @@ export default {
 				that.flowersList = res.data.list;
 				that.flowersList = res.data.list;
 				that.productList = [];
 				that.productList = [];
 				that.flowersList.forEach(function(item,index,arr){
 				that.flowersList.forEach(function(item,index,arr){
-					that.productList.push({id:item.id,price:item.autoPrice})
+					that.productList.push({id:item.id,price:item.hdPrice})
 				})
 				})
 			});
 			});
 		},
 		},
 		modifyPrice(res){
 		modifyPrice(res){
 			let id = res.id
 			let id = res.id
-			let price = res.autoPrice
+			let price = res.hdPrice
 
 
-			if(parseFloat(res.autoPrice)==parseFloat(Number(res.addPrice)+Number(res.cost)) || parseFloat(Number(res.autoPrice)-Number(res.cost)) < 0){
+			if(parseFloat(res.hdPrice)==parseFloat(Number(res.addPrice)+Number(res.cost)) || parseFloat(Number(res.hdPrice)-Number(res.cost)) < 0){
 				let i = this.costChangeIds.indexOf(id)
 				let i = this.costChangeIds.indexOf(id)
 				if(i > -1){
 				if(i > -1){
 					this.costChangeIds.splice(i,1)
 					this.costChangeIds.splice(i,1)
@@ -122,11 +123,14 @@ export default {
 	margin-bottom:30upx;
 	margin-bottom:30upx;
 }
 }
 .product-area{
 .product-area{
-	width:600upx;
-	height:120upx;
+	width:680upx;
+	height:90upx;
+	display:flex;
+	align-items:center;
 	.first-area{
 	.first-area{
-		text{
-			width:270upx;
+		border-bottom:1upx solid #e4e2e2;
+		.name{
+			width:180upx;
 			overflow: hidden;
 			overflow: hidden;
 			text-overflow:ellipsis;
 			text-overflow:ellipsis;
 			white-space: nowrap;
 			white-space: nowrap;
@@ -135,9 +139,10 @@ export default {
 		input{
 		input{
 			border:1upx solid #cccccc;
 			border:1upx solid #cccccc;
 			display:inline-block;
 			display:inline-block;
-			width:150upx;
-			margin-left:30upx;
-			margin-right:10upx;
+			width:135upx;
+			margin-left:10upx;
+			margin-right:30upx;
+			text-align:center;
 		}
 		}
 	}
 	}
 	.second-area{
 	.second-area{