|
@@ -3,8 +3,9 @@
|
|
|
<scroll-view class="scroller" :scroll-into-view="toView" scroll-y="true" scroll-with-animation="true">
|
|
<scroll-view class="scroller" :scroll-into-view="toView" scroll-y="true" scroll-with-animation="true">
|
|
|
<view class="flex flex-a-c flex-j-b bg-white bind-audit mb-16">
|
|
<view class="flex flex-a-c flex-j-b bg-white bind-audit mb-16">
|
|
|
<text>绑定审核员</text>
|
|
<text>绑定审核员</text>
|
|
|
- <text class="text-center flex-1">{{ orderDetail.auditUserName || selectedAuditor?.userName || ''
|
|
|
|
|
- }}</text>
|
|
|
|
|
|
|
+ <text class="text-center flex-1">{{
|
|
|
|
|
+ orderDetail.auditUserName || selectedAuditor?.userName || ""
|
|
|
|
|
+ }}</text>
|
|
|
<text @click="showAuditorSelector = true" class="color-primary">绑定</text>
|
|
<text @click="showAuditorSelector = true" class="color-primary">绑定</text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -12,18 +13,27 @@
|
|
|
|
|
|
|
|
<UserInfoCard :detail="orderDetail" />
|
|
<UserInfoCard :detail="orderDetail" />
|
|
|
|
|
|
|
|
- <view class="mt-16" style="padding: 0 6rpx;">
|
|
|
|
|
- <u-subsection :list="list" mode="subsection" :current="current"
|
|
|
|
|
- @change="handleSectionChange"></u-subsection>
|
|
|
|
|
- <BookInfo v-if="current == 0" :bookList="orderDetail.detailVoList" :detail="orderDetail"
|
|
|
|
|
- @get-all-firstLetter="onGetAllFirstLetter" />
|
|
|
|
|
|
|
+ <view class="mt-16" style="padding: 0 6rpx">
|
|
|
|
|
+ <u-subsection
|
|
|
|
|
+ :list="list"
|
|
|
|
|
+ mode="subsection"
|
|
|
|
|
+ :current="current"
|
|
|
|
|
+ @change="handleSectionChange"
|
|
|
|
|
+ ></u-subsection>
|
|
|
|
|
+ <BookInfo
|
|
|
|
|
+ v-if="current == 0"
|
|
|
|
|
+ :bookList="orderDetail.detailVoList"
|
|
|
|
|
+ :detail="orderDetail"
|
|
|
|
|
+ @get-all-firstLetter="onGetAllFirstLetter"
|
|
|
|
|
+ />
|
|
|
<LogisticsTimeline v-if="current == 1" :list="orderDetail.trackingVoList" />
|
|
<LogisticsTimeline v-if="current == 1" :list="orderDetail.trackingVoList" />
|
|
|
<FileInfo v-if="current == 2" :orderId="orderDetail.orderId" />
|
|
<FileInfo v-if="current == 2" :orderId="orderDetail.orderId" />
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
|
|
|
|
|
<view class="fixed-left">
|
|
<view class="fixed-left">
|
|
|
- <view class="bind-code common-bg" style="margin-bottom: 30px;padding:20rpx" @click="handleBindCode">绑码
|
|
|
|
|
|
|
+ <view class="bind-code common-bg" style="margin-bottom: 30px; padding: 20rpx" @click="handleBindCode"
|
|
|
|
|
+ >绑码
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="common-bg flex flex-a-c flex-j-c flex-d">
|
|
<view class="common-bg flex flex-a-c flex-j-c flex-d">
|
|
@@ -35,16 +45,20 @@
|
|
|
|
|
|
|
|
<view class="fixed-right">
|
|
<view class="fixed-right">
|
|
|
<view class="letter-bg flex flex-a-c flex-j-c flex-d">
|
|
<view class="letter-bg flex flex-a-c flex-j-c flex-d">
|
|
|
- <view class="letter-item"><u-icon name="arrow-up-fill" size="20" color="#ffffff"
|
|
|
|
|
- @click="scrollToTop"></u-icon></view>
|
|
|
|
|
|
|
+ <view class="letter-item"
|
|
|
|
|
+ ><u-icon name="arrow-up-fill" size="20" color="#ffffff" @click="scrollToTop"></u-icon
|
|
|
|
|
+ ></view>
|
|
|
<view class="letter-item" v-for="item in allLetters" @click="scrollToView(item)">{{ item }}</view>
|
|
<view class="letter-item" v-for="item in allLetters" @click="scrollToView(item)">{{ item }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="common-bg fixed-bottom" v-if="type != 2">
|
|
<view class="common-bg fixed-bottom" v-if="type != 2">
|
|
|
- <u-button type="warning" size="large" v-if="orderDetail.status == 5"
|
|
|
|
|
- @click="handleLogisticsConfirm">物流签收</u-button>
|
|
|
|
|
- <u-button type="primary" size="large" v-if="orderDetail.status == 6" @click="handleConfirm">确认收货</u-button>
|
|
|
|
|
|
|
+ <u-button type="warning" size="large" v-if="orderDetail.status == 5" @click="handleLogisticsConfirm"
|
|
|
|
|
+ >物流签收</u-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <u-button type="primary" size="large" v-if="orderDetail.status == 6" @click="handleConfirm"
|
|
|
|
|
+ >确认收货</u-button
|
|
|
|
|
+ >
|
|
|
|
|
|
|
|
<template v-if="orderDetail.status == 8 || orderDetail.status == 9 || orderDetail.status == 10">
|
|
<template v-if="orderDetail.status == 8 || orderDetail.status == 9 || orderDetail.status == 10">
|
|
|
<u-button type="warning" size="large" @click="handleScanCode">扫码</u-button>
|
|
<u-button type="warning" size="large" @click="handleScanCode">扫码</u-button>
|
|
@@ -52,228 +66,254 @@
|
|
|
</template>
|
|
</template>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <AuditorSelector :show="showAuditorSelector" @update:show="showAuditorSelector = $event"
|
|
|
|
|
- @auditor-selected="handleAuditorSelected" />
|
|
|
|
|
|
|
+ <AuditorSelector
|
|
|
|
|
+ :show="showAuditorSelector"
|
|
|
|
|
+ @update:show="showAuditorSelector = $event"
|
|
|
|
|
+ @auditor-selected="handleAuditorSelected"
|
|
|
|
|
+ />
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref } from 'vue';
|
|
|
|
|
-import { onLoad, onShow } from '@dcloudio/uni-app';
|
|
|
|
|
-import AuditorSelector from './components/AuditorSelector.vue';
|
|
|
|
|
-import OrderInfo from './components/OrderInfo.vue';
|
|
|
|
|
-import UserInfoCard from './components/UserInfoCard.vue';
|
|
|
|
|
-import LogisticsTimeline from '../express/components/LogisticsTimeline.vue';
|
|
|
|
|
-import BookInfo from './components/BookInfo.vue';
|
|
|
|
|
-import FileInfo from './components/FileInfo.vue';
|
|
|
|
|
|
|
+import { ref } from "vue";
|
|
|
|
|
+import { onLoad, onShow } from "@dcloudio/uni-app";
|
|
|
|
|
+import AuditorSelector from "./components/AuditorSelector.vue";
|
|
|
|
|
+import OrderInfo from "./components/OrderInfo.vue";
|
|
|
|
|
+import UserInfoCard from "./components/UserInfoCard.vue";
|
|
|
|
|
+import LogisticsTimeline from "../express/components/LogisticsTimeline.vue";
|
|
|
|
|
+import BookInfo from "./components/BookInfo.vue";
|
|
|
|
|
+import FileInfo from "./components/FileInfo.vue";
|
|
|
|
|
|
|
|
const showAuditorSelector = ref(false);
|
|
const showAuditorSelector = ref(false);
|
|
|
const selectedAuditor = ref({});
|
|
const selectedAuditor = ref({});
|
|
|
const handleAuditorSelected = (auditor) => {
|
|
const handleAuditorSelected = (auditor) => {
|
|
|
selectedAuditor.value = auditor;
|
|
selectedAuditor.value = auditor;
|
|
|
- orderDetail.value.auditUserId = auditor.userId
|
|
|
|
|
- orderDetail.value.auditUserName = auditor.userName
|
|
|
|
|
|
|
+ orderDetail.value.auditUserId = auditor.userId;
|
|
|
|
|
+ orderDetail.value.auditUserName = auditor.userName;
|
|
|
|
|
+
|
|
|
|
|
+ uni.setStorageSync("checkUserInfo", {
|
|
|
|
|
+ userName: auditor.userName,
|
|
|
|
|
+ userId: auditor.userId,
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
//点击滚动的位置
|
|
//点击滚动的位置
|
|
|
-const toView = ref('')
|
|
|
|
|
|
|
+const toView = ref("");
|
|
|
function scrollToView(to) {
|
|
function scrollToView(to) {
|
|
|
- toView.value = to
|
|
|
|
|
|
|
+ toView.value = to;
|
|
|
|
|
|
|
|
uni.pageScrollTo({
|
|
uni.pageScrollTo({
|
|
|
- selector: '#' + to,
|
|
|
|
|
- duration: 200
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ selector: "#" + to,
|
|
|
|
|
+ duration: 200,
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
//回到顶部
|
|
//回到顶部
|
|
|
function scrollToTop() {
|
|
function scrollToTop() {
|
|
|
uni.pageScrollTo({
|
|
uni.pageScrollTo({
|
|
|
top: 0,
|
|
top: 0,
|
|
|
- duration: 200
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ duration: 200,
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//绑码
|
|
//绑码
|
|
|
function handleBindCode() {
|
|
function handleBindCode() {
|
|
|
- uni.$u.toast('暂无开发')
|
|
|
|
|
|
|
+ uni.$u.toast("暂无开发");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-const list = ref(['图书清单', '物流信息', '上传附件']);
|
|
|
|
|
|
|
+const list = ref(["图书清单", "物流信息", "上传附件"]);
|
|
|
const current = ref(0);
|
|
const current = ref(0);
|
|
|
const handleSectionChange = (index) => {
|
|
const handleSectionChange = (index) => {
|
|
|
current.value = index;
|
|
current.value = index;
|
|
|
-}
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
//监听书籍的首字母
|
|
//监听书籍的首字母
|
|
|
-const allLetters = ref([])
|
|
|
|
|
|
|
+const allLetters = ref([]);
|
|
|
function onGetAllFirstLetter(data) {
|
|
function onGetAllFirstLetter(data) {
|
|
|
- allLetters.value = data
|
|
|
|
|
|
|
+ allLetters.value = data;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//物流签收 /app/orderinfo/signLogistics
|
|
//物流签收 /app/orderinfo/signLogistics
|
|
|
function handleLogisticsConfirm() {
|
|
function handleLogisticsConfirm() {
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
- title: '提示',
|
|
|
|
|
- content: '是否确认物流签收?',
|
|
|
|
|
|
|
+ title: "提示",
|
|
|
|
|
+ content: "是否确认物流签收?",
|
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
|
- uni.showLoading({ title: '加载中...', mask: true })
|
|
|
|
|
- uni.$u.http.post('/app/orderinfo/signLogistics', {
|
|
|
|
|
- params: {
|
|
|
|
|
|
|
+ uni.showLoading({ title: "加载中...", mask: true });
|
|
|
|
|
+ uni.$u.http
|
|
|
|
|
+ .post("/app/orderinfo/signLogistics", {
|
|
|
searchType: 1,
|
|
searchType: 1,
|
|
|
- "search": orderId.value
|
|
|
|
|
- }
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- uni.showToast({ title: '签收成功', icon: 'none' })
|
|
|
|
|
- uni.$u.ttsModule.speak('签收成功')
|
|
|
|
|
- uni.navigateBack()
|
|
|
|
|
- }
|
|
|
|
|
- }).finally(() => {
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ search: orderDetail.value.orderId,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ uni.showToast({ title: "签收成功", icon: "none" });
|
|
|
|
|
+ uni.$u.ttsModule.speak("签收成功");
|
|
|
|
|
+ uni.navigateBack();
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//确认收货 /app/orderinfo/confirmOrder
|
|
//确认收货 /app/orderinfo/confirmOrder
|
|
|
function handleConfirm() {
|
|
function handleConfirm() {
|
|
|
- uni.showLoading({ title: '加载中...', mask: true })
|
|
|
|
|
- uni.$u.http.post('/app/orderinfo/confirmOrder', {
|
|
|
|
|
- searchType: 1,
|
|
|
|
|
- "search": orderDetail.value.orderId
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- uni.showToast({ title: '确认收货成功', icon: 'none' })
|
|
|
|
|
- uni.$u.ttsModule.speak('确认收货成功')
|
|
|
|
|
- getOrderDetail()
|
|
|
|
|
- }
|
|
|
|
|
- }).finally(() => {
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ uni.showLoading({ title: "加载中...", mask: true });
|
|
|
|
|
+ uni.$u.http
|
|
|
|
|
+ .post("/app/orderinfo/confirmOrder", {
|
|
|
|
|
+ searchType: 1,
|
|
|
|
|
+ search: orderDetail.value.orderId,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ uni.showToast({ title: "确认收货成功", icon: "none" });
|
|
|
|
|
+ uni.$u.ttsModule.speak("确认收货成功");
|
|
|
|
|
+ getOrderDetail();
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
//完成
|
|
//完成
|
|
|
function handleComplete() {
|
|
function handleComplete() {
|
|
|
- let bookList = orderDetail.value.detailVoList
|
|
|
|
|
- let bool = bookList.some(item => item.auditCommentList?.length < item.num)
|
|
|
|
|
|
|
+ let bookList = orderDetail.value.detailVoList;
|
|
|
|
|
+ let bool = bookList.some((item) => item.auditCommentList?.length < item.num);
|
|
|
if (bool) {
|
|
if (bool) {
|
|
|
- let text = '还有未审核的书'
|
|
|
|
|
- uni.$u.toast(text)
|
|
|
|
|
- uni.$u.ttsModule.speak(text)
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ let text = "还有未审核的书";
|
|
|
|
|
+ uni.$u.toast(text);
|
|
|
|
|
+ uni.$u.ttsModule.speak(text);
|
|
|
|
|
+ return;
|
|
|
} else {
|
|
} else {
|
|
|
- uni.$u.http.post('/app/orderinfo/checkOrderFinish', {
|
|
|
|
|
- checkUserId: orderDetail.value.auditUserId,
|
|
|
|
|
- "orderId": orderDetail.value.orderId
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- uni.showToast({ title: '审核完成', icon: 'none' })
|
|
|
|
|
- uni.$u.ttsModule.speak('审核完成')
|
|
|
|
|
- uni.navigateBack()
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ uni.$u.http
|
|
|
|
|
+ .post("/app/orderinfo/checkOrderFinish", {
|
|
|
|
|
+ checkUserId: orderDetail.value.auditUserId,
|
|
|
|
|
+ orderId: orderDetail.value.orderId,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ uni.showToast({ title: "审核完成", icon: "none" });
|
|
|
|
|
+ uni.$u.ttsModule.speak("审核完成");
|
|
|
|
|
+ uni.navigateBack();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const orderDetail = ref({ status: 0 });
|
|
const orderDetail = ref({ status: 0 });
|
|
|
//获取订单详情
|
|
//获取订单详情
|
|
|
function getOrderDetail() {
|
|
function getOrderDetail() {
|
|
|
- if (!orderId.value) return
|
|
|
|
|
|
|
+ if (!orderId.value) return;
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
- title: '加载中...',
|
|
|
|
|
- mask: true
|
|
|
|
|
- })
|
|
|
|
|
- uni.$u.http.get('/app/orderinfo/getOrderInfoForCheck', {
|
|
|
|
|
- params: {
|
|
|
|
|
- searchType: 1,
|
|
|
|
|
- "search": orderId.value
|
|
|
|
|
- }
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- orderDetail.value = res.data
|
|
|
|
|
- if (isOnLoad.value) {
|
|
|
|
|
- if (res.data.manageRemark.length > 0 && res.data.status < 10) {
|
|
|
|
|
- uni.$u.ttsModule.speak('此订单有备注信息,请注意查看')
|
|
|
|
|
- }
|
|
|
|
|
- if (res.data.warnArea && res.data.warnArea.length > 0) {
|
|
|
|
|
- let text = `此订单来源于${res.data.warnArea}`
|
|
|
|
|
- uni.$u.ttsModule.speak(text)
|
|
|
|
|
- }
|
|
|
|
|
- isOnLoad.value = false
|
|
|
|
|
|
|
+ title: "加载中...",
|
|
|
|
|
+ mask: true,
|
|
|
|
|
+ });
|
|
|
|
|
+ uni.$u.http
|
|
|
|
|
+ .get("/app/orderinfo/getOrderInfoForCheck", {
|
|
|
|
|
+ params: {
|
|
|
|
|
+ searchType: 1,
|
|
|
|
|
+ search: orderId.value,
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ orderDetail.value = res.data;
|
|
|
|
|
+ getCheckUserInfo();
|
|
|
|
|
|
|
|
if (res.data.auditUserId) {
|
|
if (res.data.auditUserId) {
|
|
|
let auditUserInfo = {
|
|
let auditUserInfo = {
|
|
|
userName: res.data.auditUserName,
|
|
userName: res.data.auditUserName,
|
|
|
- userId: res.data.auditUserId
|
|
|
|
|
- }
|
|
|
|
|
- uni.setStorageSync('checkUserInfo', auditUserInfo)
|
|
|
|
|
|
|
+ userId: res.data.auditUserId,
|
|
|
|
|
+ };
|
|
|
|
|
+ uni.setStorageSync("checkUserInfo", auditUserInfo);
|
|
|
} else {
|
|
} else {
|
|
|
- let userInfo = uni.getStorageSync('userInfo')
|
|
|
|
|
- if (userInfo) {
|
|
|
|
|
- orderDetail.value.auditUserName = userInfo.userName
|
|
|
|
|
- orderDetail.value.auditUserId = userInfo.userId
|
|
|
|
|
- uni.setStorageSync('checkUserInfo', {
|
|
|
|
|
- userName: userInfo.userName,
|
|
|
|
|
- userId: userInfo.userId
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ let userInfo = uni.getStorageSync("checkUserInfo");
|
|
|
|
|
+ orderDetail.value.auditUserName = userInfo.userName;
|
|
|
|
|
+ orderDetail.value.auditUserId = userInfo.userId;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isOnLoad.value) {
|
|
|
|
|
+ if (res.data.manageRemark.length > 0 && res.data.status < 10) {
|
|
|
|
|
+ uni.$u.ttsModule.speak("此订单有备注信息,请注意查看");
|
|
|
}
|
|
}
|
|
|
|
|
+ if (res.data.warnArea && res.data.warnArea.length > 0) {
|
|
|
|
|
+ let text = `此订单来源于${res.data.warnArea}`;
|
|
|
|
|
+ uni.$u.ttsModule.speak(text);
|
|
|
|
|
+ }
|
|
|
|
|
+ isOnLoad.value = false;
|
|
|
}
|
|
}
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.$u.toast(res.msg);
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
- uni.$u.toast(res.msg)
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+//获取上一次绑定的审核员信息
|
|
|
|
|
+function getCheckUserInfo() {
|
|
|
|
|
+ uni.$u.http.get("/app/orderinfo/getCheckUser").then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ let userInfo = res.data;
|
|
|
|
|
+ orderDetail.value.auditUserName = userInfo.userName;
|
|
|
|
|
+ orderDetail.value.auditUserId = userInfo.userId;
|
|
|
|
|
+ uni.setStorageSync("checkUserInfo", {
|
|
|
|
|
+ userName: userInfo.userName,
|
|
|
|
|
+ userId: userInfo.userId,
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- }).finally(() => {
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//isbn正则校验是否符合
|
|
//isbn正则校验是否符合
|
|
|
function checkIsbn(isbn) {
|
|
function checkIsbn(isbn) {
|
|
|
const isbn13Regex = /^(?:97[89]-?\d{1,5}-?\d{1,7}-?\d{1,6}-?\d)$/;
|
|
const isbn13Regex = /^(?:97[89]-?\d{1,5}-?\d{1,7}-?\d{1,6}-?\d)$/;
|
|
|
if (isbn13Regex.test(isbn)) {
|
|
if (isbn13Regex.test(isbn)) {
|
|
|
- return true
|
|
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
- return false
|
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//扫码之后的逻辑
|
|
//扫码之后的逻辑
|
|
|
function handleScan(isbn) {
|
|
function handleScan(isbn) {
|
|
|
if (!checkIsbn(isbn)) {
|
|
if (!checkIsbn(isbn)) {
|
|
|
- let text = `不是正确的ISBN码`
|
|
|
|
|
- uni.$u.ttsModule.speak(text)
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ let text = `不是正确的ISBN码`;
|
|
|
|
|
+ uni.$u.ttsModule.speak(text);
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (orderDetail.value.status >= 10) {
|
|
if (orderDetail.value.status >= 10) {
|
|
|
- uni.$u.ttsModule.speak('订单已审核完成')
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ uni.$u.ttsModule.speak("订单已审核完成");
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- let isbns = orderDetail.value.detailVoList.map(item => item.isbn)
|
|
|
|
|
|
|
+ let isbns = orderDetail.value.detailVoList.map((item) => item.isbn);
|
|
|
|
|
|
|
|
if (isbns.includes(isbn)) {
|
|
if (isbns.includes(isbn)) {
|
|
|
- let book = orderDetail.value.detailVoList.find(item => item.isbn == isbn)
|
|
|
|
|
|
|
+ let book = orderDetail.value.detailVoList.find((item) => item.isbn == isbn);
|
|
|
|
|
|
|
|
//扫描到套装书
|
|
//扫描到套装书
|
|
|
if (book.suit == 1) {
|
|
if (book.suit == 1) {
|
|
|
- let text = `${isbn}请注意套装书是否齐全`
|
|
|
|
|
- uni.$u.ttsModule.speak(text)
|
|
|
|
|
|
|
+ let text = `${isbn}请注意套装书是否齐全`;
|
|
|
|
|
+ uni.$u.ttsModule.speak(text);
|
|
|
}
|
|
}
|
|
|
//扫描到需要取出的书
|
|
//扫描到需要取出的书
|
|
|
if (book.bookWarn == 1) {
|
|
if (book.bookWarn == 1) {
|
|
|
- let text = `请注意${isbn}需要取出`
|
|
|
|
|
- uni.$u.ttsModule.speak(text)
|
|
|
|
|
|
|
+ let text = `请注意${isbn}需要取出`;
|
|
|
|
|
+ uni.$u.ttsModule.speak(text);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url: `/pages/index/detail/book-audit?isbn=${isbn}&orderId=${orderDetail.value.orderId}`
|
|
|
|
|
- })
|
|
|
|
|
- uni.setStorageSync('auditBook', book)
|
|
|
|
|
- uni.setStorageSync('orderDetail', orderDetail.value)
|
|
|
|
|
|
|
+ url: `/pages/index/detail/book-audit?isbn=${isbn}&orderId=${orderDetail.value.orderId}`,
|
|
|
|
|
+ });
|
|
|
|
|
+ uni.setStorageSync("auditBook", book);
|
|
|
|
|
+ uni.setStorageSync("orderDetail", orderDetail.value);
|
|
|
} else {
|
|
} else {
|
|
|
- let text = `此订单中不存在${isbn}这本书 `
|
|
|
|
|
- uni.$u.ttsModule.speak(text)
|
|
|
|
|
|
|
+ let text = `此订单中不存在${isbn}这本书 `;
|
|
|
|
|
+ uni.$u.ttsModule.speak(text);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -281,39 +321,37 @@ function handleScan(isbn) {
|
|
|
function handleScanCode() {
|
|
function handleScanCode() {
|
|
|
uni.scanCode({
|
|
uni.scanCode({
|
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
- res.result && handleScan(res.result)
|
|
|
|
|
|
|
+ res.result && handleScan(res.result);
|
|
|
},
|
|
},
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const orderId = ref('')
|
|
|
|
|
-const isOnLoad = ref(false)
|
|
|
|
|
|
|
+const orderId = ref("");
|
|
|
|
|
+const isOnLoad = ref(false);
|
|
|
|
|
|
|
|
// 1 表示到货审核 2 表示查看订单
|
|
// 1 表示到货审核 2 表示查看订单
|
|
|
-const type = ref(1)
|
|
|
|
|
|
|
+const type = ref(1);
|
|
|
onLoad((option) => {
|
|
onLoad((option) => {
|
|
|
- orderId.value = option.id
|
|
|
|
|
- getOrderDetail()
|
|
|
|
|
- isOnLoad.value = true
|
|
|
|
|
- type.value = option.type || 1
|
|
|
|
|
|
|
+ orderId.value = option.id;
|
|
|
|
|
+ getOrderDetail();
|
|
|
|
|
+ isOnLoad.value = true;
|
|
|
|
|
+ type.value = option.type || 1;
|
|
|
|
|
|
|
|
- uni.removeStorageSync('scannedBooks')
|
|
|
|
|
|
|
+ uni.removeStorageSync("scannedBooks");
|
|
|
|
|
|
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
|
uni.$u.useGlobalEvent((e) => {
|
|
uni.$u.useGlobalEvent((e) => {
|
|
|
if (e.barcode) {
|
|
if (e.barcode) {
|
|
|
- handleScan(e.barcode)
|
|
|
|
|
|
|
+ handleScan(e.barcode);
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
// #endif
|
|
// #endif
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
|
- uni.$u.updateActivePageOnShow()
|
|
|
|
|
- getOrderDetail()
|
|
|
|
|
-
|
|
|
|
|
-})
|
|
|
|
|
|
|
+ uni.$u.updateActivePageOnShow();
|
|
|
|
|
+ getOrderDetail();
|
|
|
|
|
+});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
<style>
|
|
@@ -339,7 +377,7 @@ page {
|
|
|
.fixed-left {
|
|
.fixed-left {
|
|
|
position: fixed;
|
|
position: fixed;
|
|
|
left: 0;
|
|
left: 0;
|
|
|
- top: 150px;
|
|
|
|
|
|
|
+ top: 11%;
|
|
|
width: 100rpx;
|
|
width: 100rpx;
|
|
|
|
|
|
|
|
.common-bg {
|
|
.common-bg {
|
|
@@ -359,7 +397,7 @@ page {
|
|
|
.fixed-right {
|
|
.fixed-right {
|
|
|
position: fixed;
|
|
position: fixed;
|
|
|
right: 0;
|
|
right: 0;
|
|
|
- top: 180px;
|
|
|
|
|
|
|
+ top: 12%;
|
|
|
width: 70rpx;
|
|
width: 70rpx;
|
|
|
|
|
|
|
|
.letter-bg {
|
|
.letter-bg {
|
|
@@ -376,4 +414,4 @@ page {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|