From 920675a9f1ccf311d32e6466ebde737dff765645 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 23 一月 2026 09:15:00 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
---
pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue | 366 +++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 274 insertions(+), 92 deletions(-)
diff --git a/pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue b/pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue
index fba70a1..7a5e2fb 100644
--- a/pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue
+++ b/pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue
@@ -2,16 +2,11 @@
<view>
<view class="tabs" id="tabs">
<view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">鍩烘湰淇℃伅</view>
- <!-- <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">鏄庣粏淇℃伅</view> -->
<view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">鍏朵粬淇℃伅</view>
- <!-- <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">闄勪欢淇℃伅</view> -->
</view>
<!-- 鍩烘湰淇℃伅 -->
<template v-if="tabs == 0">
- <view class="form" :style="{
- height: containerHeight + 'px',
- overflow: 'auto'
- }">
+ <view class="form" :style="{ height: containerHeight + 'px',overflow: 'auto'}">
<view class="form-item">
<view class="title">璁惧鏉$爜:</view>
<view :class="enableEdit?'right':'righton'">
@@ -44,6 +39,40 @@
<textarea v-model="hform.HRepairContent" placeholder="璇疯緭鍏ラ獙璇佸唴瀹�" />
</view>
</view>
+ <!-- 婧愬崟绫诲瀷 -->
+ <view class="form-item">
+ <view class="title">婧愬崟绫诲瀷:</view>
+ <view class="right" v-show="showHMainSourceBillType">
+ <picker :range="arrayHMainSourceBillType" @change="HMainSourceBillTypeChange">
+ <input disabled name="HMainSourceBillType" v-model="HMainSourceBillType"
+ placeholder="璇烽�夋嫨婧愬崟绫诲瀷" />
+ <view class="picker-overlay"></view>
+ </picker>
+ </view>
+ <view class="righton" v-show="!showHMainSourceBillType">
+ <input name="HMainSourceBillType" disabled v-model="HMainSourceBillType"
+ placeholder="璇烽�夋嫨婧愬崟绫诲瀷" />
+ </view>
+ </view>
+
+ <!-- 婧愬崟鍗曞彿 -->
+ <view class="form-item">
+ <view class="title required">婧愬崟鍗曞彿:</view>
+ <view :class="enableSourceBillEdit?'right':'righton'">
+ <input v-model="hform.HMainSourceBillNo" :disabled="!enableSourceBillEdit"
+ @confirm="GetMessageByHMainSourceBillNo(hform.HMainSourceBillNo)"
+ placeholder="璇疯緭鍏�(鎴栨壂鎻�)婧愬崟鍗曞彿" />
+ </view>
+ <!-- 鏀惧ぇ闀滃浘鏍囷紝褰撴簮鍗曠被鍨嬩笉鏄�"鎵嬪伐褰曞叆"鏃舵樉绀� -->
+ <view class="icon-wrapper" v-if="hform.HMainSourceBillType != '鎵嬪伐褰曞叆'">
+ <uni-icons type="search" size="20" @click="showBillList"></uni-icons>
+ </view>
+ <!-- 鎵弿鍥炬爣 -->
+ <view class="icon-wrapper">
+ <uni-icons type="scan" size="20" @click="toScanHMainSourceBillNo"></uni-icons>
+ </view>
+ </view>
+
<view class="form-item">
<view class="title">鍗曟嵁鍙�:</view>
<view class="righton">
@@ -75,33 +104,25 @@
<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="HRepairList" dataKey="缁翠慨椤圭洰"
dataValue="hitemid" v-model="hform.HRepairID">
-
</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>
@@ -201,6 +222,10 @@
<button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
</view>
<!-- <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload> -->
+ <!-- 婧愬崟鍗曟嵁鍒楄〃寮圭獥 -->
+ <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="hform.HBillType"
+ :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID">
+ </BillListPopupEquipConkBookBillVue>
</view>
</template>
@@ -215,13 +240,19 @@
import {
getUserInfo
} from "../../../utils/auth";
+ // 寮曞叆婧愬崟鍗曟嵁鍒楄〃寮圭獥缁勪欢
+ import BillListPopupEquipConkBookBillVue from '../../../components/BillListPopup/BillListPopupEquipConkBookBill.vue';
+
export default {
// 璁惧缁翠慨娲惧伐鍗�
name: 'Sb_EquipRepairSendWorkBill',
+ components: {
+ BillListPopupEquipConkBookBillVue
+ },
data() {
return {
tabs: 0,
- HMainSourceBillType: "",
+ HMainSourceBillType: "", // 鐢ㄤ簬鏄剧ず鐨勬簮鍗曠被鍨�
btnTop: 0,
tabsBottom: 0,
HModName: "Sb_EquipRepairSendWorkBill",
@@ -229,6 +260,12 @@
operationType: 1,
uploadOptions: {},
enableEdit: true,
+ enableSourceBillEdit: true, // 淇锛氭坊鍔犺繖涓睘鎬�
+
+ // 婧愬崟绫诲瀷鐩稿叧
+ arrayHMainSourceBillType: ['璁惧缁翠慨鐧昏鍗�', '鎵嬪伐褰曞叆'], // 鍙�夌殑婧愬崟绫诲瀷
+ arrayHMainSourceBillTypeID: ['璁惧缁翠慨鐧昏鍗�', '鎵嬪伐褰曞叆'], // 瀵瑰簲鐨勫崟鎹被鍨婭D
+ showHMainSourceBillType: true,
HDeptList: [],
HRepairCheckList: [],
@@ -242,12 +279,12 @@
HDate: dayjs(new Date()).format("YYYY-MM-DD"),
HInnerBillNo: '',
HRepairContent: '',
- HDeptIDName: '',
- HDeptID: 0,
- HEmpIDName: '',
- HEmpID: 0,
- HManagerIDName: '',
- HManagerID: 0,
+ HDeptName: getUserInfo().HDeptName,
+ HDeptID: getUserInfo().HDeptID,
+ HEmpName: getUserInfo().HEmpName,
+ HEmpID: getUserInfo().HEmpID,
+ HManagerName: getUserInfo().HManagerName,
+ HManagerID: getUserInfo().HManagerID,
HEquipIDName: '',
HEquipID: 0,
HRepairIDName: '',
@@ -255,7 +292,7 @@
HRepairPlanBeginDate: dayjs(new Date()).format("YYYY-MM-DD"),
HRepairPlanEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
HCycleUnit: '灏忔椂',
- HPlanTimes: '',
+ HPlanTimes: '0',
HExplanation: '',
HRemark: '',
HMaker: getUserInfo()["Czymc"],
@@ -267,7 +304,13 @@
HCloseDate: '',
HUpDateDate: '',
HDeleteMan: '',
- HDeleteDate: ''
+ HDeleteDate: '',
+ // 鏂板鐨勬簮鍗曠浉鍏冲瓧娈�
+ HMainSourceBillType: '璁惧缁翠慨鐧昏鍗�', // 榛樿涓鸿澶囩淮淇櫥璁板崟
+ HMainSourceBillNo: '',
+ HMainSourceInterID: 0,
+ HMainSourceEntryID: 0,
+ HStockOrgID: uni.getStorageSync("OrganizationID"), // 鏂板搴撳瓨缁勭粐ID
},
HDetailList: [{ // 鍚庣鎺ュ彛鎻愪氦闇�瑕� 鏄庣粏淇℃伅
"瀛愮淮淇」鐩�": "",
@@ -289,6 +332,168 @@
},
},
methods: {
+ // 鏄剧ず婧愬崟鍗曟嵁鍒楄〃寮圭獥
+ showBillList() {
+ if (this.hform.HMainSourceBillType === '鎵嬪伐褰曞叆') {
+ CommonUtils.showTips({
+ title: '鎻愮ず',
+ message: '鎵嬪伐褰曞叆妯″紡涓嬩笉鑳介�夋嫨婧愬崟'
+ });
+ return;
+ }
+ this.$refs.billList.showPopup();
+ },
+
+ // 閫夋嫨婧愬崟绫诲瀷
+ HMainSourceBillTypeChange(e) {
+ if (e.detail.value == -1 || e.detail.value == NaN) {
+ this.HMainSourceBillType = '鎵嬪伐褰曞叆';
+ this.hform.HMainSourceBillType = '鎵嬪伐褰曞叆';
+ return;
+ }
+
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[e.detail.value];
+ this.hform.HMainSourceBillType = this.arrayHMainSourceBillTypeID[e.detail.value];
+
+ // 濡傛灉鏄墜宸ュ綍鍏ワ紝娓呯┖婧愬崟淇℃伅
+ if (this.hform.HMainSourceBillType === '鎵嬪伐褰曞叆') {
+ this.hform.HMainSourceBillNo = '';
+ this.hform.HMainSourceInterID = 0;
+ this.hform.HMainSourceEntryID = 0;
+ this.enableSourceBillEdit = false; // 鎵嬪伐褰曞叆鏃剁鐢ㄦ簮鍗曞崟鍙风紪杈�
+ } else {
+ this.enableSourceBillEdit = true; // 闈炴墜宸ュ綍鍏ユ椂鍙紪杈�
+ }
+
+ // 缂撳瓨褰撳墠椤甸潰閫夋嫨
+ const pages = getCurrentPages();
+ const currentPage = pages[pages.length - 1];
+ uni.setStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`, {
+ HSourceBillTypeName: this.HMainSourceBillType,
+ HSourceBillType: this.hform.HMainSourceBillType
+ });
+ },
+
+ // 璇诲彇缂撳瓨
+ loadCache() {
+ const pages = getCurrentPages();
+ const currentPage = pages[pages.length - 1];
+ let HBillTypeCache = uni.getStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`);
+ if (HBillTypeCache) {
+ this.HMainSourceBillType = HBillTypeCache.HSourceBillTypeName;
+ this.hform.HMainSourceBillType = HBillTypeCache.HSourceBillType;
+
+ // 鏍规嵁缂撳瓨鐨勬簮鍗曠被鍨嬭缃紪杈戠姸鎬�
+ if (this.hform.HMainSourceBillType === '鎵嬪伐褰曞叆') {
+ this.enableSourceBillEdit = false;
+ } else {
+ this.enableSourceBillEdit = true;
+ }
+ }
+ },
+
+ // 鎵弿婧愬崟鍗曞彿
+ toScanHMainSourceBillNo() {
+ MpaasScan.scanCode(cb => {
+ this.hform.HMainSourceBillNo = cb;
+ this.GetMessageByHMainSourceBillNo(cb);
+ });
+ },
+
+ // 鏍规嵁婧愬崟鍗曞彿鑾峰彇淇℃伅
+ async GetMessageByHMainSourceBillNo(HSouceBillNo) {
+ try {
+ let url, dataField;
+
+ // 鏍规嵁婧愬崟绫诲瀷閫夋嫨涓嶅悓鐨勬帴鍙�
+ if (this.hform.HMainSourceBillType === '璁惧缁翠慨鐧昏鍗�') {
+ url = "/Sb_EqpRepairWorkBill/GetEqpConkBookBillListPage";
+ dataField = {
+ sWhere: ` and 鍗曟嵁鍙� = '${HSouceBillNo}'`,
+ user: getUserInfo()["Czymc"],
+ page: 1,
+ size: 1,
+ };
+ } else {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: `鏆備笉鏀寔璇ユ簮鍗曠被鍨嬶細${this.hform.HMainSourceBillType}`
+ });
+ return;
+ }
+
+ let res = await CommonUtils.doRequest2Async({
+ url: url,
+ data: dataField
+ });
+
+ let { count, Message, data } = res.data;
+ if (count == 1) {
+ this.hform.HMainSourceBillNo = data[0]["鍗曟嵁鍙�"];
+ this.hform.HMainSourceInterID = data[0]["hmainid"];
+ this.hform.HMainSourceEntryID = data[0]["hsubid"];
+
+ // 濡傛灉婧愬崟鏈夎澶囦俊鎭紝鍙互鑷姩濉厖
+ if (data[0].HEquipID) {
+ this.hform.HEquipID = data[0].HEquipID;
+ this.getEquipFileMain(data[0].HEquipID);
+ }
+
+ } else {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: `鑾峰彇婧愬崟鍗曞彿澶辫触: ${Message}`
+ });
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: `鑾峰彇婧愬崟鍗曞彿澶辫触: ${err}`
+ });
+ }
+ },
+
+ // 鏍规嵁璁惧ID鑾峰彇璁惧淇℃伅
+ async getEquipFileMain(HInterID) {
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_ListByHEquipID",
+ data: {
+ HEquipID: HInterID,
+ },
+ });
+
+ if (!res) {
+ return;
+ }
+
+ let {
+ data,
+ count,
+ Message
+ } = res.data;
+
+ if (count == 1) {
+ this.hform.HEquipID = data[0].hmainid;
+ this.hform.HBarName = data[0].璁惧鍚嶇О;
+ this.hform.HBarSpec = data[0].璁惧瑙勬牸;
+ this.hform.HBarModel = data[0].璁惧鍨嬪彿;
+ this.hform.HBarCode = data[0].璁惧鏉$爜 || "";
+ this.enableEdit = false;
+ } else {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: Message
+ });
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: err
+ });
+ }
+ },
+
// 缁翠慨椤圭洰
async getRepairList() {
try{
@@ -336,13 +541,13 @@
}
if (this.hform.HEmpID == 0) {
return {
- Message: "楠屾敹浜轰笉寰椾负绌�!",
+ Message: "缁翠慨浜轰笉寰椾负绌�!",
state: false
}
}
- if (this.hform.HRepairCheckMainID == 0) {
+ if (this.hform.HRepairID == 0) {
return {
- Message: "楠岃瘉椤圭洰涓嶅緱涓虹┖!",
+ Message: "缁翠慨椤圭洰涓嶅緱涓虹┖!",
state: false
}
}
@@ -350,6 +555,15 @@
return {
Message: "璐熻矗浜轰笉寰椾负绌�!",
state: false
+ }
+ }
+ // 娣诲姞婧愬崟鏍¢獙锛堝鏋滀笉鏄墜宸ュ綍鍏ワ紝鍒欏繀椤婚�夋嫨婧愬崟锛�
+ if (this.hform.HMainSourceBillType !== '鎵嬪伐褰曞叆') {
+ if (!this.hform.HMainSourceBillNo || this.hform.HMainSourceBillNo.trim() === '') {
+ return {
+ Message: "婧愬崟绫诲瀷闈炴墜宸ュ綍鍏ワ紝蹇呴』閫夋嫨婧愬崟锛�",
+ state: false
+ }
}
}
@@ -552,7 +766,7 @@
},
toScanCode() {
MpaasScan.scanCode(cb => {
- this.hfrom.HBarCode = cb
+ this.hform.HBarCode = cb; // 淇锛氬師鏉ユ槸 hfrom 搴旇鏄� hform
this.GetMessageByBarCode(cb)
})
},
@@ -564,7 +778,6 @@
HBarCode: HBarCode,
},
})
-
if (!res) {
return
@@ -582,6 +795,7 @@
this.hform.HBarName = data[0].璁惧鍚嶇О
this.hform.HBarSpec = data[0].璁惧瑙勬牸
this.hform.HBarModel = data[0].璁惧鍨嬪彿
+ this.hform.HBarCode = HBarCode; // 纭繚鏉$爜姝g‘鏄剧ず
this.hform.HQty = 1
this.enableEdit = false
@@ -598,66 +812,7 @@
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
@@ -746,7 +901,6 @@
})
}
-
} catch (err) {
CommonUtils.showTips({
title: "娓╅Θ鎻愮ず",
@@ -770,16 +924,35 @@
// 澶嶅埗
} else if (this.operationType == 3) {
// 缂栬緫
-
} else if (this.operationType == 4) {
// 娴忚
-
+ this.enableEdit = false;
+ this.enableSourceBillEdit = false;
+ this.showHMainSourceBillType = false;
}
this.getHDeptList()
this.getEmpList()
this.getCheckProjList()
this.getRepairList()
+ this.loadCache()
+
+ // 鐩戝惉鍗曟嵁閫夋嫨瀹屾垚浜嬩欢
+ uni.$on('BillSelectComplete', (e) => {
+ console.log("鎺ユ敹鍒扮殑娑堟伅: ", e)
+ this.hform.HMainSourceInterID = e.HInterID
+ this.hform.HMainSourceBillNo = e.HBillNo
+ this.hform.HMainSourceEntryID = e.HEntryID
+ this.hform.HEquipID = e.HEquipID
+ this.hform.HBarName = e.HEquipName
+ this.hform.HBarSpec = e.HEquipSpec
+ this.hform.HBarModel = e.HEquipModel
+ this.hform.HBarCode = e.HEquipBarCode || ""
+ this.$refs.billList.exit()
+ })
+ },
+ onUnload() {
+ uni.$off('BillSelectComplete')
},
onReady() {
const query = uni.createSelectorQuery().in(this)
@@ -796,5 +969,14 @@
</script>
<style lang="scss" scoped>
- @import "@/pages/MJGL/style/MJBillStyle.scss"
+ @import "@/pages/MJGL/style/MJBillStyle.scss";
+
+ .picker-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 1;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.1