|
@@ -13,6 +13,8 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+
|
|
|
|
+
|
|
<el-col :span="24" :style="allDetail">
|
|
<el-col :span="24" :style="allDetail">
|
|
<el-col :span="24" class="title">项目基本信息
|
|
<el-col :span="24" class="title">项目基本信息
|
|
<i class="el-icon-edit editDetail" v-if="user.id == proDetail.managerId || user.id == proDetail.creatorId" @click="edit"></i>
|
|
<i class="el-icon-edit editDetail" v-if="user.id == proDetail.managerId || user.id == proDetail.creatorId" @click="edit"></i>
|
|
@@ -41,64 +43,97 @@
|
|
<span v-if="index != proDetail.customCompanies.length-1">、</span>
|
|
<span v-if="index != proDetail.customCompanies.length-1">、</span>
|
|
</span>
|
|
</span>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="24" class="detail">
|
|
|
|
|
|
+ <!-- <el-col :span="24" class="detail">
|
|
项目模具:
|
|
项目模具:
|
|
<span class="info model" v-for="(item, index) in proDetail.models">
|
|
<span class="info model" v-for="(item, index) in proDetail.models">
|
|
<span @click="toMold(item.id)">{{item.modelName}}({{item.modelNo}})</span>
|
|
<span @click="toMold(item.id)">{{item.modelName}}({{item.modelNo}})</span>
|
|
<span v-if="index != proDetail.models.length-1">、</span>
|
|
<span v-if="index != proDetail.models.length-1">、</span>
|
|
</span>
|
|
</span>
|
|
- </el-col>
|
|
|
|
|
|
+ </el-col> -->
|
|
<el-col :span="24" class="detail">
|
|
<el-col :span="24" class="detail">
|
|
- 资产方人员:
|
|
|
|
- <span class="info" v-for="(item, index) in proDetail.ownerUsers">
|
|
|
|
|
|
+ 普通人员:
|
|
|
|
+ <span class="info" v-for="(item, index) in proDetail.participateUsers">
|
|
{{item.username}}
|
|
{{item.username}}
|
|
- <span v-if="index != proDetail.ownerUsers.length-1">、</span>
|
|
|
|
|
|
+ <span v-if="index != proDetail.participateUsers.length-1">、</span>
|
|
</span>
|
|
</span>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="24" class="detail">
|
|
|
|
|
|
+ <!-- <el-col :span="24" class="detail">
|
|
生产方人员:
|
|
生产方人员:
|
|
<span class="info" v-for="(item, index) in proDetail.customUsers">
|
|
<span class="info" v-for="(item, index) in proDetail.customUsers">
|
|
{{item.username}}
|
|
{{item.username}}
|
|
<span v-if="index != proDetail.customUsers.length-1">、</span>
|
|
<span v-if="index != proDetail.customUsers.length-1">、</span>
|
|
</span>
|
|
</span>
|
|
- </el-col>
|
|
|
|
- </el-col>
|
|
|
|
-
|
|
|
|
- <el-col :span="24" class="title">项目文档
|
|
|
|
- <!-- update == 1 -->
|
|
|
|
- <el-upload v-if="user.id == proDetail.managerId" class="upload-demo" action="customize" :http-request="uploadFile" :show-file-list="false" multiple :limit="5" style="float:right;">
|
|
|
|
- <el-button size="small" type="primary" :loading="upLoading">点击上传</el-button>
|
|
|
|
- </el-upload>
|
|
|
|
|
|
+ </el-col> -->
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-table :data="files" highlight-current-row v-loading="listLoading" height="400" style="width: 100%;">
|
|
|
|
- <el-table-column type="index" width="40"></el-table-column>
|
|
|
|
- <el-table-column prop="fileName" label="名称" sortable></el-table-column>
|
|
|
|
- <el-table-column prop="fileSize" label="大小" width="150" align="center" sortable></el-table-column>
|
|
|
|
- <el-table-column prop="uploader" label="上传者" width="120" align="center" sortable></el-table-column>
|
|
|
|
- <el-table-column prop="indate" label="上传时间" width="200" align="center" sortable></el-table-column>
|
|
|
|
- <el-table-column label="操作" width="220" align="center" sortable>
|
|
|
|
- <template slot-scope="scope" v-if="download == 1">
|
|
|
|
- <el-button size="small" @click="dowloadFile(scope.row.id)">
|
|
|
|
- <a :href="scope.row.url" :download="scope.row.fileName">下载</a>
|
|
|
|
- </el-button>
|
|
|
|
- <el-button size="small" type="danger" @click="fileDel(scope.row.id)" v-if="scope.row.uploaderId == user.id">删除</el-button>
|
|
|
|
|
|
+ <el-collapse v-model="activeNames">
|
|
|
|
+ <el-collapse-item name="1">
|
|
|
|
+ <template slot="title">
|
|
|
|
+ <el-col :span="24" class="title">项目模具</el-col>
|
|
|
|
+ </template>
|
|
|
|
+ <el-col :span="24" class="detail">
|
|
|
|
+ <el-table :data="proDetail.models" highlight-current-row v-loading="modelsLoading" style="width: 100%;">
|
|
|
|
+ <el-table-column type="index" width="40"></el-table-column>
|
|
|
|
+ <el-table-column prop="modelNo" label="模具编号" width="200" sortable>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span class="model" @click="toMold(scope.row.id)">{{scope.row.modelNo}}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="modelName" label="模具名称" width="500" sortable></el-table-column>
|
|
|
|
+ <el-table-column prop="produceCompanyName" label="所属生产商" sortable></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-collapse-item>
|
|
|
|
+
|
|
|
|
+ <el-collapse-item name="2">
|
|
|
|
+ <template slot="title">
|
|
|
|
+ <el-col :span="24" class="title">项目文档
|
|
|
|
+ <!-- update == 1 -->
|
|
|
|
+ <el-upload v-if="user.id == proDetail.managerId" action="customize" :http-request="uploadFile" :show-file-list="false" multiple :limit="5" style="float:right;margin-right:20px;">
|
|
|
|
+ <el-button size="small" type="primary" :loading="upLoading">点击上传</el-button>
|
|
|
|
+ </el-upload>
|
|
|
|
+ </el-col>
|
|
</template>
|
|
</template>
|
|
- <template slot-scope="scope" v-else>
|
|
|
|
- -
|
|
|
|
|
|
+ <el-col :span="24" class="detail">
|
|
|
|
+ <el-table :data="files" highlight-current-row v-loading="listLoading" style="width: 100%;">
|
|
|
|
+ <el-table-column type="index" width="40"></el-table-column>
|
|
|
|
+ <el-table-column prop="fileName" label="名称" sortable></el-table-column>
|
|
|
|
+ <el-table-column prop="fileSize" label="大小" width="150" align="center" sortable></el-table-column>
|
|
|
|
+ <el-table-column prop="uploader" label="上传者" width="120" align="center" sortable></el-table-column>
|
|
|
|
+ <el-table-column prop="indate" label="上传时间" width="200" align="center" sortable></el-table-column>
|
|
|
|
+ <el-table-column label="操作" width="220" align="center" sortable>
|
|
|
|
+ <template slot-scope="scope" v-if="download == 1">
|
|
|
|
+ <el-button size="small" @click="dowloadFile(scope.row.id)">
|
|
|
|
+ <a :href="scope.row.url" :download="scope.row.fileName">下载</a>
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button size="small" type="danger" @click="fileDel(scope.row.id)" v-if="scope.row.uploaderId == user.id">删除</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ <template slot-scope="scope" v-else>
|
|
|
|
+ -
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-collapse-item>
|
|
|
|
+
|
|
|
|
+ <el-collapse-item name="3">
|
|
|
|
+ <template slot="title">
|
|
|
|
+ <el-col :span="24" class="title">操作记录</el-col>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
|
|
+ <el-col :span="24" class="detail">
|
|
|
|
+ <el-table :data="opers" highlight-current-row v-loading="oplistLoading" style="width: 100%;">
|
|
|
|
+ <el-table-column type="index" width="40"></el-table-column>
|
|
|
|
+ <el-table-column prop="content" label="操作" width="120" sortable></el-table-column>
|
|
|
|
+ <el-table-column prop="fileName" label="操作文档名称" sortable></el-table-column>
|
|
|
|
+ <el-table-column prop="operator" label="操作人" width="120" align="center" sortable></el-table-column>
|
|
|
|
+ <el-table-column prop="indate" label="操作时间" width="200" align="center" sortable></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-collapse-item>
|
|
|
|
+ </el-collapse>
|
|
</el-col>
|
|
</el-col>
|
|
-
|
|
|
|
- <el-col :span="24" class="title">操作记录</el-col>
|
|
|
|
- <el-table :data="opers" highlight-current-row v-loading="oplistLoading" height="400" style="width: 100%;">
|
|
|
|
- <el-table-column type="index" width="40"></el-table-column>
|
|
|
|
- <el-table-column prop="content" label="操作" width="120" sortable></el-table-column>
|
|
|
|
- <el-table-column prop="fileName" label="操作文档名称" sortable></el-table-column>
|
|
|
|
- <el-table-column prop="operator" label="操作人" width="120" align="center" sortable></el-table-column>
|
|
|
|
- <el-table-column prop="indate" label="操作时间" width="200" align="center" sortable></el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
|
|
+
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
<!--编辑界面-->
|
|
<!--编辑界面-->
|
|
@@ -110,16 +145,18 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<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-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
<el-form-item label="项目经理" prop="managerId">
|
|
<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 v-for="item in charger" :key="item.id" :label="item.username" :value="item">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
@@ -127,7 +164,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="资产方审批人" prop="ownerApproverId">
|
|
<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 v-for="item in assets" :key="item.id" :label="item.username" :value="item.id">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
@@ -135,21 +172,21 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="生产方审批人" prop="customerApproverId">
|
|
<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 v-for="item in produce" :key="item.id" :label="item.username" :value="item.id">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<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-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="24">
|
|
|
|
|
|
+ <!-- <el-col :span="24">
|
|
<el-form-item label="资产方参与人">
|
|
<el-form-item label="资产方参与人">
|
|
<el-select v-model="editForm.assets" clearable filterable multiple placeholder="请选择资产方参与人" style="width:510px">
|
|
<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">
|
|
<el-option v-for="item in assets" :key="item.id" :label="item.username" :value="item.id">
|
|
@@ -164,13 +201,41 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- </el-col>
|
|
|
|
|
|
+ </el-col> -->
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<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 @click.native="editFormVisible = false">取消</el-button>
|
|
<el-button type="primary" @click.native="addSubmit" :loading="editLoading">提交</el-button>
|
|
<el-button type="primary" @click.native="addSubmit" :loading="editLoading">提交</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</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>
|
|
</section>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -178,7 +243,21 @@
|
|
import util from "../../common/js/util";
|
|
import util from "../../common/js/util";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
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 {
|
|
return {
|
|
|
|
+ activeNames: ['1','2','3'],
|
|
|
|
+
|
|
detailId: this.$route.params.id,
|
|
detailId: this.$route.params.id,
|
|
user: JSON.parse(sessionStorage.getItem('user')),
|
|
user: JSON.parse(sessionStorage.getItem('user')),
|
|
//临时数据
|
|
//临时数据
|
|
@@ -193,6 +272,7 @@
|
|
},
|
|
},
|
|
|
|
|
|
listLoading: false,
|
|
listLoading: false,
|
|
|
|
+ modelsLoading: false,
|
|
upLoading: false,
|
|
upLoading: false,
|
|
oplistLoading: false,
|
|
oplistLoading: false,
|
|
activePage: 0,
|
|
activePage: 0,
|
|
@@ -202,10 +282,15 @@
|
|
view: 0,
|
|
view: 0,
|
|
approve: 0,
|
|
approve: 0,
|
|
|
|
|
|
- company:[],
|
|
|
|
|
|
+ company: [],
|
|
|
|
+
|
|
|
|
+ staffComp: [],
|
|
|
|
+ allUser: [],
|
|
assets: [],
|
|
assets: [],
|
|
produce: [],
|
|
produce: [],
|
|
charger: [],
|
|
charger: [],
|
|
|
|
+ general: [],
|
|
|
|
+
|
|
formRules: {
|
|
formRules: {
|
|
projectName: [
|
|
projectName: [
|
|
{ required: true, message: '请输入项目名称', trigger: 'blur' }
|
|
{ required: true, message: '请输入项目名称', trigger: 'blur' }
|
|
@@ -213,6 +298,9 @@
|
|
customerCompany: [
|
|
customerCompany: [
|
|
{ required: true, message: '请选择客户公司', trigger: 'blur' }
|
|
{ required: true, message: '请选择客户公司', trigger: 'blur' }
|
|
],
|
|
],
|
|
|
|
+ modelIds: [
|
|
|
|
+ { required: true, message: '请选择项目模具', trigger: ['blur','change'] }
|
|
|
|
+ ],
|
|
managerId: [
|
|
managerId: [
|
|
{ required: true, message: '请选择项目经理', trigger: ['blur','change'] }
|
|
{ required: true, message: '请选择项目经理', trigger: ['blur','change'] }
|
|
],
|
|
],
|
|
@@ -221,7 +309,20 @@
|
|
],
|
|
],
|
|
customerApproverId: [
|
|
customerApproverId: [
|
|
{ required: true, message: '请选择生产方审批人', trigger: ['blur','change'] }
|
|
{ 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,//新增界面是否显示
|
|
editFormVisible: false,//新增界面是否显示
|
|
@@ -234,9 +335,20 @@
|
|
ownerApproverId: '',
|
|
ownerApproverId: '',
|
|
customerApproverId: '',
|
|
customerApproverId: '',
|
|
modelIds: [],
|
|
modelIds: [],
|
|
- assets: [],
|
|
|
|
- produce: []
|
|
|
|
- }
|
|
|
|
|
|
+ users: []
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //新增界面是否显示
|
|
|
|
+ addFormVisible: false,
|
|
|
|
+ addLoading: false,
|
|
|
|
+ //新增界面数据
|
|
|
|
+ addForm: {
|
|
|
|
+ username: '',
|
|
|
|
+ account: '',
|
|
|
|
+ companyId: '',
|
|
|
|
+ roleName: '',
|
|
|
|
+ flag: 0
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -245,16 +357,21 @@
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|
|
// this.$router.push("/project");
|
|
// this.$router.push("/project");
|
|
},
|
|
},
|
|
|
|
+
|
|
toMold(id) {
|
|
toMold(id) {
|
|
this.$router.push('/moldList/' + id);
|
|
this.$router.push('/moldList/' + id);
|
|
},
|
|
},
|
|
|
|
+
|
|
handleClick(tab, event) {
|
|
handleClick(tab, event) {
|
|
},
|
|
},
|
|
|
|
+
|
|
//获取详情
|
|
//获取详情
|
|
getDetail() {
|
|
getDetail() {
|
|
|
|
+ this.modelsLoading = true;
|
|
this.http.post(this.port.project.projectDetail, {
|
|
this.http.post(this.port.project.projectDetail, {
|
|
id: this.detailId
|
|
id: this.detailId
|
|
}, res => {
|
|
}, res => {
|
|
|
|
+ this.modelsLoading = false;
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
this.update = res.data.update;
|
|
this.update = res.data.update;
|
|
this.download = res.data.download;
|
|
this.download = res.data.download;
|
|
@@ -274,6 +391,7 @@
|
|
this.proDetail = list;
|
|
this.proDetail = list;
|
|
if(this.user.parentId != 0){
|
|
if(this.user.parentId != 0){
|
|
this.getMsg();
|
|
this.getMsg();
|
|
|
|
+ this.getStaff();
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
@@ -282,12 +400,14 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}, error => {
|
|
}, error => {
|
|
|
|
+ this.modelsLoading = false;
|
|
this.$message({
|
|
this.$message({
|
|
message: error,
|
|
message: error,
|
|
type: 'error'
|
|
type: 'error'
|
|
});
|
|
});
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
getFileList() {
|
|
getFileList() {
|
|
this.listLoading = true;
|
|
this.listLoading = true;
|
|
// 获取文档列表
|
|
// 获取文档列表
|
|
@@ -311,6 +431,7 @@
|
|
});
|
|
});
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
getOperList() {
|
|
getOperList() {
|
|
this.oplistLoading = true;
|
|
this.oplistLoading = true;
|
|
// 获取文档列表
|
|
// 获取文档列表
|
|
@@ -334,34 +455,22 @@
|
|
});
|
|
});
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
//获取信息
|
|
//获取信息
|
|
getMsg() {
|
|
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
|
|
id: this.user.id
|
|
- } , res => {
|
|
|
|
|
|
+ }, res => {
|
|
if (res.code == "ok") {
|
|
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 {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
@@ -375,19 +484,13 @@
|
|
});
|
|
});
|
|
})
|
|
})
|
|
|
|
|
|
- // 获取公司
|
|
|
|
- this.http.post(this.port.base.addCompanyListToProject, {
|
|
|
|
|
|
+ // 获取模具
|
|
|
|
+ this.http.post(this.port.mold.modelList, {
|
|
parentId: this.user.parentId,
|
|
parentId: this.user.parentId,
|
|
id: this.user.id
|
|
id: this.user.id
|
|
}, res => {
|
|
}, res => {
|
|
if (res.code == "ok") {
|
|
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 {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
@@ -401,13 +504,57 @@
|
|
});
|
|
});
|
|
})
|
|
})
|
|
|
|
|
|
- // 获取模具
|
|
|
|
- this.http.post(this.port.mold.modelList, {
|
|
|
|
|
|
+ this.http.post(this.port.base.companys, {
|
|
parentId: this.user.parentId,
|
|
parentId: this.user.parentId,
|
|
id: this.user.id
|
|
id: this.user.id
|
|
}, res => {
|
|
}, res => {
|
|
if (res.code == "ok") {
|
|
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 {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
@@ -421,6 +568,40 @@
|
|
});
|
|
});
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ //切换人员
|
|
|
|
+ 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() {
|
|
companyChange() {
|
|
var param = {} ,
|
|
var param = {} ,
|
|
@@ -456,6 +637,7 @@
|
|
});
|
|
});
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
//打开编辑页面
|
|
//打开编辑页面
|
|
edit() {
|
|
edit() {
|
|
this.editFormVisible = true;
|
|
this.editFormVisible = true;
|
|
@@ -491,7 +673,7 @@
|
|
for(var i in this.molds){
|
|
for(var i in this.molds){
|
|
for(var j in this.proDetail.models){
|
|
for(var j in this.proDetail.models){
|
|
if(this.molds[i].id == this.proDetail.models[j].id){
|
|
if(this.molds[i].id == this.proDetail.models[j].id){
|
|
- moldArr.push(this.molds[i].id)
|
|
|
|
|
|
+ moldArr.push(this.proDetail.models[j])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -516,6 +698,7 @@
|
|
produce: produce
|
|
produce: produce
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
//提交
|
|
//提交
|
|
addSubmit() {
|
|
addSubmit() {
|
|
this.$refs.editForm.validate((valid) => {
|
|
this.$refs.editForm.validate((valid) => {
|
|
@@ -532,27 +715,35 @@
|
|
cName = cName.substring(0,cName.length-1);
|
|
cName = cName.substring(0,cName.length-1);
|
|
|
|
|
|
for(var i in this.editForm.modelIds){
|
|
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);
|
|
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 {
|
|
} else {
|
|
- userIds += this.editForm.produce[i] + ","
|
|
|
|
|
|
+ userIds += this.editForm.users[i] + ","
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -595,6 +786,55 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ //打开新增人员
|
|
|
|
+ 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) {
|
|
uploadFile(params) {
|
|
this.upLoading = true;
|
|
this.upLoading = true;
|
|
@@ -625,6 +865,7 @@
|
|
});
|
|
});
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
//下载
|
|
//下载
|
|
dowloadFile(id) {
|
|
dowloadFile(id) {
|
|
this.http.post(this.port.project.dowloadFile, {
|
|
this.http.post(this.port.project.dowloadFile, {
|
|
@@ -634,6 +875,7 @@
|
|
}, error => {
|
|
}, error => {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
//删除上传文件
|
|
//删除上传文件
|
|
fileDel(id) {
|
|
fileDel(id) {
|
|
this.$confirm('确认删除该文档吗?', '提示', {
|
|
this.$confirm('确认删除该文档吗?', '提示', {
|
|
@@ -664,6 +906,7 @@
|
|
});
|
|
});
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+
|
|
created() {
|
|
created() {
|
|
let height = window.innerHeight;
|
|
let height = window.innerHeight;
|
|
this.allDetail.height = height - 170 + "px";
|
|
this.allDetail.height = height - 170 + "px";
|
|
@@ -672,6 +915,7 @@
|
|
that.allDetail.height = window.innerHeight - 170;
|
|
that.allDetail.height = window.innerHeight - 170;
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+
|
|
mounted() {
|
|
mounted() {
|
|
this.getDetail();
|
|
this.getDetail();
|
|
this.getFileList();
|
|
this.getFileList();
|