|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
<div class="container">
|
|
<div class="container">
|
|
- <van-form class="formStyle" @submit="onSubmit" ref="formRef">
|
|
|
|
|
|
+ <van-form class="formStyle" ref="formRef">
|
|
<div class="formStyle-top">
|
|
<div class="formStyle-top">
|
|
<van-field style="width: 100%;" v-model="object.expressNo" name="expressNo" label="快递单号"
|
|
<van-field style="width: 100%;" v-model="object.expressNo" name="expressNo" label="快递单号"
|
|
placeholder="快递单号" :rules="[{ required: true }]" />
|
|
placeholder="快递单号" :rules="[{ required: true }]" />
|
|
@@ -61,10 +61,10 @@
|
|
<div
|
|
<div
|
|
style=" display: flex; justify-content: space-between; background-color: #fff; padding: 10px 20px;">
|
|
style=" display: flex; justify-content: space-between; background-color: #fff; padding: 10px 20px;">
|
|
<van-button size="small" style="border-radius: 5px; width: 50vw; " block type="info"
|
|
<van-button size="small" style="border-radius: 5px; width: 50vw; " block type="info"
|
|
- @click="printerGo" native-type="button">保存/打印小标签并添加下一个</van-button>
|
|
|
|
|
|
+ @click="handleSubmit(true)" native-type="button">保存并打印</van-button>
|
|
|
|
|
|
<van-button size="small" style="border-radius: 5px; width: 35vw;" block type="info"
|
|
<van-button size="small" style="border-radius: 5px; width: 35vw;" block type="info"
|
|
- native-type="submit">保存并添加下一个</van-button>
|
|
|
|
|
|
+ @click="handleSubmit(false)" native-type="button">仅保存</van-button>
|
|
</div>
|
|
</div>
|
|
</van-form>
|
|
</van-form>
|
|
</div>
|
|
</div>
|
|
@@ -106,12 +106,14 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { appGetEmployeeInfoByPhone, appGeLogisticsList, appSaveExpressRecord, getSysUserInfoByUserIdAPI, getListOfPrinters, storagePrintSmallTab } from '@/api/index'
|
|
|
|
|
|
+import { appGetEmployeeInfoByPhone, appGeLogisticsList, appSaveExpressRecord, getSysUserInfoByUserIdAPI, getListOfPrinters, storagePrintSmallTab ,appFindInsideInfoByExpressNo} from '@/api/index'
|
|
import { Toast } from 'vant';
|
|
import { Toast } from 'vant';
|
|
import wx from "weixin-jsapi";
|
|
import wx from "weixin-jsapi";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ isPrint:false,//是否需要打印
|
|
|
|
+ expressInfo:{},// 快件信息
|
|
gfg: {},
|
|
gfg: {},
|
|
isCompany: '否',
|
|
isCompany: '否',
|
|
inputValue: '',//输入手机号后四位聚焦
|
|
inputValue: '',//输入手机号后四位聚焦
|
|
@@ -145,9 +147,11 @@ export default {
|
|
value14: '',
|
|
value14: '',
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- mounted() {
|
|
|
|
|
|
+ async mounted() {
|
|
this.getUser()
|
|
this.getUser()
|
|
this.floorId = this.$store.state.user.expressScope
|
|
this.floorId = this.$store.state.user.expressScope
|
|
|
|
+ const expressData = await appFindInsideInfoByExpressNo({insideNum:'S6000000363245086'})
|
|
|
|
+ this.handleAppFindInsideInfoByExpressNoCallback(expressData)
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
|
|
@@ -156,20 +160,26 @@ export default {
|
|
wx.scanQRCode({
|
|
wx.scanQRCode({
|
|
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
|
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
|
scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
|
|
scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
|
|
- success: (res) => {
|
|
|
|
|
|
+ success: async (res) => {
|
|
var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
|
|
var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
|
|
if (result.indexOf(",") != -1) {
|
|
if (result.indexOf(",") != -1) {
|
|
let result1 = res.resultStr.split(",");
|
|
let result1 = res.resultStr.split(",");
|
|
result = result1[result1.length - 1];
|
|
result = result1[result1.length - 1];
|
|
}
|
|
}
|
|
this.object.expressNo = result
|
|
this.object.expressNo = result
|
|
|
|
+ const expressData = await appFindInsideInfoByExpressNo({insideNum})
|
|
|
|
+ handleAppFindInsideInfoByExpressNoCallback(expressData)
|
|
|
|
+ console.log(expressData)
|
|
},
|
|
},
|
|
error: function (res) {
|
|
error: function (res) {
|
|
console.log(res, 'error++++++++++');
|
|
console.log(res, 'error++++++++++');
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ },
|
|
|
|
|
|
-
|
|
|
|
|
|
+ // 查询快递单号回调
|
|
|
|
+ handleAppFindInsideInfoByExpressNoCallback(data){
|
|
|
|
+ this.expressInfo
|
|
},
|
|
},
|
|
// 手机号点击聚焦
|
|
// 手机号点击聚焦
|
|
onFocus() {
|
|
onFocus() {
|
|
@@ -217,6 +227,10 @@ export default {
|
|
this.shelf = false;
|
|
this.shelf = false;
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ handleSubmit(isPrint){
|
|
|
|
+ this.isPrint = isPrint;
|
|
|
|
+ this.$refs.formRef.submit()
|
|
|
|
+ },
|
|
|
|
|
|
// 提交
|
|
// 提交
|
|
async onSubmit(values) {
|
|
async onSubmit(values) {
|
|
@@ -242,9 +256,13 @@ export default {
|
|
}
|
|
}
|
|
const res = await appSaveExpressRecord({ ...params, ...value, departmentId: this.onGroupObject.departmentName }, { emulateJSON: true })
|
|
const res = await appSaveExpressRecord({ ...params, ...value, departmentId: this.onGroupObject.departmentName }, { emulateJSON: true })
|
|
this.value14 = this.object.value4
|
|
this.value14 = this.object.value4
|
|
- console.log(res[0], 'res===')
|
|
|
|
if (res.msg == 'success') {
|
|
if (res.msg == 'success') {
|
|
- this.$toast('打印成功')
|
|
|
|
|
|
+ this.$toast('入库成功')
|
|
|
|
+ if(this.isPrint){
|
|
|
|
+ this.printerGo();
|
|
|
|
+ }
|
|
|
|
+ this.isPrint = false;
|
|
|
|
+ this.expressInfo = {};
|
|
this.object = {
|
|
this.object = {
|
|
remark: '',
|
|
remark: '',
|
|
radio: '文件',
|
|
radio: '文件',
|
|
@@ -261,7 +279,7 @@ export default {
|
|
mailFloor: '',
|
|
mailFloor: '',
|
|
seat_no: '',
|
|
seat_no: '',
|
|
},
|
|
},
|
|
- this.checkbox = false
|
|
|
|
|
|
+ this.checkbox = false
|
|
|
|
|
|
} else if (res.msg == 'already') {
|
|
} else if (res.msg == 'already') {
|
|
this.$toast('该账号已添加过')
|
|
this.$toast('该账号已添加过')
|
|
@@ -278,6 +296,15 @@ export default {
|
|
// 保存/打印小标签并添加下一个
|
|
// 保存/打印小标签并添加下一个
|
|
async printerGo() {
|
|
async printerGo() {
|
|
const getPrinters = await getListOfPrinters({})
|
|
const getPrinters = await getListOfPrinters({})
|
|
|
|
+ console.log(getPrinters)
|
|
|
|
+ if(getPrinters.data.length === 0){
|
|
|
|
+ Toast('该用户未绑定打印机')
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if(getPrinters.data.length === 1){
|
|
|
|
+ this.onPrinter(getPrinters.data[0])
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if (getPrinters.code == 0) {
|
|
if (getPrinters.code == 0) {
|
|
// const qwe = {
|
|
// const qwe = {
|
|
// IMEI: "8672970676795912",
|
|
// IMEI: "8672970676795912",
|
|
@@ -315,13 +342,11 @@ export default {
|
|
// 开始走打印机面单
|
|
// 开始走打印机面单
|
|
const formData = this.$refs.formRef.getValues();
|
|
const formData = this.$refs.formRef.getValues();
|
|
try {
|
|
try {
|
|
- await this.onSubmit(formData)
|
|
|
|
const res = await storagePrintSmallTab({ expressNo: formData.expressNo, id: e.id })
|
|
const res = await storagePrintSmallTab({ expressNo: formData.expressNo, id: e.id })
|
|
if (res.msg == 'success') {
|
|
if (res.msg == 'success') {
|
|
Toast('打印成功')
|
|
Toast('打印成功')
|
|
|
|
|
|
}
|
|
}
|
|
- console.log(res, '最后')
|
|
|
|
this.printerShow = false;
|
|
this.printerShow = false;
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
|
|