|
@@ -171,6 +171,20 @@
|
|
></el-option>
|
|
></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item prop="brandId">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model.trim="searchForm.brandId"
|
|
|
|
+ clearable
|
|
|
|
+ placeholder="商品品牌"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item, index) in goodsBrand"
|
|
|
|
+ :key="index"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item prop="status">
|
|
<el-form-item prop="status">
|
|
<el-select
|
|
<el-select
|
|
v-model.trim="searchForm.status"
|
|
v-model.trim="searchForm.status"
|
|
@@ -206,7 +220,7 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column align="center" prop="sn" label="货号">
|
|
<el-table-column align="center" prop="sn" label="货号">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column align="center" prop="brand" label="品牌">
|
|
|
|
|
|
+ <el-table-column align="center" prop="brandName" label="品牌">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
@@ -282,24 +296,13 @@
|
|
}}</span>
|
|
}}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- align="center"
|
|
|
|
- prop="stockCount"
|
|
|
|
- label="内部库存"
|
|
|
|
- v-if="tenantId == 1"
|
|
|
|
- :key="Math.random()"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-table-column align="center" prop="stockCount" label="库存">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <!-- 先判断是否是组合商品 -->
|
|
|
|
- <span v-if="scope.row.complementGoodsIdList">
|
|
|
|
- {{ scope.row.stockCount ? scope.row.stockCount : "" }}
|
|
|
|
- </span>
|
|
|
|
- <span v-else>{{ scope.row.stockCount }}</span>
|
|
|
|
|
|
+ <span>{{ scope.row.stockCount }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column align="center" prop="taxStockCount" label="税务库存">
|
|
|
|
|
|
+ <!-- <el-table-column align="center" prop="taxStockCount" label="税务库存">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <!-- 先判断是否是组合商品 -->
|
|
|
|
<span v-if="scope.row.complementGoodsIdList">
|
|
<span v-if="scope.row.complementGoodsIdList">
|
|
{{ scope.row.taxStockCount ? scope.row.taxStockCount : "" }}
|
|
{{ scope.row.taxStockCount ? scope.row.taxStockCount : "" }}
|
|
</span>
|
|
</span>
|
|
@@ -316,7 +319,7 @@
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
{{ scope.row.stockType | stockTypeStatus }}
|
|
{{ scope.row.stockType | stockTypeStatus }}
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
|
|
+ </el-table-column> -->
|
|
<el-table-column align="center" prop="marketPrice" label="市场价(元)">
|
|
<el-table-column align="center" prop="marketPrice" label="市场价(元)">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
{{ scope.row.marketPrice | moneyFormat }}
|
|
{{ scope.row.marketPrice | moneyFormat }}
|
|
@@ -426,12 +429,12 @@
|
|
>查看</el-button
|
|
>查看</el-button
|
|
>
|
|
>
|
|
|
|
|
|
- <el-button
|
|
|
|
|
|
+ <!-- <el-button
|
|
v-if="permission('/shopOperation/copyShop')"
|
|
v-if="permission('/shopOperation/copyShop')"
|
|
@click="onShopOperation('copy', scope.row)"
|
|
@click="onShopOperation('copy', scope.row)"
|
|
type="text"
|
|
type="text"
|
|
>复制</el-button
|
|
>复制</el-button
|
|
- >
|
|
|
|
|
|
+ > -->
|
|
<!-- <el-button v-if="scope.row.status == 0"
|
|
<!-- <el-button v-if="scope.row.status == 0"
|
|
v-permission="'goods/del'"
|
|
v-permission="'goods/del'"
|
|
@click="onDelete(scope.row)"
|
|
@click="onDelete(scope.row)"
|
|
@@ -458,10 +461,16 @@
|
|
width="1000px"
|
|
width="1000px"
|
|
>
|
|
>
|
|
<combinationProducts
|
|
<combinationProducts
|
|
|
|
+ :activeRow="activeRow"
|
|
|
|
+ :addType="addType"
|
|
:addDisabled="addDisabled"
|
|
:addDisabled="addDisabled"
|
|
:categoryList="categoryList"
|
|
:categoryList="categoryList"
|
|
|
|
+ :goodsBrand="goodsBrand"
|
|
|
|
+ :goodsType="goodsType"
|
|
:selectGoodsList="selectGoodsList"
|
|
:selectGoodsList="selectGoodsList"
|
|
:tenantId="tenantId"
|
|
:tenantId="tenantId"
|
|
|
|
+ @close="routeShopStatus = false"
|
|
|
|
+ @confirm="getList"
|
|
/>
|
|
/>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
@@ -476,14 +485,17 @@ import {
|
|
goodsAdd,
|
|
goodsAdd,
|
|
goodsUpdate,
|
|
goodsUpdate,
|
|
goodsDelete,
|
|
goodsDelete,
|
|
- updateGoodsStatus
|
|
|
|
|
|
+ updateGoodsStatus,
|
|
|
|
+ api_queryGoodsTypeList,
|
|
|
|
+ api_queryGoodsCategoryList,
|
|
|
|
+ api_queryGoodsBrandList
|
|
} from "@/api/businessManager";
|
|
} from "@/api/businessManager";
|
|
|
|
+import { goodsType } from "@/utils/searchArray";
|
|
import qs from "qs";
|
|
import qs from "qs";
|
|
import cleanDeep from "clean-deep";
|
|
import cleanDeep from "clean-deep";
|
|
import Tooltip from "@/components/Tooltip/index";
|
|
import Tooltip from "@/components/Tooltip/index";
|
|
import { Export } from "@/utils/downLoadFile";
|
|
import { Export } from "@/utils/downLoadFile";
|
|
import { getToken, getTenantId } from "@/utils/auth";
|
|
import { getToken, getTenantId } from "@/utils/auth";
|
|
-import { goodsType } from "@/utils/searchArray";
|
|
|
|
import load from "@/utils/loading";
|
|
import load from "@/utils/loading";
|
|
import { permission } from "@/utils/directivePage";
|
|
import { permission } from "@/utils/directivePage";
|
|
|
|
|
|
@@ -499,8 +511,9 @@ export default {
|
|
name: "shopList",
|
|
name: "shopList",
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- goodsType: goodsType,
|
|
|
|
|
|
+ goodsType: goodsType || [], // 商品类型
|
|
categoryList: [],
|
|
categoryList: [],
|
|
|
|
+ goodsBrand: [], // 商品品牌
|
|
goodsLoading: false,
|
|
goodsLoading: false,
|
|
organId: null,
|
|
organId: null,
|
|
orderDate: null,
|
|
orderDate: null,
|
|
@@ -524,7 +537,8 @@ export default {
|
|
memberFeeShowOrganId: null,
|
|
memberFeeShowOrganId: null,
|
|
freeFeeShowOrganId: null,
|
|
freeFeeShowOrganId: null,
|
|
replacementShowOrganId: null,
|
|
replacementShowOrganId: null,
|
|
- studentShowOrganId: null
|
|
|
|
|
|
+ studentShowOrganId: null,
|
|
|
|
+ brandId: null
|
|
},
|
|
},
|
|
headers: {
|
|
headers: {
|
|
Authorization: getToken(),
|
|
Authorization: getToken(),
|
|
@@ -549,7 +563,7 @@ export default {
|
|
copy: "复制"
|
|
copy: "复制"
|
|
},
|
|
},
|
|
addDisabled: false,
|
|
addDisabled: false,
|
|
-
|
|
|
|
|
|
+ activeRow: {},
|
|
selectGoodsList: [],
|
|
selectGoodsList: [],
|
|
tenantId: ""
|
|
tenantId: ""
|
|
};
|
|
};
|
|
@@ -567,25 +581,60 @@ export default {
|
|
init() {
|
|
init() {
|
|
this.getList();
|
|
this.getList();
|
|
this.getCategory();
|
|
this.getCategory();
|
|
|
|
+ // this.getGoodsType();
|
|
|
|
+ this.getGoodsBrand();
|
|
},
|
|
},
|
|
- getCategory() {
|
|
|
|
|
|
+ /** 商品分类 */
|
|
|
|
+ async getCategory() {
|
|
let params = {
|
|
let params = {
|
|
- delFlag: 0,
|
|
|
|
|
|
+ // delFlag: 0,
|
|
rows: 9999
|
|
rows: 9999
|
|
};
|
|
};
|
|
- categoryListTree(params).then(res => {
|
|
|
|
- let result = res.data;
|
|
|
|
- if (res.code == 200) {
|
|
|
|
- let tempArray = [];
|
|
|
|
- result.rows.forEach(row => {
|
|
|
|
- tempArray.push({
|
|
|
|
- label: row.name,
|
|
|
|
- value: row.id
|
|
|
|
- });
|
|
|
|
|
|
+ try {
|
|
|
|
+ const { data } = await api_queryGoodsCategoryList(params);
|
|
|
|
+ console.log(data, "data");
|
|
|
|
+ const result = data || [];
|
|
|
|
+ let tempArray = [];
|
|
|
|
+ result.forEach(row => {
|
|
|
|
+ tempArray.push({
|
|
|
|
+ label: row.name,
|
|
|
|
+ value: row.id
|
|
});
|
|
});
|
|
- this.categoryList = tempArray;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ });
|
|
|
|
+ this.categoryList = tempArray;
|
|
|
|
+ } catch {}
|
|
|
|
+ },
|
|
|
|
+ /** 商品类型 */
|
|
|
|
+ async getGoodsType() {
|
|
|
|
+ try {
|
|
|
|
+ const { data } = await api_queryGoodsTypeList({ rows: 999 });
|
|
|
|
+ console.log(data, "getGoodsType");
|
|
|
|
+ const result = data || [];
|
|
|
|
+ let tempArray = [];
|
|
|
|
+ result.forEach(row => {
|
|
|
|
+ tempArray.push({
|
|
|
|
+ label: row.name,
|
|
|
|
+ value: row.id
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ this.goodsType = tempArray;
|
|
|
|
+ } catch {}
|
|
|
|
+ },
|
|
|
|
+ /** 商品品牌 */
|
|
|
|
+ async getGoodsBrand() {
|
|
|
|
+ try {
|
|
|
|
+ const { data } = await api_queryGoodsBrandList({ rows: 999 });
|
|
|
|
+ console.log(data, "getGoodsBrand");
|
|
|
|
+ const result = data || [];
|
|
|
|
+ let tempArray = [];
|
|
|
|
+ result.forEach(row => {
|
|
|
|
+ tempArray.push({
|
|
|
|
+ label: row.name,
|
|
|
|
+ value: row.id
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ this.goodsBrand = tempArray;
|
|
|
|
+ } catch {}
|
|
},
|
|
},
|
|
async onUpdate(row, type) {
|
|
async onUpdate(row, type) {
|
|
let title = type == 1 ? "你是否下架该商品?" : "你是否上架该商品?";
|
|
let title = type == 1 ? "你是否下架该商品?" : "你是否上架该商品?";
|
|
@@ -680,44 +729,44 @@ export default {
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
onShopComAdd() {
|
|
onShopComAdd() {
|
|
- this.form = {
|
|
|
|
- sn: null,
|
|
|
|
- brand: null,
|
|
|
|
- supplyChannel: null,
|
|
|
|
- name: null,
|
|
|
|
- type: null,
|
|
|
|
- goodsCategoryId: null,
|
|
|
|
- specification: null,
|
|
|
|
- marketPrice: null,
|
|
|
|
- discountPrice: null,
|
|
|
|
- groupPurchasePrice: null,
|
|
|
|
- clientShow: null,
|
|
|
|
- educationalShow: null,
|
|
|
|
- musicGroupShow: null,
|
|
|
|
- organIdList: [],
|
|
|
|
- courseViewType: [],
|
|
|
|
- stockWarning: null,
|
|
|
|
- image: null,
|
|
|
|
- complementGoodsIdList: null,
|
|
|
|
- goodsList: [
|
|
|
|
- {
|
|
|
|
- id: null
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- brief: null,
|
|
|
|
- desc: null,
|
|
|
|
- replacementShow: null
|
|
|
|
- };
|
|
|
|
- this.onValidGoodsStatus();
|
|
|
|
- this.routeShopStatus = true;
|
|
|
|
|
|
+ // this.form = {
|
|
|
|
+ // sn: null,
|
|
|
|
+ // brand: null,
|
|
|
|
+ // supplyChannel: null,
|
|
|
|
+ // name: null,
|
|
|
|
+ // type: null,
|
|
|
|
+ // goodsCategoryId: null,
|
|
|
|
+ // specification: null,
|
|
|
|
+ // marketPrice: null,
|
|
|
|
+ // discountPrice: null,
|
|
|
|
+ // groupPurchasePrice: null,
|
|
|
|
+ // clientShow: null,
|
|
|
|
+ // educationalShow: null,
|
|
|
|
+ // musicGroupShow: null,
|
|
|
|
+ // organIdList: [],
|
|
|
|
+ // courseViewType: [],
|
|
|
|
+ // stockWarning: null,
|
|
|
|
+ // image: null,
|
|
|
|
+ // complementGoodsIdList: null,
|
|
|
|
+ // goodsList: [
|
|
|
|
+ // {
|
|
|
|
+ // id: null
|
|
|
|
+ // }
|
|
|
|
+ // ],
|
|
|
|
+ // brief: null,
|
|
|
|
+ // desc: null,
|
|
|
|
+ // replacementShow: null
|
|
|
|
+ // };
|
|
|
|
+ // this.onValidGoodsStatus();
|
|
this.addType = "create";
|
|
this.addType = "create";
|
|
this.addDisabled = false;
|
|
this.addDisabled = false;
|
|
|
|
+ this.routeShopStatus = true;
|
|
|
|
|
|
- this.$nextTick(res => {
|
|
|
|
- if (this.$refs["ruleForm"]) {
|
|
|
|
- this.$refs["ruleForm"].resetFields();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ // this.$nextTick(res => {
|
|
|
|
+ // if (this.$refs["ruleForm"]) {
|
|
|
|
+ // this.$refs["ruleForm"].resetFields();
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
},
|
|
},
|
|
onOrganChange(val) {
|
|
onOrganChange(val) {
|
|
if (val && val.length > 0) {
|
|
if (val && val.length > 0) {
|
|
@@ -743,92 +792,90 @@ export default {
|
|
},
|
|
},
|
|
onShopOperation(type, row) {
|
|
onShopOperation(type, row) {
|
|
// 添加或修改
|
|
// 添加或修改
|
|
-
|
|
|
|
- let params = {
|
|
|
|
- type: type
|
|
|
|
- };
|
|
|
|
- if (row) {
|
|
|
|
- params.id = row.id;
|
|
|
|
- }
|
|
|
|
- let paramInfo = JSON.stringify(params);
|
|
|
|
|
|
+ // let params = {
|
|
|
|
+ // type: type
|
|
|
|
+ // };
|
|
|
|
+ // if (row) {
|
|
|
|
+ // params.id = row.id;
|
|
|
|
+ // }
|
|
|
|
+ // let paramInfo = JSON.stringify(params);
|
|
this.addType = type;
|
|
this.addType = type;
|
|
this.addDisabled = type == "look" ? true : false;
|
|
this.addDisabled = type == "look" ? true : false;
|
|
// 判断是否是修改组合商品
|
|
// 判断是否是修改组合商品
|
|
- if (
|
|
|
|
- (type == "update" || type == "look" || type == "copy") &&
|
|
|
|
- row.complementGoodsIdList
|
|
|
|
- ) {
|
|
|
|
- this.routeShopStatus = true;
|
|
|
|
-
|
|
|
|
- let form = this.form;
|
|
|
|
- for (let i in form) {
|
|
|
|
- form[i] = row[i];
|
|
|
|
- }
|
|
|
|
- let ids = row.complementGoodsIdList.split(",");
|
|
|
|
- let goodsList = [];
|
|
|
|
- ids.forEach(item => {
|
|
|
|
- goodsList.push({
|
|
|
|
- id: Number(item)
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- form.goodsList = goodsList;
|
|
|
|
- form.id = row.id;
|
|
|
|
|
|
+ if (type == "update" || type == "look" || type == "copy") {
|
|
|
|
+ this.activeRow = row;
|
|
|
|
+ // let form = this.form;
|
|
|
|
+ // for (let i in form) {
|
|
|
|
+ // form[i] = row[i];
|
|
|
|
+ // }
|
|
|
|
+ // let ids = row.complementGoodsIdList.split(",");
|
|
|
|
+ // let goodsList = [];
|
|
|
|
+ // ids.forEach(item => {
|
|
|
|
+ // goodsList.push({
|
|
|
|
+ // id: Number(item)
|
|
|
|
+ // });
|
|
|
|
+ // });
|
|
|
|
+ // form.goodsList = goodsList;
|
|
|
|
+ // form.id = row.id;
|
|
|
|
|
|
- if (row.courseViewType) {
|
|
|
|
- form.courseViewType = row.courseViewType.split(",");
|
|
|
|
- }
|
|
|
|
|
|
+ // if (row.courseViewType) {
|
|
|
|
+ // form.courseViewType = row.courseViewType.split(",");
|
|
|
|
+ // }
|
|
|
|
|
|
- if (row.studentShowOrganId) {
|
|
|
|
- form.studentShowOrganId = row.studentShowOrganId.split(",");
|
|
|
|
- }
|
|
|
|
|
|
+ // if (row.studentShowOrganId) {
|
|
|
|
+ // form.studentShowOrganId = row.studentShowOrganId.split(",");
|
|
|
|
+ // }
|
|
|
|
|
|
- if (row.educationShowOrganId) {
|
|
|
|
- form.educationShowOrganId = row.educationShowOrganId.split(",");
|
|
|
|
- }
|
|
|
|
|
|
+ // if (row.educationShowOrganId) {
|
|
|
|
+ // form.educationShowOrganId = row.educationShowOrganId.split(",");
|
|
|
|
+ // }
|
|
|
|
|
|
- if (row.courseFeeShowOrganId) {
|
|
|
|
- form.courseFeeShowOrganId = row.courseFeeShowOrganId.split(",");
|
|
|
|
- }
|
|
|
|
|
|
+ // if (row.courseFeeShowOrganId) {
|
|
|
|
+ // form.courseFeeShowOrganId = row.courseFeeShowOrganId.split(",");
|
|
|
|
+ // }
|
|
|
|
|
|
- if (row.memberFeeShowOrganId) {
|
|
|
|
- form.memberFeeShowOrganId = row.memberFeeShowOrganId.split(",");
|
|
|
|
- }
|
|
|
|
- if (row.freeFeeShowOrganId) {
|
|
|
|
- form.freeFeeShowOrganId = row.freeFeeShowOrganId.split(",");
|
|
|
|
- }
|
|
|
|
|
|
+ // if (row.memberFeeShowOrganId) {
|
|
|
|
+ // form.memberFeeShowOrganId = row.memberFeeShowOrganId.split(",");
|
|
|
|
+ // }
|
|
|
|
+ // if (row.freeFeeShowOrganId) {
|
|
|
|
+ // form.freeFeeShowOrganId = row.freeFeeShowOrganId.split(",");
|
|
|
|
+ // }
|
|
|
|
|
|
- if (row.replacementShowOrganId) {
|
|
|
|
- form.replacementShowOrganId = row.replacementShowOrganId.split(",");
|
|
|
|
- }
|
|
|
|
|
|
+ // if (row.replacementShowOrganId) {
|
|
|
|
+ // form.replacementShowOrganId = row.replacementShowOrganId.split(",");
|
|
|
|
+ // }
|
|
|
|
|
|
// if (row.organIdList) {
|
|
// if (row.organIdList) {
|
|
// form.organIdList = row.organIdList.split(",");
|
|
// form.organIdList = row.organIdList.split(",");
|
|
|
|
|
|
// }
|
|
// }
|
|
- this.getAllGoodsList();
|
|
|
|
|
|
+ // this.getAllGoodsList();
|
|
|
|
|
|
- this.onValidGoodsStatus();
|
|
|
|
- } else {
|
|
|
|
- let pageTitle = "添加";
|
|
|
|
- if (type == "update") {
|
|
|
|
- pageTitle = "修改";
|
|
|
|
- } else if (type == "look") {
|
|
|
|
- pageTitle = "查看";
|
|
|
|
- } else if (type == "copy") {
|
|
|
|
- pageTitle = "复制";
|
|
|
|
- }
|
|
|
|
- this.$router.push(
|
|
|
|
- {
|
|
|
|
- path: "/shopManager/shopOperation",
|
|
|
|
- query: {
|
|
|
|
- paramInfo
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- route => {
|
|
|
|
- route.meta.title = pageTitle + "商品";
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
|
|
+ // this.onValidGoodsStatus();
|
|
|
|
+
|
|
|
|
+ this.routeShopStatus = true;
|
|
}
|
|
}
|
|
|
|
+ // else {
|
|
|
|
+ // let pageTitle = "添加";
|
|
|
|
+ // if (type == "update") {
|
|
|
|
+ // pageTitle = "修改";
|
|
|
|
+ // } else if (type == "look") {
|
|
|
|
+ // pageTitle = "查看";
|
|
|
|
+ // } else if (type == "copy") {
|
|
|
|
+ // pageTitle = "复制";
|
|
|
|
+ // }
|
|
|
|
+ // this.$router.push(
|
|
|
|
+ // {
|
|
|
|
+ // path: "/shopManager/shopOperation",
|
|
|
|
+ // query: {
|
|
|
|
+ // paramInfo
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ // route => {
|
|
|
|
+ // route.meta.title = pageTitle + "商品";
|
|
|
|
+ // }
|
|
|
|
+ // );
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
beforeUpload(file) {
|
|
beforeUpload(file) {
|
|
// console.log(file.type)
|
|
// console.log(file.type)
|