|
|
|
@ -1,28 +1,40 @@ |
|
|
|
<template> |
|
|
|
<section class="page-container padding border"> |
|
|
|
<el-row class="padding-bottom"> |
|
|
|
<el-steps :active="calcProjectStatusStep" simple finish-status="success"> |
|
|
|
<el-step v-for="(i,index) in options['projectStatus']" :title="i.optionName" :key="index"> |
|
|
|
<el-row slot="title" @click.native.stop="editForm.status=i.optionValue"> |
|
|
|
{{i.optionName}} |
|
|
|
</el-row> |
|
|
|
</el-step> |
|
|
|
</el-steps> |
|
|
|
</el-row> |
|
|
|
<section class="page-container padding border"> |
|
|
|
<el-row class="page-main "> |
|
|
|
<!--新增界面 XmProduct 产品表--> |
|
|
|
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm"> |
|
|
|
<el-form-item label="产品编号" prop="id"> |
|
|
|
<el-input v-model="addForm.id" placeholder="产品编号" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="产品代号" prop="code"> |
|
|
|
<el-input v-model="addForm.code" placeholder="产品代号,不可为空" > |
|
|
|
<template slot="append"> |
|
|
|
<el-button type="text" @click="createProductCode">自动生成</el-button> |
|
|
|
</template> |
|
|
|
</el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="产品名称" prop="productName"> |
|
|
|
<el-input v-model="addForm.productName" placeholder="产品名称" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="总监" prop="admUserid"> |
|
|
|
<el-input readonly v-model="addForm.admUsername" @click.native="showUserVisible('admUserid')"></el-input> |
|
|
|
<font style="font-size:12px;" color="red"></font> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="产品经理" prop="pmUserid"> |
|
|
|
<el-tag v-if="addForm.pmUserid" closable @close="clearPmUser">{{addForm.pmUsername}}</el-tag> |
|
|
|
<el-tag v-else>未配置</el-tag> |
|
|
|
<el-button @click="selectUser">选产品经理</el-button> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="产品经理" prop="pmUserid"> |
|
|
|
<el-input readonly v-model="addForm.pmUsername" @click.native="showUserVisible('pmUserid')"></el-input> |
|
|
|
<font style="font-size:12px;" color="red"></font> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="副经理、助理" prop="assUserid"> |
|
|
|
<el-input readonly v-model="addForm.assUsername" @click.native="showUserVisible('assUserid')"></el-input> |
|
|
|
<font style="font-size:12px;" color="red"></font> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-form-item label="备注" prop="remark"> |
|
|
|
<el-input v-model="addForm.remark" type="textarea" :autosize="{ minRows: 4, maxRows: 20}" placeholder="备注" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
@ -43,7 +55,7 @@ |
|
|
|
<script> |
|
|
|
import util from '@/common/js/util';//全局公共库 |
|
|
|
import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 |
|
|
|
import { addXmProduct } from '@/api/xm/core/xmProduct'; |
|
|
|
import { addXmProduct,createProductCode } from '@/api/xm/core/xmProduct'; |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; |
|
|
|
|
|
|
|
@ -69,26 +81,30 @@ |
|
|
|
return { |
|
|
|
options:{xmProductPstatus:[]},//下拉选择框的所有静态数据 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 },//查询中... |
|
|
|
addFormRules: { |
|
|
|
id: [ |
|
|
|
{ required: true, message: '产品编号不能为空', trigger: 'blur' } |
|
|
|
addFormRules: { |
|
|
|
productName: [ |
|
|
|
{ required: true, message: '产品名称不能为空', trigger: 'change' } |
|
|
|
], |
|
|
|
|
|
|
|
productName: [ |
|
|
|
{ required: true, message: '产品名称不能为空', trigger: 'blur' } |
|
|
|
code: [ |
|
|
|
{ required: true, message: '产品代号不能为空', trigger: 'change' } |
|
|
|
], |
|
|
|
|
|
|
|
pmUserid: [ |
|
|
|
{ required: true, message: '产品经理不能为空', trigger: 'blur' } |
|
|
|
{ required: true, message: '产品经理不能为空', trigger: 'change' } |
|
|
|
], |
|
|
|
|
|
|
|
admUserid: [ |
|
|
|
{ required: true, message: '产品总监不能为空', trigger: 'change' } |
|
|
|
] |
|
|
|
}, |
|
|
|
//新增界面数据 产品表 |
|
|
|
addForm: { |
|
|
|
id:'',productName:'',branchId:'',remark:'',pmUserid:'',pmUsername:'',ctime:'' |
|
|
|
id:'',code:'',productName:'',branchId:'',remark:'',pmUserid:'',pmUsername:'',pstatus:'',ctime:'',admUserid:'',admUsername:'',assUserid:'',assUsername:'',del:'',locked:'' |
|
|
|
}, |
|
|
|
userSelectVisible:false, |
|
|
|
/**begin 在下面加自定义属性,记得补上面的一个逗号**/ |
|
|
|
|
|
|
|
currUserType:'', |
|
|
|
/**end 在上面加自定义属性**/ |
|
|
|
}//end return |
|
|
|
},//end data |
|
|
|
@ -124,20 +140,40 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
createProductCode(){ |
|
|
|
createProductCode({}).then(res=>{ |
|
|
|
var tips=res.data.tips; |
|
|
|
if(tips.isOk){ |
|
|
|
this.addForm.code=res.data.data |
|
|
|
} |
|
|
|
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|
|
|
}) |
|
|
|
}, |
|
|
|
selectUser(){ |
|
|
|
showUserVisible(userType){ |
|
|
|
this.currUserType=userType |
|
|
|
this.userSelectVisible=true; |
|
|
|
}, |
|
|
|
onUserSelected(users){ |
|
|
|
//选择人员 |
|
|
|
onUserSelected: function(users) { |
|
|
|
this.userSelectVisible = false; |
|
|
|
var user={userid:'',username:''}; |
|
|
|
if(users && users.length>0){ |
|
|
|
this.addForm.pmUserid=users[0].userid |
|
|
|
this.addForm.pmUsername=users[0].username |
|
|
|
user=users[0] |
|
|
|
} |
|
|
|
this.userSelectVisible=false |
|
|
|
}, |
|
|
|
clearPmUser:function(){ |
|
|
|
this.addForm.pmUserid='' |
|
|
|
this.addForm.pmUsername='' |
|
|
|
|
|
|
|
if(this.currUserType=='admUserid'){ |
|
|
|
this.addForm.admUserid=user.userid |
|
|
|
this.addForm.admUsername=user.username |
|
|
|
}else if(this.currUserType=='assUserid'){ |
|
|
|
this.addForm.assUserid=user.userid |
|
|
|
this.addForm.assUsername=user.username |
|
|
|
}else if(this.currUserType=='pmUserid'){ |
|
|
|
this.addForm.pmUserid=user.userid |
|
|
|
this.addForm.pmUsername=user.username |
|
|
|
} |
|
|
|
this.currUserType=""; |
|
|
|
|
|
|
|
}, |
|
|
|
/**begin 在下面加自定义方法,记得补上面的一个逗号**/ |
|
|
|
|
|
|
|
|