| | |
| | | <template> |
| | | <view> |
| | | <scroll-view class="full-page" scroll-y using-sticky> |
| | | <up-sticky bgColor="#fff"> |
| | | <view class="coreshop-ff content c-p-10"> |
| | | <!-- <up-search placeholder="请点击选择日期" @clear='clear' @clickIcon='clickTime' @custom='search' |
| | | v-model="workTime" search-icon="calendar" @search='search'></up-search> --> |
| | | <up-search placeholder="请输入工作名称" @clear='clear' @custom='search' v-model="state.orderName" |
| | | @search='search'></up-search> |
| | | <up-search placeholder="请输入工作名称" @clear='clear' @custom='PostMyListPageCompany' |
| | | v-model="state.orderName" @search='PostMyListPageCompany'></up-search> |
| | | </view> |
| | | <!-- <up-subsection :list="list" :current="current4" activeColor="#f9ae3d" |
| | | @change="sectionChange"></up-subsection> --> |
| | | <up-subsection :list="list" current="1" activeColor="#f9ae3d" @change="sectionChange"></up-subsection> |
| | | </up-sticky> |
| | | <view class="full-page"> |
| | | <view class="full-page-content"> |
| | | <view class="c-p-l-20 c-p-r-20" v-if="listO.orderList&&listO.orderList.length>0"> |
| | | <view class="listrecord c-p-t-20" v-for="(item,index) in listO.orderList" :key="item.id" |
| | | @click="pageToDetail(item)"> |
| | |
| | | <!-- <text class="c-p-r-20"> |
| | | |
| | | </text> --> |
| | | <up-tag class='c-m-r-10' :text="item.orderStatusName" shape="circle" type="success" |
| | | plain plainFill size='mini'></up-tag> |
| | | <!-- <up-tag class='c-m-r-10' :text="item.orderStatusName" shape="circle" type="success" |
| | | plain plainFill size='mini'></up-tag> --> |
| | | <up-text :type="item.orderStatus==0?'primary':'success'" :text="item.orderStatusName" size='12'></up-text> |
| | | <!-- <up-button class='c-m-r-10' :text="item.isEn?'下架':'上架'" disabled shape="circle" |
| | | v-if="item.orderStatus==0" :type="item.isEn?'error':'primary'" size='mini' |
| | | @click.stop="manageOrder(item)"></up-button> --> |
| | | </view> |
| | | </view> |
| | | <view class="text-69 chuany-font28"> |
| | | <view class=""> |
| | | 日期:{{$util.formatDate(item.wordStartTime)}} 至 {{$util.formatDate(item.wordEndTime)}} |
| | | </view> |
| | | <view class=""> |
| | | 时间:{{item.startTimeName}} 至 {{item.endTimeName}} |
| | | </view> |
| | | <view class="chuany-flex chuany-justify-between "> |
| | | <view class="chuany-flex chuany-justify-between chuany-flex-wrap"> |
| | | <view class="chuany-width50" v-if="item.zixinganpai"> |
| | | 时间:{{item.zixinganpaiName}} |
| | | </view> |
| | | <view class="chuany-width50" v-else> |
| | | 时间:{{item.startTimeName}} 至 {{item.endTimeName}} |
| | | </view> |
| | | <view class="chuany-width50"> |
| | | <text> |
| | | 方式:{{item.workerType==0?'计时':'计件'}} |
| | |
| | | <view class="chuany-width50"> |
| | | 工价:{{item.workPrice}}{{item.workerType==0?'元/小时':'元/件'}} |
| | | <text></text> |
| | | </view> |
| | | <view class=""> |
| | | <up-button hoverStopPropagation :text="item.isEn?'下架':'上架'" shape="circle" :loading='item.isLoading' :loadingText="item.isEn?'下架中':'上架中'" |
| | | v-if="item.orderStatus==0" :type="item.isEn?'error':'primary'" size='mini' |
| | | @tap.stop="manageOrder(item)"></up-button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | <fui-date-picker range :show="datePickerShow" type="5" @change="changePicker" |
| | | @cancel="cancel"></fui-date-picker> |
| | | </view> |
| | | </scroll-view> |
| | | </template> |
| | | |
| | | <script setup> |
| | |
| | | let datePickerShow = ref(false) |
| | | let loadStatus = ref('loadmore') |
| | | let totalPages = ref(0) |
| | | let isEn = ref(true) |
| | | let listO = reactive({ |
| | | orderList: [] |
| | | }) |
| | |
| | | PostMyListPageCompany(); |
| | | } |
| | | }) |
| | | onLoad(() => { |
| | | onShow(() => { |
| | | PostMyListPageCompany() |
| | | }) |
| | | onPullDownRefresh(() => { |
| | |
| | | uni.stopPullDownRefresh(); |
| | | }) |
| | | const current4 = ref(0); |
| | | const list = ref(['全部', '发布', '招工完毕', '结算完毕']); |
| | | const list = ref(['全部', '发布中', '已下架']); |
| | | const changePicker = (val) => { |
| | | console.log(val); |
| | | workTime.value = val.startDate.result + '至' + val.endDate.result |
| | | state.wordStartTime = new Date(val.startDate.result) //工作开始时间 |
| | | state.wordEndTime = new Date(val.endDate.result) |
| | | } |
| | | |
| | | const search = (index) => { |
| | | PostMyListPageCompany() |
| | | } |
| | | const clear = () => { |
| | | state.orderName = '' |
| | | state.wordStartTime = "" |
| | | state.wordEndTime = "" |
| | | PostMyListPageCompany() |
| | | } |
| | | const clickTime = () => { |
| | | datePickerShow.value = !datePickerShow.value |
| | |
| | | let data = { |
| | | pageIndex: state.pageIndex, |
| | | pageSize: state.pageSize, |
| | | orderStatus |
| | | orderStatus, |
| | | isEn: isEn.value |
| | | } |
| | | if (state.wordStartTime) { |
| | | data.wordStartTime = state.wordStartTime |
| | |
| | | } else { |
| | | listO.orderList = listO.orderList.concat(...res.data.items) |
| | | } |
| | | listO.orderList.forEach(item => { |
| | | item.isLoading = false |
| | | }) |
| | | console.log(listO.orderList, 'listO.orderList’'); |
| | | // totalPages.value = res.data.totalCount |
| | | // 根据count数量判断是否还有数据 |
| | |
| | | } |
| | | }) |
| | | } |
| | | const sectionChange = (val) => { |
| | | switch (val) { |
| | | case 0: |
| | | isEn.value = null |
| | | break; |
| | | case 1: |
| | | isEn.value = true |
| | | break; |
| | | case 2: |
| | | isEn.value = false |
| | | break; |
| | | } |
| | | PostMyListPageCompany() |
| | | } |
| | | const manageOrder = (item) => { |
| | | let obj = { |
| | | orderId: item.id |
| | | } |
| | | console.log(obj); |
| | | item.isLoading = true |
| | | if (item.isEn) { |
| | | $api.deleteOrder(obj).then(res => { |
| | | if (res.code == 1) { |
| | | $util.showToast({ |
| | | title: '下架成功!' |
| | | }) |
| | | PostMyListPageCompany() |
| | | } else { |
| | | $util.showToast({ |
| | | title: res.error |
| | | }) |
| | | } |
| | | item.isLoading = false |
| | | }) |
| | | } else { |
| | | $api.saveOrder(item).then(res => { |
| | | if (res.code == 1) { |
| | | $util.showToast({ |
| | | title: "上架成功!", |
| | | icon: "success" |
| | | }) |
| | | PostMyListPageCompany() |
| | | } else { |
| | | $util.showToast({ |
| | | title: res.msg |
| | | }) |
| | | } |
| | | item.isLoading = false |
| | | }) |
| | | } |
| | | } |
| | | const pageToDetail = (item) => { |
| | | uni.navigateTo({ |
| | | url: `/pages/order/detail?orderid=${item.id}` |