Browse Source

优化

master
陈裕财 4 years ago
parent
commit
4cf36d0c5c
  1. 11
      src/api/xm/core/xmTask.js
  2. 174
      src/views/xm/core/xmTask/XmTaskEdit.vue

11
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) => { export const initDicts = (that) => {
//任务类型字典taskState,交易模式字典tranMode,能力要求字典capaLvl,保障要求字典supRequire,会员权益等级memInterestLvl //任务类型字典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){ if(itemCodes.length>0){
initSimpleDicts('all',itemCodes).then(res=>{ initSimpleDicts('all',itemCodes).then(res=>{
Object.assign(that.dicts,res.data.data) 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;
};

174
src/views/xm/core/xmTask/XmTaskEdit.vue

@ -217,20 +217,95 @@
<el-checkbox v-model="editForm.toTaskCenter" v-if="editForm.taskOut==='1'" true-label="1" false-label="0" id="toTaskCenter" @change="editXmTaskSomeFields(editForm,'toTaskCenter',$event)">发布到互联网任务大厅</el-checkbox> <el-checkbox v-model="editForm.toTaskCenter" v-if="editForm.taskOut==='1'" true-label="1" false-label="0" id="toTaskCenter" @change="editXmTaskSomeFields(editForm,'toTaskCenter',$event)">发布到互联网任务大厅</el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="分享赚" prop="oshare" v-if="editForm.taskOut==='1'">
<el-checkbox v-model="editForm.oshare" true-label="1" false-label="0" id="oshare" @change="editXmTaskSomeFields(editForm,'oshare',$event)">开通分享赚</el-checkbox>
</el-form-item>
<el-form-item label="分享佣金" prop="shareFee" v-if="editForm.oshare==='1' && editForm.taskOut==='1'">
<el-input type="number" style="width:150px;" v-model="editForm.shareFee" :precision="2" :step="100" :min="0" placeholder="分享赚佣金" @change="editXmTaskSomeFields(editForm,'shareFee',$event)"></el-input >
<font color="blue">开通分享赚后起效佣金从任务预算中扣除如果未发生分享佣金则不扣除一般建议为任务佣金的1%-5%</font>
</el-form-item>
<el-form-item label="推广" v-if="editForm.crowd==='1'">
<el-checkbox v-model="editForm.hot" true-label="1" false-label="0" id="hot" @change="editXmTaskSomeFields(editForm,'hot',$event)">热门</el-checkbox>
<el-checkbox v-model="editForm.top" true-label="1" false-label="0" id="top" @change="editXmTaskSomeFields(editForm,'top',$event)">置顶</el-checkbox>
<el-checkbox v-model="editForm.urgent" true-label="1" false-label="0" id="urgent" @change="editXmTaskSomeFields(editForm,'urgent',$event)">加急</el-checkbox>
<el-checkbox v-model="editForm.crmSup" true-label="1" false-label="0" id="crmSup" @change="editXmTaskSomeFields(editForm,'crmSup',$event)">客服包办</el-checkbox>
</el-form-item>
<el-row v-if="editForm.crowd==='1'">
<el-col :span="18">
<el-row>
<el-col :span="6">
<el-form-item label="托管资金" prop="estate" v-if="editForm.taskOut==='1'">
<el-tag v-for="(item,index) in formatDictsWithClass(dicts,'estate',editForm.hot)" :key="index" :type="item.className">{{item.name}}</el-tag>
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item label="任务佣金" prop="efunds" v-if="editForm.taskOut==='1'">
{{editForm.budgetAt}}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="分享赚" prop="oshare" v-if="editForm.taskOut==='1'">
<el-checkbox v-model="editForm.oshare" v-if="editForm.oshare!='2'" true-label="1" false-label="0" id="oshare" @change="editXmTaskSomeFields(editForm,'oshare',$event)">分享赚</el-checkbox>
<el-tag v-for="(item,index) in formatDictsWithClass(dicts,'marketState',editForm.oshare)" :key="index" :type="item.className">{{item.name}}</el-tag>
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item label="分享佣金" prop="shareFee" v-if="editForm.oshare==='1' && editForm.taskOut==='1'">
<el-input type="number" style="width:100px;" v-model="editForm.shareFee" :precision="2" :step="2" :min="0" placeholder="分享赚佣金" @change="editXmTaskSomeFields(editForm,'shareFee',$event)"></el-input >
<font color="blue">一般建议为任务佣金的1%-5%</font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="热门" prop="hot" v-if="editForm.taskOut==='1'">
<el-checkbox v-model="editForm.hot" v-if="editForm.hot!='2'" true-label="1" false-label="0" id="hot" @change="editXmTaskSomeFields(editForm,'hot',$event)">热门</el-checkbox>
<el-tag v-for="(item,index) in formatDictsWithClass(dicts,'marketState',editForm.hot)" :key="index" :type="item.className">{{item.name}}</el-tag>
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item label="热门费用" prop="hotFee" v-if="editForm.hot==='1' && editForm.taskOut==='1'">
{{editForm.hotFee}}&nbsp;
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="置顶" prop="top" v-if="editForm.taskOut==='1'">
<el-checkbox v-model="editForm.top" v-if="editForm.top!='2'" true-label="1" false-label="0" id="hot" @change="editXmTaskSomeFields(editForm,'top',$event)">置顶</el-checkbox>
<el-tag v-for="(item,index) in formatDictsWithClass(dicts,'marketState',editForm.top)" :key="index" :type="item.className">{{item.name}}</el-tag>
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item label="置顶费用" prop="topFee" v-if="editForm.top==='1' && editForm.taskOut==='1'">
{{editForm.topFee}}&nbsp;
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="加急" prop="urgent" v-if="editForm.taskOut==='1'">
<el-checkbox v-model="editForm.urgent" v-if="editForm.hot!='2'" true-label="1" false-label="0" id="urgent" @change="editXmTaskSomeFields(editForm,'urgent',$event)">加急</el-checkbox>
<el-tag v-for="(item,index) in formatDictsWithClass(dicts,'marketState',editForm.urgent)" :key="index" :type="item.className">{{item.name}}</el-tag>
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item label="加急费用" prop="urgentFee" v-if="editForm.urgent==='1' && editForm.taskOut==='1'">
{{editForm.urgentFee}}&nbsp;
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="客服包办" prop="crmSup" v-if="editForm.taskOut==='1'">
<el-checkbox v-model="editForm.crmSup" v-if="editForm.crmSup!='2'" true-label="1" false-label="0" id="hot" @change="editXmTaskSomeFields(editForm,'crmSup',$event)">客服包办</el-checkbox>
<el-tag v-for="(item,index) in formatDictsWithClass(dicts,'marketState',editForm.crmSup)" :key="index" :type="item.className">{{item.name}}</el-tag>
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item label="客服包办费用" prop="crmSupFee" v-if="editForm.crmSup==='1' && editForm.taskOut==='1'">
{{editForm.crmSupFee}}&nbsp;
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="6">
<strong> 合计待付款:</strong>&nbsp;&nbsp;<font style="font-size:48px;color:red;"> {{needPayAt}}&nbsp;</font>
<br/>
<el-button class="padding" @click="toPayAt">去付款</el-button>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="交易模式" prop="tranMode" v-if="editForm.crowd==='1'"> <el-form-item label="交易模式" prop="tranMode" v-if="editForm.crowd==='1'">
@ -355,6 +430,7 @@
import XmMyDoFocus from '@/views/myWork/my/components/DoFocus'; import XmMyDoFocus from '@/views/myWork/my/components/DoFocus';
import XmTaskExecuserForTask from '../xmTaskExecuser/XmTaskExecuserForTask.vue'; import XmTaskExecuserForTask from '../xmTaskExecuser/XmTaskExecuserForTask.vue';
import XmPhaseSelect from "./XmPhaseSelect.vue"; import XmPhaseSelect from "./XmPhaseSelect.vue";
import { initSysDicts } from '../../../../api/xm/core/xmTask';
export default { export default {
name:'xmTaskEdit', name:'xmTaskEdit',
computed: { computed: {
@ -363,6 +439,28 @@
]), ]),
calcTaskStep(){ calcTaskStep(){
return this.dicts['bidStep'].findIndex(i=>i.id==this.editForm.bidStep) 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"], props:['xmTask','visible','xmProject',"parentTask"],
@ -378,9 +476,10 @@
this.activateTabPaneName="2" this.activateTabPaneName="2"
this.supRequires=this.editForm.supRequires?this.editForm.supRequires.split(","):[] this.supRequires=this.editForm.supRequires?this.editForm.supRequires.split(","):[]
this.doAddXmRecordVisit() this.doAddXmRecordVisit()
this.doInitMarket(this.dicts.crowd_task_market)
// //
} }
},
},
}, },
data() { data() {
const beginDate = new Date(); const beginDate = new Date();
@ -394,6 +493,8 @@
priority:[], priority:[],
xmTaskSettleSchemel:[], xmTaskSettleSchemel:[],
bidStep:[], 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'}]} },// 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 },//... load:{ list: false, edit: false, del: false, add: false },//...
editFormRules: { editFormRules: {
@ -415,7 +516,7 @@
// xm_task // xm_task
editForm: { 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 在下面加自定义属性,记得补上面的一个逗号**/ /**begin 在下面加自定义属性,记得补上面的一个逗号**/
menuVisible:false, 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) { formatDate: function(time) {
const date = new Date(time); const date = new Date(time);
const m = date.getMonth()+1; const m = date.getMonth()+1;
@ -750,6 +873,10 @@
}, },
doAddXmRecordVisit(){ doAddXmRecordVisit(){
addXmRecordVisit({bizId:this.editForm.id,objType:'2',pbizId:this.editForm.projectId}) addXmRecordVisit({bizId:this.editForm.id,objType:'2',pbizId:this.editForm.projectId})
},
toPayAt(){
} }
},//end method },//end method
components: { components: {
@ -759,13 +886,18 @@
// 'xm-task-edit':XmTaskEdit // 'xm-task-edit':XmTaskEdit
}, },
mounted() { 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 }//end mounted

Loading…
Cancel
Save