From 5b37957eec9e5f301f7594b0f0f2d208ddea0cdc Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期一, 19 一月 2026 12:08:09 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
---
pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBillList.vue | 455 +++++++++++++++
utils/common.js | 1
utils/WebSocketServices.js | 412 +++++++-------
pages/index/tab3.vue | 7
pages.json | 13
pages/index/tab2.vue | 5
pages/index/login.vue | 8
pages/guzhangdengji/EqpConkBookBillList.vue | 2
App.vue | 2
pages/ZLGL/lailiaojianyan_fast/Kf_QCStockInCheckBill_Fast.vue | 6
pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill.vue | 816 ++++++++++++++++++++++++++++
pages/index/mine.vue | 2
12 files changed, 1,512 insertions(+), 217 deletions(-)
diff --git a/App.vue b/App.vue
index a26a7c6..16c947d 100644
--- a/App.vue
+++ b/App.vue
@@ -11,7 +11,7 @@
onLaunch: function() {
console.log('App Launch')
// #ifdef H5
- // // 娴嬭瘯鏃讹紝H5椤甸潰鍒锋柊浼氫涪澶盬ebSocket杩炴帴锛岄渶瑙﹀彂閲嶈繛 锛堥渶瑕佹祴璇曠殑鏃跺�欏啀瑙i櫎娉ㄩ噴锛屽惁鍒欎細褰卞搷鐑洿鏂帮級
+ // 娴嬭瘯鏃讹紝H5椤甸潰鍒锋柊浼氫涪澶盬ebSocket杩炴帴锛岄渶瑙﹀彂閲嶈繛 锛堥渶瑕佹祴璇曠殑鏃跺�欏啀瑙i櫎娉ㄩ噴锛屽惁鍒欎細褰卞搷鐑洿鏂帮級
// if (uni.getStorageSync("userinfo")) {
// if (WebSocketServices.wsInstance) { // 鍋囪浣犵殑 WebSocket 瀹炰緥瀛樺湪 wsInstance 涓�
// WebSocketServices.closeConnect(); // 璋冪敤浣犲皝瑁呯殑鈥滃叧闂繛鎺モ�濇柟娉�
diff --git a/pages.json b/pages.json
index bf4b719..0cabc1d 100644
--- a/pages.json
+++ b/pages.json
@@ -1590,6 +1590,19 @@
{
"navigationBarTitleText" : "鍛樺伐绛惧埌璁板綍琛ㄥ垪琛�"
}
+ },
+ {
+ "path" : "pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill",
+ "style" :
+ {
+ "navigationBarTitleText" : "璁惧鏁呴殰鐧昏鍗�"
+ }
+ },{
+ "path" : "pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBillList",
+ "style" :
+ {
+ "navigationBarTitleText" : "璁惧鏁呴殰鐧昏鍗曞垪琛�"
+ }
}
diff --git a/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill.vue b/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill.vue
new file mode 100644
index 0000000..cb66841
--- /dev/null
+++ b/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill.vue
@@ -0,0 +1,816 @@
+<template>
+ <view>
+ <view class="tabs" id="tabs">
+ <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">鍩烘湰淇℃伅</view>
+ <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">鍏朵粬淇℃伅</view>
+ </view>
+ <!-- 鍩烘湰淇℃伅 -->
+ <template v-if="tabs == 0">
+ <view class="form" :style="{
+ height: containerHeight + 'px',
+ overflow: 'auto'
+ }">
+ <view class="form-item">
+ <view class="title">璁惧鏉$爜:</view>
+ <view :class="enableEdit?'right':'righton'">
+ <input v-model="hform.HBarCode" :disabled="!enableEdit"
+ @confirm="GetMessageByBarCode(hform.HBarCode)" placeholder="璇疯緭鍏�(鎴栨壂鎻�)璁惧鏉$爜" />
+ </view>
+ <view class="icon-wrapper">
+ <uni-icons type="scan" size="20" @click="toScanCode"></uni-icons>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">寮�濮嬫椂闂�:</view>
+ <view class="right">
+ <uni-datetime-picker type="datetime" :clear-icon="false" v-model="hform.HRepairPlanBeginDate">
+ <input :value="hform.HConkBeginDate" />
+ </uni-datetime-picker>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title required">鏁呴殰绫诲埆:</view>
+ <zxz-uni-data-select required class="right" :localdata="HConkTypeList" dataKey="鏁呴殰绫诲埆鍚嶇О"
+ dataValue="hitemid" v-model="hform.HConkTypeID">
+
+ </zxz-uni-data-select>
+ <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
+ </view>
+ <view class="form-item">
+ <view class="title required">鏁呴殰鍘熷洜:</view>
+ <zxz-uni-data-select required class="right" :localdata="HConkReasonList" dataKey="HName"
+ dataValue="HItemID" v-model="hform.HConkReasonID">
+ </zxz-uni-data-select>
+ <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
+ </view>
+ <view class="form-item">
+ <view class="title">鏁呴殰鎻忚堪:</view>
+ <view class="right">
+ <textarea v-model="hform.HExplanation" placeholder="璇疯緭鍏ユ晠闅滄弿杩�" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鍗曟嵁鍙�:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HBillNo" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鍗曟嵁鏃ユ湡:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HDate" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title required">閮ㄩ棬:</view>
+ <zxz-uni-data-select required class="right" :localdata="HDeptList" dataKey="閮ㄩ棬鍚嶇О"
+ dataValue="HItemID" v-model="hform.HDeptID">
+
+ </zxz-uni-data-select>
+ <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
+ </view>
+ <view class="form-item">
+ <view class="title required">鍙戠幇浜�:</view>
+ <zxz-uni-data-select required class="right" :localdata="HEmpList" dataKey="HName"
+ dataValue="HItemID" v-model="hform.HEmpID">
+
+ </zxz-uni-data-select>
+ <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
+ </view>
+ <view class="form-item">
+ <view class="title required">璐熻矗浜�:</view>
+ <zxz-uni-data-select required class="right" :localdata="HEmpList" dataKey="HName"
+ dataValue="HItemID" v-model="hform.HManagerID">
+
+ </zxz-uni-data-select>
+ <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
+ </view>
+ <view class="form-item">
+ <view class="title">璁惧鍚嶇О:</view>
+ <view class="righton">
+ <input v-model="hform.HBarName" disabled />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">璁惧瑙勬牸:</view>
+ <view class="righton">
+ <input v-model="hform.HBarSpec" disabled />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">璁惧鍨嬪彿:</view>
+ <view class="righton">
+ <input v-model="hform.HBarModel" disabled />
+ </view>
+ </view>
+ </view>
+ </template>
+
+ <!-- 鍏朵粬淇℃伅 -->
+ <template v-if="tabs == 2">
+ <view class="form" :style="{
+ height: containerHeight + 'px',
+ overflow: 'auto'
+ }">
+ <view class="form-item">
+ <view class="title">鍒涘缓浜�:</view>
+ <view class="righton">
+ <input v-model="hform.HMaker" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鍒涘缓鏃ユ湡:</view>
+ <view class="righton">
+ <input v-model="hform.HMakeDate" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">淇敼浜�:</view>
+ <view class="righton">
+ <input v-model="hform.HUpDater" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">淇敼鏃ユ湡:</view>
+ <view class="righton">
+ <input v-model="hform.HUpDateDate" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">瀹℃牳浜�:</view>
+ <view class="righton">
+ <input v-model="hform.HChecker" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">瀹℃牳鏃堕棿:</view>
+ <view class="righton">
+ <input v-model="hform.HCheckDate" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">浣滃簾浜�:</view>
+ <view class="righton">
+ <input v-model="hform.HDeleteMan" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">浣滃簾鏃ユ湡:</view>
+ <view class="righton">
+ <input v-model="hform.HDeleteDate" />
+ </view>
+ </view>
+ </view>
+
+ </template>
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <view class="buttons" id="buttons">
+ <button class="btn-a" size="mini" @tap="submit">鎻愪氦</button>
+ <view style="flex: 1;"></view>
+ <button class="btn-a" size="mini" @tap="addNew">鏂板</button>
+ <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
+ </view>
+ <!-- <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload> -->
+ </view>
+</template>
+
+<script>
+ import dayjs from "dayjs";
+ import {
+ CommonUtils
+ } from "@/utils/common";
+ import {
+ MpaasScan
+ } from "@/utils/mpaasScan.js"
+ import {
+ getUserInfo
+ } from "../../../utils/auth";
+ export default {
+ // 璁惧鏁呴殰鐧昏鍗�
+ name: 'Sb_EquipConkBookBill',
+ data() {
+ return {
+ tabs: 0,
+ HMainSourceBillType: "",
+ btnTop: 0,
+ tabsBottom: 0,
+ HModName: "Sb_EquipConkBookBill",
+ HBillType: '3907',
+ operationType: 1,
+ uploadOptions: {},
+ enableEdit: true,
+
+ HDeptList: [],
+ HEmpList: [],
+ HConkTypeList: [],
+ HConkReasonList: [],
+
+ hform: {
+ HBarCode: "",
+ HConkBeginDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
+ HConkTypeName: "",
+ HConkTypeID: 0,
+ HConkReasonName: "",
+ HConkReasonID: 0,
+ HExplanation: "",
+ HBillNo: "",
+ HInterID: 0,
+ HDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
+ HDeptName: "",
+ HDeptID: 0,
+ HEmpName: "",
+ HEmpID: 0,
+ HManagerName: "",
+ HManagerID: 0,
+ HBarName: "",
+ HEquipID: 0,
+ HBarSpec: "",
+ HBarModel: "",
+ HMaker: getUserInfo()["Czymc"],
+ HChecker: '',
+ HCloseMan: '',
+ HUpDater: '',
+ HMakeDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
+ HCheckDate: '',
+ HCloseDate: '',
+ HUpDateDate: '',
+ HDeleteMan: '',
+ HDeleteDate: ''
+ },
+ HDetailList: [{ // 鍚庣鎺ュ彛鎻愪氦闇�瑕� 鏄庣粏淇℃伅
+ "HConkReasonID": "",
+ "HConkReasonCode": "",
+ "HConkReasonName": "",
+ "HConkExplanation": "",
+ "HManagerID": "",
+ "HManagerCode": "",
+ "HManagerName": "",
+ "HRemark": " "
+ }]
+ };
+ },
+ computed: {
+ containerHeight: {
+ get() {
+ return this.btnTop - this.tabsBottom - 5
+ }
+ },
+ },
+ methods: {
+ // 鑾峰彇鏁呴殰绫诲埆
+ async getConkType() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: "/Gy_ConkType/List_PDA",
+ data: {
+ sWhere: ``,
+ user: getUserInfo()['Czymc']
+ }
+ })
+
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ this.HConkTypeList = data
+ } else {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: `鑾峰彇鏁呴殰绫诲埆澶辫触: ${Message}`
+ })
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: `鑾峰彇鏁呴殰绫诲埆澶辫触: ${err}`
+ })
+ }
+ },
+ // 鑾峰彇鏁呴殰鍘熷洜
+ async getConkReason() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: "/PublicPageMethod/Gy_ConkReasonList_PDA",
+ data: {
+ sWhere: ``,
+ }
+ })
+
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ this.HConkReasonList = data
+ } else {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: `鑾峰彇鏁呴殰鍘熷洜澶辫触: ${Message}`
+ })
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: `鑾峰彇鏁呴殰鍘熷洜澶辫触: ${err}`
+ })
+ }
+ },
+ // 鍒犻櫎鏄庣粏
+ delDetail(item) {
+
+ },
+ // 鎻愪氦鏁版嵁鏈夋晥鎬ф牎楠�
+ ValidCheck() {
+ if (this.hform.HEquipID == 0) {
+ return {
+ Message: "鏈綍鍏ヨ澶囦俊鎭紝璇峰厛褰曞叆璁惧淇℃伅!",
+ state: false
+ }
+ }
+ if (this.hform.HDeptID == 0) {
+ return {
+ Message: "閮ㄩ棬涓嶅緱涓虹┖!",
+ state: false
+ }
+ }
+ if (this.hform.HEmpID == 0) {
+ return {
+ Message: "鍙戠幇浜轰笉寰椾负绌�!",
+ state: false
+ }
+ }
+ if (this.hform.HManagerID == 0) {
+ return {
+ Message: "璐熻矗浜轰笉寰椾负绌�!",
+ state: false
+ }
+ }
+ if (this.hform.HConkReasonID == 0) {
+ return {
+ Message: "鏁呴殰鍘熷洜涓嶅緱涓虹┖!",
+ state: false
+ }
+ }
+ if (this.hform.HConkTypeID == 0) {
+ return {
+ Message: "鏁呴殰绫诲埆涓嶅緱涓虹┖!",
+ state: false
+ }
+ }
+
+ return {
+ Message: "",
+ state: true
+ }
+ },
+ addNew() {
+ uni.redirectTo({
+ url: './Sb_EquipConkBookBill?operationType=1'
+ })
+ },
+ goBack() {
+ uni.navigateBack()
+ },
+ checkBoxChangeHandler(index, e) {
+ let cr = e.detail.value
+ if (cr.length == 0) {
+ this.HCheckFileList[index]["HDotCheckResult"] = false
+ } else {
+ this.HCheckFileList[index]["HDotCheckResult"] = true
+ }
+ },
+ uploadFile(index) {
+ console.log('filePath: ', this.attachmentInfo[index].filePath);
+ // 閫氳繃涓存椂璺緞璇诲彇鏂囦欢
+ uni.uploadFile({
+ url: CommonUtils.getServerUrl() + "/Sb_EquipDotCheckBill/UploadFile",
+ filePath: this.attachmentInfo[index].filePath,
+ name: 'file',
+ formData: {
+ HBillNo: this.hform.HBillNo,
+ HRemark: "",
+ HUserName: getUserInfo()["Czymc"]
+ },
+ success: (uploadRes) => {
+ CommonUtils.showTips({
+ message: "涓婁紶鎴愬姛"
+ })
+ this.attachmentInfo[index].status = "涓婁紶鎴愬姛"
+ },
+ fail: (err) => {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: `涓婁紶澶辫触: ${err}`
+ })
+ }
+ })
+ },
+ delFile(index) {
+ console.log('attachmentInfo: ', this.attachmentInfo[index]);
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '纭瑕佸垹闄� " ' + this.attachmentInfo[index].fileName + ' " 鍒犻櫎鍚庡皢涓嶅彲鎭㈠锛�',
+ success: (res) => {
+ if (res.confirm) {
+ this.attachmentInfo.splice(index, 1)
+ }
+ },
+ })
+
+ },
+ handleUploadCallback(res) { // 鏂囦欢涓婁紶鍥炶皟
+ console.log('file: ', res);
+ let fileInfo = res.data[0]
+ this.attachmentInfo.push({
+ fileName: fileInfo.name,
+ size: fileInfo.size,
+ status: '绛夊緟涓婁紶',
+ filePath: fileInfo.tempFilePath
+ })
+ },
+ // 涓婁紶鏂囦欢
+ fileUpload() {
+ this.$refs.XeUpload.upload('file', {});
+ },
+ //鑾峰彇鐝鏁版嵁
+ async getShiftList() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Web/GetGy_ShiftsList_Json',
+ data: {
+ Shifts: "",
+ }
+ })
+
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ this.HShiftsList = data
+ } else {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: Message
+ })
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: err
+ })
+ }
+ },
+ //鑾峰彇浣跨敤閮ㄩ棬鏁版嵁
+ async getHDeptList() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Gy_Department/list',
+ data: {
+ sWhere: ` and HUSEORGID = ${uni.getStorageSync('OrganizationID')} `,
+ user: uni.getStorageSync('HUserName'),
+ Organization: uni.getStorageSync('Organization')
+ }
+ })
+
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ this.HDeptList = data
+ } else {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: Message
+ })
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: err
+ })
+ }
+ },
+ // 鑾峰彇鑱屽憳鏁版嵁
+ async getEmpList() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: '/PublicPageMethod/UserList',
+ data: {
+ sWhere: " where 1=1",
+ }
+ })
+
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ this.HEmpList = data
+ } else {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: Message
+ })
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: err
+ })
+ }
+ },
+
+ toScanCode() {
+ MpaasScan.scanCode(cb => {
+ this.hfrom.HBarCode = cb
+ this.GetMessageByBarCode(cb)
+ })
+ },
+ async GetMessageByBarCode(HBarCode) {
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_List",
+ data: {
+ HBarCode: HBarCode,
+ },
+ })
+
+
+ if (!res) {
+ return
+ }
+
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+
+ if (count == 1) {
+ console.log('data: ', data);
+ this.hform.HEquipID = data[0].hmainid
+ this.hform.HBarName = data[0].璁惧鍚嶇О
+ this.hform.HBarSpec = data[0].璁惧瑙勬牸
+ this.hform.HBarModel = data[0].璁惧鍨嬪彿
+ this.hform.HQty = 1
+
+ this.enableEdit = false
+ } else {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: Message
+ })
+ }
+
+ } catch (err) {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: err
+ })
+ }
+ },
+ async GetItemByEquipFile() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: "/Web/GetItemByEquipFile",
+ data: {
+ "EquipProjectID": this.hform.HEquipID,
+ "Type": "DJ",
+ "HDate": this.hform.HBeginDate
+ }
+ })
+
+ let {
+ data,
+ Message,
+ count
+ } = res.data
+ if (count == 1) {
+ this.hform.HEquipDotCheckRuleInterID = data[0].鐐规瑙勭▼ID
+ this.hform.HEquipDotCheckRuleInterNo = data[0].鐐规瑙勭▼鍗曞彿
+ this.hform.HPlanNo = data[0].鐐规璁″垝鍗�
+ this.hform.HPlanInterID = (data[0].鐐规璁″垝ID == null ? 0 : data[0].鐐规璁″垝ID) == "" ? 0 : data[0]
+ .鐐规璁″垝ID
+ this.hform.HPlanEntryID = (data[0].鐐规璁″垝瀛怚D == null ? 0 : data[0].鐐规璁″垝瀛怚D) == "" ? 0 : data[
+ 0].鐐规璁″垝瀛怚D
+
+ this.HCheckFileList = Array.from(data).map(item => {
+ return {
+ "HDotCheckItemID": item.HDotCheckItemID,
+ "HDotCheckCode": item.鐐规椤圭洰浠g爜,
+ "HDotCheckItem": item.鐐规椤圭洰,
+ "HDotCheckPart": item.鐐规閮ㄤ綅,
+ "HClaim": item.鍏蜂綋瑕佹眰,
+ "HManagerID": item.璐熻矗浜篒D,
+ "HManagerCode": item.璐熻矗浜轰唬鐮�,
+ "HManagerName": item.璐熻矗浜哄悕绉�,
+ "HSourceInterID": item.鐐规璁″垝ID == null ? 0 : item.鐐规璁″垝ID,
+ "HSourceEntryID": item.鐐规璁″垝瀛怚D == null ? 0 : item.鐐规璁″垝瀛怚D,
+ "HSourceBillNo": item.鐐规璁″垝鍗�,
+ "HDotCheckItemClassID": 0,
+ "HDotCheckItemClassName": "",
+ "HDotCheckItemMethodID": 0,
+ "HDotCheckItemMethodName": "",
+ "HDotCheckResult": item.榛樿缁撹 == 1 ? true : false
+ }
+ })
+
+ } else {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: `鑾峰彇鐐规瑙勭▼閿欒锛� ${Message}`
+ })
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: `鑾峰彇鐐规瑙勭▼閿欒锛� ${err}`
+ })
+ }
+ },
+ radioChange({
+ detail: {
+ value
+ }
+ }) {
+ this.hform.HCheckResult = value
+ },
+ async getMaxNum() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: "/Web/GetMAXNum",
+ data: {
+ "HBillType": this.HBillType
+ }
+ })
+
+ let {
+ count,
+ data,
+ Message
+ } = res.data
+ console.log('data: ', data);
+ // this.hform.HInterID = data[0]["HInterID"]
+ this.hform.HInterID = 0
+ this.hform.HBillNo = data[0]["HBillNo"]
+ } catch (err) {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: "鑾峰彇鍗曟嵁淇℃伅寮傚父: " + err
+ })
+ }
+ },
+ async submit() {
+ let valid = this.ValidCheck()
+ if (!valid.state) {
+ CommonUtils.showTips({
+ message: valid.Message
+ })
+ return
+ }
+
+ try {
+ let oMain = JSON.stringify(this.hform);
+ this.HDetailList[0].HConkReasonID = this.hform.HConkReasonID
+ this.HDetailList[0].HConkExplanation = this.hform.HExplanation
+ this.HDetailList[0].HManagerID = this.hform.HManagerID
+ let sSubStr = JSON.stringify(this.HDetailList);
+ let sMainSub = oMain + ';' + sSubStr + `;` + getUserInfo()[
+ 'Czymc'] + ";1";
+ let res = await CommonUtils.doRequest2Sync({
+ url: "/Sb_EqpRepairWorkBill/SaveGetEqpConkBookBillList",
+ data: {
+ "msg": sMainSub
+ },
+ method: "POST"
+ })
+
+ if (!res) {
+ return
+ }
+
+ let {
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: './Sb_EquipConkBookBill?operationType=1'
+ })
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 50)
+ }
+ }
+ });
+ } else {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: "鎻愪氦鍗曟嵁澶辫触: " + Message
+ })
+ }
+
+
+ } catch (err) {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: "鎻愪氦鍗曟嵁澶辫触: " + err
+ })
+ }
+ },
+ async getEditData(hmainid) {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Sb_EqpRepairWorkBill/Sb_EqpConkBookBillListCheckDetai',
+ data: {
+ HID: hmainid
+ },
+ })
+
+ let {
+ data,
+ count,
+ msg,
+ code
+ } = res.data
+
+ if (code == 1) {
+ data = data.h_v_Sb_EquipConkBookBillList_Edit[0]
+
+ this.enableEdit = false
+ } else {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: `鑾峰彇鏁呴殰鐧昏鍗曞け璐�: ${msg}`
+ })
+ }
+
+ } catch (err) {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: `鑾峰彇鏁呴殰鐧昏鍗曞け璐�: ${err}`
+ })
+ }
+ }
+ },
+ onLoad(e) {
+ console.log('e: ', e);
+ if (!e.operationType) {
+ this.operationType = 1
+ } else {
+ this.operationType = e.operationType
+ }
+
+ if (this.operationType == 1) {
+ // 鏂板
+ this.getMaxNum()
+ } else if (this.operationType == 2) {
+ // 澶嶅埗
+ } else if (this.operationType == 3) {
+ // 缂栬緫 锛圥DA涓病鏈夌紪杈戝姛鑳斤紝鏁呮澶勭紪杈戝姛鑳藉厛涓嶄娇鐢級
+ let hmainid = e.hmainid
+ this.getEditData(hmainid)
+
+ } else if (this.operationType == 4) {
+ // 娴忚
+
+ }
+
+ this.getHDeptList()
+ this.getEmpList()
+ this.getConkReason()
+ this.getConkType()
+ },
+ onReady() {
+ const query = uni.createSelectorQuery().in(this)
+ query.select("#buttons")
+ .boundingClientRect()
+ .select("#tabs")
+ .boundingClientRect()
+ .exec(res => {
+ this.btnTop = Math.floor(res[0].top)
+ this.tabsBottom = Math.ceil(res[1].bottom)
+ })
+ }
+ }
+</script>
+
+<style lang="scss" scoped>
+ @import "@/pages/MJGL/style/MJBillStyle.scss"
+</style>
\ No newline at end of file
diff --git a/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBillList.vue b/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBillList.vue
new file mode 100644
index 0000000..17d7fe4
--- /dev/null
+++ b/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBillList.vue
@@ -0,0 +1,455 @@
+<template>
+ <view class="content">
+ <view class="form">
+ <view class="form-item">
+ <view class="title">寮�濮嬫椂闂�:</view>
+ <view class="right">
+ <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HBeginDate">
+ <input :value="hform.HBeginDate" />
+ </uni-datetime-picker>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">缁撴潫鏃堕棿:</view>
+ <view class="right">
+ <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HEndDate">
+ <input :value="hform.HEndDate" />
+ </uni-datetime-picker>
+ </view>
+ </view>
+ <view v-if="showmore">
+ <view class="form-item">
+ <view class="title">鍗曟嵁鍙�:</view>
+ <view class="right">
+ <input v-model="hform.HBillNo" placeholder="璇疯緭鍏ュ崟鎹彿" />
+ </view>
+ </view>
+
+ </view>
+ <view class="other">
+ <view v-if="!showmore" @tap="changeShowMore">
+ 灞曞紑鍏朵粬鏉′欢<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="bottom"></uni-icons>
+ </view>
+ <view v-if="showmore" @tap="changeShowMore">
+ 鎶樺彔鍏朵粬鏉′欢<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="top"></uni-icons>
+ </view>
+ </view>
+
+ <view class="buttons">
+ <button class="btn-a" size="mini" type="default" @tap="clear">閲嶇疆</button>
+ <button class="btn-b" size="mini" type="default" @tap="add">鏂板</button>
+ <button class="btn-c" size="mini" type="default" @tap="search">鏌ヨ</button>
+ </view>
+ </view>
+
+ <view id="divide" style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
+ <view :style="{
+ height: calcContentHeight + 'px',
+ overflowY: 'auto'
+ }">
+ <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0">
+ <uni-card :title="item.鍒跺崟鏃ユ湡.substr(0,10)" :extra="item.鍗曟嵁鍙�" style="margin: 10px;"
+ @tap="showDetail = showDetail==index?-1:index">
+ <view class="card-detail"
+ v-for="(HBillField, index) in CommonUtils.emptyValueFilter(item,HFieldList).slice(0,10)" :key="index">
+ <template
+ v-if="HBillField.ColmType == 'DateTime'"><text>{{ HBillField.ColmCols }}锛�</text>{{ item[HBillField.ColmCols] ? dayjs(item[HBillField.ColmCols]).format("YYYY-MM-DD HH:mm:ss") : "" }}
+ </template>
+ <template
+ v-else><text>{{ HBillField.ColmCols }}锛�</text>{{ item[HBillField.ColmCols] }}</template>
+ </view>
+ <view class="card-detail" v-if="showDetail == index">
+ <view class="card-detail"
+ v-for="(HBillField, index) in CommonUtils.emptyValueFilter(item,HFieldList).slice(10,-1)"
+ :key="index">
+ <template
+ v-if="HBillField.ColmType == 'DateTime'"><text>{{ HBillField.ColmCols }}锛�</text>{{ item[HBillField.ColmCols] ? dayjs(item[HBillField.ColmCols]).format("YYYY-MM-DD HH:mm:ss") : "" }}
+ </template>
+ <template
+ v-else><text>{{ HBillField.ColmCols }}锛�</text>{{ item[HBillField.ColmCols] }}</template>
+ </view>
+ </view>
+
+ <view class="more" v-if="showDetail == index && operations != index">
+ <view class="part" style="border-right: 1px solid #eee;">
+ <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>鏀惰捣
+ </view>
+ <view class="part" @tap.stop="operations = operations==index?-1:index">
+ <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;"
+ size="14"></uni-icons>鎿嶄綔
+ </view>
+ </view>
+ <view class="more" v-if="showDetail != index && operations != index">
+ <view class="part" style="border-right: 1px solid #eee;">
+ <uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>鏇村淇℃伅
+ </view>
+ <view class="part" @tap.stop="operations = operations==index?-1:index">
+ <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;"
+ size="14"></uni-icons>鎿嶄綔
+ </view>
+ </view>
+ <view class="op" v-if="operations == index">
+ <!-- <button class="op3" size="mini" plain @tap.stop="edit(item)">缂栬緫</button> -->
+ <button class="op4" size="mini" plain @tap.stop="del(item)">鍒犻櫎</button>
+ <button class="op5" size="mini" plain @tap.stop="operations = -1">鍙栨秷鎿嶄綔</button>
+ </view>
+ </uni-card>
+ </view>
+ </view>
+ <view class="pagination-zone" id="pagination-zone">
+ <uni-pagination show-icon :page-size="size" :total="dataLength" :current="page"
+ @change="onPaginationChangeHandler"></uni-pagination>
+ </view>
+ <BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
+ </view>
+</template>
+
+<script>
+ import {
+ getUserInfo
+ } from "@/utils/auth.js";
+ import BarCodePopupVue from "@/components/BarCodePopup/BarCodePopup.vue";
+ import {
+ CommonUtils
+ } from "@/utils/common";
+ import dayjs from "dayjs";
+ export default {
+ data() {
+ return {
+ dayjs,
+ CommonUtils,
+ userInfo: getUserInfo(),
+ serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
+ tabs: 0,
+ urls: '/Web/GetEquipmentBillsList',
+ MvarReportTitle: '璁惧鏁呴殰鐧昏鍗曠紦瀛�',
+ hform: {
+ HBillNo: '',
+ HSourceBillNo: '',
+ HBillType: '',
+ user: uni.getStorageSync('HUserName'),
+ HStockOrgID: uni.getStorageSync('OrganizationID'),
+ Type: "GZ",
+ sWhere: "",
+ HBeginDate: dayjs(new Date()).subtract(30, 'day').format("YYYY-MM-DD"),
+ HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
+ },
+ sWhere: '',
+ listData: [],
+ showList: [],
+ HFieldList: [],
+ showDetail: -1,
+ operations: -1,
+
+ page: 1,
+ size: 20,
+ dataLength: 0,
+ divideBottom: 0,
+ paginationTop: 0,
+ showmore: false,
+ }
+ },
+ computed: {
+ calcContentHeight: {
+ get() {
+ return this.paginationTop - this.divideBottom
+ }
+ }
+ },
+ onShow() {
+ //鐢ㄦ埛妯″潡鏉冮檺鍒ゆ柇
+ // this.CheckModRight()
+ this.changeTab(0)
+ console.log(this.userInfo, uni.getStorageSync('HUserName'))
+ },
+ components: {
+ BarCodePopupVue
+ },
+ onPullDownRefresh: function() {
+ this.clear()
+ setTimeout(() => {
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
+ onReady() {
+ this.getCalcHeight()
+ },
+ methods: {
+ changeShowMore() {
+ this.showmore = !this.showmore
+ this.$nextTick(() => {
+ // 閲嶆柊璁$畻鍐呭瑙嗗彛楂樺害
+ this.getCalcHeight()
+ })
+ },
+ getCalcHeight() {
+ let query = uni.createSelectorQuery().in(this)
+ query
+ .select("#divide")
+ .boundingClientRect()
+ .select("#pagination-zone")
+ .boundingClientRect()
+ .exec(res => {
+ this.divideBottom = Math.ceil(res[0].bottom)
+ this.paginationTop = Math.floor(res[1].top)
+ })
+ },
+ async qrCodeDisplay(item) {
+ this.$refs.barcodePopup.setCodeInfo(item.HBillNo)
+ await this.$nextTick()
+ this.$refs.barcodePopup.open()
+ },
+ CheckModRight() {
+ uni.request({
+ url: this.serverUrl + '/WEBSController/CheckModRight_Json',
+ data: {
+ ModRightName: 'CE_OtherOut',
+ HUserName: uni.getStorageSync('HUserName')
+ },
+ success: (res) => {
+ if (res.data.count == 1) {} else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
+ },
+ onPaginationChangeHandler({
+ current
+ }) {
+ this.page = current
+ this.showList = this.getPage(current, this.size, this.listData)
+ },
+ getPage(page, size, list) {
+ let sindex = (parseInt(page) - 1) * size
+ let eindex = parseInt(page) * size
+ let newList = list.slice(sindex, eindex)
+ return newList
+ },
+ changeTab(e) {
+ this.tabs = e
+ this.page = 1
+ this.showList = []
+
+ if (this.tabs == 0) {
+ this.urls = '/Web/GetEquipmentBillsList'
+ }
+ // if (this.tabs == 1) {
+ // this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_Json'
+ // }
+ this.search()
+ },
+ async getList() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: this.urls,
+ data: this.hform
+ })
+
+ let {
+ count,
+ data,
+ Message,
+ list
+ } = res.data
+
+ if (count == 1) {
+ if (data == null) {
+ data = []
+ }
+ this.listData = data
+ this.showList = this.getPage(this.page, this.size, data)
+ this.dataLength = data.length
+ this.HFieldList = CommonUtils.fieldListFilterRole({
+ ExcludeKeys: ["鍒跺崟鏃ユ湡", "鍗曟嵁鍙�"],
+ FieldList: Array.from(list)
+ }).data
+ } else {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: `鑾峰彇璁惧鏁呴殰鐧昏鍗曞け璐�: ${Message}`
+ })
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: `鑾峰彇璁惧鏁呴殰鐧昏鍗曞け璐�: ${err}`
+ })
+ }
+
+ },
+ search() {
+ this.hform.sWhere = ''
+ this.listData = []
+ this.page = 1
+ this.showList = []
+
+ if (this.hform.HBillNo) {
+ this.hform.sWhere += " and 鍗曟嵁鍙� like '%" + this.hform.HBillNo + "%'";
+ }
+ if (this.hform.HBeginDate && this.hform.HEndDate) {
+ this.hform.sWhere +=
+ ` and convert(date,鏃ユ湡) between convert(date, '${this.hform.HBeginDate}') and convert(date, '${this.hform.HEndDate}')`;
+ }
+ this.getList()
+ },
+ clear() {
+ this.listData = []
+ this.page = 1
+ this.showList = []
+
+ this.sWhere = ''
+ this.hform = {
+ HBillNo: '',
+ HSourceBillNo: '',
+ HBillType: '',
+ user: uni.getStorageSync('HUserName'),
+ HStockOrgID: uni.getStorageSync('OrganizationID'),
+ Type: "GZ",
+ sWhere: "",
+ HBeginDate: dayjs(new Date()).subtract(30, 'day').format("YYYY-MM-DD"),
+ HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
+ }
+ this.search()
+ },
+ add() {
+ uni.navigateTo({
+ url: '/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill?operationType=1'
+ })
+ },
+ //缂栬緫
+ edit(item) {
+ return
+ console.log(item)
+ uni.request({
+ url: this.serverUrl + '/WEBSController/TempList_Modify_Json',
+ data: {
+ "HInterID": item.HInterID,
+ "HBillNo": item.鍗曟嵁鍙�,
+ "HBillType": this.hform.HBillType
+ },
+ success: (res) => {
+ console.log(1, res);
+ if (res.data.count == 1) {
+ uni.navigateTo({
+ url: './OtherOutBill?OperationType=2&HInterID=' + item.HInterID
+ })
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.hideLoading()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ })
+ },
+ //鍒犻櫎
+ del(item) {
+ // console.log(item.hmainid,uni.getStorageSync('HUserName'))
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '纭瑕佸垹闄よ褰曪紵鍒犻櫎鍚庝笉鑳芥仮澶�',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.request({
+ url: this.serverUrl +
+ '/Sb_EqpRepairWorkBill/DeltetEqpConkBookBill',
+ data: {
+ HInterID: item.hmainid,
+ user: uni.getStorageSync('HUserName'),
+ },
+ success: (res) => {
+ console.log(1, res);
+ if (res.data.count == 1) {
+ this.clear()
+ }
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.hideLoading()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ }
+ }
+ });
+ },
+ //鎾ら攢
+ revoke(item) {
+ // console.log(item.hmainid,uni.getStorageSync('HUserName'))
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '鏄惁纭鎾ら攢',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.request({
+ url: this.serverUrl +
+ '/WEBSController/set_DeleteICStockBillAndWMS_Json',
+ data: {
+ HInterID: item.HInterID,
+ HBillNo: item.鍗曟嵁鍙�,
+ HBillType: this.hform.HBillType,
+ HMaker: uni.getStorageSync('HUserName'),
+ MvarReportTitle: this.MvarReportTitle,
+ },
+ success: (res) => {
+ console.log(1, res);
+ if (res.data.count == 1) {
+ this.clear()
+ }
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.hideLoading()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ }
+ }
+ });
+ },
+ }
+ }
+</script>
+
+<style lang="scss" scoped>
+ @import "@/pages/MJGL/style/MJListStyle.scss"
+</style>
\ No newline at end of file
diff --git a/pages/ZLGL/lailiaojianyan_fast/Kf_QCStockInCheckBill_Fast.vue b/pages/ZLGL/lailiaojianyan_fast/Kf_QCStockInCheckBill_Fast.vue
index 2710c7b..e7daec9 100644
--- a/pages/ZLGL/lailiaojianyan_fast/Kf_QCStockInCheckBill_Fast.vue
+++ b/pages/ZLGL/lailiaojianyan_fast/Kf_QCStockInCheckBill_Fast.vue
@@ -475,10 +475,16 @@
this.HCheckResultList.find(elem => elem.text == e)?.value
if (e == '鍚堟牸') {
this.HUseResultValueList = ["鎺ユ敹", "璁╂鎺ユ敹"]
+ this.detailManifestItem.HUseResultName = "鎺ユ敹"
+ this.detailManifestItem.HUseResult = "A"
} else if (e == '涓嶅悎鏍�') {
this.HUseResultValueList = ["鎸戦��(鍏ㄦ)", "鍒ら��"]
+ this.detailManifestItem.HUseResultName = "鎸戦��(鍏ㄦ)"
+ this.detailManifestItem.HUseResult = "E"
} else if (e == '淇濈暀') {
this.HUseResultValueList = ["鎺ユ敹", "璁╂鎺ユ敹", "鎸戦��(鍏ㄦ)", "鍒ら��"]
+ this.detailManifestItem.HUseResultName = "鎺ユ敹"
+ this.detailManifestItem.HUseResult = "A"
}
this.HUseResultChangeHandle(this.HUseResultValueList[0])
diff --git a/pages/guzhangdengji/EqpConkBookBillList.vue b/pages/guzhangdengji/EqpConkBookBillList.vue
index 8fa436f..e27dad9 100644
--- a/pages/guzhangdengji/EqpConkBookBillList.vue
+++ b/pages/guzhangdengji/EqpConkBookBillList.vue
@@ -371,7 +371,7 @@
edit(item){
console.log(item)
uni.navigateTo({
- url:'/pages/guzhangdengji/EqpConkBookBill?hmainid=' + item.hmainid
+ url:'/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill?operationType=3&hmainid=' + item.hmainid
})
},
//鍒犻櫎
diff --git a/pages/index/login.vue b/pages/index/login.vue
index 98a674d..e5484ab 100644
--- a/pages/index/login.vue
+++ b/pages/index/login.vue
@@ -335,14 +335,8 @@
uni.setStorageSync('HWorkCenterName', res.data.data[0].HWorkCenterName);
uni.setStorageSync('HSecManagerID', res.data.data[0].HSecManagerID); //瀵瑰簲楠屾敹
uni.setStorageSync('HSecManagerName', res.data.data[0].HSecManagerName);
- uni.setStorageSync('HProcID', res.data.data[0].HProcID);
- uni.setStorageSync('HProcName', res.data.data[0].HProcName);
- uni.setStorageSync('HSourceID', res.data.data[0].HSourceID);
- uni.setStorageSync('HSourceName', res.data.data[0].HSourceName);
- uni.setStorageSync('HGroupID', res.data.data[0].HGroupID);
- uni.setStorageSync('HGroupName', res.data.data[0].HGroupName);
this.CommonUtils.setServerUrl(this.serverUrl)
- this.WebSocketServices.createConnect(res.data.data[0].Czybm,res.data.data[0].Czymc);
+ // this.WebSocketServices.createConnect(res.data.data[0].Czybm,res.data.data[0].Czymc);
uni.reLaunch({
url: '/pages/index/index'
})
diff --git a/pages/index/mine.vue b/pages/index/mine.vue
index 1a0b49e..3c3242c 100644
--- a/pages/index/mine.vue
+++ b/pages/index/mine.vue
@@ -101,7 +101,7 @@
if (res.confirm) {
console.log('鐢ㄦ埛鐐瑰嚮纭畾');
// 鏂紑Socket杩炴帴
- WebSocketServices.closeSocket();
+ // WebSocketServices.closeSocket();
// 閿�姣� userInfo 缂撳瓨
uni.removeStorageSync("userinfo")
uni.reLaunch({
diff --git a/pages/index/tab2.vue b/pages/index/tab2.vue
index ea980c2..20304c5 100644
--- a/pages/index/tab2.vue
+++ b/pages/index/tab2.vue
@@ -407,11 +407,12 @@
},
{
"img": "../../static/icon/icon6.png",
- "text": "璁惧鏁呴殰鐧昏琛ㄥ垪琛�",
- "url": "/pages/guzhangdengji/EqpConkBookBillList",
+ "text": "璁惧鏁呴殰鐧昏鍗曞垪琛�",
+ "url": "/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBillList",
"id": 50,
"hidden": false
},
+
{
"img": "../../static/icon/icon8.png",
"text": "璁惧缁翠慨娲惧伐鍗曞垪琛�",
diff --git a/pages/index/tab3.vue b/pages/index/tab3.vue
index ed9c2dc..d2b409e 100644
--- a/pages/index/tab3.vue
+++ b/pages/index/tab3.vue
@@ -74,6 +74,13 @@
"hidden": false
},
{
+ "img": "../../static/icon/icon6.png",
+ "text": "璁惧鏁呴殰鐧昏鍗�",
+ "url": "/pages/MJGL/Sb_EquipConkBook/Sb_EquipConkBookBill?operationType=1",
+ "id": 20,
+ "hidden": false
+ },
+ {
"img": "../../static/icon/icon8.png",
"text": "妯″叿缁翠慨娲惧伐鍗�",
"url": "/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill",
diff --git a/utils/WebSocketServices.js b/utils/WebSocketServices.js
index b7838a9..7115a50 100644
--- a/utils/WebSocketServices.js
+++ b/utils/WebSocketServices.js
@@ -3,210 +3,214 @@
} from "@/utils/common.js";
class WebSocketServices {
- constructor() {
- this.wsInstance = null; // WebSocket 瀹炰緥
- this.isConnecting = false; // 杩炴帴涓姸鎬侊紙閬垮厤骞跺彂閲嶈繛锛�
- this.isConnected = false; // 宸茶繛鎺ョ姸鎬�
- this.isReconnectStopped = false; // 鍋滄閲嶈繛鏍囪
- this.wsUrl = CommonUtils.httpFormatWs(); // WebSocket 鍩虹鍦板潃
-
- // 瓒呮椂鏍¢獙閰嶇疆
- this.noMessageTimeout = 45000; // 45绉掑唴娌℃敹鍒颁换浣曚笟鍔℃秷鎭� 鈫� 鍒ゅ畾杩炴帴澶辨晥锛堟湇鍔$30绉掑彂涓�娆ing锛岀暀15绉掑閿欙級
- this.noMessageTimer = null; // 鏃犳秷鎭秴鏃跺畾鏃跺櫒
-
- // 鐩戝惉鍑芥暟寮曠敤
- this.openListener = null;
- this.messageListener = null;
- this.closeListener = null;
- this.errorListener = null;
-
- // 缂撳瓨鐢ㄦ埛淇℃伅
- this.currentUserId = "";
- this.currentUserName = "";
- }
-
- /**
- * 寤虹珛 WebSocket 杩炴帴
- * @param {string/number} userId - 鐢ㄦ埛ID锛堝繀濉級
- * @param {string} userName - 鐢ㄦ埛鍚嶏紙蹇呭~锛�
- * @param {number} count - 褰撳墠閲嶈繛娆℃暟
- * @param {number} limit - 鏈�澶ч噸杩炴鏁帮紙榛樿3娆★級
- */
- createConnect(userId, userName, count = 0, limit = 3) {
- // 缂撳瓨鐢ㄦ埛淇℃伅锛堢敤浜庨噸杩烇級
- this.currentUserId = userId;
- this.currentUserName = userName;
-
- // 鍓嶇疆鏍¢獙锛氶伩鍏嶆棤鏁堣繛鎺ュ拰骞跺彂閲嶈繛
- if (this.isConnecting || this.isConnected) return;
- if (!userId && userId !== 0) { // 鍏煎 userId 涓� 0 鐨勫悎娉曞満鏅�
- CommonUtils.showTips({ message: "鐢ㄦ埛鏍囪瘑涓嶈兘涓虹┖锛屾棤娉曞缓绔媁ebSocket杩炴帴" });
- return;
- }
- if (count > limit) {
- CommonUtils.showTips({
- message: `WebSocket 閲嶈繛娆℃暟瓒呭嚭鏈�澶ч檺鍒讹紙${limit}娆★級锛屽凡鍋滄閲嶈繛`,
- });
- this.isReconnectStopped = true;
- return;
- }
-
- console.log(`[WebSocket] 寮�濮嬪缓绔嬭繛鎺ワ紙绗� ${count || 0} 娆★級`, {
- wsUrl: this.wsUrl,
- userId,
- userName,
- });
-
- // 娓呴櫎鍘嗗彶娈嬬暀锛氱洃鍚�+瀹氭椂鍣�
- this.clearAllListeners();
- this.clearNoMessageTimer();
-
- // 鍙戣捣杩炴帴
- this.isConnecting = true;
- this.wsInstance = uni.connectSocket({
- url: `${this.wsUrl}?userId=${encodeURIComponent(userId)}&userName=${encodeURIComponent(userName)}`,
- fail: (error) => {
- console.error("[WebSocket] 杩炴帴鍙戣捣澶辫触", error);
- this.isConnecting = false;
- this.triggerReconnect(count);
- },
- });
-
- // 鐩戝惉杩炴帴鎴愬姛锛氬惎鍔ㄦ棤娑堟伅瓒呮椂鏍¢獙
- this.openListener = uni.onSocketOpen((res) => {
- console.log("[WebSocket] 杩炴帴寤虹珛鎴愬姛", res);
- this.isConnecting = false;
- this.isConnected = true;
- this.isReconnectStopped = false;
- this.startNoMessageCheck();
- count = 0;
- });
-
- this.messageListener = uni.onSocketMessage((res) => {
- try {
- const message = JSON.parse(res.data);
- console.log("[WebSocket] 鏀跺埌涓氬姟娑堟伅", message);
-
- // 閲嶇疆鏃犳秷鎭畾鏃跺櫒锛堟湁涓氬姟娑堟伅=杩炴帴姝e父锛�
- this.resetNoMessageTimer();
-
- // 澶勭悊涓氬姟娑堟伅
- if (message.Type === "Message") {
- const content = JSON.parse(message.Content);
- this.showTaskTip(`鎮ㄦ湁${content.length}鏉℃秷鎭渶瑕佸鐞�!`);
- // this.emit("message", content); // 鏀寔澶栭儴鐩戝惉
- }
- } catch (error) {
- console.error("[WebSocket] 娑堟伅瑙f瀽澶辫触", error, res.data);
- }
- });
-
- // 鐩戝惉杩炴帴鍏抽棴锛氫粎寮傚父鍏抽棴瑙﹀彂閲嶈繛
- this.closeListener = uni.onSocketClose((res) => {
- console.log("[WebSocket] 杩炴帴鍏抽棴", res);
- this.isConnecting = false;
- this.isConnected = false;
- this.clearNoMessageTimer();
-
- // 姝e父鍏抽棴锛坈ode=1000锛夋垨涓诲姩鍋滄閲嶈繛鏃讹紝涓嶉噸杩�
- if (!this.isReconnectStopped && res.code !== 1000) {
- this.triggerReconnect(count);
- }
- });
-
- // 鐩戝惉杩炴帴閿欒锛氳Е鍙戦噸杩�
- this.errorListener = uni.onSocketError((error) => {
- console.error("[WebSocket] 杩炴帴閿欒", error);
- this.isConnecting = false;
- this.clearNoMessageTimer();
- if (!this.isReconnectStopped) {
- this.triggerReconnect(count);
- }
- });
- }
-
- /**
- * 缁熶竴瑙﹀彂閲嶈繛锛堝欢杩�3绉掞級
- * @param {number} count - 褰撳墠閲嶈繛娆℃暟
- */
- triggerReconnect(count) {
- console.log(`[WebSocket] 鍑嗗绗� ${count + 1} 娆¢噸杩瀈);
- setTimeout(() => {
- this.createConnect(this.currentUserId, this.currentUserName, count + 1);
- }, 3000);
- }
-
- /**
- * 鍚姩鈥滄棤涓氬姟娑堟伅鈥濊秴鏃舵牎楠�
- * 閫昏緫锛�45绉掑唴娌℃敹鍒颁换浣曚笟鍔℃秷鎭� 鈫� 鍒ゅ畾杩炴帴澶辨晥锛堟湇鍔$30绉掑彂Ping锛屽簳灞傚凡澶勭悊锛屾澶勪粎鏍¢獙涓氬姟閫氶亾锛�
- */
- startNoMessageCheck() {
- this.clearNoMessageTimer();
- this.noMessageTimer = setTimeout(() => {
- console.warn("[WebSocket] 45绉掓湭鏀跺埌涓氬姟娑堟伅锛屽垽瀹氳繛鎺ュけ鏁堬紝涓诲姩閲嶈繛");
- this.closeSocket();
- this.createConnect(this.currentUserId, this.currentUserName);
- }, this.noMessageTimeout);
- }
-
- /**
- * 鏀跺埌涓氬姟娑堟伅鍚庯紝閲嶇疆鏃犳秷鎭畾鏃跺櫒
- */
- resetNoMessageTimer() {
- this.startNoMessageCheck();
- }
-
- /**
- * 娓呴櫎鏃犳秷鎭畾鏃跺櫒
- */
- clearNoMessageTimer() {
- if (this.noMessageTimer) {
- clearTimeout(this.noMessageTimer);
- this.noMessageTimer = null;
- }
- }
-
- /**
- * 娓呴櫎鎵�鏈� Socket 鐩戝惉
- */
- clearAllListeners() {
- if (this.openListener) {
- uni.offSocketOpen(this.openListener);
- this.openListener = null;
- }
- if (this.messageListener) {
- uni.offSocketMessage(this.messageListener);
- this.messageListener = null;
- }
- if (this.closeListener) {
- uni.offSocketClose(this.closeListener);
- this.closeListener = null;
- }
- if (this.errorListener) {
- uni.offSocketError(this.errorListener);
- this.errorListener = null;
- }
- }
-
- /**
- * 涓诲姩鍏抽棴 WebSocket 杩炴帴 (鐧诲嚭鏃跺叧闂璚ebSocket杩炴帴)
- */
- closeSocket() {
- this.isReconnectStopped = true;
- this.clearAllListeners();
- this.clearNoMessageTimer();
-
- if (this.wsInstance) {
- uni.closeSocket({
- success: () => console.log("[WebSocket] 涓诲姩鍏抽棴杩炴帴鎴愬姛"),
- fail: (error) => console.error("[WebSocket] 涓诲姩鍏抽棴杩炴帴澶辫触", error),
- });
- this.wsInstance = null;
- }
-
- this.isConnected = false;
- this.isConnecting = false;
- }
+ constructor() {
+ this.wsInstance = null; // WebSocket 瀹炰緥
+ this.isConnecting = false; // 杩炴帴涓姸鎬侊紙閬垮厤骞跺彂閲嶈繛锛�
+ this.isConnected = false; // 宸茶繛鎺ョ姸鎬�
+ this.isReconnectStopped = false; // 鍋滄閲嶈繛鏍囪
+ this.wsUrl = CommonUtils.httpFormatWs(); // WebSocket 鍩虹鍦板潃
+
+ // 瓒呮椂鏍¢獙閰嶇疆
+ this.businessMessageInterval = 5 * 60 * 1000;
+ this.noMessageTimeout = this.businessMessageInterval + 2 * 60 * 1000;
+ this.noMessageTimer = null; // 鏃犳秷鎭秴鏃跺畾鏃跺櫒
+
+ // 鐩戝惉鍑芥暟寮曠敤
+ this.openListener = null;
+ this.messageListener = null;
+ this.closeListener = null;
+ this.errorListener = null;
+
+ // 缂撳瓨鐢ㄦ埛淇℃伅
+ this.currentUserId = "";
+ this.currentUserName = "";
+ }
+
+ /**
+ * 寤虹珛 WebSocket 杩炴帴
+ * @param {string/number} userId - 鐢ㄦ埛ID锛堝繀濉級
+ * @param {string} userName - 鐢ㄦ埛鍚嶏紙蹇呭~锛�
+ * @param {number} count - 褰撳墠閲嶈繛娆℃暟
+ * @param {number} limit - 鏈�澶ч噸杩炴鏁帮紙榛樿3娆★級
+ */
+ createConnect(userId, userName, count = 0, limit = 3) {
+ // 鐧诲綍寤虹珛杩炴帴鏃讹紝闇�瑕侀噸鏂拌幏鍙杊ttp鍦板潃锛屽彲鑳戒細鍙樻洿
+ this.wsUrl = CommonUtils.httpFormatWs();
+ // 缂撳瓨鐢ㄦ埛淇℃伅锛堢敤浜庨噸杩烇級
+ this.currentUserId = userId;
+ this.currentUserName = userName;
+
+ // 鍓嶇疆鏍¢獙锛氶伩鍏嶆棤鏁堣繛鎺ュ拰骞跺彂閲嶈繛
+ if (this.isConnecting || this.isConnected) return;
+ if (!userId && userId !== 0) { // 鍏煎 userId 涓� 0 鐨勫悎娉曞満鏅�
+ CommonUtils.showTips({
+ message: "鐢ㄦ埛鏍囪瘑涓嶈兘涓虹┖锛屾棤娉曞缓绔媁ebSocket杩炴帴"
+ });
+ return;
+ }
+ if (count > limit) {
+ CommonUtils.showTips({
+ message: `WebSocket 閲嶈繛娆℃暟瓒呭嚭鏈�澶ч檺鍒讹紙${limit}娆★級锛屽凡鍋滄閲嶈繛`,
+ });
+ this.isReconnectStopped = true;
+ return;
+ }
+
+ console.log(`[WebSocket] 寮�濮嬪缓绔嬭繛鎺ワ紙绗� ${count || 0} 娆★級`, {
+ wsUrl: this.wsUrl,
+ userId,
+ userName,
+ });
+
+ // 娓呴櫎鍘嗗彶娈嬬暀锛氱洃鍚�+瀹氭椂鍣�
+ this.clearAllListeners();
+ this.clearNoMessageTimer();
+
+ // 鍙戣捣杩炴帴
+ this.isConnecting = true;
+ this.wsInstance = uni.connectSocket({
+ url: `${this.wsUrl}?userId=${encodeURIComponent(userId)}&userName=${encodeURIComponent(userName)}`,
+ fail: (error) => {
+ console.error("[WebSocket] 杩炴帴鍙戣捣澶辫触", error);
+ this.isConnecting = false;
+ this.triggerReconnect(count);
+ },
+ });
+
+ // 鐩戝惉杩炴帴鎴愬姛锛氬惎鍔ㄦ棤娑堟伅瓒呮椂鏍¢獙
+ this.openListener = uni.onSocketOpen((res) => {
+ console.log("[WebSocket] 杩炴帴寤虹珛鎴愬姛", res);
+ this.isConnecting = false;
+ this.isConnected = true;
+ this.isReconnectStopped = false;
+ this.startNoMessageCheck();
+ count = 0;
+ });
+
+ this.messageListener = uni.onSocketMessage((res) => {
+ try {
+ const message = JSON.parse(res.data);
+ console.log("[WebSocket] 鏀跺埌涓氬姟娑堟伅", message);
+
+ // 閲嶇疆鏃犳秷鎭畾鏃跺櫒锛堟湁涓氬姟娑堟伅=杩炴帴姝e父锛�
+ this.resetNoMessageTimer();
+
+ // 澶勭悊涓氬姟娑堟伅
+ if (message.Type === "Message") {
+ const content = JSON.parse(message.Content);
+ this.showTaskTip(`鎮ㄦ湁${content.length}鏉℃秷鎭渶瑕佸鐞�!`);
+ // this.emit("message", content); // 鏀寔澶栭儴鐩戝惉
+ }
+ } catch (error) {
+ console.error("[WebSocket] 娑堟伅瑙f瀽澶辫触", error, res.data);
+ }
+ });
+
+ // 鐩戝惉杩炴帴鍏抽棴锛氫粎寮傚父鍏抽棴瑙﹀彂閲嶈繛
+ this.closeListener = uni.onSocketClose((res) => {
+ console.log("[WebSocket] 杩炴帴鍏抽棴", res);
+ this.isConnecting = false;
+ this.isConnected = false;
+ this.clearNoMessageTimer();
+
+ // 姝e父鍏抽棴锛坈ode=1000锛夋垨涓诲姩鍋滄閲嶈繛鏃讹紝涓嶉噸杩�
+ if (!this.isReconnectStopped && res.code !== 1000) {
+ this.triggerReconnect(count);
+ }
+ });
+
+ // 鐩戝惉杩炴帴閿欒锛氳Е鍙戦噸杩�
+ this.errorListener = uni.onSocketError((error) => {
+ console.error("[WebSocket] 杩炴帴閿欒", error);
+ this.isConnecting = false;
+ this.clearNoMessageTimer();
+ if (!this.isReconnectStopped) {
+ this.triggerReconnect(count);
+ }
+ });
+ }
+
+ /**
+ * 缁熶竴瑙﹀彂閲嶈繛锛堝欢杩�3绉掞級
+ * @param {number} count - 褰撳墠閲嶈繛娆℃暟
+ */
+ triggerReconnect(count) {
+ console.log(`[WebSocket] 鍑嗗绗� ${count + 1} 娆¢噸杩瀈);
+ setTimeout(() => {
+ this.createConnect(this.currentUserId, this.currentUserName, count + 1);
+ }, 3000);
+ }
+
+ /**
+ * 鍚姩鈥滄棤涓氬姟娑堟伅鈥濊秴鏃舵牎楠�
+ */
+ startNoMessageCheck() {
+ this.clearNoMessageTimer();
+ this.noMessageTimer = setTimeout(() => {
+ console.warn("[WebSocket] 7鍒嗛挓鏈敹鍒颁笟鍔℃秷鎭紝鍒ゅ畾杩炴帴澶辨晥锛屼富鍔ㄩ噸杩�");
+ this.closeSocket();
+ this.createConnect(this.currentUserId, this.currentUserName);
+ }, this.noMessageTimeout);
+ }
+
+ /**
+ * 鏀跺埌涓氬姟娑堟伅鍚庯紝閲嶇疆鏃犳秷鎭畾鏃跺櫒
+ */
+ resetNoMessageTimer() {
+ this.startNoMessageCheck();
+ }
+
+ /**
+ * 娓呴櫎鏃犳秷鎭畾鏃跺櫒
+ */
+ clearNoMessageTimer() {
+ if (this.noMessageTimer) {
+ clearTimeout(this.noMessageTimer);
+ this.noMessageTimer = null;
+ }
+ }
+
+ /**
+ * 娓呴櫎鎵�鏈� Socket 鐩戝惉
+ */
+ clearAllListeners() {
+ if (this.openListener) {
+ uni.offSocketOpen(this.openListener);
+ this.openListener = null;
+ }
+ if (this.messageListener) {
+ uni.offSocketMessage(this.messageListener);
+ this.messageListener = null;
+ }
+ if (this.closeListener) {
+ uni.offSocketClose(this.closeListener);
+ this.closeListener = null;
+ }
+ if (this.errorListener) {
+ uni.offSocketError(this.errorListener);
+ this.errorListener = null;
+ }
+ }
+
+ /**
+ * 涓诲姩鍏抽棴 WebSocket 杩炴帴 (鐧诲嚭鏃跺叧闂璚ebSocket杩炴帴)
+ */
+ closeSocket() {
+ this.isReconnectStopped = true;
+ this.clearAllListeners();
+ this.clearNoMessageTimer();
+
+ if (this.wsInstance) {
+ uni.closeSocket({
+ success: () => console.log("[WebSocket] 涓诲姩鍏抽棴杩炴帴鎴愬姛"),
+ fail: (error) => console.error("[WebSocket] 涓诲姩鍏抽棴杩炴帴澶辫触", error),
+ });
+ this.wsInstance = null;
+ }
+
+ this.isConnected = false;
+ this.isConnecting = false;
+ }
showTaskTip(Content) {
diff --git a/utils/common.js b/utils/common.js
index 4c609a4..6905022 100644
--- a/utils/common.js
+++ b/utils/common.js
@@ -496,7 +496,6 @@
}
httpFormatWs(httpUrl=this.serverUrl) {
- console.log('httpUrl: ',httpUrl);
if(httpUrl.indexOf("http://") === 0){
httpUrl = httpUrl.replace("http://", "")
httpUrl = "ws://" + httpUrl.split(":")[0]+":8089/ws"
--
Gitblit v1.9.1