diff --git a/src/views/store/creatStore/index.vue b/src/views/store/creatStore/index.vue index 6b8fb9b..f1d82ef 100644 --- a/src/views/store/creatStore/index.vue +++ b/src/views/store/creatStore/index.vue @@ -532,63 +532,63 @@ - - - - - - - - - - - - - - - - - - - - - - - - 取消 - - - - - - - - - - - - - - - - - - - - - - - 确定 - 取消 - - - - - - - 添加分期配置 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { - if (!config.installmentNumber || !config.price || config.price <= 0) { - this.$message.error('分期数和价格不能为空且价格必须大于0'); - return; - } - }); - if ( - this.newInstallmentConfigs.length > 0 && - this.newInstallmentConfigs.every((config) => - Object.values(config).every((value) => value !== '' && value !== null) - ) - ) { - // 将非空对象逐个添加到 installmentConfigs 数组中 - this.newInstallmentConfigs.forEach((config) => { - if (Object.values(config).some((value) => value !== '' && value !== null)) { - config.price = Number(config.price); - this.formValidate.installmentConfigs.push(config); - } - }); - - // 清空 newInstallmentConfigs 数组 - this.newInstallmentConfigs = []; - } - }, + // // 添加分期配置 + // addInstallmentConfig() { + // this.newInstallmentConfigs.push({ ...this.newInstallment }); + // // 判断是否有选择分期数和输入价格 + // }, + // saveNewInstallmentConfig: function () { + // //判断newInstallmentConfigs数组是否有值, + // //如果有值则将newInstallmentConfigs数组里的对象,一个个添加到installmentConfigs数组中 + // // 判断 newInstallmentConfigs 数组是否有值且里面的对象不是都是空值 + // this.newInstallmentConfigs.forEach((config) => { + // if (!config.installmentNumber || !config.price || config.price <= 0) { + // this.$message.error('分期数和价格不能为空且价格必须大于0'); + // return; + // } + // }); + // if ( + // this.newInstallmentConfigs.length > 0 && + // this.newInstallmentConfigs.every((config) => + // Object.values(config).every((value) => value !== '' && value !== null) + // ) + // ) { + // // 将非空对象逐个添加到 installmentConfigs 数组中 + // this.newInstallmentConfigs.forEach((config) => { + // if (Object.values(config).some((value) => value !== '' && value !== null)) { + // config.price = Number(config.price); + // this.formValidate.installmentConfigs.push(config); + // } + // }); + // + // // 清空 newInstallmentConfigs 数组 + // this.newInstallmentConfigs = []; + // } + // }, // 取消 offAttrName() { this.isBtn = false; @@ -1248,8 +1248,8 @@ export default { selectRule: info.selectRule, isSub: info.isSub, content: this.$selfUtil.replaceImgSrcHttps(info.content), - installmentConfigs: info.storeProductInstallmentsList ==null?[]:info.storeProductInstallmentsList, - orderType: info.orderType, + // installmentConfigs: info.storeProductInstallmentsList ==null?[]:info.storeProductInstallmentsList, + // orderType: info.orderType, specType: info.specType, id: info.id, giveIntegral: info.giveIntegral, @@ -1414,14 +1414,14 @@ export default { // 提交 handleSubmit: Debounce(function (name) { this.onChangeGroup(); - this.saveNewInstallmentConfig(); - this.newInstallmentConfigs.forEach((config) => { - if (!config.installmentNumber || !config.price || config.price <= 0) { - this.$message.error('分期数和价格不能为空且价格必须大于0'); - return; - } - }); - console.log("this.formValidate----------"+JSON.stringify(this.formValidate)) + // this.saveNewInstallmentConfig(); + // this.newInstallmentConfigs.forEach((config) => { + // if (!config.installmentNumber || !config.price || config.price <= 0) { + // this.$message.error('分期数和价格不能为空且价格必须大于0'); + // return; + // } + // }); + // console.log("this.formValidate----------"+JSON.stringify(this.formValidate)) if (this.formValidate.specType && this.formValidate.attr.length < 1) return this.$message.warning('请填写多规格属性!'); this.formValidate.cateId = this.formValidate.cateIds.join(','); @@ -1461,7 +1461,7 @@ export default { this.$refs[name].validate((valid) => { if (valid) { this.fullscreenLoading = true; - this.formValidate.orderType = this.orderType; + // this.formValidate.orderType = this.orderType; this.$route.params.id ? productUpdateApi(this.formValidate) .then(async (res) => {