|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<ele-modal :visible.sync="visible" :title="title" width="40vw" append-to-body :maxable="true">
|
|
<ele-modal :visible.sync="visible" :title="title" width="40vw" append-to-body :maxable="true">
|
|
|
- <div class="title">{{ title == '返工返修' ? '原' : '' }}产品信息</div>
|
|
|
|
|
|
|
+ <div class="title">{{ title == '返工' || title == '返修' ? '原' : '' }}产品信息</div>
|
|
|
<el-table :data="poList" border>
|
|
<el-table :data="poList" border>
|
|
|
<el-table-column label="产品名称" align="center" prop="categoryName">
|
|
<el-table-column label="产品名称" align="center" prop="categoryName">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -8,25 +8,25 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<!-- <el-table-column label="刻码" align="center" prop="engravingCode">
|
|
<!-- <el-table-column label="刻码" align="center" prop="engravingCode">
|
|
|
</el-table-column> -->
|
|
</el-table-column> -->
|
|
|
-<!-- <el-table-column label="规格" align="center" prop="specification">-->
|
|
|
|
|
-<!-- </el-table-column>-->
|
|
|
|
|
|
|
+ <!-- <el-table-column label="规格" align="center" prop="specification">-->
|
|
|
|
|
+ <!-- </el-table-column>-->
|
|
|
<el-table-column label="数量" align="center" prop="unqualifiedQuantity">
|
|
<el-table-column label="数量" align="center" prop="unqualifiedQuantity">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime">
|
|
<el-table-column label="创建时间" align="center" prop="createTime">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="创建人" align="center" prop="reviewerName">
|
|
<el-table-column label="创建人" align="center" prop="reviewerName">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="入库仓库" align="center" prop="depotId" v-if="title != '返工返修'">
|
|
|
|
|
|
|
+ <el-table-column label="入库仓库" align="center" prop="deptId" v-if="title != '返工返修'">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-select v-model="scope.row.depotId">
|
|
|
|
|
|
|
+ <el-select v-model="scope.row.deptId">
|
|
|
<el-option v-for="item in warehouseList" :key="item.id" :value="item.id" :label="item.name"
|
|
<el-option v-for="item in warehouseList" :key="item.id" :value="item.id" :label="item.name"
|
|
|
@click.native="handleChangeDepot(scope.row, item)"></el-option>
|
|
@click.native="handleChangeDepot(scope.row, item)"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
- <div class="title" v-if="title == '返工返修'">返工返修产品信息</div>
|
|
|
|
|
- <el-form ref="form" label-width="90px" class="create-form" v-if="title == '返工返修'">
|
|
|
|
|
|
|
+ <div class="title" v-if="title == '返工' || title == '返修'">返工返修产品信息</div>
|
|
|
|
|
+ <el-form ref="form" label-width="90px" class="create-form" v-if="title == '返工' || title == '返修'">
|
|
|
<el-table :data="newPoList" border height="20vh">
|
|
<el-table :data="newPoList" border height="20vh">
|
|
|
<el-table-column label="序号" align="center" width="60">
|
|
<el-table-column label="序号" align="center" width="60">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -63,7 +63,7 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
- <div class="add-product" @click="addEquipment" v-if="title == '返工返修'">
|
|
|
|
|
|
|
+ <div class="add-product" @click="addEquipment" v-if="title == '返工' || title == '返修'">
|
|
|
<i class="el-icon-circle-plus-outline"></i>
|
|
<i class="el-icon-circle-plus-outline"></i>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -98,7 +98,7 @@ export default {
|
|
|
newPoList: [],
|
|
newPoList: [],
|
|
|
visible: false,
|
|
visible: false,
|
|
|
loading: false,
|
|
loading: false,
|
|
|
- title: '返工返修',
|
|
|
|
|
|
|
+ title: '',
|
|
|
originLong: '',
|
|
originLong: '',
|
|
|
originHeight: '',
|
|
originHeight: '',
|
|
|
type: '',
|
|
type: '',
|
|
@@ -114,17 +114,18 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
open(row, type) {
|
|
open(row, type) {
|
|
|
- console.log(row, 'row')
|
|
|
|
|
|
|
+ console.log(row, 'row', type)
|
|
|
|
|
+
|
|
|
this.visible = true;
|
|
this.visible = true;
|
|
|
this.poList = row;
|
|
this.poList = row;
|
|
|
- this.type = type
|
|
|
|
|
- this.title = type == 1 ? '返工返修' : type == 2 ? '报废' : '试销品';
|
|
|
|
|
- if (
|
|
|
|
|
- !row[0].productName.includes('板材') &&
|
|
|
|
|
- !row[0].productName.includes('砌块')
|
|
|
|
|
- ) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.type = type;
|
|
|
|
|
+ this.title = type == 1 ? '返工' : type == 2 ? '返修' : type == 3 ? '报废' : '';
|
|
|
|
|
+ // if (
|
|
|
|
|
+ // !row[0].productName.includes('板材') &&
|
|
|
|
|
+ // !row[0].productName.includes('砌块')
|
|
|
|
|
+ // ) {
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
this._calcVolume(this.poList[0].specification);
|
|
this._calcVolume(this.poList[0].specification);
|
|
|
},
|
|
},
|
|
|
handleChangeDepot(row, item) {
|
|
handleChangeDepot(row, item) {
|
|
@@ -150,28 +151,34 @@ export default {
|
|
|
},
|
|
},
|
|
|
/* 保存编辑 */
|
|
/* 保存编辑 */
|
|
|
save() {
|
|
save() {
|
|
|
- let isSumNew = true,
|
|
|
|
|
- isDepotId = true;
|
|
|
|
|
- let data = this.title == '返工返修' ? this.newPoList : this.poList;
|
|
|
|
|
|
|
+ let isSumNew = true;
|
|
|
|
|
+ let isDepotId = true;
|
|
|
|
|
|
|
|
- data.forEach((item) => {
|
|
|
|
|
- if (this.title == '返工返修' && !item.sumNew) {
|
|
|
|
|
- isSumNew = false;
|
|
|
|
|
- }
|
|
|
|
|
- if (this.title != '返工返修' && !item.depotId) {
|
|
|
|
|
|
|
+ let data = this.title == '报废' ? this.poList : this.newPoList;
|
|
|
|
|
+
|
|
|
|
|
+ this.poList.forEach((item) => {
|
|
|
|
|
+ if (this.title != '返工' && !item.deptId || this.title == '返修' && !item.deptId) {
|
|
|
|
|
+ console.log(item, 'item')
|
|
|
isDepotId = false;
|
|
isDepotId = false;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- if (data.length == 0) {
|
|
|
|
|
- this.$alert('产品列表不能为空');
|
|
|
|
|
|
|
+ if (!isDepotId) {
|
|
|
|
|
+ this.$message.error('请选择入库仓库');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (!isSumNew) {
|
|
|
|
|
- this.$alert('数量不能为空');
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (this.newPoList.length == 0) {
|
|
|
|
|
+ this.$message.error('产品列表不能为空');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (!isDepotId) {
|
|
|
|
|
- this.$alert('请选择入库仓库');
|
|
|
|
|
|
|
+ this.newPoList.forEach((item) => {
|
|
|
|
|
+ if (this.title == '返工' && item.sumNew == '' || this.title == '返修' && item.sumNew == '') {
|
|
|
|
|
+ isSumNew = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (!isSumNew) {
|
|
|
|
|
+ this.$message.error('数量不能为空');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.$emit('success', { data, type: this.type });
|
|
this.$emit('success', { data, type: this.type });
|
|
@@ -179,13 +186,15 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 封装计算体积方法
|
|
// 封装计算体积方法
|
|
|
_calcVolume(string) {
|
|
_calcVolume(string) {
|
|
|
- let modelArr = string.split('*');
|
|
|
|
|
- let originLong = Number(modelArr[0]);
|
|
|
|
|
- let originWide = Number(modelArr[1]);
|
|
|
|
|
- let originHeight = modelArr[2].substr(0, modelArr[2].indexOf('cm'));
|
|
|
|
|
- this.originLong = originLong;
|
|
|
|
|
- this.originHeight = originHeight;
|
|
|
|
|
- return originLong * originWide * originHeight;
|
|
|
|
|
|
|
+ let modelArr = string?.split('*');
|
|
|
|
|
+ if (modelArr) {
|
|
|
|
|
+ let originLong = Number(modelArr[0]);
|
|
|
|
|
+ let originWide = Number(modelArr[1]);
|
|
|
|
|
+ let originHeight = modelArr[2].substr(0, modelArr[2].indexOf('cm'));
|
|
|
|
|
+ this.originLong = originLong;
|
|
|
|
|
+ this.originHeight = originHeight;
|
|
|
|
|
+ return originLong * originWide * originHeight;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 封装计算修补信息规格*块数的总体积
|
|
// 封装计算修补信息规格*块数的总体积
|
|
|
_calcModelVSWordcount() {
|
|
_calcModelVSWordcount() {
|
|
@@ -229,8 +238,8 @@ export default {
|
|
|
if (!row.name.includes('板材') && !row.name.includes('砌块')) {
|
|
if (!row.name.includes('板材') && !row.name.includes('砌块')) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
- let currentLong = Number(row.specification.split('*')[0]);
|
|
|
|
|
- let currentHeight = row.specification.split('*')[2];
|
|
|
|
|
|
|
+ let currentLong = Number(row.specification?.split('*')[0]);
|
|
|
|
|
+ let currentHeight = row.specification?.split('*')[2];
|
|
|
currentHeight = Number(
|
|
currentHeight = Number(
|
|
|
currentHeight.substr(0, currentHeight.indexOf('cm'))
|
|
currentHeight.substr(0, currentHeight.indexOf('cm'))
|
|
|
);
|
|
);
|
|
@@ -290,5 +299,4 @@ export default {
|
|
|
margin: 10px 0;
|
|
margin: 10px 0;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
</style>
|
|
</style>
|