|
@@ -130,14 +130,12 @@
|
|
|
:src="scope.row.good_thumb_img"
|
|
|
style="display: inline-block; width: 100%; height: 100%"
|
|
|
alt=""
|
|
|
- />
|
|
|
+ >
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #model="{ scope }">
|
|
|
<span v-for="(si, sii) in scope.row.specinfo" :key="si.spec_id">
|
|
|
- <span v-if="sii !== 0">--</span
|
|
|
- ><span>{{ si.spec_name }}[{{ si.spec_value }}]</span></span
|
|
|
- >
|
|
|
+ <span v-if="sii !== 0">--</span><span>{{ si.spec_name }}[{{ si.spec_value }}]</span></span>
|
|
|
</template>
|
|
|
<template #is_stock="{ scope }">
|
|
|
<span>{{ scope.row.is_stock + "" === "1" ? "库存品" : "非库存品" }} </span>
|
|
@@ -148,19 +146,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import asyncRequest from "@/apis/components/search-good-online-modal";
|
|
|
-import asyncYZRequest from "@/apis/service/youzan/othgoodsOnline";
|
|
|
-import resToken from "@/mixins/resToken";
|
|
|
-import mixinPage from "@/mixins/elPaginationHandle";
|
|
|
-import { mapGetters } from "vuex";
|
|
|
-import columns from "./columns";
|
|
|
+import asyncRequest from '@/apis/components/search-good-online-modal'
|
|
|
+import asyncYZRequest from '@/apis/service/youzan/othgoodsOnline'
|
|
|
+import resToken from '@/mixins/resToken'
|
|
|
+import mixinPage from '@/mixins/elPaginationHandle'
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
+import columns from './columns'
|
|
|
export default {
|
|
|
- name: "SearchGoodOnlineModal",
|
|
|
+ name: 'SearchGoodOnlineModal',
|
|
|
mixins: [resToken, mixinPage],
|
|
|
computed: {
|
|
|
- ...mapGetters(["tablebtnSize", "searchSize", "size"]),
|
|
|
+ ...mapGetters(['tablebtnSize', 'searchSize', 'size'])
|
|
|
},
|
|
|
- props: ["showModel", "once", "sitem", "active", "platform_type"],
|
|
|
+ props: ['showModel', 'once', 'sitem', 'active', 'platform_type'],
|
|
|
|
|
|
/**
|
|
|
* 属性集合
|
|
@@ -173,31 +171,31 @@ export default {
|
|
|
*/
|
|
|
data() {
|
|
|
return {
|
|
|
- select: "1",
|
|
|
- sinput: "",
|
|
|
+ select: '1',
|
|
|
+ sinput: '',
|
|
|
is_stock: [
|
|
|
- { id: "0", name: "非库存品" },
|
|
|
- { id: "1", name: "库存品" },
|
|
|
+ { id: '0', name: '非库存品' },
|
|
|
+ { id: '1', name: '库存品' }
|
|
|
],
|
|
|
selectLoading: false,
|
|
|
- searchName: "",
|
|
|
+ searchName: '',
|
|
|
supplierCode: [],
|
|
|
loading: true,
|
|
|
showModelThis: false,
|
|
|
parmValue: {
|
|
|
- platform_code: "",
|
|
|
- companyNo: "",
|
|
|
- is_stock: "",
|
|
|
- exam_status: "",
|
|
|
+ platform_code: '',
|
|
|
+ companyNo: '',
|
|
|
+ is_stock: '',
|
|
|
+ exam_status: '',
|
|
|
cat_id: [], // 商品属性code
|
|
|
brandid: [],
|
|
|
- skucode: "",
|
|
|
- spucode: "", // 商品编码
|
|
|
- good_name: "", // 商品名称
|
|
|
- plat_code: "",
|
|
|
+ skucode: '',
|
|
|
+ spucode: '', // 商品编码
|
|
|
+ good_name: '', // 商品名称
|
|
|
+ plat_code: '',
|
|
|
|
|
|
page: 1, // 页码
|
|
|
- size: 15, // 每页显示条数
|
|
|
+ size: 15 // 每页显示条数
|
|
|
},
|
|
|
tableData: [],
|
|
|
passwordModel: false,
|
|
@@ -208,162 +206,167 @@ 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.active);
|
|
|
- console.log(this.sitem);
|
|
|
- const { platform_code, company_id, is_stock } = this.sitem;
|
|
|
+ console.log(this.active)
|
|
|
+ console.log(this.sitem)
|
|
|
+ const { platform_code, company_id, is_stock } = this.sitem
|
|
|
|
|
|
this.parmValue = {
|
|
|
- platform_code: platform_code || "",
|
|
|
- companyNo: company_id || "", // 业务企业编号
|
|
|
- is_stock: is_stock || "",
|
|
|
+ platform_code: platform_code || '',
|
|
|
+ companyNo: company_id || '', // 业务企业编号
|
|
|
+ is_stock: is_stock || '',
|
|
|
cat_id: [], // 商品属性code
|
|
|
brandid: [],
|
|
|
- exam_status: this.active ? "3" : "",
|
|
|
- skucode: "",
|
|
|
- spucode: "", // 商品编码
|
|
|
- good_name: "", // 商品名称
|
|
|
- plat_code: "",
|
|
|
+ exam_status: this.active ? '3' : '',
|
|
|
+ skucode: '',
|
|
|
+ spucode: '', // 商品编码
|
|
|
+ good_name: '', // 商品名称
|
|
|
+ plat_code: '',
|
|
|
page: 1, // 页码
|
|
|
- size: 15, // 每页显示条数
|
|
|
- };
|
|
|
+ size: 15 // 每页显示条数
|
|
|
+ }
|
|
|
// 表格 - 分页
|
|
|
this.pageInfo = {
|
|
|
size: 15,
|
|
|
curr: 1,
|
|
|
- total: 0,
|
|
|
- };
|
|
|
- this.searchList();
|
|
|
+ total: 0
|
|
|
+ }
|
|
|
+ this.searchList()
|
|
|
},
|
|
|
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 brandidsearchChange(e) {
|
|
|
- const { id } = e;
|
|
|
- this.parmValue.brandid = id ? [id] : [];
|
|
|
- this.pageInfo.curr = 1;
|
|
|
- this.parmValue.page = 1;
|
|
|
- await this.searchList();
|
|
|
+ const { id } = e
|
|
|
+ this.parmValue.brandid = id ? [id] : []
|
|
|
+ this.pageInfo.curr = 1
|
|
|
+ this.parmValue.page = 1
|
|
|
+ await this.searchList()
|
|
|
},
|
|
|
async platform_codesearchChange(e) {
|
|
|
- const { id, code, label } = e;
|
|
|
- this.parmValue.platform_code = id ? [id] : [];
|
|
|
- this.pageInfo.curr = 1;
|
|
|
- this.parmValue.page = 1;
|
|
|
- await this.searchList();
|
|
|
+ const { id, code, label } = e
|
|
|
+ this.parmValue.platform_code = id ? [id] : []
|
|
|
+ this.pageInfo.curr = 1
|
|
|
+ this.parmValue.page = 1
|
|
|
+ await this.searchList()
|
|
|
},
|
|
|
async company_idsearchChange(e) {
|
|
|
- const { id, code, label } = e;
|
|
|
- this.parmValue.company_id = code || "";
|
|
|
- this.pageInfo.curr = 1;
|
|
|
- this.parmValue.page = 1;
|
|
|
- await this.searchList();
|
|
|
+ const { id, code, label } = e
|
|
|
+ this.parmValue.company_id = code || ''
|
|
|
+ this.pageInfo.curr = 1
|
|
|
+ this.parmValue.page = 1
|
|
|
+ await this.searchList()
|
|
|
},
|
|
|
async searchList() {
|
|
|
- this.loading = true;
|
|
|
- const model = JSON.parse(JSON.stringify(this.parmValue));
|
|
|
- model.cat_id = model.cat_id.length > 0 ? model.cat_id[model.cat_id.length - 1] : "";
|
|
|
+ this.loading = true
|
|
|
+ const model = JSON.parse(JSON.stringify(this.parmValue))
|
|
|
+ model.cat_id = model.cat_id.length > 0 ? model.cat_id[model.cat_id.length - 1] : ''
|
|
|
model.brandid =
|
|
|
- model.brandid.length > 0 ? model.brandid[model.brandid.length - 1] : "";
|
|
|
- model.spucode = this.select === "2" ? this.sinput : ""; // 商品编码
|
|
|
- model.good_name = this.select === "1" ? this.sinput : ""; // 商品名称
|
|
|
- model.plat_code = this.select === "3" ? this.sinput : "";
|
|
|
- model.skucode = this.select === "4" ? this.sinput : "";
|
|
|
+ model.brandid.length > 0 ? model.brandid[model.brandid.length - 1] : ''
|
|
|
+ model.spucode = this.select === '2' ? this.sinput : '' // 商品编码
|
|
|
+ model.good_name = this.select === '1' ? this.sinput : '' // 商品名称
|
|
|
+ model.plat_code = this.select === '3' ? this.sinput : ''
|
|
|
+ model.skucode = this.select === '4' ? this.sinput : ''
|
|
|
// model.platform_code =
|
|
|
// model.platform_code.length > 0
|
|
|
// ? model.platform_code[model.platform_code.length - 1]
|
|
|
// : "";
|
|
|
|
|
|
- const apis = this.platform_type + "" === "1" ? asyncYZRequest : asyncRequest;
|
|
|
+ const apis = this.platform_type + '' === '1' ? asyncYZRequest : asyncRequest
|
|
|
|
|
|
- const res = await apis.list(model);
|
|
|
+ const status = this.platform_type + '' === '1' ? '6' : '3'
|
|
|
+
|
|
|
+ const res = await apis.list({
|
|
|
+ ...model,
|
|
|
+ exam_status: status
|
|
|
+ })
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
- this.tableData = res.data.list;
|
|
|
+ this.tableData = res.data.list
|
|
|
this.tableData.map((e) => {
|
|
|
- e.cat_name = "";
|
|
|
+ e.cat_name = ''
|
|
|
if (e.cat_info && e.cat_info.length > 0) {
|
|
|
e.cat_info.forEach((si, sii) => {
|
|
|
- e.cat_name += `${sii !== 0 ? "_" : ""}${si.name}`;
|
|
|
- });
|
|
|
+ e.cat_name += `${sii !== 0 ? '_' : ''}${si.name}`
|
|
|
+ })
|
|
|
}
|
|
|
- return e;
|
|
|
- });
|
|
|
+ return e
|
|
|
+ })
|
|
|
|
|
|
- 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 remoteMethod(query) {
|
|
|
- this.selectLoading = true;
|
|
|
- if (query !== "") {
|
|
|
- this.options = [];
|
|
|
+ this.selectLoading = true
|
|
|
+ if (query !== '') {
|
|
|
+ this.options = []
|
|
|
const formValue = {
|
|
|
page: 1,
|
|
|
size: 100,
|
|
|
name: query,
|
|
|
- code: "",
|
|
|
- };
|
|
|
+ code: ''
|
|
|
+ }
|
|
|
|
|
|
- const 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.showModelThis = false;
|
|
|
- this.$emit("resultList", selection);
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
+ this.showModelThis = false
|
|
|
+ this.$emit('resultList', selection)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style></style>
|