1 line
8.6 KiB
JSON
1 line
8.6 KiB
JSON
{"remainingRequest":"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\\canteen\\foodPrepare\\addPrepare\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"E:\\hz-zhhq-web\\src\\views\\canteen\\foodPrepare\\addPrepare\\index.vue","mtime":1737610069406},{"path":"E:\\hz-zhhq-web\\babel.config.js","mtime":1737610069371},{"path":"E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1740463332762},{"path":"E:\\hz-zhhq-web\\node_modules\\babel-loader\\lib\\index.js","mtime":1740463332584},{"path":"E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1740463332762},{"path":"E:\\hz-zhhq-web\\node_modules\\vue-loader\\lib\\index.js","mtime":1740463340941}],"contextDependencies":[],"result":["\"use strict\";\n\nvar _interopRequireDefault = require(\"E:/hz-zhhq-web/node_modules/@babel/runtime/helpers/interopRequireDefault.js\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nrequire(\"core-js/modules/web.dom.iterable\");\nvar _getdata = require(\"@/api/getdata\");\nvar _popup = _interopRequireDefault(require(\"@/views/estate/examine/dialog/popup.vue\"));\nvar _crypto = require(\"crypto\");\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//\nvar _default = exports.default = {\n components: {\n Popup: _popup.default\n },\n data: function data() {\n var valNum = function valNum(rule, value, callback) {\n var reg = /^[0-9]+(\\.[0-9]{1,2})?$/;\n if (reg.test(value)) {\n callback();\n } else {\n callback(new Error('请输入正数(包含两位小数)'));\n }\n };\n var checkUnit = function checkUnit(rule, value, callback) {\n var reg = \"克千克件\";\n if (reg.indexOf(value) != -1) {\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(\"pageIndex\"),\n validation: false,\n completeTitle: \"\",\n nav: \"\",\n imgData: {},\n dialogImageUrl: \"\",\n dialogVisible: false,\n timeUpdate: \"\",\n ruleForm: {\n RAW: [],\n TIME: \"\",\n FOOD_TYPE: ''\n // foodType:'',\n // STAFF_NAME: \"\",\n // SEX: \"\",\n // CARD: \"\",\n // PHONE: \"\",\n // HEALTH:\"\",\n // HEALTH_PHOTO:[],\n // OPERATE_PHOTO:[]\n },\n til: \"添加\",\n id: \"\",\n TIME: '',\n FOOD_TYPE: '',\n rules: {\n TIME: [{\n required: true,\n message: \"请选择时间\",\n trigger: \"blur\"\n }],\n FOOD_TYPE: [{\n required: true,\n message: \"请选择菜谱\",\n trigger: \"blur\"\n }],\n NUM: [{\n required: true,\n message: \"请输入数量\",\n trigger: \"blur\"\n }, {\n validator: valNum,\n trigger: \"blur\"\n }],\n UNIT: [{\n required: true,\n message: \"请输入单位\",\n trigger: \"blur\"\n }, {\n validator: checkUnit,\n trigger: \"blur\"\n }]\n },\n foodTypeList: [{\n id: '0',\n name: '早餐'\n }, {\n id: '1',\n name: '午餐'\n }, {\n id: '2',\n name: '晚餐'\n }],\n parentData: [],\n pickerOptions: {\n disabledDate: function disabledDate(time) {\n return time.getTime() < Date.now() - 8.64e7 || time.getTime() > Date.now() + 30 * 24 * 60 * 60 * 1000;\n }\n }\n };\n },\n created: function created() {},\n watch: {\n TIME: function TIME(newVal, oldVal) {\n this.ruleForm.TIME = newVal;\n if (this.FOOD_TYPE != '') {\n this.getRawBywatch();\n }\n },\n FOOD_TYPE: function FOOD_TYPE(newVal, oldVal) {\n this.ruleForm.FOOD_TYPE = newVal;\n if (this.TIME != '') {\n this.getRawBywatch();\n }\n }\n },\n mounted: function mounted() {},\n methods: {\n getRawBywatch: function getRawBywatch() {\n var _this = this;\n console.log(this.TIME);\n console.log(this.FOOD_TYPE);\n var valNum = function valNum(rule, value, callback) {\n var reg = /^[0-9]\\d*$/;\n if (reg.test(value)) {\n callback();\n } else {\n callback(new Error('请输入正整数数字'));\n }\n };\n var Content = {\n TIME: this.TIME,\n FOOD_TYPE: this.FOOD_TYPE\n };\n (0, _getdata.getRaw)(Content).then(function (res) {\n if (res.returnCode == \"1\") {\n // console.log(res.returnData)\n _this.ruleForm.RAW = [];\n res.returnData.forEach(function (item, index) {\n var obj = {};\n obj['RAW_NAME'] = item;\n obj['NUM'] = '';\n obj['UNIT'] = '';\n obj['NOTES'] = '';\n _this.ruleForm.RAW.push(obj);\n // console.log(this.ruleForm)\n // this.rules['NUM'+index] = [{ required: true, message: \"请输入数量\"+index, trigger: \"blur\" }]\n // this.rules['UNIT'+index] = [{ required: true, message: \"请输入\"+index, trigger: \"blur\" }]\n });\n // this.rules['NUM'] = [{ required: true, message: \"请输入数量\", trigger: \"blur\" }]\n // this.ruleForm.RAW = res.returnData;\n }\n }).catch(function (err) {\n console.log(err);\n });\n },\n /**返回上一级 */comeBack: function comeBack() {\n this.$router.push({\n name: \"canteen-foodPrepare-index\",\n params: {\n index: this.indexCall\n }\n });\n },\n submitForm: function submitForm(formName) {\n var _this2 = this;\n console.log(this.ruleForm.RAW);\n if (this.ruleForm.RAW.length == 0) {\n this.$message({\n message: \"所选菜谱无数据,请先添加菜谱\",\n type: \"error\"\n });\n } else {\n this.$refs[formName].validate(function (valid) {\n console.log(valid);\n if (valid) {\n if (_this2.til == \"编辑\") {\n _this2.validation = true;\n _this2.completeTitle = \"编辑\";\n _this2.nav = \"是否编辑?\";\n } else {\n _this2.validation = true;\n _this2.completeTitle = \"添加\";\n _this2.nav = \"是否添加?\";\n }\n }\n });\n }\n },\n closeDialogDel: function closeDialogDel(val) {\n var _this3 = this;\n if (val == \"3\") {\n console.log(this.ruleForm);\n var Content = {\n TIME: this.TIME,\n FOOD_TYPE: this.FOOD_TYPE,\n RAW: this.ruleForm.RAW\n };\n console.log(Content);\n (0, _getdata.addCanteenPlan)(Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this3.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n if (_this3.completeTitle == \"添加\") {\n _this3.$router.push({\n name: \"canteen-foodPrepare-index\",\n params: {\n index: 1\n }\n });\n }\n } else {\n _this3.$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 resetForm: function resetForm(formName) {\n this.$refs[formName].resetFields();\n this.$router.push({\n name: \"canteen-foodPrepare-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.OPERATE_PHOTO = file;\n }\n }\n};",null]} |