|
@@ -67,8 +67,8 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
- <el-collapse>
|
|
|
- <el-collapse-item>
|
|
|
+ <el-collapse v-model="activeNames">
|
|
|
+ <el-collapse-item name="1">
|
|
|
<template slot="title">
|
|
|
<el-col :span="24" class="title">项目模具</el-col>
|
|
|
</template>
|
|
@@ -81,12 +81,12 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="modelName" label="模具名称" width="500" sortable></el-table-column>
|
|
|
- <el-table-column prop="factoryName" label="所属生产商" sortable></el-table-column>
|
|
|
+ <el-table-column prop="produceCompanyName" label="所属生产商" sortable></el-table-column>
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
</el-collapse-item>
|
|
|
|
|
|
- <el-collapse-item>
|
|
|
+ <el-collapse-item name="2">
|
|
|
<template slot="title">
|
|
|
<el-col :span="24" class="title">项目文档
|
|
|
<!-- update == 1 -->
|
|
@@ -117,7 +117,7 @@
|
|
|
</el-col>
|
|
|
</el-collapse-item>
|
|
|
|
|
|
- <el-collapse-item>
|
|
|
+ <el-collapse-item name="3">
|
|
|
<template slot="title">
|
|
|
<el-col :span="24" class="title">操作记录</el-col>
|
|
|
</template>
|
|
@@ -145,16 +145,18 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="生产方公司" prop="customerCompany">
|
|
|
- <el-select v-model="editForm.customerCompany" clearable filterable multiple placeholder="请选择生产方公司" @change="companyChange" value-key='id' style="width:510px">
|
|
|
- <el-option v-for="item in company" :key="item.companyName" :label="item.companyName" :value="item">
|
|
|
+ <el-form-item label="项目模具" prop="modelIds">
|
|
|
+ <el-select v-model="editForm.modelIds" clearable filterable multiple placeholder="请选择项目模具" value-key='id' style="width:510px">
|
|
|
+ <el-option v-for="item in molds" :key="item.id" :label="item.modelName" :value="item">
|
|
|
+ <span style="float: left">{{ item.modelName }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 6px;margin-right:17px;">{{ item.produceCompany }}</span>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="项目经理" prop="managerId">
|
|
|
- <el-select v-model="editForm.managerId" clearable filterable placeholder="请选择项目经理" value-key='id' style="width:510px">
|
|
|
+ <el-select v-model="editForm.managerId" @change="changeStaff(0)" clearable filterable placeholder="请选择项目经理" value-key='id' style="width:510px">
|
|
|
<el-option v-for="item in charger" :key="item.id" :label="item.username" :value="item">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -162,7 +164,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="资产方审批人" prop="ownerApproverId">
|
|
|
- <el-select v-model="editForm.ownerApproverId" clearable filterable placeholder="请选择资产方审批人" value-key='id' style="width:190px">
|
|
|
+ <el-select v-model="editForm.ownerApproverId" @change="changeStaff(0)" clearable filterable placeholder="请选择资产方审批人" value-key='id' style="width:190px">
|
|
|
<el-option v-for="item in assets" :key="item.id" :label="item.username" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -170,21 +172,21 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="生产方审批人" prop="customerApproverId">
|
|
|
- <el-select v-model="editForm.customerApproverId" clearable filterable placeholder="请选择生产方审批人" value-key='id' style="width:190px">
|
|
|
+ <el-select v-model="editForm.customerApproverId" @change="changeStaff(0)" clearable filterable placeholder="请选择生产方审批人" value-key='id' style="width:190px">
|
|
|
<el-option v-for="item in produce" :key="item.id" :label="item.username" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="项目模具">
|
|
|
- <el-select v-model="editForm.modelIds" clearable filterable multiple placeholder="请选择项目模具" style="width:510px">
|
|
|
- <el-option v-for="item in molds" :key="item.id" :label="item.modelName" :value="item.id">
|
|
|
+ <el-form-item label="项目普通用户">
|
|
|
+ <el-select v-model="editForm.users" @change="changeStaff(1)" clearable filterable multiple placeholder="请选择项目普通用户" style="width:510px">
|
|
|
+ <el-option v-for="item in general" :key="item.id" :label="item.username" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
+ <!-- <el-col :span="24">
|
|
|
<el-form-item label="资产方参与人">
|
|
|
<el-select v-model="editForm.assets" clearable filterable multiple placeholder="请选择资产方参与人" style="width:510px">
|
|
|
<el-option v-for="item in assets" :key="item.id" :label="item.username" :value="item.id">
|
|
@@ -199,13 +201,41 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" style="float:left;margin-left:20px;" type="primary" @click.native="addStaff" :loading="editLoading">添加人员</el-button>
|
|
|
<el-button @click.native="editFormVisible = false">取消</el-button>
|
|
|
<el-button type="primary" @click.native="addSubmit" :loading="editLoading">提交</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!--新增界面-->
|
|
|
+ <el-dialog title="新增人员" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
|
|
|
+ <el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
|
|
|
+ <el-form-item label="姓名" prop="username">
|
|
|
+ <el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="手机号" prop="account">
|
|
|
+ <el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="公司" prop="companyId">
|
|
|
+ <el-select v-model="addForm.companyId" clearable filterable placeholder="请选择所属公司" style="width:202px">
|
|
|
+ <el-option v-for="item in staffComp" :key="item.id" :label="item.companyName" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="角色">
|
|
|
+ <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入角色名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
|
|
|
+ <el-button @click.native="addFormVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click.native="addPeople(1)" :loading="addLoading">提交并新增</el-button>
|
|
|
+ <el-button type="primary" @click.native="addPeople(0)" :loading="addLoading">提交</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</section>
|
|
|
</template>
|
|
|
|
|
@@ -213,7 +243,21 @@
|
|
|
import util from "../../common/js/util";
|
|
|
export default {
|
|
|
data() {
|
|
|
+ var checkPhone = (rule, value, callback) => {
|
|
|
+ if (!value) {
|
|
|
+ return callback(new Error('请输入联系方式'));
|
|
|
+ } else {
|
|
|
+ const reg = /^1[0-9]\d{9}$/
|
|
|
+ if (reg.test(value)) {
|
|
|
+ callback();
|
|
|
+ } else {
|
|
|
+ return callback(new Error('请输入正确的联系方式'));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
return {
|
|
|
+ activeNames: ['1','2','3'],
|
|
|
+
|
|
|
detailId: this.$route.params.id,
|
|
|
user: JSON.parse(sessionStorage.getItem('user')),
|
|
|
//临时数据
|
|
@@ -238,10 +282,15 @@
|
|
|
view: 0,
|
|
|
approve: 0,
|
|
|
|
|
|
- company:[],
|
|
|
+ company: [],
|
|
|
+
|
|
|
+ staffComp: [],
|
|
|
+ allUser: [],
|
|
|
assets: [],
|
|
|
produce: [],
|
|
|
charger: [],
|
|
|
+ general: [],
|
|
|
+
|
|
|
formRules: {
|
|
|
projectName: [
|
|
|
{ required: true, message: '请输入项目名称', trigger: 'blur' }
|
|
@@ -249,6 +298,9 @@
|
|
|
customerCompany: [
|
|
|
{ required: true, message: '请选择客户公司', trigger: 'blur' }
|
|
|
],
|
|
|
+ modelIds: [
|
|
|
+ { required: true, message: '请选择项目模具', trigger: ['blur','change'] }
|
|
|
+ ],
|
|
|
managerId: [
|
|
|
{ required: true, message: '请选择项目经理', trigger: ['blur','change'] }
|
|
|
],
|
|
@@ -257,7 +309,20 @@
|
|
|
],
|
|
|
customerApproverId: [
|
|
|
{ required: true, message: '请选择生产方审批人', trigger: ['blur','change'] }
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ // 新建人员
|
|
|
+ username: [
|
|
|
+ { required: true, message: '请输入姓名', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ account: [
|
|
|
+ { required: true, validator: checkPhone, trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ teamName: [
|
|
|
+ { required: true, message: '请选择人员类型', trigger: ["blur",'change'] }
|
|
|
+ ],
|
|
|
+ companyId: [
|
|
|
+ { required: true, message: '请选择所属公司', trigger: ["blur",'change'] }
|
|
|
+ ],
|
|
|
},
|
|
|
|
|
|
editFormVisible: false,//新增界面是否显示
|
|
@@ -270,9 +335,20 @@
|
|
|
ownerApproverId: '',
|
|
|
customerApproverId: '',
|
|
|
modelIds: [],
|
|
|
- assets: [],
|
|
|
- produce: []
|
|
|
- }
|
|
|
+ users: []
|
|
|
+ },
|
|
|
+
|
|
|
+ //新增界面是否显示
|
|
|
+ addFormVisible: false,
|
|
|
+ addLoading: false,
|
|
|
+ //新增界面数据
|
|
|
+ addForm: {
|
|
|
+ username: '',
|
|
|
+ account: '',
|
|
|
+ companyId: '',
|
|
|
+ roleName: '',
|
|
|
+ flag: 0
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -315,6 +391,7 @@
|
|
|
this.proDetail = list;
|
|
|
if(this.user.parentId != 0){
|
|
|
this.getMsg();
|
|
|
+ this.getStaff();
|
|
|
}
|
|
|
} else {
|
|
|
this.$message({
|
|
@@ -381,32 +458,19 @@
|
|
|
|
|
|
//获取信息
|
|
|
getMsg() {
|
|
|
- // 获取人员
|
|
|
- var compIds = this.user.companyId;
|
|
|
- for(var i in this.proDetail.customCompanies){
|
|
|
- compIds += "," + this.proDetail.customCompanies[i].companyId;
|
|
|
- }
|
|
|
- this.http.post(this.port.project.getUserById, {
|
|
|
- companyIds: compIds,
|
|
|
+ // 获取公司
|
|
|
+ this.http.post(this.port.base.addCompanyListToProject, {
|
|
|
+ parentId: this.user.parentId,
|
|
|
id: this.user.id
|
|
|
- } , res => {
|
|
|
+ }, res => {
|
|
|
if (res.code == "ok") {
|
|
|
- var list = res.data , assets = [] , produce = [];
|
|
|
- for(var i in list) {
|
|
|
- if(list[i].companyId == this.user.companyId){
|
|
|
- console.log(list[i])
|
|
|
- if(list[i].id != this.user.id){
|
|
|
- if(list[i].id != this.proDetail.managerId){
|
|
|
- assets.push(list[i])
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- produce.push(list[i])
|
|
|
+ var list = res.data , array = [];
|
|
|
+ for(var i in list){
|
|
|
+ if(list[i].id != this.user.companyId){
|
|
|
+ array.push(list[i])
|
|
|
}
|
|
|
}
|
|
|
- this.charger = res.data;
|
|
|
- this.assets = assets;
|
|
|
- this.produce = produce;
|
|
|
+ this.company = array;
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -420,19 +484,13 @@
|
|
|
});
|
|
|
})
|
|
|
|
|
|
- // 获取公司
|
|
|
- this.http.post(this.port.base.addCompanyListToProject, {
|
|
|
+ // 获取模具
|
|
|
+ this.http.post(this.port.mold.modelList, {
|
|
|
parentId: this.user.parentId,
|
|
|
id: this.user.id
|
|
|
}, res => {
|
|
|
if (res.code == "ok") {
|
|
|
- var list = res.data , array = [];
|
|
|
- for(var i in list){
|
|
|
- if(list[i].id != this.user.companyId){
|
|
|
- array.push(list[i])
|
|
|
- }
|
|
|
- }
|
|
|
- this.company = array;
|
|
|
+ this.molds = res.data;
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -446,13 +504,57 @@
|
|
|
});
|
|
|
})
|
|
|
|
|
|
- // 获取模具
|
|
|
- this.http.post(this.port.mold.modelList, {
|
|
|
+ this.http.post(this.port.base.companys, {
|
|
|
parentId: this.user.parentId,
|
|
|
id: this.user.id
|
|
|
}, res => {
|
|
|
if (res.code == "ok") {
|
|
|
- this.molds = res.data;
|
|
|
+ this.staffComp = res.data;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取人员
|
|
|
+ getStaff() {
|
|
|
+ // 获取人员
|
|
|
+ var compIds = this.user.companyId;
|
|
|
+ for(var i in this.proDetail.customCompanies){
|
|
|
+ compIds += "," + this.proDetail.customCompanies[i].companyId;
|
|
|
+ }
|
|
|
+ this.http.post(this.port.project.getUserById, {
|
|
|
+ companyIds: compIds,
|
|
|
+ id: this.user.id
|
|
|
+ } , res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ var list = res.data , assets = [] , produce = [];
|
|
|
+ for(var i in list) {
|
|
|
+ if(list[i].companyId == this.user.companyId){
|
|
|
+ if(list[i].id != this.user.id){
|
|
|
+ if(list[i].id != this.proDetail.managerId){
|
|
|
+ assets.push(list[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ produce.push(list[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.allUser = res.data;
|
|
|
+ this.charger = res.data;
|
|
|
+ this.assets = assets;
|
|
|
+ this.produce = produce;
|
|
|
+ this.general = res.data;
|
|
|
+
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -467,6 +569,39 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ //切换人员
|
|
|
+ changeStaff(i) {
|
|
|
+ if(i == 0){
|
|
|
+ var list = this.allUser , array = [];
|
|
|
+ for(var i in list){
|
|
|
+ if(list[i].id != this.editForm.customerApproverId && list[i].id != this.editForm.managerId.id && list[i].id != this.editForm.ownerApproverId){
|
|
|
+ array.push(list[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(array)
|
|
|
+ this.general = array;
|
|
|
+ } else if(i == 1) {
|
|
|
+ var list = this.allUser , str = this.editForm.users.toString() , array = [] , assets = [] , produce = [];
|
|
|
+ for(var i in list) {
|
|
|
+ if(str.indexOf(list[i].id) == -1) {
|
|
|
+ array.push(list[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for(var i in list) {
|
|
|
+ if(list[i].subordinateType == 0){
|
|
|
+ assets.push(list[i])
|
|
|
+ } else {
|
|
|
+ produce.push(list[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.charger = array;
|
|
|
+ this.assets = assets;
|
|
|
+ this.produce = produce;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
//选择公司切换人员
|
|
|
companyChange() {
|
|
|
var param = {} ,
|
|
@@ -538,7 +673,7 @@
|
|
|
for(var i in this.molds){
|
|
|
for(var j in this.proDetail.models){
|
|
|
if(this.molds[i].id == this.proDetail.models[j].id){
|
|
|
- moldArr.push(this.molds[i].id)
|
|
|
+ moldArr.push(this.proDetail.models[j])
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -580,27 +715,35 @@
|
|
|
cName = cName.substring(0,cName.length-1);
|
|
|
|
|
|
for(var i in this.editForm.modelIds){
|
|
|
- modelIds += this.editForm.modelIds[i] + ","
|
|
|
+ modelIds += this.editForm.modelIds[i].id + ","
|
|
|
}
|
|
|
modelIds = modelIds.substring(0,modelIds.length-1);
|
|
|
|
|
|
- for(var i in this.editForm.assets){
|
|
|
- if(i == this.editForm.assets.length -1){
|
|
|
- userIds += this.editForm.assets[i]
|
|
|
- } else {
|
|
|
- userIds += this.editForm.assets[i] + ","
|
|
|
- }
|
|
|
- }
|
|
|
+ // for(var i in this.editForm.assets){
|
|
|
+ // if(i == this.editForm.assets.length -1){
|
|
|
+ // userIds += this.editForm.assets[i]
|
|
|
+ // } else {
|
|
|
+ // userIds += this.editForm.assets[i] + ","
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
- if(userIds != "" && this.editForm.produce.length != 0){
|
|
|
- userIds += ","
|
|
|
- }
|
|
|
-
|
|
|
- for(var i in this.editForm.produce){
|
|
|
- if(i == this.editForm.produce.length -1){
|
|
|
- userIds += this.editForm.produce[i]
|
|
|
+ // if(userIds != "" && this.editForm.produce.length != 0){
|
|
|
+ // userIds += ","
|
|
|
+ // }
|
|
|
+
|
|
|
+ // for(var i in this.editForm.produce){
|
|
|
+ // if(i == this.editForm.produce.length -1){
|
|
|
+ // userIds += this.editForm.produce[i]
|
|
|
+ // } else {
|
|
|
+ // userIds += this.editForm.produce[i] + ","
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ for(var i in this.editForm.users) {
|
|
|
+ if(i == this.editForm.users.length -1){
|
|
|
+ userIds += this.editForm.users[i]
|
|
|
} else {
|
|
|
- userIds += this.editForm.produce[i] + ","
|
|
|
+ userIds += this.editForm.users[i] + ","
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -644,6 +787,54 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ //打开新增人员
|
|
|
+ addStaff() {
|
|
|
+ this.addFormVisible = true;
|
|
|
+ this.addForm = {
|
|
|
+ parentId: this.user.id,
|
|
|
+ username: '',
|
|
|
+ account: '',
|
|
|
+ companyId: '',
|
|
|
+ roleName: '',
|
|
|
+ projectId: this.detailId,
|
|
|
+ flag: 0
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ addPeople(i) {
|
|
|
+ this.$refs.addForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if(i == 0){
|
|
|
+ this.addLoading = true;
|
|
|
+ }
|
|
|
+ this.http.post(this.port.project.addUser, this.addForm , res => {
|
|
|
+ if(i == 0){ this.addLoading = false; }
|
|
|
+ else { this.$refs.addForm.resetFields();this.addForm.roleName = "" }
|
|
|
+ if (res.code == "ok") {
|
|
|
+ if(i == 0){ this.addFormVisible = false; }
|
|
|
+ this.getDetail();
|
|
|
+ this.$message({
|
|
|
+ message: '创建成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, error => {
|
|
|
+ if(i == 0){ this.addLoading = false;this.addFormVisible = false; }
|
|
|
+ else { this.$refs.addForm.resetFields();this.addForm.roleName = "" }
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
//上传
|
|
|
uploadFile(params) {
|
|
|
this.upLoading = true;
|