|
|
@@ -0,0 +1,193 @@
|
|
|
+<template>
|
|
|
+ <My_listbox ref="listBox" :empty="!list.length" @getlist="getList">
|
|
|
+ <view style="height: 18rpx;" />
|
|
|
+ <navigator class="item" v-for="item in list" :key="item.sa_workorderid" url="/pages/workOrder/detail"
|
|
|
+ hover-class="navigator-hover">
|
|
|
+ <view class="head">
|
|
|
+ <view class="tag"
|
|
|
+ :style="{ 'background': { '安装': '#70B603', '维修': '#D9001B', '清洁': '#3874F6' }[item.type] || '#999999' }">
|
|
|
+ {{ item.type }}
|
|
|
+ </view>
|
|
|
+ <view class="time">
|
|
|
+ {{ item.createdate }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="address">
|
|
|
+ {{ item.address }}
|
|
|
+ </view>
|
|
|
+ <view class="user">
|
|
|
+ {{ item.customername + ' ' + item.customerphonenumber }}
|
|
|
+ </view>
|
|
|
+ <view class="but-box" @click.stop>
|
|
|
+ <view class="but-box-item">
|
|
|
+ <My-button :customStyle="{
|
|
|
+ 'background-color': '#FFFFFF',
|
|
|
+ 'color': '#3874F6',
|
|
|
+ height: '70rpx',
|
|
|
+ }" frontIcon="icon-bodadianhua1" text="电话" :phonenumber="item.customerphonenumber" />
|
|
|
+ </view>
|
|
|
+ <view class="but-box-item" @click="openModel(item)">
|
|
|
+ <My-button :customStyle="{
|
|
|
+ height: '70rpx',
|
|
|
+ }" frontIcon="icon-dianhua" text="接单" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </navigator>
|
|
|
+ </My_listbox>
|
|
|
+
|
|
|
+ <up-modal :show="takeOrderShow" title="是否确认接单?" showCancelButton @confirm="takeOrders"
|
|
|
+ @cancel="takeOrderShow = false" ref="uModal" :asyncClose="true"></up-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref, reactive, getCurrentInstance } from 'vue';
|
|
|
+const { $Http } = getCurrentInstance().proxy;
|
|
|
+import { onLoad } from '@dcloudio/uni-app';
|
|
|
+const listBox = ref(null);
|
|
|
+const content = reactive({
|
|
|
+ isadmin: 1,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "status": '',
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+});
|
|
|
+const list = ref([])
|
|
|
+
|
|
|
+onLoad((options) => {
|
|
|
+ content.where.status = options.type;
|
|
|
+ switch (options.type) {
|
|
|
+ case '待接单':
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: '待接工单'
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case '进行中':
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: '进行中工单'
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case '已完结':
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: '已完结工单'
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ getList();
|
|
|
+});
|
|
|
+
|
|
|
+function getList(init = false) {
|
|
|
+ if (init) content.pageNumber = 1;
|
|
|
+ $Http.basic({
|
|
|
+ "id": "20230208140203",
|
|
|
+ content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("获取列表", res)
|
|
|
+ listBox.value.refreshToComplete();
|
|
|
+ listBox.value.setHeight();
|
|
|
+ if (res.code == 1) {
|
|
|
+ list.value = reactive(res.firstPage ? res.data : list.value.concat(res.data));
|
|
|
+ content.pageTotal = res.pageTotal;
|
|
|
+ content.pageNumber = res.pageNumber;
|
|
|
+ } else {
|
|
|
+ if (res.msg) uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+let takeOrderShow = ref(false);
|
|
|
+let takeItem = null;
|
|
|
+function openModel(item) {
|
|
|
+ takeItem = item;
|
|
|
+ takeOrderShow.value = true;
|
|
|
+}
|
|
|
+function takeOrders() {
|
|
|
+ $Http.basic({
|
|
|
+ id: 20230210101103,
|
|
|
+ "content": {
|
|
|
+ "sa_workorderid": takeItem.sa_workorderid
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("接单结果", res)
|
|
|
+ if (res.code == 1) {
|
|
|
+ takeOrderShow.value = false;
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/pages/workOrder/detail?id=' + takeItem.sa_workorderid,
|
|
|
+ success: (result) => {
|
|
|
+ uni.showToast({
|
|
|
+ title: '接单成功',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ })
|
|
|
+ $Http.updateList(content, getList)
|
|
|
+ } else {
|
|
|
+ if (res.msg) uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.item {
|
|
|
+ width: 690rpx;
|
|
|
+ background: #FFFFFF;
|
|
|
+ box-shadow: 0rpx 4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
|
|
|
+ margin: 0 auto 20rpx;
|
|
|
+ padding: 20rpx 40rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ .head {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .tag {
|
|
|
+ font-family: PingFang SC, PingFang SC;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+ padding: 8rpx 20rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .time {
|
|
|
+ font-family: Microsoft YaHei, Microsoft YaHei;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .address {
|
|
|
+ line-height: 38rpx;
|
|
|
+ font-family: Microsoft YaHei, Microsoft YaHei;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #333333;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .user {
|
|
|
+ line-height: 32rpx;
|
|
|
+ font-family: Microsoft YaHei, Microsoft YaHei;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #999999;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .but-box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-around;
|
|
|
+ margin-top: 20rpx;
|
|
|
+
|
|
|
+ .but-box-item {
|
|
|
+ width: 40%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|