Browse Source

优化

master
陈裕财 4 years ago
parent
commit
0a5674e86f
  1. 24
      src/views/xm/core/xmProduct/XmProductMng.vue
  2. 28
      src/views/xm/core/xmProduct/XmProductTplMng.vue

24
src/views/xm/core/xmProduct/XmProductMng.vue

@ -221,6 +221,9 @@
</el-form-item> </el-form-item>
<el-form-item label="附加任务"> <el-form-item label="附加任务">
<el-checkbox v-model="xmProductCopy.copyMenu" true-label="1" false-label="0">拷贝需求列表</el-checkbox> <el-checkbox v-model="xmProductCopy.copyMenu" true-label="1" false-label="0">拷贝需求列表</el-checkbox>
<el-checkbox v-model="xmProductCopy.copyPhase" true-label="1" false-label="0">拷贝计划</el-checkbox>
<el-checkbox v-model="xmProductCopy.copyGroup" true-label="1" false-label="0">拷贝组织架构</el-checkbox>
<el-checkbox v-model="xmProductCopy.copyGroupUser" true-label="1" false-label="0">拷贝产品组成员</el-checkbox>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -317,7 +320,7 @@ import XmProductSelect from './XmProductSelect.vue';
productSelectVisible:false, productSelectVisible:false,
showType:false, showType:false,
xmProductCopy:{ xmProductCopy:{
id:'',productName:'',code:'',isTpl:'',copyMenu:'1'
id:'',productName:'',code:'',isTpl:'',copyMenu:'1',copyPhase:'1',copyGroup:'1',copyGroupUser:'0'
}, },
copyToVisible:false, copyToVisible:false,
templateVisible:false, templateVisible:false,
@ -472,15 +475,13 @@ import XmProductSelect from './XmProductSelect.vue';
selsChange: function (sels) { selsChange: function (sels) {
this.sels = sels; this.sels = sels;
}, },
//xmProduct
handleDel: function (row,index) { handleDel: function (row,index) {
if(!this.roles.some(i=>i.roleid=='productAdmin')){
this.$notify({showClose: true, message: "只有产品经理能够删除产品", type: 'error'});
return false;
}
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.$prompt('将同步删除计划、组织、需求等,慎重起见,请输入产品代号:'+row.code, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({ value }) => {
if(value==row.code){
this.load.del=true; this.load.del=true;
let params = { id: row.id }; let params = { id: row.id };
delXmProduct(params).then((res) => { delXmProduct(params).then((res) => {
@ -492,6 +493,11 @@ import XmProductSelect from './XmProductSelect.vue';
} }
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false ); }).catch( err => this.load.del=false );
}else{
this.$notify({showClose: true, message: "产品代号不正确", type: 'error' });
}
}).catch(() => {
return;
}); });
}, },
//xmProduct //xmProduct

28
src/views/xm/core/xmProduct/XmProductTplMng.vue

@ -68,6 +68,9 @@
</el-form-item> </el-form-item>
<el-form-item label="附加任务"> <el-form-item label="附加任务">
<el-checkbox v-model="xmProductCopy.copyMenu" true-label="1" false-label="0">拷贝需求列表</el-checkbox> <el-checkbox v-model="xmProductCopy.copyMenu" true-label="1" false-label="0">拷贝需求列表</el-checkbox>
<el-checkbox v-model="xmProductCopy.copyPhase" true-label="1" false-label="0">拷贝计划</el-checkbox>
<el-checkbox v-model="xmProductCopy.copyGroup" true-label="1" false-label="0">拷贝组织架构</el-checkbox>
<el-checkbox v-model="xmProductCopy.copyGroupUser" true-label="1" false-label="0">拷贝产品组成员</el-checkbox>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -145,7 +148,7 @@
projectVisible:false, projectVisible:false,
productSelectVisible:false, productSelectVisible:false,
xmProductCopy:{ xmProductCopy:{
id:'',productName:'',code:'',isTpl:'',copyMenu:'1'
id:'',productName:'',code:'',isTpl:'',copyMenu:'1',copyPhase:'1',copyGroup:'1',copyGroupUser:'0'
}, },
copyToVisible:false, copyToVisible:false,
maxTableHeight:300, maxTableHeight:300,
@ -273,11 +276,12 @@
selsChange: function (sels) { selsChange: function (sels) {
this.sels = sels; this.sels = sels;
}, },
//xmProduct
handleDel: function (row,index) { handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.$prompt('将同步删除计划、组织、需求等,慎重起见,请输入产品代号:'+row.code, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({ value }) => {
if(value==row.code){
this.load.del=true; this.load.del=true;
let params = { id: row.id }; let params = { id: row.id };
delXmProduct(params).then((res) => { delXmProduct(params).then((res) => {
@ -289,19 +293,15 @@
} }
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false ); }).catch( err => this.load.del=false );
}else{
this.$notify({showClose: true, message: "产品代号不正确", type: 'error' });
}
}).catch(() => {
return;
}); });
}, },
//xmProduct //xmProduct
batchDel: function () { batchDel: function () {
if(!this.roles.some(i=>i.roleid=='productAdmin')){
this.$notify({showClose: true, message: "只有产品经理能够删除产品", type: 'error'});
return false;
}
var mmSels=this.sels.filter(i=>i.pmUserid!=this.userInfo.userid)
if(mmSels.length>0){
this.$notify({showClose: true, message: "只能删除你负责的产品", type: 'error'});
return false;
}
this.$confirm('确认删除选中记录吗?', '提示', { this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {

Loading…
Cancel
Save