| | |
| | | <div style="height: 100%"> |
| | | <div class="page-header"> |
| | | <div class="header-left"> |
| | | <a @click="$router.go(-1)"><i class="icon-btn-back"></i></a> |
| | | <a @click="goBack"><i class="icon-btn-back"></i></a> |
| | | <h2>编辑-产品结构</h2> |
| | | </div> |
| | | <div class="btn-group header-right"> |
| | | <el-button title="保存" :disabled="isSubmit" v-thinclick="`save`" |
| | | <el-button title="保存" type="primary" :disabled="isSubmit" v-thinclick="`save`" |
| | | >保存</el-button |
| | | > |
| | | </div> |
| | |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="结构类型" prop="bomTypeDb"> |
| | | <el-select |
| | | v-model="dataForm.bomTypeDb" |
| | | placeholder="请选择结构类型" |
| | | style="width:100%" |
| | | > |
| | | <el-option |
| | | v-for="(item, index) in bomTypeDbOptions" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :key="index" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item label="替代" prop="alternativeNo"> |
| | | <el-input v-model="dataForm.alternativeNo"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="替代描述" prop="alternativeDesc"> |
| | | <el-input |
| | | type="textarea" |
| | | :autosize="{ minRows: 1, maxRows: 3 }" |
| | | v-model="dataForm.alternativeDesc" |
| | | ></el-input> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item label="版本号" prop="version"> |
| | | <el-input v-model="dataForm.version" disabled></el-input> |
| | | </el-form-item> --> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input |
| | | type="textarea" |
| | |
| | | v-model="dataForm.remark" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="已同步至IFS" prop="ifsSync"> |
| | | <span |
| | | style="width: 146px;display: inline-block;font-size:12px;font-weight:bold;" |
| | | >{{ dataForm.ifsSync ? '是' : '否' }}</span |
| | | > |
| | | </el-form-item> --> |
| | | <!-- <el-form-item label="默认结构" prop="master"> |
| | | <el-checkbox v-model="dataForm.master"></el-checkbox> |
| | | </el-form-item> --> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | |
| | | size="medium" |
| | | class="blue-but" |
| | | @click="addNode()" |
| | | >添加 |
| | | >添加行 |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | |
| | | :data="nodeList" |
| | | :default-sort="{ prop: 'lineItemNo' }" |
| | | height="650" |
| | | :header-cell-style="{ color: '#999' }" |
| | | border |
| | | :header-cell-style="{ color: '#000' }" |
| | | :row-class-name="structureComponentRowClass" |
| | | class="l-mes" |
| | | > |
| | | <el-table-column |
| | | prop="lineItemNo" |
| | | label="行项号" |
| | | label="序号" |
| | | align="center" |
| | | width="70" |
| | | > |
| | |
| | | prop="operationName" |
| | | align="center" |
| | | > |
| | | <template scope="scope"> |
| | | <template scope="scope" > |
| | | <el-input |
| | | v-model="scope.row.operationName" |
| | | placeholder="请选择消耗工序" |
| | | v-if="scope.row.isUpdate" |
| | | style="width:90%" |
| | | v-model="scope.row.operationName" |
| | | placeholder="请选择消耗工序" |
| | | readonly |
| | | v-if="scope.row.isUpdate" |
| | | > |
| | | <el-button |
| | | slot="append" |
| | |
| | | <el-table-column label="零件号" prop="partNo" align="center"> |
| | | <template scope="scope"> |
| | | <el-input |
| | | style="width:90%" |
| | | :class="customClass[scope.$index]" |
| | | v-model="scope.row.partNo" |
| | | placeholder="请选择零件" |
| | |
| | | <el-table-column label="数量" prop="qpa" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input |
| | | style="width:90%" |
| | | clearable |
| | | size="small" |
| | | v-model="scope.row.qpa" |
| | | placeholder="请填写数量" |
| | |
| | | <span v-show="!scope.row.isUpdate">{{ scope.row.qpa }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="单位" prop="unit" align="center"> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="盘数(盘)" prop="discNum" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input |
| | | size="small" |
| | | v-model="scope.row.discNum" |
| | | placeholder="请填写盘数" |
| | | v-show="scope.row.isUpdate" |
| | | ></el-input> |
| | | <span v-show="!scope.row.isUpdate">{{ |
| | | scope.row.discNum |
| | | }}</span> |
| | | </template> |
| | | </el-table-column> --> |
| | | <!-- <el-table-column label="图号" prop="drawingNumber" align="center"> |
| | | </el-table-column> --> |
| | | <el-table-column align="center" label="操作" width="85px"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | class="blue-but" |
| | | v-if="!scope.row.isUpdate" |
| | | v-if="!scope.row.isUpdate && scope.row.id!=null" |
| | | @click="editNode(scope.$index, scope.row)" |
| | | >编辑</el-button |
| | | > |
| | |
| | | type="text" |
| | | size="small" |
| | | class="blue-but" |
| | | v-if="scope.row.isUpdate" |
| | | v-if="scope.row.isUpdate && scope.row.id!=null" |
| | | :loading="nodeSaveLoading" |
| | | @click="addOrUpdateNode(scope.$index, scope.row)" |
| | | >保存</el-button |
| | |
| | | this.getBomTypeDbOptions() |
| | | }, |
| | | methods: { |
| | | goBack(){ |
| | | let isUnSave = false |
| | | const _than = this |
| | | _than.nodeList.forEach(e=>{ |
| | | if(e.isUpdate || e.id==null){ |
| | | isUnSave = true |
| | | } |
| | | }) |
| | | if(isUnSave){ |
| | | _than.$confirm('您还有未保存的子节点,确认离开吗?', '提示', { |
| | | confirmButtonText: '仍要离开', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | _than.$router.go(-1) |
| | | }).catch(() => {}); |
| | | }else{ |
| | | _than.$router.go(-1) |
| | | } |
| | | }, |
| | | // 查询结构类型字典 |
| | | getBomTypeDbOptions() { |
| | | remote('bom_type_db').then((response) => { |
| | |
| | | this.currRow = null |
| | | }, |
| | | save() { |
| | | const _than = this |
| | | this.isSubmit = true |
| | | this.$refs.dataForm.validate((valid) => { |
| | | _than.nodeList.forEach(e=>{ |
| | | e.version = _than.dataForm.version |
| | | }) |
| | | _than.dataForm.components = _than.nodeList |
| | | _than.$refs.dataForm.validate((valid) => { |
| | | if (valid) { |
| | | if (this.dataForm.id) { |
| | | putObj(this.dataForm) |
| | | if (_than.dataForm.id) { |
| | | putObj(_than.dataForm) |
| | | .then((response) => { |
| | | var data = response.data |
| | | if (data.code === 0) { |
| | | this.$message.success('保存成功') |
| | | _than.$message.success('保存成功') |
| | | _than.$nextTick(()=>{ |
| | | _than.init(_than.dataForm.id) |
| | | }) |
| | | } else { |
| | | this.$message.error('保存失败') |
| | | _than.$message.error('保存失败') |
| | | } |
| | | this.isSubmit = false |
| | | _than.isSubmit = false |
| | | }) |
| | | .catch(() => { |
| | | this.isSubmit = false |
| | | _than.isSubmit = false |
| | | }) |
| | | } else { |
| | | addObj(this.dataForm) |
| | | addObj(_than.dataForm) |
| | | .then((response) => { |
| | | var data = response.data |
| | | if (data.code === 0) { |
| | | this.dataForm.id = data.data |
| | | this.$message.success('保存成功') |
| | | _than.dataForm.id = data.data |
| | | _than.$message.success('保存成功') |
| | | } else { |
| | | this.$message.error('保存失败') |
| | | _than.$message.error('保存失败') |
| | | } |
| | | this.isSubmit = false |
| | | _than.isSubmit = false |
| | | }) |
| | | .catch(() => { |
| | | this.isSubmit = false |
| | | _than.isSubmit = false |
| | | }) |
| | | } |
| | | } else { |
| | | this.isSubmit = false |
| | | _than.isSubmit = false |
| | | } |
| | | }) |
| | | }, |
| | |
| | | } |
| | | }, |
| | | delNode(index, row) { |
| | | if(row.id==null){ |
| | | this.nodeList.splice(index,1) |
| | | return |
| | | } |
| | | this.$confirm('是否确认删除零件号为' + row.partNo, '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | |
| | | .el-input__red { |
| | | border: 1px solid red; |
| | | } |
| | | .l-mes .el-input-group__append, |
| | | .l-mes .el-input-group__prepend { |
| | | padding: 0; |
| | | border-top: none; |
| | | border-right: none; |
| | | border-left: none; |
| | | border-radius: 0; |
| | | background-color: transparent; |
| | | } |
| | | |
| | | .l-mes .el-input-group__append .el-button, |
| | | .l-mes .el-input-group__prepend .el-button { |
| | | padding: 0; |
| | | width: 25px; |
| | | border: none !important; |
| | | line-height: 28px; |
| | | color: #c0c4cc; |
| | | margin: -1px 0; |
| | | } |
| | | |
| | | .l-mes .el-input-group__append .el-button i, |
| | | .l-mes .el-input-group__prepend .el-button i { |
| | | vertical-align: middle; |
| | | } |
| | | </style> |