fix:mlobw编辑时传参调整以及生产领料时物料标签的打印
This commit is contained in:
parent
faf6358eab
commit
2a282c5b63
|
@ -200,6 +200,13 @@
|
|||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-link
|
||||
type="primary"
|
||||
v-if="mioObj.type == 'do_out'&&project_code=='bxerp'"
|
||||
@click="printMaterial(scope.row)"
|
||||
>
|
||||
物料标签
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
@ -413,6 +420,29 @@ export default {
|
|||
that.printVisible = true;
|
||||
})
|
||||
},//打印
|
||||
//打印物料标签
|
||||
printMaterial(row){
|
||||
let that = this;
|
||||
that.apiObj.req({tid:row.id}).then((res) => {
|
||||
let code = res.code_label;
|
||||
let str = [
|
||||
"SIZE 40 mm,70 mm",
|
||||
"GAP 7 mm,7 mm",
|
||||
"CLS",
|
||||
"REFERENCE 0,0",
|
||||
'QRCODE 30,400,H,5,A,0,"' +code +'"',
|
||||
"WINTEXT 200,550,28,90,0,0,Simhei," + res.material_name,
|
||||
"WINTEXT 240,550,28,90,0,0,Simhei," + res.batch,
|
||||
"PRINT 1",
|
||||
];
|
||||
let obj = {};
|
||||
obj.printer_commands = str;
|
||||
obj.printer_name = that.printer_name;
|
||||
that.$API.wpm.prints.req(obj).then((response) => {
|
||||
that.$message.success("打印成功");
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -18,21 +18,21 @@
|
|||
<span v-if="!scope.row.isEdit">{{ scope.row.number }}</span>
|
||||
<el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input>
|
||||
<el-select
|
||||
v-if="scope.row.isEdit&&mode == 'ins'"
|
||||
v-model="scope.row.wpr"
|
||||
placeholder="动态成品"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="optionChange(scope.row)"
|
||||
v-if="scope.row.isEdit&&mode == 'ins'"
|
||||
v-model="scope.row.wpr"
|
||||
placeholder="动态成品"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="optionChange(scope.row)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.number"
|
||||
:value="item.id"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.number"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id">
|
||||
|
@ -105,6 +105,76 @@
|
|||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="note" :label="item.testitem_name" v-for="item in scope.row.ftest.ftestitems" :key="item.id">
|
||||
<template #default="scope">
|
||||
<el-input-number
|
||||
v-if="item.testitem_field_type=='input-number'"
|
||||
v-model="item.test_val_json"
|
||||
:min="0"
|
||||
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="item.test_val_json"
|
||||
:min="0"
|
||||
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="item.test_val_json"
|
||||
class="width-100"
|
||||
@change="defectCountSun(scope.row)"
|
||||
>
|
||||
</el-input>
|
||||
<el-select
|
||||
v-if="item.testitem_field_type=='select-text'"
|
||||
v-model="item.test_val_json"
|
||||
clearable
|
||||
class="width-100"
|
||||
@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="item.test_val_json"
|
||||
clearable
|
||||
multiple
|
||||
class="width-100"
|
||||
@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-column :label="item1.defect_name" v-for="item1 in scope.row.ftest.ftestdefects" :key="item1.id">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
:disabled="!scope.row.isEdit"
|
||||
v-model="item1.has"
|
||||
style="--el-switch-on-color: red"
|
||||
@change="switchChange(scope.row, item)"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="note" label="备注">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
|
||||
|
@ -277,31 +347,50 @@ export default {
|
|||
obj.mlogb = row.mlogb;
|
||||
obj.note = row.note;
|
||||
obj.ftest = {};
|
||||
obj.ftest.test_date = that.handle_date;
|
||||
obj.ftest.test_user = that.handle_user;
|
||||
obj.ftest.qct = that.qct;
|
||||
obj.ftest.ftestitems = [];
|
||||
obj.ftest.ftestdefects = [];
|
||||
if(row.id!=''&&row.id!==undefined&&row.id!==null){
|
||||
obj.id = row.id;
|
||||
obj.ftest.qct = row.ftest.qct;
|
||||
obj.ftest.test_date = row.ftest.test_date;
|
||||
obj.ftest.test_user = row.ftest.test_user;
|
||||
row.ftest.ftestdefects.forEach((item) => {
|
||||
let itemObj = {};
|
||||
itemObj.id = item.id;
|
||||
itemObj.defect = item.defect;
|
||||
itemObj.test_user = item.test_user;
|
||||
itemObj.has = row[item.defect_name]?row[item.defect_name]:false;
|
||||
obj.ftest.ftestdefects.push(itemObj);
|
||||
})
|
||||
row.ftest.ftestitems.forEach((item1) => {
|
||||
let itemObj1 = {};
|
||||
itemObj1.id = item1.id;
|
||||
itemObj1.testitem = item1.testitem;
|
||||
itemObj1.test_user = item1.test_user;
|
||||
itemObj1.test_val_json = row[item1.testitem_name];
|
||||
obj.ftest.ftestitems.push(itemObj1);
|
||||
})
|
||||
}else{
|
||||
obj.ftest.qct = that.qct;
|
||||
obj.ftest.test_date = that.handle_date;
|
||||
obj.ftest.test_user = that.handle_user;
|
||||
that.qct_defects.forEach((item) => {
|
||||
let itemObj = {};
|
||||
itemObj.defect = item.defect;
|
||||
itemObj.test_user = that.handle_user;
|
||||
itemObj.has = row[item.defect_name]?row[item.defect_name]:false;
|
||||
obj.ftest.ftestdefects.push(itemObj);
|
||||
})
|
||||
that.qct_testitems.forEach((item1) => {
|
||||
let itemObj1 = {};
|
||||
itemObj1.testitem = item1.testitem;
|
||||
itemObj1.test_user = that.handle_user;
|
||||
itemObj1.test_val_json = row[item1.testitem_name];
|
||||
obj.ftest.ftestitems.push(itemObj1);
|
||||
})
|
||||
}
|
||||
that.qct_defects.forEach((item) => {
|
||||
let itemObj = {};
|
||||
itemObj.defect = item.defect;
|
||||
itemObj.test_user = that.handle_user;
|
||||
itemObj.has = row[item.defect_name]?row[item.defect_name]:false;
|
||||
obj.ftest.ftestdefects.push(itemObj);
|
||||
})
|
||||
that.qct_testitems.forEach((item1) => {
|
||||
let itemObj1 = {};
|
||||
itemObj1.testitem = item1.testitem;
|
||||
itemObj1.test_user = that.handle_user;
|
||||
itemObj1.test_val_json = row[item1.testitem_name];
|
||||
obj.ftest.ftestitems.push(itemObj1);
|
||||
})
|
||||
console.log('row:',row);
|
||||
console.log('obj:',obj);
|
||||
if(row.id!==''&&row.id!==undefined&&row.id!==null){
|
||||
obj.ftest.id = row.ftest.id;
|
||||
that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => {
|
||||
that.$message.success("保存成功");
|
||||
that.getList();
|
||||
|
|
Loading…
Reference in New Issue