完成页面开发:到派扫描、派件扫描、留仓扫描
This commit is contained in:
parent
524e0ccc5c
commit
e051f105c1
@ -35,6 +35,15 @@ export function getNextStationList(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取“上一站”列表
|
||||||
|
export function getPreStationList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/emis/emisTmsScanRecord/getPreStationList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 新增网点
|
// 新增网点
|
||||||
export function addEmisSite(data) {
|
export function addEmisSite(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
190
src/views/emis/EmisBaseTools/EmisGetPreSitePicker.vue
Normal file
190
src/views/emis/EmisBaseTools/EmisGetPreSitePicker.vue
Normal file
@ -0,0 +1,190 @@
|
|||||||
|
<template>
|
||||||
|
<!-- :loading="loading" -->
|
||||||
|
<!-- v-el-select-loadmore="loadmore" -->
|
||||||
|
<!-- <i class="el-icon-arrow-down select-down" :class="visible&&'rotate180'"></i> -->
|
||||||
|
|
||||||
|
<el-select
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
autocomplete="false"
|
||||||
|
ref="selectDom"
|
||||||
|
v-model="svalue"
|
||||||
|
remote
|
||||||
|
:remote-method="queryData"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
style="width: 100%;"
|
||||||
|
:disabled="disabled"
|
||||||
|
@focus="onFocus"
|
||||||
|
class="remote-select"
|
||||||
|
@change="onChange"
|
||||||
|
@clear="onClear"
|
||||||
|
@visible-change="reverseArrow"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in dataList" :key="item.startSite" :label="item.startSite+'-'+item.startSiteName" :value="item.startSite" ></el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getPreStationList } from "@/api/emis/emisSite";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "EmisSiteSimplePicker",
|
||||||
|
components: {
|
||||||
|
|
||||||
|
},
|
||||||
|
dicts: [],
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
countryCode: {
|
||||||
|
type: String,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
// siteType:{
|
||||||
|
// type: [String,Number],
|
||||||
|
// required: false
|
||||||
|
// },
|
||||||
|
isInitiated:{
|
||||||
|
type: [Boolean,String],
|
||||||
|
required: false,
|
||||||
|
default:false
|
||||||
|
},
|
||||||
|
disabled:{
|
||||||
|
type: [Boolean,String],
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading:false,
|
||||||
|
visible:false,
|
||||||
|
dataList: [],
|
||||||
|
svalue: this.value,
|
||||||
|
filterMap:new Map(),
|
||||||
|
firstFlag:true,
|
||||||
|
queryParams:{
|
||||||
|
pageNum:1,
|
||||||
|
pageSize:20,
|
||||||
|
searchValue:null,
|
||||||
|
// siteType:this.siteType,
|
||||||
|
countryCode:this.countryCode,
|
||||||
|
startSite:null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value(newVal) {
|
||||||
|
this.svalue = newVal;
|
||||||
|
console.log("000=>"+this.svalue);
|
||||||
|
this.firstFlag = true;
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
// siteType(newVal, oldVal) {
|
||||||
|
// if(newVal!= oldVal ){
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// countryCode(newVal, oldVal) {
|
||||||
|
// if(newVal!= oldVal ){
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
// this.queryData();
|
||||||
|
},
|
||||||
|
beforeDestroy(){
|
||||||
|
this.firstFlag = true;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onChange() {
|
||||||
|
this.$emit("input", this.svalue);
|
||||||
|
let itemData=this.filterMap[this.svalue];
|
||||||
|
this.$emit("onChange",itemData);
|
||||||
|
},
|
||||||
|
onClear(){
|
||||||
|
this.queryParams.searchValue=null;
|
||||||
|
this.queryData();
|
||||||
|
},
|
||||||
|
onFocus(){
|
||||||
|
this.queryData();
|
||||||
|
},
|
||||||
|
initData(){
|
||||||
|
if(this.svalue && this.firstFlag ){
|
||||||
|
let queryParams = {
|
||||||
|
startSite:this.svalue
|
||||||
|
}
|
||||||
|
getPreStationList(queryParams).then(response => {
|
||||||
|
this.dataList=response.rows;
|
||||||
|
const curItem = response.rows[0];
|
||||||
|
let curOption = {
|
||||||
|
currentLabel: curItem.startSiteName,
|
||||||
|
currentValue: curItem.startSite,
|
||||||
|
label:curItem.startSiteName,
|
||||||
|
value:curItem.startSite,
|
||||||
|
}
|
||||||
|
this.$refs.selectDom.cachedOptions.push(curOption)
|
||||||
|
response.rows.forEach(item => {
|
||||||
|
if(!this.filterMap.hasOwnProperty(item.startSite)){
|
||||||
|
this.filterMap[item.startSite]=item;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.firstFlag = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
queryData(val) {
|
||||||
|
if(val && this.queryParams.pageNum == 1){
|
||||||
|
this.dataList=[];
|
||||||
|
}
|
||||||
|
this.queryParams.searchValue=val;
|
||||||
|
getPreStationList(this.queryParams).then(response => {
|
||||||
|
this.dataList=response.rows;
|
||||||
|
response.rows.forEach(item => {
|
||||||
|
if(!this.filterMap.hasOwnProperty(item.startSite)){
|
||||||
|
this.filterMap[item.startSite]=item;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// loadmore() {
|
||||||
|
// this.visible = true
|
||||||
|
// this.queryParams.pageNum++;
|
||||||
|
// this.queryData();
|
||||||
|
// },
|
||||||
|
reverseArrow(flag) {
|
||||||
|
let rulesDom = this.$refs["selectDom"].$el.querySelector(
|
||||||
|
".el-input .el-input__suffix .el-input__suffix-inner .el-input__icon"
|
||||||
|
); // 找到dom
|
||||||
|
if (flag) {
|
||||||
|
rulesDom.classList.add("is-reverse"); // 对dom新增class
|
||||||
|
} else {
|
||||||
|
rulesDom.classList.remove("is-reverse"); // 对dom新增class
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
// right: 30px;
|
||||||
|
// cursor: pointer;
|
||||||
|
:deep .el-select.remote-select{
|
||||||
|
.el-select__caret::before{
|
||||||
|
content: '\e6e1';
|
||||||
|
}
|
||||||
|
.is-focus{
|
||||||
|
.el-select__caret{
|
||||||
|
transform: rotateZ(0deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
547
src/views/emis/emisTmsScanRecord/arrivalAndDispathScan.vue
Normal file
547
src/views/emis/emisTmsScanRecord/arrivalAndDispathScan.vue
Normal file
@ -0,0 +1,547 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="0">
|
||||||
|
<el-form ref="form" size="mini" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="扫描单号" prop="billCode" label-width="70px">
|
||||||
|
<span slot="label">
|
||||||
|
<span style="color: red">扫描单号</span>
|
||||||
|
</span>
|
||||||
|
<el-input v-model="form.billCode" clearable="" placeholder="单号输入后按回车" @keyup.enter.native="handleScanInput" >
|
||||||
|
<i slot="suffix" class="iconfont"></i>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item :label="$t('派件员')" prop="dispatchOrSendManCode">
|
||||||
|
<EmisUserSimplePicker v-model="form.dispatchOrSendManCode" postCode="RSD" @onChange="onStaffSelect" ></EmisUserSimplePicker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item :label="$t('上一站')" prop="preOrNextStation">
|
||||||
|
<EmisGetPreSitePicker v-model="form.preOrNextStation" @onChange="onSiteSelect" ></EmisGetPreSitePicker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="重量" prop="scanWeight" label-width="60px">
|
||||||
|
<el-input v-model="form.scanWeight" placeholder="扫描重量" >
|
||||||
|
<span slot="suffix">KG</span>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<div slot="toolbar">
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleScanUpload"
|
||||||
|
v-hasPermi="['emis:emisTmsScanRecord:add']"
|
||||||
|
>上传</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="clearSelectionBatch"
|
||||||
|
v-hasPermi="['emis:emisTmsScanRecord:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
@click="handleBatchScan"
|
||||||
|
v-hasPermi="['emis:emisTmsScanRecord:add']"
|
||||||
|
>批量扫描</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table ref="multipleTable" border stripe v-loading="loading" :data="emisTmsScanRecordList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column :label="$t('扫描单号')" align="center" prop="billCode" min-width="150" />
|
||||||
|
<el-table-column :label="$t('扫描类型')" align="center" prop="scanType" min-width="100" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.emis_scan_type" :value="scope.row.scanType"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('扫描网点')" align="center" prop="scanSite" min-width="100" />
|
||||||
|
<el-table-column :label="$t('扫描员')" align="center" prop="scanMan" min-width="150" />
|
||||||
|
<el-table-column :label="$t('扫描时间')" align="center" prop="scanDate" min-width="170" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.scanDate) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('上一站')" align="center" prop="preOrNextStation" min-width="100" />
|
||||||
|
<el-table-column :label="$t('派件员')" align="center" prop="dispatchOrSendMan" min-width="100" />
|
||||||
|
<el-table-column :label="$t('重量')" align="center" prop="scanWeight" min-width="100" />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<el-dialog :title="titleBatch" :visible.sync="openBatch" width="50%" v-dialogDrag :close-on-click-modal="false" append-to-body>
|
||||||
|
<el-form ref="formBatch" :model="formBatch" :rules="rulesBatch" size="mini" label-width="60px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label="$t('运单号')" prop="billCode">
|
||||||
|
<el-input v-model="formBatch.billCode" type="textarea" :rows="8" placeholder="运单号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div style="padding-left: 60px;font-size: 12px;"> T0123219321 有问题</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer" style="text-align:center">
|
||||||
|
<el-button type="primary" @click="submitFormBatch">确 定</el-button>
|
||||||
|
<el-button @click="cancelBatch">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listEmisWaybill, getWaybillDetail,getEmisWaybill } from "@/api/emis/emisWaybill";
|
||||||
|
import { doScan } from "@/api/emis/emisTmsScanRecord";
|
||||||
|
import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
|
||||||
|
import EmisGetPreSitePicker from '@/views/emis/EmisBaseTools/EmisGetPreSitePicker.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "ScanRecord",
|
||||||
|
props:{
|
||||||
|
id:undefined
|
||||||
|
},
|
||||||
|
components: { EmisUserSimplePicker,EmisGetPreSitePicker },
|
||||||
|
dicts: ['emis_scan_type'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
checkedDetail:[],
|
||||||
|
// 遮罩层
|
||||||
|
loading: false,
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
titleBatch: "",
|
||||||
|
formBatch: {},
|
||||||
|
openBatch:false,
|
||||||
|
dataMap:new Map(),
|
||||||
|
emisTmsScanRecordList: [],
|
||||||
|
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
// billCode: [
|
||||||
|
// { required: true, message: "billCode不能为空", trigger: "blur" }
|
||||||
|
// ],
|
||||||
|
// id: [
|
||||||
|
// { required: true, message: "id不能为空", trigger: "blur" }
|
||||||
|
// ],
|
||||||
|
},
|
||||||
|
rulesBatch: {
|
||||||
|
// id: [
|
||||||
|
// { required: true, message: "id不能为空", trigger: "blur" }
|
||||||
|
// ],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
"id": {
|
||||||
|
handler (newValue, oldValue) {
|
||||||
|
this.id = newValue;
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.reset();
|
||||||
|
this.form.scanSiteCode=this.$store.getters.ownerSiteCode;
|
||||||
|
this.form.scanSite=this.$store.getters.ownerSiteName;
|
||||||
|
|
||||||
|
this.form.scanMan=this.$store.getters.empName;
|
||||||
|
this.form.scanManCode=this.$store.getters.empCode;
|
||||||
|
|
||||||
|
this.form.recordMan=this.$store.getters.empName;
|
||||||
|
this.form.recordManCode=this.$store.getters.empCode;
|
||||||
|
|
||||||
|
// this.form.dispatchOrSendManCode=this.$store.getters.empCode;
|
||||||
|
|
||||||
|
// this.form.scanWeight = "1.0";
|
||||||
|
|
||||||
|
console.log(this.form)
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getRowSelect(row, column, event) {
|
||||||
|
// dosomething
|
||||||
|
},
|
||||||
|
|
||||||
|
onStaffSelect(item){
|
||||||
|
console.log(item)
|
||||||
|
this.form.dispatchOrSendMan=item.empName;
|
||||||
|
this.form.dispatchOrSendManCode=item.empCode;
|
||||||
|
},
|
||||||
|
getRowsSelect(arr) {
|
||||||
|
this.form.ids= arr.map(item=>item.id)
|
||||||
|
},
|
||||||
|
handleBatchScan(){
|
||||||
|
this.formBatch = {
|
||||||
|
billCode: null,
|
||||||
|
}
|
||||||
|
this.titleBatch="批量扫描";
|
||||||
|
this.openBatch=true;
|
||||||
|
},
|
||||||
|
clearSelectionBatch(){
|
||||||
|
let newList =[];
|
||||||
|
console.log(this.ids)
|
||||||
|
this.emisTmsScanRecordList.forEach(item=>{
|
||||||
|
if(this.ids.indexOf(item.billCode) == -1){
|
||||||
|
newList.push(item);
|
||||||
|
}else{
|
||||||
|
this.dataMap[item.billCode]=null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.emisTmsScanRecordList = newList;
|
||||||
|
},
|
||||||
|
cancelBatch(){
|
||||||
|
this.openBatch=false;
|
||||||
|
},
|
||||||
|
onSiteSelect(){
|
||||||
|
this.form.preOrNextStation=item.startSiteName;
|
||||||
|
this.form.preOrNextStationCode=item.startSite;
|
||||||
|
},
|
||||||
|
submitFormBatch(){
|
||||||
|
|
||||||
|
if(this.formBatch.billCode==null || this.formBatch.billCode==''){
|
||||||
|
this.$message.error("输入单号后回车");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(this.form.dispatchOrSendManCode==null || this.form.dispatchOrSendManCode==''){
|
||||||
|
this.$message.error("请选择派件员");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let bcList=this.formBatch.billCode.split(/[;\;\,\,]/)||[];
|
||||||
|
let scanWeight = this.form.scanWeight
|
||||||
|
let dispatchOrSendMan = this.form.dispatchOrSendMan;
|
||||||
|
let dispatchOrSendManCode = this.form.dispatchOrSendManCode;
|
||||||
|
let scList=bcList.map(function(code) {
|
||||||
|
return {
|
||||||
|
billCode:code,
|
||||||
|
scanWeight:scanWeight,
|
||||||
|
// scanWeight:null,
|
||||||
|
dispatchOrSendManCode: dispatchOrSendManCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// 到件批量
|
||||||
|
let scanArrivalInfo = {
|
||||||
|
scanType:"30",
|
||||||
|
opType:1,
|
||||||
|
scanData:scList
|
||||||
|
};
|
||||||
|
|
||||||
|
doScan(scanArrivalInfo).then(response => {
|
||||||
|
if(!response.data.scanResult || response.data.scanResult.length == 0){
|
||||||
|
this.$message.error("未查到单号");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (let index = 0; index < response.data.scanResult.length; index++) {
|
||||||
|
let scanRstItem = response.data.scanResult[index];
|
||||||
|
console.log(scanRstItem);
|
||||||
|
if(scanRstItem.result != 'success'){
|
||||||
|
this.$modal.msgError(scanRstItem.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this.form.scanType = '10';
|
||||||
|
this.form.scanDate = new Date();
|
||||||
|
let record =Object.assign({}, this.form)
|
||||||
|
record.billCode=scanRstItem.billCode;
|
||||||
|
record.scanType = "30";
|
||||||
|
record.dispatchOrSendMan = null;
|
||||||
|
record.dispatchOrSendManCode = null;
|
||||||
|
let indexBillCode=record.billCode;
|
||||||
|
this.dataMap[indexBillCode]=record;
|
||||||
|
this.emisTmsScanRecordList.push(record);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 派件批量
|
||||||
|
let scanDispathInfo = {
|
||||||
|
scanType:"40",
|
||||||
|
opType:1,
|
||||||
|
scanData:scList
|
||||||
|
};
|
||||||
|
|
||||||
|
doScan(scanDispathInfo).then(response => {
|
||||||
|
if(!response.data.scanResult || response.data.scanResult.length == 0){
|
||||||
|
this.$message.error("未查到单号");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (let index = 0; index < response.data.scanResult.length; index++) {
|
||||||
|
let scanRstItem = response.data.scanResult[index];
|
||||||
|
console.log(scanRstItem);
|
||||||
|
if(scanRstItem.result != 'success'){
|
||||||
|
this.$modal.msgError(scanRstItem.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this.form.scanType = '10';
|
||||||
|
this.form.scanDate = new Date();
|
||||||
|
let record =Object.assign({}, this.form)
|
||||||
|
record.billCode=scanRstItem.billCode;
|
||||||
|
record.scanType = "40";
|
||||||
|
record.dispatchOrSendMan = dispatchOrSendMan;
|
||||||
|
record.dispatchOrSendManCode = dispatchOrSendManCode;
|
||||||
|
let indexBillCode=record.billCode;
|
||||||
|
this.dataMap[indexBillCode]=record;
|
||||||
|
this.emisTmsScanRecordList.push(record);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.openBatch=false;
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
billCode: null,
|
||||||
|
scanType: null,
|
||||||
|
preOrNextStation: null,
|
||||||
|
preOrNextStationCode: null,
|
||||||
|
preOrNextStationPhone: null,
|
||||||
|
preOrNextManCode: null,
|
||||||
|
preOrNextManPhone: null,
|
||||||
|
scanDate: null,
|
||||||
|
scanManCode: null,
|
||||||
|
scanManPhone: null,
|
||||||
|
scanMan: null,
|
||||||
|
preOrNextMan: null,
|
||||||
|
scanSite: null,
|
||||||
|
scanSiteCode: null,
|
||||||
|
scanSitePhone: null,
|
||||||
|
scanWeight: null,
|
||||||
|
weight: null,
|
||||||
|
dispatchOrSendMan: null,
|
||||||
|
dispatchOrSendManCode: null,
|
||||||
|
dispatchOrSendManPhone: null,
|
||||||
|
signDate: null,
|
||||||
|
signMan: null,
|
||||||
|
signSite: null,
|
||||||
|
signSiteCode: null,
|
||||||
|
recordMan: null,
|
||||||
|
recordManCode: null,
|
||||||
|
recordManPhone: null,
|
||||||
|
recordSiteCode: null,
|
||||||
|
truckMan: null,
|
||||||
|
truckCode: null,
|
||||||
|
dataFrom: null,
|
||||||
|
picUrl: null,
|
||||||
|
status: null,
|
||||||
|
delFlag: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
remark: null,
|
||||||
|
updateSite: null,
|
||||||
|
createSite: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.billCode)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
|
||||||
|
// this.checkedDetail = selection;
|
||||||
|
|
||||||
|
|
||||||
|
// if (selection.length > 1) {
|
||||||
|
// this.$refs.multipleTable.clearSelection();
|
||||||
|
// this.$refs.multipleTable.toggleRowSelection(selection.pop());
|
||||||
|
// } else {
|
||||||
|
// //将选中行存入缓存中
|
||||||
|
// this.checkedDetail = selection;
|
||||||
|
// }
|
||||||
|
|
||||||
|
},
|
||||||
|
// 扫描上传
|
||||||
|
handleScanUpload(){
|
||||||
|
var selData = this.$refs.multipleTable.selection;
|
||||||
|
console.log(selData);
|
||||||
|
|
||||||
|
let scanArrivalData=[];
|
||||||
|
let scanDispathData=[];
|
||||||
|
selData.forEach(item=>{
|
||||||
|
if (item.scanType=="30") {
|
||||||
|
scanArrivalData.push(
|
||||||
|
{
|
||||||
|
billCode:item.billCode,
|
||||||
|
scanWeight:item.scanWeight
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}else if(item.scanType=="40") {
|
||||||
|
scanDispathData.push(
|
||||||
|
{
|
||||||
|
billCode:item.billCode,
|
||||||
|
scanWeight:item.scanWeight,
|
||||||
|
dispatchOrSendManCode:item.dispatchOrSendManCode
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 到件扫描上传
|
||||||
|
let scanArrivalInfo = {scanType:"30",opType:2,scanData:scanArrivalData}
|
||||||
|
console.log(scanArrivalInfo)
|
||||||
|
|
||||||
|
doScan(scanArrivalInfo).then(response => {
|
||||||
|
console.log(response);
|
||||||
|
let scanRstItem = response.data.scanResult[0];
|
||||||
|
console.log(scanRstItem);
|
||||||
|
if(scanRstItem.result != 'success'){
|
||||||
|
this.$modal.msgError(scanRstItem.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$modal.msgSuccess("到件扫描上传"+scanRstItem.message);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 派件扫描上传
|
||||||
|
let scanDispathInfo = {scanType:"40",opType:2,scanData:scanDispathData}
|
||||||
|
console.log(scanDispathInfo)
|
||||||
|
|
||||||
|
doScan(scanDispathInfo).then(response => {
|
||||||
|
console.log(response);
|
||||||
|
let scanRstItem = response.data.scanResult[0];
|
||||||
|
console.log(scanRstItem);
|
||||||
|
if(scanRstItem.result != 'success'){
|
||||||
|
this.$modal.msgError(scanRstItem.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$modal.msgSuccess("派件扫描上传"+scanRstItem.message);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
handleScanInput(){
|
||||||
|
|
||||||
|
if(this.form.billCode==null || this.form.billCode==''){
|
||||||
|
this.$message.error("输入单号后回车");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.form.dispatchOrSendManCode==null || this.form.dispatchOrSendManCode==''){
|
||||||
|
this.$message.error("请选择派件员");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.dataMap[this.form.billCode]){
|
||||||
|
this.$message.error("重复扫描");
|
||||||
|
this.playNoticeTone(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let dispatchOrSendMan = this.form.dispatchOrSendMan;
|
||||||
|
let dispatchOrSendManCode = this.form.dispatchOrSendManCode;
|
||||||
|
// 到件扫描
|
||||||
|
let scanArrivalInfo = {
|
||||||
|
scanType:"30",
|
||||||
|
opType:1,
|
||||||
|
scanData:[
|
||||||
|
{
|
||||||
|
billCode:this.form.billCode,
|
||||||
|
scanWeight:this.form.scanWeight,
|
||||||
|
dispatchOrSendManCode:dispatchOrSendManCode
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
doScan(scanArrivalInfo).then(response => {
|
||||||
|
console.log(response);
|
||||||
|
let scanRstItem = response.data.scanResult[0];
|
||||||
|
console.log(scanRstItem);
|
||||||
|
if(scanRstItem.result != 'success'){
|
||||||
|
this.$modal.msgError(scanRstItem.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this.form.scanType = '10';
|
||||||
|
this.form.scanDate = new Date();
|
||||||
|
let record =Object.assign({}, this.form)
|
||||||
|
record.billCode=scanRstItem.billCode;
|
||||||
|
record.scanType = '30';
|
||||||
|
record.dispatchOrSendMan=null;
|
||||||
|
record.dispatchOrSendManCode=null;
|
||||||
|
console.log(record)
|
||||||
|
let indexBillCode=record.billCode;
|
||||||
|
this.dataMap[indexBillCode]=record;
|
||||||
|
this.emisTmsScanRecordList.push(record);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 派件扫描
|
||||||
|
let scanDispathInfo = {
|
||||||
|
scanType:"40",
|
||||||
|
opType:1,
|
||||||
|
scanData:[
|
||||||
|
{
|
||||||
|
billCode:this.form.billCode,
|
||||||
|
scanWeight:this.form.scanWeight,
|
||||||
|
dispatchOrSendManCode:dispatchOrSendManCode
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
doScan(scanDispathInfo).then(response => {
|
||||||
|
console.log(response);
|
||||||
|
let scanRstItem = response.data.scanResult[0];
|
||||||
|
console.log(scanRstItem);
|
||||||
|
if(scanRstItem.result != 'success'){
|
||||||
|
this.$modal.msgError(scanRstItem.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this.form.scanType = '10';
|
||||||
|
this.form.scanDate = new Date();
|
||||||
|
let record =Object.assign({}, this.form)
|
||||||
|
record.billCode=scanRstItem.billCode;
|
||||||
|
record.scanType = '40';
|
||||||
|
record.dispatchOrSendMan = dispatchOrSendMan;
|
||||||
|
record.dispatchOrSendManCode = dispatchOrSendManCode;
|
||||||
|
console.log(record)
|
||||||
|
let indexBillCode=record.billCode;
|
||||||
|
this.dataMap[indexBillCode]=record;
|
||||||
|
this.emisTmsScanRecordList.push(record);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.form.billCode =null;
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
447
src/views/emis/emisTmsScanRecord/deliveryScan.vue
Normal file
447
src/views/emis/emisTmsScanRecord/deliveryScan.vue
Normal file
@ -0,0 +1,447 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="0">
|
||||||
|
<el-form ref="form" size="mini" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-col :span="7">
|
||||||
|
<el-form-item label="扫描单号" prop="billCode" label-width="70px">
|
||||||
|
<span slot="label">
|
||||||
|
<span style="color: red">扫描单号</span>
|
||||||
|
</span>
|
||||||
|
<el-input v-model="form.billCode" clearable="" placeholder="单号输入后按回车" @keyup.enter.native="handleScanInput" >
|
||||||
|
<i slot="suffix" class="iconfont"></i>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="7">
|
||||||
|
<el-form-item label="重量" prop="scanWeight" label-width="60px">
|
||||||
|
<el-input v-model="form.scanWeight" placeholder="扫描重量" >
|
||||||
|
<span slot="suffix">KG</span>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item :label="$t('派件员')" prop="dispatchOrSendManCode">
|
||||||
|
<EmisUserSimplePicker v-model="form.dispatchOrSendManCode" postCode="RSD" @onChange="onStaffSelect" ></EmisUserSimplePicker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<div slot="toolbar">
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleScanUpload"
|
||||||
|
v-hasPermi="['emis:emisTmsScanRecord:add']"
|
||||||
|
>上传</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="clearSelectionBatch"
|
||||||
|
v-hasPermi="['emis:emisTmsScanRecord:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
@click="handleBatchScan"
|
||||||
|
v-hasPermi="['emis:emisTmsScanRecord:add']"
|
||||||
|
>批量扫描</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table ref="multipleTable" border stripe v-loading="loading" :data="emisTmsScanRecordList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column :label="$t('扫描单号')" align="center" prop="billCode" min-width="150" />
|
||||||
|
<el-table-column :label="$t('扫描类型')" align="center" prop="scanType" min-width="100" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.emis_scan_type" :value="scope.row.scanType"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('扫描网点')" align="center" prop="scanSite" min-width="100" />
|
||||||
|
<el-table-column :label="$t('扫描员')" align="center" prop="scanMan" min-width="150" />
|
||||||
|
<el-table-column :label="$t('扫描时间')" align="center" prop="scanDate" min-width="170" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.scanDate) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column :label="$t('录入时间')" align="center" prop="createTime" min-width="170" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.scanDate) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
|
||||||
|
<el-table-column :label="$t('派件员')" align="center" prop="dispatchOrSendMan" min-width="100" />
|
||||||
|
<el-table-column :label="$t('重量')" align="center" prop="scanWeight" min-width="100" />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<!-- <div style="text-align: center;margin-bottom: 10px;">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
|
<el-dialog :title="titleBatch" :visible.sync="openBatch" width="50%" v-dialogDrag :close-on-click-modal="false" append-to-body>
|
||||||
|
<el-form ref="formBatch" :model="formBatch" :rules="rulesBatch" size="mini" label-width="60px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label="$t('运单号')" prop="billCode">
|
||||||
|
<el-input v-model="formBatch.billCode" type="textarea" :rows="8" placeholder="运单号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div style="padding-left: 60px;font-size: 12px;"> T0123219321 有问题</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer" style="text-align:center">
|
||||||
|
<el-button type="primary" @click="submitFormBatch">确 定</el-button>
|
||||||
|
<el-button @click="cancelBatch">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listEmisWaybill, getWaybillDetail,getEmisWaybill } from "@/api/emis/emisWaybill";
|
||||||
|
import { doScan } from "@/api/emis/emisTmsScanRecord";
|
||||||
|
import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "ScanRecord",
|
||||||
|
props:{
|
||||||
|
id:undefined
|
||||||
|
},
|
||||||
|
components: { EmisUserSimplePicker },
|
||||||
|
dicts: ['emis_scan_type'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
checkedDetail:[],
|
||||||
|
// 遮罩层
|
||||||
|
loading: false,
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
titleBatch: "",
|
||||||
|
formBatch: {},
|
||||||
|
openBatch:false,
|
||||||
|
dataMap:new Map(),
|
||||||
|
emisTmsScanRecordList: [],
|
||||||
|
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
// billCode: [
|
||||||
|
// { required: true, message: "billCode不能为空", trigger: "blur" }
|
||||||
|
// ],
|
||||||
|
// id: [
|
||||||
|
// { required: true, message: "id不能为空", trigger: "blur" }
|
||||||
|
// ],
|
||||||
|
},
|
||||||
|
rulesBatch: {
|
||||||
|
// id: [
|
||||||
|
// { required: true, message: "id不能为空", trigger: "blur" }
|
||||||
|
// ],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
"id": {
|
||||||
|
handler (newValue, oldValue) {
|
||||||
|
this.id = newValue;
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.reset();
|
||||||
|
this.form.scanSiteCode=this.$store.getters.ownerSiteCode;
|
||||||
|
this.form.scanSite=this.$store.getters.ownerSiteName;
|
||||||
|
|
||||||
|
this.form.scanMan=this.$store.getters.empName;
|
||||||
|
this.form.scanManCode=this.$store.getters.empCode;
|
||||||
|
|
||||||
|
this.form.recordMan=this.$store.getters.empName;
|
||||||
|
this.form.recordManCode=this.$store.getters.empCode;
|
||||||
|
|
||||||
|
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
|
||||||
|
|
||||||
|
// this.form.scanWeight = "1.0";
|
||||||
|
|
||||||
|
console.log(this.form)
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getRowSelect(row, column, event) {
|
||||||
|
// dosomething
|
||||||
|
},
|
||||||
|
|
||||||
|
onStaffSelect(item){
|
||||||
|
console.log(item)
|
||||||
|
this.form.dispatchOrSendMan=item.empName;
|
||||||
|
this.form.dispatchOrSendManCode=item.empCode;
|
||||||
|
},
|
||||||
|
getRowsSelect(arr) {
|
||||||
|
this.form.ids= arr.map(item=>item.id)
|
||||||
|
},
|
||||||
|
handleBatchScan(){
|
||||||
|
this.formBatch = {
|
||||||
|
billCode: null,
|
||||||
|
}
|
||||||
|
this.titleBatch="批量扫描";
|
||||||
|
this.openBatch=true;
|
||||||
|
},
|
||||||
|
clearSelectionBatch(){
|
||||||
|
let newList =[];
|
||||||
|
console.log(this.ids)
|
||||||
|
this.emisTmsScanRecordList.forEach(item=>{
|
||||||
|
if(this.ids.indexOf(item.billCode) == -1){
|
||||||
|
newList.push(item);
|
||||||
|
}else{
|
||||||
|
this.dataMap[item.billCode]=null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.emisTmsScanRecordList = newList;
|
||||||
|
},
|
||||||
|
cancelBatch(){
|
||||||
|
this.openBatch=false;
|
||||||
|
},
|
||||||
|
submitFormBatch(){
|
||||||
|
|
||||||
|
if(this.formBatch.billCode==null || this.formBatch.billCode==''){
|
||||||
|
this.$message.error("输入单号后回车");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let bcList=this.formBatch.billCode.split(/[;\;\,\,]/)||[];
|
||||||
|
let scanWeight = this.form.scanWeight
|
||||||
|
let dispatchOrSendManCode = this.form.dispatchOrSendManCode;
|
||||||
|
let scList=bcList.map(function(code) {
|
||||||
|
return {
|
||||||
|
billCode:code,
|
||||||
|
scanWeight:scanWeight,
|
||||||
|
// scanWeight:null,
|
||||||
|
dispatchOrSendManCode: dispatchOrSendManCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
let scanInfo = {
|
||||||
|
scanType:"40",
|
||||||
|
opType:1,
|
||||||
|
scanData:scList
|
||||||
|
};
|
||||||
|
|
||||||
|
doScan(scanInfo).then(response => {
|
||||||
|
if(!response.data.scanResult || response.data.scanResult.length == 0){
|
||||||
|
this.$message.error("未查到单号");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (let index = 0; index < response.data.scanResult.length; index++) {
|
||||||
|
let scanRstItem = response.data.scanResult[index];
|
||||||
|
console.log(scanRstItem);
|
||||||
|
if(scanRstItem.result != 'success'){
|
||||||
|
this.$modal.msgError(scanRstItem.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.form.scanType = '40';
|
||||||
|
this.form.scanDate = new Date();
|
||||||
|
let record =Object.assign({}, this.form)
|
||||||
|
record.billCode=scanRstItem.billCode;
|
||||||
|
console.log(record)
|
||||||
|
let indexBillCode=record.billCode;
|
||||||
|
this.dataMap[indexBillCode]=record;
|
||||||
|
this.emisTmsScanRecordList.push(record);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.openBatch=false;
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
billCode: null,
|
||||||
|
scanType: null,
|
||||||
|
preOrNextStation: null,
|
||||||
|
preOrNextStationCode: null,
|
||||||
|
preOrNextStationPhone: null,
|
||||||
|
preOrNextManCode: null,
|
||||||
|
preOrNextManPhone: null,
|
||||||
|
scanDate: null,
|
||||||
|
scanManCode: null,
|
||||||
|
scanManPhone: null,
|
||||||
|
scanMan: null,
|
||||||
|
preOrNextMan: null,
|
||||||
|
scanSite: null,
|
||||||
|
scanSiteCode: null,
|
||||||
|
scanSitePhone: null,
|
||||||
|
scanWeight: null,
|
||||||
|
weight: null,
|
||||||
|
dispatchOrSendMan: null,
|
||||||
|
dispatchOrSendManCode: null,
|
||||||
|
dispatchOrSendManPhone: null,
|
||||||
|
signDate: null,
|
||||||
|
signMan: null,
|
||||||
|
signSite: null,
|
||||||
|
signSiteCode: null,
|
||||||
|
recordMan: null,
|
||||||
|
recordManCode: null,
|
||||||
|
recordManPhone: null,
|
||||||
|
recordSiteCode: null,
|
||||||
|
truckMan: null,
|
||||||
|
truckCode: null,
|
||||||
|
dataFrom: null,
|
||||||
|
picUrl: null,
|
||||||
|
status: null,
|
||||||
|
delFlag: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
remark: null,
|
||||||
|
updateSite: null,
|
||||||
|
createSite: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.billCode)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
|
||||||
|
// this.checkedDetail = selection;
|
||||||
|
|
||||||
|
|
||||||
|
// if (selection.length > 1) {
|
||||||
|
// this.$refs.multipleTable.clearSelection();
|
||||||
|
// this.$refs.multipleTable.toggleRowSelection(selection.pop());
|
||||||
|
// } else {
|
||||||
|
// //将选中行存入缓存中
|
||||||
|
// this.checkedDetail = selection;
|
||||||
|
// }
|
||||||
|
|
||||||
|
},
|
||||||
|
// 扫描上传
|
||||||
|
handleScanUpload(){
|
||||||
|
var selData = this.$refs.multipleTable.selection;
|
||||||
|
console.log(selData);
|
||||||
|
|
||||||
|
let scanData=[];
|
||||||
|
selData.forEach(item=>{
|
||||||
|
scanData.push(
|
||||||
|
{
|
||||||
|
billCode:item.billCode,
|
||||||
|
scanWeight:item.scanWeight,
|
||||||
|
dispatchOrSendManCode:item.dispatchOrSendManCode,
|
||||||
|
scanDate:item.scanDate
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 检查
|
||||||
|
let scanInfo = {scanType:"40",opType:2,scanData:scanData}
|
||||||
|
console.log(scanInfo)
|
||||||
|
|
||||||
|
doScan(scanInfo).then(response => {
|
||||||
|
console.log(response);
|
||||||
|
let scanRstItem = response.data.scanResult[0];
|
||||||
|
console.log(scanRstItem);
|
||||||
|
if(scanRstItem.result != 'success'){
|
||||||
|
this.$modal.msgError(scanRstItem.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$modal.msgSuccess(scanRstItem.message);
|
||||||
|
|
||||||
|
|
||||||
|
// this.form.scanType = '10';
|
||||||
|
// this.form.scanDate = new Date();
|
||||||
|
// let record =Object.assign({}, this.form);
|
||||||
|
// console.log(record)
|
||||||
|
// let indexBillCode=record.billCode;
|
||||||
|
// this.dataMap[indexBillCode]=record;
|
||||||
|
// this.emisTmsScanRecordList.push(record);
|
||||||
|
|
||||||
|
// this.form.billCode =null;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
handleScanInput(){
|
||||||
|
|
||||||
|
if(this.form.billCode==null || this.form.billCode==''){
|
||||||
|
this.$message.error("输入单号后回车");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.dataMap[this.form.billCode]){
|
||||||
|
this.$message.error("重复扫描");
|
||||||
|
this.playNoticeTone(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查
|
||||||
|
let scanInfo = {
|
||||||
|
scanType:"40",
|
||||||
|
opType:1,
|
||||||
|
scanData:[
|
||||||
|
{
|
||||||
|
billCode:this.form.billCode,
|
||||||
|
scanWeight:this.form.scanWeight,
|
||||||
|
dispatchOrSendManCode:this.form.dispatchOrSendManCode
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
doScan(scanInfo).then(response => {
|
||||||
|
console.log(response);
|
||||||
|
let scanRstItem = response.data.scanResult[0];
|
||||||
|
console.log(scanRstItem);
|
||||||
|
if(scanRstItem.result != 'success'){
|
||||||
|
this.$modal.msgError(scanRstItem.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.form.scanType = '40';
|
||||||
|
this.form.scanDate = new Date();
|
||||||
|
let record =Object.assign({}, this.form)
|
||||||
|
record.billCode=scanRstItem.billCode;
|
||||||
|
console.log(record)
|
||||||
|
let indexBillCode=record.billCode;
|
||||||
|
this.dataMap[indexBillCode]=record;
|
||||||
|
this.emisTmsScanRecordList.push(record);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.form.billCode =null;
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
461
src/views/emis/emisTmsScanRecord/positionScanning.vue
Normal file
461
src/views/emis/emisTmsScanRecord/positionScanning.vue
Normal file
@ -0,0 +1,461 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="0">
|
||||||
|
<el-form ref="form" size="mini" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="扫描单号" prop="billCode" label-width="70px">
|
||||||
|
<span slot="label">
|
||||||
|
<span style="color: red">扫描单号</span>
|
||||||
|
</span>
|
||||||
|
<el-input v-model="form.billCode" clearable="" placeholder="单号输入后按回车" @keyup.enter.native="handleScanInput" >
|
||||||
|
<i slot="suffix" class="iconfont"></i>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item :label="$t('留仓类型')" prop="keepWarehouse">
|
||||||
|
<el-select
|
||||||
|
style="width:100%"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
v-model="keepWarehouseValue"
|
||||||
|
@change="onKeepWarehouseSelect">
|
||||||
|
<el-option v-for="item in dict.type.emis_keep_warehouse" :key="item.value" :label="item.label" :value="item.label" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="留仓原因" prop="remark" label-width="80px">
|
||||||
|
<el-input v-model="form.remark" placeholder="请输入" >
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<div slot="toolbar">
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleScanUpload"
|
||||||
|
v-hasPermi="['emis:emisTmsScanRecord:add']"
|
||||||
|
>上传</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="clearSelectionBatch"
|
||||||
|
v-hasPermi="['emis:emisTmsScanRecord:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
@click="handleBatchScan"
|
||||||
|
v-hasPermi="['emis:emisTmsScanRecord:add']"
|
||||||
|
>批量扫描</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table ref="multipleTable" border stripe v-loading="loading" :data="emisTmsScanRecordList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column :label="$t('扫描单号')" align="center" prop="billCode" min-width="150" />
|
||||||
|
<el-table-column :label="$t('扫描类型')" align="center" prop="scanType" min-width="100" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.emis_scan_type" :value="scope.row.scanType"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('扫描网点')" align="center" prop="scanSite" min-width="100" />
|
||||||
|
<el-table-column :label="$t('扫描员')" align="center" prop="scanMan" min-width="150" />
|
||||||
|
<el-table-column :label="$t('扫描时间')" align="center" prop="scanDate" min-width="170" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.scanDate) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column :label="$t('录入时间')" align="center" prop="createTime" min-width="170" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.scanDate) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
|
||||||
|
<el-table-column :label="$t('派件员')" align="center" prop="dispatchOrSendMan" min-width="150" />
|
||||||
|
<el-table-column :label="$t('重量')" align="center" prop="scanWeight" min-width="100" />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<!-- <div style="text-align: center;margin-bottom: 10px;">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
|
<el-dialog :title="titleBatch" :visible.sync="openBatch" width="50%" v-dialogDrag :close-on-click-modal="false" append-to-body>
|
||||||
|
<el-form ref="formBatch" :model="formBatch" :rules="rulesBatch" size="mini" label-width="60px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label="$t('运单号')" prop="billCode">
|
||||||
|
<el-input v-model="formBatch.billCode" type="textarea" :rows="8" placeholder="运单号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div style="padding-left: 60px;font-size: 12px;"> T0123219321 有问题</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer" style="text-align:center">
|
||||||
|
<el-button type="primary" @click="submitFormBatch">确 定</el-button>
|
||||||
|
<el-button @click="cancelBatch">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listEmisWaybill, getWaybillDetail,getEmisWaybill } from "@/api/emis/emisWaybill";
|
||||||
|
import { doScan } from "@/api/emis/emisTmsScanRecord";
|
||||||
|
import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "ScanRecord",
|
||||||
|
props:{
|
||||||
|
id:undefined
|
||||||
|
},
|
||||||
|
components: { EmisUserSimplePicker },
|
||||||
|
dicts: ['emis_scan_type','emis_keep_warehouse'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
checkedDetail:[],
|
||||||
|
// 遮罩层
|
||||||
|
loading: false,
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
titleBatch: "",
|
||||||
|
formBatch: {},
|
||||||
|
openBatch:false,
|
||||||
|
dataMap:new Map(),
|
||||||
|
emisTmsScanRecordList: [],
|
||||||
|
keepWarehouseValue:null,
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
// billCode: [
|
||||||
|
// { required: true, message: "billCode不能为空", trigger: "blur" }
|
||||||
|
// ],
|
||||||
|
// id: [
|
||||||
|
// { required: true, message: "id不能为空", trigger: "blur" }
|
||||||
|
// ],
|
||||||
|
},
|
||||||
|
rulesBatch: {
|
||||||
|
// id: [
|
||||||
|
// { required: true, message: "id不能为空", trigger: "blur" }
|
||||||
|
// ],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
"id": {
|
||||||
|
handler (newValue, oldValue) {
|
||||||
|
this.id = newValue;
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.reset();
|
||||||
|
this.form.scanSiteCode=this.$store.getters.ownerSiteCode;
|
||||||
|
this.form.scanSite=this.$store.getters.ownerSiteName;
|
||||||
|
|
||||||
|
this.form.scanMan=this.$store.getters.empName;
|
||||||
|
this.form.scanManCode=this.$store.getters.empCode;
|
||||||
|
|
||||||
|
this.form.recordMan=this.$store.getters.empName;
|
||||||
|
this.form.recordManCode=this.$store.getters.empCode;
|
||||||
|
|
||||||
|
this.form.dispatchOrSendMan=this.$store.getters.empName;
|
||||||
|
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
|
||||||
|
|
||||||
|
// this.form.scanWeight = "1.0";
|
||||||
|
|
||||||
|
console.log("------->dict.type.emis_scan_type",this.dict.type.emis_keep_warehouse)
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getRowSelect(row, column, event) {
|
||||||
|
// dosomething
|
||||||
|
},
|
||||||
|
|
||||||
|
onKeepWarehouseSelect(item){
|
||||||
|
// console.log(item)
|
||||||
|
// this.form.dispatchOrSendMan=item.empName;
|
||||||
|
// this.form.dispatchOrSendManCode=item.empCode;
|
||||||
|
this.form.keepWarehouseRemark = item;
|
||||||
|
// console.log("this.form.keepWarehouseRemark,",this.form.keepWarehouseRemark)
|
||||||
|
},
|
||||||
|
getRowsSelect(arr) {
|
||||||
|
this.form.ids= arr.map(item=>item.id)
|
||||||
|
},
|
||||||
|
handleBatchScan(){
|
||||||
|
this.formBatch = {
|
||||||
|
billCode: null,
|
||||||
|
}
|
||||||
|
this.titleBatch="批量扫描";
|
||||||
|
this.openBatch=true;
|
||||||
|
},
|
||||||
|
clearSelectionBatch(){
|
||||||
|
let newList =[];
|
||||||
|
console.log(this.ids)
|
||||||
|
this.emisTmsScanRecordList.forEach(item=>{
|
||||||
|
if(this.ids.indexOf(item.billCode) == -1){
|
||||||
|
newList.push(item);
|
||||||
|
}else{
|
||||||
|
this.dataMap[item.billCode]=null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.emisTmsScanRecordList = newList;
|
||||||
|
},
|
||||||
|
cancelBatch(){
|
||||||
|
this.openBatch=false;
|
||||||
|
},
|
||||||
|
submitFormBatch(){
|
||||||
|
|
||||||
|
if(this.formBatch.billCode==null || this.formBatch.billCode==''){
|
||||||
|
this.$message.error("输入单号后回车");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let bcList=this.formBatch.billCode.split(/[;\;\,\,]/)||[];
|
||||||
|
let scanWeight = this.form.scanWeight
|
||||||
|
let dispatchOrSendManCode = this.form.dispatchOrSendManCode;
|
||||||
|
let scList=bcList.map(function(code) {
|
||||||
|
return {
|
||||||
|
billCode:code,
|
||||||
|
scanWeight:scanWeight,
|
||||||
|
// scanWeight:null,
|
||||||
|
dispatchOrSendManCode: dispatchOrSendManCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
let scanInfo = {
|
||||||
|
scanType:"70",
|
||||||
|
opType:1,
|
||||||
|
scanData:scList
|
||||||
|
};
|
||||||
|
|
||||||
|
doScan(scanInfo).then(response => {
|
||||||
|
if(!response.data.scanResult || response.data.scanResult.length == 0){
|
||||||
|
this.$message.error("未查到单号");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (let index = 0; index < response.data.scanResult.length; index++) {
|
||||||
|
let scanRstItem = response.data.scanResult[index];
|
||||||
|
console.log(scanRstItem);
|
||||||
|
if(scanRstItem.result != 'success'){
|
||||||
|
this.$modal.msgError(scanRstItem.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.form.scanType = '70';
|
||||||
|
this.form.scanDate = new Date();
|
||||||
|
let record =Object.assign({}, this.form)
|
||||||
|
record.billCode=scanRstItem.billCode;
|
||||||
|
console.log(record)
|
||||||
|
let indexBillCode=record.billCode;
|
||||||
|
this.dataMap[indexBillCode]=record;
|
||||||
|
this.emisTmsScanRecordList.push(record);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.openBatch=false;
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
billCode: null,
|
||||||
|
scanType: null,
|
||||||
|
preOrNextStation: null,
|
||||||
|
preOrNextStationCode: null,
|
||||||
|
preOrNextStationPhone: null,
|
||||||
|
preOrNextManCode: null,
|
||||||
|
preOrNextManPhone: null,
|
||||||
|
scanDate: null,
|
||||||
|
scanManCode: null,
|
||||||
|
scanManPhone: null,
|
||||||
|
scanMan: null,
|
||||||
|
preOrNextMan: null,
|
||||||
|
scanSite: null,
|
||||||
|
scanSiteCode: null,
|
||||||
|
scanSitePhone: null,
|
||||||
|
scanWeight: null,
|
||||||
|
weight: null,
|
||||||
|
dispatchOrSendMan: null,
|
||||||
|
dispatchOrSendManCode: null,
|
||||||
|
dispatchOrSendManPhone: null,
|
||||||
|
signDate: null,
|
||||||
|
signMan: null,
|
||||||
|
signSite: null,
|
||||||
|
signSiteCode: null,
|
||||||
|
recordMan: null,
|
||||||
|
recordManCode: null,
|
||||||
|
recordManPhone: null,
|
||||||
|
recordSiteCode: null,
|
||||||
|
truckMan: null,
|
||||||
|
truckCode: null,
|
||||||
|
dataFrom: null,
|
||||||
|
picUrl: null,
|
||||||
|
status: null,
|
||||||
|
delFlag: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
remark: null,
|
||||||
|
keepWarehouseRemark:null,
|
||||||
|
updateSite: null,
|
||||||
|
createSite: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.billCode)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
|
||||||
|
// this.checkedDetail = selection;
|
||||||
|
|
||||||
|
|
||||||
|
// if (selection.length > 1) {
|
||||||
|
// this.$refs.multipleTable.clearSelection();
|
||||||
|
// this.$refs.multipleTable.toggleRowSelection(selection.pop());
|
||||||
|
// } else {
|
||||||
|
// //将选中行存入缓存中
|
||||||
|
// this.checkedDetail = selection;
|
||||||
|
// }
|
||||||
|
|
||||||
|
},
|
||||||
|
// 扫描上传
|
||||||
|
handleScanUpload(){
|
||||||
|
var selData = this.$refs.multipleTable.selection;
|
||||||
|
console.log(selData);
|
||||||
|
|
||||||
|
let scanData=[];
|
||||||
|
selData.forEach(item=>{
|
||||||
|
scanData.push(
|
||||||
|
{
|
||||||
|
billCode:item.billCode,
|
||||||
|
signMan:item.signMan,
|
||||||
|
picUrl:item.picUrl,
|
||||||
|
scanDate:item.scanDate,
|
||||||
|
scanWeight:item.scanWeight,
|
||||||
|
remark:((item.keepWarehouseRemark?item.keepWarehouseRemark+" ":"") + (item.remark ? item.remark : "")).trim(),
|
||||||
|
dispatchOrSendManCode:item.dispatchOrSendManCode
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 检查
|
||||||
|
let scanInfo = {scanType:"70",opType:2,scanData:scanData}
|
||||||
|
console.log(scanInfo)
|
||||||
|
|
||||||
|
doScan(scanInfo).then(response => {
|
||||||
|
console.log(response);
|
||||||
|
let scanRstItem = response.data.scanResult[0];
|
||||||
|
console.log(scanRstItem);
|
||||||
|
if(scanRstItem.result != 'success'){
|
||||||
|
this.$modal.msgError(scanRstItem.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$modal.msgSuccess(scanRstItem.message);
|
||||||
|
|
||||||
|
|
||||||
|
// this.form.scanType = '10';
|
||||||
|
// this.form.scanDate = new Date();
|
||||||
|
// let record =Object.assign({}, this.form);
|
||||||
|
// console.log(record)
|
||||||
|
// let indexBillCode=record.billCode;
|
||||||
|
// this.dataMap[indexBillCode]=record;
|
||||||
|
// this.emisTmsScanRecordList.push(record);
|
||||||
|
|
||||||
|
// this.form.billCode =null;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
handleScanInput(){
|
||||||
|
|
||||||
|
if(this.form.billCode==null || this.form.billCode==''){
|
||||||
|
this.$message.error("输入单号后回车");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.dataMap[this.form.billCode]){
|
||||||
|
this.$message.error("重复扫描");
|
||||||
|
this.playNoticeTone(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查
|
||||||
|
let scanInfo = {
|
||||||
|
scanType:"70",
|
||||||
|
opType:1,
|
||||||
|
scanData:[
|
||||||
|
{
|
||||||
|
billCode:this.form.billCode,
|
||||||
|
scanWeight:this.form.scanWeight,
|
||||||
|
dispatchOrSendManCode:this.form.dispatchOrSendManCode
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
doScan(scanInfo).then(response => {
|
||||||
|
console.log(response);
|
||||||
|
let scanRstItem = response.data.scanResult[0];
|
||||||
|
console.log(scanRstItem);
|
||||||
|
if(scanRstItem.result != 'success'){
|
||||||
|
this.$modal.msgError(scanRstItem.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.form.scanType = '70';
|
||||||
|
this.form.scanDate = new Date();
|
||||||
|
|
||||||
|
let record =Object.assign({}, this.form)
|
||||||
|
record.billCode=scanRstItem.billCode;
|
||||||
|
console.log(record)
|
||||||
|
let indexBillCode=record.billCode;
|
||||||
|
this.dataMap[indexBillCode]=record;
|
||||||
|
this.emisTmsScanRecordList.push(record);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.form.billCode =null;
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user