Browse Source

优化

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

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

@ -220,7 +220,10 @@
<el-radio v-model="xmProductCopy.isTpl" label="0">复制为新的产品</el-radio> <el-radio v-model="xmProductCopy.isTpl" label="0">复制为新的产品</el-radio>
</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,
@ -471,28 +474,31 @@ import XmProductSelect from './XmProductSelect.vue';
//xmProduct //xmProduct
selsChange: function (sels) { selsChange: function (sels) {
this.sels = sels; this.sels = sels;
},
//xmProduct
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.load.del=true;
let params = { id: row.id };
delXmProduct(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.count=true;
this.getXmProducts();
}
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
});
},
handleDel: function (row,index) {
this.$prompt('将同步删除计划、组织、需求等,慎重起见,请输入产品代号:'+row.code, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({ value }) => {
if(value==row.code){
this.load.del=true;
let params = { id: row.id };
delXmProduct(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.count=true;
this.getXmProducts();
}
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
}else{
this.$notify({showClose: true, message: "产品代号不正确", type: 'error' });
}
}).catch(() => {
return;
});
}, },
//xmProduct //xmProduct
batchDel: function () { batchDel: function () {

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

@ -67,7 +67,10 @@
<el-radio v-model="xmProductCopy.isTpl" label="0">复制为新的产品</el-radio> <el-radio v-model="xmProductCopy.isTpl" label="0">复制为新的产品</el-radio>
</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">
@ -144,8 +147,8 @@
pickerOptions: util.pickerOptions('datarange'), pickerOptions: util.pickerOptions('datarange'),
projectVisible:false, projectVisible:false,
productSelectVisible:false, productSelectVisible:false,
xmProductCopy:{
id:'',productName:'',code:'',isTpl:'',copyMenu:'1'
xmProductCopy:{
id:'',productName:'',code:'',isTpl:'',copyMenu:'1',copyPhase:'1',copyGroup:'1',copyGroupUser:'0'
}, },
copyToVisible:false, copyToVisible:false,
maxTableHeight:300, maxTableHeight:300,
@ -272,36 +275,33 @@
//xmProduct //xmProduct
selsChange: function (sels) { selsChange: function (sels) {
this.sels = sels; this.sels = sels;
},
//xmProduct
handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
let params = { id: row.id };
delXmProduct(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.count=true;
this.getXmProducts();
}
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
});
},
handleDel: function (row,index) {
this.$prompt('将同步删除计划、组织、需求等,慎重起见,请输入产品代号:'+row.code, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({ value }) => {
if(value==row.code){
this.load.del=true;
let params = { id: row.id };
delXmProduct(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.count=true;
this.getXmProducts();
}
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
}else{
this.$notify({showClose: true, message: "产品代号不正确", type: 'error' });
}
}).catch(() => {
return;
});
}, },
//xmProduct //xmProduct
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;
}
batchDel: function () {
this.$confirm('确认删除选中记录吗?', '提示', { this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {

Loading…
Cancel
Save