From b7ae3f69ae6706a692284d2f12835d213debfb1a Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期二, 07 四月 2026 17:21:41 +0800
Subject: [PATCH] -
---
src/pages/order/detail.vue | 216 ++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 187 insertions(+), 29 deletions(-)
diff --git a/src/pages/order/detail.vue b/src/pages/order/detail.vue
index 68d3e6b..be0d101 100644
--- a/src/pages/order/detail.vue
+++ b/src/pages/order/detail.vue
@@ -1,7 +1,7 @@
<template>
<view class="">
<scroll-view enable-flex="true">
- <view class="list chuany-flex chuany-flex-direction chuany-align-center c-p-b-30">
+ <view class="list chuany-flex chuany-flex-direction chuany-align-center c-p-b-30" @click='toEdit'>
<view class="content c-p-b-18">
<view
class="bgblue c-p-l-18 c-p-r-18 c-p-b-10 c-p-t-10 chuany-flex chuany-justify-between chuany-font30">
@@ -43,19 +43,26 @@
<view class='chuany-flex chuany-justify-between c-p-l-18 c-p-r-18 c-p-t-6 chuany-align-center'>
<view class="redcla">
<text class="chuany-font40">
- {{detailItem.workPrice}}
+ {{detailItem.workPrice}}<template
+ v-if="detailItem.workPriceMax">~{{detailItem.workPriceMax}}</template>
</text>
<text class='chuany-font20'>
{{detailItem.workerType==0?'鍏�/灏忔椂':'鍏�/浠�'}}
</text>
+ <!-- <text class="chuany-font40">
+ {{detailItem.workPrice}}
+ </text>
+ <text class='chuany-font20'>
+ {{detailItem.workerType==0?'鍏�/灏忔椂':'鍏�/浠�'}}
+ </text> -->
</view>
- <view class="">
+ <view class="" @click.stop="manageOrder(detailItem)">
<!-- <up-tag class='c-m-r-10' text="涓嬫灦" shape="circle" type="error" size='mini'
v-if="detailItem.orderStatus==0" @click.stop="deleteOrder(detailItem)"></up-tag> -->
<up-button class='c-m-r-10' :text="detailItem.isEn?'涓嬫灦':'涓婃灦'" shape="circle"
:loading='isLoading' :loadingText="detailItem.isEn?'涓嬫灦涓�':'涓婃灦涓�'"
- v-if="detailItem.orderStatus==0" :type="detailItem.isEn?'error':'primary'" size='mini'
- @click.stop="manageOrder(detailItem)"></up-button>
+ v-if="detailItem.orderStatus==0" :type="detailItem.isEn?'error':'primary'"
+ size='mini'></up-button>
<!-- <up-tag text="鍘绘姠娲�" type="warning" shape="circle"></up-tag> -->
<!-- <up-tag text="鍘绘姠娲�" type="warning" shape="circle"></up-tag> -->
</view>
@@ -76,16 +83,21 @@
</template> -->
<template #right-icon v-if="!item.isSelected" class="chuany-flex">
<up-tag class="button-layout__item" text="褰曠敤" size="mini" type="success"
- @click="selectBtn(item,true)"></up-tag>
+ @click="selectBtnGuding(item,true)"></up-tag>
<up-tag class="button-layout__item c-m-l-18" text="鎷掔粷" size="mini" type="error"
@click="selectBtn(item,false)"></up-tag>
</template>
<template #right-icon v-else class="chuany-flex">
<template class="" v-if="item.workPrice&&!item.showEdit">
<up-text type="error"
- :text="item.workerType==0?`${item.workPrice}鍏�/灏忔椂`:`${item.workPrice}鍏�/浠禶 "
+ :text="detailItem.workerType==0?`${item.workPrice}鍏�/灏忔椂`:`${item.workPrice}鍏�/浠禶 "
size='14'></up-text>
+ <up-icon name="star-fill" color="#fece01" @click='collectWorker(item)' v-if="item.isCollect"></up-icon>
+ <up-icon name="star" @click='collectWorker(item)' v-else></up-icon>
+ <up-icon name="lock-fill" color="#fece01" @click='linghuoWorker(item)' v-if="item.isGuding"></up-icon>
+ <up-icon name="lock" @click='linghuoWorker(item)' v-else></up-icon>
<up-icon name="edit-pen" @click='isShow(item)'></up-icon>
+ <up-icon name="trash" @click='deleteWorker(item)'></up-icon>
</template>
<up-input v-model="item.workPrice" border="none" v-else type="digit">
<template #suffix>
@@ -142,8 +154,11 @@
</up-list>
</view>
</scroll-view>
- <up-modal :show="modalShow" :asyncClose="true" showCancelButton closeOnClickOverlay :content="content"
- @confirm="modalConfirm" @cancel="modalCancel">
+ <up-modal :show="modalShowGuding" :asyncClose="true" showCancelButton :closeOnClickOverlay="true" :content="content" confirmText='鏄�' cancelText='鍚�'
+ @confirm="modalConfirm" @cancel="modalCancelGuding" @close='modalShowGuding=false'>
+ </up-modal>
+ <up-modal :show="modalShow" :asyncClose="true" showCancelButton :closeOnClickOverlay="true" :content="content"
+ @confirm="modalConfirm" @cancel="modalCancel" @close='modalShow=false'>
</up-modal>
</view>
</template>
@@ -175,17 +190,106 @@
let {
orderid
} = option
- getOrder(orderid)
orderIdVal = orderid
- console.log(option, '========orderid', orderid);
// detailItem.value = JSON.parse($db.get('detailItem'))
})
-
+ onShow(() => {
+ getOrder(orderIdVal)
+ })
const click = () => {
}
const isShow = (item) => {
item.showEdit = true
+ }
+ const linghuoWorker= (item)=>{
+ uni.showModal({
+ title: '鎻愮ず',
+ content: `${item.isGuding?'鍙栨秷':'娣诲姞'}${item.workerName}鐏垫椿鐢ㄥ伐锛焋,
+ success: function(res) {
+ if (res.confirm) {
+ // 鎵ц纭鍚庣殑鎿嶄綔
+ isLoading.value = true
+ $api.GudingGongren({
+ orderBiddingId: item.id,
+ isGuding:!item.isGuding
+ }).then(req => {
+ if (req.code == 1) {
+ $util.showToast({
+ title: `${item.isGuding?'鍙栨秷':'娣诲姞'}鎴愬姛锛乣
+ })
+ getOrder(orderIdVal)
+ } else {
+ $util.showToast({
+ title: req.error
+ })
+ }
+ isLoading.value = false
+ })
+ } else {
+ // 鎵ц鍙栨秷鍚庣殑鎿嶄綔
+ }
+ }
+ })
+ }
+ const collectWorker = (item)=>{
+ uni.showModal({
+ title: '鎻愮ず',
+ content: `纭${item.isCollect?'鍙栨秷':''}鏀惰棌${item.workerName}锛焋,
+ success: function(res) {
+ if (res.confirm) {
+ // 鎵ц纭鍚庣殑鎿嶄綔
+ isLoading.value = true
+ $api.collectWorker({
+ orderBiddingId: item.id,
+ isCollect:!item.isCollect
+ }).then(req => {
+ if (req.code == 1) {
+ $util.showToast({
+ title: `${item.isCollect?'鍙栨秷':''}鏀惰棌鎴愬姛锛乣
+ })
+ getOrder(orderIdVal)
+ } else {
+ $util.showToast({
+ title: req.error
+ })
+ }
+ isLoading.value = false
+ })
+ } else {
+ // 鎵ц鍙栨秷鍚庣殑鎿嶄綔
+ }
+ }
+ })
+ }
+ const deleteWorker = (item) => {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: `纭鍒犻櫎${item.workerName}锛焋,
+ success: function(res) {
+ if (res.confirm) {
+ // 鎵ц纭鍚庣殑鎿嶄綔
+ isLoading.value = true
+ $api.saveDeltoudi({
+ orderBiddingId: item.id
+ }).then(req => {
+ if (req.code == 1) {
+ $util.showToast({
+ title: '鍒犻櫎鎴愬姛锛�'
+ })
+ getOrder(orderIdVal)
+ } else {
+ $util.showToast({
+ title: req.error
+ })
+ }
+ isLoading.value = false
+ })
+ } else {
+ // 鎵ц鍙栨秷鍚庣殑鎿嶄綔
+ }
+ }
+ })
}
const saveWorkPrice = (item) => {
let obj = {
@@ -206,7 +310,7 @@
title: "宸ヤ环淇濆瓨鎴愬姛锛�",
icon: "success"
})
- getOrder(orderIdVal)
+ getOrder(orderIdVal, item.id)
item.showEdit = false
} else {
$util.showToast({
@@ -216,6 +320,7 @@
})
}
let modalShow = ref(false)
+ let modalShowGuding = ref(false)
let content = ref('')
const toView = (item) => {
uni.navigateTo({
@@ -223,7 +328,7 @@
})
}
const toWorkerDetail = (item) => {
- $db.set('toudiItem',item)
+ $db.set('toudiItem', item)
uni.navigateTo({
url: `/pages/worker/worker?workerid=${item.workerUserId}`
})
@@ -243,11 +348,18 @@
content.value = `纭畾鎷掔粷${item.workerName}鍚楋紵`
}
}
+ const selectBtnGuding = (item,val)=>{
+ workerItem.value = item
+ modalShowGuding.value = true
+ selectVal.value = val
+ content.value = `褰曠敤${item.workerName}涓虹伒娲荤敤宸ュ悧锛焋
+ }
const modalConfirm = () => {
if (selectVal.value) {
console.log('3333333333');
$api.saveQueRen({
- orderBiddingId: workerItem.value.id
+ orderBiddingId: workerItem.value.id,
+ isGuding:true
}).then(res => {
if (res.code == 1) {
$util.showToast({
@@ -260,7 +372,8 @@
title: res.error ? res.error : '澶辫触锛�'
})
}
- modalShow.value = false
+ modalShowGuding.value = false
+ workerItem.value = {}
})
} else {
@@ -280,6 +393,7 @@
})
}
modalShow.value = false
+ workerItem.value = {}
})
}
}
@@ -287,36 +401,74 @@
modalShow.value = false
workerItem.value = {}
}
- const getOrder = (orderid) => {
+ const modalCancelGuding = () => {
+ $api.saveQueRen({
+ orderBiddingId: workerItem.value.id,
+ isGuding:false
+ }).then(res => {
+ if (res.code == 1) {
+ $util.showToast({
+ title: "褰曠敤鎴愬姛锛�",
+ icon: "success"
+ })
+ getOrder(orderIdVal)
+ } else {
+ $util.showToast({
+ title: res.error ? res.error : '澶辫触锛�'
+ })
+ }
+ modalShowGuding.value = false
+ workerItem.value = {}
+ })
+ }
+ const getOrder = (orderid, id) => {
$api.getOrder(orderid).then(res => {
if (res.code == 1) {
res.data.orderBidding.forEach(item => {
item.showEdit = false
+ if (id == item.id) {
+ toWorkerDetail(item)
+ }
})
+ console.log(res.data);
detailItem.value = res.data
}
})
}
const manageOrder = (item) => {
+
let obj = {
orderId: item.id
}
- isLoading.value = true
if (item.isEn) {
- $api.deleteOrder(obj).then(res => {
- if (res.code == 1) {
- $util.showToast({
- title: '涓嬫灦鎴愬姛锛�'
- })
- getOrder(orderIdVal)
- } else {
- $util.showToast({
- title: res.error
- })
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '纭涓嬫灦璇ュ伐浣滃悧锛熶笅鏋跺悗灏嗗垹闄ょ浉鍏虫暟鎹紒',
+ success: function(res) {
+ if (res.confirm) {
+ // 鎵ц纭鍚庣殑鎿嶄綔
+ isLoading.value = true
+ $api.deleteOrder(obj).then(req => {
+ if (req.code == 1) {
+ $util.showToast({
+ title: '涓嬫灦鎴愬姛锛�'
+ })
+ getOrder(orderIdVal)
+ } else {
+ $util.showToast({
+ title: req.error
+ })
+ }
+ isLoading.value = false
+ })
+ } else {
+ // 鎵ц鍙栨秷鍚庣殑鎿嶄綔
+ }
}
- isLoading.value = false
})
} else {
+ item.OldId = item.id
+ item.id = 0
$api.saveOrder(item).then(res => {
if (res.code == 1) {
$util.showToast({
@@ -333,6 +485,12 @@
})
}
}
+ const toEdit = () => {
+ $db.set('editItem', detailItem.value)
+ uni.navigateTo({
+ url: `/pages/release/index`
+ })
+ }
</script>
<style lang='scss'>
--
Gitblit v1.9.1