123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- <template>
- <view class="home bg-f9">
- <header-bar addUrl="/purchase/add" title="申购列表"></header-bar>
- <uni-search-bar v-model="req.keyword" placeholder="输入关键词" @confirm="search" @cancel="cancel" bgColor="#fff"
- cancel-text="取消">
- </uni-search-bar>
- <view class="common-list-box" v-for="(i,index) in dataList" :key="i.index" @click="toDtl(i)">
- <view class="text">
- <view class="text-list" v-for="(j,jndex) in config" :key="jndex">
- <span class="label">
- {{j.label}}
- </span>
- <span class="value">
- {{i[j.key]}}
- </span>
- </view>
- </view>
- <view class="more success">
- <view class="common-stat-box">
- 已采购
- </view>
- <uni-icons type="forward" class="icon" size="30"></uni-icons>
- </view>
- </view>
- <!-- <common-list :config="config" @listClick="toDtl" :data="dataList"></common-list> -->
- <button type="default" @click="getList()" style="margin-top:10rpx">
- {{status == 'more' ? '点击加载更多' : status == 'noMore' ? '已经到底了' : '加载中..'}}
- </button>
- </view>
- </template>
- <script>
- import headerBar from '../../../components/header-bar/index.vue'
- import commonList from '../../../components/common-list/common-list.vue'
- import {formateObjToParamStr} from '../../../util/uitl.js'
- import Vue from 'vue'
- export default {
- components: {
- headerBar,
- commonList
- },
- data() {
- return {
- status: 'more',
- config: [{
- label: "申购单号",
- key: 'typeName',
- },
- {
- label: "申购人",
- key: 'name',
- },
- {
- label: "申购时间",
- key: 'unit',
- }
- ],
- dataList: [],
- req: {
- pageNum: 1,
- pageSize: 10,
- keyword: null,
- },
- }
- },
- onLoad() {
- this.search()
-
- },
- onShow() {
- if(this.needRefresh) this.search();
-
-
- },
- methods: {
- toDtl(i){
- console.log(i)
- uni.navigateTo({
- url: '/pages/supplyChain/purchase/add?' + formateObjToParamStr(i)
- })
- },
- cancel() {
- this.req.keyword = null
- },
- search() {
- this.req.pageNum = 1
- this.status = 'more'
- this.dataList = []
- this.getList()
- },
- getList() {
- const v = this
- if (v.status === 'more') {
- v.status = 'loading'
- } else {
- return
- }
- v.$post('/api/syringe-production/factoryProduct/list',{}).then(res => {
- console.log(res)
- })
- v.$post('/api/basics/product/page', v.req).then(res => {
- res.data.records.map(items => {
- items.typeName = (items.type === 0) ? '半成品' : '成品'
- })
- v.dataList = [...v.dataList, ...res.data.records]
- if (res.data.pages === v.req.pageNum || res.data.pages === 0) {
- v.status = 'noMore'
- } else {
- v.status = 'more'
- v.req.pageNum++
- }
- })
- },
- },
- }
- </script>
- <style lang="less">
- /deep/.bg-f9{
- background-color: #f9f9f9;
- min-height: 100vh;
- }
- /deep/.uni-forms-item{
- background-color: #fff;
- margin-bottom: 6rpx!important;
- padding: 6rpx 24rpx 26rpx!important;
- }
- /deep/.is-input-border{
- border:none!important;
- }
- .common-list-box{
- background-color: #fff;
- padding: 24rpx;
- margin-top: 6rpx;
- display: flex;
- justify-content: space-between;
- .text{
- .text-list{
- line-height: 60rpx;
- .label{
- color: #999999;
- }
- .value{
- color: #000;
- margin-left: 20rpx;
- }
- }
- }
- .common-stat-box{
- border:6rpx solid red;
- height: 80rpx;
- width: 80rpx;
- text-align: center;
- line-height: 80rpx;
- border-radius: 50%;
- position: relative;
- font-size: 20rpx;
- transform:rotate(-25deg);
- }
- .common-stat-box::before{
- display: block;
- position: absolute;
- width: 68rpx;
- height: 68rpx;
- left: 6rpx;
- top: 6rpx;
- border:2rpx solid red;
- border-radius: 50%;
- content: ' ';
- }
- .more{
- display: flex;
- align-items: center;
- }
- .success{
- .common-stat-box{
- border-color: #39C55A;
- color: #39C55A;
- }
- .common-stat-box::before{
- border-color: #39C55A;
- }
- }
- .error{
- .common-stat-box{
- border-color: #F94539;
- color: #F94539;
- }
- .common-stat-box::before{
- border-color: #F94539;
- }
- }
- .warning{
- .common-stat-box{
- border-color: #FF9315;
- color: #FF9315;
- }
- .common-stat-box::before{
- border-color: #FF9315;
- }
- }
- }
- </style>
|