|
|
@@ -56,7 +56,7 @@
|
|
|
</view>
|
|
|
|
|
|
<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>
|
|
|
|
|
|
<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" >
|
|
|
<template slot="customContent">
|
|
|
<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>
|
|
|
</template>
|
|
|
</modal-module>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -100,13 +103,12 @@
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
import ItemComponent from "./components/changeClassItem";
|
|
|
import productMins from "@/mixins/product";
|
|
|
- import { batchModifyClass } from "@/api/product";
|
|
|
+ import { manyItemChangeOnePrice } from "@/api/product";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import ModalModule from "@/components/plugin/modal";
|
|
|
import TuiListCell from "@/components/plugin/list-cell";
|
|
|
- import { getAllItemClass } from "@/api/item-class";
|
|
|
export default {
|
|
|
- name: "outlist",
|
|
|
+ name: "batchChangePrice",
|
|
|
components: {
|
|
|
AppSearchModule,
|
|
|
AppWrapperEmpty,
|
|
|
@@ -118,15 +120,13 @@
|
|
|
data() {
|
|
|
return {
|
|
|
autoLoad: false,
|
|
|
- selectJobType: "stock",
|
|
|
+ selectJobType: "batchChangePrice",
|
|
|
tabIndex: 0,
|
|
|
priceArr:[],
|
|
|
showClassRemind:false,
|
|
|
currentList:[],
|
|
|
- itemClassData:[],
|
|
|
- itemClassSelectedData:{},
|
|
|
- classId:0,
|
|
|
- showClassModel:false
|
|
|
+ showClassModel:false,
|
|
|
+ form:{price:'',hjPrice:'',skPrice:''}
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
@@ -134,20 +134,8 @@
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.initProduct()
|
|
|
-
|
|
|
- getAllItemClass().then(res => {
|
|
|
- if (this.$util.isEmpty(res.data)){
|
|
|
- return false;
|
|
|
- }
|
|
|
- this.itemClassData = res.data;
|
|
|
- })
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
- changeItemClassFn(e) {
|
|
|
- this.itemClassSelectedData = this.itemClassData[e.detail.value];
|
|
|
- this.classId = this.itemClassSelectedData.id;
|
|
|
- },
|
|
|
getCurrentAll(index){
|
|
|
let that = this
|
|
|
let child = this.globalClassItemList[index] && this.globalClassItemList[index].child ? this.globalClassItemList[index].child : []
|
|
|
@@ -159,7 +147,7 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- modifyClass(){
|
|
|
+ changeSelectItem(){
|
|
|
let that = this
|
|
|
if(this.$util.isEmpty(this.currentList)){
|
|
|
this.$msg('请选择花材')
|
|
|
@@ -177,12 +165,28 @@
|
|
|
this.$msg('请选择花材')
|
|
|
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
|
|
|
}
|
|
|
- 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){
|
|
|
that.cancelModifyClass()
|
|
|
that.$msg(res.msg)
|
|
|
@@ -193,8 +197,6 @@
|
|
|
},
|
|
|
cancelModifyClass() {
|
|
|
this.showClassModel = false;
|
|
|
- this.classId = 0
|
|
|
- this.itemClassSelectedData = {}
|
|
|
},
|
|
|
checkItemEvent(item,check) {
|
|
|
let id = item.id
|