1 line
8.3 KiB
JavaScript
1 line
8.3 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-resourceStoreScrap-resourceStoreScrap"],{"0815":function(e,t,s){"use strict";var r=s("d459d"),a=s.n(r);a.a},"139a":function(e,t,s){"use strict";s.r(t);var r=s("fcd7"),a=s.n(r);for(var i in r)["default"].indexOf(i)<0&&function(e){s.d(t,e,(function(){return r[e]}))}(i);t["default"]=a.a},"1bc6":function(e,t,s){var r=s("c86c");t=r(!1),t.push([e.i,".footer-step-fixed[data-v-19801fe4]{width:100%;position:fixed;left:0;bottom:0;display:flex;justify-content:space-between;-moz-box-shadow:0 -5px 5px #ccc;box-shadow:0 -5px 5px #ccc;background-color:#fff}.step-item[data-v-19801fe4]{width:100%;text-align:center;height:%?80?%;line-height:%?80?%}.cu-list.menu-avatar>.cu-item .content-left[data-v-19801fe4]{left:0}.cu-list+.cu-list[data-v-19801fe4]{margin-top:%?20?%}.remark[data-v-19801fe4]{width:80%;border-radius:%?15?%}.flex uni-label[data-v-19801fe4], .flex-around uni-label[data-v-19801fe4]{width:%?250?%}.use-number[data-v-19801fe4]{width:%?200?%;border-radius:%?15?%}.item-remove[data-v-19801fe4]{border-radius:%?15?%;padding:%?2?% %?10?%}.flex-around[data-v-19801fe4]{display:flex;justify-content:space-between;padding:0 %?20?%}",""]),e.exports=t},"97bb":function(e,t,s){"use strict";s.r(t);var r=s("c90c"),a=s("139a");for(var i in a)["default"].indexOf(i)<0&&function(e){s.d(t,e,(function(){return a[e]}))}(i);s("0815");var c=s("828b"),o=Object(c["a"])(a["default"],r["b"],r["c"],!1,null,"19801fe4",null,!1,r["a"],void 0);t["default"]=o.exports},c90c:function(e,t,s){"use strict";s.d(t,"b",(function(){return a})),s.d(t,"c",(function(){return i})),s.d(t,"a",(function(){return r}));var r={selectResourceStaff:s("46af").default},a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-uni-view",[s("v-uni-view",{staticStyle:{"padding-bottom":"100rpx"}},[s("v-uni-view",{staticClass:"cu-bar bg-white search "},[s("v-uni-view",{staticClass:"action"},[s("v-uni-button",{staticClass:"cu-btn bg-gradual-green shadow-blur round",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e._openChooseResourceModel()}}},[e._v(" "+e._s(e.$t("pages.resourceStoreScrap.resourceStoreScrap.选择物品")))])],1)],1),s("v-uni-view",{staticClass:"margin-top"},e._l(e.resourceStores,(function(t,r){return s("v-uni-view",{key:r,staticClass:"cu-list menu-avatar "},[s("v-uni-view",{staticClass:"cu-item",staticStyle:{height:"320rpx"}},[s("v-uni-view",{staticClass:"content content-left",staticStyle:{width:"100%"}},[s("v-uni-view",{staticClass:"text-grey flex-around"},[s("v-uni-text",{staticClass:"ellip"},[e._v(e._s(t.resName)+"("+e._s(t.parentRstName)+">"+e._s(t.rstName)+")")]),s("v-uni-text",{staticClass:"item-remove bg-red text-df",on:{click:function(s){arguments[0]=s=e.$handleEvent(s),e._removeItem(r,t.resId)}}},[e._v(" "+e._s(e.$t("pages.resourceStoreScrap.resourceStoreScrap.移除")))])],1),s("v-uni-view",{staticClass:"text-gray flex-around text-df",staticStyle:{margin:"10rpx 0"}},[s("v-uni-view",[s("v-uni-text",[e._v(" "+e._s(e.$t("pages.resourceStoreScrap.resourceStoreScrap.当前库存")))]),s("v-uni-text",[e._v(e._s(t.miniStock)+e._s(t.miniUnitCodeName))])],1)],1),s("v-uni-view",{staticClass:"text-gray flex-around",staticStyle:{margin:"10rpx 0"}},[s("v-uni-label",[e._v(" "+e._s(e.$t("pages.resourceStoreScrap.resourceStoreScrap.损耗类型")))]),s("v-uni-picker",{attrs:{value:e.selectedScrapTypesList[r],range:e.scrapTypes,"range-key":"stateName"},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e._scrapTypesChange(r,t)}}},[s("v-uni-view",{staticClass:"picker"},[e._v(" "+e._s(e.scrapTypes[e.selectedScrapTypesList[r]].stateName)+" ")])],1)],1),s("v-uni-view",{staticClass:"text-gray flex-around",staticStyle:{margin:"10rpx 0"}},[s("v-uni-label",[e._v(" "+e._s(e.$t("pages.resourceStoreScrap.resourceStoreScrap.损耗数量"))+"("+e._s(t.miniUnitCodeName)+")")]),s("v-uni-view",{staticClass:"flex"},[s("v-uni-text",{staticClass:"cuIcon-move",on:{click:function(s){arguments[0]=s=e.$handleEvent(s),e._decItemCurstock(t.resId)}}}),s("v-uni-input",{staticClass:"use-number bg-gray",attrs:{type:"number",value:""},model:{value:t.giveQuantity,callback:function(s){e.$set(t,"giveQuantity",s)},expression:"item.giveQuantity"}}),s("v-uni-text",{staticClass:"cuIcon-add",on:{click:function(s){arguments[0]=s=e.$handleEvent(s),e._incItemCurstock(t.resId)}}})],1)],1),s("v-uni-view",{staticClass:"text-gray flex-around",staticStyle:{margin:"10rpx 0"}},[s("v-uni-label",{staticClass:"text-df"},[e._v(" "+e._s(e.$t("pages.resourceStoreScrap.resourceStoreScrap.备注")))]),s("v-uni-input",{staticClass:"remark bg-gray",attrs:{type:"text",value:""},model:{value:t.purchaseRemark,callback:function(s){e.$set(t,"purchaseRemark",s)},expression:"item.purchaseRemark"}})],1)],1)],1)],1)})),1)],1),s("v-uni-view",{staticClass:"footer-step-fixed"},[s("v-uni-view",{staticClass:"step-item",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.$preventClick(e.save)}}},[e._v(" "+e._s(e.$t("pages.resourceStoreScrap.resourceStoreScrap.提交")))])],1),s("select-resource-staff",{ref:"selectresourcestaff",on:{getResourceInfo:function(t){arguments[0]=t=e.$handleEvent(t),e._getResourceInfo.apply(void 0,arguments)}}})],1)},i=[]},d459d:function(e,t,s){var r=s("1bc6");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var a=s("967d").default;a("1b6b6178",r,!0,{sourceMap:!1,shadowMode:!1})},fcd7:function(e,t,s){"use strict";s("6a54");var r=s("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,s("bf0f"),s("2797"),s("e966"),s("d4b5"),s("aa9c"),s("dd2b");var a=s("f37f"),i=s("a98f"),c=r(s("9b8e")),o=r(s("46af")),n=s("7fee");c.default.prototype.$preventClick=i.preventClick;var u={data:function(){return{onoff:!0,resourceStores:[],scrapTypes:[{state:"",stateName:this.$t("pages.resourceStoreScrap.resourceStoreScrap.请选择")},{state:"1001",stateName:this.$t("pages.resourceStoreScrap.resourceStoreScrap.报废回收")},{state:"3003",stateName:this.$t("pages.resourceStoreScrap.resourceStoreScrap.公用损耗")}],flag:1,selectedScrapTypesList:[]}},components:{selectResourceStaff:o.default},onLoad:function(){this.java110Context.onLoad()},methods:{_openChooseResourceModel:function(){this.$refs.selectresourcestaff.switchShow()},save:function(){var e=this;if(this.resourceStores.length<1)return this.onoff=!0,void this._showToast(this.$t("pages.resourceStoreScrap.resourceStoreScrap.请选择物品"));var t="";if(this.resourceStores.forEach((function(s){!s.hasOwnProperty("giveQuantity")||!s.giveQuantity||parseInt(s.giveQuantity)<1?t=e.$t("pages.resourceStoreScrap.resourceStoreScrap.请填写数量"):(s.giveQuantity=parseInt(s.giveQuantity),s.giveQuantity>parseInt(s.miniStock)?t=s.resName+",库存不足":s.hasOwnProperty("state")&&s.state?s.hasOwnProperty("purchaseRemark")&&s.purchaseRemark||(t=e.$t("pages.resourceStoreScrap.resourceStoreScrap.请填写备注")):t=e.$t("pages.resourceStoreScrap.resourceStoreScrap.请选择损耗类型"))})),""!=t)return this.onoff=!0,void this._showToast(t);var s={resourceStores:this.resourceStores,flag:this.flag,communityId:(0,n.getCurrentCommunity)().communityId};(0,a.saveResourceStoreTransfer)(this,s).then((function(e){0!=e.code||uni.navigateBack({delta:1})}))},_getResourceInfo:function(e){var t=this,s=JSON.stringify(e),r=JSON.parse(s);r.forEach((function(e){var s=!0;t.resourceStores.forEach((function(t){e.resId==t.resId&&(s=!1)})),s&&(e.giveQuantity=0,e.purchaseRemark="",t.resourceStores.push(e),t.selectedScrapTypesList.push(0))}))},_removeItem:function(e,t){this.resourceStores.splice(e,1),this.selectedScrapTypesList.splice(e,1),this.$refs.selectresourcestaff.removeSelectedItem(t),console.log(this.resourceStores)},_itemReturnAll:function(e,t){this.resourceStores.forEach((function(e){e.resId==t&&(e.giveQuantity=e.miniStock)})),this.$forceUpdate()},_decItemCurstock:function(e){this.resourceStores.forEach((function(t){t.resId==e&&t.giveQuantity>1&&(t.giveQuantity-=1)})),this.$forceUpdate()},_incItemCurstock:function(e){this.resourceStores.forEach((function(t){t.resId==e&&t.miniStock>t.giveQuantity&&(t.giveQuantity+=1)})),this.$forceUpdate()},_scrapTypesChange:function(e,t){this.$set(this.selectedScrapTypesList,e,t.target.value),console.log(this.scrapTypes[this.selectedScrapTypesList[e]].state),this.resourceStores[e].state=this.scrapTypes[this.selectedScrapTypesList[e]].state},_showToast:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";uni.showToast({title:e,icon:t})}}};t.default=u}}]); |