1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-34977340"],{"0df0":function(t,e,o){"use strict";var a=o("ddce"),i=o.n(a);i.a},"3da4":function(t,e,o){"use strict";o.d(e,"d",function(){return n}),o.d(e,"e",function(){return r}),o.d(e,"i",function(){return c}),o.d(e,"a",function(){return l}),o.d(e,"b",function(){return u}),o.d(e,"h",function(){return d}),o.d(e,"g",function(){return f}),o.d(e,"f",function(){return h}),o.d(e,"j",function(){return m}),o.d(e,"c",function(){return p});var a=o("8982"),i="/industryParkApi",s="/wx/WxParkGoodsOrderController";function n(t){return Object(a["a"])({url:i+s+"/getGoodsList",method:"post",data:t})}function r(t){return Object(a["a"])({url:i+s+"/getGoodsTypeList",method:"post",data:t})}function c(t){return Object(a["a"])({url:i+s+"/operateGoodsState",method:"post",data:t})}function l(t){return Object(a["a"])({url:i+s+"/addGoods",method:"post",data:t})}function u(t){return Object(a["a"])({url:i+s+"/getEatOutList",method:"post",data:t})}function d(t){return Object(a["a"])({url:i+s+"/getStoreList",method:"post",data:t})}function f(t){return Object(a["a"])({url:i+s+"/getOrderList",method:"post",data:t})}function h(t){return Object(a["a"])({url:i+s+"/getOrderDetial",method:"post",data:t})}function m(t){return Object(a["a"])({url:i+s+"/orderConsume",method:"post",data:t})}function p(t){return Object(a["a"])({url:i+s+"/getGoodsDetial",method:"post",data:t})}},8024:function(t,e,o){"use strict";o.d(e,"a",function(){return n});o("f499");var a=o("8982"),i="/industryParkApi",s="/wx/dictController";function n(t){return Object(a["a"])({url:i+s+"/getByCode",method:"post",data:t})}},8982:function(t,e,o){"use strict";o.d(e,"a",function(){return h}),o.d(e,"b",function(){return m});var a=o("795b"),i=o.n(a),s=o("bc3a"),n=o.n(s),r=o("4328"),c=o.n(r),l=o("4360"),u=o("5cab"),d=o("a18c"),f=o("3089");function h(t,e){t.headers||(t.headers={}),t.headers&&u["a"].getToken()&&(t.headers["RC-Token"]=u["a"].getToken());var o={method:t.method,url:t.url,data:c.a.stringify(t.data)};return e&&(o.data=t.data),t.headers&&(o.headers=t.headers),new i.a(function(e,a){n()(o).then(function(t){if(t&&t.data&&200===t.status){var o=t.data;switch(o.errno){case 501:Object(f["Toast"])(o.errmsg),setTimeout(function(){l["a"].dispatch("user/logout").then(function(){d["a"].push("/login")})},1500),a(o.errmsg);break;case 401:case 402:case 502:case 503:case 504:case 505:case 506:case 507:case 508:case 801:Object(f["Toast"])(o.errmsg),a(o.errmsg);break}e(o)}else console.log(t),a(t)}).catch(function(e,o){console.log(t.url+" fail",e,o),Object(f["Toast"])(e),a(e,o)})})}function m(t){t.headers||(t.headers={}),t.headers&&u["a"].getToken()&&(t.headers["RC-Token"]=u["a"].getToken());var e={method:t.method,url:t.url};return e.data=t.data,t.headers&&(e.headers=t.headers,e.headers["MVVM-Key"]=String((new Date).getTime()),e.headers["xx"]="anything",e.headers["Content-Type"]="application/json;charset=UTF-8"),console.log("request: ",t),new i.a(function(o,a){n.a.defaults.withCredentials=!0,n()(e).then(function(t){if(console.log("response:",t),t&&t.data&&200===t.status){var e=t.data;switch(e.errno){case 501:Object(f["Toast"])(e.errmsg),setTimeout(function(){l["a"].dispatch("user/logout").then(function(){d["a"].push("/login")})},1500),a(e.errmsg);break;case 401:case 402:case 502:case 503:case 504:case 505:case 506:case 507:case 508:case 801:Object(f["Toast"])(e.errmsg),a(e.errmsg);break}o(e)}else console.log(t),a(t)}).catch(function(e,o){console.log(t.url+" fail",e,o),Object(f["Toast"])(e),a(e,o)})})}},b515:function(t,e,o){"use strict";o.r(e);var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"repair-box"},[o("div",{staticClass:"tabs-box"},[o("div",{staticClass:"fixed-page-content"},[o("div",{staticClass:"white-box page-1 form-part"},[t._m(0),o("div",{staticClass:"custom-white-box-content"},[o("div",{staticClass:"custom-input-box"},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.form.goodsName,expression:"form.goodsName"}],attrs:{type:"text",maxlength:"50px",placeholder:"请输入"},domProps:{value:t.form.goodsName},on:{input:function(e){e.target.composing||t.$set(t.form,"goodsName",e.target.value)}}})])]),o("div",{staticClass:"block-cell-item"},[o("div",{staticClass:"tit"},[o("ul",{staticClass:"custom-select-list"},t._l(t.quickList,function(e){return o("li",{key:e.value,class:{active:t.quickSleced.value&&e.value===t.quickSleced.value},on:{click:function(o){return t.quickSelect(e)}}},[t._v("\n\t\t\t\t\t\t\t\t\t"+t._s(e.label)+"\n\t\t\t\t\t\t\t\t")])}),0)])]),o("van-field",{staticClass:"input-item picker-item",attrs:{readonly:"",clickable:"",value:t.value,"input-align":"right",label:"所属商家",placeholder:"请选择"},on:{click:function(e){t.showPicker=!0}},scopedSlots:t._u([{key:"button",fn:function(){return[o("i",{staticClass:"iconfont icon-zuo"})]},proxy:!0}])}),o("van-popup",{attrs:{position:"bottom"},model:{value:t.showPicker,callback:function(e){t.showPicker=e},expression:"showPicker"}},[o("van-picker",{staticClass:"picker-box",attrs:{"show-toolbar":"",columns:t.columns},on:{confirm:function(e){return t.onSelect(e)},cancel:function(e){t.showPicker=!1}}})],1),o("van-field",{staticClass:"input-item",attrs:{label:"份量",placeholder:"请填写","input-align":"right"},model:{value:t.form.weight,callback:function(e){t.$set(t.form,"weight",e)},expression:"form.weight"}}),o("van-field",{staticClass:"input-item",attrs:{label:"单价(元)",placeholder:"请填写","input-align":"right"},model:{value:t.form.price,callback:function(e){t.$set(t.form,"price",e)},expression:"form.price"}}),o("div",{staticClass:"cell-item"},[o("p",{staticClass:"label"},[t._v("所属餐别")]),o("div",{staticClass:"tit"},[o("van-radio-group",{model:{value:t.form.goodsTypeId,callback:function(e){t.$set(t.form,"goodsTypeId",e)},expression:"form.goodsTypeId"}},t._l(t.goodsTypeList,function(e){return o("van-radio",{key:e.id,attrs:{name:e.id,"checked-color":"#976CEB"},on:{change:function(o){return t.changePosition(e.id)}}},[t._v(t._s(e.typeName)+"\n\t\t\t\t\t\t\t\t")])}),1)],1)]),o("div",{staticClass:"block-cell-item"},[t._m(1),o("div",{staticClass:"tit"},[o("van-uploader",{attrs:{multiple:!0,"max-count":1,"after-read":t.afterRead,"before-delete":t.beforeDelete},model:{value:t.fileUrls,callback:function(e){t.fileUrls=e},expression:"fileUrls"}})],1),o("van-field",{attrs:{autosize:"",type:"textarea",maxlength:"800",placeholder:"请填写商品描述","show-word-limit":""},model:{value:t.form.brief,callback:function(e){t.$set(t.form,"brief",e)},expression:"form.brief"}})],1)],1)]),o("div",{staticClass:"bottom-button"},[o("button",{staticClass:"btn",on:{click:t.submitGoods}},[t._v("保存")])])])])},i=[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"custom-item-tit"},[o("p",{staticClass:"tit"},[t._v("商品名称")])])},function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("p",{staticClass:"label"},[t._v("\n\t\t\t\t\t\t\t商品图片"),o("span",{staticClass:"tips"},[t._v("(支持图片/视频上传限20M内,最多1张)")])])}],s=o("795b"),n=o.n(s),r=(o("ac6a"),o("8024")),c=o("3da4"),l=o("bc3a"),u=o.n(l),d=o("3089"),f={data:function(){return{goodsId:"",active:0,quickSleced:{},goodsTypeList:[],quickList:[],positionSleced:"1",fileUrlList:[],fileUrls:[],columns:[],showPicker:!1,value:"",groupId:"870261874875170816",form:{},time:"",showPicker_time:!1,mealLabelList:["1","2","3"]}},mounted:function(){this.getKWList(),this.getGoodsTypeList(),this.goodsId=this.$route.query.goodsId,this.getStore()},methods:{onSelect:function(t){this.value=t.text,this.form.storeId=t.value,this.showPicker=!1},getStore:function(){var t=this,e={groupId:this.groupId};Object(c["h"])(e).then(function(e){t.storeList=[],e.data.forEach(function(e){var o={text:e.storeName,value:e.id};t.columns.push(o),t.getDetial()})})},getDetial:function(){var t=this,e={id:this.goodsId};Object(c["c"])(e).then(function(e){t.form=e.data,t.quickSleced.value=t.form.flavor,t.fileUrls=[],t.fileUrlList=[];var o={url:e.data.goodsImg,isImage:!0};t.columns.forEach(function(e){e.value==t.form.storeId&&(t.value=e.text)}),t.fileUrlList.push(o),t.fileUrls.push(o)})},getKWList:function(){var t=this,e={code:"goodsFlavor"};Object(r["a"])(e).then(function(e){console.log("口味_:",e),t.quickList=JSON.parse(e.data.dictValue)})},getGoodsTypeList:function(){var t=this,e={groupId:this.groupId};Object(c["e"])(e).then(function(e){t.goodsTypeList=e.data,t.goodsTypeList!=[]&&t.goodsTypeList.length>0&&(t.goodsTypeKey=t.goodsTypeList[0].id)})},changePosition:function(t){},cbSelect:function(){this.showPicker_time=!0},onConfirm:function(t){this.time=t,this.showPicker_time=!1},quickSelect:function(t){this.quickSleced.value&&this.quickSleced.value===t.value?(this.form.flavor="",this.quickSleced={}):(this.form.flavor=t.label,this.quickSleced=t)},afterRead:function(t){var e=this;t instanceof Array?t.map(function(t){e.uploadImg(t)}):this.uploadImg(t)},beforeDelete:function(t,e){var o=this;return o.fileUrlList.splice(e.index,1),function(t,a){var i=a.index;o.fileUrlList[e.index].splice(i,1)}},submitGoods:function(){var t=this;this.form.groupId=this.groupId,this.form.goodsImg=this.fileUrlList.length>0?this.fileUrlList[0].url:"",Object(c["a"])(this.form).then(function(e){t.goNavigator("meal-commodityManagement-app"),Object(d["Toast"])("操作成功!")})},uploadImg:function(t){var e=this,o=new FormData;o.append("file",t.file),console.log(o.get("file"));var a={headers:{"Content-Type":"multipart/form-data","MVVM-Key":String((new Date).getTime()),xx:"anything"}};return new n.a(function(t,i){u.a.post("/industryParkApi/wx/fileController/upload",o,a).then(function(t){var o=JSON.parse(t.data.data);e.fileUrlList.push(o[0])}).catch(function(t,e){i(t,e)})})}}},h=f,m=(o("0df0"),o("2877")),p=Object(m["a"])(h,a,i,!1,null,"4536e0c9",null);e["default"]=p.exports},ddce:function(t,e,o){}}]);
|