|
@@ -27,15 +27,123 @@
|
|
|
<el-link type="primary" :underline="false" @click="handleAdd(-1,null)">新增产品</el-link>
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float:right;" >
|
|
|
- <el-link type="primary" :underline="false" @click="isganttshow = true">分类管理</el-link>
|
|
|
+ <el-link type="primary" :underline="false" @click="getCategoryList()">分类管理</el-link>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
<!--列表-->
|
|
|
- <el-table ref="productTbl" v-if="showTable" @cell-mouse-enter="hoverCall" @cell-mouse-leave="handCall" :cell-class-name="tableCellClassName" :default-expand-all="defaultExpandAllFlg" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @sort-change="tableSort">
|
|
|
- <el-table-column type="expand" :label="''">
|
|
|
-
|
|
|
+ <el-table ref="productTbl" v-if="showTable" @cell-mouse-enter="hoverCall" @cell-mouse-leave="handCall" :cell-class-name="tableCellClassName" :default-expand-all="defaultExpandAllFlg" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @sort-change="tableSort" @expand-change="expandChange" >
|
|
|
+
|
|
|
+ <el-table-column type="expand">
|
|
|
+ <template slot-scope="props">
|
|
|
+ <el-form label-position="left" inline class="demo-table-expand">
|
|
|
+ <el-form-item label="派工单">
|
|
|
+ <span>版本号:</span>
|
|
|
+ <el-select v-model="procedureVersion" placeholder="请选择版本号" @change="changeProcedureVersion(props.row)">
|
|
|
+ <el-option
|
|
|
+ v-for="item in props.row.tableProdProcedure.versions"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item >
|
|
|
+ <el-table
|
|
|
+ :data="props.row.tableProdProcedure.procedureList"
|
|
|
+ border
|
|
|
+ style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="工序名称"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="unitPrice"
|
|
|
+ label="单件工时"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="workingTime"
|
|
|
+ label="单件工价"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="质检类型"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.checkType == 0">自检</span>
|
|
|
+ <span v-if="scope.row.checkType==1">互检</span>
|
|
|
+ <span v-if="scope.row.checkType == 2">专检</span>
|
|
|
+ </template>
|
|
|
+ <!-- -->
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="物料单">
|
|
|
+ <span>版本号:</span>
|
|
|
+ <el-select v-model="prodMaterialVersion" placeholder="请选择版本号" @change="changeMaterialVersion(props.row)">
|
|
|
+ <el-option
|
|
|
+ v-for="item in props.row.tableProdMaterial.versions"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item >
|
|
|
+ <el-table
|
|
|
+ :data="props.row.tableProdMaterial.materialList"
|
|
|
+ border
|
|
|
+ style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="零件名称"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="companyCode"
|
|
|
+ label="公司编码"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="companyDrawingNo"
|
|
|
+ label="公司图号"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="materialQuality"
|
|
|
+ label="材质"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="thickness"
|
|
|
+ label="厚度"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="numberProduct"
|
|
|
+ label="数量(个/产品)"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="numberVehicle"
|
|
|
+ label="数量(个/辆)"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<el-table-column prop="name" label="产品名称" sortable="custom" width="300"></el-table-column>
|
|
|
<el-table-column prop="code" label="项目代码" width="200" ></el-table-column>
|
|
|
<el-table-column prop="orderNumber" label="订单数量" width="100" ></el-table-column>
|
|
@@ -51,7 +159,7 @@
|
|
|
</el-table>
|
|
|
|
|
|
<!--工具条-->
|
|
|
- <el-col :span="24" class="toolbar">
|
|
|
+ <el-col :span="24" class="toolbar" v-if="false">
|
|
|
<el-button size="small" @click="batchSetWudulistBtn1" v-if="(user.timeType.customDegreeActive || user.company.packageProject) && (showColumnWidth != '0' || permissions.projectManagement)">{{ $t('btn.cancel') }}</el-button>
|
|
|
<template v-if="user.timeType.customDegreeActive && (showColumnWidth != '0' || permissions.projectManagement)">
|
|
|
<el-button size="small" type="primary" @click="batchSetWudulistBtn2(true)">{{ $t('volumeset') }} {{user.timeType.customDegreeName}}</el-button>
|
|
@@ -122,61 +230,124 @@
|
|
|
</div>
|
|
|
<div v-if="prodEditActive == 1" >
|
|
|
<!--此处是录入工序的模块-->
|
|
|
- <el-input placeholder="请输入工序版本号"></el-input>
|
|
|
- <el-table :data="projectProfessionList" size="small" :key="Math.random()" :height="'400px'">
|
|
|
- <el-table-column prop="professionId" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-select v-model="scope.row.professionId" >
|
|
|
- <el-option v-for="item in professionList" :key="item.id" :label="item.name" :value="item.id"/>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- <template slot="header" >
|
|
|
- <span style="font-size:14px;font-weight:normal;">{{ $t('nameprofessional') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="percentage" width="120" :label="$t('zhan-bi')">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div><el-input type="number" v-model="scope.row.percentage"></el-input></div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column prop="membNames" :label="$t('personnelproportion')">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span style="margin:0 5px;" v-for="item in scope.row.membList" :key="item.membId">
|
|
|
- <span v-if="user.userNameNeedTranslate != 1">{{item.membName}}({{item.percentage}}%)</span>
|
|
|
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.membName'></ww-open-data>({{item.percentage}}%)</span>
|
|
|
- </span>
|
|
|
- <el-link @click="showEditPpMembs(scope.row)">{{(scope.row.membList == null || scope.row.membList.length == 0)?$t('professionalparticipants'):$t('setup')}}</el-link>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="inchargerName" width="200" :label="$t('head')">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-select v-model="scope.row.inchargerId" v-if="user.userNameNeedTranslate != 1">
|
|
|
- <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
-
|
|
|
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="participator" :subjectId="scope.row.inchargerId" :other="scope.$index" :distinction="'4'" @selectCal="selectCal"></selectCat>
|
|
|
-
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button icon="el-icon-delete" size="mini" style="margin-left:10px;" @click.stop.native="deleteItem(scope.$index)"></el-button>
|
|
|
- </template>
|
|
|
- <template slot="header" >
|
|
|
- <el-link type="primary" :underline="false" @click="addItem">{{ $t('addTian') }}</el-link>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <el-input placeholder="请输入工序版本号" v-model="procedureVersion" class="input-pM"></el-input>
|
|
|
+ <el-table :data="procedureLit" style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="工序名称"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.name" placeholder="请输入"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="unitPrice"
|
|
|
+ label="单件工时"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.unitPrice" placeholder="请输入"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="workingTime"
|
|
|
+ label="单件工价"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.workingTime" placeholder="请输入"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="质检类型"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select v-model="scope.row.checkType" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in checkTypeOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="100" fixed="right" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" @click="deleteProcedure(scope.$index, scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <i class="el-icon-plus" @click="addProcedure()"></i>
|
|
|
+
|
|
|
</div>
|
|
|
<div v-if="prodEditActive == 2" >
|
|
|
<!--此处是录入物料的模块-->
|
|
|
- <el-input placeholder="请输入物料版本号"></el-input>
|
|
|
+
|
|
|
+ <el-input placeholder="请输入物料版本号" v-model="prodMaterialVersion" class="input-pM"></el-input>
|
|
|
+ <el-table :data="prodMaterialList" style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="零件名称"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.name" placeholder="请输入"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="companyCode"
|
|
|
+ label="公司编码"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.companyCode" placeholder="请输入"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="companyDrawingNo"
|
|
|
+ label="公司图号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.companyDrawingNo" placeholder="请输入"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="materialQuality"
|
|
|
+ label="材质">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.materialQuality" placeholder="请输入"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="thickness"
|
|
|
+ label="厚度">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.thickness" placeholder="请输入"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="numberProduct"
|
|
|
+ label="数量(个/产品)">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.numberProduct" placeholder="请输入"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="numberVehicle"
|
|
|
+ label="数量(个/辆)">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.numberVehicle" placeholder="请输入"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="100" fixed="right" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" @click="deleteMaterial(scope.$index, scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <i class="el-icon-plus" @click="addMaterial()"></i>
|
|
|
</div>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer;">
|
|
|
- <el-button @click.native="deletePro(1, addForm)" v-if="addForm.id" style="float:left">{{ $t('btn.delete') }}</el-button>
|
|
|
- <el-button @click.native="addFormVisible = false">{{ $t('btn.cancel') }}</el-button>
|
|
|
+ <!-- <el-button @click.native="deletePro(1, addForm)" v-if="addForm.id" style="float:left">{{ $t('btn.delete') }}</el-button> -->
|
|
|
+ <el-button @click.native="prodEditActive = 0;addFormVisible = false ">{{ $t('btn.cancel') }}</el-button>
|
|
|
<el-button v-if="prodEditActive == 0" type="primary" @click="submitInsert(0)" :loading="addLoading">保存</el-button>
|
|
|
<el-button v-if="prodEditActive == 0" type="primary" @click="submitInsert(1)" :loading="addLoading">保存并编辑工序</el-button>
|
|
|
<el-button v-if="prodEditActive == 1" type="primary" @click="submitSequence(0)" :loading="addLoading">保存工序</el-button>
|
|
@@ -208,6 +379,58 @@
|
|
|
<el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 产品分类管理 -->
|
|
|
+ <el-dialog
|
|
|
+ title="分类管理"
|
|
|
+ :visible.sync="isganttshow"
|
|
|
+ width="40%"
|
|
|
+ :before-close="handleClose">
|
|
|
+ <div>
|
|
|
+ <el-table
|
|
|
+ :data="categoryList"
|
|
|
+ style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="分类名称"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" @click="updateCategory(scope.row)">编辑</el-button>
|
|
|
+ <el-button size="mini" @click="deleteCategory(scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="isganttshow = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="isganttshowCa = true; title ='新增'">新增</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="isganttshowCa"
|
|
|
+ width="30%"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <el-form ref="form" :model="category" label-width="80px">
|
|
|
+ <el-form-item label="分类名称">
|
|
|
+ <el-input v-model="category.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="isganttshowCa = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click=" saveCategory()">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
<!-- 子项目列表 -->
|
|
|
<el-dialog :title="$t('listofsubitems')" show-header="false" v-if="subProjectVisible" :visible.sync="subProjectVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
<el-table :data="subProjectList" highlight-current-row height="400" style="width: 100%;">
|
|
@@ -399,6 +622,9 @@ a {
|
|
|
.router-link-active {
|
|
|
text-decoration: none;
|
|
|
}
|
|
|
+.input-pM{
|
|
|
+ width: 50%;
|
|
|
+}
|
|
|
</style>
|
|
|
<script>
|
|
|
import util from "../../common/js/util";
|
|
@@ -410,7 +636,30 @@ a {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ categoryList: [],
|
|
|
+ category:{},
|
|
|
+ procedureVersion: "",
|
|
|
+ prodMaterialVersion: "",
|
|
|
+ //项目展开的详情
|
|
|
+ procedureVersions: [], //产品的工序版本集合
|
|
|
+ prodMaterialVersions: [], //产品的物料版本集合
|
|
|
+ procedureLit: [],//当前版本的工序集合
|
|
|
+ prodMaterialList: [], //当前版本的物料集合
|
|
|
+ checkTypeOptions: [
|
|
|
+ {
|
|
|
+ value: 0,
|
|
|
+ label: '自检'
|
|
|
+ }, {
|
|
|
+ value: 1,
|
|
|
+ label: '互检'
|
|
|
+ }, {
|
|
|
+ value: 2,
|
|
|
+ label: '专检'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+
|
|
|
prodEditActive: 0,
|
|
|
+ productId: null,
|
|
|
cateName: null,
|
|
|
cateId: null,
|
|
|
name: null,
|
|
@@ -435,6 +684,7 @@ a {
|
|
|
showImportResult: false,
|
|
|
importResultMsg:null,
|
|
|
isganttshow: false,
|
|
|
+ isganttshowCa: false,
|
|
|
deleteAlertMsg: null,
|
|
|
chosenLeaders:[],
|
|
|
baseClfList:[],
|
|
@@ -492,7 +742,18 @@ a {
|
|
|
total: 0,
|
|
|
page: 1,
|
|
|
size: localStorage.getItem("projectPageSize")==null?20:parseInt(localStorage.getItem("projectPageSize")),
|
|
|
- list: [],
|
|
|
+ list: [
|
|
|
+ {
|
|
|
+ tableProdProcedure:{
|
|
|
+ versions: [],
|
|
|
+ procedureList: []
|
|
|
+ },
|
|
|
+ tableProdMaterial: {
|
|
|
+ versions: [],
|
|
|
+ materialList: []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
subProjectVisible: false,
|
|
|
subProjectList: [],//子项目列表
|
|
|
currentProject:{},
|
|
@@ -658,6 +919,283 @@ a {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ updateCategory(row){
|
|
|
+ this.isganttshowCa = true
|
|
|
+ this.title="编辑"
|
|
|
+ this.category=row
|
|
|
+ },
|
|
|
+ deleteCategory(row){
|
|
|
+ this.http.post("/prod-category/delete",{ id: row.id},
|
|
|
+ res=>{
|
|
|
+ console.log("=======",res.code)
|
|
|
+ if(res.code==='ok'){
|
|
|
+ this.getCategoryList()
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '删除成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '该分类正在使用中,不能删除',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ saveCategory(){
|
|
|
+
|
|
|
+ this.http.post("/prod-category/saveOrUpdateInfo",this.category,
|
|
|
+ res=>{
|
|
|
+ if(res.code=='ok'){
|
|
|
+ this.isganttshowCa = false
|
|
|
+ this.getCategoryList()
|
|
|
+ this.category={}
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ getCategoryList(){
|
|
|
+ this.isganttshow = true
|
|
|
+ console.log("======")
|
|
|
+ console.log(this.categoryList)
|
|
|
+ this.http.post("/prod-category/getList",null,
|
|
|
+ res => {
|
|
|
+ this.categoryList=res.data
|
|
|
+ console.log(this.categoryList)
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ handleClose(done) {
|
|
|
+ this.$confirm('确认关闭?')
|
|
|
+ .then(_ => {
|
|
|
+ done();
|
|
|
+ })
|
|
|
+ .catch(_ => { });
|
|
|
+ },
|
|
|
+ changeProcedureVersion(row){
|
|
|
+ let index = null
|
|
|
+ for (var i in this.list) {
|
|
|
+ if (this.list[i].id === row.id) {
|
|
|
+ index = i
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getProdProcedureVersion(row.id,index)
|
|
|
+ },
|
|
|
+ changeMaterialVersion(row) {
|
|
|
+ let index = null
|
|
|
+ for (var i in this.list) {
|
|
|
+ if (this.list[i].id === row.id) {
|
|
|
+ index = i
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getProdMaterialVersion(row.id, index)
|
|
|
+ },
|
|
|
+ // 获取row的key值
|
|
|
+ getRowKeys(row) {
|
|
|
+ return row.id;
|
|
|
+ },
|
|
|
+ // 展开事件----动态获取内嵌表数据(项目)
|
|
|
+ expandChange(row, expandedRows) {
|
|
|
+ // 该处是用于判断是展开还是收起行,只有展开的时候做请求,避免多次请求!
|
|
|
+ // 展开的时候expandedRows有值,收起的时候为空.
|
|
|
+ if (expandedRows.length > 0) {
|
|
|
+
|
|
|
+ let index = null
|
|
|
+ for (var i in this.list) {
|
|
|
+ if (this.list[i].id === row.id) {
|
|
|
+ index = i
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(index, '索引')
|
|
|
+ this.http.post("/prod-procedure/getVersions", { productId: row.id },
|
|
|
+ res => {
|
|
|
+ this.list[index].tableProdProcedure.versions = res.data
|
|
|
+ this.procedureVersion = res.data[res.data.length - 1]
|
|
|
+ this.getProdProcedureVersion(row.id, index)
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ this.http.post("/prod-material/getVersions", { productId: row.id },
|
|
|
+ res => {
|
|
|
+ this.list[index].tableProdMaterial.versions = res.data
|
|
|
+ this.prodMaterialVersion = res.data[res.data.length - 1]
|
|
|
+ this.getProdMaterialVersion(row.id, index)
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getProdProcedureVersion(id,index){
|
|
|
+ if(this.procedureVersion!=null&&this.procedureVersion!=''){
|
|
|
+ this.http.post("/prod-procedure/getInfo", { version: this.procedureVersion, productId: id },
|
|
|
+ res => {
|
|
|
+ // this.list[index].tableProdProcedure.procedureList = res.data;
|
|
|
+ // this.$forceUpdate();
|
|
|
+ this.$set(this.list[index].tableProdProcedure, 'procedureList', res.data );
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ getProdMaterialVersion( id,index) {
|
|
|
+ if(this.prodMaterialVersion!=null&& this.prodMaterialVersion!=''){
|
|
|
+ this.http.post("/prod-material/getInfo", { version: this.prodMaterialVersion, productId: id },
|
|
|
+ res => {
|
|
|
+ /* this.list[index].tableProdMaterial.materialList = res.data;
|
|
|
+ this.$forceUpdate(); */
|
|
|
+ this.$set(this.list[index].tableProdMaterial, 'materialList', res.data);
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ submitSequence(addSequence){
|
|
|
+ this.addLoading = true;
|
|
|
+ let procedureString =JSON.stringify(this.procedureLit);
|
|
|
+ this.http.post('/prod-procedure/changeProdProcedure', {
|
|
|
+ productId: this.productId,
|
|
|
+ version: this.procedureVersion,
|
|
|
+ prodProcedures: procedureString
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ this.addLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: (this.addForm.id != null ? this.$t('xiu-gai') : this.$t('create')) + this.$t('other.successful'),
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ if (addSequence) {
|
|
|
+ //进入物料录入
|
|
|
+
|
|
|
+ this.http.post('/prod-material/getProdMaterialList', { productId: this.productId },
|
|
|
+ res => {
|
|
|
+ this.prodMaterialList = res.data.prodMaterialList;
|
|
|
+ this.prodMaterialVersion = res.data.version;
|
|
|
+ })
|
|
|
+ this.prodEditActive = 2;
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.addFormVisible = false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.addLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ //删除工序
|
|
|
+ deleteProcedure(index,row){
|
|
|
+ if(row.id!=null){
|
|
|
+ this.http.get("/prod-procedure/isDelete",row.id,
|
|
|
+ res=>{
|
|
|
+ if(!res.data){
|
|
|
+ this.procedureLit.splice(index, 1)
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: '该工序已被使用,不能删除',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.procedureLit.splice(index, 1)
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ // 向表格中添加数据
|
|
|
+ addProcedure() {
|
|
|
+ this.procedureLit = [...this.procedureLit, {
|
|
|
+ name: '',
|
|
|
+ unitPrice: '',
|
|
|
+ workingTime: '',
|
|
|
+
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ // 向表格中添加数据
|
|
|
+ addMaterial() {
|
|
|
+ this.prodMaterialList = [...this.prodMaterialList, {
|
|
|
+ name: '',
|
|
|
+ companyCode: '',
|
|
|
+ companyDrawingNo: '',
|
|
|
+ materialQuality: '',
|
|
|
+ thickness: '',
|
|
|
+ numberProduct: '',
|
|
|
+ numberVehicle: ''
|
|
|
+
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ submitMaterial(){
|
|
|
+ this.addLoading = true;
|
|
|
+ let materialString = JSON.stringify(this.prodMaterialList);
|
|
|
+ this.http.post('/prod-material/changeProdMaterial', {
|
|
|
+ productId: this.productId,
|
|
|
+ version: this.prodMaterialVersion,
|
|
|
+ prodMaterials: materialString
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ this.addLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: (this.addForm.id != null ? this.$t('xiu-gai') : this.$t('create')) + this.$t('other.successful'),
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+
|
|
|
+ this.addFormVisible = false;
|
|
|
+ this.prodEditActive = 0
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.addLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //删除工物料
|
|
|
+ deleteMaterial(index, row) {
|
|
|
+ if (row.id != null) {
|
|
|
+ console.log(index);
|
|
|
+ this.http.get("/prod-material/isDelete", row.id,
|
|
|
+ res => {
|
|
|
+ if (!res.data) {
|
|
|
+ this.prodMaterialList.splice(index,1);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: '该物料已被使用,不能删除',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.prodMaterialList.splice(index, 1)
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
// 进入页面所执行的函数
|
|
|
mountedEnter() {
|
|
|
this.cateId = this.$route.params.cateId;
|
|
@@ -676,6 +1214,7 @@ a {
|
|
|
this.getUsers();
|
|
|
},
|
|
|
|
|
|
+
|
|
|
defaultExpandAllFlgCli() {
|
|
|
this.defaultExpandAllFlg = !this.defaultExpandAllFlg
|
|
|
this.list = JSON.parse(JSON.stringify(this.list))
|
|
@@ -2234,6 +2773,7 @@ a {
|
|
|
pageSize: this.size,
|
|
|
name:this.name,
|
|
|
code: this.code,
|
|
|
+ cateId : this.cateId
|
|
|
}
|
|
|
|
|
|
this.http.post('/product/getProductPage', parameter,
|
|
@@ -2241,6 +2781,10 @@ a {
|
|
|
this.listLoading = false;
|
|
|
if (res.code == "ok") {
|
|
|
var list = res.data.records;
|
|
|
+ for(var i in list) {
|
|
|
+ list[i].tableProdProcedure = {}
|
|
|
+ list[i].tableProdMaterial = {}
|
|
|
+ }
|
|
|
this.list = list;
|
|
|
this.total = res.data.total;
|
|
|
} else {
|
|
@@ -2511,17 +3055,25 @@ a {
|
|
|
this.$refs.form1.validate(valid => {
|
|
|
if (valid) {
|
|
|
this.addLoading = true;
|
|
|
-
|
|
|
+ this.addForm.categoryId =this.cateId;
|
|
|
this.http.post('/product/saveProductInfo',this.addForm,
|
|
|
res => {
|
|
|
this.addLoading = false;
|
|
|
if (res.code == "ok") {
|
|
|
+ this.productId=res.data.id;
|
|
|
this.$message({
|
|
|
message: (this.addForm.id!=null?this.$t('xiu-gai'):this.$t('create'))+this.$t('other.successful'),
|
|
|
type: "success"
|
|
|
});
|
|
|
if (addSequence) {
|
|
|
//进入工序录入
|
|
|
+ this.http.post('/prod-procedure/getProdProcedureList',{productId: this.productId},
|
|
|
+ res=>{
|
|
|
+ this.procedureLit=res.data.prodProcedureList;
|
|
|
+ this.procedureVersion=res.data.version;
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
this.prodEditActive = 1;
|
|
|
} else {
|
|
|
this.addFormVisible = false;
|
|
@@ -2803,6 +3355,9 @@ a {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.demo-table-expand .el-form-item {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
.rg_span{
|
|
|
display: inline-block;
|
|
|
}
|