require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/admin/components/writeOffList/index"],{1377:function(t,i,n){"use strict";(function(t){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var e=n("6af6"),s=(n("28d0"),{props:{list:{type:Object,default:function(){return{}}},auth:{type:[String,Number],default:1},oid:{type:Number,default:0}},data:function(){return{nums:[],newList:[],reduce_show:-1,plus_show:-1,ids:[],lets:0,listlet:0,attr:{cartAttr:!1,id:[],code:"",type:0},lists:{},lengt:0,box:!1,checked:!1,checkModel:[],isAllSelect:!1,data:[{id:"1",value:"aaa"},{id:"2",value:"bbb"},{id:"3",value:"ccc"}],writeOffNum:0,cart_info:[],numChecked:0}},watch:{checkModel:function(){}},mounted:function(){this.cart_info=this.list.cart_info,this.checkAll()},methods:{num:function(){for(var t=0;t<this.lists.cart_info.length;t++)this.nums.push({num:0})},subCart:function(t,i){this.list.cart_info[i].surplus_num_input--},addCart:function(t,i){this.list.cart_info[i].surplus_num_input++},checkAll:function(){this.cart_info;this.checkModel=[],this.checked=!this.checked;for(var t=0;t<this.cart_info.length;t++)this.cart_info[t].checked=this.checked,this.cart_info[t].checked&&this.checkModel.push(this.cart_info[t].cart_id);for(var i=0,n=0;n<this.cart_info.length;n++)this.cart_info[n].is_writeoff||this.cart_info[n].checked&&(i+=this.cart_info[n].surplus_num_input);this.numChecked=i},dan:function(t,i){this.cart_info[i].checked=!this.cart_info[i].checked,this.checkModel=[];for(var n=0;n<this.cart_info.length;n++)this.cart_info[n].checked&&this.checkModel.push(this.cart_info[n].cart_id);for(var e=!0,s=0;s<this.cart_info.length;s++)this.cart_info[s].is_writeoff||this.cart_info[s].checked||(e=!1);this.checked=e;for(var c=0,r=0;r<this.cart_info.length;r++)this.cart_info[r].is_writeoff||this.cart_info[r].checked&&(c+=this.cart_info[r].surplus_num_input);this.numChecked=c},getList:function(t){var i=this;this.checkKefuAuth("kefu-order-writeoff-submit")&&(0,e.orderCartInfo)({oid:t,auth:2}).then((function(t){i.list=t.data,i.lists=JSON.parse(JSON.stringify(t.data)),i.listlet=t.data.cart_info.length,i.$set(i.attr,"id",i.list.id),i.checkAll(),i.num()}))},onDataId:function(t){this.nums.forEach((function(t){t.num=0})),this.id=t,this.getList(t)},switchs:function(){this.checkKefuAuth("kefu-order-writeoff-submit")&&(this.attr.cartAttr=!0,this.$refs.writeOff.getList(2))},onMyEvent:function(){this.attr.cartAttr=!1},verification:function(){if(this.checkKefuAuth("kefu-order-writeoff-submit")){for(var i=this,n=[],s=0;s<this.cart_info.length;s++)this.cart_info[s].checked&&!this.cart_info[s].is_writeoff&&n.push({cart_id:this.cart_info[s].cart_id,cart_num:this.cart_info[s].surplus_num_input});if(this.newList=n,0==i.checkModel.length)i.$util.Tips({title:"请选择商品"});else{t.showLoading({title:"加载中"});var c=0;n.forEach((function(t){c+=parseInt(t.cart_num)})),this.writeOffNum=c,setTimeout((function(){(0,e.orderWriteoff)({auth:i.auth,oid:i.oid,cart_ids:i.newList}).then((function(n){t.hideLoading();for(var e=1,s=0;s<i.list.cart_info.length;s++)if(i.list.cart_info[s].checked&&i.list.cart_info[s].surplus_num!=i.list.cart_info[s].surplus_num_input){e=0;break}i.$emit("success",e)})).catch((function(n){i.$util.Tips({title:n}),t.hideLoading()}))}),1e3)}}},ok:function(i){this.box=!1,this.nums.forEach((function(t){t.num=0})),this.getList(this.id),i&&t.redirectTo({url:"/pages/admin/distribution/index"})}}});i.default=s}).call(this,n("df3c")["default"])},"172a":function(t,i,n){"use strict";n.r(i);var e=n("1377"),s=n.n(e);for(var c in e)["default"].indexOf(c)<0&&function(t){n.d(i,t,(function(){return e[t]}))}(c);i["default"]=s.a},"6aa1f":function(t,i,n){"use strict";var e=n("8531"),s=n.n(e);s.a},8531:function(t,i,n){},a892:function(t,i,n){"use strict";n.d(i,"b",(function(){return e})),n.d(i,"c",(function(){return s})),n.d(i,"a",(function(){}));var e=function(){var t=this,i=t.$createElement,n=(t._self._c,t.hasKefuAuth("kefu-order-writeoff-submit")),e=t.box?parseInt(t.list.writeoff_count):null,s=t.box?1==t.lets&&t.list.total_num==parseInt(t.list.writeoff_count)+t.writeOffNum:null,c=t.box?t.lets>1&&t.list.total_num!=parseInt(t.list.writeoff_count)+t.writeOffNum:null,r=t.box?t.lets>1&&t.list.total_num==parseInt(t.list.writeoff_count)+t.writeOffNum||1==t.lets&&t.list.total_num!=parseInt(t.list.writeoff_count)+t.writeOffNum:null,f=t.box?parseInt(t.list.writeoff_count):null,o=t.box?t.lets>1&&t.list.total_num==parseInt(t.list.writeoff_count)+t.writeOffNum:null;t.$mp.data=Object.assign({},{$root:{m0:n,m1:e,m2:s,m3:c,m4:r,m5:f,m6:o}})},s=[]},b3bf:function(t,i,n){"use strict";n.r(i);var e=n("a892"),s=n("172a");for(var c in s)["default"].indexOf(c)<0&&function(t){n.d(i,t,(function(){return s[t]}))}(c);n("6aa1f");var r=n("828b"),f=Object(r["a"])(s["default"],e["b"],e["c"],!1,null,"2cd7a162",null,!1,e["a"],void 0);i["default"]=f.exports}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'pages/admin/components/writeOffList/index-create-component',
    {
        'pages/admin/components/writeOffList/index-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('df3c')['createComponent'](__webpack_require__("b3bf"))
        })
    },
    [['pages/admin/components/writeOffList/index-create-component']]
]);
