完成签收录入页面

This commit is contained in:
liuyp 2024-05-16 11:47:55 +08:00
parent c298d106be
commit d08e6cf482

View File

@ -11,19 +11,10 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="签收人" prop="signManCode" label-width="70px"> <el-form-item label="签收人" prop="signManCode" label-width="70px">
<EmisUserSimplePicker v-model="form.signManCode" postCode="RSD" @onChange="onSignStaffSelect" ></EmisUserSimplePicker> <EmisUserSimplePicker v-model="form.signManCode" postCode="RSD" @onChange="onSignStaffSelect" ></EmisUserSimplePicker>
<!-- <el-input v-model="form.xxxxx" placeholder="请输入" /> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户名称')" prop="customerCode" label-width="70px"> <el-form-item :label="$t('客户名称')" prop="customerCode" label-width="70px">
<!-- <el-select
style="width:100%"
filterable
clearable
v-model="form.customerCode"
@change="onCustomerSelect">
<el-option v-for="item in dict.type.emis_customer_type" :key="item.value" :label="item.label" :value="item.label" />
</el-select> -->
<CustomerSimplePicker v-model="form.customerCode" postCode="RSD" @onChange="onCustomerSelect" ></CustomerSimplePicker> <CustomerSimplePicker v-model="form.customerCode" postCode="RSD" @onChange="onCustomerSelect" ></CustomerSimplePicker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -48,7 +39,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col class="line" :span="24"> <el-col class="line" :span="24">
<sapn >运单信息</sapn> <span >运单信息</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="0"> <el-row :gutter="0">
@ -98,126 +89,113 @@
</el-form> </el-form>
</el-row> </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>
<div slot="toolbar"> <el-table ref="multipleTable" border stripe v-loading="loading" :data="emisTmsScanRecordList" @selection-change="handleSelectionChange">
<el-row :gutter="10" class="mb8"> <el-table-column type="selection" width="55" align="center" />
<el-col :span="1.5"> <el-table-column :label="$t('运单号')" align="center" prop="billCode" min-width="150" />
<el-button <el-table-column :label="$t('派件员')" align="center" prop="empCode" min-width="100" />
type="primary" <el-table-column :label="$t('签收人')" align="center" prop="signMan" min-width="100" />
plain <el-table-column :label="$t('签收网点')" align="center" prop="signSiteCode" min-width="100" />
size="mini" <el-table-column :label="$t('签收时间')" align="center" prop="signDate" min-width="170" >
:disabled="multiple" <template slot-scope="scope">
@click="handleScanUpload" <span>{{ parseTime(scope.row.scanDate) }}</span>
v-hasPermi="['emis:emisTmsScanRecord:add']" </template>
>上传</el-button> </el-table-column>
</el-col> <el-table-column :label="$t('寄件日期')" align="center" prop="registerDate" min-width="170" >
<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="empCode" min-width="100" />
<el-table-column :label="$t('签收人')" align="center" prop="signMan" min-width="100" />
<el-table-column :label="$t('签收网点')" align="center" prop="signSiteCode" min-width="100" />
<el-table-column :label="$t('签收时间')" align="center" prop="signDate" min-width="170" >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.scanDate) }}</span> <span>{{ parseTime(scope.row.registerDate) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('寄件日期')" align="center" prop="registerDate" min-width="170" > <el-table-column :label="$t('寄件网点')" align="center" prop="registerSiteCode" min-width="100" />
<template slot-scope="scope"> <el-table-column :label="$t('到付转月结用户编号')" align="center" prop="customerCode" min-width="100" />
<span>{{ parseTime(scope.row.registerDate) }}</span> <el-table-column :label="$t('到付转月结用户名称')" align="center" prop="customerName" min-width="100" />
</template> <el-table-column :label="$t('派件日期')" align="center" prop="dispatchDate" min-width="170" >
</el-table-column> <template slot-scope="scope">
<el-table-column :label="$t('寄件网点')" align="center" prop="registerSiteCode" min-width="100" /> <span>{{ parseTime(scope.row.dispatchDate) }}</span>
<el-table-column :label="$t('到付转月结用户编号')" align="center" prop="customerCode" min-width="100" /> </template>
<el-table-column :label="$t('到付转月结用户名称')" align="center" prop="customerName" min-width="100" /> </el-table-column>
<el-table-column :label="$t('派件日期')" align="center" prop="dispatchDate" min-width="170" > <el-table-column :label="$t('派件网点')" align="center" prop="dispatchSiteCode" min-width="100" />
<template slot-scope="scope"> <el-table-column :label="$t('录件重量')" align="center" prop="volumeWeight" min-width="100" />
<span>{{ parseTime(scope.row.dispatchDate) }}</span> <el-table-column :label="$t('备注')" align="center" prop="remark" min-width="100" />
</template> <el-table-column :label="$t('签收图片')" align="center" min-width="100">
</el-table-column> <el-table-column :label="$t('保存目录')" align="center" prop="picUrl" width="200" >
<el-table-column :label="$t('派件网点')" align="center" prop="dispatchSiteCode" min-width="100" /> <template slot-scope="scope">
<el-table-column :label="$t('录件重量')" align="center" prop="volumeWeight" min-width="100" /> <span class="ellipsis">{{scope.row.picUrl}}</span>
<el-table-column :label="$t('备注')" align="center" prop="remark" min-width="100" /> </template>
<el-table-column :label="$t('签收图片')" align="center" min-width="100"> </el-table-column>
<!-- <el-table-column :label="$t('保存目录')" align="center" prop="picUrl" min-width="100" /> --> <el-table-column :label="$t('上传网点')" align="center" prop="xxxx" min-width="100" >
<el-table-column :label="$t('保存目录')" align="center" prop="picUrl" width="200" > </el-table-column>
<template slot-scope="scope"> <el-table-column :label="$t('上传人')" align="center" prop="xxxx" min-width="100" />
<span class="ellipsis">{{scope.row.picUrl}}</span> <el-table-column :label="$t('文件大小(KB)')" align="center" prop="xxxx" min-width="120" />
</template> </el-table-column>
</el-table-column> </el-table>
<el-table-column :label="$t('上传网点')" align="center" prop="xxxx" min-width="100" > <el-dialog :title="titleBatch" :visible.sync="openBatch" width="50%" v-dialogDrag :close-on-click-modal="false" append-to-body>
<!-- <span class="ellipsis"></span> --> <el-form ref="formBatch" :model="formBatch" :rules="rulesBatch" size="mini" label-width="60px">
</el-table-column> <el-row>
<el-table-column :label="$t('上传人')" align="center" prop="xxxx" min-width="100" /> <el-col :span="24">
<el-table-column :label="$t('文件大小(KB)')" align="center" prop="xxxx" min-width="120" /> <el-form-item :label="$t('运单号')" prop="billCode">
</el-table-column> <el-input v-model="formBatch.billCode" type="textarea" :rows="8" placeholder="运单号" />
</el-table> </el-form-item>
</el-col>
<!-- <div style="text-align: center;margin-bottom: 10px;"> <el-col :span="24">
<el-button type="primary" @click="submitForm">确 定</el-button> <div style="padding-left: 60px;font-size: 12px;"> T0123219321 有问题</div>
<el-button @click="cancel">取 消</el-button> </el-col>
</div> --> </el-row>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align:center">
<el-dialog :title="titleBatch" :visible.sync="openBatch" width="50%" v-dialogDrag :close-on-click-modal="false" append-to-body> <el-button type="primary" @click="submitFormBatch">确 定</el-button>
<el-form ref="formBatch" :model="formBatch" :rules="rulesBatch" size="mini" label-width="60px"> <el-button @click="cancelBatch">取 消</el-button>
<el-row> </div>
<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> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listEmisWaybill, getWaybillDetail,getEmisWaybill } from "@/api/emis/emisWaybill"; import { getWaybillDetail } from "@/api/emis/emisWaybill";
// import { doScan } from "@/api/emis/emisTmsScanRecord"; import { doScan } from "@/api/emis/emisTmsScanRecord";
import CustomerSimplePicker from '@/views/emis/EmisBaseTools/CustomerSimplePicker.vue'; import CustomerSimplePicker from '@/views/emis/EmisBaseTools/CustomerSimplePicker.vue';
import CustomerAddressSimplePicker from '@/views/emis/EmisBaseTools/CustomerAddressSimplePicker.vue';
import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue'; import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
// import FileUpload from '@/components/FileUpload/index.vue';
export default { export default {
name: "SignAndRecord", name: "SignAndRecord",
props:{ props:{
id:undefined id:undefined
}, },
components: { EmisUserSimplePicker, CustomerSimplePicker, CustomerAddressSimplePicker }, components: { EmisUserSimplePicker, CustomerSimplePicker },
dicts: ['emis_scan_type'], dicts: ['emis_scan_type'],
data() { data() {
return { return {
@ -242,17 +220,10 @@ export default {
open: false, open: false,
// 表单校验 // 表单校验
rules: { rules: {
// billCode: [
// { required: true, message: "billCode不能为空", trigger: "blur" }
// ],
// id: [
// { required: true, message: "id不能为空", trigger: "blur" }
// ],
}, },
rulesBatch: { rulesBatch: {
// id: [
// { required: true, message: "id不能为空", trigger: "blur" }
// ],
}, },
//查询信息展示 //查询信息展示
@ -281,17 +252,9 @@ export default {
this.form.dispatchOrSendMan=this.$store.getters.empName; this.form.dispatchOrSendMan=this.$store.getters.empName;
this.form.dispatchOrSendManCode=this.$store.getters.empCode; this.form.dispatchOrSendManCode=this.$store.getters.empCode;
// this.form.scanWeight = "1.0";
console.log(this.form)
}, },
methods: { methods: {
getRowSelect(row, column, event) {
// dosomething
},
handleInput(item){ handleInput(item){
this.form.picUrl = item; this.form.picUrl = item;
}, },
@ -304,10 +267,6 @@ export default {
this.form.customerName=null; this.form.customerName=null;
} }
}, },
// onStaffSelect(item){
// this.form.dispatchOrSendMan=item.empName || this.$store.getters.empName;
// this.form.dispatchOrSendManCode=item.empCode || this.$store.getters.empCode;
// },
onSendStaffSelect(item){ onSendStaffSelect(item){
// this.form.dispatchMan=item.empName || this.$store.getters.empName; // this.form.dispatchMan=item.empName || this.$store.getters.empName;
this.form.dispatchManCode=item.empCode; this.form.dispatchManCode=item.empCode;
@ -316,9 +275,6 @@ export default {
this.form.signMan=item.empName || this.$store.getters.empName; this.form.signMan=item.empName || this.$store.getters.empName;
this.form.signManCode=item.empCode || this.$store.getters.empCode; this.form.signManCode=item.empCode || this.$store.getters.empCode;
}, },
getRowsSelect(arr) {
this.form.ids= arr.map(item=>item.id)
},
handleBatchScan(){ handleBatchScan(){
this.formBatch = { this.formBatch = {
billCode: null, billCode: null,
@ -342,54 +298,14 @@ export default {
this.openBatch=false; this.openBatch=false;
}, },
submitFormBatch(){ submitFormBatch(){
if(this.formBatch.billCode==null || this.formBatch.billCode==''){ if(this.formBatch.billCode==null || this.formBatch.billCode==''){
this.$message.error("输入单号后回车"); this.$message.error("输入单号后回车");
return; return;
} }
let bcList=this.formBatch.billCode.split(/[;\;\,\,\n]/)||[]; let bcList=this.formBatch.billCode.split(/[;\;\,\,\n]/)||[];
let scanWeight = this.form.scanWeight bcList.forEach((code) => {
let dispatchOrSendManCode = this.form.dispatchOrSendManCode; this.getDetail(code, true)
let scList=bcList.map(function(code) { })
return {
billCode:code,
scanWeight:scanWeight,
// scanWeight:null,
dispatchOrSendManCode: dispatchOrSendManCode
}
}
)
let scanInfo = {
scanType:"50",
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 = '50';
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; this.openBatch=false;
}, },
// 表单重置 // 表单重置
@ -561,18 +477,6 @@ export default {
this.ids = selection.map(item => item.billCode) this.ids = selection.map(item => item.billCode)
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length 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(){ handleScanUpload(){
@ -584,21 +488,20 @@ export default {
scanData.push( scanData.push(
{ {
billCode:item.billCode, billCode:item.billCode,
signMan:item.signMan,
signManCode:item.signManCode,
picUrl:item.picUrl,
remark:item.remark,
scanWeight:item.scanWeight, scanWeight:item.scanWeight,
dispatchOrSendManCode:item.dispatchOrSendManCode, dispatchManCode:item.dispatchManCode,
customerCode:item.customerCode,
customerName:item.customerName,
// dispatchOrSendManCode:item.dispatchOrSendManCode,
scanDate:item.scanDate scanDate:item.scanDate
} }
); );
}); });
// record.dispatchManCode=this.form.dispatchManCode;
// record.signManCode=this.form.signManCode;
// record.signMan=this.form.signMan;
// record.customerCode=this.form.customerCode;
// record.customerName=this.form.customerName;
// record.picUrl=this.form.picUrl;
// 检查 // 检查
let scanInfo = {scanType:"50",opType:2,scanData:scanData} let scanInfo = {scanType:"50",opType:2,scanData:scanData}
console.log(scanInfo) console.log(scanInfo)
@ -614,26 +517,22 @@ export default {
this.$modal.msgSuccess(scanRstItem.message); this.$modal.msgSuccess(scanRstItem.message);
}); });
}, },
handleScanInput(){ handleScanInput(){
if(this.form.billCode==null || this.form.billCode==''){ if(this.form.billCode==null || this.form.billCode==''){
this.$message.error("输入单号后回车"); this.$message.error("输入单号后回车");
return; return;
} }
if(this.dataMap[this.form.billCode]){ if(this.dataMap[this.form.billCode]){
this.$message.error("重复扫描"); this.$message.error("重复扫描");
this.playNoticeTone(1); this.playNoticeTone(1);
return; return;
} }
this.getDetail(this.form.billCode)
getWaybillDetail(this.form.billCode).then(response => { this.form.billCode =null;
console.log(response); },
debugger; getDetail(billCode, isBatch){
this.emisTmsScanRecordList=[]; getWaybillDetail(billCode).then(response => {
let scanRstItem = response.data; let scanRstItem = response.data;
console.log(scanRstItem); console.log(scanRstItem);
if(response.code != 200){ if(response.code != 200){
@ -650,14 +549,9 @@ export default {
let indexBillCode=record.billCode; let indexBillCode=record.billCode;
this.dataMap[indexBillCode]=record; this.dataMap[indexBillCode]=record;
this.emisTmsScanRecordList.push(record); this.emisTmsScanRecordList.push(record);
this.record = record; isBatch || this.emisTmsScanRecordList.length > 1 ? this.record = {} : this.record = record;
}); });
}
this.form.billCode =null;
},
} }
}; };
</script> </script>