|
|
@@ -17,6 +17,9 @@
|
|
|
<el-button type="primary" size="small" @click="confirmChange()">确认修改</el-button>
|
|
|
<el-checkbox v-model="couldLessCost" style="margin-left:8px;">售价允许低于成本</el-checkbox>
|
|
|
</div>
|
|
|
+ <div style="padding-left:9px;margin-bottom:5px;">
|
|
|
+ 修改记录:<span v-for="(it,idx) in modifyList" style="margin-right:15px;cursor: pointer;" @click="getChagnePrice(it)"> {{ it.name }} </span>
|
|
|
+ </div>
|
|
|
<div style="width:100%;height:auto;text-align: left;" v-for="(sonProduct, index) in allProdct">
|
|
|
|
|
|
<div style="font-weight:bold;text-align: left;width:100%;padding:6px 0 5px 8px;" v-if="sonProduct.child && !$util.isEmpty(sonProduct.child)">{{ sonProduct.className }}</div>
|
|
|
@@ -92,21 +95,36 @@
|
|
|
classId:0,
|
|
|
searchName:'',
|
|
|
modifyName:'',
|
|
|
- couldLessCost: false
|
|
|
+ couldLessCost: false,
|
|
|
+ modifyList:[],
|
|
|
+ historyPriceList:[]
|
|
|
};
|
|
|
},
|
|
|
mounted () {
|
|
|
+ this.historyPriceList=[]
|
|
|
this.show()
|
|
|
-
|
|
|
this.$service.itemClass.allClass().then((res) => {
|
|
|
this.itemClassList = res;
|
|
|
})
|
|
|
+ this.getModifyList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getChagnePrice(info){
|
|
|
+ this.$service.modify.getModifyItem({id:info.id}).then(res=>{
|
|
|
+ this.historyPriceList = res.list
|
|
|
+ this.show()
|
|
|
+ this.$message.success('导入成功')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getModifyList(){
|
|
|
+ this.$service.modify.list().then((res) => {
|
|
|
+ this.modifyList = res.list
|
|
|
+ })
|
|
|
+ },
|
|
|
confirmChange(){
|
|
|
let that = this
|
|
|
if (this.$util.isEmpty(this.allProdct)) {
|
|
|
- this.$msg('没有修改')
|
|
|
+ this.$message.error('没有修改')
|
|
|
return false
|
|
|
}
|
|
|
let hasLessCostPrice = false
|
|
|
@@ -116,7 +134,7 @@
|
|
|
item.child.forEach((onIt,index,info)=>{
|
|
|
onIt.forEach((it,ii,inData)=>{
|
|
|
if(it.showPrice && Number(it.showPrice)>0){
|
|
|
- data.push({id:it.id,price:it.showPrice,skPrice:it.showPrice,hjPrice:it.showPrice})
|
|
|
+ data.push({id:it.id,price:it.showPrice,skPrice:it.showPrice,hjPrice:it.showPrice,name:it.name,cover:it.shortCover})
|
|
|
if(Number(it.cost)>Number(it.showPrice)){
|
|
|
hasLessCostPrice = true
|
|
|
}
|
|
|
@@ -138,23 +156,29 @@
|
|
|
this.modifyName = ''
|
|
|
this.$message.success('修改成功')
|
|
|
this.show()
|
|
|
+ this.getModifyList()
|
|
|
+ this.historyPriceList=[]
|
|
|
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
searchFocus(){
|
|
|
this.searchName = ''
|
|
|
+ this.historyPriceList=[]
|
|
|
this.show()
|
|
|
},
|
|
|
toSearch(){
|
|
|
+ this.historyPriceList=[]
|
|
|
this.show()
|
|
|
},
|
|
|
changeRequest(e){
|
|
|
+ this.historyPriceList=[]
|
|
|
this.requestType = e
|
|
|
this.show()
|
|
|
},
|
|
|
getItemClass(e){
|
|
|
this.classId = e
|
|
|
+ this.historyPriceList=[]
|
|
|
this.show()
|
|
|
},
|
|
|
show(){
|
|
|
@@ -165,9 +189,17 @@
|
|
|
if (item.child && !this.$util.isEmpty(item.child)) {
|
|
|
|
|
|
item.child.forEach((single,ix,array)=>{
|
|
|
- array[ix].showPrice=''
|
|
|
- array[ix].showSkPrice=''
|
|
|
- array[ix].showHjPrice=''
|
|
|
+ let currentId = single.id
|
|
|
+ if(this.historyPriceList[currentId]){
|
|
|
+ let currentInfo = this.historyPriceList[currentId]
|
|
|
+ array[ix].showPrice=currentInfo.price ?parseFloat(currentInfo.price):0
|
|
|
+ array[ix].showSkPrice=currentInfo.skPrice?parseFloat(currentInfo.skPrice):0
|
|
|
+ array[ix].showHjPrice=currentInfo.hjPrice?parseFloat(currentInfo.hjPrice):0
|
|
|
+ }else{
|
|
|
+ array[ix].showPrice=''
|
|
|
+ array[ix].showSkPrice=''
|
|
|
+ array[ix].showHjPrice=''
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
|