Sfoglia il codice sorgente

Merge branch 'developer' of http://git.caimei365.com/zhengjinyi/caimei-applets-mcare into developer

zhengjinyi 2 anni fa
parent
commit
9faf4046f6

+ 1 - 1
pages.json

@@ -61,7 +61,7 @@
 				{
 					"path": "procurement",
 					"style": {
-						"navigationBarTitleText": "集需求",
+						"navigationBarTitleText": "集需求",
 						"enablePullDownRefresh": true
 					}
 				}, {

+ 97 - 107
pages/goods/components/procurement_card.vue

@@ -1,133 +1,123 @@
 <template>
-    <view class="card" :style="{padding: proStatus ? '32rpx 32rpx 0 32rpx' : '32rpx'}">
+    <view class="card" :style="{ padding: (procurementStatus('isAllTab') || procurementStatus('isDelFlag')) ? '32rpx 32rpx 0 32rpx' : '32rpx' }">
         <view class="card_title">
-            <view class="card_user_icon">
-                发起者
-            </view>
-            <view class="card_user">
-                科医人医疗激光设备贸易公司
-            </view>
+            <view class="card_user_icon">发起者</view>
+            <view class="card_user">{{ procuretInfo.clubName }}</view>
         </view>
-        <view class="card_time">2023-04-26   16:20:10</view>
+        <view class="card_time">{{ procuretInfo.saveTime }}</view>
         <view class="card_content">
-            <image class="card_content_img" src="" mode=""></image>
-            <view class="card_content_title">
-                韩国恩盛进口氢洁气小气泡清韩进口氢
-                洁气小气泡清...
-            </view>
+            <image class="card_content_img" src="" mode="aspectFill"></image>
+            <view class="card_content_title">{{ procuretInfo.productName }}</view>
         </view>
         <view class="card_form">
             <view class="form">
-                <view class="form_title">
-                    期望单价:
-                </view>
-                <view class="form_price">
-                    ¥100.00
-                </view>
+                <view class="form_title">期望单价:</view>
+                <view class="form_price">¥{{ procuretInfo.price }}</view>
             </view>
         </view>
         <view class="card_form">
             <view class="form">
-                <view class="form_title">
-                    采购数量:
-                </view>
-                <view class="form_price">
-                    ¥100.00
-                </view>
-            </view>
-            <view class="form_title">
-                >
+                <view class="form_title">采购数量:</view>
+                <view class="form_price">{{ procuretInfo.number }}</view>
             </view>
+            <view class="form_title">></view>
         </view>
         <view class="card_form">
             <view class="form">
-                <view class="form_title">
-                    参与机构数:
-                </view>
-                <view class="form_price">
-                    ¥100.00
-                </view>
+                <view class="form_title">参与机构数:</view>
+                <view class="form_price">{{ procuretInfo.partNumber || 0 }}</view>
             </view>
         </view>
-        <view class="card_foot" v-if='proStatus'>
-            <view class="foot_title">
-                您已参与
-            </view>
+        <view class="card_foot" v-if="!procurementStatus('isAllTab') && procurementStatus('isInvolved')">
+            <view class="foot_title">您已参与</view>
             <view class="foot_continue">
-               <view class="foot_change" @click="procurementChange">
-                    修改
-                </view>
-                <!-- <view class="foot_delete" @click="procurementDelete">
-                    删除
-                </view> -->
-                <view class="foot_exit" @click="procurementExit">
-                    退出
-                </view>
+                <view class="foot_change" @click="procurementChange">修改</view>
+                <view class="foot_delete" @click="procurementDelete">删除</view>
+                <view class="foot_exit" @click="procurementExit">退出</view>
             </view>
         </view>
-<!--        <view class="card_foot_2" @click="procurementAdd">
-            <view class="foot_title">
-                我要参与
-            </view>
+        <view class="card_foot_2" @click="procurementAdd">
+            <view class="foot_title">我要参与</view>
         </view>
-        <view class="card_foot_2">
-            <view class="foot_title_2">
-                您已参与
-            </view>
-        </view> -->
+        <view class="card_foot_2" v-if="procurementStatus('isAllTab') && procurementStatus('isInvolved')"><view class="foot_title_2">您已参与</view></view>
         <view class="card_status">
-            <image v-if='proStatus' style="width: 100%;height: 100%;" src="@/static/procurement/success.png" mode="aspectFill"></image>
-            <image v-else style="width: 100%;height: 100%;" src="@/static/procurement/delete.png" mode="aspectFill"></image>
+            <image
+                v-if="procurementStatus('isAchieve')"
+                style="width: 100%;height: 100%;"
+                src="@/static/procurement/success.png"
+                mode="aspectFill"
+            ></image>
+            <image
+                v-if="procurementStatus('isDelFlag')"
+                style="width: 100%;height: 100%;"
+                src="@/static/procurement/delete.png"
+                mode="aspectFill"
+            ></image>
         </view>
-        <view class="card_bg" v-if='!proStatus'></view>
+        <view class="card_bg" v-if="procurementStatus('isDelFlag')"></view>
     </view>
 </template>
 
 <script>
-    export default {
-        props: {
-            procuretInfo: {
-                id: 1,
-                msg: '12313'
-            }
+export default {
+    props: {
+        procuretInfo: {
+            type: Object,
+            default: () => {}
         },
-        data() {
-            return {
-                //data 数据
-                card: {},
-            }
+        proTabId: {
+            type: Number,
+            default: () => 0
+        }
+    },
+    data() {
+        return {
+            //data 数据
+            card: {}
+        }
+    },
+    computed: {
+        
+        
+    },
+    watch: {
+    },
+    mounted() {
+    },
+    methods: {
+        handlerChange() {},
+        handlerDelete() {},
+        // 删除
+        procurementDelete() {},
+        // 修改
+        procurementChange() {
+            this.$emit('popupChange', this.procuretInfo)
         },
-        computed: {
-            // 状态
-            proStatus() {
-                return this.procuretInfo % 2 === 0
-            },
+        // 参与
+        procurementAdd() {
+            this.$emit('popupAdd', this.procuretInfo)
+        },
+        // 退出
+        procurementExit() {
+            this.$emit('modelData', this.procuretInfo)
+        },
+        // 各部分状态
+        procurementStatus(string) {
+            const procuretInfo = this.procuretInfo
+            const status = {
+                'isDelFlag': () => procuretInfo.delFlag === 1, // 是否删除
+                'isAchieve': () => procuretInfo.isAchieve === 0, // 是否实现
+                'isAllTab': () => this.proTabId === 0, // 是否在全部的tab栏下
+                'isInvolved': () => procuretInfo.isInvolved === 1, // 是否参与 0 未参与 1已参与 2 我创建的
+            }
+            return status[string]()
         },
-        methods: {
-            handlerChange() {
-                
-            },
-            handlerDelete() {},
-            // 删除
-            procurementDelete() {},
-            // 修改
-            procurementChange() {
-                this.$emit('popupChange', this.procuretInfo)
-            },
-            // 参与
-            procurementAdd() {
-                this.$emit('popupAdd', this.procuretInfo)
-            },
-            // 退出
-            procurementExit() {
-                this.$emit('modelData', this.procuretInfo)
-            },
-        }
     }
+}
 </script>
 
 <style scoped lang="scss">
-.card{
+.card {
     border-radius: 8rpx;
     width: 100%;
     background: #fff;
@@ -145,7 +135,7 @@
     height: 40rpx;
     border-radius: 8rpx;
     font-size: 24rpx;
-    background-color: #F3B574;
+    background-color: #f3b574;
     color: #fff;
     display: flex;
     justify-content: center;
@@ -167,10 +157,10 @@
     color: #999999;
     margin-bottom: 32rpx;
 }
-.card .card_content{
+.card .card_content {
     radius: 8rpx 8rpx 8rpx 8rpx;
     opacity: 1;
-    background: #FFF8EF;
+    background: #fff8ef;
     height: 160rpx;
     padding: 12rpx 16rpx;
     display: flex;
@@ -221,7 +211,7 @@
     display: flex;
     justify-content: space-between;
     align-content: center;
-    border-top: 1px solid #E1E1E1;
+    border-top: 1px solid #e1e1e1;
 }
 .card_foot .foot_title {
     color: #999999;
@@ -236,27 +226,27 @@
     height: 100%;
 }
 .foot_continue .foot_change {
-    color: #F3B574;
+    color: #f3b574;
     font-size: 26rpx;
     margin-right: 32rpx;
 }
 .foot_continue .foot_delete {
     font-size: 26rpx;
-    color: #F85050;
+    color: #f85050;
 }
 .foot_continue .foot_exit {
     font-size: 26rpx;
-    color: #F85050;
+    color: #f85050;
 }
-.card_foot_2 { 
-    border-top: 1px solid #E1E1E1;
+.card_foot_2 {
+    border-top: 1px solid #e1e1e1;
     height: 100rpx;
     justify-content: center;
     align-items: center;
     display: flex;
 }
 .card_foot_2 .foot_title {
-    color: #F3B574;
+    color: #f3b574;
     font-size: 32rpx;
     font-weight: 500;
 }
@@ -280,4 +270,4 @@
     width: 100%;
     background-color: rgba(255, 255, 255, 0.7);
 }
-</style>
+</style>

+ 192 - 128
pages/goods/procurement.vue

@@ -1,68 +1,69 @@
 <template>
     <view class="proInit">
         <tui-skeleton
-        	v-if="skeletonShow"
-        	backgroundColor="#fafafa"
-        	borderRadius="10rpx"
-        	:isLoading="true"
-        	:loadingType="5"
+            v-if="skeletonShow"
+         	  backgroundColor="#fafafa"
+            borderRadius="10rpx"
+            :isLoading="true"
+            :loadingType="5"
         ></tui-skeleton>
         <view v-else>
             <tui-tabs :tabs="tabs" :currentTab="currentTab" @change="handlerTabs" class="tab"></tui-tabs>
-            <view class="tabsContent" v-for="(item, index) in 5" :key="index" :style="{marginTop: index === 0 ? '40px' : ''}">
-                <proCard @modelData="modelData" :procuretInfo='item' @popupAdd="popupAdd" @popupChange='popupChange'/>
+            <view
+                class="tabsContent"
+                v-for="(item, index) in procurementList"
+                :key="index"
+                :style="{ marginTop: index === 0 ? '40px' : '' }"
+            >
+                <proCard @modelData="modelData" :proTabId='currentTab' :procuretInfo="item" @popupAdd="popupAdd" @popupChange="popupChange" />
             </view>
         </view>
         <!-- 弹窗提示 -->
         <tui-modal
-        	:show="modal"
-        	@click="handleClick"
-        	@cancel="hideMobel"
-        	:content="contentModalText"
-        	:button="modalButton"
-        	color="#333"
-        	:size="32"
-        	shape="circle"
-        	:maskClosable="false"
-        >
-        </tui-modal>
+            :show="modal"
+            @click="handleClick"
+            @cancel="hideMobel"
+            :content="contentModalText"
+            :button="modalButton"
+           	color="#333"
+            :size="32"
+        	   shape="circle"
+            :maskClosable="false"
+        ></tui-modal>
         <view class="add_btn" @click="procurementAdd">
             <image style="width: 100%;height: 100%;" src="@/static/procurement/add_pro.png"></image>
         </view>
-        <tui-bottom-popup  :zIndex="1002" :maskZIndex="1001" :show="popupShow" @close="handlerPopupClose">
-        	<view class="popup_content">
-        	    <view class="pro_popup_title">
-        	        参与需求
-        	    </view>
+        <tui-bottom-popup :zIndex="1002" :maskZIndex="1001" :show="popupShow" @close="handlerPopupClose">
+            <view class="popup_content">
+                <view class="pro_popup_title">参与需求</view>
                 <view class="popup_form">
-                    <view class="popup_form_item">
-                        商品图片:
-                    </view>
+                    <view class="popup_form_item">商品图片:</view>
                     <view class="popup_img">
                         <image style="width: 100%;height: 100%;" src="" mode="aspectFill"></image>
                     </view>
                 </view>
                 <view class="popup_form">
-                    <view class="popup_form_item">
-                        商品名称:
-                    </view>
+                    <view class="popup_form_item">商品名称:</view>
                     <view class="popup_form_name">
-                        韩国恩盛进口氢洁气小气泡清韩进口氢洁气小气泡清
-                        口氢洁气小气泡清韩进口氢洁气小气泡
+                        韩国恩盛进口氢洁气小气泡清韩进口氢洁气小气泡清 口氢洁气小气泡清韩进口氢洁气小气泡
                     </view>
                 </view>
                 <form>
                     <view class="uni-form-item uni-column">
-                        <view class="title"><text style="font-size: 26rpx;color: #F85050;">*</text>期望单价:</view>
+                        <view class="title">
+                            <text style="font-size: 26rpx;color: #F85050;">*</text>
+                            期望单价:
+                        </view>
                         <view style="position: relative;">
-                            <view class="input_icon">
-                                ¥
-                            </view>
+                            <view class="input_icon">¥</view>
                             <input class="uni-input" focus placeholder="自动获得焦点" />
                         </view>
                     </view>
                     <view class="uni-form-item uni-column">
-                        <view class="title"><text style="font-size: 26rpx;color: #F85050;">*</text>采购数量:</view>
+                        <view class="title">
+                            <text style="font-size: 26rpx;color: #F85050;">*</text>
+                            采购数量:
+                        </view>
                         <view style="position: relative;">
                             <input class="uni-input" focus placeholder="自动获得焦点" />
                         </view>
@@ -72,105 +73,168 @@
                         <button class="popup_btn submit">确定</button>
                     </view>
                 </form>
-        	</view>
+            </view>
         </tui-bottom-popup>
         <!--加载loadding-->
         <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
-        <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
+        <!-- <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore> -->
         <!--加载loadding-->
     </view>
 </template>
 
 <script>
-    import proCard from './components/procurement_card.vue'
-    import jumpMixins from '@/mixins/jumpMixins.js'
-    export default {
-        components: {
-            proCard,
-        },
-        mixins: [jumpMixins],
-        data() {
-            return {
-                skeletonShow: true,
-                tabs: [
-                    {
-                        name: '全部'
-                    },
-                    {
-                        name:'我参与的'
+import proCard from './components/procurement_card.vue'
+import jumpMixins from '@/mixins/jumpMixins.js'
+import { mapState } from 'vuex'
+export default {
+    components: {
+        proCard
+    },
+    mixins: [jumpMixins],
+    data() {
+        return {
+            skeletonShow: true, // loading
+            // tab 栏切换
+            tabs: [
+                {
+                    name: '全部'
+                },
+                {
+                    name: '我参与的'
+                },
+                {
+                    name: '我发起的'
+                }
+            ],
+            currentTab: 0, // tab 当前所在栏
+            modal: false, // 弹窗
+            contentModalText: '确定退出参与该需求吗?', // 弹窗内容
+            // 弹窗配置
+            modalButton: [
+                {
+                    text: '取消',
+                    type: 'gray',
+                    plain: true //是否空心
+                },
+                {
+                    text: '确认',
+                    customStyle: {
+                        color: '#fff',
+                        bgColor: 'linear-gradient(90deg, #F28F31 0%, #F3B574 100%)'
                     },
-                    {
-                        name: '我发起的'
-                    }
-                ],
-                currentTab: 0,
-                modal: false,
-                contentModalText: '确定退出参与该需求吗?',
-                modalButton: [
-                    {
-                        text: '取消',
-                        type: 'gray',
-                        plain: true, //是否空心
-                    },
-                    {
-                        text: '确认',
-                        customStyle: {
-                            color: '#fff',
-                            bgColor: 'linear-gradient(90deg, #F28F31 0%, #F3B574 100%)'
-                        },
-                        plain: false
-                    }
-                ],
-                proDataInfo: {},
-                popupShow: false,
-                loadding: true,
-                pullUpOn: true,
+                    plain: false
+                }
+            ],
+            // 组件传递集采需求
+            proDataInfo: {},
+            popupShow: false, // 底部上移栏
+            loadding: false, // 下拉刷新
+            pullUpOn: false, // 下拉刷新
+            // 分页参数
+            pageInfo: {
+                pageNo: 1,
+                pageSize: 10
+            },
+            // 所有数据
+            procurementList: [
+                {
+                    id: 1,
+                    userId: 2,
+                    productImage: '',
+                    productName: '测试',
+                    price: 1000,
+                    number: 1000,
+                    saveTime: '2023-1-2',
+                    createUserId: 33,
+                    isAchieve: 0,
+                    delFlag: 0,
+                    clubName: '测试机构',
+                    isInvolved: 0
+                }
+            ], 
+            // 下拉刷新
+            nomoreText: '已经被掏空了~'
+        }
+    },
+    watch: {
+        currentTab(val) {
+            if (val) {
             }
-        },
-        mounted() {
+        }
+    },
+    computed: {
+        // 是否登录
+        ...mapState(['hasLogin'])
+    },
+    onShow() {
+        this.procurementAllList()
+        if (this.hasLogin) {
+            this.skeletonShow = false
+        } else {
+            // this.$api.redirectTo('/pages/login/login')
             this.skeletonShow = false
+        }
+    },
+    methods: {
+        // tab 切换
+        handlerTabs($event) {
+            this.currentTab = $event.index
         },
-        methods:{
-            handlerTabs($event) {
-                this.currentTab = $event.index
-            },
-            handleClick($event) {
-                this.modal = false
-                if ($event.index === 1) {}
-            },
-            hideMobel($event) {},
-            modelData(proData) {
-                this.modal = true
-                this.proDataInfo = proData
-            },
-            // 关闭底部
-            handlerPopupClose() {
-                this.popupShow = false
-            },
-            // 我要参与
-            popupAdd($event) {
-                console.log($event)
-                this.popupShow = true
-            },
-            // 修改
-            popupChange($event) {
-                uni.navigateTo({
-                	url: '/pages/goods/procurement_info'
-                })
-            },
-            // 发布
-            procurementAdd() {
-                uni.navigateTo({
-                	url: '/pages/goods/procurementAdd'
-                })
-            },
+        // 弹窗确认或取消
+        handleClick($event) {
+            this.modal = false
+            if ($event.index === 1) {
+            }
+        },
+        hideMobel($event) {},
+        // 组件传递商品详情
+        modelData(proData) {
+            this.modal = true
+            this.proDataInfo = proData
+        },
+        // 关闭底部
+        handlerPopupClose() {
+            this.popupShow = false
         },
+        // 我要参与
+        popupAdd($event) {
+            console.log($event)
+            this.popupShow = true
+        },
+        // 修改
+        popupChange($event) {
+            uni.navigateTo({
+                url: '/pages/goods/procurement_info'
+            })
+        },
+        // 发布
+        procurementAdd() {
+            uni.navigateTo({
+                url: '/pages/goods/procurementAdd'
+            })
+        },
+        /**
+         * 网络请求
+         */
+        // 全部集采
+        async procurementAllList() {
+            try {
+                const data = await this.ProcurementService.procurementAllList(this.pageInfo)
+                this.procurementList = data.list
+            } catch (error) {
+                console.log(error)
+            }
+        }
     }
+}
 </script>
 
-<style lang="scss" scoped>
+<style lang="scss">
+page {
+    background-color: #f7f7f7;
+}
 .proInit {
-    background-color: #F7F7F7;
+    background-color: #f7f7f7;
 }
 .proInit .tab {
     position: fixed;
@@ -179,13 +243,13 @@
     z-index: 9;
 }
 ::v-deep .tui-tabs-slider.data-v-9311a734 {
-    background: #F3B574 !important;
+    background: #f3b574 !important;
 }
 ::v-deep .tui-tabs-title.tui-tabs-active {
-    color: #F3B574 !important;
+    color: #f3b574 !important;
 }
 .tabsContent {
-    background-color: #F7F7F7;
+    background-color: #f7f7f7;
     padding: 16rpx 32rpx;
     // margin-bottom: 32rpx;
 }
@@ -234,12 +298,12 @@
     position: absolute;
     left: 15rpx;
     top: 24rpx;
-    color: #B2B2B2;
+    color: #b2b2b2;
     font-size: 26rpx;
 }
 .uni-form-item .uni-input {
     height: 80rpx;
-    border: 1px solid #B2B2B2;
+    border: 1px solid #b2b2b2;
     border-radius: 6rpx 6rpx 6rpx 6rpx;
     font-size: 26rpx;
     padding-left: 47rpx;
@@ -261,13 +325,13 @@
     line-height: 84rpx;
 }
 ::v-deep .submit_btn .cancel {
-    background-color: #FFF4E6;
-    color: #F3B574;
+    background-color: #fff4e6;
+    color: #f3b574;
     font-size: 32rpx;
 }
 ::v-deep .submit_btn .submit {
-    background-color: #F3B574;
-    color: #FFFFFF;
+    background-color: #f3b574;
+    color: #ffffff;
     font-size: 32rpx;
 }
-</style>
+</style>

+ 35 - 14
pages/goods/procurementAdd.vue

@@ -1,8 +1,11 @@
 <template>
     <view class="release">
-        <form>
-            <view class="uni-form-item uni-column">
-                <view class="title"><span>*</span>商品图片</view>
+        <uni-forms>
+            <uni-forms-item label="申请人" name="Name">
+                <uni-easyinput v-model="form.Name" placeholder="请输入申请人" />
+            </uni-forms-item>
+            <!-- <view class="uni-form-item uni-column">
+                <view class="title">商品图片</view>
                 <view class="uploadComp">
                     <proUpload />
                 </view>
@@ -10,24 +13,24 @@
             <view class="uni-form-item uni-column">
                 <view class="title"><span>*</span>商品名称</view>
                 <view>
-                    <input class="uni-input" focus placeholder="自动获得焦点" />
+                    <input class="uni-input" focus placeholder="自动获得焦点" v-model='formData.productName' />
                 </view>
             </view>
             <view class="uni-form-item uni-column">
                 <view class="title"><span>*</span>期望单价</view>
                 <view>
-                    <input class="uni-input" focus placeholder="自动获得焦点" />
+                    <input class="uni-input" focus placeholder="自动获得焦点" v-model="formData.price" />
                 </view>
             </view>
             <view class="uni-form-item uni-column">
                 <view class="title"><span>*</span>采购数量</view>
                 <view>
-                    <input class="uni-input" focus placeholder="自动获得焦点" />
+                    <input class="uni-input" focus placeholder="自动获得焦点" v-model="formData.number" />
                 </view>
-            </view>
-        </form>
+            </view> -->
+        </uni-forms>
         <view class="release_btn">
-            <proBtn width="600rpx" height="90rpx" background='#E2E2E2' color='#999999' fontSize='32rpx'>发布</proBtn>
+            <proBtn width="600rpx" height="90rpx" background='#E2E2E2' color='#999999' fontSize='32rpx' @click="handlerSave">发布</proBtn>
         </view>
     </view>
 </template>
@@ -40,6 +43,26 @@
             proUpload,
             proBtn
         },
+        data() {
+            return {
+                // 发布需求
+                formData: {
+                    userId: 1,
+                    productImage: '',
+                    productName: '',
+                    price: '',
+                    number: ''
+                }
+            }
+        },
+        onLoad(e) {},
+        onShow() {},
+        methods: {
+            // submit 发布
+            handlerSave() {
+                console.log(this.formData)
+            },
+        },
     }
 </script>
 
@@ -60,14 +83,12 @@
         margin-bottom: 40rpx;
     }
     .uni-input {
-        border-radius: 6rpx 6rpx 6rpx 6rpx;
-        border: 1rpx solid #B2B2B2;
         height: 90rpx;
+        border: 1px solid #B2B2B2;
+        border-radius: 6rpx 6rpx 6rpx 6rpx;
         font-size: 28rpx;
-        padding: 24rpx;
+        padding-left: 47rpx;
         margin-bottom: 40rpx;
-        box-sizing: border-box;
-        line-height: 40rpx;
     }
     .release_btn {
         position: fixed;

+ 3 - 0
services/index.js

@@ -9,6 +9,7 @@ import OrderService from './order.service'
 import PublicService from './public.service.js'
 import UploadService from './upload.service.js'
 import SpecialService from './special.service.js'
+import ProcurementService from './procurement.service.js'
 
 let commonService = new CommonService(ajaxService)
 let userService = new UserService(ajaxService)
@@ -18,6 +19,7 @@ let orderService = new OrderService(ajaxService)
 let publicService = new PublicService(ajaxService)
 let uploadService = new UploadService(ajaxService)
 let specialService = new SpecialService(ajaxService)
+let procurementService = new ProcurementService(ajaxService)
 
 Vue.prototype.AjaxService = ajaxService
 Vue.prototype.CommonService = commonService
@@ -28,3 +30,4 @@ Vue.prototype.OrderService = orderService
 Vue.prototype.PublicService = publicService
 Vue.prototype.UploadService = uploadService
 Vue.prototype.SpecialService = specialService
+Vue.prototype.ProcurementService = procurementService

+ 90 - 0
services/procurement.service.js

@@ -0,0 +1,90 @@
+/**
+ * 集采需求数据请求
+ */
+export default class ProcurementService {
+    constructor(AjaxService) {
+        Object.assign(this, { AjaxService })
+        this.name = 'ProcurementService'
+    }
+    /**
+     * 所有集采
+     * @param pageNo 页数
+     * @param pageSize 长度
+     */
+    procurementAllList(data = {}) {
+        return this.AjaxService.get({
+            url:'/commodity/procurement/findList', 
+            data, 
+            isLoading: false,
+        })
+    }
+    /**
+     * 集采详情
+     * @param {number} id 集采id
+     */
+    procurementDetail(data={}) {
+        return this.AjaxService.post({
+            url: '/commodity/procurement/detail',
+            data,
+            isLoading: false,
+        })
+    }
+    /**
+     * 集采tab 我参与的 我创建的
+     * @param {number} userId 用户id
+     * @param {number} procurementType = [0, 1] 0 我参与的 1 我发起的
+     */
+    procurementTabChange(data={}) {
+        return this.AjaxService.get({
+            url: '/commodity/procurement/detail',
+            data,
+            isLoading: false,
+        })
+    }
+    
+    /**
+     * 发布集采 | 修改集采
+     * @param id id
+     * @param userId 发布人id
+     * @param userName 用户名
+     * @param productImage 商品图片
+     * @param productName 商品名称
+     * @param price 期望单价
+     * @param number 购买数量
+     */
+    procurementSave(data={}) {
+        return this.AjaxService.post({
+            url: '/commodity/procurement/saveProcurement',
+            data,
+            isLoading: false,
+        })
+    }
+    /**
+     * 参与集采
+     * @param userId 发布人id
+     * @param productImage 商品图片
+     * @param productName 商品名称
+     * @param price 期望单价
+     * @param number 购买数量
+     */
+    procurementParticipate(data={}) {
+        return this.AjaxService.post({
+            url: '/commodity/procurement/pateProcurement',
+            data,
+            isLoading: false,
+        })
+    }
+    /**
+     * 删除集采 | 退出集采
+     * @param id 集采id
+     * @param {number} userId 用户id
+     * @param {number} procurementType = [0, 1] 0 删除集采 1 退出集采
+     */
+    procurementUpdate(data={}) {
+        return this.AjaxService.get({
+            url: '/commodity/procurement/updateProcurement',
+            data,
+            isLoading: false,
+        })
+    }
+}