|
@@ -134,12 +134,41 @@
|
|
|
</view>
|
|
</view>
|
|
|
</uni-popup>
|
|
</uni-popup>
|
|
|
|
|
|
|
|
|
|
+ <!-- 多供货商提示弹框 -->
|
|
|
|
|
+ <uni-popup ref="supplierNoticePopup" background-color="#fff" type="center" :animation="true" class="supplier-notice-popup">
|
|
|
|
|
+ <view class="supplier-notice-container">
|
|
|
|
|
+ <!-- 头部 -->
|
|
|
|
|
+ <view class="supplier-notice-header">
|
|
|
|
|
+ <text class="supplier-notice-title">您已有多个供货商</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 中间供货商列表 -->
|
|
|
|
|
+ <view class="supplier-notice-content">
|
|
|
|
|
+ <view class="supplier-list">
|
|
|
|
|
+ <view class="supplier-item" v-for="(supplier, index) in displaySupplierList" :key="index">
|
|
|
|
|
+ <view class="supplier-icon">🏪</view>
|
|
|
|
|
+ <text class="supplier-name">{{ supplier.name }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 底部提示 -->
|
|
|
|
|
+ <view class="supplier-notice-footer">
|
|
|
|
|
+ <text class="supplier-notice-tip">买花时注意区分,避免下错</text>
|
|
|
|
|
+ <view class="supplier-notice-buttons">
|
|
|
|
|
+ <button class="admin-button-com default" @click="remindLater">下次提醒</button>
|
|
|
|
|
+ <button class="admin-button-com blue" @click="closeSupplierNotice">知道了</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </uni-popup>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
|
import { ghsList } from "@/api/purchase";
|
|
import { ghsList } from "@/api/purchase";
|
|
|
-import { changeDelStatus } from "@/api/ghs";
|
|
|
|
|
|
|
+import { changeDelStatus,hasMoreGhs } from "@/api/ghs";
|
|
|
import { hasNotice } from "@/api/admin";
|
|
import { hasNotice } from "@/api/admin";
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
@@ -148,12 +177,12 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
supplierList: [],
|
|
supplierList: [],
|
|
|
ad:[],
|
|
ad:[],
|
|
|
- showAd:1,
|
|
|
|
|
- currentGhs:{}
|
|
|
|
|
|
|
+ currentGhs:{},
|
|
|
|
|
+ displaySupplierList: [] // 用于显示在弹框中的供货商列表
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onPullDownRefresh() {
|
|
onPullDownRefresh() {
|
|
|
- this.getGhsList().then(res => {
|
|
|
|
|
|
|
+ this.getMyGhsData().then(res => {
|
|
|
uni.stopPullDownRefresh();
|
|
uni.stopPullDownRefresh();
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -164,6 +193,23 @@ export default {
|
|
|
closeToShow(){
|
|
closeToShow(){
|
|
|
this.$refs.toShowMore.close()
|
|
this.$refs.toShowMore.close()
|
|
|
},
|
|
},
|
|
|
|
|
+ // 显示供货商提示弹框
|
|
|
|
|
+ showSupplierNotice() {
|
|
|
|
|
+ // 设置要显示的供货商列表,最多显示5个
|
|
|
|
|
+ this.displaySupplierList = this.supplierList.filter(item => item.name).slice(0, 5)
|
|
|
|
|
+ this.$refs.supplierNoticePopup.open('center')
|
|
|
|
|
+ },
|
|
|
|
|
+ // 关闭供货商提示弹框
|
|
|
|
|
+ closeSupplierNotice() {
|
|
|
|
|
+ this.$refs.supplierNoticePopup.close()
|
|
|
|
|
+ // 调用已有的接口标记已通知
|
|
|
|
|
+ hasNotice().then(res => { })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 下次提醒
|
|
|
|
|
+ remindLater() {
|
|
|
|
|
+ this.$refs.supplierNoticePopup.close()
|
|
|
|
|
+ // 不调用hasNotice接口,保持提醒状态
|
|
|
|
|
+ },
|
|
|
getMore(info){
|
|
getMore(info){
|
|
|
this.currentGhs = info
|
|
this.currentGhs = info
|
|
|
this.$refs.toShowMore.open('top')
|
|
this.$refs.toShowMore.open('top')
|
|
@@ -236,7 +282,7 @@ export default {
|
|
|
changeDelStatus({delStatus:1,ghsId:ghs.id}).then(res=>{
|
|
changeDelStatus({delStatus:1,ghsId:ghs.id}).then(res=>{
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
that.closeToShow()
|
|
that.closeToShow()
|
|
|
- that.getGhsList()
|
|
|
|
|
|
|
+ that.getMyGhsData()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -271,22 +317,21 @@ export default {
|
|
|
this.$util.confirmModal({content:'付款金额不足消欠款单时,存为余额下次使用'},() => {})
|
|
this.$util.confirmModal({content:'付款金额不足消欠款单时,存为余额下次使用'},() => {})
|
|
|
},
|
|
},
|
|
|
init() {
|
|
init() {
|
|
|
- this.getGhsList()
|
|
|
|
|
|
|
+ this.getMyGhsData().then(() => {
|
|
|
|
|
+ this.toRemindCustom()
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ toRemindCustom(){
|
|
|
|
|
+ hasMoreGhs().then(ret=>{
|
|
|
|
|
+ if(ret.data.needNotice == 1){
|
|
|
|
|
+ this.showSupplierNotice()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- getGhsList () {
|
|
|
|
|
|
|
+ getMyGhsData () {
|
|
|
return ghsList().then(res => {
|
|
return ghsList().then(res => {
|
|
|
this.supplierList = res.data.list
|
|
this.supplierList = res.data.list
|
|
|
this.ad = res.data.ad ? res.data.ad : []
|
|
this.ad = res.data.ad ? res.data.ad : []
|
|
|
- this.showAd = res.data.showAd ? res.data.showAd : 0
|
|
|
|
|
-
|
|
|
|
|
- let needNotice = res.data.needNotice ? res.data.needNotice : 0
|
|
|
|
|
- if(needNotice == 1){
|
|
|
|
|
- this.$util.confirmModal({content:'你已有多个供货商,下单时注意区别,不要下错了哦',okText:'知道了'},() => {
|
|
|
|
|
- hasNotice().then(res=>{
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
settleAccounts (item) {
|
|
settleAccounts (item) {
|
|
@@ -627,4 +672,95 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+/* 供货商提示弹框样式 */
|
|
|
|
|
+.supplier-notice-popup {
|
|
|
|
|
+ .supplier-notice-container {
|
|
|
|
|
+ width: 650upx;
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ border-radius: 20upx;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+
|
|
|
|
|
+ .supplier-notice-header {
|
|
|
|
|
+ padding: 40upx 30upx 20upx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ background-color: #f8f9fa;
|
|
|
|
|
+ border-bottom: 1upx solid #e9ecef;
|
|
|
|
|
+
|
|
|
|
|
+ .supplier-notice-title {
|
|
|
|
|
+ font-size: 36upx;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .supplier-notice-content {
|
|
|
|
|
+ padding: 20upx 0;
|
|
|
|
|
+
|
|
|
|
|
+ .supplier-list {
|
|
|
|
|
+ padding: 0 30upx;
|
|
|
|
|
+
|
|
|
|
|
+ .supplier-item {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ padding: 20upx 0;
|
|
|
|
|
+ border-bottom: 1upx solid #f0f0f0;
|
|
|
|
|
+
|
|
|
|
|
+ &:last-child {
|
|
|
|
|
+ border-bottom: none;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .supplier-icon {
|
|
|
|
|
+ width: 60upx;
|
|
|
|
|
+ height: 60upx;
|
|
|
|
|
+ background-color: #e3f2fd;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ font-size: 32upx;
|
|
|
|
|
+ margin-right: 20upx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .supplier-name {
|
|
|
|
|
+ font-size: 32upx;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .supplier-notice-footer {
|
|
|
|
|
+ padding: 30upx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ background-color: #f8f9fa;
|
|
|
|
|
+ border-top: 1upx solid #e9ecef;
|
|
|
|
|
+
|
|
|
|
|
+ .supplier-notice-tip {
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ font-size: 38upx;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ color: red;
|
|
|
|
|
+ margin-bottom: 30upx;
|
|
|
|
|
+ line-height: 1.4;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .supplier-notice-buttons {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ gap: 20upx;
|
|
|
|
|
+
|
|
|
|
|
+ .admin-button-com {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ padding: 20upx 0;
|
|
|
|
|
+ height: auto;
|
|
|
|
|
+ line-height: normal;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|