调度app新增未开票批次提醒
This commit is contained in:
@@ -68,6 +68,7 @@
|
||||
797484782DA67515003EEB47 /* NewTraningViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 797484772DA67515003EEB47 /* NewTraningViewModel.swift */; };
|
||||
79B966382AB0651C00308A8D /* VehicleLogoutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79B966372AB0651C00308A8D /* VehicleLogoutView.swift */; };
|
||||
79BF24412E9CEFB300FA5F1E /* OnlineVehiclesEntryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79BF24402E9CEFB300FA5F1E /* OnlineVehiclesEntryView.swift */; };
|
||||
79C95CD22F58101E00230593 /* GongdanpiciTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79C95CD12F58101E00230593 /* GongdanpiciTool.swift */; };
|
||||
79CB07CC2AA8465A00154B61 /* UserPermission.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79CB07CB2AA8465A00154B61 /* UserPermission.swift */; };
|
||||
79CE24AA2EF52EAF007FCF90 /* IdentityAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79CE24A92EF52EAF007FCF90 /* IdentityAlertView.swift */; };
|
||||
79CECC122A89BD1A00B95D8B /* MessageCenterController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79CECC112A89BD1A00B95D8B /* MessageCenterController.swift */; };
|
||||
@@ -207,6 +208,7 @@
|
||||
797484772DA67515003EEB47 /* NewTraningViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTraningViewModel.swift; sourceTree = "<group>"; };
|
||||
79B966372AB0651C00308A8D /* VehicleLogoutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VehicleLogoutView.swift; sourceTree = "<group>"; };
|
||||
79BF24402E9CEFB300FA5F1E /* OnlineVehiclesEntryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnlineVehiclesEntryView.swift; sourceTree = "<group>"; };
|
||||
79C95CD12F58101E00230593 /* GongdanpiciTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GongdanpiciTool.swift; sourceTree = "<group>"; };
|
||||
79CB07CB2AA8465A00154B61 /* UserPermission.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserPermission.swift; sourceTree = "<group>"; };
|
||||
79CE24A92EF52EAF007FCF90 /* IdentityAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IdentityAlertView.swift; sourceTree = "<group>"; };
|
||||
79CECC112A89BD1A00B95D8B /* MessageCenterController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageCenterController.swift; sourceTree = "<group>"; };
|
||||
@@ -330,6 +332,7 @@
|
||||
792EE0962AA74E5800A212AB /* PushNotiCommonTool.swift */,
|
||||
79BF24402E9CEFB300FA5F1E /* OnlineVehiclesEntryView.swift */,
|
||||
79CE24A92EF52EAF007FCF90 /* IdentityAlertView.swift */,
|
||||
79C95CD12F58101E00230593 /* GongdanpiciTool.swift */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
@@ -1186,6 +1189,7 @@
|
||||
791887892A7CE79E007EA0C1 /* LoginController.swift in Sources */,
|
||||
791887A42A80CA30007EA0C1 /* ResponseModel.swift in Sources */,
|
||||
7938A8452E40A5F10017508A /* VehicleMonitoringVideoDetailController.swift in Sources */,
|
||||
79C95CD22F58101E00230593 /* GongdanpiciTool.swift in Sources */,
|
||||
794FBB0D2A8F040D00D57BB8 /* HistoryController.swift in Sources */,
|
||||
7918878D2A8081D4007EA0C1 /* ActionStrings.swift in Sources */,
|
||||
791887972A80C6CD007EA0C1 /* LocalizedStrings.swift in Sources */,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
import DDControlsKit_Private
|
||||
import DDLogKit_Private
|
||||
|
||||
open class ZDViewController : DDViewController {
|
||||
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
||||
@@ -24,4 +25,8 @@ open class ZDViewController : DDViewController {
|
||||
|
||||
open func reloadData() {
|
||||
}
|
||||
|
||||
deinit {
|
||||
DDLog(message: "=================\(type(of: self))销毁了=================")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +173,9 @@ open class WebViewTool : NSObject {
|
||||
if let vc {
|
||||
let tabVc = UIApplication.shared.dd_keyWindow.rootViewController as? MainTabBarController
|
||||
let nav = tabVc?.selectedViewController as? UINavigationController
|
||||
if let top = nav?.topViewController, top.isMember(of: type(of: vc)) {
|
||||
return
|
||||
}
|
||||
nav?.pushViewController(vc, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,11 +89,17 @@ open class UserData {
|
||||
|
||||
public var regId : String?
|
||||
|
||||
func showGongdanpiciAlert() {
|
||||
GongdanpiciTool.default.selectCountBySupplierId()
|
||||
}
|
||||
|
||||
func clear() {
|
||||
setToken(token: nil)
|
||||
setRefreshToken(token: nil)
|
||||
setSupplierType(supplierType: nil)
|
||||
setUserId(userId: nil)
|
||||
setSupplierId(supplierId: nil)
|
||||
|
||||
GongdanpiciTool.default.refreshCount()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,4 +91,6 @@ open class ApiList {
|
||||
public let onlineReminder = "/supplierAppV2/dispatchApp/alarm/onlineReminder"
|
||||
|
||||
public let vehicleMonitorInfo = "/supplierAppV2/dispatchApp/order/vehicleMonitorInfo"
|
||||
|
||||
public let selectCountBySupplierId = "/order/taskInvoiceBatch/selectCountBySupplierId"
|
||||
}
|
||||
|
||||
@@ -291,3 +291,7 @@ public struct JudgeIfNeedConfirmParameters : Encodable {
|
||||
public struct GiveUpParameters : Encodable {
|
||||
var supplierId : Int?
|
||||
}
|
||||
|
||||
public struct SelectCountBySupplierIdPrameters : Encodable {
|
||||
var supplierId : Int?
|
||||
}
|
||||
|
||||
@@ -188,4 +188,8 @@ open class RequestList {
|
||||
func vehicleMonitorInfo<P:Encodable>(parameters:P) -> Single<ResponseModel<VehicleMonitorInfoDataModel>?> {
|
||||
return DDAF.post(urlString: HOST+API.vehicleMonitorInfo,parameters: parameters,encoding: JSONParameterEncoder.default,headers: [tokenHeader()],responseType: ResponseModel<VehicleMonitorInfoDataModel>.self)
|
||||
}
|
||||
|
||||
func selectCountBySupplierId<P:Encodable>(parameters:P) -> Single<ResponseModel<Int>?> {
|
||||
return DDAF.get(urlString: HOST+API.selectCountBySupplierId,parameters: parameters,encoding: URLEncodedFormParameterEncoder.default,headers: [tokenHeader()],responseType: ResponseModel<Int>.self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,6 +121,10 @@ class Initial : NSObject {
|
||||
MCOUNT.newestMessage()
|
||||
}
|
||||
|
||||
func initGongdanpici() {
|
||||
UserData.default.showGongdanpiciAlert()
|
||||
}
|
||||
|
||||
// MARK: <RootViewController>
|
||||
func initRootViewController(){
|
||||
if USER.isLogin == true {
|
||||
@@ -145,6 +149,7 @@ class Initial : NSObject {
|
||||
self?.initAppUpdate()
|
||||
self?.initRefreshToken()
|
||||
self?.initNewestMessage()
|
||||
self?.initGongdanpici()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,6 +47,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
NewTraining.default.newTrainingRelay.accept(nil)
|
||||
}
|
||||
|
||||
// 在服务商登录调度app后,弹框提醒服务商(提醒次数为2次)
|
||||
if USER.isLogin == true, appIsAlive == true {
|
||||
UserData.default.showGongdanpiciAlert()
|
||||
}
|
||||
|
||||
// 说明app时活的,用来判断进入后台之后返回前台时的问题
|
||||
appIsAlive = true
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@ extension MineController {
|
||||
return RQ.thisWeekNumber()
|
||||
})
|
||||
.flatMapLatest { numberModel in
|
||||
return Single.zip(RQ.generalInfo(),RQ.getNeedConfirmPersonInfo(prameters: NeedConfirmPersonInfoParameters(supplierId: UserData.default.supplierId)),Single.just(numberModel))
|
||||
return Single.zip(RQ.generalInfo(),RQ.getNeedConfirmPersonInfo(prameters: NeedConfirmPersonInfoParameters(supplierId: UserData.default.supplierId)),RQ.selectCountBySupplierId(parameters: SelectCountBySupplierIdPrameters(supplierId: UserData.default.supplierId)),Single.just(numberModel))
|
||||
}
|
||||
.observe(on: MainScheduler.instance)
|
||||
.subscribe(onNext: {[weak self] response,needConfirmPersonInfoModel,numberModel in
|
||||
.subscribe(onNext: {[weak self] response,needConfirmPersonInfoModel,selectCountModel,numberModel in
|
||||
self?.mineView.scrollView.mj_header?.endRefreshing()
|
||||
if response?.success == true {
|
||||
self?.mineView.carInfoView.descLabel.text = String(response?.data?.vehicleCount ?? 0)+"台"
|
||||
@@ -84,6 +84,17 @@ extension MineController {
|
||||
}else{
|
||||
self?.view.dd_makeToast(numberModel?.msg)
|
||||
}
|
||||
|
||||
if selectCountModel?.success == true {
|
||||
if let count = selectCountModel?.data, count > 0 {
|
||||
self?.mineView.gongdanpici.contentView.isHidden = false
|
||||
self?.mineView.gongdanpici.contentLabel.text = "\(count)"
|
||||
}else{
|
||||
self?.mineView.gongdanpici.contentView.isHidden = true
|
||||
}
|
||||
}else{
|
||||
self?.view.dd_makeToast(selectCountModel?.msg)
|
||||
}
|
||||
})
|
||||
.disposed(by: disposeBag)
|
||||
|
||||
|
||||
80
OrderScheduling/Rescue/View/GongdanpiciTool.swift
Normal file
80
OrderScheduling/Rescue/View/GongdanpiciTool.swift
Normal file
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// GongdanpiciTool.swift
|
||||
// OrderScheduling
|
||||
//
|
||||
// Created by 中道 on 2026/3/4.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import RxSwift
|
||||
import PopupDialog
|
||||
|
||||
class GongdanpiciTool : NSObject {
|
||||
public static let `default` = GongdanpiciTool()
|
||||
private let disposeBag = DisposeBag()
|
||||
|
||||
func selectCountBySupplierId() {
|
||||
guard let supplierId = UserData.default.supplierId else {
|
||||
return
|
||||
}
|
||||
|
||||
var selectCountBySupplierId = (UserDefaults.standard.object(forKey: "selectCountBySupplierId") as? Int) ?? 0
|
||||
|
||||
// 只弹两次
|
||||
guard selectCountBySupplierId < 2 else {
|
||||
return
|
||||
}
|
||||
|
||||
RQ.selectCountBySupplierId(parameters: SelectCountBySupplierIdPrameters(supplierId: supplierId))
|
||||
.observe(on: MainScheduler.instance)
|
||||
.subscribe(onSuccess: { selectCountModel in
|
||||
if selectCountModel?.success == true {
|
||||
if let count = selectCountModel?.data, count > 0 {
|
||||
let popup = PopupDialog(title: nil, message: "工单批次中有\(count)条【未生成财务批次】数据,请及时开票。",buttonAlignment: .horizontal,transitionStyle: .zoomIn,tapGestureDismissal: false,
|
||||
panGestureDismissal: false,
|
||||
hideStatusBar: false){
|
||||
|
||||
}
|
||||
let vc = popup.viewController as! PopupDialogDefaultViewController
|
||||
vc.titleColor = UIColor(red: 0/255.0, green: 0/255.0, blue: 0/255.0, alpha: 1.0)
|
||||
vc.messageColor = UIColor(red: 0.13, green: 0.19, blue: 0.33, alpha: 1)
|
||||
vc.titleFont = UIFont.boldSystemFont(ofSize: 16)
|
||||
vc.messageFont = UIFont.systemFont(ofSize: 16)
|
||||
|
||||
vc.titleText = "提示"
|
||||
vc.titleFont = UIFont.boldSystemFont(ofSize: 18)
|
||||
let buttonOne = CancelButton(title: "稍后处理") {
|
||||
}
|
||||
buttonOne.titleFont = UIFont.boldSystemFont(ofSize: 16)
|
||||
buttonOne.titleColor = UIColor(red: 0/255.0, green: 0/255.0, blue: 0/255.0, alpha: 0.7)
|
||||
|
||||
let buttonTwo = DefaultButton(title: "去处理", dismissOnTap: true) {
|
||||
if let supplierId = UserData.default.supplierId {
|
||||
WEBTOOL.open(name: .invoicingNotify, appending: "&supplierId=\(supplierId)")
|
||||
}
|
||||
}
|
||||
buttonTwo.titleFont = UIFont.boldSystemFont(ofSize: 16)
|
||||
buttonTwo.titleColor = UIColor(red: 29/255.0, green: 100/255.0, blue: 210/255.0, alpha: 0.7)
|
||||
|
||||
popup.addButtons([buttonOne, buttonTwo])
|
||||
let tabBarVc = UIApplication.shared.dd_keyWindow.rootViewController as? UITabBarController
|
||||
let nav = tabBarVc?.selectedViewController as? UINavigationController
|
||||
nav?.topViewController?.present(popup, animated: true)
|
||||
|
||||
// 计数
|
||||
selectCountBySupplierId+=1
|
||||
UserDefaults.standard.set(selectCountBySupplierId, forKey: "selectCountBySupplierId")
|
||||
}
|
||||
}else{
|
||||
let tabBarVc = UIApplication.shared.dd_keyWindow.rootViewController as? UITabBarController
|
||||
let nav = tabBarVc?.selectedViewController as? UINavigationController
|
||||
nav?.topViewController?.view.dd_makeToast(selectCountModel?.msg)
|
||||
}
|
||||
})
|
||||
.disposed(by: disposeBag)
|
||||
}
|
||||
|
||||
func refreshCount() {
|
||||
UserDefaults.standard.set(0, forKey: "selectCountBySupplierId")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user