This commit is contained in:
linfso 2024-12-25 17:41:43 +08:00
parent 1062ad60c2
commit 69bd78af7c
3 changed files with 80 additions and 75 deletions

View File

@ -891,7 +891,9 @@ export default {
}
let billCode=item0.billCode;
this.$router.push({ path: '/d24/waybillManagement/WaybillRecord', query: {name:"接单", action: "add",billCode: billCode,addFrom:"userOrder"}})
this.$router.push({ path: '/d24/waybillManagement/WaybillGot', query: {name:"接单", action: "got",billCode: billCode,timestamp:(new Date()).getTime() }})
// this.$router.push({ path: '/d24/waybillManagement/WaybillRecord', query: {name:"接单", action: "add",billCode: billCode,addFrom:"userOrder"}})
}

View File

@ -13,23 +13,23 @@
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<!-- 运单录入 -->
<el-col :span="6" v-if="action=='add' || action=='preAdd'">
<el-col :span="6" v-if="action=='add' || action=='preAdd' || action=='got'">
<el-form-item :label="$t('发货时间')" prop="sendDate">
<el-input v-model="sendDate" placeholder="" disabled />
</el-form-item>
</el-col>
<el-col :span="18" v-if="action=='add' || action=='preAdd'">
<el-col :span="18" v-if="action=='add' || action=='preAdd' || action=='got'">
<el-form-item :label="$t('运单号')" prop="billCode" >
<div style="display:inline-flex">
<div>
<el-input v-model="form.billCode" placeholder="" @blur="onBillCodeChange" style="font-weight:600;color:black" :disabled="this.addFrom=='userOrder'" />
<el-input v-model="form.billCode" placeholder="" @blur="onBillCodeChange" style="font-weight:600;color:black" :disabled="this.action=='got'" />
</div>
<div style="padding-left:5px"> <el-checkbox v-model="form.blSelfBillCode" style="font-size:400;margin-right:10px;font-size:10px" :disabled="this.addFrom=='userOrder'" @change="checked=>handleBillCodeChange(checked)" :true-label="'1'" :false-label="'0'"><span style="font-size:10px">{{ $t('电子主单') }}</span></el-checkbox></div>
<div style="padding-left:5px"> <el-checkbox v-model="form.blSelfBillCode" style="font-size:400;margin-right:10px;font-size:10px" :disabled="this.action=='got'" @change="checked=>handleBillCodeChange(checked)" :true-label="'1'" :false-label="'0'"><span style="font-size:10px">{{ $t('电子主单') }}</span></el-checkbox></div>
</div>
</el-form-item>
</el-col>
<!-- <el-col :span="8" v-if="action=='add' && addFrom=='userOrder'">
<!-- <el-col :span="8" v-if="action=='got'">
<el-form-item :label="$t('寄件网点')" prop="sendSiteCode">
<EmisSiteSimplePicker v-if="$store.getters.ownerSiteCode== '88888'" v-model="form.sendSiteCode" @onChange="onSendSiteSelect" ></EmisSiteSimplePicker>
<el-input v-else v-model="form.sendSiteName" placeholder="" disabled />
@ -361,6 +361,7 @@
<el-input v-model="form.billWeight" @blur="handleCalcSettlementWeight" @keyup.enter.native="handleCalcSettlementWeight" style="text-align: right;min-width: 80px" placeholder="" >
<span slot="suffix">(kg)</span>
</el-input>
</el-form-item>
</el-col>
@ -717,7 +718,7 @@
</el-form-item>
</el-col>
<el-col :span="24" v-if="action=='add' || action=='preAdd' ">
<el-col :span="24" v-if="action=='add' || action=='preAdd' || action=='got' ">
<el-form-item :label="$t('打印选项')" prop="printTypeCheckList">
<el-checkbox-group v-model="form.printTypeCheckList">
<el-checkbox :key="0" :label="0" >
@ -732,7 +733,7 @@
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :span="24" v-if="action=='add' || action=='preAdd'">
<el-col :span="24" v-if="action=='add' || action=='preAdd' || action=='got'">
<el-form-item :label="$t('打印组件')" prop="printTypeCheckList">
<TanexPrinterPanel ref="tanexPrinter" :isShowPinters="true" v-model="printerStatus" @onPrint="handleBatchPrint" :isInitA4="false" @onPrintComplete="onComplete"></TanexPrinterPanel>
<!-- <el-button type="primary" @click="handleTestPrintPreview">{{$t('测试打印')}}</el-button> -->
@ -823,6 +824,7 @@ import { deepClone } from '@/utils/index'
export default {
// name: "WaybillRecord",
// name: "WaybillGot",
name: "WaybillModify",
components: {
SalemanPicker,
@ -871,8 +873,8 @@ data() {
loading: true,
triggerCount:0,
action:null,
addFrom:null,
sendDate:null,
lastTimestamp:null,
// 表单参数
form: {},
timer:null,
@ -1032,30 +1034,43 @@ computed: {
},
watch: {
$route () {
if(this.$route.query.addFrom=="userOrder"){
this.action="add";
this.addFrom="userOrder";
this.billCode=this.$route.query.billCode;
this.$route.meta.title = "接单";
this.initData();
if(this.$route.query.action=='got'){
this.action="got";
// 判断时间是否一致
if(this.lastTimestamp != this.$route.query.timestamp){
this.lastTimestamp=this.$route.query.timestamp;
this.billCode=this.$route.query.billCode;
const title = '接单:'+this.billCode;
const route = Object.assign({}, this.$route, { title: `${title}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
this.initData();
}
}
}
},
// beforeRouteEnter(to,from,next){
// if(to.query.name){
// to.meta.title = to.query.name;
// }
// next()
// },
created() {
this.action=this.$route.query.action;
if(!this.action){
this.action="add";
}
if(this.$route.query.addFrom=="userOrder"){
if(this.action=='add' ){
this.billCode=null;
const title = '运单录入';
const route = Object.assign({}, this.$route, { title: `${title}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
}
else if(this.action=='got'){
this.billCode=this.$route.query.billCode;
this.addFrom="userOrder";
const title = '接单:'+this.billCode;
const route = Object.assign({}, this.$route, { title: `${title}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
}
else if(this.action=='modify'){
const title = '运单修改';
const route = Object.assign({}, this.$route, { title: `${title}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
}
this.initData();
@ -1073,7 +1088,6 @@ methods: {
this.billCode=this.form.billCode+"";
this.initData();
},
onBillCodeChange(){
if(this.form.billCode){
this.form.billCode=this.form.billCode.replace(/\s+/g, '');
@ -1448,7 +1462,7 @@ methods: {
if(this.billCode && this.billCode!=undefined) {
this.loading = true;
getWaybillDetail(this.billCode).then(response => {
if(this.$store.getters.ownerSiteCode!='88888'&&this.addFrom!='userOrder'){
if(this.$store.getters.ownerSiteCode!='88888'&&this.action!='got'){
if(this.$store.getters.ownerSiteCode!=response.data.sendSiteCode){
this.$modal.msgError('此单归属不允许修改');
return;
@ -1456,7 +1470,7 @@ methods: {
}
this.form = response.data;
if(this.form.lockFlag=="T"&&this.addFrom!='userOrder'){
if(this.form.lockFlag=="T"&&this.action!='got'){
this.$confirm(this.form.lockReason, '提示', {
confirmButtonText: '确认',
cancelButtonText: '返回',
@ -1492,7 +1506,7 @@ methods: {
// 接单处理
if(this.addFrom=="userOrder"){
if(this.action=="got"){
// 获取可用运单数
this.initGetTotalAvailablePag(this.form.sendSiteCode);
this.startTimer();
@ -1716,7 +1730,7 @@ methods: {
});
},
startTimer(){
if(this.action=='add' || this.action=='preAdd'){
if(this.action=='add' || this.action=='preAdd' || this.action=='got'){
this.sendDate=parseTime(new Date());
this.timer = setTimeout(this.startTimer, 1000);
}
@ -1737,9 +1751,8 @@ methods: {
realSubmitOrder(postForm).then(response => {
this.$modal.msgSuccess("下单成功");
this.addFrom=null;
// 新开单才需要打印
if(this.action == "add"){
if(this.action == "add" || this.action == "got"){
// 做揽收扫描记录
// this.handDoGotScan();

View File

@ -13,23 +13,23 @@
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<!-- 运单录入 -->
<el-col :span="6" v-if="action=='add' || action=='preAdd'">
<el-col :span="6" v-if="action=='add' || action=='preAdd' || action=='got'">
<el-form-item :label="$t('发货时间')" prop="sendDate">
<el-input v-model="sendDate" placeholder="" disabled />
</el-form-item>
</el-col>
<el-col :span="18" v-if="action=='add' || action=='preAdd'">
<el-col :span="18" v-if="action=='add' || action=='preAdd' || action=='got'">
<el-form-item :label="$t('运单号')" prop="billCode" >
<div style="display:inline-flex">
<div>
<el-input v-model="form.billCode" placeholder="" @blur="onBillCodeChange" style="font-weight:600;color:black" :disabled="this.addFrom=='userOrder'" />
<el-input v-model="form.billCode" placeholder="" @blur="onBillCodeChange" style="font-weight:600;color:black" :disabled="this.action=='got'" />
</div>
<div style="padding-left:5px"> <el-checkbox v-model="form.blSelfBillCode" style="font-size:400;margin-right:10px;font-size:10px" :disabled="this.addFrom=='userOrder'" @change="checked=>handleBillCodeChange(checked)" :true-label="'1'" :false-label="'0'"><span style="font-size:10px">{{ $t('电子主单') }}</span></el-checkbox></div>
<div style="padding-left:5px"> <el-checkbox v-model="form.blSelfBillCode" style="font-size:400;margin-right:10px;font-size:10px" :disabled="this.action=='got'" @change="checked=>handleBillCodeChange(checked)" :true-label="'1'" :false-label="'0'"><span style="font-size:10px">{{ $t('电子主单') }}</span></el-checkbox></div>
</div>
</el-form-item>
</el-col>
<!-- <el-col :span="8" v-if="action=='add' && addFrom=='userOrder'">
<!-- <el-col :span="8" v-if="action=='got'">
<el-form-item :label="$t('寄件网点')" prop="sendSiteCode">
<EmisSiteSimplePicker v-if="$store.getters.ownerSiteCode== '88888'" v-model="form.sendSiteCode" @onChange="onSendSiteSelect" ></EmisSiteSimplePicker>
<el-input v-else v-model="form.sendSiteName" placeholder="" disabled />
@ -718,7 +718,7 @@
</el-form-item>
</el-col>
<el-col :span="24" v-if="action=='add' || action=='preAdd' ">
<el-col :span="24" v-if="action=='add' || action=='preAdd' || action=='got' ">
<el-form-item :label="$t('打印选项')" prop="printTypeCheckList">
<el-checkbox-group v-model="form.printTypeCheckList">
<el-checkbox :key="0" :label="0" >
@ -733,7 +733,7 @@
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :span="24" v-if="action=='add' || action=='preAdd'">
<el-col :span="24" v-if="action=='add' || action=='preAdd' || action=='got'">
<el-form-item :label="$t('打印组件')" prop="printTypeCheckList">
<TanexPrinterPanel ref="tanexPrinter" :isShowPinters="true" v-model="printerStatus" @onPrint="handleBatchPrint" :isInitA4="false" @onPrintComplete="onComplete"></TanexPrinterPanel>
<!-- <el-button type="primary" @click="handleTestPrintPreview">{{$t('测试打印')}}</el-button> -->
@ -824,6 +824,7 @@ import { deepClone } from '@/utils/index'
export default {
name: "WaybillRecord",
// name: "WaybillGot",
// name: "WaybillModify",
components: {
SalemanPicker,
@ -872,8 +873,8 @@ data() {
loading: true,
triggerCount:0,
action:null,
addFrom:null,
sendDate:null,
lastTimestamp:null,
// 表单参数
form: {},
timer:null,
@ -1033,27 +1034,17 @@ computed: {
},
watch: {
$route () {
if(this.$route.query.action=='add'){
this.action="add";
if(this.$route.query.addFrom=="userOrder"){
this.addFrom="userOrder";
if(this.$route.query.action=='got'){
this.action="got";
// 判断时间是否一致
if(this.lastTimestamp != this.$route.query.timestamp){
this.lastTimestamp=this.$route.query.timestamp;
this.billCode=this.$route.query.billCode;
const title = '接单';
const title = '接单:'+this.billCode;
const route = Object.assign({}, this.$route, { title: `${title}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
}else{
this.addFrom=null;
this.billCode=null;
const title = '运单录入';
const route = Object.assign({}, this.$route, { title: `${title}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
this.initData();
}
this.initData();
}
}
@ -1065,20 +1056,16 @@ created() {
}
if(this.action=='add' ){
this.billCode=null;
const title = '运单录入';
const route = Object.assign({}, this.$route, { title: `${title}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
}
else if(this.action=='got'){
this.billCode=this.$route.query.billCode;
if(this.$route.query.addFrom=="userOrder"){
this.addFrom="userOrder";
const title = '接单';
const route = Object.assign({}, this.$route, { title: `${title}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
}else{
this.billCode=null;
this.addFrom=null;
const title = '运单录入';
const route = Object.assign({}, this.$route, { title: `${title}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
}
const title = '接单:'+this.billCode;
const route = Object.assign({}, this.$route, { title: `${title}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
}
else if(this.action=='modify'){
const title = '运单修改';
@ -1101,7 +1088,6 @@ methods: {
this.billCode=this.form.billCode+"";
this.initData();
},
onBillCodeChange(){
if(this.form.billCode){
this.form.billCode=this.form.billCode.replace(/\s+/g, '');
@ -1476,7 +1462,7 @@ methods: {
if(this.billCode && this.billCode!=undefined) {
this.loading = true;
getWaybillDetail(this.billCode).then(response => {
if(this.$store.getters.ownerSiteCode!='88888'&&this.addFrom!='userOrder'){
if(this.$store.getters.ownerSiteCode!='88888'&&this.action!='got'){
if(this.$store.getters.ownerSiteCode!=response.data.sendSiteCode){
this.$modal.msgError('此单归属不允许修改');
return;
@ -1484,7 +1470,7 @@ methods: {
}
this.form = response.data;
if(this.form.lockFlag=="T"&&this.addFrom!='userOrder'){
if(this.form.lockFlag=="T"&&this.action!='got'){
this.$confirm(this.form.lockReason, '提示', {
confirmButtonText: '确认',
cancelButtonText: '返回',
@ -1520,9 +1506,14 @@ methods: {
// 接单处理
if(this.addFrom=="userOrder"){
if(this.action=="got"){
// 获取可用运单数
this.initGetTotalAvailablePag(this.form.sendSiteCode);
if(!this.form.cargoList){
this.handleInitGenGoods();
}
this.startTimer();
}
@ -1744,7 +1735,7 @@ methods: {
});
},
startTimer(){
if(this.action=='add' || this.action=='preAdd'){
if(this.action=='add' || this.action=='preAdd' || this.action=='got'){
this.sendDate=parseTime(new Date());
this.timer = setTimeout(this.startTimer, 1000);
}
@ -1765,9 +1756,8 @@ methods: {
realSubmitOrder(postForm).then(response => {
this.$modal.msgSuccess("下单成功");
this.addFrom=null;
// 新开单才需要打印
if(this.action == "add"){
if(this.action == "add" || this.action == "got"){
// 做揽收扫描记录
// this.handDoGotScan();