|
|
@@ -42,12 +42,13 @@ import { onLoad, onShow } from '@dcloudio/uni-app';
|
|
|
const listBox = ref(null);
|
|
|
const content = reactive({
|
|
|
loading: false,
|
|
|
+ "nocache": true,
|
|
|
isadmin: 1,
|
|
|
"pageNumber": 1,
|
|
|
"pageSize": 20,
|
|
|
"where": {
|
|
|
ispublic: 1,
|
|
|
- "status": '',
|
|
|
+ "status": '待接单',
|
|
|
"condition": ""
|
|
|
}
|
|
|
});
|
|
|
@@ -96,19 +97,21 @@ function openModel(item) {
|
|
|
|
|
|
function takeOrders() {
|
|
|
$Http.basic({
|
|
|
- id: 20230210101103,
|
|
|
+ "id": "2025101710510903",
|
|
|
"content": {
|
|
|
- "sa_workorderid": takeItem.sa_workorderid
|
|
|
- }
|
|
|
+ "sa_workorderid": takeItem.sa_workorderid,
|
|
|
+ "projectlearders": [wx.getStorageSync('userMsg').userid],
|
|
|
+ ismanage: 0 // 用于避免多次抢单
|
|
|
+ },
|
|
|
}).then(res => {
|
|
|
- console.log("接单结果", res)
|
|
|
if (res.code == 1) {
|
|
|
+ console.log("抢单结果", res)
|
|
|
takeOrderShow.value = false;
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/workOrder/detail?id=' + takeItem.sa_workorderid,
|
|
|
success: (result) => {
|
|
|
uni.showToast({
|
|
|
- title: '接单成功',
|
|
|
+ title: '抢单成功',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
},
|
|
|
@@ -121,6 +124,37 @@ function takeOrders() {
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+ const handleTakeOrder = () => {
|
|
|
+ $Http.basic({
|
|
|
+ id: 20230210101103,
|
|
|
+ "content": {
|
|
|
+ "sa_workorderid": takeItem.sa_workorderid
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("接单结果", res)
|
|
|
+ if (res.code == 1) {
|
|
|
+ takeOrderShow.value = false;
|
|
|
+ uni.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>
|