1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
webpackJsonp([447],{"3iVI":function(e,t){},"4yGv":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=a("mvHQ"),o=a.n(s),i=(a("NYxO"),a("t4zo"),a("bzuE")),l={data:function(){return{total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10,startTime:"",endTime:"",code:"",materielName:"",outFacility:"",inFacility:""},config:i.a,tableData:[],inventoryIds:[],actureTime:"",dialogTitle:"",time:"",selectDeptId:"",formDataTime:"",fac_type_list1:[],fac_type_list2:[],auditSignList:[],companyList:[],createByList:[],depOptions:[],formData:{},btnDelDisabled:!0,btnOtherDisabled:!0,chooseClientrVisible:!1,dialogLoading:!1,chooseUserVisible:!1,chooseMaterielVisible:!1,columnSetDialogVisible:!1,advanceQueryDialogVisible:!1,chooseSupplierVisible:!1,columnSetDialogTitle:"设置显示字段列表",tableId:"inventory_table",pictLoading:!1,showTableColumnsDefault:[{title:"盘点日期",prop_:"actureTime",select:!0},{title:"盘点编号",prop_:"code",select:!0},{title:"盘点仓库",prop_:"warehouseName",select:!0},{title:"执行状态",prop_:"checkStatusName",select:!0},{title:"盘点人",prop_:"checkerName",select:!0},{title:"制单人",prop_:"createName",select:!0},{title:"制单时间",prop_:"createTime",select:!0}],showTableColumns:[{title:"盘点日期",prop_:"actureTime",select:!0},{title:"盘点编号",prop_:"code",select:!0},{title:"盘点仓库",prop_:"warehouseName",select:!0},{title:"执行状态",prop_:"checkStatusName",select:!0},{title:"盘点人",prop_:"checkerName",select:!0},{title:"制单人",prop_:"createName",select:!0},{title:"制单时间",prop_:"createTime",select:!0}],showTableColumnsTemp:[],formTableData:[]}},created:function(){var e=this;document.onkeydown=function(t){"Enter"===t.key&&e.search()}},computed:{},mounted:function(){this.showTableColumns=JSON.parse(o()(this.showTableColumns)),this.showTableColumnsTemp=JSON.parse(o()(this.showTableColumns)),this.getList(),this.getShowColumns()},methods:{search:function(){this.search_data.pageno=1,this.getList()},changeFacility:function(){this.$forceUpdate()},getList:function(){var e=this;this.pictLoading=!0,this.$api.inventoryAPI.istPlan(this.search_data).then(function(t){e.pictLoading=!1,t.data?(e.total=t.data.totalRows,e.tableData=t.data.datas?t.data.datas:[],e.tableData.forEach(function(e){e.actureTime=/\d{4}-\d{1,2}-\d{1,2}/g.exec(e.actureTime),e.createTime=/\d{4}-\d{1,2}-\d{1,2}/g.exec(e.createTime)})):(e.total=0,e.tableData=[])}).catch(function(e){console.log(e)})},doPlan:function(){this.$router.push({path:"/warehouse/inventoryRecord",query:{id:this.inventoryIds[0].id,t:Date.now()}})},goAdd:function(){this.$router.push({path:"/warehouse/inventory_add",query:{t:Date.now()}})},remove:function(){var e=this,t=[];this.inventoryIds.forEach(function(e){t.push(e.id)}),this.$confirm("确认删除选中的项吗?","提示",{type:"warning"}).then(function(){e.$api.inventoryAPI.deletePlan({planId:t}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getList()):e.$message({message:t.msg?t.msg:"删除失败,请重试",type:"error"})}).catch(function(t){e.$message({message:"删除失败,请重试",type:"error"})})})},handleSelectionChange:function(e){console.log(e),this.inventoryIds=e,this.setBtn(e)},handleSizeChange:function(e){this.search_data.pagesize=e,this.getList()},handleCurrentChange:function(e){this.search_data.pageno=e,this.getList()},setBtn:function(e){var t=!0,a=!0;e.length>0?(a=!1,1==e.length&&(t=!1)):(t=!0,a=!0),this.btnOtherDisabled=a,this.btnDelDisabled=t},showColumnSetDialog:function(){this.columnSetDialogVisible=!0,this.showTableColumnsTemp=JSON.parse(o()(this.showTableColumns))},toUp:function(e){if(0==e.$index)return!1;for(var t=void 0,a=0;a<this.showTableColumns.length;a++)this.showTableColumns[a].prop_==e.row.prop_&&(t=a);var s=this.showTableColumns[t];this.showTableColumns[t]=this.showTableColumns[t-1],this.showTableColumns[t-1]=s,this.$forceUpdate()},toDown:function(e){if(e.$index==this.showTableColumns.length-1)return!1;for(var t=void 0,a=0;a<this.showTableColumns.length;a++)this.showTableColumns[a].prop_==e.row.prop_&&(t=a);var s=this.showTableColumns[t];this.showTableColumns[t]=this.showTableColumns[t+1],this.showTableColumns[t+1]=s,this.$forceUpdate()},toDefault:function(){this.showTableColumns=JSON.parse(o()(this.showTableColumnsDefault)),this.$forceUpdate()},saveAndCloseColumnSetDialog:function(){var e=this,t=this.tableId,a=o()(this.showTableColumns);this.columnSetDialogVisible=!1,this.$api.tableColumnAPI.saveShowColumns({tableNo:t,tableColumns:a}).then(function(t){var a=JSON.parse(o()(e.showTableColumns));e.formTableData=[];for(var s=0;s<a.length;s++)a[s].select&&e.formTableData.push(a[s])}).catch(function(e){console.log(e)})},handleClose:function(){this.showTableColumns=JSON.parse(o()(this.showTableColumnsTemp)),this.columnSetDialogVisible=!1},getShowColumns:function(){var e=this,t=this.tableId;this.formTableData=[],this.$api.tableColumnAPI.getShowColumns({tableNo:t}).then(function(t){if(0==t.code)if(t.results){e.showTableColumns=JSON.parse(t.results);for(var a=JSON.parse(o()(e.showTableColumns)),s=0;s<a.length;s++)a[s].select&&e.formTableData.push(a[s]);e.$forceUpdate()}else{for(var i=JSON.parse(o()(e.showTableColumnsDefault)),l=0;l<i.length;l++)i[l].select&&e.formTableData.push(i[l]);e.$forceUpdate()}else e.$message({message:t.msg?t.msg:"获取列表信息失败",type:"error"})}).catch(function(t){e.$message({message:t,type:"error"}),console.log(t)})}},watch:{time:function(e){e?(this.search_data.startTime=e[0],this.search_data.endTime=e[1]):(this.search_data.startTime="",this.search_data.endTime="")},formDataTime:function(e){e?(this.formData.startTime=e[0],this.formData.endTime=e[1]):(this.formData.startTime="",this.formData.endTime="")}}},n={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sys-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{directives:[{name:"has",rawName:"v-has",value:"warehouse:inventory:add",expression:"'warehouse:inventory:add'"}],attrs:{type:"primary"},on:{click:function(t){return e.goAdd()}}},[e._v("新增")]),e._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"warehouse:inventory:remove",expression:"'warehouse:inventory:remove'"}],attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:function(t){return e.remove()}}},[e._v("删除")]),e._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"warehouse:inventory:doPlan",expression:"'warehouse:inventory:doPlan'"}],attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:e.doPlan}},[e._v("执行盘点")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.showColumnSetDialog}},[e._v(e._s(e.config.configureBtnName))])],1),e._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:e.search_data.code,callback:function(t){e.$set(e.search_data,"code",t)},expression:"search_data.code"}})],1),e._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"33%"},attrs:{label:"时间"}},[a("el-date-picker",{attrs:{type:"daterange",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd HH:mm:ss","range-separator":"—","start-placeholder":"开始时间","end-placeholder":"结束时间"},model:{value:e.time,callback:function(t){e.time=t},expression:"time"}})],1)],1),e._v(" "),a("div",{staticClass:"form_item_btn_out"},[a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.search()}}},[e._v("查询")])],1)],1)])],1),e._v(" "),a("div",{staticClass:"sys-table"},[e.formTableData.length>0?a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.pictLoading,expression:"pictLoading"}],ref:"tb",attrs:{border:"",id:"out-table",data:e.tableData,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),e._l(e.formTableData,function(e,t){return a("el-table-column",{key:t,attrs:{prop:e.prop_,label:e.title,align:"center","show-overflow-tooltip":""}})})],2):e._e()],1),e._v(" "),a("div",{staticClass:"sys-pagination"},[a("el-pagination",{attrs:{"current-page":e.search_data.pageno,"page-sizes":e.pageSizes,"page-size":e.search_data.pagesize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1),e._v(" "),a("el-dialog",{attrs:{title:e.columnSetDialogTitle,center:"",visible:e.columnSetDialogVisible,width:"531px","before-close":e.handleClose},on:{"update:visible":function(t){e.columnSetDialogVisible=t}}},[a("el-table",{key:Math.random(),staticStyle:{width:"100%"},attrs:{border:"",data:e.showTableColumns,"max-height":"350"}},[a("el-table-column",{attrs:{prop:"title",label:"列表名称",width:"180",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"select",label:"是否显示",width:"180"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{model:{value:t.row.select,callback:function(a){e.$set(t.row,"select",a)},expression:"scope.row.select"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.toUp(t)}}},[e._v("前移")]),e._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.toDown(t)}}},[e._v("后移")])]}}])})],1),e._v(" "),a("el-row",{staticClass:"row-bg",staticStyle:{"margin-top":"10px"},attrs:{type:"flex",justify:"center"}},[a("el-col",{attrs:{span:6}},[a("el-button",{attrs:{type:"primary",size:"middle"},on:{click:e.saveAndCloseColumnSetDialog}},[e._v("完成")])],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-button",{attrs:{type:"primary",size:"middle"},on:{click:e.toDefault}},[e._v("恢复默认")])],1)],1)],1)],1)},staticRenderFns:[]};var r=a("VU/8")(l,n,!1,function(e){a("3iVI")},"data-v-1cd0d132",null);t.default=r.exports}}); |