1 line
4.7 KiB
JavaScript
1 line
4.7 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/groupCompany/cost/editCost"],{"056b":function(e,t,i){"use strict";(function(e,t){var n=i("4ea4");i("8886");n(i("66fd"));var o=n(i("f000"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(o.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])},"117b":function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return a})),i.d(t,"a",(function(){return n}));var n={uActionSheet:function(){return i.e("uview-ui/components/u-action-sheet/u-action-sheet").then(i.bind(null,"b13b"))}},o=function(){var e=this.$createElement,t=(this._self._c,this.imgList.length);this.$mp.data=Object.assign({},{$root:{g0:t}})},a=[]},a6ed:function(e,t,i){"use strict";i.r(t);var n=i("ced3"),o=i.n(n);for(var a in n)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(a);t["default"]=o.a},ab9a:function(e,t,i){"use strict";var n=i("c77c"),o=i.n(n);o.a},c77c:function(e,t,i){},ced3:function(e,t,i){"use strict";(function(e,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i("76dd"),a=i("0c59"),s=i("dc92"),c=i("8683"),u={mixins:[c.commonF],components:{fixedApproval:function(){i.e("components/fixedApproval").then(function(){return resolve(i("d3f7"))}.bind(null,i)).catch(i.oe)}},data:function(){return{id:"",customer_id:"",consume_time:"",consume_type:"",money:"",remark:"",file_ids:"",BASE_IMG_URL:a.BASE_IMG_URL,typeList:[],DefaultRemind:[],remindPeople:[],remindType:"contract",imgList:[],uploadShow:!1,uploadActions:[{id:1,text:"拍照",color:"#03aa96"},{id:2,text:"从相册中选择",color:"#03aa96"}],show:!1,approvalPro:{}}},onLoad:function(e){this.id=e.id,this.getDetail(),this.getProcess()},onShow:function(){this.getType()},methods:{getProcess:function(){var e=this;(0,s.netApprovalProcess)({type:"consume"}).then((function(t){e.approvalPro=t.data}))},getDetail:function(){var e=this;(0,o.netCostDetail)({id:this.id}).then((function(t){t=t.data,e.consume_time=t.consume_time,e.consume_type=t.consume_type,e.money=t.money,e.remark=t.remark,e.imgList=t.files,e.customer_id=t.customer_id}))},getType:function(){var e=this;(0,o.netSelect)().then((function(t){e.typeList=t.data["消费方式"]}))},changeTime:function(e){this.consume_time=e.detail.value},changeType:function(e){this.consume_type=this.typeList[e.detail.value]},uploadClick:function(){this.uploadShow=!0},onCancel:function(){this.uploadShow=!1},uploadType:function(t){var i=this;0==t?e.chooseImage({sourceType:["camera"],sizeType:["compressed"],success:function(e){var t=e.tempFilePaths;t.forEach((function(e){i.uploadFile(e,1)}))}}):1==t?e.chooseImage({sourceType:["album"],sizeType:["compressed"],success:function(e){var t=e.tempFilePaths;t.forEach((function(e){i.uploadFile(e,1)}))}}):n.chooseMessageFile({count:1,type:"file",success:function(e){var t=e.tempFiles[0];i.uploadFile(t,2)},fail:function(e){console.log(e)}})},uploadFile:function(t,i){var n=this;e.uploadFile({url:s.uploadUrl,name:"file",header:{token:e.getStorageSync("token")},filePath:1==i?t:t.path,success:function(o){var a=JSON.parse(o.data);if(n.uploadShow=!1,1==a.code)if(1==i){var s={id:a.data.id,file_path:a.data.url};n.imgList.push(s)}else{var c={id:a.data.id,file_path:a.data.url};t=Object.assign({},t,c),n.fileList.push(t)}else e.showToast({title:"上传失败",icon:"none"})},fail:function(e){console.log(e)}})},delImg:function(e){this.imgList.splice(e,1)},moreClick:function(){e.navigateTo({url:"/pagesA/crm/selectMember/selectMember"})},saveFollow:function(){var t=this.id,i=this.customer_id,n=this.consume_time,a=this.consume_type,s=this.money,c=this.remark,u=this.imgList,l=this.remindPeople;if(n)if(a)if(s)if(l&&0!=l.length||0!=this.approvalPro.status){var r=[];u.forEach((function(e){r.push(e.id)}));var d=r.join(","),f=[];l.forEach((function(e){f.push(e.id)}));f.join(",");var p={id:t,customer_id:i,consume_time:n,consume_type:a,money:s,remark:c,file_ids:d,flow_staff_ids:0==this.approvalPro.status?f.join(","):""};(0,o.netEditCost)(p).then((function(t){e.showToast({title:t.msg,icon:"none"}),setTimeout((function(){e.navigateBack({delta:1})}),2e3)}))}else e.showToast({title:"请选择流程审批人",icon:"none"});else e.showToast({title:"请填写消费金额",icon:"none"});else e.showToast({title:"请选择消费方式",icon:"none"});else e.showToast({title:"请选择消费日期",icon:"none"})}}};t.default=u}).call(this,i("543d")["default"],i("bc2e")["default"])},f000:function(e,t,i){"use strict";i.r(t);var n=i("117b"),o=i("a6ed");for(var a in o)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return o[e]}))}(a);i("ab9a");var s=i("f0c5"),c=Object(s["a"])(o["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);t["default"]=c.exports}},[["056b","common/runtime","common/vendor"]]]); |