|
|
@@ -36,6 +36,7 @@
|
|
|
<DkSplit v-model="split">
|
|
|
<!-- 左边部分 -->
|
|
|
<DkTable slot="left" ref="leftTable" :data="leftData" :height="tableHeight" :page-flag="false"
|
|
|
+ primaryKey="kindCode"
|
|
|
:page-total-flag="false" :show-setting-flag="false" :freeze="false" :choose-flag="false"
|
|
|
@current-change="currentChangeEvent($event)">
|
|
|
<DkTableColumn :title="$t('allType')" field="kindName" width="auto" :filter="false" :sortable="false"
|
|
|
@@ -138,6 +139,7 @@ export default {
|
|
|
data() {
|
|
|
let self = this
|
|
|
return {
|
|
|
+ leftRow:null,
|
|
|
modalTitle: '',//新建编辑弹窗名称
|
|
|
submitType: '',//新建编辑提交类型
|
|
|
kindCode: null,
|
|
|
@@ -184,54 +186,64 @@ export default {
|
|
|
*/
|
|
|
currentChangeEvent({row}) {
|
|
|
if (row != null) {
|
|
|
+ this.leftRow = row
|
|
|
this.kindCode = row.kindCode
|
|
|
- let params = {
|
|
|
- cpId: this.$store.state.user.cpId,
|
|
|
- }
|
|
|
+ this.searchData();
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- // 仓库
|
|
|
- if (this.kindCode == this.$config.kindCode.basicWarehouse || this.kindCode == null) {
|
|
|
- setTimeout(() => {
|
|
|
- this.wareHouseTableFlag = true
|
|
|
- }, 100)
|
|
|
- this.saleChannelTableFlag = false
|
|
|
- this.dictionaryTableFlag = false
|
|
|
- params.whCode = row.code
|
|
|
- params.whName = row.name
|
|
|
- this.excute(this.$service.wareHouseService, this.$service.wareHouseService.selectByCond, params).then(res => {
|
|
|
- if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
- this.wareHouseData = res.data.list
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- // 渠道
|
|
|
- else if (this.kindCode == this.$config.kindCode.basicChannel) {
|
|
|
- params.channelCode = row.code
|
|
|
- params.channelName = row.name
|
|
|
- this.wareHouseTableFlag = false
|
|
|
- this.dictionaryTableFlag = false
|
|
|
- setTimeout(() => {
|
|
|
- this.saleChannelTableFlag = true
|
|
|
- }, 100)
|
|
|
- this.excute(this.$service.saleChannelService, this.$service.saleChannelService.selectByCond, params).then(res => {
|
|
|
- if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
- this.saleChannelTableData = res.data.list
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- // 数据字典
|
|
|
- params.dictCode = this.kindCode
|
|
|
- setTimeout(() => {
|
|
|
- this.dictionaryTableFlag = true
|
|
|
- }, 100)
|
|
|
- this.saleChannelTableFlag = false
|
|
|
- this.wareHouseTableFlag = false
|
|
|
- this.excute(this.$service.dictionaryDataService, this.$service.dictionaryDataService.selectByCond, params).then(res => {
|
|
|
- if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
- this.dictionaryTableData = res.data.list
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * @desc : 获取数据
|
|
|
+ * @author : 常皓宁
|
|
|
+ * @date : 2024/3/9 10:55
|
|
|
+ */
|
|
|
+ getData(params) {
|
|
|
+ // 商品品牌
|
|
|
+ if (this.kindCode == this.$config.kindCode.basicWarehouse || this.kindCode == null) {
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.wareHouseTableFlag = true
|
|
|
+ },100)
|
|
|
+ this.saleChannelTableFlag = false
|
|
|
+ this.dictionaryTableFlag = false
|
|
|
+ console.log("this.leftRow:",this.leftRow)
|
|
|
+ params.whCode = this.leftRow.code
|
|
|
+ params.whName = this.leftRow.name
|
|
|
+ this.excute(this.$service.wareHouseService, this.$service.wareHouseService.selectByCond, params).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.wareHouseData = res.data.list
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 渠道
|
|
|
+ else if (this.kindCode == this.$config.kindCode.basicChannel) {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.saleChannelTableFlag = true
|
|
|
+ }, 100)
|
|
|
+ this.wareHouseTableFlag = false
|
|
|
+ this.dictionaryTableFlag = false
|
|
|
+ params.channelCode = this.leftRow.code
|
|
|
+ params.channelName = this.leftRow.name
|
|
|
+ this.excute(this.$service.saleChannelService, this.$service.saleChannelService.selectByCond, params).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.saleChannelTableData = res.data.list
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // 数据字典
|
|
|
+ params.dictCode = this.kindCode
|
|
|
+ setTimeout(() => {
|
|
|
+ this.dictionaryTableFlag = true
|
|
|
+ }, 100)
|
|
|
+ this.saleChannelTableFlag = false
|
|
|
+ this.wareHouseTableFlag = false
|
|
|
+ this.excute(this.$service.dictionaryDataService, this.$service.dictionaryDataService.selectByCond, params).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.dictionaryTableData = res.data.list
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -359,23 +371,6 @@ export default {
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @desc : 获取数据
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/3/9 10:55
|
|
|
- */
|
|
|
- getData() {
|
|
|
- if (this.kindCode) {
|
|
|
- let data = {
|
|
|
- kindCode: this.kindCode,
|
|
|
- code: this.searchCond._value['code'],
|
|
|
- name: this.searchCond._value['name'],
|
|
|
- }
|
|
|
- this.currentChangeEvent({row: data})
|
|
|
- }
|
|
|
- this.loading = false
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
* @desc : 基础资料左侧列表数据
|
|
|
* @author : 常皓宁
|
|
|
* @date : 2024/3/9 13:03
|
|
|
@@ -391,10 +386,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.getBasicData() //基础资料左侧列表数据
|
|
|
+ },
|
|
|
created() {
|
|
|
this.primaryKey = 'basicDataId' // 设置主键Id
|
|
|
this.routeObjName = 'basicData' // 设置路由名称
|
|
|
- this.getBasicData() //商品属性左侧列表数据
|
|
|
}
|
|
|
}
|
|
|
</script>
|