|
|
@@ -50,7 +50,8 @@
|
|
|
<div class="set-sort">
|
|
|
<span>库存预警</span>
|
|
|
<el-button v-if="!stockWarningInput" icon="el-icon-edit-outline" size="small" type="text" @click="showStockWarningInput" class="show"></el-button>
|
|
|
- <el-button class="hide" v-else size="mini" @click="commitChange('stockWarning')" type="primary">完成</el-button>
|
|
|
+ <el-button class="hide" v-if="stockWarningInput" size="mini" @click="showMultiplePop(scope,'stockWarning')" type="primary">批</el-button>
|
|
|
+ <el-button class="hide" v-if="stockWarningInput" size="mini" @click="commitChange('stockWarning')" type="primary">完成</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -60,9 +61,10 @@
|
|
|
</template>
|
|
|
<template #table-header-shelfLife>
|
|
|
<div class="set-sort">
|
|
|
- <span>保质期(天)</span>
|
|
|
+ <span>保质期</span>
|
|
|
<el-button v-if="!shelfLifeInput" icon="el-icon-edit-outline" size="small" type="text" @click="showShelfLifeInputInput" class="show"></el-button>
|
|
|
- <el-button class="hide" v-else size="mini" @click="commitChange('shelfLife')" type="primary">完成</el-button>
|
|
|
+ <el-button class="hide" v-if="shelfLifeInput" size="mini" @click="showMultiplePop(scope,'shelfLife')" type="primary">批</el-button>
|
|
|
+ <el-button class="hide" v-if="shelfLifeInput" size="mini" @click="commitChange('shelfLife')" type="primary">完成</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -100,7 +102,7 @@
|
|
|
<div class="set-sort">
|
|
|
<span>每扎加价</span>
|
|
|
<el-button v-if="!canAddPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showAddPrice" class="show"></el-button>
|
|
|
- <el-button class="hide" v-if="canAddPrice" size="mini" @click="changeAllSort(scope)" type="primary">批</el-button>
|
|
|
+ <el-button class="hide" v-if="canAddPrice" size="mini" @click="showMultiplePop(scope,'addPrice')" type="primary">批</el-button>
|
|
|
<el-button class="hide" v-if="canAddPrice" size="mini" @click="commitChange('addPrice')" type="primary">完成</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -259,15 +261,16 @@
|
|
|
<el-button type="primary" size="small" @click="replaceConfirmFn">确认</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
<!--批量修改-->
|
|
|
<el-dialog width="600px" title="批量修改" :visible.sync="dialogFormVisible">
|
|
|
<div class="flex-center">
|
|
|
- <el-input placeholder="批量修改" v-model="batchAlter" autocomplete="off"></el-input>
|
|
|
- <el-button style="margin: 0 30px" type="primary" @click="batchAlterFun">确 定</el-button>
|
|
|
+ <el-input placeholder="批量修改" v-model="batchAlterNum" autocomplete="off"></el-input>
|
|
|
+ <el-button style="margin: 0 30px" type="primary" @click="batchAlterNumFun">确 定</el-button>
|
|
|
</div>
|
|
|
<div class="flex-center" style="margin-top: 30px">
|
|
|
- <el-input placeholder="批量加价" v-model="batchAddPrice" autocomplete="off"></el-input>
|
|
|
- <el-button style="margin: 0 30px" type="primary" @click="batchAddPriceFun">确 定</el-button>
|
|
|
+ <el-input placeholder="批量加价" v-model="batchAddNum" autocomplete="off"></el-input>
|
|
|
+ <el-button style="margin: 0 30px" type="primary" @click="batchAddNumFun">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
@@ -296,8 +299,8 @@ export default {
|
|
|
sort: {
|
|
|
status: false
|
|
|
},
|
|
|
- batchAlter:'',
|
|
|
- batchAddPrice:'',
|
|
|
+ batchAlterNum:'',
|
|
|
+ batchAddNum:'',
|
|
|
dialogFormVisible:false,
|
|
|
canAddPrice:false,
|
|
|
canAddRatio:false,
|
|
|
@@ -532,7 +535,7 @@ export default {
|
|
|
prop: 'stockWarning',
|
|
|
label: '库存预警',
|
|
|
align: 'center',
|
|
|
- 'min-width': 118
|
|
|
+ 'min-width': 125
|
|
|
},
|
|
|
{
|
|
|
prop: 'delStatus',
|
|
|
@@ -544,7 +547,7 @@ export default {
|
|
|
prop: 'shelfLife',
|
|
|
label: '保质期',
|
|
|
align: 'center',
|
|
|
- 'min-width': 125
|
|
|
+ 'min-width': 130
|
|
|
},
|
|
|
{
|
|
|
prop: 'className',
|
|
|
@@ -556,7 +559,7 @@ export default {
|
|
|
prop: 'ratio',
|
|
|
label: '单位比',
|
|
|
align: 'center',
|
|
|
- 'min-width': 110
|
|
|
+ 'min-width': 100
|
|
|
},
|
|
|
{
|
|
|
prop: 'weight',
|
|
|
@@ -568,7 +571,7 @@ export default {
|
|
|
prop: 'inTurn',
|
|
|
label: '排序',
|
|
|
align: 'center',
|
|
|
- minWidth: 120
|
|
|
+ minWidth: 100
|
|
|
},
|
|
|
{
|
|
|
prop: 'unit',
|
|
|
@@ -844,32 +847,61 @@ export default {
|
|
|
|
|
|
},
|
|
|
//批量加价
|
|
|
- batchAddPriceFun(){
|
|
|
- if(this.batchAddPrice=='') return;
|
|
|
- this.dataList.form.type = 'addPrice'
|
|
|
+ batchAddNumFun(){
|
|
|
+ if(this.batchAddNum==''){
|
|
|
+ return
|
|
|
+ }
|
|
|
let data = this.$refs['xCrud'].table.data;
|
|
|
data.forEach((ele)=>{
|
|
|
- let batchAddPrice = (Number(this.batchAddPrice) + Number(ele.addPrice)).toFixed(2)
|
|
|
- ele.addPrice = batchAddPrice
|
|
|
- this.initData.push({id:ele.id,addPrice:ele.addPrice})
|
|
|
+
|
|
|
+ if(this.dataList.form.type == 'addPrice'){
|
|
|
+ let batchAddNum = (Number(this.batchAddNum) + Number(ele.addPrice)).toFixed(2)
|
|
|
+ ele.addPrice = batchAddNum
|
|
|
+ this.initData.push({id:ele.id,addPrice:ele.addPrice})
|
|
|
+ }else if(this.dataList.form.type == 'stockWarning'){
|
|
|
+ let batchAddNum = (Number(this.batchAddNum) + Number(ele.stockWarning)).toFixed(2)
|
|
|
+ ele.stockWarning = batchAddNum
|
|
|
+ this.initData.push({id:ele.id,stockWarning:ele.stockWarning})
|
|
|
+ }else if(this.dataList.form.type == 'shelfLife'){
|
|
|
+ let batchAddNum = (Number(this.batchAddNum) + Number(ele.shelfLife)).toFixed(2)
|
|
|
+ ele.shelfLife = batchAddNum
|
|
|
+ this.initData.push({id:ele.id,shelfLife:ele.shelfLife})
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
this.dialogFormVisible = false;
|
|
|
},
|
|
|
//批量改价
|
|
|
- batchAlterFun(){
|
|
|
- if(this.batchAlter=='') return;
|
|
|
- this.dataList.form.type = 'addPrice'
|
|
|
+ batchAlterNumFun(){
|
|
|
+ if(this.batchAlterNum==''){
|
|
|
+ return
|
|
|
+ }
|
|
|
let data = this.$refs['xCrud'].table.data;
|
|
|
data.forEach((ele)=>{
|
|
|
- ele.addPrice = this.batchAlter
|
|
|
- this.initData.push({id:ele.id,addPrice:this.batchAlter})
|
|
|
+
|
|
|
+ if(this.dataList.form.type == 'addPrice'){
|
|
|
+ ele.addPrice = this.batchAlterNum
|
|
|
+ this.initData.push({id:ele.id,addPrice:this.batchAlterNum})
|
|
|
+ }else if(this.dataList.form.type == 'stockWarning'){
|
|
|
+ ele.stockWarning = this.batchAlterNum
|
|
|
+ this.initData.push({id:ele.id,stockWarning:this.batchAlterNum})
|
|
|
+ }else if(this.dataList.form.type == 'shelfLife'){
|
|
|
+ ele.shelfLife = this.batchAlterNum
|
|
|
+ this.initData.push({id:ele.id,shelfLife:this.batchAlterNum})
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
this.dialogFormVisible = false
|
|
|
},
|
|
|
- changeAllSort(e){
|
|
|
- this.batchAlter='';
|
|
|
- this.batchAddPrice='';
|
|
|
+ showMultiplePop(e,type){
|
|
|
+ this.batchAlterNum='';
|
|
|
+ this.batchAddNum='';
|
|
|
this.dialogFormVisible = true;
|
|
|
+ this.dataList.form.type = type
|
|
|
},
|
|
|
changeInputValue (d, type) {
|
|
|
this.dataList.form.type = type
|