diff --git a/src/api/superStore/shopMaterial.js b/src/api/superStore/shopMaterial.js
index bbb49ac4..4285224e 100644
--- a/src/api/superStore/shopMaterial.js
+++ b/src/api/superStore/shopMaterial.js
@@ -61,7 +61,7 @@ export function getMaterialListApi(data) {
// 新增商品
export function addMaterialApi(data) {
return request({
- url: '/smart-canteen/supermarket_product/add',
+ url: '/smart-canteen/supermarket_product',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@@ -85,14 +85,14 @@ export function updateMaterialApi(data) {
// 删除商品
export function removeMaterialApi(data) {
return request({
- url: '/smart-canteen/supermarket_product/del',
+ url: '/smart-canteen/supermarket_product/del/'+data.productId,
method: 'post',
headers: {
"merchant-id":"378915229716713472",
- },
- data: data
+ }
})
-}
+}
+
// 批量删除商品
export function batchRemoveMaterialApi(data) {
return request({
diff --git a/src/api/superStore/super.js b/src/api/superStore/super.js
index 057358c5..a513e401 100644
--- a/src/api/superStore/super.js
+++ b/src/api/superStore/super.js
@@ -27,7 +27,7 @@ export function supermarketPageListApi(data) {
// 超市列表-新增
export function insertSupermarketApi(data) {
return request({
- url: '/smart-canteen/supermarket_info/add',
+ url: '/smart-canteen/supermarket_info',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@@ -50,12 +50,11 @@ export function editSupermarketApi(data) {
// 超市列表-删除
export function deleteSupermarketApi(data) {
return request({
- url: '/smart-canteen/supermarket_info/del',
+ url: '/smart-canteen/supermarket_info/del/'+data.supermarketId,
method: 'post',
headers: {
"merchant-id":"378915229716713472",
- },
- data: data
+ }
})
}
diff --git a/src/api/superStore/superUitId.js b/src/api/superStore/superUitId.js
index 7a503ff6..79ec51bd 100644
--- a/src/api/superStore/superUitId.js
+++ b/src/api/superStore/superUitId.js
@@ -27,7 +27,7 @@ export function drpUnitPageListApi(data) {
// 单位列表-新增
export function addDrpUnitApi(data) {
return request({
- url: '/smart-canteen/supermarket_unit/add',
+ url: '/smart-canteen/supermarket_unit',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
@@ -49,14 +49,13 @@ export function editDrpUnitApi(data) {
}
// 单位列表-删除
-export function removeDrpUnitApi(data) {
+export function removeDrpUnitApi(unitId) {
return request({
- url: '/smart-canteen/supermarket_unit/del',
+ url: '/smart-canteen/supermarket_unit/del/'+unitId,
method: 'post',
headers: {
"merchant-id":"378915229716713472",
- },
- data: data
+ }
})
}
diff --git a/src/utils/request.js b/src/utils/request.js
index 056aae6b..542114f5 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -84,7 +84,7 @@ service.interceptors.request.use(config => {
// console.log(sessionObj)
// console.log(requestObj)
if(requestObj.data&&requestObj.data.indexOf('pageNum')==-1){
- if (sessionObj.data === requestObj.data && requestObj.time - sessionObj.time < 3000 && sessionObj.url === requestObj.url) {
+ if (sessionObj.data === requestObj.data && requestObj.time - sessionObj.time < 2000 && sessionObj.url === requestObj.url) {
console.warn(`[${sessionObj.url}]: 数据正在处理,请勿重复提交`)
return Promise.reject(new Error('数据正在处理,请勿重复提交'))
}
diff --git a/src/views/dish/dish/index.vue b/src/views/dish/dish/index.vue
index 80c97539..fd30f477 100644
--- a/src/views/dish/dish/index.vue
+++ b/src/views/dish/dish/index.vue
@@ -721,92 +721,7 @@
-
-
+
diff --git a/src/views/dish/nutritionInfo/index.vue b/src/views/dish/nutritionInfo/index.vue
index bfe9b34c..bd783024 100644
--- a/src/views/dish/nutritionInfo/index.vue
+++ b/src/views/dish/nutritionInfo/index.vue
@@ -1162,6 +1162,7 @@ export default {
}
getNutrition(data).then(response => {
this.form = response.data;
+ this.formTable = [this.form]
this.$set(this.form,"categoryId",Number(response.data.categoryId))
this.chosenType(this.form.categoryId)
this.open = true;
@@ -1257,6 +1258,7 @@ export default {
}
}
this.form[field] = newValue;
+ this.formTable[0][field] = newValue;
},
/**
@@ -1281,6 +1283,7 @@ export default {
}
// 格式化为两位小数
this.form[field] = value.toFixed(2);
+ this.formTable[0][field] = value.toFixed(2);
}
}
diff --git a/src/views/superstore/shopMaterial/components/MaterialDialog.vue b/src/views/superstore/shopMaterial/components/MaterialDialog.vue
index cc960ff7..c5252758 100644
--- a/src/views/superstore/shopMaterial/components/MaterialDialog.vue
+++ b/src/views/superstore/shopMaterial/components/MaterialDialog.vue
@@ -7,6 +7,7 @@
:close-on-click-modal="false"
:destroy-on-close="true"
@close="handleClose"
+ @open="handelOpen"
>
@@ -160,14 +161,11 @@
-
-
-
-
+
@@ -190,7 +188,8 @@ export default {
}
},
data() {
- return {
+ return {
+ loading:false,
treeAreaOptions:[],//区域树
treeTypeOptions:[],//类型树
unitOptions:[],//单位下拉
@@ -237,11 +236,18 @@ export default {
},
},
mounted() {
- this.getAreaTreeData();//获取区域树
- this.getTypeTreeData();//获取商品类别树
- this.getDrpUnitList();//获取单位类型下拉
},
methods: {
+ handelOpen(){
+ this.getAreaTreeData();//获取区域树
+ this.getDrpUnitList();//获取单位类型下拉
+ },
+ handleClose() {
+ this.$emit('update:visible', false);
+ this.$nextTick(() => {
+ this.reset();
+ });
+ },
//区域树
getAreaTreeData() {
systemAreaTreeApi({}).then((response) => {
@@ -278,7 +284,7 @@ export default {
}
this.form.unitId=null
getDrpUnitListApi(param).then((response) => {
- this.unitOptions = response.data;
+ this.unitOptions = response.rows;
// if(response.data.records.length>0){
// response.data.records.forEach(item => {
// if(item.weighType==this.form.salesMode){
@@ -329,19 +335,20 @@ export default {
submitForm() {
this.$refs.form.validate(valid => {
if (valid) {
+ this.loading=true
this.form.salePrice = Number(this.form.salePrice)*100;
this.form.prefPrice = Number(this.form.prefPrice)*100;
+ setTimeout(()=>{
+ this.$set(this.form,"salePrice",Number((this.form.salePrice/100).toFixed(2)))
+ this.$set(this.form,"prefPrice",Number((this.form.prefPrice/100).toFixed(2)))
+ this.loading=false
+ },2000)
this.$emit('submit', this.form);
+
}
});
},
-
- handleClose() {
- this.$emit('update:visible', false);
- this.$nextTick(() => {
- this.reset();
- });
- },
+
cancel() {
this.$emit('update:visible', false);
diff --git a/src/views/superstore/shopMaterial/index.vue b/src/views/superstore/shopMaterial/index.vue
index b23d35ec..ebbf90dc 100644
--- a/src/views/superstore/shopMaterial/index.vue
+++ b/src/views/superstore/shopMaterial/index.vue
@@ -341,7 +341,7 @@
-
+
diff --git a/src/views/superstore/super/index.vue b/src/views/superstore/super/index.vue
index 837065a0..e8d1d7ef 100644
--- a/src/views/superstore/super/index.vue
+++ b/src/views/superstore/super/index.vue
@@ -276,7 +276,7 @@
-->
@@ -302,6 +302,7 @@
return {
// 遮罩层
loading: true,
+ loadingBtn: false,
// 选中数组
ids: [],
// 非单个禁用
@@ -570,21 +571,24 @@
console.log(this.baseForm)
this.$refs["baseForm"].validate(valid => {//基本设置表单校验
if (valid) {
+ this.loadingBtn=true
this.baseForm.imgUrl = this.checkUrlList[0]
let param = this.baseForm
// param.configList = this.configList;
if (param.supermarketId) {
- editSupermarketApi(param).then(response => {
+ editSupermarketApi(param).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
+ this.loadingBtn = false;
this.getList();
});
} else {
- insertSupermarketApi(param).then(response => {
- this.$modal.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
+ insertSupermarketApi(param).then(response => {
+ this.$modal.msgSuccess("新增成功");
+ this.open = false;
+ this.loadingBtn = false;
+ this.getList();
+ });
}
}
});