Commit 72b7c588 authored by jisiyu's avatar jisiyu

add:增加启用功能

parent 7e0bb981
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"prod": "sh ./bin/start.sh production", "prod": "sh ./bin/start.sh production",
"koa": "nodemon app.js", "koa": "nodemon app.js",
"web-dev": "cross-env NODE_ENV=development vue-cli-service serve", "web-dev": "cross-env NODE_ENV=development vue-cli-service serve",
"web-dev-test": "cross-env NODE_ENV=test vue-cli-service serve",
"web-test": "cross-env NODE_ENV=test vue-cli-service build", "web-test": "cross-env NODE_ENV=test vue-cli-service build",
"web-build": "cross-env NODE_ENV=production vue-cli-service build", "web-build": "cross-env NODE_ENV=production vue-cli-service build",
"web-build-report": "cross-env NODE_ENV=production vue-cli-service build --report", "web-build-report": "cross-env NODE_ENV=production vue-cli-service build --report",
......
...@@ -244,3 +244,15 @@ exports.updateOta = async (ctx) => { ...@@ -244,3 +244,15 @@ exports.updateOta = async (ctx) => {
const res = await req(ctx, opts); const res = await req(ctx, opts);
ctx.body = res; ctx.body = res;
}; };
//商家列表-取消禁用
exports.undeleteOta = async (ctx) => {
const url = `${GOODS_URI}/goods/background/undelete_ota`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body,
};
const res = await req(ctx, opts);
ctx.body = res;
};
...@@ -69,6 +69,7 @@ router.post(`${API_VERSION}/otaList`, goods.otaList); ...@@ -69,6 +69,7 @@ router.post(`${API_VERSION}/otaList`, goods.otaList);
router.post(`${API_VERSION}/addOta`, goods.addOta); router.post(`${API_VERSION}/addOta`, goods.addOta);
router.post(`${API_VERSION}/deleteOta`, goods.deleteOta); router.post(`${API_VERSION}/deleteOta`, goods.deleteOta);
router.post(`${API_VERSION}/updateOta`, goods.updateOta); router.post(`${API_VERSION}/updateOta`, goods.updateOta);
router.post(`${API_VERSION}/undeleteOta`, goods.undeleteOta);
//生活号 //生活号
router.post(`${API_VERSION}/merchant/lifeinner/life_info`, life.get_life_info); router.post(`${API_VERSION}/merchant/lifeinner/life_info`, life.get_life_info);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<el-button type="text" :disabled="scope.row.status == 1" @click="modifyMerchant(scope.row.ota_id, scope.$index)"> <el-button type="text" :disabled="scope.row.status == 1" @click="modifyMerchant(scope.row.ota_id, scope.$index)">
修改 修改
</el-button> </el-button>
<el-button type="text" :disabled="scope.row.status == 1" @click="handleDisable(scope.row)"> <el-button type="text" @click="handleDisable(scope.row)">
{{ scope.row.status == 1 ? "启用" : "禁用" }} {{ scope.row.status == 1 ? "启用" : "禁用" }}
</el-button> </el-button>
</template> </template>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<script> <script>
import Layout from "../layout/index.vue"; import Layout from "../layout/index.vue";
import myMap from "@/pages/Activity/releaseProduc/components/myMap"; import myMap from "@/pages/Activity/releaseProduc/components/myMap";
import { otaList, addOta, deleteOta, updateOta } from "@/service/Goods/goods"; import { otaList, addOta, deleteOta, updateOta, undeleteOta } from "@/service/Goods/goods";
export default { export default {
name: "merchantManagement", name: "merchantManagement",
components: { components: {
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
}, },
//禁用 //禁用
async handleDisable(item) { async handleDisable(item) {
let res = await deleteOta({ ota_id: item.ota_id }); let res = item.status == 0 ? await deleteOta({ ota_id: item.ota_id }) : await undeleteOta({ ota_id: item.ota_id });
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
this.getOtaList(); this.getOtaList();
}, },
......
...@@ -119,3 +119,8 @@ export async function updateOta(params) { ...@@ -119,3 +119,8 @@ export async function updateOta(params) {
const res = await axios.post("/api/v1/updateOta", params); const res = await axios.post("/api/v1/updateOta", params);
return res; return res;
} }
// 商家列表-取消禁用
export async function undeleteOta(params) {
const res = await axios.post("/api/v1/undeleteOta", params);
return res;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment