12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["index"],{"1e66":function(e,t,a){},"2ef9":function(e,t,a){"use strict";a("8f7d")},"306e":function(e,t,a){"use strict";var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("layout",{attrs:{title:e.$attrs.title,required:e.$attrs.required}},[a("div",{staticClass:"custom-select-container flex flex-row flex-row-aic"},[a("div",{staticClass:"left",on:{click:function(t){return e.$emit("click")}}},[e.value?a("div",{staticClass:"value"},[e._v(e._s(e.value))]):a("div",{staticClass:"default"},[e._v(e._s(e.placeholder))])]),e.hideRemove?e._e():a("div",{staticClass:"right"},[e.value?a("van-icon",{attrs:{size:20,color:"#A2A3A4",name:"clear"},on:{click:function(t){return e.$emit("clear")}}}):e._e(),a("van-icon",{attrs:{color:"#A2A3A4",size:20,name:"arrow"},on:{click:function(t){return e.$emit("click")}}})],1)])])},i=[],o=a("87a7"),r={name:"CSelectImitate",components:{Layout:o["a"]},props:{value:{type:String,default:""},placeholder:{type:String,default:"请选择"},hideRemove:{type:Boolean,default:!1}}},l=r,n=(a("e1c5"),a("2877")),c=Object(n["a"])(l,s,i,!1,null,"779f15c0",null);t["a"]=c.exports},3364:function(e,t,a){"use strict";a("f71f")},3374:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"apply-for-container"},[a(e.renderComponent,{ref:"rendeRef",tag:"component",attrs:{flag:e.flag,editId:e.editId,"edit-data":e.editData}}),a("div",{staticClass:"btnbox"},[a("div",{staticClass:"btn",on:{click:e.handleSubmitData}},[e._v(e._s("approve"===e.flag?"更新内容":"提交"))])])],1)},i=[],o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"type6-container"},[a("c-input",{attrs:{title:"申请事由",required:!0,"input-type":"textarea",maxlength:800},model:{value:e.reason,callback:function(t){e.reason=t},expression:"reason"}}),a("c-select",{attrs:{title:"采购类型",required:!0,list:e.applyTypeList,pickerValueKey:"name",pickerValueId:"id"},model:{value:e.type,callback:function(t){e.type=t},expression:"type"}}),"1"==e.type?[a("c-product-store",{ref:"productStoreRef",attrs:{type:"1"},model:{value:e.apply_goods,callback:function(t){e.apply_goods=t},expression:"apply_goods"}})]:e._e(),a("c-input",{attrs:{title:"总金额(元)",required:!0,"input-type":"number"},model:{value:e.total_amount,callback:function(t){e.total_amount=t},expression:"total_amount"}}),a("c-date",{attrs:{title:"预计申购完成日期"},model:{value:e.start_time,callback:function(t){e.start_time=t},expression:"start_time"}}),a("c-files",{ref:"documentRef",model:{value:e.document,callback:function(t){e.document=t},expression:"document"}}),a("c-files",{ref:"imageRef",attrs:{ctype:"images"},model:{value:e.images,callback:function(t){e.images=t},expression:"images"}}),a("c-select",{attrs:{title:"支付方式",required:!0,list:e.applyPayTypeList,pickerValueKey:"name",pickerValueId:"id"},model:{value:e.pay_type,callback:function(t){e.pay_type=t},expression:"pay_type"}}),a("c-flow-path",{attrs:{approve:e.approvePeople,copy:e.copyPeople,isAllowCopy:e.isCopy},on:{"update:copy":function(t){e.copyPeople=t}}})],2)},r=[],l=(a("13d5"),a("14d9"),a("ca00")),n=a("5112"),c=a("7fe3"),d=a("88c3"),p=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("layout",{attrs:{title:"流程"}},[a("div",{staticClass:"custom-flow-path-container"},[a("div",{staticClass:"rows"},[a("div",{staticClass:"left"},[a("div",{staticClass:"left__title"},[e._v(" 审批人 ")]),a("div",{staticClass:"left__desc"},[e._v(" "+e._s(e.approveTxt)+" ")])]),a("div",{staticClass:"right flex flex-row"},[e.approveSelList.length?a("div",{staticClass:"procesbox flex flex-row flex-row-aic"},e._l(e.approveSelList,(function(t,s){return a("div",{key:s,staticClass:"flex flex-row"},[a("div",{staticClass:"personal flex flex-col"},[a("div",{staticClass:"avatar avatar--name"},[t.avatar?[a("img",{staticClass:"avatar-heade",attrs:{src:t.avatar}})]:[a("span",{staticClass:"avatar__name"},[e._v(e._s(e._f("changeName")(t.name)))])]],2),a("div",{staticClass:"personal__name"},[e._v(e._s(t.name))])]),s!==e.approveSelList.length-1?a("van-icon",{staticClass:"arrow",attrs:{size:14,name:"arrow",color:"rgb(151, 151, 151)"}}):e._e()],1)})),0):e._e()]),a("div",{staticClass:"rows-line"})]),e.copySelList.length||"1"==e.isAllowCopy?a("div",{staticClass:"rows"},[a("div",{staticClass:"left"},[a("div",{staticClass:"left__title"},[e._v(" 抄送人 ")]),a("div",{staticClass:"left__desc"},[e._v(" "+e._s(e.sendTxt)+" ")])]),a("div",{staticClass:"right flex flex-row"},[a("div",{staticClass:"procesbox flex flex-row flex-row-aic"},[e.copySelList.length>=3?a("div",{staticClass:"flex flex-row",on:{click:function(t){e.showMoreCopy=!0}}},[a("div",{staticClass:"personal flex flex-col"},[a("div",{staticClass:"avatar avatar--name"},[a("span",{staticClass:"avatar__name"},[a("van-icon",{attrs:{name:"friends-o",size:24}})],1)]),a("div",{staticClass:"personal__name"},[e._v("查看全部")])]),a("van-icon",{staticClass:"arrow",attrs:{size:14,name:"plus",color:"rgb(151, 151, 151)"}})],1):e._e(),e._l(e.copySelListCompu,(function(t,s){return a("div",{key:s+"-"+t.userid,staticClass:"flex flex-row"},[a("div",{staticClass:"personal flex flex-col"},[a("div",{staticClass:"avatar avatar--name"},[t.avatar?[a("img",{staticClass:"avatar-heade",attrs:{src:t.avatar}})]:[a("span",{staticClass:"avatar__name"},[e._v(e._s(e._f("changeName")(t.name)))])]],2),a("div",{staticClass:"personal__name"},[e._v(e._s(t.name))])]),s!==e.copySelListCompu.length-1||"1"==e.isAllowCopy?a("van-icon",{staticClass:"arrow",attrs:{size:14,name:"plus",color:"rgb(151, 151, 151)"}}):e._e()],1)}))],2),"1"==e.isAllowCopy?a("div",{staticClass:"empty-box",on:{click:e.handleOpenContactsCopy}},[a("van-icon",{attrs:{size:20,color:"#979797",name:"plus"}})],1):e._e()])]):e._e()]),a("van-popup",{style:{height:"60%"},attrs:{position:"bottom",closeable:"","close-icon-position":"top-right"},model:{value:e.showMoreCopy,callback:function(t){e.showMoreCopy=t},expression:"showMoreCopy"}},[a("div",{staticClass:"show-more-copy-container flex flex-col"},[a("div",{staticClass:"header"},[e._v("抄送"+e._s(e.copySelList.length)+"人")]),a("div",{staticClass:"main"},[a("div",{staticClass:"procesbox flex flex-row flex-row-aic"},e._l(e.copySelList,(function(t,s){return a("div",{key:s+"-"+t.userid,staticClass:"flex flex-row"},[a("div",{staticClass:"personal flex flex-col"},[a("div",{staticClass:"closebox",on:{click:function(a){return e.handleRemoveSignal(t,s)}}},[a("van-icon",{attrs:{name:"cross",size:14,color:"#fff"}})],1),a("div",{staticClass:"avatar avatar--name"},[t.avatar?[a("img",{staticClass:"avatar-heade",attrs:{src:t.avatar}})]:[a("span",{staticClass:"avatar__name"},[e._v(e._s(e._f("changeName")(t.name)))])]],2),a("div",{staticClass:"personal__name"},[e._v(e._s(t.name))])]),s!==e.copySelList.length-1?a("van-icon",{staticClass:"arrow",attrs:{size:14,name:"plus",color:"rgb(151, 151, 151)"}}):e._e()],1)})),0)])])])],1)},u=[],m=a("87a7"),h=a("3842"),_={name:"CFlowPath",components:{Layout:m["a"]},computed:{approveTxt(){let e=this.approveSelList;return e.length?e.length+"人依次审批":"暂无审批人"},sendTxt(){let e=this.copySelList;return e.length?`抄送${e.length}人`:"暂无抄送人"},copySelListCompu(){let e=[...this.copySelList];return e.length>2?e.slice(-2):e}},props:{approve:{type:Array},copy:{type:Array},isAllowCopy:{type:[String,Number],default:1}},data(){return{showMoreCopy:!1,approveSelList:[],copySelList:[]}},methods:{async handleOpenContactsCopy(){if(1!=this.isAllowCopy)return;const e=await Object(h["a"])({title:"添加抄送人",multiple:!1,maxUsers:9999,limitTips:"抄送人已达最大人数",pickedUsers:this.copySelList.map(e=>e.userid),responseUserOnly:!0,startWithDepartmentId:0,deptId:-1,showLabelPick:!1}),{users:t}=e;t.length&&(t.forEach(e=>{this.copySelList.push({...e,userid:e.emplId})}),this.$emit("update:copy",[...this.copySelList]))},handleRemoveSignal(e,t){this.copySelList.splice(t,1),this.$emit("update:copy",[...this.copySelList])},__render_a__(e){Array.isArray(e)||(e=this.approve),this.approveSelList=[...e]},__render_c__(e){Array.isArray(e)||(e=this.copy),this.copySelList=[...e]}},watch:{approve:{handler(e){this.__render_a__(e)},deep:!0},copy:{handler(e){this.__render_c__(e)},deep:!0}}},f=_,y=(a("2ef9"),a("2877")),v=Object(y["a"])(f,p,u,!1,null,"29a36c33",null),g=v.exports,x=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("layout",{attrs:{title:e.$attrs.title,required:e.$attrs.required}},[a("div",{staticClass:"custom-date-container flex flex-row flex-row-aic"},[a("div",{staticClass:"left",on:{click:function(){return e.show=!e.show}}},[e.selectVal?a("div",{staticClass:"value"},[e._v(e._s(e.selectVal))]):a("div",{staticClass:"default"},[e._v("请选择")])]),a("div",{staticClass:"right"},[e.selectVal?a("van-icon",{attrs:{size:20,color:"#A2A3A4",name:"clear"},on:{click:e.handleRemoveVal}}):e._e(),a("van-icon",{attrs:{color:"#A2A3A4",size:20,name:"arrow"},on:{click:function(){return e.show=!e.show}}})],1)]),a("van-popup",{attrs:{position:"bottom"},model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[a("div",{staticClass:"switch-data-box flex flex-row flex-row-aic"},[a("div",{staticClass:"left"},[a("span",{class:{active:0===e.swt},on:{click:function(){return e.swt=0}}},[e._v(e._s(e.dateShow))]),e.hasAm?a("span",{class:{active:1===e.swt},on:{click:function(){return e.swt=1}}},[e._v(e._s(e.rangeShow))]):a("span",{class:{active:2===e.swt},on:{click:function(){return e.swt=2}}},[e._v("时间")])]),a("div",{staticClass:"right",on:{click:e.handleConfirmBtn}},[a("div",{staticClass:"btn"},[e._v("确认")])])]),a("van-calendar",{directives:[{name:"show",rawName:"v-show",value:0===e.swt,expression:"swt === 0"}],style:{height:"340px"},attrs:{poppable:!1,"show-confirm":!1,"show-title":!1,"show-subtitle":!1,"row-height":"50",color:"#3290c4","default-date":e.calenderDefaultVal},on:{confirm:e.onConfirmDateVal}}),a("van-picker",{directives:[{name:"show",rawName:"v-show",value:1===e.swt&&e.hasAm,expression:"swt === 1 && hasAm"}],ref:"vanPickerRef",style:{height:"340px"},attrs:{"show-toolbar":!1,columns:e.rangeTimeList,"default-index":e.defaultAmPickerIdx},on:{change:e.handlePickerChange}}),a("van-datetime-picker",{directives:[{name:"show",rawName:"v-show",value:2===e.swt&&!e.hasAm,expression:"swt === 2 && !hasAm"}],ref:"vanDatePickerRef",style:{height:"340px"},attrs:{value:e.timeVal,type:"time","show-toolbar":!1,"min-hour":e.rendeMinHours,"max-hour":23,"visible-item-count":"7"},on:{change:e.handleDateTimePickerChange}})],1)],1)},b=[],w=a("1d0a"),k={name:"CDate",components:{Layout:m["a"]},computed:{dateShow(){return this.dateVal?Object(w["b"])(this.dateVal):"日期"},rangeShow(){return"上午"===this.rangeTime?"上午":"下午"},rendeMinHours(){let e=0;return"下午"===this.rangeTime&&(e=12),e},defaultAmPickerIdx(){return"上午"===this.rangeTime?0:1}},props:{value:{type:String,default:""},hasAm:{type:Boolean,default:!1}},data(){return{show:!1,swt:0,selectVal:"",rangeTimeList:["上午","下午"],calenderDefaultVal:new Date,rangeTime:"上午",dateVal:"",timeVal:"00:00"}},methods:{onConfirmDateVal(e){this.dateVal=e},reset(){this.selectVal="",this.dateVal="",this.timeVal="00:00",this.rangeTime="上午"},handleRemoveVal(){this.reset()},handlePickerChange(e,t){this.rangeTime=t},handleDateTimePickerChange(e){const[t,a]=e.getValues();this.timeVal=`${t}:${a}`},handleConfirmBtn(){try{this.show=!1,this.dateVal||(this.dateVal=this.calenderDefaultVal),this.hasAm&&this.$refs.vanPickerRef.confirm(),this.$nextTick(()=>{let e=this.hasAm?`${Object(w["a"])(this.dateVal)} ${this.rangeTime}`:`${Object(w["a"])(this.dateVal)} ${this.timeVal}`;this.selectVal=e,this.$emit("input",e)})}catch(e){console.log("%c handleConfirmBtn >>>","background: blue; color: #fff",e)}}},watch:{show(e){e||(this.swt=0)},value:{handler(e){if(e){const[t,a]=e.split(" ");let s=a.includes(":");if(s){let[e]=a.split(":");this.rangeTime=e>12?"下午":"上午",this.timeVal=a}else this.rangeTime=a;this.selectVal=e,this.calenderDefaultVal=new Date(t),this.dateVal=t}},immediate:!0}}},C=k,$=(a("8897"),Object(y["a"])(C,x,b,!1,null,"74862614",null)),T=$.exports,A=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"layout-container"},[a("div",{staticClass:"layout__title flex flex-row flex-row-aic"},[a("div",{staticClass:"left"},[a("span",{staticClass:"title"},[e._v(e._s(e.$attrs.title))]),e.$attrs.required?a("span",{staticClass:"require"},[e._v("*")]):e._e()]),a("div",{staticClass:"right"},[a("van-switch",{attrs:{size:20,value:e.$attrs.value,"active-color":"#3290c4","active-value":e.$attrs.activeValue,"inactive-value":e.$attrs.inactiveValue},on:{change:function(t){return e.$emit("input",t)}}})],1)])])},S=[],D={name:"CSwitch"},j=D,P=(a("3364"),Object(y["a"])(j,A,S,!1,null,"8ef9abca",null)),L=P.exports,O=a("306e"),V={components:{CSelect:n["a"],CInput:c["a"],CFiles:d["a"],CFlowPath:g,CDate:T,CSwitch:L,CSelectImitate:O["a"]}},I=a("b775");function R(e){return Object(I["a"])({method:"POST",url:"approveflow/get_data",data:e})}var q={mixins:[V],props:{editData:{type:Object,default:()=>null},editId:{type:Number,default:0},flag:{type:String,validator:e=>["","info","approve"].includes(e)}},data(){return{approvePeople:[],copyPeople:[],isCopy:void 0}},created(){"notInDingTalk"!==h["d"]&&this.navigationSetting()},activated(){"notInDingTalk"!==h["d"]&&this.handleSetRightTitle()},methods:{navigationSetting(){Object(h["f"])({title:this.pageTitle})},handleNavRightBack(){this.$router.push({name:"ApplyState",query:{type:this.module}})},handleSetRightTitle(){Object(h["e"])({show:!0,control:!0,text:this.pageRightTitle,callback:this.handleNavRightBack})},async getCommonFlowPathData(e={},t){try{let a=this.module;const s={module:a},i=[5,6,8];i.includes(a)&&e.flow_item&&(s["flow_item"]=e.flow_item);const o=await R(s);if(1===o.code){const{approve_user:e=[],copy_user:a=[],is_copy:s="0"}=o.data;this.isCopy=s,this.approvePeople=e,this.copyPeople=a,t&&t()}}catch(a){console.log(a)}},__validtor__({mapTxt:e,requiredKey:t,data:a},s){let i=t.length,o=!1,r="";for(let c=0;c<i;c++){let e=t[c],s=a[e],i=Object(l["g"])(s);if("Number"!==i||isNaN(s)){if("Array"===i&&s.length)continue;if("String"===i&&s)continue;r=e,o=!0;break}}let n="";if(s){const[e,t,i]=s(a,o,r);o=e,r=t,n=i}return n?(this.$toast(n),!0):o?(this.$toast(e[r]+"为空"),!0):void 0},__jump2apply_state__(){this.$store.commit({type:"app/ROUTE_REMOVE",value:"Applyfor"}),this.$router.replace({name:"ApplyState",query:{type:this.module}})}},watch:{editData:{handler(e){e&&this.handleFormatEditData(e)},deep:!0,immediate:!0}}},E=a("120e"),U=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"product-store-container"},[s("div",{staticClass:"product-store__header flex flex-row flex-row-aic"},[s("div",{staticClass:"left-title"},[s("span",[e._v(e._s(e.title))]),s("span",{staticClass:"required"},[e._v("*")])]),e.disabled?e._e():s("div",{staticClass:"right-content flex flex-row flex-row-aic"},[["1","3"].includes(e.type)?[s("span",{on:{click:e.handleAddGoods}},[e._v("添加新商品")]),s("span",{staticClass:"divider"})]:e._e(),s("span",{on:{click:function(t){e.productStoreActionsheetVisibility=!0}}},[e._v("批量导入")]),s("span",{staticClass:"divider"}),s("span",{on:{click:e.handleGoPStore}},[e._v("商品库选择")])],2)]),e.showList?[s("div",{staticClass:"product-list-container"},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.list.length>2,expression:"list.length > 2"}],staticClass:"product-list__header flex flex-row flex-row-aic"},[s("div",{staticClass:"left"},[e._v("商品列表")]),s("div",{staticClass:"right",on:{click:function(t){e.showMore=!e.showMore}}},[e.showMore?[e._v(" 收起"),s("van-icon",{attrs:{name:"arrow-up"}})]:[e._v(" 展开"),s("van-icon",{attrs:{name:"arrow-down"}})]],2)]),s("div",{staticClass:"product-list__rows"},e._l(e.renderInfoList,(function(t,a){return s("div",{key:a,staticClass:"prow"},[s("div",{staticClass:"prow-header flex flex-row flex-row-aic"},[s("div",{staticClass:"prow-header__left"},[e._v(" "+e._s(t.goods_name)+" ")]),e.disabled?e._e():s("div",{staticClass:"prow-header__right"},[s("span",{directives:[{name:"show",rawName:"v-show",value:2!=t.flag,expression:"item.flag != 2"}],staticClass:"update",on:{click:function(s){return e.handleUpdateRow(t,a)}}},[e._v("更改")]),s("span",{staticClass:"remove",on:{click:function(s){return e.handleRemoveRow(t,a)}}},[e._v("删除")])])]),e._l(t.goods_stock,(function(t,a){return[s("div",{key:a,staticClass:"prow-middle flex flex-row flex--row-aic"},[s("div",{staticClass:"flex flex-row flex-row-aic"},[s("div",{staticClass:"tags"},[e._v(e._s(t.name))]),s("div",{directives:[{name:"show",rawName:"v-show",value:e.needShowPrice,expression:"needShowPrice"}],staticClass:"price"},[e._v("¥"+e._s(t.price))])]),s("div",{staticClass:"count"},[e._v("x"+e._s(t.stock))])])]})),s("div",{directives:[{name:"show",rawName:"v-show",value:e.needShowPrice,expression:"needShowPrice"}],staticClass:"prow-total"},[s("span",[e._v("¥")]),e._v(e._s(e._f("sumPrice")(t.goods_stock))+" ")])],2)})),0)])]:[s("div",{staticClass:"product-store__empty"},[e._v(" "+e._s(e.showEmptyTxt)+" ")])],s("van-action-sheet",{attrs:{actions:e.actions,"cancel-text":"取消","close-on-click-action":""},on:{select:e.handleSelectSheet},model:{value:e.productStoreActionsheetVisibility,callback:function(t){e.productStoreActionsheetVisibility=t},expression:"productStoreActionsheetVisibility"}},[s("div",{staticClass:"action-sheet-container",attrs:{slot:"description"},on:{click:e.handleDownloadHelp},slot:"description"},[s("div",{staticClass:"icon"},[s("img",{attrs:{src:a("4e32"),alt:""}})]),s("div",{staticClass:"title"},[e._v("批量导入方法说明.Excel")]),s("div",{staticClass:"sub-title"},[e._v("264.45 KB")])])]),s("input",{ref:"importTemlate",attrs:{accept:e.excelSuffix,type:"file",name:"file",id:"file"},on:{change:e.handleInputFileChange}})],2)},F=[],M=a("2934"),N=a("60fe"),z=a("0e5c"),K=a("d77e"),B={name:"CProductStore",props:{value:{type:Array,default:()=>[]},type:{validator:e=>["1","3","4"].includes(e),required:!0},disabled:{typeof:Boolean,default:!1}},computed:{showEmptyTxt(){return"还未添加"+this.title},needShowPrice(){return["1"].includes(this.type)},showList(){return Boolean(this.list.length)},title(){let e=this.type,t="";switch(e){case"1":t="采购明细";break;case"3":t="入库明细";break;case"4":t="领用明细";break}return t},renderInfoList(){return this.showMore?this.list:this.list.slice(0,2)}},data:()=>({showMore:!1,excelSuffix:N["g"].join(","),productStoreActionsheetVisibility:!1,actions:[{name:"下载模板",color:"rgba(0, 122, 255, 1)"},{name:"导入模板",color:"rgba(0, 122, 255, 1)"}],list:[]}),created(){K["a"].$on("updateProductList",this.handleUpdateList),K["a"].$on("changeGoods",this.handleAddOrUpdateData)},mounted(){this.handleUpdateValues()},methods:{handleUpdateValues(){const e=this.value;Array.isArray(e)&&(this.list=[...e].map(e=>{let t=e.goods_stock;return"string"===typeof t&&(t=JSON.parse(t)),{...e,goods_stock:t}}))},handleAddOrUpdateData(e){if(!e)return;const{flag:t}=e,a=Boolean(e.goods_id);let s=this.list.findIndex(t=>a?t.goods_id===e.goods_id:t.__id__===e.__id__);console.log("handleAddOrUpdateData",t,e,this.list,s),s>=0?this.list.splice(s,1,{...e}):this.list.push({...e})},handleUpdateList(e){const{customCount:t,goodsStock:a,item:s,GoodsPrice:i}=e;console.log("handleUpdateList",t,a,s,i);const o=this.list.some(e=>e.goods_id===s.id);if(o){let e=this.list.findIndex(e=>e.goods_id===s.id);const{goods_stock:o}=this.list[e];let r=o.some(e=>e.id===a.id);if(r){let e=o.findIndex(e=>e.id===a.id);e>=0&&(o[e]={...o[e],price:i,stock:t})}else o.push({id:a.id,name:a.name,price:i,stock:t});this.$forceUpdate()}else{const e={flag:3,goods_id:s.id,goods_category_first:s.goods_category_first,goods_category_id:s.goods_category_id,goods_no:s.goods_no,goods_name:s.goods_name,goods_brand:s.goods_brand,goods_stock:[{id:a.id,name:a.name,price:i,stock:t}]};this.list=[...this.list,e]}},handleSelectSheet(e,t){switch(t){case 0:this.handleDownloadTemplate();break;case 1:this.$refs.importTemlate.click();break}},async handleDownloadTemplate(){try{const e={module:this.type},t=await Object(M["a"])(e);if(1===t.code){const{url:e}=t.data;e?Object(l["c"])(e):this.$toast("请联系网络管理员")}}catch(e){console.log("%c handleDownloadTemplate >>>","background: blue; color: #fff",e)}},async handleInputFileChange(e){let t=e.target.files;if(t.length){let a=t[0];e.target.value=null,console.log("%c change file >>>","background: blue; color: #fff",a),await this.handleImportFile(a)}else this.$refs.importTemlate.value=""},async handleImportFile(e){try{const t=await Object(z["a"])(e),a=await Object(M["d"])({module:this.type,file:t.url});if(1===a.code){const{error_data:e=[],apply_goods_data:t=[]}=a.data;e.length?this.handleTipsImport(e,t):t.length&&(this.list=[...this.list,...t])}}catch(t){console.log("%c handleImportFileError >>>","background: blue; color: #fff",t)}},handleDownloadHelp(){this.$toast("点击下载模板进行编辑上传")},handleTipsImport(e,t){this.$dialog.confirm({message:e.map((e,t)=>`${t+1}、${e.msg}`).join("\t\n"),confirmButtonText:"取消申领",confirmButtonColor:"rgba(0, 122, 255, 1)",cancelButtonText:"按已有的库存申领"}).catch(()=>{this.list=[...this.list,...t]})},handleRemoveRow(e,t){let a=e.goods_name;this.$dialog.confirm({title:"删除"+this.title,message:`请确认是否删除“${a}”的信息`,confirmButtonText:"否",confirmButtonColor:"#576B95",cancelButtonText:"是"}).catch(()=>{this.list.splice(t,1)})},handleUpdateRow(e){this.$store.commit({type:"app/ROUTE_ADD",value:"Goods"}),this.$nextTick(()=>{this.$router.push({name:"Goods",query:{flag:"3",type:this.type,flagtxt:this.$route.query.flag,edit:JSON.stringify(e)}})})},handleGoPStore(){this.$router.push({name:"ProductStore",query:{module:this.type}})},handleAddGoods(){this.$store.commit({type:"app/ROUTE_ADD",value:"Goods"}),this.$nextTick(()=>{this.$router.push({name:"Goods",query:{type:this.type}})})}},filters:{sumPrice(e){let t=0;return e.reduce((e,t)=>e+Number(t.price)*Number(t.stock),t)}},watch:{list:{handler(e){Array.isArray(e)&&e.length&&this.$listeners["input"]&&this.$emit("input",e)}}},beforeDestroy(){K["a"].$off("updateProductList"),K["a"].$off("changeGoods")}},G=B,H=(a("56dc"),Object(y["a"])(G,U,F,!1,null,"7d067ce3",null)),Y=H.exports,J={name:"IndexType1",mixins:[q],components:{CProductStore:Y},data(){return{pageTitle:"申购申请",pageRightTitle:"我的申购",degreeList:this.$store.state.enum.degreeList,applyTypeList:this.$store.state.enum.applyTypeList,applyPayTypeList:this.$store.state.enum.applyPayTypeList,way:"create",id:"",module:1,reason:"",type:"",document:[],images:[],total_amount:"",pay_type:"",start_time:"",apply_goods:[],approve_user:[],copy_user:[]}},created(){this.getCommonFlowPathData()},methods:{handleFormatEditData(e){console.log("%c edit data type1 >>>","background: blue; color: #fff",e);const t="approve"===this.flag;this.way=t?"edit":"update",this.id=t?e.approve_id:e.id,this.reason=e.reason,this.type=e.type;const a=e.module_info;this.total_amount=""+Number(a.total_amount),this.pay_type=a.pay_type,a.start_time&&(this.start_time=a.start_time),this.apply_goods=e.apply_goods.map(e=>({flag:3,...e,goods_stock:JSON.parse(e.goods_stock)})),Array.isArray(e.module_info.images_text)&&e.module_info.images_text.length&&(this.images=e.module_info.images_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),Array.isArray(e.module_info.document_text)&&e.module_info.document_text.length&&(this.document=e.module_info.document_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),this.$nextTick(()=>{this.$refs.productStoreRef.handleUpdateValues(),this.$refs.imageRef.handleUpdateValues(),this.$refs.documentRef.handleUpdateValues()})},handleSubmitData(){let e=this.__format_data__();console.log("format data>>>",e);let t=this.validate(e);t||(console.log("execute handleSubmitData",e),this.__post__(e))},__format_data__(){let e={way:this.way,module:this.module,reason:this.reason,type:this.type,total_amount:this.total_amount,pay_type:this.pay_type,start_time:this.start_time,apply_goods:this.apply_goods,approve_user:this.approvePeople.map(e=>e.userid||e.emplId).join(","),copy_user:this.copyPeople.map(e=>e.userid||e.emplId).join(",")},t=this.images;Array.isArray(t)&&t.length&&(e.images=t.map(e=>e.url).join(","));let a=this.document;return Array.isArray(a)&&a.length&&(e.document=a.map(e=>e.url).join(",")),this.id&&(e.id=this.id),e},validate(e){let t={reason:"申购事由",type:"采购类型",apply_goods:"申购明细",total_amount:"总金额",pay_type:"支付方式"},a=["reason","type","total_amount","pay_type"];return this.__validtor__({mapTxt:t,requiredKey:a,data:e},(e,t,a)=>(1!=e.type||Array.isArray(e.apply_goods)&&e.apply_goods.length||(t=!0,a="apply_goods"),[t,a]))},async __post__(e){try{const t=await Object(E["e"])(e);1===t.code&&(this.$toast(t.msg),"approve"===this.flag?this.$router.go(-1):this.__jump2apply_state__())}catch(t){console.log("it5, __post__",t)}}},watch:{apply_goods:{handler(e){if(Array.isArray(e)&&e.length&&1==this.type){let t=0;for(const a of e){let e=0;t+=a.goods_stock.reduce((e,t)=>e+Number(t.price)*Number(t.stock),e)}this.total_amount=""+t}},deep:!0}}},W=J,Q=Object(y["a"])(W,o,r,!1,null,null,null),X=Q.exports,Z=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"type6-container"},[a("c-select",{attrs:{title:"呈批类型",required:!0,list:e.offerList,pickerValueKey:"name",pickerValueId:"id"},model:{value:e.type,callback:function(t){e.type=t},expression:"type"}}),a("c-input",{attrs:{title:"发文字号",required:!0},model:{value:e.word_size,callback:function(t){e.word_size=t},expression:"word_size"}}),a("c-select",{attrs:{title:"缓急程度",required:!0,list:e.degreeList,pickerValueKey:"name",pickerValueId:"id"},model:{value:e.desc,callback:function(t){e.desc=t},expression:"desc"}}),a("c-input",{attrs:{title:"印制份数","input-type":"number"},model:{value:e.number,callback:function(t){e.number=t},expression:"number"}}),a("c-input",{attrs:{title:"申请标题",required:!0},model:{value:e.reason,callback:function(t){e.reason=t},expression:"reason"}}),a("c-input",{attrs:{title:"申请内容","input-type":"textarea"},model:{value:e.remark,callback:function(t){e.remark=t},expression:"remark"}}),a("c-files",{ref:"fileRef",model:{value:e.document,callback:function(t){e.document=t},expression:"document"}}),a("c-flow-path",{attrs:{approve:e.approvePeople,copy:e.copyPeople,isAllowCopy:e.isCopy},on:{"update:copy":function(t){e.copyPeople=t}}})],1)},ee=[],te={name:"IndexType2",mixins:[q],data:()=>({pageTitle:"呈批申请",pageRightTitle:"我的呈批",degreeList:[],offerList:[],way:"create",id:"",module:2,reason:"",type:"",desc:"",remark:"",word_size:"",number:"",document:[],approve_user:[],copy_user:[]}),created(){this.degreeList=this.$store.state.enum.degreeList,this.offerList=this.$store.state.enum.offerTypeList,this.getCommonFlowPathData()},methods:{handleFormatEditData(e){console.log("%c edit data type6 >>>","background: blue; color: #fff",e);const t="approve"===this.flag;this.way=t?"edit":"update",this.id=t?e.approve_id:e.id,this.module=e.module;const a=e.module_info;Array.isArray(e.module_info.document_text)&&e.module_info.document_text.length&&(this.document=e.module_info.document_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),this.reason=a.reason,this.type=a.type,this.desc=a.desc,this.remark=a.remark,this.word_size=a.word_size,this.number=a.number,this.$nextTick(()=>{this.$refs.fileRef.handleUpdateValues()})},handleSubmitData(){let e=this.__format_data__();console.log("format data>>>",e);let t=this.validate(e);t||(console.log("execute handleSubmitData",e),this.__post__(e))},__format_data__(){let e={way:this.way,module:this.module,reason:this.reason,type:this.type,desc:this.desc,remark:this.remark,word_size:this.word_size,number:this.number,approve_user:this.approvePeople.map(e=>e.userid||e.emplId).join(","),copy_user:this.copyPeople.map(e=>e.userid||e.emplId).join(",")},t=this.document;return Array.isArray(t)&&t.length&&(e.document=t.map(e=>e.url).join(",")),this.id&&(e.id=this.id),e},validate(e){let t={type:"呈批类型",word_size:"发文字号",desc:"缓急程度",reason:"申请标题"},a=["type","word_size","desc","reason"];return this.__validtor__({mapTxt:t,requiredKey:a,data:e})},async __post__(e){try{const t=await Object(E["e"])(e);1===t.code&&(this.$toast(t.msg),"approve"===this.flag?this.$router.go(-1):this.__jump2apply_state__())}catch(t){console.log("it2, __post__",t)}}}},ae=te,se=Object(y["a"])(ae,Z,ee,!1,null,null,null),ie=se.exports,oe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"type6-container"},[a("c-select-imitate",{attrs:{title:"采购审批单",value:e.selOrd_text,"hide-remove":"approve"===e.flag},on:{click:e.handleClickSelOrdRow,clear:e.handleCloseSelOrd}}),a("c-product-store",{ref:"cproductstoreRef",attrs:{type:"3",disabled:"approve"===e.flag},model:{value:e.stock_goods,callback:function(t){e.stock_goods=t},expression:"stock_goods"}}),a("c-files",{ref:"documentRef",model:{value:e.document,callback:function(t){e.document=t},expression:"document"}}),a("c-files",{ref:"imageRef",attrs:{ctype:"images"},model:{value:e.images,callback:function(t){e.images=t},expression:"images"}}),a("c-input",{attrs:{title:"其他补充说明","input-type":"textarea"},model:{value:e.remark,callback:function(t){e.remark=t},expression:"remark"}}),a("c-flow-path",{attrs:{approve:e.approvePeople,copy:e.copyPeople,isAllowCopy:e.isCopy},on:{"update:copy":function(t){e.copyPeople=t}}})],1)},re=[],le={name:"IndexType3",mixins:[q],components:{CProductStore:Y},computed:{selOrd_text(){return this.selOrd_arrs.length?"已设置":""},apply_id(){let e=this.selOrd_arrs;return e.length?e.map(e=>e.id).join(","):0}},data(){return{pageTitle:"入库申请",pageRightTitle:"我的入库",degreeList:this.$store.state.enum.degreeList,way:"create",id:"",module:3,document:[],images:[],remark:"",stock_goods:[],approve_user:[],copy_user:[],selOrd_arrs:[]}},created(){this.getCommonFlowPathData(),K["a"].$on("listenApprovalFormList",this.handleApprovalFormList)},methods:{handleApprovalFormList(e,t=1){e=e.map((e,a)=>({...e,flag:t,__id__:`${Date.now()}-${a}`})),this.selOrd_arrs=[...e],this.$nextTick(()=>{e.forEach(e=>{e.apply_goods.forEach(t=>{this.$refs.cproductstoreRef.handleAddOrUpdateData({...t,__flag_x__:"approve-form",__flag_id__:e.__id__})})})})},handleFormatEditData(e){console.log("%c edit data type3 >>>","background: blue; color: #fff",e);const t="approve"===this.flag;this.way=t?"edit":"update",this.id=t?e.approve_id:e.id,this.module=e.module,Array.isArray(e.module_info.images_text)&&e.module_info.images_text.length&&(this.images=e.module_info.images_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),Array.isArray(e.module_info.document_text)&&e.module_info.document_text.length&&(this.document=e.module_info.document_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),this.remark=e.module_info.remark;let a=e.stock_goods.map(e=>({flag:3,...e,goods_stock:JSON.parse(e.goods_stock)}))||[];this.stock_goods=a,e.apply&&(this.selOrd_arrs={id:e.apply.order_no}),this.$nextTick(()=>{this.$refs.imageRef.handleUpdateValues(),this.$refs.documentRef.handleUpdateValues(),this.$refs.cproductstoreRef.handleUpdateValues()})},handleSubmitData(){let e=this.__format_data__();console.log("format data>>>",e);let t=this.validate(e);t||(console.log("execute handleSubmitData",e),this.__post__(e))},__format_data__(){let e={way:this.way,module:this.module,apply_id:this.apply_id,remark:this.remark,stock_goods:this.stock_goods,approve_user:this.approvePeople.map(e=>e.userid||e.emplId).join(","),copy_user:this.copyPeople.map(e=>e.userid||e.emplId).join(",")},t=this.images;Array.isArray(t)&&t.length&&(e.images=t.map(e=>e.url).join(","));let a=this.document;return Array.isArray(a)&&a.length&&(e.document=a.map(e=>e.url).join(",")),this.id&&(e.id=this.id),e},validate(e){let t={stock_goods:"入库明细"},a=["stock_goods"];return this.__validtor__({mapTxt:t,requiredKey:a,data:e})},async __post__(e){try{const t=await Object(E["e"])(e);1===t.code&&(this.$toast(t.msg),"approve"===this.flag?this.$router.go(-1):this.__jump2apply_state__())}catch(t){console.log("it5, __post__",t)}},handleClickSelOrdRow(){if("approve"===this.flag)return;let e={};this.apply_id&&(e.sel=this.apply_id),this.$router.push({name:"CApprovalForm",query:e})},handleCloseSelOrd(){try{let e=[...this.stock_goods],t=this.selOrd_arrs.map(e=>e.__id__||e.id),a=[];e.forEach(e=>{t.includes(e.__flag_id__)||a.push(e)}),this.stock_goods=[...a],this.$forceUpdate(),this.$nextTick(()=>{this.selOrd_arrs=[],this.$refs.cproductstoreRef.handleUpdateValues()})}catch(e){console.log("%c handleCloseSelOrd >>>","background: blue; color: #fff",e)}},__about_selarrs__(e){let t=[...this.selOrd_arrs],a=t.map(e=>e.__id__||e.id),s=e.filter(e=>"approve-form"===e.__flag_x__).map(e=>e.__flag_id__),i=[...new Set(s)];i.length?i.forEach(e=>{if(!a.includes(e)){let s=a.findIndex(t=>t==e);s>=0&&t.splice(s,1)}}):t=[],this.selOrd_arrs=[...t],this.$forceUpdate()}},beforeDestroy(){K["a"].$off("listenApprovalFormList",this.handleApprovalFormList)},watch:{stock_goods:{handler(e,t){e.length&&this.selOrd_arrs.length?this.__about_selarrs__(t):this.selOrd_arrs=[]},deep:!0}}},ne=le,ce=Object(y["a"])(ne,oe,re,!1,null,null,null),de=ce.exports,pe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"type6-container"},[a("c-input",{attrs:{title:"物品用途"},model:{value:e.reason,callback:function(t){e.reason=t},expression:"reason"}}),a("c-product-store",{ref:"cproductstoreRef",attrs:{type:"4"},model:{value:e.use_goods,callback:function(t){e.use_goods=t},expression:"use_goods"}}),a("c-files",{ref:"fileRef",attrs:{ctype:"files"},model:{value:e.document,callback:function(t){e.document=t},expression:"document"}}),a("c-input",{attrs:{title:"其他补充说明","input-type":"textarea"},model:{value:e.remark,callback:function(t){e.remark=t},expression:"remark"}}),a("c-flow-path",{attrs:{approve:e.approvePeople,copy:e.copyPeople,isAllowCopy:e.isCopy},on:{"update:copy":function(t){e.copyPeople=t}}})],1)},ue=[],me={name:"IndexType4",mixins:[q],components:{CProductStore:Y},data(){return{pageTitle:"领用申请",pageRightTitle:"我的领用",degreeList:this.$store.state.enum.degreeList,way:"create",id:"",module:4,reason:"",document:[],remark:"",use_goods:[],approve_user:[],copy_user:[]}},created(){this.getCommonFlowPathData()},methods:{handleFormatEditData(e){console.log("%c edit data type6 >>>","background: blue; color: #fff",e);const t="approve"===this.flag;this.way=t?"edit":"update",this.id=t?e.approve_id:e.id,this.module=e.module;const a=e.module_info;Array.isArray(e.module_info.document_text)&&e.module_info.document_text.length&&(this.document=e.module_info.document_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),this.reason=a.reason,this.remark=a.remark,this.use_goods=e.use_goods.map(e=>({flag:3,...e,goods_stock:JSON.parse(e.goods_stock)}))||[],this.$nextTick(()=>{this.$refs.fileRef.handleUpdateValues(),this.$refs.cproductstoreRef.handleUpdateValues()})},handleSubmitData(){let e=this.__format_data__();console.log("format data>>>",e);let t=this.validate(e);t||(console.log("execute handleSubmitData",e),this.__post__(e))},__format_data__(){let e={way:this.way,module:this.module,reason:this.reason,remark:this.remark,use_goods:this.use_goods,approve_user:this.approvePeople.map(e=>e.userid||e.emplId).join(","),copy_user:this.copyPeople.map(e=>e.userid||e.emplId).join(",")};return this.document.length&&(e.document=this.document.map(e=>e.url).join(",")),this.id&&(e.id=this.id),e},validate(e){let t={use_goods:"领用明细"},a=["use_goods"];return this.__validtor__({mapTxt:t,requiredKey:a,data:e})},async __post__(e){try{const t=await Object(E["e"])(e);1===t.code&&(this.$toast(t.msg),"approve"===this.flag?this.$router.go(-1):this.__jump2apply_state__())}catch(t){console.log("it5, __post__",t)}}}},he=me,_e=Object(y["a"])(he,pe,ue,!1,null,"4bb2952e",null),fe=_e.exports,ye=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"type5-container"},[a("c-select-imitate",{attrs:{title:"申请人",value:e.apply_user_name,"hide-remove":e.isApprove},on:{click:function(t){"approve"!==e.flag&&e.handleEditApplyofUser()},clear:e.handleRemoveApplyUser}}),a("c-input",{attrs:{title:"填写事由",required:!0},model:{value:e.reason,callback:function(t){e.reason=t},expression:"reason"}}),a("peers",{model:{value:e.peer_user,callback:function(t){e.peer_user=t},expression:"peer_user"}}),e.isApprove?a("c-select-imitate",{attrs:{title:"出差开始时间",required:!0,value:e.start_time,"hide-remove":e.isApprove}}):a("c-date",{attrs:{title:"出差开始时间",required:!0},model:{value:e.start_time,callback:function(t){e.start_time=t},expression:"start_time"}}),e.isApprove?a("c-select-imitate",{attrs:{title:"出差结束时间",required:!0,value:e.end_time,"hide-remove":e.isApprove}}):a("c-date",{attrs:{title:"出差结束时间",required:!0},model:{value:e.end_time,callback:function(t){e.end_time=t},expression:"end_time"}}),a("c-files",{ref:"documentRef",model:{value:e.document,callback:function(t){e.document=t},expression:"document"}}),a("c-files",{ref:"imageRef",attrs:{ctype:"images"},model:{value:e.images,callback:function(t){e.images=t},expression:"images"}}),e.isApprove?a("c-select-imitate",{attrs:{title:"类型",required:!0,value:e.getEvectionTypeList(e.type),"hide-remove":e.isApprove}}):a("c-select",{attrs:{title:"类型",required:!0,list:e.awayArr,pickerValueKey:"name",pickerValueId:"id"},model:{value:e.type,callback:function(t){e.type=t},expression:"type"}}),1==e.type?a("c-switch",{attrs:{title:"是否跨关内关外",required:!0,activeValue:1,inactiveValue:0},model:{value:e.is_who,callback:function(t){e.is_who=t},expression:"is_who"}}):e._e(),a("c-input",{attrs:{title:"预算金额",required:Boolean(e.is_who),"input-type":"textarea",placeholder:"请输入预算金额"},model:{value:e.remark,callback:function(t){e.remark=t},expression:"remark"}}),a("c-flow-path",{attrs:{approve:e.approvePeople,copy:e.copyPeople,isAllowCopy:e.isCopy},on:{"update:copy":function(t){e.copyPeople=t}}})],1)},ve=[],ge=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"peers-info-container"},[a("div",{staticClass:"peers__header flex flex-row flex-row-aic"},[a("span",{staticClass:"left-title"},[e._v("同行人员")]),a("span",{staticClass:"right-addd",on:{click:e.handleAddPeerData}},[e._v("添加人员")])]),e.peerList.length?[a("div",{staticClass:"peers__mainlist"},e._l(e.peersListCom,(function(t,s){return a("div",{key:s,staticClass:"peers__row"},[a("div",{staticClass:"peers__row__header flex flex-row flex-row-aic"},[a("div",{staticClass:"peers__row__header__left"},[a("span",[e._v(e._s(e.InsideOutMap[t.xtype]))]),a("span",[e._v(e._s(e._f("filterDepText")(t)))])]),a("div",{staticClass:"operate"},[a("span",{directives:[{name:"show",rawName:"v-show",value:"out"===t.xtype,expression:"item.xtype === 'out'"}],staticClass:"update",on:{click:function(a){return e.handleUpdateRow(t,s)}}},[e._v("更新")]),a("span",{staticClass:"remove",on:{click:function(a){return e.handleRemoveRow(t,s)}}},[e._v("删除")])])]),a("div",{staticClass:"peers__row__foot"},[a("span",{staticClass:"name"},[e._v(e._s(t.name))])])])})),0),e.peerList.length>2?a("div",{staticClass:"peers__more"},[a("span",{on:{click:e.handleShowMore}},[e._v(e._s(e.isShowMore?"收起":"展开"))]),e.isShowMore?a("van-icon",{attrs:{size:14,name:"arrow-up"},on:{click:e.handleShowMore}}):a("van-icon",{attrs:{size:14,name:"arrow-down"},on:{click:e.handleShowMore}})],1):e._e()]:[a("div",{staticClass:"peers__emptybox"},[e._v(" 还未添加同行人员 ")])],a("van-action-sheet",{attrs:{actions:e.actions,"cancel-text":"取消","close-on-click-action":""},on:{select:e.handleActionSheetSelected},model:{value:e.actionSheetVisibility,callback:function(t){e.actionSheetVisibility=t},expression:"actionSheetVisibility"}})],2)},xe=[],be=(a("e17f"),a("2241"));const we={inside:"内部人员",out:"外部人员"};var ke={name:"Peers",computed:{peersListCom(){return this.isShowMore?[...this.peerList]:[...this.peerList.slice(0,2)]}},props:{value:{type:Array,require:!0}},created(){K["a"].$on("addOutPeersEvent",this.__listenChangePeersEvent__)},data(){return{InsideOutMap:we,isShowMore:!0,actionSheetVisibility:!1,actions:[{name:"内部人员",type:"in"},{name:"外部人员",type:"out"}],peerList:[]}},mounted(){this.renderValue()},methods:{__listenChangePeersEvent__(e){this.__handle_out_peers(e)},renderValue(){Array.isArray(this.value)&&this.value.length&&(this.peerList=[...this.value].map(e=>{let t={...e,xtype:e.is_who?"out":"inside"};return e[e.is_who?"remark":"selectDeptName"]=e.desc,t}))},async handleActionSheetSelected(e){const{type:t}=e;if("in"===t)try{const e=await Object(h["a"])({title:"请选择内部人员",multiple:!1,maxUsers:1,limitTips:"单次只可选择1人",pickedUsers:this.peerList.filter(e=>"inside"===e.xtype).map(e=>e.emplId),responseUserOnly:!1,startWithDepartmentId:0,deptId:-1});this.__handle_in_press__(e)}catch(a){console.log("err",a)}else"out"===t&&this.$router.push({name:"PeersOutForm"})},handleShowMore(){this.isShowMore=!this.isShowMore},handleUpdateRow(e,t){const{xtype:a}=e;console.log("handleUpdateRow",e,t),"out"===a&&this.$router.push({name:"PeersOutForm",query:{idx:e.idx,name:e.name,remark:e.remark,isUpdate:"1"}})},handleRemoveRow(e,t){be["a"].confirm({title:"温馨提示",message:`是否删除同行人员“${e.name}”`}).then(()=>{this.peerList.splice(t,1)})},handleAddPeerData(){this.actionSheetVisibility=!0},__handle_out_peers(e){if("1"==e.isUpdate){let t=this.peerList.findIndex(t=>t.idx===e.idx);this.peerList.splice(t,1,{...this.peerList[t],...e})}else this.peerList.push({idx:""+Date.now(),xtype:"out",...e})},__handle_in_press__(e){console.log("handle_in_press",e);const{users:t}=e;t.forEach(e=>{let t=this.peerList.findIndex(t=>t.emplId==e.emplId);t>=0?this.peerList[t]={...this.peerList[t],...e}:this.peerList.push({idx:Date.now(),xtype:"inside",...e})}),this.$emit("input",this.peerList)}},beforeDestroy(){K["a"].$off("__listenChangePeersEvent__",this.__listenChangePeersEvent__)},filters:{filterDepText(e){const{xtype:t}=e;return"inside"===t&&e.selectDeptName?`(${e.selectDeptName})`:"out"===t&&e.remark?`(${e.remark})`:""}},watch:{peerList:{handler(e){e.length&&this.$emit("input",e)}}}},Ce=ke,$e=(a("51db"),Object(y["a"])(Ce,ge,xe,!1,null,"3493da67",null)),Te=$e.exports,Ae=a("2f62"),Se={name:"IndexType5",mixins:[q],components:{Peers:Te},computed:{isApprove(){return"approve"===this.flag},...Object(Ae["c"])("user",["token","userinfo"]),...Object(Ae["b"])("enum",["getEvectionTypeList"])},data(){return{pageTitle:"出差申请",pageRightTitle:"我的出差",formType:5,awayArr:this.$store.state.enum.evectionTypeList,requiredKey:["reason","start_time","end_time","type"],way:"create",module:5,id:void 0,reason:"",start_time:"",end_time:"",type:void 0,document:[],images:[],remark:"",is_who:0,peer_user:[],approve_user:"",copy_user:"",apply_user_id:"",apply_user_name:""}},async created(){this.init(),this.token&&(this.apply_user_id=this.userinfo.userid,this.apply_user_name=this.userinfo.name)},methods:{init(){this.getCommonFlowPathData()},handleFormatEditData(e){const{module_info:t,peerUser:a}=e,{end_time:s,is_who:i,reason:o,remark:r,start_time:n,type:c}=t,d="approve"===this.flag;this.way=d?"edit":"update",this.id=d?e.approve_id:e.id,this.peer_user=a,this.reason=o,this.start_time=n,this.end_time=s,this.type=c,this.remark=r,this.is_who=i,e.apply_user&&(this.apply_user_id=e.apply_user.userid,this.apply_user_name=e.apply_user.name),Array.isArray(e.module_info.document_text)&&e.module_info.document_text.length&&(this.document=t.document.split(",").map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),Array.isArray(e.module_info.images_text)&&e.module_info.images_text.length&&(this.images=e.module_info.images_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),this.$nextTick(()=>{this.$refs.imageRef.handleUpdateValues(),this.$refs.documentRef.handleUpdateValues()})},handleSubmitData(){let e=this.__format_data__();console.log("format data>>>",e);let t=this.validate(e);t||(console.log("execute handleSubmitData"),this.__post__(e))},async __post__(e){try{const t=await Object(E["e"])(e);1===t.code&&(this.$toast(t.msg),"approve"===this.flag?this.$router.go(-1):this.__jump2apply_state__())}catch(t){console.log("it5, __post__",t)}},validate(e){let t={reason:"申请事由",start_time:"开始时间",end_time:"结束时间",type:"出差类型",is_who:"跨关内外"},a=["type","start_time","end_time","reason"];return this.__validtor__({mapTxt:t,requiredKey:a,data:e},(e,t,a)=>(1!=e.type||["0","1"].includes(String(e.is_who))||(t=!0,a="is_who"),[t,a]))},__format_data__(){let e={};try{e={way:this.way,module:5,reason:this.reason,start_time:this.start_time,end_time:this.end_time,type:this.type,document:"",images:"",remark:this.remark,is_who:this.is_who,peer_user:[],approve_user:this.approvePeople.map(e=>e.userid||e.emplId).join(","),copy_user:this.copyPeople.map(e=>e.userid||e.emplId).join(","),apply_user_id:this.apply_user_id};let t=this.images;Array.isArray(t)&&t.length&&(e.images=t.map(e=>e.url).join(","));let a=this.document;Array.isArray(a)&&a.length&&(e.document=a.map(e=>e.url).join(",")),Array.isArray(this.peer_user)&&this.peer_user.length&&(e.peer_user=this.peer_user.map(e=>({is_who:"inside"===e.xtype?0:1,name:e.name,desc:"inside"===e.xtype?e.selectDeptName:e.remark,user_id:e.emplId||e.user_id||""}))),this.id&&(e.id=this.id)}catch(t){console.log("%c IndexType5 format >>>","background: blue; color: #fff",t)}return e},async handleEditApplyofUser(){try{const e=await Object(h["a"])({title:"请选择出差申请人",multiple:!1,maxUsers:1,limitTips:"单次只可选择1人",responseUserOnly:!0,startWithDepartmentId:0,deptId:-1,showLabelPick:!1});let t=e.users;if(t.length){let{name:e,emplId:a}=t[0];this.apply_user_id=a,this.apply_user_name=e}else this.$toast("选择失败, 请重新选择")}catch(e){"Cancel"!==e.errorMessage&&this.$toast(e.message)}},handleRemoveApplyUser(){this.apply_user_id="",this.apply_user_name=""}},watch:{type:{handler(e,t){e&&e!==t&&this.getCommonFlowPathData({flow_item:e})},immediate:!0}}},De=Se,je=Object(y["a"])(De,ye,ve,!1,null,"1de377f4",null),Pe=je.exports,Le=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"type6-container"},[a("c-select-imitate",{attrs:{title:"申请人",value:e.apply_user_name,"hide-remove":"approve"===e.flag},on:{click:function(t){"approve"!==e.flag&&e.handleEditApplyofUser()},clear:e.handleRemoveApplyUser}}),a("c-select",{attrs:{title:"请假类型",required:!0,list:e.askForleaveTypeList,pickerValueKey:"name",pickerValueId:"id"},model:{value:e.type,callback:function(t){e.type=t},expression:"type"}}),"approve"===e.flag?a("c-select-imitate",{attrs:{title:"请假开始时间",required:!0,value:e.start_time,"hide-remove":"approve"===e.flag}}):a("c-date",{attrs:{title:"请假开始时间",required:!0,"has-am":!0},model:{value:e.start_time,callback:function(t){e.start_time=t},expression:"start_time"}}),"approve"===e.flag?a("c-select-imitate",{attrs:{title:"请假结束时间",required:!0,value:e.end_time,"hide-remove":"approve"===e.flag}}):a("c-date",{ref:"cdateEndTimeRef",attrs:{title:"请假结束时间",required:!0,"has-am":!0},model:{value:e.end_time,callback:function(t){e.end_time=t},expression:"end_time"}}),a("c-input",{attrs:{title:"请假时长(天)",placeholder:"自动填充请假时长",disabled:!0,"input-type":"number"},model:{value:e.time,callback:function(t){e.time=t},expression:"time"}}),a("c-input",{attrs:{title:"原因",required:!0,"input-type":"textarea",maxlength:300},model:{value:e.reason,callback:function(t){e.reason=t},expression:"reason"}}),a("c-files",{ref:"documentRef",attrs:{ctype:"files"},model:{value:e.document,callback:function(t){e.document=t},expression:"document"}}),a("c-files",{ref:"imageRef",attrs:{ctype:"images"},model:{value:e.images,callback:function(t){e.images=t},expression:"images"}}),a("c-input",{attrs:{title:"是否离“深”","input-type":"textarea",placeholder:"需写清目的地(到街道)、是否涉疫、出行方式及班次"},model:{value:e.remark,callback:function(t){e.remark=t},expression:"remark"}}),a("c-flow-path",{ref:"cFlowPathRef",attrs:{approve:e.approvePeople,copy:e.copyPeople,isAllowCopy:e.isCopy},on:{"update:copy":function(t){e.copyPeople=t}}})],1)},Oe=[],Ve={name:"IndexType6",mixins:[q],computed:{...Object(Ae["c"])("user",["token","userinfo"]),...Object(Ae["c"])("enum",{askForleaveTypeList:"leaveTypeList",timeList:"timeList"})},data(){return{pageTitle:"请假申请",pageRightTitle:"我的请假",way:"create",id:"",module:6,reason:"",type:"",document:[],images:[],remark:"",start_time:"",end_time:"",start_am:"",end_am:"",time:"",approve_user:[],copy_user:[],apply_user_id:"",apply_user_name:"",flow_item:""}},created(){let e=this.$route.query.asktype,t="1"==this.$route.query.edit;t||e?this.type=e:this.$router.replace({name:"AskForLeave"}),this.token&&(this.apply_user_id=this.userinfo.userid,this.apply_user_name=this.userinfo.name),this.init()},methods:{init(){this.getCommonFlowPathData()},handleGetAskLeaveTykpe(e){console.log("%c get type value >>>","background: blue; color: #fff",e)},handleFormatEditData(e){const{module_info:t}=e;console.log("%c edit data type6 >>>","background: blue; color: #fff",e);const a="approve"===this.flag;this.way=a?"edit":"update",this.id=a?e.approve_id:e.id,this.reason=t.reason,this.type=t.type,this.remark=t.remark,this.start_time=`${t.start_time} ${t.start_am}`,this.end_time=`${t.end_time} ${t.end_am}`,this.start_am=t.start_am,this.end_am=t.end_am,this.time=t.time,e.apply_user&&(this.apply_user_id=e.apply_user.userid,this.apply_user_name=e.apply_user.name),Array.isArray(e.module_info.document_text)&&e.module_info.document_text.length&&(this.document=t.document.split(",").map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),Array.isArray(e.module_info.images_text)&&e.module_info.images_text.length&&(this.images=e.module_info.images_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),this.$nextTick(()=>{this.$refs.imageRef.handleUpdateValues(),this.$refs.documentRef.handleUpdateValues()})},handleSubmitData(){let e=this.__format_data__();console.log("format data>>>",e);let t=this.validate(e);t||(console.log("execute handleSubmitData",e),this.__post__(e))},__format_data__(){let e={way:this.way,module:this.module,reason:this.reason,type:this.type,remark:this.remark,time:this.time,approve_user:this.approvePeople.map(e=>e.userid||e.emplId).join(","),copy_user:this.copyPeople.map(e=>e.userid||e.emplId).join(","),apply_user_id:this.apply_user_id};if(this.start_time){const[t,a]=this.start_time.split(" ");e.start_time=t,e.start_am=a}if(this.end_time){const[t,a]=this.end_time.split(" ");e.end_time=t,e.end_am=a}let t=this.images;Array.isArray(t)&&t.length&&(e.images=t.map(e=>e.url).join(","));let a=this.document;return Array.isArray(a)&&a.length&&(e.document=a.map(e=>e.url).join(",")),this.id&&(e.id=this.id),e},validate(e){let t={type:"请假类型",start_time:"开始时间",end_time:"结束时间",reason:"原因"},a=["type","start_time","end_time","reason"];return this.__validtor__({mapTxt:t,requiredKey:a,data:e})},async __post__(e){try{const t=await Object(E["e"])(e);1===t.code&&(this.$toast(t.msg),"approve"===this.flag?this.$router.go(-1):this.__jump2apply_state__())}catch(t){console.log("it5, __post__",t)}},__sum_days__(e,t){const[a,s]=e.split(" "),[i,o]=t.split(" ");let r=new Date(a),l=new Date(i),n=l.getTime()-r.getTime();if(!(n>=0))return"";{let e=n/864e5;if("上午"===s&&"上午"===o||"下午"===s&&"下午"===o)return""+(e+=.5);if("下午"===s&&"上午"===o)return""+e;if("上午"===s&&"下午"===o)return""+(e+=1)}},checkTimeAndGetFlow(){let e=this.start_time,t=this.end_time;if(!e||!t)return;let a="";this.time="",e===t?(a="半天",this.time="0.5"):e.split(" ")[0]===t.split(" ")[0]?(a="一天",this.time="1"):(a="一天以上",this.time=this.__sum_days__(e,t));let s=this.timeList.filter(e=>e.name===a),i=void 0;s.length&&(i=s[0].id,this.flow_item=i,this.getCommonFlowPathData({flow_item:i},()=>{this.$refs.cFlowPathRef.__render_a__(),this.$refs.cFlowPathRef.__render_c__()}))},async handleEditApplyofUser(){try{const e=await Object(h["a"])({title:"请选择请假申请人",multiple:!1,maxUsers:1,limitTips:"单次只可选择1人",responseUserOnly:!0,startWithDepartmentId:0,deptId:-1,showLabelPick:!1});let t=e.users;if(t.length){let{name:e,emplId:a}=t[0];this.apply_user_id=a,this.apply_user_name=e}else this.$toast("选择失败, 请重新选择")}catch(e){"Cancel"!==e.errorMessage&&this.$toast(e.message)}},handleRemoveApplyUser(){this.apply_user_id="",this.apply_user_name=""}},watch:{start_time(){this.checkTimeAndGetFlow()},end_time(e){if(this.start_time&&e){let t=this.start_time.split(" ")[0],a=e.split(" ")[0],s=new Date(t).getTime(),i=new Date(a).getTime();i<s&&(this.$toast("请假结束时间错误!"),this.end_time="",this.$refs.cdateEndTimeRef.reset())}this.checkTimeAndGetFlow()}}},Ie=Ve,Re=Object(y["a"])(Ie,Le,Oe,!1,null,"2d4e0911",null),qe=Re.exports,Ee=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"type6-container"},[a("c-select-imitate",{attrs:{title:"申请人",value:e.apply_user_name,"hide-remove":"approve"===e.flag},on:{click:e.handleEditApplyofUser,clear:e.handleRemoveApplyUser}}),a("div",{staticClass:"group-box"},[a("div",{staticClass:"group__title"},[e._v("用车信息")]),a("c-input",{attrs:{title:"出发地点",required:!0},model:{value:e.reason,callback:function(t){e.reason=t},expression:"reason"}}),a("c-date",{attrs:{title:"出发时间",required:!0},model:{value:e.start_time,callback:function(t){e.start_time=t},expression:"start_time"}})],1),a("div",{staticClass:"group-box m-t-10"},[a("c-input",{attrs:{title:"到达地点",required:!0},model:{value:e.reach_address,callback:function(t){e.reach_address=t},expression:"reach_address"}}),a("c-date",{attrs:{title:"返回时间"},model:{value:e.end_time,callback:function(t){e.end_time=t},expression:"end_time"}}),a("c-input",{attrs:{title:"返回地点"},model:{value:e.end_address,callback:function(t){e.end_address=t},expression:"end_address"}})],1),a("c-files",{ref:"documentRef",attrs:{ctype:"files"},model:{value:e.document,callback:function(t){e.document=t},expression:"document"}}),a("c-files",{ref:"imageRef",attrs:{ctype:"images"},model:{value:e.images,callback:function(t){e.images=t},expression:"images"}}),a("c-flow-path",{attrs:{approve:e.approvePeople,copy:e.copyPeople,isAllowCopy:e.isCopy},on:{"update:copy":function(t){e.copyPeople=t}}})],1)},Ue=[],Fe={name:"IndexType7",mixins:[q],computed:{...Object(Ae["c"])("user",["token","userinfo"])},data(){return{pageTitle:"用车申请",pageRightTitle:"我的用车",way:"create",id:"",module:7,reason:"",start_time:"",end_time:"",document:[],images:[],reach_address:"",end_address:"",approve_user:[],copy_user:[],apply_user_id:"",apply_user_name:""}},created(){this.getCommonFlowPathData(),this.token&&(this.apply_user_id=this.userinfo.userid,this.apply_user_name=this.userinfo.name)},methods:{handleFormatEditData(e){const{module_info:t}=e;console.log("%c edit data type6 >>>","background: blue; color: #fff",e);const a="approve"===this.flag;this.way=a?"edit":"update",this.id=a?e.approve_id:e.id,this.reason=t.reason,this.start_time=t.start_time,this.end_time=t.end_time,this.reach_address=t.reach_address,this.end_address=t.end_address,e.apply_user&&(this.apply_user_id=e.apply_user.userid,this.apply_user_name=e.apply_user.name),Array.isArray(e.module_info.document_text)&&e.module_info.document_text.length&&(this.document=t.document.split(",").map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),Array.isArray(e.module_info.images_text)&&e.module_info.images_text.length&&(this.images=e.module_info.images_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),this.$nextTick(()=>{this.$refs.imageRef.handleUpdateValues(),this.$refs.documentRef.handleUpdateValues()})},handleSubmitData(){let e=this.__format_data__();console.log("format data>>>",e);let t=this.validate(e);t||(console.log("execute handleSubmitData",e),this.__post__(e))},__format_data__(){let e={way:this.way,module:this.module,reason:this.reason,reach_address:this.reach_address,end_address:this.end_address,approve_user:this.approvePeople.map(e=>e.userid||e.emplId).join(","),copy_user:this.copyPeople.map(e=>e.userid||e.emplId).join(","),apply_user_id:this.apply_user_id,start_time:this.start_time,end_time:this.end_time},t=this.images;Array.isArray(t)&&t.length&&(e.images=t.map(e=>e.url).join(","));let a=this.document;return Array.isArray(a)&&a.length&&(e.document=a.map(e=>e.url).join(",")),this.id&&(e.id=this.id),e},validate(e){let t={start_time:"出发时间",end_time:"返回时间",reason:"出发地点"},a=["reason","start_time","reach_address"];return this.__validtor__({mapTxt:t,requiredKey:a,data:e})},async __post__(e){try{const t=await Object(E["e"])(e);1===t.code&&(this.$toast(t.msg),"approve"===this.flag?this.$router.go(-1):this.__jump2apply_state__())}catch(t){console.log("it5, __post__",t)}},async handleEditApplyofUser(){try{const e=await Object(h["a"])({title:"请选择用车申请人",multiple:!1,maxUsers:1,limitTips:"单次只可选择1人",responseUserOnly:!0,startWithDepartmentId:0,deptId:-1,showLabelPick:!1});let t=e.users;if(t.length){let{name:e,emplId:a}=t[0];this.apply_user_id=a,this.apply_user_name=e}else this.$toast("选择失败, 请重新选择")}catch(e){"Cancel"!==e.errorMessage&&this.$toast(e.message)}},handleRemoveApplyUser(){this.apply_user_id="",this.apply_user_name=""}}},Me=Fe,Ne=Object(y["a"])(Me,Ee,Ue,!1,null,"59f5dfae",null),ze=Ne.exports,Ke=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"type6-container"},[a("div",{staticClass:"group-box"},[a("div",{staticClass:"group__title"},[e._v("报修信息")]),"approve"===e.flag?a("c-select-imitate",{attrs:{title:"维修分类",value:e.getMaintainText(e.type),"hide-remove":"approve"===e.flag}}):a("c-select",{attrs:{title:"维修分类",required:!0,list:e.maintainTypeList,pickerValueKey:"name",pickerValueId:"id"},model:{value:e.type,callback:function(t){e.type=t},expression:"type"}}),a("c-input",{attrs:{title:"维修地点",required:!0},model:{value:e.reason,callback:function(t){e.reason=t},expression:"reason"}})],1),a("c-input",{attrs:{title:"具体内容",required:!0,"input-type":"textarea",maxlength:800},model:{value:e.desc,callback:function(t){e.desc=t},expression:"desc"}}),a("c-files",{ref:"imageM8Ref",attrs:{ctype:"images",placeholder:"最多九张"},model:{value:e.images,callback:function(t){e.images=t},expression:"images"}}),a("c-flow-path",{attrs:{approve:e.approvePeople,copy:e.copyPeople,isAllowCopy:e.isCopy},on:{"update:copy":function(t){e.copyPeople=t}}})],1)},Be=[],Ge={name:"IndexType8",mixins:[q],computed:{...Object(Ae["b"])("enum",["getMaintainText"])},data(){return{pageTitle:"维修申请",pageRightTitle:"我的维修",maintainTypeList:this.$store.state.enum.maintainTypeList,way:"create",id:"",module:8,reason:"",type:"",desc:"",images:[],approve_user:[],copy_user:[]}},created(){this.getCommonFlowPathData()},methods:{handleFormatEditData(e){console.log("%c edit data type8 >>>","background: blue; color: #fff",e);const t="approve"===this.flag;this.way=t?"edit":"update",this.id=t?e.approve_id:e.id,this.reason=e.reason,this.desc=e.desc,this.type=e.type,e.module_info.images&&(this.images=e.module_info.images_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),this.$nextTick(()=>{this.$refs.imageM8Ref.handleUpdateValues()})},handleSubmitData(){let e=this.__format_data__();console.log("format data>>>",e);let t=this.validate(e);t||(console.log("execute handleSubmitData",e),this.__post__(e))},__format_data__(){let e={way:this.way,module:this.module,reason:this.reason,type:this.type,desc:this.desc,approve_user:this.approvePeople.map(e=>e.userid||e.emplId).join(","),copy_user:this.copyPeople.map(e=>e.userid||e.emplId).join(",")};return Array.isArray(this.images)&&this.images.length&&(e.images=this.images.map(e=>e.url).join(",")),this.id&&(e.id=this.id),e},validate(e){let t={type:"维修分类",reason:"维修地点",desc:"具体内容"},a=["type","reason","desc"];return this.__validtor__({mapTxt:t,requiredKey:a,data:e})},async __post__(e){try{const t=await Object(E["e"])(e);1===t.code&&(this.$toast(t.msg),"approve"===this.flag?this.$router.go(-1):this.__jump2apply_state__())}catch(t){console.log("it5, __post__",t)}}},watch:{type:{handler(e,t){e&&e!==t&&this.getCommonFlowPathData({flow_item:e})},immediate:!0}}},He=Ge,Ye=Object(y["a"])(He,Ke,Be,!1,null,"fcb80678",null),Je=Ye.exports,We=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"type6-container"},[e.apply_id||"create"!==e.way?[a("c-select-imitate",{attrs:{required:!0,title:"合同类型",value:e.getContractTypeList(e.type),"hide-remove":!0}})]:[a("c-select",{attrs:{title:"合同类型",required:!0,list:e.contractTypeList,pickerValueKey:"name",pickerValueId:"id"},model:{value:e.type,callback:function(t){e.type=t},expression:"type"}})],e.apply_id?a("c-select-imitate",{attrs:{title:"关联申购申请-采购订单",value:e.apply_order_no,"hide-remove":!0}}):e._e(),a("c-select",{attrs:{title:"缓急程度",required:!0,list:e.degreeList,pickerValueKey:"name",pickerValueId:"id"},model:{value:e.desc,callback:function(t){e.desc=t},expression:"desc"}}),a("c-input",{attrs:{title:"印制份数","input-type":"number"},model:{value:e.number,callback:function(t){e.number=t},expression:"number"}}),a("c-input",{attrs:{title:"发放范围",placeholder:"请输入发放范围,比如合同双方"},model:{value:e.scope,callback:function(t){e.scope=t},expression:"scope"}}),a("c-input",{attrs:{title:"法务意见",placeholder:"本合同已经法律顾问审核同意,详见附件《法律意见书》"},model:{value:e.legal_opinion,callback:function(t){e.legal_opinion=t},expression:"legal_opinion"}}),a("c-files",{ref:"fileRef",attrs:{ctype:"files"},model:{value:e.document,callback:function(t){e.document=t},expression:"document"}}),a("c-input",{attrs:{title:"备注说明"},model:{value:e.remark,callback:function(t){e.remark=t},expression:"remark"}}),a("c-flow-path",{attrs:{approve:e.approvePeople,copy:e.copyPeople,isAllowCopy:e.isCopy},on:{"update:copy":function(t){e.copyPeople=t}}})],2)},Qe=[],Xe={name:"IndexType9",mixins:[q],computed:{...Object(Ae["b"])("enum",["getContractTypeList"])},data(){return{pageTitle:"合同呈批",pageRightTitle:"我的呈批",contractTypeList:this.$store.state.enum.contractTypeList,degreeList:this.$store.state.enum.degreeList,way:"create",id:"",module:9,type:"",desc:"",document:[],remark:"",number:"",scope:"",legal_opinion:"",approve_user:[],copy_user:[],apply_id:0,apply_order_no:""}},created(){this.getCommonFlowPathData(),this.$route.query.order_no&&(this.apply_id=""+this.$route.query.apply_id,this.apply_order_no=""+this.$route.query.order_no,this.type="1")},methods:{handleFormatEditData(e){console.log("%c edit data type9 >>>","background: blue; color: #fff",e);const t="approve"===this.flag;this.way=t?"edit":"update",this.id=t?e.approve_id:e.id,this.module=e.module;const a=e.module_info;Array.isArray(e.module_info.document_text)&&e.module_info.document_text.length&&(this.document=e.module_info.document_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),this.reason=a.reason,this.type=a.type,this.desc=a.desc,this.remark=a.remark,this.number=""+a.number,this.scope=a.scope,this.legal_opinion=a.legal_opinion,e.apply&&(this.apply_id=e.apply.id,this.apply_order_no=e.apply.order_no),this.$nextTick(()=>{this.$refs.fileRef.handleUpdateValues()})},handleSubmitData(){let e=this.__format_data__();console.log("format data>>>",e);let t=this.validate(e);t||(console.log("execute handleSubmitData",e),this.__post__(e))},__format_data__(){let e={way:this.way,module:this.module,reason:this.reason,type:this.type,desc:this.desc,remark:this.remark,number:this.number,scope:this.scope,legal_opinion:this.legal_opinion,apply_id:this.apply_id,approve_user:this.approvePeople.map(e=>e.userid||e.emplId).join(","),copy_user:this.copyPeople.map(e=>e.userid||e.emplId).join(",")},t=this.document;return Array.isArray(t)&&t.length&&(e.document=t.map(e=>e.url).join(",")),this.id&&(e.id=this.id),e},validate(e){let t={type:"合同类型",desc:"缓急程度",legal_opinion:"法务意见"},a=["type","desc","legal_opinion"];return this.__validtor__({mapTxt:t,requiredKey:a,data:e})},async __post__(e){try{const t=await Object(E["e"])(e);1===t.code&&(this.$toast(t.msg),"approve"===this.flag?this.$router.go(-1):this.__jump2apply_state__())}catch(t){console.log("it5, __post__",t)}}}},Ze=Xe,et=Object(y["a"])(Ze,We,Qe,!1,null,"4430d763",null),tt=et.exports,at=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"type6-container"},[a("c-input",{attrs:{title:"创建人"},model:{value:e.founder,callback:function(t){e.founder=t},expression:"founder"}}),a("c-input",{attrs:{title:"来文单位名称",required:!0},model:{value:e.desc,callback:function(t){e.desc=t},expression:"desc"}}),a("c-input",{attrs:{title:"收文序号",required:!0},model:{value:e.serial_number,callback:function(t){e.serial_number=t},expression:"serial_number"}}),a("c-input",{attrs:{title:"文件名称"},model:{value:e.reason,callback:function(t){e.reason=t},expression:"reason"}}),a("c-date",{attrs:{title:"收文日期",required:!0},model:{value:e.start_time,callback:function(t){e.start_time=t},expression:"start_time"}}),a("c-input",{attrs:{title:"内容摘要","input-type":"textarea"},model:{value:e.remark,callback:function(t){e.remark=t},expression:"remark"}}),a("c-select",{attrs:{title:"缓急程度",required:!0,list:e.degreeList,pickerValueKey:"name",pickerValueId:"id"},model:{value:e.degree,callback:function(t){e.degree=t},expression:"degree"}}),a("c-files",{ref:"fileRef",attrs:{ctype:"files"},model:{value:e.document,callback:function(t){e.document=t},expression:"document"}}),a("c-flow-path",{attrs:{approve:e.approvePeople,copy:e.copyPeople,isAllowCopy:e.isCopy},on:{"update:copy":function(t){e.copyPeople=t}}})],1)},st=[],it={name:"IndexType10",mixins:[q],data(){return{pageTitle:"收文批阅",pageRightTitle:"我的批阅",degreeList:this.$store.state.enum.degreeList,way:"create",id:"",module:10,reason:"",desc:"",document:[],remark:"",founder:"",serial_number:"",start_time:"",degree:"",approve_user:[],copy_user:[]}},created(){this.getCommonFlowPathData()},methods:{handleFormatEditData(e){console.log("%c edit data type10 >>>","background: blue; color: #fff",e);const t="approve"===this.flag;this.way=t?"edit":"update",this.id=t?e.approve_id:e.id,this.module=e.module;const a=e.module_info;Array.isArray(e.module_info.document_text)&&e.module_info.document_text.length&&(this.document=e.module_info.document_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),this.reason=a.reason,this.desc=a.desc,this.remark=a.remark,this.founder=a.founder,this.serial_number=a.serial_number,this.start_time=a.start_time,this.degree=a.degree,this.$nextTick(()=>{this.$refs.fileRef.handleUpdateValues()})},handleSubmitData(){let e=this.__format_data__();console.log("format data>>>",e);let t=this.validate(e);t||(console.log("execute handleSubmitData",e),this.__post__(e))},__format_data__(){let e={way:this.way,module:this.module,reason:this.reason,desc:this.desc,remark:this.remark,founder:this.founder,serial_number:this.serial_number,start_time:this.start_time,degree:this.degree,approve_user:this.approvePeople.map(e=>e.userid||e.emplId).join(","),copy_user:this.copyPeople.map(e=>e.userid||e.emplId).join(",")},t=this.document;return Array.isArray(t)&&t.length&&(e.document=t.map(e=>e.url).join(",")),this.id&&(e.id=this.id),e},validate(e){let t={desc:"来文单位名称",serial_number:"收文序号",start_time:"收文日期",degree:"缓急程度"},a=["desc","serial_number","start_time","degree"];return this.__validtor__({mapTxt:t,requiredKey:a,data:e})},async __post__(e){try{const t=await Object(E["e"])(e);1===t.code&&(this.$toast(t.msg),"approve"===this.flag?this.$router.go(-1):this.__jump2apply_state__())}catch(t){console.log("it5, __post__",t)}}}},ot=it,rt=Object(y["a"])(ot,at,st,!1,null,"8d263a72",null),lt=rt.exports,nt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"type6-container"},[a("c-select-imitate",{attrs:{title:"拟稿部门",required:!0,value:e.department},on:{click:function(t){return e.handleChooseDepartments("department")},clear:function(t){return e.handleRemoveDepartment("department")}}}),a("c-input",{attrs:{title:"文件名称",required:!0},model:{value:e.reason,callback:function(t){e.reason=t},expression:"reason"}}),a("c-select-imitate",{attrs:{title:"落款",required:!0,value:e.department_sign},on:{click:function(t){return e.handleChooseDepartments("department_sign")},clear:function(t){return e.handleRemoveDepartment("department_sign")}}}),a("c-input",{attrs:{title:"上会情况","input-type":"textarea"},model:{value:e.remark,callback:function(t){e.remark=t},expression:"remark"}}),a("c-files",{ref:"fileRef",attrs:{ctype:"files"},model:{value:e.document,callback:function(t){e.document=t},expression:"document"}}),a("c-select",{attrs:{title:"缓急程度",required:!0,list:e.degreeList,pickerValueKey:"name",pickerValueId:"id"},model:{value:e.desc,callback:function(t){e.desc=t},expression:"desc"}}),a("c-date",{attrs:{title:"拟发文时间",required:!0},model:{value:e.start_time,callback:function(t){e.start_time=t},expression:"start_time"}}),a("c-input",{attrs:{title:"文件号",required:!0},model:{value:e.serial_number,callback:function(t){e.serial_number=t},expression:"serial_number"}}),a("c-flow-path",{attrs:{approve:e.approvePeople,copy:e.copyPeople,isAllowCopy:e.isCopy},on:{"update:copy":function(t){e.copyPeople=t}}})],1)},ct=[],dt={name:"IndexType11",mixins:[q],data(){return{pageTitle:"学校文件",pageRightTitle:"我的文件",degreeList:this.$store.state.enum.degreeList,way:"create",id:"",module:11,reason:"",desc:"",document:[],remark:"",serial_number:"",start_time:"",department:"",department_id:"",department_sign:"",department_sign_id:"",approve_user:[],copy_user:[]}},created(){this.getCommonFlowPathData()},methods:{handleFormatEditData(e){console.log("%c edit data type6 >>>","background: blue; color: #fff",e);const t="approve"===this.flag;this.way=t?"edit":"update",this.id=t?e.approve_id:e.id,this.module=e.module;const a=e.module_info;Array.isArray(e.module_info.document_text)&&e.module_info.document_text.length&&(this.document=e.module_info.document_text.map(e=>{const{name:t=""}=Object(l["f"])(e);return{name:t,url:e}})),this.reason=a.reason,this.desc=a.desc,this.remark=a.remark,this.serial_number=a.serial_number,this.start_time=a.start_time,this.department=a.department,this.department_sign=a.department_sign,this.$nextTick(()=>{this.$refs.fileRef.handleUpdateValues()})},handleSubmitData(){let e=this.__format_data__();console.log("format data>>>",e);let t=this.validate(e);t||(console.log("execute handleSubmitData",e),this.__post__(e))},__format_data__(){let e={way:this.way,module:this.module,reason:this.reason,desc:this.desc,remark:this.remark,serial_number:this.serial_number,start_time:this.start_time,department:this.department,department_sign:this.department_sign,approve_user:this.approvePeople.map(e=>e.userid||e.emplId).join(","),copy_user:this.copyPeople.map(e=>e.userid||e.emplId).join(",")},t=this.document;return Array.isArray(t)&&t.length&&(e.document=t.map(e=>e.url).join(",")),this.id&&(e.id=this.id),e},validate(e){let t={department:"拟稿部门",reason:"文件名称",department_sign:"落款",desc:"缓急程度",start_time:"拟发文时间",serial_number:"文件号"},a=["department","reason","department_sign","desc","start_time","serial_number"];return this.__validtor__({mapTxt:t,requiredKey:a,data:e})},async __post__(e){try{const t=await Object(E["e"])(e);1===t.code&&(this.$toast(t.msg),"approve"===this.flag?this.$router.go(-1):this.__jump2apply_state__())}catch(t){console.log("it5, __post__",t)}},async handleChooseDepartments(e){try{const t=await Object(h["b"])({title:"请选择部门",multiple:!1,maxDepartments:1,limitTips:"只能选择一个部门",pickedDepartments:[this[e+"_id"]]});console.log("%c handleChooseDepartments >>>","background: blue; color: #fff",t);let a=t.departments;if(a.length>=2){let{name:t,id:s}=a[1];this[e+"_id"]=s,this[""+e]=t}else this.$toast("选择失败, 请重新选择")}catch(t){"Cancel"!==t.errorMessage&&this.$toast(t.message)}},handleRemoveDepartment(e){this[e+"_id"]="",this[""+e]=""}}},pt=dt,ut=Object(y["a"])(pt,nt,ct,!1,null,null,null),mt=ut.exports,ht=a("b429"),_t=a("4360"),ft={beforeRouteEnter(e,t,a){_t["a"].commit({type:"app/ROUTE_ADD",value:"Applyfor"}),a()},beforeRouteLeave(e,t,a){e.path.includes("applyfor")&&_t["a"].commit({type:"app/ROUTE_ADD",value:"Applyfor"}),a()},name:"Applyfor",components:{IndexType1:X,IndexType2:ie,IndexType3:de,IndexType4:fe,IndexType5:Pe,IndexType6:qe,IndexType7:ze,IndexType8:Je,IndexType9:tt,IndexType10:lt,IndexType11:mt},computed:{renderComponent(){const e=this.formType;return"IndexType"+e}},created(){this.$route.query.type&&(this.formType=Number(this.$route.query.type)),1==this.$route.query.edit&&(this.editId=Number(this.$route.query.id),this.isEdit=!0,this.flag=this.$route.query.flag),this.init()},data(){return{formType:-1,flag:"",isEdit:!1,editId:-1,editData:null}},methods:{init(){this.isEdit&&this.__detail__()},async __detail__(){try{const e="info"===this.flag?E["c"]:ht["c"];let t="info"===this.flag?"id":"approve_id";const a={[t]:this.editId},s=await e(a);1===s.code&&(this.editData=s.data)}catch(e){console.log("aplyof error >>>",e)}},handleSubmitData(){let e=this.$refs.rendeRef.handleSubmitData;e&&e()}}},yt=ft,vt=(a("dee6"),Object(y["a"])(yt,s,i,!1,null,null,null));t["default"]=vt.exports},"51db":function(e,t,a){"use strict";a("9344")},"56dc":function(e,t,a){"use strict";a("657e")},"657e":function(e,t,a){},"805d":function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"approve-container flex flex-col"},[a("van-tabs",{attrs:{"before-change":e.handleTabBeforeChangeEvnet},model:{value:e.tabVal,callback:function(t){e.tabVal=t},expression:"tabVal"}},e._l(e.tabs,(function(e,t){return a("van-tab",{key:t,attrs:{title:e.title,name:e.name,color:"#000"}})})),1),a("div",{staticClass:"filter-container p-h-12 flex flex-row flex-row-aic"},[a("van-field",{attrs:{clearable:"",placeholder:"搜索","left-icon":"search",disabled:!0,readonly:!0},on:{click:e.handleClickSearchBox},model:{value:e.searchVal,callback:function(t){e.searchVal=t},expression:"searchVal"}}),a("div",{class:["filterbox flex flex-row flex-0shrink",e.hasFilter?"filterbox--sel":""],on:{click:function(){return e.popupVisibility=!0}}},[a("van-icon",{attrs:{name:"filter-o",size:"20"}}),a("span",[e._v("筛选")])],1)],1),a("div",{staticClass:"approve-main"},[a("van-list",{attrs:{finished:e.finished,"finished-text":e.finishedText},on:{load:e.onLoadData},model:{value:e.listLoading,callback:function(t){e.listLoading=t},expression:"listLoading"}},e._l(e.tableData,(function(t,s){return a("approve-item",{key:s,attrs:{"approve-type":"xx",title:e.rendeTitleCom,time:t.apply_date,rows:t.__rows_item__,person:t.approve_one?t.approve_one.user.name:"",flag:"info","flag-state":Number(t.status)},on:{click:function(a){return e.handleGoInfo(t)}}})})),1),a("my-empty",{directives:[{name:"show",rawName:"v-show",value:e.showEmpty,expression:"showEmpty"}],attrs:{tip:"暂无数据"}})],1),a("van-popup",{staticClass:"popupxx",style:{height:"60%"},attrs:{position:"bottom",closeable:"","close-icon-position":"top-left"},on:{"click-close-icon":e.handleClosePopup},model:{value:e.popupVisibility,callback:function(t){e.popupVisibility=t},expression:"popupVisibility"}},[a("div",[a("div",{staticClass:"popup__title"},[e._v("全部筛选")]),a("div",{staticClass:"popup__rangetime"},[a("div",{staticClass:"popup__typebox__header"},[a("span",[e._v("申请时间")])]),a("div",{staticClass:"popup__rangetime__main flex flex-row flex-row-aic"},[a("van-field",{attrs:{value:e.timeStart,disabled:!0,clearable:"",placeholder:"开始时间",center:!0},on:{click:e.handleClickTimeStart}}),a("span",{staticClass:"horization"}),a("van-field",{attrs:{value:e.timeEnd,disabled:!0,clearable:"",placeholder:"结束时间",center:!0},on:{click:e.handleClickTimeEnd}})],1)])]),a("div",{staticClass:"btn-popup",on:{click:e.handleSubmitFilter}},[a("span",[e._v("搜索")])])]),a("ChooseTime",{ref:"chooseTimeRef",attrs:{"min-date":e.minDate,"max-date":e.maxDate},model:{value:e.timeVal,callback:function(t){e.timeVal=t},expression:"timeVal"}})],1)},i=[],o=(a("14d9"),a("4920")),r=a("120e"),l=a("aa58"),n=a("4360"),c=a("5a0c"),d=a.n(c),p=a("b549"),u=a("3842"),m=a("60fe"),h={nameText:"我的申请状态",name:"ApplyState",components:{ApproveItem:l["a"],ChooseTime:o["a"]},computed:{hasFilter(){return this.timeStart&&this.timeEnd},rendeTitleCom(){let e=this.formType,t=n["a"].getters.name+"提交的";return e>=1&&e<=11&&(t=`${t}${m["b"][e]}`),t}},data(){return{timeVal:"",formType:void 0,popupVisibility:!1,tabVal:"2",tabs:[{title:"审批中",name:"2"},{title:"已通过",name:"3"},{title:"已驳回",name:"4"},{title:"已撤销",name:"5"}],searchVal:"",timeStart:"",timeEnd:"",pagination:{page:1,page_num:10},showEmpty:!1,listLoading:!1,finished:!1,finishedText:"暂无更多数据",tableData:[],minDate:"",maxDate:""}},created(){this.navigationSetting(),this.handleNavigationRight(),this.$route.query&&(this.formType=this.$route.query.type),this.init()},methods:{navigationSetting(){let e=this.formType,t="申请列表";e>=1&&e<=11&&(t=m["b"][e]),Object(u["f"])({title:"我的"+t})},handleNavigationRight(){Object(u["e"])({show:!1})},init(){let e=new Date;e.setMonth(e.getMonth()-7),this.minDate=e;let t=new Date;this.maxDate=t},async __record_list__(){try{let e=this;const t={group:"list",module:this.formType,status:Number(this.tabVal),...this.pagination};this.timeStart&&this.timeEnd&&(t.start_time=this.timeStart,t.end_time=this.timeEnd);const a=await Object(r["d"])(t);if(1===a.code){this.listLoading=!1;let t=a.data||[];t=t.map(t=>({...t,__rows_item__:Object(p["a"])(t,e.formType)})),t.length<this.pagination.page_num?this.finished=!0:this.pagination.page++,this.tableData=this.tableData.concat(t),this.finished&&!this.tableData.length&&(this.finishedText="",this.showEmpty=!0)}}catch(e){console.log("record list",e)}},onLoadData(){this.__record_list__()},handleTabBeforeChangeEvnet(e){return this.tabVal=e,this.showEmpty=!1,this.tableData=[],this.listLoading=!0,this.finished=!1,this.finishedText="暂无更多数据",this.pagination.page=1,this.onLoadData(),!0},handleClickTimeStart(){const e=this;e.timeVal=""+e.timeStart,this.$refs.chooseTimeRef.openChooseTime(t=>{e.timeStart=d()(t).format("YYYY-MM-DD HH:mm")})},handleClickTimeEnd(){const e=this;e.timeVal=""+e.timeEnd,this.$refs.chooseTimeRef.openChooseTime(t=>{e.timeEnd=d()(t).format("YYYY-MM-DD HH:mm")})},handleTouchThatType(e){const{name:t}=e;this.typeVal=t},handleClickSearchBox(){this.$router.push({name:"Search",query:{formType:this.formType,flag:"info",flagState:this.tabVal}})},handleSwitchFilterBox(){},handleSubmitFilter(){let e=new Date(this.timeStart).getTime(),t=new Date(this.timeEnd).getTime();t<=e?this.$toast("结束时间不可以比开始时间小"):(this.popupVisibility=!1,this.showEmpty=!1,this.tableData=[],this.listLoading=!0,this.finished=!1,this.finishedText="暂无更多数据",this.pagination.page=1,this.onLoadData())},handleGoInfo(e){console.log("goInfo>",e),this.$router.push({name:"ExamineDetail",query:{id:e.id,type:"info"}})},handleClosePopup(){this.timeStart="",this.timeEnd=""}}},_=h,f=(a("93cf"),a("2877")),y=Object(f["a"])(_,s,i,!1,null,"3123ab97",null);t["default"]=y.exports},8897:function(e,t,a){"use strict";a("ab2b")},"8c5a":function(e,t,a){},"8f7d":function(e,t,a){},9344:function(e,t,a){},"93cf":function(e,t,a){"use strict";a("1e66")},ab2b:function(e,t,a){},c983:function(e,t,a){},d77e:function(e,t,a){"use strict";var s=a("2b0e");const i=new s["default"];t["a"]=i},d8fd:function(e,t,a){"use strict";a("c983")},dd8d:function(e,t,a){},dee6:function(e,t,a){"use strict";a("8c5a")},e1c5:function(e,t,a){"use strict";a("dd8d")},e536:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"peers-out-form-container flex flex-col"},[a("div",{staticClass:"content"},[a("c-input",{attrs:{title:"同行姓名"},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}}),a("c-input",{attrs:{title:"备注","input-type":"textarea",maxlength:20},model:{value:e.remark,callback:function(t){e.remark=t},expression:"remark"}})],1),a("div",{staticClass:"btn-container"},[a("div",{staticClass:"btn-span",on:{click:e.handleConfirmSub}},[e._v("确认")])])])},i=[],o=a("7fe3"),r=a("d77e"),l=a("3842"),n={components:{CInput:o["a"]},data(){return{name:"",remark:""}},created(){this.navigationSetting();let e=this.$route.query;e&&(this.name=e.name||"",this.remark=e.remark||"")},methods:{navigationSetting(){Object(l["e"])({show:!1})},handleConfirmSub(){if(!this.name)return this.$toast("请填写同行人姓名");if(!this.remark)return this.$toast("请填写备注");let e={name:this.name,remark:this.remark},t=this.$route.query;t&&"1"==t.isUpdate&&(e={...this.$route.query,...e}),r["a"].$emit("addOutPeersEvent",e),this.$router.go(-1)}}},c=n,d=(a("d8fd"),a("2877")),p=Object(d["a"])(c,s,i,!1,null,"1cb06513",null);t["default"]=p.exports},f71f:function(e,t,a){}}]);
- //# sourceMappingURL=index.bd1b48f2.js.map
|