diff --git a/src/views/goodsManage/goodsList/goodsEdit/jcsz.vue b/src/views/goodsManage/goodsList/goodsEdit/jcsz.vue index a0021d7..1e75950 100644 --- a/src/views/goodsManage/goodsList/goodsEdit/jcsz.vue +++ b/src/views/goodsManage/goodsList/goodsEdit/jcsz.vue @@ -333,7 +333,7 @@ - + - + diff --git a/src/views/marketing/rechargeCard/addRechargeCard.vue b/src/views/marketing/rechargeCard/addRechargeCard.vue index be09104..e80b5bc 100644 --- a/src/views/marketing/rechargeCard/addRechargeCard.vue +++ b/src/views/marketing/rechargeCard/addRechargeCard.vue @@ -30,8 +30,9 @@ {{'添加'}} + >添加 - {{ '会员编号' }} - {{ '会员名称' }} - {{'产品名称'}} - {{'产品规格'}} - {{'提货基数'}} + 会员编号 + 会员名称 + 产品名称 + 产品规格 + 提货基数 可提数量 增加数量 - {{ '截止日期' }} - {{ '包邮类型' }} - + 截止日期 + 包邮类型 + 提货来源 - {{'添加产品'}} + {{ '添加产品' }} + - + - + - + + + + + + + + @@ -233,18 +249,22 @@ >
- - - - {{ '搜索' }} - - + + + + {{ '搜索' }} + +
- - + {{'选择规格'}}
+ >{{ '选择规格' }}
- {{'取消'}} + {{ '取消' }} {{'确认'}} + >{{ '确认' }} - {{'取消'}} + {{ '取消' }} {{'确认'}} + >{{ '确认' }}
@@ -366,14 +387,14 @@ @click="cancelCz" > {{ '取消' }} {{ '确认' }} item.consumeRuleConfigList.length > 0) + } + }, mounted() { const geturl = window.location.href const getqyinfo = geturl.split('?')[1] @@ -464,13 +497,13 @@ export default { this.disableds = true this.addFlag = false this.isArea = 1 - }else if (type == 3) { + } else if (type == 3) { this.getThDetails(pkId) this.disableds = true this.deled = true this.addFlag = false this.isArea = 1 - } else { + } else { this.getData() } }, @@ -480,46 +513,47 @@ export default { const that = this pickDetail({ pkId: pkId }).then((res) => { // console.error(res) - if(res.data.detailList){ + if (res.data.detailList) { that.allData = [{ 'consumeRuleConfigList': [{ - memberName: res.data.memberName, - memberCode: res.data.memberCode, - pkId: res.data.pkId, - baseQuantity: res.data.baseQuantity, - receiveTime: res.data.receiveTime, - usableQuantity: res.data.usableQuantity, - quantity: 0, - isFreeMail: res.data.isFreeMail, - waresGiftConfigList: [ - { - pkProduct: res.data.detailList[0].pkProduct, - productName: res.data.detailList[0].productName, - specsName: res.data.detailList[0].specsName, - specsNameId: res.data.detailList[0].specsNameId, - quantity: res.data.detailList[0].quantity - } - ] }], 'orderType': 1 }] - }else{ + memberName: res.data.memberName, + memberCode: res.data.memberCode, + pkId: res.data.pkId, + baseQuantity: res.data.baseQuantity, + receiveTime: res.data.receiveTime, + usableQuantity: res.data.usableQuantity, + quantity: 0, + isFreeMail: res.data.isFreeMail, + pickType: res.data.pickType, + waresGiftConfigList: [ + { + pkProduct: res.data.detailList[0].pkProduct, + productName: res.data.detailList[0].productName, + specsName: res.data.detailList[0].specsName, + specsNameId: res.data.detailList[0].specsNameId, + quantity: res.data.detailList[0].quantity + } + ] }], 'orderType': 1 }] + } else { that.allData = [{ 'consumeRuleConfigList': [{ - memberName: res.data.memberName, - memberCode: res.data.memberCode, - pkId: res.data.pkId, - baseQuantity: res.data.baseQuantity, - receiveTime: res.data.receiveTime, - usableQuantity: res.data.usableQuantity, - quantity: 0, - isFreeMail: res.data.isFreeMail, - waresGiftConfigList: [ - { - pkProduct:'', - productName: '', - specsName: '', - specsNameId: '', - quantity: 0 - } - ] }], 'orderType': 1 }] + memberName: res.data.memberName, + memberCode: res.data.memberCode, + pkId: res.data.pkId, + baseQuantity: res.data.baseQuantity, + receiveTime: res.data.receiveTime, + usableQuantity: res.data.usableQuantity, + quantity: 0, + isFreeMail: res.data.isFreeMail, + pickType: res.data.pickType, + waresGiftConfigList: [ + { + pkProduct: '', + productName: '', + specsName: '', + specsNameId: '', + quantity: 0 + } + ] }], 'orderType': 1 }] } - }) this.$forceUpdate() }, @@ -551,14 +585,21 @@ export default { }, saveDate() { const dataList = [] - this.allData[0].consumeRuleConfigList.forEach((res) => { + this.allData[0].consumeRuleConfigList.forEach((item) => { dataList.push( - { 'memberCode': res.memberCode, 'pkProduct': res.waresGiftConfigList[0].pkProduct, 'memberName': res.memberName, - 'productName': res.waresGiftConfigList[0].productName + res.waresGiftConfigList[0].specsName, - 'receiveTime': res.receiveTime, - 'specsName': res.waresGiftConfigList[0].specsName, 'specsNameId': res.waresGiftConfigList[0].specsNameId, - 'baseQuantity': res.baseQuantity, 'quantity': res.quantity, 'isFreeMail': res.isFreeMail, 'pkPostage': res.pkPostage, - "pkId":res.pkId?res.pkId:'' + { 'memberCode': item.memberCode, + 'pkProduct': item.waresGiftConfigList[0].pkProduct, + 'memberName': item.memberName, + 'productName': item.waresGiftConfigList[0].productName + item.waresGiftConfigList[0].specsName, + 'receiveTime': item.receiveTime, + 'specsName': item.waresGiftConfigList[0].specsName, + 'specsNameId': item.waresGiftConfigList[0].specsNameId, + 'baseQuantity': item.baseQuantity, + 'quantity': item.quantity, + 'isFreeMail': item.isFreeMail, + 'pkPostage': item.pkPostage, + 'pkId': item.pkId ? item.pkId : '', + 'pickType': item.pickType } ) }) @@ -590,7 +631,7 @@ export default { } if (res.quantity === '' || res.quantity == undefined) { this.flags = 3 - + return false } else { this.flags = 2 @@ -619,20 +660,30 @@ export default { }) } else if (this.flags == 3) { this.$message({ - message: '请输入增加数量', - type: 'warning' - }) - }else { - this.$router.push({ - path: 'rechargeQc', - query: { - data: JSON.stringify(dataList), - approvalBusiness: 700, + message: '请输入增加数量', + type: 'warning' + }) + } else { + const params = { + detailList: dataList, + signType: 0, // 普通件,急件,密件 + remark: '', // 备注 + fileList: [], // 附件[] + userIdList: [], // 审批流程[] + sendIdList: [] // 审批流程[] + } + man.rechargeConfirm(params).then((res) => { + if (res.code === 200) { + this.$message({ + message: res.msg, + type: 'success' + }) + this.$router.go(-1) } }) } }, - saveDate1(){ + saveDate1() { const dataList = [] this.allData[0].consumeRuleConfigList.forEach((res) => { dataList.push( @@ -641,18 +692,30 @@ export default { 'receiveTime': res.receiveTime, 'specsName': res.waresGiftConfigList[0].specsName, 'specsNameId': res.waresGiftConfigList[0].specsNameId, 'baseQuantity': res.baseQuantity, 'quantity': res.quantity, 'isFreeMail': res.isFreeMail, 'pkPostage': res.pkPostage, - "pkId":res.pkId?res.pkId:'' + 'pkId': res.pkId ? res.pkId : '' } ) }) - this.$router.push({ - path: 'rechargeQc', - query: { - data: JSON.stringify(dataList), - approvalBusiness: 701, - type:this.deled - } - }) + const params = { + detailList: dataList + } + man.rechargeDel(params).then((res) => { + if (res.code === 200) { + this.$message({ + message: res.msg, + type: 'success' + }) + this.$router.go(-1) + } + }) + // this.$router.push({ + // path: 'rechargeQc', + // query: { + // data: JSON.stringify(dataList), + // approvalBusiness: 701, + // type: this.deled + // } + // }) }, getPage(allData) { this.allData = allData @@ -690,13 +753,19 @@ export default { this.ggVisible = false }, sureProduct() { - if (this.selectData.length == 0) { + if (!this.selectData) { this.$message({ message: '请选择产品', type: 'warning' }) - return false } else { + if (!this.selectData.selSkuNameList || this.selectData.selSkuNameList.length === 0) { + this.$message({ + message: '请选择产品规格', + type: 'warning' + }) + return + } this.allData.forEach((item) => { if (this.isArea == item.orderType) { item.consumeRuleConfigList[this.showCndex].waresGiftConfigList[ @@ -758,7 +827,7 @@ export default { this.isArea = val }, handleClose() { - this.selectData = [] + this.selectData = undefined this.dialogVisible = false }, handleCloseGg() { @@ -803,8 +872,10 @@ export default { specsName: '', specsNameId: '', quantity: '' + } - ] + ], + pickType: 0 }) } }) @@ -838,7 +909,7 @@ export default { }, getDataList() { api - .getProductAll(Object.assign({isPutOn:0}, this.queryParams, this.select,{isExistSpecs:1})) + .getProductAll(Object.assign({ isPutOn: 0 }, this.queryParams, this.select, { isExistSpecs: 1 })) .then((res) => { res.rows.forEach((item) => { item.quantity = 1 @@ -872,18 +943,23 @@ export default { }, selected(selection, row) { // 清除 所有勾选项 + if (selection.length === 0) { + this.selectData = undefined + } else { + this.selectData = row + } + this.$refs.multipleTable.clearSelection() - // 当表格数据都没有被勾选的时候 就返回 - // 主要用于将当前勾选的表格状态清除 - if (selection.length == 0) return this.$refs.multipleTable.toggleRowSelection(row, true) - this.selectData = row - }, - // 表格的选中 可以获得当前选中的数据 - selectionChange(val) { - // 将选中的数据存储起来 - this.selectData = val + // // 当表格数据都没有被勾选的时候 就返回 + // // 主要用于将当前勾选的表格状态清除 + // this.$nextTick(() => { + // if (selection.length == 0) return + // this.$refs.multipleTable.toggleRowSelection(row, true) + // this.selectData = row + // }) }, + tableRowClassName({ row, rowIndex }) { if (rowIndex % 2 == 1) { return 'warning-row' @@ -891,6 +967,11 @@ export default { return 'success-row' } return '' + }, + pickTypeChange(val, item) { + if (val === 8) { + this.$set(item, 'baseQuantity', '1') + } } } } diff --git a/src/views/marketing/rechargeCard/index.vue b/src/views/marketing/rechargeCard/index.vue index e908ca2..5968eef 100644 --- a/src/views/marketing/rechargeCard/index.vue +++ b/src/views/marketing/rechargeCard/index.vue @@ -111,22 +111,22 @@
{{'添加'}} + >{{ '添加' }} {{ '导出' }} + > 导出