From 396893679ec68e190be3e691e495dce2df69de83 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期四, 15 一月 2026 13:55:38 +0800
Subject: [PATCH] 员工签到记录单
---
pages/index/tab1.vue | 19
pages.json | 15
pages/index/login.vue | 6
pages/EmployeeRecords/EmployeeRecordsBill.vue | 1566 ++++++++++++++++++++++++++++++++++++++++++
pages/index/index.vue | 1
pages/EmployeeRecords/EmployeeRecordsBillList.vue | 558 +++++++++++++++
6 files changed, 2,163 insertions(+), 2 deletions(-)
diff --git a/pages.json b/pages.json
index 6c8cb0b..6e047bd 100644
--- a/pages.json
+++ b/pages.json
@@ -1578,7 +1578,22 @@
{
"navigationBarTitleText" : "妯″叿淇濆吇浠诲姟"
}
+ },
+ {
+ "path" : "pages/EmployeeRecords/EmployeeRecordsBill",
+ "style" :
+ {
+ "navigationBarTitleText" : "鍛樺伐绛惧埌璁板綍琛�"
+ }
+ },
+ {
+ "path" : "pages/EmployeeRecords/EmployeeRecordsBillList",
+ "style" :
+ {
+ "navigationBarTitleText" : "鍛樺伐绛惧埌璁板綍琛ㄥ垪琛�"
+ }
}
+
],
"tabBar": {
diff --git a/pages/EmployeeRecords/EmployeeRecordsBill.vue b/pages/EmployeeRecords/EmployeeRecordsBill.vue
new file mode 100644
index 0000000..e6f179a
--- /dev/null
+++ b/pages/EmployeeRecords/EmployeeRecordsBill.vue
@@ -0,0 +1,1566 @@
+<template>
+ <view class="form">
+ <view class="form-base-info">
+ <view class="form-item">
+ <view class="title">鏉$爜</view>
+ <view class="right">
+ <input type="text" :focus="HBarCodeFocus" v-model="HBarCode"
+ @confirm="GetMeesageByBarCode(HBarCode)" />
+ </view>
+ <view class="right-icon">
+ <uni-icons type="scan"
+ style="background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;" size="20"
+ @click="toScanCode2"></uni-icons>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">瑙掕壊</view>
+ <view class="right">
+ <!-- 澶氶�変笅鎷夋 -->
+ <uni-data-select v-model="hform.HRoles" :multiple="true" :localdata="roleOptions"
+ placeholder="璇烽�夋嫨瑙掕壊" :clear="false" @change="onRoleChange">
+ </uni-data-select>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鐢熶骇杞﹂棿:</view>
+ <view class="right">
+ <uni-combox :candidates="arrayHDeptName" placeholder="璇烽�夋嫨杞﹂棿" v-model="hform.HDeptName"
+ @input="HDeptNameChange"></uni-combox>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">绛惧埌浜哄憳:</view>
+ <view class="right">
+ <uni-combox :candidates="arrayHEmpName" placeholder="璇烽�夋嫨绛惧埌浜哄憳" v-model="hform.HEmpName"
+ @input="HEmpNameChange"></uni-combox>
+ </view>
+ </view>
+
+ <view class="form-item">
+ <view class="title">鐝粍:</view>
+ <view class="right">
+ <uni-combox :candidates="arrayHGroupName" placeholder="璇烽�夋嫨杞﹂棿" v-model="hform.HGroupName"
+ @input="HGroupNameChange"></uni-combox>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鐝:</view>
+ <view class="right">
+ <uni-combox :candidates="arrayHShiftsName" placeholder="璇烽�夋嫨杞﹂棿" v-model="hform.HShiftsName"
+ @input="HShiftsNameChange"></uni-combox>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鐢熶骇璧勬簮:</view>
+ <view class="right">
+ <uni-combox :candidates="arrayHSourceName" placeholder="璇烽�夋嫨杞﹂棿" v-model="hform.HSourceName"
+ @input="HSourceNameChange"></uni-combox>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">宸ュ簭:</view>
+ <view class="right">
+ <uni-combox :candidates="arrayHProcName" placeholder="璇烽�夋嫨杞﹂棿" v-model="hform.HProcName"
+ @input="HProcNameChange"></uni-combox>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鏃ユ湡</view>
+ <view class="right disabled">
+ <input type="text" disabled :value="hform.HDate" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鍗曟嵁鍙�</view>
+ <view class="right disabled">
+ <input type="text" disabled :value="hform.HBillNo" />
+ </view>
+ </view>
+ </view>
+ <view class="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>
+ <!-- 瑁呯淇℃伅 -->
+ <view v-if="tabs == 1">
+ <zb-table id="list-table" :checked-highlight="true" :fit="true" :style="{height: `${listTableHeight}px`}"
+ :columns="columns" :data="listData" :show-header="true" :border="true" :row-key="row => row.index"
+ @toggleRowSelection="handleSelect" @toggleAllSelection="handleSelectAll"
+ @rowClick="onTableRowClickHandler" />
+ </view>
+ <view v-if="tabs == 0" class="machine-info-container">
+ <view class="form-item" v-if="false">
+ <view class="title">璁惧ID:</view>
+ <view class="righton">
+ <input name="HEquipID" disabled v-model="hform.HEquipID" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">璁惧鍚嶇О:</view>
+ <view class="righton">
+ <input name="HEquipName" disabled v-model="hform.HEquipName" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">妯″叿缂栫爜:</view>
+ <view class="righton">
+ <input name="HMouldNo" disabled v-model="hform.HMouldNo" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">妯″叿鍚嶇О:</view>
+ <view class="righton">
+ <input name="HMouldName" disabled v-model="hform.HMouldName" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">妯″叿鐘舵��:</view>
+ <view class="righton">
+ <input name="HMouldState" disabled v-model="hform.HMouldState" />
+ </view>
+ </view>
+ <!-- <label class="checkbox" style="float: right;">
+ <checkbox :checked="hform.chkHBarflag" style="transform:scale(0.8)" disabled color="#4f81fc" />鏉$爜鏍稿
+ </label> -->
+ </view>
+ <!-- 鍒跺崟淇℃伅 -->
+ <view v-if="tabs == 2">
+ <view class="bill-info">
+ <view class="form-item">
+ <view class="title">鍒涘缓鏃ユ湡</view>
+ <view class="right">
+ <uni-datetime-picker type="date" v-model="hform.HDate">
+ <input type="text" v-model="hform.HDate" disabled />
+ </uni-datetime-picker>
+ </view>
+ </view>
+ </view>
+ <view class="bill-info">
+ <view class="form-item">
+ <view class="title">鍒涘缓浜�</view>
+ <view class="right disabled">
+ <input type="text" disabled :value="hform.HMaker" />
+ </view>
+ </view>
+ </view>
+ <view class="bill-info">
+ <view class="form-item">
+ <view class="title">淇敼鏃ユ湡</view>
+ <view class="right">
+ <uni-datetime-picker type="date" v-model="hform.HUpDateDate">
+ <input type="text" v-model="hform.HDate" disabled />
+ </uni-datetime-picker>
+ </view>
+ </view>
+ </view>
+ <view class="bill-info">
+ <view class="form-item">
+ <view class="title">淇敼浜�</view>
+ <view class="right disabled">
+ <input type="text" disabled :value="hform.HUpDater" />
+ </view>
+ </view>
+ </view>
+ <view class="bill-info">
+ <view class="form-item">
+ <view class="title">淇敼鏃ユ湡</view>
+ <view class="right">
+ <uni-datetime-picker type="date" v-model="hform.HCheckDate">
+ <input type="text" v-model="hform.HDate" disabled />
+ </uni-datetime-picker>
+ </view>
+ </view>
+ </view>
+ <view class="bill-info">
+ <view class="form-item">
+ <view class="title">淇敼浜�</view>
+ <view class="right disabled">
+ <input type="text" disabled :value="hform.HChecker" />
+ </view>
+ </view>
+ </view>
+ <view class="bill-info">
+ <view class="form-item">
+ <view class="title">鍗曟嵁鍙�</view>
+ <view class="right disabled">
+ <input type="text" disabled :value="hform.HBillNo" />
+ </view>
+ </view>
+ </view>
+
+ <view class="bill-info">
+ <view class="form-item">
+ <view class="title">缁勭粐</view>
+ <view class="right disabled">
+ <input type="text" disabled :value="hform.HStockOrgName" />
+ </view>
+ </view>
+ </view>
+
+ </view>
+ <view class="bottom-btn" id="bottom-btn">
+ <button :class="EnableSubmit?'btn-a':'btn-c'" :disabled="!EnableSubmit" size="mini"
+ @tap="cmdSubmit">鎻愪氦</button>
+ <view style="flex: 1;"></view>
+ <!-- <button class="btn-d" size="mini" @tap="cmdDelete">鍒犻櫎</button> -->
+ <button class="btn-c" size="mini" @tap="cmdExit">閫�鍑�</button>
+ </view>
+ <!-- 鎵撳嵃妯″潡 -->
+ <labelPrinterComponentVue ref="labelPrinter" :printInfo="printInfo" :printMode="'cpcl'">
+ </labelPrinterComponentVue>
+
+ <!-- 鎵撳嵃鏈洪�夋嫨鍒楄〃 -->
+ <view v-if="maskShow" class="uni-mask" @tap="maskShow = false">
+ <scroll-view class="uni-scroll_box" scroll-y>
+ <view class="uni-list-box" v-for="(device, index) in discoveredDevices" :key="index"
+ @tap="connectBT(device)">
+ <view class="uni-list_name">鍚嶇О锛歿{ device.name }}</view>
+ <view class="uni-list_item">{{ connectedDeviceId === device.address?'宸茶繛鎺�':'鏈繛鎺�' }}</view>
+ </view>
+ </scroll-view>
+ </view>
+ <view v-if="showResultTable" class="result-modal">
+ <view class="modal-mask" @tap="closeResultTable"></view>
+ <view class="modal-content">
+ <view class="modal-header">
+ <text class="modal-title">绛惧埌缁撴灉</text>
+ <uni-icons type="close" size="20" @tap="closeResultTable"></uni-icons>
+ </view>
+ <view class="modal-body">
+ <zb-table :fit="true" :style="{height: '400px'}" :columns="resultTableColumns"
+ :data="resultTableData" :show-header="true" :border="true" :row-key="row => row.index" />
+ </view>
+ <view class="modal-footer">
+ <button class="btn-a" size="mini" @tap="toAddNew">鏂板</button>
+ <button class="btn-a" size="mini" @tap="search">鎵撳嵃</button>
+ <view style="flex: 1;"></view>
+ <button class="btn-c" size="mini" @tap="closeResultTable">鍏抽棴</button>
+ </view>
+ </view>
+
+ </view>
+ </view>
+</template>
+
+<script>
+ import dayjs from 'dayjs'
+ import {
+ getUserInfo
+ } from "../../utils/auth";
+ import {
+ CommonUtils
+ } from "@/utils/common.js"
+ import {
+ MpaasScan
+ } from "@/utils/mpaasScan.js"
+ import labelPrinterComponentVue from "@/components/labelPrinterComponent/labelPrinterComponent.vue"
+ import getdateTime from '../../utils/getdateTime';
+ export default {
+ components: {
+ labelPrinterComponentVue
+ },
+ data() {
+ return {
+
+ serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
+ // 璁$畻鍒楄〃楂樺害
+ bottomBtnTop: 0,
+ listTableTop: 0,
+ // 鍏叡鍙橀噺
+ arrayHDeptName: [], //閮ㄩ棬
+ HDeptNameList: [],
+ arrayHEmpName: [], //鍛樺伐
+ HEmpNameList: [],
+ arrayHGroupName: [], //鐝粍
+ HGroupNameList: [],
+ arrayHShiftsName: [], //鐝
+ HShiftsNameList: [],
+ arrayHSourceName: [], //鐢熶骇璧勬簮
+ HSourceNameList: [],
+ arrayHProcName: [], //宸ュ簭
+ HProcNameList: [],
+
+
+ EnableScanBarCodePack: true,
+ EnableSubmit: true,
+ HBarCodePackFocus: false,
+ HBarCodeFocus: false,
+
+ HBarCode: '', // 鍖呮潯鐮�
+ tabs: 0,
+ HBillType: '4616',
+ HBillSubType: '1', //瀛愮被鍨嬶紙1瑁呯銆�2缁勬墭锛�
+ OperationType: 1, //鎿嶄綔绫诲瀷锛�1鏂板銆�2浠庣紦瀛樺垪琛ㄤ腑杩斿洖锛�
+ HMaterNumber_Pack: "", //鎵樻潯鐮佸搴旂墿鏂欎唬鐮�
+ listOption: [],
+ listData: [],
+ columns: [{
+ type: 'selection',
+ fixed: true,
+ width: 50
+ },
+ {
+ name: 'index',
+ label: '搴忓彿',
+ width: 60,
+ hidden: true
+ },
+ {
+ name: '娴佽浆鍗″彿',
+ label: '娴佽浆鍗″彿',
+ width: 100,
+ },
+ {
+ name: '鏁伴噺',
+ label: '鏁伴噺',
+ width: 100,
+ },
+ {
+ name: '鐗╂枡浠g爜',
+ label: '鐗╂枡浠g爜',
+ width: 100,
+ },
+ {
+ name: '鐗╂枡鍚嶇О',
+ label: '鐗╂枡鍚嶇О',
+ width: 100,
+ },
+ {
+ name: '瑙勬牸鍨嬪彿',
+ label: '瑙勬牸鍨嬪彿',
+ width: 100,
+ },
+ {
+ name: '鏁伴噺',
+ label: '鏁伴噺',
+ width: 100,
+ },
+ {
+ name: '鐢熶骇璧勬簮',
+ label: '鐢熶骇璧勬簮',
+ width: 100,
+ }
+ ],
+ selectedRows: [], // 瀛樺偍閫変腑鐨勬暟鎹�
+ HModName: "Sc_PackUnionBill_Packing_PDA",
+ ModRightName: "CE_PackUnionBill_Packing", //妯″潡鏉冮檺鍙傛暟
+ titleData: [], //涓嶉渶瑕佹樉绀虹殑瀛楁
+ OperationType: 1, //浠庣紦瀛樺垪琛ㄤ腑杩斿洖鏁版嵁绫诲瀷锛�1鏂板銆�2浠庣紦瀛樺垪琛ㄤ腑杩斿洖锛�
+ //钃濈墮鐩稿叧淇℃伅
+ printInfo: "", //鎵撳嵃鍐呭
+ maskShow: false, //钃濈墮鎵撳嵃鏈烘樉绀虹粦瀹�
+ printListData: [], //
+ //灞曠ず琛ㄥ崟
+ showResultTable: false, // 鎺у埗缁撴灉琛ㄦ牸鏄剧ず
+ resultTableData: [], // 缁撴灉琛ㄦ牸鏁版嵁
+ resultTableColumns: [{
+ name: '璁惧缂栫爜',
+ label: '璁惧缂栫爜',
+ width: 120,
+ },
+ {
+ name: '璁惧鍚嶇О',
+ label: '璁惧鍚嶇О',
+ width: 120,
+ },
+ {
+ name: '绛惧埌瑙掕壊',
+ label: '绛惧埌瑙掕壊',
+ width: 100,
+ },
+ {
+ name: '鐢熶骇璧勬簮鍚嶇О',
+ label: '鐢熶骇璧勬簮鍚嶇О',
+ width: 100,
+ }
+ ],
+ //
+
+ // 琛ㄥ崟鎻愪氦鍊�
+ hform: {
+ HDate: dayjs(new Date()).format('YYYY-MM-DD'),
+ HMaker: getUserInfo()['Czymc'],
+ HInterID: '',
+ HStockOrgName: uni.getStorageSync("Organization"),
+ HStockOrgID: uni.getStorageSync("OrganizationID"),
+
+ HQualityApproval: false,
+
+ HMainID: '',
+ HSubID: '',
+ HSourceBillSEQ: '',
+ HBillNo: '',
+ HEmpID: getUserInfo()['HEmpID'] || '',
+ HEmpName: getUserInfo()['Czymc'] || '',
+ HEmpNumber: getUserInfo()['Czybm'] || uni.getStorageSync("HEmpNumber"),
+
+
+ HCheckEmpName: '',
+
+ HRemark: '',
+
+ HProduceDate: dayjs(new Date()).format('YYYY-MM-DD'),
+
+ //鑷畾涔�
+ HMouldID: 0,
+ HMouldName: '',
+ HMouldNumber: '',
+ HMouldNo: '',
+ HMouldState: '',
+ HEquipID: 0,
+ HEquipName: '',
+ HSourceID: uni.getStorageSync('HSourceID'),
+ HSourceName: uni.getStorageSync('HSourceName'),
+ HProcID: uni.getStorageSync('HProcID'),
+ HProcName:uni.getStorageSync('HProcName'),
+ HGroupID:uni.getStorageSync('HGroupID'),
+ HGroupName: uni.getStorageSync('HGroupName'),
+ HShiftsID: 0,
+ HShiftsName: '',
+ HDeptName: uni.getStorageSync('HDeptName'),
+ HDeptID: uni.getStorageSync('HDeptID'),
+ //HEmpID:0,
+ //HEmpName:'',
+ HSignInReason: '',
+ HSignRemark: '',
+
+ HMaterID: 0,
+ HMaterNumber: '',
+ HMaterName: '',
+ HMaterModel: '',
+ HRoles: [],
+ },
+ roleOptions: [],
+ // [{
+ // value: '鐝粍闀�',
+ // text: '鐝粍闀�'
+ // },
+ // {
+ // value: '鐝憳',
+ // text: '鐝憳'
+ // },
+ // {
+ // value: '鏈轰慨宸�',
+ // text: '鏈轰慨宸�'
+ // },
+ // {
+ // value: '鎿嶄綔宸�',
+ // text: '鎿嶄綔宸�'
+ // }
+ // ],
+ // 鍒嗛〉妯″潡鍏冩暟鎹�
+ paginationMeta: {
+
+ }
+ }
+ },
+ methods: {
+ onTableRowClickHandler(row, index) {
+ console.log('row: ', row);
+ if (!this.listData[index].checked) {
+ this.$set(this.listData[index], 'checked', true)
+ } else {
+ this.listData[index].checked = !this.listData[index].checked
+ }
+ },
+ async HBarCodeFocusRefresh() {
+ this.HBarCode = ''
+ this.HBarCodeFocus = false
+ await this.$nextTick()
+ this.HBarCodeFocus = true
+ },
+ async HBarCodePackFocusRefresh() {
+ this.HBarCode_Pack = ''
+ this.HBarCodePackFocus = false
+ await this.$nextTick()
+ this.HBarCodePackFocus = true
+ },
+ //#region 涓嬫媺妗�
+ //鑾峰彇浣跨敤閮ㄩ棬鏁版嵁
+ async getHDeptList() {
+ try{
+ let res = await CommonUtils.doRequest2Async({
+ url: '/PublicPageMethod/DeptList',
+ data: {
+ sWhere: "where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + uni.getStorageSync(
+ 'OrganizationID') + ""
+ },
+ })
+
+ console.log('res: ', res);
+ if (res.data.count == 1) {
+ console.log('res.data.data: ', res.data.data);
+ this.HDeptNameList = res.data.data
+ // for (var i = 0; i < res.data.data.length; i++) {
+ // this.arrayHDeptName[i] = res.data.data[i].HName
+ // }
+ this.arrayHDeptName = res.data.data.map(item => item.HName)
+ this.$forceUpdate();
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ }catch(err) {
+ uni.showToast({
+ title: err,
+ icon: 'none'
+ })
+ }
+
+ },
+ //閫夋嫨浣跨敤閮ㄩ棬
+ HDeptNameChange(e) {
+ for (var i = 0; i < this.HDeptNameList.length; i++) {
+ if (this.HDeptNameList[i].HName == e) {
+ this.hform.HDeptID = this.HDeptNameList[i].HItemID
+ }
+ }
+ },
+ //鎿嶄綔鍛樸�佽礋璐d汉
+ async getHEmpList() {
+ try{
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Web/GetEmployeeList_Json',
+ data: {
+ Employee: '',
+ HGroupID: 0
+ },
+ })
+
+ console.log('res: ', res);
+ if (res.data.count == 1) {
+ console.log('res.data.data: ', res.data.data);
+ this.HEmpNameList = res.data.data
+ // for (var i = 0; i < res.data.data.length; i++) {
+ // this.arrayHDeptName[i] = res.data.data[i].HName
+ // }
+ this.arrayHEmpName = res.data.data.map(item => item.HName)
+ this.$forceUpdate();
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ }catch(err) {
+ uni.showToast({
+ title: err,
+ icon: 'none'
+ })
+ }
+
+ },
+ //閫夋嫨鎿嶄綔鍛�
+ HEmpNameChange(e) {
+ for (var i = 0; i < this.HEmpNameList.length; i++) {
+ if (this.HEmpNameList[i].HName == e) {
+ this.hform.HEmpID = this.HEmpNameList[i].HItemID
+ }
+ }
+ },
+
+ //鐝粍
+ async getHGroupList() {
+ try{
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Gy_Group/list',
+ data: {
+ sWhere: '',
+ user: getUserInfo()['Czymc'] || '',
+ },
+ })
+
+ console.log('res: ', res);
+ if (res.data.count > 0) {
+ console.log('res.data.data: ', res.data.data);
+ this.HGroupNameList = res.data.data
+ // for (var i = 0; i < res.data.data.length; i++) {
+ // this.arrayHDeptName[i] = res.data.data[i].HName
+ // }
+ this.arrayHGroupName = res.data.data.map(item => item.鐝粍鍚嶇О)
+ this.$forceUpdate();
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ }catch(err) {
+ uni.showToast({
+ title: err,
+ icon: 'none'
+ })
+ }
+
+ },
+ //閫夋嫨鐝粍
+ HGroupNameChange(e) {
+ for (var i = 0; i < this.HGroupNameList.length; i++) {
+ if (this.HGroupNameList[i].鐝粍鍚嶇О == e) {
+ this.hform.HGroupID = this.HGroupNameList[i].HItemID
+ }
+ }
+ },
+ //鐝璫i
+ async getHShiftsList() {
+ try{
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Gy_ShiftsController/Get_Gy_WorkShiftList',
+ data: {
+ sWhere: '',
+ HMaker: getUserInfo()['Czymc'] || '',
+ },
+ })
+
+ console.log('res: ', res);
+ if (res.data.count > 0) {
+ console.log('res.data.data: ', res.data.data);
+ this.HShiftsNameList = res.data.data
+ // for (var i = 0; i < res.data.data.length; i++) {
+ // this.arrayHDeptName[i] = res.data.data[i].HName
+ // }
+ this.arrayHShiftsName = res.data.data.map(item => item.鐝鍚嶇О)
+ this.$forceUpdate();
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ }catch(err) {
+ uni.showToast({
+ title: err,
+ icon: 'none'
+ })
+ }
+
+ },
+ //閫夋嫨鐝璫i
+ HShiftsNameChange(e) {
+ for (var i = 0; i < this.HSourceNameList.length; i++) {
+ if (this.HSourceNameList[i].鐝鍚嶇О == e) {
+ this.hform.HSourceID = this.HSourceNameList[i].HInterID
+ }
+ }
+ },
+ //鐢熶骇璧勬簮
+ async getHSourceList() {
+ try{
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Gy_Source/list',
+ data: {
+ sWhere: '',
+ user: getUserInfo()['Czymc'] || '',
+ },
+ })
+
+ console.log('鐢熶骇璧勬簮res: ', res);
+ if (res.data.count > 0) {
+ console.log('鐢熶骇璧勬簮res.data.data: ', res.data.data);
+ this.HSourceNameList = res.data.data
+ // for (var i = 0; i < res.data.data.length; i++) {
+ // this.arrayHDeptName[i] = res.data.data[i].HName
+ // }
+ this.arrayHSourceName = res.data.data.map(item => item.鐢熶骇璧勬簮鍚嶇О)
+ this.$forceUpdate();
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ }catch(err) {
+ uni.showToast({
+ title: err,
+ icon: 'none'
+ })
+ }
+
+ },
+ //閫夋嫨shengcanziyuan
+ HSourceNameChange(e) {
+ for (var i = 0; i < this.HSourceNameList.length; i++) {
+ if (this.HSourceNameList[i].鐢熶骇璧勬簮鍚嶇О == e) {
+ this.hform.HSourceID = this.HSourceNameList[i].HItemID
+ console.log("HSourceID涓�",this.hform.HSourceID)
+ }
+ }
+ },
+ //宸ュ簭
+ async getHProcList() {
+ try{
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Gy_Process/list',
+ data: {
+ sWhere: '',
+ user: getUserInfo()['Czymc'] || '',
+ },
+ })
+
+ console.log('宸ュ簭res: ', res);
+ if (res.data.count > 0) {
+ console.log('宸ュ簭res.data.data: ', res.data.data);
+ this.HProcNameList = res.data.data
+ // for (var i = 0; i < res.data.data.length; i++) {
+ // this.arrayHDeptName[i] = res.data.data[i].HName
+ // }
+ this.arrayHProcName = res.data.data.map(item => item.宸ュ簭鍚嶇О)
+ this.$forceUpdate();
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ }catch(err) {
+ uni.showToast({
+ title: err,
+ icon: 'none'
+ })
+ }
+
+ },
+ //閫夋嫨Proc
+ HProcNameChange(e) {
+ for (var i = 0; i < this.HProcNameList.length; i++) {
+ if (this.HProcNameList[i].宸ュ簭鍚嶇О == e) {
+ this.hform.HProcID = this.HProcNameList[i].HItemID
+ }
+ }
+ },
+
+
+ // 鑾峰彇瑙掕壊鍒楄〃
+ async getRoleList() {
+ try {
+ let res = await CommonUtils.doRequest2Async({
+ url: '/Xt_UserGroup/list',
+ data: {
+ sWhere: '',
+ },
+ })
+
+ console.log('瑙掕壊鍒楄〃res: ', res);
+ if (res.data.count > 0) {
+ console.log('瑙掕壊鍒楄〃res.data.data: ', res.data.data);
+ // 灏嗘帴鍙h繑鍥炵殑鏁版嵁杞崲涓� uni-data-select 闇�瑕佺殑鏍煎紡
+ this.roleOptions = res.data.data.map(item => {
+
+ return {
+ value: item.瑙掕壊 ,
+ text: item.瑙掕壊
+ };
+ });
+ this.$forceUpdate();
+ } else {
+ uni.showToast({
+ title: res.data.Message || '鑾峰彇瑙掕壊鍒楄〃澶辫触',
+ icon: 'none'
+ });
+ // 濡傛灉鎺ュ彛澶辫触锛屽彲浠ヨ缃粯璁ら�夐」
+ this.roleOptions = [];
+ }
+ } catch(err) {
+ uni.showToast({
+ title: err.message || '鑾峰彇瑙掕壊鍒楄〃寮傚父',
+ icon: 'none'
+ });
+ // 寮傚父鎯呭喌璁剧疆榛樿閫夐」
+ this.roleOptions = [];
+ }
+ },
+ //#endregion
+
+
+ toScanCode2() {
+ MpaasScan.scanCode((scanCode) => {
+ this.HBarCode = scanCode
+ GetMeesageByBarCode(scanCode)
+ })
+ },
+ GetMeesageByBarCode(HBarCode) {
+
+ // 鑾峰彇寰呯粍鎵樻潯鐮佸搴旂殑鏁版嵁
+ let sOldBarCode = this.HBarCode
+ let HDeleteFlag = sOldBarCode.substring(0, 1)
+ let sBarCode = sOldBarCode.slice(1)
+ if (HDeleteFlag == '*') {
+ if (!sBarCode) {
+ return uni.showToast({
+ icon: 'none',
+ title: '璇锋壂鎻忚鍒犻櫎鐨勬潯鐮�',
+ })
+ } else {
+ this.HBarCodeFocusRefresh()
+ }
+ CommonUtils.doRequest2({
+ url: '/WEBSController/set_DelPackUnionBill_Temp_Pack_Json',
+ data: {
+ "HInterID": this.hform.HInterID,
+ "HBarCode": sBarCode,
+ "HBillType": this.HBillType
+ },
+ resFunction: (res) => {
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ CommonUtils.playSound(1)
+ //this.DisBillEntryList()
+ } else {
+ CommonUtils.playSound(0)
+ uni.showToast({
+ icon: 'none',
+ title: Message
+ })
+ }
+ }
+ })
+ } else {
+ let sBarCode = this.HBarCode
+ if (!sBarCode) {
+ return uni.showToast({
+ icon: 'none',
+ title: '鏉$爜涓嶈兘涓虹┖锛岃鎵弿鏉$爜锛�',
+ })
+ }
+ CommonUtils.doRequest2({
+ url: '/Sc_EmployeeSignInNoteBillController/APP_Edit_json',
+ data: {
+ "HInterID": this.hform.HInterID,
+ "HBarCode": sBarCode,
+ },
+
+ resFunction: (res) => {
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ CommonUtils.playSound(1)
+ //let data=res.data
+ console.log(sBarCode)
+ console.log(res.data.data[0])
+ console.log(res.data[1])
+ debugger
+ this.hform.HMouldID = data[0][0].妯″叿id
+ console.log("idwei", data[0][0].妯″叿id)
+ this.hform.HMouldNo = data[0][0].妯″叿缂栫爜
+ this.hform.HMouldName = data[0][0].妯″叿鍚嶇О
+ this.hform.HMouldState = data[0][0].妯″叿鐘舵��
+ this.listData = []
+ let tabledata = data[1][0]
+ if (data[1].length > 0) {
+ this.hform.HEquipID = tabledata.璁惧鍐呯爜
+ this.hform.HEquipName = tabledata.璁惧鍚嶇О
+ //
+ //this.hform.HSourceID = tabledata.HSourceID
+ this.hform.HMaterID = tabledata.HMaterID
+ //this.hform.HProcID = tabledata.HSourceInterID
+ for (let i = 0; i < data[1].length; i++) {
+ this.listData.push(Object.assign(data[1][i], {
+ index: i
+ }))
+ }
+ }
+
+
+ } else {
+ CommonUtils.playSound(0)
+ this.listData = []
+ this.HBarCodeFocusRefresh()
+ uni.showToast({
+ icon: 'none',
+ title: Message
+ })
+ }
+ }
+ })
+ }
+ },
+ onRoleChange(e) {
+ console.log('閫変腑鐨勮鑹�:', this.hform.HRoles);
+ },
+
+
+ handleSelect(selected, array) {
+ this.selectedRows = array
+ },
+ handleSelectAll(selected, array) {
+ this.selectedRows = array
+ },
+ getMaxNo() {
+ CommonUtils.doRequest2({
+ url: "/WEBSController/GetMaxBillNoAndID_Json",
+ data: {
+ "HBillType": this.HBillType
+ },
+ resFunction: (d) => {
+ console.log('d: ', d);
+ let {
+ count,
+ data,
+ Message
+ } = d.data
+ if (count == 1) {
+ this.hform.HInterID = data[0].HInterID;
+ this.hform.HBillNo = data[0].HBillNo
+ } else {
+
+ uni.showModal({
+ title: "娓╅Θ鎻愮ず",
+ showCancel: false,
+ content: Message
+
+ })
+
+ }
+ }
+ })
+ },
+ submitPreCheck() {
+ if (CommonUtils.isEmpty(this.hform.HInterID)) {
+ uni.showToast({
+ icon: 'none',
+ title: '鍗曟嵁鍐呯爜鑾峰彇澶辫触锛岄敊璇殑鍗曟嵁鍐呯爜锛�'
+ })
+ return false
+ }
+ if (CommonUtils.isEmpty(this.hform.HBillNo)) {
+ uni.showToast({
+ icon: 'none',
+ title: '鍗曟嵁鍙疯幏鍙栧け璐ワ紝閿欒鐨勫崟鎹彿锛�'
+ })
+ return false
+ }
+ if (this.listData.length < 1) {
+ uni.showToast({
+ icon: 'none',
+ title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�'
+ })
+ return false
+ }
+ return true
+ },
+ cmdDelete() {
+ console.log('this.selectedRows: ', this.selectedRows);
+ if (this.selectedRows.length != 1) {
+ return uni.showToast({
+ icon: 'none',
+ title: '璇烽�夋嫨涓�琛岃褰曪紝杩涜鍒犻櫎锛�'
+ })
+ }
+ uni.showModal({
+ title: '鍒犻櫎纭',
+ content: '纭瑕佸垹闄ら�変腑琛屾墍鏈夋壂鐮佽褰曪紵鍒犻櫎鍚庡皢涓嶅彲鎭㈠!',
+ success: () => {
+ if (confirm) {
+ CommonUtils.doRequest2({
+ url: '/WEBSController/set_DelPackUnionBill_Temp_Pack_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.HBillType,
+ HBarCode: this.selectedRows[0].HBarCode
+ },
+ resFunction: (res) => {
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ CommonUtils.playSound(1)
+ uni.showToast({
+ icon: 'none',
+ title: Message
+ })
+ //this.DisBillEntryList()
+ } else {
+ CommonUtils.playSound(0)
+ uni.showToast({
+ icon: 'none',
+ title: Message
+ })
+ }
+ }
+ })
+ }
+ }
+ })
+ },
+
+ async cmdSubmit() {
+ let checkRes = this.submitPreCheck()
+ if (!checkRes) {
+ return
+ }
+ this.EnableSubmit = false
+
+ try {
+ debugger
+ this.hform.HInterID = 0
+ for (let i = 0; i < this.hform.HRoles.length; i++) {
+ this.hform.HSignRemark = this.hform.HSignRemark + this.hform.HRoles[i] + ","
+ }
+ let oMain = JSON.stringify(this.hform);
+ console.log("鎻愪氦鐨刯son", oMain)
+ // this.HBillSub[0].HRepairCheckID = this.hform.HRepairCheckMainID
+ // this.HBillSub[0].HManagerID = this.hform.HManagerID
+ // this.HBillSub[0].HRepairCheckContent = this.hform.HRepairCheckMainContent
+ // let sSubStr = JSON.stringify(this.HBillSub);
+ let sMainSub = oMain + ';' + getUserInfo()['OrganizationID'] + ';' + getUserInfo()['Czymc'];
+ await CommonUtils.doRequest2({
+ url: "/Sc_EmployeeSignInNoteBillController/SaveBill_APP",
+ data: {
+ "msg": sMainSub
+ },
+ method: "POST",
+ resFunction: async (res) => {
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ // 绛夊緟鏁版嵁鑾峰彇瀹屾垚鍚庡啀鏄剧ず琛ㄦ牸
+ await this.getResultTableData();
+ } else {
+ uni.showToast({
+ icon: 'none',
+ title: Message
+ })
+ this.EnableSubmit = true;
+ }
+ }
+ })
+ } catch (error) {
+ console.error('鎻愪氦澶辫触:', error);
+ this.EnableSubmit = true;
+ }
+ },
+ getResultTableData() {
+ CommonUtils.doRequest2({
+ url: '/Sc_EmployeeSignInNoteBillController/GetListPage',
+ data: {
+ "sWhere": 'and HEquipID=' + this.hform.HEquipID,
+ "user": 'admin'
+ },
+ resFunction: (res) => {
+ console.log('缁撴灉鎺ュ彛杩斿洖:', res);
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ console.log('鑾峰彇鍒扮粨鏋滄暟鎹�:', data);
+ this.resultTableData = data;
+ this.showResultTable = true; // 鏄剧ず缁撴灉琛ㄦ牸
+ console.log('showResultTable 璁剧疆涓�:', this.showResultTable);
+ } else {
+ uni.showToast({
+ icon: 'none',
+ title: Message || '鑾峰彇鏁版嵁澶辫触'
+ })
+ this.EnableSubmit = true;
+ }
+ }
+ })
+ },
+ // 鏂板鏂规硶
+ toAddNew() {
+ // 閲嶇疆鏁版嵁锛屽噯澶囨柊澧�
+ this.showResultTable = false;
+ this.EnableSubmit = true;
+ this.resultTableData = [];
+ this.HBarCode_Pack = '';
+ this.HBarCode = '';
+ this.listData = [];
+ this.getMaxNo(); // 閲嶆柊鑾峰彇鏂扮殑鍗曟嵁鍙�
+ this.HBarCodePackFocusRefresh(); // 閲嶆柊鑱氱劍
+ },
+
+ // 鍏抽棴缁撴灉琛ㄦ牸
+ closeResultTable() {
+ this.showResultTable = false;
+ uni.navigateBack();
+ },
+ cmdExit() {
+ uni.navigateBack()
+ },
+ //鎵撳嵃妯″潡鍑芥暟
+ /**
+ * 鎵撳嵃鍑芥暟
+ */
+ async search() {
+ // #ifndef APP-PLUS
+ uni.showModal({
+ content: "涓嶆敮鎸佽摑鐗欐墦鍗板姛鑳斤紝璇峰垏鎹㈢Щ鍔ㄨ澶�...",
+ })
+ return
+ // #endif
+ if (this.$printer.isConnected() === false) {
+ this.$refs.labelPrinter.openPopup()
+ } else {
+ let printContent = []
+ let printInfoBuffer = []
+ let count = 0
+ uni.showLoading()
+ console.log('this.listData: ', this.printListData);
+ for (let listOne of this.printListData) {
+ let Message = await this.getPrintTemplate(listOne.HInterID, listOne.HItemID)
+ printContent.push(Message)
+ count++;
+ if (count == 10) {
+ printInfoBuffer.push(printContent.join("\r\n"))
+ count = 0
+ printContent = []
+ }
+ }
+ uni.hideLoading()
+ printInfoBuffer.push(printContent.join("\r\n"))
+ this.printInfo = JSON.stringify(printInfoBuffer)
+ printInfoBuffer = []
+
+ await this.$nextTick(() => {
+ this.$refs.labelPrinter.execPrint()
+ })
+ }
+ },
+ /** 鑾峰彇鎵撳嵃妯℃澘
+ * @param {Object} HInterID
+ * @param {Object} HItemID
+ */
+ async getPrintTemplate(HInterID, HItemID) {
+ console.log('data: ', {
+ HOrginationName: uni.getStorageSync("Organization"),
+ HBillSubType: this.HBillType,
+ HInterID: HInterID,
+ HItemID: HItemID,
+ })
+ return new Promise((resolve, reject) => {
+ CommonUtils.doRequest2({
+ url: "/Sc_BarCode/Get_BarCodePrintCode_CPCL",
+ data: {
+ HOrginationName: uni.getStorageSync("Organization"),
+ HBillSubType: this.HBillType,
+ HInterID: HInterID,
+ HItemID: HItemID,
+ },
+ resFunction: (res) => {
+ let {
+ Message,
+ count
+ } = res.data
+ if (count == 1) {
+ console.log('Message: ', Message);
+ resolve(Message)
+ } else {
+ uni.showToast({
+ icon: 'none',
+ title: Message
+ })
+ reject();
+ }
+ },
+ errFunction: (err) => {
+ reject();
+ },
+
+ })
+ })
+ },
+ /**
+ * 鏌ユ壘鎵撳嵃鏈�
+ */
+ async searchLabelPrinter() {
+ // 鏌ユ壘鎵撳嵃鏈�
+ var that = this
+ // 浣跨敤openBluetoothAdapter 鎺ュ彛锛屽厤鍘讳富鍔ㄧ敵璇锋潈闄愮殑楹荤儲
+ uni.openBluetoothAdapter({
+ success: async (res) => {
+ await this.checkPermission();
+ console.log('start discovery devices');
+ this.discoveredDevices = [];
+ console.log(res)
+ bluetoothTool.discoveryNewDevice();
+ this.maskShow = true
+ },
+ fail: async (e) => {
+ console.error(e)
+ switch (e.code) {
+ case "10009":
+ this.showToast("姝よ澶囦笉鏀寔璁惧鎼滅储鍔熻兘!");
+ break;
+ default:
+ console.error(e);
+ }
+ }
+ })
+
+ },
+ onDevice(device) {
+ console.log("鐩戝惉瀵绘壘鍒版柊璁惧鐨勪簨浠�---------------")
+ console.log(device)
+ if (typeof device === 'undefined') return;
+ if (typeof device.name === 'undefined') return;
+ console.log(device.name);
+ if (device.name === '') return;
+ if (device.name === null) return;
+ if (device.name.toUpperCase().endsWith('_BLE') ||
+ device.name.toUpperCase().endsWith('-LE') ||
+ device.name.toUpperCase().endsWith('-BLE')) return;
+ const isDuplicate = this.discoveredDevices.find(item => item.address === device.address);
+ if (isDuplicate) return;
+ this.discoveredDevices.push(device);
+ },
+ connectBT(device) {
+ const vm = this;
+ uni.showLoading({
+ title: '杩炴帴涓�'
+ });
+ bluetoothTool.connDevice(device.address, (result) => {
+ console.log(result)
+ uni.hideLoading()
+ if (result) {
+ // // console.log(result);
+ bluetoothTool.cancelDiscovery();
+ // console.log(vm.$printer)
+ vm.$printer.init(new FakeConnectedDevice());
+ vm.connectedDeviceId = device.address;
+ uni.showToast({
+ icon: 'none',
+ title: '杩炴帴鎴愬姛'
+ })
+ this.maskShow = false
+ } else {
+ uni.showToast({
+ icon: 'none',
+ title: '杩炴帴澶辫触'
+ })
+ }
+ });
+ },
+ stopSearchBT() {
+ console.log("鍋滄鎼滃闄勮繎鐨勮摑鐗欏鍥磋澶�---------------")
+ bluetoothTool.cancelDiscovery();
+ },
+ closeBluetooth() {
+ console.log("鍋滄钃濈墮杩炴帴")
+ const vm = this;
+ if (vm.connectedDeviceId != '') {
+ bluetoothTool.closeBtSocket();
+ vm.connectedDeviceId = "";
+ }
+ },
+
+ },
+ computed: {
+ listTableHeight: {
+ get() {
+ return this.bottomBtnTop - this.listTableTop - 10
+ }
+ }
+ },
+ async onReady() {
+ // #ifndef MP-WEIXIN
+ let query = uni.createSelectorQuery().in(this)
+ query.select("#bottom-btn")
+ .boundingClientRect((data) => {
+ if (data) {
+ this.bottomBtnTop = data.top
+ } else {
+ console.log("鏈壘鍒�#bottom-btn鑺傜偣");
+ }
+ })
+ .exec();
+ query.select("#list-table")
+ .boundingClientRect((data) => {
+ if (data) {
+ this.listTableTop = data.top
+ } else {
+ console.log("鏈壘鍒�#list-table鑺傜偣");
+ }
+ })
+ .exec();
+ // #endif
+ },
+ onLoad(e) {
+ // 1涓� 瑁呯 2涓� 缁勬墭
+ this.BarCodeType = e.BarCodeType || 1
+ this.OperationType = e.OperationType || 1
+
+ this.getHDeptList()
+ this.getHEmpList()
+ this.getHGroupList()
+ this.getHShiftsList()
+ this.getHSourceList()
+ this.getHProcList()
+ this.getRoleList()
+ if (this.OperationType == 1) {
+ this.getMaxNo()
+ } else if (this.OperationType == 2) {
+ // this.GetMeesageByBarCode_Pack(this.HBarCode_Pack)
+ //this.DisBillEntryList()
+ this.tabs = 0
+ }
+
+
+ // 鍏夋爣榛樿鑱氱劍鍦ㄦ墭鏉$爜涓�
+ this.HBarCodePackFocusRefresh()
+ }
+ }
+</script>
+
+<style lang="scss">
+ input {
+ width: inherit;
+ padding: 8rpx 20rpx;
+ font-size: 30rpx;
+ }
+
+ .uni-mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ z-index: 3;
+ display: flex;
+ align-items: center;
+ width: 100%;
+ background: rgba(0, 0, 0, 0.6);
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ }
+
+ .form {
+ display: flex;
+ flex-direction: column;
+ gap: 20rpx;
+
+ .form-base-info {
+ display: flex;
+ flex-direction: column;
+ gap: 10rpx;
+ box-sizing: border-box;
+ padding: 30rpx;
+ }
+
+ .bill-info {
+ display: flex;
+ flex-direction: column;
+ gap: 10rpx;
+ box-sizing: border-box;
+ padding: 16rpx 30rpx;
+ background-color: #fff;
+ }
+
+ .form-item {
+ display: flex;
+ align-items: center;
+ font-size: 30rpx;
+ padding: 6rpx 0;
+
+ .title {
+ width: 208rpx;
+
+ text {
+ color: red;
+ font-weight: bold;
+ }
+ }
+
+ .right {
+ flex: 1;
+ border-radius: 22rpx;
+ border: 1px solid #acacac;
+ }
+
+ .righton {
+ width: 450rpx;
+ border-radius: 22rpx;
+ border: 1px solid #e4e4e4;
+ background-color: #e4e4e4;
+ }
+
+ input {
+ // width: 100%;
+ padding: 8rpx 20rpx;
+ font-size: 30rpx;
+ }
+
+
+
+ textarea {
+ width: 98%;
+ padding: 8rpx 20rpx;
+ font-size: 30rpx;
+ }
+
+ }
+ }
+
+ .tabs {
+ width: 100%;
+ display: flex;
+ border-bottom: 1px solid #ddd;
+ margin: 20rpx 0;
+
+ view {
+ width: 25%;
+ font-size: 30rpx;
+ color: #555;
+ text-align: center;
+ padding: 16rpx 0;
+ }
+
+ .on {
+ color: #3a78ff;
+ font-weight: bold;
+ border-bottom: 3px solid #3a78ff;
+ }
+ }
+
+ .machine-info-container {
+ padding-left: 40rpx;
+ /* 鍚戝彸绉诲姩40rpx */
+ padding-right: 40rpx;
+ padding-top: 20rpx;
+
+ .form-item {
+ display: flex;
+ align-items: center;
+ font-size: 30rpx;
+ padding: 10rpx 0;
+
+ .title {
+ width: 220rpx;
+ /* 绋嶅井鍔犲鏍囬瀹藉害 */
+ min-width: 220rpx;
+ color: #333;
+ }
+
+ .righton {
+ flex: 1;
+ border-radius: 22rpx;
+ border: 1px solid #e4e4e4;
+ background-color: #f8f8f8;
+
+ input {
+ width: 100%;
+ padding: 12rpx 20rpx;
+ font-size: 30rpx;
+ color: #666;
+ }
+ }
+ }
+ }
+
+ .bottom-btn {
+ width: 100%;
+ box-sizing: border-box;
+ // height: 120rpx;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ background-color: #fff;
+ box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
+ padding: 30rpx 40rpx 40rpx 40rpx;
+ display: flex;
+ flex-direction: row;
+ gap: 10rpx;
+
+ button {
+ border-radius: 50rpx;
+ width: 180rpx;
+ height: 66rpx;
+ line-height: 66rpx;
+ font-size: 28rpx;
+ }
+
+ .btn-a {
+ background-color: #3A78FF;
+ color: #fff;
+ }
+
+ .btn-b {
+ background-color: #41a863;
+ color: #fff;
+ }
+
+ .btn-c {
+ background-color: #acacac;
+ color: #fff;
+ // position: absolute;
+ // right: 120rpx;
+ }
+
+ .btn-d {
+ background-color: #ff8901;
+ color: #fff;
+ }
+ }
+
+ .result-modal {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 2;
+
+ .modal-mask {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background: rgba(0, 0, 0, 0.5);
+ }
+
+ .modal-content {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 90%;
+ max-width: 700rpx;
+ background: #fff;
+ border-radius: 20rpx;
+ overflow: hidden;
+
+ .modal-header {
+ padding: 30rpx;
+ border-bottom: 1px solid #eee;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ .modal-title {
+ font-size: 32rpx;
+ font-weight: bold;
+ }
+ }
+
+ .modal-body {
+ padding: 30rpx;
+ max-height: 60vh;
+ overflow-y: auto;
+ }
+
+ .modal-footer {
+ padding: 30rpx;
+ border-top: 1px solid #eee;
+ display: flex;
+ align-items: center;
+ }
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/pages/EmployeeRecords/EmployeeRecordsBillList.vue b/pages/EmployeeRecords/EmployeeRecordsBillList.vue
new file mode 100644
index 0000000..7924e7f
--- /dev/null
+++ b/pages/EmployeeRecords/EmployeeRecordsBillList.vue
@@ -0,0 +1,558 @@
+<template>
+ <view>
+ <view class="page-header">
+ <view class="search-item">
+ <view class="left">鏃ユ湡闂撮殧</view>
+ <view class="right">
+ <picker mode="selector" :value="curDateGap" :range="dateRangePicker"
+ @change="onDateRangePickerChangeHandler">
+ <input disabled v-model="curDateGap" placeholder="璇烽�夋嫨鏃ユ湡闂撮殧" />
+ <view class="picker-overlay"></view>
+ </picker>
+ </view>
+ </view>
+ <view class="search-item">
+ <view class="left">寮�濮嬫棩鏈�</view>
+ <view class="right">
+ <uni-datetime-picker :clear-icon="false" type="date" v-model="startDate"
+ :disabled="!enableCustomDateRange">
+ <view class="datetime-picker-inner"
+ :class="enableCustomDateRange?'font__enable':'font__disable'">
+ <text>{{ startDate }}</text>
+ </view>
+ </uni-datetime-picker>
+ </view>
+ </view>
+ <view class="search-item">
+ <view class="left">缁撴潫鏃ユ湡</view>
+ <view class="right">
+ <uni-datetime-picker :clear-icon="false" type="date" v-model="endDate"
+ :disabled="!enableCustomDateRange">
+ <view class="datetime-picker-inner"
+ :class="enableCustomDateRange?'font__enable':'font__disable'">{{ endDate }}</view>
+ </uni-datetime-picker>
+ </view>
+ </view>
+ <view class="search-item">
+ <view class="left">鍗曟嵁鍙�</view>
+ <view class="right">
+ <input type="text" auto-focus v-model="HBillNo" />
+ </view>
+ </view>
+
+ <view class="button-groups">
+ <button type="default" size="mini" class="btn-b" @tap.stop="onAddClickHandler">鏂板</button>
+ <button type="default" size="mini" class="btn-c" @tap.stop="onSearchClickHandler">鏌ヨ</button>
+ <button type="default" size="mini" class="btn-a" @tap.stop="onResetClickHandler">閲嶇疆</button>
+ </view>
+ </view>
+ <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
+ <scroll-view id="pageContent" scroll-y class="page-content" :style="{height: pageContentHeight + 'px'}">
+ <view v-for="(item,index) in listData" :key="index">
+ <uni-card :title="item.浜у搧妯″叿" :extra="item.鍗曟嵁鍙�" style="margin: 10px;"
+ @tap="showDetail = showDetail==index?-1:index">
+ <view class="card-detail">
+ <view class="detail" v-if="item.璁惧缂栫爜">
+ <text>璁惧缂栫爜锛�</text>{{item.璁惧缂栫爜}}
+ </view>
+ <view class="detail" v-if="item.璁惧鍚嶇О">
+ <text>璁惧鍚嶇О锛�</text>{{item.璁惧鍚嶇О}}
+ </view>
+ <view class="detail" v-if="item.浜哄憳浠g爜">
+ <text>浜哄憳浠g爜锛�</text>{{item.浜哄憳浠g爜}}
+ </view>
+ <view class="detail" v-if="item.浜哄憳鍚嶇О">
+ <text>浜哄憳鍚嶇О锛�</text>{{item.浜哄憳鍚嶇О}}
+ </view>
+ <view class="detail" v-if="item.绛惧埌瑙掕壊">
+ <text>绛惧埌瑙掕壊锛�</text>{{item.绛惧埌瑙掕壊}}
+ </view>
+ <view class="detail" v-if="item.鐢熶骇璧勬簮鍚嶇О">
+ <text>鐢熶骇璧勬簮鍚嶇О锛�</text>{{item.鐢熶骇璧勬簮鍚嶇О}}
+ </view>
+ <view class="detail" v-if="item.宸ュ簭鍚嶇О">
+ <text>宸ュ簭鍚嶇О锛�</text>{{item.宸ュ簭鍚嶇О}}
+ </view>
+ <view class="detail" v-if="item.鐝粍鍚嶇О">
+ <text>鐝粍鍚嶇О锛�</text>{{item.鐝粍鍚嶇О}}
+ </view>
+ <view class="detail" v-if="item.鐝鍚嶇О">
+ <text>鐝鍚嶇О锛�</text>{{item.鐝鍚嶇О}}
+ </view>
+ </view>
+ <view class="card-detail" v-if="showDetail == index">
+ <view class="detail" v-if="item.鍒跺崟浜�">
+ <text>鍒跺崟浜猴細</text>{{item.鍒跺崟浜簘}
+ </view>
+ <view class="detail" v-if="item.鍒跺崟鏃ユ湡">
+ <text>鍒跺崟鏃ユ湡锛�</text>{{item.鍒跺崟鏃ユ湡.substr(0,10)}}
+ </view>
+ <view class="detail" v-if="item.瀹℃牳浜�">
+ <text>瀹℃牳浜猴細</text>{{item.瀹℃牳浜簘}
+ </view>
+ <view class="detail" v-if="item.瀹℃牳鏃ユ湡">
+ <text>瀹℃牳鏃ユ湡锛�</text>{{item.瀹℃牳鏃ユ湡.substr(0,10)}}
+ </view>
+ <view class="detail" v-if="item.淇敼浜�">
+ <text>淇敼浜猴細</text>{{item.淇敼浜簘}
+ </view>
+ <view class="detail" v-if="item.淇敼鏃ユ湡">
+ <text>淇敼鏃ユ湡锛�</text>{{item.淇敼鏃ユ湡.substr(0,10)}}
+ </view>
+ <view class="detail" v-if="item.鍏抽棴浜�">
+ <text>鍏抽棴浜猴細</text>{{item.鍏抽棴浜簘}
+ </view>
+ <view class="detail" v-if="item.鍏抽棴鏃ユ湡">
+ <text>鍏抽棴鏃ユ湡锛�</text>{{item.鍏抽棴鏃ユ湡.substr(0,10)}}
+ </view>
+ <view class="detail" v-if="item.浣滃簾浜�">
+ <text>浣滃簾浜猴細</text>{{item.浣滃簾浜簘}
+ </view>
+ <view class="detail" v-if="item.浣滃簾鏃ユ湡">
+ <text>浣滃簾鏃ユ湡锛�</text>{{item.浣滃簾鏃ユ湡.substr(0,10)}}
+ </view>
+ </view>
+
+
+ <view class="more" v-if="showDetail == index && operations != index">
+ <view class="part" style="border-right: 1px solid #eee;">
+ <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>鏀惰捣
+ </view>
+ <view class="part" @tap.stop="operations = operations==index?-1:index">
+ <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;"
+ size="14"></uni-icons>鎿嶄綔
+ </view>
+ </view>
+ <view class="more" v-if="showDetail != index && operations != index">
+ <view class="part" style="border-right: 1px solid #eee;">
+ <uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>鏇村淇℃伅
+ </view>
+ <view class="part" @tap.stop="operations = operations==index?-1:index">
+ <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;"
+ size="14"></uni-icons>鎿嶄綔
+ </view>
+ </view>
+
+ <view class="op" v-if="operations == index">
+ <!-- <button class="op3" size="mini" plain @tap.stop="edit(item)">缂栬緫</button> -->
+ <button class="op4" size="mini" plain @tap.stop="del(item)">鍒犻櫎</button>
+ <button class="op5" size="mini" plain @tap.stop="operations = -1">鍙栨秷鎿嶄綔</button>
+ </view>
+ </uni-card>
+ </view>
+ <view class="over" v-if="listData.length == 0">鏆傛棤鏁版嵁</view>
+ </scroll-view>
+ <!-- 鍒嗛〉鍣� -->
+ <view class="page-footer">
+ <uni-pagination id="pagination" title="鏍囬鏂囧瓧" v-model="pageMeta.curPage" :pageSize="pageMeta.size"
+ :total="pageMeta.total" @change="onPageChangeHandler"></uni-pagination>
+ </view>
+ </view>
+</template>
+
+<script>
+ import dayjs from 'dayjs'
+ import {
+ CommonUtils
+ } from '@/utils/common.js'
+ import {
+ getUserInfo
+ } from "../../utils/auth";
+ export default {
+ data() {
+ return {
+ // 璁$畻鍗$墖鍒楄〃楂樺害
+ pagination_top: 0,
+ pageContent_top: 0,
+ // 鍒嗛〉鎺у埗
+ pageMeta: {
+ curPage: 1,
+ size: 50,
+ total: 0,
+ },
+ // 婊氬姩鎺у埗
+ scrollTop: 0,
+ old: {
+ scrollTop: 0
+ },
+
+ dateRangePicker: ["浠绘剰闂撮殧", "浠婂ぉ", "杩戜袱澶�", "杩戜笁澶�", "杩戝洓澶�", "杩戜簲澶�", "杩戝叚澶�", "杩戜竷澶�", "杩�30澶�"],
+ curDateGap: "杩戜竷澶�",
+ enableCustomDateRange: false,
+ startDate: dayjs(new Date()).subtract(7, 'day').format('YYYY-MM-DD'),
+ endDate: dayjs(new Date()).format('YYYY-MM-DD'),
+ HBillNo: '',
+
+ listData: [],
+ showDetail: -1,
+ operations: -1,
+ }
+ },
+ computed: {
+ pageContentHeight: {
+ get() {
+ return (this.pagination_top - this.pageContent_top)
+ }
+ },
+ },
+ onLoad() {
+ this.onSearchClickHandler()
+ },
+ onPullDownRefresh() {
+ this.onSearchClickHandler()
+ },
+ async onReady() {
+ // #ifndef MP-WEIXIN
+ let query = uni.createSelectorQuery().in(this)
+ query.select("#pagination")
+ .boundingClientRect((data) => {
+ if (data) {
+ this.pagination_top = data.top
+ } else {
+ console.log("鏈壘鍒�#pagination鑺傜偣");
+ }
+ })
+ .exec();
+ query.select("#pageContent")
+ .boundingClientRect((data) => {
+ if (data) {
+ this.pageContent_top = data.top
+ } else {
+ console.log("鏈壘鍒�#pageContent鑺傜偣");
+ }
+ })
+ .exec();
+ // #endif
+
+ },
+ methods: {
+ goTop: function(e) {
+ // 瑙e喅view灞備笉鍚屾鐨勯棶棰�
+ this.scrollTop = this.old.scrollTop
+ this.$nextTick(function() {
+ this.scrollTop = 0
+ });
+ },
+ onDateRangePickerChangeHandler({
+ detail
+ }) {
+ this.enableCustomDateRange = false
+ this.curDateGap = this.dateRangePicker[detail.value]
+ let date = new Date()
+ switch (this.curDateGap) {
+ case "浠婂ぉ":
+ this.startDate = dayjs(date).format("YYYY-MM-DD")
+ break;
+ case "杩戜竴澶�":
+ this.startDate = dayjs(date).subtract(1, 'day').format("YYYY-MM-DD")
+ break;
+ case "杩戜袱澶�":
+ this.startDate = dayjs(date).subtract(2, 'day').format("YYYY-MM-DD")
+ break;
+ case "杩戜笁澶�":
+ this.startDate = dayjs(date).subtract(3, 'day').format("YYYY-MM-DD")
+ break;
+ case "杩戝洓澶�":
+ this.startDate = dayjs(date).subtract(4, 'day').format("YYYY-MM-DD")
+ break;
+ case "杩戜簲澶�":
+ this.startDate = dayjs(date).subtract(5, 'day').format("YYYY-MM-DD")
+ break;
+ case "杩戝叚澶�":
+ this.startDate = dayjs(date).subtract(6, 'day').format("YYYY-MM-DD")
+ break;
+ case "杩戜竷澶�":
+ this.startDate = dayjs(date).subtract(7, 'day').format("YYYY-MM-DD")
+ break;
+ case "杩�30澶�":
+ this.startDate = dayjs(date).subtract(30, 'day').format("YYYY-MM-DD")
+ break;
+ }
+ if (this.curDateGap == '浠绘剰闂撮殧') {
+ this.enableCustomDateRange = true
+ }
+ },
+ onSearchClickHandler() {
+ let sWhere = ""
+ if (this.startDate) {
+ sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + this.startDate + "'";
+ }
+ if (this.endDate) {
+ sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + this.endDate + "'";
+ }
+ if (this.HBillNo) {
+ sWhere += " and 鍗曟嵁鍙� like '%" + this.HBillNo + "%'";
+ }
+ this.get_DisplayPage(sWhere);
+ },
+ clear() {
+ this.curDateGap = "杩戜竷澶�"
+ this.enableCustomDateRange = false
+ this.startDate = dayjs(new Date()).subtract(7, 'day').format('YYYY-MM-DD')
+ this.endDate = dayjs(new Date()).format('YYYY-MM-DD')
+ this.HBillNo = ''
+ },
+ async onResetClickHandler() {
+ this.clear()
+ await this.$nextTick()
+ this.onSearchClickHandler()
+ },
+ get_DisplayPage(sWhere) {
+ CommonUtils.doRequest2({
+ url: '/Sc_EmployeeSignInNoteBillController/GetListPage',
+ data: {
+ "sWhere": sWhere,
+ "user": getUserInfo()["Czymc"],
+ },
+ resFunction: (res) => {
+ let {
+ data,
+ Message,
+ count
+ } = res.data
+ console.log('res.data: ', res.data);
+ this.listData = data;
+ this.pageMeta.total = count
+ uni.stopPullDownRefresh()
+ }
+ })
+ },
+ onPageChangeHandler() {
+ this.onSearchClickHandler()
+ this.goTop()
+ },
+ // 鏂板
+ onAddClickHandler() {
+ uni.navigateTo({
+ url: "/pages/EmployeeRecords/EmployeeRecordsBill?operationType=1"
+ })
+ },
+ //缂栬緫鐐规璁板綍鍗�
+ edit(item) {
+ console.log(item)
+ uni.navigateTo({
+ url: '/pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckBill?operationType=3&hmainid=' + item.hmainid
+ })
+ },
+ //鍒犻櫎鐐规璁板綍鍗�
+ del(item) {
+ uni.showModal({
+ title: '鍒犻櫎纭',
+ content: '纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ CommonUtils.doRequest2({
+ url: '/Sc_EmployeeSignInNoteBillController/deleteBill',
+ data: {
+ HItemID: item['InterID'],
+ user: getUserInfo()['Czymc']
+ },
+ resFunction: (res) => {
+ let {
+ data,
+ count,
+ Message
+ } = res.data
+ if (count == 1) {
+ uni.showToast({
+ icon: count === 1 ? 'success' : 'error',
+ title: Message,
+ duration: 2000
+ });
+
+ // 绛夊緟鎻愮ず鏄剧ず瀹屾垚鍐嶅埛鏂�
+ setTimeout(() => {
+ this.onSearchClickHandler();
+ }, 2000);
+ } else {
+ uni.showToast({
+ icon: 'none',
+ title: Message
+ })
+ }
+ }
+ })
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ }
+ }
+ });
+ }
+ },
+ }
+</script>
+
+<style lang="scss">
+ .page-header {
+ display: flex;
+ box-sizing: border-box;
+ padding: 20rpx;
+ flex-direction: column;
+ gap: 10rpx;
+ font-size: 32rpx;
+
+ .search-item {
+ display: flex;
+ flex-direction: row;
+ gap: 10rpx;
+ justify-content: center;
+ align-items: center;
+
+ .left {
+ width: 4em;
+ }
+
+ .right {
+ flex: 1;
+ position: relative;
+ border-radius: 22rpx;
+ border: 1px solid #acacac;
+ display: flex;
+ padding: 4rpx 10rpx;
+
+ picker {
+ width: 100%;
+ }
+ }
+ }
+
+ input {
+ width: inherit;
+ padding: 8rpx 20rpx;
+ font-size: 30rpx;
+ }
+
+ .datetime-picker-inner {
+ padding: 8rpx 20rpx;
+ font-size: 30rpx;
+ display: flex;
+ align-items: center;
+ }
+
+ .font__enable {
+ color: #000;
+ }
+
+ .font__disable {
+ color: #cccccc;
+ }
+ }
+
+ .button-groups {
+ box-sizing: border-box;
+ padding: 10rpx 0 0 0;
+ display: flex;
+ flex-direction: row;
+ gap: 10rpx;
+ justify-content: space-between;
+
+ button {
+ border-radius: 50rpx;
+ width: 180rpx;
+ height: 66rpx;
+ line-height: 66rpx;
+ font-size: 28rpx;
+ }
+
+ .btn-a {
+ background-color: #acacac;
+ color: #fff;
+ }
+
+ .btn-b {
+ background-color: #41a863;
+ color: #fff;
+ }
+
+ .btn-c {
+ background-color: #3a78ff;
+ color: #fff;
+ }
+ }
+
+ .page-content {
+ // height: 40vh;
+ box-sizing: border-box;
+ padding: 10rpx 0;
+
+ .card-detail {
+ width: 100%;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ line-height: 120%;
+
+ .detail {
+ // width: 50%;
+ font-size: 26rpx;
+ margin-bottom: 12rpx;
+ color: #555;
+ margin-right: 20rpx;
+
+ text {
+ color: #999;
+ font-size: 26rpx;
+ }
+ }
+ }
+
+ .more {
+ color: #888;
+ font-size: 24rpx;
+ display: flex;
+ border-top: 1px solid #eee;
+ padding-top: 20rpx;
+
+ .part {
+ width: 50%;
+ text-align: center;
+ }
+ }
+
+ .op {
+ display: flex;
+ justify-content: space-around;
+ margin-top: 20rpx;
+
+ button {
+ padding: 0;
+ width: 150rpx;
+ font-size: 25rpx;
+ }
+
+ .op1 {
+ border: 1px solid #41a863;
+ color: #41a863;
+ }
+
+ .op2 {
+ border: 1px solid #d98d00;
+ color: #d98d00;
+ }
+
+ .op3 {
+ border: 1px solid #3a78ff;
+ color: #3a78ff;
+ }
+
+ .op4 {
+ border: 1px solid #da0000;
+ color: #da0000;
+ }
+
+ .op5 {
+ border: 1px solid #888;
+ color: #888;
+ }
+ }
+ }
+
+ .page-footer {
+ position: fixed;
+ bottom: 0;
+ width: 100%;
+ box-sizing: border-box;
+ padding: 32rpx 40rpx;
+ }
+</style>
\ No newline at end of file
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 5dfac23..c486320 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -337,6 +337,7 @@
"id": 26,
"hidden": false
},
+
],
}
diff --git a/pages/index/login.vue b/pages/index/login.vue
index 85b3051..00e4498 100644
--- a/pages/index/login.vue
+++ b/pages/index/login.vue
@@ -330,6 +330,12 @@
uni.setStorageSync('HWorkCenterName', res.data.data[0].HWorkCenterName);
uni.setStorageSync('HSecManagerID', res.data.data[0].HSecManagerID); //瀵瑰簲楠屾敹
uni.setStorageSync('HSecManagerName', res.data.data[0].HSecManagerName);
+ uni.setStorageSync('HProcID', res.data.data[0].HProcID);
+ uni.setStorageSync('HProcName', res.data.data[0].HProcName);
+ uni.setStorageSync('HSourceID', res.data.data[0].HSourceID);
+ uni.setStorageSync('HSourceName', res.data.data[0].HSourceName);
+ uni.setStorageSync('HGroupID', res.data.data[0].HGroupID);
+ uni.setStorageSync('HGroupName', res.data.data[0].HGroupName);
this.CommonUtils.setServerUrl(this.serverUrl)
uni.reLaunch({
url: '/pages/index/index'
diff --git a/pages/index/tab1.vue b/pages/index/tab1.vue
index 1c72b32..541524a 100644
--- a/pages/index/tab1.vue
+++ b/pages/index/tab1.vue
@@ -70,6 +70,7 @@
id: 4,
hidden: false,
},
+
{
img: '../../static/icon/icon14.png',
text: '鎴戠殑鎶ュ伐骞冲彴',
@@ -86,8 +87,22 @@
id: 6,
hidden: false,
},
-
-
+ {
+ img: '../../static/icon/icon12.png',
+ text: '鍛樺伐绛惧埌璁板綍鍗�',
+ tip: '绔嬪嵆鏂板',
+ url: '/pages/EmployeeRecords/EmployeeRecordsBill',
+ id: 7,
+ hidden: false,
+ },
+ {
+ img: '../../static/icon/icon12.png',
+ text: '鍛樺伐绛惧埌璁板綍鍗曞垪琛�',
+ tip: '鐐瑰嚮杩涘叆',
+ url: '/pages/EmployeeRecords/EmployeeRecordsBillList',
+ id: 8,
+ hidden: false,
+ }
]
}
},
--
Gitblit v1.9.1