Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop

This commit is contained in:
caoqianming 2021-12-07 08:43:36 +08:00
commit 16aa96e305
1 changed files with 345 additions and 331 deletions

View File

@ -78,49 +78,51 @@
<el-table-column label="所在子工序"> <el-table-column label="所在子工序">
<template slot-scope="scope">{{ scope.row.step_.name }}</template> <template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="220px"> <el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['warehouse_update'])"
@click="handleInspection(scope)" @click="handleInspection(scope)"
>检验</el-link >检验
> </el-link
</template> >
</el-table-column> </template>
</el-table> </el-table-column>
<pagination </el-table>
v-show="wproductList2.count > 0" <pagination
:total="wproductList2.count" v-show="wproductList2.count > 0"
:page.sync="listQuery2.page" :total="wproductList2.count"
:limit.sync="listQuery2.page_size" :page.sync="listQuery2.page"
@pagination="getList2" :limit.sync="listQuery2.page_size"
/> @pagination="getList2"
</el-card> />
</el-tab-pane> </el-card>
<el-tab-pane label="已合格半成品"> </el-tab-pane>
<el-card style="margin-top: 2px"> <el-tab-pane label="已合格半成品">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-card style="margin-top: 2px">
>批量入库</el-button <el-button type="primary" icon="el-icon-plus" @click="handleCreate"
> >批量入库
<el-table </el-button
v-loading="listLoading" >
:data="wproductList1.results" <el-table
ref="multipleTable" v-loading="listLoading"
border :data="wproductList1.results"
fit ref="multipleTable"
stripe border
highlight-current-row fit
max-height="600" stripe
highlight-current-row
max-height="600"
> >
<el-table-column <el-table-column
type="selection" type="selection"
width="55"> width="55">
</el-table-column> </el-table-column>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50"/>
<el-table-column label="半成品名称"> <el-table-column label="半成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template> <template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="半成品编号"> <el-table-column label="半成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template> <template slot-scope="scope">{{ scope.row.number }}</template>
@ -158,15 +160,13 @@
</el-tabs> </el-tabs>
<el-dialog title="物料检查表" :close-on-click-modal="false" :visible.sync="outerVisible"> <el-dialog title="物料检查表" :close-on-click-modal="false" :visible.sync="outerVisible">
<el-select style="width: 100%" v-model="recordform" placeholder="请选择"> <el-select style="width: 100%" v-model="recordform" placeholder="请选择" @change="recordformChange">
<el-option <el-option
v-for="item in recordformList" v-for="item in recordformList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
@change="recordformChange(item)" >
@select="recordformChange(item)"
>
</el-option> </el-option>
</el-select> </el-select>
@ -190,308 +190,322 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="半成品入库" :close-on-click-modal="false" :visible.sync="dialogFormVisible"> <el-dialog title="半成品入库" :close-on-click-modal="false" :visible.sync="dialogFormVisible">
<el-form :model="form"> <el-form :model="form">
<el-form-item label="仓库" :label-width="formLabelWidth"> <el-form-item label="仓库" :label-width="formLabelWidth">
<el-select <el-select
style="width: 100%" style="width: 100%"
v-model="form.warehouse" v-model="form.warehouse"
placeholder="请选择仓库" placeholder="请选择仓库"
> >
<el-option <el-option
v-for="item in WarehouseData" v-for="item in WarehouseData"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
> >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注" :label-width="formLabelWidth"> <el-form-item label="备注" :label-width="formLabelWidth">
<el-input v-model="form.remark" ></el-input> <el-input v-model="form.remark"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button> <el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="putin"> </el-button> <el-button type="primary" @click="putin"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="半成品批量入库" :close-on-click-modal="false" :visible.sync="dialogFormVisibles"> <el-dialog title="半成品批量入库" :close-on-click-modal="false" :visible.sync="dialogFormVisibles">
<el-form :model="form"> <el-form :model="form">
<el-form-item label="仓库" :label-width="formLabelWidth"> <el-form-item label="仓库" :label-width="formLabelWidth">
<el-select <el-select
style="width: 100%" style="width: 100%"
v-model="form.warehouse" v-model="form.warehouse"
placeholder="请选择仓库" placeholder="请选择仓库"
> >
<el-option <el-option
v-for="item in WarehouseData" v-for="item in WarehouseData"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
> >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注" :label-width="formLabelWidth"> <el-form-item label="备注" :label-width="formLabelWidth">
<el-input v-model="form.remark" ></el-input> <el-input v-model="form.remark"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisibles = false"> </el-button> <el-button @click="dialogFormVisibles = false"> </el-button>
<el-button type="primary" @click="putins"> </el-button> <el-button type="primary" @click="putins"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import customForm from '@/components/customForm/index'; import customForm from '@/components/customForm/index';
import { getwproductList ,wproductTest,wproductPutin,createputins} from "@/api/wpm"; import {getwproductList, wproductTest, wproductPutin, createputins} from "@/api/wpm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { getWarehouseList } from "@/api/inm"; import {getWarehouseList} from "@/api/inm";
import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm"; import {getMaterialList, getrecordformList, getrffieldList} from "@/api/mtm";
import { genTree } from "@/utils"; import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultetestitem = {}; const defaultetestitem = {};
export default { export default {
components: {Pagination,customForm}, components: {Pagination, customForm},
data() { data() {
return { return {
testitem: defaultetestitem, testitem: defaultetestitem,
form: {remark: "", warehouse: ""}, form: {remark: "", warehouse: ""},
wproductList: { wproductList: {
count: 0, count: 0,
},
wproductList1: {
count: 0,
},
wproductList2: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
listQuery1: {
page: 1,
page_size: 20,
},
listQuery2: {
page: 1,
page_size: 20,
},
actstate_: {
6: "待复检",
10: "生产中",
20: "待检验",
30: "已合格",
40: "库存中",
50: "不合格",
60: "待成品检验",
},
choice: [
{
value: true,
label: "合格",
}, },
{ wproductList1: {
value: false, count: 0,
label: "不合格",
}, },
], wproductList2: {
options: [], count: 0,
listLoading: true, },
fieldList: "", listQuery: {
is_testok: "true", page: 1,
field: [], page_size: 20,
recordformList: [], },
recordform: "", listQuery1: {
fifo_detail: "", page: 1,
listQueryrecordform: { page_size: 20,
page: 0, },
}, listQuery2: {
mutipID: [], page: 1,
outerVisible: false, page_size: 20,
innerVisible: false, },
dialogFormVisible: false, formLabelWidth:'',
dialogFormVisibles: false, formLabelWidthL:'',
testrecord: {}, actstate_: {
WarehouseData: "", 6: "待复检",
}; 10: "生产中",
}, 20: "待检验",
computed: {}, 30: "已合格",
watch: {}, 40: "库存中",
created() { 50: "不合格",
this.getList(); 60: "待成品检验",
this.getList2(); },
this.getList1(); choice: [
this.getLists(); {
}, value: true,
methods: { label: "合格",
checkPermission, },
//待检半成品列表 {
getList() { value: false,
this.listLoading = true; label: "不合格",
this.listQuery.act_state = 20; },
getwproductList(this.listQuery).then((response) => { ],
if (response.data) { options: [],
this.wproductList = response.data; listLoading: true,
} fieldList: "",
this.listLoading = false; is_testok: "true",
}); field: [],
recordformList: [],
recordform: "",
fifo_detail: "",
listQueryrecordform: {
page: 0,
},
mutipID: [],
wproduct:null,
hasPicture: false,
outerVisible: false,
innerVisible: false,
dialogFormVisible: false,
dialogFormVisibles: false,
testrecord: {},
WarehouseData: "",
formName:'项目检查表',
};
}, },
//复检半成品列表 computed: {},
getList2() { watch: {},
created() {
this.listQuery2.act_state = 6; this.getList();
getwproductList(this.listQuery2).then((response) => { this.getList2();
if (response.data) { this.getList1();
this.wproductList2 = response.data; // this.getLists();
}
});
}, },
//已合格半成品 methods: {
getList1() { checkPermission,
//待检半成品列表
this.listQuery1.act_state = 30; getList() {
this.listQuery1.material__type = 1; this.listLoading = true;
getwproductList(this.listQuery1).then((response) => { this.listQuery.act_state = 20;
if (response.data) { getwproductList(this.listQuery).then((response) => {
this.wproductList1 = response.data;
}
});
},
//半成品批量入库
handleCreate() {
this.dialogFormVisibles = true;
this.getWarehouseLists();//仓库
},
//批量入库
putins() {
let _this = this
_this.mutipID = []
this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID.push(item.id);
alert(_this.mutipID);
});
console.log(_this.mutipID);
createputins({warehouse: this.form.warehouse, wproducts: _this.mutipID, remark: this.form.remark}).then((res) => {
if (res.code >= 200) {
this.$message.success("批量入库成功!");
this.dialogFormVisibles = false;
this.getList1();
}
});
},
//仓库列表
getWarehouseLists() {
getWarehouseList({page: 0}).then((response) => {
if (response.data) {
this.WarehouseData = response.data;
}
});
},
handleInspection(scope) {
//调该物料对应的检查表
this.outerVisible = true;
this.wproduct = scope.row.id;//半成品ID
this.wproductactstate = scope.row.act_state;//半成品状态
this.listQueryrecordform.material = scope.row.material;//
this.listQueryrecordform.type = 2;
this.recordform = "";
getrecordformList(this.listQueryrecordform).then((response) => {
if (response.data) {
this.recordformList = response.data;
}
});
},
//根据选择的表渲染检查项目
submitrecordform() {
let that = this;
if (this.recordform != "") {
getrffieldList({form: this.recordform, page: 1,page_size:100}).then((response) => {
if (response.data) { if (response.data) {
that.hasPicture = false; this.wproductList = response.data;
let fieldList = response.data.results; }
that.fieldList = [...fieldList]; this.listLoading = false;
let arr = fieldList.filter(item => { });
return item.field_type === 'draw' },
}); //复检半成品列表
if (arr.length > 0) { getList2() {
that.hasPicture = true;
} this.listQuery2.act_state = 6;
that.innerVisible = true; getwproductList(this.listQuery2).then((response) => {
if (response.data) {
this.wproductList2 = response.data;
}
});
},
//已合格半成品
getList1() {
this.listQuery1.act_state = 30;
this.listQuery1.material__type = 1;
getwproductList(this.listQuery1).then((response) => {
if (response.data) {
this.wproductList1 = response.data;
}
});
},
//半成品批量入库
handleCreate() {
this.dialogFormVisibles = true;
this.getWarehouseLists();//仓库
},
//批量入库
putins() {
let _this = this
_this.mutipID = []
this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID.push(item.id);
alert(_this.mutipID);
});
console.log(_this.mutipID);
createputins({
warehouse: this.form.warehouse,
wproducts: _this.mutipID,
remark: this.form.remark
}).then((res) => {
if (res.code >= 200) {
this.$message.success("批量入库成功!");
this.dialogFormVisibles = false;
this.getList1();
} }
}); });
} else this.$message.error("请选择检查表!"); },
}, //仓库列表
//提交检查项目 getWarehouseLists() {
submitfield() { getWarehouseList({page: 0}).then((response) => {
let _this = this; if (response.data) {
_this.field = []; //检查项目 this.WarehouseData = response.data;
this.fieldList.forEach((item) => { }
_this.field.push({
form_field: item.id,
field_value: item.sort,
is_testok: item.is_testok//单项检查结果
}); });
}); },
handleInspection(scope) {
//调该物料对应的检查表
this.outerVisible = true;
this.wproduct = scope.row.id;//半成品ID
this.wproductactstate = scope.row.act_state;//半成品状态
this.listQueryrecordform.material = scope.row.material;//
this.listQueryrecordform.type = 2;
this.recordform = "";
getrecordformList(this.listQueryrecordform).then((response) => {
if (response.data) {
this.recordformList = response.data;
}
});
},
recordformChange(){
let that = this;
let arr = this.recordformList.filter(item=>{
return item.id=that.recordform;
})
that.formName = arr[0].name;
},
//根据选择的表渲染检查项目
submitrecordform() {
let that = this;
if (this.recordform != "") {
getrffieldList({form: this.recordform, page: 1, page_size: 100}).then((response) => {
if (response.data) {
that.hasPicture = false;
let fieldList = response.data.results;
that.fieldList = [...fieldList];
let arr = fieldList.filter(item => {
return item.field_type === 'draw'
});
if (arr.length > 0) {
that.hasPicture = true;
}
that.innerVisible = true;
}
});
} else this.$message.error("请选择检查表!");
},
//提交检查项目
submitfield() {
let _this = this;
_this.field = []; //检查项目
this.fieldList.forEach((item) => {
console.log(this.recordform); _this.field.push({
this.testrecord.form = this.recordform;//检查表 form_field: item.id,
this.testrecord.record_data = _this.field;//检查项列表 field_value: item.sort,
this.testrecord.is_testok = this.is_testok;//检查表检查结果 is_testok: item.is_testok//单项检查结果
this.testrecord.wproduct = this.wproduct;//半成品ID });
});
console.log(this.recordform);
this.testrecord.form = this.recordform;//检查表
this.testrecord.record_data = _this.field;//检查项列表
this.testrecord.is_testok = this.is_testok;//检查表检查结果
this.testrecord.wproduct = this.wproduct;//半成品ID
wproductTest(this.testrecord).then((res) => { wproductTest(this.testrecord).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.innerVisible = false; this.innerVisible = false;
this.outerVisible = false; this.outerVisible = false;
this.getList(); this.getList();
this.getList1(); this.getList1();
this.getList2(); this.getList2();
} }
}); });
},
//半成品入库
handlePutin(scope) {
this.dialogFormVisible = true;
this.getWarehouseLists();//仓库
this.id = scope.row.id;//半成品id
},
putin() {
wproductPutin(this.id, this.form).then((res) => {
if (res.code >= 200) {
this.$message.success("入库成功!");
this.dialogFormVisible = false;
this.getList1();
}
});
},
formFunc(value) {
wproductTest(value).then((res) => {
if (res.code >= 200) {
this.innerVisible = false;
this.outerVisible = false;
this.getList();
this.getList1();
this.getList2();
}
});
},
}, },
//半成品入库 }
handlePutin(scope) {
this.dialogFormVisible = true;
this.getWarehouseLists();//仓库
this.id = scope.row.id;//半成品id
},
putin() {
wproductPutin(this.id, this.form).then((res) => {
if (res.code >= 200) {
this.$message.success("入库成功!");
this.dialogFormVisible = false;
this.getList1();
}
});
},
formFunc(value) {
wproductTest(value).then((res) => {
if (res.code >= 200) {
this.innerVisible = false;
this.outerVisible = false;
this.getList();
this.getList1();
this.getList2();
}
});
},
},
}
</script> </script>