fix:玻纤原料入库和入库检验调整

This commit is contained in:
shijing 2025-02-21 17:35:51 +08:00
parent e8cf10b2d4
commit 1674cb7d95
2 changed files with 593 additions and 245 deletions

View File

@ -750,57 +750,165 @@
@closed="$emit('closed')"
>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-table :data="mioitemwList" border>
<el-header>
<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>
<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">
<el-button @click="changeCheckItem(scope.row)" type="text">检验</el-button>
<el-button v-if="scope.row.wpr" @click="changeCheckRecord(scope.row)" type="text">检验记录</el-button>
<el-input-number
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>
</el-table-column>
</el-table>
<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">
<el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="120px">
<template #default="scope">
<el-tag v-if="scope.row.is_ok" type="success">合格</el-tag>
<el-tag v-else type="warning">不合格</el-tag>
<el-switch
: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>
</el-table-column>
<el-table-column label="操作" fixed="right" width="80">
<el-table-column prop="note" label="备注" width="80px">
<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>
</el-table-column>
</scTable>
</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-drawer>
<checkform-dialog
v-if="checkShow"
ref="checkFormDialog"
:material="objitem.material"
:mioitemw="mioitemw"
@success="checkFormSuccess"
@closed="checkShow= false"
>
</checkform-dialog>
</template>
<script>
import checkformDialog from "./mioitemCheckForm.vue";
export default {
emits: ["success", "closed"],
components: {
checkformDialog
},
props: {
mioitemId: { type: String, default: "" },
type: { type: String, default: "" },
@ -809,6 +917,7 @@ export default {
},
data() {
return {
tableHeight:500,
tableData:[],
loading: false,
form: {
@ -839,23 +948,18 @@ export default {
],
},
formbw:{
number:'',
note:'',
mioitem:'',
test_date:'',
test_user:'',
},
project_code: null,
mioItem: {},
weight_kgs: [{ value: 0 }],
checkShow:false,
checkShowsss:false,
visible: false,
visibleDrawer:false,
isSaveing: false,
checkRecordShow:false,
recordList:[],
userList: [],
qct_defects:[],
qct_testitems:[],
processOptions: [],
deptOptions: [],
selectionFilters: [],
@ -871,11 +975,13 @@ export default {
let that = this;
let config_base = that.$TOOL.data.get("BASE_INFO").base;
that.project_code = config_base.base_code;
setTimeout(() => {
this.tableHeight = document.getElementById('mioitemwMain').clientHeight-20;
},500)
that.getUserList();
if(that.project_code=='bxerp'){
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();
}else{
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: {
//
open(mode = "add") {
this.mode = mode;
let config_base = this.$TOOL.data.get("BASE_INFO").base.base_code;
if(config_base=='bxerp'){
this.getQctDetail();
this.visibleDrawer = true;
}else{
this.visible = true;
}
return this;
},
changeCheckItem(row){
getMaterialItem(){
let that = this;
that.mioitemw = row;
that.checkShow = true;
console.log("row",row);
console.log("checkFormDialog");
that.$nextTick(() => {
that.$refs.checkFormDialog.open("add");
that.$API.mtm.material.item.req(that.objitem.material).then(()=>{
})
},
checkFormDetail(row){
getdefects(){
let that = this;
that.mioitemw = row;
that.checkShow = true;
that.$nextTick(() => {
that.$refs.checkFormDialog.open("show").setData(row);
})
if(that.qct!==null&&that.qct!==''){
that.$API.qm.qct.item.req(that.qct).then((res) => {
that.qct_defects = [];
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;
this.mioitemwWpr = row.wpr;
that.$API.qm.ftest.list.req({ mioitemw_ftest__wpr: row.wpr,page:0 }).then((res) => {
that.recordList = res;
})
that.checkShow = false;
that.checkRecordShow = true;
that.$API.qm.qct.list.req({ qctmat__material: that.objitem.material,page:0 }).then((res) => {
if(res.length>0){
that.qctId = res[0].id;
that.$API.qm.qct.item.req(that.qctId).then((res0) => {
//testitemdefectitem
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(){
let that = this;
that.$API.inm.mioitemw.list.req({ mioitem: that.mioitemId,page:0 }).then((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"
) {
this.form.count_notok =
this.form.count_n_zw +
this.form.count_n_tw +
this.form.count_n_qp +
this.form.count_n_wq +
this.form.count_n_dl +
this.form.count_n_pb +
this.form.count_n_dxt +
this.form.count_n_js +
this.form.count_n_qx +
this.form.count_n_hs +
this.form.count_n_ysq +
this.form.count_n_zz +
this.form.count_n_b +
this.form.count_n_qt;
this.form.count_n_zw +
this.form.count_n_tw +
this.form.count_n_qp +
this.form.count_n_wq +
this.form.count_n_dl +
this.form.count_n_pb +
this.form.count_n_dxt +
this.form.count_n_js +
this.form.count_n_qx +
this.form.count_n_hs +
this.form.count_n_ysq +
this.form.count_n_zz +
this.form.count_n_b +
this.form.count_n_qt;
}
if (that.type == "do_in" && that.cate == "good") {
this.form.count_notok =
this.form.count_n_hs +
this.form.count_n_cs +
this.form.count_n_zz +
this.form.count_n_tw +
this.form.count_n_d +
this.form.count_n_zdd +
this.form.count_n_zw +
this.form.count_n_dl +
//
this.form.count_n_qp +
this.form.count_n_bl +
this.form.count_n_hw +
this.form.count_n_yp +
this.form.count_n_bp +
this.form.count_n_sc +
//
this.form.count_n_qx +
this.form.count_n_js +
this.form.count_n_tydd +
this.form.count_n_sw +
this.form.count_n_bhpcd +
this.form.count_n_wq;
this.form.count_n_hs +
this.form.count_n_cs +
this.form.count_n_zz +
this.form.count_n_tw +
this.form.count_n_d +
this.form.count_n_zdd +
this.form.count_n_zw +
this.form.count_n_dl +
//
this.form.count_n_qp +
this.form.count_n_bl +
this.form.count_n_hw +
this.form.count_n_yp +
this.form.count_n_bp +
this.form.count_n_sc +
//
this.form.count_n_qx +
this.form.count_n_js +
this.form.count_n_tydd +
this.form.count_n_sw +
this.form.count_n_bhpcd +
this.form.count_n_wq;
}
},
//
@ -1060,45 +1283,45 @@ export default {
that.type == "other_in"
) {
this.form.count_notok =
this.form.count_n_zw +
this.form.count_n_tw +
this.form.count_n_qp +
this.form.count_n_wq +
this.form.count_n_dl +
this.form.count_n_pb +
this.form.count_n_dxt +
this.form.count_n_js +
this.form.count_n_qx +
this.form.count_n_hs +
this.form.count_n_ysq +
this.form.count_n_zz +
this.form.count_n_b +
this.form.count_n_qt;
this.form.count_n_zw +
this.form.count_n_tw +
this.form.count_n_qp +
this.form.count_n_wq +
this.form.count_n_dl +
this.form.count_n_pb +
this.form.count_n_dxt +
this.form.count_n_js +
this.form.count_n_qx +
this.form.count_n_hs +
this.form.count_n_ysq +
this.form.count_n_zz +
this.form.count_n_b +
this.form.count_n_qt;
}
if (that.type == "do_in" && that.cate == "good") {
this.form.count_notok =
this.form.count_n_hs +
this.form.count_n_cs +
this.form.count_n_zz +
this.form.count_n_tw +
this.form.count_n_d +
this.form.count_n_zdd +
this.form.count_n_zw +
this.form.count_n_dl +
//
this.form.count_n_qp +
this.form.count_n_bl +
this.form.count_n_hw +
this.form.count_n_yp +
this.form.count_n_bp +
this.form.count_n_sc +
//
this.form.count_n_qx +
this.form.count_n_js +
this.form.count_n_tydd +
this.form.count_n_sw +
this.form.count_n_bhpcd +
this.form.count_n_wq;
this.form.count_n_hs +
this.form.count_n_cs +
this.form.count_n_zz +
this.form.count_n_tw +
this.form.count_n_d +
this.form.count_n_zdd +
this.form.count_n_zw +
this.form.count_n_dl +
//
this.form.count_n_qp +
this.form.count_n_bl +
this.form.count_n_hw +
this.form.count_n_yp +
this.form.count_n_bp +
this.form.count_n_sc +
//
this.form.count_n_qx +
this.form.count_n_js +
this.form.count_n_tydd +
this.form.count_n_sw +
this.form.count_n_bhpcd +
this.form.count_n_wq;
}
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
@ -1157,12 +1380,84 @@ export default {
(sum / data.weight_kgs.length) * data.count_bag;
}
},
checkFormSuccess(){},
//
setFilters(filters) {
this.selectionFilters = filters;
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>

View File

@ -12,119 +12,144 @@
:rules="rules"
label-width="120px"
>
<el-form-item label="物料" prop="material">
<el-select
v-model="selectMaterial"
value-key="id"
clearable
filterable
style="width: 100%"
@change="selectMaterialChange"
>
<el-option
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-row>
<el-col :md="12" :sm="24">
<el-form-item label="物料" prop="material">
<el-select
v-model="selectMaterial"
value-key="id"
clearable
filterable
style="width: 100%"
@change="selectMaterialChange"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="批次号" prop="batch">
<!-- <el-input v-model="form.batch" placeholder="手动输入批次号" :disabled="inputBatchDisable" /> -->
<el-select
v-model="form.batch"
filterable
allow-create
clearable
style="width: 100%"
:disabled="inputBatchDisable"
>
<el-option
v-for="item in wbatchOptions"
:key="item.id"
:value="item.batch"
>
<span style="float: left">{{ item.batch }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.count }}</span
<el-option
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-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="批次号" prop="batch">
<!-- <el-input v-model="form.batch" placeholder="手动输入批次号" :disabled="inputBatchDisable" /> -->
<el-select
v-model="form.batch"
filterable
allow-create
clearable
style="width: 100%"
:disabled="inputBatchDisable"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库已有批次">
<el-select
v-model="selectBatch"
value-key="id"
clearable
style="width: 100%"
@change="selectBatchChange"
@clear="selectBatchClear"
:disabled="selectBatchDisable"
>
<el-option
v-for="item in batchOptions"
:key="item.id"
:label="item.batch"
:value="item"
>
<span style="float: left">{{ item.batch }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.count }} -- {{ item.warehouse_name }}</span
<el-option
v-for="item in wbatchOptions"
:key="item.id"
:value="item.batch"
>
<span style="float: left">{{ item.batch }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.count }}</span
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="仓库已有批次">
<el-select
v-model="selectBatch"
value-key="id"
clearable
style="width: 100%"
@change="selectBatchChange"
@clear="selectBatchClear"
:disabled="selectBatchDisable"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库" prop="warehouse">
<el-select
v-model="form.warehouse"
clearable
style="width: 100%"
:disabled="warehouseDisable"
>
<el-option
v-for="item in warehouseOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="数量" v-if="cate == 'mainso'">
<el-input-number
v-model="form.count"
:min="1"
:precision="3"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="数量" v-else>
<el-input-number
v-model="form.count"
:min="1"
style="width: 100%"
/>
</el-form-item>
<el-option
v-for="item in batchOptions"
:key="item.id"
:label="item.batch"
:value="item"
>
<span style="float: left">{{ item.batch }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.count }} -- {{ item.warehouse_name }}</span
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="仓库" prop="warehouse">
<el-select
v-model="form.warehouse"
clearable
style="width: 100%"
:disabled="warehouseDisable"
>
<el-option
v-for="item in warehouseOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></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">
<el-row
v-for="item in components"
@ -242,10 +267,14 @@ export default {
selectBatch: null,
components: [],
wbatchOptions: [],
mioitems:[''],
project_code:'',
};
},
mounted() {
// this.getBatchs();
let that = this;
let config_base = that.$TOOL.data.get("BASE_INFO").base;
that.project_code = config_base.base_code;
},
methods: {
init() {
@ -424,6 +453,20 @@ export default {
this.visible = true;
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() {
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 {
var res;
console.log(this.form);
if (this.mode == "add") {
res = await this.$API.inm.mioitem.create.req(
this.form