teat:禅道416
This commit is contained in:
parent
15bb2a55ec
commit
a10f797569
|
|
@ -154,6 +154,7 @@ export default {
|
|||
},
|
||||
route_code:"",
|
||||
batchOrign:{},
|
||||
preselected:[],
|
||||
wprOptions: [],
|
||||
materialOptions: [],
|
||||
loading: false,
|
||||
|
|
@ -179,6 +180,7 @@ export default {
|
|||
that.$API.wpm.wpr.list.req({page:0,wm:id}).then((res) => {
|
||||
res.forEach(item=>{
|
||||
item.checked = false;
|
||||
item.disabled = that.preselected.some(r => r.id === item.id);
|
||||
})
|
||||
that.wprOptions = res;
|
||||
});
|
||||
|
|
@ -197,17 +199,22 @@ export default {
|
|||
obj.wm = that.batchOrign.id;
|
||||
obj.batch = that.batchOrign.batch+"-"+that.addBactchNum;
|
||||
that.addBactchNum++;
|
||||
obj.count = 0;
|
||||
obj.wm_in = "";
|
||||
obj.handoverbw=[];
|
||||
obj.handoverbw = that.preselected.map(r => ({ number: r.number, wpr: r.id }));
|
||||
obj.count = obj.handoverbw.length;
|
||||
that.form.handoverb.push(obj);
|
||||
})
|
||||
},
|
||||
//显示
|
||||
open(mode = "add",data,mtype) {
|
||||
open(mode = "add", data, mtype, preselected = []) {
|
||||
this.mode = mode;
|
||||
this.form.mtype = mtype;
|
||||
this.batchOrign = data;
|
||||
this.preselected = preselected;
|
||||
this.form.handoverb = [];
|
||||
this.wprOptions = [];
|
||||
this.lastBatchNum = 1;
|
||||
this.addBactchNum = 1;
|
||||
this.getWpr(data.id);
|
||||
this.getNum(data.batch);
|
||||
this.visible = true;
|
||||
|
|
|
|||
|
|
@ -9,12 +9,19 @@
|
|||
<h4>关联产品</h4>
|
||||
<el-button v-if="mode=='out'" type="primary" @click="wprNumberChange">发货编号</el-button>
|
||||
<el-button v-if="mode=='out'" type="warning" @click="wprNumberClear">清空编号</el-button>
|
||||
<el-button type="primary" @click="openSplit">拆批</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
:disabled="selectedRows.length === 0"
|
||||
:loading="batchCoderLoading"
|
||||
@click="batchSendToCoder"
|
||||
>批量喷码</el-button>
|
||||
>批量喷数字码</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
:disabled="selectedRows.length === 0"
|
||||
:loading="batchCoderLoading2"
|
||||
@click="batchSendToCoder2"
|
||||
>批量喷二维码</el-button>
|
||||
<el-input
|
||||
style="margin-right: 5px;width: 200px;"
|
||||
v-model="search"
|
||||
|
|
@ -57,12 +64,13 @@
|
|||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="200"
|
||||
width="220"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button v-if="mode=='ins'&&mgroupName=='毛坯检测后打码'" @click="QRCode(scope.row)" type="success">二维码</el-button>
|
||||
<el-button @click="printMaterial(scope.row)" type="primary">打签</el-button>
|
||||
<el-button @click="sendToCoder(scope.row)" type="warning" :loading="!!coderLoadingIds[scope.row.id]" :disabled="!!coderLoadingIds[scope.row.id]">喷码</el-button>
|
||||
<el-button @click="sendToCoder(scope.row,'coder_field')" type="warning" :loading="!!coderLoadingIds[scope.row.id]" :disabled="!!coderLoadingIds[scope.row.id]">喷码</el-button>
|
||||
<el-button @click="sendToCoder(scope.row,'coder_field2')" type="warning" :loading="!!coderLoadingIds[scope.row.id]" :disabled="!!coderLoadingIds[scope.row.id]">喷码</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -75,6 +83,12 @@
|
|||
</el-main>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
<handover-form2
|
||||
ref="splitDialog"
|
||||
:mgroupId="mgroupId"
|
||||
:process="process"
|
||||
@success="getRowWpr"
|
||||
></handover-form2>
|
||||
<el-dialog title="设置发货编号" v-model="showBatch">
|
||||
<el-form :model="wprParams" label-width="80px">
|
||||
<el-form-item label="编号前缀">
|
||||
|
|
@ -100,8 +114,10 @@
|
|||
</template>
|
||||
<script>
|
||||
import { wmState } from "@/utils/enum.js";
|
||||
import handoverForm2 from "./handover_form2.vue";
|
||||
export default {
|
||||
name: "inm_record",
|
||||
components: { handoverForm2 },
|
||||
props: {
|
||||
wm: { type: String, default: "" },
|
||||
mgroupId: { type: String, default: "" },
|
||||
|
|
@ -131,6 +147,7 @@ export default {
|
|||
wprList:[],
|
||||
selectedRows:[],
|
||||
batchCoderLoading: false,
|
||||
batchCoderLoading2: false,
|
||||
digitNum:3,
|
||||
wprTableHeight:500,
|
||||
printer_name:localStorage.getItem("printer_name"),
|
||||
|
|
@ -355,7 +372,7 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
|
|||
};
|
||||
},
|
||||
//下发喷码: 单行入队 1 条
|
||||
sendToCoder(row){
|
||||
sendToCoder(row, coderFieldKey = 'coder_field'){
|
||||
let that = this;
|
||||
if (that.coderLoadingIds[row.id]) return;
|
||||
let release = () => {
|
||||
|
|
@ -364,7 +381,7 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
|
|||
that.coderLoadingIds = map;
|
||||
};
|
||||
that.coderLoadingIds = { ...that.coderLoadingIds, [row.id]: true };
|
||||
that._postCoder([that.rowToTdata(row)])
|
||||
that._postCoder([that.rowToTdata(row)],coderFieldKey)
|
||||
.then(() => that.$message.success("喷码下发成功"))
|
||||
.finally(release);
|
||||
},
|
||||
|
|
@ -377,16 +394,26 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
|
|||
if (!that.selectedRows.length || that.batchCoderLoading) return;
|
||||
let tdataList = that.selectedRows.map(r => that.rowToTdata(r));
|
||||
that.batchCoderLoading = true;
|
||||
that._postCoder(tdataList)
|
||||
that._postCoder(tdataList, 'coder_field')
|
||||
.then(() => that.$message.success(`已入队 ${tdataList.length} 条`))
|
||||
.finally(() => { that.batchCoderLoading = false; });
|
||||
},
|
||||
//批量喷码2: 使用 coder_field2
|
||||
batchSendToCoder2(){
|
||||
let that = this;
|
||||
if (!that.selectedRows.length || that.batchCoderLoading2) return;
|
||||
let tdataList = that.selectedRows.map(r => that.rowToTdata(r));
|
||||
that.batchCoderLoading2 = true;
|
||||
that._postCoder(tdataList, 'coder_field2')
|
||||
.then(() => that.$message.success(`已入队 ${tdataList.length} 条`))
|
||||
.finally(() => { that.batchCoderLoading2 = false; });
|
||||
},
|
||||
//公共: 查模板 + 拼 body + 调接口
|
||||
_postCoder(tdataList){
|
||||
_postCoder(tdataList, coderFieldKey = 'coder_field'){
|
||||
let that = this;
|
||||
let coder_ip = localStorage.getItem('coder_ip') || '';
|
||||
let coder_port = localStorage.getItem('coder_port') || '';
|
||||
let coder_field = localStorage.getItem('coder_field') || '';
|
||||
let coder_field = localStorage.getItem(coderFieldKey) || '';
|
||||
if (!coder_ip) {
|
||||
that.$message.error('请先在右上角"喷码设置"配置喷码IP');
|
||||
return Promise.reject(new Error('no coder_ip'));
|
||||
|
|
@ -405,6 +432,15 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
|
|||
return that.$API.cm.labeltemplate.sendToCoder.req(template.id, body);
|
||||
});
|
||||
},
|
||||
openSplit() {
|
||||
let that = this;
|
||||
let data = {
|
||||
id: that.wm,
|
||||
batch: that.ofromBatch,
|
||||
count: that.wprList.length,
|
||||
};
|
||||
that.$refs.splitDialog.open("add", data, 20, that.selectedRows);
|
||||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess() {
|
||||
this.$refs.tables.refresh();
|
||||
|
|
|
|||
Loading…
Reference in New Issue