|
@@ -10,7 +10,7 @@ $(function () {
|
|
|
{label: '条码', name: 'barcode', index: 'barcode', width: 60, align: 'center'},
|
|
|
{label: 'sku', name: 'sku', index: 'sku', width: 80, align: 'center'},
|
|
|
{label: '当前价格', name: 'currentPrice', index: 'current_price', width: 40, align: 'center'},
|
|
|
- {label: '价格来源', name: 'priceType', index: 'price_type', width: 80, align: 'center',formatter:function(value ){
|
|
|
+ {label: '价格来源', name: 'priceType', index: 'price_type', width: 50, align: 'center',formatter:function(value ){
|
|
|
if (value == 1){
|
|
|
return "门店商品";
|
|
|
}else if (value == 2){
|
|
@@ -19,7 +19,9 @@ $(function () {
|
|
|
return "临时促销";
|
|
|
}
|
|
|
}},
|
|
|
- {label: '建议价格', name: 'suggestedPrice', index: 'suggested_price', width: 220},
|
|
|
+ {label: '建议价格', name: 'suggestedPrice', index: 'suggested_price', width: 220, align: 'center'},
|
|
|
+ {label: '建议最高价格', name: 'highestPrice', index: 'highestPrice', width: 50, align: 'center'},
|
|
|
+ {label: '建议最低价格', name: 'lowestPrice', index: 'lowestPrice', width: 50, align: 'center'},
|
|
|
{label: '校验时间', name: 'checkTime', index: 'check_time', width: 70, align: 'center',formatter:function(value){
|
|
|
|
|
|
var time = new Date(value);
|
|
@@ -73,7 +75,9 @@ let vm = new Vue({
|
|
|
},
|
|
|
q: {
|
|
|
name: ''
|
|
|
- }
|
|
|
+ },
|
|
|
+ customPriceInput:'',
|
|
|
+ mseprId:''
|
|
|
},
|
|
|
methods: {
|
|
|
query: function () {
|
|
@@ -147,6 +151,67 @@ let vm = new Vue({
|
|
|
}
|
|
|
vm.reload();
|
|
|
},
|
|
|
+ appHighPrice:function(){
|
|
|
+ let mseprId = getSelectedRow();
|
|
|
+ if (mseprId == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ confirm('确定要应用最高价吗?',function(){
|
|
|
+ vm.updateGoodsPrice("highest",mseprId);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ appLowestPrice:function(){
|
|
|
+ let mseprId = getSelectedRow();
|
|
|
+ if (mseprId == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ confirm('确定要应用最低价吗?',function(){
|
|
|
+ vm.updateGoodsPrice("lowest",mseprId);
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
+ customPrice:function(){
|
|
|
+ let mseprId = getSelectedRow();
|
|
|
+ if (mseprId == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ vm.mseprId = mseprId;
|
|
|
+ $('#myModal').modal('show');
|
|
|
+ },
|
|
|
+ submitCustomPrice:function(){
|
|
|
+ vm.customPriceInput = this.$refs.customPriceInput.value
|
|
|
+ confirm('确定要应用此价格吗?',function(){
|
|
|
+ vm.updateGoodsPrice("custom",vm.mseprId);
|
|
|
+ $(".form-group input[type=text]").each(function(){
|
|
|
+ this.value = '';
|
|
|
+ })
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ updateGoodsPrice:function(type,mseprId){
|
|
|
+
|
|
|
+ var param = {'mseprId':mseprId,'type':type,'customPriceInput':vm.customPriceInput};
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "../shoperrorpricerecord/updateGoodsPrice",
|
|
|
+ contentType: "application/json",
|
|
|
+ data: JSON.stringify(param),
|
|
|
+ success: function (r) {
|
|
|
+ console.log(r);
|
|
|
+ if (r.code === 0) {
|
|
|
+ alert('操作成功', function (index) {
|
|
|
+ vm.reload();
|
|
|
+ });
|
|
|
+ vm.mseprId = '';
|
|
|
+ } else {
|
|
|
+ alert(r.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
reload: function (event) {
|
|
|
vm.showList = true;
|
|
|
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
|