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

更新代码

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