|
@@ -1,30 +1,30 @@
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
- .avatar-uploader .el-upload {
|
|
|
|
|
- border: 1px dashed #d9d9d9;
|
|
|
|
|
- border-radius: 6px;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.avatar-uploader .el-upload {
|
|
|
|
|
+ border: 1px dashed #d9d9d9;
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- .avatar-uploader .el-upload:hover {
|
|
|
|
|
- border-color: #409eff;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.avatar-uploader .el-upload:hover {
|
|
|
|
|
+ border-color: #409eff;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- .avatar-uploader-icon {
|
|
|
|
|
- font-size: 28px;
|
|
|
|
|
- color: #8c939d;
|
|
|
|
|
- width: 178px;
|
|
|
|
|
- height: 178px;
|
|
|
|
|
- line-height: 178px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.avatar-uploader-icon {
|
|
|
|
|
+ font-size: 28px;
|
|
|
|
|
+ color: #8c939d;
|
|
|
|
|
+ width: 178px;
|
|
|
|
|
+ height: 178px;
|
|
|
|
|
+ line-height: 178px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- .avatar {
|
|
|
|
|
- width: 178px;
|
|
|
|
|
- height: 178px;
|
|
|
|
|
- display: block;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.avatar {
|
|
|
|
|
+ width: 178px;
|
|
|
|
|
+ height: 178px;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|
|
|
<template>
|
|
<template>
|
|
|
<section class="content">
|
|
<section class="content">
|
|
@@ -34,14 +34,28 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
|
<el-form-item label="股票名称">
|
|
<el-form-item label="股票名称">
|
|
|
- <el-input clearable @clear="getData()" v-model="queryParams.stock_name" placeholder="请输入股票名称/代码"
|
|
|
|
|
- size="mini"></el-input>
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @clear="getData()"
|
|
|
|
|
+ v-model="queryParams.stock_name"
|
|
|
|
|
+ placeholder="请输入股票名称/代码"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
|
<el-form-item label-width="10" style="margin-left: 10px">
|
|
<el-form-item label-width="10" style="margin-left: 10px">
|
|
|
- <el-button type="primary" @click="getData" size="mini">筛选</el-button>
|
|
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增点评</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="getData" size="mini"
|
|
|
|
|
+ >筛选</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="handleAdd"
|
|
|
|
|
+ >新增点评</el-button
|
|
|
|
|
+ >
|
|
|
<!-- <el-button
|
|
<!-- <el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
icon="el-icon-plus"
|
|
@@ -53,48 +67,90 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
- <el-table v-loading="loading" :data="list" style="width: 100%; margin-top: 10px" height="50vh">
|
|
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ v-loading="loading"
|
|
|
|
|
+ :data="list"
|
|
|
|
|
+ style="width: 100%; margin-top: 10px"
|
|
|
|
|
+ height="50vh"
|
|
|
|
|
+ >
|
|
|
<el-table-column align="center" prop="stock_name" label="股票名称" />
|
|
<el-table-column align="center" prop="stock_name" label="股票名称" />
|
|
|
<el-table-column align="center" prop="stock_code" label="股票代码" />
|
|
<el-table-column align="center" prop="stock_code" label="股票代码" />
|
|
|
<el-table-column label="图片">
|
|
<el-table-column label="图片">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-image style="width: 80px; height: 60px" :src="scope.row.img" :preview-src-list="[scope.row.img]">
|
|
|
|
|
|
|
+ <el-image
|
|
|
|
|
+ style="width: 80px; height: 60px"
|
|
|
|
|
+ :src="scope.row.img"
|
|
|
|
|
+ :preview-src-list="[scope.row.img]"
|
|
|
|
|
+ >
|
|
|
</el-image>
|
|
</el-image>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column align="center" prop="content" label="点评内容">
|
|
<el-table-column align="center" prop="content" label="点评内容">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- {{scope.row.content.substring(0,20)}}...
|
|
|
|
|
|
|
+ {{ scope.row.content.substring(0, 20) }}...
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column align="center" prop="ctime" label="创建时间" />
|
|
<el-table-column align="center" prop="ctime" label="创建时间" />
|
|
|
<el-table-column align="center" prop="date" label="操作" width="320">
|
|
<el-table-column align="center" prop="date" label="操作" width="320">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="edit(scope.row.id)" size="mini" type="warning">编辑</el-button>
|
|
|
|
|
- <el-button @click="del(scope.row.id)" size="mini" type="danger">删除</el-button>
|
|
|
|
|
|
|
+ <el-button @click="edit(scope.row.id)" size="mini" type="warning"
|
|
|
|
|
+ >编辑</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button @click="del(scope.row.id)" size="mini" type="danger"
|
|
|
|
|
+ >删除</el-button
|
|
|
|
|
+ >
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
- <Page ref="pageButton" :current="form.page" :page_size="form.page_size" :total="total" @pageChange="gopage" />
|
|
|
|
|
|
|
+ <Page
|
|
|
|
|
+ ref="pageButton"
|
|
|
|
|
+ :current="form.page"
|
|
|
|
|
+ :page_size="form.page_size"
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ @pageChange="gopage"
|
|
|
|
|
+ />
|
|
|
<!-- 新增用户 -->
|
|
<!-- 新增用户 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="股票" prop="stock_id">
|
|
<el-form-item label="股票" prop="stock_id">
|
|
|
- <el-select @change="changeStock" v-model="form.stock_id" placeholder="请输入股票名称" filterable remote
|
|
|
|
|
- :remote-method="remoteMethod">
|
|
|
|
|
- <el-option v-for="item in stockList" :key="item.value" :label="item.label" :value="item.id">
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ @change="changeStock"
|
|
|
|
|
+ v-model="form.stock_id"
|
|
|
|
|
+ placeholder="请输入股票名称"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ remote
|
|
|
|
|
+ :remote-method="remoteMethod"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in stockList"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ >
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="图片" prop="">
|
|
<el-form-item label="图片" prop="">
|
|
|
- <el-upload class="avatar-uploader" action="/api/admin/uploadfile" :data="{watermark:0}"
|
|
|
|
|
- :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
|
|
|
|
|
|
|
+ <el-upload
|
|
|
|
|
+ class="avatar-uploader"
|
|
|
|
|
+ action="/api/admin/uploadfile"
|
|
|
|
|
+ :data="{ watermark: 0 }"
|
|
|
|
|
+ :show-file-list="false"
|
|
|
|
|
+ :on-success="handleAvatarSuccess"
|
|
|
|
|
+ :before-upload="beforeAvatarUpload"
|
|
|
|
|
+ >
|
|
|
<img v-if="form.img" :src="form.img" class="avatar" />
|
|
<img v-if="form.img" :src="form.img" class="avatar" />
|
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="点评内容" prop="content">
|
|
<el-form-item label="点评内容" prop="content">
|
|
|
- <el-input clearable v-model="form.content" placeholder="请输入点评内容" type="textarea" rows=10></el-input>
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ clearable
|
|
|
|
|
+ v-model="form.content"
|
|
|
|
|
+ placeholder="请输入点评内容"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ rows="10"
|
|
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -105,171 +161,179 @@
|
|
|
</section>
|
|
</section>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
- import Page from "../../components/Page";
|
|
|
|
|
- export default {
|
|
|
|
|
- components: {
|
|
|
|
|
- Page,
|
|
|
|
|
- },
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- loading: false,
|
|
|
|
|
- queryParams: {
|
|
|
|
|
- page: 1,
|
|
|
|
|
- },
|
|
|
|
|
- form: {},
|
|
|
|
|
- form1: {},
|
|
|
|
|
- form2: {},
|
|
|
|
|
- list: [{}, {}],
|
|
|
|
|
- total: 0,
|
|
|
|
|
- title: "新增用户",
|
|
|
|
|
- open: false,
|
|
|
|
|
- stockList: [],
|
|
|
|
|
- rules: {
|
|
|
|
|
- username: [{
|
|
|
|
|
|
|
+import Page from "../../components/Page";
|
|
|
|
|
+export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ Page,
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ queryParams: {
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ },
|
|
|
|
|
+ form: {},
|
|
|
|
|
+ form1: {},
|
|
|
|
|
+ form2: {},
|
|
|
|
|
+ list: [{}, {}],
|
|
|
|
|
+ total: 0,
|
|
|
|
|
+ title: "新增用户",
|
|
|
|
|
+ open: false,
|
|
|
|
|
+ stockList: [],
|
|
|
|
|
+ rules: {
|
|
|
|
|
+ username: [
|
|
|
|
|
+ {
|
|
|
required: true,
|
|
required: true,
|
|
|
message: "请输入用户名",
|
|
message: "请输入用户名",
|
|
|
- trigger: "blur"
|
|
|
|
|
- }, ],
|
|
|
|
|
- player_type: [{
|
|
|
|
|
|
|
+ trigger: "blur",
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ player_type: [
|
|
|
|
|
+ {
|
|
|
required: true,
|
|
required: true,
|
|
|
message: "请选择用户类型",
|
|
message: "请选择用户类型",
|
|
|
- trigger: "change"
|
|
|
|
|
- }, ],
|
|
|
|
|
- phone: [{
|
|
|
|
|
|
|
+ trigger: "change",
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ phone: [
|
|
|
|
|
+ {
|
|
|
required: true,
|
|
required: true,
|
|
|
message: "请输入用户手机号",
|
|
message: "请输入用户手机号",
|
|
|
- trigger: "blur"
|
|
|
|
|
- }, ],
|
|
|
|
|
- avatar: [{
|
|
|
|
|
|
|
+ trigger: "blur",
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ avatar: [
|
|
|
|
|
+ {
|
|
|
required: true,
|
|
required: true,
|
|
|
message: "请输入用户手机号",
|
|
message: "请输入用户手机号",
|
|
|
- trigger: "change"
|
|
|
|
|
- }, ],
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
- del(id) {
|
|
|
|
|
- this.$confirm("删除用户会删除相关数据,确定删除吗?", "提示", {
|
|
|
|
|
- type: "warning",
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- this.$api.delStockNBComments({
|
|
|
|
|
- id: id
|
|
|
|
|
- }).then((res) => {
|
|
|
|
|
|
|
+ trigger: "change",
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ del(id) {
|
|
|
|
|
+ this.$confirm("删除用户会删除相关数据,确定删除吗?", "提示", {
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ this.$api
|
|
|
|
|
+ .delStockNBComments({
|
|
|
|
|
+ id: id,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: "删除成功",
|
|
message: "删除成功",
|
|
|
type: "success",
|
|
type: "success",
|
|
|
});
|
|
});
|
|
|
this.getData();
|
|
this.getData();
|
|
|
});
|
|
});
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- gopage(size) {
|
|
|
|
|
- if (size) {
|
|
|
|
|
- this.queryParams.page_size = size;
|
|
|
|
|
- }
|
|
|
|
|
- this.queryParams.page = this.$refs.pageButton.page;
|
|
|
|
|
- this.getData();
|
|
|
|
|
- },
|
|
|
|
|
- getData() {
|
|
|
|
|
- this.loading = true;
|
|
|
|
|
- this.$api.getStockNBCommentsList(this.queryParams).then((res) => {
|
|
|
|
|
- this.list = res.data.data.list;
|
|
|
|
|
- this.total = res.data.data.total;
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- handleAdd() {
|
|
|
|
|
- this.open = true;
|
|
|
|
|
- this.title = "新增牛人点评";
|
|
|
|
|
- this.form = {};
|
|
|
|
|
- },
|
|
|
|
|
- edit(id) {
|
|
|
|
|
- this.title = "编辑牛人点评";
|
|
|
|
|
- this.$api.getStockNBCommentsInfo({
|
|
|
|
|
- id: id
|
|
|
|
|
- }).then((res) => {
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ gopage(size) {
|
|
|
|
|
+ if (size) {
|
|
|
|
|
+ this.queryParams.page_size = size;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.queryParams.page = this.$refs.pageButton.page;
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ },
|
|
|
|
|
+ getData() {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ this.$api.getStockNBCommentsList(this.queryParams).then((res) => {
|
|
|
|
|
+ this.list = res.data.data.list;
|
|
|
|
|
+ this.total = res.data.data.total;
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ handleAdd() {
|
|
|
|
|
+ this.open = true;
|
|
|
|
|
+ this.title = "新增牛人点评";
|
|
|
|
|
+ this.form = {};
|
|
|
|
|
+ },
|
|
|
|
|
+ edit(id) {
|
|
|
|
|
+ this.title = "编辑牛人点评";
|
|
|
|
|
+ this.$api
|
|
|
|
|
+ .getStockNBCommentsInfo({
|
|
|
|
|
+ id: id,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
this.form = res.data.data;
|
|
this.form = res.data.data;
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
});
|
|
});
|
|
|
- },
|
|
|
|
|
- black(row) {
|
|
|
|
|
- this.$api.commentsBlack({
|
|
|
|
|
- id: row.id
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- this.getData()
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ black(row) {
|
|
|
|
|
+ this.$api
|
|
|
|
|
+ .commentsBlack({
|
|
|
|
|
+ id: row.id,
|
|
|
})
|
|
})
|
|
|
- },
|
|
|
|
|
- handleAvatarSuccess(res, file) {
|
|
|
|
|
- this.form.img = res.data.url;
|
|
|
|
|
- console.log(this.form.img)
|
|
|
|
|
- },
|
|
|
|
|
- beforeAvatarUpload(file) {
|
|
|
|
|
- return;
|
|
|
|
|
- const isJPG = file.type === "image/jpeg";
|
|
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ handleAvatarSuccess(res, file) {
|
|
|
|
|
+ this.form.img = res.data.url;
|
|
|
|
|
+ console.log(this.form.img);
|
|
|
|
|
+ },
|
|
|
|
|
+ beforeAvatarUpload(file) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ const isJPG = file.type === "image/jpeg";
|
|
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
|
|
|
|
|
- if (!isJPG) {
|
|
|
|
|
- this.$message.error("上传头像图片只能是 JPG 格式!");
|
|
|
|
|
- }
|
|
|
|
|
- if (!isLt2M) {
|
|
|
|
|
- this.$message.error("上传头像图片大小不能超过 2MB!");
|
|
|
|
|
- }
|
|
|
|
|
- return isJPG && isLt2M;
|
|
|
|
|
- },
|
|
|
|
|
- /** 提交按钮 */
|
|
|
|
|
- submitForm() {
|
|
|
|
|
- this.$refs["form"].validate((valid) => {
|
|
|
|
|
- if (valid) {
|
|
|
|
|
- if (this.form.id != null) {
|
|
|
|
|
- this.$api.editStockNBComments(this.form).then((res) => {
|
|
|
|
|
- if (res.data.code == 0) {
|
|
|
|
|
- this.msgSuccess("成功!");
|
|
|
|
|
- this.open = false;
|
|
|
|
|
- this.getData();
|
|
|
|
|
- } else {
|
|
|
|
|
- this.msgError(res.data.message);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$api.addStockNBComments(this.form).then((res) => {
|
|
|
|
|
- if (res.data.code == 0) {
|
|
|
|
|
- this.msgSuccess("成功!");
|
|
|
|
|
- this.open = false;
|
|
|
|
|
- this.getData();
|
|
|
|
|
- } else {
|
|
|
|
|
- this.msgError(res.data.message);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (!isJPG) {
|
|
|
|
|
+ this.$message.error("上传头像图片只能是 JPG 格式!");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!isLt2M) {
|
|
|
|
|
+ this.$message.error("上传头像图片大小不能超过 2MB!");
|
|
|
|
|
+ }
|
|
|
|
|
+ return isJPG && isLt2M;
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 提交按钮 */
|
|
|
|
|
+ submitForm() {
|
|
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ if (this.form.id != null) {
|
|
|
|
|
+ this.$api.editStockNBComments(this.form).then((res) => {
|
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
|
+ this.msgSuccess("成功!");
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.msgError(res.data.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$api.addStockNBComments(this.form).then((res) => {
|
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
|
+ this.msgSuccess("成功!");
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.msgError(res.data.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- remoteMethod(query) {
|
|
|
|
|
- if (query !== '') {
|
|
|
|
|
- this.loading = true;
|
|
|
|
|
- this.$api.getStockSearchList({
|
|
|
|
|
- name: query
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- this.stockList = res.data.data
|
|
|
|
|
- this.$set(this.stockList, res.data.data)
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
- this.stockList = [];
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- changeStock(val) {
|
|
|
|
|
- var obj = {}
|
|
|
|
|
- obj = this.stockList.find(function(item){
|
|
|
|
|
- return item.id === val;
|
|
|
|
|
- })
|
|
|
|
|
- this.form.stock_name = obj.name
|
|
|
|
|
- this.form.stock_code = obj.code
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
- created() {
|
|
|
|
|
- this.getData();
|
|
|
|
|
- },
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ remoteMethod(query) {
|
|
|
|
|
+ if (query !== "") {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ this.$api
|
|
|
|
|
+ .getStockSearchList({
|
|
|
|
|
+ name: query,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.stockList = res.data.data;
|
|
|
|
|
+ this.$set(this.stockList, res.data.data);
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.stockList = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|