(window.webpackJsonp=window.webpackJsonp||[]).push([["EgTa"],{EgTa:function(e,t,i){"use strict";i.r(t);var a=i("QbLZ"),s=i.n(a),l=i("L2JU"),r={data:function(){return{routineCheckType:[],dialogFormVisible:!1,title:"",equipmentValue:"",equipmentName:"",opName:"",process:[],form:{"不合格原因":""},rules:{"不合格原因":[{required:!0,message:"不合格原因"}]},original:"",total:0,tableData:[],pageCurrent:1,pageSize:20}},computed:s()({},Object(l.b)(["id","token"])),created:function(){this.searchTable()},methods:{searchTable:function(){var e=this,t=this.CreateData("11","基础数据_不合格原因_查询",[]);this.ExecDatabase(t).then(function(t){e.tableData=t.data})},ADD:function(){this.title="新增",void 0!==this.$refs.form&&this.$refs.form.resetFields(),this.form.不合格原因="",this.dialogFormVisible=!0},handleEdit:function(e){this.title="编辑",void 0!==this.$refs.form&&this.$refs.form.resetFields(),this.equipmentValue=e.不合格原因,this.form.不合格原因=e.不合格原因文本,this.dialogFormVisible=!0},callOff:function(e){this.dialogFormVisible=!1,this.$refs[e].resetFields()},submitAdd:function(e){var t=this;this.$refs[e].validate(function(e){if(e){var i=[];i[0]=["不合格原因",t.form.不合格原因];var a=t.CreateData("12","基础数据_不合格原因_增加",i);t.ExecDatabase(a).then(function(e){"1"===e.data[0].result?(t.$message.success("添加成功"),t.searchTable(),t.dialogFormVisible=!1):t.$message.error("添加失败")})}})},submitEdit:function(e){var t=this;this.$refs[e].validate(function(e){if(e){var i=[];i[0]=["id",t.equipmentValue],i[1]=["不合格原因",t.form.不合格原因];var a=t.CreateData("12","基础数据_不合格原因_修改",i);t.ExecDatabase(a).then(function(e){"1"===e.data[0].result?(t.$message.success("编辑成功"),t.searchTable(),t.dialogFormVisible=!1):t.$message.error("编辑失败")})}})},handleDelete:function(e){var t=this;this.$confirm("是否删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var i=[];i[0]=["id",e.不合格原因];var a=t.CreateData("12","基础数据_不合格原因_删除",i);t.ExecDatabase(a).then(function(e){"1"===e.data[0].result?(t.$message.success("删除成功"),t.pageCurrent=1,t.searchTable()):t.$message.error("删除失败")})}).catch(function(){t.$message({type:"info",message:"已取消删除"})})},handleSizeChanges:function(e){this.pageCurrent=1,this.pageSize=e,this.searchTable()},handleCurrentChanges:function(e){this.pageCurrent=e,this.searchTable()}}},n=i("KHd+"),o=Object(n.a)(r,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("el-card",{staticStyle:{height:"850px"}},[i("el-table",{staticStyle:{width:"450px"},attrs:{data:e.tableData,border:"",size:"small",stripe:"","highlight-current-row":"","max-height":"740px"}},[i("el-table-column",{attrs:{type:"index",align:"center",label:"序号",width:"70px"}}),e._v(" "),i("el-table-column",{attrs:{label:"不合格原因",align:"center",width:"250px"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n          "+e._s(t.row.不合格原因文本)+"\n        ")]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{staticStyle:{"margin-right":"10px"},attrs:{type:"text",size:"mini",icon:"el-icon-edit"},on:{click:function(i){e.handleEdit(t.row)}}}),e._v(" "),i("el-button",{attrs:{type:"text",size:"mini",icon:"el-icon-delete"},on:{click:function(i){e.handleDelete(t.row)}}})]}}])})],1),e._v(" "),i("el-tooltip",{attrs:{effect:"dark",content:"添加新设备",placement:"top"}},[i("el-button",{attrs:{type:"primary",icon:"el-icon-circle-plus-outline",size:"small"},on:{click:function(t){e.ADD()}}})],1)],1),e._v(" "),i("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],staticStyle:{"min-height":"300px"},attrs:{title:e.title,visible:e.dialogFormVisible,center:"",width:"500px"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[i("el-form",{ref:"form",staticClass:"demo-ruleForm",attrs:{model:e.form,rules:e.rules,"label-position":"right","label-width":"110px"}},[i("el-row",[i("el-form-item",{attrs:{label:"不合格原因",prop:"不合格原因"}},[i("el-input",{staticStyle:{width:"300px"},attrs:{type:"textarea",placeholder:"不合格原因",size:"small",clearable:""},model:{value:e.form.不合格原因,callback:function(t){e.$set(e.form,"不合格原因",t)},expression:"form.不合格原因"}})],1)],1)],1),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.callOff("form")}}},[e._v("取消")]),e._v(" "),i("el-button",{directives:[{name:"show",rawName:"v-show",value:"新增"===e.title,expression:"title==='新增'"}],attrs:{type:"primary"},on:{click:function(t){e.submitAdd("form")}}},[e._v("确定")]),e._v(" "),i("el-button",{directives:[{name:"show",rawName:"v-show",value:"编辑"===e.title,expression:"title==='编辑'"}],attrs:{type:"primary"},on:{click:function(t){e.submitEdit("form")}}},[e._v("确定")])],1)],1)],1)},[],!1,null,null,null);o.options.__file="index.vue";t.default=o.exports}}]);