From 25508db9e43fe793d7a34fa2d8ca1d7244d887a6 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期四, 17 七月 2025 16:11:56 +0800
Subject: [PATCH] PDA核磅录入除提交外其余地方联调结果
---
pages/wareHouse/nuclearScale/createwriteoffform.vue | 563 +++++-
pages/wareHouse/nuclearScale/saveForm.vue | 378 +++++
pages/wareHouse/inventory/index.vue | 710 ++++----
pages/wareHouse/nuclearScale/nuclearScaleList.vue | 798 +++++-----
pages/wareHouse/nuclearScale/index.vue | 452 ++++-
pages/wareHouse/nuclearScale/index.scss | 243 +++
common/http.api.js | 4
pages/wareHouse/nuclearScale/nuclearscalerecord.vue | 1261 +++++++++-------
8 files changed, 2,844 insertions(+), 1,565 deletions(-)
diff --git a/common/http.api.js b/common/http.api.js
index 1887d8f..164c0ab 100644
--- a/common/http.api.js
+++ b/common/http.api.js
@@ -547,6 +547,10 @@
NuclearScaleEntry: {
// 鑾峰彇瀹㈡埛鍚嶇О
selClient: (params = {}) => vm.$u.get('/mes/weighingVerification/selClient'),
+ // 鍒涘缓鏍哥鍗曟彁浜�
+ createMain: (params = {}) => vm.$u.post('/mes/weighingVerification/createMain', params),
+ // 鏍哥鍗曞彿
+ getWeighingOrder: (params = {}) => vm.$u.get('/mes/weighingVerification/pageVerificationMain', params),
}
};
diff --git a/pages/wareHouse/inventory/index.vue b/pages/wareHouse/inventory/index.vue
index eec0586..22e8c67 100644
--- a/pages/wareHouse/inventory/index.vue
+++ b/pages/wareHouse/inventory/index.vue
@@ -32,7 +32,8 @@
<view class="item-one item-two" @click="openPN()">
<text>{{ registerInfo.value6 == '' ? "鐐瑰嚮杈撳叆" : registerInfo.value6 }}</text>
</view>
- <u-icon name="arrow-right" color="#687792" size="28" v-show="registerInfo.value6 == ''"></u-icon>
+ <u-icon name="arrow-right" color="#687792" size="28"
+ v-show="registerInfo.value6 == ''"></u-icon>
</view>
</view>
<view class="packing-registration-param-item param-extra">
@@ -40,8 +41,10 @@
<text class="item-one">鎵规鍙�</text>
</view>
<view class="packing-registration-param-item-right" @click="openBatch()">
- <text class="item-one item-two">{{ registerInfo.value3 == '' ? "鐐瑰嚮杈撳叆" : registerInfo.value3 }}</text>
- <u-icon name="arrow-right" color="#687792" size="28" v-show="registerInfo.value3 == ''"></u-icon>
+ <text
+ class="item-one item-two">{{ registerInfo.value3 == '' ? "鐐瑰嚮杈撳叆" : registerInfo.value3 }}</text>
+ <u-icon name="arrow-right" color="#687792" size="28"
+ v-show="registerInfo.value3 == ''"></u-icon>
</view>
</view>
<view class="packing-registration-param-item param-extra">
@@ -52,7 +55,8 @@
<view class="item-one item-two">
<text>{{ registerInfo.value4 == '' ? "鐐瑰嚮杈撳叆" : registerInfo.value4 }}</text>
</view>
- <u-icon name="arrow-right" color="#687792" size="28" v-show="registerInfo.value4 == ''"></u-icon>
+ <u-icon name="arrow-right" color="#687792" size="28"
+ v-show="registerInfo.value4 == ''"></u-icon>
</view>
</view>
<view class="packing-registration-param-item param-extra">
@@ -63,7 +67,8 @@
<view class="item-one item-two">
<text>{{ registerInfo.value5 == '' ? "鐐瑰嚮杈撳叆" : registerInfo.value5 }}</text>
</view>
- <u-icon name="arrow-right" color="#687792" size="28" v-show="registerInfo.value4 == ''"></u-icon>
+ <u-icon name="arrow-right" color="#687792" size="28"
+ v-show="registerInfo.value4 == ''"></u-icon>
</view>
</view>
<view class="packing-registration-param-item param-extra">
@@ -139,414 +144,415 @@
</modalBg>
<!-- 鐩樼偣鏁伴噺 -->
<modalBg ref="openPhysicalInventory" :confirm="confirmPhysicalInventory">
- <u-field v-model="registerInfo.value5" label="鐩樼偣鏁伴噺锛�" label-width="140" placeholder="璇疯緭鍏�" :border-bottom="false">
+ <u-field v-model="registerInfo.value5" label="鐩樼偣鏁伴噺锛�" label-width="140" placeholder="璇疯緭鍏�"
+ :border-bottom="false">
</u-field>
</modalBg>
</view>
</view>
</template>
<script>
-import modalBg from '@/components/modal/modal-bg.vue'
-import scan from "@/components/scan/scan.vue";
-import content_bg from '@/static/custom/packing/backBg.png'
-export default {
- components: {
- scan,
- modalBg
- },
- data() {
- return {
- background: {
- backgroundImage: `url(${content_bg})`,
- backgroundAttachment: 'fixed',
- backgroundSize: '100% auto',
- backgroundRepeat: 'no-repeat',
- },
- labelStyle: {
- fontSize: '32rpx',
- whiteSpace: 'nowrap'
- },
- registerInfo: {
- value1: '',
- value2: '',
- value3: '',
- value4: '',
- value5: '',
- value6: ''
- },
- hasScanSnList: [{
- value0: '11111111111111111111111',
- value1: '111',
- value2: '111',
- value3: '111',
- },
- {
- value0: '111',
- value1: '111',
- value2: '111',
- value3: '111',
- },
- {
- value0: '111',
- value1: '111',
- value2: '111',
- value3: '111',
- },
- {
- value0: '111',
- value1: '111',
- value2: '111',
- value3: '111',
- },
- ],
- delContent: null,
- staffList: [],
- };
- },
- onLoad(option) { },
- onShow() {
+ import modalBg from '@/components/modal/modal-bg.vue'
+ import scan from "@/components/scan/scan.vue";
+ import content_bg from '@/static/custom/packing/backBg.png'
+ export default {
+ components: {
+ scan,
+ modalBg
+ },
+ data() {
+ return {
+ background: {
+ backgroundImage: `url(${content_bg})`,
+ backgroundAttachment: 'fixed',
+ backgroundSize: '100% auto',
+ backgroundRepeat: 'no-repeat',
+ },
+ labelStyle: {
+ fontSize: '32rpx',
+ whiteSpace: 'nowrap'
+ },
+ registerInfo: {
+ value1: '',
+ value2: '',
+ value3: '',
+ value4: '',
+ value5: '',
+ value6: ''
+ },
+ hasScanSnList: [{
+ value0: '11111111111111111111111',
+ value1: '111',
+ value2: '111',
+ value3: '111',
+ },
+ {
+ value0: '111',
+ value1: '111',
+ value2: '111',
+ value3: '111',
+ },
+ {
+ value0: '111',
+ value1: '111',
+ value2: '111',
+ value3: '111',
+ },
+ {
+ value0: '111',
+ value1: '111',
+ value2: '111',
+ value3: '111',
+ },
+ ],
+ delContent: null,
+ staffList: [],
+ };
+ },
+ onLoad(option) {},
+ onShow() {
- let that = this
+ let that = this
- uni.$off('scan') // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒
- uni.$on('scan', function (data) {
- console.log('onscan');
- //鎵爜鎴愬姛鍚庣殑鍥炶皟锛屼綘鍙互鍐欒嚜宸辩殑閫昏緫浠g爜鍦ㄨ繖閲�
- console.log('鎵爜缁撴灉锛�', data.code);
- that.scanHandle(data.code)
- that.$forceUpdate();
+ uni.$off('scan') // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒
+ uni.$on('scan', function(data) {
+ console.log('onscan');
+ //鎵爜鎴愬姛鍚庣殑鍥炶皟锛屼綘鍙互鍐欒嚜宸辩殑閫昏緫浠g爜鍦ㄨ繖閲�
+ console.log('鎵爜缁撴灉锛�', data.code);
+ that.scanHandle(data.code)
+ that.$forceUpdate();
- })
- },
- onNavigationBarButtonTap() {
- this.goScan()
- },
- onReady() { },
- methods: {
- //闆朵欢鍙�
- openPN() {
- this.$refs.openPN.open();
- },
- // 寮规淇濆瓨
- confirmPN() {
- console.log('淇濆瓨', this.registerInfo.value6);
- // 璇锋眰鎺ュ彛锛屾牴鎹伐鍗曞彿鏌ヨ鍏朵粬淇℃伅骞惰祴鍊�
- },
- //鎵规鍙�
- openBatch() {
- this.$refs.openBatch.open();
- },
- // 寮规淇濆瓨
- confirmBatch() {
- console.log('淇濆瓨', this.registerInfo.value3);
- // 璇锋眰鎺ュ彛锛屾牴鎹伐鍗曞彿鏌ヨ鍏朵粬淇℃伅骞惰祴鍊�
- },
- //搴撲綅鍙�
- openLocation() {
- this.$refs.openLocation.open();
- },
- // 寮规淇濆瓨
- confirmLocation() {
- console.log('淇濆瓨', this.registerInfo.value4);
- // 璇锋眰鎺ュ彛锛屾牴鎹伐鍗曞彿鏌ヨ鍏朵粬淇℃伅骞惰祴鍊�
- },
- //鐩樼偣鏁伴噺
- openPhysicalInventory() {
- this.$refs.openPhysicalInventory.open();
- },
- // 寮规淇濆瓨
- confirmPhysicalInventory() {
- console.log('淇濆瓨', this.registerInfo.value5);
- // 璇锋眰鎺ュ彛锛屾牴鎹伐鍗曞彿鏌ヨ鍏朵粬淇℃伅骞惰祴鍊�
- },
-
- setNo(val) {
- console.log('11111', val)
- this.registerInfo.value1 = val.value1
- this.registerInfo.value2 = val.value2
-
- },
- //鐩樼偣鎶ュ憡鍙�
- seachPersonnelNo() {
- console.log('11111')
- uni.navigateTo({
- url: '/pages/wareHouse/inventory/orderList'
})
},
- goScan() {
- uni.scanCode({
- scanType: ['qrCode'],
- success: res => {
- try {
- console.log('鎵爜缁撴灉锛�', res);
- this.scanHandle(res.result)
- } catch (e) { }
- }
- });
+ onNavigationBarButtonTap() {
+ this.goScan()
},
- scanHandle(scanresult) {
- scanresult = scanresult.replace(/[\r\n]/g, "")
- if (scanresult.indexOf('{') > -1) {
- //浜岀淮鐮�
- const result = JSON.parse(scanresult)
- //澧炲姞SN鏍¢獙
- if (result.sn_no && result.sn_no != null && result.sn_no != '') {
- if (this.hasScanSnList.length > 0) {
- let hasScanSnIndex = this.hasScanSnList.indexOf(result.sn_no)
- if (hasScanSnIndex < 0) {
+ onReady() {},
+ methods: {
+ //闆朵欢鍙�
+ openPN() {
+ this.$refs.openPN.open();
+ },
+ // 寮规淇濆瓨
+ confirmPN() {
+ console.log('淇濆瓨', this.registerInfo.value6);
+ // 璇锋眰鎺ュ彛锛屾牴鎹伐鍗曞彿鏌ヨ鍏朵粬淇℃伅骞惰祴鍊�
+ },
+ //鎵规鍙�
+ openBatch() {
+ this.$refs.openBatch.open();
+ },
+ // 寮规淇濆瓨
+ confirmBatch() {
+ console.log('淇濆瓨', this.registerInfo.value3);
+ // 璇锋眰鎺ュ彛锛屾牴鎹伐鍗曞彿鏌ヨ鍏朵粬淇℃伅骞惰祴鍊�
+ },
+ //搴撲綅鍙�
+ openLocation() {
+ this.$refs.openLocation.open();
+ },
+ // 寮规淇濆瓨
+ confirmLocation() {
+ console.log('淇濆瓨', this.registerInfo.value4);
+ // 璇锋眰鎺ュ彛锛屾牴鎹伐鍗曞彿鏌ヨ鍏朵粬淇℃伅骞惰祴鍊�
+ },
+ //鐩樼偣鏁伴噺
+ openPhysicalInventory() {
+ this.$refs.openPhysicalInventory.open();
+ },
+ // 寮规淇濆瓨
+ confirmPhysicalInventory() {
+ console.log('淇濆瓨', this.registerInfo.value5);
+ // 璇锋眰鎺ュ彛锛屾牴鎹伐鍗曞彿鏌ヨ鍏朵粬淇℃伅骞惰祴鍊�
+ },
+
+ setNo(val) {
+ console.log('11111', val)
+ this.registerInfo.value1 = val.value1
+ this.registerInfo.value2 = val.value2
+
+ },
+ //鐩樼偣鎶ュ憡鍙�
+ seachPersonnelNo() {
+ console.log('11111')
+ uni.navigateTo({
+ url: '/pages/wareHouse/inventory/orderList'
+ })
+ },
+ goScan() {
+ uni.scanCode({
+ scanType: ['qrCode'],
+ success: res => {
+ try {
+ console.log('鎵爜缁撴灉锛�', res);
+ this.scanHandle(res.result)
+ } catch (e) {}
+ }
+ });
+ },
+ scanHandle(scanresult) {
+ scanresult = scanresult.replace(/[\r\n]/g, "")
+ if (scanresult.indexOf('{') > -1) {
+ //浜岀淮鐮�
+ const result = JSON.parse(scanresult)
+ //澧炲姞SN鏍¢獙
+ if (result.sn_no && result.sn_no != null && result.sn_no != '') {
+ if (this.hasScanSnList.length > 0) {
+ let hasScanSnIndex = this.hasScanSnList.indexOf(result.sn_no)
+ if (hasScanSnIndex < 0) {
+ this.hasScanSnList.push(result.sn_no)
+ } else {
+ this.$u.toast('璇峰嬁閲嶅鎵弿')
+ }
+ } else {
this.hasScanSnList.push(result.sn_no)
+ }
+ }
+
+ } else {
+ //澧炲姞SN鏍¢獙
+ if (this.hasScanSnList.length > 0) {
+ let hasScanSnIndex = this.hasScanSnList.indexOf(scanresult)
+ if (hasScanSnIndex < 0) {
+ this.hasScanSnList.push(scanresult)
} else {
this.$u.toast('璇峰嬁閲嶅鎵弿')
}
} else {
- this.hasScanSnList.push(result.sn_no)
- }
- }
-
- } else {
- //澧炲姞SN鏍¢獙
- if (this.hasScanSnList.length > 0) {
- let hasScanSnIndex = this.hasScanSnList.indexOf(scanresult)
- if (hasScanSnIndex < 0) {
this.hasScanSnList.push(scanresult)
- } else {
- this.$u.toast('璇峰嬁閲嶅鎵弿')
}
- } else {
- this.hasScanSnList.push(scanresult)
}
- }
- },
- goSubmit() {
- // if (this.registerInfo.shiftId == null || this.registerInfo.shiftId == '') {
- // this.$u.toast('璇烽�夋嫨鐝')
- // return
- // }
- // if (this.registerInfo.value3 == null || this.registerInfo.value3 == '') {
- // this.$u.toast('璇烽�夋嫨鏃ユ湡')
- // return
- // }
- // if (this.registerInfo.locNo == null || this.registerInfo.locNo == '') {
- // this.$u.toast('璇烽�夋嫨鍖呰搴撲綅')
- // return
- // }
- // if (this.hasScanSnList.length == 0) {
- // this.$u.toast('鏃犲緟鎻愪氦鐨凷N鍙锋槑缁�')
- // return
- // }
- // let registrList = []
- // this.staffList = []
- // this.staffNameList.forEach((item) => {
- // this.staffList.push({
- // staffId: item.id
- // })
- // })
- // this.hasScanSnList.forEach((item) => {
- // registrList.push({
- // shiftId: this.registerInfo.shiftId,
- // value3: this.registerInfo.value3,
- // locNo: this.registerInfo.locNo,
- // partBatchNo: item,
- // staffList: this.staffList
- // })
- // })
- // this.$u.api.pigxPacking.addPackageRegister(registrList).then(res => {
- // let resData = res.data
- // this.hasScanSnList = []
- // this.$u.toast('鎻愪氦鎴愬姛')
- // }).catch((e) => {
- // })
+ },
+ goSubmit() {
+ // if (this.registerInfo.shiftId == null || this.registerInfo.shiftId == '') {
+ // this.$u.toast('璇烽�夋嫨鐝')
+ // return
+ // }
+ // if (this.registerInfo.value3 == null || this.registerInfo.value3 == '') {
+ // this.$u.toast('璇烽�夋嫨鏃ユ湡')
+ // return
+ // }
+ // if (this.registerInfo.locNo == null || this.registerInfo.locNo == '') {
+ // this.$u.toast('璇烽�夋嫨鍖呰搴撲綅')
+ // return
+ // }
+ // if (this.hasScanSnList.length == 0) {
+ // this.$u.toast('鏃犲緟鎻愪氦鐨凷N鍙锋槑缁�')
+ // return
+ // }
+ // let registrList = []
+ // this.staffList = []
+ // this.staffNameList.forEach((item) => {
+ // this.staffList.push({
+ // staffId: item.id
+ // })
+ // })
+ // this.hasScanSnList.forEach((item) => {
+ // registrList.push({
+ // shiftId: this.registerInfo.shiftId,
+ // value3: this.registerInfo.value3,
+ // locNo: this.registerInfo.locNo,
+ // partBatchNo: item,
+ // staffList: this.staffList
+ // })
+ // })
+ // this.$u.api.pigxPacking.addPackageRegister(registrList).then(res => {
+ // let resData = res.data
+ // this.hasScanSnList = []
+ // this.$u.toast('鎻愪氦鎴愬姛')
+ // }).catch((e) => {
+ // })
- },
- }
-};
+ },
+ }
+ };
</script>
<style lang="scss" scoped>
-.packing-registration-bg {
- background-color: #F6F9FF;
- background-image: url('~@/static/custom/packing/backBg.png');
- padding: 0 20rpx;
- background-attachment: fixed;
- background-size: 100% auto;
- background-repeat: no-repeat;
- position: fixed;
- top: 0;
- bottom: 0;
- width: 100%;
- z-index: -1;
-}
-
-.packing-registration-param {
- padding: 40rpx 30rpx 10rpx 30rpx;
-
- .packing-registration-param-title {
- display: flex;
- flex-direction: row;
- align-items: center;
- margin-bottom: 30rpx;
-
- .title-label {
- margin-left: 14rpx;
- font-size: 34rpx;
- font-weight: bold;
- color: #283E65;
- }
+ .packing-registration-bg {
+ background-color: #F6F9FF;
+ background-image: url('~@/static/custom/packing/backBg.png');
+ padding: 0 20rpx;
+ background-attachment: fixed;
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ width: 100%;
+ z-index: -1;
}
- .packing-registration-param-view {
- height: 615rpx;
- background-color: #fff;
- border-radius: 10rpx;
- padding: 0rpx 23rpx;
- margin-bottom: 30rpx;
+ .packing-registration-param {
+ padding: 40rpx 30rpx 10rpx 30rpx;
- .packing-registration-param-item {
- height: 90rpx;
- border: 1px solid #ADC8E4;
- line-height: 90rpx;
+ .packing-registration-param-title {
display: flex;
- justify-content: space-between;
- border: none;
+ flex-direction: row;
+ align-items: center;
+ margin-bottom: 30rpx;
- .packing-registration-param-item-left {
- .item-one {
- font-size: 30rpx;
- color: #666666;
- }
+ .title-label {
+ margin-left: 14rpx;
+ font-size: 34rpx;
+ font-weight: bold;
+ color: #283E65;
}
+ }
- .packing-registration-param-item-right {
+ .packing-registration-param-view {
+ height: 615rpx;
+ background-color: #fff;
+ border-radius: 10rpx;
+ padding: 0rpx 23rpx;
+ margin-bottom: 30rpx;
+
+ .packing-registration-param-item {
+ height: 90rpx;
+ border: 1px solid #ADC8E4;
+ line-height: 90rpx;
display: flex;
justify-content: space-between;
+ border: none;
- .item-one {
- font-size: 30rpx;
- color: #333333;
- margin-right: 6rpx;
+ .packing-registration-param-item-left {
+ .item-one {
+ font-size: 30rpx;
+ color: #666666;
+ }
}
- .item-two {
- font-size: 30rpx;
- color: #A6B4CC;
- margin-right: 6rpx;
- }
+ .packing-registration-param-item-right {
+ display: flex;
+ justify-content: space-between;
- .item-three {
- font-size: 30rpx;
- color: #214DED;
- margin-right: 6rpx;
+ .item-one {
+ font-size: 30rpx;
+ color: #333333;
+ margin-right: 6rpx;
+ }
+
+ .item-two {
+ font-size: 30rpx;
+ color: #A6B4CC;
+ margin-right: 6rpx;
+ }
+
+ .item-three {
+ font-size: 30rpx;
+ color: #214DED;
+ margin-right: 6rpx;
+ }
}
}
- }
- .param-extra {
- border-bottom: 1px solid #EDEDED;
+ .param-extra {
+ border-bottom: 1px solid #EDEDED;
+ }
}
}
-}
-.wrap .packing-registration-scroll-list {
- height: calc(100vh - var(--window-top) - var(--window-bottom) - 930rpx);
- width: 100%;
-}
-
-.packing-registration-scroll-list-group {
- ::v-deep .u-cell-item-box {
- background-color: rgba(250, 252, 255, 0.36) !important;
- padding: 0rpx 30rpx;
+ .wrap .packing-registration-scroll-list {
+ height: calc(100vh - var(--window-top) - var(--window-bottom) - 930rpx);
+ width: 100%;
}
- .content {
- font-size: 12px;
- background-color: #ffffff;
- box-sizing: border-box;
- border-radius: 10rpx;
- margin: 0rpx 0rpx 16rpx;
- padding: 20rpx 8rpx;
- box-shadow: none;
- display: flex;
- align-items: center;
+ .packing-registration-scroll-list-group {
+ ::v-deep .u-cell-item-box {
+ background-color: rgba(250, 252, 255, 0.36) !important;
+ padding: 0rpx 30rpx;
+ }
- .content-header {
- width: 40rpx;
- height: 90rpx;
+ .content {
+ font-size: 12px;
+ background-color: #ffffff;
+ box-sizing: border-box;
+ border-radius: 10rpx;
+ margin: 0rpx 0rpx 16rpx;
+ padding: 20rpx 8rpx;
+ box-shadow: none;
display: flex;
align-items: center;
- .content-header-icon {
- background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
- background-size: 100% auto;
- background-repeat: no-repeat;
- height: 28rpx;
- width: 28rpx;
- }
-
- .content-header-title {
- margin-left: 11rpx;
- font-size: 26rpx;
- font-weight: bold;
- color: #626369;
- }
- }
-
- .content-body {
- flex: 1;
- background-color: #ffffff;
- border-radius: 10rpx;
- padding: 0rpx 23rpx;
-
- .row-list {
- height: 60rpx;
+ .content-header {
+ width: 40rpx;
+ height: 90rpx;
display: flex;
- flex-direction: row;
- padding: 0px;
- align-items: center;
- }
-
- .row-list ._label {
- display: flex;
- flex: 0.8;
- color: #909399;
align-items: center;
- ._label-name {
+ .content-header-icon {
+ background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ height: 28rpx;
+ width: 28rpx;
+ }
+
+ .content-header-title {
margin-left: 11rpx;
font-size: 26rpx;
- font-weight: 500;
- color: #666666;
+ font-weight: bold;
+ color: #626369;
}
}
- .row-list ._content {
- flex: 1.5;
- text-align: right;
- color: #909399;
- font-size: 24rpx;
- }
+ .content-body {
+ flex: 1;
+ background-color: #ffffff;
+ border-radius: 10rpx;
+ padding: 0rpx 23rpx;
- .row-list .s1 {
- color: #d35651;
+ .row-list {
+ height: 60rpx;
+ display: flex;
+ flex-direction: row;
+ padding: 0px;
+ align-items: center;
+ }
+
+ .row-list ._label {
+ display: flex;
+ flex: 0.8;
+ color: #909399;
+ align-items: center;
+
+ ._label-name {
+ margin-left: 11rpx;
+ font-size: 26rpx;
+ font-weight: 500;
+ color: #666666;
+ }
+ }
+
+ .row-list ._content {
+ flex: 1.5;
+ text-align: right;
+ color: #909399;
+ font-size: 24rpx;
+ }
+
+ .row-list .s1 {
+ color: #d35651;
+ }
}
}
}
-}
-.registration-form-footer {
- display: flex;
- margin-top: 10rpx;
- margin-bottom: 10rpx;
- margin-left: 20rpx;
- margin-right: 20rpx;
- padding-bottom: 14rpx;
+ .registration-form-footer {
+ display: flex;
+ margin-top: 10rpx;
+ margin-bottom: 10rpx;
+ margin-left: 20rpx;
+ margin-right: 20rpx;
+ padding-bottom: 14rpx;
- .btn {
- flex: 1;
- margin: 10rpx;
- background: #214DED;
- box-shadow: 0rpx 6rpx 8rpx 0rpx rgba(4, 49, 212, 0.3);
- font-weight: bold;
- color: #FEFEFE;
- font-family: PingFang SC;
+ .btn {
+ flex: 1;
+ margin: 10rpx;
+ background: #214DED;
+ box-shadow: 0rpx 6rpx 8rpx 0rpx rgba(4, 49, 212, 0.3);
+ font-weight: bold;
+ color: #FEFEFE;
+ font-family: PingFang SC;
+ }
}
-}
</style>
\ No newline at end of file
diff --git a/pages/wareHouse/nuclearScale/createwriteoffform.vue b/pages/wareHouse/nuclearScale/createwriteoffform.vue
index 14963bf..dfaa5e2 100644
--- a/pages/wareHouse/nuclearScale/createwriteoffform.vue
+++ b/pages/wareHouse/nuclearScale/createwriteoffform.vue
@@ -4,77 +4,100 @@
<view class="packing-registration-bg" />
<u-navbar title="鏍哥褰曞叆" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
back-icon-color="#000" />
- <u-form :model="form" ref="uForm" :label-width="200" :rules="rules" :error-type="['toast']" class="uForm">
- <u-form-item label="浜у搧绫诲瀷" :border-bottom="false" prop="value0">
- <u-radio-group v-model="form.value0">
- <u-radio name="瀵间綋">瀵间綋</u-radio>
- <u-radio name="閾滄潌">閾滄潌</u-radio>
- <u-radio name="瀵间綋2.6">瀵间綋2.6</u-radio>
+ <u-form :model="form" ref="uForm" :label-width="210" labelAlign="left" :rules="rules" :error-type="['toast']"
+ class="uForm">
+ <u-form-item label="浜у搧绫诲瀷锛�" :border-bottom="false" prop="productType">
+ <u-radio-group v-model="form.productType" @change="handleProductTypeChange">
+ <u-radio name="1">瀵间綋</u-radio>
+ <u-radio name="2">閾滄潌</u-radio>
+ <u-radio name="3">瀵间綋2.6</u-radio>
</u-radio-group>
</u-form-item>
- <u-form-item label="鏇挎崲浜岀淮鐮�" :border-bottom="false" prop="value1">
- <u-radio-group v-model="form.value1">
+ <u-form-item label="鏇挎崲浜岀淮鐮侊細" :border-bottom="false" prop="replace">
+ <u-radio-group v-model="form.replace">
<u-radio name="1">鏄�</u-radio>
<u-radio name="0">鍚�</u-radio>
</u-radio-group>
</u-form-item>
- <u-form-item label="杞︾墝鍙�" :border-bottom="false" prop="value2">
- <u-input v-model="form.value2" type="select" placeholder="璇疯緭鍏ヨ溅鐗屽彿" @click="lpn" />
+ <u-form-item label="杞︾墝鍙凤細" :border-bottom="false" prop="licensePlate">
+ <u-input v-model="form.licensePlate" type="select" placeholder="璇疯緭鍏ヨ溅鐗屽彿" @click="lpn" />
</u-form-item>
- <u-form-item label="瀹㈡埛鍚嶇О" :border-bottom="false" prop="value3">
+ <u-form-item label="瀹㈡埛鍚嶇О1锛�" :border-bottom="false" prop="customerName1">
<picker class="item-one item-two" style="width: 100%; text-align: right"
- @change="locNoNumBindChange($event, locNoList)" :value="locNoNumIndex" :range="locNoList"
- range-key="label">
+ @change="selClientChange($event, selClientList, 'customerName1')" :value="selClientIndex1"
+ :range="selClientList" range-key="label">
<view>
- <text :style="{ color: locNoNumIndex == null ? '#a5abb4' : '#0c0c0c' }">{{
- locNoNumIndex == null
+ <text :style="{
+ color: selClientIndex1 == null ? '#a5abb4' : '#0c0c0c',
+ }">{{
+ selClientIndex1 == null
? "璇烽�夋嫨"
- : locNoList[locNoNumIndex].label
+ : selClientList[selClientIndex1].label
}}</text>
</view>
</picker>
- <u-icon v-if="locNoNumIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
+ <u-icon v-if="selClientIndex1 == null" name="arrow-right" color="#687792" size="28"></u-icon>
</u-form-item>
- <u-form-item label="鍙戣揣閫氱煡鍗曞彿" :border-bottom="false" prop="value4">
- <u-input v-model="form.value4" placeholder="" disabled />
+ <u-form-item label="鍙戣揣閫氱煡鍗曞彿1锛�" :border-bottom="false" prop="shippingNoticeNo1">
+ <u-input v-model="form.shippingNoticeNo1" placeholder="" disabled />
</u-form-item>
- <u-form-item label="鐢熶骇杞﹂棿" :border-bottom="false" prop="value5">
+ <u-form-item label="瀹㈡埛鍚嶇О2锛�" :border-bottom="false" prop="customerName2">
<picker class="item-one item-two" style="width: 100%; text-align: right"
- @change="locNoNumBindChange($event, locNoList)" :value="locNoNumIndex" :range="locNoList"
- range-key="label">
+ @change="selClientChange($event, selClientList, 'customerName2')" :value="selClientIndex2"
+ :range="selClientList" range-key="label">
<view>
- <text :style="{ color: locNoNumIndex == null ? '#a5abb4' : '#0c0c0c' }">{{
- locNoNumIndex == null
+ <text :style="{
+ color: selClientIndex2 == null ? '#a5abb4' : '#0c0c0c',
+ }">{{
+ selClientIndex2 == null
? "璇烽�夋嫨"
- : locNoList[locNoNumIndex].label
+ : selClientList[selClientIndex2].label
}}</text>
</view>
</picker>
- <u-icon v-if="locNoNumIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
+ <u-icon v-if="selClientIndex2 == null" name="arrow-right" color="#687792" size="28"></u-icon>
</u-form-item>
- <u-form-item label="鍙哥鍛�" :border-bottom="false" prop="value6">
+ <u-form-item label="鍙戣揣閫氱煡鍗曞彿2锛�" :border-bottom="false" prop="shippingNoticeNo2">
+ <u-input v-model="form.shippingNoticeNo2" placeholder="" disabled />
+ </u-form-item>
+ <u-form-item label="鐢熶骇杞﹂棿锛�" :border-bottom="false" prop="workshop">
<picker class="item-one item-two" style="width: 100%; text-align: right"
- @change="locNoNumBindChange($event, locNoList)" :value="locNoNumIndex" :range="locNoList"
- range-key="label">
+ @change="workshopChange($event, workshopList)" :value="workshopIndex" :range="workshopList"
+ range-key="label" :disabled="!form.productType">
<view>
- <text :style="{ color: locNoNumIndex == null ? '#a5abb4' : '#0c0c0c' }">{{
- locNoNumIndex == null
+ <text :style="{ color: workshopIndex == null ? '#a5abb4' : '#0c0c0c' }">{{
+ workshopIndex == null
? "璇烽�夋嫨"
- : locNoList[locNoNumIndex].label
+ : workshopList[workshopIndex].label
}}</text>
</view>
</picker>
- <u-icon v-if="locNoNumIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
+ <u-icon v-if="workshopIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
</u-form-item>
- <u-form-item label="鍙夎溅宸�" :border-bottom="false" prop="value7">
- <u-input v-model="form.value7" type="select" placeholder="璇烽�夋嫨" @click="openForkliftDriverList" />
+ <u-form-item label="鍙哥鍛橈細" :border-bottom="false" prop="weighingOperator">
+ <picker class="item-one item-two" style="width: 100%; text-align: right"
+ @change="weighmanChange($event, weighmanList)" :value="weighmanIndex" :range="weighmanList"
+ range-key="label">
+ <view>
+ <text :style="{ color: weighmanIndex == null ? '#a5abb4' : '#0c0c0c' }">{{
+ weighmanIndex == null
+ ? "璇烽�夋嫨"
+ : weighmanList[weighmanIndex].label
+ }}</text>
+ </view>
+ </picker>
+ <u-icon v-if="weighmanIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
+ </u-form-item>
+ <u-form-item label="鍙夎溅宸ワ細" :border-bottom="false" prop="forkliftOperator">
+ <u-input v-model="form.forkliftOperator" type="select" placeholder="璇烽�夋嫨"
+ @click="openForkliftDriverList" />
</u-form-item>
</u-form>
<u-button type="primary" class="bottom-button1" @click="submit">鍒涘缓</u-button>
<!--杞︾墝鍙� -->
<modalBg ref="modalBg" :confirm="confirm">
- <u-field v-model="form.value2" label="杞︾墝鍙凤細" placeholder="璇疯緭鍏�" :border-bottom="false">
+ <u-field v-model="form.licensePlate" label="杞︾墝鍙凤細" placeholder="璇疯緭鍏�" :border-bottom="false">
</u-field>
</modalBg>
<!-- 鍙夎溅宸� -->
@@ -103,32 +126,7 @@
},
data() {
return {
- checkboxList: [{
- label: "宸ヤ汉1",
- value: "a",
- checked: false,
- },
- {
- label: "宸ヤ汉2",
- value: "2",
- checked: false,
- },
- {
- label: "宸ヤ汉3",
- value: "3",
- checked: false,
- },
- {
- label: "宸ヤ汉4",
- value: "4",
- checked: false,
- },
- {
- label: "宸ヤ汉",
- value: "5",
- checked: false,
- },
- ],
+ checkboxList: [],
background: {
backgroundImage: `url(${content_bg})`,
backgroundAttachment: "fixed",
@@ -138,96 +136,228 @@
show: false,
num: 1,
form: {
- value0: "",
- value1: "",
- value2: "",
- value3: "",
- value4: "111",
- value5: "",
- value6: "",
- value7: "",
- value8: "",
+ replace: '0',
+ productType: '',
+ licensePlate: '',
+ customerName1: '',
+ shippingNoticeNo1: '',
+ customerName2: '',
+ shippingNoticeNo2: '',
+ workshop: '',
+ weighingOperator: '',
+ forkliftOperator: '',
},
rules: {
- value0: [{
+ productType: [{
required: true,
message: "璇烽�夋嫨浜у搧绫诲瀷",
trigger: ["change"],
}, ],
- value1: [{
+ replace: [{
required: true,
message: "璇烽�夋嫨鏄惁鏇挎崲浜岀淮鐮�",
trigger: ["change", "blur"],
}, ],
- value2: [{
+ licensePlate: [{
required: true,
message: "璇疯緭鍏ヨ溅鐗屽彿",
trigger: ["change", "blur"],
}, ],
- // value3: [
- // {
- // required: true,
- // message: "璇烽�夋嫨瀹㈡埛鍚嶇О",
- // trigger: ["change", "blur"],
- // },
- // ],
- value4: [{
- required: true,
- message: "璇疯緭鍏ュ彂璐ч�氱煡鍗曞彿",
- trigger: ["change"],
- }, ],
- value5: [{
+ workshop: [{
required: true,
message: "璇烽�夋嫨鐢熶骇杞﹂棿",
trigger: ["change"],
}, ],
- value6: [{
+ weighingOperator: [{
required: true,
message: "璇烽�夋嫨鍙哥鍛�",
trigger: ["change"],
}, ],
- value7: [{
- type: "array",
+ forkliftOperator: [{
+ type: "string",
required: true,
message: "璇疯嚦灏戦�夋嫨涓�涓弶杞﹀伐",
trigger: ["change"],
}, ],
},
- locNoList: [{
- value: "0",
- label: "鍏徃1",
- },
- {
- value: "1",
- label: "鍏徃2",
- },
- {
- value: "2",
- label: "鍏徃3",
- },
- {
- value: "3",
- label: "鍏徃4",
- },
- {
- value: "4",
- label: "鍏徃5",
- },
- {
- value: "5",
- label: "鍏徃6",
- },
- ],
- locNoNumIndex: null,
+ // 瀹㈡埛鍚嶇О
+ selClientList: [],
+ selClientIndex1: null,
+ selClientIndex2: null,
+ // 鐢熶骇杞﹂棿
+ workshopList: [],
+ workshopIndex: null,
+ // 鍙哥鍛�
+ weighmanList: [],
+ weighmanIndex: null,
showModal: false,
selectedItems: [],
+ id1: '',
+ id2: '',
+ isSubmitting: false
};
},
onReady() {
this.$refs.uForm.setRules(this.rules);
+ // 浠呭湪缁勪欢鍒濇鍔犺浇鏃惰幏鍙栨暟鎹�
+ if (this.selClientList.length === 0) {
+ this.fetchClients();
+ }
+ if (this.workshopList.length === 0) {
+ this.fetchWorkshops();
+ }
+ if (this.checkboxList.length === 0) {
+ this.fetchForkliftOperators();
+ }
+ if (this.weighmanList.length === 0) {
+ this.fetchWeighmen();
+ }
},
- onShow() {},
+ onShow() {
+ // 閲嶇疆琛ㄥ崟鏁版嵁
+ this.form = {
+ replace: '0',
+ productType: '',
+ licensePlate: '',
+ customerName1: '',
+ shippingNoticeNo1: '',
+ customerName2: '',
+ shippingNoticeNo2: '',
+ workshop: '',
+ weighingOperator: '',
+ forkliftOperator: '',
+ };
+ this.selClientIndex1 = null;
+ this.selClientIndex2 = null;
+ this.workshopIndex = null;
+ this.weighmanIndex = null;
+ this.checkboxList = this.checkboxList.map(item => ({
+ ...item,
+ checked: false
+ }));
+ this.$refs.uForm && this.$refs.uForm.resetValidation();
+ },
methods: {
+ /**
+ * 鑾峰彇瀹㈡埛鍒楄〃
+ */
+ fetchClients() {
+ this.$u.api.NuclearScaleEntry.selClient().then((res) => {
+ console.log('瀹㈡埛鍚嶇О', res)
+ if (res.code === 0) {
+ res.data.forEach((i) => {
+ const obj = Object.assign({
+ label: i.customerName,
+ value: i.customerName,
+ shippingNoticeNo: i.shippingNoticeNo,
+ id: i.id
+ });
+ this.selClientList.push(obj);
+ });
+ } else {
+ uni.showToast({
+ title: res.msg || '鑾峰彇瀹㈡埛鍚嶇О澶辫触',
+ icon: 'none'
+ });
+ }
+ }).catch(err => {
+ uni.showToast({
+ title: '缃戠粶閿欒锛岃幏鍙栧鎴峰悕绉板け璐�',
+ icon: 'none'
+ });
+ console.error('鑾峰彇瀹㈡埛鍚嶇О閿欒:', err);
+ });
+ },
+
+ /**
+ * 鑾峰彇杞﹂棿鍒楄〃
+ */
+ fetchWorkshops() {
+ this.$u.api.dictData({
+ dictType: 'workshop'
+ }).then(res => {
+ if (res.code === 0 && res.data.length > 0) {
+ res.data.forEach(i => {
+ const obj = Object.assign({
+ label: i.label,
+ value: i.value,
+ })
+ this.workshopList.push(obj)
+ })
+ } else {
+ uni.showToast({
+ title: res.msg || '鑾峰彇杞﹂棿鍒楄〃澶辫触',
+ icon: 'none'
+ });
+ }
+ }).catch(err => {
+ uni.showToast({
+ title: '缃戠粶閿欒锛岃幏鍙栬溅闂村垪琛ㄥけ璐�',
+ icon: 'none'
+ });
+ console.error('鑾峰彇杞﹂棿鍒楄〃閿欒:', err);
+ });
+ },
+
+ /**
+ * 鑾峰彇鍙夎溅宸ュ垪琛�
+ */
+ fetchForkliftOperators() {
+ this.$u.api.dictData({
+ dictType: 'forklift'
+ }).then(res => {
+ if (res.code === 0 && res.data.length > 0) {
+ res.data.forEach(i => {
+ const obj = Object.assign({
+ label: i.label,
+ value: i.label,
+ })
+ this.checkboxList.push(obj)
+ })
+ } else {
+ uni.showToast({
+ title: res.msg || '鑾峰彇鍙夎溅宸ュ垪琛ㄥけ璐�',
+ icon: 'none'
+ });
+ }
+ }).catch(err => {
+ uni.showToast({
+ title: '缃戠粶閿欒锛岃幏鍙栧弶杞﹀伐鍒楄〃澶辫触',
+ icon: 'none'
+ });
+ console.error('鑾峰彇鍙夎溅宸ュ垪琛ㄩ敊璇�:', err);
+ });
+ },
+
+ /**
+ * 鑾峰彇鍙哥鍛樺垪琛�
+ */
+ fetchWeighmen() {
+ this.$u.api.dictData({
+ dictType: 'weighing'
+ }).then(res => {
+ if (res.code === 0 && res.data.length > 0) {
+ res.data.forEach(i => {
+ const obj = Object.assign({
+ label: i.label,
+ value: i.label,
+ })
+ this.weighmanList.push(obj)
+ })
+ } else {
+ uni.showToast({
+ title: res.msg || '鑾峰彇鍙哥鍛樺垪琛ㄥけ璐�',
+ icon: 'none'
+ });
+ }
+ }).catch(err => {
+ uni.showToast({
+ title: '缃戠粶閿欒锛岃幏鍙栧徃纾呭憳鍒楄〃澶辫触',
+ icon: 'none'
+ });
+ console.error('鑾峰彇鍙哥鍛樺垪琛ㄩ敊璇�:', err);
+ });
+ },
// 澶嶉�夋鍙樺寲浜嬩欢
checkboxChange(e) {
const values = e.detail.value;
@@ -241,43 +371,196 @@
// 纭閫夋嫨
confirmSelection() {
- this.form.value7 = this.checkboxList
+ // 灏嗛�変腑鐨勫弶杞﹀伐鏍囩鏁扮粍杞负浠ラ�楀彿鍒嗛殧鐨勫瓧绗︿覆
+ this.form.forkliftOperator = this.checkboxList
.filter((item) => item.checked)
- .map((item) => item.label);
+ .map((item) => item.label)
+ .join(',');
},
+ cancel() {},
openForkliftDriverList() {
this.showModal = true;
},
- locNoNumBindChange(e, storage) {
+ // 瀹㈡埛鍚嶇О
+ selClientChange(e, storage, code) {
if (storage.length <= 0) {
- this.locNoNumIndex = null;
+ this.selClientIndex1 = null;
+ this.selClientIndex2 = null;
return;
}
- this.locNoNumIndex = e.target.value;
- this.form.value3 = storage[this.locNoNumIndex].label;
+ const selectedIndex = e.target.value;
+ const selectedCustomer = storage[selectedIndex];
+
+ // 妫�鏌ユ槸鍚﹂�夋嫨浜嗙浉鍚岀殑瀹㈡埛
+ if (code === "customerName1" && this.selClientIndex2 === selectedIndex) {
+ uni.showToast({
+ title: '涓嶈兘閫夋嫨鐩稿悓鐨勫鎴�',
+ icon: 'none'
+ });
+ return;
+ }
+ if (code === "customerName2" && this.selClientIndex1 === selectedIndex) {
+ uni.showToast({
+ title: '涓嶈兘閫夋嫨鐩稿悓鐨勫鎴�',
+ icon: 'none'
+ });
+ return;
+ }
+
+ if (code === "customerName2") {
+ this.selClientIndex2 = selectedIndex;
+ this.form.customerName2 = selectedCustomer.label;
+ this.form.shippingNoticeNo2 = selectedCustomer.shippingNoticeNo;
+ this.id2 = selectedCustomer.id;
+ }
+ if (code === "customerName1") {
+ this.selClientIndex1 = selectedIndex;
+ this.form.customerName1 = selectedCustomer.label;
+ this.form.shippingNoticeNo1 = selectedCustomer.shippingNoticeNo;
+ this.id1 = selectedCustomer.id
+ }
},
- // 鎵撳紑寮规--鍚庨潰杩橀渶瑕佺洃鍚壂鐮佹灙鎵爜缁撴灉锛岃祴鍊肩粰鎶ュ伐鍗曞彿瀛楁锛岀劧鍚庢墦寮�寮规閫夋嫨璁㈠崟鍙风瓑鎿嶄綔
+ // 鐢熶骇杞﹂棿
+ workshopChange(e, storage) {
+ if (storage.length <= 0) {
+ this.workshopIndex = null;
+ return;
+ }
+
+ const productType = this.form.productType;
+ const selectedWorkshop = storage[e.target.value];
+
+ // 妫�鏌ヤ骇鍝佺被鍨嬫槸鍚︿负閾滄潌(鍊间负2)
+ if (productType === '2') {
+ // 閾滄潌鍙兘閫夋嫨閾滄潌鐩稿叧杞﹂棿
+ if (!selectedWorkshop.label.includes('閾滄潌')) {
+ uni.showModal({
+ title: "鎻愮ず",
+ content: "閾滄潌浜у搧鍙兘閫夋嫨閾滄潌鐩稿叧杞﹂棿",
+ showCancel: false
+ });
+ return;
+ }
+ } else {
+ // 瀵间綋浜у搧涓嶈兘閫夋嫨閾滄潌杞﹂棿
+ if (selectedWorkshop.label.includes('閾滄潌')) {
+ uni.showModal({
+ title: "鎻愮ず",
+ content: "瀵间綋浜у搧涓嶈兘閫夋嫨閾滄潌杞﹂棿",
+ showCancel: false
+ });
+ return;
+ }
+ }
+
+ this.workshopIndex = e.target.value;
+ this.form.workshop = selectedWorkshop.label;
+ },
+ // 鍙哥鍛�
+ weighmanChange(e, storage) {
+ if (storage.length <= 0) {
+ this.weighmanIndex = null;
+ return;
+ }
+ this.weighmanIndex = e.target.value;
+ this.form.weighingOperator = storage[this.weighmanIndex].label;
+ },
lpn() {
this.$refs.modalBg.open();
},
// 寮规淇濆瓨
- confirm() {
- console.log("淇濆瓨", this.form.value1);
- // 璇锋眰鎺ュ彛锛屾牴鎹伐鍗曞彿鏌ヨ鍏朵粬淇℃伅骞惰祴鍊�
+ confirm() {},
+
+ /**
+ * 浜у搧绫诲瀷鍙樺寲鏃舵竻绌鸿溅闂撮�夋嫨
+ */
+ handleProductTypeChange() {
+ this.workshopIndex = null;
+ this.form.workshop = '';
},
// 鎻愪氦鎸夐挳
- submit() {
- if (!this.$refs.uForm.validate()) {
- console.log("1111");
- return;
+ async submit() {
+ if (this.isSubmitting) return;
+
+ try {
+ // 缁熶竴琛ㄥ崟楠岃瘉
+ if (!await this.validateForm()) return;
+
+ // 鏋勫缓鎻愪氦鏁版嵁
+ const submitData = this.buildSubmitData().customerList;
+ console.log('鎻愪氦鐨勬暟鎹�',submitData)
+ this.isSubmitting = true;
+ const res = await this.$u.api.NuclearScaleEntry.createMain(submitData);
+
+ if (res.code === 0) {
+ this.$u.toast("鎻愪氦鎴愬姛");
+ uni.navigateBack();
+ } else {
+ uni.showToast({
+ title: res.msg || '鎻愪氦澶辫触锛氫笟鍔″鐞嗛敊璇�',
+ icon: 'none'
+ });
+ console.error('涓氬姟閿欒:', res);
+ }
+ } catch (err) {
+ if (err.type === 'validation') {
+ uni.showToast({
+ title: err.message,
+ icon: 'none'
+ });
+ } else if (err.message.includes('Network Error')) {
+ uni.showToast({
+ title: '缃戠粶杩炴帴閿欒锛岃妫�鏌ョ綉缁滃悗閲嶈瘯',
+ icon: 'none'
+ });
+ } else {
+ uni.showToast({
+ title: '绯荤粺閿欒锛岃绋嶅悗閲嶈瘯',
+ icon: 'none'
+ });
+ }
+ console.error('鎻愪氦琛ㄥ崟閿欒:', err);
+ } finally {
+ this.isSubmitting = false;
}
- if (this.form.value3 === "") {
- uni.showToast({
- title: "璇峰厛閫夋嫨瀹㈡埛鍚嶇О",
- icon: "none",
- });
- return;
+ },
+
+ // 缁熶竴琛ㄥ崟楠岃瘉
+ async validateForm() {
+ // 浣跨敤uView琛ㄥ崟楠岃瘉
+ if (!await this.$refs.uForm.validate()) {
+ return false;
}
+
+ // 瀹㈡埛鍚嶇О楠岃瘉
+ if (!this.form.customerName1 || !this.form.customerName2) {
+ throw { type: 'validation', message: '璇峰厛閫夋嫨瀹㈡埛鍚嶇О' };
+ }
+
+ return true;
+ },
+
+ // 鏋勫缓鎻愪氦鏁版嵁
+ buildSubmitData() {
+ // 鍒涘缓瀹㈡埛鏁版嵁鐨勮緟鍔╁嚱鏁�
+ const createCustomerItem = (customerIndex) => ({
+ customerName: this.form[`customerName${customerIndex}`],
+ shippingNoticeNo: this.form[`shippingNoticeNo${customerIndex}`],
+ shippingNoticeId: this[`id${customerIndex}`],
+ replace: this.form.replace,
+ productType: this.form.productType,
+ licensePlate: this.form.licensePlate,
+ workshop: this.form.workshop,
+ weighingOperator: this.form.weighingOperator,
+ forkliftOperator: this.form.forkliftOperator,
+ });
+
+ // 鏋勫缓瀹㈡埛鍒楄〃
+ const customerList = [1, 2].map(createCustomerItem);
+
+ return {
+ customerList
+ };
},
},
};
@@ -314,12 +597,14 @@
/* 澶嶉�夋鏍峰紡 */
.checkbox-item {
- width: 200px;
+ width: 230px;
display: flex;
align-items: center;
padding: 20rpx 0;
border-bottom: 1rpx solid #f5f5f5;
- .label{
+ background-color: #f8f9fa;
+
+ .label {
position: relative;
left: 130px;
}
diff --git a/pages/wareHouse/nuclearScale/index.scss b/pages/wareHouse/nuclearScale/index.scss
index 7ec1a27..15d9a6d 100644
--- a/pages/wareHouse/nuclearScale/index.scss
+++ b/pages/wareHouse/nuclearScale/index.scss
@@ -50,7 +50,7 @@
text-align: right !important;
}
.bottom-button {
- position: fixed;
+ position: absolute;
bottom: 40rpx;
left: 45%;
width: calc(100% - 80rpx);
@@ -64,3 +64,244 @@
transform: translateX(-50%);
}
+.wrap .packing-registration-scroll-list {
+ height: calc(100vh - var(--window-top) - var(--window-bottom) - 800rpx);
+ width: 100%;
+}
+
+.packing-registration-scroll-list-group {
+ ::v-deep .u-cell-item-box {
+ background-color: rgba(250, 252, 255, 0.36) !important;
+ padding: 0rpx 30rpx;
+ }
+
+ .content {
+ font-size: 12px;
+ background-color: #ffffff;
+ box-sizing: border-box;
+ border-radius: 10rpx;
+ margin: 0rpx 0rpx 16rpx;
+ padding: 20rpx 8rpx;
+ box-shadow: none;
+ display: flex;
+ align-items: center;
+
+ .content-header {
+ width: 40rpx;
+ height: 90rpx;
+ display: flex;
+ align-items: center;
+
+ .content-header-icon {
+ background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ height: 28rpx;
+ width: 28rpx;
+ }
+
+ .content-header-title {
+ margin-left: 11rpx;
+ font-size: 26rpx;
+ font-weight: bold;
+ color: #626369;
+ }
+ }
+
+ .content-body {
+ flex: 1;
+ background-color: #ffffff;
+ border-radius: 10rpx;
+ padding: 0rpx 23rpx;
+
+ .row-list {
+ height: 60rpx;
+ display: flex;
+ flex-direction: row;
+ padding: 0px;
+ align-items: center;
+ }
+
+ .row-list ._label {
+ display: flex;
+ flex: 0.8;
+ color: #909399;
+ align-items: center;
+
+ ._label-name {
+ margin-left: 11rpx;
+ font-size: 26rpx;
+ font-weight: 500;
+ color: #666666;
+ }
+ }
+
+ .row-list ._content {
+ flex: 1.5;
+ text-align: right;
+ color: #909399;
+ font-size: 24rpx;
+ }
+
+ .row-list .s1 {
+ color: #d35651;
+ }
+ }
+ }
+
+ .packing-registration-param {
+ padding: 40rpx 30rpx 10rpx 30rpx;
+ height: 350px;
+ overflow: hidden;
+
+ .packing-registration-param-title {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ margin-bottom: 30rpx;
+
+ .title-label {
+ margin-left: 14rpx;
+ font-size: 34rpx;
+ font-weight: bold;
+ color: #283e65;
+ }
+ }
+
+ .packing-registration-param-view {
+ height: 177rpx;
+ background-color: #fff;
+ border-radius: 10rpx;
+ padding: 0rpx 23rpx;
+ margin-bottom: 30rpx;
+
+ .packing-registration-param-item {
+ height: 90rpx;
+ border: 1px solid #adc8e4;
+ line-height: 90rpx;
+ display: flex;
+ justify-content: space-between;
+ border: none;
+
+ .packing-registration-param-item-left {
+ .item-one {
+ font-size: 30rpx;
+ color: #666666;
+ }
+ }
+
+ .packing-registration-param-item-right {
+ display: flex;
+ justify-content: space-between;
+
+ .item-one {
+ font-size: 15rpx;
+ color: #060505;
+ margin-right: 6rpx;
+ }
+
+ .item-two {
+ font-size: 15rpx;
+ color: #a6b4cc;
+ margin-right: 6rpx;
+ }
+
+ .item-three {
+ font-size: 30rpx;
+ color: #214ded;
+ margin-right: 6rpx;
+ }
+ }
+ }
+
+ .param-extra {
+ border-bottom: 1px solid #ededed;
+ }
+ }
+ }
+ ::v-deep .u-model__title {
+ padding-top: 0 !important;
+ }
+
+ ::v-deep .u-input__input {
+ text-align: right !important;
+ }
+}
+
+.popup-content {
+ width: 600rpx;
+ height: 350rpx;
+ background-color: #fff;
+ border-radius: 8px;
+ z-index: 10;
+ /* 纭繚鍐呭鍦ㄨ挋鐗堜箣涓� */
+}
+
+.packing-registration-param {
+ padding: 40rpx 30rpx 10rpx 30rpx;
+
+ .packing-registration-param-title {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ margin-bottom: 30rpx;
+
+ .title-label {
+ margin-left: 14rpx;
+ font-size: 34rpx;
+ font-weight: bold;
+ color: #283e65;
+ }
+ }
+
+ .packing-registration-param-view {
+ height: 550rpx;
+ background-color: #fff;
+ border-radius: 10rpx;
+ padding: 0rpx 23rpx;
+ margin-bottom: 30rpx;
+
+ .packing-registration-param-item {
+ height: 90rpx;
+ border: 1px solid #adc8e4;
+ line-height: 90rpx;
+ display: flex;
+ justify-content: space-between;
+ border: none;
+
+ .packing-registration-param-item-left {
+ .item-one {
+ font-size: 30rpx;
+ color: #666666;
+ }
+ }
+
+ .packing-registration-param-item-right {
+ display: flex;
+ justify-content: space-between;
+
+ .item-one {
+ font-size: 30rpx;
+ color: #060505;
+ margin-right: 6rpx;
+ }
+
+ .item-two {
+ font-size: 30rpx;
+ color: #a6b4cc;
+ margin-right: 6rpx;
+ }
+
+ .item-three {
+ font-size: 30rpx;
+ color: #214ded;
+ margin-right: 6rpx;
+ }
+ }
+ }
+
+ .param-extra {
+ border-bottom: 1px solid #ededed;
+ }
+ }
+}
\ No newline at end of file
diff --git a/pages/wareHouse/nuclearScale/index.vue b/pages/wareHouse/nuclearScale/index.vue
index d59bc52..95d8801 100644
--- a/pages/wareHouse/nuclearScale/index.vue
+++ b/pages/wareHouse/nuclearScale/index.vue
@@ -1,145 +1,325 @@
<template>
- <!-- 鏍哥褰曞叆 -->
- <div class="page">
- <view class="packing-registration-bg" />
- <u-navbar title="鏍哥褰曞叆" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
- back-icon-color="#000" />
- <u-form :model="form" ref="uForm" :label-width="200" :rules="rules" :error-type="['toast']" class="uForm">
- <u-form-item label="鏍哥鍗曞彿" :border-bottom="false" prop="value1">
- <u-input v-model="form.value1" type="select" placeholder="璇烽�夋嫨鏍哥鍗曞彿" @click="openList" />
- </u-form-item>
- <u-form-item label="浜у搧绫诲瀷" :border-bottom="false" prop="value2">
- <u-input v-model="form.value2" placeholder="" disabled />
- </u-form-item>
- <u-form-item label="杞︾墝鍙�" :border-bottom="false" prop="value3">
- <u-input v-model="form.value3" placeholder="" disabled />
- </u-form-item>
- <u-form-item label="鍙戣揣閫氱煡鍗�1" :border-bottom="false" prop="value4">
- <u-input v-model="form.value4" placeholder="" disabled />
- </u-form-item>
- <u-form-item label="瀹㈡埛鍚嶇О1" :border-bottom="false" prop="value5">
- <u-input v-model="form.value5" placeholder="" disabled />
- </u-form-item>
- <u-form-item label="鍙戣揣閫氱煡鍗�2" :border-bottom="false" prop="value4">
- <u-input v-model="form.value9" placeholder="" disabled />
- </u-form-item>
- <u-form-item label="瀹㈡埛鍚嶇О2" :border-bottom="false" prop="value5">
- <u-input v-model="form.value10" placeholder="" disabled />
- </u-form-item>
- <u-form-item label="鍙哥鍛�" :border-bottom="false" prop="value6">
- <u-input v-model="form.value6" placeholder="" disabled />
- </u-form-item>
- <u-form-item label="鍙夎溅鍙告満" :border-bottom="false" prop="value7">
- <u-input v-model="form.value7" placeholder="" disabled />
- </u-form-item>
- <u-form-item label="鏍哥璁板綍" :border-bottom="false" prop="value8">
- <u-input v-model="form.value8" type="select" placeholder="" @click="openNuclearScaleRecord" />
- </u-form-item>
- <u-form-item :label="`鎵爜璁板綍(${num}鏉�)锛歚" :border-bottom="false" prop="value4" :label-width="260">
- <!-- <u-input v-model="form.value4" placeholder="" disabled /> -->
- </u-form-item>
- </u-form>
- <u-button type="primary" class="bottom-button" @click="submit">鎻愪氦</u-button>
+ <!-- 鏍哥褰曞叆 -->
+ <div class="page">
+ <view class="packing-registration-bg" />
+ <u-navbar title="鏍哥褰曞叆" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
+ back-icon-color="#000" />
+ <u-form :model="form" ref="uForm" :label-width="200" :rules="rules" :error-type="['toast']" class="uForm">
+ <u-form-item label="鏍哥鍗曞彿" :border-bottom="false" prop="verificationNo">
+ <u-input v-model="form.verificationNo" type="select" placeholder="璇烽�夋嫨鏍哥鍗曞彿" @click="openList" />
+ </u-form-item>
+ <u-form-item label="浜у搧绫诲瀷" :border-bottom="false" prop="productType">
+ <u-input v-model="productTypeMap[form.productType] || form.productType" placeholder="" disabled />
+ </u-form-item>
+ <u-form-item label="杞︾墝鍙�" :border-bottom="false" prop="licensePlate">
+ <u-input v-model="form.licensePlate" placeholder="" disabled />
+ </u-form-item>
+ <u-form-item label="鍙戣揣閫氱煡鍗�1" :border-bottom="false" prop="shippingNoticeNo1">
+ <u-input v-model="form.shippingNoticeNo1" placeholder="" disabled />
+ </u-form-item>
+ <u-form-item label="瀹㈡埛鍚嶇О1" :border-bottom="false" prop="customerName1">
+ <u-input v-model="form.customerName1" placeholder="" disabled />
+ </u-form-item>
+ <u-form-item label="鍙戣揣閫氱煡鍗�2" :border-bottom="false" prop="shippingNoticeNo2">
+ <u-input v-model="form.shippingNoticeNo2" placeholder="" disabled />
+ </u-form-item>
+ <u-form-item label="瀹㈡埛鍚嶇О2" :border-bottom="false" prop="customerName2">
+ <u-input v-model="form.customerName2" placeholder="" disabled />
+ </u-form-item>
+ <u-form-item label="鍙哥鍛�" :border-bottom="false" prop="weighingOperator">
+ <u-input v-model="form.weighingOperator" placeholder="" disabled />
+ </u-form-item>
+ <u-form-item label="鍙夎溅鍙告満" :border-bottom="false" prop="forkliftOperator">
+ <u-input v-model="form.forkliftOperator" placeholder="" disabled />
+ </u-form-item>
+ <u-form-item label="鏍哥璁板綍" :border-bottom="false" prop="value8">
+ <u-input type="select" placeholder="" @click="openNuclearScaleRecord" />
+ </u-form-item>
+ <u-form-item :label="`鎵爜璁板綍(${ScanCodeRecord.length}鏉�)锛歚" :border-bottom="false" prop="shippingNoticeNo1"
+ :label-width="260">
+ </u-form-item>
+ </u-form>
+ <view class="wrap">
+ <scroll-view class="packing-registration-scroll-list" scroll-y="true">
+ <u-cell-group class="packing-registration-scroll-list-group" :border="false">
+ <view class="content" v-for="(item, index) in ScanCodeRecord" :key="index" :index="index"
+ @click="cancelReport(item)">
+ <view class="content-header">
+ <view class="content-header-title">{{ index + 1 }}</view>
+ </view>
+ <view class="content-body">
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-name">鎵瑰彿锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.outBatchNo }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-name">闆朵欢鎻忚堪锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.netWeight }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-name">闆朵欢鍙凤細</view>
+ </view>
+ <view class="_content">
+ {{ item.partNo }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-name">姣涢噸锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.grossWeight }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-name">鐩橀噸锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.trayWeight }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-name">鍑�閲嶏細</view>
+ </view>
+ <view class="_content">
+ {{ item.netWeight }}
+ </view>
+ </view>
+ </view>
+ </view>
+ </u-cell-group>
+ </scroll-view>
+ </view>
+ <!-- 瀵间綋 -->
+ <u-modal v-model="showModal" title="" :show-cancel-button="true" :show-confirm-button="true"
+ @confirm="confirmDt" @cancel="cancelDt">
+ <view class="popup-content">
+ <view class="packing-registration-param">
+ <view class="packing-registration-param-view">
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">鏍哥閲嶉噺锛�</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <u-input class="item-one item-two" v-model="modalList.suppliedQuantity" />
+ </view>
+ </view>
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">鍙夎溅鐩橀噸锛�</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <u-input class="item-one item-two" v-model="modalList.suppliedQuantity" />
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
+ </u-modal>
+ <u-button type="primary" class="bottom-button" @click="submit">鎻愪氦</u-button>
<u-modal v-model="show" @confirm="confirm" content="鏄惁纭鎻愪氦" show-cancel-button></u-modal>
- <scan></scan>
- </div>
+ <saveForm ref="saveForm" :operationTaskList="this.form" @update="handleUpdate" />
+ <scan></scan>
+ </div>
</template>
<script>
-import scan from "@/components/scan/scan.vue";
-import content_bg from '@/static/custom/packing/backBg.png'
-export default {
- components: { scan },
- data() {
- return {
- background: {
- backgroundImage: `url(${content_bg})`,
- backgroundAttachment: 'fixed',
- backgroundSize: '100% auto',
- backgroundRepeat: 'no-repeat',
- },
- show:false,
- num:1,
- form: {
- value0: '',
- value1: '',
- value2: '',
- value3: '',
- value4: '',
- value5: '',
- value6: '',
- value7: '',
- value8: '',
- value9: '',
- value10:'',
- },
- rules: {
- value1: [
- {
- required: true,
- message: '璇烽�夋嫨鏍哥鍗曞彿',
- trigger: ['change', 'blur'],
- },
- ],
- },
- }
- },
- onReady() {
- this.$refs.uForm.setRules(this.rules);
- },
- onShow() {
- let that = this
- uni.$off('scan') // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒
- uni.$on('scan', function (data) {
- console.log('onscan');
- //鎵爜鎴愬姛鍚庣殑鍥炶皟锛屼綘鍙互鍐欒嚜宸辩殑閫昏緫浠g爜鍦ㄨ繖閲�
- console.log('椤甸潰鎵爜缁撴灉锛�', data.code);
- if (data.code) {
- let codeInfo = JSON.parse(data.code)
- if (codeInfo.WorkNo) {
- // 鎵弿鎶ュ伐鍗曚簩缁寸爜
- that.saveForm(codeInfo);
- }
- }
- })
- },
- methods: {
- // 鎻愪氦鎸夐挳
- submit() {
- this.show = true
- },
- // 寮规淇濆瓨
- confirm() {
- console.log('淇濆瓨', this.form.value1);
- // 璇锋眰鎺ュ彛锛屾牴鎹伐鍗曞彿鏌ヨ鍏朵粬淇℃伅骞惰祴鍊�
- },
- // 閫夋嫨璁㈠崟鍙�
- openList() {
- uni.navigateTo({
- url: '/pages/wareHouse/nuclearScale/nuclearScaleList'
- })
- },
- //鏍哥璁板綍
- openNuclearScaleRecord() {
- uni.navigateTo({
- url: '/pages/wareHouse/nuclearScale/nuclearscalerecord'
- })
- },
- // 瀛樿鍗曞彿
- setNo(val) {
- this.form.value3 = val
- },
- // 鍥炴樉鎵爜鐨勪俊鎭�-鎶ュ伐鍗�
- saveForm(val) {
- let { WorkNo, ProcessName, ORDER_NO } = val
- this.form.value1 = WorkNo
- this.form.value2 = ProcessName
- this.form.value3 = ORDER_NO
- }
- }
-}
+ import scan from "@/components/scan/scan.vue";
+ import content_bg from "@/static/custom/packing/backBg.png";
+ import saveForm from "./saveForm.vue";
+ export default {
+ components: {
+ scan,
+ saveForm,
+ },
+ data() {
+ return {
+ modalList: {},
+ showModal: false,
+ productTypeMap: {
+ 1: "瀵间綋",
+ 2: "閾滄潌",
+ 3: "瀵间綋2.6",
+ },
+ ScanCodeRecord: [],
+ background: {
+ backgroundImage: `url(${content_bg})`,
+ backgroundAttachment: "fixed",
+ backgroundSize: "100% auto",
+ backgroundRepeat: "no-repeat",
+ },
+ show: false,
+ form: {
+ value0: "",
+ verificationNo: "",
+ productType: "",
+ licensePlate: "",
+ shippingNoticeNo1: "",
+ customerName1: "",
+ weighingOperator: "",
+ forkliftOperator: "",
+ value8: "",
+ shippingNoticeNo2: "",
+ customerName2: "",
+ },
+ rules: {
+ verificationNo: [{
+ required: true,
+ message: "璇烽�夋嫨鏍哥鍗曞彿",
+ trigger: ["change", "blur"],
+ }, ],
+ },
+ };
+ },
+ onReady() {
+ this.$refs.uForm.setRules(this.rules);
+ },
+ onShow() {
+ let that = this;
+ uni.$off("scan"); // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒
+ uni.$on("scan", function(data) {
+ console.log("onscan");
+ if (that.form.verificationNo == "") {
+ uni.showToast({
+ icon: "none",
+ title: "璇峰厛閫夋嫨鏍哥鍗曞彿锛�",
+ duration: 2 * 1000,
+ });
+ return;
+ }
+ //鎵爜鎴愬姛鍚庣殑鍥炶皟锛屼綘鍙互鍐欒嚜宸辩殑閫昏緫浠g爜鍦ㄨ繖閲�
+ console.log("椤甸潰鎵爜缁撴灉锛�", data.code);
+ if (data.code) {
+ try {
+ let codeInfo = JSON.parse(data.code);
+ } catch (e) {
+ uni.showToast({
+ icon: "none",
+ title: "鎵爜鏁版嵁瑙f瀽澶辫触锛岃閲嶈瘯锛�",
+ duration: 2 * 1000,
+ });
+ return;
+ }
+ if (codeInfo.CN != that.form.customerName1) {
+ // 鎵弿鎶ュ伐鍗曚簩缁寸爜
+ uni.showModal({
+ title: "鎻愮ず",
+ content: "瀹㈡埛涓嶄竴鑷达細" +
+ codeInfo.CN +
+ "||" +
+ that.form.customerName1,
+ showCancel: true,
+ success: function() {
+ if (that.form.productType == "2") {
+ that.$refs.saveForm.open(codeInfo);
+ } else {
+ that.ScanCodeRecord.push(codeInfo);
+ }
+ },
+ });
+ } else {
+ if (that.form.productType == "2") {
+ that.$refs.saveForm.open(codeInfo);
+ } else {
+ that.ScanCodeRecord.push(codeInfo);
+ }
+ }
+ }
+ });
+ },
+ methods: {
+ // 鍙栨秷鎵爜璁板綍
+ cancelReport(item) {
+ this.ScanCodeRecord = this.ScanCodeRecord.filter(a => a.outBatchNo !== item.outBatchNo);
+ },
+ // 瀵间綋鎻愪氦
+ confirmDt() {
+ const magnetic =
+ Number(this.form.h) - Number(this.form.children) - Number(this.form.m);
+ console.log("淇濆瓨", this.form.verificationNo);
+ switch (this.form.productType) {
+ case "瀵间綋":
+ if (magnetic > 0 && magnetic < 3) {
+ this.ScanCodeRecord.push(this.form);
+ } else {
+ this.$u.toast("鐢熶骇鏍告煡");
+ }
+ break;
+ case "瀵间綋2.6":
+ if (magnetic > -0.5 && magnetic < 0.5) {
+ this.ScanCodeRecord.push(this.form);
+ } else {
+ this.$u.toast("鐢熶骇鏍告煡");
+ }
+ break;
+ }
+ },
+ // 鍙栨秷
+ cancelDt() {
+ this.showModal = false;
+ },
+ handleUpdate(Obj) {
+ this.ScanCodeRecord.push(Obj);
+ },
+ // 鎻愪氦鎸夐挳
+ submit() {
+ this.showModal = true;
+ },
+ // 寮规淇濆瓨
+ confirm() {
+ console.log("淇濆瓨", this.form.verificationNo);
+ // 璇锋眰鎺ュ彛锛屾牴鎹伐鍗曞彿鏌ヨ鍏朵粬淇℃伅骞惰祴鍊�
+ },
+ // 閫夋嫨璁㈠崟鍙�
+ openList() {
+ uni.navigateTo({
+ url: "/pages/wareHouse/nuclearScale/nuclearScaleList",
+ });
+ },
+ //鏍哥璁板綍
+ openNuclearScaleRecord() {
+ if (this.form.verificationNo == "") {
+ uni.showToast({
+ icon: "none",
+ title: "璇峰厛閫夋嫨鏍哥鍗曞彿锛�",
+ duration: 2 * 1000,
+ });
+ return;
+ }
+ uni.navigateTo({
+ url: "/pages/wareHouse/nuclearScale/nuclearscalerecord",
+ });
+ },
+ // 瀛樿鍗曞彿
+ setNo(val) {
+ this.form = val;
+ },
+ // 鍥炴樉鎵爜鐨勪俊鎭�-鎶ュ伐鍗�
+ // saveForm(val) {
+ // let {
+ // WorkNo,
+ // ProcessName,
+ // ORDER_NO
+ // } = val;
+ // this.form.verificationNo = WorkNo;
+ // this.form.productType = ProcessName;
+ // this.form.licensePlate = ORDER_NO;
+ // },
+ },
+ };
</script>
<style lang="scss">
-@import 'index.scss';
+ @import "index.scss";
</style>
\ No newline at end of file
diff --git a/pages/wareHouse/nuclearScale/nuclearScaleList.vue b/pages/wareHouse/nuclearScale/nuclearScaleList.vue
index 6354a36..d862c3e 100644
--- a/pages/wareHouse/nuclearScale/nuclearScaleList.vue
+++ b/pages/wareHouse/nuclearScale/nuclearScaleList.vue
@@ -1,399 +1,453 @@
<template>
- <view class="page">
- <view class="finishProductIn-locno-bg" />
- <u-navbar
- title="鏍哥鍗曞彿"
- :background="background"
- :border-bottom="false"
- :title-bold="true"
- title-color="#000"
- back-icon-color="#000"
- />
- <view class="finishProductIn-locno-search">
- <u-search
- v-model="keywords"
- shape="square"
- bg-color="rgba(250,252,255,0.36)"
- :show-action="false"
- placeholder="璇疯緭鍏ユ牳纾呭崟鍙�"
- @clear="search"
- @custom="search"
- @search="search"
- >
- </u-search>
- </view>
- <view class="wrap">
- <scroll-view
- class="finishProductIn-locno-scroll-list"
- scroll-y="true"
- @scrolltolower="loadMore"
- >
- <u-cell-group
- class="finishProductIn-locno-scroll-list-group"
- :border="false"
- >
- <view
- class="content"
- v-for="(item, index) in list"
- :key="item.locNo"
- :index="index"
- @click="selectNo(item.index)"
- >
- <view class="content-header">
- <view class="content-header-title">{{ index + 1 }}</view>
- </view>
- <view class="content-body">
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-1"> </view>
- <view class="_label-name">鏍告鍗曞彿锛�</view>
- </view>
- <view class="_content">
- {{ item.value0 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-2"> </view>
- <view class="_label-name">浜у搧绫诲瀷锛�</view>
- </view>
- <view class="_content">
- {{ item.value1 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-3"> </view>
- <view class="_label-name">杞︾墝鍙凤細</view>
- </view>
- <view class="_content">
- {{ item.value2 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-1"> </view>
- <view class="_label-name">鍙戣揣閫氱煡锛�</view>
- </view>
- <view class="_content">
- {{ item.value3 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-2"> </view>
- <view class="_label-name">瀹㈡埛鍚嶇О锛�</view>
- </view>
- <view class="_content">
- {{ item.value4 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-3"> </view>
- <view class="_label-name">鐢熶骇杞﹂棿锛�</view>
- </view>
- <view class="_content">
- {{ item.value5 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-1"> </view>
- <view class="_label-name">鍙哥鍛橈細</view>
- </view>
- <view class="_content">
- {{ item.value6 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-2"> </view>
- <view class="_label-name">鍙夎溅鍙告満锛�</view>
- </view>
- <view class="_content">
- {{ item.value7 }}
- </view>
- </view>
- </view>
- </view>
- </u-cell-group>
- <view class="loadmore" @click="loadMore">
- <u-loadmore :status="loadStatus"></u-loadmore>
- </view>
- </scroll-view>
- </view>
- <view class="plus-button" @click="openCreateWriteOffForm">
- <text class="plus-sign">+</text>
- </view>
- </view>
+ <view class="page">
+ <view class="finishProductIn-locno-bg" />
+ <u-navbar title="鏍哥鍗曞彿" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
+ back-icon-color="#000" />
+ <view class="finishProductIn-locno-search">
+ <u-search v-model="keywords" shape="square" bg-color="rgba(250,252,255,0.36)" :show-action="false"
+ placeholder="璇疯緭鍏ユ牳纾呭崟鍙�" @clear="search" @custom="search" @search="search">
+ </u-search>
+ </view>
+ <view class="wrap">
+ <scroll-view class="finishProductIn-locno-scroll-list" scroll-y="true" @scrolltolower="getmoreList()">
+ <u-skeleton v-if="isLoading && list.length === 0" type="list" :row="5" :loading="isLoading" />
+ <u-cell-group class="finishProductIn-locno-scroll-list-group" :border="false">
+ <view v-if="list.length === 0 && !isLoading" class="empty-tips">
+ <text>鏆傛棤鏁版嵁</text>
+ </view>
+ <view class="content" v-for="(item, index) in list" :key="item.verificationNo" :index="index"
+ @click="selectNo(item)">
+ <view class="content-header">
+ <view class="content-header-title">{{ index + 1 }}</view>
+ </view>
+ <view class="content-body">
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-1"> </view>
+ <view class="_label-name">鏍告鍗曞彿锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.verificationNo }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-2"> </view>
+ <view class="_label-name">浜у搧绫诲瀷锛�</view>
+ </view>
+ <view class="_content">
+ {{ formatProductType(item.productType) }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-3"> </view>
+ <view class="_label-name">杞︾墝鍙凤細</view>
+ </view>
+ <view class="_content">
+ {{ item.licensePlate }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-1"> </view>
+ <view class="_label-name">鍙戣揣閫氱煡1锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.shippingNoticeNo1 }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-2"> </view>
+ <view class="_label-name">瀹㈡埛鍚嶇О1锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.customerName1 }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-1"> </view>
+ <view class="_label-name">鍙戣揣閫氱煡2锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.shippingNoticeNo2 }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-2"> </view>
+ <view class="_label-name">瀹㈡埛鍚嶇О2锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.customerName2 }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-3"> </view>
+ <view class="_label-name">鐢熶骇杞﹂棿锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.workshop }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-1"> </view>
+ <view class="_label-name">鍙哥鍛橈細</view>
+ </view>
+ <view class="_content">
+ {{ item.weighingOperator }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-2"> </view>
+ <view class="_label-name">鍙夎溅鍙告満锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.forkliftOperator }}
+ </view>
+ </view>
+ </view>
+ </view>
+ </u-cell-group>
+ <view class="loadmore" @click="getmoreList()">
+ <u-loadmore :status="status" :load-text="loadText" @loadmore="getmoreList()" />
+ </view>
+ </scroll-view>
+ </view>
+ <view class="plus-button" @click="openCreateWriteOffForm">
+ <text class="plus-sign">+</text>
+ </view>
+ </view>
</template>
<script>
-import content_bg from "@/static/custom/finishProductIn/locNoBg.png";
-export default {
- data() {
- return {
- background: {
- backgroundImage: `url(${content_bg})`,
- backgroundAttachment: "fixed",
- backgroundSize: "100% auto",
- backgroundRepeat: "no-repeat",
- },
- keywords: "",
- alllist: [],
- originList: [],
- query: {
- current: 1,
- size: 10,
- },
- list: [
- {
- value0: "123456789",
- value1: "123456789",
- value2: "123456789",
- value3: "123456789",
- value4: "123456789",
- value5: "123456789",
- value6: "123456789",
- value7: "123456789",
- },
- {
- value0: "123456789",
- value1: "123456789",
- value2: "123456789",
- value3: "123456789",
- value4: "123456789",
- value5: "123456789",
- value6: "123456789",
- value7: "123456789",
- },
- ],
- count: 0,
- loadStatus: "loading",
- };
+ import content_bg from "@/static/custom/finishProductIn/locNoBg.png";
+ export default {
+ data() {
+ return {
+ background: {
+ backgroundImage: `url(${content_bg})`,
+ backgroundAttachment: "fixed",
+ backgroundSize: "100% auto",
+ backgroundRepeat: "no-repeat",
+ },
+ keywords: "",
+ list: [],
+ total: 0,
+ pageNum: 1,
+ pageSize: 10,
+ status: 'loading',
+ isLoading: false,
+ loadText: {
+ loadmore: "鍔犺浇鏇村...",
+ loading: "鍔姏鍔犺浇涓�...",
+ nomore: "娌℃湁鏇村浜�",
+ },
+ };
+ },
+ onLoad() {
+ this.getlist();
},
- onLoad() {
- this.$u.api.finishProductIn.fetchList().then((res) => {
- this.alllist = res.data;
- this.originList = res.data;
- this.loadList();
- });
- },
- methods: {
- //鍒涘缓鏍搁攢鍗�
- openCreateWriteOffForm() {
- uni.navigateTo({
- url: '/pages/wareHouse/nuclearScale/createwriteoffform'
- })
- },
- loadMore() {
- if (this.loadStatus == "nomore" || this.loadStatus == "loading") {
- return;
- }
- this.loadStatus = "loading";
- setTimeout(() => {
- this.query.current += 1;
- this.loadList();
- }, 100);
- },
- loadList() {
- const data = this.originList.slice(
- (this.query.current - 1) * this.query.size,
- this.query.current * this.query.size
- );
- this.list = this.list.concat(data);
- this.loadStatus = "loadmore";
- if (!data || data.length < this.query.size) {
- this.loadStatus = "nomore";
- }
- },
- search(value) {
- this.list = [];
- this.query.current = 1;
- if (value) {
- this.originList = this.alllist.filter((item) =>
- item.locNo.includes(value)
- );
- } else {
- this.originList = this.alllist;
- }
- this.loadList();
- },
- selectNo(no) {
- this.refreshLastPage(no);
- },
+ onShow() {
+ this.getlist();
+ },
+ methods: {
+ //鍒涘缓鏍搁攢鍗�
+ openCreateWriteOffForm() {
+ uni.navigateTo({
+ url: '/pages/wareHouse/nuclearScale/createwriteoffform'
+ })
+ },
+ getmoreList() {
+ if (this.pageSize >= this.total) {
+ this.status = "nomore";
+ return;
+ }
+ this.isLoading = true;
+ this.status = "loading";
+ setTimeout(() => {
+ this.pageSize += this.pageSize;
+ this.getlist();
+ }, 1000);
+ },
+ getlist() {
+ this.isLoading = true;
+ this.$u.api.NuclearScaleEntry
+ .getWeighingOrder({
+ current: this.pageNum,
+ size: this.pageSize
+ })
+ .then((res) => {
+ this.handleListResponse(res);
+ })
+ .catch((err) => {
+ this.handleApiError(err);
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ },
- //鍒锋柊涓婁竴涓〉闈�
- refreshLastPage(no) {
- // 鍛婄煡 A.vue 鏇存柊鏁版嵁
- // 鑾峰彇椤甸潰鏍�
- let pages = getCurrentPages();
+ getmoreList() {
+ if (this.isLoading || this.pageSize >= this.total) {
+ return;
+ }
+ this.isLoading = true;
+ this.status = "loading";
+ setTimeout(() => {
+ this.pageSize += this.pageSize;
+ this.getlist();
+ }, 500);
+ },
- // 鑾峰彇涓婁竴椤垫爤
- let prevPage = pages[pages.length - 2];
+ // 鎼滅储鐩稿叧鏂规硶
+ search(value) {
+ if (value) {
+ this.list = [];
+ this.pageSize = 10;
+ this.isLoading = true;
+ this.$u.api.NuclearScaleEntry
+ .getWeighingOrder({
+ current: this.pageNum,
+ size: this.pageSize,
+ verificationNo: value,
+ })
+ .then((res) => {
+ this.handleListResponse(res);
+ })
+ .catch((err) => {
+ this.handleApiError(err);
+ })
+ .finally(() => {
+ this.isLoading = false;
+ });
+ } else {
+ this.getlist();
+ }
+ },
- // 瑙﹀彂涓婁竴椤� upData 鍑芥暟(骞舵惡甯﹀弬鏁�)
- prevPage.$vm.setNo(no);
+ // 宸ュ叿鏂规硶
+ handleListResponse(res) {
+ console.log('API Response:', res);
+ console.log('Response Code:', res.code);
+ console.log('Response Data:', res.data);
+ console.log('Response Records:', res.data ? res.data.records : 'res.data is undefined');
- // 杩斿洖涓婁竴椤�
- uni.navigateBack({
- delta: 1,
- });
- },
- // 鏂板鎸夐挳
- handleClick() {
- console.log("鎸夐挳琚偣鍑�");
- },
- },
-};
+ if (res.code != 0) {
+ uni.showToast({
+ title: res.msg || '鑾峰彇鏁版嵁澶辫触',
+ icon: 'none'
+ });
+ return;
+ }
+
+ if (!res.data) {
+ console.error('res.data is undefined');
+ uni.showToast({
+ title: '鏁版嵁鏍煎紡閿欒',
+ icon: 'none'
+ });
+ return;
+ }
+
+ this.list = res.data.records || [];
+ this.total = res.data.total || 0;
+ this.status = this.pageSize >= this.total ? "nomore" : "loadmore";
+ },
+
+ handleApiError(err) {
+ console.error('API璇锋眰澶辫触:', err);
+ uni.showToast({
+ title: '缃戠粶寮傚父锛岃绋嶅悗閲嶈瘯',
+ icon: 'none'
+ });
+ },
+ formatProductType(type) {
+ const productTypeMap = {
+ 1: '瀵间綋',
+ 2: '閾滄潌',
+ 3: '瀵间綋2.6'
+ };
+ return productTypeMap[type] || type;
+ },
+ selectNo(no) {
+ this.refreshLastPage(no);
+ },
+
+ //鍒锋柊涓婁竴涓〉闈�
+ refreshLastPage(no) {
+ // 鍛婄煡 A.vue 鏇存柊鏁版嵁
+ // 鑾峰彇椤甸潰鏍�
+ let pages = getCurrentPages();
+
+ // 鑾峰彇涓婁竴椤垫爤
+ let prevPage = pages[pages.length - 2];
+
+ // 瑙﹀彂涓婁竴椤� upData 鍑芥暟(骞舵惡甯﹀弬鏁�)
+ prevPage.$vm.setNo(no);
+
+ // 杩斿洖涓婁竴椤�
+ uni.navigateBack({
+ delta: 1,
+ });
+ },
+ },
+ };
</script>
<style lang="scss" scoped>
-.plus-button {
- width: 40px;
- height: 40px;
- border-radius: 50%;
- background-color: #007aff;
- display: flex;
- justify-content: center;
- align-items: center;
- position: fixed;
- bottom: 40px;
- right: 10px;
- z-index: 100;
-}
-.plus-sign {
- color: white;
- font-size: 50px;
- position: relative;
- bottom: 4px;
+ .plus-button {
+ width: 40px;
+ height: 40px;
+ border-radius: 50%;
+ background-color: #007aff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ position: fixed;
+ bottom: 40px;
+ right: 10px;
+ z-index: 100;
+ }
-}
-.finishProductIn-locno-bg {
- background-color: #f6f9ff;
- background-image: url("~@/static/custom/finishProductIn/locNoBg.png");
- // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
- padding: 0 20rpx;
- background-attachment: fixed;
- background-size: 100% auto;
- background-repeat: no-repeat;
- position: fixed;
- top: 0;
- bottom: 0;
- width: 100%;
- z-index: -1;
-}
+ .plus-sign {
+ color: white;
+ font-size: 50px;
+ position: relative;
+ bottom: 4px;
-.finishProductIn-locno-search {
- padding: 40rpx 30rpx 20rpx 30rpx;
-}
+ }
-.wrap .finishProductIn-locno-scroll-list {
- height: calc(100vh - var(--window-top) - var(--window-bottom) - 242rpx);
- width: 100%;
-}
+ .finishProductIn-locno-bg {
+ background-color: #f6f9ff;
+ background-image: url("~@/static/custom/finishProductIn/locNoBg.png");
+ // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
+ padding: 0 20rpx;
+ background-attachment: fixed;
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ width: 100%;
+ z-index: -1;
+ }
-.finishProductIn-locno-scroll-list-group {
- ::v-deep .u-cell-item-box {
- background-color: rgba(250, 252, 255, 0.36) !important;
- padding: 0rpx 30rpx;
- }
+ .finishProductIn-locno-search {
+ padding: 40rpx 30rpx 20rpx 30rpx;
+ }
- .content {
- font-size: 12px;
- background-color: #ffffff;
- box-sizing: border-box;
- border-radius: 10rpx;
- margin: 0rpx 0rpx 16rpx;
- padding: 20rpx 8rpx;
- box-shadow: none;
- display: flex;
- align-items: center;
+ .wrap .finishProductIn-locno-scroll-list {
+ height: calc(100vh - var(--window-top, 0) - var(--window-bottom, 0) - 242rpx);
+ width: 100%;
+ min-height: 300rpx; /* 娣诲姞鏈�灏忛珮搴︾‘淇濆厓绱犲缁堝彲瑙� */
+ }
- .content-header {
- width: 40rpx;
- height: 90rpx;
- display: flex;
- align-items: center;
+ .finishProductIn-locno-scroll-list-group {
+ ::v-deep .u-cell-item-box {
+ background-color: rgba(250, 252, 255, 0.36) !important;
+ padding: 0rpx 30rpx;
+ }
- .content-header-icon {
- background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
- background-size: 100% auto;
- background-repeat: no-repeat;
- height: 28rpx;
- width: 28rpx;
- }
+ .content {
+ font-size: 12px;
+ background-color: #ffffff;
+ box-sizing: border-box;
+ border-radius: 10rpx;
+ margin: 0rpx 0rpx 16rpx;
+ padding: 20rpx 8rpx;
+ box-shadow: none;
+ display: flex;
+ align-items: center;
- .content-header-title {
- margin-left: 11rpx;
- font-size: 26rpx;
- font-weight: bold;
- color: #3d52f5;
- }
- }
+ .content-header {
+ width: 40rpx;
+ height: 90rpx;
+ display: flex;
+ align-items: center;
- .content-body {
- flex: 1;
- background: #f5f9ff;
- border-radius: 10rpx;
- padding: 0rpx 23rpx;
+ .content-header-icon {
+ background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ height: 28rpx;
+ width: 28rpx;
+ }
- .row-list {
- height: 60rpx;
- display: flex;
- flex-direction: row;
- padding: 0px;
- align-items: center;
- }
+ .content-header-title {
+ margin-left: 11rpx;
+ font-size: 26rpx;
+ font-weight: bold;
+ color: #3d52f5;
+ }
+ }
- .row-list ._label {
- display: flex;
- flex: 0.8;
- color: #909399;
- align-items: center;
+ .content-body {
+ flex: 1;
+ background: #f5f9ff;
+ border-radius: 10rpx;
+ padding: 0rpx 23rpx;
- ._label-icon-1 {
- background-image: url("~@/static/custom/moveWareHouse/label-icon-1.png");
- background-size: 100% auto;
- background-repeat: no-repeat;
- height: 26rpx;
- width: 26rpx;
- }
+ .row-list {
+ height: 60rpx;
+ display: flex;
+ flex-direction: row;
+ padding: 0px;
+ align-items: center;
+ }
- ._label-icon-2 {
- background-image: url("~@/static/custom/moveWareHouse/label-icon-2.png");
- background-size: 100% auto;
- background-repeat: no-repeat;
- height: 26rpx;
- width: 26rpx;
- }
+ .row-list ._label {
+ display: flex;
+ flex: 0.8;
+ color: #909399;
+ align-items: center;
- ._label-icon-3 {
- background-image: url("~@/static/custom/moveWareHouse/label-icon-3.png");
- background-size: 100% auto;
- background-repeat: no-repeat;
- height: 26rpx;
- width: 26rpx;
- }
+ ._label-icon-1 {
+ background-image: url("~@/static/custom/moveWareHouse/label-icon-1.png");
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ height: 26rpx;
+ width: 26rpx;
+ }
- ._label-name {
- margin-left: 11rpx;
- font-size: 26rpx;
- font-weight: 500;
- color: #666666;
- }
- }
+ ._label-icon-2 {
+ background-image: url("~@/static/custom/moveWareHouse/label-icon-2.png");
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ height: 26rpx;
+ width: 26rpx;
+ }
- .row-list ._content {
- flex: 1.5;
- text-align: right;
- color: #909399;
- font-size: 24rpx;
- }
+ ._label-icon-3 {
+ background-image: url("~@/static/custom/moveWareHouse/label-icon-3.png");
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ height: 26rpx;
+ width: 26rpx;
+ }
- .row-list .s1 {
- color: #d35651;
- }
- }
- }
-}
-</style>
+ ._label-name {
+ margin-left: 11rpx;
+ font-size: 26rpx;
+ font-weight: 500;
+ color: #666666;
+ }
+ }
+
+ .row-list ._content {
+ flex: 1.5;
+ text-align: right;
+ color: #909399;
+ font-size: 24rpx;
+ }
+
+ .row-list .s1 {
+ color: #d35651;
+ }
+ }
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/pages/wareHouse/nuclearScale/nuclearscalerecord.vue b/pages/wareHouse/nuclearScale/nuclearscalerecord.vue
index 260c131..b4b0834 100644
--- a/pages/wareHouse/nuclearScale/nuclearscalerecord.vue
+++ b/pages/wareHouse/nuclearScale/nuclearscalerecord.vue
@@ -1,600 +1,731 @@
<template>
- <view class="page">
- <view class="finishProductIn-locno-bg" />
- <u-navbar title="鏍哥璁板綍" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
- back-icon-color="#000">
- <view class="navbar-right" slot="right" @click="goPrintAll">
- 鍏ㄩ儴鎵撳嵃
- </view>
- </u-navbar>
- <view class="wrap">
- <scroll-view class="finishProductIn-locno-scroll-list" scroll-y="true" @scrolltolower="loadMore">
- <u-cell-group class="finishProductIn-locno-scroll-list-group" :border="false">
- <view class="content" v-for="(item, index) in list" :key="item.locNo" :index="index" @click="selectNo(item)">
- <view class="content-header">
- <view class="content-header-title">{{ index + 1 }}</view>
- </view>
- <view class="content-body">
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-1"> </view>
- <view class="_label-name">鎵规鍙凤細</view>
- </view>
- <view class="_content">
- {{ item.value0 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-2"> </view>
- <view class="_label-name">浜у搧鎻忚堪锛�</view>
- </view>
- <view class="_content">
- {{ item.value1 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-3"> </view>
- <view class="_label-name">闆朵欢鍙凤細</view>
- </view>
- <view class="_content">
- {{ item.value2 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-1"> </view>
- <view class="_label-name">姣涢噸锛�</view>
- </view>
- <view class="_content">
- {{ item.value3 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-2"> </view>
- <view class="_label-name">鐩橀噸锛�</view>
- </view>
- <view class="_content">
- {{ item.value4 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-3"> </view>
- <view class="_label-name">鍑�閲嶏細</view>
- </view>
- <view class="_content">
- {{ item.value5 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-1"> </view>
- <view class="_label-name">鏍哥閲嶉噺锛�</view>
- </view>
- <view class="_content">
- {{ item.value6 }}
- </view>
- </view>
- <view class="row-list">
- <view class="_label">
- <view class="_label-icon-2"> </view>
- <view class="_label-name">鍙夎溅鐩橀噸锛�</view>
- </view>
- <view class="_content">
- {{ item.value7 }}
- </view>
- </view>
- </view>
- </view>
- </u-cell-group>
- <view class="loadmore" @click="loadMore">
- <u-loadmore :status="loadStatus"></u-loadmore>
- </view>
- </scroll-view>
- </view>
- <u-toast ref="uToast" />
- <view v-if="maskShow" class="uni-mask" @touchmove.stop.prevent="moveHandle" @click="maskclose">
- <scroll-view class="uni-scroll_box" scroll-y @touchmove.stop.prevent="moveHandle" @click.stop="moveHandle">
- <view class="uni-list-box" v-for="(item, index) in listDevice" :key="index" @click="tapQuery(item)">
- <view>
- <view class="uni-list_name">鍚嶇О锛歿{ item.name }}</view>
- <view class="uni-list_item">UUID:{{ item.address }}</view>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
+ <view class="page">
+ <view class="finishProductIn-locno-bg" />
+ <u-navbar title="鏍哥璁板綍" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
+ back-icon-color="#000">
+ <view class="navbar-right" slot="right" @click="goPrintAll">
+ 鍏ㄩ儴鎵撳嵃
+ </view>
+ </u-navbar>
+ <view class="wrap">
+ <scroll-view class="finishProductIn-locno-scroll-list" scroll-y="true" @scrolltolower="getmoreList()">
+ <u-cell-group class="finishProductIn-locno-scroll-list-group" :border="false">
+ <view class="content" v-for="(item, index) in list" :key="item.locNo" :index="index"
+ @click="selectNo(item)">
+ <view class="content-header">
+ <view class="content-header-title">{{ index + 1 }}</view>
+ </view>
+ <view class="content-body">
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-1"> </view>
+ <view class="_label-name">鎵规鍙凤細</view>
+ </view>
+ <view class="_content">
+ {{ item.outBatchNo }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-2"> </view>
+ <view class="_label-name">浜у搧鎻忚堪锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.netWeight }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-3"> </view>
+ <view class="_label-name">闆朵欢鍙凤細</view>
+ </view>
+ <view class="_content">
+ {{ item.partNo }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-1"> </view>
+ <view class="_label-name">姣涢噸锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.grossWeight }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-2"> </view>
+ <view class="_label-name">鐩橀噸锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.trayWeight }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-3"> </view>
+ <view class="_label-name">鍑�閲嶏細</view>
+ </view>
+ <view class="_content">
+ {{ item.value5 }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-1"> </view>
+ <view class="_label-name">鏍哥閲嶉噺锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.netWeight }}
+ </view>
+ </view>
+ <view class="row-list">
+ <view class="_label">
+ <view class="_label-icon-2"> </view>
+ <view class="_label-name">鍙夎溅鐩橀噸锛�</view>
+ </view>
+ <view class="_content">
+ {{ item.value7 }}
+ </view>
+ </view>
+ </view>
+ </view>
+ </u-cell-group>
+ <view class="loadmore" @click="getmoreList()">
+ <u-loadmore :status="status" :load-text="loadText" @loadmore="getmoreList()" />
+ </view>
+ </scroll-view>
+ </view>
+ <u-toast ref="uToast" />
+ <u-modal v-model="maskShow" title="" v-for="(item, index) in listDevice" :key="index"
+ :show-confirm-button="true" @confirm="tapQuery(item)">
+ <view class="packing-registration-param-view" @touchmove.stop.prevent="moveHandle" @click="maskclose">
+ <scroll-view class="uni-scroll_box" scroll-y @touchmove.stop.prevent="moveHandle"
+ @click.stop="moveHandle">
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">鍚嶇О锛�</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <text class="item-one">{{ item.name }}</text>
+ </view>
+ </view>
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">UUID:</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <text class="item-one">{{ item.address }}</text>
+
+ </view>
+ </view>
+ </scroll-view>
+ </view>
+ </u-modal>
+ </view>
</template>
<script>
-import content_bg from '@/static/custom/finishProductIn/locNoBg.png'
-const jcapi = uni.requireNativePlugin("JCSDK-JCApiModule");
+ import content_bg from '@/static/custom/finishProductIn/locNoBg.png'
+ const jcapi = uni.requireNativePlugin("JCSDK-JCApiModule");
-// 浜岀淮鐮佺被鍨�
-const QrCodeType = {
- QrCode: 31,
- PDF417: 32,
- DataMatrix: 33,
- AZTEC: 34
-}
-// 绾挎潯绫诲瀷
-const LineType = {
- Solid: 1, // 瀹炵嚎
- Dotted: 2, // 铏氱嚎锛堥粯璁よ櫄瀹�1:1鐩搁棿锛�
-}
-// 鎹㈣鏂瑰紡
-const LineModeType = {
- Justified: 1, // 瀹介珮鍥哄畾锛屽唴瀹硅嚜閫傚簲锛堝瓧鍙�/瀛楅棿璺�/琛岄棿璺濇寜姣斾緥缂╂斁锛�
- AutoHeight: 2, // 瀹藉害鍥哄畾锛岄珮搴﹁嚜閫傚簲
- Fixed: 4, // 瀹介珮鍥哄畾锛岃秴鍑洪儴鍒嗚鍓�
- Adapt: 6, // 瀹介珮鍥哄畾锛屽唴瀹硅秴杩囨椂棰勮瀹介珮鑷姩缂╁皬
-}
-export default {
- data() {
- return {
- background: {
- backgroundImage: `url(${content_bg})`,
- backgroundAttachment: 'fixed',
- backgroundSize: '100% auto',
- backgroundRepeat: 'no-repeat',
- },
- keywords: '',
- alllist: [],
- originList: [],
- query: {
- current: 1,
- size: 10
- },
- list: [
- {
- value0: '123456789',
- value1: '123456789',
- value2: '123456789',
- value3: '123456789',
- value4: '123456789',
- value5: '123456789',
- value6: '123456789',
- value7: '123456789'
- },
- {
- value0: '123456789',
- value1: '123456789',
- value2: '123456789',
- value3: '123456789',
- value4: '123456789',
- value5: '123456789',
- value6: '123456789',
- value7: '123456789'
- }
- ],
- count: 0,
- loadStatus: 'loading',
- maskShow: false,
- listDevice: [], //钃濈墮璁惧鏁版嵁
- pritList: []
- };
- },
- onLoad() {
- this.$u.api.finishProductIn.fetchList().then(res => {
- this.alllist = res.data
- this.originList = res.data
- this.loadList()
- })
- // 鍒濆鍖朣DK
- jcapi.initSDK()
- // 鐩戝惉椤电爜鍥炶皟
- jcapi.didReadPrintCountInfo(function (r) {
- console.log(r)
- })
+ // 浜岀淮鐮佺被鍨�
+ const QrCodeType = {
+ QrCode: 31,
+ PDF417: 32,
+ DataMatrix: 33,
+ AZTEC: 34
+ }
+ // 绾挎潯绫诲瀷
+ const LineType = {
+ Solid: 1, // 瀹炵嚎
+ Dotted: 2, // 铏氱嚎锛堥粯璁よ櫄瀹�1:1鐩搁棿锛�
+ }
+ // 鎹㈣鏂瑰紡
+ const LineModeType = {
+ Justified: 1, // 瀹介珮鍥哄畾锛屽唴瀹硅嚜閫傚簲锛堝瓧鍙�/瀛楅棿璺�/琛岄棿璺濇寜姣斾緥缂╂斁锛�
+ AutoHeight: 2, // 瀹藉害鍥哄畾锛岄珮搴﹁嚜閫傚簲
+ Fixed: 4, // 瀹介珮鍥哄畾锛岃秴鍑洪儴鍒嗚鍓�
+ Adapt: 6, // 瀹介珮鍥哄畾锛屽唴瀹硅秴杩囨椂棰勮瀹介珮鑷姩缂╁皬
+ }
+ export default {
+ data() {
+ return {
+ background: {
+ backgroundImage: `url(${content_bg})`,
+ backgroundAttachment: 'fixed',
+ backgroundSize: '100% auto',
+ backgroundRepeat: 'no-repeat',
+ },
+ keywords: '',
+ list: [],
+ total: 0,
+ pageNum: 1,
+ pageSize: 10,
+ status: 'loading',
+ loadText: {
+ loadmore: "鍔犺浇鏇村...",
+ loading: "鍔姏鍔犺浇涓�...",
+ nomore: "娌℃湁鏇村浜�",
+ },
+ maskShow: false,
+ listDevice: [], //钃濈墮璁惧鏁版嵁
+ pritList: [],
+ printDensity: 3, // 榛樿鎵撳嵃娴撳害
+ labelType: 1, // 榛樿鏍囩绫诲瀷 *
+ // 1锛氶棿闅欑焊
+ // 2锛氶粦鏍囩焊
+ // 3锛氳繛缁焊
+ // 4锛氬畾瀛旂焊
+ // 5锛氶�忔槑绾�
+ printMode: 2, // 榛樿鎵撳嵃妯″紡
+ // 1锛氱儹鏁�
+ // 2锛氱儹杞嵃
+ connectedDevice: null // 宸茶繛鎺ョ殑鎵撳嵃鏈�
+ };
+ },
+ onLoad() {
+ this.getlist()
+ // 鍒濆鍖朣DK
+ jcapi.initSDK()
+ // 鐩戝惉椤电爜鍥炶皟
+ jcapi.didReadPrintCountInfo(function(r) {
+ console.log(r)
+ })
- // 鐩戝惉閿欒鍥炶皟
- jcapi.didReadPrintErrorInfo(function (r) {
- console.log(r)
- if (r.code == 23) {
- // 鎵撳嵃鏈烘柇寮�杩炴帴
- _this.connectedDevice = null
- }
- uni.showToast({
- icon: 'none',
- title: JSON.stringify(r),
- duration: 2 * 1000
- })
- })
- },
- methods: {
- loadMore() {
- if (this.loadStatus == "nomore" || this.loadStatus == "loading") {
- return
- }
- this.loadStatus = "loading";
- setTimeout(() => {
- this.query.current += 1;
- this.loadList();
- }, 100);
- },
- loadList() {
- const data = this.originList.slice((this.query.current - 1) * this.query.size, this.query.current * this.query.size)
- this.list = this.list.concat(data);
- this.loadStatus = "loadmore";
- if (!data || data.length < this.query.size) {
- this.loadStatus = "nomore";
- }
- },
- search(value) {
- this.list = [];
- this.query.current = 1;
- if (value) {
- this.originList = this.alllist.filter(item => item.locNo.includes(value))
- } else {
- this.originList = this.alllist
- }
- this.loadList()
- },
- // 鎵撳嵃鍗曚釜淇℃伅
- selectNo(item) {
- let that = this
- uni.showModal({
- title: '鎻愮ず',
- content: '鏄惁鎵撳嵃瑁呯鍗曪紵',
- showCancel: true,
- success: function (res) {
- if (res.confirm) {
- that.searchDevice()
- that.pritList = [item]
- }
- }
- });
- },
- // 鎵撳嵃鍏ㄩ儴淇℃伅
- goPrintAll() {
- let that = this
- uni.showModal({
- title: '鎻愮ず',
- content: '鏄惁鎵撳嵃瑁呯鍗曪紵',
- showCancel: true,
- success: function (res) {
- if (res.confirm) {
- that.searchDevice()
- that.pritList = this.list
- }
- }
- });
- },
- moveHandle() {
+ // 鐩戝惉閿欒鍥炶皟
+ jcapi.didReadPrintErrorInfo((r) => {
+ console.log(r)
+ if (r.code == 23) {
+ // 鎵撳嵃鏈烘柇寮�杩炴帴
+ this.connectedDevice = null
+ uni.showToast({
+ icon: 'none',
+ title: '鎵撳嵃鏈鸿繛鎺ュ凡鏂紑锛岃閲嶆柊杩炴帴',
+ duration: 2 * 1000
+ })
+ } else {
+ uni.showToast({
+ icon: 'none',
+ title: JSON.stringify(r),
+ duration: 2 * 1000
+ })
+ }
+ })
+ },
+ methods: {
+ getmoreList() {
+ if (this.pageSize >= this.total) {
+ this.status = "nomore";
+ return;
+ }
+ this.status = "loading";
+ setTimeout(() => {
+ this.pageSize += this.pageSize;
+ this.getlist();
+ }, 1000);
+ },
+ getlist() {
+ this.$u.api.workReporting
+ .getWorkshopOrder({
+ current: this.pageNum,
+ size: this.pageSize
+ })
+ .then((res) => {
+ this.list = res.data.records;
+ this.total = res.data.total;
+ if (this.pageSize >= this.total) {
+ this.status = "nomore";
+ } else {
+ this.status = "loadmore";
+ }
+ });
+ },
+ search(value) {
+ if (value) {
+ this.list = [];
+ this.pageSize = 10;
+ this.$u.api.workReporting
+ .getWorkshopOrder({
+ current: this.pageNum,
+ size: this.pageSize,
+ moNo: value,
+ })
+ .then((res) => {
+ this.list = res.data.records;
+ this.total = res.data.total;
+ if (this.pageSize >= this.total) {
+ this.status = "nomore";
+ } else {
+ this.status = "loadmore";
+ }
+ });
+ } else {
+ this.getlist();
+ }
+ },
+ // 鎵撳嵃鍗曚釜淇℃伅
+ // 妫�鏌ヨ摑鐗欒繛鎺ョ姸鎬�
+ async checkBluetoothConnection() {
+ if (!this.connectedDevice) return false;
+
+ // 灏濊瘯鍙戦�佷竴涓畝鍗曞懡浠ゆ鏌ヨ繛鎺ョ姸鎬�
+ return new Promise(resolve => {
+ jcapi.checkPrinterStatus(this.connectedDevice.address, r => {
+ if (r && r.code === 0) {
+ resolve(true);
+ } else {
+ // 杩炴帴宸叉柇寮�
+ this.connectedDevice = null;
+ resolve(false);
+ }
+ });
+ });
+ },
- },
- maskclose() {
+ selectNo(item) {
+ let that = this
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '鏄惁鎵撳嵃瑁呯鍗曪紵',
+ showCancel: true,
+ success: async function(res) {
+ if (res.confirm) {
+ // 妫�鏌ヨ摑鐗欒繛鎺ョ姸鎬�
+ const isConnected = await that.checkBluetoothConnection();
+ if (isConnected) {
+ // 宸茶繛鎺ワ紝鐩存帴鎵撳嵃
+ that.pritList = [item]
+ that.pritList.forEach(async item => {
+ await that.printQrCode(item)
+ })
+ } else {
+ // 鏈繛鎺ユ垨杩炴帴宸叉柇寮�锛屾悳绱㈣澶�
+ that.searchDevice()
+ that.pritList = [item]
+ }
+ }
+ }
+ });
+ },
+ // 鎵撳嵃鍏ㄩ儴淇℃伅
+ goPrintAll() {
+ let that = this
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '鏄惁鎵撳嵃瑁呯鍗曪紵',
+ showCancel: true,
+ success: async function(res) {
+ if (res.confirm) {
+ // 妫�鏌ヨ摑鐗欒繛鎺ョ姸鎬�
+ const isConnected = await that.checkBluetoothConnection();
+ if (isConnected) {
+ // 宸茶繛鎺ワ紝鐩存帴鎵撳嵃
+ that.pritList = that.list
+ that.pritList.forEach(async item => {
+ await that.printQrCode(item)
+ })
+ } else {
+ // 鏈繛鎺ユ垨杩炴帴宸叉柇寮�锛屾悳绱㈣澶�
+ that.searchDevice()
+ that.pritList = that.list
+ }
+ }
+ }
+ });
+ },
+ moveHandle() {
- },
- //鎵撳嵃浜岀淮鐮�
- async printQrCode(item) {
- const params = {
- rwMatlBindId: item.id
- }
- let res = await this.$u.api.dailyPaper.zongjianLabelInfo(params)
- if (!res.data) {
- this.$refs.uToast.show({
- title: '鏈煡璇㈠埌璇ユ爣绛句俊鎭紒',
- type: 'warning '
- })
- return
- }
- // 鍒濆鍖栫敾鏉�
- jcapi.initDrawingBoard({
- width: 50,
- height: 100,
- rotate: 0
- });
+ },
+ maskclose() {
- // // 缁樺埗浜岀淮鐮�
- jcapi.drawLabelQrCode({
- x: 14.5,
- y: 74,
- width: 20,
- height: 20,
- value: jsonString,
- rotate: 0,
- codeType: QrCodeType.QrCode,
- });
- // 缁樺埗妯嚎 瀹炵嚎8鏉�
- let sum = 4;
- for (let i = 1; i < 13; i++) {
- this.getDrawLabelLine(4, sum, 46, 0.5, 0, LineType.Solid) // 瀹炵嚎
- sum = (i * 6) + 4
- }
- // 浜岀淮鐮佸ぇ妗�
- this.getDrawLabelLine(4, 97, 46, 0.5, 0, LineType.Solid) // 瀹炵嚎9
+ },
+ //鎵撳嵃浜岀淮鐮�
+ async printQrCode(item) {
+ console.log('item de shuju ', item)
+ const params = {
+ rwMatlBindId: item.id
+ };
+ try {
+ let res = await this.$u.api.dailyPaper.zongjianLabelInfo(params)
+ if (!res.data) {
+ this.$refs.uToast.show({
+ title: '鏈煡璇㈠埌璇ユ爣绛句俊鎭紒',
+ type: 'warning '
+ })
+ return
+ }
+ // const res = {
+ // ht: 'HT20250717995352665',
+ // lj: '88.118.1/A0611091',
+ // ljms: '閾滃崟绾� 瑁搁摐-TY-鍦嗗舰-3.0',
+ // fh: '1083.6',
+ // scdt: '2025-07-14 13:46:55.0',
+ // scph: '2025071273-3',
+ // fhdw: '姹熶笢鍚堥噾鎶�鏈湁闄愬叕鍙�',
+ // shdw: '鏄嗗北娉板痉閫氶摐涓氭湁闄愬叕鍙�',
+ // }
+ // 浠嶢PI鍝嶅簲涓彁鍙栨墍闇�鏁版嵁
+ const {
+ ht,
+ lj,
+ ljms,
+ fh,
+ scdt,
+ scph,
+ fhdw,
+ shdw
+ } = res.data
+ // const jsonString = JSON.stringify(res.data)
- //缁樺埗绔栫嚎
- this.getDrawLabelLine(4, 4, 0.5, 97, 0, LineType.Solid) // 绔栫嚎1
- this.getDrawLabelLine(20, 4, 0.5, 66, 0, LineType.Solid) // 绔栫嚎2
- this.getDrawLabelLine(44.5, 4, 0.5, 97, 0, LineType.Solid) // 绔栫嚎2
+ // 鍒濆鍖栫敾鏉�
+ jcapi.initDrawingBoard({
+ width: 70,
+ height: 49,
+ rotate: 90
+ });
- // 濉啿鏂囧瓧鏍囬
- this.getDrawLabelText(5, 5, 20, 20, '缂� 鍙�:', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
- this.getDrawLabelText(5, 11, 20, 20, '宸ュ崟鍙�:', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
- this.getDrawLabelText(5, 17, 20, 20, '鐗� 鍙�:', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
- this.getDrawLabelText(5, 23, 20, 20, '鐗囧锛坢m锛�:', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
- this.getDrawLabelText(5, 29, 20, 20, '鍘氬害锛坢m锛�:', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
- this.getDrawLabelText(5, 35, 20, 20, '閲嶉噺锛圞G锛�:', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
- this.getDrawLabelText(5, 41, 20, 20, '闀垮害锛坢锛�:', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
- this.getDrawLabelText(5, 47, 20, 20, '鐢熶骇浜�:', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
- this.getDrawLabelText(5, 53, 20, 20, '鐢熶骇鏃堕棿:', 3.4, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
- this.getDrawLabelText(5, 59, 20, 20, '鍘傚:', 3.4, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
- this.getDrawLabelText(5, 65, 20, 20, '閾佹崯:', 3.4, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
+ // 缁樺埗浜岀淮鐮�
+ const qrContent =
+ `ht:${ht}\nlj:${lj}\nljms:${ljms}\nfh:${fh}\nscdt:${scdt}\nscph:${scph}\nfhdw:${fhdw}\nshdw:${shdw}`;
+ jcapi.drawLabelQrCode({
+ x: 43.5,
+ y: 2,
+ width: 24,
+ height: 24,
+ value: qrContent,
+ rotate: 0,
+ codeType: QrCodeType.QrCode,
+ });
+ // getDrawLabelLine 锛坸鍧愭爣锛寉鍧愭爣锛岀嚎鏉″搴︼紝绾挎潯楂樺害锛屾棆杞搴︼紝绾挎潯绫诲瀷锛�
+ // 缁樺埗妯嚎 瀹炵嚎8鏉�
+ this.getDrawLabelLine(1, 1, 67, 0.5, 0, LineType.Solid)
+ this.getDrawLabelLine(1, 6, 42, 0.3, 0, LineType.Solid)
+ this.getDrawLabelLine(1, 11, 42, 0.3, 0, LineType.Solid)
+ this.getDrawLabelLine(1, 16, 42, 0.3, 0, LineType.Solid)
+ this.getDrawLabelLine(1, 21, 42, 0.3, 0, LineType.Solid)
+ this.getDrawLabelLine(1, 27, 67, 0.3, 0, LineType.Solid)
+ this.getDrawLabelLine(1, 32, 67,0.3, 0, LineType.Solid)
+ this.getDrawLabelLine(1, 37, 67, 0.3, 0, LineType.Solid)
+ this.getDrawLabelLine(1, 42, 67, 0.3, 0, LineType.Solid)
+ this.getDrawLabelLine(1, 47, 67, 0.5, 0, LineType.Solid)
+ //缁樺埗绔栫嚎
+ this.getDrawLabelLine(1, 1, 0.5, 46, 0, LineType.Solid) // 绔栫嚎1
+ this.getDrawLabelLine(43, 1, 0.3, 26, 0, LineType.Solid) // 绔栫嚎2
+ this.getDrawLabelLine(68, 1, 0.5, 46, 0, LineType.Solid) // 绔栫嚎2
+ // getDrawLabelText 锛�1.x鍧愭爣锛�2.y鍧愭爣锛�3.鏂囨湰妗嗗搴︼紝4.鏂囨湰妗嗛珮搴︼紝5.缁樺埗鏂囧瓧鍐呭锛�6.瀛椾綋澶у皬锛堥粯璁ら珮搴�4mm锛�,7.鏃嬭浆瑙掑害,8.鎹㈣鏂瑰紡,9.饩忛棿闅�,10.瀛楅棿闅�,11.鏂囧瓧姘村钩甯冨眬,12鏂囧瓧鍨傜洿甯冨眬)
+ // 鏍囬
+ this.getDrawLabelText(3, 2.5, 40, 8, '涓ぉ绉戞妧瑁呯娓呭崟', 2.5, 0, LineModeType.AutoHeight, 0, 0, 1, 1,1)
+ // 濉啿鏂囧瓧鏍囬
+ this.getDrawLabelText(2, 7, 25, 8, '鍚堝悓鍙�:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
+ this.getDrawLabelText(2, 12, 25, 8, '闆朵欢鍙�:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
+ this.getDrawLabelText(2, 17, 25, 8, '闆朵欢鎻忚堪:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
+ this.getDrawLabelText(2, 22.5, 25, 8, '鍙戣揣/瑁呯鏁�:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
+ this.getDrawLabelText(2, 27.5, 25, 8, '鐢熶骇鏃ユ湡:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
+ this.getDrawLabelText(2, 32.5, 25, 8, '鐢熶骇鎵瑰彿:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
+ this.getDrawLabelText(2, 37.5, 25, 8, '鍙戣揣鍗曚綅:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
+ this.getDrawLabelText(2, 42.5, 25, 8, '鏀惰揣鍗曚綅:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
+ // 濉啿鍙傛暟鍊�
+ this.getDrawLabelText(11, 7, 30, 8, ht, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
+ this.getDrawLabelText(11, 12, 32, 8, lj, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
+ this.getDrawLabelText(14, 17, 30, 8, ljms, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
+ this.getDrawLabelText(17, 22.5, 27, 8, fh, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
+ this.getDrawLabelText(14, 27.5, 55, 8, scdt, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
+ this.getDrawLabelText(14, 32.5, 55, 8, scph, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
+ this.getDrawLabelText(14, 37.5,55, 8, fhdw, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
+ this.getDrawLabelText(14, 42.5, 55, 8, shdw, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
- // // 濉啿鍙傛暟鍊�
- this.getDrawLabelText(22, 5, 35, 12, labelNo, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
- this.getDrawLabelText(22, 11, 35, 12, optaskNo, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
- this.getDrawLabelText(22, 17, 35, 12, grade, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
- this.getDrawLabelText(22, 23, 35, 12, sliceWidth, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
- this.getDrawLabelText(22, 29, 35, 12, thickness, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
- this.getDrawLabelText(22, 35, 35, 12, wweight, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
- this.getDrawLabelText(22, 41, 35, 12, llength, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
- this.getDrawLabelText(22, 47, 35, 12, reportName, 2, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
- this.getDrawLabelText(22, 53, 35, 12, reportTime, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
- this.getDrawLabelText(22, 59, 35, 12, supplierVenderName, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
- this.getDrawLabelText(22, 65, 35, 12, ironLoss, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
+ // 鐢熸垚鎵撳嵃鏁版嵁
+ let imageJsonObj = jcapi.generateLabelJson()
+ let imageJsonObj111 = jcapi.generatePrintPreviewImage(imageJsonObj)
+ console.log('棰勮', imageJsonObj111)
+ // // 璁剧疆鎵撳嵃浠诲姟
+ jcapi.startJob({
+ totalCount: 1,
+ density: this.printDensity,
+ labelType: this.labelType,
+ printMode: this.printMode,
+ }, function(r) {
+ console.log('鎵撳嵃', r)
+ if (r.code == 0) {
+ // 鎵撳嵃鏁版嵁
+ jcapi.printData(imageJsonObj, {
+ "printQuantity": 1,
+ }, function(r) {
+ if (r.code == 0) {
+ console.log("鎵撳嵃鎴愬姛")
+ uni.showToast({
+ title: '鎵撳嵃鎴愬姛',
+ icon: 'success'
+ })
+ } else {
+ console.log("鎵撳嵃澶辫触")
+ uni.showToast({
+ title: '鎵撳嵃澶辫触: ' + (r.msg || '鏈煡閿欒'),
+ icon: 'none'
+ })
+ }
+ })
+ } else {
+ console.log("璁剧疆鎵撳嵃浠诲姟澶辫触")
+ }
- // 鐢熸垚鎵撳嵃鏁版嵁
- let imageJsonObj = jcapi.generateLabelJson()
- // 璁剧疆鎵撳嵃浠诲姟
- jcapi.startJob({
- totalCount: 1,
- density: this.printDensity,
- labelType: this.labelType,
- printMode: this.printMode,
- }, function (r) {
- if (r.code == 0) {
- // 鎵撳嵃鏁版嵁
- jcapi.printData(imageJsonObj, {
- "printQuantity": 1,
- }, function (r) {
- if (r.code == 0) {
- console.log("鎵撳嵃鎴愬姛")
- } else {
- console.log("鎵撳嵃澶辫触")
- }
- })
- } else {
- console.log("璁剧疆鎵撳嵃浠诲姟澶辫触")
- }
- })
- },
- tapQuery(item) {
- this.maskShow = false
- // 杩炴帴鎵撳嵃鏈�
- let _this = this;
- console.log(item)
- jcapi.openPrinterByDevice({
- address: item.address,
- name: item.name,
- deviceType: item.deviceType // 璁惧绫诲瀷锛�0-钃濈墮锛�1-缃戠粶
- }, function (r) {
- uni.showToast({
- title: (r.code == 0) ? "杩炴帴鎴愬姛" : "杩炴帴澶辫触",
- duration: 2 * 1000
- })
- if (r.code == 0) {
- _this.connectedDevice = item
- // 缁樻爣绛捐繘琛屾墦鍗�
- _this.pritList.forEac(async item => {
- await _this.printQrCode(item)
- })
- }
- })
- },
- //鎵撳嵃鐩稿叧
- searchDevice() {
- let _this = this
- uni.openBluetoothAdapter({ // 纭钃濈墮鏄惁鎵撳紑
- success(r) {
- uni.showLoading({
- title: "鎼滅储涓�..."
- })
- // 鏈巿浜堣摑鐗欑浉鍏虫潈闄愬拰鏈墦寮�鎵嬫満瀹氫綅浼氭悳绱笉鍒拌澶�
- jcapi.getBluetoothDevices(function (r) {
- console.log("device:" + JSON.stringify(r))
- // 鎼滅储鍒拌澶囧洖璋�
- uni.hideLoading()
- _this.listDevice = r;
- _this.maskShow = true
- })
- },
- fail(e) {
- uni.showModal({
- confirmText: "鎵撳紑钃濈墮澶辫触"
- })
- console.log("寮�鍚摑鐗欒澶囧け璐�" + e)
- }
- })
- },
- // 缁樺埗妯嚎 瀹炵嚎
- getDrawLabelLine(x, y, width, height, rotate, lineType) {
- jcapi.drawLabelLine({
- x: x,
- y: y,
- width: width,
- height: height,
- rotate: rotate,
- lineType: lineType
- });
- },
- // 濉啿鏂囧瓧鏍囬
- getDrawLabelText(x, y, width, height, value, fontSize, rotate, lineMode, lineSpace, letterSpace, textAlignHorizontal, textAlignVertical) {
- jcapi.drawLabelText({
- x: x,
- y: y,
- width: width,
- height: height,
- value: value,
- fontSize: fontSize,
- rotate: rotate,
- lineMode: lineMode,
- lineSpace: lineSpace,
- letterSpace: letterSpace,
- textAlignHorizontal: textAlignHorizontal,
- textAlignVertical: textAlignVertical
- })
- },
+ })
- //鍒锋柊涓婁竴涓〉闈�
- refreshLastPage(no) {
- // 鍛婄煡 A.vue 鏇存柊鏁版嵁
- // 鑾峰彇椤甸潰鏍�
- let pages = getCurrentPages()
+ },
+ tapQuery(item) {
+ this.maskShow = false
+ // 杩炴帴鎵撳嵃鏈�
+ let _this = this;
+ console.log(item)
+ jcapi.openPrinterByDevice({
+ address: item.address,
+ name: item.name,
+ deviceType: 0 // 璁惧绫诲瀷锛�0-钃濈墮锛�1-缃戠粶
+ }, function(r) {
+ uni.showToast({
+ title: (r.code == 0) ? "杩炴帴鎴愬姛" : "杩炴帴澶辫触",
+ duration: 2 * 1000
+ })
+ if (r.code == 0) {
+ _this.connectedDevice = item
+ // 娣诲姞鎵撳嵃鍒楄〃绌哄�兼鏌�
+ if (!_this.pritList || _this.pritList.length === 0) {
+ uni.showToast({
+ title: '娌℃湁鍙墦鍗扮殑鏁版嵁',
+ icon: 'none'
+ })
+ return
+ }
+ // 缁樻爣绛捐繘琛屾墦鍗�
+ _this.pritList.forEach(async item => {
+ await _this.printQrCode(item)
+ })
+ }
+ })
+ },
+ //鎵撳嵃鐩稿叧
+ searchDevice() {
+ let _this = this
+ uni.openBluetoothAdapter({ // 纭钃濈墮鏄惁鎵撳紑
+ success(r) {
+ uni.showLoading({
+ title: "鎼滅储涓�..."
+ })
+ // 鏈巿浜堣摑鐗欑浉鍏虫潈闄愬拰鏈墦寮�鎵嬫満瀹氫綅浼氭悳绱笉鍒拌澶�
+ jcapi.getBluetoothDevices(function(r) {
+ console.log("device:" + JSON.stringify(r))
+ // 鎼滅储鍒拌澶囧洖璋�
+ uni.hideLoading()
+ // 濡傛灉涔嬪墠鏈夎繛鎺ョ殑璁惧浣嗕笉鍦ㄦ悳绱㈢粨鏋滀腑锛岃鏄庤澶囧凡鏇存崲
+ if (_this.connectedDevice && !r.some(dev => dev.address === _this.connectedDevice.address)) {
+ _this.connectedDevice = null;
+ uni.showToast({
+ icon: 'none',
+ title: '宸茶繛鎺ョ殑钃濈墮璁惧宸叉洿鎹紝璇烽噸鏂伴�夋嫨',
+ duration: 2000
+ });
+ }
+ _this.listDevice = r;
+ _this.maskShow = true
+ })
+ },
+ fail(e) {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '鎵撳紑钃濈墮澶辫触锛岃妫�鏌ヨ摑鐗欐槸鍚﹀紑鍚�',
+ showCancel: false
+ })
+ console.log("寮�鍚摑鐗欒澶囧け璐�" + e)
+ }
+ })
+ },
+ // 缁樺埗妯嚎 瀹炵嚎
+ getDrawLabelLine(x, y, width, height, rotate, lineType) {
+ jcapi.drawLabelLine({
+ x: x,
+ y: y,
+ width: width,
+ height: height,
+ rotate: rotate,
+ lineType: lineType
+ });
+ },
+ // 濉啿鏂囧瓧鏍囬
+ getDrawLabelText(x, y, width, height, value, fontSize, rotate, lineMode, lineSpace, letterSpace,
+ textAlignHorizontal, textAlignVertical,bold) {
- // 鑾峰彇涓婁竴椤垫爤
- let prevPage = pages[pages.length - 2]
+ jcapi.drawLabelText({
+ x: x,
+ y: y,
+ width: width,
+ height: height,
+ value: value,
+ fontSize: fontSize,
+ rotate: rotate,
+ lineMode: lineMode,
+ lineSpace: lineSpace,
+ letterSpace: letterSpace,
+ textAlignHorizontal: textAlignHorizontal,
+ textAlignVertical: textAlignVertical,
+ bold:bold
+ })
+ },
- // 瑙﹀彂涓婁竴椤� upData 鍑芥暟(骞舵惡甯﹀弬鏁�)
- prevPage.$vm.setNo(no)
+ //鍒锋柊涓婁竴涓〉闈�
+ refreshLastPage(no) {
+ // 鍛婄煡 A.vue 鏇存柊鏁版嵁
+ // 鑾峰彇椤甸潰鏍�
+ let pages = getCurrentPages()
- // 杩斿洖涓婁竴椤�
- uni.navigateBack({
- delta: 1
- })
- },
- }
-};
+ // 鑾峰彇涓婁竴椤垫爤
+ let prevPage = pages[pages.length - 2]
+
+ // 瑙﹀彂涓婁竴椤� upData 鍑芥暟(骞舵惡甯﹀弬鏁�)
+ prevPage.$vm.setNo(no)
+
+ // 杩斿洖涓婁竴椤�
+ uni.navigateBack({
+ delta: 1
+ })
+ },
+ }
+ };
</script>
<style lang="scss">
-.finishProductIn-locno-bg {
- background-color: #F6F9FF;
- background-image: url('~@/static/custom/finishProductIn/locNoBg.png');
- // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
- padding: 0 20rpx;
- background-attachment: fixed;
- background-size: 100% auto;
- background-repeat: no-repeat;
- position: fixed;
- top: 0;
- bottom: 0;
- width: 100%;
- z-index: -1;
-}
+ .finishProductIn-locno-bg {
+ background-color: #F6F9FF;
+ background-image: url('~@/static/custom/finishProductIn/locNoBg.png');
+ // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
+ padding: 0 20rpx;
+ background-attachment: fixed;
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ width: 100%;
+ z-index: -1;
+ }
-.finishProductIn-locno-search {
- padding: 40rpx 30rpx 20rpx 30rpx;
-}
+ .finishProductIn-locno-search {
+ padding: 40rpx 30rpx 20rpx 30rpx;
+ }
-.wrap .finishProductIn-locno-scroll-list {
- height: calc(100vh - var(--window-top) - var(--window-bottom) - 242rpx);
- width: 100%;
-}
+ .wrap .finishProductIn-locno-scroll-list {
+ height: calc(100vh - var(--window-top) - var(--window-bottom) - 242rpx);
+ width: 100%;
+ }
-.finishProductIn-locno-scroll-list-group {
- ::v-deep .u-cell-item-box {
- background-color: rgba(250, 252, 255, 0.36) !important;
- padding: 0rpx 30rpx;
- }
+ .finishProductIn-locno-scroll-list-group {
+ ::v-deep .u-cell-item-box {
+ background-color: rgba(250, 252, 255, 0.36) !important;
+ padding: 0rpx 30rpx;
+ }
- .content {
- font-size: 12px;
- background-color: #ffffff;
- box-sizing: border-box;
- border-radius: 10rpx;
- margin: 0rpx 0rpx 16rpx;
- padding: 20rpx 8rpx;
- box-shadow: none;
- display: flex;
- align-items: center;
+ .content {
+ font-size: 12px;
+ background-color: #ffffff;
+ box-sizing: border-box;
+ border-radius: 10rpx;
+ margin: 0rpx 0rpx 16rpx;
+ padding: 20rpx 8rpx;
+ box-shadow: none;
+ display: flex;
+ align-items: center;
- .content-header {
- width: 40rpx;
- height: 90rpx;
- display: flex;
- align-items: center;
+ .content-header {
+ width: 40rpx;
+ height: 90rpx;
+ display: flex;
+ align-items: center;
- .content-header-icon {
- background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
- background-size: 100% auto;
- background-repeat: no-repeat;
- height: 28rpx;
- width: 28rpx;
- }
+ .content-header-icon {
+ background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ height: 28rpx;
+ width: 28rpx;
+ }
- .content-header-title {
- margin-left: 11rpx;
- font-size: 26rpx;
- font-weight: bold;
- color: #3d52f5;
- }
- }
+ .content-header-title {
+ margin-left: 11rpx;
+ font-size: 26rpx;
+ font-weight: bold;
+ color: #3d52f5;
+ }
+ }
- .content-body {
- flex: 1;
- background: #f5f9ff;
- border-radius: 10rpx;
- padding: 0rpx 23rpx;
+ .content-body {
+ flex: 1;
+ background: #f5f9ff;
+ border-radius: 10rpx;
+ padding: 0rpx 23rpx;
- .row-list {
- height: 60rpx;
- display: flex;
- flex-direction: row;
- padding: 0px;
- align-items: center;
- }
+ .row-list {
+ height: 60rpx;
+ display: flex;
+ flex-direction: row;
+ padding: 0px;
+ align-items: center;
+ }
- .row-list ._label {
- display: flex;
- flex: 0.8;
- color: #909399;
- align-items: center;
+ .row-list ._label {
+ display: flex;
+ flex: 0.8;
+ color: #909399;
+ align-items: center;
- ._label-icon-1 {
- background-image: url("~@/static/custom/moveWareHouse/label-icon-1.png");
- background-size: 100% auto;
- background-repeat: no-repeat;
- height: 26rpx;
- width: 26rpx;
- }
+ ._label-icon-1 {
+ background-image: url("~@/static/custom/moveWareHouse/label-icon-1.png");
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ height: 26rpx;
+ width: 26rpx;
+ }
- ._label-icon-2 {
- background-image: url("~@/static/custom/moveWareHouse/label-icon-2.png");
- background-size: 100% auto;
- background-repeat: no-repeat;
- height: 26rpx;
- width: 26rpx;
- }
+ ._label-icon-2 {
+ background-image: url("~@/static/custom/moveWareHouse/label-icon-2.png");
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ height: 26rpx;
+ width: 26rpx;
+ }
- ._label-icon-3 {
- background-image: url("~@/static/custom/moveWareHouse/label-icon-3.png");
- background-size: 100% auto;
- background-repeat: no-repeat;
- height: 26rpx;
- width: 26rpx;
- }
+ ._label-icon-3 {
+ background-image: url("~@/static/custom/moveWareHouse/label-icon-3.png");
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ height: 26rpx;
+ width: 26rpx;
+ }
- ._label-name {
- margin-left: 11rpx;
- font-size: 26rpx;
- font-weight: 500;
- color: #666666;
- }
- }
+ ._label-name {
+ margin-left: 11rpx;
+ font-size: 26rpx;
+ font-weight: 500;
+ color: #666666;
+ }
+ }
- .row-list ._content {
- flex: 1.5;
- text-align: right;
- color: #909399;
- font-size: 24rpx;
- }
+ .row-list ._content {
+ flex: 1.5;
+ text-align: right;
+ color: #909399;
+ font-size: 24rpx;
+ }
- .row-list .s1 {
- color: #d35651;
- }
- }
- }
-}
+ .row-list .s1 {
+ color: #d35651;
+ }
+ }
+ }
+ }
-.navbar-right {
- font-weight: 500;
- font-size: 13px;
- color: #0b0b0b;
- line-height: 36rpx;
- margin-right: 32rpx;
-}
-</style>
+ .navbar-right {
+ font-weight: 500;
+ font-size: 13px;
+ color: #0b0b0b;
+ line-height: 36rpx;
+ margin-right: 32rpx;
+ }
+</style>
\ No newline at end of file
diff --git a/pages/wareHouse/nuclearScale/saveForm.vue b/pages/wareHouse/nuclearScale/saveForm.vue
new file mode 100644
index 0000000..6709109
--- /dev/null
+++ b/pages/wareHouse/nuclearScale/saveForm.vue
@@ -0,0 +1,378 @@
+<template>
+ <u-modal
+ v-model="show"
+ ref="uModal"
+ title=""
+ :show-cancel-button="true"
+ @confirm="confirm"
+ @cancel="cancel"
+ :async-close="true"
+ >
+ <view class="packing-registration-param">
+ <scroll-view scroll-y="true" style="height: 100%">
+ <view class="packing-registration-param-view">
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">鎵规鍙�</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <u-input
+ class="item-one item-two"
+ v-model="form.overallLength"
+ disabled
+ />
+ </view>
+ </view>
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">浜у搧鎻忚堪</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <u-input
+ class="item-one item-two"
+ v-model="form.proposedLocation"
+ disabled
+ />
+ </view>
+ </view>
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">闆朵欢浣�</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <u-input
+ class="item-one item-two"
+ v-model="form.reelNumber"
+ disabled
+ />
+ </view>
+ </view>
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">姣涢噸</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <u-input
+ class="item-one item-two"
+ v-model="form.reelWeight"
+ disabled
+ />
+ </view>
+ </view>
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">鐩橀噸</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <u-input
+ class="item-one item-two"
+ v-model="form.grossWeight"
+ disabled
+ />
+ </view>
+ </view>
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">鍑�閲�</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <u-input
+ class="item-one item-two"
+ v-model="form.netWeight"
+ disabled
+ />
+ </view>
+ </view>
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">鏍哥閲嶉噺</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <u-input class="item-one item-two" v-model="form.name" />
+ </view>
+ </view>
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">鍙夎溅閲嶉噺</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <u-input class="item-one item-two" v-model="form.outerDiameter" />
+ </view>
+ </view>
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">闀垮害</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <u-input class="item-one item-two" v-model="form.voltage" />
+ </view>
+ </view>
+ <view class="packing-registration-param-item param-extra">
+ <view class="packing-registration-param-item-left">
+ <text class="item-one">鐩樺彿</text>
+ </view>
+ <view class="packing-registration-param-item-right">
+ <u-input class="item-one item-two" v-model="form.speed" />
+ </view>
+ </view>
+ </view>
+ </scroll-view>
+ </view>
+ </u-modal>
+</template>
+
+<script>
+export default {
+ props: {
+ operationTaskList: {
+ type: Object,
+ required: true,
+ default: () => ({}),
+ },
+ },
+ data() {
+ return {
+ show: false,
+ form: {},
+ };
+ },
+ methods: {
+ confirm() {
+ if (!this.form.outerDiameter) {
+ this.$u.toast("璇疯緭鍏ユ牳纾呴噸閲�");
+ this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵��
+ return;
+ }
+ if (!this.form.voltage) {
+ this.$u.toast("璇疯緭鍏ュ弶杞﹂噸閲�");
+ this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵��
+ return;
+ }
+ // PDA 鎵爜鏍哥瑙勫垯:
+ // (1).閾滄潌
+ // 姝g宸�:0-3kg 鍙洿鎺ユ彁浜�
+ // 4-10kg 鐨噸涓嶅彉
+ // 濡傛灉涓� 4kg 鍑�閲嶅姞 2kg銆佹瘺閲嶅姞 2kg
+ // 濡傛灉涓� 5kg 鍑�閲嶅姞 3kg銆佹瘺閲嶅姞 4kg
+ // 濡傛灉涓� 6kg 鍑�閲嶅姞 4kg銆佹瘺閲嶅姞 4kg
+ // 浠ユ绫绘帹
+ // 娣诲姞寮圭獥鎻愮ず:鏇存敼鍚堟牸璇佹瘺閲嶄负..(鏀瑰悗鐨勫��)銆佸噣閲嶄负..(鏀瑰悗鐨勫噣閲�)
+ // 瓒呰繃 10kg鎻愮ず鐢熶骇鏍告煡(涓嶈兘鎻愪氦)
+ // 璐熺宸�(瑕佸姞璐熷彿):鍑�閲嶄笉鍙�
+ // -10kg 浠ュ唴
+ // 鏍哥閲嶉噺-2(鏂扮殑姣涢噸)鐨噸(鏂扮殑姣涢噸-鍑�閲�)瓒呰繃 10kg鎻愮ず鐢熶骇鏍告煡(涓嶈兘鎻愪氦)
+ // (2).瀵间綋
+ // 姝g宸�:0-3kg鍙洿鎺ユ彁浜�
+ // 瓒呰繃 3kg鍙� 璐熺宸彁绀虹敓浜ф牳鏌�(涓嶈兘鎻愪氦)
+ // (3).瀵间綋2.6
+ // 澹�0.5kg 閮藉彲鐩存帴鎻愪氦
+ // 瓒呰繃0.5 鎻愮ず鐢熶骇鏍告煡
+ //纾呭樊璁$畻锛氭牳姒�-鍙夎溅鐩�-姣涢噸
+ Number(this.form.h);
+ const magnetic =
+ Number(this.form.h) - Number(this.form.children) - Number(this.form.m);
+ uni.showModal({
+ title: "鎻愮ず",
+ content: "纾呭樊涓猴細" + magnetic,
+ showCancel: false,
+ success: function () {
+ switch (this.operationTaskList.productType) {
+ case "閾滄潌":
+ if (magnetic > 0 && magnetic < 3) {
+ this.verifySubmission(this.form);
+ }
+ if (magnetic == 4) {
+ this.form.grossWeight = Number(this.form.grossWeight) + 2;
+ this.form.netWeight = Number(this.form.netWeight) + 2;
+ this.$u.toast(
+ "鏇存敼鍚堟牸璇佹瘺閲嶄负锛�" +
+ this.form.grossWeight +
+ "鍑�閲嶄负锛�" +
+ this.form.netWeight
+ );
+ this.verifySubmission(this.form);
+ }
+ if (magnetic == 5) {
+ this.form.grossWeight = Number(this.form.grossWeight) + 3;
+ this.form.netWeight = Number(this.form.netWeight) + 3;
+ this.$u.toast(
+ "鏇存敼鍚堟牸璇佹瘺閲嶄负锛�" +
+ this.form.grossWeight +
+ "鍑�閲嶄负锛�" +
+ this.form.netWeight
+ );
+ this.verifySubmission(this.form);
+ }
+ if (magnetic == 6) {
+ this.form.grossWeight = Number(this.form.grossWeight) + 4;
+ this.form.netWeight = Number(this.form.netWeight) + 4;
+ this.$u.toast(
+ "鏇存敼鍚堟牸璇佹瘺閲嶄负锛�" +
+ this.form.grossWeight +
+ "鍑�閲嶄负锛�" +
+ this.form.netWeight
+ );
+ this.verifySubmission(this.form);
+ }
+ if (magnetic == 7) {
+ this.form.grossWeight = Number(this.form.grossWeight) + 5;
+ this.form.netWeight = Number(this.form.netWeight) + 5;
+ this.$u.toast(
+ "鏇存敼鍚堟牸璇佹瘺閲嶄负锛�" +
+ this.form.grossWeight +
+ "鍑�閲嶄负锛�" +
+ this.form.netWeight
+ );
+ this.verifySubmission(this.form);
+ }
+ if (magnetic == 8) {
+ this.form.grossWeight = Number(this.form.grossWeight) + 6;
+ this.form.netWeight = Number(this.form.netWeight) + 6;
+ this.$u.toast(
+ "鏇存敼鍚堟牸璇佹瘺閲嶄负锛�" +
+ this.form.grossWeight +
+ "鍑�閲嶄负锛�" +
+ this.form.netWeight
+ );
+ this.verifySubmission(this.form);
+ }
+ if (magnetic == 9) {
+ this.form.grossWeight = Number(this.form.grossWeight) + 7;
+ this.form.netWeight = Number(this.form.netWeight) + 7;
+ this.$u.toast(
+ "鏇存敼鍚堟牸璇佹瘺閲嶄负锛�" +
+ this.form.grossWeight +
+ "鍑�閲嶄负锛�" +
+ this.form.netWeight
+ );
+ this.verifySubmission(this.form);
+ }
+ if (magnetic == 10) {
+ this.form.grossWeight = Number(this.form.grossWeight) + 8;
+ this.form.netWeight = Number(this.form.netWeight) + 8;
+ this.$u.toast(
+ "鏇存敼鍚堟牸璇佹瘺閲嶄负锛�" +
+ this.form.grossWeight +
+ "鍑�閲嶄负锛�" +
+ this.form.netWeight
+ );
+ this.verifySubmission(this.form);
+ }
+ if (magnetic > 10) {
+ this.$u.toast("鐢熶骇鏍告煡");
+ }
+ break;
+ // case "瀵间綋":
+ // if (magnetic > 0 && magnetic < 3) {
+ // this.verifySubmission(this.form);
+ // } else {
+ // this.$u.toast("鐢熶骇鏍告煡");
+ // }
+ // break;
+ // case "瀵间綋2.6":
+ // if (magnetic > -0.5 && magnetic < 0.5) {
+ // this.verifySubmission(this.form);
+ // } else {
+ // this.$u.toast("鐢熶骇鏍告煡");
+ // }
+ // break;
+ }
+ },
+ });
+ },
+ // 鏍¢獙鍚庢彁浜�
+ verifySubmission(Obj) {
+ this.$emit("update", Obj);
+ },
+ cancel() {
+ this.show = false;
+ this.form = {};
+ },
+ open(val) {
+ this.show = true;
+ this.form = val;
+ },
+ },
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep .u-model__title {
+ padding-top: 0 !important;
+}
+
+::v-deep .u-input__input {
+ text-align: right !important;
+}
+
+.packing-registration-param {
+ padding: 40rpx 30rpx 10rpx 30rpx;
+ height: 350px;
+ overflow: hidden;
+
+ .packing-registration-param-title {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ margin-bottom: 30rpx;
+
+ .title-label {
+ margin-left: 14rpx;
+ font-size: 34rpx;
+ font-weight: bold;
+ color: #283e65;
+ }
+ }
+
+ .packing-registration-param-view {
+ height: 177rpx;
+ background-color: #fff;
+ border-radius: 10rpx;
+ padding: 0rpx 23rpx;
+ margin-bottom: 30rpx;
+
+ .packing-registration-param-item {
+ height: 90rpx;
+ border: 1px solid #adc8e4;
+ line-height: 90rpx;
+ display: flex;
+ justify-content: space-between;
+ border: none;
+
+ .packing-registration-param-item-left {
+ .item-one {
+ font-size: 30rpx;
+ color: #666666;
+ }
+ }
+
+ .packing-registration-param-item-right {
+ display: flex;
+ justify-content: space-between;
+
+ .item-one {
+ font-size: 15rpx;
+ color: #060505;
+ margin-right: 6rpx;
+ }
+
+ .item-two {
+ font-size: 15rpx;
+ color: #a6b4cc;
+ margin-right: 6rpx;
+ }
+
+ .item-three {
+ font-size: 30rpx;
+ color: #214ded;
+ margin-right: 6rpx;
+ }
+ }
+ }
+
+ .param-extra {
+ border-bottom: 1px solid #ededed;
+ }
+ }
+}
+</style>
\ No newline at end of file
--
Gitblit v1.9.3