提交 2b90c182 authored 作者: 刘旭's avatar 刘旭

更新代码

上级 9c487a93
...@@ -4,20 +4,26 @@ ...@@ -4,20 +4,26 @@
"version" : "0.0", "version" : "0.0",
"configurations" : [ "configurations" : [
{ {
"default" : { "app-plus" :
"launchtype" : "local" {
}, "launchtype" : "local"
"mp-weixin" : { },
"launchtype" : "local" "default" :
}, {
"type" : "uniCloud" "launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}, },
{ {
"openVueDevtools" : true, "openVueDevtools" : true,
"type" : "uni-app:h5" "type" : "uni-app:h5"
}, },
{ {
"playground" : "custom", "playground" : "standard",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
} }
] ]
......
<template> <template>
<view v-if="isShow"> <view v-if="isShow">
<view @tap.stop.prevent @touchmove.stop.prevent class="wyb-popup-box" :style="{ <view class="wyb-popup-box" :style="{
transitionDuration: duration + 'ms', transitionDuration: duration + 'ms',
opacity: contentOpacity || (type === 'center' ? 0 : 1), opacity: contentOpacity || (type === 'center' ? 0 : 1),
transform: contentTransform || autoTransform, transform: contentTransform || autoTransform,
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="wyb-popup-mask" @tap.stop="close" @touchmove.stop.prevent :style="{ <view class="wyb-popup-mask" @tap.stop="close" :style="{
opacity: maskOpacity, opacity: maskOpacity,
transitionDuration: duration + 'ms', transitionDuration: duration + 'ms',
backgroundColor: 'rgba(0, 0, 0, ' + maskAlpha + ')', backgroundColor: 'rgba(0, 0, 0, ' + maskAlpha + ')',
......
// export const ApiUrl: string = 'http://192.168.1.37/ndr' // export const ApiUrl: string = '/ndr'
export const ApiUrl: string = 'http://192.168.1.37/k3Cloud' // export const ApiUrl: string = 'http://192.168.1.37/k3Cloud'
// export const ApiUrl = 'http://192.168.0.242:89/k3Cloud' // export const ApiUrl = 'http://192.168.0.242:89/k3Cloud'
// export const ApiUrl = 'http://k3.newdegreetech.com:89/k3cloud' export const ApiUrl = 'http://k3.newdegreetech.com:89/k3cloud'
\ No newline at end of file
<template> <template>
<div class='edit-container'> <div class='edit-container'>
<formList ref="formListRef" :select-list="selectList" /> <formList ref="formListRef" :select-list="selectList" @initSelect="initSelect"/>
<view class="button"> <view class="button">
<button size="mini" @tap="onSave">保存</button> <button size="mini" @tap="onSave">保存</button>
</view> </view>
...@@ -33,35 +33,25 @@ onLoad((options: any) => { ...@@ -33,35 +33,25 @@ onLoad((options: any) => {
}) })
const initSelect = () => { const initSelect = (FName?: string) => {
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
mask: true mask: true
}) })
uni.request({ uni.request({
url: ApiUrl + '/LQKJ.K3.NDR.WebApiBusinessServicePlugIn.WebApi.ExecuteCmdSelect,LQKJ.K3.NDR.WebApiBusinessServicePlugIn.common.kdsvc', url: ApiUrl + '/LQKJ.K3.NDR.WebApiBusinessServicePlugIn.WebApi.ExecuteCmdSelect,LQKJ.K3.NDR.WebApiBusinessServicePlugIn.common.kdsvc',
method: 'GET', method: 'POST',
success(res: any) { data: { FName },
uni.hideLoading() success({ data: res }: any) {
const { data } = res uni.hideLoading()
if (data.code == 200) { if (res.code == 200) {
data.data.map((item: any) => { selectList.value = res.data
selectList.value.push({ }
text: item.fname,
value: item.fnumber
})
})
} else {
uni.showToast({
title: data.msg,
icon: 'none'
})
}
}, },
fail() { fail() {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '请在内网使用', title: '请求失败',
icon: 'none' icon: 'none'
}) })
} }
...@@ -125,7 +115,7 @@ const onSave = () => { ...@@ -125,7 +115,7 @@ const onSave = () => {
fail() { fail() {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '请在内网使用', title: '请求失败',
icon: 'none' icon: 'none'
}) })
} }
......
<template> <template>
<view class="item-container"> <view class="item-container">
<view class="form-title">{{ placeholder }}</view> <view class="form-title">{{ placeholder }}</view>
<view class="line" /> <view class="line" />
<uni-forms ref="formRef" :modelValue="formData" :rules="rules" label-width="10"> <uni-forms
<view style="width: 100%; display: flex; justify-content: center; align-items: center;"> ref="formRef"
<uni-forms-item name="number" @tap="handleClick"> :modelValue="formData"
<uni-easyinput type="text" v-model="formData.number" placeholder="项目编号" :inputBorder="false" :rules="rules"
:clearable="false" disabled placeholderStyle="color: rgba(0, 0, 0, 0.9); font-size: 28rpx;" /> label-width="10"
</uni-forms-item> >
<uni-icons v-show="formData.number" type="clear" size="22" color="#ccc" @tap="clear" /> <view
</view> style="
<view class="line" /> width: 100%;
<uni-forms-item name="Hours"> display: flex;
<uni-easyinput type="number" v-model="formData.Hours" placeholder="工时数" :inputBorder="false" justify-content: center;
:clearable="false" placeholderStyle="color: rgba(0, 0, 0, 0.9); font-size: 28rpx" /> align-items: center;
<view class="line" /> "
</uni-forms-item> >
<view class="line" /> <uni-forms-item name="number">
<uni-forms-item name="workContent"> <div @tap="handleClick">
<uni-easyinput type="textarea" maxlength="-1" v-model="formData.workContent" placeholder="工作内容" <uni-easyinput
:inputBorder="false" :clearable="false" type="text"
placeholderStyle="color: rgba(0, 0, 0, 0.9); font-size: 28rpx" /> v-model="formData.number"
<view class="line" /> placeholder="项目编号"
</uni-forms-item> :inputBorder="false"
</uni-forms> :clearable="false"
</view> disabled
<popup ref="popupRef" v-model="formData.number" :selectList="selectList" @input-value="inputValue" /> placeholderStyle="color: rgba(0, 0, 0, 0.9); font-size: 28rpx;"
style="pointer-events: none"
/>
</div>
</uni-forms-item>
<uni-icons
v-show="formData.number"
type="clear"
size="22"
color="#ccc"
@tap="clear"
/>
</view>
<view class="line" />
<uni-forms-item name="Hours">
<uni-easyinput
type="number"
v-model="formData.Hours"
placeholder="工时数"
:inputBorder="false"
:clearable="false"
placeholderStyle="color: rgba(0, 0, 0, 0.9); font-size: 28rpx"
/>
<view class="line" />
</uni-forms-item>
<view class="line" />
<uni-forms-item name="workContent">
<uni-easyinput
type="textarea"
maxlength="-1"
v-model="formData.workContent"
placeholder="工作内容"
:inputBorder="false"
:clearable="false"
placeholderStyle="color: rgba(0, 0, 0, 0.9); font-size: 28rpx"
/>
<view class="line" />
</uni-forms-item>
</uni-forms>
</view>
<popup
ref="popupRef"
v-model="formData.number"
:selectList="selectList"
@input-value="inputValue"
/>
</template> </template>
<script setup lang='ts'> <script setup lang="ts">
import { nextTick, ref } from 'vue' import { nextTick, ref } from 'vue'
import { ApiUrl } from '@/config'; import popup from './popup.vue'
import popup from './popup.vue';
defineProps({
defineProps({ placeholder: {
placeholder: { type: String,
type: String },
}, selectList: {
selectList: { type: Array,
type: Array, default: [],
default: [] },
} })
})
const emits = defineEmits(['initSelect'])
const emits = defineEmits(['initSelect'])
const formData = ref({
const formData = ref({ number: '',
number: '', Hours: '',
Hours: '', workContent: '',
workContent: '', })
})
const rules = ref({
const rules = ref({ number: {
number: { rules: [
rules: [{ {
required: true, required: true,
errorMessage: '请选择项目编号', errorMessage: '请选择项目编号',
}]
}, },
workContent: { ],
rules: [{ },
required: true, workContent: {
errorMessage: '请选择工作内容', rules: [
}] {
required: true,
errorMessage: '请选择工作内容',
}, },
Hours: { ],
rules: [{ },
required: true, Hours: {
errorMessage: '请输入工时数', rules: [
}] {
required: true,
errorMessage: '请输入工时数',
}, },
}) ],
},
const formRef = ref() })
const popupRef = ref()
const formRef = ref()
const initRules = () => { const popupRef = ref()
formRef.value?.setRules(rules.value)
} const initRules = () => {
formRef.value?.setRules(rules.value)
const reset = () => { }
formData.value = {
number: '', const reset = () => {
Hours: '', formData.value = {
workContent: '', number: '',
} Hours: '',
} workContent: '',
}
const submit = () => { }
let p = new Promise((resolve: any, reject: any) => {
formRef.value?.validate().then((res: any) => { const submit = () => {
resolve(res) let p = new Promise((resolve: any, reject: any) => {
}).catch((err: any) => { formRef.value
reject(err) ?.validate()
}) .then((res: any) => {
resolve(res)
}) })
return p .catch((err: any) => {
} reject(err)
})
const handleClick = () => { })
emits('initSelect') return p
popupRef.value.open() }
const height = localStorage.getItem('windowHeight')
nextTick(() => popupRef.value.windowHeight = Number(height) * 0.8 * 0.9) const handleClick = (event: any) => {
} event.stopPropagation()
console.log('sss')
const clear = () => {
formData.value.number = '' emits('initSelect')
} popupRef.value.open()
const height = localStorage.getItem('windowHeight')
const inputValue = (value: string) => { nextTick(() => (popupRef.value.windowHeight = Number(height) * 0.8 * 0.9))
emits('initSelect', value) }
}
const clear = () => {
defineExpose({ formData.value.number = ''
formData, }
initRules,
submit, const inputValue = (value: string) => emits('initSelect', value)
reset
}) defineExpose({
formData,
initRules,
submit,
reset,
})
</script> </script>
<style scoped> <style scoped>
.form-title { .form-title {
padding: 14rpx 20rpx; padding: 14rpx 20rpx;
color: #ccc; color: #ccc;
font-size: 24rpx; font-size: 24rpx;
} }
.line { .line {
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
width: 100%; width: 100%;
transform: scaleY(0.5); transform: scaleY(0.5);
} }
.item-container { .item-container {
margin-bottom: 20rpx; margin-bottom: 20rpx;
/* border: #ddd 1px solid; /* border: #ddd 1px solid;
padding: 10rpx; padding: 10rpx;
border-radius: 10rpx; border-radius: 10rpx;
padding-bottom: 20rpx; */ padding-bottom: 20rpx; */
} }
.item-container>>>.uni-select { .item-container >>> .uni-select {
border: 0; border: 0;
} }
.item-container>>>.uni-select__input-placeholder { .item-container >>> .uni-select__input-placeholder {
color: rgba(0, 0, 0, 0.9); color: rgba(0, 0, 0, 0.9);
font-size: 28rpx font-size: 28rpx;
} }
.item-container>>>.is-direction-left { .item-container >>> .is-direction-left {
width: 100%; width: 100%;
} }
.item-container>>>.uni-icons { .item-container >>> .uni-icons {
/* display: none; */ /* display: none; */
} }
/* .item-container>>>.uni-forms-item:last-child { /* .item-container>>>.uni-forms-item:last-child {
margin-bottom: 10px; margin-bottom: 10px;
} */ } */
.item-container>>>.uni-forms-item { .item-container >>> .uni-forms-item {
margin-bottom: 0; margin-bottom: 0;
} }
.item-container>>>.is-textarea { .item-container >>> .is-textarea {
padding: 0 20rpx; padding: 0 20rpx;
} }
.item-container>>>.uni-forms-item__error { .item-container >>> .uni-forms-item__error {
display: none; display: none;
} }
.item-container>>>.is-disabled { .item-container >>> .is-disabled {
background-color: #fff; background-color: #fff;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<wyb-popup ref="popupRef" type="bottom" height="800" width="500" radius="4" :showCloseIcon="true"> <wyb-popup ref="popupRef" type="bottom" height="800" width="500" radius="4" :showCloseIcon="true">
<view class="popup-content"> <view class="popup-content">
<uni-easyinput suffixIcon="search" v-model="inputValue" placeholder="项目编号" @iconClick="iconClick" /> <uni-easyinput suffixIcon="search" v-model="inputValue" placeholder="项目编号" @iconClick="inputChange"
@input="inputChange" @change="inputChange" />
<view style="margin-bottom: 20px; box-sizing: border-box; overflow-y: scroll;" <view style="margin-bottom: 20px; box-sizing: border-box; overflow-y: scroll;"
:style="{ 'height': windowHeight + 'px' }"> :style="{ 'height': windowHeight + 'px' }">
<!-- <scroll-view scroll-y="true" > --> <!-- <scroll-view scroll-top="0" scroll-y="true"> -->
<uni-list v-if="selectList.length !== 0"> <uni-list v-if="selectList.length !== 0">
<uni-list-item v-for="(item, i) in selectList" :key="i" :title="item.fnumber" <uni-list-item class="project-list" v-for="(item, i) in selectList" :key="i" :title="item.fnumber"
@click="handleList(item.fnumber)" clickable /> @click="handleList(item.fnumber)" clickable />
</uni-list> </uni-list>
<!-- </scroll-view> -->
<view v-else class="loading">暂无数据</view> <view v-else class="loading">暂无数据</view>
<!-- </scroll-view> -->
</view> </view>
</view> </view>
</wyb-popup> </wyb-popup>
...@@ -40,12 +41,15 @@ const handleList = (value: String) => { ...@@ -40,12 +41,15 @@ const handleList = (value: String) => {
popupRef.value?.hide() popupRef.value?.hide()
} }
const open = () => { const open = () => {
popupRef.value?.show() popupRef.value?.show()
} }
const iconClick = () => { const inputChange = () => {
emits('inputValue', inputValue.value) setTimeout(() => {
emits('inputValue', inputValue.value)
}, 100)
} }
defineExpose({ defineExpose({
...@@ -62,6 +66,7 @@ defineExpose({ ...@@ -62,6 +66,7 @@ defineExpose({
.uni-easyinput { .uni-easyinput {
width: 90%; width: 90%;
margin-bottom: 20rpx;
} }
:deep(.uni-scroll-view) { :deep(.uni-scroll-view) {
......
差异被折叠。
...@@ -43,7 +43,7 @@ const login = () => { ...@@ -43,7 +43,7 @@ const login = () => {
}, },
fail: (error) => { fail: (error) => {
uni.showToast({ uni.showToast({
title: '请在内网使用', title: '请求失败',
icon: 'none' icon: 'none'
}) })
} }
......
...@@ -26,12 +26,14 @@ ...@@ -26,12 +26,14 @@
:circle="true" /> :circle="true" />
<uni-tag v-else text="重新审核" type="warning" size="small" :circle="true" /> --> <uni-tag v-else text="重新审核" type="warning" size="small" :circle="true" /> -->
<uni-tag v-if="item.F_LQKJ_BILLSTATUS == 'C'" text="已审核" type="success" size="small" :circle="true" /> <uni-tag v-if="item.F_LQKJ_BILLSTATUS == 'C'" text="已审核" type="success" size="small" :circle="true" />
<uni-tag v-else-if="item.F_LQKJ_BILLSTATUS == 'B'" text="审核中" type="primary" size="small"
:circle="true" />
<uni-tag v-else text="未审核" type="default" size="small" :circle="true" /> <uni-tag v-else text="未审核" type="default" size="small" :circle="true" />
</view> </view>
</view> </view>
<view class="line" v-show="item.F_LQKJ_BILLSTATUS != 'C'" /> <view class="line" v-show="item.F_LQKJ_BILLSTATUS != 'C' && item.F_LQKJ_BILLSTATUS != 'B'" />
<view class="footer" v-show="item.F_LQKJ_BILLSTATUS != 'C'"> <view class="footer" v-show="item.F_LQKJ_BILLSTATUS != 'C' && item.F_LQKJ_BILLSTATUS != 'B'">
<view class="button" @tap.stop="edit(item)">修改</view> <view class=" button" @tap.stop="edit(item)">修改</view>
<view class="button error" @tap.stop="deleteItem(item.FID)">删除</view> <view class="button error" @tap.stop="deleteItem(item.FID)">删除</view>
</view> </view>
</view> </view>
...@@ -67,7 +69,7 @@ const init = () => { ...@@ -67,7 +69,7 @@ const init = () => {
fail() { fail() {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '请在内网使用', title: '请求失败',
icon: 'none' icon: 'none'
}) })
} }
...@@ -112,7 +114,7 @@ const deleteItem = (Id: number) => { ...@@ -112,7 +114,7 @@ const deleteItem = (Id: number) => {
fail() { fail() {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '请在内网使用', title: '请求失败',
icon: 'none' icon: 'none'
}) })
} }
...@@ -153,7 +155,7 @@ const submitTo = (id: number) => { ...@@ -153,7 +155,7 @@ const submitTo = (id: number) => {
fail() { fail() {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '请在内网使用', title: '请求失败',
icon: 'none' icon: 'none'
}) })
} }
...@@ -190,7 +192,7 @@ const cancel = (id: number) => { ...@@ -190,7 +192,7 @@ const cancel = (id: number) => {
fail() { fail() {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '请在内网使用', title: '请求失败',
icon: 'none' icon: 'none'
}) })
} }
......
import { defineConfig } from 'vite'; import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'; import uni from '@dcloudio/vite-plugin-uni'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [uni()], plugins: [uni()],
server: { server: {
host: '0.0.0.0', host: '0.0.0.0',
port: 7879, port: 7879,
open: true, open: true,
strictPort: false, // 端口被占用直接退出 strictPort: false, // 端口被占用直接退出
proxy: { proxy: {
'/NDR': { '/ndr': {
target: 'http://192.168.1.12', target: 'http://192.168.1.12',
}, },
'/k3Cloud': { },
target: 'http://192.168.1.37', },
}, build: {
}, minify: 'terser',
}, terserOptions: {
build: { compress: {
minify: 'terser', //生产环境时移除console
terserOptions: { drop_console: true,
compress: { drop_debugger: true,
//生产环境时移除console },
drop_console: true, },
drop_debugger: true, },
}, })
},
},
});
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论