Browse Source

收藏夹+demo

master
ruanqi 2 years ago
parent
commit
1553879767
  1. 18
      src/api/project/project.js
  2. 245
      src/views/modules/project/comdemo.vue
  3. 2
      src/views/modules/project/demo.vue
  4. 624
      src/views/modules/project/projectInfo/projectInfo-add-or-update.vue
  5. 71
      src/views/modules/project/projectInfo/projectInfo.vue

18
src/api/project/project.js

@ -0,0 +1,18 @@
import { createAPI } from "@/utils/httpRequest.js";
export const projectInfoSearch = data => createAPI(`/project/projectInfoSearch`,'Post',data)
export const searchOperatorWithSite = data => createAPI(`/project/searchOperatorWithSite`,'Post',data)
export const searchProjectTeam = data => createAPI(`/project/searchProjectTeam`,'Post',data)
export const searchProjectTeamStr = data => createAPI(`/project/searchProjectTeamStr`,'Post',data)
export const searchUserRoll = data => createAPI(`/project/searchUserRoll`,'Post',data)
export const saveProjectInfo = data => createAPI(`/project/saveProjectInfo`,'Post',data)

245
src/views/modules/project/comdemo.vue

@ -0,0 +1,245 @@
<template>
<div class="mod-config">
<el-dialog
width="600px"
:title="!dataForm.id ? '添加' :'编辑'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'项目层级'">
<el-select v-model="dataForm.projectLevel" style="width: 130px">
<el-option label="一级" value=1></el-option>
<el-option label="二级" value=2></el-option>
<el-option label="三级" value=3></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'项目号'">
<el-input v-model="dataForm.projectId" style="width: 130px" disabled></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(1010,1)"><a herf="#">项目类型</a></span>
<el-input v-model="dataForm.projectTypeDesc" style="width: 130px" readonly @focus="getBaseList(1010,1)"></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(102,1)"><a herf="#">所属客户</a></span>
<el-input v-model="dataForm.customerName" style="width: 130px" readonly @focus="getBaseList(102,1)"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'项目名称'">
<el-input v-model="dataForm.projectName" style="width: 562px" ></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'项目描述'">
<el-input v-model="dataForm.projectDesc" style="width: 562px" ></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item >
<span slot="label" style="" @click="getBaseList(1011,1)"><a herf="#">项目来源</a></span>
<el-input v-model="dataForm.projectSourceDesc" style="width: 130px" readonly @focus="getBaseList(1011,1)"></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(1012,1)"><a herf="#">优先级</a></span>
<el-input v-model="dataForm.priorityDesc" style="width: 130px" readonly @focus="getBaseList(1012,1)"></el-input>
</el-form-item>
<el-form-item :label="'要求日期:'">
<el-date-picker
style="width: 130px"
v-model="dataForm.needDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item >
<span slot="label" style="" @click="getBaseList(1012,1)"><a herf="#">项目经理</a></span>
<el-input v-model="dataForm.projectManagerName" readonly style="width: 274px" @focus="getBaseList(1010,1)"></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(1012,1)"><a herf="#">项目负责人</a></span>
<el-input v-model="dataForm.projectObjectName" readonly style="width: 274px" @focus="getBaseList(1010,1)"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'客户应用/要求'">
<el-input v-model="dataForm.customerRemark" style="width: 562px" ></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'其他要求'">
<el-input v-model="dataForm.remark" style="width: 562px" ></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item>
<span slot="label" style="" @click="getBaseList(1012,1)"><a herf="#">项目权限</a></span>
<el-input v-model="dataForm.userListName" style="width: 562px" ></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dataFormSubmit()">{{'确定'}}</el-button>
<el-button type="primary" @click="visible = false">{{'关闭'}}</el-button>
</span>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {projectInfoSearch } from "@/api/project/project.js"
import Chooselist from '@/views/modules/common/Chooselist'
export default {
components: {
Chooselist
},
data () {
return {
tagNo:'',
tagNo1:'',
visible: false,
treeVisible: false,
dataForm: {
id: 0,
site:'',
projectLevel:1,
projectId:'',
projectType:'',
projectTypeDesc:'',
customerName:'',
customerId:'',
projectName:'',
projectDesc:'',
needDate:'',
priority:'',
projectSource:'',
priorityDesc:'',
projectSourceDesc:'',
projectManagerName:'',
projectObjectName:'',
customerRemark:'',
remark:'',
userListName:'',
},
projectManagerList:[],
projectObjectName:[],
userList:[],
}
},
created () {
},
methods: {
// S
getBaseList (val, type) {
this.tagNo = val
this.tagNo1 = type
this.$nextTick(() => {
let strVal = ''
if (val === 1010) {
if(type==1) {
strVal = this.dataForm.projectType
}
}
if (val === 102) {
if(type==1) {
strVal = this.dataForm.customerId
}
}
if (val === 1011) {
if(type==1) {
strVal = this.dataForm.projectSource
}
}
if (val === 1012) {
if(type==1) {
strVal = this.dataForm.priority
}
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 1010) {
if(this.tagNo1==1) {
this.dataForm.projectType = val.Base_id
this.dataForm.projectTypeDesc = val.Base_desc
}
}
if (this.tagNo === 102) {
if(this.tagNo1==1) {
this.dataForm.customerId = val.Customer_no
this.dataForm.customerName = val.Customer_desc
}
}
if (this.tagNo === 1011) {
if(this.tagNo1==1) {
this.dataForm.projectSource = val.Base_id
this.dataForm.projectSourceDesc = val.Base_desc
}
}
if (this.tagNo === 1012) {
if(this.tagNo1==1) {
this.dataForm.priority = val.Base_id
this.dataForm.priorityDesc = val.Base_desc
}
}
},
init (id) {
this.dataForm.id = id || 0
if(this.dataForm.id!=0){
projectInfoSearch(this.searchData).then(({data}) => {
if(data.page.list.length>0){
this.exportList= data.page.list[0];
}
})
}
this.visible = true
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/sys/menu/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'menuId': this.dataForm.menuId,
'type': this.dataForm.type,
'name': this.dataForm.name,
'parentId': this.dataForm.parentId,
'url': this.dataForm.url,
'perms': this.dataForm.perms,
'orderNum': this.dataForm.orderNum,
'icon': this.dataForm.icon,
'menuType': this.dataForm.menuType,
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message.success('操作成功')
this.visible = false
this.$emit('refreshDataList')
} else {
this.$message.error(data.msg)
}
})
}
})
}
},
}
</script>
<style lang="scss" >
</style>

2
src/views/modules/project/demo.vue

@ -1,6 +1,6 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -10px;">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
<el-form-item > <el-form-item >
<span slot="label" style="" @click="getBaseList(1031,3)"><a herf="#">工厂编码</a></span> <span slot="label" style="" @click="getBaseList(1031,3)"><a herf="#">工厂编码</a></span>
<el-input v-model="searchData.site" style="width: 120px"></el-input> <el-input v-model="searchData.site" style="width: 120px"></el-input>

624
src/views/modules/project/projectInfo/projectInfo-add-or-update.vue

@ -0,0 +1,624 @@
<template>
<div class="mod-config">
<el-dialog
width="600px"
:title="!dataForm.id ? '添加' :'编辑'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'项目层级'">
<el-select v-model="dataForm.projectLevel" style="width: 130px">
<el-option label="一级" value=1></el-option>
<el-option label="二级" value=2></el-option>
<el-option label="三级" value=3></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'项目号'">
<el-input v-model="dataForm.projectId" style="width: 130px" disabled></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(1010,1)"><a herf="#">项目类型</a></span>
<el-input v-model="dataForm.projectType" style="width: 130px" readonly @focus="getBaseList(1010,1)"></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(102,1)"><a herf="#">所属客户</a></span>
<el-input v-model="dataForm.customerName" style="width: 130px" readonly @focus="getBaseList(102,1)"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'项目名称'">
<el-input v-model="dataForm.projectName" style="width: 562px" ></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'项目描述'">
<el-input v-model="dataForm.projectDesc" style="width: 562px" ></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item >
<span slot="label" style="" @click="getBaseList(1011,1)"><a herf="#">项目来源</a></span>
<el-input v-model="dataForm.projectSourceDesc" style="width: 130px" readonly @focus="getBaseList(1011,1)"></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(1012,1)"><a herf="#">优先级</a></span>
<el-input v-model="dataForm.priorityDesc" style="width: 130px" readonly @focus="getBaseList(1012,1)"></el-input>
</el-form-item>
<el-form-item :label="'要求日期:'">
<el-date-picker
style="width: 130px"
v-model="dataForm.needDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item >
<span slot="label" style="" @click="managerChooseModal()"><a herf="#">项目经理</a></span>
<el-input v-model="dataForm.projectManagerName" readonly style="width: 274px" @focus="managerChooseModal()"></el-input>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="ownerChooseModal()"><a herf="#">项目负责人</a></span>
<el-input v-model="dataForm.projectOwnerName" readonly style="width: 274px" @focus="ownerChooseModal()"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'客户应用/要求'">
<el-input v-model="dataForm.customerRemark" style="width: 562px" ></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'其他要求'">
<el-input v-model="dataForm.remark" style="width: 562px" ></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item>
<span slot="label" style="" @click="userRollModal()"><a herf="#">项目权限</a></span>
<el-input v-model="dataForm.userRoleName" style="width: 562px" @focus="userRollModal()"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dataFormSubmit()">{{'确定'}}</el-button>
<el-button type="primary" @click="visible = false">{{'关闭'}}</el-button>
</span>
</el-dialog>
<el-dialog
width="530px"
title="项目经理"
:close-on-click-modal="false"
:visible.sync="managerFlag">
<el-transfer v-model="projectManagerList" :props="{
key: 'operatorId',
label: 'operatorName'
}" :data="operatorList" :titles="['未选择', '已选择']"></el-transfer>
<span slot="footer" class="dialog-footer">
<div style="margin-top: 5px">
<el-button type="primary" @click="saveManagerList()">确定</el-button>
<el-button @click="managerFlag = false" type="primary">取消</el-button>
</div>
</span>
</el-dialog>
<el-dialog
width="530px"
title="项目负责人"
:close-on-click-modal="false"
:visible.sync="ownerFlag">
<el-transfer v-model="projectOwnerList" :props="{
key: 'operatorId',
label: 'operatorName'
}" :data="operatorList" :titles="['未选择', '已选择']"></el-transfer>
<span slot="footer" class="dialog-footer">
<div style="margin-top: 5px">
<el-button type="primary" @click="saveOwnerList()">确定</el-button>
<el-button @click="ownerFlag = false" type="primary">取消</el-button>
</div>
</span>
</el-dialog>
<el-dialog
width="530px"
title="权限"
:close-on-click-modal="false"
:visible.sync="userRoleFlag">
<el-table
:data="userRoleList"
border
:height="300"
v-loading="false"
style="width: 100%;">
<el-table-column
prop="username"
header-align="center"
align="center"
min-width="35"
label="账号">
</el-table-column>
<el-table-column
prop="userDisplay"
header-align="center"
align="center"
min-width="35"
label="姓名">
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
min-width="30"
label="">
<template slot-scope="scope">
<!-- 如果数据为Y显示勾选框否则不勾选 -->
<el-checkbox v-model="scope.row.checkAll" @change="changeAll(scope.row)"></el-checkbox>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
min-width="30"
label="查询">
<template slot-scope="scope">
<!-- 如果数据为Y显示勾选框否则不勾选 -->
<el-checkbox v-model="scope.row.searchCheck" @change="changeCheck(scope.row,1)"></el-checkbox>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
min-width="30"
label="修改">
<template slot-scope="scope">
<!-- 如果数据为Y显示勾选框否则不勾选 -->
<el-checkbox v-model="scope.row.updateCheck" @change="changeCheck(scope.row,2)"></el-checkbox>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
min-width="30"
label="下载">
<template slot-scope="scope">
<!-- 如果数据为Y显示勾选框否则不勾选 -->
<el-checkbox v-model="scope.row.downCheck" @change="changeCheck(scope.row,3)"></el-checkbox>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
min-width="30"
label="删除">
<template slot-scope="scope">
<!-- 如果数据为Y显示勾选框否则不勾选 -->
<el-checkbox v-model="scope.row.deleteCheck" @change="changeCheck(scope.row,4)"></el-checkbox>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<div style="margin-top: 5px">
<el-button type="primary" @click="saveUserList()">确定</el-button>
<el-button @click="userRoleFlag = false" type="primary">取消</el-button>
</div>
</span>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {projectInfoSearch,
searchOperatorWithSite,
searchProjectTeamStr,
searchUserRoll,
saveProjectInfo,
} from "@/api/project/project.js"
import Chooselist from '@/views/modules/common/Chooselist'
export default {
components: {
Chooselist
},
data () {
return {
tagNo:'',
tagNo1:'',
visible: false,
treeVisible: false,
managerFlag:false,
userRoleFlag:false,
ownerFlag:false,
operatorList:[],
dataForm: {
id: 0,
site:this.$store.state.user.site,
projectLevel:1,
projectId:'',
projectTypeDb:'',
projectType:'',
customerName:'',
customerId:'',
projectName:'',
projectDesc:'',
needDate:'',
priority:'',
projectSource:'',
priorityDesc:'',
projectSourceDesc:'',
projectManagerName:'',
projectOwnerName:'',
customerRemark:'',
remark:'',
userRoleName:'',
projectManagerList:[],
projectOwnerList:[],
userRoleList:[],
},
projectManagerList:[],
projectOwnerList:[],
userRoleList:[],
}
},
created () {
},
methods: {
// S
getBaseList (val, type) {
this.tagNo = val
this.tagNo1 = type
this.$nextTick(() => {
let strVal = ''
if (val === 1010) {
if(type==1) {
strVal = this.dataForm.projectTypeDb
}
}
if (val === 102) {
if(type==1) {
strVal = this.dataForm.customerId
}
}
if (val === 1011) {
if(type==1) {
strVal = this.dataForm.projectSource
}
}
if (val === 1012) {
if(type==1) {
strVal = this.dataForm.priority
}
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 1010) {
if(this.tagNo1==1) {
this.dataForm.projectTypeDb = val.Base_id
this.dataForm.projectType = val.Base_desc
}
}
if (this.tagNo === 102) {
if(this.tagNo1==1) {
this.dataForm.customerId = val.Customer_no
this.dataForm.customerName = val.Customer_desc
}
}
if (this.tagNo === 1011) {
if(this.tagNo1==1) {
this.dataForm.projectSource = val.Base_id
this.dataForm.projectSourceDesc = val.Base_desc
}
}
if (this.tagNo === 1012) {
if(this.tagNo1==1) {
this.dataForm.priority = val.Base_id
this.dataForm.priorityDesc = val.Base_desc
}
}
},
init (id) {
this.dataForm.id = id || 0
if(this.dataForm.id!=0){
let inData={
page: 1,
limit: 10,
id:id
}
projectInfoSearch(inData).then(({data}) => {
if(data.page.list.length>0){
this.dataForm= data.page.list[0];
let inData={
site:this.dataForm.site,
projectId:this.dataForm.projectId,
type:'manager',
}
searchProjectTeamStr(inData).then(({data}) => {
this.dataForm.projectManagerList=data.rows
})
let inData2={
site:this.dataForm.site,
projectId:this.dataForm.projectId,
type:'owner',
}
searchProjectTeamStr(inData2).then(({data}) => {
this.dataForm.projectOwnerList=data.rows
})
let inData3={
site:this.dataForm.site,
projectId:this.dataForm.projectId,
}
searchUserRoll(inData3).then(({data}) => {
this.dataForm.userRoleList=data.rows
})
}
})
}else {
this.dataForm={
id: 0,
site:this.$store.state.user.site,
projectLevel:1,
projectId:'',
projectTypeDb:'',
projectType:'',
customerName:'',
customerId:'',
projectName:'',
projectDesc:'',
needDate:'',
priority:'',
projectSource:'',
priorityDesc:'',
projectSourceDesc:'',
projectManagerName:'',
projectOwnerName:'',
customerRemark:'',
remark:'',
userRoleName:'',
projectManagerList:[],
projectOwnerList:[],
}
let inData={
site:this.dataForm.site,
projectId:this.dataForm.projectId,
}
searchUserRoll(inData).then(({data}) => {
this.dataForm.userRoleList=data.rows
})
}
this.visible = true
},
managerChooseModal(){
let inData={
site:this.dataForm.site,
projectId:this.dataForm.projectId,
}
searchOperatorWithSite(inData).then(({data}) => {
this.operatorList=data.rows
})
this.projectManagerList = JSON.parse(JSON.stringify(this.dataForm.projectManagerList));
this.managerFlag=true
},
saveManagerList(){
let projectManagerName='';
for (let i = 0; i < this.projectManagerList.length; i++) {
let select= this.operatorList.filter(item => item.operatorId === this.projectManagerList[i])
if(select.length>0){
projectManagerName+=select[0].operatorName+';'
}
}
this.dataForm.projectManagerName=projectManagerName
this.dataForm.projectManagerList=JSON.parse(JSON.stringify(this.projectManagerList));
this.managerFlag=false
},
ownerChooseModal(){
let inData={
site:this.dataForm.site,
projectId:this.dataForm.projectId,
}
searchOperatorWithSite(inData).then(({data}) => {
this.operatorList=data.rows
})
this.projectOwnerList = JSON.parse(JSON.stringify(this.dataForm.projectOwnerList));
this.ownerFlag=true
},
saveOwnerList(){
let projectOwnerName='';
for (let i = 0; i < this.projectOwnerList.length; i++) {
let select= this.operatorList.filter(item => item.operatorId === this.projectOwnerList[i])
if(select.length>0){
projectOwnerName+=select[0].operatorName+';'
}
}
this.dataForm.projectOwnerName=projectOwnerName
this.dataForm.projectOwnerList=JSON.parse(JSON.stringify(this.projectOwnerList));
this.ownerFlag=false
},
userRollModal(){
this.userRoleList=JSON.parse(JSON.stringify(this.dataForm.userRoleList));
this.userRoleFlag=true
},
saveUserList(){
console.log(this.userRoleList)
let name= '';
for (let i = 0; i < this.userRoleList.length; i++) {
if(this.userRoleList[i].searchCheck||this.userRoleList[i].updateCheck||this.userRoleList[i].downCheck||this.userRoleList[i].deleteCheck){
name+=this.userRoleList[i].userDisplay+';'
}
}
this.dataForm.userRoleName=name
this.dataForm.userRoleList=JSON.parse(JSON.stringify(this.userRoleList));
this.userRoleFlag=false
},
changeAll(row){
if(row.checkAll){
row.searchCheck=true;
row.updateCheck=true;
row.downCheck=true;
row.deleteCheck=true;
row.searchFlag='Y'
row.updateFlag='Y'
row.downFlag='Y'
row.deleteFlag='Y'
}else {
row.searchCheck=false;
row.updateCheck=false;
row.downCheck=false;
row.deleteCheck=false;
row.searchFlag='N'
row.updateFlag='N'
row.downFlag='N'
row.deleteFlag='N'
}
},
changeCheck(row,type){
if(type==1){
if(row.searchCheck){
row.searchFlag='Y'
}else {
row.searchFlag='N'
}
}
if(type==2){
if(row.updateCheck){
row.updateFlag='Y'
}else {
row.updateFlag='N'
}
}
if(type==3){
if(row.downCheck){
row.downFlag='Y'
}else {
row.downFlag='N'
}
}
if(type==4){
if(row.deleteCheck){
row.deleteFlag='Y'
}else {
row.deleteFlag='N'
}
}
if(row.searchCheck&&row.updateCheck&&row.downCheck&&row.deleteCheck){
row.checkAll=true
}else{
row.checkAll=false
}
this.$forceUpdate();
},
//
dataFormSubmit () {
if(this.dataForm.projectTypeDb==''||this.dataForm.projectTypeDb==null){
this.$alert('请选择项目类型!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.dataForm.customerId==''||this.dataForm.customerId==null){
this.$alert('请选择所属客户!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.dataForm.projectName==''||this.dataForm.projectName==null){
this.$alert('请输入项目名称!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.dataForm.projectSource==''||this.dataForm.projectSource==null){
this.$alert('请选择项目来源!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.dataForm.priority==''||this.dataForm.priority==null){
this.$alert('请选择优先级!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.dataForm.needDate==''||this.dataForm.needDate==null){
this.$alert('请选择要求日期!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.dataForm.projectManagerName==''||this.dataForm.projectManagerName==null){
this.$alert('请选择项目经理!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.dataForm.projectOwnerName==''||this.dataForm.projectOwnerName==null){
this.$alert('请选择项目负责人!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.dataForm.userRoleName==''||this.dataForm.userRoleName==null){
this.$alert('请选择权限!', '错误', {
confirmButtonText: '确定'
})
return false;
}
saveProjectInfo(this.dataForm).then(({data}) => {
if (data && data.code === 0) {
this.$message.success( '操作成功')
this.visible = false
this.$emit('refreshDataList')
} else {
this.$message.error(data.msg)
}
})
},
},
}
</script>
<style >
.el-transfer-panel {
border: 2px solid #17b3a3;
border-radius: 4px;
overflow: hidden;
background: #fff;
display: inline-block;
vertical-align: middle;
width: 200px;
max-height: 100%;
-webkit-box-sizing: border-box;
box-sizing: border-box;
position: relative;
}
.el-transfer-panel .el-transfer-panel__header {
height: 40px;
line-height: 40px;
background: #17b3a3;
margin: 0;
padding-left: 15px;
border-bottom: 1px solid #17b3a3;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: #000;
}
.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label {
font-size: 14px;
color: #303133;
font-weight: 400;
}
</style>

71
src/views/modules/project/projectInfo/projectInfo.vue

@ -1,18 +1,25 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -10px;">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
<el-form-item :label="'项目编号'">
<el-input v-model="searchData.projectId" style="width: 130px"></el-input>
</el-form-item>
<el-form-item > <el-form-item >
<span slot="label" style="" @click="getBaseList(1031,3)"><a herf="#">工厂编码</a></span>
<el-input v-model="searchData.site" style="width: 120px"></el-input>
<span slot="label" style="" @click="getBaseList(1010,1)"><a herf="#">项目类型</a></span>
<el-input v-model="searchData.projectType" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'项目责任人'">
<el-input v-model="searchData.projectOwnerName" style="width: 130px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label=" "> <el-form-item label=" ">
<el-button @click="search()" type="primary" style="margin-left: 2px;margin-top: 33px">查询</el-button>
<el-button @click="search()" type="primary" style="margin-left: 2px;margin-top:0px">查询</el-button>
<el-button @click="addOrUpdateHandle()" type="primary" style="margin-left: 2px;margin-top: 0px">新增</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
:height="height" :height="height"
:data="dataList"
:data="dataList1"
border border
v-loading="dataListLoading" v-loading="dataListLoading"
style="width: 100%;"> style="width: 100%;">
@ -54,32 +61,37 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="search" v-drag></add-or-update>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div> </div>
</template> </template>
<script> <script>
import AddOrUpdate from './projectInfo-add-or-update'
import { import {
getTableDefaultListLanguage, getTableDefaultListLanguage,
getTableUserListLanguage, getTableUserListLanguage,
} from "@/api/table.js" } from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist' import Chooselist from '@/views/modules/common/Chooselist'
import { } from "@/api/table.js"
import {projectInfoSearch } from "@/api/project/project.js"
export default { export default {
components: { components: {
Chooselist
Chooselist,AddOrUpdate
}, },
name: "null", name: "null",
data() { data() {
return { return {
addOrUpdateVisible:false,
searchData:{ searchData:{
page: 1, page: 1,
limit: 10, limit: 10,
site:this.$store.state.user.site,
projectId:'',
projectType:'',
projectOwnerName:'',
}, },
height: 200, height: 200,
dataList:[],
dataList1:[],
dataListLoading: false, dataListLoading: false,
// start // start
exportData: [], exportData: [],
@ -187,10 +199,10 @@
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 101002001, functionId: 101002001,
serialNumber: '101002001Table1ProjectManagerId',
serialNumber: '101002001Table1ProjectOwnerName',
tableId: "101002001Table1", tableId: "101002001Table1",
tableName: "项目信息主表", tableName: "项目信息主表",
columnProp: "projectManagerId",
columnProp: "projectOwnerName",
headerAlign: "center", headerAlign: "center",
align: "left", align: "left",
columnLabel: "项目负责人", columnLabel: "项目负责人",
@ -361,7 +373,7 @@
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.height = window.innerHeight - 240;
this.height = window.innerHeight - 540;
}) })
}, },
methods: { methods: {
@ -371,13 +383,13 @@
this.tagNo2 = type this.tagNo2 = type
this.$nextTick(() => { this.$nextTick(() => {
let strVal = '' let strVal = ''
if (val === 26) {
if (val === 1010) {
if(type==1) { if(type==1) {
strVal = this.saveHeaderData.operatorId
strVal = this.searchData.projectType
}else if(type==2){ }else if(type==2){
strVal = this.saveHeaderData.operatorId2
strVal = this.searchData.projectType
}else { }else {
strVal = this.searchData.operatorName
strVal = this.searchData.projectType
} }
} }
this.$refs.baseList.init(val, strVal) this.$refs.baseList.init(val, strVal)
@ -385,23 +397,28 @@
}, },
/* 列表方法的回调 */ /* 列表方法的回调 */
getBaseData (val) { getBaseData (val) {
if (this.tagNo === 26) {
if(this.tagNo2==1) {
this.saveHeaderData.operatorId = val.OperatorID
this.saveHeaderData.operatorName = val.OperatorName
if (this.tagNo === 1010) {
if(this.tagNo1==1) {
this.searchData.projectType = val.Base_id
}else if(this.tagNo2==2){ }else if(this.tagNo2==2){
this.saveHeaderData.operatorId2 = val.OperatorID
this.saveHeaderData.operatorIdName2 = val.OperatorName
this.searchData.projectType = val.Base_id
}else { }else {
this.searchData.operatorName = val.OperatorName
this.searchData.projectType = val.Base_id
} }
} }
}, },
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//excel //excel
async createExportData() { async createExportData() {
this.searchData.limit = -1 this.searchData.limit = -1
this.searchData.page = 1 this.searchData.page = 1
await eamWorkPlanSearch(this.searchData).then(({data}) => {
await projectInfoSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list; this.exportList= data.page.list;
}) })
@ -433,9 +450,9 @@
search () { search () {
this.searchData.limit = this.pageSize this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex this.searchData.page = this.pageIndex
eamWorkPlanSearch(this.searchData).then(({data}) => {
projectInfoSearch(this.searchData).then(({data}) => {
if (data.code == 0) { if (data.code == 0) {
this.dataList = data.page.list
this.dataList1 = data.page.list
this.pageIndex = data.page.currPage this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount

Loading…
Cancel
Save