15 changed files with 1213 additions and 59 deletions
-
30src/api/xm/core/xmIterationProductLink.js
-
30src/api/xm/core/xmProductProjectLink.js
-
2src/views/xm/core/xmIteration/XmIterationAdd.vue
-
79src/views/xm/core/xmIteration/XmIterationMng.vue
-
3src/views/xm/core/xmIteration/XmIterationSelect.vue
-
123src/views/xm/core/xmIterationProductLink/XmIterationProductLinkAdd.vue
-
118src/views/xm/core/xmIterationProductLink/XmIterationProductLinkEdit.vue
-
252src/views/xm/core/xmIterationProductLink/XmIterationProductLinkMng.vue
-
2src/views/xm/core/xmProduct/XmProductAdd.vue
-
6src/views/xm/core/xmProduct/XmProductComplex.vue
-
93src/views/xm/core/xmProduct/XmProductMng.vue
-
5src/views/xm/core/xmProduct/XmProductSelect.vue
-
123src/views/xm/core/xmProductProjectLink/XmProductProjectLinkAdd.vue
-
118src/views/xm/core/xmProductProjectLink/XmProductProjectLinkEdit.vue
-
252src/views/xm/core/xmProductProjectLink/XmProductProjectLinkMng.vue
@ -0,0 +1,30 @@ |
|||||
|
import axios from '@/utils/request' |
||||
|
|
||||
|
import config from '@/common/config' |
||||
|
|
||||
|
let base = config.getCoreBasePath(); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 |
||||
|
*1 默认只开放普通查询,所有查询,只要上传 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】},后台都会自动按分页查询 其它 api用到再打开,没用到的api请注释掉, |
||||
|
*2 查询、新增、修改的参数格式 params={iterationId:'迭代表主键 主键',productId:'产品表主键 主键',ctime:'创建时间',cuserid:'创建人编号',cusername:'创建人姓名',linkStatus:'关联状态1关联0取消关联'} |
||||
|
**/ |
||||
|
|
||||
|
//普通查询 条件之间and关系
|
||||
|
export const listXmIterationProductLink = params => { return axios.get(`${base}/xm/core/xmIterationProductLink/list`, { params: params }); }; |
||||
|
|
||||
|
//模糊查询迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 条件之间or关系
|
||||
|
//export const listXmIterationProductLinkKey = params => { return axios.get(`${base}/xm/core/xmIterationProductLink/listKey`, { params: params }); };
|
||||
|
|
||||
|
//删除一条迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 params={iterationId:'迭代表主键 主键',productId:'产品表主键 主键'}
|
||||
|
export const delXmIterationProductLink = params => { return axios.post(`${base}/xm/core/xmIterationProductLink/del`,params); }; |
||||
|
|
||||
|
//批量删除迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 params=[{iterationId:'迭代表主键 主键',productId:'产品表主键 主键'}]
|
||||
|
export const batchDelXmIterationProductLink = params => { return axios.post(`${base}/xm/core/xmIterationProductLink/batchDel`, params); }; |
||||
|
|
||||
|
//修改一条迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表记录
|
||||
|
export const editXmIterationProductLink = params => { return axios.post(`${base}/xm/core/xmIterationProductLink/edit`, params); }; |
||||
|
|
||||
|
//新增一条迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表
|
||||
|
export const addXmIterationProductLink = params => { return axios.post(`${base}/xm/core/xmIterationProductLink/add`, params); }; |
||||
@ -0,0 +1,30 @@ |
|||||
|
import axios from '@/utils/request' |
||||
|
|
||||
|
import config from '@/common/config' |
||||
|
|
||||
|
let base = config.getCoreBasePath(); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 产品与项目的关联关系表,一般由产品经理挂接项目到产品上 |
||||
|
*1 默认只开放普通查询,所有查询,只要上传 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】},后台都会自动按分页查询 其它 api用到再打开,没用到的api请注释掉, |
||||
|
*2 查询、新增、修改的参数格式 params={projectId:'项目表中的主键 主键',productId:'产品表中的主键 主键',ctime:'创建时间',cuserid:'创建人编号',cusername:'创建人姓名',linkStatus:'关联状态1关联0取消关联'} |
||||
|
**/ |
||||
|
|
||||
|
//普通查询 条件之间and关系
|
||||
|
export const listXmProductProjectLink = params => { return axios.get(`${base}/xm/core/xmProductProjectLink/list`, { params: params }); }; |
||||
|
|
||||
|
//模糊查询产品与项目的关联关系表,一般由产品经理挂接项目到产品上 条件之间or关系
|
||||
|
//export const listXmProductProjectLinkKey = params => { return axios.get(`${base}/xm/core/xmProductProjectLink/listKey`, { params: params }); };
|
||||
|
|
||||
|
//删除一条产品与项目的关联关系表,一般由产品经理挂接项目到产品上 params={projectId:'项目表中的主键 主键',productId:'产品表中的主键 主键'}
|
||||
|
export const delXmProductProjectLink = params => { return axios.post(`${base}/xm/core/xmProductProjectLink/del`,params); }; |
||||
|
|
||||
|
//批量删除产品与项目的关联关系表,一般由产品经理挂接项目到产品上 params=[{projectId:'项目表中的主键 主键',productId:'产品表中的主键 主键'}]
|
||||
|
export const batchDelXmProductProjectLink = params => { return axios.post(`${base}/xm/core/xmProductProjectLink/batchDel`, params); }; |
||||
|
|
||||
|
//修改一条产品与项目的关联关系表,一般由产品经理挂接项目到产品上记录
|
||||
|
export const editXmProductProjectLink = params => { return axios.post(`${base}/xm/core/xmProductProjectLink/edit`, params); }; |
||||
|
|
||||
|
//新增一条产品与项目的关联关系表,一般由产品经理挂接项目到产品上
|
||||
|
export const addXmProductProjectLink = params => { return axios.post(`${base}/xm/core/xmProductProjectLink/add`, params); }; |
||||
@ -0,0 +1,123 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-row> |
||||
|
<!--新增界面 XmIterationProductLink 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表--> |
||||
|
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm"> |
||||
|
<el-form-item label="迭代表主键" prop="iterationId"> |
||||
|
<el-input v-model="addForm.iterationId" placeholder="迭代表主键" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="产品表主键" prop="productId"> |
||||
|
<el-input v-model="addForm.productId" placeholder="产品表主键" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建时间" prop="ctime"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.ctime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建人编号" prop="cuserid"> |
||||
|
<el-input v-model="addForm.cuserid" placeholder="创建人编号" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建人姓名" prop="cusername"> |
||||
|
<el-input v-model="addForm.cusername" placeholder="创建人姓名" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="关联状态1关联0取消关联" prop="linkStatus"> |
||||
|
<el-input v-model="addForm.linkStatus" placeholder="关联状态1关联0取消关联" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-col :span="24" :offset="8"> |
||||
|
<el-button @click.native="handleCancel">取消</el-button> |
||||
|
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button> |
||||
|
</el-col> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 |
||||
|
import { addXmIterationProductLink } from '@/api/xm/core/xmIterationProductLink'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo' |
||||
|
]) |
||||
|
}, |
||||
|
props:['xmIterationProductLink','visible'], |
||||
|
watch: { |
||||
|
'xmIterationProductLink':function( xmIterationProductLink ) { |
||||
|
this.addForm = xmIterationProductLink; |
||||
|
}, |
||||
|
'visible':function(visible) { |
||||
|
if(visible==true){ |
||||
|
//从新打开页面时某些数据需要重新加载,可以在这里添加 |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
options:{},//下拉选择框的所有静态数据 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: { |
||||
|
iterationId: [ |
||||
|
//{ required: true, message: '迭代表主键不能为空', trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
//新增界面数据 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 |
||||
|
addForm: { |
||||
|
iterationId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:'' |
||||
|
} |
||||
|
/**begin 在下面加自定义属性,记得补上面的一个逗号**/ |
||||
|
|
||||
|
/**end 在上面加自定义属性**/ |
||||
|
}//end return |
||||
|
},//end data |
||||
|
methods: { |
||||
|
// 取消按钮点击 父组件监听@cancel="addFormVisible=false" 监听 |
||||
|
handleCancel:function(){ |
||||
|
this.$refs['addForm'].resetFields(); |
||||
|
this.$emit('cancel'); |
||||
|
}, |
||||
|
//新增提交XmIterationProductLink 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 父组件监听@submit="afterAddSubmit" |
||||
|
addSubmit: function () { |
||||
|
|
||||
|
this.$refs.addForm.validate((valid) => { |
||||
|
if (valid) { |
||||
|
|
||||
|
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
||||
|
this.load.add=true |
||||
|
let params = Object.assign({}, this.addForm); |
||||
|
addXmIterationProductLink(params).then((res) => { |
||||
|
this.load.add=false |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.$refs['addForm'].resetFields(); |
||||
|
this.$emit('submit');// @submit="afterAddSubmit" |
||||
|
} |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err => this.load.add=false); |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
/**begin 在下面加自定义方法,记得补上面的一个逗号**/ |
||||
|
|
||||
|
/**end 在上面加自定义方法**/ |
||||
|
|
||||
|
},//end method |
||||
|
components: { |
||||
|
//在下面添加其它组件 'xm-iteration-product-link-edit':XmIterationProductLinkEdit |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.addForm=Object.assign(this.addForm, this.xmIterationProductLink); |
||||
|
/**在下面写其它函数***/ |
||||
|
|
||||
|
}//end mounted |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,118 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-row> |
||||
|
<!--编辑界面 XmIterationProductLink 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表--> |
||||
|
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm"> |
||||
|
<el-form-item label="迭代表主键" prop="iterationId"> |
||||
|
<el-input v-model="editForm.iterationId" placeholder="迭代表主键"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="产品表主键" prop="productId"> |
||||
|
<el-input v-model="editForm.productId" placeholder="产品表主键"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建时间" prop="ctime"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.ctime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建人编号" prop="cuserid"> |
||||
|
<el-input v-model="editForm.cuserid" placeholder="创建人编号"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建人姓名" prop="cusername"> |
||||
|
<el-input v-model="editForm.cusername" placeholder="创建人姓名"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="关联状态1关联0取消关联" prop="linkStatus"> |
||||
|
<el-input v-model="editForm.linkStatus" placeholder="关联状态1关联0取消关联"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-col :span="24" :offset="8"> |
||||
|
<el-button @click.native="handleCancel">取消</el-button> |
||||
|
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button> |
||||
|
</el-col> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 |
||||
|
import { editXmIterationProductLink } from '@/api/xm/core/xmIterationProductLink'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo' |
||||
|
]) |
||||
|
}, |
||||
|
props:['xmIterationProductLink','visible'], |
||||
|
watch: { |
||||
|
'xmIterationProductLink':function( xmIterationProductLink ) { |
||||
|
this.editForm = xmIterationProductLink; |
||||
|
}, |
||||
|
'visible':function(visible) { |
||||
|
if(visible==true){ |
||||
|
//从新打开页面时某些数据需要重新加载,可以在这里添加 |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
options:{},//下拉选择框的所有静态数据 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: { |
||||
|
iterationId: [ |
||||
|
//{ required: true, message: '迭代表主键不能为空', trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
//编辑界面数据 XmIterationProductLink 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 |
||||
|
editForm: { |
||||
|
iterationId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:'' |
||||
|
} |
||||
|
/**begin 在下面加自定义属性,记得补上面的一个逗号**/ |
||||
|
|
||||
|
/**end 在上面加自定义属性**/ |
||||
|
}//end return |
||||
|
},//end data |
||||
|
methods: { |
||||
|
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
||||
|
handleCancel:function(){ |
||||
|
this.$refs['editForm'].resetFields(); |
||||
|
this.$emit('cancel'); |
||||
|
}, |
||||
|
//编辑提交XmIterationProductLink 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表父组件监听@submit="afterEditSubmit" |
||||
|
editSubmit: function () { |
||||
|
this.$refs.editForm.validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
||||
|
this.load.edit=true |
||||
|
let params = Object.assign({}, this.editForm); |
||||
|
editXmIterationProductLink(params).then((res) => { |
||||
|
this.load.edit=false |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.$refs['editForm'].resetFields(); |
||||
|
this.$emit('submit');// @submit="afterEditSubmit" |
||||
|
} |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err =>this.load.edit=false); |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
/**begin 在下面加自定义方法,记得补上面的一个逗号**/ |
||||
|
|
||||
|
/**end 在上面加自定义方法**/ |
||||
|
},//end method |
||||
|
components: { |
||||
|
//在下面添加其它组件 'xm-iteration-product-link-edit':XmIterationProductLinkEdit |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.editForm=Object.assign(this.editForm, this.xmIterationProductLink); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,252 @@ |
|||||
|
<template> |
||||
|
<section class="app-container"> |
||||
|
<el-row> |
||||
|
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"> |
||||
|
<template slot="append"> |
||||
|
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmIterationProductLinks" icon="el-icon-search">查询</el-button> |
||||
|
</template> |
||||
|
</el-input> |
||||
|
<el-button type="primary" @click="showAdd" icon="el-icon-plus" circle> </el-button> |
||||
|
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete" circle></el-button> |
||||
|
</el-row> |
||||
|
<el-row style="padding-top:10px;"> |
||||
|
<!--列表 XmIterationProductLink 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表--> |
||||
|
<el-table ref="xmIterationProductLink" :data="xmIterationProductLinks" :max-height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
||||
|
<el-table-column type="selection" width="55"></el-table-column> |
||||
|
<el-table-column sortable type="index" width="55"></el-table-column> |
||||
|
<el-table-column prop="iterationId" label="迭代表主键" min-width="80" ></el-table-column> |
||||
|
<el-table-column prop="productId" label="产品表主键" min-width="80" ></el-table-column> |
||||
|
<el-table-column prop="ctime" label="创建时间" min-width="80" ></el-table-column> |
||||
|
<el-table-column prop="cuserid" label="创建人编号" min-width="80" ></el-table-column> |
||||
|
<el-table-column prop="cusername" label="创建人姓名" min-width="80" ></el-table-column> |
||||
|
<el-table-column prop="linkStatus" label="关联状态1关联0取消关联" min-width="80" ></el-table-column> |
||||
|
<el-table-column label="操作" width="120" fixed="right"> |
||||
|
<template slot="header"> |
||||
|
<el-button @click="showAdd" icon="el-icon-plus" circle> </el-button> |
||||
|
</template> |
||||
|
<template scope="scope"> |
||||
|
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" circle></el-button> |
||||
|
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" circle></el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination> |
||||
|
|
||||
|
<!--编辑 XmIterationProductLink 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表界面--> |
||||
|
<el-dialog title="编辑迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表" :visible.sync="editFormVisible" width="50%" append-to-body :close-on-click-modal="false"> |
||||
|
<xm-iteration-product-link-edit :xm-iteration-product-link="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-iteration-product-link-edit> |
||||
|
</el-dialog> |
||||
|
|
||||
|
<!--新增 XmIterationProductLink 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表界面--> |
||||
|
<el-dialog title="新增迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表" :visible.sync="addFormVisible" width="50%" append-to-body :close-on-click-modal="false"> |
||||
|
<xm-iteration-product-link-add :xm-iteration-product-link="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-iteration-product-link-add> |
||||
|
</el-dialog> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from '@/common/config';//全局公共库 |
||||
|
import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 |
||||
|
import { listXmIterationProductLink, delXmIterationProductLink, batchDelXmIterationProductLink } from '@/api/xm/core/xmIterationProductLink'; |
||||
|
import XmIterationProductLinkAdd from './XmIterationProductLinkAdd';//新增界面 |
||||
|
import XmIterationProductLinkEdit from './XmIterationProductLinkEdit';//修改界面 |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo','workSpace' |
||||
|
]) |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
filters: { |
||||
|
key: '' |
||||
|
}, |
||||
|
xmIterationProductLinks: [],//查询结果 |
||||
|
pageInfo:{//分页数据 |
||||
|
total:0,//服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算。 |
||||
|
pageSize:10,//每页数据 |
||||
|
count:false,//是否需要重新计算总记录数 |
||||
|
pageNum:1,//当前页码、从1开始计算 |
||||
|
orderFields:[],//排序列 如 ['sex','student_id'],必须为数据库字段 |
||||
|
orderDirs:[]//升序 asc,降序desc 如 性别 升序、学生编号降序 ['asc','desc'] |
||||
|
}, |
||||
|
load:{ list: false, edit: false, del: false, add: false },//查询中... |
||||
|
sels: [],//列表选中数据 |
||||
|
options:{ |
||||
|
//sex:[], |
||||
|
},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
||||
|
|
||||
|
addFormVisible: false,//新增xmIterationProductLink界面是否显示 |
||||
|
//新增xmIterationProductLink界面初始化数据 |
||||
|
addForm: { |
||||
|
iterationId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:'' |
||||
|
}, |
||||
|
|
||||
|
editFormVisible: false,//编辑界面是否显示 |
||||
|
//编辑xmIterationProductLink界面初始化数据 |
||||
|
editForm: { |
||||
|
iterationId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:'' |
||||
|
}, |
||||
|
maxTableHeight:300, |
||||
|
} |
||||
|
},//end data |
||||
|
methods: { |
||||
|
handleSizeChange(pageSize) { |
||||
|
this.pageInfo.pageSize=pageSize; |
||||
|
this.getXmIterationProductLinks(); |
||||
|
}, |
||||
|
handleCurrentChange(pageNum) { |
||||
|
this.pageInfo.pageNum = pageNum; |
||||
|
this.getXmIterationProductLinks(); |
||||
|
}, |
||||
|
// 表格排序 obj.order=ascending/descending,需转化为 asc/desc ; obj.prop=表格中的排序字段,字段驼峰命名 |
||||
|
sortChange( obj ){ |
||||
|
if(obj.order==null){ |
||||
|
this.pageInfo.orderFields=[]; |
||||
|
this.pageInfo.orderDirs=[]; |
||||
|
}else{ |
||||
|
var dir='asc'; |
||||
|
if(obj.order=='ascending'){ |
||||
|
dir='asc' |
||||
|
}else{ |
||||
|
dir='desc'; |
||||
|
} |
||||
|
|
||||
|
this.pageInfo.orderFields=[util.toLine(obj.prop)]; |
||||
|
this.pageInfo.orderDirs=[dir]; |
||||
|
} |
||||
|
this.getXmIterationProductLinks(); |
||||
|
}, |
||||
|
searchXmIterationProductLinks(){ |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmIterationProductLinks(); |
||||
|
}, |
||||
|
//获取列表 XmIterationProductLink 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 |
||||
|
getXmIterationProductLinks() { |
||||
|
let params = { |
||||
|
pageSize: this.pageInfo.pageSize, |
||||
|
pageNum: this.pageInfo.pageNum, |
||||
|
total: this.pageInfo.total, |
||||
|
count:this.pageInfo.count |
||||
|
}; |
||||
|
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){ |
||||
|
let orderBys=[]; |
||||
|
for(var i=0;i<this.pageInfo.orderFields.length;i++){ |
||||
|
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i]) |
||||
|
} |
||||
|
params.orderBy= orderBys.join(",") |
||||
|
} |
||||
|
if(this.filters.key){ |
||||
|
params.key="%"+this.filters.key+"%" |
||||
|
} |
||||
|
|
||||
|
this.load.list = true; |
||||
|
listXmIterationProductLink(params).then((res) => { |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.pageInfo.total = res.data.total; |
||||
|
this.pageInfo.count=false; |
||||
|
this.xmIterationProductLinks = res.data.data; |
||||
|
}else{ |
||||
|
this.$message({ message: tips.msg, type: 'error' }); |
||||
|
} |
||||
|
this.load.list = false; |
||||
|
}).catch( err => this.load.list = false ); |
||||
|
}, |
||||
|
|
||||
|
//显示编辑界面 XmIterationProductLink 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 |
||||
|
showEdit: function ( row,index ) { |
||||
|
this.editFormVisible = true; |
||||
|
this.editForm = Object.assign({}, row); |
||||
|
}, |
||||
|
//显示新增界面 XmIterationProductLink 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 |
||||
|
showAdd: function () { |
||||
|
this.addFormVisible = true; |
||||
|
//this.addForm=Object.assign({}, this.editForm); |
||||
|
}, |
||||
|
afterAddSubmit(){ |
||||
|
this.addFormVisible=false; |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmIterationProductLinks(); |
||||
|
}, |
||||
|
afterEditSubmit(){ |
||||
|
this.editFormVisible=false; |
||||
|
}, |
||||
|
//选择行xmIterationProductLink |
||||
|
selsChange: function (sels) { |
||||
|
this.sels = sels; |
||||
|
}, |
||||
|
//删除xmIterationProductLink |
||||
|
handleDel: function (row,index) { |
||||
|
this.$confirm('确认删除该记录吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.load.del=true; |
||||
|
let params = { iterationId: row.iterationId }; |
||||
|
delXmIterationProductLink(params).then((res) => { |
||||
|
this.load.del=false; |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmIterationProductLinks(); |
||||
|
} |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err => this.load.del=false ); |
||||
|
}); |
||||
|
}, |
||||
|
//批量删除xmIterationProductLink |
||||
|
batchDel: function () { |
||||
|
|
||||
|
this.$confirm('确认删除选中记录吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.load.del=true; |
||||
|
batchDelXmIterationProductLink(this.sels).then((res) => { |
||||
|
this.load.del=false; |
||||
|
var tips=res.data.tips; |
||||
|
if( tips.isOk ){ |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmIterationProductLinks(); |
||||
|
} |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error'}); |
||||
|
}).catch( err => this.load.del=false ); |
||||
|
}); |
||||
|
}, |
||||
|
rowClick: function(row, event, column){ |
||||
|
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
||||
|
}, |
||||
|
/**begin 自定义函数请在下面加**/ |
||||
|
|
||||
|
|
||||
|
/**end 自定义函数请在上面加**/ |
||||
|
|
||||
|
},//end methods |
||||
|
components: { |
||||
|
'xm-iteration-product-link-add':XmIterationProductLinkAdd, |
||||
|
'xm-iteration-product-link-edit':XmIterationProductLinkEdit, |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
this.getXmIterationProductLinks(); |
||||
|
var clientRect=this.$refs.xmIterationProductLink.$el.getBoundingClientRect(); |
||||
|
var subHeight=65/1000 * window.innerHeight; |
||||
|
this.maxTableHeight = window.innerHeight -clientRect.y - this.$refs.xmIterationProductLink.$el.offsetTop-subHeight; |
||||
|
}); |
||||
|
/** 举例, |
||||
|
listOption([{categoryId:'all',itemCode:'sex'},{categoryId:'all',itemCode:'grade'}] ).then(res=>{ |
||||
|
if(res.data.tips.isOk){ |
||||
|
this.options=res.data.data |
||||
|
} |
||||
|
}); |
||||
|
**/ |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
</style> |
||||
@ -0,0 +1,123 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-row> |
||||
|
<!--新增界面 XmProductProjectLink 产品与项目的关联关系表,一般由产品经理挂接项目到产品上--> |
||||
|
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm"> |
||||
|
<el-form-item label="项目表中的主键" prop="projectId"> |
||||
|
<el-input v-model="addForm.projectId" placeholder="项目表中的主键" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="产品表中的主键" prop="productId"> |
||||
|
<el-input v-model="addForm.productId" placeholder="产品表中的主键" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建时间" prop="ctime"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.ctime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建人编号" prop="cuserid"> |
||||
|
<el-input v-model="addForm.cuserid" placeholder="创建人编号" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建人姓名" prop="cusername"> |
||||
|
<el-input v-model="addForm.cusername" placeholder="创建人姓名" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="关联状态1关联0取消关联" prop="linkStatus"> |
||||
|
<el-input v-model="addForm.linkStatus" placeholder="关联状态1关联0取消关联" ></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-col :span="24" :offset="8"> |
||||
|
<el-button @click.native="handleCancel">取消</el-button> |
||||
|
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button> |
||||
|
</el-col> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 |
||||
|
import { addXmProductProjectLink } from '@/api/xm/core/xmProductProjectLink'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo' |
||||
|
]) |
||||
|
}, |
||||
|
props:['xmProductProjectLink','visible'], |
||||
|
watch: { |
||||
|
'xmProductProjectLink':function( xmProductProjectLink ) { |
||||
|
this.addForm = xmProductProjectLink; |
||||
|
}, |
||||
|
'visible':function(visible) { |
||||
|
if(visible==true){ |
||||
|
//从新打开页面时某些数据需要重新加载,可以在这里添加 |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
options:{},//下拉选择框的所有静态数据 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: { |
||||
|
projectId: [ |
||||
|
//{ required: true, message: '项目表中的主键不能为空', trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
//新增界面数据 产品与项目的关联关系表,一般由产品经理挂接项目到产品上 |
||||
|
addForm: { |
||||
|
projectId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:'' |
||||
|
} |
||||
|
/**begin 在下面加自定义属性,记得补上面的一个逗号**/ |
||||
|
|
||||
|
/**end 在上面加自定义属性**/ |
||||
|
}//end return |
||||
|
},//end data |
||||
|
methods: { |
||||
|
// 取消按钮点击 父组件监听@cancel="addFormVisible=false" 监听 |
||||
|
handleCancel:function(){ |
||||
|
this.$refs['addForm'].resetFields(); |
||||
|
this.$emit('cancel'); |
||||
|
}, |
||||
|
//新增提交XmProductProjectLink 产品与项目的关联关系表,一般由产品经理挂接项目到产品上 父组件监听@submit="afterAddSubmit" |
||||
|
addSubmit: function () { |
||||
|
|
||||
|
this.$refs.addForm.validate((valid) => { |
||||
|
if (valid) { |
||||
|
|
||||
|
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
||||
|
this.load.add=true |
||||
|
let params = Object.assign({}, this.addForm); |
||||
|
addXmProductProjectLink(params).then((res) => { |
||||
|
this.load.add=false |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.$refs['addForm'].resetFields(); |
||||
|
this.$emit('submit');// @submit="afterAddSubmit" |
||||
|
} |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err => this.load.add=false); |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
/**begin 在下面加自定义方法,记得补上面的一个逗号**/ |
||||
|
|
||||
|
/**end 在上面加自定义方法**/ |
||||
|
|
||||
|
},//end method |
||||
|
components: { |
||||
|
//在下面添加其它组件 'xm-product-project-link-edit':XmProductProjectLinkEdit |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.addForm=Object.assign(this.addForm, this.xmProductProjectLink); |
||||
|
/**在下面写其它函数***/ |
||||
|
|
||||
|
}//end mounted |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,118 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-row> |
||||
|
<!--编辑界面 XmProductProjectLink 产品与项目的关联关系表,一般由产品经理挂接项目到产品上--> |
||||
|
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm"> |
||||
|
<el-form-item label="项目表中的主键" prop="projectId"> |
||||
|
<el-input v-model="editForm.projectId" placeholder="项目表中的主键"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="产品表中的主键" prop="productId"> |
||||
|
<el-input v-model="editForm.productId" placeholder="产品表中的主键"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建时间" prop="ctime"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.ctime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建人编号" prop="cuserid"> |
||||
|
<el-input v-model="editForm.cuserid" placeholder="创建人编号"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建人姓名" prop="cusername"> |
||||
|
<el-input v-model="editForm.cusername" placeholder="创建人姓名"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="关联状态1关联0取消关联" prop="linkStatus"> |
||||
|
<el-input v-model="editForm.linkStatus" placeholder="关联状态1关联0取消关联"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-col :span="24" :offset="8"> |
||||
|
<el-button @click.native="handleCancel">取消</el-button> |
||||
|
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button> |
||||
|
</el-col> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 |
||||
|
import { editXmProductProjectLink } from '@/api/xm/core/xmProductProjectLink'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo' |
||||
|
]) |
||||
|
}, |
||||
|
props:['xmProductProjectLink','visible'], |
||||
|
watch: { |
||||
|
'xmProductProjectLink':function( xmProductProjectLink ) { |
||||
|
this.editForm = xmProductProjectLink; |
||||
|
}, |
||||
|
'visible':function(visible) { |
||||
|
if(visible==true){ |
||||
|
//从新打开页面时某些数据需要重新加载,可以在这里添加 |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
options:{},//下拉选择框的所有静态数据 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: { |
||||
|
projectId: [ |
||||
|
//{ required: true, message: '项目表中的主键不能为空', trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
//编辑界面数据 XmProductProjectLink 产品与项目的关联关系表,一般由产品经理挂接项目到产品上 |
||||
|
editForm: { |
||||
|
projectId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:'' |
||||
|
} |
||||
|
/**begin 在下面加自定义属性,记得补上面的一个逗号**/ |
||||
|
|
||||
|
/**end 在上面加自定义属性**/ |
||||
|
}//end return |
||||
|
},//end data |
||||
|
methods: { |
||||
|
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
||||
|
handleCancel:function(){ |
||||
|
this.$refs['editForm'].resetFields(); |
||||
|
this.$emit('cancel'); |
||||
|
}, |
||||
|
//编辑提交XmProductProjectLink 产品与项目的关联关系表,一般由产品经理挂接项目到产品上父组件监听@submit="afterEditSubmit" |
||||
|
editSubmit: function () { |
||||
|
this.$refs.editForm.validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
||||
|
this.load.edit=true |
||||
|
let params = Object.assign({}, this.editForm); |
||||
|
editXmProductProjectLink(params).then((res) => { |
||||
|
this.load.edit=false |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.$refs['editForm'].resetFields(); |
||||
|
this.$emit('submit');// @submit="afterEditSubmit" |
||||
|
} |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err =>this.load.edit=false); |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
/**begin 在下面加自定义方法,记得补上面的一个逗号**/ |
||||
|
|
||||
|
/**end 在上面加自定义方法**/ |
||||
|
},//end method |
||||
|
components: { |
||||
|
//在下面添加其它组件 'xm-product-project-link-edit':XmProductProjectLinkEdit |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.editForm=Object.assign(this.editForm, this.xmProductProjectLink); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,252 @@ |
|||||
|
<template> |
||||
|
<section class="app-container"> |
||||
|
<el-row> |
||||
|
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"> |
||||
|
<template slot="append"> |
||||
|
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmProductProjectLinks" icon="el-icon-search">查询</el-button> |
||||
|
</template> |
||||
|
</el-input> |
||||
|
<el-button type="primary" @click="showAdd" icon="el-icon-plus" circle> </el-button> |
||||
|
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete" circle></el-button> |
||||
|
</el-row> |
||||
|
<el-row style="padding-top:10px;"> |
||||
|
<!--列表 XmProductProjectLink 产品与项目的关联关系表,一般由产品经理挂接项目到产品上--> |
||||
|
<el-table ref="xmProductProjectLink" :data="xmProductProjectLinks" :max-height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
||||
|
<el-table-column type="selection" width="55"></el-table-column> |
||||
|
<el-table-column sortable type="index" width="55"></el-table-column> |
||||
|
<el-table-column prop="projectId" label="项目表中的主键" min-width="80" ></el-table-column> |
||||
|
<el-table-column prop="productId" label="产品表中的主键" min-width="80" ></el-table-column> |
||||
|
<el-table-column prop="ctime" label="创建时间" min-width="80" ></el-table-column> |
||||
|
<el-table-column prop="cuserid" label="创建人编号" min-width="80" ></el-table-column> |
||||
|
<el-table-column prop="cusername" label="创建人姓名" min-width="80" ></el-table-column> |
||||
|
<el-table-column prop="linkStatus" label="关联状态1关联0取消关联" min-width="80" ></el-table-column> |
||||
|
<el-table-column label="操作" width="120" fixed="right"> |
||||
|
<template slot="header"> |
||||
|
<el-button @click="showAdd" icon="el-icon-plus" circle> </el-button> |
||||
|
</template> |
||||
|
<template scope="scope"> |
||||
|
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" circle></el-button> |
||||
|
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" circle></el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination> |
||||
|
|
||||
|
<!--编辑 XmProductProjectLink 产品与项目的关联关系表,一般由产品经理挂接项目到产品上界面--> |
||||
|
<el-dialog title="编辑产品与项目的关联关系表,一般由产品经理挂接项目到产品上" :visible.sync="editFormVisible" width="50%" append-to-body :close-on-click-modal="false"> |
||||
|
<xm-product-project-link-edit :xm-product-project-link="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-product-project-link-edit> |
||||
|
</el-dialog> |
||||
|
|
||||
|
<!--新增 XmProductProjectLink 产品与项目的关联关系表,一般由产品经理挂接项目到产品上界面--> |
||||
|
<el-dialog title="新增产品与项目的关联关系表,一般由产品经理挂接项目到产品上" :visible.sync="addFormVisible" width="50%" append-to-body :close-on-click-modal="false"> |
||||
|
<xm-product-project-link-add :xm-product-project-link="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-product-project-link-add> |
||||
|
</el-dialog> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from '@/common/config';//全局公共库 |
||||
|
import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 |
||||
|
import { listXmProductProjectLink, delXmProductProjectLink, batchDelXmProductProjectLink } from '@/api/xm/core/xmProductProjectLink'; |
||||
|
import XmProductProjectLinkAdd from './XmProductProjectLinkAdd';//新增界面 |
||||
|
import XmProductProjectLinkEdit from './XmProductProjectLinkEdit';//修改界面 |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo','workSpace' |
||||
|
]) |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
filters: { |
||||
|
key: '' |
||||
|
}, |
||||
|
xmProductProjectLinks: [],//查询结果 |
||||
|
pageInfo:{//分页数据 |
||||
|
total:0,//服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算。 |
||||
|
pageSize:10,//每页数据 |
||||
|
count:false,//是否需要重新计算总记录数 |
||||
|
pageNum:1,//当前页码、从1开始计算 |
||||
|
orderFields:[],//排序列 如 ['sex','student_id'],必须为数据库字段 |
||||
|
orderDirs:[]//升序 asc,降序desc 如 性别 升序、学生编号降序 ['asc','desc'] |
||||
|
}, |
||||
|
load:{ list: false, edit: false, del: false, add: false },//查询中... |
||||
|
sels: [],//列表选中数据 |
||||
|
options:{ |
||||
|
//sex:[], |
||||
|
},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
||||
|
|
||||
|
addFormVisible: false,//新增xmProductProjectLink界面是否显示 |
||||
|
//新增xmProductProjectLink界面初始化数据 |
||||
|
addForm: { |
||||
|
projectId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:'' |
||||
|
}, |
||||
|
|
||||
|
editFormVisible: false,//编辑界面是否显示 |
||||
|
//编辑xmProductProjectLink界面初始化数据 |
||||
|
editForm: { |
||||
|
projectId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:'' |
||||
|
}, |
||||
|
maxTableHeight:300, |
||||
|
} |
||||
|
},//end data |
||||
|
methods: { |
||||
|
handleSizeChange(pageSize) { |
||||
|
this.pageInfo.pageSize=pageSize; |
||||
|
this.getXmProductProjectLinks(); |
||||
|
}, |
||||
|
handleCurrentChange(pageNum) { |
||||
|
this.pageInfo.pageNum = pageNum; |
||||
|
this.getXmProductProjectLinks(); |
||||
|
}, |
||||
|
// 表格排序 obj.order=ascending/descending,需转化为 asc/desc ; obj.prop=表格中的排序字段,字段驼峰命名 |
||||
|
sortChange( obj ){ |
||||
|
if(obj.order==null){ |
||||
|
this.pageInfo.orderFields=[]; |
||||
|
this.pageInfo.orderDirs=[]; |
||||
|
}else{ |
||||
|
var dir='asc'; |
||||
|
if(obj.order=='ascending'){ |
||||
|
dir='asc' |
||||
|
}else{ |
||||
|
dir='desc'; |
||||
|
} |
||||
|
|
||||
|
this.pageInfo.orderFields=[util.toLine(obj.prop)]; |
||||
|
this.pageInfo.orderDirs=[dir]; |
||||
|
} |
||||
|
this.getXmProductProjectLinks(); |
||||
|
}, |
||||
|
searchXmProductProjectLinks(){ |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmProductProjectLinks(); |
||||
|
}, |
||||
|
//获取列表 XmProductProjectLink 产品与项目的关联关系表,一般由产品经理挂接项目到产品上 |
||||
|
getXmProductProjectLinks() { |
||||
|
let params = { |
||||
|
pageSize: this.pageInfo.pageSize, |
||||
|
pageNum: this.pageInfo.pageNum, |
||||
|
total: this.pageInfo.total, |
||||
|
count:this.pageInfo.count |
||||
|
}; |
||||
|
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){ |
||||
|
let orderBys=[]; |
||||
|
for(var i=0;i<this.pageInfo.orderFields.length;i++){ |
||||
|
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i]) |
||||
|
} |
||||
|
params.orderBy= orderBys.join(",") |
||||
|
} |
||||
|
if(this.filters.key){ |
||||
|
params.key="%"+this.filters.key+"%" |
||||
|
} |
||||
|
|
||||
|
this.load.list = true; |
||||
|
listXmProductProjectLink(params).then((res) => { |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.pageInfo.total = res.data.total; |
||||
|
this.pageInfo.count=false; |
||||
|
this.xmProductProjectLinks = res.data.data; |
||||
|
}else{ |
||||
|
this.$message({ message: tips.msg, type: 'error' }); |
||||
|
} |
||||
|
this.load.list = false; |
||||
|
}).catch( err => this.load.list = false ); |
||||
|
}, |
||||
|
|
||||
|
//显示编辑界面 XmProductProjectLink 产品与项目的关联关系表,一般由产品经理挂接项目到产品上 |
||||
|
showEdit: function ( row,index ) { |
||||
|
this.editFormVisible = true; |
||||
|
this.editForm = Object.assign({}, row); |
||||
|
}, |
||||
|
//显示新增界面 XmProductProjectLink 产品与项目的关联关系表,一般由产品经理挂接项目到产品上 |
||||
|
showAdd: function () { |
||||
|
this.addFormVisible = true; |
||||
|
//this.addForm=Object.assign({}, this.editForm); |
||||
|
}, |
||||
|
afterAddSubmit(){ |
||||
|
this.addFormVisible=false; |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmProductProjectLinks(); |
||||
|
}, |
||||
|
afterEditSubmit(){ |
||||
|
this.editFormVisible=false; |
||||
|
}, |
||||
|
//选择行xmProductProjectLink |
||||
|
selsChange: function (sels) { |
||||
|
this.sels = sels; |
||||
|
}, |
||||
|
//删除xmProductProjectLink |
||||
|
handleDel: function (row,index) { |
||||
|
this.$confirm('确认删除该记录吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.load.del=true; |
||||
|
let params = { projectId: row.projectId }; |
||||
|
delXmProductProjectLink(params).then((res) => { |
||||
|
this.load.del=false; |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmProductProjectLinks(); |
||||
|
} |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err => this.load.del=false ); |
||||
|
}); |
||||
|
}, |
||||
|
//批量删除xmProductProjectLink |
||||
|
batchDel: function () { |
||||
|
|
||||
|
this.$confirm('确认删除选中记录吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.load.del=true; |
||||
|
batchDelXmProductProjectLink(this.sels).then((res) => { |
||||
|
this.load.del=false; |
||||
|
var tips=res.data.tips; |
||||
|
if( tips.isOk ){ |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmProductProjectLinks(); |
||||
|
} |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error'}); |
||||
|
}).catch( err => this.load.del=false ); |
||||
|
}); |
||||
|
}, |
||||
|
rowClick: function(row, event, column){ |
||||
|
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
||||
|
}, |
||||
|
/**begin 自定义函数请在下面加**/ |
||||
|
|
||||
|
|
||||
|
/**end 自定义函数请在上面加**/ |
||||
|
|
||||
|
},//end methods |
||||
|
components: { |
||||
|
'xm-product-project-link-add':XmProductProjectLinkAdd, |
||||
|
'xm-product-project-link-edit':XmProductProjectLinkEdit, |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
this.getXmProductProjectLinks(); |
||||
|
var clientRect=this.$refs.xmProductProjectLink.$el.getBoundingClientRect(); |
||||
|
var subHeight=65/1000 * window.innerHeight; |
||||
|
this.maxTableHeight = window.innerHeight -clientRect.y - this.$refs.xmProductProjectLink.$el.offsetTop-subHeight; |
||||
|
}); |
||||
|
/** 举例, |
||||
|
listOption([{categoryId:'all',itemCode:'sex'},{categoryId:'all',itemCode:'grade'}] ).then(res=>{ |
||||
|
if(res.data.tips.isOk){ |
||||
|
this.options=res.data.data |
||||
|
} |
||||
|
}); |
||||
|
**/ |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue