完成扫描记录查询页开发

This commit is contained in:
liuyp 2024-05-11 12:50:49 +08:00
parent e16376b33f
commit d1cdc6d573

View File

@ -89,7 +89,7 @@
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="clearSelectionBatch"
@click="handleDelete"
v-hasPermi="['emis:emisTmsScanRecord:remove']"
>删除</el-button>
</el-col>
@ -114,7 +114,11 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column :label="$t('单号')" align="center" prop="billCode" min-width="100" />
<el-table-column :label="$t('单号')" align="center" prop="queryType" min-width="100">
<template slot-scope="scope">
<span>{{scope.row.queryType=="1"?scope.row.billCode:scope.row.orderSN}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('单号类型')" align="center" prop="nuType" min-width="100" />
<el-table-column :label="$t('车牌号')" align="center" prop="carNo" min-width="100" />
<el-table-column :label="$t('扫描时间')" align="center" prop="scanDate" min-width="170" >
@ -148,13 +152,13 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('上/下一网点')" prop="preOrNextStation" label-width="90px">
<EmisSiteSimplePicker key="3" v-model="modifyParams.preOrNextStation" @onChange="onModifyPreOrNextSiteSelect" ></EmisSiteSimplePicker>
<el-form-item :label="$t('上/下一网点')" prop="preOrNextStationCode" label-width="90px">
<EmisSiteSimplePicker key="3" v-model="modifyParams.preOrNextStationCode" @onChange="onModifyPreOrNextSiteSelect" ></EmisSiteSimplePicker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('取件员')" prop="dispatchOrSendManCode">
<EmisUserSimplePicker v-model="modifyParams.dispatchOrSendManCode" postCode="RSD" @onChange="onModifyStaffSelect" ></EmisUserSimplePicker>
<el-form-item :label="$t('扫描员工')" prop="scanManCode">
<EmisUserSimplePicker key="4" v-model="modifyParams.scanManCode" postCode="RSD" @onChange="onModifyStaffSelect" ></EmisUserSimplePicker>
</el-form-item>
</el-col>
</el-form>
@ -170,7 +174,7 @@
<script>
import { listEmisElectronicPagApply, getEmisElectronicPagApply, delEmisElectronicPagApply, addEmisElectronicPagApply, updateEmisElectronicPagApply } from "@/api/emis/emisElectronicPagApply";
import { listEmisTmsScanRecord } from "@/api/emis/emisTmsScanRecord";
import { listEmisTmsScanRecord, delEmisTmsScanRecord, updateEmisTmsScanRecord } from "@/api/emis/emisTmsScanRecord";
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
// import emisElectronicPagApplyView from '@/views/emis/emisElectronicPagApply/emisElectronicPagApplyView';
@ -279,9 +283,15 @@ export default {
},
// 修改参数
modifyParams:{
scanSite:null,
scanSiteCode:null,
scanSitePhone:null,
preOrNextStation:null,
dispatchOrSendManCode:null
preOrNextStationCode:null,
preOrNextStationPhone:null,
scanMan:null,
scanManCode:null,
scanManPhone:null,
},
// 表单参数
form: {},
@ -315,9 +325,10 @@ export default {
this.queryParams.params["queryType"] = this.queryParams.queryType;//1:yd;2:dd;
this.queryParams.params["isSubBill"] = this.queryParams.isSubBill;//1:子单;0:主单
if(this.queryParams.queryType == "1"){
let queryType = this.queryParams.queryType;
if(queryType == "1"){
this.queryParams.orderSN=null;
}else if(this.queryParams.queryType == "2"){
}else if(queryType == "2"){
this.queryParams.orderSN=this.queryParams.billCode;
this.queryParams.billCode=null;
}
@ -350,7 +361,10 @@ export default {
// record.carNo=scanRstItem.carNo;
// record.scanData=scanRstItem.scanData;
// record.scanType=scanRstItem.scanType;
record.orderType = this.queryParams.orderType;
// if(queryType == "1"){
// this.queryParams.orderSN=null;
// }
record.queryType = this.queryParams.queryType;
record.scanSiteName = this.queryParams.scanSiteName || record.scanSiteName;
record.preOrNextStation = this.queryParams.preOrNextStation || scanRstItem.preOrNextStation;
// record.createTime=scanRstItem.createTime;
@ -366,10 +380,10 @@ export default {
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.resetModifyParams();
},
onScanSiteSelect(item){
this.queryParams.scanSiteName=item.siteName;
this.queryParams.scanSite=item.siteName;
this.queryParams.scanSiteCode=item.siteCode;
},
onPreOrNextSiteSelect(item){
@ -381,28 +395,31 @@ export default {
this.queryParams.destName=item.destName;
},
onDateSelect(value){
debugger;
console.log("date picker---->", value)
this.dateTimeRange=value;
// scanDate
},
onModifyScanSiteSelect(item){
debugger
this.modifyParams.scanSite=item.siteName;
this.modifyParams.scanSiteCode = item.siteCode
this.modifyParams.scanSitePhone = item.scanSitePhone;
},
onModifyPreOrNextSiteSelect(item){
debugger
this.modifyParams.preOrNextStation=item.siteName;
this.modifyParams.preOrNextStationCode=item.siteCode;
this.modifyParams.preOrNextStationPhone=item.preOrNextStationPhone;
},
onModifyStaffSelect(item){
debugger
this.modifyParams.scanMan=item.empName;
this.modifyParams.scanManCode=item.empCode;
// this.modifyParams.scanManPhone=item.scanManPhone;
},
//删除
clearSelectionBatch(){
let newList =[];
console.log(this.ids)
this.emisElectronicPagApplyList.forEach(item=>{
if(this.ids.indexOf(item.billCode+item.scanType) == -1){
if(this.ids.indexOf(item.id) == -1){
newList.push(item);
}
});
@ -466,9 +483,22 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
resetModifyParams(){
this.modifyParams = {
scanSite:null,
scanSiteCode:null,
scanSitePhone:null,
preOrNextStation:null,
preOrNextStationCode:null,
preOrNextStationPhone:null,
scanMan:null,
scanManCode:null,
scanManPhone:null,
}
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.billCode+item.scanType)
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
@ -495,9 +525,13 @@ export default {
this.moreInputVisible = !this.moreInputVisible;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
handleUpdate() {
// this.reset();
// const id = this.ids
if(!this.ids || this.ids.length == 0){
this.$message.error("未选中数据,请先选择");
return;
}
this.open = true;
this.title = "修改";
// getEmisElectronicPagApply(id).then(response => {
@ -520,6 +554,18 @@ export default {
},
/** 提交按钮 */
submitForm() {
for(var i=0; i<this.ids.length;i++){
updateEmisTmsScanRecord({
id:this.ids[i],
...this.modifyParams
}).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.resetModifyParams();
this.getList();
});
}
// this.$refs["form"].validate(valid => {
// if (valid) {
// if (this.form.id != null) {
@ -548,10 +594,10 @@ export default {
this.openForm = false;
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
handleDelete() {
const ids = this.ids
this.$modal.confirm('是否确认删除').then(function() {
return delEmisElectronicPagApply(ids);
return delEmisTmsScanRecord(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");