This commit is contained in:
zty 2025-06-20 10:15:49 +08:00
commit feb0e9bb1c
20 changed files with 708 additions and 160 deletions

View File

@ -444,9 +444,8 @@ export default {
// //
this.getCount(); this.getCount();
// //
this.getMaterials();
// //
this.getMaterials(); // this.getMaterials();// this.getmgroupMaterial();
}) })
}, },
methods: { methods: {
@ -526,7 +525,6 @@ export default {
// //
getmgroupMaterial(item) { getmgroupMaterial(item) {
let that = this; let that = this;
console.log('item',item);
let params = { tag: 'done',page_size:1,mgroup: item.id }; let params = { tag: 'done',page_size:1,mgroup: item.id };
that.$API.wpm.wmaterial.list.req(params).then((res) => { that.$API.wpm.wmaterial.list.req(params).then((res) => {
let obj = {}; let obj = {};
@ -556,13 +554,10 @@ export default {
} }
}) })
let maxNum = valuelist.sort((a, b) => b - a)[0]+2; let maxNum = valuelist.sort((a, b) => b - a)[0]+2;
console.log('maxNum',maxNum);
console.log('maxNum',maxNum);
let arr = []; let arr = [];
valuelist.forEach((item)=>{ valuelist.forEach((item)=>{
arr.push(maxNum) arr.push(maxNum)
}) })
console.log('arr',arr);
that.chartOption2.yAxis[0].data = namelist; that.chartOption2.yAxis[0].data = namelist;
that.chartOption2.yAxis[1].data = valuelist; that.chartOption2.yAxis[1].data = valuelist;
that.chartOption2.series[0].data = valuelist; that.chartOption2.series[0].data = valuelist;
@ -580,7 +575,7 @@ export default {
let that = this; let that = this;
let params = { let params = {
page: 0, belong_dept:that.deptId, page: 0, belong_dept:that.deptId,
query: " { id, name, number, model, state ,mgroup_name }" // query: " { id, name, number, model, state ,mgroup_name }"
}; };
that.config_middle_bottom.data = []; that.config_middle_bottom.data = [];
that.$API.em.equipment.list.req(params).then((res) => { that.$API.em.equipment.list.req(params).then((res) => {
@ -588,7 +583,7 @@ export default {
res.forEach((item) => { res.forEach((item) => {
let arr = []; let arr = [];
let state_ = that.state_[item.state]; let state_ = that.state_[item.state];
let running_state_ = runningStateEnum[scope.row.running_state]?.text; let running_state_ = runningStateEnum[item.running_state]?.text;
arr[0] = item.name; arr[0] = item.name;
arr[1] = item.number; arr[1] = item.number;
arr[2] = state_; arr[2] = state_;
@ -603,8 +598,8 @@ export default {
let that = this; let that = this;
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd"); let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
let params = { let params = {
// query: {start_date:date,end_date:date,dept_name:that.deptName}, query: {start_date:date,end_date:date,dept_name:that.deptName},
query: {start_date:'2025-06-11',end_date:'2025-06-11',dept_name:that.deptName}, // query: {start_date:'2025-06-11',end_date:'2025-06-11',dept_name:that.deptName},
}; };
let namelist = [],valuelist = []; let namelist = [],valuelist = [];
this.$API.bi.dataset.exec.req("performance", params).then((res) => { this.$API.bi.dataset.exec.req("performance", params).then((res) => {

View File

@ -706,12 +706,12 @@ export default {
let week = nowDate.getDay();//week let week = nowDate.getDay();//week
let weekFirst = week-1;// let weekFirst = week-1;//
let weekLast = 7-week;// let weekLast = 7-week;//
let first = new Date(new Date(nowDate.getTime() - (weekFirst * ondDayTime)));// let first = that.$TOOL.dateFormat2(new Date(nowDate.getTime() - (weekFirst * ondDayTime)));//
let last = new Date(new Date(nowDate.getTime() + (weekLast * ondDayTime)));// let last = that.$TOOL.dateFormat2(new Date(nowDate.getTime() + (weekLast * ondDayTime)));//
let objWeek = {query:{ let objWeek = {query:{
start_date:first,end_date:last,mgroup_name:'二次超洗', start_date:first,end_date:last,mgroup_name:'二次超洗',
group_bys_date:',月,周',order_bys_date:',月,周', group_bys_date:',月,周',order_bys_date:',月,周',
select_cols_date:', EXTRACT ( MONTH FROM mlog.work_end_time) AS 月,EXTRACT(WEEK FROM mlog.work_end_time) AS 周' select_cols_date:', EXTRACT ( MONTH FROM mlog.handle_date) AS 月,EXTRACT(WEEK FROM mlog.handle_date) AS 周'
}}; }};
that.$API.bi.dataset.exec.req('lineDay_m2', objWeek).then((res1) => { that.$API.bi.dataset.exec.req('lineDay_m2', objWeek).then((res1) => {
if(res1.data2.ds0&&res1.data2.ds0.length>0){ if(res1.data2.ds0&&res1.data2.ds0.length>0){
@ -723,7 +723,7 @@ export default {
let objMonth = {query:{ let objMonth = {query:{
start_date:start_month,end_date:end_month,mgroup_name:'二次超洗', start_date:start_month,end_date:end_month,mgroup_name:'二次超洗',
group_bys_date:',月',order_bys_date:',月', group_bys_date:',月',order_bys_date:',月',
select_cols_date:', EXTRACT ( MONTH FROM mlog.work_end_time) AS 月' select_cols_date:', EXTRACT ( MONTH FROM mlog.handle_date) AS 月'
}}; }};
that.$API.bi.dataset.exec.req('lineDay_m2', objMonth).then((res2) => { that.$API.bi.dataset.exec.req('lineDay_m2', objMonth).then((res2) => {
if(res2.data2.ds0&&res2.data2.ds0.length>0){ if(res2.data2.ds0&&res2.data2.ds0.length>0){

View File

@ -61,7 +61,7 @@
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
@click="table_add" @click="table_add"
v-if="mioObj.state == 10" v-if="mioObj.state == 10&&mode!=='show'"
>新增</el-button >新增</el-button
> >
</div> </div>
@ -145,6 +145,7 @@
fixed="right" fixed="right"
align="center" align="center"
width="150px" width="150px"
v-if=" mode!=='show'"
> >
<template #default="scope"> <template #default="scope">
<el-button <el-button
@ -312,6 +313,7 @@ export default {
}, },
data() { data() {
return { return {
mode:"add",
dialog: { dialog: {
check: false, check: false,
save: false, save: false,
@ -367,7 +369,8 @@ export default {
that.setNameVisible = false; that.setNameVisible = false;
that.$message.success("打印机设置成功,请重新进行打印操作。"); that.$message.success("打印机设置成功,请重新进行打印操作。");
}, },
open() { open(mode='add') {
this.mode = mode;
this.visible = true; this.visible = true;
}, },
getMio() { getMio() {

View File

@ -64,6 +64,14 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="物料单价">
<el-input-number
v-model="form.unit_price"
:min="0"
style="width: 100%;"
controls-position="right"
/>
</el-form-item>
</el-col> </el-col>
<el-col v-if="form.type == 'pur_in'||form.type == 'other_in'||form.type == 'do_out'||form.type=='sale_out'"> <el-col v-if="form.type == 'pur_in'||form.type == 'other_in'||form.type == 'do_out'||form.type=='sale_out'">
<el-form-item label="仓库已有批次"> <el-form-item label="仓库已有批次">
@ -269,6 +277,8 @@ export default {
}, },
mounted() { mounted() {
let that = this; let that = this;
let url1 = window.location.href;
this.url_code = url1.split('/')[3];
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;
}, },
@ -398,7 +408,7 @@ export default {
}); });
}, },
selectChange(item){ selectChange(item){
console.log(item) // console.log(item)
let that = this; let that = this;
that.wbatchOptions.forEach((item) => { that.wbatchOptions.forEach((item) => {
if(that.form.batch == item.batch){ if(that.form.batch == item.batch){
@ -411,6 +421,7 @@ export default {
var that = this; var that = this;
var type = this.form.type; var type = this.form.type;
that.form.material = that.selectObj.id; that.form.material = that.selectObj.id;
that.form.batch = that.selectObj.bin_number_main;
that.mTracking = that.selectObj.tracking; that.mTracking = that.selectObj.tracking;
if (type == "do_in") { if (type == "do_in") {
if (that.selectObj.is_assemb) { if (that.selectObj.is_assemb) {
@ -511,6 +522,7 @@ export default {
} }
} }
that.form.mioitemw = that.mioitemw; that.form.mioitemw = that.mioitemw;
// console.log(that.form);
try { try {
let res; let res;
if (that.mode == "add") { if (that.mode == "add") {

View File

@ -0,0 +1,218 @@
<template>
<el-container>
<el-header>
<div class="right-panel">
<el-date-picker
v-model="query.mio__inout_date__gte"
type="date"
placeholder="开始日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 150px;"
/>
<el-date-picker
v-model="query.mio__inout_date__lte"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="结束日期"
style="width: 150px;"
/>
<el-input
v-model="query.search"
placeholder="名称"
clearable
style="width: 150px;"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main style="padding: 0;">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
:query="query"
:summary-method="getSummaries"
show-summary
>
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="inout_date">
</el-table-column>
<el-table-column label="物料编号" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_">{{ scope.row.material_.number }}</span>
</template>
</el-table-column>
<el-table-column label="名称" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_">{{ scope.row.material_.name }}</span>
</template>
</el-table-column>
<el-table-column label="货位号">
<template #default="scope">
<span v-if="scope.row.material_">{{ scope.row.material_.bin_number_main }}</span>
</template>
</el-table-column>
<el-table-column label="规格" prop="batch">
<template #default="scope">
<span v-if="scope.row.material_">{{ scope.row.material_.specification }}</span>
</template>
</el-table-column>
<el-table-column label="品牌型号" prop="batch">
<template #default="scope">
<span v-if="scope.row.material_">{{ scope.row.material_.model }}</span>
</template>
</el-table-column>
<el-table-column label="单位" prop="batch">
<template #default="scope">
<span v-if="scope.row.material_">{{ scope.row.material_.unit }}</span>
</template>
</el-table-column>
<el-table-column label="入库数量" prop="count">
</el-table-column>
<el-table-column label="单价" prop="unit_price">
</el-table-column>
<el-table-column label="总金额" prop="price">
</el-table-column>
<el-table-column label="入库人">
<template #default="scope">
<span v-if="scope.row.mio_">{{ scope.row.mio_.submit_user_name }}</span>
</template>
</el-table-column>
<el-table-column label="入库凭证号">
<template #default="scope">
<span v-if="scope.row.mio_">{{ scope.row.mio_.number }}</span>
</template>
</el-table-column>
<el-table-column label="类别" prop="type">
<template #default="scope">
<span v-if="scope.row.mio_">{{ typeDict[scope.row.mio_.type] }}</span>
</template>
</el-table-column>
<el-table-column label="供应商" prop="supplier_name">
</el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "mioitemlist",
data() {
return {
apiObj: null,
params: {with_mio:'yes'},
selection: [],
tableData:[],
query: {
search: "",
mio__inout_date__gte: "",
mio__inout_date__lte: "",
},
stateDict: {
10: "创建中",
20: "已提交",
},
typeDict: {
do_out: "生产领料",
sale_out: "销售发货",
pur_in: "采购入库",
do_in: "生产入库",
other_in: "其他入库",
other_out: "其他出库",
},
project_code:'',
};
},
mounted() {
this.checkTemplate = this.checkTemplate+"?t=" + new Date().getTime();
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
this.params.mio = this.mioId;
this.apiObj = this.$API.inm.mioitem.list;
},
methods: {
handleCheckSuccess() {
this.$refs.table.refresh();
this.dialog.check = false;
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
//
printMaterial(row,type){
let that = this;
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
if(type=='mioitem'){
let params = {};
params.tid = row.id;
params.extra_data={count:row.count};
params.label_template_name = '库存标签模板';
that.$API.cm.labelmat.fromMioitem.req(params).then((res) => {
let obj = {};
obj.printer_commands = res.commands;
obj.printer_name = that.printer_name;
that.$API.wpm.prints.req(obj).then((response) => {
that.$message.success("打印成功");
});
})
}else{
let params = {};
let name = that.printMaterialName.split('|')[0];
params.label_template_name = '单件打印模板';
params.data = {number:row.number,name:name};
that.$API.cm.labeltemplate.commands.req(params).then((res) => {
let obj = {};
obj.printer_commands = res.commands;
obj.printer_name = that.printer_name;
that.$API.wpm.prints.req(obj).then((response) => {
that.$message.success("打印成功");
});
});
}
}else{
that.printSetting();
}
},
getSummaries({ columns, data }) {
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = "合计";
return;
}
if (index == 8|| index == 10) {
const values = data.map((item) =>
Number(item[column.property])
);
if (!values.every((value) => Number.isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr); //Number
let sum = Number(
Number(prev) + Number(curr)
).toFixed(2); //toFixed(2)
if (!isNaN(value)) {
return sum;
} else {
return prev;
}
}, 0);
}
}
});
return sums;
},
},
};
</script>

163
src/views/inm/miolist.vue Normal file
View File

@ -0,0 +1,163 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-select
v-model="query.type"
clearable
style="width: 120px; margin-left: 2px"
placeholder="出入库类型"
@change="handleQuery"
>
<el-option
v-for="item in cateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-select
v-model="query.state"
clearable
style="width: 120px; margin-left: 2px"
placeholder="状态"
@change="handleQuery"
>
<el-option
v-for="item in stateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</div>
<div class="right-panel">
<el-input
v-model="query.search"
placeholder="编号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe>
<el-table-column type="index" width="50" />
<el-table-column
label="记录编号"
prop="number"
></el-table-column>
<el-table-column label="出/入库类型">
<template #default="scope">
{{ typeDict[scope.row.type] }}
</template>
</el-table-column>
<el-table-column label="记录状态">
<template #default="scope">
{{ stateDict[scope.row.state] }}
</template>
</el-table-column>
<el-table-column label="出/入库日期" prop="inout_date">
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column label="创建时间" prop="create_time">
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="150px"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_detail(scope.row)"
>
查看
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<record-dialog
ref="showDrawer"
v-if="visibleDrawer"
:type="type"
:cate="cate"
:mioId="mioId"
@closed="visibleDrawer = false"
>
</record-dialog>
</template>
<script>
import recordDialog from "./mioitem.vue";
export default {
name: "mio",
components: {
recordDialog,
},
data() {
return {
stateDict: {
10: "创建中",
20: "已提交",
},
stateOptions: [
{ id: 10, name: "创建中" },
{ id: 20, name: "已提交" },
],
typeDict: {
do_out: "生产领料",
sale_out: "销售发货",
pur_in: "采购入库",
do_in: "生产入库",
},
cateOptions: [
{ id: "do_out", name: "生产领料" },
{ id: "sale_out", name: "销售发货" },
{ id: "pur_in", name: "采购入库" },
{ id: "do_in", name: "生产入库" },
],
dialog: {
record: false,
},
visibleDrawer: false,
query: {
search: "",
},
form: {},
apiObj: this.$API.inm.mio.list,
selection: [],
type: "",
mioId: "",
};
},
methods: {
//
table_detail(row) {
this.type = row.type;
this.mioId = row.id;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open('show');
});
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
},
};
</script>

View File

@ -113,6 +113,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 光芯 --> <!-- 光芯 -->
<el-col :md="12" :sm="24" v-if="form.type == 40">
<el-form-item label="仓库位号">
<el-input
v-model="form.bin_number_main"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="form.type !== 20"> <el-col :md="12" :sm="24" v-if="form.type !== 20">
<el-form-item label="物料单价"> <el-form-item label="物料单价">
<el-input-number <el-input-number
@ -127,6 +134,11 @@
<el-switch v-model="form.is_hidden" /> <el-switch v-model="form.is_hidden" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="form.type == 40">
<el-form-item label="是否进入车间库存">
<el-switch v-model="form.into_wm" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="form.type==10||form.type==20"> <el-col :md="12" :sm="24" v-if="form.type==10||form.type==20">
<el-form-item label="产品图纸"> <el-form-item label="产品图纸">
<sc-upload v-model="form.photo" :modelValue="form.photo" title="产品图纸"></sc-upload> <sc-upload v-model="form.photo" :modelValue="form.photo" title="产品图纸"></sc-upload>
@ -252,6 +264,9 @@ export default {
}, },
typeChange(val) { typeChange(val) {
this.getMaterial(val); this.getMaterial(val);
if(this.form.type == 40) {
this.form.into_wm = false;
}
}, },
// //
submit() { submit() {
@ -300,6 +315,7 @@ export default {
that.form.is_hidden = data.is_hidden; that.form.is_hidden = data.is_hidden;
that.form.unit_price = data.unit_price; that.form.unit_price = data.unit_price;
that.form.photo = data.photo; that.form.photo = data.photo;
that.form.into_wm = data.into_wm;
that.form.photo_number = data.photo_number; that.form.photo_number = data.photo_number;
}else{ }else{
Object.assign(this.form, data); Object.assign(this.form, data);

View File

@ -107,6 +107,8 @@
width="80" width="80"
> >
</el-table-column> </el-table-column>
<el-table-column label="仓库位号" prop="bin_number_main" v-if="project_code=='gx'">
</el-table-column>
<el-table-column label="追踪方式" prop="tracking" v-if="project_code=='bxerp'"> <el-table-column label="追踪方式" prop="tracking" v-if="project_code=='bxerp'">
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.tracking == 10">批次</el-tag> <el-tag v-if="scope.row.tracking == 10">批次</el-tag>

View File

@ -248,13 +248,13 @@ export default {
material_start__type:30, material_start__type:30,
}, },
params_mio:{ params_mio:{
item_mio_w_mioitem_number:'', item_mio__w_mioitem__number:'',
}, },
params_mlog:{ params_mlog:{
b_mlog_wmlogb_number:'', b_mlog__w_mlogb__number:'',
}, },
params_handover:{ params_handover:{
b_handover_w_handoverb_number:'', b_handover__w_handoverb__number:'',
}, },
stateDict: { stateDict: {
10: "创建中", 10: "创建中",
@ -293,12 +293,15 @@ export default {
that.wprItem = res.wm_; that.wprItem = res.wm_;
that.wprItem.number = row.number; that.wprItem.number = row.number;
} }
that.params_mio.item_mio_w_mioitem_number = row.number; that.params_mio.item_mio__w_mioitem__number = row.number;
that.params_mlog.b_mlog_wmlogb_number = row.number; that.params_mlog.b_mlog__w_mlogb__number = row.number;
that.params_handover.b_handover_w_handoverb_number = row.number; that.params_handover.b_handover__w_handoverb__number = row.number;
that.apiObj_mlog = that.$API.wpm.mlog.list; that.apiObj_mlog = that.$API.wpm.mlog.list;
that.apiObj_handover = that.$API.wpm.handover.list; that.apiObj_handover = that.$API.wpm.handover.list;
that.apiObj_mio = that.$API.inm.mio.list; that.apiObj_mio = that.$API.inm.mio.list;
that.$refs.tableMlog.queryData(that.params_mlog);
that.$refs.tableHandover.queryData(that.params_handover);
that.$refs.tableMio.queryData(that.params_mio);
}) })
}, },

View File

@ -22,7 +22,7 @@
@change="formWminChange(wm_in)" @change="formWminChange(wm_in)"
style="width: 300px;margin-left: 10px;" style="width: 300px;margin-left: 10px;"
></el-input> ></el-input>
<scScanner @scanResult="formWminChange"></scScanner> <!-- <scScanner @scanResult="formWminChange"></scScanner> -->
</el-form-item> </el-form-item>
<el-form-item label="总计:"> <el-form-item label="总计:">
{{ totalCount }} {{ totalCount }}

View File

@ -465,28 +465,35 @@ export default {
if(type=='wm'){ if(type=='wm'){
let params = {}; let params = {};
params.tid = row.id; params.tid = row.id;
let materialname = row.material_.name + '|' + row.material_.process_name;
let specification = row.material_.specification;
if(that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'){ if(that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'){
params.label_template_name = '工序带板段号打印模板'; params.label_template_name = '工序带板段号打印模板';
that.wprParams.wm = row.id; that.wprParams.wm = row.id;
let numbers = ['','','','','','','']; let numbers = ['','','','','','',''];
this.$API.wpm.wpr.list.req(that.wprParams).then((res) => { this.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
let leng = res.length; let leng = res.length;
let slice_count = null;//
let wprItem = res[0].oinfo;
for(let key in wprItem){
if(wprItem[key].name=='切片数'){
slice_count = wprItem[key].val;
}
}
if(leng>0){ if(leng>0){
let nums = leng/4; let nums = leng/3;
for(let i=0;i<nums;i++){ for(let i=0;i<nums;i++){
let index = i*4; let index = i*3;
if(index+3<leng){ if(index+2<leng){
numbers[i] =res[index].number+'、'+res[index+1].number+'、'+res[index+2].number+'、'+res[index+3].number; numbers[i] =res[index].number+'('+slice_count+'片)、'+res[index+1].number+'('+slice_count+'片)、'+res[index+2].number+'('+slice_count+'片)';
}else if(index+2<leng){
numbers[i] =res[index].number+'、'+res[index+1].number+'、'+res[index+2].number;
}else if(index+1<leng){ }else if(index+1<leng){
numbers[i] =res[index].number+'、'+res[index+1].number; numbers[i] =res[index].number+'('+slice_count+'片)、'+res[index+1].number+'('+slice_count+'片)';
}else{ }else{
numbers[i] =res[index].number; numbers[i] =res[index].number+'('+slice_count+'片)';
} }
} }
} }
params.extra_data={count:row.count,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]}; params.extra_data={materialname:materialname,specification:specification,count:row.count,slicecount:slice_count,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]};
that.apiObjPrint.req(params).then((res) => { that.apiObjPrint.req(params).then((res) => {
let obj = {}; let obj = {};
obj.printer_commands = res.commands; obj.printer_commands = res.commands;

View File

@ -466,28 +466,36 @@ export default {
if(type=='wm'){ if(type=='wm'){
let params = {}; let params = {};
params.tid = row.id; params.tid = row.id;
let materialname = row.material_.name + '|' + row.material_.process_name;
let specification = row.material_.specification;
if(that.route_code=='tuomoceliang'||that.route_code=='reyatuihuo'){ if(that.route_code=='tuomoceliang'||that.route_code=='reyatuihuo'){
console.log('route_code',that.route_code);
params.label_template_name = '工序带板段号打印模板'; params.label_template_name = '工序带板段号打印模板';
that.wprParams.wm = row.id; that.wprParams.wm = row.id;
let numbers = ['','','','','','','']; let numbers = ['','','','','','',''];
this.$API.wpm.wpr.list.req(that.wprParams).then((res) => { this.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
let leng = res.length; let leng = res.length;
let slice_count = null;//
let wprItem = res[0].oinfo;
for(let key in wprItem){
if(wprItem[key].name=='切片数'){
slice_count = wprItem[key].val;
}
}
if(leng>0){ if(leng>0){
let nums = leng/4; let nums = leng/3;
for(let i=0;i<nums;i++){ for(let i=0;i<nums;i++){
let index = i*4; let index = i*3;
if(index+3<leng){ if(index+2<leng){
numbers[i] =res[index].number+'、'+res[index+1].number+'、'+res[index+2].number+'、'+res[index+3].number; numbers[i] =res[index].number+'('+slice_count+'片)、'+res[index+1].number+'('+slice_count+'片)、'+res[index+2].number+'('+slice_count+'片)';
}else if(index+2<leng){
numbers[i] =res[index].number+'、'+res[index+1].number+'、'+res[index+2].number;
}else if(index+1<leng){ }else if(index+1<leng){
numbers[i] =res[index].number+'、'+res[index+1].number; numbers[i] =res[index].number+'('+slice_count+'片)、'+res[index+1].number+'('+slice_count+'片)';
}else{ }else{
numbers[i] =res[index].number; numbers[i] =res[index].number+'('+slice_count+'片)';
} }
} }
} }
params.extra_data={count:row.count,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]}; params.extra_data={materialname:materialname,specification:specification,count:row.count,slicecount:slice_count,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]};
that.apiObjPrint.req(params).then((res) => { that.apiObjPrint.req(params).then((res) => {
let obj = {}; let obj = {};
obj.printer_commands = res.commands; obj.printer_commands = res.commands;

View File

@ -63,7 +63,7 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<scScanner @scanResult="scanClose"></scScanner> <!-- <scScanner @scanResult="scanClose"></scScanner> -->
<scan-dialog ref="scanDialog" :closeNow="closeNow" @closed="scanClose"> </scan-dialog> <scan-dialog ref="scanDialog" :closeNow="closeNow" @closed="scanClose"> </scan-dialog>
</el-form-item> </el-form-item>
<el-form-item label="批次" v-if="cate == 'do_out'"> <el-form-item label="批次" v-if="cate == 'do_out'">
@ -91,7 +91,7 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<scScanner @scanResult="scanClose"></scScanner> <!-- <scScanner @scanResult="scanClose"></scScanner> -->
<scan-dialog ref="scanDialog" @closed="scanClose"> </scan-dialog> <scan-dialog ref="scanDialog" @closed="scanClose"> </scan-dialog>
</el-form-item> </el-form-item>
<el-form-item label="仓库" prop="warehouse"> <el-form-item label="仓库" prop="warehouse">

View File

@ -118,7 +118,7 @@
<el-button <el-button
type="danger" type="danger"
@click="table_muser_del(scope.row)" @click="table_muser_del(scope.row)"
></el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>

View File

@ -58,7 +58,7 @@
</el-col> </el-col>
<el-col> <el-col>
<el-form-item label="物料扫码" style="display: flex;"> <el-form-item label="物料扫码" style="display: flex;">
<scScanner @scanResult="formWminChange"></scScanner> <!-- <scScanner @scanResult="formWminChange"></scScanner> -->
<el-input ref="codeInput" v-model="wm_in" clearable @change="formWminChange(wm_in)" style="width: 200px;margin-left: 4px;"></el-input> <el-input ref="codeInput" v-model="wm_in" clearable @change="formWminChange(wm_in)" style="width: 200px;margin-left: 4px;"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>

View File

@ -205,7 +205,9 @@ export default {
data() { data() {
return { return {
apiObj: null, apiObj: null,
params: { mgroup: "" ,submit_time__isnull:true}, params: { mgroup: "" ,submit_time__isnull:true,
query: " { id,equipment, material_out_name, equipment_name, reminder_interval_list ,mstate_json,belong_dept_name, mgroup_name,handle_user_name,work_start_time,work_end_time,submit_time}"
},
query: {submit_time__isnull:true}, query: {submit_time__isnull:true},
dialog: { dialog: {
save: false, save: false,

View File

@ -185,7 +185,7 @@
size="small" size="small"
@click="table_reBack(scope.row)" @click="table_reBack(scope.row)"
type="danger" type="danger"
v-if="scope.row.recive_mgroup == mgroupId&&scope.row.submit_time!== null&&scope.row.type == 10&&scope.row.mtype == 10" v-if="scope.row.recive_mgroup == mgroupId&&scope.row.submit_time!== null&&(scope.row.type == 10||scope.row.type == 20)&&scope.row.mtype == 10"
>退回</el-button> >退回</el-button>
<el-button <el-button
link link
@ -403,7 +403,7 @@ export default {
that.codeText2 = codeText2; that.codeText2 = codeText2;
this.dialog.save = true; this.dialog.save = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("add",codeText2,20); this.$refs.saveDialog.open("add",codeText2,10);
}); });
}, },
// //

View File

@ -35,7 +35,26 @@
<el-row v-show="addShow"> <el-row v-show="addShow">
<el-col> <el-col>
<el-form-item label="交接物料"> <el-form-item label="交接物料">
<el-select <xtSelect
:apiObj="apiObjM"
v-model="form.wm_in"
v-model:obj="selectObj"
:labelField="'batch'"
style="width: 100%;"
:params = "paramsM"
@change="materialChange0"
>
<el-table-column label="物料" prop="full_name">
<template #default="scope">
<span v-if="scope.row.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
<span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
<span>{{ scope.row.batch }}({{ scope.row.material_name }})</span>
<span v-if="scope.row.defect_name !== null" style="color: orangered">{{ scope.row.defect_name }}</span>
</template>
</el-table-column>
<el-table-column label="数量" prop="count" width="110px"></el-table-column>
</xtSelect>
<!-- <el-select
v-model="selectItems" v-model="selectItems"
placeholder="交接物料" placeholder="交接物料"
filterable filterable
@ -55,22 +74,22 @@
<span v-if="item.defect_name !== null" style="color: orangered">{{ item.defect_name }}</span> <span v-if="item.defect_name !== null" style="color: orangered">{{ item.defect_name }}</span>
<span style="float: right">{{ item.count }}</span> <span style="float: right">{{ item.count }}</span>
</el-option> </el-option>
</el-select> </el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem"> <el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
<el-col :span="10"> <el-col :span="12">
<el-form-item label="交接物料"> <el-form-item label="交接物料">
<el-input v-model="listItem.batch" disabled></el-input> <el-input v-model="listItem.label" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="4">
<el-form-item label="总数量"> <el-form-item label="总数量">
<span>{{ listItem.count_cando }}</span> <span>{{ listItem.count_cando }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="6">
<el-form-item label="交接数量"> <el-form-item label="交接数量">
<el-input-number <el-input-number
v-model="listItem.count" v-model="listItem.count"
@ -235,6 +254,9 @@ export default {
recive_mgroup: null, recive_mgroup: null,
handoverb:[], handoverb:[],
}, },
apiObjM:null,
paramsM:{},
selectObj:{},
rules: { rules: {
batch: [ batch: [
{ {
@ -319,17 +341,22 @@ export default {
// //
if(that.type==20&&that.mgroupName!=='废品库'){ if(that.type==20&&that.mgroupName!=='废品库'){
// //
that.getMaterialRework(); // that.getMaterialRework();
that.paramsM = {mgroup: that.mgroupId,page: 0,state__in:'20,34',tag : 'done'};
}else if(that.type==20&&that.mgroupName=='废品库'){ }else if(that.type==20&&that.mgroupName=='废品库'){
// //
that.getMaterialFP(); // that.getMaterialFP();
that.paramsM = {page: 0,state : 50,state_all: 1};
}else if(that.type==40){ }else if(that.type==40){
// //
that.getMaterialNotok(); // that.getMaterialNotok();
that.paramsM = {mgroupx: that.mgroupId,page: 0,state:20};
}else{ }else{
// //
that.getMaterial(); that.paramsM = {mgroup: that.mgroupId,page: 0,state:10,tag : 'done'};
// that.getMaterial();
} }
that.apiObjM = this.$API.wpm.wmaterial.list;
if(that.type==40||that.type==20){ if(that.type==40||that.type==20){
that.getMgroupOptions(); that.getMgroupOptions();
}else{ }else{
@ -353,32 +380,32 @@ export default {
}); });
}, },
// //
getMaterial() { // getMaterial() {
let that = this; // let that = this;
var req = { // var req = {
page: 0, // page: 0,
state:10, // state:10,
tag:'done' // tag:'done'
}; // };
that.materialOptions = []; // that.materialOptions = [];
req.mgroup = that.mgroupId; // req.mgroup = that.mgroupId;
that.listParams = req; // that.listParams = req;
this.$API.wpm.wmaterial.list.req(req).then((res) => { // this.$API.wpm.wmaterial.list.req(req).then((res) => {
that.materialOptions = res; // that.materialOptions = res;
res.forEach(item=>{ // res.forEach(item=>{
if(that.codeText!==''&&item.batch === that.codeText){ // if(that.codeText!==''&&item.batch === that.codeText){
let obj = {}; // let obj = {};
obj.wm = item.id; // obj.wm = item.id;
obj.batch = item.batch; // obj.batch = item.batch;
obj.count = item.count_cando; // obj.count = item.count_cando;
obj.count_cando = item.count_cando; // obj.count_cando = item.count_cando;
that.totalCount = item.count_cando; // that.totalCount = item.count_cando;
that.form.handoverb.push(obj) // that.form.handoverb.push(obj)
that.getResaveMgroups(item.material); // that.getResaveMgroups(item.material);
} // }
}) // })
}); // });
}, // },
getResaveMgroups(material){ getResaveMgroups(material){
let that = this; let that = this;
let params = { let params = {
@ -393,45 +420,45 @@ export default {
}) })
}, },
// //
getMaterialNotok() { // getMaterialNotok() {
let that = this; // let that = this;
that.materialOptions = []; // that.materialOptions = [];
var req = { // var req = {
mgroupx: that.mgroupId, // mgroupx: that.mgroupId,
page: 0, // page: 0,
state:20 // state:20
}; // };
that.listParams = req; // that.listParams = req;
this.$API.wpm.wmaterial.list.req(req).then((res) => { // this.$API.wpm.wmaterial.list.req(req).then((res) => {
that.materialOptions = res; // that.materialOptions = res;
}); // });
}, // },
getMaterialRework(){ // getMaterialRework(){
let that = this; // let that = this;
that.materialOptions = []; // that.materialOptions = [];
var req = { // var req = {
mgroup: that.mgroupId, // mgroup: that.mgroupId,
page: 0, // page: 0,
tag : 'done' // tag : 'done'
}; // };
that.listParams = req; // that.listParams = req;
this.$API.wpm.wmaterial.list.req(req).then((res) => { // this.$API.wpm.wmaterial.list.req(req).then((res) => {
that.materialOptions = res; // that.materialOptions = res;
}); // });
}, // },
// //
getMaterialFP() { // getMaterialFP() {
let that = this; // let that = this;
that.materialOptions = []; // that.materialOptions = [];
var obj = { // var obj = {
page: 0, // page: 0,
state : 50, // state : 50,
state_all: 1 // state_all: 1
}; // };
that.$API.wpm.wmaterial.list.req(obj).then((res) => { // that.$API.wpm.wmaterial.list.req(obj).then((res) => {
that.materialOptions = res; // that.materialOptions = res;
}); // });
}, // },
// //
getUserList() { getUserList() {
let that = this; let that = this;
@ -521,21 +548,47 @@ export default {
this.visible = true; this.visible = true;
return this; return this;
}, },
materialChange() { materialChange0(){
let that = this; let that = this;
let totalCount = 0; let obj = {};
let data = that.materialOptions.filter((item) => { obj.wm = that.selectObj.id;
return that.selectItems.indexOf(item.id)>-1; obj.batch = that.selectObj.batch;
}); obj.label = that.selectObj.defect !== null?that.selectObj.batch+'('+that.selectObj.material_name+')'+that.selectObj.defect_name:that.selectObj.batch+'('+that.selectObj.material_name+')';
data.forEach(item=>{ obj.count = that.selectObj.count_cando;
item.wm = item.id; obj.defect_name = that.selectObj.defect_name;
item.count = item.count_cando; obj.count_cando = that.selectObj.count_cando;
totalCount += Number(item.count_cando); obj.material = that.selectObj.material;
}) if(that.form.handoverb.length>0){
that.totalCount = totalCount; let datas = that.form.handoverb.filter((item) => {
that.form.handoverb = data; return item.wm==that.selectObj.id;
that.getResaveMgroups(data[0].material); });
if(datas.length>0){
that.$message.warning('该物料已存在');
}else{
that.totalCount += Number(obj.count_cando);
that.form.handoverb.push(obj);
}
}else{
that.totalCount += Number(obj.count_cando);
that.form.handoverb.push(obj);
}
that.getResaveMgroups(obj.material);
}, },
// materialChange() {
// let that = this;
// let totalCount = 0;
// let data = that.materialOptions.filter((item) => {
// return that.selectItems.indexOf(item.id)>-1;
// });
// data.forEach(item=>{
// item.wm = item.id;
// item.count = item.count_cando;
// totalCount += Number(item.count_cando);
// })
// that.totalCount = totalCount;
// that.form.handoverb = data;
// that.getResaveMgroups(data[0].material);
// },
countChange(){ countChange(){
let that = this; let that = this;
let totalCount = 0; let totalCount = 0;
@ -628,17 +681,35 @@ export default {
if(arr.length>0){ if(arr.length>0){
that.$message.error("该批次已存在") that.$message.error("该批次已存在")
}else{ }else{
that.materialOptions.forEach((item) => { let params = {mgroup: that.mgroupId,page: 0,state__in:res.state,search:res.batch,tag : 'done'};
if(item.batch == res.batch){ if(that.type==10){
let obj = {}; params.state__in = '10';
obj.wm = item.id; }else if(that.type==20){
obj.batch = item.batch; params.state__in = '20,34';
obj.counts = item.count; }
obj.count = item.count; that.$API.wpm.wmaterial.list.req(params).then((res1) => {
that.form.handoverb.push(obj) if(res1.length>0){
that.getResaveMgroups(item.material); res1.forEach(item=>{
} let cando = Number(item.count_canhandover);
}) if(cando>0&&item.defect_name==res.defect_name){
let obj = {};
obj.wm = item.id;
obj.batch = item.batch;
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';
obj.count = item.count_cando;
obj.defect_name = item.defect_name;
obj.count_cando = item.count_cando;
obj.material = item.material;
that.form.handoverb.push(obj)
that.getResaveMgroups(obj.material);
}
// else{
// that.$message.error("")
// }
})
}
that.codeText = '';
});
} }
}) })
// //

View File

@ -339,7 +339,7 @@
:mlog="mlogId" :mlog="mlogId"
:mgroup="mgroup" :mgroup="mgroup"
:is_fix = "is_fix" :is_fix = "is_fix"
:mlogbindefect = "mlogbindefect" :mlogbdefect = "mlogbdefect"
:mgroupMtype="mgroupMtype" :mgroupMtype="mgroupMtype"
:mgroupName = "mgroupName" :mgroupName = "mgroupName"
:codeText = "codeText" :codeText = "codeText"
@ -561,7 +561,7 @@ export default {
options: [], options: [],
tableData:[], tableData:[],
tableData2:[], tableData2:[],
mlogbindefect:[], mlogbdefect:[],
mlogboutdefect:[], mlogboutdefect:[],
saveInDialog: false, saveInDialog: false,
ticketDialog:false, ticketDialog:false,
@ -699,17 +699,17 @@ export default {
if (valid) { if (valid) {
that.isSaveing = true; that.isSaveing = true;
let obj = {}; let obj = {};
let count_pn_jgqbl = 0,mlogbindefect=[]; let count_pn_jgqbl = 0,mlogbdefect=[];
that.qct_defects.forEach(item => { that.qct_defects.forEach(item => {
count_pn_jgqbl += that.defectinform[item.defect_name] ; count_pn_jgqbl += that.defectinform[item.defect_name] ;
let obj = {}; let obj = {};
obj.defect = item.defect; obj.defect = item.defect;
obj.count = that.defectinform[item.defect_name]; obj.count = that.defectinform[item.defect_name];
obj.mlogb = that.saveInForm.id; obj.mlogb = that.saveInForm.id;
mlogbindefect.push(obj); mlogbdefect.push(obj);
}) })
obj.count_use = that.saveInForm.count_use; obj.count_use = that.saveInForm.count_use;
obj.mlogbindefect = mlogbindefect; obj.mlogbdefect = mlogbdefect;
obj.count_pn_jgqbl = count_pn_jgqbl; obj.count_pn_jgqbl = count_pn_jgqbl;
that.$API.wpm.mlogb.updateIn.req(that.saveInForm.id, obj).then((res) => { that.$API.wpm.mlogb.updateIn.req(that.saveInForm.id, obj).then((res) => {
that.isSaveing = false; that.isSaveing = false;
@ -804,6 +804,7 @@ export default {
this.dialog.save = true; this.dialog.save = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open(); this.$refs.saveDialog.open();
this.codeText = '';
}); });
}, },
handleSaveSuccess() { handleSaveSuccess() {

View File

@ -18,6 +18,27 @@
<el-row> <el-row>
<el-col> <el-col>
<el-form-item label="批次号" prop="wm_in"> <el-form-item label="批次号" prop="wm_in">
<xtSelect
:apiObj="apiObjM"
v-model="form.wm_in"
v-model:obj="selectObj"
:labelField="'batch'"
style="width: 100%;"
:params = "paramsM"
>
<!-- :params = "{type__in: '10,20',is_hidden: false}" -->
<el-table-column label="物料" prop="full_name">
<template #default="scope">
<span v-if="scope.row.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
<span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
<span>{{ scope.row.batch }}({{ scope.row.material_name }})</span>
<span v-if="scope.row.defect_name !== null" style="color: orangered">{{ scope.row.defect_name }}</span>
</template>
</el-table-column>
<el-table-column label="数量" prop="count" width="110px"></el-table-column>
</xtSelect>
</el-form-item>
<!-- <el-form-item label="批次号" prop="wm_in">
<el-select <el-select
v-model="form.wm_in" v-model="form.wm_in"
placeholder="物料" placeholder="物料"
@ -34,6 +55,8 @@
> >
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<div> <div>
<span v-if="item.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
<span v-if="item.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
<span>{{ item.batch }}({{ item.material_name }})</span> <span>{{ item.batch }}({{ item.material_name }})</span>
<span v-if="item.defect_name !== null" style="color: orangered">{{ item.defect_name }}</span> <span v-if="item.defect_name !== null" style="color: orangered">{{ item.defect_name }}</span>
</div> </div>
@ -41,7 +64,7 @@
</div> </div>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="关联任务"> <el-form-item label="关联任务">
@ -76,7 +99,7 @@
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item :label="mgroupMtype==10?'领用数量':'批次总数'"> <el-form-item :label="mgroupMtype==10?'领用数量':'批次总数'">
<el-input-number <el-input-number
v-model="form.count_use" v-model="selectObj.count_cando"
:min="0" :min="0"
class="width-100" class="width-100"
controls-position="right" controls-position="right"
@ -205,7 +228,7 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
mlogbindefect:{ mlogbdefect:{
type:Array, type:Array,
default:()=>[] default:()=>[]
}, },
@ -238,6 +261,7 @@ export default {
}, },
], ],
}, },
selectObj:{count:0},
batch_count:null, batch_count:null,
codeBatch:"", codeBatch:"",
materialFix:"", materialFix:"",
@ -249,20 +273,37 @@ export default {
visible: false, visible: false,
isSaveing: false, isSaveing: false,
setFiltersVisible: false, setFiltersVisible: false,
apiObjM:this.$API.wpm.wmaterial.list,
paramsM:{},
}; };
}, },
mounted() { mounted() {
let that = this; let that = this;
that.paramsM.mtaskx =that.form.mtask;
that.paramsM.mgroup = that.mgroup;
// that.paramsM.query = "{id,batch,count,material,material_name,defect_name}";
that.paramsM.page =0;
if(that.is_fix){//&&
that.paramsM.tag = 'canfix';
}else{
that.paramsM.material =that.materialIn;
that.paramsM.state =10;
that.paramsM.tag = 'todo';
}
if(that.codeText!==''){ if(that.codeText!==''){
let id = that.codeText.split('#')[1]; let id = that.codeText.split('#')[1];
this.$API.cm.labelmat.item.req(id).then((res) => { this.$API.cm.labelmat.item.req(id).then((res) => {
that.codeBatch = res.batch; that.codeBatch = res.batch;
this.getMaterial(); that.paramsM.search = that.codeBatch;
that.apiObjM = that.$API.wpm.wmaterial.list;
// this.getMaterial();
}).catch((err) => { }).catch((err) => {
that.getMaterial(); that.apiObjM = that.$API.wpm.wmaterial.list;
// that.getMaterial();
}) })
}else{ }else{
that.getMaterial(); that.apiObjM = that.$API.wpm.wmaterial.list;
// that.getMaterial();
} }
if(that.is_fix){}else{ if(that.is_fix){}else{
this.getdefects(); this.getdefects();
@ -292,6 +333,8 @@ export default {
let obj = {}; let obj = {};
obj.mtaskx =that.form.mtask; obj.mtaskx =that.form.mtask;
obj.mgroup = that.mgroup; obj.mgroup = that.mgroup;
obj.search = that.codeBatch;
// obj.query = "{id,batch,count,material,material_name,defect_name}";
obj.page =0; obj.page =0;
if(that.is_fix){//&& if(that.is_fix){//&&
obj.tag = 'canfix'; obj.tag = 'canfix';
@ -328,9 +371,9 @@ export default {
}) })
that.qct_defects=res.qct_defects; that.qct_defects=res.qct_defects;
let count_pn_jgqbl = 0; let count_pn_jgqbl = 0;
if(data.mlogbindefect.length>0){ if(data.mlogbdefect.length>0){
that.qct_defects.forEach(item => { that.qct_defects.forEach(item => {
data.mlogbindefect.forEach(item2=>{ data.mlogbdefect.forEach(item2=>{
if(item.defect==item2.defect){ if(item.defect==item2.defect){
count_pn_jgqbl+=item2.count; count_pn_jgqbl+=item2.count;
that.defectform[item.defect_name] = item2.count; that.defectform[item.defect_name] = item2.count;
@ -413,6 +456,8 @@ export default {
if (valid) { if (valid) {
that.isSaveing = true; that.isSaveing = true;
that.form.mlog = that.mlog; that.form.mlog = that.mlog;
that.form.batch = that.selectObj.batch;
that.form.count_use = that.selectObj.count_cando;
if(that.mgroupMtype==10&&that.cellsList.length>0){ if(that.mgroupMtype==10&&that.cellsList.length>0){
that.form.count_json_from = that.cellsList; that.form.count_json_from = that.cellsList;
} }
@ -428,6 +473,8 @@ export default {
}) })
that.form.mlogbdefect = mlogbdefect; that.form.mlogbdefect = mlogbdefect;
that.form.count_pn_jgqbl = count_pn_jgqbl; that.form.count_pn_jgqbl = count_pn_jgqbl;
console.log(that.form);
console.log(that.selectObj);
that.$API.wpm.mlogb.in.req(that.form).then((res) => { that.$API.wpm.mlogb.in.req(that.form).then((res) => {
that.isSaveing = false; that.isSaveing = false;
that.$emit("success"); that.$emit("success");