|
@@ -194,8 +194,8 @@
|
|
|
@click="addProducts">+新增产品</a-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-show="chooseVal=='a'"><tableType1 ref="cillProduct"></tableType1></div>
|
|
|
- <div v-show="chooseVal=='d'"><tableType3 :setData="setTableData" :rulesType="form.discountType" ref="specialProduct"></tableType3></div>
|
|
|
+ <div v-show="chooseVal=='a'"><tableType1 :unitTypeList="unitTypeDataList" ref="cillProduct"></tableType1></div>
|
|
|
+ <div v-show="chooseVal=='d'"><tableType3 :setData="setTableData" :rulesType="form.discountType" :unitTypeList="unitTypeDataList" ref="specialProduct"></tableType3></div>
|
|
|
</a-card>
|
|
|
<div class="btn-cont">
|
|
|
<a-button id="promotionList-basicInfo-modal-back" @click="isShow = false">取消</a-button>
|
|
@@ -220,9 +220,10 @@ import { commonMixin } from '@/utils/mixin'
|
|
|
import { VSelect } from '@/components'
|
|
|
import tableType1 from './tableType1.vue'
|
|
|
import tableType3 from './tableType3.vue'
|
|
|
-import { promotionSave, getRuleDetail, getNewScopeSn } from '@/api/promotion'
|
|
|
+import { promotionSave, getRuleDetail } from '@/api/promotion'
|
|
|
import chooseProductsModal from './chooseProductsModal.vue'
|
|
|
import ImportGuideModal from './importGuideModal.vue'
|
|
|
+import { getLookUpData } from '@/api/data'
|
|
|
export default {
|
|
|
name: 'PromotionListBasicInfoModal',
|
|
|
mixins: [commonMixin],
|
|
@@ -270,7 +271,9 @@ export default {
|
|
|
chooseVal: 'a',
|
|
|
openProductsModal: false,
|
|
|
chooseProducts: [],
|
|
|
- openGuideModal: false // 导入弹窗
|
|
|
+ openGuideModal: false, // 导入弹窗
|
|
|
+ code: 'SCOPE_UNIT_TYPE', // 起订类型数据字典
|
|
|
+ unitTypeDataList: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -721,15 +724,22 @@ export default {
|
|
|
_this.handleProductsOk(newConArr)
|
|
|
}
|
|
|
},
|
|
|
+ // 生成随机数
|
|
|
+ generateUniqueRandomNumber () {
|
|
|
+ const timestamp = new Date().getTime()
|
|
|
+ const randomNumber = Math.floor(Math.random() * 1e5).toString().padStart(5, '0')
|
|
|
+ const uniqueRandomNumber = timestamp + randomNumber
|
|
|
+ return uniqueRandomNumber
|
|
|
+ },
|
|
|
// +新增产品
|
|
|
handleProductsOk (con) {
|
|
|
const _this = this
|
|
|
con.forEach(async (item) => {
|
|
|
const chooseProductsList = []
|
|
|
- const getSn = await getNewScopeSn({})
|
|
|
- if (getSn.status == 200) {
|
|
|
+ const getSn = this.generateUniqueRandomNumber()
|
|
|
+ if (getSn) {
|
|
|
const newData = {
|
|
|
- productScopeSn: getSn.data,
|
|
|
+ productScopeSn: getSn,
|
|
|
dataSourceOrigin: '1',
|
|
|
productTypeArr: [],
|
|
|
productTypeList: [],
|
|
@@ -778,6 +788,18 @@ export default {
|
|
|
}
|
|
|
_this.$refs.specialProduct.setSourceData(chooseProductsList)
|
|
|
})
|
|
|
+ },
|
|
|
+ getUnitTypeList () {
|
|
|
+ const _this = this
|
|
|
+ getLookUpData({
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 1000,
|
|
|
+ lookupCode: _this.code
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.unitTypeDataList = res.data.list
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -791,6 +813,8 @@ export default {
|
|
|
this.$emit('close')
|
|
|
this.resetSearchForm()
|
|
|
} else {
|
|
|
+ // 获取起订类型数据字典
|
|
|
+ this.getUnitTypeList()
|
|
|
if (this.itemSn) {
|
|
|
this.getDetail()
|
|
|
} else {
|