<template>
|
<div ref="container" class="page-list-container">
|
<!--数据Table-->
|
<yrt-data-list :ref="dataListRef" :editor-ref="editorRef" :data-options="dataOptions" :fields.sync="dataListOptions.fields" :buttons="dataListOptions.buttons" :button-click="buttonClick" :data-list-selections.sync="dataListSelections" :auth-nodes="authNodes">
|
</yrt-data-list>
|
|
<!--数据编辑器Editor-->
|
<yrt-editor :ref="editorRef" :data-list-ref="dataListRef" v-bind="editorOptions" :data-options="dataOptions" :action.sync="editorOptions.action" :visible.sync="editorOptions.
|
config.visible" :detail-button-click="detailButtonClick" :auth-nodes="authNodes">
|
</yrt-editor>
|
|
<el-dialog :visible.sync="dialogVisible" title="获取物料信息" width="700px">
|
<el-form ref="form" :model="form" label-width="120px">
|
<el-form-item label="搜索关键词">
|
<el-input v-model="form.searchKey" class="w-300"></el-input>
|
</el-form-item>
|
</el-form>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button type="primary" @click="getProduct">开始获取</el-button>
|
</span>
|
</el-dialog>
|
|
</div>
|
</template>
|
|
<script>
|
import baseLayout from "@/components/common/base-layout.vue";
|
|
export default {
|
name: "interface-weidian-product",
|
components: {},
|
mixins: [baseLayout],
|
data() {
|
return {
|
// 显示拉取弹出窗口
|
dialogVisible: false,
|
form: {
|
searchKey: null // 搜索关键词
|
}
|
};
|
},
|
methods: {
|
// 列表页面按钮点击事件
|
buttonClick(authNode) {
|
switch (authNode) {
|
case "getProduct":
|
// 显示对话框
|
this.dialogVisible = true;
|
return true;
|
}
|
},
|
// 获取accessToken
|
getProduct() {
|
if (!this.form.searchKey) {
|
this.$message.error("请输入关键词");
|
return;
|
}
|
|
const url = "/api/interface/weidian/basicInfo/getProduct";
|
const params = {
|
searchKey: this.form.searchKey
|
};
|
this.common.ajax(
|
url,
|
params,
|
res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
this.dataList.reload();
|
this.dialogVisible = false;
|
}
|
},
|
true
|
);
|
}
|
}
|
};
|
</script>
|