crm_second_opening_mini/pagesA/business/addBusiness.js

1 line
4.3 KiB
JavaScript

require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesA/business/addBusiness"],{"00c1":function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=e("0c59"),o=e("dc92"),c=e("76dd"),s={components:{selectCustomer:function(){Promise.all([e.e("common/vendor"),e.e("components/selectCustomer")]).then(function(){return resolve(e("5bcd"))}.bind(null,e)).catch(e.oe)},popupList:function(){Promise.all([e.e("common/vendor"),e.e("components/selectProduct/index")]).then(function(){return resolve(e("a99f"))}.bind(null,e)).catch(e.oe)},popupProductConfig:function(){e.e("components/selectProductConfig/index").then(function(){return resolve(e("55ad"))}.bind(null,e)).catch(e.oe)},formItem:function(){Promise.all([e.e("common/vendor"),e.e("components/form/formitem")]).then(function(){return resolve(e("d7bf"))}.bind(null,e)).catch(e.oe)}},data:function(){return{BASE_IMG_URL:i.BASE_IMG_URL,noClick:!0,customerObj:{},listForm:[],productList:[],isRequired:!1}},onLoad:function(t){t.id&&this.getCustomerInfo(t.id),this.getForm()},methods:{changeRequired:function(t){this.isRequired=t.detail.value},getCustomerInfo:function(t){var n=this;(0,c.netKehuDetail)({id:t}).then((function(t){t=t.data,n.customerObj={id:t.id,name:t.name}}))},getForm:function(){var t=this;(0,o.netSetForm)({type:"business"}).then((function(n){n=n.data.data,n.forEach((function(t){t.value=""})),t.listForm=n}))},changeCus:function(t){this.$refs.customerChild.init()},sureSelect:function(t){this.customerObj=t},changeOtherData:function(t,n,e){var i=this,o=this.listForm;o.forEach((function(t,o){t.id==e.id&&(t.value=n,i.$set(i.listForm,o,t))}))},addPart:function(){this.$refs.productChild.init()},selectList:function(t){t.forEach((function(t){t.minprice=t.price,t.parts=[]})),this.productList=this.deWeight(t.concat(this.productList))},deWeight:function(t){for(var n=0;n<t.length-1;n++)for(var e=n+1;e<t.length;e++)t[n].id==t[e].id&&(t.splice(e,1),e--);return t},changeNumber:function(t,n){var e=this.productList[n];e.number=t,this.$set(this.productList,n,e)},delProduct:function(t){this.productList.splice(t,1)},toSelectConfig:function(t,n){this.configIndex=n,this.$refs.productConfig.init(t.id)},configList:function(t){var n=this.productList[this.configIndex];n.parts=this.deWeight(n.parts.concat(t)),this.$set(this.productList,this.configIndex,n)},changeConfigNumber:function(t,n,e){var i=this.productList[e];i.parts[n].number=t,this.$set(this.productList,e,i)},delPeizhi:function(t,n){var e=this.productList[t];e.parts.splice(n,1),this.$set(this.productList,t,e)},toSave:function(){if(this.customerObj.id){var n=this.checkCommonForm(this.listForm);if(n){var e=[];this.productList.length>0&&this.productList.forEach((function(t){e.push({product_id:t.id,price:t.price,number:t.number,parts:t.parts,min_price:t.min_price})})),n=Object.assign({},n,{customer_id:this.customerObj.id,product:e}),(0,o.netAddBusiness)(n).then((function(n){t.showToast({title:n.msg,icon:"none"}),setTimeout((function(){t.navigateBack({delta:1})}),2e3)}))}}else t.showToast({title:"请选择客户名称",icon:"none"})}}};n.default=s}).call(this,e("543d")["default"])},"3d2b":function(t,n,e){"use strict";e.d(n,"b",(function(){return o})),e.d(n,"c",(function(){return c})),e.d(n,"a",(function(){return i}));var i={uniNumberBox:function(){return e.e("uni_modules/uni-number-box/components/uni-number-box/uni-number-box").then(e.bind(null,"2e8f"))}},o=function(){var t=this.$createElement,n=(this._self._c,this.productList.length);this.$mp.data=Object.assign({},{$root:{g0:n}})},c=[]},"40f5":function(t,n,e){"use strict";e.r(n);var i=e("00c1"),o=e.n(i);for(var c in i)["default"].indexOf(c)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(c);n["default"]=o.a},"55a1":function(t,n,e){"use strict";e.r(n);var i=e("3d2b"),o=e("40f5");for(var c in o)["default"].indexOf(c)<0&&function(t){e.d(n,t,(function(){return o[t]}))}(c);e("a294");var s=e("f0c5"),r=Object(s["a"])(o["default"],i["b"],i["c"],!1,null,"ed952232",null,!1,i["a"],void 0);n["default"]=r.exports},"5d5a":function(t,n,e){},"84fc":function(t,n,e){"use strict";(function(t,n){var i=e("4ea4");e("8886");i(e("66fd"));var o=i(e("55a1"));t.__webpack_require_UNI_MP_PLUGIN__=e,n(o.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},a294:function(t,n,e){"use strict";var i=e("5d5a"),o=e.n(i);o.a}},[["84fc","common/runtime","common/vendor"]]]);