hz-zhhq-web/node_modules/.cache/babel-loader/2f2b65aa179d94b3862a4f211b0...

1 line
15 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\\market\\takeawayMenu\\addmenuDetail\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"E:\\hz-zhhq-web\\src\\views\\market\\takeawayMenu\\addmenuDetail\\index.vue","mtime":1737610069436},{"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 _paging = _interopRequireDefault(require(\"@/views/Public/paging.vue\"));\nvar _popup = _interopRequireDefault(require(\"@/views/estate/examine/dialog/popup.vue\"));\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//\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar _default = exports.default = {\n components: {\n Paging: _paging.default,\n Popup: _popup.default\n },\n data: function data() {\n return {\n formInline: {\n pc: \"\",\n input: \"\"\n },\n loading: false,\n //初始化loading\n loadingMsg: \"\",\n loading1: false,\n //初始化loading\n loadingMsg1: \"\",\n a: 0,\n msg: \"暂无商品,请从右侧选择商品\",\n row: {},\n btn: 3,\n cp: \"\",\n validation: false,\n completeTitle: \"\",\n nav: \"\",\n detail: [],\n canteen: \"\",\n input: \"\",\n kinds: \"\",\n foodName: \"\",\n num: \"\",\n quota: \"\",\n id: \"\",\n greenFoodsVarieties: [],\n til: \"添加\",\n tableData: [],\n ruleForm: {\n uploadDate: \"\",\n locationId: '3'\n },\n rules: {\n locationId: [{\n required: true,\n message: \"请选择\",\n trigger: \"blur\"\n }],\n uploadDate: [{\n required: true,\n message: \"请选择日期\",\n trigger: \"blur\"\n }]\n },\n isShow: {},\n page: {\n limit: 0 /** 当前点击*/,\n sizePage: 10 /** 当前多少页*/,\n total: 0 /**总数 */\n },\n page2: {\n limit: 1 /** 当前点击*/,\n sizePage: 10 /** 当前多少页*/,\n total: 0 /**总数 */\n },\n allList: [],\n data: typeof this.$route.query.rowdata == \"string\" ? JSON.parse(window.localStorage.getItem(\"takewayRowdataMarket\")) : this.$route.query.rowdata,\n indexCall: this.$route.query.index ? this.$route.query.index : window.localStorage.getItem(\"takewayIndexMarket\"),\n greenContent: []\n };\n },\n mounted: function mounted() {\n this.createLoad();\n this.createLoad1();\n this.til = this.data ? this.data.til : \"\";\n this.id = this.data ? this.data.id : \"\";\n this.getdetail();\n this.ruleForm.uploadDate = this.data ? this.data.sell_date : \"\";\n if (this.til != \"添加\") {\n this.ruleForm.locationId = this.data ? this.data.locationName : \"\";\n }\n },\n methods: {\n createLoad: function createLoad() {\n this.loading = true;\n this.loadingMsg = \"加载中...\";\n },\n clearLoad: function clearLoad() {\n this.loading = false;\n this.loadingMsg = \"\";\n },\n createLoad1: function createLoad1() {\n this.loading1 = true;\n this.loadingMsg1 = \"加载中...\";\n },\n clearLoad1: function clearLoad1() {\n this.loading1 = false;\n this.loadingMsg1 = \"\";\n },\n comeBack: function comeBack() {\n this.$router.push({\n path: \"market-takeawayMenu-index\",\n params: {\n index: this.indexCall\n }\n });\n },\n getlist: function getlist() {\n var _this = this;\n var Content = {\n currentPage: this.page.limit == \"0\" ? 1 : this.page.limit,\n queryObj: {\n foodName: this.formInline.input.trim(),\n kinds: this.formInline.cp\n }\n };\n (0, _getdata.Marketlist)(Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this.clearLoad1();\n _this.tableData = res.returnData.data;\n _this.tableData.forEach(function (item) {\n // console.log(item,331)\n item.isShow = true;\n _this.allList.forEach(function (items) {\n if (item.id == items.kindsId || item.id == items.id) {\n item.isShow = false;\n }\n });\n });\n _this.page.total = res.returnData.total;\n _this.page.limit = res.returnData.currentPage;\n } else {\n _this.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n setTimeout(function () {\n _this.clearLoad();\n }, 300);\n }\n }).catch(function (err) {\n console.log(err);\n setTimeout(function () {\n _this.clearLoad();\n }, 300);\n });\n },\n // 详情\n getdetail: function getdetail() {\n var _this2 = this;\n var Content = {\n id: this.id\n };\n (0, _getdata.MarketMenudetail)(Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this2.clearLoad();\n _this2.allList = res.returnData;\n _this2.page2.total = res.returnData.length;\n var startIndex = (_this2.page2.limit - 1) * _this2.page2.sizePage;\n var endIndex = startIndex + _this2.page2.sizePage;\n endIndex = endIndex > _this2.allList.length ? _this2.allList.length : endIndex;\n _this2.greenFoodsVarieties = [];\n for (var i = startIndex; i < endIndex; i++) {\n _this2.greenFoodsVarieties.push(_this2.allList[i]);\n }\n //this.greenFoodsVarieties = [];//res.returnData;\n _this2.resetForm.locationId = res.returnData.location_id;\n _this2.resetForm.uploadDate = res.returnData.sell_date ? res.returnData.sell_date : \"\";\n _this2.getlist();\n } else {\n _this2.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n setTimeout(function () {\n _this2.clearLoad();\n }, 300);\n }\n }).catch(function (err) {\n console.log(err);\n setTimeout(function () {\n _this2.clearLoad();\n }, 300);\n });\n },\n handleClick: function handleClick(row, i) {\n console.log(row, 394);\n row.isShow = false;\n var obj = {};\n obj = row;\n obj.foodName = row.food_name ? row.food_name : \"\";\n this.allList.push(row);\n this.page2.total = this.allList.length;\n var startIndex = (this.page2.limit - 1) * this.page2.sizePage;\n var endIndex = startIndex + this.page2.sizePage;\n endIndex = endIndex > this.allList.length ? this.allList.length : endIndex;\n this.greenFoodsVarieties = [];\n for (var i = startIndex; i < endIndex; i++) {\n this.greenFoodsVarieties.push(this.allList[i]);\n }\n },\n // 查询\n search: function search() {\n this.page.limit = 1;\n this.createLoad1();\n this.getlist();\n },\n submitForm: function submitForm(formName) {\n var _this3 = this;\n this.greenContent = [];\n this.allList.map(function (item) {\n _this3.greenContent.push({\n foodName: item.foodName,\n kindsId: item.kindsId ? item.kindsId : item.id,\n quota: 0,\n sellNumber: 1000,\n unit: item.unit\n });\n });\n // 添加商品\n\n this.$refs[formName].validate(function (valid) {\n if (valid) {\n if (_this3.til != \"编辑\") {\n var flag = true;\n _this3.greenContent.map(function (item) {\n // var reg = /^([0-9]*)$/;\n var reg = /[^\\.]\\d+[^\\.]/;\n // if (!item.quota) {\n // item.quota = 0;\n // }\n // if (!item.sellNumber) {\n // this.nav = \"预售量为必填项!\";\n // flag = false;\n // }\n // else {\n // flag = true;\n // }\n return;\n });\n if (!flag) {\n _this3.btn = 2;\n _this3.completeTitle = \"今日商品\";\n _this3.validation = true;\n }\n if (flag) {\n _this3.validation = true;\n _this3.btn = 3;\n _this3.completeTitle = \"添加\";\n _this3.nav = \"是否添加?\";\n }\n } else {\n var _flag = true;\n _this3.greenContent.map(function (item) {\n var reg = /^([0-9]*)$/;\n if (!item.quota) {\n item.quota = 0;\n }\n if (!item.sellNumber) {\n _this3.nav = \"请输入预售量(整数)\";\n _flag = false;\n } else {\n _flag = true;\n }\n return;\n });\n if (!_flag) {\n _this3.btn = 2;\n _this3.completeTitle = \"今日商品\";\n _this3.validation = true;\n }\n if (_flag) {\n _this3.validation = true;\n _this3.btn = 3;\n _this3.completeTitle = \"编辑\";\n _this3.nav = \"是否编辑?\";\n }\n }\n }\n });\n },\n resetForm: function resetForm(formName) {\n this.$refs[formName].resetFields();\n this.$router.push({\n path: \"market-takeawayMenu-index\",\n params: {\n index: this.indexCall\n }\n });\n this.$message({\n message: \"取消成功\",\n type: \"success\"\n });\n },\n closeDialogDel: function closeDialogDel(val) {\n var _this4 = this;\n var Content;\n var aa = 3;\n if (val == \"1\") {\n // this.tableData.map(item => {\n // if (item.id == this.row.id || item.id == this.row.kindsId) {\n // this.createLoad1();\n // this.getlist()\n // this.$set(item,'isShow',true)\n // // item.isShow = true;\n // }\n // });\n var indexid = this.row.kindsId ? this.row.kindsId : this.row.id;\n var delindex = 0;\n this.greenFoodsVarieties.map(function (item, index) {\n if (item.id === indexid || item.kindsId == indexid) {\n delindex = index;\n }\n });\n this.greenFoodsVarieties.splice(delindex, 1);\n this.allList.map(function (item, index) {\n if (item.id === indexid || item.kindsId == indexid) {\n delindex = index;\n }\n });\n this.allList.splice(delindex, 1);\n this.page2.total = this.allList.length;\n this.getlist();\n } else if (val == \"2\") {\n //编辑\n Content = {\n menuId: this.id,\n locationId: aa,\n uploadDate: this.ruleForm.uploadDate ? this.ruleForm.uploadDate : \"\",\n greenFoodsVarieties: this.greenContent\n };\n (0, _getdata.UpdataMarketMenu)(Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this4.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n _this4.$router.push({\n path: \"market-takeawayMenu-index\",\n params: {\n index: _this4.indexCall\n }\n });\n } else {\n _this4.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n setTimeout(function () {\n _this4.clearLoad();\n }, 300);\n }\n }).catch(function (err) {\n console.log(err);\n setTimeout(function () {\n _this4.clearLoad();\n }, 300);\n });\n this.dialogTableVisible = false;\n } else if (val == \"3\") {\n Content = {\n locationId: aa,\n uploadDate: this.ruleForm.uploadDate ? this.ruleForm.uploadDate : \"\",\n greenFoodsVarieties: this.greenContent\n };\n (0, _getdata.AddMarketmenu)(Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this4.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n _this4.$router.push({\n path: \"market-takeawayMenu-index\",\n params: {\n index: _this4.indexCall\n }\n });\n _this4.getdetail();\n } else {\n _this4.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n }).catch(function (err) {\n console.log(err);\n });\n this.dialogTableVisible = false;\n }\n // this.$refs['ruleForm'].resetFields()\n\n this.validation = false;\n },\n handleModifyStatus: function handleModifyStatus(row) {\n this.btn = 3;\n this.completeTitle = \"删除\";\n this.nav = \"是否删除?\";\n this.row = row;\n this.validation = true;\n },\n currentChanges: function currentChanges(val) {\n this.page.limit = val;\n this.getlist();\n },\n currentChanges2: function currentChanges2(val) {\n this.page2.limit = val;\n var startIndex = (this.page2.limit - 1) * this.page2.sizePage;\n var endIndex = startIndex + this.page2.sizePage;\n endIndex = endIndex > this.allList.length ? this.allList.length : endIndex;\n this.greenFoodsVarieties = [];\n for (var i = startIndex; i < endIndex; i++) {\n this.greenFoodsVarieties.push(this.allList[i]);\n }\n //this.greenFoodsVarieties = this.greenFoodsVarieties.concat(arr);\n }\n }\n};",null]}