applyfor.6a985e5a.js 28 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["applyfor"],{"083a":function(t,e,s){"use strict";var a=s("0d51"),i=TypeError;t.exports=function(t,e){if(!delete t[e])throw new i("Cannot delete property "+a(e)+" of "+a(t))}},"0c8f":function(t,e,s){},"0efe":function(t,e,s){},"120e":function(t,e,s){"use strict";s.d(e,"e",(function(){return i})),s.d(e,"d",(function(){return o})),s.d(e,"b",(function(){return n})),s.d(e,"c",(function(){return l})),s.d(e,"h",(function(){return c})),s.d(e,"g",(function(){return r})),s.d(e,"f",(function(){return d})),s.d(e,"a",(function(){return _}));var a=s("b775");const i=t=>Object(a["a"])({method:"POST",url:"approveinfo/create",data:t}),o=t=>Object(a["a"])({method:"POST",url:"approveinfo/get_list",data:t}),n=t=>Object(a["a"])({method:"POST",url:"approveinfo/get_detail",data:t}),l=t=>Object(a["a"])({method:"POST",url:"approveinfo/get_info",data:t}),c=t=>Object(a["a"])({method:"POST",url:"approveinfo/urging",data:t}),r=t=>Object(a["a"])({method:"POST",url:"approveinfo/cancel",data:t}),d=t=>Object(a["a"])({method:"POST",url:"approveinfo/comment",data:t}),_=t=>Object(a["a"])({method:"POST",url:"approveinfo/download",data:t})},"1aae":function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"approval-container flex flex-col flex-col-jcsp"},[s("div",{staticClass:"approval__header"},[t._e()],1),s("div",{staticClass:"approval__content"},[s("van-list",{attrs:{finished:t.finished,"finished-text":t.finishedText,"immediate-check":!1},on:{load:t.onLoadData},model:{value:t.listLoading,callback:function(e){t.listLoading=e},expression:"listLoading"}},[t._l(t.list,(function(e,a){return[s("div",{key:a,staticClass:"approval-item flex flex-row",on:{click:function(s){return t.handleCheckboxItem(e,a)}}},[s("div",{staticClass:"checkbox"},[s("van-icon",{class:e.selected?"sel":"",attrs:{name:"circle",size:18}})],1),s("div",{staticClass:"approval-item__main"},[s("div",{staticClass:"approval-item__header flex flex-row flex-row-aic"},[s("div",{staticClass:"hb"},[s("div",{staticClass:"title"},[t._v("采购人")]),s("div",{staticClass:"ctx"},[t._v(t._s(t.username))])]),s("div",{staticClass:"hb"},[s("div",{staticClass:"title"},[t._v("采购时间")]),s("div",{staticClass:"ctx"},[t._v(t._s(e.apply_date))])])]),s("div",{staticClass:"approval-item__mid"},[s("div",{staticClass:"hb"},[s("div",{staticClass:"title"},[t._v("采购事由")]),s("div",{staticClass:"ctx"},[t._v(t._s(e.reason))])])]),s("div",{staticClass:"approval-item__mid"},[s("div",{staticClass:"hb"},[s("div",{staticClass:"title"},[t._v("采购物品")]),s("div",{staticClass:"ctx"},[t._v(t._s(t._f("filterGoods")(e.apply_goods)))])])])])])]}))],2),s("my-empty",{directives:[{name:"show",rawName:"v-show",value:t.showEmpty,expression:"showEmpty"}],attrs:{tip:"暂无数据"}})],1),s("div",{staticClass:"btn-container"},[s("div",{staticClass:"btn-span",on:{click:t.handleConfirmForm}},[t._v("确定")])])])},i=[],o=(s("14d9"),s("120e")),n=s("60fe"),l=s("3842"),c=s("2f62"),r={name:"CApprovalForm",computed:{...Object(c["c"])("user",{username:t=>t.name})},data:()=>({list:[],showEmpty:!1,listLoading:!1,finished:!1,finishedText:"暂无更多数据了",pagination:{page:1,page_num:20},isSelectedAll:!1}),created(){this.navigationSetting(),this.__list__()},methods:{navigationSetting(){Object(l["e"])({show:!1})},onLoadData(){this.__list__()},async __list__(){try{let t=[];this.$route.query&&this.$route.query.sel&&(t=this.$route.query.sel.split(","));const e=this,s={...e.pagination,group:"form"},a=await Object(o["d"])(s);if(1===a.code){let s=a.data||[];this.listLoading=!1,s=s.map(e=>({...e,selected:t.includes(String(e.id))})),s.length<e.pagination.page_num?e.finished=!0:e.pagination.page++,e.list=e.list.concat(s),e.finished&&!e.list.length&&(e.finishedText="",e.showEmpty=!0)}}catch(t){console.log("%c __list__ >>>","background: blue; color: #fff",t)}},handleSelectAll(){this.isSelectedAll=!this.isSelectedAll,this.list=this.list.map(t=>({...t,selected:this.isSelectedAll}))},handleCheckboxItem(t,e){this.list=this.list.map(t=>({...t,selected:!1})),this.$forceUpdate(),this.$nextTick(()=>{this.list[e].selected=!0,this.$forceUpdate()})},handleConfirmForm(){let t=this.list.filter(t=>t.selected);if(!t.length)return this.$toast("请选择采购单!");localStorage.setItem(n["d"],JSON.stringify(t)),this.$nextTick(()=>{this.$router.push({name:"CApprovalFormSel"})})}},filters:{filterGoods(t){return Array.isArray(t)&&t.length?t.map(t=>t.goods_name).join("、"):"/"}}},d=r,_=(s("df69"),s("0c7c")),u=Object(_["a"])(d,a,i,!1,null,"358617b7",null);e["default"]=u.exports},"306e":function(t,e,s){"use strict";var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("layout",{attrs:{title:t.$attrs.title,required:t.$attrs.required}},[s("div",{staticClass:"custom-select-container flex flex-row flex-row-aic"},[s("div",{staticClass:"left",on:{click:function(e){return t.$emit("click")}}},[t.value?s("div",{staticClass:"value"},[t._v(t._s(t.value))]):s("div",{staticClass:"default"},[t._v(t._s(t.placeholder))])]),t.hideRemove?t._e():s("div",{staticClass:"right"},[t.value?s("van-icon",{attrs:{size:20,color:"#A2A3A4",name:"clear"},on:{click:function(e){return t.$emit("clear")}}}):t._e(),s("van-icon",{attrs:{color:"#A2A3A4",size:20,name:"arrow"},on:{click:function(e){return t.$emit("click")}}})],1)])])},i=[],o=s("87a7"),n={name:"CSelectImitate",components:{Layout:o["a"]},props:{value:{type:String,default:""},placeholder:{type:String,default:"请选择"},hideRemove:{type:Boolean,default:!1}}},l=n,c=(s("e1c5"),s("0c7c")),r=Object(c["a"])(l,a,i,!1,null,"779f15c0",null);e["a"]=r.exports},"30cd":function(t,e,s){},"34dd":function(t,e,s){"use strict";s("b6d8")},"39b7":function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"goods-container flex flex-col"},[s("div",{staticClass:"goods__main"},["1"===t.flag?s("c-select-imitate",{attrs:{title:"商品分类",value:t.goods_category_text},on:{click:t.handleClickCategory,clear:t.handleClearCategory}}):t._e(),s("c-input",{attrs:{title:"商品编号",disabled:3==t.flag},model:{value:t.goods_no,callback:function(e){t.goods_no=e},expression:"goods_no"}}),s("c-input",{attrs:{title:"商品名称",disabled:3==t.flag},model:{value:t.goods_name,callback:function(e){t.goods_name=e},expression:"goods_name"}}),s("c-input",{attrs:{title:"商品品牌",disabled:3==t.flag},model:{value:t.goods_brand,callback:function(e){t.goods_brand=e},expression:"goods_brand"}}),s("c-select-imitate",{attrs:{title:"商品规格",value:t.goodsStandarsTxt},on:{click:t.handleClickStandards,clear:t.handleClearStandards}})],1),s("div",{staticClass:"goods__footer"},[s("div",{staticClass:"btn-container"},[s("div",{staticClass:"btn-span",on:{click:t.handleConfirmSubmit}},[t._v(t._s("3"===t.flag?"修改":"提交"))])])])])},i=[],o=(s("14d9"),s("d77e")),n=s("7fe3"),l=s("306e"),c=s("3842"),r={name:"Goods",name_cn:"商品",components:{CInput:n["a"],CSelectImitate:l["a"]},computed:{goodsStandarsTxt(){return this.goods_stock.length?`共${this.goods_stock.length}个规格`:""}},data:()=>({flag:"1",id:"",goods_id:void 0,goods_category_first:"",goods_category_id:"",goods_category_text:"",goods_no:"",goods_name:"",goods_brand:"",goods_stock:[],row:null}),created(){this.navigationSetting(),o["a"].$on("listenCategoryEvent",this.handleCategoryData),o["a"].$on("listenStrandarsEvent",this.handleStandarsData);const{flag:t}=this.$route.query;if("3"===t){const e=JSON.parse(this.$route.query.edit);e&&(this.row=e,console.log("%c update row??? >>>","background: blue; color: #fff",e),this.flag=t,this.goods_id=e.goods_id||void 0,this.goods_category_first=e.goods_category_first||"",this.goods_category_id=e.goods_category_id||"",this.goods_no=e.goods_no||"",this.goods_name=e.goods_name||"",this.goods_brand=e.goods_brand||"",this.goods_stock=e.goods_stock||[],e.__id__&&(this.id=e.__id__))}},methods:{navigationSetting(){Object(c["e"])({show:!1})},handleClickCategory(){this.$router.push({name:"ProductStore",query:{type:"2"}})},handleClearCategory(){this.goods_category_first="",this.goods_category_id="",this.goods_category_text=""},handleCategoryData(t){const{first:e,second:s}=t;this.goods_category_text=`${e.name}/${s.name}`,this.goods_category_first=e.id,this.goods_category_id=s.id},handleClickStandards(){this.$router.push({name:"GoodsSpeci",query:{role:this.$route.query.flagtxt,type:this.$route.query.type,showPrice:Number(["1"].includes(this.$route.query.type)),goods_stock:JSON.stringify(this.goods_stock)}})},handleClearStandards(){this.goods_stock=[]},handleStandarsData(t){this.goods_stock=[...t],this.row&&(this.row.flag="1")},handleConfirmSubmit(){const t={flag:this.flag,goods_category_first:this.goods_category_first,goods_category_id:this.goods_category_id,goods_no:this.goods_no,goods_name:this.goods_name,goods_brand:this.goods_brand,goods_stock:this.goods_stock};"3"===this.flag?(this.row.flag&&(t.flag=this.row.flag),this.goods_id?t.goods_id=this.goods_id:this.id&&(t["__id__"]=this.id)):t["__id__"]=""+Date.now(),o["a"].$emit("changeGoods",t),this.$nextTick(()=>{this.$store.commit({type:"app/ROUTE_REMOVE",value:"Goods"}),this.$router.go(-1)})}},beforeDestroy(){o["a"].$off("listenCategoryEvent"),o["a"].$off("listenStrandarsEvent")}},d=r,_=(s("4504"),s("0c7c")),u=Object(_["a"])(d,a,i,!1,null,"77e8c340",null);e["default"]=u.exports},"39c7":function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"specifications-container flex flex-col"},[s("div",{directives:[{name:"show",rawName:"v-show",value:t.goods_stock.length,expression:"goods_stock.length"}],staticClass:"s-header flex flex-row flex-row-aic"},[s("span",[t._v("商品规格")]),t.isApproveM4?t._e():s("div",{staticClass:"icons"},[s("van-icon",{attrs:{name:"delete-o",size:18,color:"#828181"},on:{click:t.handleRemoveAll}}),s("van-icon",{attrs:{name:"setting-o",size:t.closeable?20:18,color:t.closeable?"#414141":"#828181"},on:{click:function(e){t.closeable=!t.closeable}}})],1)]),s("div",{directives:[{name:"show",rawName:"v-show",value:t.goods_stock.length,expression:"goods_stock.length"}],staticClass:"s-context flex flex-row"},[t._l(t.goods_stock,(function(e,a){return[s("van-tag",{key:a,attrs:{closeable:t.closeable,size:"large",type:"primary"},on:{close:function(s){return t.handleClose(e,a)},click:function(s){return t.handleEdit(e,a)}}},[t._v(" "+t._s(e.name)+" ")])]}))],2),!t.isApproveM4&&t.goods_stock.length?s("div",{staticClass:"s-btn"},[s("van-icon",{attrs:{name:"plus",size:14}}),s("span",{on:{click:function(e){t.visibilityDialog=!0}}},[t._v("追加新规格")])],1):t._e(),s("div",{staticClass:"main"},[t.goods_stock.length?s("div",{staticClass:"standars-box"},t._l(t.goods_stock,(function(e,a){return s("div",{key:a,staticClass:"row"},[s("div",{staticClass:"row__header flex flex-row flex-row-aic"},[s("span",[t._v(" "+t._s(e.name)+" ")])]),s("div",{staticClass:"row__main"},[1==t.$route.query.showPrice?s("c-input",{attrs:{title:"价格",maxlength:9,showWordLimit:!1,"input-type":"number"},model:{value:e.price,callback:function(s){t.$set(e,"price",s)},expression:"item.price"}}):t._e(),s("c-input",{attrs:{title:"数量",maxlength:5,showWordLimit:!1,"input-type":"digit"},model:{value:e.stock,callback:function(s){t.$set(e,"stock",s)},expression:"item.stock"}})],1)])})),0):s("div",{staticClass:"addbtn",on:{click:function(e){t.visibilityDialog=!0}}},[s("van-icon",{attrs:{name:"plus",size:18}}),t._v(" 添加规格 ")],1)]),s("van-dialog",{attrs:{title:"添加/修改规格","show-cancel-button":"","confirm-button-color":"#007aff","before-close":t.handleBeforeCloseDialog},on:{cancel:t.handleCancelEvent,confirm:t.handleConfirmEdit},model:{value:t.visibilityDialog,callback:function(e){t.visibilityDialog=e},expression:"visibilityDialog"}},[s("van-field",{attrs:{center:"","input-align":"center",placeholder:"蓝色,165cm"},model:{value:t.templateValue,callback:function(e){t.templateValue="string"===typeof e?e.trim():e},expression:"templateValue"}})],1),t.goods_stock.length?s("div",{staticClass:"btn-container"},[s("div",{staticClass:"btn-span",on:{click:t.handleSubmitStandars}},[t._v("提交")])]):t._e()],1)},i=[],o=(s("3c65"),s("7fe3")),n=s("d77e"),l={name:"GoodsSpeci",components:{CInput:o["a"]},computed:{isApproveM4(){const{role:t,type:e}=this.$route.query;return 4==e&&"approve"===t}},data:()=>({templateValue:"",visibilityDialog:!1,closeable:!1,editIdx:-1,goods_stock:[]}),created(){this.__init__()},methods:{__init__(){const{goods_stock:t}=this.$route.query,e=t?JSON.parse(t):[];e.length&&(this.goods_stock=[...e].map(t=>{let e={...t,stock:""+t.stock};return t.stock&&(e.stock=""+t.stock),t.price&&(e.price=""+t.price),e}).reverse())},handleRemoveAll(){this.$dialog.confirm({message:"是否删除全部规格",confirmButtonColor:"#007aff"}).then(()=>{this.goods_stock=[]}).catch(()=>{})},handleClose(t,e){this.$dialog.confirm({message:"是否删除规格 "+t.name,confirmButtonColor:"#007aff"}).then(()=>{this.goods_stock.splice(e,1)}).catch(()=>{})},handleEdit(t,e){t.id&&delete t.id,this.templateValue=t.name,this.visibilityDialog=!0,this.editIdx=e},handleBeforeCloseDialog(t,e){if("confirm"===t&&!this.templateValue)return e(!1);const s=this.goods_stock.some(t=>t.name===this.templateValue);return s?e(!1):e()},handleCancelEvent(){this.visibilityDialog=!1,this.templateValue="",this.editIdx=-1},handleConfirmEdit(){const t=this.templateValue;if(!t)return this.$toast("规格名称为空");const e=this.goods_stock.some(e=>e.name===t);if(e)return this.$toast("规格名称重复!");this.editIdx>=0?this.goods_stock.splice(this.editIdx,1,{...this.goods_stock[this.editIdx],name:t}):this.goods_stock.unshift({name:t,price:"",stock:""}),this.$nextTick(()=>{this.visibilityDialog=!1,this.templateValue="",this.editIdx=-1})},handleSubmitStandars(){const t=this.goods_stock;let e=!1;const s=Boolean(this.$route.query.showPrice);for(let a=0;a<t.length;a++){const{price:i,stock:o,name:n}=t[a];if(!o||s&&!i){e=!0;let t=o?"":"数量";s&&(t=i?"":"价格"),this.$toast(`规则${n}的${t}为空,请填写`);break}}e||(n["a"].$emit("listenStrandarsEvent",[...t].reverse()),this.$nextTick(()=>{this.$router.go(-1)}))}}},c=l,r=(s("c1c5"),s("0c7c")),d=Object(r["a"])(c,a,i,!1,null,"62202a9b",null);e["default"]=d.exports},"3c65":function(t,e,s){"use strict";var a=s("23e7"),i=s("7b0b"),o=s("07fa"),n=s("3a349"),l=s("083a"),c=s("3511"),r=1!==[].unshift(0),d=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}},_=r||!d();a({target:"Array",proto:!0,arity:1,forced:_},{unshift:function(t){var e=i(this),s=o(e),a=arguments.length;if(a){c(s+a);var r=s;while(r--){var d=r+a;r in e?e[d]=e[r]:l(e,d)}for(var _=0;_<a;_++)e[_]=arguments[_]}return n(e,s+a)}})},4504:function(t,e,s){"use strict";s("30cd")},"498a":function(t,e,s){},"56c0":function(t,e,s){"use strict";s("c037")},6101:function(t,e,s){},"6aa0":function(t,e,s){"use strict";s("0efe")},"6bc7":function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"product-store-container flex flex-col"},[s("div",{staticClass:"product-store__header"},["1"===t.type?s("div",{staticClass:"search-box"},[s("van-field",{attrs:{center:"",placeholder:"搜索","left-icon":"search"},on:{click:t.handleClickSearchBox},scopedSlots:t._u([{key:"button",fn:function(){return[s("van-button",{attrs:{size:"small",type:"primary"},on:{click:t.handleLaunchSearch}},[t._v("搜索")])]},proxy:!0}],null,!1,1321573992),model:{value:t.searchVal,callback:function(e){t.searchVal=e},expression:"searchVal"}})],1):t._e(),s("div",{staticClass:"sub-title flex flex-row flex-row-aic flex-row-jcsp"},["2"===t.type?s("span",[t._v("请选择商品分类")]):s("span",[t._v("商品库")]),s("van-button",{directives:[{name:"show",rawName:"v-show",value:t.searchData.length,expression:"searchData.length"}],attrs:{size:"small",type:"primary"},on:{click:t.handleResetSearch}},[t._v("重置搜索")])],1)]),t.searchData.length?s("div",{staticClass:"product-store__main"},t._l(t.searchData,(function(e,a){return s("div",{key:a,staticClass:"search-row",on:{click:function(s){return t.handleSelectedGoods(e)}}},[s("div",{staticClass:"search-row__category"},[t._v(" "+t._s(e.goods_category_first_en)+"/"+t._s(e.goods_category_en)+" ")]),s("div",{staticClass:"search-row__title ellipsis"},[t._v(t._s(e.goods_name))])])})),0):s("div",{staticClass:"product-store__main"},[s("van-radio-group",{model:{value:t.radioCategory,callback:function(e){t.radioCategory=e},expression:"radioCategory"}},t._l(t.categoryData,(function(e,a){return s("div",{key:a,staticClass:"row"},[s("div",{staticClass:"row__header row__header--b-line flex flex-row flex-row-aic"},[s("div",{staticClass:"row__header__content"},[t._v(" "+t._s(e.name)+" ")]),s("div",{staticClass:"row__header__more flex flex-row flex-row-aic",on:{click:function(s){return t.handleClickRow(e,a)}}},[s("van-icon",{attrs:{name:"cluster-o",size:26,color:"#3290C4"}}),s("span",{staticClass:"txt"},[t._v("下级")])],1)]),e.expand?s("div",{staticClass:"row__main"},t._l(e.childlist,(function(e,a){return s("div",{key:a,staticClass:"row__second"},[s("div",{staticClass:"row__second__header row__second__header--b-line flex flex-row flex-row-aic",on:{click:function(s){"1"===t.type&&t.handleClickSecondRow(e,a)}}},["2"===t.type?s("div",{staticClass:"radio-box"},[s("van-radio",{attrs:{name:e.id}},[t._v(t._s(e.name))])],1):s("div",{staticClass:"row__second__header__content"},[t._v(" "+t._s(e.name)+" ")]),"1"===t.type?s("div",{staticClass:"row__second__header__more"},[e.expand?s("van-icon",{attrs:{name:"arrow-up",size:24,color:"rgba(162, 163, 164, 1)"}}):s("van-icon",{attrs:{name:"arrow-down",size:24,color:"rgba(162, 163, 164, 1)"}})],1):t._e()]),e.expand?[e.queryed&&!e.childlist.length?s("div",{staticClass:"row__second__main"},[s("div",{staticClass:"row__third-item flex flex-row flex-row-aic"},[s("span",{attrs:{id:"c1"}},[t._v("当前分类下暂无商品")])])]):s("div",{staticClass:"row__second__main"},t._l(e.childlist,(function(e,a){return s("div",{key:a,staticClass:"row__third-item flex flex-row flex-row-aic",on:{click:function(s){return t.handleSelectedGoods(e,a)}}},[s("span",{attrs:{id:"c1"}},[t._v(t._s(e.goods_name))])])})),0)]:t._e()],2)})),0):t._e()])})),0)],1),"2"===t.type?s("div",{staticClass:"btn-container"},[s("div",{staticClass:"btn-span",on:{click:t.handleConfirmCategory}},[t._v("确定")])]):t._e(),s("van-popup",{staticClass:"popup flex flex-col",style:{height:"60%"},attrs:{position:"bottom",closeable:"","close-icon-position":"top-right"},model:{value:t.popupVisibility,callback:function(e){t.popupVisibility=e},expression:"popupVisibility"}},[s("div",{staticClass:"popup__header"},[t.choosedStock?s("span",{staticClass:"product__title"},[t._v(t._s(t.choosedStock.goods_name))]):t._e(),s("span",{staticClass:"product__inventory"},[t._v(t._s(t.leftStockComp))])]),s("div",{staticClass:"popup__main"},[t._l(t.productData,(function(e,a){return["total"===e.type?[s("c-input",{key:a,attrs:{title:e.label,placeholder:"请输入"+e.label,maxlength:5,showWordLimit:!1,"input-type":"digit"},model:{value:e.val,callback:function(s){t.$set(e,"val",s)},expression:"item.val"}})]:"price"===e.type?[s("c-input",{key:a,attrs:{title:e.label,placeholder:"请输入"+e.label,maxlength:5,showWordLimit:!1,"input-type":"number"},model:{value:e.val,callback:function(s){t.$set(e,"val",s)},expression:"item.val"}})]:[s("div",{key:a,staticClass:"product__row"},[s("div",{staticClass:"product__row__header"},[t._v(" "+t._s(e.label)+" ")]),s("div",{staticClass:"product__row__main"},t._l(e.list,(function(a,i){return s("span",{key:i,class:{selected:e.val==a.id},attrs:{"data-id":a.id},on:{click:function(s){return t.handleClickItem(e,a)}}},[t._v(t._s(a.name))])})),0)])]]}))],2),s("div",{staticClass:"popup__footer"},[s("div",{staticClass:"btn-container"},[s("div",{staticClass:"btn-span",on:{click:t.handleConfirmInput}},[t._v("确认")])])])])],1)},i=[],o=(s("14d9"),s("d77e")),n=s("7fe3"),l=s("b775");const c=t=>Object(l["a"])({method:"POST",url:"goods/get_list",data:t}),r=()=>Object(l["a"])({method:"POST",url:"goodscategory/get_list"});var d=s("3842"),_={name:"ProductStore",components:{CInput:n["a"]},computed:{leftStockComp(){if(!this.choosedStock)return"";const[{val:t,list:e}]=this.productData;let s=e.filter(e=>e.id===t);if(s.length){let t=s[0].stock;return t>0?`库存剩余:${t}件`:"暂无库存"}return""}},data:()=>({type:"1",module:"",radioCategory:"",searchVal:"",categoryData:[],popupVisibility:!1,productData:[],choosedStock:null,searchData:[]}),created(){this.navigationSetting(),this.__init__()},methods:{navigationSetting(){Object(d["e"])({show:!1})},async __init__(){try{let t=this.$route.query;t&&(t.type&&(this.type=t.type),t.module&&(this.module=t.module)),await this.__queryCategoay__()}catch(t){console.log("ProductStore __init__ error",t)}},handleClickSearchBox(){},handleClickRow(t){t.expand=!t.expand,this.$forceUpdate()},async handleClickSecondRow(t){const e=this.$toast({type:"loading",message:"加载数据中",duration:0});try{if(!t.expand&&!t.childlist){const e=await this.__queryStoreData__(t.id);t.childlist=[...e]}t.expand=!t.expand,t.queryed=!0,this.$forceUpdate()}catch(s){this.$toast(s.message)}finally{e.clear()}},handleClickItem(t,e){t.val=e.id},handleConfirmInput(){try{let t=this.productData,e=t.every(t=>t.val);if(!e)return this.$toast("检查填写情况");const[s,a,i]=t.map(t=>t.val);let n=t[0].list.filter(t=>t.id===s)[0],l=0;if(n&&(l=n.stock),a<=0)return this.$toast("物品数量最少1件");if(![1,3].includes(Number(this.module))&&a>l)return this.$toast("当前商品规格数量不足");if(i<=0)return this.$toast("当前商品价格不对");o["a"].$emit("updateProductList",{item:this.choosedStock,goodsStock:n,customCount:a,GoodsPrice:i}),this.$router.go(-1)}catch(t){console.log(t)}},handleSelectedGoods(t){const{goods_stock:e}=t;this.choosedStock=t;let s=[{label:"规格",val:"",list:e},{label:"物品数量",type:"total",val:""}];["1"].includes(this.module)&&s.push({label:"物品单价",type:"price",val:""}),this.productData=s,this.popupVisibility=!0},__queryCategoay__(){return new Promise((t,e)=>{r().then(s=>{1===s.code?(this.categoryData=s.data,t()):e()}).catch(t=>{console.log("%c error >>>","background: blue; color: #fff",t),e()})})},__queryStoreData__(t){return new Promise((e,s)=>{c({category_id:t}).then(t=>{1===t.code&&e(t.data||[])}).catch(t=>{s(t)})})},handleConfirmCategory(){let t=this.radioCategory,e=this.categoryData;for(let s=0;s<e.length;s++){const a=e[s],i=a.childlist;for(let e=0;e<i.length;e++){const s=i[e];if(t===s.id){let t={...a};delete t.childlist,delete t.expand,o["a"].$emit("listenCategoryEvent",{first:t,second:{...s}});break}}}this.$router.go(-1)},__category_en__(t){const{goods_category_first:e,goods_category_id:s}=t,a={goods_category_first_en:"",goods_category_en:""};let i=this.categoryData;for(let o=0;o<i.length;o++){const t=i[o];if(t.id===e)for(let e=0;e<t.childlist.length;e++){const i=t.childlist[e];if(i.id===s){a.goods_category_first_en=t.name,a.goods_category_en=i.name;break}}}return a},async handleLaunchSearch(){let t=this.searchVal;if(!t)return;const e=this.$toast({type:"loading",message:"搜索中...",duration:0});try{const s=await c({search:t});1===s.code&&(s.data.length?(this.searchData=s.data.map(t=>({...t,...this.__category_en__(t)})),e.clear()):(e.clear(),this.$toast(`暂无与${t}相关商品`)))}catch(s){e.clear(),console.log("%c handleLaunchSearchError >>>","background: blue; color: #fff",s)}},handleResetSearch(){this.searchData=[],this.searchVal=""}},watch:{radio(t){console.log("%c radio value watch? >>>","background: blue; color: #fff",t)}}},u=_,h=(s("6aa0"),s("0c7c")),f=Object(h["a"])(u,a,i,!1,null,"cf21eeae",null);e["default"]=f.exports},"7fe3":function(t,e,s){"use strict";var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("layout",{attrs:{title:t.$attrs.title,required:t.$attrs.required}},[s("div",{staticClass:"custom-input-container flex flex-row flex-row-aic"},[s("van-field",{staticClass:"input-padding",attrs:{value:t.value,type:t.inputType,placeholder:t.$attrs.placeholder||"请输入",clearable:"",maxlength:t.$attrs.maxlength||void 0,"show-word-limit":"undefined"===typeof t.$attrs.showWordLimit||t.$attrs.showWordLimit,rows:"3",autosize:"",readonly:t.$attrs.readonly||!1,disabled:t.$attrs.disabled},on:{input:function(e){return t.$emit("input",e)},clear:function(){return t.$emit("input","")}}})],1)])},i=[],o=s("87a7"),n={name:"CInput",components:{Layout:o["a"]},props:{value:{type:String,default:""},inputType:{type:String,default:"text"}}},l=n,c=(s("34dd"),s("0c7c")),r=Object(c["a"])(l,a,i,!1,null,"63f8111c",null);e["a"]=r.exports},"87a7":function(t,e,s){"use strict";var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"layout-container"},[s("div",{staticClass:"layout__title"},[s("span",{staticClass:"title"},[t._v(t._s(t.title))]),t.required?s("span",{staticClass:"require"},[t._v("*")]):t._e()]),t._t("default")],2)},i=[],o={props:{title:{type:String,default:"默认文案"},required:{type:Boolean,default:!1}}},n=o,l=(s("fa3a"),s("0c7c")),c=Object(l["a"])(n,a,i,!1,null,"853cdbd0",null);e["a"]=c.exports},b6d8:function(t,e,s){},c037:function(t,e,s){},c1c5:function(t,e,s){"use strict";s("0c8f")},d77e:function(t,e,s){"use strict";var a=s("2b0e");const i=new a["default"];e["a"]=i},df69:function(t,e,s){"use strict";s("498a")},e1c5:function(t,e,s){"use strict";s("6101")},fa3a:function(t,e,s){"use strict";s("fd05")},fd05:function(t,e,s){},fef4:function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"approval-container flex flex-col flex-col-jcsp"},[s("div",{staticClass:"approval__header"},[s("div",{staticClass:"tits flex flex-row flex-row-aic flex-row-jcsp"},[s("span",[t._v("入库明细")]),s("span",{staticClass:"btn",on:{click:function(e){t.isEdit=!t.isEdit}}},[t._v(t._s(t.isEdit?"完成":"编辑"))])]),s("div",{staticClass:"line"})]),s("div",{staticClass:"approval__content"},[t._l(t.list,(function(e,a){return[t._l(e.apply_goods,(function(i,o){return[t._l(i.goods_stock,(function(n,l){return[s("div",{key:a+"-"+o+"-"+l,staticClass:"item flex flex-col"},[s("div",{staticClass:"item__header flex flex-row flex-row-aic flex-row-jcsp"},[s("div",{staticClass:"title"},[t._v(t._s(i.goods_name))]),s("div",{directives:[{name:"show",rawName:"v-show",value:t.isEdit,expression:"isEdit"}],staticClass:"remove"},[s("span",{on:{click:function(s){return t.handleRemoveRow(e,i,n,a,o,l)}}},[t._v("删除")])])]),s("div",{staticClass:"item__main flex flex-row flex-row-aic flex-row-jcsp"},[s("span",{staticClass:"categor"},[t._v(t._s(n.name))]),t.isEdit?s("van-stepper",{attrs:{min:1},model:{value:n.stock,callback:function(e){t.$set(n,"stock",e)},expression:"categor.stock"}}):s("div",{staticClass:"count"},[t._v("x "+t._s(n.stock))])],1)])]}))]}))]}))],2),s("div",{staticClass:"btn-container"},[s("div",{staticClass:"btn-span",on:{click:t.handleConfirmForm}},[t._v("确定")])])])},i=[],o=s("60fe"),n=s("d77e"),l=s("3842"),c={name:"CApprovalFormSel",data:()=>({isEdit:!1,list:[],showEmpty:!1,listLoading:!1,finished:!1,finishedText:"暂无更多数据了",pagination:{page:1,page_num:20},isSelectedAll:!1}),created(){this.navigationSetting(),this.__list__()},methods:{navigationSetting(){Object(l["e"])({show:!1})},__list__(){try{const t=localStorage.getItem(o["d"]);if(t){let e=JSON.parse(t);e=e.map(t=>({...t,apply_goods:t.apply_goods.map(t=>({...t,goods_stock:JSON.parse(t.goods_stock)}))})),this.list=e}}catch(t){console.log(t),this.$toast("请选择采购单!")}},handleRemoveRow(t,e,s,a,i,o){this.$dialog.confirm({message:`是否删除商品“${e.goods_name}-${s.name}”`,confirmButtonText:"确定",confirmButtonColor:"rgba(0, 122, 255, 1)"}).then(()=>{e.goods_stock.splice(o,1),this.$forceUpdate()})},handleConfirmForm(){this.isEdit=!1,n["a"].$emit("listenApprovalFormList",this.list),this.$router.go(-2)}}},r=c,d=(s("56c0"),s("0c7c")),_=Object(d["a"])(r,a,i,!1,null,"fc0477a8",null);e["default"]=_.exports}}]);
  2. //# sourceMappingURL=applyfor.6a985e5a.js.map