|
@@ -2,30 +2,52 @@
|
|
|
<view class="app-content">
|
|
<view class="app-content">
|
|
|
<view v-if="!$util.isEmpty(list.data)" style="padding-bottom:120upx;">
|
|
<view v-if="!$util.isEmpty(list.data)" style="padding-bottom:120upx;">
|
|
|
<t-table :headerBackgroundColor="'#F0F2F6'">
|
|
<t-table :headerBackgroundColor="'#F0F2F6'">
|
|
|
- <view style="position:fixed;width:100%;top:0;z-index:99999">
|
|
|
|
|
|
|
+ <view style="position:fixed;width:100%;top:0;z-index:99">
|
|
|
<t-tr header>
|
|
<t-tr header>
|
|
|
<t-th><view style="color:black;">名称</view></t-th>
|
|
<t-th><view style="color:black;">名称</view></t-th>
|
|
|
<t-th>
|
|
<t-th>
|
|
|
<view style="color:black;">
|
|
<view style="color:black;">
|
|
|
- <view>零售价</view>
|
|
|
|
|
- <view>比成本贵加</view>
|
|
|
|
|
|
|
+ <view>会员价</view>
|
|
|
|
|
+ <view>比成本多加</view>
|
|
|
</view>
|
|
</view>
|
|
|
</t-th>
|
|
</t-th>
|
|
|
<t-th>
|
|
<t-th>
|
|
|
<view style="color:black;">
|
|
<view style="color:black;">
|
|
|
<view>批发价</view>
|
|
<view>批发价</view>
|
|
|
- <view>比成本贵加</view>
|
|
|
|
|
|
|
+ <view>比成本多加</view>
|
|
|
</view>
|
|
</view>
|
|
|
</t-th>
|
|
</t-th>
|
|
|
<t-th>
|
|
<t-th>
|
|
|
<view style="color:black;">
|
|
<view style="color:black;">
|
|
|
- <view>会员价</view>
|
|
|
|
|
- <view>比成本贵加</view>
|
|
|
|
|
|
|
+ <view>零售价</view>
|
|
|
|
|
+ <view>比成本多加</view>
|
|
|
</view>
|
|
</view>
|
|
|
</t-th>
|
|
</t-th>
|
|
|
</t-tr>
|
|
</t-tr>
|
|
|
</view>
|
|
</view>
|
|
|
<view style="margin-top:115upx;">
|
|
<view style="margin-top:115upx;">
|
|
|
|
|
+
|
|
|
|
|
+ <t-tr>
|
|
|
|
|
+ <t-td align="center" color="info">
|
|
|
|
|
+ <view></view>
|
|
|
|
|
+ </t-td>
|
|
|
|
|
+ <t-td align="center" color="info">
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <button class="admin-button-com mini-btn blue" @click="modify(3)">整列修改</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </t-td>
|
|
|
|
|
+ <t-td align="center" color="info">
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <button class="admin-button-com mini-btn blue" @click="modify(2)">整列修改</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </t-td>
|
|
|
|
|
+ <t-td align="center" color="info">
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <button class="admin-button-com mini-btn blue" @click="modify(1)">整列修改</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </t-td>
|
|
|
|
|
+ </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">
|
|
<t-td align="center" color="info">
|
|
@@ -33,19 +55,19 @@
|
|
|
</t-td>
|
|
</t-td>
|
|
|
<t-td align="center" color="info">
|
|
<t-td align="center" color="info">
|
|
|
<view>
|
|
<view>
|
|
|
- <input v-model="item.skMore" @focus="item.skMore=''" name="skMore"
|
|
|
|
|
|
|
+ <input v-model="item.hjAddPrice" name="hjAddPrice"
|
|
|
type="digit" style="border:1upx solid #cccccc;color:#333333;" />
|
|
type="digit" style="border:1upx solid #cccccc;color:#333333;" />
|
|
|
</view>
|
|
</view>
|
|
|
</t-td>
|
|
</t-td>
|
|
|
<t-td align="center" color="info">
|
|
<t-td align="center" color="info">
|
|
|
<view>
|
|
<view>
|
|
|
- <input v-model="item.addPrice" @focus="item.addPrice=''" name="price"
|
|
|
|
|
|
|
+ <input v-model="item.addPrice" name="addPrice"
|
|
|
type="digit" style="border:1upx solid #cccccc;color:#333333;" />
|
|
type="digit" style="border:1upx solid #cccccc;color:#333333;" />
|
|
|
</view>
|
|
</view>
|
|
|
</t-td>
|
|
</t-td>
|
|
|
<t-td align="center" color="info">
|
|
<t-td align="center" color="info">
|
|
|
<view>
|
|
<view>
|
|
|
- <input v-model="item.addPrice" @focus="item.addPrice=''" name="price"
|
|
|
|
|
|
|
+ <input v-model="item.skMore" name="skMore"
|
|
|
type="digit" style="border:1upx solid #cccccc;color:#333333;" />
|
|
type="digit" style="border:1upx solid #cccccc;color:#333333;" />
|
|
|
</view>
|
|
</view>
|
|
|
</t-td>
|
|
</t-td>
|
|
@@ -58,7 +80,6 @@
|
|
|
<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
|
|
<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
|
|
|
</view>
|
|
</view>
|
|
|
<view class="app-footer">
|
|
<view class="app-footer">
|
|
|
- <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="savePrice">保存修改</view>
|
|
<view style="margin-left:20upx;" class="admin-button-com middle blue" @click="savePrice">保存修改</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -66,9 +87,9 @@
|
|
|
<template slot="customContent">
|
|
<template slot="customContent">
|
|
|
<view class="select-cmd_bx">
|
|
<view class="select-cmd_bx">
|
|
|
<view class="num_bx" style="margin:60upx 0 60upx 0;font-size:35upx;">
|
|
<view class="num_bx" style="margin:60upx 0 60upx 0;font-size:35upx;">
|
|
|
- <view class="flex">金额:
|
|
|
|
|
- <input v-model="batchPrice" placeholder="填写要批量修改的金额"
|
|
|
|
|
- type="digit" style="border:1upx solid #CCCCCC;height:60upx;" />
|
|
|
|
|
|
|
+ <view class="flex">
|
|
|
|
|
+ <input v-model="batchPrice" placeholder="填写金额"
|
|
|
|
|
+ type="digit" style="border:1upx solid #CCCCCC;height:60upx;margin:0 auto;text-align:center;" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -92,30 +113,16 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
batchModel:false,
|
|
batchModel:false,
|
|
|
- batchStyle:'add',
|
|
|
|
|
batchPrice:'',
|
|
batchPrice:'',
|
|
|
focusOn:false,
|
|
focusOn:false,
|
|
|
levelIndex:0
|
|
levelIndex:0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- showBatchUpdate(styleInfo){
|
|
|
|
|
- if (this.$util.isEmpty(this.list.data)){
|
|
|
|
|
- this.$msg('没有花材')
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- this.batchStyle = styleInfo
|
|
|
|
|
- let self = this
|
|
|
|
|
- let levelList = ['请选择:','零售价比成本贵', '批发价比成本贵']
|
|
|
|
|
- uni.showActionSheet({
|
|
|
|
|
- itemList: levelList,
|
|
|
|
|
- success: function (respond) {
|
|
|
|
|
- self.levelIndex = respond.tapIndex
|
|
|
|
|
- self.batchModel = true
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ modify(index){
|
|
|
|
|
+ this.levelIndex = index
|
|
|
|
|
+ this.batchModel = true
|
|
|
|
|
+ },
|
|
|
affirmBatch(val) {
|
|
affirmBatch(val) {
|
|
|
let that = this
|
|
let that = this
|
|
|
if (val.index === 0) {
|
|
if (val.index === 0) {
|
|
@@ -128,23 +135,15 @@ export default {
|
|
|
}
|
|
}
|
|
|
let currentPrice = Number(this.batchPrice)
|
|
let currentPrice = Number(this.batchPrice)
|
|
|
this.list.data.forEach(function(value,index,array){
|
|
this.list.data.forEach(function(value,index,array){
|
|
|
- if(that.batchStyle =='add'){
|
|
|
|
|
- if(that.levelIndex == 1){
|
|
|
|
|
- array[index].skMore = parseFloat((Number(array[index].skMore) + currentPrice).toFixed(2))
|
|
|
|
|
- }else if(that.levelIndex == 2){
|
|
|
|
|
- array[index].addPrice = parseFloat((Number(array[index].addPrice) + currentPrice).toFixed(2))
|
|
|
|
|
- }else{
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- }else{
|
|
|
|
|
- if(that.levelIndex == 1){
|
|
|
|
|
- array[index].skMore = parseFloat((currentPrice).toFixed(2))
|
|
|
|
|
- }else if(that.levelIndex == 2){
|
|
|
|
|
- array[index].addPrice = parseFloat((currentPrice).toFixed(2))
|
|
|
|
|
- }else{
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if(that.levelIndex == 1){
|
|
|
|
|
+ array[index].skMore = parseFloat((currentPrice).toFixed(2))
|
|
|
|
|
+ }
|
|
|
|
|
+ if(that.levelIndex == 2){
|
|
|
|
|
+ array[index].addPrice = parseFloat((currentPrice).toFixed(2))
|
|
|
|
|
+ }
|
|
|
|
|
+ if(that.levelIndex == 3){
|
|
|
|
|
+ array[index].hjAddPrice = parseFloat((currentPrice).toFixed(2))
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
this.batchPrice = ''
|
|
this.batchPrice = ''
|
|
|
this.batchModel = false;
|
|
this.batchModel = false;
|
|
@@ -155,20 +154,22 @@ export default {
|
|
|
let addData = [];
|
|
let addData = [];
|
|
|
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.skMore) == false){
|
|
|
|
|
- that.$msg('【'+value.name+'】的 零售价比成本贵 填写错误')
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
- if(that.$util.isMoney(value.addPrice) == false){
|
|
|
|
|
- that.$msg('【'+value.name+'】的 批发价比成本贵 填写错误')
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- addData.push({id:value.id,skMore:value.skMore,addPrice:value.addPrice})
|
|
|
|
|
|
|
+ if(that.$util.isMoney(value.skMore) == false){
|
|
|
|
|
+ that.$msg('【'+value.name+'】的 填写错误')
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if(that.$util.isMoney(value.addPrice) == false){
|
|
|
|
|
+ that.$msg('【'+value.name+'】的 填写错误')
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if(that.$util.isMoney(value.hjAddPrice) == false){
|
|
|
|
|
+ that.$msg('【'+value.name+'】的 填写错误')
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ addData.push({id:value.id,skMore:value.skMore,addPrice:value.addPrice,hjAddPrice:value.hjAddPrice})
|
|
|
})
|
|
})
|
|
|
let addString = JSON.stringify(addData)
|
|
let addString = JSON.stringify(addData)
|
|
|
- batchChangeAddPrice({addData:addString}).then(res=>{
|
|
|
|
|
|
|
+ batchChangeAddPrice({addData:addString,appVersion:1}).then(res=>{
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|