update: 1. 去掉旧配置 2. 其他配置中按钮点击事件 3.保存后返回上一页

This commit is contained in:
admin 2024-07-19 15:01:59 +08:00
parent 1e6937966b
commit 07097b173d
4 changed files with 46 additions and 27 deletions

View File

@ -76,12 +76,12 @@ const state = reactive({
// path: "/pagesConfig/index",
path: "/pagesHome/config",
},
{
text: "配置旧",
icon: "config.png",
activeIcon: "config_active.png",
path: "/pagesHome/index1",
},
// {
// text: "",
// icon: "config.png",
// activeIcon: "config_active.png",
// path: "/pagesHome/index1",
// },
{
text: "我的",
icon: "profile.png",

View File

@ -3,7 +3,7 @@
<up-icon
name="minus"
@click="decrease"
:size="14"
:size="22"
color="rgba(0,0,0,0.25)"
></up-icon>
<input
@ -17,7 +17,7 @@
<up-icon
name="plus"
@click="increase"
:size="14"
:size="22"
color="rgba(0,0,0,0.25)"
></up-icon>
</view>
@ -31,7 +31,7 @@ const props = defineProps<{
}>();
const emit = defineEmits(["changeValue"]);
const num = ref(props.value);
const handleInput = (event) => {
const handleInput = (event:any) => {
const value = parseInt(event.target.value);
if (!isNaN(value) && value >= 1) {
num.value = value;
@ -59,7 +59,7 @@ const decrease = () => {
align-items: center;
justify-items: center;
border: 1px solid rgba(0, 0, 0, 0.15);
padding: 0rpx 8rpx;
padding: 4px;
border-radius: 5px;
margin: 0rpx 16rpx;
.uni-input {

View File

@ -1,5 +1,5 @@
<template>
<block v-if="Object.keys(state.formData).length > 0">
<view v-if="Object.keys(state.formData).length > 0" class="app-container">
<view class="title">终端机自动打单配置</view>
<view class="box">
<view
@ -40,7 +40,7 @@
<view
>收货-待审核联单打印<AvatarInput
:min="1"
:max="7"
:max="5"
:value="state.formData.manualPrintAudit"
@changeValue="
(v) => {
@ -53,7 +53,7 @@
<view
>收货-已审核联单打印<AvatarInput
:min="1"
:max="7"
:max="5"
:value="state.formData.manualPrintAudited"
@changeValue="
(v) => {
@ -66,7 +66,7 @@
<view
>出货-待结算联单打印<AvatarInput
:min="1"
:max="7"
:max="5"
:value="state.formData.manualPrintToBeSettled"
@changeValue="
(v) => {
@ -79,7 +79,7 @@
<view
>出货-已结算联单打印<AvatarInput
:min="1"
:max="7"
:max="5"
:value="state.formData.manualPrintSettled"
@changeValue="
(v) => {
@ -112,6 +112,7 @@
></view>
<view
v-for="item in state.formData.devices"
v-if="state.formData.autoSettlement"
:key="item.id"
style="padding: 8rpx 44rpx"
>{{ item.deviceName }}
@ -128,7 +129,7 @@
天后自动结算</view
>
</view>
</block>
</view>
<view class="btn-box-fix-btn">
<u-button
@ -198,6 +199,7 @@ const handleSave = () => {
uni.showToast({
title: "设置更新成功",
});
uni.navigateBack();
}
});
};
@ -206,7 +208,7 @@ const showSelect = () => {
state.show = true;
};
const selectClick = (v:any) => {
const selectClick = (v: any) => {
state.formData.settlementConfig = v.id;
state.show = false;
};
@ -248,4 +250,9 @@ const selectClick = (v:any) => {
border-radius: 5px;
margin: 0rpx 16rpx;
}
.app-container {
height: calc(100vh - 70px);
overflow: scroll;
position: relative;
}
</style>

View File

@ -8,13 +8,22 @@
:checked="item.templateDeleted"
:activeColor="'#00D2E3'"
:usedAlone="true"
@change="(v) => {item.templateDeleted = v}"
@change="
(v:any) => {
item.templateDeleted = v;
}
"
>
</up-checkbox>
</view>
</view>
<view class="btn-box-fix-btn">
<u-button type="primary" text="保存" shape="circle" @click="handleSave"></u-button>
<u-button
type="primary"
text="保存"
shape="circle"
@click="handleSave"
></u-button>
</view>
</template>
<script setup lang="ts">
@ -22,17 +31,20 @@ import { onLoad } from "@dcloudio/uni-app";
import { OtherConfigApi } from "@/services/index";
const title = ref("");
const list = ref([]);
const list: any = ref([]);
const handleSave = () => {
OtherConfigApi.updatePrintTemplate({printTemplatePos: list.value}).then(res => {
if(res.code === 200) {
uni.showToast({
title: "设置更新成功",
});
OtherConfigApi.updatePrintTemplate({ printTemplatePos: list.value }).then(
(res) => {
if (res.code === 200) {
uni.showToast({
title: "设置更新成功",
});
uni.navigateBack();
}
}
})
}
);
};
onLoad((option: any) => {
//
if (option.key) {