From e3f6581c48b1dfb65c55e8a1a6ce1761a7dc26b4 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期四, 16 一月 2025 15:29:43 +0800
Subject: [PATCH] 费用报销
---
src/pages/release/index.vue | 89 ++++++++++++++++++++++++++++++++++++--------
1 files changed, 73 insertions(+), 16 deletions(-)
diff --git a/src/pages/release/index.vue b/src/pages/release/index.vue
index 93a24e5..8a80974 100644
--- a/src/pages/release/index.vue
+++ b/src/pages/release/index.vue
@@ -14,8 +14,13 @@
<up-input v-model="workDate" border="none" readonly placeholder="鐐瑰嚮閫夋嫨宸ヤ綔鏃ユ湡"></up-input>
<up-icon #right name="arrow-right"></up-icon>
</up-form-item>
- <up-form-item label="宸ヤ綔鏃堕棿" prop="StartTime" required :borderBottom='false' ref="item1"
- @click="clickTime(6)">
+ <up-form-item label="鑷瀹夋帓" prop="startTime" :borderBottom='false' ref="item1"
+ v-if="publicJob.workerType==1">
+ <up-checkbox :customStyle="{marginBottom: '8px'}" label="鑷瀹夋帓鏃堕棿" name="agree" usedAlone
+ v-model:checked="publicJob.zixinganpai" />
+ </up-form-item>
+ <up-form-item label="宸ヤ綔鏃堕棿" prop="startTime" required :borderBottom='false' ref="item1"
+ v-if="!publicJob.zixinganpai" @click="clickTime(6)">
<up-input v-model="workTime" border="none" readonly placeholder="鐐瑰嚮閫夋嫨宸ヤ綔鏃堕棿"></up-input>
<up-icon #right name="arrow-right"></up-icon>
</up-form-item>
@@ -46,6 +51,10 @@
<up-input v-model="publicJob.workPrice" border="none" placeholder="璇疯緭鍏ュ伐浠�" type="digit">
<template #suffix>{{publicJob.workerType=="0"?'鍏�/灏忔椂':'鍏�/浠�'}}</template></up-input>
</up-form-item>
+ <up-form-item label="宸ヤ环涓婇檺" prop="workPriceMax" required :borderBottom='false' ref="item1">
+ <up-input v-model="publicJob.workPriceMax" border="none" placeholder="璇疯緭鍏ュ伐浠蜂笂闄�" type="digit">
+ <template #suffix>{{publicJob.workerType=="0"?'鍏�/灏忔椂':'鍏�/浠�'}}</template></up-input>
+ </up-form-item>
</view>
<!-- <view class="coreshop-bg-white c-m-t-20 c-p-20">
<view class="c-p-b-20 colorgray">
@@ -64,14 +73,14 @@
</up-form>
</view>
<view class="tabbtns">
- <up-button color='#fece01' class="text-69" text="鍙戝竷鎷涘伐" :loading='isLoading' loadingText="鍙戝竷涓�"
+ <up-button color='#fece01' class="text-69" :text="editItem?'淇敼鎷涘伐':'鍙戝竷鎷涘伐'" :loading='isLoading' :loadingText="editItem?'淇敼涓�':'鍙戝竷涓�'"
@click="saveOrder"></up-button>
</view>
<!-- <fui-fab :zIndex="10" background='#fff' bottom='250'>
<fui-icon name="kefu-fill" color='#000'></fui-icon>
</fui-fab> -->
<fui-date-picker range :show="datePickerShow" :type="dateType" @change="changePicker" :minDate='minDate'
- :start="dateType==6?'8:00':'寮�濮嬫棩鏈�'" :value="dateType==6?'8:00':sDate" :end="dateType==6?'18:00':'缁撴潫鏃ユ湡'"
+ :start="dateType==6?'8:00':'寮�濮嬫棩鏈�'" :value="dateType==6?'8:00':sDate" :end="dateType==6?'18:00':eDate"
@cancel="cancel" :param='$util.formatDate(new Date())'></fui-date-picker>
</view>
</template>
@@ -86,7 +95,8 @@
import {
onLoad,
onShow,
- onReady
+ onReady,
+ onHide
} from "@dcloudio/uni-app";
const {
$upload,
@@ -99,10 +109,18 @@
} from 'vuex'
onLoad(() => {
let data = $db.get('userInfo').userCompany
+ editItem = $db.get('editItem')
if (data) {
publicJob.orderUserId = 5
publicJob.worderAddress = data.address
publicJob.contactPhone = data.phone //鑱旂郴鐢佃瘽
+ }
+ if (editItem) {
+ publicJob = reactive(editItem)
+ workDate.value = editItem.wordStartTimeName + '鑷�' + editItem.wordEndTimeName
+ sDate = editItem.wordStartTimeName
+ eDate = editItem.wordEndTimeName
+ $db.del('editItem')
}
})
let rules = {
@@ -116,7 +134,7 @@
message: '宸ヤ綔鏃ユ湡涓嶈兘涓虹┖',
trigger: ['blur', 'change']
},
- StartTime: {
+ startTime: {
required: true,
message: '宸ヤ綔鏃堕棿涓嶈兘涓虹┖',
trigger: ['blur', 'change']
@@ -142,14 +160,43 @@
trigger: ['blur', 'change']
},
workPrice: {
+ type: 'number',
required: true,
message: '宸ヤ环涓嶈兘涓虹┖',
trigger: ['blur', 'change']
- }
+ },
+ workPriceMax: {
+ type: 'number',
+ required: true,
+ message: '宸ヤ环涓婇檺涓嶈兘涓虹┖',
+ trigger: ['blur', 'change']
+ },
}
const formRef = ref(null);
onReady(() => {
formRef.value.setRules(rules);
+ })
+ onShow(()=>{
+ console.log('Show-------------',publicJob);
+ })
+ onHide(()=>{
+ publicJob = reactive({
+ id: 0, //鎷涘伐Id
+ orderUserId: '', //鎷涘伐鐢ㄦ埛id
+ orderName: '', //鎷涘伐鍚嶇О
+ wordStartTime: '', //宸ヤ綔寮�濮嬫棩鏈�
+ wordEndTime: '', //宸ヤ綔缁撴潫鏃ユ湡
+ startTime: `${$util.formatDate(new Date())}T08:00:00.000`, //宸ヤ綔寮�濮嬫椂闂�
+ endTime: `${$util.formatDate(new Date())}T18:00:00.000`, //宸ヤ綔缁撴潫鏃堕棿
+ demand: '', //闇�姹�
+ zixinganpai: false, //鑷瀹夋帓鏃堕棿
+ worderCount: 1, //鎷涘伐浜烘暟
+ worderAddress: '', //宸ヤ綔鍦扮偣
+ contactPhone: '', //鑱旂郴鐢佃瘽
+ workerType: 0, //宸ヤ綔鏂瑰紡 0璁℃椂1璁′欢
+ workPrice: '', //宸ヤ环
+ })
+ workDate.value = ''
})
onMounted(() => {
formRef.value.setRules(rules);
@@ -158,6 +205,7 @@
let dateType = ref()
let minDate = $util.formatDate(new Date())
let sDate = $util.formatDate(new Date(), null, 1)
+ let eDate = '缁撴潫鏃ユ湡'
let longitude = ref(0)
let latitude = ref(0)
let workDate = ref('')
@@ -165,15 +213,17 @@
const store = useStore()
let datePickerShow = ref(false)
let isLoading = ref(false)
- const publicJob = reactive({
+ let editItem = null
+ let publicJob = reactive({
id: 0, //鎷涘伐Id
orderUserId: '', //鎷涘伐鐢ㄦ埛id
orderName: '', //鎷涘伐鍚嶇О
wordStartTime: '', //宸ヤ綔寮�濮嬫棩鏈�
wordEndTime: '', //宸ヤ綔缁撴潫鏃ユ湡
- StartTime: `${$util.formatDate(new Date())}T08:00:00.000`, //宸ヤ綔寮�濮嬫椂闂�
- EndTime: `${$util.formatDate(new Date())}T18:00:00.000`, //宸ヤ綔缁撴潫鏃堕棿
+ startTime: `${$util.formatDate(new Date())}T08:00:00.000`, //宸ヤ綔寮�濮嬫椂闂�
+ endTime: `${$util.formatDate(new Date())}T18:00:00.000`, //宸ヤ綔缁撴潫鏃堕棿
demand: '', //闇�姹�
+ zixinganpai: false, //鑷瀹夋帓鏃堕棿
worderCount: 1, //鎷涘伐浜烘暟
worderAddress: '', //宸ヤ綔鍦扮偣
contactPhone: '', //鑱旂郴鐢佃瘽
@@ -184,6 +234,9 @@
const style = ref('time')
const changStyle = (val) => {
publicJob.workerType = val
+ if (val == 0) {
+ publicJob.zixinganpai = false
+ }
}
const clickTime = (type) => {
dateType.value = type
@@ -206,24 +259,28 @@
}
}
const saveOrder = () => {
- console.log(publicJob, 'publicJob', !publicJob.wordStartTime);
+ console.log(publicJob, 'publicJob', publicJob.workPrice);
formRef.value.validate().then(res => {
isLoading.value = true
let time = publicJob.wordStartTime
publicJob.wordStartTime = new Date(publicJob.wordStartTime)
$api.saveOrder(publicJob).then(res => {
if (res.code == 1) {
- uni.redirectTo({
- url: '/pages/order/order'
- })
+ if (editItem) {
+ uni.navigateBack()
+ } else {
+ uni.navigateTo({
+ url: '/pages/order/order'
+ })
+ }
$util.showToast({
- title: "淇濆瓨鎴愬姛锛�",
+ title: editItem?'淇敼鎴愬姛锛�':"淇濆瓨鎴愬姛锛�",
icon: "success"
})
} else {
publicJob.wordStartTime = time
$util.showToast({
- title: res.msg
+ title: res.error
})
}
isLoading.value = false
--
Gitblit v1.9.1