瀏覽代碼

完成参与集采需求

xiebaomin 2 年之前
父節點
當前提交
7d31f57a6c

+ 3 - 3
pages.json

@@ -68,7 +68,7 @@
 					"path": "procurement_info",
 					"style": {
 						"navigationBarTitleText": "需求详情",
-						"enablePullDownRefresh": false
+						"enablePullDownRefresh": true
 					}
 				}, {
 					"path": "procurementAdd",
@@ -86,13 +86,13 @@
 					"path": "good-activity",
 					"style": {
 						"navigationBarTitleText": "",
-						"enablePullDownRefresh": false
+						"enablePullDownRefresh": true
 					}
 				}, {
                     "path": "active-product",
                     "style": {
 						"navigationBarTitleText": "",
-						"enablePullDownRefresh": false
+						"enablePullDownRefresh": true
 					}
                 }
 			]

+ 8 - 1
pages/goods/active-product.vue

@@ -22,12 +22,19 @@
         data() {
             return {
                 skeletonShow: true,
-                activeProductList: [] // 活动商品列表
+                activeProductList: [], // 活动商品列表
+                refleshdata: {} // 刷新数据
             }
         },
         onLoad(options) {
+            this.refleshdata = options
             this.activeProduct(options)
         },
+        onPullDownRefresh() {
+            this.skeletonShow = true
+            this.activeProduct(this.refleshdata)
+            uni.stopPullDownRefresh()
+        },
         methods: {
             // 楼层商品数据
             async activeProduct(options) {

+ 2 - 6
pages/goods/components/procurement_card.vue

@@ -7,7 +7,7 @@
             </view>
             <view class="card_time">{{ procuretInfo.saveTime }}</view>
             <view class="card_content">
-                <image class="card_content_img" :src="procuretInfo.productImage" mode="aspectFill"></image>
+                <image class="card_content_img" :src="isImageUrl(procuretInfo.productImage) ? imageUrl :procuretInfo.productImage" mode="aspectFill"></image>
                 <view class="card_content_title">{{ procuretInfo.productName }}</view>
             </view>
             <view class="card_form">
@@ -89,12 +89,9 @@ export default {
     data() {
         return {
             //data 数据
-            card: {}
+            card: {},
         }
     },
-    computed: {},
-    watch: {},
-    mounted() {},
     methods: {
         handlerChange() {},
         handlerDelete() {},
@@ -174,7 +171,6 @@ export default {
 .card .card_content_img {
     width: 136rpx;
     height: 136rpx;
-    border: 1px dotted #E1E1E1;
     box-sizing: border-box;
     margin-right: 24rpx;
 }

+ 8 - 2
pages/goods/good-activity.vue

@@ -40,14 +40,20 @@ export default {
     data() {
         return {
             skeletonShow: true,
-            active: {} // 活动数据
+            active: {}, // 活动数据
+            refleshdata: {} // 刷新数据
         }
     },
     mounted() {},
     onLoad(options) {
-        console.log(options)
+        this.refleshdata = options
         this.specialInfo(options)
     },
+    onPullDownRefresh() {
+        this.skeletonShow = true
+        this.specialInfo(this.refleshdata)
+        uni.stopPullDownRefresh()
+    },
     methods: {
         // 活动数据
         async specialInfo(options) {

+ 10 - 0
pages/goods/mixins/procurementMixins.js

@@ -1,4 +1,9 @@
 export default {
+    data() {
+        return{
+            imageUrl: require('@/static/procurement/default.png'),
+        }
+    },
     filters: {
         subText(str, index) {
             if(str) {
@@ -48,5 +53,10 @@ export default {
             }
             return form[str]()
         },
+        // 图片是否上传
+        isImageUrl: (url) => {
+            if (url) return url.indexOf('none.jpg') > 0
+            else return true
+        },
     }
 }

+ 14 - 30
pages/goods/procurement.vue

@@ -47,7 +47,7 @@
                 <view class="popup_form">
                     <view class="popup_form_item">商品图片:</view>
                     <view class="popup_img">
-                        <image style="width: 100%;height: 100%;" :src="joinData.productImage" mode="aspectFill"></image>
+                        <image style="width: 100%;height: 100%;" :src="isImageUrl(joinData.productImage) ? imageUrl : joinData.productImage" mode="aspectFill"></image>
                     </view>
                 </view>
                 <view class="popup_form">
@@ -104,14 +104,13 @@
 
 <script>
 import proCard from './components/procurement_card.vue'
-import jumpMixins from '@/mixins/jumpMixins.js'
 import { mapState } from 'vuex'
 import procurementMixins from './mixins/procurementMixins.js'
 export default {
     components: {
         proCard
     },
-    mixins: [jumpMixins, procurementMixins],
+    mixins: [procurementMixins],
     data() {
         return {
             skeletonShow: true, // loading
@@ -162,35 +161,27 @@ export default {
                 userId: '',
                 procurementType: 0
             },
-            // 删除退出
-            deleteData: {
-                id: 0,
-                userId: 0,
-                procurementType: 0
-            },
             // 所有数据
             procurementList: [],
             // 下拉刷新
             nomoreText: '已经没有了~',
-            userInfo: {},
             isLastPage: false, // 是否是最后一页
             joinData: {}, // 我要参与
-            isEditDetail: false // 是否修改详情
         }
     },
     computed: {
         // 是否登录
-        ...mapState(['hasLogin'])
+        ...mapState(['hasLogin', 'userInfo'])
     },
     onShow() {
-        // if(this.hasLogin){
+        if(this.hasLogin){
         	this.userInfo = uni.getStorageSync('userInfo')
         	this.pageInfo.userId = this.userInfo.userId
         	this.participate.userId = this.userInfo.userId
         	this.procurementAllList()
-        // }else{
-        // 	this.$api.redirectTo('/pages/login/login')
-        // }
+        }else{
+        	this.$api.redirectTo('/pages/login/login')
+        }
     },
     onLoad() {
         uni.$on('refreshAddData', () => {
@@ -255,7 +246,6 @@ export default {
         // 修改
         popupChange($event) {
             this.joinData = $event
-            console.log($event)
             if (this.joinData.isInvolved === 1) {
                 this.procurementEditData()
             } else {
@@ -320,12 +310,8 @@ export default {
         },
         // 我要参与
         async procurementParticipate() {
-            if (this.joinData.price === '') {
-                return this.$util.msg('请输入期望单价', 2000)
-            }
-            if (this.joinData.number === '') {
-                return this.$util.msg('请输入期望数量', 2000)
-            }
+            if (this.joinData.price === '') return this.$util.msg('请输入期望单价', 2000)
+            if (this.joinData.number === '') return this.$util.msg('请输入期望数量', 2000)
             const form = {
                 userId: this.userInfo.userId,
                 productImage: this.joinData.productImage,
@@ -333,7 +319,8 @@ export default {
                 price: this.joinData.price,
                 number: this.joinData.number,
                 status: 0,
-                id: this.joinData.id
+                id: this.joinData.id,
+                userName: this.userInfo.name
             }
             if (this.joinData.isInvolved === 1) {
                 form.id = this.joinData.id
@@ -343,7 +330,6 @@ export default {
                 const data = await this.ProcurementService.procurementParticipate(form)
                 this.procurementAllAddList()
                 this.popupShow = false
-                this.isEditDetail = false
                 uni.showToast({
                     title: `${this.joinData.isInvolved === 0 ? '参与' : '修改'}成功`,
                     icon: 'success'
@@ -378,13 +364,13 @@ export default {
                 procurementType: 0
             }
             try {
-                const data = await this.ProcurementService.procurementEditData(form)
-                this.joinData = data.data
+                const {data} = await this.ProcurementService.procurementEditData(form)
+                this.joinData = data
                 this.popupShow = true
             } catch (error) {
                 console.log(error)
             }
-        }
+        },
     }
 }
 </script>
@@ -414,7 +400,6 @@ page {
 .tabsContent {
     background-color: #f7f7f7;
     padding: 16rpx 32rpx;
-    // margin-bottom: 32rpx;
 }
 .add_btn {
     width: 100rpx;
@@ -444,7 +429,6 @@ page {
 .popup_form .popup_img {
     width: 136rpx;
     height: 136rpx;
-    border: 1px dotted black;
 }
 .popup_form .popup_form_name {
     color: #333333;

+ 7 - 4
pages/goods/procurementAdd.vue

@@ -141,7 +141,7 @@ export default {
     mounted() {
         this.userInfo = uni.getStorageSync('userInfo')
         this.formData.userId = this.userInfo.userId
-        this.formData.userName = this.userInfo.userName
+        this.formData.userName = this.userInfo.name
     },
     methods: {
         // 发布按钮
@@ -190,7 +190,7 @@ export default {
                         data: 1
                     })
                 }, 800)
-                uni.$emit('refreshAddData', this.detailData.id) // 刷新修改的数据
+                uni.$emit('refreshAddData', this.detailData.id) // 刷新修改的数据 
             } catch (error) {
                 console.log(error)
             }
@@ -199,8 +199,11 @@ export default {
         async handlerDetail() {
             this.detailData.userId = this.userInfo.userId
             try {
-                const data = await this.ProcurementService.procurementEditData(this.detailData)
-                this.formData = data.data
+                const {data} = await this.ProcurementService.procurementEditData(this.detailData)
+                this.formData = data
+                if (this.isImageUrl(this.formData.productImage)) {
+                    this.formData.productImage = ''
+                } 
             } catch (error) {
                 console.log(error)
             }

+ 92 - 12
pages/goods/procurement_info.vue

@@ -12,7 +12,7 @@
                 <view class="card_title">采购商品</view>
                 <view class="card_line"></view>
                 <view class="card_store">
-                    <image class="img" :src="procurement.productImage" mode="aspectFill"></image>
+                    <image class="img" :src="isImageUrl(procurement.productImage) ? imageUrl : procurement.productImage" mode="aspectFill"></image>
                     <view class="store_title">{{ procurement.productName }}</view>
                 </view>
                 <view class="back-filter" v-if="procurementStatus('isDelFlag', procurement.delFlag)"></view>
@@ -69,11 +69,11 @@
                         <view class="Initiator_price">
                             <view class="unit_price">
                                 <view class="title">期望单价:</view>
-                                <view class="price">¥{{ procurement.price }}</view>
+                                <view class="price">¥{{ item.price }}</view>
                             </view>
                             <view class="unit_sum">
                                 <view class="title">采购数量:</view>
-                                <view class="price">{{ procurement.number }}</view>
+                                <view class="price">{{ item.number }}</view>
                             </view>
                         </view>
                     </view>
@@ -117,7 +117,7 @@
                 <view class="popup_form">
                     <view class="popup_form_item">商品图片:</view>
                     <view class="popup_img">
-                        <image style="width: 100%;height: 100%;" :src="joinData.productImage" mode="aspectFill"></image>
+                        <image style="width: 100%;height: 100%;" :src="isImageUrl(joinData.productImage) ? imageUrl : joinData.productImage" mode="aspectFill"></image>
                     </view>
                 </view>
                 <view class="popup_form">
@@ -201,7 +201,8 @@ export default {
             userInfo: {},
             popupShow: false, // 底部上移栏
             proTabId: '', // tab id
-            detailId: '' // 详情id
+            detailId: '', // 详情id
+            refleshdata: {},
         }
     },
     onLoad(options) {
@@ -215,6 +216,11 @@ export default {
             }
         })
     },
+    onPullDownRefresh() {
+        this.skeletonShow = true
+        this.procurementDetail(this.detailId)
+        uni.stopPullDownRefresh()
+    },
     methods: {
         // 删除
         procurementDelete() {
@@ -224,7 +230,7 @@ export default {
         },
         handleClick($event) {
             if ($event.index === 1) {
-                if (this.joinData.isInvolved === 1) {
+                if (this.procurement.isInvolved === 1) {
                     // 退出参与
                     this.procurementUpdate(1)
                 } else {
@@ -273,7 +279,7 @@ export default {
         // 删除 退出
         async procurementUpdate(type) {
             const form = {
-                id: this.detailId,
+                id: type === 0 ? this.detailId : this.procurement.sid,
                 userId: this.userInfo.userId,
                 procurementType: type
             }
@@ -304,15 +310,17 @@ export default {
                 price: this.joinData.price,
                 number: this.joinData.number,
                 status: 0,
-                id: this.joinData.id
+                id: this.joinData.id,
+                userName: this.userInfo.name
             }
             if (this.joinData.isInvolved === 1) {
-                form.id = this.joinData.sid
+                form.id = this.joinData.id
                 form.status = 1 // 0参与 1 修改
             }
             try {
                 await this.ProcurementService.procurementParticipate(form)
                 this.procurementDetail(this.detailId)
+                this.popupShow = false
                 uni.$emit('refreshAddData') // 刷新修改的数据
                 uni.showToast({
                     title: `${this.procurement.isInvolved === 0 ? '参与' : '修改'}成功`,
@@ -330,8 +338,8 @@ export default {
                 procurementType: 0
             }
             try {
-                const data = await this.ProcurementService.procurementEditData(form)
-                this.joinData = data.data
+                const {data} = await this.ProcurementService.procurementEditData(form)
+                this.joinData = data
                 this.popupShow = true
             } catch (error) {
                 console.log(error)
@@ -345,7 +353,6 @@ export default {
 .img {
     width: 136rpx;
     height: 136rpx;
-    border: 1px dotted #E1E1E1;
     margin-right: 24rpx;
 }
 .procure_info {
@@ -487,4 +494,77 @@ export default {
     height: 100%;
     width: 100%;
 }
+.popup_content {
+    padding: 0 64rpx;
+}
+.pro_popup_title {
+    font-size: 32rpx;
+    font-weight: bold;
+    color: #333333;
+    margin: 40rpx auto;
+    text-align: center;
+}
+.popup_form {
+    margin-bottom: 32rpx;
+}
+.popup_form .popup_form_item {
+    color: #999999;
+    font-size: 26rpx;
+    margin-bottom: 16rpx;
+}
+.popup_form .popup_img {
+    width: 136rpx;
+    height: 136rpx;
+}
+.popup_form .popup_form_name {
+    color: #333333;
+    font-size: 26rpx;
+    font-weight: 400;
+    line-height: 44rpx;
+}
+.uni-form-item .title {
+    color: #999999;
+    font-size: 26rpx;
+    margin-bottom: 16rpx;
+}
+.input_icon {
+    position: absolute;
+    left: 15rpx;
+    top: 24rpx;
+    color: #b2b2b2;
+    font-size: 26rpx;
+}
+.uni-form-item .uni-input {
+    height: 80rpx;
+    border: 1px solid #b2b2b2;
+    border-radius: 6rpx 6rpx 6rpx 6rpx;
+    font-size: 26rpx;
+    padding-left: 47rpx;
+    margin-bottom: 32rpx;
+}
+.submit_btn {
+    margin-top: 56rpx;
+    height: 84rpx;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 50rpx;
+}
+.submit_btn .popup_btn {
+    width: 280rpx;
+    height: 100%;
+    border-radius: 45rpx 45rpx 45rpx 45rpx;
+    text-align: center;
+    line-height: 84rpx;
+}
+::v-deep .submit_btn .cancel {
+    background-color: #fff4e6;
+    color: #f3b574;
+    font-size: 32rpx;
+}
+::v-deep .submit_btn .submit {
+    background-color: #f3b574;
+    color: #ffffff;
+    font-size: 32rpx;
+}
 </style>

+ 2 - 2
services/config.env.js

@@ -3,9 +3,9 @@ if(process.env.NODE_ENV === 'development'){
     // 开发环境
     // URL_CONFIG = 'http://192.168.2.67:18002'	 //智捷联调地址
     // URL_CONFIG = 'http://192.168.2.68:18002'	 //涛涛联调地址
-    URL_CONFIG = 'http://192.168.2.102:18002' //志国联调地址
+    // URL_CONFIG = 'http://192.168.2.102:18002' //志国联调地址
     // URL_CONFIG = 'http://192.168.2.103:18002' // 陈凯联调
-    // URL_CONFIG = 'https://core-b.caimei365.com'
+    URL_CONFIG = 'https://core-b.caimei365.com'
     // URL_CONFIG = 'https://core.caimei365.com'  
 }else{
     // 生产环境

+ 2 - 2
services/special.service.js

@@ -15,7 +15,7 @@ export default class SpecialService {
         return this.AjaxService.get({
             url:'/commodity/MallOrganize/mall/detail', 
             data, 
-            isLoading: false ,
+            isLoading: false,
         })
     }
     /**
@@ -26,7 +26,7 @@ export default class SpecialService {
         return this.AjaxService.get({
             url:'/commodity/MallOrganize/mall/activeProduct', 
             data, 
-            isLoading: false ,
+            isLoading: false,
         })
     }
 }

二進制
static/procurement/default.png