|
@@ -4,16 +4,12 @@
|
|
|
isAdd
|
|
isAdd
|
|
|
addText="筛选" -->
|
|
addText="筛选" -->
|
|
|
<view class="tabs">
|
|
<view class="tabs">
|
|
|
- <Tabs
|
|
|
|
|
- :isFixed="true"
|
|
|
|
|
- :tabs="tabs"
|
|
|
|
|
- :currentTab="tabIndex"
|
|
|
|
|
- @change="changeTabEvent"
|
|
|
|
|
- itemWidth="20%"
|
|
|
|
|
- @add="addEvent"
|
|
|
|
|
- :isAdd="false"
|
|
|
|
|
- addText="新增"
|
|
|
|
|
- ></Tabs>
|
|
|
|
|
|
|
+ <view
|
|
|
|
|
+ v-for="(item, index) in tabList"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :class="{'active': tabIndex === index}"
|
|
|
|
|
+ @click="changeTabEvent(index)"
|
|
|
|
|
+ >{{item}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<scroll-view
|
|
<scroll-view
|
|
|
scroll-y
|
|
scroll-y
|
|
@@ -35,7 +31,17 @@
|
|
|
<view class="accumulative">累计采购: {{item.expendAmount}}</view>
|
|
<view class="accumulative">累计采购: {{item.expendAmount}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="store_btn">
|
|
<view class="store_btn">
|
|
|
- <view class="btn_entrance">
|
|
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="btn_entrance"
|
|
|
|
|
+ v-if="Number(item.debtAmount) <= 0"
|
|
|
|
|
+ @click="settleAccounts(item.debtAmount)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 结账
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="btn_entrance btn_forbid"
|
|
|
|
|
+ v-else
|
|
|
|
|
+ >
|
|
|
结账
|
|
结账
|
|
|
</view>
|
|
</view>
|
|
|
<view class="btn_entrance">
|
|
<view class="btn_entrance">
|
|
@@ -56,28 +62,35 @@
|
|
|
class="pay_list"
|
|
class="pay_list"
|
|
|
v-if="tabIndex == 1"
|
|
v-if="tabIndex == 1"
|
|
|
>
|
|
>
|
|
|
- <Tabs
|
|
|
|
|
- :isFixed="true"
|
|
|
|
|
- :tabs="tabs"
|
|
|
|
|
- :currentTab="tabIndex"
|
|
|
|
|
- @change="changeTabEvent"
|
|
|
|
|
- itemWidth="20%"
|
|
|
|
|
- @add="addEvent"
|
|
|
|
|
- :isAdd="false"
|
|
|
|
|
- addText="新增"
|
|
|
|
|
- ></Tabs>
|
|
|
|
|
|
|
+ <block v-if="!$util.isEmpty(list.data)">
|
|
|
|
|
+ <OrderItem
|
|
|
|
|
+ v-for="(item, index) in list.data"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :info="item"
|
|
|
|
|
+ @click="gotoDetails(item)"
|
|
|
|
|
+ >
|
|
|
|
|
+ </OrderItem>
|
|
|
|
|
+ </block>
|
|
|
|
|
+ <block v-else>
|
|
|
|
|
+ <AppWrapperEmpty
|
|
|
|
|
+ title="暂无数据"
|
|
|
|
|
+ :is-empty="$util.isEmpty(list.data)"
|
|
|
|
|
+ />
|
|
|
|
|
+ </block>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import Tabs from "@/components/plugin/tabs";
|
|
import Tabs from "@/components/plugin/tabs";
|
|
|
|
|
+import OrderItem from "./orderItem";
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
import { ghsList, purchaseList } from "@/api/purchase/index";
|
|
import { ghsList, purchaseList } from "@/api/purchase/index";
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
Tabs,
|
|
Tabs,
|
|
|
- AppWrapperEmpty
|
|
|
|
|
|
|
+ AppWrapperEmpty,
|
|
|
|
|
+ OrderItem
|
|
|
},
|
|
},
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
@@ -91,13 +104,17 @@ export default {
|
|
|
key: "1",
|
|
key: "1",
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
-
|
|
|
|
|
|
|
+ tabList: ['供货商', '采购记录'],
|
|
|
|
|
+ list: {
|
|
|
|
|
+ data: []
|
|
|
|
|
+ },
|
|
|
supplierList: [],
|
|
supplierList: [],
|
|
|
tabIndex: 0
|
|
tabIndex: 0
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted () {
|
|
mounted () {
|
|
|
this.getGHSList()
|
|
this.getGHSList()
|
|
|
|
|
+ this.getpurchaseList()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
getGHSList () {
|
|
getGHSList () {
|
|
@@ -106,14 +123,28 @@ export default {
|
|
|
console.log(this.supplierList, 111)
|
|
console.log(this.supplierList, 111)
|
|
|
}).catch(err => { console.log(err) })
|
|
}).catch(err => { console.log(err) })
|
|
|
},
|
|
},
|
|
|
|
|
+ // tab切换
|
|
|
changeTabEvent (info) {
|
|
changeTabEvent (info) {
|
|
|
- const { index } = info;
|
|
|
|
|
|
|
+ const index = info;
|
|
|
if (this.tabIndex == index) {
|
|
if (this.tabIndex == index) {
|
|
|
return false;
|
|
return false;
|
|
|
} else {
|
|
} else {
|
|
|
this.tabIndex = index;
|
|
this.tabIndex = index;
|
|
|
}
|
|
}
|
|
|
- console.log('this.tabIndex', this.tabIndex)
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取采购记录列表
|
|
|
|
|
+ getpurchaseList () {
|
|
|
|
|
+ purchaseList({ status: 0 }).then(res => {
|
|
|
|
|
+ console.log(res, 222222)
|
|
|
|
|
+ this.list.data = res.data.list
|
|
|
|
|
+ }).catch(err => { console.log(err) })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 结账
|
|
|
|
|
+ settleAccounts (num) {
|
|
|
|
|
+ console.log('点击了结账', num)
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '/pagesPurchase/gathering'
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -121,11 +152,36 @@ export default {
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.order-page {
|
|
.order-page {
|
|
|
|
|
+ .tabs {
|
|
|
|
|
+ height: 80upx;
|
|
|
|
|
+ line-height: 80upx;
|
|
|
|
|
+ & > view {
|
|
|
|
|
+ padding: 0 80upx;
|
|
|
|
|
+ font-size: 28upx;
|
|
|
|
|
+ color: #666;
|
|
|
|
|
+ display: inline-block;
|
|
|
|
|
+ }
|
|
|
|
|
+ & > .active {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ color: #3385ff;
|
|
|
|
|
+ font-weight: 700;
|
|
|
|
|
+ }
|
|
|
|
|
+ & > .active::after {
|
|
|
|
|
+ content: "";
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ left: 50%;
|
|
|
|
|
+ transform: translateX(-50%);
|
|
|
|
|
+ width: 70upx;
|
|
|
|
|
+ height: 6upx;
|
|
|
|
|
+ background: #3385ff;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.order_list {
|
|
.order_list {
|
|
|
// height: 200upx;
|
|
// height: 200upx;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
background: #f0f2f6;
|
|
background: #f0f2f6;
|
|
|
- padding: 100upx 0 20upx;
|
|
|
|
|
|
|
+ padding: 20upx 0;
|
|
|
.list_item {
|
|
.list_item {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
height: 180upx;
|
|
height: 180upx;
|
|
@@ -164,11 +220,15 @@ export default {
|
|
|
padding: 15upx 30upx;
|
|
padding: 15upx 30upx;
|
|
|
margin-left: 30upx;
|
|
margin-left: 30upx;
|
|
|
}
|
|
}
|
|
|
|
|
+ & > .btn_forbid {
|
|
|
|
|
+ border: 1px solid #999;
|
|
|
|
|
+ color: #999;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.pay_list {
|
|
.pay_list {
|
|
|
- padding-top: 100upx;
|
|
|
|
|
|
|
+ padding-top: 20upx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|