|
|
|
@ -16,22 +16,22 @@
|
|
|
|
|
v-model="filterQuery.code"
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<el-form-item label="产品编码:">
|
|
|
|
|
<el-input v-model="filterQuery.productCode" placeholder="请输入产品编码" clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<el-form-item label="批次号:">
|
|
|
|
|
<el-input v-model="filterQuery.batchNo" placeholder="请输入批次号" clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<el-form-item label="产品编码:">
|
|
|
|
|
<el-input v-model="filterQuery.productCode" placeholder="请输入产品编码" clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<el-form-item label="批次号:">
|
|
|
|
|
<el-input v-model="filterQuery.batchNo" placeholder="请输入批次号" clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<el-form-item label="失效日期:">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
<el-date-picker
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
:picker-options="pickerOptions"
|
|
|
|
|
v-model="actDateRange"
|
|
|
|
@ -41,9 +41,9 @@
|
|
|
|
|
range-separator="至"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
@ -55,24 +55,24 @@
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="onSubmitFind">查询</el-button>
|
|
|
|
|
<!-- <el-button type="primary" icon="el-icon-plus" @click="newDistributionForm()" :loading="loading">手动新增</el-button> -->
|
|
|
|
|
<el-upload
|
|
|
|
|
:action="action"
|
|
|
|
|
:headers ="headers"
|
|
|
|
|
accept=".xml"
|
|
|
|
|
:on-preview="handlePreview"
|
|
|
|
|
:on-remove="handleRemove"
|
|
|
|
|
:before-remove="beforeRemove"
|
|
|
|
|
:on-success="handleSuccess"
|
|
|
|
|
:on-progress="handleProgress"
|
|
|
|
|
:on-error="handleError"
|
|
|
|
|
:before-upload="beforeUpload"
|
|
|
|
|
:limit="5"
|
|
|
|
|
:on-exceed="handleExceed"
|
|
|
|
|
:file-list="fileList"
|
|
|
|
|
:show-file-list="false"
|
|
|
|
|
:data="extraData">
|
|
|
|
|
<el-button size="small" icon="el-icon-upload" type="primary">文件上传</el-button>
|
|
|
|
|
<!-- <div slot="tip" class="el-upload__tip">只能上传xml文件,且不超过5M</div> -->
|
|
|
|
|
</el-upload>
|
|
|
|
|
:action="action"
|
|
|
|
|
:headers ="headers"
|
|
|
|
|
accept=".xml"
|
|
|
|
|
:on-preview="handlePreview"
|
|
|
|
|
:on-remove="handleRemove"
|
|
|
|
|
:before-remove="beforeRemove"
|
|
|
|
|
:on-success="handleSuccess"
|
|
|
|
|
:on-progress="handleProgress"
|
|
|
|
|
:on-error="handleError"
|
|
|
|
|
:before-upload="beforeUpload"
|
|
|
|
|
:limit="5"
|
|
|
|
|
:on-exceed="handleExceed"
|
|
|
|
|
:file-list="fileList"
|
|
|
|
|
:show-file-list="false"
|
|
|
|
|
:data="extraData">
|
|
|
|
|
<el-button size="small" icon="el-icon-upload" type="primary">文件上传</el-button>
|
|
|
|
|
<!-- <div slot="tip" class="el-upload__tip">只能上传xml文件,且不超过5M</div> -->
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-button-group>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -93,8 +93,8 @@
|
|
|
|
|
<el-table-column label="备注" prop="comment"></el-table-column>
|
|
|
|
|
<el-table-column label="操作" width="120px">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button type="text" size="small" @click.native="newDistributionForm(scope.$index, scope.row)">详情</el-button>
|
|
|
|
|
<el-button type="text" size="small" @click.native.stop="deleteDialog(scope.row)">删除</el-button>
|
|
|
|
|
<!-- <el-button type="text" size="small" @click.native="newDistributionForm(scope.$index, scope.row)">拼箱</el-button>-->
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -111,24 +111,31 @@
|
|
|
|
|
<el-dialog
|
|
|
|
|
:title="formName"
|
|
|
|
|
:visible.sync="newSpDistributionVisible"
|
|
|
|
|
width="85%"
|
|
|
|
|
width="45%"
|
|
|
|
|
append-to-body
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
:close-on-press-escape="false"
|
|
|
|
|
v-if="newSpDistributionVisible"
|
|
|
|
|
@close='closeDialog'
|
|
|
|
|
>
|
|
|
|
|
<operateRelCode
|
|
|
|
|
:closeDialog="closeDialog"
|
|
|
|
|
:orderQuery="idQuery"
|
|
|
|
|
></operateRelCode>
|
|
|
|
|
<el-table v-loading="loading" :data="codeArray" style="width: 100%;" max-height="800" height="500"
|
|
|
|
|
border
|
|
|
|
|
ref="multipleTable">
|
|
|
|
|
<el-table-column label="序号" type="index" width="55"></el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="追溯码"
|
|
|
|
|
prop="curCode"
|
|
|
|
|
width="280"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
></el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import {getList,delRelCode} from "@/api/collect/relCode";
|
|
|
|
|
import {getList,delRelCode,getDetailList} from "@/api/collect/relCode";
|
|
|
|
|
import {getAdminId, getToken} from '@/utils/auth';
|
|
|
|
|
import operateRelCode from "@/views/collect/relCode/operateRelCode"
|
|
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
@ -155,6 +162,7 @@ export default {
|
|
|
|
|
formData: null,
|
|
|
|
|
total: 0,
|
|
|
|
|
actDateRange:[],
|
|
|
|
|
codeArray:[],
|
|
|
|
|
scanCode:null,
|
|
|
|
|
pickerOptions: {
|
|
|
|
|
shortcuts: [
|
|
|
|
@ -228,25 +236,34 @@ export default {
|
|
|
|
|
this.showSearch = !this.showSearch;
|
|
|
|
|
},
|
|
|
|
|
newDistributionForm(index, row) {
|
|
|
|
|
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
|
|
|
|
|
this.idQuery = row;
|
|
|
|
|
this.formName = "拼箱";
|
|
|
|
|
this.newSpDistributionVisible = true;
|
|
|
|
|
} else {
|
|
|
|
|
this.formName = "新增";
|
|
|
|
|
this.newSpDistributionVisible = true;
|
|
|
|
|
this.formName = "码明细";
|
|
|
|
|
//获取码明细
|
|
|
|
|
let post = {
|
|
|
|
|
batchIdFk: row.id,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 500
|
|
|
|
|
}
|
|
|
|
|
getDetailList(post).then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.codeArray = response.data.list
|
|
|
|
|
this.newSpDistributionVisible = true;
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
closeDialog() {
|
|
|
|
|
this.newSpDistributionVisible = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.detailList = [];
|
|
|
|
|
},
|
|
|
|
|
enterKey(event){
|
|
|
|
|
this.onSubmitFind()
|
|
|
|
|
},
|
|
|
|
|
getInputFocus(event) {
|
|
|
|
|
event.currentTarget.select();
|
|
|
|
|
event.currentTarget.select();
|
|
|
|
|
},
|
|
|
|
|
enterKey(event){
|
|
|
|
|
this.onSubmitFind();
|
|
|
|
|
},
|
|
|
|
|
deleteDialog(row) {
|
|
|
|
|
this.$confirm("此操作将永久删除关联记录, 是否继续?", "提示", {
|
|
|
|
@ -256,16 +273,16 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
delRelCode({id:row.id})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.getList();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.getList();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
@ -351,31 +368,31 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
filters: {},
|
|
|
|
|
mounted() {
|
|
|
|
|
document.body.ondrop = function (event) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
event.stopPropagation();
|
|
|
|
|
};
|
|
|
|
|
var that = this;
|
|
|
|
|
var inputer = document.getElementById("inputer");
|
|
|
|
|
window.sc = new A.KeyScaner(inputer); //传入要监听的DOM节点
|
|
|
|
|
sc.onInput = function (text) {
|
|
|
|
|
if (text.includes("delete")) {
|
|
|
|
|
that.codeFormData.code = "";
|
|
|
|
|
that.sictomText = "";
|
|
|
|
|
that.originCode = "";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (that.sitcomScan) {
|
|
|
|
|
let tempTxt = text;
|
|
|
|
|
let str = tempTxt.replace(/[\r]/g, "");
|
|
|
|
|
that.sictomText = that.sictomText + str;
|
|
|
|
|
that.codeFormData.code = that.sictomText;
|
|
|
|
|
} else {
|
|
|
|
|
that.codeFormData.code = text;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
inputer.focus();
|
|
|
|
|
this.$refs.inputRef.focus();
|
|
|
|
|
document.body.ondrop = function (event) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
event.stopPropagation();
|
|
|
|
|
};
|
|
|
|
|
var that = this;
|
|
|
|
|
var inputer = document.getElementById("inputer");
|
|
|
|
|
window.sc = new A.KeyScaner(inputer); //传入要监听的DOM节点
|
|
|
|
|
sc.onInput = function (text) {
|
|
|
|
|
if (text.includes("delete")) {
|
|
|
|
|
that.codeFormData.code = "";
|
|
|
|
|
that.sictomText = "";
|
|
|
|
|
that.originCode = "";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (that.sitcomScan) {
|
|
|
|
|
let tempTxt = text;
|
|
|
|
|
let str = tempTxt.replace(/[\r]/g, "");
|
|
|
|
|
that.sictomText = that.sictomText + str;
|
|
|
|
|
that.codeFormData.code = that.sictomText;
|
|
|
|
|
} else {
|
|
|
|
|
that.codeFormData.code = text;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
inputer.focus();
|
|
|
|
|
this.$refs.inputRef.focus();
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|