|
@@ -18,11 +18,11 @@
|
|
|
</el-form-item>
|
|
|
<!--操作按钮-->
|
|
|
<el-form-item style="float:right;">
|
|
|
- <el-link type="primary" :underline="false" @click="importProduct()">导出产品</el-link>
|
|
|
+ <el-link type="primary" :underline="false" :disabled="productSelections.length==0" @click="importProduct()">导出产品</el-link>
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float:right;">
|
|
|
<el-upload class="filter-item" name="file" action :on-error="uploadFalse" :on-success="uploadSuccess"
|
|
|
- :before-upload="beforeAvatarUpload" :limit="1" ref="upload" accept=".xlsx,.xls"
|
|
|
+ :before-upload="beforeAvatarUpload" ref="upload" accept=".xlsx,.xls"
|
|
|
:show-file-list="false" :file-list="fileList" :http-request="uploadFile">
|
|
|
|
|
|
<el-link type="primary" :underline="false">导入产品</el-link>
|
|
@@ -110,7 +110,7 @@
|
|
|
|
|
|
<el-table-column type="selection" width="55">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="name" label="产品名称" sortable="custom" width="300"></el-table-column>
|
|
|
+ <el-table-column prop="name" label="产品名称" 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>
|
|
|
<el-table-column prop="unit" label="单位" width="100"></el-table-column>
|
|
@@ -155,6 +155,19 @@
|
|
|
style="float:right;"></el-pagination>
|
|
|
</el-col>
|
|
|
|
|
|
+ <div class="layout-container-floor">
|
|
|
+ <el-pagination
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="pageIndex"
|
|
|
+ :page-sizes="[10, 20, 50, 100]"
|
|
|
+ :page-size="pageSize"
|
|
|
+ layout="total, prev, pager, next, sizes, jumper"
|
|
|
+ :total="total"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+
|
|
|
<!--新增界面-->
|
|
|
<el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false"
|
|
|
customClass="customWidth" width="960px" :top="'6vh'">
|
|
@@ -168,35 +181,35 @@
|
|
|
</el-steps>
|
|
|
<div v-if="prodEditActive == 0" style="height: 72vh;overflow-y: auto;overflow-x: hidden;">
|
|
|
<el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
|
|
|
- <el-form-item label="产品名称">
|
|
|
+ <el-form-item label="产品名称" prop="name">
|
|
|
<!-- <el-input v-model="addForm.code" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目编号" clearable></el-input> -->
|
|
|
<el-input v-model="addForm.name" :placeholder="$t('peaseenterthe')" clearable maxlength="50"
|
|
|
show-word-limit="true"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="项目代码">
|
|
|
+ <el-form-item label="项目代码" prop="code">
|
|
|
<!-- <el-input v-model="addForm.code" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目编号" clearable></el-input> -->
|
|
|
<el-input v-model="addForm.code" :placeholder="$t('peaseenterthe')" clearable maxlength="50"
|
|
|
show-word-limit="true"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="订单数量">
|
|
|
+ <el-form-item label="订单数量" prop="orderNumber">
|
|
|
<el-input-number v-model="addForm.orderNumber" :placeholder="$t('peaseenterthe')" clearable
|
|
|
- :min="1"></el-input-number>
|
|
|
+ :min="1" :max="10000"></el-input-number>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="单位">
|
|
|
+ <el-form-item label="单位" prop="unit">
|
|
|
<el-input v-model="addForm.unit" :placeholder="$t('peaseenterthe')" clearable
|
|
|
maxlength="10"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="编组">
|
|
|
+ <el-form-item label="编组" prop="groupNumber">
|
|
|
<el-input v-model="addForm.groupNumber" :placeholder="$t('peaseenterthe')" clearable
|
|
|
maxlength="10"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="每列数量">
|
|
|
<el-input-number v-model="addForm.columnNumber" :placeholder="$t('peaseenterthe')"
|
|
|
- :min="1"></el-input-number>
|
|
|
+ :min="1" :max="10000"></el-input-number>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="每辆数量">
|
|
|
<el-input-number v-model="addForm.vehicleNumber" :placeholder="$t('peaseenterthe')"
|
|
|
- :min="1"></el-input-number>
|
|
|
+ :min="1" :max="10000"></el-input-number>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="描述" prop="description">
|
|
@@ -209,22 +222,33 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div v-if="prodEditActive == 1">
|
|
|
- <!--此处是录入工序的模块-->
|
|
|
- <el-input placeholder="请输入工序版本号" v-model="procedureVersion" class="input-pM"></el-input>
|
|
|
+ <!--此处是录入工序的模块-->
|
|
|
+ <!-- el-form ref="form2" :rules="rules1" label-width="120px">
|
|
|
+ <el-form-item prop="version">
|
|
|
+ <el-input placeholder="请输入工序版本号" v-model="procedureVersion" class="input-pM"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+
|
|
|
+ <el-form-item label=""></el-form-item>
|
|
|
+ </el-form> -->
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-input placeholder="请输入工序版本号" v-model="procedureVersion" clearable maxlength="50" class="input-pM"></el-input>
|
|
|
<el-table :data="procedureLit" style="width: 100%">
|
|
|
- <el-table-column prop="name" label="工序名称" width="180">
|
|
|
+ <el-table-column prop="name" label="工序名称" clearable maxlength="30" 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">
|
|
|
+ <el-table-column prop="workingTime" label="单件工时" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.unitPrice" placeholder="请输入"></el-input>
|
|
|
+ <el-input v-model="scope.row.unitPrice" clearable maxlength="11" placeholder="请输入"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="workingTime" label="单件工价" width="180">
|
|
|
+ <el-table-column prop="unitPrice" label="单件工价" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.workingTime" placeholder="请输入"></el-input>
|
|
|
+ <el-input v-model="scope.row.workingTime" clearable maxlength="9" placeholder="请输入"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="质检类型" width="180">
|
|
@@ -305,7 +329,7 @@
|
|
|
: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)"
|
|
|
+ <el-button v-if="prodEditActive == 1" type="primary" @click="submitSequence(0)"
|
|
|
:loading="addLoading">保存工序</el-button>
|
|
|
<!-- <el-button v-if="prodEditActive == 1" type="primary" @click="submitSequence(1)"
|
|
|
:loading="addLoading">保存并编辑物料</el-button>
|
|
@@ -377,20 +401,6 @@
|
|
|
<el-button type="primary" @click=" saveCopyProduct()">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
- <!-- 复制产品 -->
|
|
|
- <el-dialog :title="title" :visible.sync="copyVisible" width="30%">
|
|
|
- <div>
|
|
|
- <el-form ref="form" :model="category" label-width="80px">
|
|
|
- <el-form-item label="产品名称">
|
|
|
- <el-input v-model="pdName"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="copyVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click=" saveCopyProduct()">确定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
|
|
|
<!-- 新增产品分类 -->
|
|
|
<el-dialog :title="title" :visible.sync="isganttshowCa" width="30%">
|
|
@@ -626,12 +636,14 @@ a {
|
|
|
import util from "../../common/js/util";
|
|
|
// 自定义select组件
|
|
|
import selectCat from "@/components/select.vue"
|
|
|
+import { version } from 'vue';
|
|
|
export default {
|
|
|
components: {
|
|
|
selectCat
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+
|
|
|
copyVisible: false,
|
|
|
pdName: '',
|
|
|
productSelections: [], //选中的产品id集合
|
|
@@ -776,6 +788,11 @@ export default {
|
|
|
rules: {
|
|
|
name: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
|
|
|
code: [{ required: true, message: this.$t('qing-shu-ru-bian-hao'), trigger: "blur" }],
|
|
|
+ orderNumber: [{ required: true, message:' 请输入订单数量', trigger: "blur" }],
|
|
|
+ unit: [{ required: true, message: '请输入单位', trigger: "blur" }],
|
|
|
+ groupNumber: [{ required: true, message: '请输入编组', trigger: "blur" }],
|
|
|
+
|
|
|
+
|
|
|
projectStageName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
|
|
|
projectLevelName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
|
|
|
},
|
|
@@ -917,9 +934,9 @@ export default {
|
|
|
this.$refs.productTbl.doLayout();
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
methods: {
|
|
|
uploadFile(params) {
|
|
|
-
|
|
|
let str = params.file.name.split(".");
|
|
|
let format1 = str[str.length - 1];
|
|
|
if (format1 != "xls" && format1 != "xlsx") {
|
|
@@ -998,7 +1015,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
- message: '该分类正在使用中,不能删除',
|
|
|
+ message: '已有产品为此分类,无法删除',
|
|
|
type: 'warning'
|
|
|
});
|
|
|
}
|
|
@@ -1015,7 +1032,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
- message: '该分类已处在',
|
|
|
+ message: '该分类已存在',
|
|
|
type: 'warning'
|
|
|
});
|
|
|
}
|
|
@@ -1027,7 +1044,7 @@ export default {
|
|
|
|
|
|
getCategoryList() {
|
|
|
this.isganttshow = true
|
|
|
- console.log("======")
|
|
|
+
|
|
|
console.log(this.categoryList)
|
|
|
this.http.post("/prod-category/getList", null,
|
|
|
res => {
|
|
@@ -1121,49 +1138,73 @@ export default {
|
|
|
|
|
|
},
|
|
|
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,
|
|
|
- productName: this.productName
|
|
|
- },
|
|
|
- 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) {
|
|
|
- //进入物料录入
|
|
|
+ let flag=true
|
|
|
+
|
|
|
|
|
|
- this.http.post('/prod-material/getProdMaterialList', { productId: this.productId },
|
|
|
- res => {
|
|
|
- this.prodMaterialList = res.data.prodMaterialList;
|
|
|
- this.prodMaterialVersion = res.data.version;
|
|
|
- })
|
|
|
- this.prodEditActive = 2;
|
|
|
+ if (version === '') {
|
|
|
+ flag=false
|
|
|
+ }
|
|
|
|
|
|
+ for (let i = 0; i < this.procedureLit.length; i++) {
|
|
|
+ console.log(this.procedureLit[i].name === '')
|
|
|
+ if (this.procedureLit[i].name === '' || this.procedureLit[i].unitPrice === '' || this.procedureLit[i].workingTime === '' || this.procedureLit[i].checkType === '') {
|
|
|
+ flag= false
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(flag){
|
|
|
+ this.addLoading = true;
|
|
|
+ let procedureString = JSON.stringify(this.procedureLit);
|
|
|
+ this.http.post('/prod-procedure/changeProdProcedure', {
|
|
|
+ productId: this.productId,
|
|
|
+ version: this.procedureVersion,
|
|
|
+ prodProcedures: procedureString,
|
|
|
+ productName: this.productName
|
|
|
+ },
|
|
|
+ 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.addFormVisible = false;
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
}
|
|
|
- } else {
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.addLoading = false;
|
|
|
this.$message({
|
|
|
- message: res.msg,
|
|
|
+ message: error,
|
|
|
type: "error"
|
|
|
});
|
|
|
- }
|
|
|
- },
|
|
|
- error => {
|
|
|
- this.addLoading = false;
|
|
|
- this.$message({
|
|
|
- message: error,
|
|
|
- type: "error"
|
|
|
});
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: "版本号或工序中部分数据为空",
|
|
|
+ type: "error"
|
|
|
});
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
},
|
|
|
|
|
@@ -1192,6 +1233,7 @@ export default {
|
|
|
name: '',
|
|
|
unitPrice: '',
|
|
|
workingTime: '',
|
|
|
+ checkType: 0
|
|
|
|
|
|
}]
|
|
|
},
|
|
@@ -2968,7 +3010,7 @@ export default {
|
|
|
//复制产品
|
|
|
copyProduct(item) {
|
|
|
this.copyVisible = true
|
|
|
- this.pdName = ''
|
|
|
+ this.pdName = item.name
|
|
|
this.productId = item.id
|
|
|
|
|
|
},
|
|
@@ -3151,7 +3193,11 @@ export default {
|
|
|
},
|
|
|
submitInsert(addSequence) {
|
|
|
this.$refs.form1.validate(valid => {
|
|
|
+ console.log(valid)
|
|
|
if (valid) {
|
|
|
+
|
|
|
+ if(Number.isInteger(this.addForm.orderNumber)&& Number.isInteger(this.addForm.columnNumber) && Number.isInteger(this.addForm.vehicleNumber)){
|
|
|
+ //console.log("valid",valid)
|
|
|
this.addLoading = true;
|
|
|
this.addForm.categoryId = this.cateId;
|
|
|
this.http.post('/product/saveProductInfo', this.addForm,
|
|
@@ -3178,7 +3224,7 @@ export default {
|
|
|
this.addFormVisible = false;
|
|
|
}
|
|
|
this.getList();
|
|
|
- } else {
|
|
|
+ }else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
|
type: "error"
|
|
@@ -3192,6 +3238,13 @@ export default {
|
|
|
type: "error"
|
|
|
});
|
|
|
});;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "数量要为整数",
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
},
|