From 4cf36d0c5c35644c38b19958623df5049c369fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Tue, 5 Jul 2022 23:46:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/xm/core/xmTask.js | 11 +- src/views/xm/core/xmTask/XmTaskEdit.vue | 174 +++++++++++++++++++++--- 2 files changed, 162 insertions(+), 23 deletions(-) diff --git a/src/api/xm/core/xmTask.js b/src/api/xm/core/xmTask.js index 7453f5d3..91abe2e4 100644 --- a/src/api/xm/core/xmTask.js +++ b/src/api/xm/core/xmTask.js @@ -82,7 +82,8 @@ export const getXmTaskSort = params => { return axios.get(`${base}/xm/core/xmTas //初始化页面上的字典 export const initDicts = (that) => { //任务类型字典taskState,交易模式字典tranMode,能力要求字典capaLvl,保障要求字典supRequire,会员权益等级memInterestLvl - var itemCodes=['planType','taskType','priority','xmTaskSettleSchemel','taskState','bidStep','tranMode','capaLvl','supRequire','memInterestLvl','regionType'];//在此添加要加载的字典 如['sex','grade','lvl'] + var itemCodes=['planType','taskType','priority','xmTaskSettleSchemel','taskState','bidStep','tranMode','capaLvl','supRequire','memInterestLvl','regionType','estate'];//在此添加要加载的字典 如['sex','grade','lvl'] + that.dicts['marketState']=[{id:'0',name:'关闭'},{id:'1',name:'待付款'},{id:'2',name:'已开通'},{id:'3',name:'已过期'}] if(itemCodes.length>0){ initSimpleDicts('all',itemCodes).then(res=>{ Object.assign(that.dicts,res.data.data) @@ -90,7 +91,13 @@ export const initDicts = (that) => { } }; - + export const initSysDicts =async (that) => { + //任务类型字典taskState,交易模式字典tranMode,能力要求字典capaLvl,保障要求字典supRequire,会员权益等级memInterestLvl + var itemCodes=['crowd_task_market'];//在此添加要加载的字典 如['sex','grade','lvl'] + var res=await initComplexDicts('sysParam',itemCodes); + Object.assign(that.dicts,res.data.data) + return res; + }; diff --git a/src/views/xm/core/xmTask/XmTaskEdit.vue b/src/views/xm/core/xmTask/XmTaskEdit.vue index 36798bee..679ece68 100644 --- a/src/views/xm/core/xmTask/XmTaskEdit.vue +++ b/src/views/xm/core/xmTask/XmTaskEdit.vue @@ -217,20 +217,95 @@ 发布到互联网任务大厅 - - 开通分享赚 - - - 元 - 开通分享赚后起效,佣金从任务预算中扣除,如果未发生分享佣金,则不扣除。一般建议为任务佣金的1%-5% - + - - 热门 - 置顶 - 加急 - 客服包办 - + + + + + + {{item.name}} + + + + + {{editForm.budgetAt}}元 + + + + + + + 分享赚 + {{item.name}} + + + + + 元 + 一般建议为任务佣金的1%-5% + + + + + + + 热门 + {{item.name}} + + + + + {{editForm.hotFee}} 元 + + + + + + + 置顶 + {{item.name}} + + + + + {{editForm.topFee}} 元 + + + + + + + 加急 + {{item.name}} + + + + + {{editForm.urgentFee}} 元 + + + + + + + 客服包办 + {{item.name}} + + + + + {{editForm.crmSupFee}} 元 + + + + + + 合计待付款¥:   {{needPayAt}} 元 +
+ 去付款 +
+
@@ -355,6 +430,7 @@ import XmMyDoFocus from '@/views/myWork/my/components/DoFocus'; import XmTaskExecuserForTask from '../xmTaskExecuser/XmTaskExecuserForTask.vue'; import XmPhaseSelect from "./XmPhaseSelect.vue"; + import { initSysDicts } from '../../../../api/xm/core/xmTask'; export default { name:'xmTaskEdit', computed: { @@ -363,6 +439,28 @@ ]), calcTaskStep(){ return this.dicts['bidStep'].findIndex(i=>i.id==this.editForm.bidStep) + }, + needPayAt(){ + var toPayAt=0; + if(this.editForm.oshare=='1'){ + toPayAt=toPayAt+parseFloat(this.editForm.shareFee||0) + } + if(this.editForm.top=='1'){ + toPayAt=toPayAt+parseFloat(this.editForm.topFee||0) + } + if(this.editForm.hot=='1'){ + toPayAt=toPayAt+parseFloat(this.editForm.hotFee||0) + } + if(this.editForm.urgent=='1'){ + toPayAt=toPayAt+parseFloat(this.editForm.urgentFee||0) + } + if(this.editForm.crmSup=='1'){ + toPayAt=toPayAt+parseFloat(this.editForm.crmSupFee||0) + } + if(this.editForm.estate=='1'||this.editForm.crowd==='1'){ + toPayAt=toPayAt+parseFloat(this.editForm.efunds||this.editForm.budgetAt) + } + return toPayAt; } }, props:['xmTask','visible','xmProject',"parentTask"], @@ -378,9 +476,10 @@ this.activateTabPaneName="2" this.supRequires=this.editForm.supRequires?this.editForm.supRequires.split(","):[] this.doAddXmRecordVisit() + this.doInitMarket(this.dicts.crowd_task_market) //从新打开页面时某些数据需要重新加载,可以在这里添加 } - }, + }, }, data() { const beginDate = new Date(); @@ -394,6 +493,8 @@ priority:[], xmTaskSettleSchemel:[], bidStep:[], + marketState:[], + crowd_task_market:null, },//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} load:{ list: false, edit: false, del: false, add: false },//查询中... editFormRules: { @@ -415,7 +516,7 @@ //新增界面数据 xm_task editForm: { - id:'',name:'',parentTaskid:'',parentTaskname:'',projectId:'',projectName:'',level:'',sortLevel:'',executorUserid:'',executorUsername:'',preTaskid:'',preTaskname:'',startTime:'',endTime:'',milestone:'',description:'',remarks:'',createUserid:'',createUsername:'',createTime:'',rate:0,budgetAt:0,budgetWorkload:0,actAt:0,actWorkload:0,taskState:'0',taskType:'4',taskClass:'',toTaskCenter:'0',actStartTime:'',actEndTime:'',bizProcInstId:'',bizFlowState:'',phaseId:'',phaseName:'',taskSkillNames:'',exeUsernames:'',taskSkillIds:'',exeUserids:'',taskOut:'0',planType:'w2',settleSchemel:'1',menuId:'',menuName:'',productId:'',cbranchId:'',cdeptid:'',tagIds:'',tagNames:'',ntype:'0',childrenCnt:0,ltime:'',pidPaths:'',lvl:'',isTpl:'',keyPath:'',uniInnerPrice:80,uniOutPrice:100,calcType:'',ptype:'',wtype:'',bctrl:'',initWorkload:'',shareFee:'',oshare:'',crowd:'',browseUsers:'',execUsers:'',cityId:'',cityName:'',regionType:'',browseTimes:'',capaLvls:'',tranMode:'',supRequires:'',hot:'0',top:'0',urgent:'0',crmSup:'0',bidStep:'0',interestLvls:'',filePaths:'',estate:'0',efunds:0,etoPlatTime:'',etoDevTime:'',ebackTime:'',topStime:'',topEtime:'',hotStime:'',hotEtime:'',urgentStime:'',urgentEtime:'' + id:'',name:'',parentTaskid:'',parentTaskname:'',projectId:'',projectName:'',level:'',sortLevel:'',executorUserid:'',executorUsername:'',preTaskid:'',preTaskname:'',startTime:'',endTime:'',milestone:'',description:'',remarks:'',createUserid:'',createUsername:'',createTime:'',rate:0,budgetAt:0,budgetWorkload:0,actAt:0,actWorkload:0,taskState:'0',taskType:'4',taskClass:'',toTaskCenter:'0',actStartTime:'',actEndTime:'',bizProcInstId:'',bizFlowState:'',phaseId:'',phaseName:'',taskSkillNames:'',exeUsernames:'',taskSkillIds:'',exeUserids:'',taskOut:'0',planType:'w2',settleSchemel:'1',menuId:'',menuName:'',productId:'',cbranchId:'',cdeptid:'',tagIds:'',tagNames:'',ntype:'0',childrenCnt:0,ltime:'',pidPaths:'',lvl:'',isTpl:'',keyPath:'',uniInnerPrice:80,uniOutPrice:100,calcType:'',ptype:'',wtype:'',bctrl:'',initWorkload:'',shareFee:'',oshare:'',crowd:'',browseUsers:'',execUsers:'',cityId:'',cityName:'',regionType:'',browseTimes:'',capaLvls:'',tranMode:'',supRequires:'',hot:'0',top:'0',urgent:'0',crmSup:'0',bidStep:'0',interestLvls:'',filePaths:'',estate:'0',efunds:0,etoPlatTime:'',etoDevTime:'',ebackTime:'',topStime:'',topEtime:'',hotStime:'',hotEtime:'',urgentStime:'',urgentEtime:'',urgentFee:0,topFee:0,hotFee:0 }, /**begin 在下面加自定义属性,记得补上面的一个逗号**/ menuVisible:false, @@ -465,6 +566,28 @@ } }); }, + doInitMarket(data){ + var extInfos=new Map(); + if(data.extInfos){ + var ext=JSON.parse(data.extInfos) + ext.forEach(k=>{ + extInfos.set(k.id,k.value) + }) + + } + if(this.editForm.top=='1'){ + this.editForm.topFee=parseFloat(extInfos.get("topFee")||0) + } + if(this.editForm.hot=='1'){ + this.editForm.hotFee=parseFloat(extInfos.get("hotFee")||0) + } + if(this.editForm.urgent=='1'){ + this.editForm.urgentFee=parseFloat(extInfos.get("urgentFee")||0) + } + if(this.editForm.crmSup=='1'){ + this.editForm.crmSupFee=parseFloat(extInfos.get("crmSupFee")||0) + } + }, formatDate: function(time) { const date = new Date(time); const m = date.getMonth()+1; @@ -750,6 +873,10 @@ }, doAddXmRecordVisit(){ addXmRecordVisit({bizId:this.editForm.id,objType:'2',pbizId:this.editForm.projectId}) + }, + + toPayAt(){ + } },//end method components: { @@ -759,13 +886,18 @@ //在下面添加其它组件 'xm-task-edit':XmTaskEdit }, mounted() { + this.$nextTick(()=>{ + initDicts(this); + this.editForm=Object.assign(this.editForm, this.xmTask); + this.editFormBak=Object.assign({},this.editForm) + this.supRequires=this.editForm.supRequires?this.editForm.supRequires.split(","):[] + this.setSkills(); + this.doAddXmRecordVisit() + initSysDicts(this).then(res=>{ + this.doInitMarket(res.data.data.crowd_task_market) + }) + }) - initDicts(this); - this.editForm=Object.assign(this.editForm, this.xmTask); - this.editFormBak=Object.assign({},this.editForm) - this.supRequires=this.editForm.supRequires?this.editForm.supRequires.split(","):[] - this.setSkills(); - this.doAddXmRecordVisit() /**在下面写其它函数***/ }//end mounted