From c5dd3c5e518906ca6ffc7c6791e7408f8cf15628 Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期四, 22 一月 2026 19:38:17 +0800
Subject: [PATCH] 模具设备证据选着源单功能,封装公用组件
---
pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBill.vue | 2
pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckBill.vue | 22
pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue | 352 ++
manifest.json | 4
pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill.vue | 1834 ++++++++--------
pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill.vue | 1660 ++++++++------
components/BillListPopup/BillListPopuMouldRepairRecordPopup.vue | 730 +++---
components/BillListPopup/BillListPopupEquipConkBookBill.vue | 398 +++
components/BillListPopup/BillListPopupMouldConkBookBill.vue | 1
pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill.vue | 1486 +++++++------
10 files changed, 3,686 insertions(+), 2,803 deletions(-)
diff --git a/components/BillListPopup/BillListPopuMouldRepairRecordPopup.vue b/components/BillListPopup/BillListPopuMouldRepairRecordPopup.vue
index defa328..c03ebd4 100644
--- a/components/BillListPopup/BillListPopuMouldRepairRecordPopup.vue
+++ b/components/BillListPopup/BillListPopuMouldRepairRecordPopup.vue
@@ -1,385 +1,389 @@
<template>
- <view>
- <uni-popup ref="popup" type="bottom" @change="popupChangeHandler">
- <view class="content">
- <view class="search-condition">
- <view class="title"><text>鏃ユ湡: </text></view>
- <view class="daterange" style="flex: 1;">
- <view class="right general">
- <uni-datetime-picker type="date" :clear-icon="false" v-model="HBeginDate">
- <view>{{HBeginDate}}</view>
- </uni-datetime-picker>
- </view>
- <view>鈥�</view>
- <view class="right general">
- <uni-datetime-picker type="date" :clear-icon="false" v-model="HEndDate">
- <view>{{HEndDate}}</view>
- </uni-datetime-picker>
- </view>
- </view>
- </view>
- <!-- 淇濇寔涓庢晠闅滅櫥璁板崟鐩稿悓鐨勬悳绱㈡潯浠� -->
- <view class="search-condition">
- <view class="title"><text>妯″叿缂栫爜: </text></view>
- <view class="right"><input type="text" :focus="enablefocus" v-model="HNumber"
- @confirm="getRepairRecordList" /></view>
- </view>
- <view class="search-condition">
- <view class="title"><text>妯″叿鍚嶇О: </text></view>
- <view class="right"><input type="text" v-model="HName" @confirm="getRepairRecordList" /></view>
- </view>
- <view class="search-condition">
- <view class="title"><text>鍗曟嵁鍙�: </text></view>
- <view class="right"><input type="text" v-model="HBillNo" @confirm="getRepairRecordList" /></view>
- </view>
- <view class="buttons">
- <view style="flex: 1;"></view>
- <button size="mini" type="primary" @click="search">鎼滅储</button>
- <button size="mini" type="primary" @click="exit">閫�鍑�</button>
- </view>
- <scroll-view id="#BillListPanel" scroll-y="true" style="height: 50vh;">
- <view class="options-wrapper" v-show="HRepairRecordList.length != 0">
- <uni-card :is-active="record.isActive" :class="record.isActive?'uni-card--is-active':''"
- v-for="(record, index) in HRepairRecordList[curPage-1]" :key="index"
- :title="record['鍗曟嵁鍙�'] || record['HBillNo'] || record['缁翠慨鍗曞彿']"
- @tap="clickCard(record, index)">
- <view class="item">
- <view class="left">鏃ユ湡: </view>
- <view class="right">{{dayjs(record['鏃ユ湡'] || record['缁翠慨鏃ユ湡'] || record['HDate']).format('YYYY-MM-DD')}}</view>
- </view>
- <view class="item" v-if="record['妯″叿缂栫爜'] || record['HMouldCode']">
- <view class="left">妯″叿缂栫爜: </view>
- <view class="right">{{record['浜у搧妯″叿浠g爜'] || record['HMouldCode']}}</view>
- </view>
- <view class="item" v-if="record['妯″叿鍚嶇О'] || record['HMouldName']">
- <view class="left">妯″叿鍚嶇О: </view>
- <view class="right">{{record['浜у搧妯″叿'] || record['HMouldName']}}</view>
- </view>
- <view class="item" v-if="record['妯″叿瑙勬牸'] || record['HMouldSpec']">
- <view class="left">妯″叿瑙勬牸: </view>
- <view class="right">{{record['妯″叿瑙勬牸'] || record['HMouldSpec']}}</view>
- </view>
- <view class="item" v-if="record['妯″叿鍨嬪彿'] || record['HMouldModel']">
- <view class="left">妯″叿鍨嬪彿: </view>
- <view class="right">{{record['妯″叿鍨嬪彿'] || record['HMouldModel']}}</view>
- </view>
- <view class="item" v-if="record['缁翠慨鍗曞彿'] || record['HRepairNo']">
- <view class="left">缁翠慨鍗曞彿: </view>
- <view class="right">{{record['缁翠慨鍗曞彿'] || record['HRepairNo']}}</view>
- </view>
- <view class="item" v-if="record['缁翠慨鍐呭'] || record['HRepairContent']">
- <view class="left">缁翠慨鍐呭: </view>
- <view class="right">{{record['缁翠慨鍐呭'] || record['HRepairContent']}}</view>
- </view>
- <view class="item" v-if="record['缁翠慨浜�'] || record['HEmpName']">
- <view class="left">缁翠慨浜�: </view>
- <view class="right">{{record['缁翠慨浜�'] || record['HEmpName']}}</view>
- </view>
- <view class="item" v-if="record['缁翠慨浜�'] || record['HStatus']">
- <view class="left">缁翠慨浜�: </view>
- <view class="right">{{record['缁翠慨浜�'] || record['HStatus']}}</view>
- </view>
- </uni-card>
- </view>
- <view class="over" v-show="HRepairRecordList.length == 0">鏆傛棤鏁版嵁</view>
- </scroll-view>
- <uni-pagination id="#pagination" title="鏍囬鏂囧瓧" v-model="curPage" :pageSize="size"
- :total="length"></uni-pagination>
- </view>
- </uni-popup>
- </view>
+ <view>
+ <uni-popup ref="popup" type="bottom" @change="popupChangeHandler">
+ <view class="content">
+ <view class="search-condition">
+ <view class="title"><text>鏃ユ湡: </text></view>
+ <view class="daterange" style="flex: 1;">
+ <view class="right general">
+ <uni-datetime-picker type="date" :clear-icon="false" v-model="HBeginDate">
+ <view>{{HBeginDate}}</view>
+ </uni-datetime-picker>
+ </view>
+ <view>鈥�</view>
+ <view class="right general">
+ <uni-datetime-picker type="date" :clear-icon="false" v-model="HEndDate">
+ <view>{{HEndDate}}</view>
+ </uni-datetime-picker>
+ </view>
+ </view>
+ </view>
+ <!-- 淇濇寔涓庢晠闅滅櫥璁板崟鐩稿悓鐨勬悳绱㈡潯浠� -->
+ <view class="search-condition">
+ <view class="title"><text>妯″叿缂栫爜: </text></view>
+ <view class="right"><input type="text" :focus="enablefocus" v-model="HNumber"
+ @confirm="getRepairRecordList" /></view>
+ </view>
+ <view class="search-condition">
+ <view class="title"><text>妯″叿鍚嶇О: </text></view>
+ <view class="right"><input type="text" v-model="HName" @confirm="getRepairRecordList" /></view>
+ </view>
+ <view class="search-condition">
+ <view class="title"><text>鍗曟嵁鍙�: </text></view>
+ <view class="right"><input type="text" v-model="HBillNo" @confirm="getRepairRecordList" /></view>
+ </view>
+ <view class="buttons">
+ <view style="flex: 1;"></view>
+ <button size="mini" type="primary" @click="search">鎼滅储</button>
+ <button size="mini" type="primary" @click="exit">閫�鍑�</button>
+ </view>
+ <scroll-view id="#BillListPanel" scroll-y="true" style="height: 50vh;">
+ <view class="options-wrapper" v-show="HRepairRecordList.length != 0">
+ <uni-card :is-active="record.isActive" :class="record.isActive?'uni-card--is-active':''"
+ v-for="(record, index) in HRepairRecordList[curPage-1]" :key="index"
+ :title="record['鍗曟嵁鍙�'] || record['HBillNo'] || record['缁翠慨鍗曞彿']"
+ @tap="clickCard(record, index)">
+ <view class="item">
+ <view class="left">鏃ユ湡: </view>
+ <view class="right">
+ {{dayjs(record['鏃ユ湡'] || record['缁翠慨鏃ユ湡'] || record['HDate']).format('YYYY-MM-DD')}}
+ </view>
+ </view>
+ <view class="item" v-if="record['妯″叿缂栫爜'] || record['HMouldCode']">
+ <view class="left">妯″叿缂栫爜: </view>
+ <view class="right">{{record['浜у搧妯″叿浠g爜'] || record['HMouldCode']}}</view>
+ </view>
+ <view class="item" v-if="record['妯″叿鍚嶇О'] || record['HMouldName']">
+ <view class="left">妯″叿鍚嶇О: </view>
+ <view class="right">{{record['浜у搧妯″叿'] || record['HMouldName']}}</view>
+ </view>
+ <view class="item" v-if="record['妯″叿瑙勬牸'] || record['HMouldSpec']">
+ <view class="left">妯″叿瑙勬牸: </view>
+ <view class="right">{{record['妯″叿瑙勬牸'] || record['HMouldSpec']}}</view>
+ </view>
+ <view class="item" v-if="record['妯″叿鍨嬪彿'] || record['HMouldModel']">
+ <view class="left">妯″叿鍨嬪彿: </view>
+ <view class="right">{{record['妯″叿鍨嬪彿'] || record['HMouldModel']}}</view>
+ </view>
+ <view class="item" v-if="record['缁翠慨鍗曞彿'] || record['HRepairNo']">
+ <view class="left">缁翠慨鍗曞彿: </view>
+ <view class="right">{{record['缁翠慨鍗曞彿'] || record['HRepairNo']}}</view>
+ </view>
+ <view class="item" v-if="record['缁翠慨鍐呭'] || record['HRepairContent']">
+ <view class="left">缁翠慨鍐呭: </view>
+ <view class="right">{{record['缁翠慨鍐呭'] || record['HRepairContent']}}</view>
+ </view>
+ <view class="item" v-if="record['缁翠慨浜�'] || record['HEmpName']">
+ <view class="left">缁翠慨浜�: </view>
+ <view class="right">{{record['缁翠慨浜�'] || record['HEmpName']}}</view>
+ </view>
+ <view class="item" v-if="record['缁翠慨浜�'] || record['HStatus']">
+ <view class="left">缁翠慨浜�: </view>
+ <view class="right">{{record['缁翠慨浜�'] || record['HStatus']}}</view>
+ </view>
+ </uni-card>
+ </view>
+ <view class="over" v-show="HRepairRecordList.length == 0">鏆傛棤鏁版嵁</view>
+ </scroll-view>
+ <uni-pagination id="#pagination" title="鏍囬鏂囧瓧" v-model="curPage" :pageSize="size"
+ :total="length"></uni-pagination>
+ </view>
+ </uni-popup>
+ </view>
</template>
<script>
- import dayjs from 'dayjs';
- import {
- CommonUtils
- } from '../../utils/common';
- import {
- getUserInfo
- } from '../../utils/auth';
- export default {
- name: "RepairRecordPopup",
- data() {
- return {
- dayjs: dayjs,
- enablefocus: false,
- size: 20,
- curPage: 1,
- length: 0,
- page: 0,
- HMouldID: 0, // 褰撳墠閫夋嫨鐨勬ā鍏稩D
- HRepairRecordList: [],
-
- // 鎼滅储鏉′欢 - 涓庢晠闅滅櫥璁板崟淇濇寔涓�鑷�
- HBeginDate: dayjs(new Date()).subtract(30, 'd').format("YYYY-MM-DD"),
- HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
- HNumber: '',
- HName: '',
- HBillNo: '',
-
- };
- },
- props: {
- HBillType: {
- type: [String, Number],
- required: true
- },
- HStockOrgID: {
- type: [String, Number],
- required: true
- },
- // 鏂板涓�涓槸鍚︽樉绀烘ā鍏蜂俊鎭殑鍙傛暟
- showMouldInfo: {
- type: Boolean,
- default: true
- }
- },
- methods: {
- popupChangeHandler(e) {
- if (e.show === true) {
- this.getRepairRecordList()
- }
- },
- async exit() {
- this.resetSearchConditions();
- await this.$nextTick();
- this.$refs.popup.close();
- },
-
- resetSearchConditions() {
- this.size = 20;
- this.curPage = 1;
- this.length = 0;
- this.page = 0;
- this.HRepairRecordList = [];
- this.enablefocus = false;
-
- // 閲嶇疆鎼滅储鏉′欢
- this.HBeginDate = dayjs(new Date()).subtract(30, 'd').format("YYYY-MM-DD");
- this.HEndDate = dayjs(new Date()).format("YYYY-MM-DD");
- this.HNumber = '';
- this.HName = '';
- this.HBillNo = '';
- this.HRepairNo = '';
- this.HRepairContent = '';
- this.HRepairStatus = '';
- },
-
- showPopup(HMouldID) {
- this.HMouldID = HMouldID || 0;
- this.resetSearchConditions();
- this.$refs.popup.open();
- },
-
- search() {
- this.getRepairRecordList();
- },
-
- repairStatusChange(e) {
- const index = e.detail.value;
- if (index == 0) {
- this.HRepairStatus = ''; // 鍏ㄩ儴
- } else {
- this.HRepairStatus = this.repairStatusOptions[index];
- }
- },
-
- clickCard(record, index) {
- // 鍙戦�侀�夋嫨瀹屾垚浜嬩欢
- uni.$emit('RepairRecordSelectComplete', {
- HInterID: record["hmainid"],
- HEntryID: record["hsubid"] || record["HEntryID"] || 0,
- HBillNo: record["鍗曟嵁鍙�"] || record["HBillNo"] || "",
- HMouldID: record['HMouldID'] || this.HMouldID || 0,
- HMouldName: record['浜у搧妯″叿'],
- HMouldCode: record['浜у搧妯″叿浠g爜'],
- HMouldSpec: record['妯″叿瑙勬牸'],
- HMouldModel: record['妯″叿鍨嬪彿']
- });
- },
-
- getsWhere() {
- let sWhere = '';
-
- // 鏃ユ湡鑼冨洿鏉′欢 - 涓庢晠闅滅櫥璁板崟淇濇寔涓�鑷�
- if (this.HBeginDate && this.HEndDate) {
- sWhere += ` and (CONVERT(varchar(100),鏃ユ湡, 23) between '${this.HBeginDate}' and '${this.HEndDate}') `;
- }
- // 妯″叿ID鏉′欢 - 濡傛灉浼犲叆浜嗘ā鍏稩D
- if (this.HMouldID) {
- sWhere += ` and HMouldID = ${this.HMouldID} `;
- }
- // 妯″叿缂栫爜鏉′欢
- if (this.HNumber) {
- sWhere += ` and (浜у搧妯″叿浠g爜 like '%${this.HNumber}%' `;
- }
- // 妯″叿鍚嶇О鏉′欢
- if (this.HName) {
- sWhere += ` and (浜у搧妯″叿 like '%${this.HName}%' `;
- }
- // 鍗曟嵁鍙锋潯浠�
- if (this.HBillNo) {
- sWhere += ` and (鍗曟嵁鍙� like '%${this.HBillNo}%' `;
- }
- return sWhere;
- },
-
- getRepairRecordList() {
- this.HRepairRecordList = [];
- this.length = 0;
- this.page = 0;
- this.curPage = 1;
-
- // 璋冪敤缁翠慨璁板綍鍒楄〃鎺ュ彛
- CommonUtils.doRequest(
- "/Sb_MouldRepairWorkBill/GetMouldRepairWorkBill_PDA", { // 璇锋牴鎹疄闄呮儏鍐佃皟鏁存帴鍙h矾寰�
- sWhere: this.getsWhere(),
- user: getUserInfo()["Czymc"]
- },
- (res) => {
- let {
- data,
- count,
- Message
- } = res.data;
- if (count == 1) {
- this.length = Array.from(data).length;
- const result = [];
- for (let i = 0; i < data.length; i += this.size) {
- result.push(data.slice(i, i + this.size));
- }
- this.HRepairRecordList = result;
- this.page = result.length;
- setTimeout(() => {
- this.enablefocus = true;
- }, 500);
- } else {
- setTimeout(() => {
- this.enablefocus = true;
- }, 500);
- uni.showToast({
- icon: 'none',
- title: Message || '鏆傛棤缁翠慨璁板綍鏁版嵁'
- });
- }
- },
- (err) => {
- setTimeout(() => {
- this.enablefocus = true;
- }, 500);
- uni.showToast({
- icon: 'none',
- title: '鍔犺浇澶辫触: ' + (err.message || '鏈煡閿欒')
- });
- }
- );
- }
- }
- }
+ import dayjs from 'dayjs';
+ import {
+ CommonUtils
+ } from '../../utils/common';
+ import {
+ getUserInfo
+ } from '../../utils/auth';
+ export default {
+ name: "RepairRecordPopup",
+ data() {
+ return {
+ dayjs: dayjs,
+ enablefocus: false,
+ size: 20,
+ curPage: 1,
+ length: 0,
+ page: 0,
+ HMouldID: 0, // 褰撳墠閫夋嫨鐨勬ā鍏稩D
+ HRepairRecordList: [],
+
+ // 鎼滅储鏉′欢 - 涓庢晠闅滅櫥璁板崟淇濇寔涓�鑷�
+ HBeginDate: dayjs(new Date()).subtract(30, 'd').format("YYYY-MM-DD"),
+ HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
+ HNumber: '',
+ HName: '',
+ HBillNo: '',
+
+ };
+ },
+ props: {
+ HBillType: {
+ type: [String, Number],
+ required: true
+ },
+ HStockOrgID: {
+ type: [String, Number],
+ required: true
+ },
+ // 鏂板涓�涓槸鍚︽樉绀烘ā鍏蜂俊鎭殑鍙傛暟
+ showMouldInfo: {
+ type: Boolean,
+ default: true
+ }
+ },
+ methods: {
+ popupChangeHandler(e) {
+ if (e.show === true) {
+ this.getRepairRecordList()
+ }
+ },
+ async exit() {
+ this.resetSearchConditions();
+ await this.$nextTick();
+ this.$refs.popup.close();
+ },
+
+ resetSearchConditions() {
+ this.size = 20;
+ this.curPage = 1;
+ this.length = 0;
+ this.page = 0;
+ this.HRepairRecordList = [];
+ this.enablefocus = false;
+
+ // 閲嶇疆鎼滅储鏉′欢
+ this.HBeginDate = dayjs(new Date()).subtract(30, 'd').format("YYYY-MM-DD");
+ this.HEndDate = dayjs(new Date()).format("YYYY-MM-DD");
+ this.HNumber = '';
+ this.HName = '';
+ this.HBillNo = '';
+ this.HRepairNo = '';
+ this.HRepairContent = '';
+ this.HRepairStatus = '';
+ },
+
+ showPopup(HMouldID) {
+ this.HMouldID = HMouldID || 0;
+ this.resetSearchConditions();
+ this.$refs.popup.open();
+ },
+
+ search() {
+ this.getRepairRecordList();
+ },
+
+ repairStatusChange(e) {
+ const index = e.detail.value;
+ if (index == 0) {
+ this.HRepairStatus = ''; // 鍏ㄩ儴
+ } else {
+ this.HRepairStatus = this.repairStatusOptions[index];
+ }
+ },
+
+ clickCard(record, index) {
+ // 鍙戦�侀�夋嫨瀹屾垚浜嬩欢
+ uni.$emit('RepairRecordSelectComplete', {
+ HInterID: record["hmainid"],
+ HEntryID: record["hsubid"] || record["HEntryID"] || 0,
+ HBillNo: record["鍗曟嵁鍙�"] || record["HBillNo"] || "",
+ HMouldID: record['HMouldID'] || this.HMouldID || 0,
+ HMouldName: record['浜у搧妯″叿'],
+ HMouldCode: record['浜у搧妯″叿浠g爜'],
+ HMouldSpec: record['妯″叿瑙勬牸'],
+ HMouldModel: record['妯″叿鍨嬪彿']
+ });
+ },
+
+ getsWhere() {
+ let sWhere = '';
+
+ // 鏃ユ湡鑼冨洿鏉′欢 - 涓庢晠闅滅櫥璁板崟淇濇寔涓�鑷�
+ if (this.HBeginDate && this.HEndDate) {
+ sWhere += ` and (CONVERT(varchar(100),鏃ユ湡, 23) between '${this.HBeginDate}' and '${this.HEndDate}') `;
+ }
+ // 妯″叿ID鏉′欢 - 濡傛灉浼犲叆浜嗘ā鍏稩D
+ if (this.HMouldID) {
+ sWhere += ` and HMouldID = ${this.HMouldID} `;
+ }
+ // 妯″叿缂栫爜鏉′欢
+ if (this.HNumber) {
+ sWhere += ` and (浜у搧妯″叿浠g爜 like '%${this.HNumber}%' `;
+ }
+ // 妯″叿鍚嶇О鏉′欢
+ if (this.HName) {
+ sWhere += ` and (浜у搧妯″叿 like '%${this.HName}%' `;
+ }
+ // 鍗曟嵁鍙锋潯浠�
+ if (this.HBillNo) {
+ sWhere += ` and (鍗曟嵁鍙� like '%${this.HBillNo}%' `;
+ }
+ sWhere += ` and isnull(缁翠慨浜�,'')!='${uni.getStorageSync('HUserName')}$' `
+ sWhere += ` and isnull(鍏抽棴浜�,'')!='' `
+ return sWhere;
+ },
+
+ getRepairRecordList() {
+ this.HRepairRecordList = [];
+ this.length = 0;
+ this.page = 0;
+ this.curPage = 1;
+
+ // 璋冪敤缁翠慨璁板綍鍒楄〃鎺ュ彛
+ CommonUtils.doRequest(
+ "/Sb_MouldRepairWorkBill/GetMouldRepairWorkBill_PDA", { // 璇锋牴鎹疄闄呮儏鍐佃皟鏁存帴鍙h矾寰�
+ sWhere: this.getsWhere(),
+ user: getUserInfo()["Czymc"]
+ },
+ (res) => {
+ let {
+ data,
+ count,
+ Message
+ } = res.data;
+ if (count == 1) {
+ this.length = Array.from(data).length;
+ const result = [];
+ for (let i = 0; i < data.length; i += this.size) {
+ result.push(data.slice(i, i + this.size));
+ }
+ this.HRepairRecordList = result;
+ this.page = result.length;
+ setTimeout(() => {
+ this.enablefocus = true;
+ }, 500);
+ } else {
+ setTimeout(() => {
+ this.enablefocus = true;
+ }, 500);
+ uni.showToast({
+ icon: 'none',
+ title: Message || '鏆傛棤缁翠慨璁板綍鏁版嵁'
+ });
+ }
+ },
+ (err) => {
+ setTimeout(() => {
+ this.enablefocus = true;
+ }, 500);
+ uni.showToast({
+ icon: 'none',
+ title: '鍔犺浇澶辫触: ' + (err.message || '鏈煡閿欒')
+ });
+ }
+ );
+ }
+ }
+ }
</script>
<style lang="scss">
- .content {
- box-sizing: border-box;
- border-radius: 15rpx 15rpx 0 0;
- padding: 20rpx 20rpx 40rpx 20rpx;
- background-color: #fff;
- display: flex;
- flex-direction: column;
- gap: 10rpx;
+ .content {
+ box-sizing: border-box;
+ border-radius: 15rpx 15rpx 0 0;
+ padding: 20rpx 20rpx 40rpx 20rpx;
+ background-color: #fff;
+ display: flex;
+ flex-direction: column;
+ gap: 10rpx;
- .search-condition {
- display: flex;
- flex-direction: row;
- align-items: center;
- gap: 20rpx;
- font-size: 30rpx;
+ .search-condition {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ gap: 20rpx;
+ font-size: 30rpx;
- .title {
- width: 5rem;
- text-align: right;
- }
+ .title {
+ width: 5rem;
+ text-align: right;
+ }
- .right {
- flex: 1;
- border-radius: 22rpx;
- border: 1px solid #acacac;
- height: auto;
- padding: 8rpx 16rpx;
+ .right {
+ flex: 1;
+ border-radius: 22rpx;
+ border: 1px solid #acacac;
+ height: auto;
+ padding: 8rpx 16rpx;
- input {
- width: 100%;
- font-size: 30rpx;
- }
-
- picker {
- width: 100%;
- font-size: 30rpx;
- line-height: 1.5;
- }
- }
- }
+ input {
+ width: 100%;
+ font-size: 30rpx;
+ }
- .buttons {
- display: flex;
- flex-direction: row;
- gap: 20rpx;
- justify-content: flex-end;
+ picker {
+ width: 100%;
+ font-size: 30rpx;
+ line-height: 1.5;
+ }
+ }
+ }
- >button {
- display: inline-flex;
- width: 4rem;
- }
- }
+ .buttons {
+ display: flex;
+ flex-direction: row;
+ gap: 20rpx;
+ justify-content: flex-end;
- .options-wrapper {
- padding: 20rpx;
- display: grid;
- grid-template-columns: repeat(1, 1fr);
- gap: 20rpx;
+ >button {
+ display: inline-flex;
+ width: 4rem;
+ }
+ }
- >view {
- margin: 0 !important;
- box-sizing: border-box;
+ .options-wrapper {
+ padding: 20rpx;
+ display: grid;
+ grid-template-columns: repeat(1, 1fr);
+ gap: 20rpx;
- }
+ >view {
+ margin: 0 !important;
+ box-sizing: border-box;
- .item {
- .left {
- display: inline-block;
- width: 6rem;
- font-size: 26rpx;
- color: #666;
- }
+ }
- .right {
- display: inline-block;
- font-size: 28rpx;
- color: #333;
- word-break: break-all;
- }
- }
- }
+ .item {
+ .left {
+ display: inline-block;
+ width: 6rem;
+ font-size: 26rpx;
+ color: #666;
+ }
- .uni-card--is-active {
- background-color: rgba(0, 122, 255, 0.2);
- }
+ .right {
+ display: inline-block;
+ font-size: 28rpx;
+ color: #333;
+ word-break: break-all;
+ }
+ }
+ }
- .daterange {
- display: flex;
- flex-direction: row;
- gap: 10rpx;
- justify-content: center;
- align-items: center;
+ .uni-card--is-active {
+ background-color: rgba(0, 122, 255, 0.2);
+ }
- }
-
- .over {
- text-align: center;
- padding: 100rpx 0;
- color: #999;
- font-size: 28rpx;
- }
- }
+ .daterange {
+ display: flex;
+ flex-direction: row;
+ gap: 10rpx;
+ justify-content: center;
+ align-items: center;
+
+ }
+
+ .over {
+ text-align: center;
+ padding: 100rpx 0;
+ color: #999;
+ font-size: 28rpx;
+ }
+ }
</style>
\ No newline at end of file
diff --git a/components/BillListPopup/BillListPopupEquipConkBookBill.vue b/components/BillListPopup/BillListPopupEquipConkBookBill.vue
new file mode 100644
index 0000000..2d28518
--- /dev/null
+++ b/components/BillListPopup/BillListPopupEquipConkBookBill.vue
@@ -0,0 +1,398 @@
+<template>
+ <view>
+ <uni-popup ref="popup" type="bottom" @change="popupChangeHandler">
+ <view class="content">
+ <view class="search-condition">
+ <view class="title"><text>鏃ユ湡: </text></view>
+ <view class="daterange" style="flex: 1;">
+ <view class="right general">
+ <uni-datetime-picker type="date" :clear-icon="false" v-model="HBeginDate">
+ <view>{{HBeginDate}}</view>
+ </uni-datetime-picker>
+ </view>
+ <view>鈥�</view>
+ <view class="right general">
+ <uni-datetime-picker type="date" :clear-icon="false" v-model="HEndDate">
+ <view>{{HEndDate}}</view>
+ </uni-datetime-picker>
+ </view>
+ </view>
+ </view>
+ <view class="search-condition">
+ <view class="title"><text>璁惧浠g爜: </text></view>
+ <view class="right"><input type="text" :focus="enablefocus" v-model="HNumber"
+ @confirm="getBillList" /></view>
+ </view>
+ <view class="search-condition">
+ <view class="title"><text>璁惧鍚嶇О: </text></view>
+ <view class="right"><input type="text" v-model="HName" @confirm="getBillList" /></view>
+ </view>
+ <view class="search-condition">
+ <view class="title"><text>鍗曟嵁鍙�: </text></view>
+ <view class="right"><input type="text" v-model="HBillNo" @confirm="getBillList" /></view>
+ </view>
+ <view class="buttons">
+ <view style="flex: 1;"></view>
+ <button size="mini" type="primary" @click="search">鎼滅储</button>
+ <button v-if="MultiSourceBill" size="mini" type="primary" @click="ret">杩斿洖</button>
+ <button size="mini" type="primary" @click="exit">閫�鍑�</button>
+ </view>
+ <scroll-view id="#BillListPanel" scroll-y="true" style="height: 55vh;">
+ <view class="options-wrapper" v-show="HBillList.length != 0">
+ <uni-card :is-active="bill.isActive" :class="bill.isActive?'uni-card--is-active':''"
+ v-for="(bill, index) in HBillList[curPage-1]" :key="index" :title="bill['鍗曟嵁鍙�']"
+ @tap="clickCard(bill, index)">
+ <view class="item">
+ <view class="left">鏃ユ湡: </view>
+ <view class="right">{{dayjs(bill['鏃ユ湡']).format('YYYY-MM-DD')}}</view>
+ </view>
+ <view class="item" v-if="bill['璁惧浠g爜']">
+ <view class="left">璁惧浠g爜: </view>
+ <view class="right">{{bill['璁惧浠g爜']}}</view>
+ </view>
+ <view class="item" v-if="bill['璁惧鍚嶇О']">
+ <view class="left">璁惧鍚嶇О: </view>
+ <view class="right">{{bill['璁惧鍚嶇О']}}</view>
+ </view>
+ <view class="item" v-if="bill['鍙戠幇浜�']">
+ <view class="left">鍙戠幇浜�: </view>
+ <view class="right">{{bill['鍙戠幇浜�']}}</view>
+ </view>
+ <view class="item" v-if="bill['缁翠慨浜�']">
+ <view class="left">缁翠慨浜�: </view>
+ <view class="right">{{bill['缁翠慨浜�']}}</view>
+ </view>
+ <view class="item" v-if="bill['璐熻矗浜�']">
+ <view class="left">璐熻矗浜�: </view>
+ <view class="right">{{bill['璐熻矗浜�']}}</view>
+ </view>
+ <view class="item" v-if="bill['鏁呴殰绫诲埆']">
+ <view class="left">鏁呴殰绫诲埆: </view>
+ <view class="right">{{bill['鏁呴殰绫诲埆']}}</view>
+ </view>
+ <view class="item" v-if="bill['缁翠慨椤圭洰']">
+ <view class="left">缁翠慨椤圭洰: </view>
+ <view class="right">{{bill['缁翠慨椤圭洰']}}</view>
+ </view>
+ <view class="item" v-if="bill['鏁呴殰鍙戠敓鏃ユ湡']">
+ <view class="left">鏁呴殰鍙戠敓鏃ユ湡: </view>
+ <view class="right">{{dayjs(bill['鍙戠敓鏃ユ湡']).format('YYYY-MM-DD')}}</view>
+ </view>
+ </uni-card>
+ </view>
+ <view class="over" v-show="HBillList.length == 0">鏆傛棤鏁版嵁</view>
+ </scroll-view>
+ <uni-pagination id="#pagination" title="鏍囬鏂囧瓧" v-model="curPage" :pageSize="size"
+ :total="length"></uni-pagination>
+ </view>
+
+ </uni-popup>
+ </view>
+</template>
+
+<script>
+ import dayjs from 'dayjs';
+ import {
+ CommonUtils
+ } from '../../utils/common';
+ import {
+ getUserInfo
+ } from '../../utils/auth';
+ export default {
+ name: "BillListPopup",
+ data() {
+ return {
+ dayjs: dayjs,
+ enablefocus: false,
+ size: 20,
+ curPage: 1,
+ length: 0,
+ page: 0,
+ HSourceBillNo: '',
+ HMater: '',
+ HCustom: '',
+ HBillList: [],
+ panelHeight: 0,
+ HBeginDate: dayjs(new Date()).subtract(30, 'd').format("YYYY-MM-DD"),
+ HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
+ HNumber: '',
+ HName: '',
+ HBillNo: '',
+
+ multiSouceBillList: []
+ };
+ },
+ props: {
+ HBillType: {
+ type: [String, Number],
+ required: true
+ },
+ HSourceBillType: {
+ type: [String, Number],
+ required: true
+ },
+ HStockOrgID: {
+ type: [String, Number],
+ required: true
+ },
+ MultiSourceBill: {
+ type: Boolean,
+ default: false,
+ required: false
+ }
+ },
+ model: {
+ prop: "HSourceBill",
+ event: 'change'
+ },
+ methods: {
+ popupChangeHandler(e) {
+ if (e.show === true) {
+ this.getBillList()
+ }
+ },
+ async exit() {
+ this.size = 20
+ this.curPage = 1
+ this.length = 0
+ this.page = 0
+ this.HSourceBillNo = ''
+ this.HMater = ''
+ this.HCustom = ''
+ this.HBillList = []
+ this.enablefocus = false
+ this.multiSouceBillList = []
+ // 闇�瑕佺瓑寰呴〉闈㈠唴鐨勬暟鎹祴鍊煎畬姣�
+ await this.$nextTick()
+ this.$refs.popup.close();
+ },
+ search() {
+ this.getBillList()
+ },
+ ret() {
+ console.log('this.MultiSourceBill: ', this.MultiSourceBill);
+ uni.$emit('BillSelectComplete', {
+ HInterID: 0,
+ HBillNo: 0,
+ enableMultiSourceBill: this.MultiSourceBill,
+ MultiSourceBillList: this.multiSouceBillList
+ })
+ },
+ showPopup() {
+ this.$refs.popup.open();
+ },
+ clickCard(bill, index) {
+ if (this.MultiSourceBill == false) { // 闈炲婧愬崟妯″紡
+ uni.$emit('BillSelectComplete', {
+ HInterID: bill["hmainid"],
+ HEntryID: bill["hsubid"],
+ HBillNo: bill["鍗曟嵁鍙�"],
+ HEquipID: bill["HEquipID"],
+ HEquipNumber: bill['璁惧浠g爜'],
+ HEquipName: bill['璁惧鍚嶇О'],
+ HEquipSpec: bill['妯″叿瑙勬牸'],
+ HEquipModel: bill['妯″叿鍨嬪彿'],
+ enableMultiSourceBill: this.MultiSourceBill
+ })
+ } else {
+ this.$set(this.HBillList[this.curPage - 1][index], 'isActive', !this.HBillList[this.curPage - 1][
+ index
+ ]['isActive'])
+ console.log(this.HBillList[this.curPage - 1][index])
+ // 璁剧疆浜嗗婧愬崟妯″紡
+ this.setMultiSourceBillList({
+ HInterID: interid,
+ HBillNo: billno,
+ HIsActive: this.HBillList[this.curPage - 1][index]['isActive']
+ })
+ }
+
+ // this.exit()
+ },
+ setMultiSourceBillList(billInfo) {
+ let index = this.multiSouceBillList.findIndex(item => item.HInterID == billInfo.HInterID)
+ if (index == -1) {
+ billInfo['count'] = 1
+ this.multiSouceBillList.push(billInfo)
+ } else {
+ if (billInfo.HIsActive) {
+ // 濡傛灉瀵瑰簲鍗曟嵁浼犲叆鐨勬槸鍚︽縺娲绘暟鏄痶rue锛屽垯璁℃暟鍣�+1
+ this.multiSouceBillList[index]['count']++;
+ } else {
+ // 濡傛灉瀵瑰簲鍗曟嵁浼犲叆鐨勬槸鍚︽縺娲绘暟鏄痜alse锛屽垯璁℃暟鍣�-1
+ this.multiSouceBillList[index]['count']--;
+ }
+ if (this.multiSouceBillList[index]['count'] == 0) {
+ // 娌℃湁閫変腑鐨勫崟鎹紝鍒欑Щ闄ょ紦瀛樹腑鐨勬暟鎹�
+ this.multiSouceBillList.splice(index, 1)
+ }
+ }
+ console.log('this.multiSouceBillList: ', this.multiSouceBillList);
+ },
+ getsWhere() {
+ let sWhere = ''
+ if (this.HBeginDate && this.HEndDate) {
+ sWhere += ` and CONVERT(varchar(100),鏃ユ湡, 23) between '${this.HBeginDate}' and '${this.HEndDate}'`
+ }
+
+
+ if (this.HNumber) {
+ sWhere += ` and 璁惧浠g爜 like '%${this.HNumber}%'`
+ }
+
+ if (this.HName) {
+ sWhere += ` and 璁惧鍚嶇О like '%${this.HName}%'`
+ }
+
+ if (this.HBillNo) {
+ sWhere += ` and 鍗曟嵁鍙� like '%${this.HBillNo}%'`
+ }
+ if (this.HSourceBillType === '璁惧缁翠慨璁板綍鍗�') {
+ sWhere += ` and isnull(缁翠慨浜�,'')!='${uni.getStorageSync('HUserName')}$' `
+ }
+ sWhere += ` and isnull(鍏抽棴浜�,'')!='' `
+
+
+ return sWhere
+ },
+ getBillList() {
+ this.HBillList = []
+ this.length = 0
+ this.page = 0
+ this.curPage = 1
+
+ let type = "GZ"; // 榛樿鏄晠闅滃崟
+
+ if (this.HSourceBillType === '璁惧缁翠慨鐧昏鍗�') {
+ type = "GZ";
+ } else if (this.HSourceBillType === '璁惧缁翠慨娲惧伐鍗�') {
+ type = "PG";
+ } else if (this.HSourceBillType === '璁惧缁翠慨璁板綍鍗�') {
+ type = "WX";
+ }
+
+ CommonUtils.doRequest(
+ "/Web/GetEquipmentBillsList", {
+ sWhere: this.getsWhere(),
+ Type: type,
+ user: getUserInfo()["Czymc"]
+ },
+ (res) => {
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ this.length = Array.from(data).length
+ const result = [];
+ for (let i = 0; i < data.length; i += this.size) {
+ result.push(data.slice(i, i + this.size));
+ }
+ this.HBillList = result
+ this.page = result.length
+ setTimeout(() => {
+ this.enablefocus = true
+ }, 500)
+ } else {
+ setTimeout(() => {
+ this.enablefocus = true
+ }, 500)
+ uni.showToast({
+ icon: 'none',
+ title: Message
+ })
+ }
+ }
+ )
+ },
+ },
+ }
+</script>
+
+<style lang="scss">
+ .content {
+ box-sizing: border-box;
+ border-radius: 15rpx 15rpx 0 0;
+ padding: 20rpx 20rpx 40rpx 20rpx;
+ background-color: #fff;
+ display: flex;
+ flex-direction: column;
+ gap: 10rpx;
+
+ .search-condition {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ gap: 20rpx;
+ font-size: 30rpx;
+
+ .title {
+ width: 5rem;
+ text-align: right;
+ }
+
+ .right {
+ flex: 1;
+ border-radius: 22rpx;
+ border: 1px solid #acacac;
+ height: auto;
+ padding: 8rpx 16rpx;
+
+ input {
+ width: 100%;
+ font-size: 30rpx;
+ }
+ }
+ }
+
+ .buttons {
+ display: flex;
+ flex-direction: row;
+ gap: 20rpx;
+ justify-content: flex-end;
+
+ >button {
+ display: inline-flex;
+ width: 4rem;
+ }
+ }
+
+ .options-wrapper {
+ padding: 20rpx;
+ display: grid;
+ grid-template-columns: repeat(1, 1fr);
+ gap: 20rpx;
+
+ >view {
+ margin: 0 !important;
+ box-sizing: border-box;
+
+ }
+
+ .item {
+ .left {
+ display: inline-block;
+ width: 6rem;
+ }
+
+ .right {
+ display: inline-block;
+ }
+ }
+ }
+
+ .uni-card--is-active {
+ background-color: rgba(0, 122, 255, 0.2);
+ }
+
+ .daterange {
+ display: flex;
+ flex-direction: row;
+ gap: 10rpx;
+ justify-content: center;
+ align-items: center;
+
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/components/BillListPopup/BillListPopupMouldConkBookBill.vue b/components/BillListPopup/BillListPopupMouldConkBookBill.vue
index a7237af..d2ea0f6 100644
--- a/components/BillListPopup/BillListPopupMouldConkBookBill.vue
+++ b/components/BillListPopup/BillListPopupMouldConkBookBill.vue
@@ -246,6 +246,7 @@
if (this.HBillNo) {
sWhere += ` and 鍗曟嵁鍙� like '%${this.HBillNo}%'`
}
+ sWhere += ` and isnull(鍏抽棴浜�,'')!='' `
return sWhere
},
getBillList() {
diff --git a/manifest.json b/manifest.json
index c128efa..8c3381e 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "鏅轰簯LMES",
"appid" : "__UNI__B002F49",
"description" : "",
- "versionName" : "2.0.58",
- "versionCode" : 258,
+ "versionName" : "2.0.60",
+ "versionCode" : 260,
"transformPx" : false,
/* 5+App鐗规湁鐩稿叧 */
"app-plus" : {
diff --git a/pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill.vue b/pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill.vue
index 17ddc2b..647fc59 100644
--- a/pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill.vue
+++ b/pages/MJGL/Sb_EqpMaintenance/Sb_EqpMaintenanceBill.vue
@@ -1,938 +1,986 @@
<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="{
+ <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="date" :clear-icon="false" v-model="hform.HRepairPlanBeginDate">
- <input :value="hform.HRepairBeginDate" />
- </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.HRepairPlanEndDate">
- <input :value="hform.HRepairEndDate" />
- </uni-datetime-picker>
- </view>
- </view>
- <view class="form-item">
- <view class="title">缁翠慨鍐呭:</view>
- <view class="right">
- <textarea v-model="hform.HRepairContent" 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">婧愬崟绫诲瀷:</view>
- <zxz-uni-data-select class="right" :localdata="[
- {key: '璁惧缁翠慨鐧昏鍗�', value: '璁惧缁翠慨鐧昏鍗�'},
- {key: '鎵嬪伐褰曞叆', value: '鎵嬪伐褰曞叆'},
- {key: '璁惧缁翠慨娲惧伐鍗�', value: '璁惧缁翠慨娲惧伐鍗�'},
- ]" dataKey="key" dataValue="value" v-model="hform.HMainSourceBillType">
- </zxz-uni-data-select>
- </view>
- <view class="form-item">
- <view class="title">鏁呴殰鐧昏鍗�:</view>
- <view :class="enableSourceBillEdit?'right':'righton'" >
- <input v-model="hform.HMainSourceBillNo" :disabled="enableSourceBillEdit?false:true"
- @confirm="GetMessageByHMainSourceBillNo(hform.HMainSourceBillNo)"
- placeholder="璇疯緭鍏�(鎴栨壂鎻�)鏁呴殰鐧昏鍗�" />
- </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="right">
- <textarea v-model="hform.HExplanation" placeholder="璇疯緭鍏ョ淮淇姹�" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鏃堕棿鍗曚綅:</view>
- <zxz-uni-data-select class="right" :localdata="[
+ <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="date" :clear-icon="false" v-model="hform.HRepairPlanBeginDate">
+ <input :value="hform.HRepairBeginDate" />
+ </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.HRepairPlanEndDate">
+ <input :value="hform.HRepairEndDate" />
+ </uni-datetime-picker>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">缁翠慨鍐呭:</view>
+ <view class="right">
+ <textarea v-model="hform.HRepairContent" 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">婧愬崟绫诲瀷:</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?false:true"
+ @confirm="GetMessageByHMainSourceBillNo(hform.HMainSourceBillNo)"
+ placeholder="璇疯緭鍏�(鎴栨壂鎻�)婧愬崟鍗曞彿" />
+ </view>
+ <view class="icon-wrapper" v-show="hform.HMainSourceBillType != '鎵嬪伐褰曞叆'"
+ :disabled="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="right">
+ <textarea v-model="hform.HExplanation" placeholder="璇疯緭鍏ョ淮淇姹�" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鏃堕棿鍗曚綅:</view>
+ <zxz-uni-data-select class="right" :localdata="[
{key: '灏忔椂', value: '灏忔椂'},
{key: '澶�', value: '澶�'},
{key: '鏈�', value: '鏈�'},
]" dataKey="key" dataValue="value" v-model="hform.HCycleUnit">
- </zxz-uni-data-select>
- </view>
- <view class="form-item">
- <view class="title">缁翠慨宸ユ椂:</view>
- <view class="right">
- <input type="number" v-model="hform.HTimes" />
- </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>
+ </view>
+ <view class="form-item">
+ <view class="title">缁翠慨宸ユ椂:</view>
+ <view class="right">
+ <input type="number" v-model="hform.HTimes" />
+ </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>
+ </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>
+ </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>
+ </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>
+ </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>
- </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>
- <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="{
+ <!-- 鍏朵粬淇℃伅 -->
+ <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>
+ <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" v-if="operationType!=4" 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>
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <view class="buttons" id="buttons">
+ <button class="btn-a" size="mini" @tap="submit">鎻愪氦</button>
+ <view style="flex: 1;"></view>
+ <button class="btn-a" v-if="operationType!=4" 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> -->
+ <!-- 婧愬崟鍗曟嵁鍒楄〃寮圭獥 -->
+ <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="hform.HBillType"
+ :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID">
+ </BillListPopupEquipConkBookBillVue>
+ </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_EqpMaintenanceBill',
- data() {
- return {
- tabs: 0,
- HMainSourceBillType: "",
- btnTop: 0,
- tabsBottom: 0,
- HModName: "Sb_EqpMaintenanceBill",
- HBillType: '3910',
- operationType: 1,
- uploadOptions: {},
- enableEdit: true,
- enableSourceBillEdit: true,
+ import dayjs from "dayjs";
+ import {
+ CommonUtils
+ } from "@/utils/common";
+ import {
+ MpaasScan
+ } from "@/utils/mpaasScan.js"
+ import {
+ getUserInfo
+ } from "../../../utils/auth";
+ // 寮曞叆婧愬崟鍗曟嵁鍒楄〃寮圭獥缁勪欢
+ import BillListPopupEquipConkBookBillVue from '../../../components/BillListPopup/BillListPopupEquipConkBookBill.vue';
- HDeptList: [],
- HRepairCheckList: [],
- HEmpList: [],
- HRepairList: [],
+ export default {
+ // 璁惧缁翠慨璁板綍鍗�
+ name: 'Sb_EqpMaintenanceBill',
+ components: {
+ BillListPopupEquipConkBookBillVue
+ },
+ data() {
+ return {
+ tabs: 0,
+
+ btnTop: 0,
+ tabsBottom: 0,
+ HModName: "Sb_EqpMaintenanceBill",
+ HBillType: '3910',
+ operationType: 1,
+ uploadOptions: {},
+ enableEdit: true,
+ enableSourceBillEdit: true,
- hform: {
- HBarCode: "",
- HBarCode: '',
- HRepairBeginDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
- HRepairEndDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
- HRepairContent: '',
- HBillNo: '',
- HInterID: 0,
- HDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
- HDeptName: '',
- HDeptID: 0,
- HEmpName: '',
- HEmpID: 0,
- HRepair: '',
- HRepairID: 0,
- HExplanation: '',
- HMainSourceBillType: '璁惧缁翠慨鐧昏鍗�',
- HMainSourceBillNo: '',
- HMainSourceInterID: 0,
- HMainSourceEntryID: 0,
- HManagerName: '',
- HManagerID: 0,
- HTimes: '',
- HCycleUnit: '灏忔椂',
- HBarName: '',
- HNumber: '',
- HEquipID: 0,
- HBarSpec: '',
- HBarModel: '',
- HMaker: getUserInfo()["Czymc"],
- HChecker: '',
- HCloseMan: '',
- HUpDater: '',
- HMakeDate: dayjs(new Date()).format("YYYY-MM-DD"),
- HCheckDate: '',
- HCloseDate: '',
- HUpDateDate: '',
- HDeleteMan: '',
- HDeleteDate: ''
- },
- HDetailList: [{
- "HRepairID": 0,
- "HRepairCode": "",
- "HRepairName": "",
- "HManagerID": 0,
- "HManagerCode": "",
- "HManagerName": "",
- "HRepairExplanation": '',
- "HRemark": "",
- "HEmpID": '',
- "HSourceInterID": 0,
- "HSourceEntryID": 0,
- "HSourceBillNo": ''
- }]
- };
- },
- computed: {
- containerHeight: {
- get() {
- return this.btnTop - this.tabsBottom - 5
- }
- },
- },
- methods: {
- // 缁翠慨椤圭洰
- async getRepairList() {
- try {
- let res = await CommonUtils.doRequest2Async({
- url: '/Gy_Repair/GetRepairList',
- data: {
- sWhere: '',
- user: getUserInfo()["Czymc"]
- }
- })
+ // 婧愬崟绫诲瀷鐩稿叧
+ HMainSourceBillType: "璁惧缁翠慨鐧昏鍗�", // 鐢ㄤ簬鏄剧ず鐨勬簮鍗曠被鍨�
+ arrayHMainSourceBillType: ['璁惧缁翠慨鐧昏鍗�', '鎵嬪伐褰曞叆', '璁惧缁翠慨娲惧伐鍗�'],
+ arrayHMainSourceBillTypeID: ['璁惧缁翠慨鐧昏鍗�', '鎵嬪伐褰曞叆', '璁惧缁翠慨娲惧伐鍗�'], // 瀵瑰簲鐨勫崟鎹被鍨婭D
+ showHMainSourceBillType: true,
- let {
- data,
- count,
- Message
- } = res.data
- if (count == 1) {
- this.HRepairList = data
- } else {
- CommonUtils.showTips({
- title: '娓╅Θ鎻愮ず',
- message: `鑾峰彇妫�楠岄」鐩け璐�: ${Message}`
- })
- }
- } catch (err) {
- CommonUtils.showTips({
- title: '娓╅Θ鎻愮ず',
- message: `鑾峰彇妫�楠岄」鐩け璐�: ${err}`
- })
- }
- },
- // 鍒犻櫎鏄庣粏
- delDetail(item) {
+ HDeptList: [],
+ HRepairCheckList: [],
+ HEmpList: [],
+ HRepairList: [],
- },
- // 鎻愪氦鏁版嵁鏈夋晥鎬ф牎楠�
- 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.HRepairCheckMainID == 0) {
- return {
- Message: "楠岃瘉椤圭洰涓嶅緱涓虹┖!",
- state: false
- }
- }
- if (this.hform.HManagerID == 0) {
- return {
- Message: "璐熻矗浜轰笉寰椾负绌�!",
- state: false
- }
- }
+ hform: {
+ HBillType: '3910',
+ HStockOrgID: uni.getStorageSync("OrganizationID"),
+ HBarCode: "",
+ HBarCode: '',
+ HRepairBeginDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
+ HRepairEndDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
+ HRepairContent: '',
+ HBillNo: '',
+ HInterID: 0,
+ HDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
+ HDeptName: getUserInfo().HDeptName,
+ HDeptID: getUserInfo().HDeptID,
+ HEmpName: getUserInfo().HEmpName,
+ HEmpID: getUserInfo().HEmpID,
+ HRepair: '',
+ HRepairID: 0,
+ HExplanation: '',
+ HMainSourceBillType: '璁惧缁翠慨鐧昏鍗�', // 榛樿涓鸿澶囩淮淇櫥璁板崟
+ HMainSourceBillNo: '',
+ HMainSourceInterID: 0,
+ HMainSourceEntryID: 0,
+ HManagerName: getUserInfo().HManagerName,
+ HManagerID: getUserInfo().HManagerID,
+ HTimes: 0,
+ HCycleUnit: '灏忔椂',
+ HBarName: '',
+ HNumber: '',
+ HEquipID: 0,
+ HBarSpec: '',
+ HBarModel: '',
+ HMaker: getUserInfo()["Czymc"],
+ HChecker: '',
+ HCloseMan: '',
+ HUpDater: '',
+ HMakeDate: dayjs(new Date()).format("YYYY-MM-DD"),
+ HCheckDate: '',
+ HCloseDate: '',
+ HUpDateDate: '',
+ HDeleteMan: '',
+ HDeleteDate: ''
+ },
+ HDetailList: [{
+ "HRepairID": 0,
+ "HRepairCode": "",
+ "HRepairName": "",
+ "HManagerID": 0,
+ "HManagerCode": "",
+ "HManagerName": "",
+ "HRepairExplanation": '',
+ "HRemark": "",
+ "HEmpID": '',
+ "HSourceInterID": 0,
+ "HSourceEntryID": 0,
+ "HSourceBillNo": ''
+ }]
+ };
+ },
+ computed: {
+ containerHeight: {
+ get() {
+ return this.btnTop - this.tabsBottom - 5
+ }
+ },
+ },
+ methods: {
+ // 鏄剧ず婧愬崟鍗曟嵁鍒楄〃寮圭獥
+ showBillList() {
+ this.$refs.billList.showPopup()
+ },
- return {
- Message: "",
- state: true
- }
- },
- addNew() {
- uni.redirectTo({
- url: './Sb_EquipRepairSendWorkBill?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)
- }
- },
- })
+ // 閫夋嫨婧愬崟绫诲瀷
+ HMainSourceBillTypeChange(e) {
+ if (e.detail.value == -1 || e.detail.value == NaN) {
+ this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ this.hform.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ return
+ }
- },
- 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: "",
- }
- })
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[e.detail.value]
+ this.hform.HMainSourceBillType = this.arrayHMainSourceBillTypeID[e.detail.value]
- 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')
- }
- })
+ // 缂撳瓨褰撳墠椤甸潰閫夋嫨
+ const pages = getCurrentPages()
+ const currentPage = pages[pages.length - 1]
+ uni.setStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`, {
+ HSourceBillTypeName: this.HMainSourceBillType,
+ HSourceBillType: this.hform.HMainSourceBillType
+ })
+ },
- 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",
- }
- })
+ // 璇诲彇缂撳瓨
+ 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
+ }
+ },
- 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
- })
- }
- },
- // 鑾峰彇楠岃瘉椤圭洰鏁版嵁
- async getCheckProjList() {
- try {
- let res = await CommonUtils.doRequest2Async({
- url: '/Gy_RepairCheck/GetRepairCheckList',
- data: {
- sWhere: "",
- user: uni.getStorageSync('HUserName'),
- }
- })
+ // 缁翠慨椤圭洰
+ async getRepairList() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Gy_Repair/GetRepairList',
+ data: {
+ sWhere: '',
+ user: getUserInfo()["Czymc"]
+ }
+ })
- let {
- data,
- count,
- Message
- } = res.data
- if (count == 1) {
- this.HRepairCheckList = 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)
- })
- },
- toScanHMainSourceBillNo() {
- MpaasScan.scanCode(cb => {
- this.hfrom.HMainSourceBillNo = cb
- this.GetMessageByHMainSourceBillNo(cb)
- })
- },
- async GetMessageByHMainSourceBillNo(HSouceBillNo) {
- try{
- let res = await CommonUtils.doRequest2Async({
- url: "/Sb_EqpRepairWorkBill/GetEqpConkBookBillListPage",
- data: {
- sWhere: ` and 鍗曟嵁鍙� = '${HSouceBillNo}'`,
- user: getUserInfo()["Czymc"],
- page: 1,
- size: 1,
- }
- })
-
- 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"]
-
- }else {
- CommonUtils.showTips({
- title: "娓╅Θ鎻愮ず",
- message: `鑾峰彇缁翠慨鐧昏鍗曞け璐�: ${Message}`
- })
- }
- }catch(err) {
- CommonUtils.showTips({
- title: "娓╅Θ鎻愮ず",
- message: `鑾峰彇缁翠慨鐧昏鍗曞け璐�: ${err}`
- })
- }
- },
- async GetMessageByBarCode(HBarCode) {
- try {
- let res = await CommonUtils.doRequest2Sync({
- url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_List",
- data: {
- HBarCode: HBarCode,
- },
- })
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ this.HRepairList = 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.HRepairCheckMainID == 0) {
+ return {
+ Message: "缁翠慨椤圭洰涓嶅緱涓虹┖!",
+ state: false
+ }
+ }
+ if (this.hform.HManagerID == 0) {
+ return {
+ Message: "璐熻矗浜轰笉寰椾负绌�!",
+ state: false
+ }
+ }
+ if (this.hform.HMainSourceBillType !== '鎵嬪伐褰曞叆') {
+ if (!this.hform.HMainSourceBillNo || this.hform.HMainSourceBillNo.trim() === '') {
+ CommonUtils.showTips({
+ message: '婧愬崟绫诲瀷闈炴墜宸ュ綍鍏ワ紝蹇呴』閫夋嫨婧愬崟锛�'
+ })
+ return
+ }
+ }
+ return {
+ Message: "",
+ state: true
+ }
+ },
+ addNew() {
+ uni.redirectTo({
+ url: './Sb_EquipRepairSendWorkBill?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
+ })
+ }
+ },
+ // 鑾峰彇楠岃瘉椤圭洰鏁版嵁
+ async getCheckProjList() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Gy_RepairCheck/GetRepairCheckList',
+ data: {
+ sWhere: "",
+ user: uni.getStorageSync('HUserName'),
+ }
+ })
+
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ this.HRepairCheckList = 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)
+ })
+ },
+ toScanHMainSourceBillNo() {
+ MpaasScan.scanCode(cb => {
+ this.hfrom.HMainSourceBillNo = cb
+ this.GetMessageByHMainSourceBillNo(cb)
+ })
+ },
+ async GetMessageByHMainSourceBillNo(HSouceBillNo) {
+ try {
+ // 鏍规嵁婧愬崟绫诲瀷閫夋嫨涓嶅悓鐨勬帴鍙�
+ if (this.hform.HMainSourceBillType === '璁惧缁翠慨鐧昏鍗�') {
+ url = "/Sb_EqpRepairWorkBill/GetEqpConkBookBillListPage";
+ dataField = {
+ sWhere: ` and 鍗曟嵁鍙� = '${HSouceBillNo}'`,
+ user: getUserInfo()["Czymc"],
+ page: 1,
+ size: 1,
+ };
+ } else if (this.hform.HMainSourceBillType === '璁惧缁翠慨娲惧伐鍗�') {
+ url = "/Sb_EquipRepairSendWorkBill/GetEquipRepairSendWorkBillListPage";
+ 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"]
+
+ } else {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: `鑾峰彇婧愬崟鍗曞彿澶辫触: ${Message}`
+ })
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: `鑾峰彇婧愬崟鍗曞彿澶辫触: ${err}`
+ })
+ }
+ },
+ async GetMessageByBarCode(HBarCode) {
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_List",
+ data: {
+ HBarCode: HBarCode,
+ },
+ })
- if (!res) {
- return
- }
+ if (!res) {
+ return
+ }
- let {
- data,
- count,
- Message
- } = res.data
+ 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
+ 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
- })
- }
+ 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
- }
- })
+ } 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
+ 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
+ }
- 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
+ try {
+ let oMain = JSON.stringify(this.hform);
+ this.HDetailList[0].HManagerID = this.hform.HManagerID
+ this.HDetailList[0].HRepairID = this.hform.HRepairID
+ this.HDetailList[0].HRepairExplanation = this.hform.HExplanation
+ this.HDetailList[0].HEmpID = this.hform.HEmpID
+ this.HDetailList[0].HSourceInterID = this.hform.HMainSourceInterID
+ this.HDetailList[0].HSourceEntryID = this.hform.HMainSourceEntryID
+ this.HDetailList[0].HSourceBillNo = this.hform.HMainSourceBillNo
- 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
- }
- })
+ let sSubStr = JSON.stringify(this.HDetailList);
+ let sMainSub = oMain + ';' + sSubStr + `;-1;${this.operationType}` + ';' + getUserInfo()[
+ 'Czymc'];
+ let res = await CommonUtils.doRequest2Sync({
+ url: "/Sb_PDA_EqpRepairWorkBill/SaveGetEqpRepairWorkBillList",
+ data: {
+ "msg": sMainSub
+ },
+ method: "POST"
+ })
- } 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
- }
- })
+ if (!res) {
+ return
+ }
- let {
- count,
- data,
- Message
- } = res.data
- console.log('data: ', data);
- this.hform.HInterID = data[0]["HInterID"]
- 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].HManagerID = this.hform.HManagerID
- this.HDetailList[0].HRepairID = this.hform.HRepairID
- this.HDetailList[0].HRepairExplanation = this.hform.HExplanation
- this.HDetailList[0].HEmpID = this.hform.HEmpID
- this.HDetailList[0].HSourceInterID = this.hform.HMainSourceInterID
- this.HDetailList[0].HSourceEntryID = this.hform.HMainSourceEntryID
- this.HDetailList[0].HSourceBillNo = this.hform.HMainSourceBillNo
-
- let sSubStr = JSON.stringify(this.HDetailList);
- let sMainSub = oMain + ';' + sSubStr + `;-1;${this.operationType}` + ';' + getUserInfo()[
- 'Czymc'];
- let res = await CommonUtils.doRequest2Sync({
- url: "/Sb_PDA_EqpRepairWorkBill/SaveGetEqpRepairWorkBillList",
- data: {
- "msg": sMainSub
- },
- method: "POST"
- })
-
- if (!res) {
- return
- }
-
- let {
- count,
- Message
- } = res.data
- if (count == 1) {
- if(this.operationType == 4) {
- uni.showModal({
- title: '鎻愮ず',
- content: res.data.Message + '銆傚嵆灏嗚繑鍥炰笂绾ч〉闈�',
- showCancel: false,
- success: (res) => {
- if (res.confirm) {
- console.log('鐢ㄦ埛鐐瑰嚮纭畾');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- // uni.redirectTo({
- // url: './Sb_EquipRepairSendWorkBill?operationType=1'
- // })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
- }
- });
- return
- }
- uni.showModal({
- title: '鎻愮ず',
- content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
- success: (res) => {
- if (res.confirm) {
- console.log('鐢ㄦ埛鐐瑰嚮纭畾');
- uni.redirectTo({
- url: './Sb_EquipRepairSendWorkBill?operationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
- }
- });
- } else {
- CommonUtils.showTips({
- title: "娓╅Θ鎻愮ず",
- message: "鎻愪氦鍗曟嵁澶辫触: " + Message
- })
- }
+ let {
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ if (this.operationType == 4) {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傚嵆灏嗚繑鍥炰笂绾ч〉闈�',
+ showCancel: false,
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 50)
+ // uni.redirectTo({
+ // url: './Sb_EquipRepairSendWorkBill?operationType=1'
+ // })
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 50)
+ }
+ }
+ });
+ return
+ }
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: './Sb_EquipRepairSendWorkBill?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 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) {
- 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
- })
- }
- }
- },
- onLoad(e) {
- console.log('e: ', e);
- if (!e.operationType) {
- this.operationType = 1
- } else {
- this.operationType = e.operationType
- }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: "鎻愪氦鍗曟嵁澶辫触: " + err
+ })
+ }
+ },
+ async getEquipFileMain(HInterID) {
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_ListByHEquipID",
+ data: {
+ HEquipID: HInterID,
+ },
+ })
- if (this.operationType == 1) {
- // 鏂板
- this.getMaxNum()
- } else if (this.operationType == 2) {
- // 澶嶅埗
- } else if (this.operationType == 3) {
- // 缂栬緫
- } else if (this.operationType == 4) {
- // 鐢辨姤宸ュ钩鍙版墦寮�
- let HEquipID = e.HEquipID
- this.getMaxNum()
- this.getEquipFileMain(HEquipID)
- }
+ if (!res) {
+ return
+ }
- this.getHDeptList()
- this.getEmpList()
- this.getRepairList()
- },
- 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)
- })
- }
- }
+ 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
+ })
+ }
+ }
+ },
+ 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) {
+ // 缂栬緫
+
+ } else if (this.operationType == 4) {
+ // 鐢辨姤宸ュ钩鍙版墦寮�
+ let HEquipID = e.HEquipID
+ this.getMaxNum()
+ this.getEquipFileMain(HEquipID)
+ }
+
+ this.getHDeptList()
+ this.getEmpList()
+ 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.$refs.billList.exit()
+ })
+ },
+ onUnload() {
+ uni.$off('BillSelectComplete')
+ },
+ 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"
+ @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
diff --git a/pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill.vue b/pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill.vue
index e731c50..46200f5 100644
--- a/pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill.vue
+++ b/pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill.vue
@@ -1,736 +1,834 @@
<template>
- <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="{
+ <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-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 none-border">
- <radio-group @change="radioChange" class="radio_Container">
- <label>
- <view>
- <radio value="OK" :checked="hform.HCheckResult == 'OK'" />
- <text>OK</text>
- </view>
- </label>
- </label>
- <view>
- <radio value="NG" :checked="hform.HCheckResult == 'NG'" />
- <text>NG</text>
- </view>
- </label>
- </radio-group>
- </view>
- </view>
- <view class="form-item">
- <view class="title">楠岃瘉鍐呭:</view>
- <view class="right">
- <textarea v-model="hform.HRepairCheckMainContent" 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="HRepairCheckList" dataKey="缁翠慨楠屾敹椤圭洰"
- dataValue="hitemid" v-model="hform.HRepairCheckMainID">
-
- </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="{
+ <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 none-border">
+ <radio-group @change="radioChange" class="radio_Container">
+ <label>
+ <view>
+ <radio value="OK" :checked="hform.HCheckResult == 'OK'" />
+ <text>OK</text>
+ </view>
+ </label>
+ </label>
+ <view>
+ <radio value="NG" :checked="hform.HCheckResult == 'NG'" />
+ <text>NG</text>
+ </view>
+ </label>
+ </radio-group>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">楠屾敹鍐呭:</view>
+ <view class="right">
+ <textarea v-model="HDetailList[0].HRepairCheckContent" 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">
+ <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">
+ <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>
+ </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>
+ </view>
+ <view class="form-item">
+ <view class="title required">楠屾敹椤圭洰:</view>
+ <zxz-uni-data-select required class="right" :localdata="HRepairCheckList" dataKey="缁翠慨楠屾敹椤圭洰"
+ dataValue="hitemid" v-model="hform.HRepairCheckID">
+ </zxz-uni-data-select>
+ </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>
+ </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>
+ <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>
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <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>
+
+ <!-- 婧愬崟鍗曟嵁鍒楄〃寮圭獥 -->
+ <BillListPopupEquipConkBookBillVue ref="billList" :HBillType="hform.HBillType" :HSourceBillType="'璁惧缁翠慨璁板綍鍗�'"
+ :HStockOrgID="hform.HStockOrgID">
+ </BillListPopupEquipConkBookBillVue>
+ </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_EquipRepairCheckBill',
- data() {
- return {
- tabs: 0,
- HMainSourceBillType: "",
- btnTop: 0,
- tabsBottom: 0,
- HModName: "sb_EquipRepairCheckBill",
- HBillType: '3911',
- operationType: 1,
- uploadOptions: {},
- enableEdit: true,
+ import dayjs from "dayjs";
+ import {
+ CommonUtils
+ } from "@/utils/common";
+ import {
+ MpaasScan
+ } from "@/utils/mpaasScan.js"
+ import {
+ getUserInfo
+ } from "../../../utils/auth";
+ // 寮曞叆婧愬崟鍗曟嵁鍒楄〃寮圭獥缁勪欢
+ import BillListPopupEquipConkBookBillVue from '../../../components/BillListPopup/BillListPopupEquipConkBookBill.vue';
- HDeptList: [],
- HRepairCheckList: [],
- HEmpList: [],
+ export default {
+ name: 'sb_EquipRepairCheckBill',
+ components: {
+ BillListPopupEquipConkBookBillVue
+ },
+ data() {
+ return {
+ tabs: 0,
+ btnTop: 0,
+ tabsBottom: 0,
+ HModName: "sb_EquipRepairCheckBill",
+ HBillType: '3911',
+ operationType: 1,
+ uploadOptions: {},
+ enableEdit: true,
+ enableSourceBillEdit: true, // 鏂板锛氭帶鍒剁淮淇褰曠紪杈戠姸鎬�
- hform: {
- "HBarCode": "",
- "HCheckBeginDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
- "HCheckResult": "OK",
- "HRepairCheckMainContent": "",
- "HBillNo": "",
- "HInterID": 0,
- "HDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
- "HDeptName": getUserInfo().HDeptName,
- "HDeptID": getUserInfo().HDeptID,
- "HEmpName": getUserInfo().HEmpName,
- "HEmpID": getUserInfo().HEmpID,
- "HManagerName": getUserInfo().HManagerName,
- "HManagerID": getUserInfo().HManagerID,
- "HRepairCheckMainName": "",
- "HRepairCheckMainID": 0,
- "HBarName": "",
- "HEquipID": 0,
- "HBarSpec": "",
- "HBarModel": "",
- "HMaker": getUserInfo()["Czymc"],
- "HMakeDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
- "HUpDater": "",
- "HUpDateDate": "",
- "HChecker": "",
- "HCheckDate": "",
- "HDeleteMan": "",
- "HDeleteDate": "",
- "lngBillKey": "",
- "lngBillSubKey": ""
- },
- HBillSub: [{ // 鍚庣鎺ュ彛闇�瑕併�傚惁鍒欐暟鎹笉浼氭樉绀哄湪缂撳瓨涓�
- "HRepairID": 0,
- "HRepairCode": "",
- "HRepairName": "",
- "HManagerID": 0,
- "HManagerCode": "",
- "HManagerName": "",
- "HRepairExplanation": "",
- "HRemark": "",
- "LAY_TABLE_INDEX": 0
- }]
- };
- },
- computed: {
- containerHeight: {
- get() {
- return this.btnTop - this.tabsBottom - 5
- }
- },
- },
- methods: {
- // 鎻愪氦鏁版嵁鏈夋晥鎬ф牎楠�
- 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.HRepairCheckMainID == 0) {
- return {
- Message: "楠岃瘉椤圭洰涓嶅緱涓虹┖!",
- state: false
- }
- }
- if (this.hform.HManagerID == 0) {
- return {
- Message: "璐熻矗浜轰笉寰椾负绌�!",
- state: false
- }
- }
+ HDeptList: [],
+ HRepairCheckList: [],
+ HEmpList: [],
- return {
- Message: "",
- state: true
- }
- },
- addNew() {
- uni.redirectTo({
- url: './Sb_EquipRepairCheckBill?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)
- }
- },
- })
+ hform: {
+ "HBillType": '3911',
+ "HBarCode": "",
+ "HCheckBeginDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
+ "HCheckResult": "OK",
+ "HRepairCheckContent": "",
+ "HBillNo": "",
+ "HInterID": 0,
+ "HDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
+ "HDeptName": getUserInfo().HDeptName,
+ "HDeptID": getUserInfo().HDeptID,
+ "HEmpName": getUserInfo().HEmpName,
+ "HEmpID": getUserInfo().HEmpID,
+ "HManagerName": getUserInfo().HManagerName,
+ "HManagerID": getUserInfo().HManagerID,
+ "HRepairCheckMainName": "",
+ "HRepairCheckID": 0,
+ "HBarName": "",
+ "HEquipID": 0,
+ "HBarSpec": "",
+ "HBarModel": "",
+ "HMaker": getUserInfo()["Czymc"],
+ "HMakeDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
+ "HUpDater": "",
+ "HUpDateDate": "",
+ "HChecker": "",
+ "HCheckDate": "",
+ "HDeleteMan": "",
+ "HDeleteDate": "",
+ "lngBillKey": "",
+ "lngBillSubKey": "",
+ // 鏂板锛氱淮淇褰曪紙婧愬崟锛夌浉鍏冲瓧娈�
+ "HMainSourceBillNo": "",
+ "HMainSourceInterID": 0,
+ "HMainSourceEntryID": 0,
+ "HMouldRepairWorkName":"",
+ "HMouldRepairWorkID":0,
+ "HStockOrgID": uni.getStorageSync("OrganizationID"),
+ },
+ HDetailList: [{ // 鍚庣鎺ュ彛鎻愪氦闇�瑕� 鏄庣粏淇℃伅
+ "HRepairCheckID": 0,
+ "HRepairCode": "",
+ "HRepairName": "",
+ "HManagerID": 0,
+ "HManagerCode": "",
+ "HManagerName": "",
+ "HRepairCheckContent": "",
+ "HRemark": "",
+ "LAY_TABLE_INDEX": 0
+ }]
+ };
+ },
+ computed: {
+ containerHeight: {
+ get() {
+ return this.btnTop - this.tabsBottom - 5
+ }
+ },
+ },
+ methods: {
+ // 鏄剧ず婧愬崟鍗曟嵁鍒楄〃寮圭獥
+ showBillList() {
+ this.$refs.billList.showPopup();
+ },
- },
- 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: "",
- }
- })
+ // 鎵弿缁翠慨璁板綍鍗曞彿
+ toScanHMainSourceBillNo() {
+ MpaasScan.scanCode(cb => {
+ this.hform.HMainSourceBillNo = cb;
+ this.GetMessageByHMainSourceBillNo(cb);
+ });
+ },
- 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')
- }
- })
+ // 鏍规嵁缁翠慨璁板綍鍗曞彿鑾峰彇淇℃伅
+ async GetMessageByHMainSourceBillNo(HSouceBillNo) {
+ try {
+ let url = "/Sb_EqpRepairWorkBill/GetEqpRepairWorkBillListPage";
+ let dataField = {
+ sWhere: ` and 鍗曟嵁鍙� = '${HSouceBillNo}'`,
+ user: getUserInfo()["Czymc"],
+ page: 1,
+ size: 1,
+ };
- 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 res = await CommonUtils.doRequest2Async({
+ url: url,
+ data: dataField
+ });
- 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
- })
- }
- },
- // 鑾峰彇楠岃瘉椤圭洰鏁版嵁
- async getCheckProjList() {
- try {
- let res = await CommonUtils.doRequest2Async({
- url: '/Gy_RepairCheck/GetRepairCheckList',
- data: {
- sWhere: "",
- user: uni.getStorageSync('HUserName'),
- }
- })
+ 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"];
- let {
- data,
- count,
- Message
- } = res.data
- if (count == 1) {
- this.HRepairCheckList = 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 (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}`
+ });
+ }
+ },
- if (!res) {
- return
- }
+ // 鏍规嵁璁惧ID鑾峰彇璁惧淇℃伅
+ async getEquipFileMain(HInterID) {
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_ListByHEquipID",
+ data: {
+ HEquipID: HInterID,
+ },
+ });
- let {
- data,
- count,
- Message
- } = res.data
+ if (!res) {
+ return;
+ }
- 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
+ let {
+ data,
+ count,
+ Message
+ } = res.data;
- this.enableEdit = false
- } else {
- CommonUtils.showTips({
- title: "娓╅Θ鎻愮ず",
- message: Message
- })
- }
+ 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
+ });
+ }
+ },
- } 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
- }
- })
+ // 鎻愪氦鏁版嵁鏈夋晥鎬ф牎楠�
+ 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.HRepairCheckID == 0) {
+ return {
+ Message: "楠岃瘉椤圭洰涓嶅緱涓虹┖!",
+ state: false
+ }
+ }
+ if (this.hform.HManagerID == 0) {
+ return {
+ Message: "璐熻矗浜轰笉寰椾负绌�!",
+ state: false
+ }
+ }
+ // 鏂板锛氱淮淇褰曟牎楠�
+ if (!this.hform.HMainSourceBillNo || this.hform.HMainSourceBillNo.trim() === '') {
+ return {
+ Message: "缁翠慨璁板綍涓嶅緱涓虹┖!",
+ state: false
+ }
+ }
- 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
+ return {
+ Message: "",
+ state: true
+ }
+ },
+ addNew() {
+ uni.redirectTo({
+ url: './Sb_EquipRepairCheckBill?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)
+ }
+ },
+ })
- 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
- }
- })
+ },
+ 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: "",
+ }
+ })
- } 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 {
+ 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 {
- count,
- data,
- Message
- } = res.data
- console.log('data: ', data);
- 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
- }
+ 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",
+ }
+ })
- try {
- let oMain = JSON.stringify(this.hform);
- let sSubStr = JSON.stringify(this.HBillSub);
- let sMainSub = oMain + ';' + sSubStr + ';' + getUserInfo()['Czymc'];
- let res = await CommonUtils.doRequest2Sync({
- url: "/Sb_EqpRepairWorkBill/SaveGetEqpRepairCheckBillList",
- data: {
- "msg": sMainSub
- },
- method: "POST"
- })
+ 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
+ })
+ }
+ },
+ // 鑾峰彇楠岃瘉椤圭洰鏁版嵁
+ async getCheckProjList() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Gy_RepairCheck/GetRepairCheckList',
+ data: {
+ sWhere: "",
+ user: uni.getStorageSync('HUserName'),
+ }
+ })
- if (!res) {
- return
- }
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ this.HRepairCheckList = data
+ } else {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: Message
+ })
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: err
+ })
+ }
+ },
+ toScanCode() {
+ MpaasScan.scanCode(cb => {
+ this.hform.HBarCode = cb; // 淇锛氬師鏉ユ槸 hfrom 搴旇鏄� hform
+ this.GetMessageByBarCode(cb)
+ })
+ },
+ async GetMessageByBarCode(HBarCode) {
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_List",
+ data: {
+ HBarCode: HBarCode,
+ },
+ })
- 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: '/pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill?operationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
- }
- });
- } else {
- CommonUtils.showTips({
- title: "娓╅Θ鎻愮ず",
- message: "鎻愪氦鍗曟嵁澶辫触: " + Message
- })
- }
+ if (!res) {
+ return
+ }
+ let {
+ data,
+ count,
+ Message
+ } = res.data
- } 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 (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.HBarCode = HBarCode;
+ this.hform.HQty = 1
- if (this.operationType == 1) {
- // 鏂板
- this.getMaxNum()
- } else if (this.operationType == 2) {
- // 澶嶅埗
- } else if (this.operationType == 3) {
- // 缂栬緫
+ this.enableEdit = false
+ } else {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: Message
+ })
+ }
- } else if (this.operationType == 4) {
- // 娴忚
+ } 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 = 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
+ }
- this.getHDeptList()
- this.getEmpList()
- this.getCheckProjList()
- },
- 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)
- })
- }
- }
+ try {
+ let oMain = JSON.stringify(this.hform);
+ this.HDetailList[0].HManagerID = this.hform.HManagerID
+ this.HDetailList[0].HRepairCheckID = this.hform.HRepairCheckID
+ let sSubStr = JSON.stringify(this.HDetailList);
+ let sMainSub = oMain + ';' + sSubStr + ';' + getUserInfo()['Czymc'];
+ let res = await CommonUtils.doRequest2Sync({
+ url: "/Sb_EqpRepairWorkBill/SaveGetEqpRepairCheckBillList",
+ 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: '/pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill?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
+ })
+ }
+ }
+ },
+ onLoad(e) {
+ console.log('e: ', e);
+ if (!e.operationType) {
+ this.operationType = 1
+ } else {
+ this.operationType = e.operationType
+ }
+
+ if (this.operationType == 1) {
+ // 鏂板
+ this.getMaxNum()
+ this.enableEdit = true;
+ this.enableSourceBillEdit = true;
+ } else if (this.operationType == 2) {
+ // 澶嶅埗
+ } else if (this.operationType == 3) {
+ // 缂栬緫
+ } else if (this.operationType == 4) {
+ // 娴忚
+ this.enableEdit = false;
+ this.enableSourceBillEdit = false;
+ }
+
+ this.getHDeptList()
+ this.getEmpList()
+ this.getCheckProjList()
+
+ // 鐩戝惉鍗曟嵁閫夋嫨瀹屾垚浜嬩欢
+ uni.$on('BillSelectComplete', (e) => {
+ console.log("鎺ユ敹鍒扮殑娑堟伅: ", e)
+ this.hform.HMainSourceInterID = e.HInterID
+ this.hform.HMainSourceBillNo = e.HBillNo
+ this.hform.HMainSourceEntryID = e.HEntryID
+ this.hform.HMouldRepairWorkID = e.HInterID
+ this.hform.HMouldRepairWorkName = e.HBillNo
+ 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)
+ 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"
+ @import "@/pages/MJGL/style/MJBillStyle.scss"
</style>
\ No newline at end of file
diff --git a/pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue b/pages/MJGL/Sb_EquipRepairSendWork/Sb_EquipRepairSendWorkBill.vue
index bfcf397..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: [],
@@ -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
diff --git a/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill.vue b/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill.vue
index 0d5985b..1b6dd86 100644
--- a/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill.vue
+++ b/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill.vue
@@ -1,803 +1,951 @@
<template>
- <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="{
+ <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-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="date" :clear-icon="false" v-model="hform.HRepairBeginDate">
- <input :value="hform.HRepairBeginDate" />
- </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.HRepairEndDate">
- <input :value="hform.HRepairEndDate" />
- </uni-datetime-picker>
- </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">鏃堕棿鍗曚綅:</view>
- <zxz-uni-data-select class="right" :localdata="[
- {key: '灏忔椂', value: '灏忔椂'},
- {key: '澶�', value: '澶�'},
- {key: '鏈�', value: '鏈�'},
- ]" dataKey="key" dataValue="value" v-model="hform.HCycleUnit">
- </zxz-uni-data-select>
- </view>
- <view class="form-item">
- <view class="title required">璁″垝缁翠慨宸ユ椂:</view>
- <view class="right">
- <input type="number" v-model="hform.HPlanTimes" />
- </view>
- </view>
- <view class="form-item">
- <view class="title required">瀹為檯缁翠慨宸ユ椂:</view>
- <view class="right">
- <input type="number" v-model="hform.HTimes" />
- </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">
+ <!-- 鍘熷唴瀹逛繚鎸佷笉鍙� -->
+ <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="date" :clear-icon="false" v-model="hform.HRepairBeginDate">
+ <input :value="hform.HRepairBeginDate" />
+ </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.HRepairEndDate">
+ <input :value="hform.HRepairEndDate" />
+ </uni-datetime-picker>
+ </view>
+ </view>
+ <!-- 鏂板婧愬崟绫诲瀷鍜屾晠闅滅櫥璁板崟閫夋嫨 -->
+ <view class="form-item">
+ <view class="title">婧愬崟绫诲瀷</view>
+ <view class="right" v-show="showHMainSourceBillType">
+ <picker :range="arrayHMainSourceBillType" @change="HMainSourceBillTypeChange">
- </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">
+ <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="right" v-show="hform.HMainSourceBillType != 1">
+ <input type="text" name="HBarCode" v-model="hform.HMainSourceBillNo" />
+ </view>
+ <view class="icon-wrapper" v-show="hform.HMainSourceBillType != 1"
+ :disabled="hform.HMainSourceBillType == -1">
+ <uni-icons type="search" size="20" @click="showBillList"></uni-icons>
+ </view>
+ <view class="righton" v-show="hform.HMainSourceBillType == 1">
+ <input type="text" disabled name="HBarCode" v-model="hform.HMainSourceBillNo" />
+ </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>
- </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">
+ <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">鍣ㄥ叿鍚嶇О:</view>
- <view class="righton">
- <input v-model="hform.HMouldName" disabled />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鍣ㄥ叿瑙勬牸:</view>
- <view class="righton">
- <input v-model="hform.HMouldModel" disabled />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鍣ㄥ叿鍨嬪彿:</view>
- <view class="righton">
- <input v-model="hform.HMouldSpec" disabled />
- </view>
- </view>
- </view>
- </template>
- <!-- 鍏朵粬淇℃伅(闈為噸瑕佷俊鎭�) -->
- <template v-if="tabs == 1">
- <view class="form" :style="{
+ </zxz-uni-data-select>
+ </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>
+ </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>
+ </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>
+ </view>
+ <view class="form-item">
+ <view class="title">鍣ㄥ叿鍚嶇О:</view>
+ <view class="righton">
+ <input v-model="hform.HMouldName" disabled />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鍣ㄥ叿瑙勬牸:</view>
+ <view class="righton">
+ <input v-model="hform.HMouldModel" disabled />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鍣ㄥ叿鍨嬪彿:</view>
+ <view class="righton">
+ <input v-model="hform.HMouldSpec" disabled />
+ </view>
+ </view>
+ </view>
+ </template>
+ <!-- 鍏朵粬淇℃伅(闈為噸瑕佷俊鎭�) -->
+ <template v-if="tabs == 1">
+ <view class="form" :style="{
height: containerHeight + 'px',
overflow: 'auto'
}">
- <view class="form-item">
- <view class="title">渚涘簲鍟�:</view>
- <view class="right">
- <input v-model="hform.HSupID" placeholder="" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">缁翠慨绫诲瀷:</view>
- <zxz-uni-data-select class="right" :localdata="[
- {key: '鍐呴儴缁翠慨', value: '鍐呴儴缁翠慨'},
- {key: '澶栭儴缁翠慨', value: '澶栭儴缁翠慨'},
- ]" dataKey="key" dataValue="value" v-model="hform.HRepairType">
- </zxz-uni-data-select>
- </view>
- <view class="form-item">
- <view class="title">缁翠慨鍚庢柊瑙勬牸:</view>
- <view class="right">
- <input type="number" v-model="hform.HNewModel" placeholder="" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鏂拌璁″鍛�:</view>
- <view class="right">
- <input type="number" v-model="hform.HNewDesignLife" placeholder="" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">璁惧:</view>
- <view class="right">
- <input v-model="hform.HEquipID" placeholder="" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">缁翠慨璐圭敤:</view>
- <view class="right">
- <input type="number" v-model="HDetailList[0].HMoney" placeholder="" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">缁翠慨鍐呭:</view>
- <view class="right">
- <textarea v-model="hform.HRepairContent" placeholder="璇疯緭鍏ョ淮淇唴瀹�" />
- </view>
- </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="right">
- <textarea v-model="hform.HRemark" placeholder="璇疯緭鍏ュ娉�" />
- </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>
+ <view class="form-item">
+ <view class="title">鏃堕棿鍗曚綅:</view>
+ <zxz-uni-data-select class="right" :localdata="[
+ {key: '灏忔椂', value: '灏忔椂'},
+ {key: '澶�', value: '澶�'},
+ {key: '鏈�', value: '鏈�'},
+ ]" dataKey="key" dataValue="value" v-model="hform.HCycleUnit">
+ </zxz-uni-data-select>
+ </view>
+ <view class="form-item">
+ <view class="title">璁″垝缁翠慨宸ユ椂:</view>
+ <view class="right">
+ <input type="number" v-model="hform.HPlanTimes" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">瀹為檯缁翠慨宸ユ椂:</view>
+ <view class="right">
+ <input type="number" v-model="hform.HTimes" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">渚涘簲鍟�:</view>
+ <view class="right">
+ <input v-model="hform.HSupID" placeholder="" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">缁翠慨绫诲瀷:</view>
+ <zxz-uni-data-select class="right" :localdata="[
+ {key: '鍐呴儴缁翠慨', value: '鍐呴儴缁翠慨'},
+ {key: '澶栭儴缁翠慨', value: '澶栭儴缁翠慨'},
+ ]" dataKey="key" dataValue="value" v-model="hform.HRepairType">
+ </zxz-uni-data-select>
+ </view>
+ <view class="form-item">
+ <view class="title">缁翠慨鍚庢柊瑙勬牸:</view>
+ <view class="right">
+ <input type="number" v-model="hform.HNewModel" placeholder="" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鏂拌璁″鍛�:</view>
+ <view class="right">
+ <input type="number" v-model="hform.HNewDesignLife" placeholder="" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">璁惧:</view>
+ <view class="right">
+ <input v-model="hform.HEquipID" placeholder="" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">缁翠慨璐圭敤:</view>
+ <view class="right">
+ <input type="number" v-model="HDetailList[0].HMoney" placeholder="" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">缁翠慨鍐呭:</view>
+ <view class="right">
+ <textarea v-model="hform.HRepairContent" placeholder="璇疯緭鍏ョ淮淇唴瀹�" />
+ </view>
+ </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="right">
+ <textarea v-model="hform.HRemark" placeholder="璇疯緭鍏ュ娉�" />
+ </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>
- </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>
- </view>
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <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>
+
+ <!-- 鏂板寮圭獥缁勪欢 -->
+ <BillListPopupMouldConkBookBillVue ref="billList" :HBillType="hform.HBillType"
+ :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID">
+ </BillListPopupMouldConkBookBillVue>
+ </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: 'Sc_MouldRepairSendWorkBill',
- data() {
- return {
- tabs: 0,
- HMainSourceBillType: "",
- btnTop: 0,
- tabsBottom: 0,
- HModName: "Sc_MouldRepairSendWorkBill",
- HBillType: '3843',
- operationType: 1,
- uploadOptions: {},
- enableEdit: true,
+ import dayjs from "dayjs";
+ import {
+ CommonUtils
+ } from "@/utils/common";
+ import {
+ MpaasScan
+ } from "@/utils/mpaasScan.js"
+ import {
+ getUserInfo
+ } from "../../../utils/auth";
+ // 鏂板寮曞叆缁勪欢
+ import BillListPopupMouldConkBookBillVue from '../../../components/BillListPopup/BillListPopupMouldConkBookBill.vue';
- HDeptList: [],
- HRepairCheckList: [],
- HEmpList: [],
- HRepairList: [],
+ export default {
+ // 鍣ㄥ叿缁翠慨娲惧伐鍗�
+ name: 'Sc_MouldRepairSendWorkBill',
+ components: {
+ BillListPopupMouldConkBookBillVue,
+ },
+ data() {
+ return {
+ tabs: 0,
+ HMainSourceBillType: '妯″叿鏁呴殰鐧昏鍗�', // 鏂板
+ showHMainSourceBillType: true, // 鏂板
+ arrayHMainSourceBillType: ['妯″叿鏁呴殰鐧昏鍗�'], // 鏂板
+ arrayHMainSourceBillTypeID: ['3815'], // 鏂板
+ btnTop: 0,
+ tabsBottom: 0,
+ HModName: "Sc_MouldRepairSendWorkBill",
+ HBillType: '3843',
+ operationType: 1,
+ uploadOptions: {},
+ enableEdit: true,
- hform: {
- "HBarCode": "",
- "HBillNo": "",
- "HInterID": "0",
- "HDate": dayjs(new Date()).format('YYYY-MM-DD'),
- "HInnerBillNo": "",
- "MouldHNumber": "",
- "HMouldID": "0",
- "HRepairIDName": "",
- "HRepairID": "0",
- "HCycleUnit": "灏忔椂",
- "MouldHName": "",
- "MouldHModel": "",
- "HDeptName": getUserInfo()["HDeptName"],
- "HDeptID": getUserInfo()["HDeptID"],
- "HEmpName": getUserInfo().HEmpName,
- "HEmpID": getUserInfo().HEmpID,
- "HManagerName": getUserInfo().HSecManager,
- "HManagerID": getUserInfo().HSecManagerID,
- "HRepairBeginDate": dayjs(new Date()).format('YYYY-MM-DD'),
- "HMainSourceBillType": "",
- "HMainSourceInterID": "0",
- "HMainSourceEntryID": "0",
- "HPlanTimes": "0",
- "HTimes": "0",
- "HRepairEndDate": dayjs(new Date()).format('YYYY-MM-DD'),
- "HMainSourceBillNo": "",
- "HSupIDName": "",
- "HSupID": "0",
- "HRepairType": "鍐呴儴缁翠慨",
- "HNewModel": "0",
- "HOrgID": "",
- "HNewDesignLife": "0",
- "HEquipIDName": "",
- "HEquipID": "0",
- "HRepairContent": "",
- "HExplanation": "",
- "HRemark": "",
- "HMaker": getUserInfo()["Czymc"],
- "HChecker": "",
- "HCloseMan": "",
- "HUpDater": "",
- "HMakeDate": dayjs(new Date()).format('YYYY-MM-DD'),
- "HCheckDate": "",
- "HCloseDate": "",
- "HUpDateDate": "",
- "HDeleteMan": "",
- "HDeleteDate": "",
- HMouldName: "",
- HMouldSpec: "",
- HMouldModel: "",
- },
- HDetailList: [{ // 鍚庣鎺ュ彛鎻愪氦闇�瑕� 鏄庣粏淇℃伅
- "瀛愮淮淇」鐩�": "",
- "HRepairID": 0,
- "瀛愮淮淇」鐩唬鐮�": "",
- "HRepairExplanation": "",
- "瀛愯礋璐d汉浠g爜": "",
- "HManagerID": "",
- "瀛愯礋璐d汉": "",
- "HMoney": 0,
- "HRemark": ""
- }]
- };
- },
- computed: {
- containerHeight: {
- get() {
- return this.btnTop - this.tabsBottom - 5
- }
- },
- },
- methods: {
- // 缁翠慨椤圭洰
- async getRepairList() {
- try {
- let res = await CommonUtils.doRequest2Async({
- url: '/Gy_Repair/GetRepairList',
- data: {
- sWhere: '',
- user: getUserInfo()["Czymc"]
- }
- })
+ HDeptList: [],
+ HRepairCheckList: [],
+ HEmpList: [],
+ HRepairList: [],
- let {
- data,
- count,
- Message
- } = res.data
- if (count == 1) {
- this.HRepairList = data
- } else {
- CommonUtils.showTips({
- title: '娓╅Θ鎻愮ず',
- message: `鑾峰彇妫�楠岄」鐩け璐�: ${Message}`
- })
- }
- } catch (err) {
- CommonUtils.showTips({
- title: '娓╅Θ鎻愮ず',
- message: `鑾峰彇妫�楠岄」鐩け璐�: ${err}`
- })
- }
- },
- // 鍒犻櫎鏄庣粏
- delDetail(item) {
+ hform: {
+ "HBarCode": "",
+ "HBillNo": "",
+ "HInterID": "0",
+ "HDate": dayjs(new Date()).format('YYYY-MM-DD'),
+ "HInnerBillNo": "",
+ "MouldHNumber": "",
+ "HMouldID": "0",
+ "HRepairIDName": "",
+ "HRepairID": "0",
+ "HCycleUnit": "灏忔椂",
+ "MouldHName": "",
+ "MouldHModel": "",
+ "HDeptName": getUserInfo()["HDeptName"],
+ "HDeptID": getUserInfo()["HDeptID"],
+ "HEmpName": getUserInfo().HEmpName,
+ "HEmpID": getUserInfo().HEmpID,
+ "HManagerName": getUserInfo().HSecManager,
+ "HManagerID": getUserInfo().HSecManagerID,
+ "HRepairBeginDate": dayjs(new Date()).format('YYYY-MM-DD'),
+ "HMainSourceBillType": 3815, // 鏂板锛氶粯璁ゆā鍏锋晠闅滅櫥璁板崟
+ "HMainSourceInterID": "0", // 鏂板
+ "HMainSourceEntryID": "0", // 鏂板
+ "HPlanTimes": "0",
+ "HTimes": "0",
+ "HRepairEndDate": dayjs(new Date()).format('YYYY-MM-DD'),
+ "HMainSourceBillNo": "", // 鏂板
+ "HSupIDName": "",
+ "HSupID": "0",
+ "HRepairType": "鍐呴儴缁翠慨",
+ "HNewModel": "0",
+ "HOrgID": "",
+ "HNewDesignLife": "0",
+ "HEquipIDName": "",
+ "HEquipID": "0",
+ "HRepairContent": "",
+ "HExplanation": "",
+ "HRemark": "",
+ "HMaker": getUserInfo()["Czymc"],
+ "HChecker": "",
+ "HCloseMan": "",
+ "HUpDater": "",
+ "HMakeDate": dayjs(new Date()).format('YYYY-MM-DD'),
+ "HCheckDate": "",
+ "HCloseDate": "",
+ "HUpDateDate": "",
+ "HDeleteMan": "",
+ "HDeleteDate": "",
+ HMouldName: "",
+ HMouldSpec: "",
+ HMouldModel: "",
+ "HStockOrgID": uni.getStorageSync("OrganizationID") || "0" // 鏂板
+ },
+ HDetailList: [{ // 鍚庣鎺ュ彛鎻愪氦闇�瑕� 鏄庣粏淇℃伅
+ "瀛愮淮淇」鐩�": "",
+ "HRepairID": 0,
+ "瀛愮淮淇」鐩唬鐮�": "",
+ "HRepairExplanation": "",
+ "瀛愯礋璐d汉浠g爜": "",
+ "HManagerID": "",
+ "瀛愯礋璐d汉": "",
+ "HMoney": 0,
+ "HRemark": ""
+ }]
+ };
+ },
+ computed: {
+ containerHeight: {
+ get() {
+ return this.btnTop - this.tabsBottom - 5
+ }
+ },
+ },
+ methods: {
+ // 鏂板锛氶�夋嫨婧愬崟绫诲瀷
+ HMainSourceBillTypeChange(e) {
+ if (e.detail.value == -1 || e.detail.value == NaN) {
+ this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ this.hform.HMainSourceBillType = -1
+ return
+ }
+ console.log(e.detail.value)
+ console.log(e)
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[e.detail.value]
+ this.hform.HMainSourceBillType = this.arrayHMainSourceBillTypeID[e.detail.value]
- },
- // 鎻愪氦鏁版嵁鏈夋晥鎬ф牎楠�
- ValidCheck() {
- if (this.hform.HMouldID == 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.HRepairCheckMainID == 0) {
- return {
- Message: "楠岃瘉椤圭洰涓嶅緱涓虹┖!",
- state: false
- }
- }
- if (this.hform.HManagerID == 0) {
- return {
- Message: "璐熻矗浜轰笉寰椾负绌�!",
- state: false
- }
- }
- if (this.hform.HPlanTimes == '') {
- return {
- Message: "璁″垝缁翠慨宸ユ椂涓嶅緱涓虹┖!",
- state: false
- }
- }
- if (this.hform.HTimes == '') {
- return {
- Message: "瀹為檯缁翠慨宸ユ椂涓嶅緱涓虹┖!",
- state: false
- }
- }
+ // 缂撳瓨褰撳墠椤甸潰閫夋嫨
+ const pages = getCurrentPages()
+ const currentPage = pages[pages.length - 1]
+ uni.setStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`, {
+ HSourceBillTypeName: this.HMainSourceBillType,
+ HSourceBillType: this.hform.HMainSourceBillType
+ })
+ },
+ // 鏂板锛氭樉绀哄崟鎹垪琛ㄥ脊绐�
+ showBillList() {
+ this.$refs.billList.showPopup()
+ },
- return {
- Message: "",
- state: true
- }
- },
- addNew() {
- uni.redirectTo({
- url: './Sc_MouldRepairSendWorkBill?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
- }
- },
- //鑾峰彇浣跨敤閮ㄩ棬鏁版嵁
- 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')
- }
- })
+ // 鏂板锛氳鍙栫紦瀛�
+ 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
+ }
+ },
- 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",
- }
- })
+ // 缁翠慨椤圭洰
+ async getRepairList() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Gy_Repair/GetRepairList',
+ data: {
+ sWhere: '',
+ user: getUserInfo()["Czymc"]
+ }
+ })
- 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
- })
- }
- },
- // 鑾峰彇楠岃瘉椤圭洰鏁版嵁
- async getCheckProjList() {
- try {
- let res = await CommonUtils.doRequest2Async({
- url: '/Gy_RepairCheck/GetRepairCheckList',
- data: {
- sWhere: "",
- user: uni.getStorageSync('HUserName'),
- }
- })
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ this.HRepairList = data
+ } else {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: `鑾峰彇妫�楠岄」鐩け璐�: ${Message}`
+ })
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: `鑾峰彇妫�楠岄」鐩け璐�: ${err}`
+ })
+ }
+ },
+ // 鍒犻櫎鏄庣粏
+ delDetail(item) {
- let {
- data,
- count,
- Message
- } = res.data
- if (count == 1) {
- this.HRepairCheckList = 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: "/Sc_PDA_MouldRepairCheckBill/txtHBarCode_KeyDown_List",
- data: {
- HBarCode: HBarCode,
- },
- })
+ },
+ // 鎻愪氦鏁版嵁鏈夋晥鎬ф牎楠�
+ ValidCheck() {
+ // 鏂板锛氭鏌ユ晠闅滅櫥璁板崟
+ if (this.hform.HMainSourceBillType != 1 && !this.hform.HMainSourceBillNo) {
+ return {
+ Message: "鏁呴殰鐧昏鍗曚笉寰椾负绌�!",
+ state: false
+ }
+ }
+ if (this.hform.HMouldID == 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.HRepairID == 0) {
+ return {
+ Message: "缁翠慨椤圭洰涓嶅緱涓虹┖!",
+ state: false
+ }
+ }
+ if (this.hform.HManagerID == 0) {
+ return {
+ Message: "涓荤涓嶅緱涓虹┖!",
+ state: false
+ }
+ }
+ if (this.hform.HPlanTimes == '') {
+ return {
+ Message: "璁″垝缁翠慨宸ユ椂涓嶅緱涓虹┖!",
+ state: false
+ }
+ }
+ if (this.hform.HTimes == '') {
+ return {
+ Message: "瀹為檯缁翠慨宸ユ椂涓嶅緱涓虹┖!",
+ state: false
+ }
+ }
- if (!res) {
- return
- }
+ return {
+ Message: "",
+ state: true
+ }
+ },
+ addNew() {
+ uni.redirectTo({
+ url: './Sc_MouldRepairSendWorkBill?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
+ }
+ },
+ //鑾峰彇浣跨敤閮ㄩ棬鏁版嵁
+ 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
+ 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",
+ }
+ })
- if (count == 1) {
- console.log('data: ', data);
- this.hform.HMouldID = data[0].hmainid
- this.hform.HMouldName = data[0].妯″叿鍚嶇О
- this.hform.HMouldSpec = data[0].妯″叿鍝佺被
- this.hform.HMouldModel = data[0].妯″叿鍨嬪彿
- this.hform.HQty = 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
+ })
+ }
+ },
+ // 鑾峰彇楠岃瘉椤圭洰鏁版嵁
+ async getCheckProjList() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Gy_RepairCheck/GetRepairCheckList',
+ data: {
+ sWhere: "",
+ user: uni.getStorageSync('HUserName'),
+ }
+ })
- this.enableEdit = false
- } else {
- CommonUtils.showTips({
- title: "娓╅Θ鎻愮ず",
- message: Message
- })
- }
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ this.HRepairCheckList = data
+ } else {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: Message
+ })
+ }
+ } catch (err) {
+ CommonUtils.showTips({
+ title: '娓╅Θ鎻愮ず',
+ message: err
+ })
+ }
+ },
+ toScanCode() {
+ MpaasScan.scanCode(cb => {
+ this.hform.HBarCode = cb
+ this.GetMessageByBarCode(cb)
+ })
+ },
+ async GetMessageByBarCode(HBarCode) {
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: "/Sc_PDA_MouldRepairCheckBill/txtHBarCode_KeyDown_List",
+ data: {
+ HBarCode: HBarCode,
+ },
+ })
- } 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
- }
- })
+ if (!res) {
+ return
+ }
- 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
+ let {
+ data,
+ count,
+ Message
+ } = res.data
- 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
- }
- })
+ if (count == 1) {
+ console.log('data: ', data);
+ this.hform.HMouldID = data[0].hmainid
+ this.hform.HMouldName = data[0].妯″叿鍚嶇О
+ this.hform.HMouldSpec = data[0].妯″叿鍝佺被
+ this.hform.HMouldModel = data[0].妯″叿鍨嬪彿
+ this.hform.HQty = 1
- } 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
- }
- })
+ this.enableEdit = false
+ } else {
+ CommonUtils.showTips({
+ title: "娓╅Θ鎻愮ず",
+ message: Message
+ })
+ }
- let {
- count,
- data,
- Message
- } = res.data
- console.log('data: ', data);
- this.hform.HInterID = data[0]["HInterID"]
- 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
- }
+ } 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
+ }
+ })
- try {
- let oMain = JSON.stringify(this.hform);
- this.HDetailList[0].HManagerID = this.hform.HManagerID
- this.HDetailList[0].HRepairID = this.hform.HRepairID
- let sSubStr = JSON.stringify(this.HDetailList);
- let sMainSub = oMain + ';' + sSubStr + `;${this.operationType}` + ';' + getUserInfo()[
- 'Czymc'];
- let res = await CommonUtils.doRequest2Sync({
- url: "/Sc_MouldRepairSendWorkBill/AddBill",
- data: {
- "sMainSub": sMainSub
- },
- method: "POST"
- })
+ 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
- if (!res) {
- return
- }
+ 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
+ }
+ })
- 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_EquipRepairSendWorkBill?operationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
- }
- });
- } else {
- CommonUtils.showTips({
- title: "娓╅Θ鎻愮ず",
- message: "鎻愪氦鍗曟嵁澶辫触: " + Message
- })
- }
+ } 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.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
+ }
- } catch (err) {
- CommonUtils.showTips({
- title: "娓╅Θ鎻愮ず",
- message: "鎻愪氦鍗曟嵁澶辫触: " + err
- })
- }
- }
- },
- onLoad(e) {
- console.log('e: ', e);
- if (!e.operationType) {
- this.operationType = 1
- } else {
- this.operationType = e.operationType
- }
+ try {
+ let oMain = JSON.stringify(this.hform);
+ this.HDetailList[0].HManagerID = this.hform.HManagerID
+ this.HDetailList[0].HRepairID = this.hform.HRepairID
+ let sSubStr = JSON.stringify(this.HDetailList);
+ let sMainSub = oMain + ';' + sSubStr + `;${this.operationType}` + ';' + getUserInfo()[
+ 'Czymc'];
+ let res = await CommonUtils.doRequest2Sync({
+ url: "/Sc_MouldRepairSendWorkBill/AddBill",
+ data: {
+ "sMainSub": sMainSub
+ },
+ method: "POST"
+ })
- if (this.operationType == 1) {
- // 鏂板
- this.getMaxNum()
- } else if (this.operationType == 2) {
- // 澶嶅埗
- } else if (this.operationType == 3) {
- // 缂栬緫
+ if (!res) {
+ return
+ }
- } else if (this.operationType == 4) {
- // 娴忚
+ 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: './Sc_MouldRepairSendWorkBill?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
+ })
+ }
+ }
+ },
+ onLoad(e) {
+ console.log('e: ', e);
+ if (!e.operationType) {
+ this.operationType = 1
+ } else {
+ this.operationType = e.operationType
+ }
- this.getHDeptList()
- this.getEmpList()
- this.getCheckProjList()
- this.getRepairList()
- },
- 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)
- })
- }
- }
+ if (this.operationType == 1) {
+ // 鏂板
+ this.getMaxNum()
+ } else if (this.operationType == 2) {
+ // 澶嶅埗
+ } else if (this.operationType == 3) {
+ // 缂栬緫
+
+ } else if (this.operationType == 4) {
+ // 娴忚
+
+ }
+
+ 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.HMouldID = e.HMouldID
+ this.hform.HMouldName = e.HMouldName
+ this.hform.HMouldSpec = e.HMouldSpec
+ this.hform.HMouldModel = e.HMouldModel
+ // 濡傛灉閫夋嫨鍗曟嵁鏃跺甫浜嗘潯鐮侊紝涔熻缃潯鐮�
+ if (e.HBarCode) {
+ this.hform.HBarCode = e.HBarCode
+ }
+ this.$refs.billList.exit()
+ })
+ },
+ onUnload() {
+ uni.$off('BillSelectComplete') // 鏂板锛氱Щ闄や簨浠剁洃鍚�
+ },
+ 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"
+ @import "@/pages/MJGL/style/MJBillStyle.scss";
+
+ .picker-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 1;
+ }
+
+ .icon-wrapper {
+ background-color: #3A78FF;
+ width: 52rpx;
+ height: 52rpx;
+ border-radius: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ .uni-icons {
+ color: #fff !important;
+ }
+ }
+
+ .icon-wrapper[disabled] {
+ background-color: rgba(228, 228, 228, 1);
+ pointer-events: none;
+ touch-action: none;
+ }
+
+ .required {
+ position: relative;
+ }
+
+ .required::after {
+ content: "*";
+ position: relative;
+ color: red;
+ left: 0;
+ top: 0;
+ font-size: inherit;
+ }
</style>
\ No newline at end of file
diff --git a/pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBill.vue b/pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBill.vue
index cf7c276..6d8ca18 100644
--- a/pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBill.vue
+++ b/pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBill.vue
@@ -342,7 +342,7 @@
hform: {
"HBillType": 3807,
"HBarCode": "",
- "HMainSourceBillType": "1",
+ "HMainSourceBillType": 3815,
"HMainSourceBillNo": "",
"HMainSourceInterID": "0",
"HMainSourceEntryID": "0",
diff --git a/pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckBill.vue b/pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckBill.vue
index f134d8e..627130a 100644
--- a/pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckBill.vue
+++ b/pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckBill.vue
@@ -562,8 +562,10 @@
this.hform.HMouldDotCheckRuleNo = data[0].HBillNo
this.hform.HMouldDotCheckRuleID = data[0].HInterID
this.hform.HPlanNo = data[0].鍗曟嵁鍙�
- this.hform.HPlanInterID = (data[0].hmainid == null ? 0 : data[0].hmainid) == "" ? 0 : data[0].hmainid
- this.hform.HPlanEntryID = (data[0].HEntryID == null ? 0 : data[0].HEntryID) == "" ? 0 : data[0].HEntryID
+ this.hform.HPlanInterID = (data[0].hmainid == null ? 0 : data[0].hmainid) == "" ? 0 : data[0]
+ .hmainid
+ this.hform.HPlanEntryID = (data[0].HEntryID == null ? 0 : data[0].HEntryID) == "" ? 0 : data[0]
+ .HEntryID
this.HCheckFileList = Array.from(data).map(item => {
return {
@@ -583,7 +585,7 @@
"HDotCheckResult": item.榛樿缁撹 == 1 ? true : false
}
})
-
+ this.tabs = 1
} else {
CommonUtils.showTips({
title: '娓╅Θ鎻愮ず',
@@ -670,8 +672,10 @@
"HSourceInterID": (item.鐐规璁″垝ID == null ? 0 : item.鐐规璁″垝ID) || 0,
"HSourceEntryID": (item.鐐规璁″垝瀛怚D == null ? 0 : item.鐐规璁″垝瀛怚D) || 0,
"HSourceBillNo": (item.鐐规璁″垝鍗� == null ? '' : item.鐐规璁″垝鍗�) || '',
- "HDotCheckItemClassID": (item.HDotCheckItemClassID == null ? 0 : item.HDotCheckItemClassID) || 0,
- "HDotCheckItemClassName": (item.鐐规椤圭洰鍒嗙被鍚嶇О == null ? '' : item.鐐规椤圭洰鍒嗙被鍚嶇О) ||'',
+ "HDotCheckItemClassID": (item.HDotCheckItemClassID == null ? 0 : item
+ .HDotCheckItemClassID) || 0,
+ "HDotCheckItemClassName": (item.鐐规椤圭洰鍒嗙被鍚嶇О == null ? '' : item.鐐规椤圭洰鍒嗙被鍚嶇О) ||
+ '',
"HDotCheckItemMethodID": (item.鐐规鏂规硶id == null ? 0 : item.鐐规鏂规硶id) || 0,
"HDotCheckItemMethodName": (item.鐐规鏂规硶 == null ? '' : item.鐐规鏂规硶) || '',
"HDotCheckResult": item.榛樿缁撹 == 1 ? true : false
@@ -818,11 +822,11 @@
"HDotCheckItemClassID": item.HDotCheckItemClassID || 0,
"HDotCheckItemClassName": item.鐐规椤圭洰鍒嗙被鍚嶇О || "",
"HDotCheckItemMethodID": item.HDotCheckItemMethodID || 0,
- "HDotCheckItemMethodName": item.鐐规鏂规硶鍚嶇О || "",
+ "HDotCheckItemMethodName": item.鐐规鏂规硶鍚嶇О || "",
"HDotCheckResult": isChecked,
- "HRemark":item.瀛愬娉�2|| ""
+ "HRemark": item.瀛愬娉�2 || ""
};
- });
+ });
} else {
console.log('瀛愯〃鏁版嵁涓虹┖鎴栬幏鍙栧け璐�:', res.data.Message);
this.HCheckFileList = [];
@@ -951,5 +955,5 @@
</script>
<style lang="scss">
- @import "@/pages/MJGL/style/MJBillStyle.scss"
+ @import "@/pages/MJGL/style/MJBillStyle.scss"
</style>
\ No newline at end of file
--
Gitblit v1.9.1