rukujianyan

This commit is contained in:
shijing 2024-01-09 09:13:55 +08:00
parent b9e1fe491c
commit 890d41dfa4
9 changed files with 570 additions and 58 deletions

View File

@ -138,5 +138,13 @@ export default {
data);
}
},
testpurin: {
name: "入场检验",
req: async function(id,data){
return await http.post(
`${config.API_URL}/inm/mioitem/${id}/test_pur_in/`,
data);
}
},
}
}

View File

@ -66,6 +66,7 @@
@success="handleSaveSuccess" @closed="dialog.save = false">
</save-dialog>
<check-dialog v-if="dialog.check" ref="checkDialog" :mioitemId="mioitemId"
:cate="cate" :type="type" :objitem="objitem"
@success="handleCheckSuccess" @closed="dialog.check = false">
</check-dialog>
</template>
@ -103,9 +104,11 @@ export default {
mioitemId:'',
type:'',
cate:'',
objitem:{},
};
},
mounted() {
this.type = this.$route.query.type;
this.cate = this.$route.query.cate;
this.mioId = this.$route.query.mio;
this.params.mio = this.$route.query.mio;
@ -155,15 +158,17 @@ export default {
}).catch(() => { });
},
table_check(row){
this.dialog.check = true;
this.mioitemId = row.id;
this.objitem = row;
this.dialog.check = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("add");
});
},
check_Show(row){
this.dialog.check = true;
this.mioitemId = row.id;
this.objitem = row;
this.dialog.check = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("show").setData(row);
});

View File

@ -12,9 +12,9 @@
ref="dialogForm"
:model="form"
:rules="rules"
label-width="100px"
label-width="140px"
>
<el-row>
<el-row v-if="type=='do_in'">
<el-col :md="12" :sm="24">
<el-form-item label="检验日期" prop="test_date">
<el-date-picker
@ -109,6 +109,109 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="type=='pur_in'">
<el-col :md="12" :sm="24">
<el-form-item label="产品名称:">
{{ objitem.material_name }}
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="入厂批次号:">
{{ objitem.batch }}
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="总袋(桶)数:">
{{ objitem.count }}
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="抽样数量">
<el-input v-model="form.weight_kgs_count" disabled placeholder="抽样数量"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="称重记录/Kg">
<el-button type="primary" icon="el-icon-plus" @click="addWeight"></el-button>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-for="(item,ind) in weight_kgs" :key="item" style="position:relative">
<el-form-item :label-width="50">
<el-input-number v-model="item.value" :min="0" style="width:90%" controls-position="right" @change="countSun"/>
</el-form-item>
<el-button @click="delWeight(ind)" type="danger" icon="el-icon-delete" circle style="position:absolute;right:-10px;top:0"/>
</el-col>
</el-row>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="抽样计算总重量/Kg">
<el-input-number v-model="form.count_bag_weight_all" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="合同采购量/Kg">
<el-input-number v-model="form.count" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="检验合格" prop="is_testok">
<el-select
v-model="form.is_testok"
placeholder="检验合格"
clearable
style="width:100%"
>
<el-option label="是" :value="true"/>
<el-option label="否" :value="false"/>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="24" prop="is_testok">
<el-form-item label="结论判定" prop="is_testok">
<el-select
v-model="form.is_testok"
placeholder="结论判定"
clearable
style="width:100%"
>
<el-option label="是" value="true"/>
<el-option label="否" value="false"/>
</el-select>
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="检验日期" prop="test_date">
<el-date-picker
v-model="form.test_date"
type="date"
value-format="YYYY-MM-DD"
style="width:100%"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="检验员" prop="test_user">
<el-select
v-model="form.test_user"
placeholder="检验员"
clearable
style="width:100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main>
<el-footer v-if="mode=='add'">
@ -123,16 +226,23 @@ export default {
emits: ["success", "closed"],
props: {
mioitemId: { type: String, default: "" },
type: { type: String, default: "" },
cate: { type: String, default: "" },
objitem: { type: Object, default: () => {}},
},
data() {
return {
loading: false,
form: {},
form: {
weight_kgs:[],
},
rules: {
test_date: [{required: true, message: "请选择检验日期", trigger: "blur"}],
test_user: [{required: true, message: "请选择检验人", trigger: "blur"}],
count_notok: [{required: true, message: "请填写不合格数", trigger: "blur"}],
},
mioItem: {},
weight_kgs:[{value:0}],
visible: false,
isSaveing: false,
userList:[],
@ -146,6 +256,12 @@ export default {
},
mounted() {
this.getUserList();
let that = this;
if(that.type=='pur_in'){
that.form.material_name = that.objitem.material_name;
that.form.batch = that.objitem.batch;
that.form.count_bag = that.objitem.count;
}
},
methods: {
//
@ -161,18 +277,58 @@ export default {
that.userList = res.results;
});
},
addWeight(){
this.weight_kgs.push({value:0});
this.form.weight_kgs_count = this.weight_kgs.length;
},
delWeight(index){
this.weight_kgs.splice(index,1);
this.form.weight_kgs_count = this.weight_kgs.length;
},
countSun(){
let that = this;
let sum = 0;
console.log('change')
that.weight_kgs.forEach(item=>{
sum = sum+item.value;
})
that.form.count_bag_weight_all = sum/that.weight_kgs.length*that.objitem.count;
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
that.isSaveing = true;
try {
this.$API.inm.mioitem.test.req(this.mioitemId,this.form).then(res=>{
this.isSaveing = false;
this.$emit("success");
this.visible = false;
this.$message.success("操作成功");
if(that.type=='pur_in'){
console.log(that.form);
let arr = [];
that.weight_kgs.forEach(item=>{
arr.push(item.value);
})
let obj = {};
obj.test_date = that.form.test_date;
obj.test_user = that.form.test_user;
obj.count_bag = that.objitem.count;
obj.weight_kgs = arr;
obj.is_testok = that.form.is_testok;
console.log(obj)
that.$API.inm.mioitem.testpurin.req(that.mioitemId,obj).then(res=>{
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
})
}else{
that.$API.inm.mioitem.test.req(that.mioitemId,that.form).then(res=>{
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
})
}
} catch (err) {
//
this.isSaveing = false;
@ -183,8 +339,23 @@ export default {
},
//
setData(data) {
Object.assign(this.form, data);
this.form.test_group = this.form.split(',')
let that = this;
Object.assign(that.form, data);
// that.form.test_group = that.form.split(',');
that.weight_kgs = [];
console.log(data.weight_kgs)
if(data.weight_kgs.length>0){
that.form.weight_kgs_count = data.weight_kgs.length;
let sum = 0;
data.weight_kgs.forEach((item)=>{
sum = sum+item;
let obj = {};
obj.value = item;
that.weight_kgs.push(obj)
})
that.form.count_bag_weight_all =sum/data.weight_kgs.length*data.count;
}
},
//
setFilters(filters) {

View File

@ -25,24 +25,33 @@
:params="query"
>
<el-table-column type="index" width="50"/>
<el-table-column label="日期" prop="name" show-overflow-tooltip>
<el-table-column label="产品名称" prop="name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="工序" prop="number">
<el-table-column label="入场批次" prop="number">
</el-table-column>
<el-table-column label="检测内容" prop="model">
<el-table-column label="总袋(桶)数" prop="model">
</el-table-column>
<el-table-column label="检测标准" prop="factory" show-overflow-tooltip>
<el-table-column label="抽样数量" prop="factory">
</el-table-column>
<el-table-column label="操作人测量值" prop="production_date">
<el-table-column label="称重记录/Kg" prop="production_date">
</el-table-column>
<el-table-column label="操作人" prop="production_date">
<el-table-column label="抽样计算总重量/Kg" prop="production_date">
</el-table-column>
<el-table-column label="专检人测量值" prop="buy_date">
<el-table-column label="合同采购量/Kg" prop="buy_date">
</el-table-column>
<el-table-column label="专检人" prop="production_date">
<el-table-column label="检验报告" prop="production_date">
</el-table-column>
<el-table-column label="结论" prop="production_date">
<el-table-column label="结论判定" prop="production_date">
</el-table-column>
<el-table-column label="检验员" prop="production_date">
</el-table-column>
<!-- <el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-link type="primary" @click="table_show(scope.row)">查看</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-auth="'ptest.delete'">删除</el-link>
</template>
</el-table-column> -->
<!-- <el-table-column label="结论">
<template #default="scope">
<el-tag v-if="scope.row.state===10" type="success">

View File

@ -43,14 +43,23 @@
</el-table-column>
</scTable>
</el-main>
<check-dialog v-if="dialog.check" ref="checkDialog" @success="handleCheckSuccess" @closed="dialog.check = false">
</check-dialog>
</el-container>
</template>
<script>
import checkDialog from "./product_form.vue";
export default {
name: "rparty",
components:{
checkDialog
},
data() {
return {
// apiObj: this.$API.qm.list,
dialog:{
check:false,
},
apiObj:null,
query: {
page:1,
@ -65,6 +74,19 @@
};
},
methods: {
add() {
this.dialog.check = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("add");
});
},
table_edit(row) {
this.dialog.check = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("edit").setData(row);
});
},
table_del() { },
//
table_show(row) {
this.dialog.save = true;

View File

@ -0,0 +1,248 @@
<template>
<el-dialog
title="成品检验"
v-model="visible"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
label-width="100px"
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="检验日期" prop="test_date">
<el-date-picker
v-model="form.test_date"
type="date"
value-format="YYYY-MM-DD"
style="width:100%"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="批次号">
<el-input v-model="form.name" placeholder="批次号"/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="总数">
<el-input-number v-model="form.count" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="抽检数">
<el-input-number v-model="form.count" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-table :data="form.ftestitems" border placeholder="暂无数据">
<el-table-column prop="testitem" label="抽检编号" min-width="100" align="center">
<template #default="scope">
<span>{{ scope.row.testName }}</span>
</template>
</el-table-column>
<el-table-column label="检验记录" align="center">
<el-table-column prop="test_val" label="长度/mm" min-width="120" align="center">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="直径/mm" min-width="120" align="center">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="椭圆度/mm" min-width="120" align="center">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="锥度/mm" min-width="120" align="center">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="结石、沙石、黑点" min-width="120" align="center">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="条纹" min-width="120" align="center">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="气泡" min-width="120" align="center">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="test_val" label="合格判定" min-width="120" align="center">
<template #default="scope">
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
clearable
style="width:100%"
>
<el-option label="是" value="true"/>
<el-option label="否" value="false"/>
</el-select>
</template>
</el-table-column>
</el-table>
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
</el-dialog>
</template>
<script>
export default {
emits: ["success", "closed"],
data() {
return {
loading: false,
form: {
ftestitems:[
// {testitem:'(0.02mm)',test_val:'',check_val:''},
// {testitem:'(0.05mm)',test_val:'',check_val:''},
// {testitem:'(29.0)',test_val:'',check_val:''},
// {testitem:'(455mm)',test_val:'',check_val:''},
],
},
rules: {
belong_dept: [{required: true, message: "请选择所属部门", trigger: "blur"}],
test_date: [{required: true, message: "请选择检验日期", trigger: "blur"}],
test_user: [{required: true, message: "请选择操作人", trigger: "blur"}],
check_user: [{required: true, message: "请选择专检人", trigger: "blur"}],
test_group:[{required: true, message: "请选择检测工序集", trigger: "blur"}],
is_ok: [{required: true, message: "请选择是否合格", trigger: "blur"}],
},
visible: false,
isSaveing: false,
userList:[],
options: [],
processOptions: [],
deptOptions: [],
selectionFilters: [],
setFiltersVisible: false,
belong_dept_options: [],
group: [],
};
},
mounted() {
this.getTextItem();
this.getProcess();
this.getUserList();
this.getDeptOptions();
},
methods: {
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
//
getTextItem(){
let that = this;
that.$API.qm.getTestItem.get({tag:'first',page:0}).then(res=>{
console.log(res)
let ftestitems = [];
res.forEach(item=>{
let obj = {};
obj.testitem = item.id;
obj.testName = item.name;
obj.test_val = 0;
obj.check_val = 0;
ftestitems.push(obj)
})
console.log(ftestitems)
that.form.ftestitems = ftestitems;
})
},
//
getDeptOptions() {
this.$API.system.dept.list.req({ page: 0, type__in: 'dept' }).then((res) => {
this.deptOptions = [];
res.forEach(item=>{
if(item.parent=='3423856735881117696'){
this.deptOptions.push(item)
}
})
});
},
//
getUserList(){
let that = this;
this.$API.system.user.list.req({page_size:20,page:1}).then(res=>{
that.userList = res.results;
});
},
getProcess(){
let that = this;
this.$API.mtm.process.list.req({page:0}).then(res=>{
that.processOptions = res;
})
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
try {
var res;
this.form.test_group = this.form.test_group.join(',')
if (this.mode == "add") {
res = await this.$API.qm.ftest.create.req(this.form);
} else if (this.mode == "edit") {
res = await this.$API.qm.ftest.update.req(this.form.id,this.form);
}
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
} catch (err) {
//
this.isSaveing = false;
return err;
}
}
});
},
//
setData(data) {
Object.assign(this.form, data);
this.form.test_group = this.form.split(',')
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style>
</style>

View File

@ -38,7 +38,7 @@
<el-header>
<div class="right-panel">
<h2>采购统计</h2>
<el-select v-model="product" clearable @change="productChange">
<el-select v-model="material_id" clearable @change="materialChange">
<el-option v-for="item in inmOption"
:key="item.id"
:label="item.name"
@ -229,6 +229,7 @@
console.log(value)
this.queryDate = '';
},
materialChange(){},
//
getInmOption(){
let that = this;
@ -238,27 +239,23 @@
that.$API.mtm.material.list.req( obj).then((res) => {
that.inmOption = res;
console.log('inmOption',res)
that.product = res[0].id;
that.materialIn = res[0].id;
that.getInmData();
})
},
//
getInmData(){
let that = this;
let obj = {};
obj.mio__state = 20;
obj.mio__type = 'pur_in';
obj.material = that.product;
obj.mio__inout_date__gte = this.start_date;
obj.mio__inout_date__lte = this.end_date;
obj.page=0;
that.$API.inm.mioitem.list.req( obj).then((res) => {
let exec = that.queryType=='月'?'saleOutWeek':'saleOutMonth';
let obj = {
query: { start_date: that.start_date, end_date: that.end_date, mio_type: "pur_in",material_id:that.materialIn },
};
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
debugger;
console.log('getInmData',res);
res.forEach(item => {
});
})
},
//
@ -269,12 +266,25 @@
that.$API.inm.mioitem.list.req( obj).then((res) => {
that.inmOption = res;
console.log('inmOption',res)
that.product = res[0].id;
that.materialOut = res[0].id;
that.getOutData();
})
},
//
getOutData(){},
getOutData(){
let that = this;
let exec = that.queryType=='月'?'saleOutWeek':'saleOutMonth';
let obj = {
query: { start_date: that.start_date, end_date: that.end_date, mio_type: "sale_out",material_id:that.materialOut },
};
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
debugger;
console.log('getInmData',res);
res.forEach(item => {
});
})
},
handleQuery(){
let that = this;
if(this.queryType=='月'){

View File

@ -226,7 +226,7 @@
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="断裂"
placeholder=""
@change="countNotOkSun"
>
</el-input-number>
@ -235,6 +235,21 @@
</el-row>
<!-- <el-row v-if="material_name=='光纤预制棒'"> -->
<el-row v-if="material_name.indexOf('棒')>-1">
<el-col :md="12" :sm="24">
<el-form-item label="断裂">
<el-input-number
v-model="form.count_n_dl"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="断裂"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="气泡">
<el-input-number
@ -468,16 +483,29 @@ export default {
count_use: 0,
count_notok: 0,
handle_date:'',
count_n_zw:0,
count_n_tw:0,
count_n_qp:0,
count_n_wq:0,
count_n_dl:0,
count_n_pb:0,
count_n_dxt:0,
count_n_js:0,
count_n_qx:0,
count_n_qt:0,
//
count_n_hs:0,//
count_n_cs:0,//
count_n_zz:0,//
count_n_tw:0,//
count_n_zdd:0,//
count_n_d:0,//
//
count_n_dl:0,//
count_n_qp:0,//
count_n_bl:0,//
count_n_hw:0,//
count_n_yp:0,//
count_n_bp:0,//
count_n_sc:0,//
//
count_n_qx:0,//线
count_n_js:0,//
count_n_tydd:0,//
count_n_sw:0,//
count_n_bhpcd:0,//
count_n_w:0,//
handle_user:''
},
mlogb: [],
@ -575,16 +603,26 @@ export default {
},
countNotOkSun() {
this.form.count_notok =
Number(this.form.count_n_zw) +
Number(this.form.count_n_hs) +
Number(this.form.count_n_cs) +
Number(this.form.count_n_zz) +
Number(this.form.count_n_tw) +
Number(this.form.count_n_qp) +
Number(this.form.count_n_wq) +
Number(this.form.count_n_zdd) +
Number(this.form.count_n_d) +
Number(this.form.count_n_dl) +
Number(this.form.count_n_pb) +
Number(this.form.count_n_dxt) +
Number(this.form.count_n_js) +
Number(this.form.count_n_qp) +
Number(this.form.count_n_bl) +
Number(this.form.count_n_hw)+
Number(this.form.count_n_yp)+
Number(this.form.count_n_bp)+
Number(this.form.count_n_sc)+
Number(this.form.count_n_qx)+
Number(this.form.count_n_qt);
Number(this.form.count_n_js)+
Number(this.form.count_n_tydd)+
Number(this.form.count_n_sw)+
Number(this.form.count_n_bhpcd)+
Number(this.form.count_n_w)
;
},
//
submit() {

View File

@ -51,6 +51,7 @@
<!-- -->
<!-- <template v-if="currentMtask.material_out_.name=='光纤预制棒'"> -->
<template v-if="material_name.indexOf('棒')>-1">
<el-table-column prop="count_n_dl" label="断裂" />
<el-table-column prop="count_n_qp" label="气泡"/>
<el-table-column prop="count_n_bl" label="不亮" />
<el-table-column prop="count_n_hw" label="横纹" />