1 line
7.6 KiB
JavaScript
1 line
7.6 KiB
JavaScript
webpackJsonp([475],{"5XvY":function(t,e){},"9Qj2":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=a("mvHQ"),n=a.n(o),i={data:function(){return{total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10,auditSign:179},otherStockIds:[],btnDisabled:!1,btnDelDisabled:!0,summary:{},time:"",formData:{},productInStockIds:[],inOutTime:"",tableData:[],pictLoading:!1}},created:function(){var t=this;document.onkeydown=function(e){"Enter"===e.key&&t.search()}},watch:{time:function(t){t?(this.search_data.startTime=t[0],this.search_data.endTime=t[1]):(this.search_data.startTime="",this.search_data.endTime="")},tableData:{handler:function(t){t.length>0?this.btnDisabled=!1:this.btnDisabled=!0}}},mounted:function(){this.getList()},methods:{changeAmount:function(t){this.$set(t,"unitPrice",t.amount/t.inCount)},changeUnitPrice:function(t){this.$set(t,"amount",t.unitPrice*t.inCount)},save:function(){var t=this,e=[];this.tableData.forEach(function(a){var o={id:a.stockInItemId,unitPrice:a.unitPrice?a.unitPrice:0,amount:a.amount?a.amount:0};e.push(o),t.formData.item=n()(e)}),this.$api.stockInAccountingAPI.produceOrOtherInStock({detailAccounting:this.formData.item}).then(function(e){0===e.code?t.$message({message:e.msg,type:"success"}):t.$message({message:e.msg,type:"error"})})},search:function(){this.search_data.pageno=1,this.getList()},getList:function(){var t=this;this.pictLoading=!0,this.$api.otherStockAPI.getOtherStockList(this.search_data).then(function(e){t.pictLoading=!1,e.data?(t.summary=e.data,t.total=e.data.totalRows,t.tableData=e.data.datas?e.data.datas:[],t.tableData.forEach(function(t){t.inOutTime=/\d{4}-\d{1,2}-\d{1,2}/g.exec(t.inOutTime)})):(t.total=0,t.tableData=[])}).catch(function(t){console.log(t)})},setBtn:function(t){var e=!0;t.length>0?(e=!1,t.length):(!0,e=!0),this.btnDelDisabled=e},handleSelectionChange:function(t){console.log(t),this.otherStockIds=t,this.setBtn(t)},handleSizeChange:function(t){this.search_data.pagesize=t,this.getList()},handleCurrentChange:function(t){this.search_data.pageno=t,this.getList()},getSummaries:function(t){var e=this,a=t.columns,o=t.data,n=[];return a.forEach(function(t,a){if(0!==a)if("count"==t.property||"amount"==t.property||"inCount"==t.property){var i=o.map(function(e){return Number(e[t.property])});i.every(function(t){return isNaN(t)})?n[a]="":n[a]=i.reduce(function(t,e){var a=Number(e);return isNaN(a)?t:t+e},0),"count"!=t.property?"amount"!=t.property?"inCount"!=t.property||n[a]&&(n[a]=e.summary.totalInCount):n[a]&&(n[a]=e.summary.toatalAmount):n[a]&&(n[a]=e.summary.toatalCount)}else n[a]="";else n[a]="合计"}),n}}},r={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"sys-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{directives:[{name:"has",rawName:"v-has",value:"finance:otherStock:save",expression:"'finance:otherStock:save'"}],attrs:{type:"primary"},on:{click:t.save}},[t._v("保存")])],1),t._v(" "),a("div",{staticClass:"sys-search"},[a("el-form",{staticClass:"form_item_search_out",attrs:{inline:""}},[a("div",{staticClass:"form_item_input_out"},[a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"33%"},attrs:{label:"物料名称"}},[a("el-input",{attrs:{placeholder:"模糊查询",clearable:""},model:{value:t.search_data.materielName,callback:function(e){t.$set(t.search_data,"materielName",e)},expression:"search_data.materielName"}})],1),t._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"33%"},attrs:{label:"入库日期"}},[a("el-date-picker",{attrs:{type:"month",format:"yyyy-MM","value-format":"yyyy-MM-dd HH:mm:ss",placeholder:"请选择"},model:{value:t.search_data.periodTime,callback:function(e){t.$set(t.search_data,"periodTime",e)},expression:"search_data.periodTime"}})],1)],1),t._v(" "),a("div",{staticClass:"form_item_btn_out"},[a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.search()}}},[t._v("查询")])],1)],1)])],1),t._v(" "),a("div",{staticClass:"sys-table"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.pictLoading,expression:"pictLoading"}],ref:"tb",attrs:{border:"",id:"out-table","show-summary":"","summary-method":t.getSummaries,data:t.tableData,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"selection-change":t.handleSelectionChange}},[a("el-table-column",{attrs:{prop:"inOutTime",label:"入库日期",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"inheadCode",label:"单据编号",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"serialno",label:"物料代码",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"materielName",label:"物料名称",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"specification",label:"规格型号",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"sourceCompanyName",label:"供应商",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"unitName",label:"主计量单位",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"count",label:"数量(主单位)",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"supportUomName",label:"辅助单位",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"inCount",label:"数量(辅助单位)",align:"center",width:"140","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"batch",label:"批号",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"unitPrice",label:"单价(元)",width:"180",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small",precision:e.row.priceAccuracy,"controls-position":"right"},on:{change:function(a){return t.changeUnitPrice(e.row)}},model:{value:e.row.unitPrice,callback:function(a){t.$set(e.row,"unitPrice",a)},expression:"scope.row.unitPrice"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"amount",label:"金额(元)",width:"180",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small","controls-position":"right"},on:{change:function(a){return t.changeAmount(e.row)}},model:{value:e.row.amount,callback:function(a){t.$set(e.row,"amount",a)},expression:"scope.row.amount"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"warehouseName",label:"仓库",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"warehLocationName",label:"仓位",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"sourceTypeName",label:"源单类型",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"sourceCode",label:"源单单号",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"auditSignName",label:"审核状态",align:"center","show-overflow-tooltip":""}})],1),t._v(" "),a("div",{staticClass:"sys-pagination"},[a("el-pagination",{attrs:{"current-page":t.search_data.pageno,"page-sizes":t.pageSizes,"page-size":t.search_data.pagesize,layout:"total, sizes, prev, pager, next, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1)])},staticRenderFns:[]};var l=a("VU/8")(i,r,!1,function(t){a("5XvY")},"data-v-01d9c5e1",null);e.default=l.exports}}); |