{"remainingRequest":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js??ref--0-0!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/components/limited/limitedSettingDialog.vue?vue&type=script&lang=js","dependencies":[{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/components/limited/limitedSettingDialog.vue","mtime":1701742078547},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/babel.config.js","mtime":1701742078504},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport { addLimitedRecordApi, updateLimitedRecordApi } from '@/api/marketing';\nexport default {\n  props: ['showLimitedSettingDialog', 'productId', 'limitedSettingInfo'],\n  watch: {\n    limitedSettingInfo: function limitedSettingInfo(newVal) {\n      if (newVal.id) {\n        this.allQuota = newVal.allQuota ? newVal.allQuota : 1;\n        this.oneQuota = newVal.oneQuota ? newVal.oneQuota : 1;\n      }\n      this.limitedSetInfo = newVal;\n    }\n  },\n  data: function data() {\n    return {\n      allQuota: 1,\n      oneQuota: 1,\n      limitedSetInfo: {}\n    };\n  },\n  methods: {\n    onClose: function onClose() {\n      this.$emit('closeLimitedSettingDialog');\n    },\n    onConfirm: function onConfirm() {\n      var _this = this;\n      if (this.oneQuota > this.allQuota) {\n        this.$message({\n          message: '单次限购数量不能大于总限购数量',\n          type: 'error',\n          showClose: true\n        });\n        return;\n      }\n      if (this.limitedSetInfo.id) {\n        var params = {\n          id: this.limitedSetInfo.id,\n          enabled: this.limitedSetInfo.enabled,\n          allQuota: this.allQuota,\n          oneQuota: this.oneQuota,\n          productId: this.limitedSetInfo.productId,\n          name: this.limitedSetInfo.name\n        };\n        updateLimitedRecordApi(params).then(function (res) {\n          _this.$message({\n            showClose: true,\n            message: '修改成功',\n            type: 'success'\n          });\n          _this.onClose();\n        }).catch(function (err) {});\n      } else {\n        var _params = {\n          productId: this.limitedSetInfo.productId,\n          enabled: true,\n          allQuota: this.allQuota,\n          oneQuota: this.oneQuota,\n          name: this.limitedSetInfo.name\n        };\n        addLimitedRecordApi(_params).then(function (res) {\n          _this.$message({\n            showClose: true,\n            message: '新增限购成功',\n            type: 'success'\n          });\n          _this.$emit('closeLimitedSettingDialog', {\n            allQuota: _this.allQuota,\n            oneQuota: _this.oneQuota,\n            productId: _this.limitedSetInfo.productId\n          });\n        }).catch(function (err) {});\n      }\n    }\n  }\n};",null]}