fix:玻纤原料入库和入库检验调整
This commit is contained in:
parent
e8cf10b2d4
commit
1674cb7d95
|
|
@ -750,57 +750,165 @@
|
||||||
@closed="$emit('closed')"
|
@closed="$emit('closed')"
|
||||||
>
|
>
|
||||||
<el-container v-loading="loading">
|
<el-container v-loading="loading">
|
||||||
<el-main style="padding: 0 20px 20px 20px">
|
<el-header>
|
||||||
<el-table :data="mioitemwList" border>
|
<el-form
|
||||||
|
ref="dialogForm"
|
||||||
|
:model="formbw"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="80px"
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :md="12" :sm="12">
|
||||||
|
<el-form-item label="检验员" prop="test_user">
|
||||||
|
<el-select
|
||||||
|
v-model="formbw.test_user"
|
||||||
|
placeholder="检验员"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
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-col :md="12" :sm="12">
|
||||||
|
<el-form-item label="检验时间" prop="test_date">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formbw.test_date"
|
||||||
|
type="date"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-header>
|
||||||
|
<el-main style="padding: 0 20px 20px 20px" id="mioitemwMain">
|
||||||
|
<scTable :tableHeight="tableHeight" :data="mioitemwList" border hideDo hidePagination>
|
||||||
<el-table-column label="物料编号" prop="number">
|
<el-table-column label="物料编号" prop="number">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" fixed="right" width="130">
|
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button @click="changeCheckItem(scope.row)" type="text">检验</el-button>
|
<el-input-number
|
||||||
<el-button v-if="scope.row.wpr" @click="changeCheckRecord(scope.row)" type="text">检验记录</el-button>
|
v-if="item.testitem_field_type=='input-number'"
|
||||||
|
v-model="scope.row[item.testitem_name]"
|
||||||
|
:min="0"
|
||||||
|
:disabled="!scope.row.isEdit"
|
||||||
|
class="width-100"
|
||||||
|
controls-position="right"
|
||||||
|
@change="defectCountSun(scope.row)"
|
||||||
|
>
|
||||||
|
</el-input-number>
|
||||||
|
<el-input-number
|
||||||
|
v-if="item.testitem_field_type=='input-int'"
|
||||||
|
v-model="scope.row[item.testitem_name]"
|
||||||
|
:min="0"
|
||||||
|
:disabled="!scope.row.isEdit"
|
||||||
|
class="width-100"
|
||||||
|
controls-position="right"
|
||||||
|
@change="defectCountSun(scope.row)"
|
||||||
|
>
|
||||||
|
</el-input-number>
|
||||||
|
<el-input
|
||||||
|
v-if="item.testitem_field_type=='input-text'"
|
||||||
|
v-model="scope.row[item.testitem_name]"
|
||||||
|
class="width-100"
|
||||||
|
:disabled="!scope.row.isEdit"
|
||||||
|
@change="defectCountSun(scope.row)"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
<el-select
|
||||||
|
v-if="item.testitem_field_type=='select-text'"
|
||||||
|
v-model="scope.row[item.testitem_name]"
|
||||||
|
clearable
|
||||||
|
class="width-100"
|
||||||
|
:disabled="!scope.row.isEdit"
|
||||||
|
@change="defectCountSun(scope.row)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item0 in item.testitem_choices"
|
||||||
|
:key="item0"
|
||||||
|
:label="item0"
|
||||||
|
:value="item0"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-select
|
||||||
|
v-if="item.testitem_field_type=='selects-text'"
|
||||||
|
v-model="scope.row[item.testitem_name]"
|
||||||
|
clearable
|
||||||
|
multiple
|
||||||
|
class="width-100"
|
||||||
|
:disabled="!scope.row.isEdit"
|
||||||
|
@change="defectCountSun(scope.row)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item1 in item.testitem_choices"
|
||||||
|
:key="item1"
|
||||||
|
:label="item1"
|
||||||
|
:value="item1"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
<el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="120px">
|
||||||
<scTable v-if="checkRecordShow" :data="recordList" row-key="id" height="300px" stripe>
|
|
||||||
<el-table-column type="index" width="50" />
|
|
||||||
<el-table-column label="检验日期" prop="test_date"></el-table-column>
|
|
||||||
<el-table-column label="检验人" prop="test_user_name"></el-table-column>
|
|
||||||
<el-table-column label="是否合格" prop="is_ok">
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag v-if="scope.row.is_ok" type="success">合格</el-tag>
|
<el-switch
|
||||||
<el-tag v-else type="warning">不合格</el-tag>
|
:disabled="!scope.row.isEdit"
|
||||||
|
v-model="scope.row[item.defect_name]"
|
||||||
|
style="--el-switch-on-color: red"
|
||||||
|
@change="switchChange(scope.row, item)"
|
||||||
|
></el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" fixed="right" width="80">
|
<el-table-column prop="note" label="备注" width="80px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button @click="checkFormDetail(scope.row)" type="text">查看</el-button>
|
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
|
||||||
|
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" width="90">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link
|
||||||
|
v-if="scope.row.isEdit"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="formTableSave(scope.row)"
|
||||||
|
>保存</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="scope.row.isEdit"
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
style="margin-left: 5px;"
|
||||||
|
@click="formTableCancel(scope.row)"
|
||||||
|
>取消</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
v-else
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="formTableEdit(scope.row)"
|
||||||
|
>检验</el-link
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</scTable>
|
</scTable>
|
||||||
</el-main>
|
</el-main>
|
||||||
<!-- <el-footer v-if="mode == 'add'">
|
|
||||||
<el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
|
|
||||||
<el-button @click="visibleDrawer = false">取消</el-button>
|
|
||||||
</el-footer> -->
|
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
<checkform-dialog
|
|
||||||
v-if="checkShow"
|
|
||||||
ref="checkFormDialog"
|
|
||||||
:material="objitem.material"
|
|
||||||
:mioitemw="mioitemw"
|
|
||||||
@success="checkFormSuccess"
|
|
||||||
@closed="checkShow= false"
|
|
||||||
>
|
|
||||||
</checkform-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import checkformDialog from "./mioitemCheckForm.vue";
|
|
||||||
export default {
|
export default {
|
||||||
emits: ["success", "closed"],
|
emits: ["success", "closed"],
|
||||||
components: {
|
|
||||||
checkformDialog
|
|
||||||
},
|
|
||||||
props: {
|
props: {
|
||||||
mioitemId: { type: String, default: "" },
|
mioitemId: { type: String, default: "" },
|
||||||
type: { type: String, default: "" },
|
type: { type: String, default: "" },
|
||||||
|
|
@ -809,6 +917,7 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
tableHeight:500,
|
||||||
tableData:[],
|
tableData:[],
|
||||||
loading: false,
|
loading: false,
|
||||||
form: {
|
form: {
|
||||||
|
|
@ -839,23 +948,18 @@ export default {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
formbw:{
|
formbw:{
|
||||||
number:'',
|
|
||||||
note:'',
|
|
||||||
mioitem:'',
|
|
||||||
test_date:'',
|
test_date:'',
|
||||||
test_user:'',
|
test_user:'',
|
||||||
},
|
},
|
||||||
project_code: null,
|
project_code: null,
|
||||||
mioItem: {},
|
mioItem: {},
|
||||||
weight_kgs: [{ value: 0 }],
|
weight_kgs: [{ value: 0 }],
|
||||||
checkShow:false,
|
|
||||||
checkShowsss:false,
|
|
||||||
visible: false,
|
visible: false,
|
||||||
visibleDrawer:false,
|
visibleDrawer:false,
|
||||||
isSaveing: false,
|
isSaveing: false,
|
||||||
checkRecordShow:false,
|
|
||||||
recordList:[],
|
|
||||||
userList: [],
|
userList: [],
|
||||||
|
qct_defects:[],
|
||||||
|
qct_testitems:[],
|
||||||
processOptions: [],
|
processOptions: [],
|
||||||
deptOptions: [],
|
deptOptions: [],
|
||||||
selectionFilters: [],
|
selectionFilters: [],
|
||||||
|
|
@ -871,11 +975,13 @@ export default {
|
||||||
let that = this;
|
let that = this;
|
||||||
let config_base = that.$TOOL.data.get("BASE_INFO").base;
|
let config_base = that.$TOOL.data.get("BASE_INFO").base;
|
||||||
that.project_code = config_base.base_code;
|
that.project_code = config_base.base_code;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.tableHeight = document.getElementById('mioitemwMain').clientHeight-20;
|
||||||
|
},500)
|
||||||
|
|
||||||
that.getUserList();
|
that.getUserList();
|
||||||
if(that.project_code=='bxerp'){
|
if(that.project_code=='bxerp'){
|
||||||
that.mioitemwId = that.objitem.mioitemw[0].id;
|
that.mioitemwId = that.objitem.mioitemw[0].id;
|
||||||
that.formbw.number = that.objitem.mioitemw[0].number;
|
|
||||||
that.formbw.mioitem = that.objitem.mioitemw[0].mioitem;
|
|
||||||
this.getMioitemw();
|
this.getMioitemw();
|
||||||
}else{
|
}else{
|
||||||
if (that.type == "pur_in") {
|
if (that.type == "pur_in") {
|
||||||
|
|
@ -931,49 +1037,166 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
qct_testitems: {
|
||||||
|
handler() {
|
||||||
|
// 初始化表单字段,确保每个字段都有默认值
|
||||||
|
this.qct_testitems.forEach(item => {
|
||||||
|
if (!(item.testitem_name in this.form)) {
|
||||||
|
this.form[item.testitem_name] = ''
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
},
|
||||||
|
qct_defects: {
|
||||||
|
handler() {
|
||||||
|
this.qct_defects.forEach(item => {
|
||||||
|
if (!(item.defect_name in this.form)) {
|
||||||
|
this.form[item.defect_name] = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//显示
|
//显示
|
||||||
open(mode = "add") {
|
open(mode = "add") {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
let config_base = this.$TOOL.data.get("BASE_INFO").base.base_code;
|
let config_base = this.$TOOL.data.get("BASE_INFO").base.base_code;
|
||||||
if(config_base=='bxerp'){
|
if(config_base=='bxerp'){
|
||||||
|
this.getQctDetail();
|
||||||
this.visibleDrawer = true;
|
this.visibleDrawer = true;
|
||||||
}else{
|
}else{
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
changeCheckItem(row){
|
getMaterialItem(){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.mioitemw = row;
|
that.$API.mtm.material.item.req(that.objitem.material).then(()=>{
|
||||||
that.checkShow = true;
|
|
||||||
console.log("row",row);
|
|
||||||
console.log("checkFormDialog");
|
|
||||||
that.$nextTick(() => {
|
|
||||||
that.$refs.checkFormDialog.open("add");
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
checkFormDetail(row){
|
getdefects(){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.mioitemw = row;
|
if(that.qct!==null&&that.qct!==''){
|
||||||
that.checkShow = true;
|
that.$API.qm.qct.item.req(that.qct).then((res) => {
|
||||||
that.$nextTick(() => {
|
that.qct_defects = [];
|
||||||
that.$refs.checkFormDialog.open("show").setData(row);
|
res.qct_defects.forEach((item) => {
|
||||||
})
|
that.addTemplate[item.defect_name] = false;
|
||||||
|
})
|
||||||
|
that.qct_defects = res.qct_defects;
|
||||||
|
that.qct_testitems = [];
|
||||||
|
res.qct_testitems.forEach((item2) => {
|
||||||
|
let obj2 = Object.assign({}, item2);
|
||||||
|
obj2.value = '';
|
||||||
|
obj2.addto_wpr = item2.addto_wpr;
|
||||||
|
if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
|
||||||
|
obj2.value = 0;
|
||||||
|
that.addTemplate[item2.testitem_name] = 0;
|
||||||
|
}
|
||||||
|
if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){
|
||||||
|
let str = obj2.testitem_choices.replace(/'/g, '"');
|
||||||
|
let arr = JSON.parse(str);
|
||||||
|
obj2.testitem_choices = arr;
|
||||||
|
that.addTemplate[item2.testitem_name] = '';
|
||||||
|
}
|
||||||
|
that.qct_testitems.push(obj2);
|
||||||
|
})
|
||||||
|
that.getList();
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
that.getList();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
changeCheckRecord(row){
|
//根据物料关联的检测表获取检测项和不合格项
|
||||||
|
getQctDetail(){
|
||||||
let that = this;
|
let that = this;
|
||||||
this.mioitemwWpr = row.wpr;
|
that.$API.qm.qct.list.req({ qctmat__material: that.objitem.material,page:0 }).then((res) => {
|
||||||
that.$API.qm.ftest.list.req({ mioitemw_ftest__wpr: row.wpr,page:0 }).then((res) => {
|
if(res.length>0){
|
||||||
that.recordList = res;
|
that.qctId = res[0].id;
|
||||||
})
|
that.$API.qm.qct.item.req(that.qctId).then((res0) => {
|
||||||
that.checkShow = false;
|
//这里可以得到testitem和defectitem
|
||||||
that.checkRecordShow = true;
|
that.qct_defects = [];
|
||||||
|
that.qct_testitems = [];
|
||||||
|
if(res0.qct_defects.length>0){
|
||||||
|
res0.qct_defects.forEach((item1) => {
|
||||||
|
let obj = Object.assign({}, item1);
|
||||||
|
obj.value = '';
|
||||||
|
that.qct_defects.push(obj);
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
that.qct_defects = [];
|
||||||
|
}
|
||||||
|
if(res0.qct_testitems.length>0){
|
||||||
|
res0.qct_testitems.forEach((item2) => {
|
||||||
|
let obj2 = Object.assign({}, item2);
|
||||||
|
obj2.value = '';
|
||||||
|
if(obj2.testitem_field_type=='select-text'||obj2.testitem_field_type=='selects-text'){
|
||||||
|
let str = obj2.testitem_choices.replace(/'/g, '"');
|
||||||
|
let arr = JSON.parse(str);
|
||||||
|
obj2.testitem_choices = arr;
|
||||||
|
}
|
||||||
|
that.qct_testitems.push(obj2);
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
that.qct_testitems = [];
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
defectCountSun(row){
|
||||||
|
let that = this;
|
||||||
|
that.qct_defects.forEach(item => {
|
||||||
|
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
|
||||||
|
let str = item.rule_expression.replace(/`/g, '');
|
||||||
|
str = str.replace(/\${(.*?)}/g, 'row.\$1');
|
||||||
|
let judge = eval(str);
|
||||||
|
row[item.defect_name] = judge;
|
||||||
|
}else{
|
||||||
|
row[item.defect_name] = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
getMioitemw(){
|
getMioitemw(){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$API.inm.mioitemw.list.req({ mioitem: that.mioitemId,page:0 }).then((res) => {
|
that.$API.inm.mioitemw.list.req({ mioitem: that.mioitemId,page:0 }).then((res) => {
|
||||||
that.mioitemwList = res;
|
that.mioitemwList = res;
|
||||||
|
if(res.length>0){
|
||||||
|
that.mioitemwList = [];
|
||||||
|
res.forEach((item) => {
|
||||||
|
let obj = {};
|
||||||
|
obj = Object.assign({},item);
|
||||||
|
obj.isEdit = false;
|
||||||
|
if(item.ftest!=null){
|
||||||
|
if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){
|
||||||
|
item.ftest.ftestdefects.forEach((item1) => {
|
||||||
|
obj[item1.defect_name] = item1.has;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(item.ftest.ftestitems!==undefined&&item.ftest.ftestitems!==''&&item.ftest.ftestitems!==null&&item.ftest.ftestitems.length>0){
|
||||||
|
item.ftest.ftestitems.forEach((item2) => {
|
||||||
|
obj[item2.testitem_name] = item2.test_val_json;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
that.qct_defects.forEach((item1) => {
|
||||||
|
obj[item1.defect_name] = false;
|
||||||
|
})
|
||||||
|
that.qct_testitems.forEach((item2) => {
|
||||||
|
if(item2.testitem_field_type=='input-number'||item.testitem_field_type=='input-int'){
|
||||||
|
obj[item2.testitem_name] = 0;
|
||||||
|
}else{
|
||||||
|
obj[item2.testitem_name] = "";
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.mioitemwList.push(obj);
|
||||||
|
})
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取员工
|
//获取员工
|
||||||
|
|
@ -1011,45 +1234,45 @@ export default {
|
||||||
that.type == "other_in"
|
that.type == "other_in"
|
||||||
) {
|
) {
|
||||||
this.form.count_notok =
|
this.form.count_notok =
|
||||||
this.form.count_n_zw +
|
this.form.count_n_zw +
|
||||||
this.form.count_n_tw +
|
this.form.count_n_tw +
|
||||||
this.form.count_n_qp +
|
this.form.count_n_qp +
|
||||||
this.form.count_n_wq +
|
this.form.count_n_wq +
|
||||||
this.form.count_n_dl +
|
this.form.count_n_dl +
|
||||||
this.form.count_n_pb +
|
this.form.count_n_pb +
|
||||||
this.form.count_n_dxt +
|
this.form.count_n_dxt +
|
||||||
this.form.count_n_js +
|
this.form.count_n_js +
|
||||||
this.form.count_n_qx +
|
this.form.count_n_qx +
|
||||||
this.form.count_n_hs +
|
this.form.count_n_hs +
|
||||||
this.form.count_n_ysq +
|
this.form.count_n_ysq +
|
||||||
this.form.count_n_zz +
|
this.form.count_n_zz +
|
||||||
this.form.count_n_b +
|
this.form.count_n_b +
|
||||||
this.form.count_n_qt;
|
this.form.count_n_qt;
|
||||||
}
|
}
|
||||||
if (that.type == "do_in" && that.cate == "good") {
|
if (that.type == "do_in" && that.cate == "good") {
|
||||||
this.form.count_notok =
|
this.form.count_notok =
|
||||||
this.form.count_n_hs +
|
this.form.count_n_hs +
|
||||||
this.form.count_n_cs +
|
this.form.count_n_cs +
|
||||||
this.form.count_n_zz +
|
this.form.count_n_zz +
|
||||||
this.form.count_n_tw +
|
this.form.count_n_tw +
|
||||||
this.form.count_n_d +
|
this.form.count_n_d +
|
||||||
this.form.count_n_zdd +
|
this.form.count_n_zdd +
|
||||||
this.form.count_n_zw +
|
this.form.count_n_zw +
|
||||||
this.form.count_n_dl +
|
this.form.count_n_dl +
|
||||||
//棒
|
//棒
|
||||||
this.form.count_n_qp +
|
this.form.count_n_qp +
|
||||||
this.form.count_n_bl +
|
this.form.count_n_bl +
|
||||||
this.form.count_n_hw +
|
this.form.count_n_hw +
|
||||||
this.form.count_n_yp +
|
this.form.count_n_yp +
|
||||||
this.form.count_n_bp +
|
this.form.count_n_bp +
|
||||||
this.form.count_n_sc +
|
this.form.count_n_sc +
|
||||||
//管
|
//管
|
||||||
this.form.count_n_qx +
|
this.form.count_n_qx +
|
||||||
this.form.count_n_js +
|
this.form.count_n_js +
|
||||||
this.form.count_n_tydd +
|
this.form.count_n_tydd +
|
||||||
this.form.count_n_sw +
|
this.form.count_n_sw +
|
||||||
this.form.count_n_bhpcd +
|
this.form.count_n_bhpcd +
|
||||||
this.form.count_n_wq;
|
this.form.count_n_wq;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//提交
|
//提交
|
||||||
|
|
@ -1060,45 +1283,45 @@ export default {
|
||||||
that.type == "other_in"
|
that.type == "other_in"
|
||||||
) {
|
) {
|
||||||
this.form.count_notok =
|
this.form.count_notok =
|
||||||
this.form.count_n_zw +
|
this.form.count_n_zw +
|
||||||
this.form.count_n_tw +
|
this.form.count_n_tw +
|
||||||
this.form.count_n_qp +
|
this.form.count_n_qp +
|
||||||
this.form.count_n_wq +
|
this.form.count_n_wq +
|
||||||
this.form.count_n_dl +
|
this.form.count_n_dl +
|
||||||
this.form.count_n_pb +
|
this.form.count_n_pb +
|
||||||
this.form.count_n_dxt +
|
this.form.count_n_dxt +
|
||||||
this.form.count_n_js +
|
this.form.count_n_js +
|
||||||
this.form.count_n_qx +
|
this.form.count_n_qx +
|
||||||
this.form.count_n_hs +
|
this.form.count_n_hs +
|
||||||
this.form.count_n_ysq +
|
this.form.count_n_ysq +
|
||||||
this.form.count_n_zz +
|
this.form.count_n_zz +
|
||||||
this.form.count_n_b +
|
this.form.count_n_b +
|
||||||
this.form.count_n_qt;
|
this.form.count_n_qt;
|
||||||
}
|
}
|
||||||
if (that.type == "do_in" && that.cate == "good") {
|
if (that.type == "do_in" && that.cate == "good") {
|
||||||
this.form.count_notok =
|
this.form.count_notok =
|
||||||
this.form.count_n_hs +
|
this.form.count_n_hs +
|
||||||
this.form.count_n_cs +
|
this.form.count_n_cs +
|
||||||
this.form.count_n_zz +
|
this.form.count_n_zz +
|
||||||
this.form.count_n_tw +
|
this.form.count_n_tw +
|
||||||
this.form.count_n_d +
|
this.form.count_n_d +
|
||||||
this.form.count_n_zdd +
|
this.form.count_n_zdd +
|
||||||
this.form.count_n_zw +
|
this.form.count_n_zw +
|
||||||
this.form.count_n_dl +
|
this.form.count_n_dl +
|
||||||
//棒
|
//棒
|
||||||
this.form.count_n_qp +
|
this.form.count_n_qp +
|
||||||
this.form.count_n_bl +
|
this.form.count_n_bl +
|
||||||
this.form.count_n_hw +
|
this.form.count_n_hw +
|
||||||
this.form.count_n_yp +
|
this.form.count_n_yp +
|
||||||
this.form.count_n_bp +
|
this.form.count_n_bp +
|
||||||
this.form.count_n_sc +
|
this.form.count_n_sc +
|
||||||
//管
|
//管
|
||||||
this.form.count_n_qx +
|
this.form.count_n_qx +
|
||||||
this.form.count_n_js +
|
this.form.count_n_js +
|
||||||
this.form.count_n_tydd +
|
this.form.count_n_tydd +
|
||||||
this.form.count_n_sw +
|
this.form.count_n_sw +
|
||||||
this.form.count_n_bhpcd +
|
this.form.count_n_bhpcd +
|
||||||
this.form.count_n_wq;
|
this.form.count_n_wq;
|
||||||
}
|
}
|
||||||
that.$refs.dialogForm.validate(async (valid) => {
|
that.$refs.dialogForm.validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
@ -1157,12 +1380,84 @@ export default {
|
||||||
(sum / data.weight_kgs.length) * data.count_bag;
|
(sum / data.weight_kgs.length) * data.count_bag;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkFormSuccess(){},
|
|
||||||
//设置过滤项
|
//设置过滤项
|
||||||
setFilters(filters) {
|
setFilters(filters) {
|
||||||
this.selectionFilters = filters;
|
this.selectionFilters = filters;
|
||||||
this.setFiltersVisible = true;
|
this.setFiltersVisible = true;
|
||||||
},
|
},
|
||||||
|
//添加
|
||||||
|
formTableSave(row) {
|
||||||
|
let that = this;
|
||||||
|
this.$refs.dialogForm.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
let ftestdefects = [],ftestitems = [];
|
||||||
|
let obj = {};
|
||||||
|
if(row.ftest!==null){
|
||||||
|
ftestdefects = row.ftest.ftestdefects;
|
||||||
|
ftestdefects.forEach((item) => {
|
||||||
|
item.has = row[item.defect_name]?row[item.defect_name]:false;
|
||||||
|
})
|
||||||
|
ftestitems = row.ftest.ftestitems;
|
||||||
|
ftestitems.forEach((item1) => {
|
||||||
|
item1.test_val_json = row[item1.testitem_name]?row[item1.testitem_name]:"";
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
|
||||||
|
that.qct_testitems.forEach((item) => {
|
||||||
|
let obj0 = {};
|
||||||
|
obj0.testitem = item.testitem;
|
||||||
|
obj0.test_user = row.test_user;
|
||||||
|
obj0.testitem_name = item.testitem_name;
|
||||||
|
obj0.test_val_json = row[item.testitem_name]?row[item.testitem_name]:"";
|
||||||
|
ftestitems.push(obj0);
|
||||||
|
})
|
||||||
|
that.qct_defects.forEach((item1) => {
|
||||||
|
let obj1 = {};
|
||||||
|
obj1.defect = item1.defect;
|
||||||
|
obj1.test_user = row.test_user;
|
||||||
|
obj1.defect_name = item1.defect_name;
|
||||||
|
obj1.has = row[item1.defect_name]?row[item1.defect_name]:false;
|
||||||
|
ftestdefects.push(obj1);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
obj.note = row.note;
|
||||||
|
obj.number = row.number;
|
||||||
|
obj.mioitem = row.mioitem;
|
||||||
|
obj.ftest = {};
|
||||||
|
obj.ftest.qct = row.ftest?row.ftest.qct:that.qctId;
|
||||||
|
obj.ftest.test_user = that.formbw.test_user;
|
||||||
|
obj.ftest.test_date = that.formbw.test_date;
|
||||||
|
obj.ftest.ftestitems = ftestitems;
|
||||||
|
obj.ftest.ftestdefects = ftestdefects;
|
||||||
|
that.isSaveing = true;
|
||||||
|
console.log('row.id',row.id);
|
||||||
|
that.$API.inm.mioitemw.update.req(row.id,obj).then((res) => {
|
||||||
|
that.isSaveing = false;
|
||||||
|
that.getMioitemw();
|
||||||
|
that.$message.success("操作成功");
|
||||||
|
}).catch((err) => {
|
||||||
|
that.isSaveing = false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
formTableCancel(row){
|
||||||
|
let that = this;
|
||||||
|
that.mioitemwList.forEach((item, index) => {
|
||||||
|
if (item.id == row.id) {
|
||||||
|
that.mioitemwList[index].isEdit = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
formTableEdit(row) {
|
||||||
|
let that = this;
|
||||||
|
that.mioitemwList.forEach((item, index) => {
|
||||||
|
if (item.id == row.id) {
|
||||||
|
that.mioitemwList[index].isEdit = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -12,119 +12,144 @@
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
label-width="120px"
|
label-width="120px"
|
||||||
>
|
>
|
||||||
<el-form-item label="物料" prop="material">
|
<el-row>
|
||||||
<el-select
|
<el-col :md="12" :sm="24">
|
||||||
v-model="selectMaterial"
|
<el-form-item label="物料" prop="material">
|
||||||
value-key="id"
|
<el-select
|
||||||
clearable
|
v-model="selectMaterial"
|
||||||
filterable
|
value-key="id"
|
||||||
style="width: 100%"
|
clearable
|
||||||
@change="selectMaterialChange"
|
filterable
|
||||||
>
|
style="width: 100%"
|
||||||
<el-option
|
@change="selectMaterialChange"
|
||||||
v-for="item in materialOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.full_name"
|
|
||||||
:value="item"
|
|
||||||
>
|
|
||||||
<span style="float: left">{{ item.full_name }}</span>
|
|
||||||
<span
|
|
||||||
style="
|
|
||||||
float: right;
|
|
||||||
color: '#E6A23C';
|
|
||||||
font-size: 13px;
|
|
||||||
"
|
|
||||||
v-if="item.is_hidden"
|
|
||||||
>隐</span
|
|
||||||
>
|
>
|
||||||
</el-option>
|
<el-option
|
||||||
</el-select>
|
v-for="item in materialOptions"
|
||||||
</el-form-item>
|
:key="item.id"
|
||||||
<el-form-item label="批次号" prop="batch">
|
:label="item.full_name"
|
||||||
<!-- <el-input v-model="form.batch" placeholder="手动输入批次号" :disabled="inputBatchDisable" /> -->
|
:value="item"
|
||||||
<el-select
|
>
|
||||||
v-model="form.batch"
|
<span style="float: left">{{ item.full_name }}</span>
|
||||||
filterable
|
<span
|
||||||
allow-create
|
style="
|
||||||
clearable
|
float: right;
|
||||||
style="width: 100%"
|
color: '#E6A23C';
|
||||||
:disabled="inputBatchDisable"
|
font-size: 13px;
|
||||||
>
|
"
|
||||||
<el-option
|
v-if="item.is_hidden"
|
||||||
v-for="item in wbatchOptions"
|
>隐</span
|
||||||
:key="item.id"
|
>
|
||||||
:value="item.batch"
|
</el-option>
|
||||||
>
|
</el-select>
|
||||||
<span style="float: left">{{ item.batch }}</span>
|
</el-form-item>
|
||||||
<span
|
</el-col>
|
||||||
style="
|
<el-col :md="12" :sm="24">
|
||||||
float: right;
|
<el-form-item label="批次号" prop="batch">
|
||||||
color: var(--el-text-color-secondary);
|
<!-- <el-input v-model="form.batch" placeholder="手动输入批次号" :disabled="inputBatchDisable" /> -->
|
||||||
font-size: 13px;
|
<el-select
|
||||||
"
|
v-model="form.batch"
|
||||||
>{{ item.count }}</span
|
filterable
|
||||||
|
allow-create
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
:disabled="inputBatchDisable"
|
||||||
>
|
>
|
||||||
</el-option>
|
<el-option
|
||||||
</el-select>
|
v-for="item in wbatchOptions"
|
||||||
</el-form-item>
|
:key="item.id"
|
||||||
<el-form-item label="仓库已有批次">
|
:value="item.batch"
|
||||||
<el-select
|
>
|
||||||
v-model="selectBatch"
|
<span style="float: left">{{ item.batch }}</span>
|
||||||
value-key="id"
|
<span
|
||||||
clearable
|
style="
|
||||||
style="width: 100%"
|
float: right;
|
||||||
@change="selectBatchChange"
|
color: var(--el-text-color-secondary);
|
||||||
@clear="selectBatchClear"
|
font-size: 13px;
|
||||||
:disabled="selectBatchDisable"
|
"
|
||||||
>
|
>{{ item.count }}</span
|
||||||
<el-option
|
>
|
||||||
v-for="item in batchOptions"
|
</el-option>
|
||||||
:key="item.id"
|
</el-select>
|
||||||
:label="item.batch"
|
</el-form-item>
|
||||||
:value="item"
|
</el-col>
|
||||||
>
|
<el-col :md="12" :sm="24">
|
||||||
<span style="float: left">{{ item.batch }}</span>
|
<el-form-item label="仓库已有批次">
|
||||||
<span
|
<el-select
|
||||||
style="
|
v-model="selectBatch"
|
||||||
float: right;
|
value-key="id"
|
||||||
color: var(--el-text-color-secondary);
|
clearable
|
||||||
font-size: 13px;
|
style="width: 100%"
|
||||||
"
|
@change="selectBatchChange"
|
||||||
>{{ item.count }} -- {{ item.warehouse_name }}</span
|
@clear="selectBatchClear"
|
||||||
|
:disabled="selectBatchDisable"
|
||||||
>
|
>
|
||||||
</el-option>
|
<el-option
|
||||||
</el-select>
|
v-for="item in batchOptions"
|
||||||
</el-form-item>
|
:key="item.id"
|
||||||
<el-form-item label="仓库" prop="warehouse">
|
:label="item.batch"
|
||||||
<el-select
|
:value="item"
|
||||||
v-model="form.warehouse"
|
>
|
||||||
clearable
|
<span style="float: left">{{ item.batch }}</span>
|
||||||
style="width: 100%"
|
<span
|
||||||
:disabled="warehouseDisable"
|
style="
|
||||||
>
|
float: right;
|
||||||
<el-option
|
color: var(--el-text-color-secondary);
|
||||||
v-for="item in warehouseOptions"
|
font-size: 13px;
|
||||||
:key="item.id"
|
"
|
||||||
:label="item.name"
|
>{{ item.count }} -- {{ item.warehouse_name }}</span
|
||||||
:value="item.id"
|
>
|
||||||
></el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="数量" v-if="cate == 'mainso'">
|
</el-col>
|
||||||
<el-input-number
|
<el-col :md="12" :sm="24">
|
||||||
v-model="form.count"
|
<el-form-item label="仓库" prop="warehouse">
|
||||||
:min="1"
|
<el-select
|
||||||
:precision="3"
|
v-model="form.warehouse"
|
||||||
style="width: 100%"
|
clearable
|
||||||
/>
|
style="width: 100%"
|
||||||
</el-form-item>
|
:disabled="warehouseDisable"
|
||||||
<el-form-item label="数量" v-else>
|
>
|
||||||
<el-input-number
|
<el-option
|
||||||
v-model="form.count"
|
v-for="item in warehouseOptions"
|
||||||
:min="1"
|
:key="item.id"
|
||||||
style="width: 100%"
|
:label="item.name"
|
||||||
/>
|
:value="item.id"
|
||||||
</el-form-item>
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24" v-if="cate == 'mainso'">
|
||||||
|
<el-form-item label="数量">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.count"
|
||||||
|
:min="1"
|
||||||
|
:precision="3"
|
||||||
|
style="width: 100%"
|
||||||
|
@change="countChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24" v-else>
|
||||||
|
<el-form-item label="数量">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.count"
|
||||||
|
:min="1"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row v-if="project_code=='bxerp'">
|
||||||
|
<el-col :md="12" :sm="24" v-for="i in form.count" :key="i">
|
||||||
|
<el-form-item :label="'编号'+i">
|
||||||
|
<el-input
|
||||||
|
v-model="mioitems[i-1]"
|
||||||
|
placeholder="请输入编号"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<div v-if="assembShow">
|
<div v-if="assembShow">
|
||||||
<el-row
|
<el-row
|
||||||
v-for="item in components"
|
v-for="item in components"
|
||||||
|
|
@ -242,10 +267,14 @@ export default {
|
||||||
selectBatch: null,
|
selectBatch: null,
|
||||||
components: [],
|
components: [],
|
||||||
wbatchOptions: [],
|
wbatchOptions: [],
|
||||||
|
mioitems:[''],
|
||||||
|
project_code:'',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.getBatchs();
|
let that = this;
|
||||||
|
let config_base = that.$TOOL.data.get("BASE_INFO").base;
|
||||||
|
that.project_code = config_base.base_code;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
|
|
@ -424,6 +453,20 @@ export default {
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
countChange(){
|
||||||
|
if(this.project_code=='bxerp'){
|
||||||
|
if(this.form.count>this.mioitems.length){
|
||||||
|
let count = this.form.count-this.mioitems.length;
|
||||||
|
for(let i=0;i<count;i++){
|
||||||
|
this.mioitems.push('');
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.mioitems.slice(this.form.count);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
//提交
|
//提交
|
||||||
submit() {
|
submit() {
|
||||||
this.$refs.dialogForm.validate(async (valid) => {
|
this.$refs.dialogForm.validate(async (valid) => {
|
||||||
|
|
@ -439,8 +482,18 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let mioitemw = [];
|
||||||
|
if(this.mioitems.length>1){
|
||||||
|
this.mioitems.forEach((item)=>{
|
||||||
|
let obj = {};
|
||||||
|
obj.number= item;
|
||||||
|
mioitemw.push(obj);
|
||||||
|
})
|
||||||
|
this.form.mioitemw = mioitemw;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
var res;
|
var res;
|
||||||
|
console.log(this.form);
|
||||||
if (this.mode == "add") {
|
if (this.mode == "add") {
|
||||||
res = await this.$API.inm.mioitem.create.req(
|
res = await this.$API.inm.mioitem.create.req(
|
||||||
this.form
|
this.form
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue