Răsfoiți Sursa

批量修改为同个价格

shish 2 ani în urmă
părinte
comite
9bbd209725

+ 44 - 42
ghsApp/src/admin/changePrice/batchChange.vue

@@ -56,7 +56,7 @@
 			</view>
 			</view>
 	
 	
 		  <div class="app-footer">
 		  <div class="app-footer">
-			<button class="admin-button-com big blue" @click="modifyClass()">所选花材移动到</button>
+			<button class="admin-button-com big blue" @click="changeSelectItem()">修改所选花材</button>
 		  </div>
 		  </div>
 	
 	
 			<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
 			<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
@@ -75,23 +75,26 @@
 			<modal-module :show="showClassModel" @cancel="cancelModifyClass" @click="confirmModifyClass" title=" " color="#333" :size="32" padding="30rpx 30rpx" >
 			<modal-module :show="showClassModel" @cancel="cancelModifyClass" @click="confirmModifyClass" title=" " color="#333" :size="32" padding="30rpx 30rpx" >
 				<template slot="customContent">
 				<template slot="customContent">
 					<view style="padding:30upx 0">
 					<view style="padding:30upx 0">
-	
-	<view class="module-com input-line-wrap">
-		<tui-list-cell class="line-cell" :arrow="true">
-			<view class="tui-title">分类</view>
-			<picker mode="selector" :value="classId" :range="itemClassData" range-key="name" @change="changeItemClassFn" class="tui-input" >
-			<view v-if="Number(classId)>0" style="height:45upx;" >{{ itemClassSelectedData.name }}</view>
-			<view class="tui-placeholder" style="height:45upx;" v-else>请选择</view>
-			</picker>
-		</tui-list-cell>
-	</view>
-	
-	
+
+						<view class="module-com input-line-wrap">
+							<tui-list-cell class="line-cell" :arrow="false" :hover="false">
+								<view class="tui-title">会员价</view>
+								<input type="digit" placeholder="请填写会员价" v-model="form.hjPrice" @focus="form.hjPrice=''" placeholder-class="tui-placeholder"/>
+							</tui-list-cell>
+							<tui-list-cell class="line-cell" :arrow="false" :hover="false">
+								<view class="tui-title" style="color:#3385FF;font-weight:bold;">批发价</view>
+								<input type="digit" placeholder="请填写批发价" v-model="form.price" @focus="form.price=''" placeholder-class="tui-placeholder"/>
+							</tui-list-cell>
+							<tui-list-cell class="line-cell" :arrow="false" :hover="false">
+								<view class="tui-title">零售价</view>
+								<input type="digit" placeholder="请填写零售价" v-model="form.skPrice" @focus="form.skPrice=''" placeholder-class="tui-placeholder"/>
+							</tui-list-cell>
+						</view>
+
 					</view>
 					</view>
 				</template>
 				</template>
 			</modal-module>
 			</modal-module>
-	
-	
+
 		</view>
 		</view>
 	</view>
 	</view>
 	</template>
 	</template>
@@ -100,13 +103,12 @@
 	import AppWrapperEmpty from "@/components/app-wrapper-empty";
 	import AppWrapperEmpty from "@/components/app-wrapper-empty";
 	import ItemComponent from "./components/changeClassItem";
 	import ItemComponent from "./components/changeClassItem";
 	import productMins from "@/mixins/product";
 	import productMins from "@/mixins/product";
-	import { batchModifyClass } from "@/api/product";
+	import { manyItemChangeOnePrice } from "@/api/product";
 	import { mapGetters } from "vuex";
 	import { mapGetters } from "vuex";
 	import ModalModule from "@/components/plugin/modal";
 	import ModalModule from "@/components/plugin/modal";
 	import TuiListCell from "@/components/plugin/list-cell";
 	import TuiListCell from "@/components/plugin/list-cell";
-	import { getAllItemClass } from "@/api/item-class";
 	export default {
 	export default {
-		name: "outlist",
+		name: "batchChangePrice",
 		components: {
 		components: {
 			AppSearchModule,
 			AppSearchModule,
 			AppWrapperEmpty,
 			AppWrapperEmpty,
@@ -118,15 +120,13 @@
 		data() {
 		data() {
 			return {
 			return {
 				autoLoad: false,
 				autoLoad: false,
-				selectJobType: "stock",
+				selectJobType: "batchChangePrice",
 				tabIndex: 0,
 				tabIndex: 0,
 				priceArr:[],
 				priceArr:[],
 				showClassRemind:false,
 				showClassRemind:false,
 				currentList:[],
 				currentList:[],
-				itemClassData:[],
-				itemClassSelectedData:{},
-				classId:0,
-				showClassModel:false
+				showClassModel:false,
+				form:{price:'',hjPrice:'',skPrice:''}
 			};
 			};
 		},
 		},
 		computed:{
 		computed:{
@@ -134,20 +134,8 @@
 		},
 		},
 		onLoad() {
 		onLoad() {
 			this.initProduct()
 			this.initProduct()
-	
-			getAllItemClass().then(res => {
-				if (this.$util.isEmpty(res.data)){
-					return false;
-				}
-				this.itemClassData = res.data;
-			})
-	
 		},
 		},
 		methods: {
 		methods: {
-			changeItemClassFn(e) {
-				this.itemClassSelectedData = this.itemClassData[e.detail.value];
-				this.classId = this.itemClassSelectedData.id;
-			},
 			getCurrentAll(index){
 			getCurrentAll(index){
 				let that = this
 				let that = this
 				let child = this.globalClassItemList[index] && this.globalClassItemList[index].child ? this.globalClassItemList[index].child : []
 				let child = this.globalClassItemList[index] && this.globalClassItemList[index].child ? this.globalClassItemList[index].child : []
@@ -159,7 +147,7 @@
 					})
 					})
 				}
 				}
 			},
 			},
-			modifyClass(){
+			changeSelectItem(){
 				let that = this
 				let that = this
 				if(this.$util.isEmpty(this.currentList)){
 				if(this.$util.isEmpty(this.currentList)){
 					this.$msg('请选择花材')
 					this.$msg('请选择花材')
@@ -177,12 +165,28 @@
 					this.$msg('请选择花材')
 					this.$msg('请选择花材')
 					return false
 					return false
 				}
 				}
-				if(Number(this.classId)==0){
-					this.$msg('请选择分类')
+				if(Number(this.form.price)<=0){
+					this.$msg('请填写批发价')
+					return false;
+				}
+				if(Number(this.form.hjPrice)<=0){
+					this.$msg('请填写会员价')
+					return false;
+				}
+				if(Number(this.form.skPrice)<=0){
+					this.$msg('请填写零售价')
+					return false;
+				}
+				if(Number(this.form.hjPrice) > Number(this.form.price)){
+					this.$msg('会员价不能大于批发价')
+					return false
+				}
+				if(Number(this.form.price) > Number(this.form.skPrice)){
+					this.$msg('批发价不能大于零售价')
 					return false
 					return false
 				}
 				}
-				this.$util.confirmModal({content:'确认移动?'},() => {
-					batchModifyClass({ids:JSON.stringify(that.currentList),classId:that.classId}).then(res=>{
+				this.$util.confirmModal({content:'确认修改?'},() => {
+					manyItemChangeOnePrice({ids:JSON.stringify(that.currentList),...that.form}).then(res=>{
 						if(res.code == 1){
 						if(res.code == 1){
 							that.cancelModifyClass()
 							that.cancelModifyClass()
 							that.$msg(res.msg)
 							that.$msg(res.msg)
@@ -193,8 +197,6 @@
 			},
 			},
 			cancelModifyClass() {
 			cancelModifyClass() {
 				this.showClassModel = false;
 				this.showClassModel = false;
-				this.classId = 0
-				this.itemClassSelectedData = {}
 			},
 			},
 			checkItemEvent(item,check) {
 			checkItemEvent(item,check) {
 				let id = item.id
 				let id = item.id

+ 5 - 7
ghsApp/src/admin/changePrice/list.vue

@@ -58,7 +58,8 @@
 		</view>
 		</view>
 
 
       <div class="app-footer">
       <div class="app-footer">
-        <button class="admin-button-com big blue" @click="commitPrice">保存修改</button>
+		<button class="admin-button-com big default" @click="goBatchChange">批量修改</button>
+        <button class="admin-button-com big blue" style="width:40vw;" @click="commitPrice">保存修改</button>
       </div>
       </div>
 
 
 		<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
 		<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
@@ -109,6 +110,9 @@ export default {
 		this.initProduct()
 		this.initProduct()
 	},
 	},
 	methods: {
 	methods: {
+		goBatchChange(){
+			this.$util.pageTo({url: '/admin/changePrice/batchChange'})
+		},
 		hideChangeFn(item,status){
 		hideChangeFn(item,status){
 			let that = this
 			let that = this
 			changeFrontHide({id:item.id,status:status}).then(res=>{
 			changeFrontHide({id:item.id,status:status}).then(res=>{
@@ -361,12 +365,6 @@ export default {
 	.app-footer {
 	.app-footer {
 		justify-content: space-evenly;
 		justify-content: space-evenly;
 		z-index: 9999;
 		z-index: 9999;
-		.admin-button-com {
-			width: 60%;
-		}
-		button{
-			width:600upx;
-		}
 	}
 	}
 }
 }
 .class-popup-style{
 .class-popup-style{

+ 2 - 2
ghsApp/src/admin/home/apply.vue

@@ -35,8 +35,8 @@ export default {
                     list:[
                     list:[
                         {name: "花材",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/list"},
                         {name: "花材",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/list"},
                         {name: "分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/list"},
                         {name: "分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/list"},
-                        {name: "改价",img: `${this.$constant.imgUrl}/ghs/home/gj.png`,url: "/admin/changePrice/batchChange"},
-                        {name: "批量改价",img: `${this.$constant.imgUrl}/ghs/home/gj.png`,url: "/admin/changePrice/list"},
+                        {name: "改价",img: `${this.$constant.imgUrl}/ghs/home/gj.png`,url: "/admin/changePrice/list"},
+                        {name: "批量改价",img: `${this.$constant.imgUrl}/ghs/home/gj.png`,url:"/admin/changePrice/batchChange"},
                         {name: "批量移动",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/changeClass"},
                         {name: "批量移动",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/changeClass"},
                         {name: "批量加价",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/add"},
                         {name: "批量加价",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/add"},
                         {name: "批量排序",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/sort"},
                         {name: "批量排序",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/sort"},

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

@@ -1,5 +1,9 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 import https from "@/plugins/luch-request_0.0.7/request";
 
 
+export const manyItemChangeOnePrice = data => {
+	return https.post("/product/many-item-change-one-price", data);
+};
+
 export const batchModifyClass = data => {
 export const batchModifyClass = data => {
 	return https.post("/product/batch-modify-class", data);
 	return https.post("/product/batch-modify-class", data);
 };
 };