|
@@ -57,11 +57,12 @@
|
|
|
<!-- 下拉菜单内容 -->
|
|
<!-- 下拉菜单内容 -->
|
|
|
<view class="more-dropdown" v-if="activeMenuId === item.id">
|
|
<view class="more-dropdown" v-if="activeMenuId === item.id">
|
|
|
<view class="dropdown-item" hover-class="none" @click.stop="handleDebtChangeFromMenu(item)">
|
|
<view class="dropdown-item" hover-class="none" @click.stop="handleDebtChangeFromMenu(item)">
|
|
|
- <text class="dropdown-icon">📋</text>
|
|
|
|
|
<text class="dropdown-text">挂账变动明细(废弃)</text>
|
|
<text class="dropdown-text">挂账变动明细(废弃)</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="dropdown-item" hover-class="none" @click.stop="handleDeleteFromMenu(item)">
|
|
|
|
|
- <text class="dropdown-icon">🗑</text>
|
|
|
|
|
|
|
+ <view class="dropdown-item" hover-class="none" @click.stop="handleRefreshDebtNum(item)">
|
|
|
|
|
+ <text class="dropdown-text">待结笔数刷新</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="dropdown-item dropdown-item-danger" hover-class="none" @click.stop="handleDeleteFromMenu(item)">
|
|
|
<text class="dropdown-text">删除供货商</text>
|
|
<text class="dropdown-text">删除供货商</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -84,9 +85,9 @@
|
|
|
<!-- 记录信息区(中部,非删除状态显示) -->
|
|
<!-- 记录信息区(中部,非删除状态显示) -->
|
|
|
<view class="record-section" v-if="isNormalList">
|
|
<view class="record-section" v-if="isNormalList">
|
|
|
<view class="record-buttons">
|
|
<view class="record-buttons">
|
|
|
|
|
+ <view class="record-btn" hover-class="none" @click.stop="cgList(item)">采购记录</view>
|
|
|
<view class="record-btn" hover-class="none" @click.stop="pageTo({ url: '/admin/clear/list?ghsId='+item.id})">结账记录</view>
|
|
<view class="record-btn" hover-class="none" @click.stop="pageTo({ url: '/admin/clear/list?ghsId='+item.id})">结账记录</view>
|
|
|
<view class="record-btn" hover-class="none" @click.stop="getBalanceList(item)">余额变动明细</view>
|
|
<view class="record-btn" hover-class="none" @click.stop="getBalanceList(item)">余额变动明细</view>
|
|
|
- <view class="record-btn" hover-class="none" @click.stop="cgList(item)">采购记录</view>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -174,7 +175,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import Tabs from "@/components/plugin/tabs";
|
|
import Tabs from "@/components/plugin/tabs";
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
-import { getList, changeGhsName, changeLocationFn, changeDelStatus } from "@/api/ghs";
|
|
|
|
|
|
|
+import { getList, changeGhsName, changeLocationFn, changeDelStatus, refreshDebtNum } from "@/api/ghs";
|
|
|
import AppSearchModule from "@/components/module/app-search";
|
|
import AppSearchModule from "@/components/module/app-search";
|
|
|
import ModalModule from "@/components/plugin/modal";
|
|
import ModalModule from "@/components/plugin/modal";
|
|
|
import { list } from "@/mixins";
|
|
import { list } from "@/mixins";
|
|
@@ -257,7 +258,7 @@ export default {
|
|
|
if (bal < 0) {
|
|
if (bal < 0) {
|
|
|
return Math.abs(bal)
|
|
return Math.abs(bal)
|
|
|
}
|
|
}
|
|
|
- return parseFloat(item.debtAmount || 0)
|
|
|
|
|
|
|
+ return 0
|
|
|
},
|
|
},
|
|
|
// 是否有待结:金额优先,避免「N 笔 0 元」仍展示
|
|
// 是否有待结:金额优先,避免「N 笔 0 元」仍展示
|
|
|
hasSupplierPending(item) {
|
|
hasSupplierPending(item) {
|
|
@@ -326,6 +327,29 @@ export default {
|
|
|
this.activeMenuId = null
|
|
this.activeMenuId = null
|
|
|
this.getDebtList(item)
|
|
this.getDebtList(item)
|
|
|
},
|
|
},
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 更多菜单:按采购挂账单重算该供货商待结笔数并更新列表展示
|
|
|
|
|
+ */
|
|
|
|
|
+ handleRefreshDebtNum(item) {
|
|
|
|
|
+ this.activeMenuId = null
|
|
|
|
|
+ if (!item || !item.id) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const oldNum = parseInt(item.debtNum || 0, 10) || 0
|
|
|
|
|
+ refreshDebtNum({ id: item.id }).then(res => {
|
|
|
|
|
+ if (res.code != 1) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const debtNum = parseInt((res.data && res.data.debtNum) || 0, 10) || 0
|
|
|
|
|
+ this.$set(item, 'debtNum', debtNum)
|
|
|
|
|
+ // 页头总笔数仅统计有待结金额的供货商,本行无待结金额时不改总笔数
|
|
|
|
|
+ if (this.info && this.isNormalList && this.hasSupplierPending(item)) {
|
|
|
|
|
+ const total = parseInt(this.info.totalDebtNum || 0, 10) || 0
|
|
|
|
|
+ this.$set(this.info, 'totalDebtNum', Math.max(0, total + (debtNum - oldNum)))
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$msg('已刷新')
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
init() {
|
|
init() {
|
|
|
this.getGhsList()
|
|
this.getGhsList()
|
|
|
},
|
|
},
|
|
@@ -711,20 +735,18 @@ export default {
|
|
|
transition: background-color 0.2s ease;
|
|
transition: background-color 0.2s ease;
|
|
|
|
|
|
|
|
&:active {
|
|
&:active {
|
|
|
|
|
+ background-color: #f5f7fa;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 删除项按压反馈用红色,与普通菜单项区分
|
|
|
|
|
+ &.dropdown-item-danger:active {
|
|
|
background-color: #ffeef0;
|
|
background-color: #ffeef0;
|
|
|
|
|
|
|
|
- .dropdown-text, .dropdown-icon {
|
|
|
|
|
|
|
+ .dropdown-text {
|
|
|
color: #ff4d4f;
|
|
color: #ff4d4f;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .dropdown-icon {
|
|
|
|
|
- font-size: 26upx;
|
|
|
|
|
- color: #999;
|
|
|
|
|
- margin-right: 12upx;
|
|
|
|
|
- flex-shrink: 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
.dropdown-text {
|
|
.dropdown-text {
|
|
|
font-size: 26upx;
|
|
font-size: 26upx;
|
|
|
color: #555;
|
|
color: #555;
|
|
@@ -818,7 +840,8 @@ export default {
|
|
|
background-color: #e8f1ff;
|
|
background-color: #e8f1ff;
|
|
|
border: 1upx solid #c5daf5;
|
|
border: 1upx solid #c5daf5;
|
|
|
border-radius: 8upx;
|
|
border-radius: 8upx;
|
|
|
- padding: 14upx 0;
|
|
|
|
|
|
|
+ // 原 padding 14upx,上下各 +2 共增高 4upx,flex 保证文字垂直居中
|
|
|
|
|
+ padding: 16upx 0;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
margin-right: 16upx;
|
|
margin-right: 16upx;
|
|
|
transition: all 0.2s ease;
|
|
transition: all 0.2s ease;
|