|
@@ -39,31 +39,25 @@
|
|
|
<div style="width: 100%">
|
|
|
<el-row style="margin-top: -15px">
|
|
|
<el-col :span="24">
|
|
|
- <el-col :span="4" style="width: 280px; padding: 0 0 0 0px">
|
|
|
- <el-input
|
|
|
+ <el-col :span="4" style="width: 210px">
|
|
|
+ <search-brand
|
|
|
+ :value="parmValue.brandid"
|
|
|
+ :disabled="false"
|
|
|
:size="'mini'"
|
|
|
- v-model="parmValue.good_code"
|
|
|
- :maxlength="40"
|
|
|
- clearable
|
|
|
- placeholder="商品分类"
|
|
|
+ :isDetail="false"
|
|
|
+ :names="''"
|
|
|
+ :placeholder="'品牌'"
|
|
|
+ @searchChange="brandidsearchChange"
|
|
|
/>
|
|
|
</el-col>
|
|
|
- <el-col :span="4" style="width: 190px; padding: 0 0 0 10px">
|
|
|
- <el-input
|
|
|
- :size="'mini'"
|
|
|
- v-model="parmValue.good_code"
|
|
|
- :maxlength="40"
|
|
|
- clearable
|
|
|
- placeholder="所属平台"
|
|
|
- />
|
|
|
- </el-col>
|
|
|
- <el-col :span="4" style="width: 260px; padding: 0 0 0 10px">
|
|
|
- <el-input
|
|
|
- :size="'mini'"
|
|
|
- v-model="parmValue.good_code"
|
|
|
- :maxlength="40"
|
|
|
- clearable
|
|
|
- placeholder="商品编号"
|
|
|
+ <el-col :span="6" style="width: 370px; padding: 0 0 0 10px">
|
|
|
+ <good-class
|
|
|
+ :value="parmValue.cat_id"
|
|
|
+ @handleChange="goods_class_change"
|
|
|
+ :disabled="false"
|
|
|
+ :size="searchSize"
|
|
|
+ :isDetail="false"
|
|
|
+ :placeholder="'分类'"
|
|
|
/>
|
|
|
</el-col>
|
|
|
|
|
@@ -89,51 +83,24 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="24" style="padding: 10px 0 0 0">
|
|
|
- <el-col :span="4" style="width: 280px; padding: 0">
|
|
|
- <el-select
|
|
|
- v-model="supplierCode"
|
|
|
- multiple
|
|
|
- filterable
|
|
|
- remote
|
|
|
- :multiple-limit="1"
|
|
|
- reserve-keyword
|
|
|
- :size="'mini'"
|
|
|
- clearable
|
|
|
- style="width: 100%"
|
|
|
- :placeholder="'供应商名称'"
|
|
|
- :remote-method="remoteMethod"
|
|
|
- :loading="selectLoading"
|
|
|
- @change="supplierChange"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in options"
|
|
|
- :key="item.id + index"
|
|
|
- :label="item.name"
|
|
|
- :value="item.code + ''"
|
|
|
- :disabled="item.status !== '1'"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
- <el-col :span="4" style="width: 190px; padding: 0 0 0 10px">
|
|
|
- <el-select v-model="parmValue.value" :size="'mini'" placeholder="库存类型">
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
- <el-col :span="4" style="width: 260px; padding: 0 0 0 10px">
|
|
|
+ <el-col :span="4" style="width: 450px">
|
|
|
<el-input
|
|
|
+ clearable
|
|
|
:size="'mini'"
|
|
|
- v-model="parmValue.good_name"
|
|
|
+ v-model="sinput"
|
|
|
:maxlength="40"
|
|
|
- clearable
|
|
|
- placeholder="商品名称"
|
|
|
- />
|
|
|
+ placeholder="关键字"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ v-model="select"
|
|
|
+ style="width: 120px"
|
|
|
+ slot="prepend"
|
|
|
+ placeholder="关键字类型"
|
|
|
+ >
|
|
|
+ <el-option label="商品名称" value="1" />
|
|
|
+ <el-option label="商品编码" value="2" />
|
|
|
+ <el-option label="平台商品编码" value="3" /> </el-select
|
|
|
+ ></el-input>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="3" style="width: 66px; float: right">
|
|
@@ -150,6 +117,29 @@
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template #good_thumb_img="{ scope }">
|
|
|
+ <div
|
|
|
+ v-if="scope.row.good_thumb_img"
|
|
|
+ style="width: 20px; height: 20px"
|
|
|
+ class="hover"
|
|
|
+ v-viewer
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ :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
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template #is_stock="{ scope }">
|
|
|
+ <span>{{ scope.row.is_stock === "1" ? "库存品" : "非库存品" }} </span>
|
|
|
+ </template>
|
|
|
</ex-table>
|
|
|
</el-card>
|
|
|
</el-dialog>
|
|
@@ -167,7 +157,7 @@ export default {
|
|
|
computed: {
|
|
|
...mapGetters(["tablebtnSize", "searchSize", "size"]),
|
|
|
},
|
|
|
- props: ["showModel", "once"],
|
|
|
+ props: ["showModel", "once", "sitem", "active"],
|
|
|
|
|
|
/**
|
|
|
* 属性集合
|
|
@@ -180,7 +170,9 @@ export default {
|
|
|
*/
|
|
|
data() {
|
|
|
return {
|
|
|
- options: [
|
|
|
+ select: "1",
|
|
|
+ sinput: "",
|
|
|
+ is_stock: [
|
|
|
{ id: "0", name: "非库存品" },
|
|
|
{ id: "1", name: "库存品" },
|
|
|
],
|
|
@@ -190,11 +182,15 @@ export default {
|
|
|
loading: true,
|
|
|
showModelThis: false,
|
|
|
parmValue: {
|
|
|
- type_code: "", // 商品属性code
|
|
|
- supplierNo: "", // 供应商code
|
|
|
+ platform_code: [],
|
|
|
+ companyNo: "",
|
|
|
+ is_stock: "",
|
|
|
+ exam_status: "",
|
|
|
+ cat_id: [], // 商品属性code
|
|
|
+ brandid: [],
|
|
|
good_code: "", // 商品编码
|
|
|
good_name: "", // 商品名称
|
|
|
- wsmcode: "", //仓库code
|
|
|
+ plat_code: "",
|
|
|
page: 1, // 页码
|
|
|
size: 15, // 每页显示条数
|
|
|
},
|
|
@@ -224,8 +220,7 @@ export default {
|
|
|
showModel: function (val) {
|
|
|
this.showModelThis = val;
|
|
|
if (val) {
|
|
|
- this.supplierCode = [];
|
|
|
- this.searchList();
|
|
|
+ this.restSearch();
|
|
|
}
|
|
|
},
|
|
|
showModelThis(val) {
|
|
@@ -236,23 +231,21 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
- supplierChange(e) {
|
|
|
- if (e && e.length === 1) {
|
|
|
- this.parmValue.supplierNo = e[0];
|
|
|
- } else {
|
|
|
- this.parmValue.supplierNo = "";
|
|
|
- }
|
|
|
- this.parmValue.page = 1;
|
|
|
- this.searchList();
|
|
|
- },
|
|
|
restSearch() {
|
|
|
- this.supplierCode = [];
|
|
|
+ console.log(this.active);
|
|
|
+ console.log(this.sitem);
|
|
|
+ const { platform_code, company_id, is_stock } = this.sitem;
|
|
|
+
|
|
|
this.parmValue = {
|
|
|
- type_code: "", // 商品属性code
|
|
|
- supplierNo: "", // 供应商code
|
|
|
+ platform_code: this.active ? platform_code : [],
|
|
|
+ companyNo: this.active ? company_id : "",
|
|
|
+ is_stock: this.active ? is_stock : "",
|
|
|
+ cat_id: [], // 商品属性code
|
|
|
+ brandid: [],
|
|
|
+ exam_status: this.active ? "6" : "",
|
|
|
good_code: "", // 商品编码
|
|
|
good_name: "", // 商品名称
|
|
|
- wsmcode: "", //仓库code
|
|
|
+ plat_code: "",
|
|
|
page: 1, // 页码
|
|
|
size: 15, // 每页显示条数
|
|
|
};
|
|
@@ -264,19 +257,57 @@ export default {
|
|
|
};
|
|
|
this.searchList();
|
|
|
},
|
|
|
+ async goods_class_change(e) {
|
|
|
+ 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();
|
|
|
+ },
|
|
|
+ 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();
|
|
|
+ },
|
|
|
+ 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();
|
|
|
+ },
|
|
|
async searchList() {
|
|
|
this.loading = true;
|
|
|
- const res = await asyncRequest.list(this.parmValue);
|
|
|
+ let 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.platform_code =
|
|
|
+ model.platform_code.length > 0
|
|
|
+ ? model.platform_code[model.platform_code.length - 1]
|
|
|
+ : "";
|
|
|
+ const res = await asyncRequest.list(model);
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
this.tableData = res.data.list;
|
|
|
- // this.tableData.map((v) => {
|
|
|
- // // v.sale_price = this.setNum(v.sale_price);
|
|
|
- // // v.sale_fee = this.setNum(v.sale_fee);
|
|
|
- // // // v.num =
|
|
|
- // // //pa (v.sale_price);
|
|
|
- // return v;
|
|
|
- // });
|
|
|
- //
|
|
|
+ this.tableData.map((e) => {
|
|
|
+ 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}`;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return e;
|
|
|
+ });
|
|
|
+
|
|
|
this.pageInfo.total = Number(res.data.count);
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
await this.logout();
|