Commit 7e0bb981 authored by jisiyu's avatar jisiyu

add: 商家管家

parent d94838c6
......@@ -18,11 +18,13 @@
<el-button type="text" :disabled="scope.row.status == 1" @click="modifyMerchant(scope.row.ota_id, scope.$index)">
修改
</el-button>
<el-button type="text" :disabled="scope.row.status == 1" @click="handleDisable(scope.row)">禁用</el-button>
<el-button type="text" :disabled="scope.row.status == 1" @click="handleDisable(scope.row)">
{{ scope.row.status == 1 ? "启用" : "禁用" }}
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加商家 -->
<!-- 添加商家弹窗 -->
<el-dialog title="商家编辑" v-model="merchantAdd" width="70%" :show-close="false">
<el-form class="dioFor" :model="addMerchant" :rules="rules">
<el-form-item label="商家名称" label-width="100px" prop="ota_name">
......@@ -92,7 +94,7 @@
rules: {
name: [{ required: true, message: "请输入商家名称", trigger: "blur" }],
},
//修改信息
//弹窗初始:关闭
merchantAdd: false,
addMerchant: {
ota_name: "",
......@@ -114,22 +116,25 @@
// this.addMerchant = this.merchantList[index];
this.addMerchant = JSON.parse(JSON.stringify(this.merchantList[index]));
}
//点击“添加商家”按钮,弹窗打开
this.merchantAdd = true;
},
async getOtaList() {
const { result, code, reason } = await otaList();
this.merchantList = result.list;
if (code !== 0) return this.$message.error(reason);
this.merchantList = result.list;
},
//保存
async saveMerchant() {
let { result, code, reason } = this.addMerchant.ota_id ? await updateOta(this.addMerchant) : await addOta(this.addMerchant);
if (code !== 0) return this.$message.error(reason);
await this.getOtaList();
//点击保存时,弹窗关闭
this.merchantAdd = false;
},
// 取消
addCancel() {
//点击取消时,弹窗关闭
this.merchantAdd = false;
this.resetDate();
},
......
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