1 line
19 KiB
JavaScript
1 line
19 KiB
JavaScript
webpackJsonp([347],{JufY:function(t,e){},oS3O:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=a("d7EF"),i=a.n(s),o=a("//Fk"),r=a.n(o),n=a("BO1k"),l=a.n(n),c=a("mvHQ"),h=a.n(c),u=a("Dd8w"),p=a.n(u),m=a("NYxO"),d=(a("t4zo"),a("uXZL"),a("3MlD")),g=a("FnMF"),f=a("OG67"),_=a("lbHh"),b=a.n(_),v=a("bzuE"),y={name:"purchase_apply_index",components:{dialogChooseSingleUser:d.a,dialogChooseSingleSupplier:g.a,dialogChooseSingleParts:f.a},data:function(){return{totalAll:{},config:v.a,depOptions:[],selectDeptId:"",user_type:"",chooseSupplierVisible:!1,chooseMaterielVisible:!1,chooseUserVisible:!1,total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10},time:"",formDataTime:"",auditSignList:[],companyList:[],createByList:[],formData:{},showTableColumnsDefault:[{title:"开票日期",prop_:"invoiceDate",select:!0},{title:"供应商",prop_:"supplierName",select:!0},{title:"票据类型",prop_:"invoiceyTypeName",select:!0},{title:"发票号码",prop_:"billCode",select:!0},{title:"物料代码",prop_:"materielSerialNo",select:!0},{title:"物料名称",prop_:"materielName",select:!0},{title:"规格型号",prop_:"specification",select:!0},{title:"主计量单位",prop_:"unitUomName",select:!0},{title:"主单位数量",prop_:"count",select:!0},{title:"辅助单位",prop_:"supportUomName",select:!0},{title:"数量",prop_:"subCount",select:!0},{title:"不含税单价(元)",prop_:"unitPrice",select:!0},{title:"税率(%)",prop_:"taxRate",select:!0},{title:"不含税金额(元)",prop_:"amount",select:!0},{title:"税额(元)",prop_:"taxes",select:!0},{title:"价税合计(元)",prop_:"taxAmount",select:!0},{title:"审核状态",prop_:"auditSignName",select:!0},{title:"源单类型",prop_:"sourceTypeName",select:!0},{title:"源单单号",prop_:"sourceCode",select:!0}],showTableColumns:[{title:"开票日期",prop_:"invoiceDate",select:!0},{title:"供应商",prop_:"supplierName",select:!0},{title:"票据类型",prop_:"invoiceyTypeName",select:!0},{title:"发票号码",prop_:"billCode",select:!0},{title:"物料代码",prop_:"materielSerialNo",select:!0},{title:"物料名称",prop_:"materielName",select:!0},{title:"规格型号",prop_:"specification",select:!0},{title:"主计量单位",prop_:"unitUomName",select:!0},{title:"主单位数量",prop_:"count",select:!0},{title:"辅助单位",prop_:"supportUomName",select:!0},{title:"数量",prop_:"subCount",select:!0},{title:"不含税单价(元)",prop_:"unitPrice",select:!0},{title:"税率(%)",prop_:"taxRate",select:!0},{title:"不含税金额(元)",prop_:"amount",select:!0},{title:"税额(元)",prop_:"taxes",select:!0},{title:"价税合计(元)",prop_:"taxAmount",select:!0},{title:"审核状态",prop_:"auditSignName",select:!0},{title:"源单类型",prop_:"sourceTypeName",select:!0},{title:"源单单号",prop_:"sourceCode",select:!0}],showTableColumnsTemp:[],formTableData:[],tableData:[],btnDelDisabled:!0,btnOtherDisabled:!0,rowIds:[],advanceQueryDialogVisible:!1,dialogTitle:"",dialogLoading:!1,columnSetDialogVisible:!1,columnSetDialogTitle:"设置显示字段列表",pictLoading:!1,tableId:"outsourcing_processingCharge_table",userInfo:""}},created:function(){var t=this;document.onkeydown=function(e){"Enter"===e.key&&t.search()}},computed:p()({},Object(m.c)({})),mounted:function(){this.userInfo=JSON.parse(b.a.get("userInfo")),this.showTableColumns=JSON.parse(h()(this.showTableColumns)),this.showTableColumnsTemp=JSON.parse(h()(this.showTableColumns)),this.formData.createBy=this.userInfo.userId,this.formData.createByName=this.userInfo.name;var t=new Date;this.$set(this.formData,"createTime",t.getFullYear()+"-"+this.settime(t.getMonth()+1)+"-"+this.settime(t.getDate())),this.getList(),this.getTypeList(),this.getShowColumns(),this.initialize()},methods:{viewDetail:function(t){var e=t.queryId;this.$router.push({path:"/outsourcing/outsourcing_inStock_add",query:{id:e,t:Date.now()}})},initialize:function(){},getSummaries:function(t){var e=this,a=t.columns,s=t.data,i=[];return a.forEach(function(t,a){if(0!==a)if("subCount"===t.property||"count"==t.property||"taxAmount"==t.property||"amount"==t.property||"taxes"==t.property){var o=s.map(function(e){return Number(e[t.property])});o.every(function(t){return isNaN(t)})?i[a]="":i[a]=o.reduce(function(t,e){var a=Number(e);return isNaN(a)?t:t+e},0),"count"!=t.property?"subCount"!==t.property?"taxAmount"!=t.property?"amount"!=t.property?"taxes"!=t.property||i[a]&&(i[a]=e.totalAll.totalTaxes):i[a]&&(i[a]=e.totalAll.totalAmount):i[a]&&(i[a]=e.totalAll.totalTaxAmount):i[a]&&(i[a]=e.totalAll.totalSubCount):i[a]&&(i[a]=e.totalAll.totalCount)}else i[a]="";else i[a]="合计"}),i},setDeptList:function(t){var e=!0,a=!1,s=void 0;try{for(var i,o=l()(t);!(e=(i=o.next()).done);e=!0){var r=i.value;r.hasChildren?this.setDeptList(r.children):r.children=void 0}}catch(t){a=!0,s=t}finally{try{!e&&o.return&&o.return()}finally{if(a)throw s}}},handleChange:function(t){this.formData.deptId=t.length>=1?t[t.length-1]:"",this.selectDeptId=t},showUser:function(t){this.user_type=t,this.chooseUserVisible=!0},getUser:function(t){1==this.user_type?t?(this.$set(this.search_data,"applicantName",t.name),this.$set(this.search_data,"applicant",t.id)):(this.$set(this.search_data,"applicantName",""),this.$set(this.search_data,"applicant","")):2==this.user_type?t?(this.$set(this.formData,"applicantName",t.name),this.$set(this.formData,"applicant",t.id)):(this.$set(this.formData,"applicantName",""),this.$set(this.formData,"applicant","")):3==this.user_type&&(t?(this.$set(this.formData,"createByName",t.name),this.$set(this.formData,"createBy",t.id)):(this.$set(this.formData,"createByName",""),this.$set(this.formData,"createBy","")))},getSupplier:function(t){t?(this.$set(this.formData,"supplierId",t.id),this.$set(this.formData,"supplierName",t.name)):(this.$set(this.formData,"supplierId",""),this.$set(this.formData,"supplierName",""))},getMateriel:function(t){t?(this.$set(this.formData,"materiel",t.id),this.$set(this.formData,"materielName",t.name)):(this.$set(this.formData,"materiel",""),this.$set(this.formData,"materielName",""))},changeApplicantName:function(){this.search_data.applicant=""},settime:function(t){return 1==t.toString().length?"0"+t.toString():t},clickRow:function(t){this.$router.push({path:"/outsourcing/outsourcing_processingCharge_add",query:{id:t.id,t:Date.now()}})},audit:function(t){var e=this,a=this.rowIds[0].id;0==t?this.$confirm("确认审核选中的项吗?","提示",{type:"warning"}).then(function(){e.$api.outsourcingAPI.processingChargeAudit({id:a}).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"})})}):1==t&&this.$confirm("确认反审核选中的项吗?","提示",{type:"warning"}).then(function(){e.$api.outsourcingAPI.processingChargeReverseAudit({id:a}).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"})})})},showColumnSetDialog:function(){this.columnSetDialogVisible=!0,this.showTableColumnsTemp=JSON.parse(h()(this.showTableColumns))},toUp:function(t){if(0==t.$index)return!1;for(var e=void 0,a=0;a<this.showTableColumns.length;a++)this.showTableColumns[a].prop_==t.row.prop_&&(e=a);var s=this.showTableColumns[e];this.showTableColumns[e]=this.showTableColumns[e-1],this.showTableColumns[e-1]=s,this.$forceUpdate()},toDown:function(t){if(t.$index==this.showTableColumns.length-1)return!1;for(var e=void 0,a=0;a<this.showTableColumns.length;a++)this.showTableColumns[a].prop_==t.row.prop_&&(e=a);var s=this.showTableColumns[e];this.showTableColumns[e]=this.showTableColumns[e+1],this.showTableColumns[e+1]=s,this.$forceUpdate()},toDefault:function(){this.showTableColumns=JSON.parse(h()(this.showTableColumnsDefault)),this.$forceUpdate()},saveAndCloseColumnSetDialog:function(){var t=this,e=this.tableId,a=h()(this.showTableColumns);this.columnSetDialogVisible=!1,this.$api.tableColumnAPI.saveShowColumns({tableNo:e,tableColumns:a}).then(function(e){var a=JSON.parse(h()(t.showTableColumns));t.formTableData=[];for(var s=0;s<a.length;s++)a[s].select&&t.formTableData.push(a[s])}).catch(function(t){console.log(t)})},handleClose:function(){this.showTableColumns=JSON.parse(h()(this.showTableColumnsTemp)),this.columnSetDialogVisible=!1},getTypeList:function(){var t=this;r.a.all([this.$api.gylCommonAPI.getUsers(),this.$api.gylCommonAPI.getDictsByType({type:"audit_status"}),this.$api.gylInventoryAPI.getDepts()]).then(function(e){var a=i()(e,3),s=a[0],o=a[1],r=a[2];0===s.code&&(t.createByList=s.datas),0===o.code&&(t.auditSignList=o.datas),0===r.code&&(t.companyList=r.datas)}).catch(function(t){console.log(t)})},getList:function(){var t=this;this.pictLoading=!0,this.$api.outsourcingAPI.processingChargeList(this.search_data).then(function(e){t.pictLoading=!1,e.data?(t.total=e.data.totalRows,t.totalAll=e.total,t.tableData=e.data.datas?e.data.datas:[],t.tableData.forEach(function(t){t.invoiceDate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(t.invoiceDate)[0]})):(t.total=0,t.tableData=[])}).catch(function(t){console.log(t)})},getShowColumns:function(){var t=this,e=this.tableId;this.formTableData=[],this.$api.tableColumnAPI.getShowColumns({tableNo:e}).then(function(e){if(0==e.code)if(e.results){t.showTableColumns=JSON.parse(e.results);for(var a=JSON.parse(h()(t.showTableColumns)),s=0;s<a.length;s++)a[s].select&&t.formTableData.push(a[s]);t.$forceUpdate()}else{for(var i=JSON.parse(h()(t.showTableColumnsDefault)),o=0;o<i.length;o++)i[o].select&&t.formTableData.push(i[o]);t.$forceUpdate()}else t.$message({message:e.msg?e.msg:"获取列表信息失败",type:"error"})}).catch(function(e){t.$message({message:e,type:"error"}),console.log(e)})},search:function(){this.search_data.auditSign="",this.search_data.sourceCompanyId="",this.search_data.createBy="",this.search_data.createTime="",this.search_data.proBatch="",this.search_data.productName="",this.search_data.operator="",this.search_data.proType="",this.search_data.pageno=1,this.search_data.pagesize=10,this.getList()},moreSearch:function(){this.advanceQueryDialogVisible=!0,this.$set(this.formData,"applicant",this.search_data.applicant?this.search_data.applicant:""),this.$set(this.formData,"applicantName",this.search_data.applicantName?this.search_data.applicantName:""),this.formDataTime=this.time,this.dialogTitle="高级查询"},save:function(){for(var t in this.formData)this.search_data[t]=this.formData[t];this.search_data.inDatas="",this.time=this.formDataTime,this.search_data.pageno=1,this.$nextTick(function(){this.advanceQueryDialogVisible=!1,this.getList()})},clear:function(){for(var t in this.formData)this.formData[t]="";this.$forceUpdate(),this.formDataTime="",this.search_data.createTime=""},changeFacility:function(){this.$forceUpdate()},handleCurrentChange:function(t){this.search_data.pageno=t,this.getList()},handleSizeChange:function(t){this.search_data.pagesize=t,this.getList()},handleSelectionChange:function(t){this.rowIds=t,this.setBtn(t)},add:function(){this.$router.push({path:"/outsourcing/outsourcing_processingCharge_add",query:{t:Date.now()}})},remove:function(){var t=this,e=[];this.rowIds.forEach(function(t){e.indexOf(t.id)<0&&e.push(t.id)}),this.$confirm("确认删除选中的项吗?","提示",{type:"warning"}).then(function(){t.$api.outsourcingAPI.processingChargeBatchRemove({ids:e}).then(function(e){0===e.code?(t.$message({message:e.msg,type:"success"}),t.search()):t.$message({message:e.msg?e.msg:"删除失败,请重试",type:"error"})}).catch(function(e){t.$message({message:"删除失败,请重试",type:"error"})})})},setBtn:function(t){var e=!1;t.forEach(function(t){11==t.auditSign&&(e=!0)});var a=!0,s=!0;t.length>0?(s=!1,1==t.length&&(a=!1)):(a=!0,s=!0),this.btnDelDisabled=s,this.btnOtherDisabled=a||e},exportExcel:function(){delete this.search_data.pagesize,delete this.search_data.pageno,this.$api.outsourcingAPI.exportExcelprocessingCharge(this.search_data).then(function(t){})}},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="")},formDataTime:function(t){t?(this.formData.startTime=t[0],this.formData.endTime=t[1]):(this.formData.startTime="",this.formData.endTime="")}}},C={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"sys-box knowledge-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{directives:[{name:"has",rawName:"v-has",value:"outsourcing:outsourcing_processingCharge:add",expression:"'outsourcing:outsourcing_processingCharge:add'"}],attrs:{type:"primary"},on:{click:function(e){return t.add()}}},[t._v("新增")]),t._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"outsourcing:outsourcing_processingCharge:remove",expression:"'outsourcing:outsourcing_processingCharge:remove'"}],attrs:{type:"primary",disabled:t.btnDelDisabled},on:{click:function(e){return t.remove()}}},[t._v("删除")]),t._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"outsourcing:outsourcing_processingCharge:exportExcel",expression:"'outsourcing:outsourcing_processingCharge:exportExcel'"}],attrs:{type:"primary"},on:{click:function(e){return t.exportExcel()}}},[t._v("导出")]),t._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"outsourcing:outsourcing_processingCharge:audit",expression:"'outsourcing:outsourcing_processingCharge:audit'"}],attrs:{type:"primary",disabled:t.btnOtherDisabled},on:{click:function(e){return t.audit(0)}}},[t._v("审核")]),t._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"outsourcing:outsourcing_processingCharge:reverseAudit",expression:"'outsourcing:outsourcing_processingCharge:reverseAudit'"}],attrs:{type:"primary",disabled:t.btnOtherDisabled},on:{click:function(e){return t.audit(1)}}},[t._v("反审核")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.showColumnSetDialog}},[t._v(t._s(t.config.configureBtnName))])],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:"22%"},attrs:{label:"单据编号"}},[a("el-input",{attrs:{placeholder:"单据编号",clearable:""},model:{value:t.search_data.billCode,callback:function(e){t.$set(t.search_data,"billCode",e)},expression:"search_data.billCode"}})],1),t._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"22%"},attrs:{label:"供应商"}},[a("el-input",{attrs:{placeholder:"模糊查询",clearable:""},model:{value:t.search_data.supplierName,callback:function(e){t.$set(t.search_data,"supplierName",e)},expression:"search_data.supplierName"}})],1),t._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"22%"},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:"34%"},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:t.time,callback:function(e){t.time=e},expression:"time"}})],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"},[t.formTableData.length>0?a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.pictLoading,expression:"pictLoading"}],ref:"tb",attrs:{id:"out-table",border:"","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:{type:"selection",width:"55",align:"center"}}),t._v(" "),t._l(t.formTableData,function(e,s){return a("el-table-column",{key:s,attrs:{prop:e.prop_,label:e.title,align:"center","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(s){return[a("div",["sourceCode"==e.prop_?a("div",[a("el-link",{attrs:{type:"primary"},on:{click:function(e){return e.stopPropagation(),t.viewDetail(s.row)}}},[t._v(t._s(s.row.sourceCode))])],1):"billCode"==e.prop_?a("div",[a("el-link",{attrs:{type:"primary"},on:{click:function(e){return e.stopPropagation(),t.clickRow(s.row)}}},[t._v(t._s(s.row.billCode))])],1):a("div",[a("div",{staticStyle:{overflow:"hidden"}},[t._v(t._s(s.row[e.prop_]))])])])]}}],null,!0)})})],2):t._e()],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),t._v(" "),a("el-dialog",{attrs:{title:t.columnSetDialogTitle,center:"",visible:t.columnSetDialogVisible,width:"531px","before-close":t.handleClose},on:{"update:visible":function(e){t.columnSetDialogVisible=e}}},[a("el-table",{key:Math.random(),staticStyle:{width:"100%"},attrs:{border:"",data:t.showTableColumns,"max-height":"350"}},[a("el-table-column",{attrs:{prop:"title",label:"列表名称",width:"180",fixed:""}}),t._v(" "),a("el-table-column",{attrs:{prop:"select",label:"是否显示",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{model:{value:e.row.select,callback:function(a){t.$set(e.row,"select",a)},expression:"scope.row.select"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.toUp(e)}}},[t._v("前移")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.toDown(e)}}},[t._v("后移")])]}}])})],1),t._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:t.saveAndCloseColumnSetDialog}},[t._v("完成")])],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-button",{attrs:{type:"primary",size:"middle"},on:{click:t.toDefault}},[t._v("恢复默认")])],1)],1)],1),t._v(" "),a("dialogChooseSingleUser",{attrs:{visible:t.chooseUserVisible},on:{"update:visible":function(e){t.chooseUserVisible=e},change:t.getUser}}),t._v(" "),a("dialogChooseSingleSupplier",{attrs:{visible:t.chooseSupplierVisible},on:{"update:visible":function(e){t.chooseSupplierVisible=e},change:t.getSupplier}}),t._v(" "),a("dialogChooseSingleParts",{attrs:{visible:t.chooseMaterielVisible},on:{"update:visible":function(e){t.chooseMaterielVisible=e},change:t.getMateriel}})],1)},staticRenderFns:[]};var D=a("VU/8")(y,C,!1,function(t){a("JufY")},"data-v-6b2b19c3",null);e.default=D.exports}}); |