Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
553f2761bb
|
@ -298,6 +298,32 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mlogbw: {
|
||||||
|
list: {
|
||||||
|
name: "列表",
|
||||||
|
req: async function (data) {
|
||||||
|
return await http.get(`${config.API_URL}/wpm/mlogbw/`, data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
name: "创建",
|
||||||
|
req: async function (data) {
|
||||||
|
return await http.post(`${config.API_URL}/wpm/mlogbw/`, data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: "更新",
|
||||||
|
req: async function (id, data) {
|
||||||
|
return await http.put(`${config.API_URL}/wpm/mlogbw/${id}/`,data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
del: {
|
||||||
|
name: "删除",
|
||||||
|
req: async function (id) {
|
||||||
|
return await http.delete(`${config.API_URL}/wpm/mlogbw/${id}/`);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
handover: {
|
handover: {
|
||||||
list: {
|
list: {
|
||||||
name: "值班记录列表",
|
name: "值班记录列表",
|
||||||
|
|
|
@ -77,6 +77,16 @@
|
||||||
hidePagination
|
hidePagination
|
||||||
hideDo
|
hideDo
|
||||||
>
|
>
|
||||||
|
<!-- <el-table-column type="expand">
|
||||||
|
<template #default="props">
|
||||||
|
<div style="padding-left: 50px" v-if="props.row.wproducts.length > 0&&props.row.wproducts.test_json">
|
||||||
|
<el-descriptions :column="4" v-for="item in props.row.wproducts.test_json" :key="item.id">
|
||||||
|
<el-descriptions-item label="破损">
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="物料"
|
label="物料"
|
||||||
|
@ -140,6 +150,17 @@
|
||||||
width="100px"
|
width="100px"
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="table_check(scope.row)"
|
||||||
|
v-if="project_code=='bxerp'&&mioObj.state == 10 &&
|
||||||
|
(type == 'pur_in' ||type == 'do_in' ||type == 'other_in')"
|
||||||
|
v-auth="'mioitem.test'"
|
||||||
|
>
|
||||||
|
检验
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
|
@ -268,7 +289,8 @@ export default {
|
||||||
// type: "",
|
// type: "",
|
||||||
// cate: "",
|
// cate: "",
|
||||||
objitem: {},
|
objitem: {},
|
||||||
mtype:10
|
mtype:10,
|
||||||
|
project_code:''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -276,6 +298,7 @@ export default {
|
||||||
// this.cate = this.$route.query.cate;
|
// this.cate = this.$route.query.cate;
|
||||||
// this.mioId = this.$route.query.mio;
|
// this.mioId = this.$route.query.mio;
|
||||||
// this.params.mio = this.$route.query.mio;
|
// this.params.mio = this.$route.query.mio;
|
||||||
|
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
|
||||||
this.params.mio = this.mioId;
|
this.params.mio = this.mioId;
|
||||||
this.apiObj = this.$API.inm.mioitem.list;
|
this.apiObj = this.$API.inm.mioitem.list;
|
||||||
this.getMio();
|
this.getMio();
|
||||||
|
@ -302,20 +325,15 @@ export default {
|
||||||
table_del(row) {
|
table_del(row) {
|
||||||
this.$confirm(`确定删除吗?`, "提示", {
|
this.$confirm(`确定删除吗?`, "提示", {
|
||||||
type: "warning",
|
type: "warning",
|
||||||
})
|
}).then(() => {
|
||||||
.then(() => {
|
this.$API.inm.mioitem.delete.req(row.id).then((res) => {
|
||||||
this.$API.inm.mioitem.delete
|
this.$message.success("删除成功");
|
||||||
.req(row.id)
|
this.$refs.table.refresh();
|
||||||
.then((res) => {
|
return res;
|
||||||
this.$message.success("删除成功");
|
}).catch((err) => {
|
||||||
this.$refs.table.refresh();
|
return err;
|
||||||
return res;
|
});
|
||||||
})
|
}).catch(() => {});
|
||||||
.catch((err) => {
|
|
||||||
return err;
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
},
|
||||||
//检验
|
//检验
|
||||||
table_check(row) {
|
table_check(row) {
|
||||||
|
@ -365,6 +383,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleCheckSuccess() {
|
handleCheckSuccess() {
|
||||||
this.$refs.table.refresh();
|
this.$refs.table.refresh();
|
||||||
|
this.dialog.check = false;
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.$refs.table.queryData(this.query);
|
this.$refs.table.queryData(this.query);
|
||||||
|
|
|
@ -1199,6 +1199,7 @@ export default {
|
||||||
that.qct_testitems.forEach((item) => {
|
that.qct_testitems.forEach((item) => {
|
||||||
let val = that.form[item.testitem_name];
|
let val = that.form[item.testitem_name];
|
||||||
let obj0 = {};
|
let obj0 = {};
|
||||||
|
obj0.testitem_name = item.testitem_name;
|
||||||
obj0.val = val;
|
obj0.val = val;
|
||||||
test_json[item.id] =obj0;
|
test_json[item.id] =obj0;
|
||||||
})
|
})
|
||||||
|
|
|
@ -156,19 +156,11 @@
|
||||||
@success="handleinmSuccess"
|
@success="handleinmSuccess"
|
||||||
>
|
>
|
||||||
</save-dialog>
|
</save-dialog>
|
||||||
<print-dialog
|
|
||||||
v-if="dialog.print_m"
|
|
||||||
ref="printmaterial"
|
|
||||||
:mId="wmId"
|
|
||||||
:mtype="wmtype"
|
|
||||||
:apiObj="apiObjPrint"
|
|
||||||
></print-dialog>
|
|
||||||
</el-container>
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { wmState } from "@/utils/enum.js";
|
import { wmState } from "@/utils/enum.js";
|
||||||
import materials from "./../mtm/materials.vue";
|
import materials from "./../mtm/materials.vue";
|
||||||
import printDialog from "./../template/printmaterial.vue";
|
|
||||||
import checkDialog from "./check_form.vue";
|
import checkDialog from "./check_form.vue";
|
||||||
import showDrawer from "./check_drawer.vue";
|
import showDrawer from "./check_drawer.vue";
|
||||||
import scrapDialog from "./handover_form.vue";
|
import scrapDialog from "./handover_form.vue";
|
||||||
|
@ -186,7 +178,6 @@ export default {
|
||||||
checkDialog,
|
checkDialog,
|
||||||
showDrawer,
|
showDrawer,
|
||||||
scrapDialog,
|
scrapDialog,
|
||||||
printDialog
|
|
||||||
},
|
},
|
||||||
name: "wmaterial",
|
name: "wmaterial",
|
||||||
data() {
|
data() {
|
||||||
|
@ -207,7 +198,6 @@ export default {
|
||||||
scrap: false,
|
scrap: false,
|
||||||
permission: false,
|
permission: false,
|
||||||
inmRecord:false,
|
inmRecord:false,
|
||||||
print_m:false
|
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [],
|
||||||
selection: [],
|
selection: [],
|
||||||
|
@ -228,8 +218,8 @@ export default {
|
||||||
materialsVisible:false,
|
materialsVisible:false,
|
||||||
visibleDrawer: false,
|
visibleDrawer: false,
|
||||||
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
||||||
wmId:'',
|
printer_name:localStorage.getItem("printer_name"),
|
||||||
mgroup_name:''
|
mgroup_name:'',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -360,11 +350,24 @@ export default {
|
||||||
//打印物料标签
|
//打印物料标签
|
||||||
printMaterial(row){
|
printMaterial(row){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.wmId = row.id;
|
that.apiObj.req({tid:row.id}).then((res) => {
|
||||||
that.wmtype = row.material_.type;
|
let code = res.code_label;
|
||||||
that.dialog.print_m = true;
|
let str = [
|
||||||
this.$nextTick(() => {
|
"SIZE 40 mm,70 mm",
|
||||||
this.$refs.printmaterial.open();
|
"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("打印成功");
|
||||||
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -218,14 +218,18 @@
|
||||||
width="100px"
|
width="100px"
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
<!-- 批次 -->
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link type="primary"
|
||||||
type="primary"
|
v-if="mlogItem.submit_time == null&&mlogItem.material_out_&&mlogItem.material_out_.tracking==10"
|
||||||
:disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1)"
|
|
||||||
@click="table_out_check(scope.row)"
|
@click="table_out_check(scope.row)"
|
||||||
>
|
>详情</el-button>
|
||||||
检验
|
<!-- 单个 -->
|
||||||
</el-button>
|
<el-button
|
||||||
|
link type="primary"
|
||||||
|
v-if="mlogItem.submit_time == null&&mlogItem.material_out_&&mlogItem.material_out_.tracking==20"
|
||||||
|
@click="table_out_check_single(scope.row)"
|
||||||
|
>详情</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</scTable>
|
</scTable>
|
||||||
|
@ -272,6 +276,14 @@
|
||||||
@closed="dialog.check = false"
|
@closed="dialog.check = false"
|
||||||
>
|
>
|
||||||
</check-dialog>
|
</check-dialog>
|
||||||
|
<scheck-dialog
|
||||||
|
v-if="dialog.check_single"
|
||||||
|
ref="checkDialogSingle"
|
||||||
|
:mlogb="mlogb"
|
||||||
|
@success="handlesCheckSuccess"
|
||||||
|
@closed="dialog.check_single = false"
|
||||||
|
>
|
||||||
|
</scheck-dialog>
|
||||||
<edit-dialog
|
<edit-dialog
|
||||||
v-if="dialog.edit"
|
v-if="dialog.edit"
|
||||||
ref="editDialog"
|
ref="editDialog"
|
||||||
|
@ -284,13 +296,6 @@
|
||||||
<el-dialog v-model="printVisible" width="1200px">
|
<el-dialog v-model="printVisible" width="1200px">
|
||||||
<print :baseData="mlogItem" :tableData="tableData" :tableData2="tableData2" type="102" @closePrint="printVisible=false"/>
|
<print :baseData="mlogItem" :tableData="tableData" :tableData2="tableData2" type="102" @closePrint="printVisible=false"/>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<print-dialog
|
|
||||||
v-if="dialog.print_m"
|
|
||||||
ref="printmaterial"
|
|
||||||
:mId="wmId"
|
|
||||||
:mtype="wmtype"
|
|
||||||
:apiObj="apiObjPrint"
|
|
||||||
></print-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
@ -298,8 +303,8 @@
|
||||||
import editDialog from "./mlog_form.vue";
|
import editDialog from "./mlog_form.vue";
|
||||||
import saveDialog from "./mlogb_form.vue";
|
import saveDialog from "./mlogb_form.vue";
|
||||||
import checkDialog from "./mlogb_check.vue";
|
import checkDialog from "./mlogb_check.vue";
|
||||||
|
import scheckDialog from "./mlogbw_check.vue";
|
||||||
import print from "./../setting/print/A4.vue";
|
import print from "./../setting/print/A4.vue";
|
||||||
import printDialog from "./../template/printmaterial.vue";
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
mlogId: {
|
mlogId: {
|
||||||
|
@ -311,8 +316,8 @@ export default {
|
||||||
editDialog,
|
editDialog,
|
||||||
saveDialog,
|
saveDialog,
|
||||||
checkDialog,
|
checkDialog,
|
||||||
print,
|
scheckDialog,
|
||||||
printDialog
|
print
|
||||||
},
|
},
|
||||||
emits: ["success", "closed"],
|
emits: ["success", "closed"],
|
||||||
data() {
|
data() {
|
||||||
|
@ -325,6 +330,7 @@ export default {
|
||||||
edit: false,
|
edit: false,
|
||||||
check: false,
|
check: false,
|
||||||
print_m:false,
|
print_m:false,
|
||||||
|
check_single: false,
|
||||||
},
|
},
|
||||||
apiObj: null,
|
apiObj: null,
|
||||||
apiObjWm:null,
|
apiObjWm:null,
|
||||||
|
@ -343,6 +349,7 @@ export default {
|
||||||
mlog: "",
|
mlog: "",
|
||||||
material_out__isnull: 0,
|
material_out__isnull: 0,
|
||||||
},
|
},
|
||||||
|
mlogb:"",
|
||||||
mgroup: "",
|
mgroup: "",
|
||||||
mlogItem: {},
|
mlogItem: {},
|
||||||
saveInForm: {
|
saveInForm: {
|
||||||
|
@ -358,6 +365,7 @@ export default {
|
||||||
options: [],
|
options: [],
|
||||||
tableData:[],
|
tableData:[],
|
||||||
tableData2:[],
|
tableData2:[],
|
||||||
|
isSingle:true,
|
||||||
saveInDialog: false,
|
saveInDialog: false,
|
||||||
printVisible:false,
|
printVisible:false,
|
||||||
setFiltersVisible: false,
|
setFiltersVisible: false,
|
||||||
|
@ -370,11 +378,10 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
wmId:'',
|
|
||||||
wmtype:'',
|
|
||||||
materialOut:'',
|
materialOut:'',
|
||||||
batchContains:'',
|
batchContains:'',
|
||||||
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
||||||
|
printer_name:localStorage.getItem("printer_name")
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -488,7 +495,16 @@ export default {
|
||||||
this.$refs.checkDialog.open(obj);
|
this.$refs.checkDialog.open(obj);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
table_out_check_single(row){
|
||||||
|
this.dialog.check_single = true;
|
||||||
|
this.mlogb = row.id;
|
||||||
|
let obj = {};
|
||||||
|
Object.assign(obj, row);
|
||||||
|
obj.mgroup_name = this.mlogItem.mgroup_name;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.checkDialogSingle.open(obj);
|
||||||
|
});
|
||||||
|
},
|
||||||
//表单提交方法
|
//表单提交方法
|
||||||
mlogSubmit() {
|
mlogSubmit() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
@ -505,6 +521,7 @@ export default {
|
||||||
handleCheckSuccess() {
|
handleCheckSuccess() {
|
||||||
this.$refs.tableOut.refresh();
|
this.$refs.tableOut.refresh();
|
||||||
},
|
},
|
||||||
|
handlesCheckSuccess(){},
|
||||||
fileUPSuccess(res) {
|
fileUPSuccess(res) {
|
||||||
let that = this;
|
let that = this;
|
||||||
console.log('res',res);
|
console.log('res',res);
|
||||||
|
@ -526,11 +543,24 @@ export default {
|
||||||
//打印物料标签
|
//打印物料标签
|
||||||
printMaterial(row){
|
printMaterial(row){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.wmId = row.id;
|
that.apiObj.req({tid:row.id}).then((res) => {
|
||||||
that.wmtype = row.material_.type;
|
let code = res.code_label;
|
||||||
that.dialog.print_m = true;
|
let str = [
|
||||||
this.$nextTick(() => {
|
"SIZE 40 mm,70 mm",
|
||||||
this.$refs.printmaterial.open();
|
"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("打印成功");
|
||||||
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -36,7 +36,14 @@
|
||||||
<el-form-item label="批次号" prop="wm_in">
|
<el-form-item label="批次号" prop="wm_in">
|
||||||
<el-input ref="codeInput" v-model="wm_in" clearable @change="formWminChange(wm_in)"></el-input>
|
<el-input ref="codeInput" v-model="wm_in" clearable @change="formWminChange(wm_in)"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="使用数量" prop="count_use">
|
||||||
|
<el-input-number ref="codeInput" v-model="form.count_use" clearable></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<el-footer v-if="mgroup_code == 'paiyicibang'||mgroup_code == 'paiercibang'">
|
||||||
|
<el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
|
||||||
|
<el-button @click="visibleDrawer = false">取消</el-button>
|
||||||
|
</el-footer>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -47,7 +54,7 @@ const defaultForm = {
|
||||||
mlog: "",
|
mlog: "",
|
||||||
mtask: "",
|
mtask: "",
|
||||||
batch: "",
|
batch: "",
|
||||||
wn_in: "",
|
wm_in: "",
|
||||||
count_use: 1,
|
count_use: 1,
|
||||||
note:''
|
note:''
|
||||||
};
|
};
|
||||||
|
@ -90,15 +97,18 @@ export default {
|
||||||
wm_in:'',
|
wm_in:'',
|
||||||
options: [],
|
options: [],
|
||||||
materialOptions: [],
|
materialOptions: [],
|
||||||
|
mgroup_code:'',
|
||||||
visible: false,
|
visible: false,
|
||||||
isSaveing: false,
|
isSaveing: false,
|
||||||
setFiltersVisible: false,
|
setFiltersVisible: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.form.mlog = this.mlog;
|
||||||
|
let arr = this.$route.path.split("/");
|
||||||
|
this.mgroup_code = arr[2];
|
||||||
this.getMtask();
|
this.getMtask();
|
||||||
this.getMaterial();
|
this.getMaterial();
|
||||||
this.form.mlog = this.mlog;
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
|
@ -107,38 +117,34 @@ export default {
|
||||||
//获取任务列表
|
//获取任务列表
|
||||||
getMtask() {
|
getMtask() {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.$API.pm.mtask.list
|
this.$API.pm.mtask.list.req({ page: 0, mgroup: that.mgroup, state: 20 }).then((res) => {
|
||||||
.req({ page: 0, mgroup: that.mgroup, state: 20 })
|
that.options = res;
|
||||||
.then((res) => {
|
});
|
||||||
that.options = res;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
//获取车间物料
|
//获取车间物料
|
||||||
getMaterial() {
|
getMaterial() {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.$API.wpm.wmaterial.list
|
this.$API.wpm.wmaterial.list.req({
|
||||||
.req({
|
mtaskx: that.form.mtask,
|
||||||
mtaskx: that.form.mtask,
|
mgroupx: that.mgroup,
|
||||||
mgroupx: that.mgroup,
|
material: that.materialIn,
|
||||||
material: that.materialIn,
|
page: 0,
|
||||||
page: 0,
|
}).then((res) => {
|
||||||
})
|
that.materialOptions = res;
|
||||||
.then((res) => {
|
});
|
||||||
that.materialOptions = res;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
//扫描后处理方法
|
//扫描后处理方法
|
||||||
formWminChange(wm_in){
|
formWminChange(wm_in){
|
||||||
// wn_in:扫码获取的内容
|
// wm_in:扫码获取的内容
|
||||||
let that = this;
|
let that = this;
|
||||||
let arr = that.materialOptions.filter((item) => {
|
let arr = that.materialOptions.filter((item) => {
|
||||||
return item.batch == wm_in;
|
return item.batch == wm_in;
|
||||||
});
|
});
|
||||||
if (arr.length > 0) {
|
if (arr.length > 0) {
|
||||||
that.form.wm_in = arr[0].id;
|
that.form.wm_in = arr[0].id;
|
||||||
// that.form.mtask = that.mtask;
|
if(that.mgroup_code == 'paiyicibang'||that.mgroup_code == 'paiercibang'){}else{
|
||||||
//提交
|
that.submit();//提交
|
||||||
that.submit();
|
}
|
||||||
}else{
|
}else{
|
||||||
that.wm_in = '';
|
that.wm_in = '';
|
||||||
that.$message.error("批次号不存在");
|
that.$message.error("批次号不存在");
|
||||||
|
|
|
@ -0,0 +1,199 @@
|
||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
title="输出物料详情"
|
||||||
|
v-model="visible"
|
||||||
|
:size="'80%'"
|
||||||
|
destroy-on-close
|
||||||
|
@closed="$emit('closed')"
|
||||||
|
>
|
||||||
|
<sc-form-table
|
||||||
|
hideDelete
|
||||||
|
:tableHeight="500"
|
||||||
|
v-model="mlogbwlist"
|
||||||
|
:addTemplate="addTemplate"
|
||||||
|
placeholder="暂无数据"
|
||||||
|
>
|
||||||
|
<el-table-column prop="number" label="物料编号">
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-if="!scope.row.isEdit">{{ scope.row.number }}</span>
|
||||||
|
<el-input v-else v-model="scope.row.number" placeholder="物料编号"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="note" label="备注">
|
||||||
|
<template #default="scope">
|
||||||
|
<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 prop="open" label="操作" width="125" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
v-if="scope.row.isEdit"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="formTableSave(scope.row)"
|
||||||
|
>保存</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-else
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="formTableEdit(scope.row)"
|
||||||
|
>编辑</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-if="!scope.row.isEdit"
|
||||||
|
text
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
@click="formTableDel(scope.row.id)"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</sc-form-table>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
mlogb: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emits: ["success", "closed"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
//表单数据
|
||||||
|
form: {},
|
||||||
|
mgroup: "",
|
||||||
|
params: {mlogb:'',page:0},
|
||||||
|
visible: false,
|
||||||
|
mlogbwlist:[],
|
||||||
|
addTemplate:{
|
||||||
|
mlogb: "",
|
||||||
|
number: "",
|
||||||
|
note: "",
|
||||||
|
isEdit: true,
|
||||||
|
},
|
||||||
|
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
||||||
|
printer_name:localStorage.getItem("printer_name")
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
|
||||||
|
that.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
getList(){
|
||||||
|
let that = this;
|
||||||
|
that.mlogbwlist = [];
|
||||||
|
that.$API.wpm.mlogbw.list.req(that.params).then((res) => {
|
||||||
|
if(res.length>0){
|
||||||
|
res.forEach((item) => {
|
||||||
|
let obj = Object.assign({},item);
|
||||||
|
obj.isEdit = false;
|
||||||
|
that.mlogbwlist.push(obj);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//添加
|
||||||
|
formTableSave(row) {
|
||||||
|
let that = this;
|
||||||
|
if(row.id!==''&&row.id!==undefined&&row.id!==null){
|
||||||
|
that.$API.wpm.mlogbw.update.req(row.id,row).then((res) => {
|
||||||
|
that.$message.success("保存成功");
|
||||||
|
that.getList();
|
||||||
|
return res;
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
that.$API.wpm.mlogbw.create.req(row).then((res) => {
|
||||||
|
that.$message.success("添加成功");
|
||||||
|
that.getList();
|
||||||
|
return res;
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
formTableEdit(row) {
|
||||||
|
this.mlogbwlist.forEach((item, index) => {
|
||||||
|
if (item.id == row.id) {
|
||||||
|
this.mlogbwlist[index].isEdit = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//删除
|
||||||
|
formTableDel(id) {
|
||||||
|
let that = this;
|
||||||
|
that.$confirm(`确定删除吗?`, "提示", {
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
that.$API.wpm.mlogbw.delete.req(id).then((res) => {
|
||||||
|
that.$message.success("删除成功");
|
||||||
|
that.getList();
|
||||||
|
return res;
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
//表单提交方法
|
||||||
|
mlogbSubmit() {
|
||||||
|
let that = this;
|
||||||
|
that.$API.wpm.mlogb.submit.req(that.mlogb).then((res) => {
|
||||||
|
that.isSaveing = false;
|
||||||
|
that.visible = false;
|
||||||
|
that.$message.success("操作成功");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//设置过滤项
|
||||||
|
setFilters(filters) {
|
||||||
|
this.selectionFilters = filters;
|
||||||
|
this.setFiltersVisible = true;
|
||||||
|
},
|
||||||
|
handlePrint(){
|
||||||
|
let that = this;
|
||||||
|
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>
|
||||||
|
|
||||||
|
<style></style>
|
Loading…
Reference in New Issue