yxk_pc_mdh/gyhl/static/js/88.d69cafe61e578e06bcc4.js

1 line
17 KiB
JavaScript

webpackJsonp([88],{JzZO:function(e,t){},Lxnx:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i("Dd8w"),a=i.n(s),n=i("ysqt"),r=i("d7EF"),o=i.n(r),l=i("//Fk"),c=i.n(l),d=i("mvHQ"),u=i.n(d),h=i("BO1k"),m=i.n(h),f={name:"dialogChooseDevices",props:{id:{type:String,default:""},isPatrolProject:"",visible:{type:Boolean,default:!1}},watch:{visible:function(e,t){e!==t&&(e&&this.initData(),this.innerVisible=e)},innerVisible:function(e,t){e!==t&&this.$emit("update:visible",e)}},data:function(){return{depOptions:[],selectDeptId:[],subsetList:[],subsetList1:[],subsetAll:[],subsetAll1:[],subsetTotal:0,searchData_Subset:{pageno:1,pagesize:1e4,canUsed:0},search_data:{pageno:1,pagesize:1e4},callBackData:[],innerVisible:this.visible,dialogLoading1:!1,loading:!1,dialogLoading:!1,deviceType:[],deviceDept:[],addVisible:!1}},computed:{},mounted:function(){},methods:{treeFindPath:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e)return[];var s=!0,a=!1,n=void 0;try{for(var r,o=m()(e);!(s=(r=o.next()).done);s=!0){var l=r.value;if(i.push(l.id),t(l))return i;if(l.children){var c=this.treeFindPath(l.children,t,i);if(c.length)return c}i.pop()}}catch(e){a=!0,n=e}finally{try{!s&&o.return&&o.return()}finally{if(a)throw n}}return[]},setDeptList:function(e){var t=!0,i=!1,s=void 0;try{for(var a,n=m()(e);!(t=(a=n.next()).done);t=!0){var r=a.value;r.hasChildren?this.setDeptList(r.children):r.children=void 0}}catch(e){i=!0,s=e}finally{try{!t&&n.return&&n.return()}finally{if(i)throw s}}},setDefaultDept:function(){if(this.depOptions.length>0&&this.searchData_Subset.deptId){var e=u()(this.searchData_Subset.deptId),t=this.treeFindPath(this.depOptions,function(t){return t.id===e});this.selectDeptId=JSON.parse(u()(t))}},handleChange:function(e){this.searchData_Subset.deptId=e.length>=1?e[e.length-1]:"",this.selectDeptId=e},clickRow:function(e){this.$refs.tb.toggleRowSelection(e)},clickRow1:function(e){this.$refs.tb1.toggleRowSelection(e)},getList:function(){var e=this;this.dialogLoading1=!0,this.$api.shiftAPI.shiftOfLists(this.search_data).then(function(t){e.dialogLoading1=!1,console.log(t.data),t.data?e.subsetList1=t.data.datas?t.data.datas:[]:e.subsetList1=[]})},initData:function(){var e=this;c.a.all([this.$api.commonAPI.getDeptsTree()]).then(function(t){var i=o()(t,1)[0];0===i.code&&(e.depOptions=i.data.children,e.setDefaultDept(),e.setDeptList(e.depOptions))}).catch(function(e){console.log(e)}),this.searchSubset(),this.getList()},searchSubset:function(e){var t=this;e&&(this.searchData_Subset.pageno=1),console.log(this.isPatrolProject),this.isPatrolProject&&(this.searchData_Subset.isPatrolProject=this.isPatrolProject),this.dialogLoading=!0,this.$api.deviceAPI.list(this.searchData_Subset).then(function(e){t.dialogLoading=!1,0===e.code&&(t.subsetList=e.data?e.data.datas:[],t.subsetTotal=e.data?e.data.totalRows:0)})},ckSubsetAll:function(e){this.subsetAll=e},ckSubsetAll1:function(e){this.subsetAll1=e},subsetSizeChange:function(e){this.searchData_Subset.pagesize=e,this.searchSubset()},subsetCurrentChange:function(e){this.searchData_Subset.pageno=e,this.searchSubset()},submit:function(e){var t=[],i=[];if(0!=this.subsetAll.length&&0!=this.subsetAll1.length){this.subsetAll.length>0&&this.subsetAll.forEach(function(e){t.push(e)}),this.subsetAll1.length>0&&this.subsetAll1.forEach(function(e){i.push(e)});var s={deviceArr:t,crewArr:i};this.$emit("change",s),this.innerVisible=!1}else this.$message({message:"设备和班制都必须至少有一个",type:"warning"})},resetFields:function(){this.$refs.form&&this.$refs.form.resetFields()}}},v={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{directives:[{name:"dialogDrag",rawName:"v-dialogDrag"}],attrs:{center:"",title:"选择设备与对应班制",visible:e.innerVisible,width:"900px"},on:{"update:visible":function(t){e.innerVisible=t}}},[i("div",[i("el-form",{attrs:{inline:""}},[i("el-form-item",{attrs:{label:"设备名称"}},[i("el-input",{attrs:{placeholder:"编号名称模糊查询"},model:{value:e.searchData_Subset.name,callback:function(t){e.$set(e.searchData_Subset,"name",t)},expression:"searchData_Subset.name"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"使用部门"}},[i("el-cascader",{attrs:{clearable:"",options:e.depOptions,props:{expandTrigger:"hover",label:"text",value:"id",checkStrictly:!0}},on:{change:e.handleChange},model:{value:e.selectDeptId,callback:function(t){e.selectDeptId=t},expression:"selectDeptId"}})],1),e._v(" "),i("el-form-item",[i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.searchSubset(1)}}},[e._v("查询")])],1)],1)],1),e._v(" "),i("div",[i("div",{staticClass:"sys-table",staticStyle:{width:"500px"}},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.dialogLoading,expression:"dialogLoading"}],ref:"tb",attrs:{height:"250",data:e.subsetList,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"row-click":e.clickRow,"selection-change":e.ckSubsetAll}},[i("el-table-column",{attrs:{type:"selection",width:"50",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{prop:"serialno",label:"设备编号",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{prop:"name","show-overflow-tooltip":"",label:"设备名称",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{prop:"deptName",label:"使用部门",align:"center"}})],1)],1),e._v(" "),i("div",{staticClass:"sys-table ownStyle"},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.dialogLoading1,expression:"dialogLoading1"}],ref:"tb1",attrs:{height:"250",data:e.subsetList1,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"row-click":e.clickRow1,"selection-change":e.ckSubsetAll1}},[i("el-table-column",{attrs:{type:"selection",width:"50",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{prop:"name",label:"选择使用的班制",align:"center"}})],1)],1)]),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary",loading:e.loading},on:{click:function(t){return e.submit()}}},[e._v("确定")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){e.innerVisible=!1}}},[e._v("关闭")])],1)])},staticRenderFns:[]};var p=i("VU/8")(f,v,!1,function(e){i("nnEU")},"data-v-fbf34258",null).exports,b=i("GKmE"),g=i("G9gL"),D=i("NYxO"),y=i("bzuE"),w=i("lbHh"),I=i.n(w),_={inject:["reload"],components:{btnInput:n.a,ChooseDevices:g.a,ChooseDevicesAndCrew:p},data:function(){return{start_datetime:{disabledDate:function(e){return e.getTime()<Date.now()}},end_datetime:{disabledDate:function(e){return e.getTime()<Date.now()}},formData:{},config:y.a,typeList1:[],accountNumberList:[],businessTypeList:[],btnDisabled:!0,itemIds:[],consumingStockId:"",availableCount:0,totalCount:0,shiftList:[],chooseDevicesVisible:!1,btnOtherDisabled:!0,btnDelDisabled:!1,ChooseStockVisible:!1,chooseContractVisible:!1,chooseDevicesVisibleAndCrew:!1,chooseUserVisible:!1,loading:!1,isDisabled:!1,materielId:"",currentIndex:"",timeBtn:!1,options:[{value:1,label:"启用"},{value:0,label:"停用"}],value:"",ruleForm:{name:[{required:!0,message:"请输入排班计划名称",trigger:"change"}],startTime:[{required:!0,message:"请选择开始执行日期",trigger:"change"}],endTime:[{required:!0,message:"请选择结束执行日期",trigger:"change"}]},model:{childList:[]}}},mounted:function(){this.initData(),this.$route.query.id&&(this.formData.id=this.$route.query.id,this.getDetail()),this.userInfo=JSON.parse(I.a.get("userInfo")),this.$set(this.formData,"createByName",this.userInfo.name),this.$set(this.formData,"createTime",Object(b.c)())},watch:{consumingStockId:{handler:function(e,t){this.btnDelDisabled=""!=e&&void 0!=e}},model:{handler:function(e){e.childList.length>0?this.btnDisabled=!1:this.btnDisabled=!0},deep:!0}},methods:a()({},Object(D.d)({removeTagNav:"tagNav/removeTagNav"}),{settime:function(e){return 1==e.toString().length?"0"+e.toString():e},getDeviceAndDrew:function(e){var t=this;console.log(e);var i=[];e.crewArr.forEach(function(e){i.push(e.id)});var s=[];this.model.childList.forEach(function(e){s.push(e.deviceId)});e.deviceArr.forEach(function(e){0==s.indexOf(e.id)?t.$message({message:e.name+"已经选择,请勿重复选择",type:"warning"}):(t.$set(e,"deviceName",e.name),t.$set(e,"deviceId",e.id),t.$set(e,"shiftIds",i),t.$set(e,"isUse",1),t.$set(e,"onlyId",e.id+"_"+Date.now()),delete e.id,t.model.childList.push(e))})},initData:function(){var e=this;this.$api.shiftAPI.shiftOfLists(this.search_data1).then(function(t){t.data?e.shiftList=t.data.datas?t.data.datas:[]:e.shiftList=[]})},getDevice:function(e){console.log(e),e?(this.$set(this.model.childList[this.currentIndex],"deviceId",e.id),this.$set(this.model.childList[this.currentIndex],"deviceName",e.name)):(this.$set(this.model.childList[this.currentIndex],"deviceId",""),this.$set(this.model.childList[this.currentIndex],"deviceName",""))},sum1:function(e,t,i){var s=e-t;return s=s.toFixed(y.a.amountFixedTo),this.$set(this.model.childList[i],"noReceiptPaymentAmount",s),s},getDetail:function(){var e=this,t=this;this.loading=!0,this.$nextTick().then(function(){e.$api.crewAPI.detail(e.formData.id).then(function(i){e.loading=!1,t.formData=i.headInfo,new Date(/\d{4}-\d{1,2}-\d{1,2}/g.exec(t.formData.startTime)[0]).getTime()<=new Date(/\d{4}-\d{1,2}-\d{1,2}/g.exec(Object(b.c)())[0]).getTime()&&(e.timeBtn=!0),t.model.childList=i.itemInfo,t.model.childList.forEach(function(t){t.newId=t.id?t.id:"",e.$set(t,"onlyId",Math.random())})})})},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/basic/crew",query:{t:Date.now()}})},save:function(e){var t=this;this.$refs.formChild.validate(function(e,t){e}),this.$refs[e].validate(function(e){if(e){if(0==t.model.childList.length)return void t.$message({message:"请添加排班计划明细",type:"warning"});if(t.formData.id){var i=[];if(t.model.childList.forEach(function(e){console.log(e);var t={id:e.id,deviceId:e.deviceId,isUse:e.isUse,shiftIds:e.shiftIds.toString()};i.push(t)}),t.isDisabled)return;t.isDisabled=!0,t.$api.crewAPI.save({crewSchedulingDO:{id:t.formData.id,name:t.formData.name,startTime:t.formData.startTime,endTime:t.formData.endTime,remarks:t.formData.remarks?t.formData.remarks:""},crewSchedulingItemDOS:i,crewIds:t.itemIds}).then(function(e){t.isDisabled=!1,0===e.code?t.$message({message:e.msg,type:"success"}):t.$message({message:e.msg,type:"error"})})}else{var s=[];if(t.model.childList.forEach(function(e){console.log(e);var t={deviceId:e.deviceId,isUse:e.isUse,shiftIds:e.shiftIds.toString()};s.push(t)}),t.isDisabled)return;t.isDisabled=!0,t.$api.crewAPI.save({crewSchedulingDO:{name:t.formData.name,startTime:t.formData.startTime,endTime:t.formData.endTime,remarks:t.formData.remarks?t.formData.remarks:""},crewSchedulingItemDOS:s}).then(function(e){t.isDisabled=!1,0===e.code?(t.$message({message:e.msg,type:"success"}),t.back()):t.$message({message:e.msg,type:"error"})})}}})},removeLines:function(){var e=this;if(this.chooseParts){var t=[];this.chooseParts.forEach(function(i){t.push(i.id);var s=e.model.childList.findIndex(function(e){if(e.onlyId==i.onlyId&&e.id==i.id)return!0});e.model.childList.splice(s,1),e.itemIds=t})}},handlePartChange:function(e){this.chooseParts=e,console.log(this.chooseParts),this.setBtn(e)},setBtn:function(e){var t=!0,i=!0;e.length>0?(i=!1,1==e.length&&(t=!1)):(t=!0,i=!0),this.btnDelDisabled=i,this.btnOtherDisabled=t}})},k={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"sys-box plan-box"},[i("div",{staticClass:"sys-operate"},[i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.back()}}},[e._v(e._s(e.config.cancelText))]),e._v(" "),i("el-button",{directives:[{name:"has",rawName:"v-has",value:"basic:crew:edit",expression:"'basic:crew:edit'"}],attrs:{type:"primary",disabled:e.isDisabled},on:{click:function(t){return e.save("form")}}},[e._v("保存")])],1),e._v(" "),i("div",{staticClass:"sys-form"},[i("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"form",attrs:{"label-width":"120px","inline-message":!0,model:e.formData,rules:e.ruleForm}},[i("div",{staticClass:"flex"},[i("el-form-item",{staticClass:"form-inline",attrs:{label:"排班计划名称",prop:"name"}},[i("el-input",{attrs:{placeholder:"请输入排班计划名称",disabled:e.timeBtn},model:{value:e.formData.name,callback:function(t){e.$set(e.formData,"name",t)},expression:"formData.name"}})],1),e._v(" "),i("el-form-item",{staticClass:"form-inline",attrs:{label:"开始执行日期",prop:"startTime"}},[i("el-date-picker",{staticStyle:{width:"100%"},attrs:{"picker-options":e.start_datetime,disabled:e.timeBtn,type:"date",placeholder:"选择开始执行日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.formData.startTime,callback:function(t){e.$set(e.formData,"startTime",t)},expression:"formData.startTime"}})],1),e._v(" "),i("el-form-item",{staticClass:"form-inline",attrs:{label:"结束执行日期",prop:"endTime"}},[i("el-date-picker",{staticStyle:{width:"100%"},attrs:{"picker-options":e.end_datetime,disabled:e.timeBtn,type:"date",placeholder:"选择结束执行日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.formData.endTime,callback:function(t){e.$set(e.formData,"endTime",t)},expression:"formData.endTime"}})],1)],1)]),e._v(" "),i("el-divider",{attrs:{"content-position":"left"}},[i("div")]),e._v(" "),i("el-form",{ref:"formChild",attrs:{rules:e.model.rules,model:e.model}},[i("el-form-item",{staticClass:"childlist",attrs:{prop:"childList"}},[i("div",{staticClass:"sys-operate",staticStyle:{"margin-bottom":"10px"}},[i("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){e.chooseDevicesVisibleAndCrew=!0}}},[e._v("新增")]),e._v(" "),i("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.removeLines}},[e._v("删除")])],1),e._v(" "),i("el-table",{attrs:{data:e.model.childList,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"},border:""},on:{"selection-change":e.handlePartChange}},[i("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{prop:"deviceName",align:"center",label:"设备名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("btn-input",{attrs:{valueText:t.row.deviceName,valueId:t.row.deviceId,chooseVisible:e.chooseDevicesVisible,currentIndex:e.currentIndex,index:t.$index,showBtn:!e.timeBtn},on:{"update:valueText":function(i){return e.$set(t.row,"deviceName",i)},"update:value-text":function(i){return e.$set(t.row,"deviceName",i)},"update:valueId":function(i){return e.$set(t.row,"deviceId",i)},"update:value-id":function(i){return e.$set(t.row,"deviceId",i)},"update:chooseVisible":function(t){e.chooseDevicesVisible=t},"update:choose-visible":function(t){e.chooseDevicesVisible=t},"update:currentIndex":function(t){e.currentIndex=t},"update:current-index":function(t){e.currentIndex=t}}})]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"shiftIds",align:"center",label:"班次名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",multiple:"",disabled:e.timeBtn,placeholder:"请选择"},model:{value:t.row.shiftIds,callback:function(i){e.$set(t.row,"shiftIds",i)},expression:"scope.row.shiftIds"}},e._l(e.shiftList,function(e){return i("el-option",{key:e.value,attrs:{label:e.name,value:e.id}})}),1)]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"isUse",align:"center",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择",clearable:"",size:"small"},model:{value:t.row.isUse,callback:function(i){e.$set(t.row,"isUse",i)},expression:"scope.row.isUse"}},e._l(e.options,function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)]}}])})],1),e._v(" "),i("el-form-item",{attrs:{label:"备注说明",prop:"remarks"}},[i("el-input",{attrs:{disabled:e.timeBtn,type:"textarea",autosize:{minRows:4},placeholder:"请简要填写备注内容"},model:{value:e.formData.remarks,callback:function(t){e.$set(e.formData,"remarks",t)},expression:"formData.remarks"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:10}},[e._v("制单人:"+e._s(e.formData.createByName))]),e._v(" "),i("el-col",{attrs:{span:14}},[e._v("制单时间:"+e._s(e.formData.createTime))])],1)],1),e._v(" "),i("ChooseDevices",{attrs:{visible:e.chooseDevicesVisible},on:{"update:visible":function(t){e.chooseDevicesVisible=t},change:e.getDevice}}),e._v(" "),i("ChooseDevicesAndCrew",{attrs:{visible:e.chooseDevicesVisibleAndCrew},on:{"update:visible":function(t){e.chooseDevicesVisibleAndCrew=t},change:e.getDeviceAndDrew}})],1)},staticRenderFns:[]};var x=i("VU/8")(_,k,!1,function(e){i("JzZO"),i("pgsd")},"data-v-6877e296",null);t.default=x.exports},nnEU:function(e,t){},pgsd:function(e,t){}});