You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
28 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-raw-ingoods-dnReceipt-ImportDN"],{"06c5":function(e,t,r){"use strict";r("a630"),r("fb6a"),r("d3b7"),r("25f0"),r("3ca3"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=n(r("6b75"));function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(e){if("string"===typeof e)return(0,i.default)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?(0,i.default)(e,t):void 0}}},"0ae5":function(e,t,r){"use strict";var i=r("4ea4");r("a623"),r("4de4"),r("4160"),r("13d5"),r("45fc"),r("a434"),r("acd8"),r("159b"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r("5530")),a=i(r("2909"));r("96cf");var o=i(r("1da1")),s=i(r("d4ec")),u=i(r("bee2")),l=i(r("262e")),c=i(r("2caf")),d=r("9ab4"),p=r("60a3"),f=r("22da"),h=i(r("34b3")),v=r("54a3"),m=i(r("e007")),b=function(e){(0,l.default)(r,e);var t=(0,c.default)(r);function r(){var e;return(0,s.default)(this,r),e=t.apply(this,arguments),e.model=m.default,e.form={documentNo:""},e.material=[],e.poList=[],e.materialList=[],e.every={},e.value="",e.type="text",e.border=!0,e.receiptAmount="",e.Location=[],e.LocationList=[],e.wl={value:null},e.poNo=null,e.requestAmount=null,e.upload=[],e}return(0,u.default)(r,[{key:"onReady",value:function(){var e=(0,o.default)(regeneratorRuntime.mark((function e(){var t,r,i,n,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=JSON.parse(localStorage.getItem("__GWMS_APP_STATE_DATA__")),r=JSON.parse(localStorage.getItem("sendSpot")),i={loginName:t.session.user.loginName,sendSpot:r,factoryCode:t.session.user.factoryCode,workArea:v.session.workareaCode},e.next=5,this.model.queryByFactoryCodeAndWorkAreaCode(i);case 5:n=e.sent,n.forEach((function(e){console.log("res is:",n);var t={};t.label=e.locationCode,t.value=e.locationCode+"("+e.sendSpot+")",t.sendSpot=e.sendSpot,a.Location.push(t)}));case 7:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"query",value:function(){var e=(0,o.default)(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(""!=this.form.documentNo){e.next=3;break}return uni.showToast({icon:"none",title:this.$t("message.Commission_tips1")}),e.abrupt("return");case 3:return e.next=5,this.model.ImportQueryOrderInfo(this.form.documentNo);case 5:t=localStorage.getItem("list"),localStorage.removeItem("list"),this.material=JSON.parse(t),this.poList=(0,a.default)(this.material),r=this.removeDuplicates(this.poList,"poNo"),r.forEach((function(e){e.label=e.poNo,e.value=e.poNo})),this.poList=r;case 12:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"removeDuplicates",value:function(e,t){var r={},i=[];return i=e.reduce((function(e,i){return!r[i[t]]&&(r[i[t]]=e.push(i)),e}),[]),i}},{key:"totalLocation",value:function(e){var t=e.reduce((function(e,t){return e+ +t.receiptAmount}),0);return t}},{key:"poListChoice",value:function(e){this.poNo=e.pickerName.value,this.materialList=JSON.parse(JSON.stringify(this.removeDuplicates(this.material,"materialCode"))),this.materialList=this.materialList.filter((function(t){if(t.poNo==e.pickerName.value)return t.label=t.materialCode,t.value=t.materialCode,!0}))}},{key:"materialChoice",value:function(e){this.every=(0,n.default)({},e.pickerName)}},{key:"LocationChoice",value:function(e){this.wl=e.pickerName}},{key:"Add",value:function(){var e=this,t=this.totalLocation(this.LocationList);if(""!=this.receiptAmount&&""!=this.wl.value)if(parseFloat(this.receiptAmount)<=0)uni.showToast({icon:"none",title:this.$t("message.Commission_tips3")});else if(parseFloat(this.receiptAmount)>this.every.requestAmount||+this.receiptAmount+t>this.every.requestAmount)uni.showToast({icon:"none",title:this.$t("message.Commission_tips4")});else{var r=this.