Commit 2379902e by 前端

111

1 parent 081efa6e
<template> <template>
<d2-dialog <d2-dialog :title="title"
:title="title" :is-visible.sync="selectGoodsVisible"
:is-visible.sync="selectGoodsVisible" width="70%"
width="70%" btn-ok-label="确定"
btn-ok-label="确定" @confirmDialog="handleSelectGoodsConfirm"
@confirmDialog="handleSelectGoodsConfirm" @closeDialog="handleSelectGoodsClose"
@closeDialog="handleSelectGoodsClose" class="selectGoods">
class="selectGoods">
<d2-search ref="showSearch" <d2-search ref="showSearch"
class="show-search" class="show-search"
:search-form="searchForm" :search-form="searchForm"
:label-width="'100px'" :label-width="'100px'"
:form-data="showFormData"> :form-data="showFormData">
<template slot="commodityCode"> <template slot="commodityCode">
<el-input :style="{ width: '100%'}" <el-input :style="{ width: '100%'}"
placeholder="请输入商品ID" placeholder="请输入商品ID"
v-model.trim="searchForm['commodityCode']" v-model.trim="searchForm['commodityCode']"
:clearable="true" :clearable="true"
:maxlength="50" :maxlength="50"
@input="event => searchInput(event, 'commodityCode')" /> @input="event => searchInput(event, 'commodityCode')" />
</template> </template>
<template slot="type"> <template slot="type">
<el-input :style="{ width: '100%'}" <el-input :style="{ width: '100%'}"
placeholder="请输入商品编码" placeholder="请输入商品编码"
v-model.trim="searchForm['type']" v-model.trim="searchForm['type']"
:clearable="true" :clearable="true"
:maxlength="50" :maxlength="50"
@input="event => searchInput(event, 'type')" /> @input="event => searchInput(event, 'type')" />
</template> </template>
<template slot="thirdPartyCode"> <template slot="thirdPartyCode">
<el-input :style="{ width: '100%'}" <el-input :style="{ width: '100%'}"
placeholder="请输入第三方编码" placeholder="请输入第三方编码"
v-model.trim="searchForm['thirdPartyCode']" v-model.trim="searchForm['thirdPartyCode']"
:clearable="true" :clearable="true"
:maxlength="50" :maxlength="50"
@input="event => searchInput(event, 'thirdPartyCode')" /> @input="event => searchInput(event, 'thirdPartyCode')" />
</template> </template>
<template slot="baseGoodsCommodityCode"> <template slot="baseGoodsCommodityCode">
<el-input :style="{ width: '100%'}" <el-input :style="{ width: '100%'}"
placeholder="请输入系列ID" placeholder="请输入系列ID"
v-model.trim="searchForm['baseGoodsCommodityCode']" v-model.trim="searchForm['baseGoodsCommodityCode']"
:clearable="true" :clearable="true"
:maxlength="50" :maxlength="50"
@input="event => searchInput(event, 'baseGoodsCommodityCode')" /> @input="event => searchInput(event, 'baseGoodsCommodityCode')" />
</template> </template>
<template slot="goodsCascader"> <template slot="goodsCascader">
<el-cascader :options="baseData.productTypeList" style="width: 100%;" <el-cascader :options="baseData.productTypeList"
v-model="tempGoodsType" :placeholder="'请选择'" filterable style="width: 100%;"
@change="selectAddAttr($event)" clearable v-model="tempGoodsType"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }"> :placeholder="'请选择'"
filterable
@change="selectAddAttr($event)"
clearable
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }">
</el-cascader> </el-cascader>
</template> </template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button :id="tableParams.btnId" <el-button :id="tableParams.btnId"
size="small" size="small"
type="primary"> type="primary">
查询 查询
</el-button> </el-button>
</div> </div>
<d2-table ref="groundingIndexTable" <d2-table ref="groundingIndexTable"
:has-num="false" :has-num="false"
:search-form="searchForm" :search-form="searchForm"
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"> @setTableFinishFun="setTableFinishFun">
<template slot="select_btn" slot-scope="scope"> <template slot="select_btn"
<el-radio v-model="selectedRowId" :label="scope.scope.id" :disabled="packageSelectIds && packageSelectIds.includes(scope.scope.id)">{{ '' }}</el-radio> slot-scope="scope">
<el-radio v-model="selectedRowId"
:label="scope.scope.id"
:disabled="packageSelectIds && packageSelectIds.includes(scope.scope.id)">{{ '' }}</el-radio>
</template> </template>
</d2-table> </d2-table>
</d2-dialog> </d2-dialog>
...@@ -89,7 +95,12 @@ export default { ...@@ -89,7 +95,12 @@ export default {
default: false default: false
}, },
upgradeGoodsId: {}, upgradeGoodsId: {},
packageSelectIds: {} packageSelectIds: {},
// 用于嘀加上架获取商品时过滤只筛选出权益和延保类
filterParams: {
type: Array,
default: () => []
}
}, },
data() { data() {
return { return {
...@@ -208,7 +219,7 @@ export default { ...@@ -208,7 +219,7 @@ export default {
prop: '', prop: '',
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue?.carTypeConfigList?.length ? cellValue.carTypeConfigList.map(item => item.seriesName).join('/') : '-' return cellValue?.carTypeConfigList?.length ? cellValue.carTypeConfigList.map(item => item.seriesName).join('/') : '-'
} }
}, { }, {
label: '所属系列', label: '所属系列',
prop: 'goodsName', prop: 'goodsName',
...@@ -272,11 +283,14 @@ export default { ...@@ -272,11 +283,14 @@ export default {
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
if (this.filterParams.length > 0) { // 嘀加上架获取商品时过滤只筛选出权益和延保类
this.searchForm.goodsTypeList = this.filterParams
}
resolve() resolve()
}) })
}, },
handleSelectGoodsConfirm() { handleSelectGoodsConfirm() {
let selectData = this.tableData?.find(v => v.id == this.selectedRowId) const selectData = this.tableData?.find(v => v.id == this.selectedRowId)
if (!selectData) return this.$message.warning('请选择商品') if (!selectData) return this.$message.warning('请选择商品')
this.$emit('handleSelectGoodsConfirm', selectData) this.$emit('handleSelectGoodsConfirm', selectData)
}, },
...@@ -297,7 +311,7 @@ export default { ...@@ -297,7 +311,7 @@ export default {
this.tempGoodsType = [] this.tempGoodsType = []
// 重新查询 // 重新查询
this.$refs.groundingIndexTable.refreshTable(true, true) this.$refs.groundingIndexTable.refreshTable(true, true)
}, }
} }
} }
</script> </script>
...@@ -307,4 +321,4 @@ export default { ...@@ -307,4 +321,4 @@ export default {
padding: 0; padding: 0;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -8,15 +8,6 @@ ...@@ -8,15 +8,6 @@
label-width="130px"> label-width="130px">
<el-form-item label="上架商品:" <el-form-item label="上架商品:"
prop="upgradeGoodsId"> prop="upgradeGoodsId">
<!-- <el-select v-model="form.val1"
placeholder="我是已选商品"
clearable
class="el_select">
<el-option v-for="item in businessNature"
:key="item.confId"
:value="item.confId"
:label="item.confName" />
</el-select> -->
<el-button icon="el-icon-plus" <el-button icon="el-icon-plus"
@click="handleSelectGoods">选择商品</el-button> @click="handleSelectGoods">选择商品</el-button>
</el-form-item> </el-form-item>
...@@ -156,6 +147,7 @@ ...@@ -156,6 +147,7 @@
</el-form> </el-form>
<select-goods-dialog v-if="selectGoodsVisible" <select-goods-dialog v-if="selectGoodsVisible"
:select-goods-visible="selectGoodsVisible" :select-goods-visible="selectGoodsVisible"
:filter-params="filterParams"
@handleSelectGoodsConfirm="handleSelectGoodsConfirm" @handleSelectGoodsConfirm="handleSelectGoodsConfirm"
@handleSelectGoodsClose="handleSelectGoodsClose" @handleSelectGoodsClose="handleSelectGoodsClose"
:upgrade-goods-id="formData.upgradeGoodsId"></select-goods-dialog> :upgrade-goods-id="formData.upgradeGoodsId"></select-goods-dialog>
...@@ -164,10 +156,10 @@ ...@@ -164,10 +156,10 @@
<script> <script>
import { deepClone } from "@/common/util" import { deepClone } from "@/common/util"
import { businessNature } from "@/common/constants.js"
import { mapActions } from "vuex" import { mapActions } from "vuex"
import { limitPrice } from "@/common/format" import { limitPrice } from "@/common/format"
import selectGoodsDialog from '../../../components/selectGoodsDialog.vue' import selectGoodsDialog from '../../../components/selectGoodsDialog.vue'
import { baseConfig } from "@/main"
export default { export default {
name: "GoodTab", name: "GoodTab",
props: { props: {
...@@ -182,7 +174,7 @@ export default { ...@@ -182,7 +174,7 @@ export default {
}, },
data() { data() {
return { return {
businessNature: businessNature, filterParams: baseConfig.equitySceneType.concat(baseConfig.extendedPosiType),
loading: false, loading: false,
formData: { formData: {
upgradeGoodsId: "", upgradeGoodsId: "",
...@@ -234,8 +226,9 @@ export default { ...@@ -234,8 +226,9 @@ export default {
computed: {}, computed: {},
async mounted() { mounted() {
console.log('info', this.info) console.log('info', this.info)
console.log('filterParams', this.filterParams)
}, },
methods: { methods: {
......
...@@ -35,8 +35,9 @@ ...@@ -35,8 +35,9 @@
v-if="item.valiadError == 'Y'" />{{ item.title ? (item.title + (idx+1)):item.goodsName }} v-if="item.valiadError == 'Y'" />{{ item.title ? (item.title + (idx+1)):item.goodsName }}
</span> </span>
<span> <span>
<package-tab @packageEditInfo="getPackageEditInfo_notice" <package-tab :info="item.info"
:tab-idx="item.tabIndex" /> :tab-idx="item.tabIndex"
@packageEditInfo="getPackageEditInfo_notice" />
</span> </span>
</el-tab-pane> </el-tab-pane>
<!-- <el-tab-pane key="add" <!-- <el-tab-pane key="add"
...@@ -137,7 +138,7 @@ export default { ...@@ -137,7 +138,7 @@ export default {
goodsName: item.goodsName, goodsName: item.goodsName,
name: 'good_' + tabIndex, name: 'good_' + tabIndex,
tabIndex: tabIndex, tabIndex: tabIndex,
goodId: item.id, // goodId: item.id,
info: item info: item
}) })
this.tabsValue = 'good_' + tabIndex this.tabsValue = 'good_' + tabIndex
...@@ -149,7 +150,7 @@ export default { ...@@ -149,7 +150,7 @@ export default {
goodsName: item.packageName, goodsName: item.packageName,
name: 'package_' + tabIndex, name: 'package_' + tabIndex,
tabIndex: tabIndex, tabIndex: tabIndex,
goodId: item.id, // goodId: item.id,
info: item info: item
}) })
this.tabsValue = 'package_' + tabIndex this.tabsValue = 'package_' + tabIndex
...@@ -235,7 +236,6 @@ export default { ...@@ -235,7 +236,6 @@ export default {
closeOnClickModal: false // 是否可以点击空白处关闭弹窗 closeOnClickModal: false // 是否可以点击空白处关闭弹窗
}).then(() => { }).then(() => {
// 确认切换标签页 // 确认切换标签页
// this.activeName = tab.name
this.removeTab(targetName) this.removeTab(targetName)
}).catch(() => { }).catch(() => {
// 取消切换标签页 // 取消切换标签页
...@@ -248,11 +248,7 @@ export default { ...@@ -248,11 +248,7 @@ export default {
removeTab(targetName) { removeTab(targetName) {
const self = this const self = this
let activeName = self.tabsValue let activeName = self.tabsValue
// const tabs = self.goodTabs
let tabs let tabs
// if (this.goodTabs.length <= 1) {
// return false
// }
if (targetName.split("_")[0] == 'good') { if (targetName.split("_")[0] == 'good') {
tabs = self.goodTabs tabs = self.goodTabs
} else { } else {
...@@ -261,10 +257,6 @@ export default { ...@@ -261,10 +257,6 @@ export default {
if (activeName === targetName) { if (activeName === targetName) {
tabs.forEach((tab, index) => { tabs.forEach((tab, index) => {
if (tab.name === targetName) { if (tab.name === targetName) {
// const nextTab = tabs[index + 1]
// if (!nextTab) {
// activeName = tabs[index - 1].name
// }
const nextTab = tabs[index + 1] || tabs[index - 1] const nextTab = tabs[index + 1] || tabs[index - 1]
console.log('tab.name', tab.name) console.log('tab.name', tab.name)
console.log('nextTab', nextTab) console.log('nextTab', nextTab)
...@@ -285,90 +277,12 @@ export default { ...@@ -285,90 +277,12 @@ export default {
}) })
} }
this.tabsValue = activeName this.tabsValue = activeName
// tabs = tabs.filter(tab => tab.name !== targetName)
if (targetName.split("_")[0] == 'good') { if (targetName.split("_")[0] == 'good') {
this.goodTabs = tabs.filter(tab => tab.name !== targetName) this.goodTabs = tabs.filter(tab => tab.name !== targetName)
} else { } else {
this.packageTabs = tabs.filter(tab => tab.name !== targetName) this.packageTabs = tabs.filter(tab => tab.name !== targetName)
} }
this.packageNotice() this.packageNotice()
// const currentTabIndex = this.goodTabs.findIndex(item => item.name == targetName)
// // currentTabIndex <= parseInt(self.goodTabsValue)
// // (currentTabIndex == this.goodTabs.length - 1 && ) ||
// if (currentTabIndex < parseInt(self.goodTabsValue)) {
// // activeName = this.goodTabs[ ].name
// console.log(parseInt(self.goodTabsValue) - 1, 'parseInt(self.goodTabsValue) - 1')
// activeName = (parseInt(self.goodTabsValue) - 1).toString()
// // self.goodTabsValue = activeName
// }
// self.goodTabsValue = activeName
// const tabIndex = this.goodTabs.findIndex(item => item.name == targetName)
// const upgradeArr = []
// const packageArr = []
// this.goodTabs = []
// const childParams = goodsTypeGroupRules.splice(tabIndex, 1)
// // this.$set(this.goodsTypeGroupReconciliationRules, goodsTypeGroupRules)
// this.$nextTick(() => {
// this.goodsTypeGroupReconciliationRules = goodsTypeGroupRules
// this.deleteSelectGoodsList(childParams[0].goodsTypeGroupRelations)
// this.deleteSelectUpgradeGoodsList(childParams[0].upgradeGoods)
// this.deleteSelectPackageGoodsList(childParams[0].packageGoods)
// const typeList = goodsTypeGroupRules
// console.log(goodsTypeGroupRules, 'goodsTypeGroupRules')
// typeList.forEach((item, index) => {
// // index && this.goodTabs.push({
// // title: '特殊品类' + index,
// // name: (index + 1).toString()
// // })
// this.goodTabs[index] = {
// title: index ? '特殊品类' + index : '全部品类',
// name: (index + 1).toString()
// // testFlag: (item.testFlag == 'Y' && autoFlag) ? 'Y' : 'N',
// // groupDivisionRuleId: item.testFlag == 'Y' ? '' : (item.groupDivisionRuleId || '')
// }
// // 按具体商品
// if (item.goodsTypeGroupRelations?.length && item.goodsTypeGroupRelations[0]?.categoryType == 2) {
// this.goodsTypeGroupReconciliationRules[index].upgradeGoods = deepClone(item.goodsTypeGroupRelations)
// this.goodsTypeGroupReconciliationRules[index].categoryType = 2
// item.goodsTypeGroupRelations.forEach(val => {
// upgradeArr.push({
// upgradeGoodsId: val.upgradeGoodsId,
// upgradeGoodsName: val.upgradeGoodsName,
// commodityCode: val.commodityCode
// })
// })
// this.goodsTypeGroupReconciliationRules[index].goodsTypeGroupRelations = []
// }
// // 按套餐商品
// if (item.goodsTypeGroupRelations?.length && item.goodsTypeGroupRelations[0]?.categoryType == 3) {
// this.goodsTypeGroupReconciliationRules[index].packageGoods = deepClone(item.goodsTypeGroupRelations)
// this.goodsTypeGroupReconciliationRules[index].categoryType = 3
// item.goodsTypeGroupRelations.forEach(val => {
// packageArr.push({
// packageCode: val.packageCode,
// packageName: val.packageName
// })
// })
// this.goodsTypeGroupReconciliationRules[index].goodsTypeGroupRelations = []
// }
// // 按具体分类
// if (item.goodsTypeGroupRelations?.length && item.goodsTypeGroupRelations[0]?.categoryType == 1) {
// this.goodsTypeGroupReconciliationRules[index].goodsTypeGroupRelations = deepClone(item.goodsTypeGroupRelations)
// this.goodsTypeGroupReconciliationRules[index].categoryType = 1
// this.goodsTypeGroupReconciliationRules[index].upgradeGoods = []
// }
// })
// this.getSelectingList(upgradeArr)
// this.getSelectingListPackage(packageArr)
// // this.queryFeeCategoryByTypeFlow = deepClone(this.queryFeeCategoryByTypeFlow)
// this.$message({
// type: "success",
// message: "删除成功!"
// })
// })
}, },
// 填写套餐名称时通知 // 填写套餐名称时通知
...@@ -378,17 +292,6 @@ export default { ...@@ -378,17 +292,6 @@ export default {
this.packageNotice() this.packageNotice()
}, },
// 删除套餐时通知
// removePackageTab_notice() {
// this.packageInfoList = []
// this.packageTabs.forEach(item => {
// if (item.info) {
// this.packageInfoList.push(item.info)
// }
// })
// this.$EventBus.$emit('packageInfoList', this.packageInfoList)
// },
// 初始化、填写套餐名称时、删除套餐时通知 // 初始化、填写套餐名称时、删除套餐时通知
packageNotice() { packageNotice() {
this.packageInfoList = [] this.packageInfoList = []
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!