{"remainingRequest":"E:\\hz-zhhq-web\\node_modules\\thread-loader\\dist\\cjs.js!E:\\hz-zhhq-web\\node_modules\\babel-loader\\lib\\index.js!E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!E:\\hz-zhhq-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!E:\\hz-zhhq-web\\src\\views\\weekfood\\weekCarte\\addweekcarte\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"E:\\hz-zhhq-web\\src\\views\\weekfood\\weekCarte\\addweekcarte\\index.vue","mtime":1737610069455},{"path":"E:\\hz-zhhq-web\\babel.config.js","mtime":1737610069371},{"path":"E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\hz-zhhq-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\hz-zhhq-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\hz-zhhq-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.split\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport { UpdataWeekCarte, AddWeekCarte } from \"@/api/getdata\";\nimport Popup from \"@/views/estate/examine/dialog/popup.vue\";\nimport { constants } from \"crypto\";\nexport default {\n components: {\n Popup: Popup\n },\n data: function data() {\n var priceVa = function priceVa(rule, value, callback) {\n var reg = /^\\d{1,}(\\.\\d{1,2})?$/;\n var reg2 = /[`~!@#$%^&*()_\\-+=<>?:\"{}|,;'\\\\[\\]·~!@#¥%……&*()——\\-+={}|《》?:“”【】、;‘’,。、]/g;\n if (reg.test(value) && !reg2.test(value)) {\n callback();\n } else {\n callback(new Error(\"请输入数字、且小数点后最多两位!\"));\n }\n };\n var foodNameVa = function foodNameVa(rule, value, callback) {\n var reg = /[`~!@#$%^&*()_\\-+=<>?:\"{}|,./;'\\\\[\\]·~!@#¥%……&*()——\\-+={}|《》?:“”【】、;‘’,。、]/g;\n if (!reg.test(value)) {\n callback();\n } else {\n callback(new Error(\"不支持输入@#¥%……...等特殊字符 !\"));\n }\n };\n return {\n indexCall: this.$route.query.index ? this.$route.query.index : window.localStorage.getItem(\"foodIndex\"),\n validation: false,\n completeTitle: \"\",\n nav: \"\",\n imgData: {},\n dialogImageUrl: \"\",\n dialogVisible: false,\n timeUpdate: \"\",\n ruleForm: {\n startDate: '',\n endDate: '',\n breakfast: '',\n lunch: ''\n },\n aa: \"\",\n til: \"添加\",\n id: \"\",\n rules: {\n startDate: [{\n required: true,\n message: \"请选择开始日期\",\n trigger: \"blur\"\n }],\n endDate: [{\n required: true,\n message: \"请选择结束日期\",\n trigger: \"blur\"\n }],\n breakfast: [{\n required: true,\n message: \"请输入早餐\",\n trigger: \"blur\"\n }],\n lunch: [{\n required: true,\n message: \"请上传图片\",\n trigger: \"blur\"\n }]\n },\n startDatePicker: this.beginDate(),\n endDatePicker: this.processDate()\n };\n },\n created: function created() {},\n mounted: function mounted() {\n this.foodsAttr = JSON.parse(window.localStorage.getItem(\"foodsAttr\"));\n var data = typeof this.$route.query.rowdata == \"string\" ? JSON.parse(window.localStorage.getItem(\"foodRowdata\")) : this.$route.query.rowdata;\n this.til = data ? data.til : \"添加\";\n this.id = data ? data.id : \"\";\n this.ruleForm.startDate = data ? data.start_date : \"\";\n this.ruleForm.endDate = data ? data.end_date : \"\";\n this.ruleForm.breakfast = data ? data.breakfast : \"\";\n this.ruleForm.lunch = data ? data.lunch : \"\";\n },\n methods: {\n beginDate: function beginDate() {\n var self = this;\n return {\n disabledDate: function disabledDate(time) {\n if (self.ruleForm.endDate) {\n //如果结束时间不为空,则小于结束时间\n return new Date(self.ruleForm.endDate).getTime() < time.getTime();\n } else {\n // return time.getTime() > Date.now()//开始时间不选时,结束时间最大值小于等于当天\n }\n }\n };\n },\n processDate: function processDate() {\n var self = this;\n return {\n disabledDate: function disabledDate(time) {\n if (self.ruleForm.startDate) {\n //如果开始时间不为空,则结束时间大于开始时间\n return new Date(self.ruleForm.startDate).getTime() > time.getTime();\n } else {\n // return time.getTime() > Date.now()//开始时间不选时,结束时间最大值小于等于当天\n }\n }\n };\n },\n /**返回上一级 */comeBack: function comeBack() {\n this.$router.push({\n name: \"weekfood-weekCarte-index\",\n params: {\n index: this.indexCall\n }\n });\n },\n submitForm: function submitForm(formName) {\n var _this = this;\n this.$refs[formName].validate(function (valid) {\n if (valid) {\n if (_this.til == \"编辑\") {\n _this.validation = true;\n _this.completeTitle = \"编辑\";\n _this.nav = \"是否编辑?\";\n } else {\n _this.validation = true;\n _this.completeTitle = \"添加\";\n _this.nav = \"是否添加?\";\n }\n }\n });\n },\n closeDialogDel: function closeDialogDel(val) {\n var _this2 = this;\n if (val == \"2\") {\n var Content = {\n id: this.id,\n startDate: this.ruleForm.startDate,\n endDate: this.ruleForm.endDate,\n breakfast: this.ruleForm.breakfast,\n lunch: this.ruleForm.lunch\n };\n UpdataWeekCarte(Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this2.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n _this2.$router.push({\n name: \"weekfood-weekCarte-index\",\n params: {\n index: _this2.indexCall\n }\n });\n } else {\n _this2.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n }).catch(function (err) {\n console.log(err);\n });\n } else if (val == \"3\") {\n var _Content = {\n startDate: this.ruleForm.startDate,\n endDate: this.ruleForm.endDate,\n breakfast: this.ruleForm.breakfast,\n lunch: this.ruleForm.lunch\n };\n AddWeekCarte(_Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this2.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n if (_this2.completeTitle == \"添加\") {\n _this2.$router.push({\n name: \"weekfood-weekCarte-index\",\n params: {\n index: 1\n }\n });\n }\n } else {\n _this2.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n }).catch(function (err) {\n console.log(err);\n });\n }\n // this.$refs[\"ruleForm\"].resetFields();\n this.validation = false;\n },\n handlePictureCardPreview: function handlePictureCardPreview(file) {\n this.dialogImageUrl = file.url;\n this.dialogVisible = true;\n },\n changeFile: function changeFile(options, fileList) {\n // console.log(1111)\n var that = this;\n // 获取文件对象\n var file = options.raw;\n //判断图片类型\n if (file.type == \"image/jpeg\" || file.type == \"image/png\" || file.type == \"image/JPG\") {\n var isJPG = true;\n } else {\n isJPG = false;\n }\n // 判断图片大小\n var isLt2M = file.size / 1024 / 1024 < 2;\n if (!isJPG) {\n this.$message.error(\"上传产品图片只能是 JPG/PNG/JPEG 格式!\");\n }\n if (!isLt2M) {\n this.$message.error(\"上传产品图片大小不能超过 2MB!\");\n }\n // 创建一个HTML5的FileReader对象\n var reader = new FileReader();\n //创建一个img对象\n var img = new Image();\n var filename = options.filename;\n if (file) {\n reader.readAsDataURL(file);\n }\n if (isJPG && isLt2M) {\n reader.onload = function (e) {\n var base64Str = reader.result.split(\",\")[1];\n var newUrl;\n img.src = e.target.result;\n // if((file.size / 1024)<20){\n // that.$set(that.ruleForm, \"lunch\", e.target.result);\n // return\n // }\n if (true) {\n that.$set(that.ruleForm, \"lunch\", e.target.result);\n return;\n }\n };\n }\n },\n changeFile1: function changeFile1(options, fileList) {\n var that = this;\n var file = options.raw;\n if (file.type == \"image/jpeg\" || file.type == \"image/png\" || file.type == \"image/JPG\") {\n var isJPG = true;\n } else {\n isJPG = false;\n }\n // 判断图片大小\n var isLt2M = file.size / 1024 / 1024 < 2;\n if (!isJPG) {\n this.$message.error(\"上传产品图片只能是 JPG/PNG/JPEG 格式!\");\n }\n if (!isLt2M) {\n this.$message.error(\"上传产品图片大小不能超过 2MB!\");\n }\n // 创建一个HTML5的FileReader对象\n var reader = new FileReader();\n //创建一个img对象\n var img = new Image();\n var filename = options.filename;\n if (file) {\n reader.readAsDataURL(file);\n }\n if (isJPG && isLt2M) {\n reader.onload = function (e) {\n img.src = e.target.result;\n if (true) {\n that.$set(that.ruleForm, \"breakfast\", e.target.result);\n return;\n }\n };\n }\n },\n resetForm: function resetForm(formName) {\n this.$refs[formName].resetFields();\n this.$router.push({\n name: \"weekfood-weekCarte-index\",\n params: {\n index: this.indexCall\n }\n });\n this.$message({\n message: \"取消成功\",\n type: \"success\"\n });\n },\n // 上传图片\n handleAvatarSuccess: function handleAvatarSuccess(res, file) {\n this.picture = file;\n }\n }\n};",null]}