|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<el-dialog
|
|
|
center
|
|
|
- title="选择组合商品库存添加记录"
|
|
|
+ title="选择子商品"
|
|
|
:visible="_visible"
|
|
|
:close-on-click-modal="false"
|
|
|
:append-to-body="true"
|
|
@@ -11,141 +11,248 @@
|
|
|
@close="handleClose"
|
|
|
>
|
|
|
<ex-table
|
|
|
- :table="table"
|
|
|
v-loading="loading"
|
|
|
+ :table="table"
|
|
|
:data="tableData"
|
|
|
:columns="columns"
|
|
|
:page="pageInfo"
|
|
|
:size="size"
|
|
|
@page-curr-change="handlePageChange"
|
|
|
@page-size-change="handleSizeChange"
|
|
|
- @selection="selectionChange"
|
|
|
@screen-reset="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
+ pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();
|
|
|
+ "
|
|
|
@screen-submit="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
+ pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();
|
|
|
+ "
|
|
|
+ @selection="selectionChange"
|
|
|
>
|
|
|
<template #table-header="{}">
|
|
|
<div style="width: 100%">
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-col :span="6" style="width: 355px;">
|
|
|
- <period-date-picker
|
|
|
- :create_start="parmValue.create_start"
|
|
|
- :create_end="parmValue.create_end"
|
|
|
- :type="1"
|
|
|
- :width="'165px'"
|
|
|
- :size="searchSize"
|
|
|
- placeholder="创建"
|
|
|
- @timeReturned="timeReturned($event)"
|
|
|
- />
|
|
|
- </el-col>
|
|
|
+ <el-row style="padding: 0 0 10px 0px">
|
|
|
+ <el-col :span="6" style="width: 303px">
|
|
|
+ <period-date-picker
|
|
|
+ :type="1"
|
|
|
+ :width="'135px'"
|
|
|
+ :size="searchSize"
|
|
|
+ :start="parmValue.start"
|
|
|
+ :end="parmValue.end"
|
|
|
+ @timeReturned="handleTime"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4" style="width: 135px">
|
|
|
+ <search-brand
|
|
|
+ :value="brandid"
|
|
|
+ :disabled="false"
|
|
|
+ :size="'mini'"
|
|
|
+ :is-detail="true"
|
|
|
+ :names="parmValue.supplierName"
|
|
|
+ :placeholder="'商品品牌'"
|
|
|
+ @searchChange="brandidsearchChange"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" style="width: 310px; padding: 0 0 0 10px">
|
|
|
+ <good-class
|
|
|
+ :value="parmValue.cat_id"
|
|
|
+ :disabled="false"
|
|
|
+ :size="searchSize"
|
|
|
+ :is-detail="false"
|
|
|
+ :placeholder="'分类'"
|
|
|
+ @handleChange="goods_class_change"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
|
|
|
- <el-col :span="3" style="width: 66px; float: right">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- :size="searchSize"
|
|
|
- @click="searchList"
|
|
|
- style="float: right; margin-left: 5px"
|
|
|
- >刷新</el-button>
|
|
|
- </el-col>
|
|
|
+ <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
|
|
|
+ <el-button type="primary" :size="searchSize" @click="searchList">刷新</el-button>
|
|
|
+ </el-col>
|
|
|
|
|
|
- <el-col :span="4" style="width: 66px; float: right">
|
|
|
- <el-button type="warning" class="fr" :size="searchSize" @click="restSearch">重置</el-button>
|
|
|
- </el-col>
|
|
|
+ <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
|
|
|
+ <el-button type="warning" :size="searchSize" @click="restSearch">重置</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row style="margin-top: 10px">
|
|
|
- <el-col :span="6" style="width: 400px">
|
|
|
- <el-input
|
|
|
- v-model="value"
|
|
|
+ <el-row>
|
|
|
+ <!-- <el-col :span="4" style="width: 226px">
|
|
|
+ <el-select
|
|
|
+ v-model="parmValue.status"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
:size="searchSize"
|
|
|
- placeholder="关键字"
|
|
|
+ placeholder="状态"
|
|
|
+ style="width: 100%"
|
|
|
+ @change="
|
|
|
+ pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in statusList"
|
|
|
+ :key="'status' + item.code"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.code"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-col>-->
|
|
|
+ <el-col :span="4" style="width: 145px; padding: 0 0 0 0px">
|
|
|
+ <el-select
|
|
|
+ v-model="parmValue.isonline"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ :size="searchSize"
|
|
|
+ placeholder="是否上线"
|
|
|
+ style="width: 100%"
|
|
|
+ @change="
|
|
|
+ pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in isonlineoptions"
|
|
|
+ :key="'isonline' + item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <!-- <el-col :span="4" style="width: 135px;margin-left:10px">
|
|
|
+ <el-select
|
|
|
+ v-model="parmValue.is_stock"
|
|
|
+ size="mini"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="商品类型"
|
|
|
clearable
|
|
|
- :maxlength="40"
|
|
|
@change="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
+ pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();
|
|
|
+ "
|
|
|
>
|
|
|
- <template #prepend>
|
|
|
- <el-select
|
|
|
- v-model="parmValue.key"
|
|
|
- style="width:100px"
|
|
|
- @change="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- >
|
|
|
- <el-option label="商品名称" value="spuCode" />
|
|
|
- <el-option label="商品编码" value="good_name" />
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
+ <el-option
|
|
|
+ v-for="opt in isStockOptions"
|
|
|
+ :key="opt.value"
|
|
|
+ :value="opt.value"
|
|
|
+ :label="opt.label"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-col>-->
|
|
|
+ <el-col :span="4" style="margin: 0 10px">
|
|
|
+ <search-supplier
|
|
|
+ :size="'mini'"
|
|
|
+ style="width: 165px"
|
|
|
+ :value="supplierNo"
|
|
|
+ :disabled="false"
|
|
|
+ :placeholder="'供应商名称'"
|
|
|
+ :is-detail="false"
|
|
|
+ :no-disabled="true"
|
|
|
+ :names="''"
|
|
|
+ @searchChange="supplierChange"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
|
|
|
- <el-button
|
|
|
- slot="appcreate_end"
|
|
|
- icon="el-icon-search"
|
|
|
- @click="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- ></el-button>
|
|
|
+ <el-col :span="4" style="width: 420px">
|
|
|
+ <el-input
|
|
|
+ v-model="sinput"
|
|
|
+ :size="searchSize"
|
|
|
+ :maxlength="40"
|
|
|
+ placeholder="关键字"
|
|
|
+ @blur="
|
|
|
+ pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ slot="prepend"
|
|
|
+ v-model="select"
|
|
|
+ style="width: 135px"
|
|
|
+ placeholder="关键字类型"
|
|
|
+ @change="
|
|
|
+ pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-option label="商品编号" value="1" />
|
|
|
+ <el-option label="商品名称" value="2" />
|
|
|
+ </el-select>
|
|
|
</el-input>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
+ <template #spuCode="{ scope }">
|
|
|
+ <div style="display:flex;align-items:center">
|
|
|
+ <p>{{ scope.row.spuCode }}</p>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #good_thumb_img="{ scope }">
|
|
|
+ <div
|
|
|
+ v-if="scope.row.good_thumb_img"
|
|
|
+ v-viewer
|
|
|
+ style="width: 20px; height: 20px"
|
|
|
+ class="hover"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ :src="scope.row.good_thumb_img"
|
|
|
+ style="display: inline-block; width: 100%; height: 100%"
|
|
|
+ alt
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template #status="{ scope }">
|
|
|
<el-tag
|
|
|
:size="tablebtnSize"
|
|
|
- :type="scope.row.status == '0' ? 'warning' : ''"
|
|
|
+ :type="
|
|
|
+ (statusList.find((item) => item.code == scope.row.status) || {}).type || '--'
|
|
|
+ "
|
|
|
v-text="
|
|
|
- (statusOptions.find((item) => item.id == scope.row.status) || {})
|
|
|
- .label || '--'
|
|
|
- "
|
|
|
- ></el-tag>
|
|
|
+ (statusList.find((item) => item.code == scope.row.status) || {}).name || '--'
|
|
|
+ "
|
|
|
+ />
|
|
|
</template>
|
|
|
-
|
|
|
- <template #order_source="{ scope }">
|
|
|
+ <template #has_account="{ scope }">
|
|
|
<el-tag
|
|
|
:size="tablebtnSize"
|
|
|
+ :type="
|
|
|
+ (
|
|
|
+ has_account_list.find((item) => item.code == scope.row.has_account + '') ||
|
|
|
+ {}
|
|
|
+ ).type || '--'
|
|
|
+ "
|
|
|
v-text="
|
|
|
- (
|
|
|
- xs_order_source_options.find(
|
|
|
- (item) => item.id == scope.row.order_source
|
|
|
- ) || {}
|
|
|
- ).label || '--'
|
|
|
- "
|
|
|
- ></el-tag>
|
|
|
+ (
|
|
|
+ has_account_list.find((item) => item.code == scope.row.has_account + '') ||
|
|
|
+ {}
|
|
|
+ ).name || '--'
|
|
|
+ "
|
|
|
+ />
|
|
|
</template>
|
|
|
-
|
|
|
- <template #catinfo="{ scope }">{{scope.row.catInfo.map(({name}) => name).join("-")}}</template>
|
|
|
-
|
|
|
- <template #specInfo="{ scope }">
|
|
|
- <span
|
|
|
- v-for="(si, sii) in scope.row.specInfo"
|
|
|
- :key="sii + si.spec_value_id"
|
|
|
- >{{ sii === 0 ? "" : "-" }}{{ si.spec_name }}[{{ si.spec_value }}]</span>
|
|
|
+ <template #isonline="{ scope }">
|
|
|
+ <el-tag
|
|
|
+ :size="tablebtnSize"
|
|
|
+ :type="scope.row.is_online == '0' ? 'warning' : ''"
|
|
|
+ v-text="
|
|
|
+ (isonlineoptions.find((item) => item.id == scope.row.is_online) || {}).name ||
|
|
|
+ '--'
|
|
|
+ "
|
|
|
+ />
|
|
|
</template>
|
|
|
-
|
|
|
- <template #order_type="{ scope }">
|
|
|
+ <template #is_stock="{ scope }">
|
|
|
<el-tag
|
|
|
:size="tablebtnSize"
|
|
|
+ :type="scope.row.is_stock == '0' ? 'warning' : ''"
|
|
|
v-text="
|
|
|
- (
|
|
|
- is_stock.find((item) => item.id == scope.row.is_stock) || {}
|
|
|
- ).name || '--'
|
|
|
- "
|
|
|
- ></el-tag>
|
|
|
+ (options4.find((item) => item.id == scope.row.is_stock) || {}).name || '--'
|
|
|
+ "
|
|
|
+ />
|
|
|
</template>
|
|
|
</ex-table>
|
|
|
|
|
@@ -156,24 +263,24 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { has_account_list, isStockOptions } from "@/assets/js/statusList";
|
|
|
-import mixinPage from "@/mixins/elPaginationHandle";
|
|
|
-import resToken from "@/mixins/resToken";
|
|
|
-import asyncRequest from "@/apis/service/sellOut/combinedAdd";
|
|
|
+import { has_account_list, isStockOptions } from '@/assets/js/statusList'
|
|
|
+import asyncRequest from '@/apis/service/goodStore/goodsCost'
|
|
|
+import mixinPage from '@/mixins/elPaginationHandle'
|
|
|
+import resToken from '@/mixins/resToken'
|
|
|
|
|
|
export default {
|
|
|
- name: "ProductListModal",
|
|
|
+ name: 'ProductListModal',
|
|
|
mixins: [mixinPage, resToken],
|
|
|
- props: ["visible"],
|
|
|
+ props: ['visible'],
|
|
|
data() {
|
|
|
return {
|
|
|
options1: [
|
|
|
- { id: "0", name: "否" },
|
|
|
- { id: "1", name: "是" }
|
|
|
+ { id: '0', name: '否' },
|
|
|
+ { id: '1', name: '是' }
|
|
|
],
|
|
|
options4: [
|
|
|
- { id: "0", name: "非库存品" },
|
|
|
- { id: "1", name: "库存品" }
|
|
|
+ { id: '0', name: '非库存品' },
|
|
|
+ { id: '1', name: '库存品' }
|
|
|
],
|
|
|
table: {
|
|
|
stripe: true,
|
|
@@ -182,19 +289,27 @@ export default {
|
|
|
},
|
|
|
loading: false,
|
|
|
selected: [],
|
|
|
- size: "mini",
|
|
|
- searchSize: "mini",
|
|
|
- tablebtnSize: "mini",
|
|
|
- sinput: "",
|
|
|
- select: "1",
|
|
|
+ size: 'mini',
|
|
|
+ searchSize: 'mini',
|
|
|
+ tablebtnSize: 'mini',
|
|
|
+ sinput: '',
|
|
|
+ select: '1',
|
|
|
parmValue: {
|
|
|
- key: "spuCode",
|
|
|
- value: "",
|
|
|
- status: "",
|
|
|
- create_start: "",
|
|
|
- create_end: "",
|
|
|
page: 1, // 页码
|
|
|
- size: 15 // 每页显示条数
|
|
|
+ size: 10, // 每页显示条数
|
|
|
+ is_stock: '',
|
|
|
+ start: '',
|
|
|
+ end: '',
|
|
|
+ status: '',
|
|
|
+ good_name: '',
|
|
|
+ spucode: '',
|
|
|
+ cat_id: [],
|
|
|
+ brandid: '',
|
|
|
+ good_type: '',
|
|
|
+ companyNo: '',
|
|
|
+ supplierNo: '',
|
|
|
+ isonline: '',
|
|
|
+ company_name: '' // 创建人部门
|
|
|
},
|
|
|
has_account_list,
|
|
|
isStockOptions,
|
|
@@ -204,173 +319,276 @@ export default {
|
|
|
total: 0
|
|
|
},
|
|
|
isonlineoptions: [
|
|
|
- { id: "0", name: "未上线" },
|
|
|
- { id: "1", name: "已上线" }
|
|
|
+ { id: '0', name: '未上线' },
|
|
|
+ { id: '1', name: '已上线' }
|
|
|
],
|
|
|
- statusOptions: [
|
|
|
- { id: "1", label: "待审核" },
|
|
|
- { id: "2", label: "审核通过" },
|
|
|
- { id: "3", label: "审核驳回" }
|
|
|
+ statusList: [
|
|
|
+ {
|
|
|
+ code: '0',
|
|
|
+ name: '新建待审核',
|
|
|
+ type: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: '1',
|
|
|
+ name: '审核通过',
|
|
|
+ type: 'success'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: '2',
|
|
|
+ name: '基础修改待审核',
|
|
|
+ type: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: '3',
|
|
|
+ name: '成本修改待审核',
|
|
|
+ type: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: '4',
|
|
|
+ name: '基础修改驳回',
|
|
|
+ type: 'danger'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: '5',
|
|
|
+ name: '成本修改驳回',
|
|
|
+ type: 'danger'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: '6',
|
|
|
+ name: '新建审核驳回',
|
|
|
+ type: 'danger'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: '7',
|
|
|
+ name: '复制商品待编辑',
|
|
|
+ type: 'info'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: '8',
|
|
|
+ name: '竞价商品待编辑',
|
|
|
+ type: 'info'
|
|
|
+ }
|
|
|
],
|
|
|
columns: [
|
|
|
- { type: "selection", fixed: "left", _noset_: true },
|
|
|
+ { type: 'selection', fixed: 'left', _noset_: true },
|
|
|
{
|
|
|
- prop: "stockCode",
|
|
|
- label: "库存申请编码",
|
|
|
- fixed: "left",
|
|
|
- minWidth: "152px"
|
|
|
+ prop: 'spuCode',
|
|
|
+ label: '编号',
|
|
|
+ width: '180px',
|
|
|
+ _slot_: 'spuCode'
|
|
|
},
|
|
|
{
|
|
|
- prop: "spuCode",
|
|
|
- label: "商品编码",
|
|
|
- minWidth: "125px"
|
|
|
+ prop: 'good_thumb_img',
|
|
|
+ label: '图片',
|
|
|
+ _slot_: 'good_thumb_img',
|
|
|
+ width: '45px'
|
|
|
},
|
|
|
{
|
|
|
- label: "商品分类",
|
|
|
- minWidth: "125px",
|
|
|
- _slot_: "catinfo"
|
|
|
+ prop: 'good_name',
|
|
|
+ label: '名称',
|
|
|
+ 'min-width': '160px'
|
|
|
},
|
|
|
{
|
|
|
- prop: "good_name",
|
|
|
- label: "商品名称",
|
|
|
- minWidth: "125px"
|
|
|
+ prop: 'cat_name',
|
|
|
+ label: '分类'
|
|
|
},
|
|
|
{
|
|
|
- prop: "specInfo",
|
|
|
- label: "商品规格",
|
|
|
- minWidth: "125px",
|
|
|
- _slot_: "specInfo"
|
|
|
+ prop: 'brand_name',
|
|
|
+ label: '品牌'
|
|
|
},
|
|
|
{
|
|
|
- prop: "status",
|
|
|
- _slot_: "status",
|
|
|
- label: "状态",
|
|
|
- width: "100px"
|
|
|
+ prop: 'is_stock',
|
|
|
+ label: '库存类型',
|
|
|
+ _slot_: 'is_stock',
|
|
|
+ width: '85px'
|
|
|
},
|
|
|
+ // {
|
|
|
+ // prop: "is_combind",
|
|
|
+ // label: "是否组合商品",
|
|
|
+ // width: "105px",
|
|
|
+ // _slot_: "is_combind"
|
|
|
+ // },
|
|
|
{
|
|
|
- prop: "apply_name",
|
|
|
- label: "申请人",
|
|
|
- width: "90px"
|
|
|
+ prop: 'isonline',
|
|
|
+ label: '是否上线',
|
|
|
+ _slot_: 'isonline',
|
|
|
+ width: '70px'
|
|
|
},
|
|
|
{
|
|
|
- prop: "createtime",
|
|
|
- label: "创建时间",
|
|
|
- width: "155px"
|
|
|
+ prop: 'status',
|
|
|
+ label: '状态',
|
|
|
+ _slot_: 'status',
|
|
|
+ width: '118px'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'has_account',
|
|
|
+ label: '供应商账号',
|
|
|
+ _slot_: 'has_account',
|
|
|
+ width: '85px'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'supplierNo',
|
|
|
+ label: '供应商编号',
|
|
|
+ width: '110px'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'supplierName',
|
|
|
+ label: '供应商名称',
|
|
|
+ width: '110px'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'companyNo',
|
|
|
+ label: '业务公司编号',
|
|
|
+ width: '110px'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'companyName',
|
|
|
+ label: '业务公司名称',
|
|
|
+ width: '110px'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'charger_company_name',
|
|
|
+ label: '负责人部门',
|
|
|
+ minWidth: '150px'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'charger',
|
|
|
+ label: '负责人',
|
|
|
+ width: '70px'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'creater',
|
|
|
+ label: '创建人',
|
|
|
+ width: '70px'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'addtime',
|
|
|
+ label: '创建时间',
|
|
|
+ width: '140px'
|
|
|
}
|
|
|
],
|
|
|
tableData: []
|
|
|
- };
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
_visible: {
|
|
|
get() {
|
|
|
- return this.visible;
|
|
|
+ return this.visible
|
|
|
},
|
|
|
set(nV) {
|
|
|
- this.$emit("update:visible", nV);
|
|
|
+ this.$emit('update:visible', nV)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
visible(v) {
|
|
|
- if (!v) return;
|
|
|
- this.searchList();
|
|
|
+ if (!v) return
|
|
|
+ this.searchList()
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
selectionChange(evt) {
|
|
|
- const { list } = evt;
|
|
|
- this.selected = list;
|
|
|
+ const { list } = evt
|
|
|
+ this.selected = list
|
|
|
},
|
|
|
restSearch() {
|
|
|
- this.select = "2";
|
|
|
- this.sinput = "";
|
|
|
- this.supplierNo = [];
|
|
|
- this.brandid = [];
|
|
|
+ this.select = '2'
|
|
|
+ this.sinput = ''
|
|
|
+ this.supplierNo = []
|
|
|
+ this.brandid = []
|
|
|
// 表格 - 分页
|
|
|
this.pageInfo = {
|
|
|
size: 15,
|
|
|
curr: 1,
|
|
|
total: 0
|
|
|
- };
|
|
|
+ }
|
|
|
this.parmValue = {
|
|
|
page: 1, // 页码
|
|
|
size: 15, // 每页显示条数
|
|
|
- start: "",
|
|
|
- end: "",
|
|
|
- status: "",
|
|
|
- good_name: "",
|
|
|
- company_name: "", // 创建人部门
|
|
|
- spucode: "",
|
|
|
+ start: '',
|
|
|
+ end: '',
|
|
|
+ status: '',
|
|
|
+ good_name: '',
|
|
|
+ company_name: '', // 创建人部门
|
|
|
+ spucode: '',
|
|
|
cat_id: [],
|
|
|
- brandid: "",
|
|
|
- good_type: "",
|
|
|
- isonline: "",
|
|
|
- companyNo: "",
|
|
|
- supplierNo: ""
|
|
|
- };
|
|
|
- this.searchList();
|
|
|
+ brandid: '',
|
|
|
+ good_type: '',
|
|
|
+ isonline: '',
|
|
|
+ companyNo: '',
|
|
|
+ supplierNo: ''
|
|
|
+ }
|
|
|
+ this.searchList()
|
|
|
},
|
|
|
handleClose() {
|
|
|
- this.selected = [];
|
|
|
- this._visible = false;
|
|
|
+ this.selected = []
|
|
|
+ this._visible = false
|
|
|
},
|
|
|
proportionChange(proportion) {
|
|
|
- this.ruleForm.proportion = proportion;
|
|
|
+ this.ruleForm.proportion = proportion
|
|
|
},
|
|
|
onSave() {
|
|
|
if (this.selected.length === 0 || this.selected.length > 1) {
|
|
|
const message =
|
|
|
- this.selected.length === 0
|
|
|
- ? "请选择组合商品库存添加记录"
|
|
|
- : "只能选择一条组合商品库存记录";
|
|
|
- this.$message.warning(message);
|
|
|
- return;
|
|
|
+ this.selected.length === 0 ? '请选择一条商品' : '只能选择一条商品'
|
|
|
+ this.$message.warning(message)
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
- const { id } = this.selected[0];
|
|
|
- this.$emit("selected", id);
|
|
|
- this._visible = false;
|
|
|
+ const { spuCode, id } = this.selected[0]
|
|
|
+ this.$emit('selected', spuCode, id)
|
|
|
+ this._visible = false
|
|
|
},
|
|
|
async searchList() {
|
|
|
+ console.log(this.parmValue)
|
|
|
if (
|
|
|
- (this.parmValue.start !== "" && this.parmValue.end === "") ||
|
|
|
- (this.parmValue.start === "" && this.parmValue.end !== "")
|
|
|
+ (this.parmValue.start !== '' && this.parmValue.end === '') ||
|
|
|
+ (this.parmValue.start === '' && this.parmValue.end !== '')
|
|
|
) {
|
|
|
- this.$message.warning("时间区间不完整!");
|
|
|
- return;
|
|
|
+ this.$message.warning('时间区间不完整!')
|
|
|
+ return
|
|
|
}
|
|
|
- this.loading = true;
|
|
|
- const { key, value, ...rest } = this.parmValue;
|
|
|
-
|
|
|
+ this.loading = true
|
|
|
+ const item = JSON.parse(JSON.stringify(this.parmValue))
|
|
|
+ item.spucode = this.select === '1' ? this.sinput : ''
|
|
|
+ item.good_name = this.select === '2' ? this.sinput : ''
|
|
|
+ item.companyNo = this.select === '3' ? this.sinput : ''
|
|
|
+ item.supplierNo = this.select === '4' ? this.sinput : ''
|
|
|
+ item.company_name = this.select === '5' ? this.sinput : '' // 部门
|
|
|
+ item.cat_id =
|
|
|
+ item.cat_id.length > 0 ? item.cat_id[item.cat_id.length - 1] : ''
|
|
|
const res = await asyncRequest.list({
|
|
|
+ ...item,
|
|
|
+ supplierNo: Array.isArray(this.supplierNo) ? this.supplierNo[0] : '',
|
|
|
needRela: true,
|
|
|
- [key]: value,
|
|
|
- flag: "1",
|
|
|
- ...rest,
|
|
|
- status: "2"
|
|
|
- });
|
|
|
+ is_stock: '1',
|
|
|
+ status: '1',
|
|
|
+ is_combind: '1'
|
|
|
+ })
|
|
|
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
- this.tableData = res.data.list;
|
|
|
+ this.tableData = res.data.list
|
|
|
this.tableData.forEach(a => {
|
|
|
- a.cat_name = "";
|
|
|
- const list = a.cat_info || [];
|
|
|
+ a.cat_name = ''
|
|
|
+ const list = a.cat_info || []
|
|
|
list.forEach((b, i) => {
|
|
|
- a.cat_name += i == 0 ? b.name : "/" + b.name;
|
|
|
- });
|
|
|
- });
|
|
|
- this.pageInfo.total = Number(res.data.count);
|
|
|
+ a.cat_name += i == 0 ? b.name : '/' + b.name
|
|
|
+ })
|
|
|
+ })
|
|
|
+ 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.getresultlist();
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|