7868.86361d2f.js 6.9 KB

1
  1. "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[7868],{59462:function(t,e,s){s.d(e,{Z:function(){return c}});var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"inline-16"},[s("el-popconfirm",{attrs:{title:"确定删除此附件资料吗?"},on:{confirm:function(e){return t.deleteRow()}}},[s("el-button",{attrs:{slot:"reference",size:"small",type:"text"},slot:"reference"},[t._v("删 除")])],1)],1)},i=[],l={name:"fileDel",props:["data"],methods:{async deleteRow(){console.log(this.data.linksid);const t=await this.$api.requested({classname:"system.attachment.Attachment",method:"deleteFileLink",content:{linksids:[this.data.linksid]}});console.log(t),this.$emit("deleteSuccess")}}},n=l,o=s(43736),r=(0,o.Z)(n,a,i,!1,null,"3feebce1",null),c=r.exports},58102:function(t,e,s){s.d(e,{Z:function(){return c}});var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("tableLayout",{attrs:{layout:t.tablecols,data:t.list,opwidth:200,custom:!0,height:t.tableHieght},scopedSlots:t._u([{key:"customcol",fn:function(e){return[s("p",[t._v(t._s(e.column.data[e.column.columnname]))])]}},{key:"opreation",fn:function(e){return[s("div",[t._t("del",null,{data:e.data})],2)]}}],null,!0)})],1)},i=[],l={name:"fileTable",props:["id"],data(){return{tableHieght:220,tablecols:[],list:[]}},mounted(){this.listData()},methods:{async listData(){const t=await this.$api.requested({classname:"system.attachment.Attachment",method:"queryFileLink",content:{ownertable:"plm_technicalinfo",ownerid:this.id,usetype:"default"}});this.list=t.data,console.log(this.list)}},created(){this.tablecols=this.tool.tabelCol(this.$route.name).fileTable.tablecols}},n=l,o=s(43736),r=(0,o.Z)(n,a,i,!1,null,"2adc7ffc",null),c=r.exports},67868:function(t,e,s){s.r(e),s.d(e,{default:function(){return m}});var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.onShow}},[t._v("新增产品技术资料")]),s("el-drawer",{attrs:{title:"新增资料",visible:t.drawer,size:"30%",direction:"rtl","append-to-body":""},on:{"update:visible":function(e){t.drawer=e},close:t.onCancel}},[s("div",{staticClass:"drawer__panel"},[s("el-row",{attrs:{gutter:20}},[s("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,size:"mini","label-position":"right","label-width":"90px"}},[s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{prop:"type",label:"资料类别:"}},[s("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择资料类别"},model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},t._l(t.options,(function(t){return s("el-option",{key:t.value,attrs:{label:t.value,value:t.value}})})),1)],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"资料说明:"}},[s("el-input",{attrs:{type:"textarea",rows:"5",placeholder:"输入资料说明"},model:{value:t.form.remarks,callback:function(e){t.$set(t.form,"remarks",e)},expression:"form.remarks"}})],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"上传附件:"}},[s("uploadFile",{ref:"upload",attrs:{folderid:t.folderid,accept:".text,.doc,.xls",bindData:{ownertable:"plm_technicalinfo",ownerid:t.plm_technicalinfoid,usetype:"default"}},on:{onSuccess:t.uploadSuccess}})],1)],1)],1)],1),s("div",[s("file_table",{ref:"list",attrs:{id:t.plm_technicalinfoid},scopedSlots:t._u([{key:"del",fn:function(e){return[t.tool.checkAuth(t.$route.name,"delete")?s("file_delete",{attrs:{data:e.data,type:"text"},on:{deleteSuccess:t.onSuccess}}):t._e()]}}])})],1),s("div",{staticClass:"fixed__btn__panel"},[s("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:t.onCancel}},[t._v("取 消")]),s("el-button",{staticClass:"normal-btn-width btn-primary",attrs:{size:"small",type:"primary"},on:{click:t.onSubmit}},[t._v("确 定")])],1)],1)])],1)},i=[],l=s(33028),n=s(58102),o=s(59462),r={name:"add",data(){return{drawer:!1,plm_technicalinfoid:"",form:{type:"",remarks:"",attinfos:[]},options:[],rules:{type:[{required:!0,message:"资料类别不可为空",trigger:"change"}]},folderid:JSON.parse(sessionStorage.getItem("folderid")).appfolderid,attachmentids:[],linksids:[]}},components:{uploadFile:l.Z,file_table:n.Z,file_delete:o.Z},methods:{onShow(){this.drawer=!0,this.typeDetails(),this.plm_technicalinfoid="0"},onClose(){this.linksids.length>0&&this.batchDeletion()},onSubmit(){this.$refs["form"].validate((async t=>{if(!t)return!1;const e=await this.$api.requested({id:"20220926095703",version:1,content:{plm_technicalinfoid:0,type:this.form.type,remarks:this.form.remarks}});this.tool.showMessage(e,(()=>{console.log("输出创建id"),console.log(e),this.batchBinding(e.data),this.drawer=!1,this.$refs.form.resetFields(),this.plm_technicalinfoid="",this.form={type:"",remarks:"",attinfos:[]},this.$emit("onSuccess")}))}))},onCancel(){this.drawer=!1,this.$refs.form.resetFields(),this.plm_technicalinfoid="",this.form={type:"",remarks:"",attinfos:[]}},async typeDetails(){const t=JSON.parse(sessionStorage.getItem("active_account")).siteid,e=await this.$api.requested({classname:"sysmanage.develop.optiontype.optiontype",method:"optiontypeselect",content:{pageNumber:1,pageSize:20,typename:"technicalinfotype",parameter:{siteid:t}}});console.log(e),this.options=e.data},uploadSuccess(t){console.log("输出"),"string"==typeof t.attinfos?this.$refs.list.listData():(console.log(t),this.bindEnclosure(t.data.attachmentids),this.form.attinfos=this.form.attinfos.push(t.data.attachmentids),this.$refs["upload"].dialogUploadVisible=!1)},async bindEnclosure(t){console.log(t),console.log(this.attachmentids);const e=await this.$api.requested({classname:"system.attachment.Attachment",method:"createFileLink",content:{ownertable:"plm_technicalinfo",ownerid:0,usetype:"default",attachmentids:t}});this.tool.showMessage(e,(()=>{console.log("附件绑定"),console.log(e);const t=[],s=[];t[0]=e.data[0].attachmentid,s[0]=e.data[0].linksid,0===this.attachmentids.length?(this.attachmentids[0]=e.data[0].attachmentid,this.linksids[0]=e.data[0].linksid):(this.attachmentids.push(...t),this.linksids.push(...s)),console.log(this.attachmentids),console.log(this.linksids),this.$refs.list.listData(),console.log("触发")}))},async batchBinding(t){await this.$api.requested({classname:"system.attachment.Attachment",method:"createFileLink",content:{ownertable:"plm_technicalinfo",ownerid:t,usetype:"default",attachmentids:this.attachmentids}});this.batchDeletion()},async batchDeletion(){const t=await this.$api.requested({classname:"system.attachment.Attachment",method:"deleteFileLink",content:{linksids:this.linksids}});console.log("删除"),console.log(t),this.$refs.form.resetFields(),this.plm_technicalinfoid="",this.form={type:"",remarks:"",attinfos:[]},this.$refs.list.listData(),this.$emit("onSuccess")},onSuccess(){this.$refs.list.listData()}}},c=r,d=s(43736),h=(0,d.Z)(c,a,i,!1,null,"3114a170",null),m=h.exports}}]);