|
@@ -1,18 +1,18 @@
|
|
|
<template>
|
|
|
<el-dialog
|
|
|
+ v-loading="loading"
|
|
|
:title="'选择已上线的商品'"
|
|
|
:center="true"
|
|
|
align="left"
|
|
|
top="8vh"
|
|
|
width="1040px"
|
|
|
- @close="showModelThis = false"
|
|
|
:close-on-click-modal="false"
|
|
|
:visible.sync="showModelThis"
|
|
|
- v-loading="loading"
|
|
|
element-loading-text="拼命加载中"
|
|
|
element-loading-spinner="el-icon-loading"
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
append-to-body
|
|
|
+ @close="showModelThis = false"
|
|
|
>
|
|
|
<el-card style="margin-top: -20px" class="modal-form-style">
|
|
|
<ex-table
|
|
@@ -41,18 +41,17 @@
|
|
|
<el-col :span="24">
|
|
|
<el-col :span="4" style="width: 220px">
|
|
|
<el-input
|
|
|
- :size="'mini'"
|
|
|
v-model="parmValue.buy_num"
|
|
|
+ :size="'mini'"
|
|
|
:maxlength="40"
|
|
|
disabled
|
|
|
placeholder="起订量"
|
|
|
- ><template slot="prepend">起订量:</template></el-input
|
|
|
- >
|
|
|
+ ><template slot="prepend">起订量:</template></el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="4" style="width: 460px; padding: 0 0 0 10px">
|
|
|
<el-input
|
|
|
- :size="'mini'"
|
|
|
v-model="company"
|
|
|
+ :size="'mini'"
|
|
|
:maxlength="40"
|
|
|
clearable
|
|
|
disabled
|
|
@@ -79,18 +78,17 @@
|
|
|
<el-col :span="24" style="padding: 10px 0 0 0">
|
|
|
<el-col :span="4" style="width: 220px">
|
|
|
<el-input
|
|
|
- :size="'mini'"
|
|
|
v-model="parmValue.price"
|
|
|
+ :size="'mini'"
|
|
|
:maxlength="40"
|
|
|
disabled
|
|
|
placeholder="预算单价"
|
|
|
- ><template slot="prepend">售 价 ≤</template></el-input
|
|
|
- >
|
|
|
+ ><template slot="prepend">售 价 ≤</template></el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="4" style="width: 250px; padding: 0 0 0 10px">
|
|
|
<el-input
|
|
|
- :size="'mini'"
|
|
|
v-model="platform_name"
|
|
|
+ :size="'mini'"
|
|
|
:maxlength="40"
|
|
|
clearable
|
|
|
disabled
|
|
@@ -100,11 +98,11 @@
|
|
|
<el-col :span="4" style="width: 280px; padding: 0 0 0 10px">
|
|
|
<good-class
|
|
|
:value="parmValue.cat_id"
|
|
|
- @handleChange="goods_class_change"
|
|
|
:disabled="sitem.good_type + '' === '1'"
|
|
|
:size="'mini'"
|
|
|
- :isDetail="sitem.good_type + '' === '1'"
|
|
|
+ :is-detail="sitem.good_type + '' === '1'"
|
|
|
:placeholder="'分类'"
|
|
|
+ @handleChange="goods_class_change"
|
|
|
/>
|
|
|
</el-col>
|
|
|
<el-col :span="3" style="width: 66px; float: right">
|
|
@@ -127,19 +125,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import asyncRequest from "@/apis/service/sellOut/project";
|
|
|
+import asyncRequest from '@/apis/service/sellOut/project'
|
|
|
|
|
|
-import resToken from "@/mixins/resToken";
|
|
|
-import mixinPage from "@/mixins/elPaginationHandle";
|
|
|
-import { mapGetters } from "vuex";
|
|
|
-import columns from "./columns";
|
|
|
+import resToken from '@/mixins/resToken'
|
|
|
+import mixinPage from '@/mixins/elPaginationHandle'
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
+import columns from './columns'
|
|
|
export default {
|
|
|
- name: "searchGoodOnlineTableModal",
|
|
|
+ name: 'SearchGoodOnlineTableModal',
|
|
|
mixins: [resToken, mixinPage],
|
|
|
computed: {
|
|
|
- ...mapGetters(["tablebtnSize", "searchSize", "size"]),
|
|
|
+ ...mapGetters(['tablebtnSize', 'searchSize', 'size'])
|
|
|
},
|
|
|
- props: ["showModel", "sitem"],
|
|
|
+ props: ['showModel', 'sitem'],
|
|
|
|
|
|
/**
|
|
|
* 属性集合
|
|
@@ -153,23 +151,23 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
options: [
|
|
|
- { id: "0", name: "非库存品" },
|
|
|
- { id: "1", name: "库存品" },
|
|
|
+ { id: '0', name: '非库存品' },
|
|
|
+ { id: '1', name: '库存品' }
|
|
|
],
|
|
|
- company: "",
|
|
|
- platform_name: "",
|
|
|
+ company: '',
|
|
|
+ platform_name: '',
|
|
|
selectLoading: false,
|
|
|
- searchName: "",
|
|
|
+ searchName: '',
|
|
|
loading: true,
|
|
|
showModelThis: false,
|
|
|
parmValue: {
|
|
|
- buy_num: "", // 商品购买数量
|
|
|
- price: "", // 单价
|
|
|
+ buy_num: '', // 商品购买数量
|
|
|
+ price: '', // 单价
|
|
|
cat_id: [], // 分类id
|
|
|
- companyNo: "", // 业务公司id
|
|
|
- platform_code: "", //平台编号id
|
|
|
+ companyNo: '', // 业务公司id
|
|
|
+ platform_code: '', // 平台编号id
|
|
|
page: 1, // 页码
|
|
|
- size: 15, // 每页显示条数
|
|
|
+ size: 15 // 每页显示条数
|
|
|
},
|
|
|
tableData: [],
|
|
|
passwordModel: false,
|
|
@@ -180,36 +178,36 @@ export default {
|
|
|
// 表格 - 参数
|
|
|
table: {
|
|
|
stripe: true,
|
|
|
- border: true,
|
|
|
+ border: true
|
|
|
// _defaultHeader_: ["setcol"],
|
|
|
},
|
|
|
// 表格 - 分页
|
|
|
pageInfo: {
|
|
|
size: 15,
|
|
|
curr: 1,
|
|
|
- total: 0,
|
|
|
+ total: 0
|
|
|
},
|
|
|
// 表格 - 列参数
|
|
|
- columns: columns,
|
|
|
- };
|
|
|
+ columns: columns
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
- showModel: function (val) {
|
|
|
- this.showModelThis = val;
|
|
|
+ showModel: function(val) {
|
|
|
+ this.showModelThis = val
|
|
|
if (val) {
|
|
|
- this.restSearch();
|
|
|
+ this.restSearch()
|
|
|
}
|
|
|
},
|
|
|
showModelThis(val) {
|
|
|
if (!val) {
|
|
|
- this.$emit("cancel");
|
|
|
+ this.$emit('cancel')
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
restSearch() {
|
|
|
- console.log(this.sitem);
|
|
|
+ console.log(this.sitem)
|
|
|
const {
|
|
|
platform_id,
|
|
|
companyNo,
|
|
@@ -218,126 +216,126 @@ export default {
|
|
|
budget_price,
|
|
|
company,
|
|
|
platform_name,
|
|
|
- cat_info,
|
|
|
- } = this.sitem;
|
|
|
- console.log(this.sitem);
|
|
|
- this.company = company;
|
|
|
- this.platform_name = platform_name;
|
|
|
- let list = [];
|
|
|
+ cat_info
|
|
|
+ } = this.sitem
|
|
|
+ console.log(this.sitem)
|
|
|
+ this.company = company
|
|
|
+ this.platform_name = platform_name
|
|
|
+ const list = []
|
|
|
if (cat_info && cat_info.length > 0) {
|
|
|
cat_info.forEach((s) => {
|
|
|
- list.push(s.id);
|
|
|
- });
|
|
|
+ list.push(s.id)
|
|
|
+ })
|
|
|
}
|
|
|
this.parmValue = {
|
|
|
buy_num: num, // 商品购买数量
|
|
|
price: budget_price, // 单价
|
|
|
cat_id: list, // 分类id
|
|
|
companyNo: companyNo, // 业务公司id
|
|
|
- platform_code: platform_id, //平台编号id
|
|
|
+ platform_code: platform_id, // 平台编号id
|
|
|
page: 1, // 页码
|
|
|
- size: 15, // 每页显示条数
|
|
|
- };
|
|
|
+ size: 15 // 每页显示条数
|
|
|
+ }
|
|
|
// 表格 - 分页
|
|
|
this.pageInfo = {
|
|
|
size: 15,
|
|
|
curr: 1,
|
|
|
- total: 0,
|
|
|
- };
|
|
|
- this.searchList();
|
|
|
+ total: 0
|
|
|
+ }
|
|
|
+ this.searchList()
|
|
|
},
|
|
|
async searchList() {
|
|
|
- this.loading = true;
|
|
|
- let model = JSON.parse(JSON.stringify(this.parmValue));
|
|
|
- const { cat_id } = model;
|
|
|
- model.cat_id = cat_id && cat_id.length > 0 ? cat_id[cat_id.length - 1] : "";
|
|
|
- const res = await asyncRequest.get_good_online_list(model);
|
|
|
+ this.loading = true
|
|
|
+ const model = JSON.parse(JSON.stringify(this.parmValue))
|
|
|
+ const { cat_id } = model
|
|
|
+ model.cat_id = cat_id && cat_id.length > 0 ? cat_id[cat_id.length - 1] : ''
|
|
|
+ const res = await asyncRequest.get_good_online_list(model)
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
- this.tableData = res.data.list;
|
|
|
+ this.tableData = res.data.list
|
|
|
this.tableData.map((v) => {
|
|
|
- v.cat_name = "";
|
|
|
+ v.cat_name = ''
|
|
|
if (v.cat_info && v.cat_info.length > 0) {
|
|
|
v.cat_info.forEach((x, xi) => {
|
|
|
- v.cat_name += `${xi !== 0 ? "_" : ""}${x.name}`;
|
|
|
- });
|
|
|
- return v;
|
|
|
+ v.cat_name += `${xi !== 0 ? '_' : ''}${x.name}`
|
|
|
+ })
|
|
|
+ return v
|
|
|
}
|
|
|
- this.setNum(v.sale_price);
|
|
|
+ this.setNum(v.sale_price)
|
|
|
|
|
|
- return v;
|
|
|
- });
|
|
|
+ return v
|
|
|
+ })
|
|
|
//
|
|
|
- this.pageInfo.total = Number(res.data.count);
|
|
|
+ this.pageInfo.total = Number(res.data.count)
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();
|
|
|
+ await this.logout()
|
|
|
} else {
|
|
|
- this.tableData = [];
|
|
|
- this.pageInfo.total = 0;
|
|
|
+ this.tableData = []
|
|
|
+ this.pageInfo.total = 0
|
|
|
}
|
|
|
- this.loading = false;
|
|
|
+ this.loading = false
|
|
|
},
|
|
|
async goods_class_change(e) {
|
|
|
- this.parmValue.cat_id = e;
|
|
|
- this.pageInfo.curr = 1;
|
|
|
- this.parmValue.page = 1;
|
|
|
- await this.searchList();
|
|
|
+ this.parmValue.cat_id = e
|
|
|
+ this.pageInfo.curr = 1
|
|
|
+ this.parmValue.page = 1
|
|
|
+ await this.searchList()
|
|
|
},
|
|
|
async remoteMethod(query) {
|
|
|
- this.selectLoading = true;
|
|
|
- if (query !== "") {
|
|
|
- this.options = [];
|
|
|
- let formValue = {
|
|
|
+ this.selectLoading = true
|
|
|
+ if (query !== '') {
|
|
|
+ this.options = []
|
|
|
+ const formValue = {
|
|
|
page: 1,
|
|
|
size: 100,
|
|
|
name: query,
|
|
|
- code: "",
|
|
|
- };
|
|
|
+ code: ''
|
|
|
+ }
|
|
|
|
|
|
- let res = await asyncRequest.supplierList(formValue);
|
|
|
+ const res = await asyncRequest.supplierList(formValue)
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
- const { list } = res.data;
|
|
|
- this.options = list;
|
|
|
+ const { list } = res.data
|
|
|
+ this.options = list
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();
|
|
|
+ await this.logout()
|
|
|
} else {
|
|
|
- this.$message.warning(res.message);
|
|
|
+ this.$message.warning(res.message)
|
|
|
}
|
|
|
} else {
|
|
|
- this.options = [];
|
|
|
+ this.options = []
|
|
|
}
|
|
|
- this.selectLoading = false;
|
|
|
+ this.selectLoading = false
|
|
|
},
|
|
|
async resultList(selection) {
|
|
|
if (selection && selection.length > 1 && this.once) {
|
|
|
- this.$message.warning("只能选择一条商品信息!");
|
|
|
- return;
|
|
|
+ this.$message.warning('只能选择一条商品信息!')
|
|
|
+ return
|
|
|
}
|
|
|
- this.loading = true;
|
|
|
- let model = {
|
|
|
+ this.loading = true
|
|
|
+ const model = {
|
|
|
pgNo: this.sitem.pgNo,
|
|
|
spuCode: [],
|
|
|
- source: "1",
|
|
|
- };
|
|
|
+ source: '1'
|
|
|
+ }
|
|
|
selection.forEach((a) => {
|
|
|
- model.spuCode.push(a.skuCode);
|
|
|
- });
|
|
|
- let { code, data, message } = await asyncRequest.project_online_good_add(model);
|
|
|
- this.loading = false;
|
|
|
+ model.spuCode.push(a.skuCode)
|
|
|
+ })
|
|
|
+ const { code, data, message } = await asyncRequest.project_online_good_add(model)
|
|
|
+ this.loading = false
|
|
|
if (code === 0) {
|
|
|
this.$notify.success({
|
|
|
- title: "添加成功!",
|
|
|
- message: "",
|
|
|
- });
|
|
|
- this.showModelThis = false;
|
|
|
- this.$emit("submitRes", this.sitem.pgNo_index);
|
|
|
+ title: '添加成功!',
|
|
|
+ message: ''
|
|
|
+ })
|
|
|
+ this.showModelThis = false
|
|
|
+ this.$emit('submitRes', this.sitem.pgNo_index)
|
|
|
} else if (code >= 100 && code <= 104) {
|
|
|
- await this.logout();
|
|
|
+ await this.logout()
|
|
|
} else {
|
|
|
- this.$message.warning(message);
|
|
|
+ this.$message.warning(message)
|
|
|
}
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style></style>
|