pages-receipt-batch-add-edit.a48e517e.js
18.4 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-receipt-batch-add-edit"],{"10a8":function(t,e,i){"use strict";i("99af"),i("c740"),i("4160"),i("c975"),i("d81d"),i("13d5"),i("a434"),i("e25e"),i("159b"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={data:function(){return{receiptCode:"",batch:"",projectNo:"",receiptType:void 0,materialList:[],selectTotal:0,detailInfo:{},materialQty:null,receiptTypeArr:[],typeIndex:-1,timer:null,timer2:null,loading:!1,disabled:!1,type:""}},onLoad:function(t){var e=this;if(this.type=t.type,uni.$on("materialSelectData",(function(t){e.materialList=e.materialList.concat(t.data),e.materialList=e.unique(e.materialList),e.selectTotal=e.materialList.reduce((function(t,e){return t+e.qty}),0)})),this.$api.dict.getReceiptType().then((function(i){e.receiptTypeArr=i.data.data,e.typeIndex=e.receiptTypeArr.findIndex((function(e,i){return e.code==t.category}))})),"edit"==t.type){this.batch=t.batch,this.projectNo=t.projectNo,this.receiptType=t.category,this.receiptCode=t.code,this.id=t.id;try{var i=uni.getStorageSync("receipt_detail");i&&(this.materialList=i,this.selectTotal=this.materialList.reduce((function(t,e){return t+e.qty}),0))}catch(n){}}},onReady:function(){"add"==this.type?uni.setNavigationBarTitle({title:"新增入库单"}):uni.setNavigationBarTitle({title:"修改入库单"})},onUnload:function(){uni.$off("materialSelectData"),this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer2&&(clearTimeout(this.timer2),this.timer2=null)},methods:{typePickerChange:function(t){var e=this;this.typeIndex=t.target.value,this.receiptType=this.receiptTypeArr[this.typeIndex].code,this.$api.receipt.createReceiptCode(this.receiptType).then((function(t){"add"==e.type&&(e.receiptCode=t.data.data)}))},selectMaterial:function(){uni.navigateTo({url:"../../material/select"})},showPop:function(t){this.detailInfo=t,this.$refs.popup.open()},clearCart:function(){this.$refs.popup.close()},getQty:function(t){this.materialQty=t},detailDel:function(){var t=this;this.$refs.popup.close(),this.materialList.forEach((function(e){e.code==t.detailInfo.code&&t.materialList.splice(t.materialList.indexOf(e),1)})),this.selectTotal=this.materialList.reduce((function(t,e){return t+e.qty}),0)},detailSave:function(){var t=this;this.$refs.popup.close(),this.materialList.forEach((function(e){e.code==t.detailInfo.code&&(e.qty=parseInt(t.materialQty))})),this.selectTotal=this.materialList.reduce((function(t,e){return t+e.qty}),0)},submit:function(){var t=this;if(void 0!=this.receiptType)if(0!=this.materialList.length){var e=this.materialList.map((function(e){return{receiptCode:t.receiptCode,batch:t.batch,projectNo:t.projectNo,receiptType:t.receiptType,companyCode:e.companyCode,materialCode:e.code,qty:e.qty}}));this.loading=!0,this.disabled=!0,"add"==this.type?this.$api.receipt.createReceipt(e).then((function(e){200==e.data.code?(t.loading=!1,t.disabled=!1,t.$prePage()._data.queryParams.pageNum=1,t.$prePage().getReceiptList(),t.$wx.showToast({title:"保存成功!"}),t.timer=setTimeout((function(){uni.navigateBack()}),400)):(uni.showModal({title:"提示",content:e.data.msg}),t.loading=!1,t.disabled=!1)})).catch((function(e){t.loading=!1,t.disabled=!1})):this.$api.receipt.updateReceipt(e).then((function(e){200==e.data.code?(t.loading=!1,t.disabled=!1,t.$prePage().getReceiptHeader(t.id),t.$prePage().getScanBill(t.receiptCode),t.$prePage().getReceiptInfoByBill(t.receiptCode),t.$wx.showToast({title:"保存成功!"}),t.timer2=setTimeout((function(){uni.navigateBack()}),400)):(uni.showModal({title:"提示",content:e.data.msg}),t.loading=!1,t.disabled=!1)})).catch((function(e){t.loading=!1,t.disabled=!1}))}else uni.showModal({title:"提示",content:"请选择物料!",showCancel:!1});else uni.showModal({title:"提示",content:"请选择入库类型!",showCancel:!1})}}};e.default=n},"13d5":function(t,e,i){"use strict";var n=i("23e7"),a=i("d58f").left,o=i("a640"),c=i("ae40"),r=o("reduce"),s=c("reduce",{1:0});n({target:"Array",proto:!0,forced:!r||!s},{reduce:function(t){return a(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"297a":function(t,e,i){"use strict";var n;i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"uni-numbox"},[i("v-uni-view",{staticClass:"uni-numbox__minus",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t._calcValue("minus")}}},[i("v-uni-text",{staticClass:"uni-numbox--text",class:{"uni-numbox--disabled":t.inputValue<=t.min||t.disabled}},[t._v("-")])],1),i("v-uni-input",{staticClass:"uni-numbox__value",attrs:{disabled:t.disabled,type:"number"},on:{blur:function(e){arguments[0]=e=t.$handleEvent(e),t._onBlur.apply(void 0,arguments)}},model:{value:t.inputValue,callback:function(e){t.inputValue=e},expression:"inputValue"}}),i("v-uni-view",{staticClass:"uni-numbox__plus",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t._calcValue("plus")}}},[i("v-uni-text",{staticClass:"uni-numbox--text",class:{"uni-numbox--disabled":t.inputValue>=t.max||t.disabled}},[t._v("+")])],1)],1)},o=[]},"37c9":function(t,e,i){"use strict";var n=i("c167"),a=i.n(n);a.a},"38c8":function(t,e,i){var n=i("24fb");e=n(!1),e.push([t.i,"\n.uni-numbox[data-v-1513e732]{\ndisplay:-webkit-box;display:-webkit-flex;display:flex;\n-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;height:35px;line-height:35px\n\t\t/* width: 120px; */}.uni-numbox__value[data-v-1513e732]{background-color:#fff;width:40px;height:35px;text-align:center;font-size:16;border-width:%?1?%;border-style:solid;border-color:#e5e5e5;border-left-width:0;border-right-width:0}.uni-numbox__minus[data-v-1513e732]{\ndisplay:-webkit-box;display:-webkit-flex;display:flex;\n-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;width:35px;height:35px;\n\t\t/* line-height: $box-line-height;\n */\n\t\t/* text-align: center;\n */font-size:20px;color:#333;background-color:#f8f8f8;border-width:%?1?%;border-style:solid;border-color:#e5e5e5;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;border-right-width:0}.uni-numbox__plus[data-v-1513e732]{\ndisplay:-webkit-box;display:-webkit-flex;display:flex;\n-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;width:35px;height:35px;border-width:%?1?%;border-style:solid;border-color:#e5e5e5;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;background-color:#f8f8f8;border-left-width:0}.uni-numbox--text[data-v-1513e732]{font-size:%?40?%;color:#333}.uni-numbox--disabled[data-v-1513e732]{color:silver}",""]),t.exports=e},"404c":function(t,e,i){"use strict";i.r(e);var n=i("f2fe"),a=i.n(n);for(var o in n)"default"!==o&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=a.a},6017:function(t,e,i){"use strict";i.r(e);var n=i("ada7"),a=i("8941");for(var o in a)"default"!==o&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("be7f");var c,r=i("f0c5"),s=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"7450e9c4",null,!1,n["a"],c);e["default"]=s.exports},8941:function(t,e,i){"use strict";i.r(e);var n=i("10a8"),a=i.n(n);for(var o in n)"default"!==o&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=a.a},ada7:function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var n={uniIcons:i("1968").default,uniPopup:i("71e4").default,uniNumberBox:i("d5c0").default},a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"main"},[i("v-uni-view",{staticClass:"u-f u-f-jcsb u-f-aic common plr-10"},[i("v-uni-view",{staticClass:"u-f1 require"},[t._v("入库类型")]),i("v-uni-view",{staticClass:"u-f3 inp"},[i("v-uni-picker",{attrs:{value:t.typeIndex,"range-key":"name",range:t.receiptTypeArr},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.typePickerChange.apply(void 0,arguments)}}},[i("v-uni-view",{staticClass:"uni-input"},[-1==t.typeIndex?i("v-uni-text",{staticClass:"placeholder-color"},[t._v("请选择")]):i("v-uni-text",[t._v(t._s(t.receiptTypeArr[t.typeIndex].name))])],1)],1)],1)],1),i("v-uni-view",{staticClass:"u-f u-f-aic common plr-10"},[i("v-uni-view",{staticClass:"u-f1"},[t._v("批次号")]),i("v-uni-view",{staticClass:"u-f3 inp"},[i("v-uni-input",{staticClass:"s-fz",attrs:{placeholder:"请输入"},model:{value:t.batch,callback:function(e){t.batch=e},expression:"batch"}})],1)],1),i("v-uni-view",{staticClass:"u-f u-f-jcsb u-f-aic common plr-10"},[i("v-uni-view",{staticClass:"u-f1"},[t._v("项目号")]),i("v-uni-view",{staticClass:"u-f3 inp"},[i("v-uni-input",{staticClass:"s-fz",attrs:{placeholder:"请输入"},model:{value:t.projectNo,callback:function(e){t.projectNo=e},expression:"projectNo"}})],1)],1),i("v-uni-view",{staticClass:"select-material plr-10",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.selectMaterial.apply(void 0,arguments)}}},[i("v-uni-view",{staticClass:"fl"},[t._v("物料")]),i("v-uni-view",{staticClass:"select fr u-f u-f-aic"},[i("v-uni-text",{staticClass:"set-color"},[t._v("点击选择物料")]),i("uni-icons",{attrs:{type:"arrowright",size:"18",color:"gray"}})],1)],1),i("v-uni-view",{staticClass:"select-content"},t._l(t.materialList,(function(e,n){return i("v-uni-view",{key:n,staticClass:"select-list u-f u-f-jcsb u-f-aic plr-10",on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.showPop(e)}}},[i("v-uni-view",{staticClass:"left-content"},[i("v-uni-view",{staticClass:"name"},[t._v(t._s(e.name))]),i("v-uni-view",{staticClass:"code"},[t._v("编号:"+t._s(e.code))]),i("v-uni-view",{staticClass:"total"},[t._v("数量:"+t._s(e.qty))])],1),i("v-uni-view",{staticClass:"spec u-f u-f-aic"},[i("v-uni-text",{staticClass:"model"},[t._v("型号:"+t._s(e.spec))]),i("uni-icons",{attrs:{type:"arrowright",size:"18",color:"gray"}})],1)],1)})),1),i("v-uni-view",{staticClass:"footer"},[i("v-uni-view",{staticClass:"plr-10 u-f u-f-aic u-f-jcsb"},[i("v-uni-view",[t._v("数量:"),i("v-uni-text",{staticClass:"total"},[t._v(t._s(t.selectTotal))])],1),i("v-uni-view",{staticClass:"btn u-f u-f-aic",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.submit.apply(void 0,arguments)}}},[i("v-uni-button",{attrs:{loading:t.loading,type:"primary",size:"mini",disabled:t.disabled}},[t._v("保存")])],1)],1)],1),i("uni-popup",{ref:"popup",attrs:{type:"bottom"}},[i("v-uni-view",{staticClass:"pop-box"},[i("v-uni-view",{staticClass:"pop-title u-f u-f-jcsb u-f-aic plr-10"},[i("v-uni-view",[t._v("编辑明细")]),i("v-uni-view",{staticClass:"u-f u-f-aic",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.clearCart.apply(void 0,arguments)}}},[i("uni-icons",{attrs:{type:"close",size:"17"}}),i("v-uni-text",{staticClass:"clear"},[t._v("关闭")])],1)],1),i("v-uni-view",{staticClass:"pop-content",on:{touchmove:function(e){e.stopPropagation(),e.preventDefault(),arguments[0]=e=t.$handleEvent(e)}}},[i("v-uni-view",{staticClass:"pop-content-box u-f u-f-jcsb u-f-aic plr-10"},[i("v-uni-view",[i("v-uni-view",{staticClass:"name"},[t._v(t._s(t.detailInfo.name))]),i("v-uni-view",{staticClass:"code"},[t._v("编号:"+t._s(t.detailInfo.code))]),i("v-uni-view",{staticClass:"model"},[t._v("型号:"+t._s(t.detailInfo.spec))])],1),i("v-uni-view",[i("uni-number-box",{attrs:{min:1,step:1,value:t.detailInfo.qty},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.getQty.apply(void 0,arguments)}}})],1)],1)],1),i("v-uni-view",{staticClass:"pop-footer u-f u-f-aic"},[i("v-uni-button",{staticClass:"delBtn",attrs:{type:"default",plain:!0},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.detailDel.apply(void 0,arguments)}}},[t._v("删除")]),i("v-uni-button",{staticClass:"saveBtn",attrs:{type:"primary"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.detailSave.apply(void 0,arguments)}}},[t._v("保存")])],1)],1)],1)],1)},o=[]},ae15:function(t,e,i){var n=i("24fb");e=n(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.main[data-v-7450e9c4]{height:%?1144?%;overflow-y:auto}.main .common[data-v-7450e9c4]{height:%?90?%;font-size:%?32?%;background-color:#fff;border-bottom:%?2?% solid #e5e5e5}.main .common .inp[data-v-7450e9c4]{text-align:right}.main .common .inp .s-fz[data-v-7450e9c4]{font-size:%?32?%}.main .common .require[data-v-7450e9c4]{position:relative}.main .common .require[data-v-7450e9c4]::after{position:absolute;content:"*";color:red;font-size:%?50?%;top:0;left:%?-18?%}.main .select-material[data-v-7450e9c4]{height:%?90?%;line-height:%?90?%;margin-top:%?20?%;background-color:#fff;font-size:%?32?%;border-bottom:%?2?% solid #e5e5e5}.main .select-material .select .set-color[data-v-7450e9c4]{color:#007aff}.main .select-material .select .uni-icons[data-v-7450e9c4]{width:%?30?%}.main .select-content .select-list[data-v-7450e9c4]{height:%?170?%;background-color:#fff;border-bottom:%?2?% solid #e5e5e5}.main .select-content .select-list .left-content .name[data-v-7450e9c4]{font-size:%?32?%;font-weight:700}.main .select-content .select-list .left-content .code[data-v-7450e9c4],\r\n.main .select-content .select-list .left-content .total[data-v-7450e9c4]{margin-top:%?10?%}.main .select-content .select-list .left-content .code[data-v-7450e9c4]{color:#979797}.main .select-content .select-list .left-content .total[data-v-7450e9c4]{color:#007aff}.main .select-content .select-list .spec[data-v-7450e9c4]{color:#979797}.main .select-content .select-list .spec .model[data-v-7450e9c4]{margin-right:%?10?%}.main .footer[data-v-7450e9c4]{position:fixed;width:100%;bottom:0;height:%?100?%;line-height:%?100?%;border-top:%?2?% solid #e5e5e5;background-color:#fff}.main .footer .total[data-v-7450e9c4]{color:#007aff}.main .footer .btn uni-button[data-v-7450e9c4]{width:%?220?%;font-size:%?32?%;-webkit-border-radius:%?36?%;border-radius:%?36?%}.main .pop-box[data-v-7450e9c4]{position:relative;background-color:#f8f8f8;height:%?800?%}.main .pop-box .pop-title[data-v-7450e9c4]{height:%?80?%}.main .pop-box .pop-title .clear[data-v-7450e9c4]{margin-left:%?4?%}.main .pop-box .pop-content .pop-content-box[data-v-7450e9c4]{height:%?170?%;background-color:#fff;border-bottom:%?2?% solid #e5e5e5}.main .pop-box .pop-content .pop-content-box .name[data-v-7450e9c4]{font-size:%?32?%;font-weight:700}.main .pop-box .pop-content .pop-content-box .code[data-v-7450e9c4],\r\n.main .pop-box .pop-content .pop-content-box .model[data-v-7450e9c4]{margin-top:%?10?%}.main .pop-box .pop-content .pop-content-box[data-v-7450e9c4] .uni-numbox{height:%?60?%;line-height:%?60?%}.main .pop-box .pop-content .pop-content-box[data-v-7450e9c4] .uni-numbox .uni-numbox__minus,\r\n.main .pop-box .pop-content .pop-content-box[data-v-7450e9c4] .uni-numbox .uni-numbox__value,\r\n.main .pop-box .pop-content .pop-content-box[data-v-7450e9c4] .uni-numbox .uni-numbox__plus{height:%?60?%;line-height:%?60?%}.main .pop-box .pop-footer[data-v-7450e9c4]{position:absolute;width:100%;bottom:0;height:%?130?%;border-top:%?2?% solid #e5e5e5;border-bottom:%?2?% solid #e5e5e5;background-color:#fff}.main .pop-box .pop-footer .delBtn[data-v-7450e9c4],\r\n.main .pop-box .pop-footer .saveBtn[data-v-7450e9c4]{width:%?340?%;-webkit-border-radius:%?90?%!important;border-radius:%?90?%!important}.main .pop-box .pop-footer .delBtn[data-v-7450e9c4]{margin-left:%?20?%;border-color:#e5e5e5}.main .pop-box .pop-footer .saveBtn[data-v-7450e9c4]{margin-right:%?20?%}',""]),t.exports=e},be7f:function(t,e,i){"use strict";var n=i("c3d9"),a=i.n(n);a.a},c167:function(t,e,i){var n=i("38c8");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("4f06").default;a("409e06be",n,!0,{sourceMap:!1,shadowMode:!1})},c3d9:function(t,e,i){var n=i("ae15");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("4f06").default;a("33907b20",n,!0,{sourceMap:!1,shadowMode:!1})},d5c0:function(t,e,i){"use strict";i.r(e);var n=i("297a"),a=i("404c");for(var o in a)"default"!==o&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("37c9");var c,r=i("f0c5"),s=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"1513e732",null,!1,n["a"],c);e["default"]=s.exports},f2fe:function(t,e,i){"use strict";i("a9e3"),i("ac1f"),i("1276"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={name:"UniNumberBox",props:{value:{type:[Number,String],default:1},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},disabled:{type:Boolean,default:!1}},data:function(){return{inputValue:0}},watch:{value:function(t){this.inputValue=+t},inputValue:function(t,e){+t!==+e&&this.$emit("change",t)}},created:function(){this.inputValue=+this.value},methods:{_calcValue:function(t){if(!this.disabled){var e=this._getDecimalScale(),i=this.inputValue*e,n=this.step*e;if("minus"===t){if(i-=n,i<this.min*e)return;i>this.max*e&&(i=this.max*e)}else if("plus"===t){if(i+=n,i>this.max*e)return;i<this.min*e&&(i=this.min*e)}this.inputValue=String(i/e)}},_getDecimalScale:function(){var t=1;return~~this.step!==this.step&&(t=Math.pow(10,(this.step+"").split(".")[1].length)),t},_onBlur:function(t){var e=t.detail.value;e&&(e=+e,e>this.max?e=this.max:e<this.min&&(e=this.min),this.inputValue=e)}}};e.default=n}}]);