update: 优化细节

This commit is contained in:
admin 2024-05-20 16:30:44 +08:00
parent b0e31d9d9e
commit a761ecbeba
13 changed files with 296 additions and 145 deletions

View File

@ -1,7 +1,19 @@
<script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
const isFirstLaunch = ref(true);
onLaunch(() => {
console.log("App Launch");
//
if (Boolean(uni.getStorageSync("hasLaunched"))) {
//
isFirstLaunch.value = false;
console.log("不再显示启动页");
} else {
//
uni.setStorageSync("hasLaunched", true);
uni.redirectTo({ url: "pagesLaunch/index" });
}
});
onShow(() => {
console.log("App Show");

View File

@ -30,12 +30,14 @@ const props = withDefaults(
show: false
}
);
const emit = defineEmits(["handleModal", "handleOk"]);
const emit = defineEmits(["handleModal", "handleOk", "handleCancel"]);
const handleClose = (v: string) => {
emit("handleModal", false);
if (v === 'ok') {
//
emit("handleOk");
} else {
emit("handleCancel")
}
};
</script>

View File

@ -1,13 +1,14 @@
{
"name": "",
"name" : "在生万有",
// DCloud ios
"appid": "",
"appid" : "__UNI__898003A",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */
"app-plus" : {
"ignoreVersion": false,
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
@ -24,30 +25,40 @@
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios": {},
"ios" : {
"dSYMs" : false
},
/* SDK */
"sdkConfigs": {}
"sdkConfigs" : {
"ad" : {}
},
"icons" : {
"android" : {
"hdpi" : "/Users/admin/workspace/aifanda/project/在生万有/logo 72 x 72.png",
"xhdpi" : "/Users/admin/workspace/aifanda/project/在生万有/logo 96 x 96.png",
"xxhdpi" : "/Users/admin/workspace/aifanda/project/在生万有/logo 144 x144.png",
"xxxhdpi" : "/Users/admin/workspace/aifanda/project/在生万有/logo 192 x192.png"
}
}
}
},
/* */
"quickapp" : {},
// h5

View File

@ -247,8 +247,8 @@ const state = reactive({
const currentSpl = ref<any>(null);
const splBtnList = [
{ key: null, name: "全部" },
{ key: false, name: "手工补单" },
{ key: true, name: "系统单" },
{ key: true, name: "手工补单" },
{ key: false, name: "系统单" },
];
const deliveryMethod = ref<any>(null);
const deliveryMethodBtnList = [

View File

@ -32,7 +32,9 @@
:customStyle="{}"
border="none"
:disabled="item.type === 'select'"
:disabledColor="['卡号'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
:disabledColor="
['卡号'].indexOf(item.name) > -1 ? '#ffffff' : '#f5f7fa'
"
@clear="handleClear(item)"
>
<template #suffix>
@ -61,6 +63,16 @@
<view class="btn-box">
<u-button type="primary" text="保存" @click="save()"></u-button>
</view>
<SmallModal
:title="'确认作废旧卡号吗?'"
:content="`确认作废${model1.formData.cardCode}后,不能恢复!`"
:okText="'确认作废'"
:isMain="true"
:show="isShowCancelModal"
@handleModal="(v:boolean) => {handleModal(v)}"
@handleOk="handleOk()"
@handleCancel="handleCancel()"
/>
</template>
<script setup lang="ts">
import { CustomerApi, StockCardApi } from "@/services";
@ -68,9 +80,22 @@ import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
import SmallModal from "@/components/Modal/smallModal.vue";
const isShowCancelModal = ref(false);
const handleModal = (v: boolean) => {
isShowCancelModal.value = v;
};
const handleOk = () => {
handleCheck(true);
};
const handleCancel = () => {
handleCheck(false);
};
const handleClear = (item: any) => {
(model1.formData as any)[item.key] = '';
}
(model1.formData as any)[item.key] = "";
};
const model1 = reactive<any>({
formData: {},
});
@ -116,8 +141,8 @@ const formAttrList = reactive<any>([
required: true,
fn: () => {
if (contrlModalParams.stockCard.list.length === 0) {
uni.showToast({icon: 'none', title: '当前无可用卡号,请添加出库卡'})
return
uni.showToast({ icon: "none", title: "当前无可用卡号,请添加出库卡" });
return;
}
contrlModalParams.stockCard.isShow = true;
contrlModalParams.stockCard.title = "卡号";
@ -165,36 +190,47 @@ const check = () => {
};
const save = () => {
if (
model1.formData.cardCode &&
model1.formData.stockCardName !== model1.formData.cardCode
) {
handleModal(true);
} else {
handleCheck(false);
}
};
const handleCheck = (v: boolean) => {
check().then((res) => {
if (res) {
startSave();
startSave(v);
}
});
};
const startSave = () => {
const startSave = (v: boolean) => {
if (model1.formData.id) {
CustomerApi.updateCustomUser(model1.formData).then((res) => {
CustomerApi.updateCustomUser({ ...model1.formData, delCard: v }).then((res) => {
if (res.code === 200) {
uni.navigateBack()
uni.navigateBack();
}
});
} else {
CustomerApi.addCustomUser(model1.formData).then((res) => {
if (res.code === 200) {
uni.navigateBack()
uni.navigateBack();
}
});
}
};
const getStockCardList = () => {
StockCardApi.getStockCardListInfo({ vincolante: StockCardType.Shipment }).then((res) => {
StockCardApi.getStockCardListInfo({
vincolante: StockCardType.Shipment,
}).then((res) => {
if (res.code === 200) {
contrlModalParams.stockCard.list = (res.data as any).map(
(item: any) => {
contrlModalParams.stockCard.list = (res.data as any).map((item: any) => {
return { ...item, name: item.cardCode };
}
);
});
}
});
};

View File

@ -64,8 +64,19 @@
</block>
</view>
<view class="btn-box">
<u-button type="primary" text="保存" @click="save()"></u-button>
<u-button type="primary" text="保存" @click="save"></u-button>
</view>
<SmallModal
:title="'确认作废旧卡号吗?'"
:content="`确认作废${model1.formData.cardCode}后,不能恢复!`"
:okText="'确认作废'"
:isMain="true"
:show="isShowCancelModal"
@handleModal="(v:boolean) => {handleModal(v)}"
@handleOk="handleOk()"
@handleCancel="handleCancel()"
/>
</template>
<script setup lang="ts">
import { StockCardApi, SupplierApi } from "@/services";
@ -74,6 +85,18 @@ import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
import SmallModal from "@/components/Modal/smallModal.vue";
const isShowCancelModal = ref(false);
const handleModal = (v: boolean) => {
isShowCancelModal.value = v;
};
const handleOk = () => {
handleCheck(true);
};
const handleCancel = () => {
handleCheck(false);
};
const handleClear = (item: any) => {
(model1.formData as any)[item.key] = "";
};
@ -270,19 +293,32 @@ const save = () => {
return;
}
}
if (
model1.formData.cardCode &&
model1.formData.stockCardName !== model1.formData.cardCode
) {
handleModal(true);
} else {
handleCheck(false);
}
};
const handleCheck = (v: boolean) => {
check().then((res) => {
if (res) {
startSave();
startSave(v);
}
});
};
const startSave = () => {
const startSave = (v: boolean) => {
if (model1.formData.id) {
SupplierApi.updateSupplierUser(model1.formData).then((res) => {
SupplierApi.updateSupplierUser({ ...model1.formData, delCard: v }).then(
(res) => {
if (res.code === 200) {
uni.navigateBack();
}
});
}
);
} else {
SupplierApi.addSupplierUser(model1.formData).then((res) => {
if (res.code === 200) {
@ -322,23 +358,21 @@ onMounted(() => {
onLoad((option: any) => {
//
const title = option.title;
SupplierApi.getSupplierUserList({ id: option.item }).then(
(res: any) => {
SupplierApi.getSupplierUserList({ id: option.item }).then((res: any) => {
if (res.code === 200) {
if (res.data.length > 0) {
model1.formData = res.data[0]
model1.formData = res.data[0];
if (model1.formData.cardCode) {
model1.formData.stockCardName = model1.formData.cardCode;
}
} else {
uni.showToast({ title: "未查询到供应商" });
}
}
}
);
});
//
if (!option.item) {
formAttrList[1].required = true
}
if (model1.formData.cardCode) {
model1.formData.stockCardName = model1.formData.cardCode;
formAttrList[1].required = true;
}
//
uni.setNavigationBarTitle({

View File

@ -20,10 +20,24 @@
><u-icon name="arrow-down"></u-icon
></view>
<view @click="state.isShowStatus = true"
><text>单据状态</text><u-icon name="arrow-down"></u-icon
></view>
><text>{{
state.currentScaleStatus === -1
? "单据状态"
: getScaleStatus(state.currentScaleStatus)
}}</text
><u-icon name="arrow-down"></u-icon>
</view>
<view @click="state.isShowSort = true"
><text>排序</text><u-icon name="arrow-down"></u-icon
><text>{{
state.currentSortName === undefined
? "排序"
: `${
state.currentSortName === "create_time"
? "创建时间"
: "更新时间"
}降序`
}}</text
><u-icon name="arrow-down"></u-icon
></view>
<view class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view>
@ -201,6 +215,10 @@ const state = reactive({
],
isShowSort: false,
sortList: [
{
name: "全部",
key: undefined,
},
{
name: "按创建时间降序",
key: "create_time",

View File

@ -94,7 +94,7 @@ const edit = (item: any) => {
});
};
const deleteType = (item: any) => {
GoodsApi.editReceiveCategory({ isDeleted: true, id: item.id }).then((res) => {
GoodsApi.deleteReceiveCategory({ id: item.id }).then((res) => {
if (res.code === 200) {
resetPageList();
getList();

View File

@ -20,10 +20,24 @@
><u-icon name="arrow-down"></u-icon
></view>
<view @click="state.isShowStatus = true"
><text>单据状态</text><u-icon name="arrow-down"></u-icon
><text>{{
state.currentScaleStatus === -1
? "单据状态"
: getScaleStatus(state.currentScaleStatus)
}}</text
><u-icon name="arrow-down"></u-icon
></view>
<view @click="state.isShowSort = true"
><text>排序</text><u-icon name="arrow-down"></u-icon
><text>{{
state.currentSortName === undefined
? "排序"
: `${
state.currentSortName === "create_time"
? "创建时间"
: "更新时间"
}降序`
}}</text
><u-icon name="arrow-down"></u-icon
></view>
<view class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view>
@ -92,8 +106,14 @@
<text v-if="cItem.name">{{ cItem.name }}</text
><text
>{{ cItem.isBefore ? cItem.unit : "" }}
<text v-if="item[cItem.enName as string] === DeliveryMethod.Deliver">送货</text>
<text v-if="item[cItem.enName as string] === DeliveryMethod.SelfPickup">自提</text>
<text
v-if="item[cItem.enName as string] === DeliveryMethod.Deliver"
>送货</text
>
<text
v-if="item[cItem.enName as string] === DeliveryMethod.SelfPickup"
>自提</text
>
{{ cItem.isBefore ? "" : cItem.unit }}
</text>
</block>
@ -210,6 +230,10 @@ const state = reactive({
],
isShowSort: false,
sortList: [
{
name: "全部",
key: undefined,
},
{
name: "按创建时间降序",
key: "create_time",

View File

@ -10,7 +10,9 @@
>
<swiper-item v-for="(item, index) in list" :key="index">
<view class="image-box">
<image :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLaunch/${item.imgUrl}`"></image>
<image
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLaunch/${item.imgUrl}`"
></image>
<view class="title">
{{ item.title }}
</view>
@ -22,6 +24,10 @@
</swiper>
</template>
<script setup lang="ts">
import { useMemberStore } from "@/store/index";
const store = useMemberStore();
const profile = store.profile;
const list = [
{
title: "智能回收 智慧未来!",
@ -41,9 +47,16 @@ const list = [
},
];
const start = () => {
// token
if (profile.token) {
uni.navigateTo({
url: "/pagesHome/index", //
});
} else {
uni.navigateTo({
url: "/pagesLogin/login/index", //
});
}
};
</script>
<style lang="scss" scoped>

View File

@ -2,7 +2,7 @@
<view class="c-login-container">
<!-- logo -->
<view class="logo">
<image :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/logo.png`" height="60rpx"></image>
<image :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/logo2.png`" ></image>
</view>
<!-- form表单 -->
<view class="login-form">
@ -16,13 +16,15 @@
<style lang="scss" scoped>
.c-login-container {
height: 80vh;
margin-top: 20vh;
height: 85vh;
margin-top: 15vh;
.logo {
text-align: center;
image {
width: 234.62rpx;
height: 62.18rpx;
// width: 234.62rpx;
// height: 62.18rpx;
width: 300rpx;
height: 100rpx;
}
}
.login-form {

View File

@ -85,7 +85,7 @@
:customStyle="{
'border-radius': '43rpx',
}"
>保存并登录</u-button
>保存</u-button
>
</view>
</template>

View File

@ -559,7 +559,6 @@ const save = () => {
}
}
}
check().then((res) => {
if (res) {
startSave();