From bbae990ed1f4574fa954753faeae159052d03fba Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期二, 27 一月 2026 16:14:06 +0800
Subject: [PATCH] 待我审核增加销售订单,采购订单
---
pages/MJGL/shangmudan/MouldUpperBill.vue | 366 +++++++++++++++++++++-------------------------------
1 files changed, 149 insertions(+), 217 deletions(-)
diff --git a/pages/MJGL/shangmudan/MouldUpperBill.vue b/pages/MJGL/shangmudan/MouldUpperBill.vue
index 53591d2..514dd2e 100644
--- a/pages/MJGL/shangmudan/MouldUpperBill.vue
+++ b/pages/MJGL/shangmudan/MouldUpperBill.vue
@@ -14,6 +14,7 @@
<view class="tabs">
<view :class="tabs == 0 ? 'on':''" @tap="() => { tabs = 0; reFocusBarCode(); }">鍗曟嵁淇℃伅</view>
<view :class="tabs == 1 ? 'on':''" @tap="() => { tabs = 1; reFocusBarCode(); }">妯″叿淇℃伅</view>
+ <view :class="tabs == 2 ? 'on':''" @tap="() => { tabs = 2; reFocusBarCode(); }">鍒跺崟淇℃伅</view>
</view>
<!-- 鍗曟嵁淇℃伅 -->
@@ -89,15 +90,44 @@
</view>
<!-- 妯″叿淇℃伅 -->
<view v-if="tabs == 1">
- <zb-table id="list-table" :checked-highlight="true" :fit="true"
- :style="{height: `${listTableHeight}px`}" :columns="columns" :data="listData" :show-header="true"
- :border="true" :row-key="row => row.index" @toggleRowSelection="handleSelect"
- @toggleAllSelection="handleSelectAll" @rowClick="onTableRowClickHandler" />
+ <view class="card-list" :style="{height: `${listTableHeight}px`, overflow: 'auto'}">
+ <!-- 鍗$墖鍒楄〃 -->
+ <view v-for="(item, index) in listData" :key="index" class="card-item">
+ <uni-card style="margin: 10rpx 0;">
+ <view class="card-content">
+ <view class="card-row">
+ <text class="label">搴忓彿锛�</text>
+ <text class="value">{{ index + 1 }}</text>
+ </view>
+ <view class="card-row">
+ <text class="label">鍣ㄥ叿缂栫爜锛�</text>
+ <text class="value">{{ item.鍣ㄥ叿缂栫爜 }}</text>
+ </view>
+ <view class="card-row">
+ <text class="label">鍣ㄥ叿鍚嶇О锛�</text>
+ <text class="value">{{ item.鍣ㄥ叿鍚嶇О }}</text>
+ </view>
+ <view class="card-row">
+ <text class="label">鍣ㄥ叿鍨嬪彿锛�</text>
+ <text class="value">{{ item.鍣ㄥ叿鍨嬪彿 }}</text>
+ </view>
+ <view class="card-row">
+ <text class="label">鍣ㄥ叿鏉$爜锛�</text>
+ <text class="value">{{ item.鍣ㄥ叿鏉$爜 }}</text>
+ </view>
+ <view class="card-row">
+ <text class="label">鍣ㄥ叿鏁伴噺锛�</text>
+ <text class="value">{{ item.鍣ㄥ叿鏁伴噺 }}</text>
+ </view>
+ </view>
+ </uni-card>
+ </view>
+
+ <view class="over" v-if="listData.length == 0">鏆傛棤妯″叿鏁版嵁</view>
+ </view>
</view>
- <view class="tab_area"></view>
-
- <view v-if="showmore">
+ <view v-if="tabs == 2">
<view class="form-item">
<view class="title">鍒跺崟浜�:</view>
<view class="righton">
@@ -139,16 +169,6 @@
</view>
</view>
- <view class="other">
- <view v-if="!showmore" @tap="showmore = true">
- 灞曞紑鍏朵粬淇℃伅<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="bottom"></uni-icons>
- </view>
- <view v-if="showmore" @tap="showmore = false">
- 鎶樺彔鍏朵粬淇℃伅<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="top"></uni-icons>
- </view>
- </view>
-
- <view class="tab_area"></view>
<view class="bottom-btn">
<button v-if="btnType == 1 && !isEdit" class="btn-a" size="mini" @tap="submit">鎻愪氦</button>
@@ -193,51 +213,6 @@
listOption: [], // 鍒楄〃閫夐」
listData: [], // 琛ㄦ牸鏁版嵁
selectedRows: [], // 琛ㄦ牸閫変腑鐨勬暟鎹�
- // 鍦╟olumns閰嶇疆涓坊鍔犳搷浣滃垪
- columns: [ // 琛ㄦ牸鍒楅厤缃�
- {
- type: 'selection',
- fixed: true,
- width: 50
- },
- {
- name: 'index',
- label: '搴忓彿',
- width: 60,
- hidden: true
- },
- {
- name: 'HMouldID',
- label: 'HMouldID',
- width: 100,
- hidden: true
- },
- {
- name: '鍣ㄥ叿鏁伴噺',
- label: '鍣ㄥ叿鏁伴噺',
- width: 120
- },
- {
- name: '鍣ㄥ叿缂栫爜',
- label: '鍣ㄥ叿缂栫爜',
- width: 150
- },
- {
- name: '鍣ㄥ叿鍚嶇О',
- label: '鍣ㄥ叿鍚嶇О',
- width: 120
- },
- {
- name: '鍣ㄥ叿鍨嬪彿',
- label: '鍣ㄥ叿鍨嬪彿',
- width: 120
- },
- {
- name: '鍣ㄥ叿鏉$爜',
- label: '鍣ㄥ叿鏉$爜',
- width: 120
- }
- ],
hform: {
HInterID: '',
@@ -248,8 +223,8 @@
HDeptID: uni.getStorageSync('HDeptID'),
HEmpName: uni.getStorageSync('HEmpName'),
HEmpID: uni.getStorageSync('HEmpID'),
- HMangerName: uni.getStorageSync('HEmpName'),
- HMangerID: uni.getStorageSync('HEmpID'),
+ HMangerName: uni.getStorageSync('HMangerName'),
+ HMangerID: uni.getStorageSync('HMangerID'),
HSourceName: '',
@@ -336,75 +311,16 @@
this.HBarCodeFocus = true;
});
},
- // 琛ㄦ牸琛岀偣鍑诲鐞�
- onTableRowClickHandler(row, index) {
- if (!this.listData[index].checked) {
- this.$set(this.listData[index], 'checked', true)
- } else {
- this.listData[index].checked = !this.listData[index].checked
- }
- },
-
- // 琛ㄦ牸閫夋嫨澶勭悊
- handleSelect(selected, array) {
- this.selectedRows = array
- },
-
- // 琛ㄦ牸鍏ㄩ�夊鐞�
- handleSelectAll(selected, array) {
- this.selectedRows = array
- },
- // 琛ㄦ牸琛屽垹闄�
- deleteSelected() {
- if (this.selectedRows.length === 0) {
- uni.showToast({
- title: '璇峰厛閫夋嫨瑕佸垹闄ょ殑妯″叿',
- icon: 'none'
- })
- return
- }
-
- // 鏄剧ず纭瀵硅瘽妗�
- uni.showModal({
- title: '纭鍒犻櫎',
- content: `纭畾瑕佸垹闄ら�変腑鐨�${this.selectedRows.length}鏉℃暟鎹悧锛焋,
- success: (res) => {
- if (res.confirm) {
- // 鑾峰彇閫変腑琛岀殑HMouldID闆嗗悎
- const selectedIds = this.selectedRows.map(row => row.HMouldID)
-
- // 杩囨护鎺夐�変腑鐨勬暟鎹�
- this.listData = this.listData.filter(item =>
- !selectedIds.includes(item.HMouldID)
- )
-
- // 閲嶆柊璁$畻搴忓彿
- this.listData.forEach((item, index) => {
- item.index = index + 1
- })
-
- // 娓呯┖閫変腑鐘舵��
- this.selectedRows = []
-
- uni.showToast({
- title: '鍒犻櫎鎴愬姛',
- icon: 'success'
- })
- }
- }
- })
- },
-
//鏃ユ湡
HDateChange(e) {
console.log(e.detail.value)
this.hform.HDate = e.detail.value
},
getHBarCodeData(HBarCode) {
- if (uni.getStorageSync('Organization') == "鏉窞鏂帿灏旂鎬ф潗鏂欐湁闄愬叕鍙�") {
+ if (uni.getStorageSync('Organization') != "浜嬩笟涓�澶�") {
if (!this.hform.HSourceName) {
uni.showToast({
- title: '璇峰厛閫夋嫨鐢熶骇璧勬簮',
+ title: '璇峰厛閫夋嫨鎴栨壂鎻忕敓浜ц祫婧�',
icon: 'none'
});
return;
@@ -445,12 +361,9 @@
HBillType: HBillType
},
success: (res) => {
- console.log(2, res.data);
if (res.data.code == 1) {
var data = res.data.data[0];
- console.log(3, data);
var num = data.Num;
- console.log(4, num);
switch (num) {
case 1:
this.hform.HSourceID = data.HItemID;
@@ -479,84 +392,28 @@
});
return;
}
+ // 鏍规嵁缁勭粐鏉′欢鍐冲畾鏄惁杩涜鏍¢獙
+ const isSpecialOrg = uni.getStorageSync('OrganizationID') == "100007" &&
+ uni.getStorageSync('Organization') == "浜嬩笟涓�澶�";
- // 鍏堣皟鐢ㄦā鍏锋。妗堟鏌ワ紝鏍¢獙閫氳繃鍚庢墠娣诲姞鏁版嵁
- this.getMould_FC().then(isValid => {
- if (isValid) {
- this.tabs = 1;
- // 妫�鏌ユā鍏锋槸鍚﹀凡瀛樺湪浜庤〃鏍间腑
- const existingIndex = this.listData.findIndex(item =>
- item.HMouldID === data.hmainid
- );
- if (uni.getStorageSync('OrganizationID') == "100007" && uni
- .getStorageSync('Organization') == "浜嬩笟涓�澶�") {
- if (existingIndex === -1) {
- // 濡傛灉涓嶅瓨鍦紝娣诲姞鍒拌〃鏍�
- uni.showToast({
- title: '褰撳墠妫�鍏蜂笉鍦ㄥ綋鍓嶇墿鏂欑殑妫�鍏锋竻鍗曚腑',
- icon: 'none',
- duration: 1500
- });
- this.refreshBarCodeState();
- } else {
- // 濡傛灉宸插瓨鍦紝妫�鏌ュ櫒鍏锋暟閲�
- if (this.listData[existingIndex].鍣ㄥ叿鏁伴噺 === 0) {
- // 鍣ㄥ叿鏁伴噺涓�0锛屾洿鏂版潯鐮佸苟灏嗘暟閲忓彉涓�1
- this.listData[existingIndex].鍣ㄥ叿鏉$爜 = this.hform
- .HBarCode;
- this.listData[existingIndex].鍣ㄥ叿鏁伴噺 = 1;
- uni.showToast({
- title: '鎵弿鎴愬姛',
- icon: 'success',
- duration: 1500
- });
- this.refreshBarCodeState();
- } else {
- // 鍣ㄥ叿鏁伴噺宸蹭负1锛屾彁绀轰笉鍏佽閲嶅鎵弿
- uni.showToast({
- title: '璇ユā鍏峰凡鎵弿锛屼笉鍏佽閲嶅鎵弿',
- icon: 'none',
- duration: 1500
- });
- this.refreshBarCodeState();
- }
- }
+ if (isSpecialOrg) {
+ // 鐗规畩缁勭粐锛氶渶瑕佽皟鐢ㄦā鍏锋。妗堟鏌�
+ this.getMould_FC().then(isValid => {
+ if (isValid) {
+ this.handleMouldData(data);
} else {
- if (existingIndex === -1) {
- // 濡傛灉涓嶅瓨鍦紝娣诲姞鍒拌〃鏍�
- const newRow = {
- index: this.listData.length + 1,
- HMouldID: data.hmainid,
- 鍣ㄥ叿缂栫爜: data.妯″叿缂栧彿,
- 鍣ㄥ叿鍚嶇О: data.妯″叿鍚嶇О,
- 鍣ㄥ叿鍨嬪彿: data.妯″叿鍨嬪彿,
- 鍣ㄥ叿鏉$爜: this.hform.HBarCode,
- 鍣ㄥ叿鏁伴噺: 1,
- checked: false // 榛樿涓嶉�変腑
- };
- this.listData.push(newRow);
- this.refreshBarCodeState();
- } else {
- // 濡傛灉宸插瓨鍦紝鎻愮ず鐢ㄦ埛
- uni.showToast({
- title: '璇ユā鍏峰凡鎵弿',
- icon: 'none',
- duration: 1500
- });
- this.refreshBarCodeState();
- }
+ // 鏍¢獙涓嶉�氳繃锛屾竻绌烘潯鐮佷絾涓嶆坊鍔犳暟鎹�
+ this.refreshBarCodeState();
}
-
- } else {
- // 鏍¢獙涓嶉�氳繃锛屾竻绌烘潯鐮佷絾涓嶆坊鍔犳暟鎹�
+ }).catch(error => {
+ console.log('鏍¢獙澶辫触:', error);
this.refreshBarCodeState();
- }
- }).catch(error => {
- console.log('鏍¢獙澶辫触:', error);
- this.refreshBarCodeState();
- });
+ });
+ } else {
+ // 鍏朵粬缁勭粐锛氱洿鎺ュ鐞嗘ā鍏锋暟鎹�
+ this.handleMouldData(data);
+ }
break;
-
case 4:
this.hform.HProcExchBillNo = data.鍗曟嵁鍙�;
this.hform.HProcExchInterID = data.hmainid;
@@ -595,6 +452,80 @@
})
},
});
+ },
+ handleMouldData(data) {
+ this.tabs = 1;
+ // 妫�鏌ユā鍏锋槸鍚﹀凡瀛樺湪浜庤〃鏍间腑
+ const existingIndex = this.listData.findIndex(item =>
+ item.HMouldID === data.hmainid
+ );
+
+ const isSpecialOrg = uni.getStorageSync('OrganizationID') == "100007" &&
+ uni.getStorageSync('Organization') == "浜嬩笟涓�澶�";
+
+ if (isSpecialOrg) {
+ // 鐗规畩缁勭粐锛氭鏌ョ墿鏂欏櫒鍏锋竻鍗�
+ if (existingIndex === -1) {
+ // 濡傛灉涓嶅瓨鍦紝璇存槑涓嶅湪褰撳墠鐗╂枡鐨勬鍏锋竻鍗曚腑
+ uni.showToast({
+ title: '褰撳墠妫�鍏蜂笉鍦ㄥ綋鍓嶇墿鏂欑殑妫�鍏锋竻鍗曚腑',
+ icon: 'none',
+ duration: 1500
+ });
+ this.refreshBarCodeState();
+ } else {
+ // 濡傛灉宸插瓨鍦紝妫�鏌ュ櫒鍏锋暟閲�
+ if (this.listData[existingIndex].鍣ㄥ叿鏁伴噺 === 0) {
+ // 鍣ㄥ叿鏁伴噺涓�0锛屾洿鏂版潯鐮佸苟灏嗘暟閲忓彉涓�1
+ this.listData[existingIndex].鍣ㄥ叿鏉$爜 = this.hform.HBarCode;
+ this.listData[existingIndex].鍣ㄥ叿鏁伴噺 = 1;
+ uni.showToast({
+ title: '鎵弿鎴愬姛',
+ icon: 'success',
+ duration: 1500
+ });
+ this.refreshBarCodeState();
+ } else {
+ // 鍣ㄥ叿鏁伴噺宸蹭负1锛屾彁绀轰笉鍏佽閲嶅鎵弿
+ uni.showToast({
+ title: '璇ユā鍏峰凡鎵弿锛屼笉鍏佽閲嶅鎵弿',
+ icon: 'none',
+ duration: 1500
+ });
+ this.refreshBarCodeState();
+ }
+ }
+ } else {
+ // 鍏朵粬缁勭粐锛氱洿鎺ュ鐞�
+ if (existingIndex === -1) {
+ // 濡傛灉涓嶅瓨鍦紝娣诲姞鍒拌〃鏍�
+ const newRow = {
+ index: this.listData.length + 1,
+ HMouldID: data.hmainid,
+ 鍣ㄥ叿缂栫爜: data.妯″叿缂栧彿,
+ 鍣ㄥ叿鍚嶇О: data.妯″叿鍚嶇О,
+ 鍣ㄥ叿鍨嬪彿: data.妯″叿鍨嬪彿,
+ 鍣ㄥ叿鏉$爜: this.hform.HBarCode,
+ 鍣ㄥ叿鏁伴噺: 1,
+ checked: false // 榛樿涓嶉�変腑
+ };
+ this.listData.push(newRow);
+ uni.showToast({
+ title: '鎵弿鎴愬姛',
+ icon: 'success',
+ duration: 1500
+ });
+ this.refreshBarCodeState();
+ } else {
+ // 濡傛灉宸插瓨鍦紝鎻愮ず鐢ㄦ埛
+ uni.showToast({
+ title: '璇ユā鍏峰凡鎵弿',
+ icon: 'none',
+ duration: 1500
+ });
+ this.refreshBarCodeState();
+ }
+ }
},
//鑾峰彇浣跨敤閮ㄩ棬鏁版嵁
getHDeptList() {
@@ -833,7 +764,7 @@
success: (res) => {
if (res.data.code == 1 && res.data.data && res.data.data.length > 0) {
this.listData = [];
- this.tabs=1;
+ this.tabs = 1;
res.data.data.forEach((item, index) => {
this.listData.push({
index: index + 1,
@@ -845,7 +776,7 @@
鍣ㄥ叿鏁伴噺: 0
});
});
-
+
this.selectedRows = [...this.listData];
} else {
uni.showToast({
@@ -941,21 +872,21 @@
// 濡傛灉鏄簨涓氫竴澶勭粍缁囷紝鏍¢獙鍣ㄥ叿鏁伴噺
if (uni.getStorageSync('OrganizationID') === "100007" && uni.getStorageSync('Organization') === "浜嬩笟涓�澶�") {
const zeroQtyItem = this.listData.find(item => {
- // 鑰冭檻0銆乶ull銆乽ndefined绛夊紓甯告儏鍐�
- const qty = Number(item.鍣ㄥ叿鏁伴噺) || 0;
- return qty <= 0;
+ // 鑰冭檻0銆乶ull銆乽ndefined绛夊紓甯告儏鍐�
+ const qty = Number(item.鍣ㄥ叿鏁伴噺) || 0;
+ return qty <= 0;
});
-
+
if (zeroQtyItem) {
- // 鎵惧埌绗竴涓暟閲忓紓甯搁」鐨勪綅缃紙绱㈠紩+1锛�
- const index = this.listData.indexOf(zeroQtyItem) + 1;
- const code = zeroQtyItem.鍣ㄥ叿缂栫爜 || '鏈煡缂栫爜';
- uni.showToast({
- title: `绗�${index}琛屻��${code}銆戝櫒鍏锋暟閲忎负0锛岃妫�鏌,
- icon: 'none',
- duration: 3000
- });
- return;
+ // 鎵惧埌绗竴涓暟閲忓紓甯搁」鐨勪綅缃紙绱㈠紩+1锛�
+ const index = this.listData.indexOf(zeroQtyItem) + 1;
+ const code = zeroQtyItem.鍣ㄥ叿缂栫爜 || '鏈煡缂栫爜';
+ uni.showToast({
+ title: `绗�${index}琛屻��${code}銆戝櫒鍏锋暟閲忎负0锛岃妫�鏌,
+ icon: 'none',
+ duration: 3000
+ });
+ return;
}
}
if (!this.hform.HEmpName) {
@@ -1187,7 +1118,7 @@
}
.btn-c {
- background-color: #acacac;
+ background-color: #FFA500;
color: #fff;
position: absolute;
right: 120rpx;
@@ -1219,4 +1150,5 @@
border-bottom: 3px solid #3a78ff;
}
}
+
</style>
\ No newline at end of file
--
Gitblit v1.9.1