Compare commits

...

14 Commits

Author SHA1 Message Date
admin f433f725cd update: 细节优化 2024-05-21 16:13:03 +08:00
admin aea5e834d0 update: 细节优化 2024-05-21 15:28:03 +08:00
admin a761ecbeba update: 优化细节 2024-05-20 16:30:44 +08:00
admin b0e31d9d9e update: 优化细节 2024-05-20 13:56:40 +08:00
admin dc95484bf5 update: 细节优化 2024-05-20 09:24:03 +08:00
admin b71988a8f0 update: 增加打印 2024-05-15 16:43:19 +08:00
admin e5bb761556 update: 补单不能重新过毛 2024-05-15 16:27:06 +08:00
admin 6118bbeccf update: 更新问题 2024-05-15 14:56:58 +08:00
admin 9c225b6bc6 update: 出货查看现场照片类型问题 2024-05-15 13:54:07 +08:00
admin 7402e4ee5c update: 增加密码校验 2024-05-11 14:32:42 +08:00
admin f3fd202083 update: 修复问题 2024-05-11 09:55:51 +08:00
admin 426640fc6a update: 去掉总价值计算 2024-05-10 14:01:12 +08:00
admin baa0db4871 update: 调整安卓兼容性问题 2024-05-09 13:38:36 +08:00
admin ce8cb31b5b update: 修复android pina引用问题 h5 app-plus 不支持getMenuButtonBoundingClientRect方法 2024-05-09 10:45:07 +08:00
48 changed files with 2593 additions and 2018 deletions

View File

@ -39,25 +39,28 @@
"type-check": "vue-tsc --noEmit" "type-check": "vue-tsc --noEmit"
}, },
"dependencies": { "dependencies": {
"@dcloudio/uni-app": "3.0.0-3081220230817001", "@dcloudio/uni-app": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-app-plus": "3.0.0-3081220230817001", "@dcloudio/uni-app-plus": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-components": "3.0.0-3081220230817001", "@dcloudio/uni-components": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-h5": "3.0.0-3081220230817001", "@dcloudio/uni-h5": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-mp-alipay": "3.0.0-3081220230817001", "@dcloudio/uni-mp-alipay": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-mp-baidu": "3.0.0-3081220230817001", "@dcloudio/uni-mp-baidu": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-mp-jd": "3.0.0-3081220230817001", "@dcloudio/uni-mp-jd": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-mp-kuaishou": "3.0.0-3081220230817001", "@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-mp-lark": "3.0.0-3081220230817001", "@dcloudio/uni-mp-lark": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-mp-qq": "3.0.0-3081220230817001", "@dcloudio/uni-mp-qq": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-mp-toutiao": "3.0.0-3081220230817001", "@dcloudio/uni-mp-toutiao": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-mp-weixin": "3.0.0-3081220230817001", "@dcloudio/uni-mp-weixin": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-quickapp-webview": "3.0.0-3081220230817001", "@dcloudio/uni-mp-xhs": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-ui": "^1.5.2", "@dcloudio/uni-ui": "^1.5.2",
"@esbuild/darwin-x64": "^0.20.2",
"@rollup/rollup-darwin-x64": "^4.17.2",
"amfe-flexible": "^2.2.1", "amfe-flexible": "^2.2.1",
"clipboard": "^2.0.11", "clipboard": "^2.0.11",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"echarts": "^5.5.0", "echarts": "^5.5.0",
"esbuild": "0.17.19", "esbuild": "^0.20.2",
"luch-request": "^3.1.1", "luch-request": "^3.1.1",
"pinia": "2.0.33", "pinia": "2.0.33",
"pinia-plugin-persistedstate": "^3.2.1", "pinia-plugin-persistedstate": "^3.2.1",
@ -65,26 +68,26 @@
"underscore": "^1.13.6", "underscore": "^1.13.6",
"unplugin-auto-import": "^0.17.3", "unplugin-auto-import": "^0.17.3",
"uview-plus": "^3.2.14", "uview-plus": "^3.2.14",
"vue": "^3.2.45", "vue": "^3.4.27",
"vue-i18n": "^9.1.9" "vue-i18n": "^9.13.1"
}, },
"devDependencies": { "devDependencies": {
"@dcloudio/types": "^3.3.2", "@dcloudio/types": "^3.4.8",
"@dcloudio/uni-automator": "3.0.0-3081220230817001", "@dcloudio/uni-automator": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-cli-shared": "3.0.0-3081220230817001", "@dcloudio/uni-cli-shared": "3.0.0-alpha-4010520240507001",
"@dcloudio/uni-stacktracey": "3.0.0-3081220230817001", "@dcloudio/uni-stacktracey": "3.0.0-alpha-4010520240507001",
"@dcloudio/vite-plugin-uni": "3.0.0-3081220230817001", "@dcloudio/vite-plugin-uni": "3.0.0-alpha-4010520240507001",
"@types/node": "^20.11.22", "@types/node": "^20.11.22",
"@types/underscore": "^1.11.15", "@types/underscore": "^1.11.15",
"@types/wechat-miniprogram": "^3.4.7", "@types/wechat-miniprogram": "^3.4.7",
"@uni-helper/uni-app-types": "^0.5.12", "@uni-helper/uni-app-types": "^0.5.12",
"@uni-helper/uni-ui-types": "^0.5.11", "@uni-helper/uni-ui-types": "^0.5.11",
"@vue/runtime-core": "^3.2.45", "@vue/runtime-core": "^3.4.27",
"@vue/tsconfig": "^0.1.3", "@vue/tsconfig": "^0.1.3",
"sass": "^1.69.7", "sass": "^1.69.7",
"sass-loader": "10", "sass-loader": "10",
"typescript": "^4.9.4", "typescript": "^4.9.4",
"vite": "4.1.4", "vite": "5.2.8",
"vue-tsc": "^1.0.24" "vue-tsc": "^1.0.24"
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,19 @@
<script setup lang="ts"> <script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app"; import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
const isFirstLaunch = ref(true);
onLaunch(() => { onLaunch(() => {
console.log("App Launch"); 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(() => { onShow(() => {
console.log("App Show"); console.log("App Show");
@ -12,9 +24,9 @@ onHide(() => {
</script> </script>
<style lang="scss"> <style lang="scss">
/* 注意要写在第一行同时给style标签加入lang="scss"属性 */ /* 注意要写在第一行同时给style标签加入lang="scss"属性 */
@import "uview-plus/index.scss"; @import "uview-plus/index.scss";
body { body {
font-size: 12px; font-size: 12px;
} }
</style> </style>

View File

@ -56,8 +56,9 @@ import Title from "@/components/Title/index.vue";
import TabBar from "@/components/TabBar/index.vue"; import TabBar from "@/components/TabBar/index.vue";
import { useMemberStore } from "@/store/index"; import { useMemberStore } from "@/store/index";
import { ProfileApi } from "@/services"; import { ProfileApi } from "@/services";
import pinia from '@/store'
const store = useMemberStore(); const store = useMemberStore(pinia);
const list = reactive([ const list = reactive([
{ {
title: "收货", title: "收货",

View File

@ -71,7 +71,7 @@
<view class="num">{{ <view class="num">{{
formatMoney(state.summary.totalPaidPrice) formatMoney(state.summary.totalPaidPrice)
}}</view> }}</view>
<view>实收金额</view> <view>已付金额</view>
</view> </view>
</up-col> </up-col>
<up-col span="4"> <up-col span="4">

View File

@ -1,6 +1,6 @@
<template> <template>
<view <view
:class="{'box': isShow}" :class="{ box: isShow }"
:style="{ :style="{
marginTop: navbarRect.height + navbarRect.top + 'px', marginTop: navbarRect.height + navbarRect.top + 'px',
height: navbarRect.safeHeight + 'px', height: navbarRect.safeHeight + 'px',
@ -15,7 +15,7 @@ const props = withDefaults(
isShow: boolean; isShow: boolean;
}>(), }>(),
{ {
isShow: false isShow: false,
} }
); );
const navbarRect = reactive({ const navbarRect = reactive({
@ -39,12 +39,17 @@ const getSafeHeight = () => {
// #endif // #endif
}; };
onMounted(() => { onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN // #ifdef MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect(); let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
navbarRect.height = menuButtonInfo.height; navbarRect.height = menuButtonInfo.height;
navbarRect.top = menuButtonInfo.top; navbarRect.top = menuButtonInfo.top;
getSafeHeight(); getSafeHeight();
// #endif // #endif
// #ifndef MP-WEIXIN
const systemInfo = uni.getSystemInfoSync();
navbarRect.safeHeight = (systemInfo.safeArea as any).height;
getSafeHeight();
// #endif
}); });
</script> </script>
<style lang="scss"> <style lang="scss">

View File

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

View File

@ -22,19 +22,47 @@
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ProfileApi,ReceiveApi,ShipmentApi,PictureApi,ReceiveProductApi,DeviceApi,StockCardApi,GoodsApi,SupplierApi,CustomerApi,FinanceApi,MessageApi } from '@/services'; import {
ProfileApi,
ReceiveApi,
ShipmentApi,
PictureApi,
ReceiveProductApi,
DeviceApi,
StockCardApi,
GoodsApi,
SupplierApi,
CustomerApi,
FinanceApi,
MessageApi,
} from "@/services";
import { formatDate } from "@/utils"; import { formatDate } from "@/utils";
import { UsersType } from "@/utils/enum"; import { UsersType } from "@/utils/enum";
import valid from "@/utils/validate"; import valid from "@/utils/validate";
console.log(ProfileApi,ReceiveApi,ShipmentApi,PictureApi,ReceiveProductApi,DeviceApi,StockCardApi,GoodsApi,SupplierApi,CustomerApi,FinanceApi,formatDate,UsersType, valid) console.log(
ProfileApi,
ReceiveApi,
ShipmentApi,
PictureApi,
ReceiveProductApi,
DeviceApi,
StockCardApi,
GoodsApi,
SupplierApi,
CustomerApi,
FinanceApi,
formatDate,
UsersType,
valid
);
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
count: number, count: number;
title: string title: string;
}>(), }>(),
{ {
count: 0 count: 0,
} }
); );
@ -44,7 +72,7 @@ const navbarRect = reactive({
msgCount: 10, msgCount: 10,
}); });
onMounted(() => { onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN // #ifdef MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect(); let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
navbarRect.height = menuButtonInfo.height; navbarRect.height = menuButtonInfo.height;
navbarRect.top = menuButtonInfo.top; navbarRect.top = menuButtonInfo.top;

View File

@ -21,7 +21,7 @@ const navbarRect = reactive({
}); });
onMounted(() => { onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN // #ifdef MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect(); let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
navbarRect.height = menuButtonInfo.height; navbarRect.height = menuButtonInfo.height;
navbarRect.top = menuButtonInfo.top; navbarRect.top = menuButtonInfo.top;

View File

@ -86,7 +86,7 @@ watch(
// ,{ deep: true, immediate:true} // ,{ deep: true, immediate:true}
onLoad(() => { onLoad(() => {
// #ifdef APP-PLUS || MP-WEIXIN // #ifdef APP-PLUS || MP-WEIXIN || H5
getClineHeight(); getClineHeight();
// #endif // #endif
}); });

View File

@ -1,85 +1,96 @@
{ {
"name": "", "name" : "在生万有",
// DCloud ios // DCloud ios
"appid": "", "appid" : "__UNI__898003A",
"description": "", "description" : "",
"versionName": "1.0.0", "versionName" : "1.0.0",
"versionCode": "100", "versionCode" : "100",
"transformPx": false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus": { "app-plus" : {
"usingComponents": true, "ignoreVersion": false,
"nvueStyleCompiler": "uni-app", "usingComponents" : true,
"compilerVersion": 3, "nvueStyleCompiler" : "uni-app",
"splashscreen": { "compilerVersion" : 3,
"alwaysShowBeforeRender": true, "splashscreen" : {
"waiting": true, "alwaysShowBeforeRender" : true,
"autoclose": true, "waiting" : true,
"delay": 0 "autoclose" : true,
"delay" : 0
}, },
/* */ /* */
"modules": {}, "modules" : {},
/* */ /* */
"distribute": { "distribute" : {
/* android */ /* android */
"android": { "android" : {
"permissions": [ "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-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\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ]
}, },
/* ios */ /* ios */
"ios": {}, "ios" : {
"dSYMs" : false
},
/* SDK */ /* 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": {}, "quickapp" : {},
// h5 // h5
"h5": { "h5" : {
"router": { "router" : {
"base": "./" "base" : "./"
} }
}, },
/* */ /* */
"mp-weixin": { "mp-weixin" : {
"appid": "wx9251d74fe0e87028", "appid" : "wx9251d74fe0e87028",
"logoPath": "https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/logo-simple.png", "logoPath" : "https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/logo-simple.png",
"setting": { "setting" : {
"urlCheck": false "urlCheck" : false
}, },
"usingComponents": true, "usingComponents" : true,
"optimization": { "optimization" : {
"subPackages": true // "subPackages" : true //
}, },
"lazyCodeLoading": "requiredComponents" "lazyCodeLoading" : "requiredComponents"
}, },
"mp-alipay": { "mp-alipay" : {
"usingComponents": true "usingComponents" : true
}, },
"mp-baidu": { "mp-baidu" : {
"usingComponents": true "usingComponents" : true
}, },
"mp-toutiao": { "mp-toutiao" : {
"usingComponents": true "usingComponents" : true
}, },
"uniStatistics": { "uniStatistics" : {
"enable": false "enable" : false
}, },
"vueVersion": "3" "vueVersion" : "3"
} }

View File

@ -241,13 +241,7 @@
"style": { "style": {
"navigationBarTitleText": "客户详情" "navigationBarTitleText": "客户详情"
} }
}, }
// {
// "path": "uni_modules/lime-echart",
// "style": {
// "navigationBarTitleText": "组件库"
// }
// }
] ]
}, },
{ {

View File

@ -247,8 +247,8 @@ const state = reactive({
const currentSpl = ref<any>(null); const currentSpl = ref<any>(null);
const splBtnList = [ const splBtnList = [
{ key: null, name: "全部" }, { key: null, name: "全部" },
{ key: false, name: "补单" }, { key: true, name: "手工补单" },
{ key: true, name: "未补单" }, { key: false, name: "系统单" },
]; ];
const deliveryMethod = ref<any>(null); const deliveryMethod = ref<any>(null);
const deliveryMethodBtnList = [ const deliveryMethodBtnList = [
@ -441,7 +441,7 @@ const getFilter = () => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box { .box {
padding: 60rpx 30rpx; padding: 60rpx 30rpx 150rpx;
::v-deep .u-cell__value { ::v-deep .u-cell__value {
font-size: 26rpx; font-size: 26rpx;
} }

View File

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

View File

@ -159,7 +159,7 @@ const startSave = () => {
if (model1.formData.id) { if (model1.formData.id) {
GoodsApi.editShipmentCategory({ GoodsApi.editShipmentCategory({
id: model1.formData.id, id: model1.formData.id,
shmCategoryName: model1.formData.name, shmCategoryName: model1.formData.shmCategoryName,
parentId: model1.formData.parentId, parentId: model1.formData.parentId,
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {

View File

@ -3,7 +3,7 @@
<u-form <u-form
labelPosition="left" labelPosition="left"
:model="model1" :model="model1"
:rules="rules" :rules="model1.formData.id ? rules1 : rules2"
ref="form" ref="form"
:labelWidth="100" :labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }" :labelStyle="{ padding: '0rpx 10rpx' }"
@ -33,7 +33,11 @@
border="none" border="none"
@change="(e:any) => {handleInput(e, item)}" @change="(e:any) => {handleInput(e, item)}"
:disabled="item.type === 'select'" :disabled="item.type === 'select'"
:disabledColor="['卡号', '供应商分类'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" :disabledColor="
['卡号', '供应商分类'].indexOf(item.name) > -1
? '#ffffff'
: '#f5f7fa'
"
@clear="handleClear(item)" @clear="handleClear(item)"
> >
<template #suffix> <template #suffix>
@ -60,8 +64,19 @@
</block> </block>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<u-button type="primary" text="保存" @click="save()"></u-button> <u-button type="primary" text="保存" @click="save"></u-button>
</view> </view>
<SmallModal
:title="'确认作废旧卡号吗?'"
:content="`确认作废${model1.formData.cardCode}后,不能恢复!`"
:okText="'确认作废'"
:isMain="true"
:show="isShowCancelModal"
@handleModal="(v:boolean) => {handleModal(v)}"
@handleOk="handleOk()"
@handleCancel="handleCancel()"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { StockCardApi, SupplierApi } from "@/services"; import { StockCardApi, SupplierApi } from "@/services";
@ -70,11 +85,23 @@ import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import valid from "@/utils/validate"; import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore"; import _ from "underscore";
const handleClear = (item:any) => { import SmallModal from "@/components/Modal/smallModal.vue";
(model1.formData as any)[item.key] = ''; 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] = "";
};
const handleInput = (e: any, item: any) => { const handleInput = (e: any, item: any) => {
if (item.key === "phone" || item.key === 'bankNumber') { if (item.key === "phone" || item.key === "bankNumber") {
const temp = e?.replace(valid.valid_number, ""); const temp = e?.replace(valid.valid_number, "");
setTimeout(() => { setTimeout(() => {
model1.formData[item.key] = temp; model1.formData[item.key] = temp;
@ -84,7 +111,21 @@ const handleInput = (e: any, item: any) => {
const model1 = reactive<any>({ const model1 = reactive<any>({
formData: {}, formData: {},
}); });
const rules = ref({ const rules1 = ref({
"formData.name": {
type: "string",
required: true,
message: "请输入供应商",
trigger: ["blur", "change"],
},
"formData.supplierTypeName": {
type: "string",
required: true,
message: "请选择供应商分类",
trigger: ["blur", "change"],
},
});
const rules2 = ref({
"formData.stockCardName": { "formData.stockCardName": {
type: "string", type: "string",
required: true, required: true,
@ -127,11 +168,11 @@ const formAttrList = reactive<any>([
key: "stockCardName", key: "stockCardName",
type: "select", type: "select",
childKey: "stockCard", childKey: "stockCard",
required: true, // required: true,
fn: () => { fn: () => {
if (contrlModalParams.stockCard.list.length === 0) { if (contrlModalParams.stockCard.list.length === 0) {
uni.showToast({icon: 'none', title: '当前无可用卡号,请添加入库卡'}) uni.showToast({ icon: "none", title: "当前无可用卡号,请添加入库卡" });
return return;
} }
contrlModalParams.stockCard.isShow = true; contrlModalParams.stockCard.isShow = true;
contrlModalParams.stockCard.title = "卡号"; contrlModalParams.stockCard.title = "卡号";
@ -252,23 +293,44 @@ const save = () => {
return; return;
} }
} }
if (
model1.formData.cardCode &&
model1.formData.stockCardName !== model1.formData.cardCode
) {
handleModal(true);
} else {
handleCheck(false);
}
};
const handleCheck = (v: boolean) => {
check().then((res) => { check().then((res) => {
if (res) { if (res) {
startSave(); startSave(v);
} }
}); });
}; };
const startSave = () => { const startSave = (v: boolean) => {
if (model1.formData.id) { if (model1.formData.id) {
SupplierApi.updateSupplierUser(model1.formData).then((res) => { SupplierApi.updateSupplierUser({ ...model1.formData, delCard: v }).then(
(res) => {
if (res.code === 200) { if (res.code === 200) {
uni.navigateBack() // uni.navigateBack();
} uni.navigateBack({
delta: 1,
success: (res) => {
uni.$emit("pricingParams", {
name: model1.formData.name
}); });
},
});
}
}
);
} else { } else {
SupplierApi.addSupplierUser(model1.formData).then((res) => { SupplierApi.addSupplierUser(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.navigateBack() uni.navigateBack();
} }
}); });
} }
@ -283,7 +345,8 @@ const getSupplierTypeList = () => {
}; };
const getStockCardList = () => { const getStockCardList = () => {
StockCardApi.getStockCardListInfo({ vincolante: StockCardType.Receive }).then((res) => { StockCardApi.getStockCardListInfo({ vincolante: StockCardType.Receive }).then(
(res) => {
if (res.code === 200) { if (res.code === 200) {
contrlModalParams.stockCard.list = (res.data as any).map( contrlModalParams.stockCard.list = (res.data as any).map(
(item: any) => { (item: any) => {
@ -291,7 +354,8 @@ const getStockCardList = () => {
} }
); );
} }
}); }
);
}; };
onMounted(() => { onMounted(() => {
@ -299,13 +363,25 @@ onMounted(() => {
getStockCardList(); getStockCardList();
}); });
onLoad((option) => { onLoad((option: any) => {
// //
const title = (option as any).title; const title = option.title;
model1.formData = JSON.parse((option as any).item); SupplierApi.getSupplierUserList({ id: option.item }).then((res: any) => {
if (res.code === 200) {
if (res.data.length > 0) {
model1.formData = res.data[0];
if (model1.formData.cardCode) { if (model1.formData.cardCode) {
model1.formData.stockCardName = model1.formData.cardCode; model1.formData.stockCardName = model1.formData.cardCode;
} }
} else {
uni.showToast({ title: "未查询到供应商" });
}
}
});
//
if (!option.item) {
formAttrList[1].required = true;
}
// //
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: title, title: title,

View File

@ -3,7 +3,7 @@
<u-form <u-form
labelPosition="left" labelPosition="left"
:model="model1" :model="model1"
:rules="rules" :rules="model1.formData.id ? rules2 : rules1"
ref="form" ref="form"
:labelWidth="100" :labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }" :labelStyle="{ padding: '0rpx 10rpx' }"
@ -13,7 +13,7 @@
:prop="`formData.${item.key}`" :prop="`formData.${item.key}`"
:label="item.name" :label="item.name"
:required="item.required" :required="item.required"
v-for="(item, index) in formAttrList" v-for="(item, index) in model1.formData.id ? formAttrList2 : formAttrList1"
:key="index" :key="index"
@click="item.fn" @click="item.fn"
> >
@ -32,10 +32,12 @@
clearable clearable
:customStyle="{}" :customStyle="{}"
border="none" border="none"
:maxlength="item.key === 'password' ? 6 : -1" :maxlength="item.key === 'password' ? 8 : -1"
@change="(e:any) => {handleInput(e, item)}" @change="(e:any) => {handleInput(e, item)}"
:disabled="item.type === 'select'" :disabled="item.type === 'select'"
:disabledColor="['性别', '用户角色'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" :disabledColor="
['性别', '用户角色'].indexOf(item.name) > -1 ? '#ffffff' : '#f5f7fa'
"
@clear="handleClear(item)" @clear="handleClear(item)"
> >
<template #suffix> <template #suffix>
@ -49,7 +51,7 @@
</template> </template>
</u-form-item> </u-form-item>
</u-form> </u-form>
<block v-for="(item, index) in formAttrList" :key="index"> <block v-for="(item, index) in model1.formData.id ? formAttrList2 : formAttrList1" :key="index">
<u-action-sheet <u-action-sheet
v-if="item.type === 'select'" v-if="item.type === 'select'"
:actions="contrlModalParams[item.childKey].list" :actions="contrlModalParams[item.childKey].list"
@ -72,9 +74,9 @@ import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import valid from "@/utils/validate"; import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore"; import _ from "underscore";
const handleClear = (item:any) => { const handleClear = (item: any) => {
(model1.formData as any)[item.key] = ''; (model1.formData as any)[item.key] = "";
} };
const handleInput = (e: any, item: any) => { const handleInput = (e: any, item: any) => {
if (item.key === "phone") { if (item.key === "phone") {
const temp = e?.replace(valid.valid_number, ""); const temp = e?.replace(valid.valid_number, "");
@ -82,12 +84,23 @@ const handleInput = (e: any, item: any) => {
model1.formData[item.key] = temp; model1.formData[item.key] = temp;
}, 10); }, 10);
} }
if (item.key === "password") {
const temp = e?.replace(valid.valid_no_cn, "");
setTimeout(() => {
(model1.formData as any)[item.key] = temp;
}, 10);
}
}; };
const model1 = reactive<any>({ const model1 = reactive<any>({
formData: { formData: {},
},
}); });
const rules = ref({ const rules1 = ref({
"formData.roleName": {
type: "string",
required: true,
message: "请选择用户角色",
trigger: ["blur", "change"],
},
"formData.userName": { "formData.userName": {
type: "string", type: "string",
required: true, required: true,
@ -101,6 +114,20 @@ const rules = ref({
trigger: ["blur", "change"], trigger: ["blur", "change"],
}, },
}); });
const rules2 = ref({
"formData.roleName": {
type: "string",
required: true,
message: "请选择用户角色",
trigger: ["blur", "change"],
},
"formData.userName": {
type: "string",
required: true,
message: "请输入账号",
trigger: ["blur", "change"],
},
});
const contrlModalParams = reactive<any>({ const contrlModalParams = reactive<any>({
role: { role: {
isShow: false, isShow: false,
@ -123,7 +150,7 @@ const contrlModalParams = reactive<any>({
}, },
}); });
const formAttrList = reactive<any>([ const formAttrList1 = reactive<any>([
{ {
name: "姓名", name: "姓名",
key: "name", key: "name",
@ -144,6 +171,7 @@ const formAttrList = reactive<any>([
key: "roleName", key: "roleName",
type: "select", type: "select",
childKey: "role", childKey: "role",
required: true,
fn: () => { fn: () => {
contrlModalParams.role.isShow = true; contrlModalParams.role.isShow = true;
contrlModalParams.role.title = "选择角色"; contrlModalParams.role.title = "选择角色";
@ -168,6 +196,46 @@ const formAttrList = reactive<any>([
}, },
]); ]);
const formAttrList2 = reactive<any>([
{
name: "姓名",
key: "name",
type: "input",
},
{
name: "性别",
key: "genderName",
type: "select",
childKey: "gender",
fn: () => {
contrlModalParams.gender.isShow = true;
contrlModalParams.gender.title = "选择性别";
},
},
{
name: "用户角色",
key: "roleName",
type: "select",
childKey: "role",
required: true,
fn: () => {
contrlModalParams.role.isShow = true;
contrlModalParams.role.title = "选择角色";
},
},
{
name: "账号",
key: "userName",
type: "input",
required: true,
},
{
name: "联系手机",
key: "phone",
type: "input",
},
]);
const handleSelect = (key: string, v: any) => { const handleSelect = (key: string, v: any) => {
contrlModalParams[key].isShow = false; contrlModalParams[key].isShow = false;
if (key === "role") { if (key === "role") {
@ -205,6 +273,18 @@ const save = () => {
return; return;
} }
} }
if (!model1.formData.id) {
if (model1.formData.password) {
if (!valid.valid_password.pattern.test(model1.formData.password)) {
uni.showToast({
icon: "none",
title: valid.valid_password.message,
});
return;
}
}
}
check().then((res) => { check().then((res) => {
if (res) { if (res) {
startSave(); startSave();
@ -214,15 +294,22 @@ const save = () => {
const startSave = () => { const startSave = () => {
if (model1.formData.id) { if (model1.formData.id) {
ProfileApi.updateUserById(model1.formData).then((res) => { ProfileApi.updateUserById({
name: model1.formData.name,
id: model1.formData.id,
roleIds: model1.formData.roleIds,
userName: model1.formData.userName,
phone: model1.formData.phone,
gender: model1.formData.gender,
}).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.navigateBack() uni.navigateBack();
} }
}); });
} else { } else {
ProfileApi.addUser({ userType: 1, ...model1.formData }).then((res) => { ProfileApi.addUser({ userType: 1, ...model1.formData }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.navigateBack() uni.navigateBack();
} }
}); });
} }
@ -246,11 +333,11 @@ onMounted(() => {
onLoad((option) => { onLoad((option) => {
// ; // ;
const title = (option as any).title; const title = (option as any).title;
const obj = JSON.parse((option as any).item) const obj = JSON.parse((option as any).item);
model1.formData = {...obj, genderName: ['未知','男','女'][obj.gender]}; model1.formData = { ...obj, genderName: ["未知", "男", "女"][obj.gender] };
if (obj.roleVos.length > 0) { if (obj.roleVos.length > 0) {
model1.formData.roleIds = [obj.roleVos[0].id] model1.formData.roleIds = [obj.roleVos[0].id];
model1.formData.roleName = obj.roleVos[0].roleName model1.formData.roleName = obj.roleVos[0].roleName;
} }
// ; // ;
if (title) { if (title) {

View File

@ -29,7 +29,7 @@
>{{ obj.paymentType === 0 ? "收货" : "出货" }}单号 >{{ obj.paymentType === 0 ? "收货" : "出货" }}单号
<text>{{ obj.orderNumber }}</text></view <text>{{ obj.orderNumber }}</text></view
> >
<up-image :show-loading="true" v-for="(item, index) in obj.fileLists" :key="index" :src="item.url" width="80px" height="80px"></up-image> <up-image :show-loading="true" v-for="(item, index) in state.fileLists" :key="index" :src="item.url" width="80px" height="80px"></up-image>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -37,6 +37,9 @@ import { FinanceApi, PictureApi } from "@/services";
import { ImagesType, OrderType } from "@/utils/enum"; import { ImagesType, OrderType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
const obj = ref<any>({}); const obj = ref<any>({});
const state = reactive<any>({
fileLists: []
})
const getPayment = (item: any) => { const getPayment = (item: any) => {
return ["供应商付款", "客户付款", "客户(手动)", "供应商(手动)"][ return ["供应商付款", "客户付款", "客户(手动)", "供应商(手动)"][
item.paymentType item.paymentType
@ -58,7 +61,7 @@ onLoad((option: any) => {
imagesType: ImagesType.NORMARL, imagesType: ImagesType.NORMARL,
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
obj.value.fileLists = res.data; state.fileLists = res.data;
} }
}); });
}); });

View File

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

View File

@ -97,7 +97,7 @@ const handleSearch = () => {
const update = (item: any) => { const update = (item: any) => {
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then((res) => { GoodsApi.deleteReceiveProduct({ id: item.id }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
resetPageList(); resetPageList();
getList(); getList();

View File

@ -94,7 +94,7 @@ const edit = (item: any) => {
}); });
}; };
const deleteType = (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) { if (res.code === 200) {
resetPageList(); resetPageList();
getList(); getList();

View File

@ -91,7 +91,7 @@ const add = () => {
const edit = (item: any) => { const edit = (item: any) => {
uni.navigateTo({ uni.navigateTo({
url: url:
"/pagesApp/components/addRole?title=新增角色&item=" + "/pagesApp/components/addRole?title=编辑角色&item=" +
JSON.stringify(item), // JSON.stringify(item), //
}); });
}; };

View File

@ -56,7 +56,7 @@
<text v-if="cItem.name">{{ cItem.name }}</text <text v-if="cItem.name">{{ cItem.name }}</text
><text ><text
>{{ cItem.isBefore ? cItem.unit : "" }} >{{ cItem.isBefore ? cItem.unit : "" }}
{{ cItem.num }} {{ cItem.name === '送货方式' ? item[`${cItem.enName}`] === DeliveryMethod.Deliver ? '送货' : '自提' : item[`${cItem.enName}`] }}
{{ cItem.isBefore ? "" : cItem.unit }} {{ cItem.isBefore ? "" : cItem.unit }}
</text> </text>
</view> </view>
@ -68,7 +68,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ReceiveApi, ShipmentApi } from "@/services"; import { ReceiveApi, ShipmentApi } from "@/services";
import PageView from "@/components/PageView/index.vue"; import PageView from "@/components/PageView/index.vue";
import { ScaleStatus } from "@/utils/enum"; import { DeliveryMethod, ScaleStatus } from "@/utils/enum";
const keyword = ref(""); const keyword = ref("");
const gridList1 = reactive([ const gridList1 = reactive([
@ -156,7 +156,7 @@ const gridList1 = reactive([
}, },
{ {
name: "作废人", name: "作废人",
enName: "updateUserName", enName: "updateName",
unit: "", unit: "",
isBefore: false, isBefore: false,
isCustomStyle: true, isCustomStyle: true,

View File

@ -20,10 +20,24 @@
><u-icon name="arrow-down"></u-icon ><u-icon name="arrow-down"></u-icon
></view> ></view>
<view @click="state.isShowStatus = true" <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>
<view @click="state.isShowSort = true" <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>
<view class="btn" @click="handleDialog('showFilter', true)">筛选</view> <view class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view> </view>
@ -92,8 +106,14 @@
<text v-if="cItem.name">{{ cItem.name }}</text <text v-if="cItem.name">{{ cItem.name }}</text
><text ><text
>{{ cItem.isBefore ? cItem.unit : "" }} >{{ cItem.isBefore ? cItem.unit : "" }}
<text v-if="item[cItem.enName as string] === DeliveryMethod.Deliver">送货</text> <text
<text v-if="item[cItem.enName as string] === DeliveryMethod.SelfPickup">自提</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 }} {{ cItem.isBefore ? "" : cItem.unit }}
</text> </text>
</block> </block>
@ -200,16 +220,20 @@ const state = reactive({
key: 2, key: 2,
}, },
{ {
name: "已审未付", name: "待结算",
key: 3, key: 3,
}, },
{ {
name: "已审已付", name: "已结算",
key: 4, key: 4,
}, },
], ],
isShowSort: false, isShowSort: false,
sortList: [ sortList: [
{
name: "全部",
key: undefined,
},
{ {
name: "按创建时间降序", name: "按创建时间降序",
key: "create_time", key: "create_time",
@ -334,9 +358,9 @@ const getScaleStatus = (type: number) => {
} else if (type === ScaleStatus.ToBeShipmentReview) { } else if (type === ScaleStatus.ToBeShipmentReview) {
return "待审核"; return "待审核";
} else if (type === ScaleStatus.ToBeShipmentPay) { } else if (type === ScaleStatus.ToBeShipmentPay) {
return "待支付"; return "待结算";
} else if (type === ScaleStatus.ShipmentPaid) { } else if (type === ScaleStatus.ShipmentPaid) {
return "已支付"; return "已结算";
} }
}; };

View File

@ -109,7 +109,7 @@ const update = (item: any) => {
const edit = (item: any) => { const edit = (item: any) => {
uni.navigateTo({ uni.navigateTo({
url: url:
"/pagesApp/components/addShipmentProduct?title=编辑货产品&item=" + "/pagesApp/components/addShipmentProduct?title=编辑货产品&item=" +
JSON.stringify(item), // JSON.stringify(item), //
}); });
}; };

View File

@ -541,6 +541,14 @@ const save = () => {
return; return;
} }
} }
if (parseFloat(model1.order.tare) > parseFloat(model1.order.grossWeight)) {
uni.showToast({
title: `毛重需大于皮重`,
icon: "none",
});
return;
}
check().then((res) => { check().then((res) => {
if (res) { if (res) {
startSave(); startSave();

View File

@ -30,7 +30,7 @@
<view <view
>{{ >{{
item.type === StockCardType.Shipment ? "客户" : "供应商" item.type === StockCardType.Shipment ? "客户" : "供应商"
}}{{ item.name }}</view }}{{ item.customUserName }}</view
> >
<view>卡号{{ item.cardCode }}</view> <view>卡号{{ item.cardCode }}</view>
<view <view

View File

@ -118,10 +118,11 @@ const update = (item: any) => {
}; };
const edit = (item: any) => { const edit = (item: any) => {
console.log(JSON.stringify(item))
uni.navigateTo({ uni.navigateTo({
url: url:
"/pagesApp/components/addSupplier?title=编辑供应商&item=" + "/pagesApp/components/addSupplier?title=编辑供应商&item=" +
JSON.stringify(item), // item.id, //
}); });
}; };
const getList = (v?: boolean) => { const getList = (v?: boolean) => {

View File

@ -165,7 +165,9 @@ import {
import TabBar from "@/components/TabBar/index.vue"; import TabBar from "@/components/TabBar/index.vue";
import { formatMoney } from "@/utils"; import { formatMoney } from "@/utils";
import { onBackPress, onShow } from "@dcloudio/uni-app"; import { onBackPress, onShow } from "@dcloudio/uni-app";
const store = useMemberStore(); import pinia from "@/store";
const store = useMemberStore(pinia);
const navbarRect = reactive({ const navbarRect = reactive({
height: 32, height: 32,
top: 28, top: 28,
@ -550,12 +552,17 @@ const init = () => {
}); });
}; };
onMounted(() => { onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN // #ifdef MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect(); let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
navbarRect.height = menuButtonInfo.height; navbarRect.height = menuButtonInfo.height;
navbarRect.top = menuButtonInfo.top; navbarRect.top = menuButtonInfo.top;
getSafeHeight(); getSafeHeight();
// #endif // #endif
// #ifndef MP-WEIXIN
const systemInfo = uni.getSystemInfoSync();
navbarRect.safeHeight = (systemInfo.safeArea as any).height;
getSafeHeight();
// #endif
}); });
onShow(() => { onShow(() => {
init(); init();

View File

@ -10,7 +10,9 @@
> >
<swiper-item v-for="(item, index) in list" :key="index"> <swiper-item v-for="(item, index) in list" :key="index">
<view class="image-box"> <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"> <view class="title">
{{ item.title }} {{ item.title }}
</view> </view>
@ -22,6 +24,10 @@
</swiper> </swiper>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useMemberStore } from "@/store/index";
const store = useMemberStore();
const profile = store.profile;
const list = [ const list = [
{ {
title: "智能回收 智慧未来!", title: "智能回收 智慧未来!",
@ -41,9 +47,16 @@ const list = [
}, },
]; ];
const start = () => { const start = () => {
// token
if (profile.token) {
uni.navigateTo({
url: "/pagesHome/index", //
});
} else {
uni.navigateTo({ uni.navigateTo({
url: "/pagesLogin/login/index", // url: "/pagesLogin/login/index", //
}); });
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -2,7 +2,7 @@
<view class="c-login-container"> <view class="c-login-container">
<!-- logo --> <!-- logo -->
<view class="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> </view>
<!-- form表单 --> <!-- form表单 -->
<view class="login-form"> <view class="login-form">
@ -16,13 +16,15 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.c-login-container { .c-login-container {
height: 80vh; height: 85vh;
margin-top: 20vh; margin-top: 15vh;
.logo { .logo {
text-align: center; text-align: center;
image { image {
width: 234.62rpx; // width: 234.62rpx;
height: 62.18rpx; // height: 62.18rpx;
width: 300rpx;
height: 100rpx;
} }
} }
.login-form { .login-form {

View File

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

View File

@ -116,13 +116,15 @@ import { ProfileApi } from "@/services/index";
import LoginLayout from "./components/loginLayout.vue"; import LoginLayout from "./components/loginLayout.vue";
import { useMemberStore } from "@/store/index"; import { useMemberStore } from "@/store/index";
import valid from "@/utils/validate"; import valid from "@/utils/validate";
import pinia from '@/store'
const handleClear = (item: any) => { const handleClear = (item: any) => {
setTimeout(() => { setTimeout(() => {
(model1.userInfo as any)[item.key] = ""; (model1.userInfo as any)[item.key] = "";
}, 100); }, 100);
}; };
const store = useMemberStore(); const store = useMemberStore(pinia);
const loginForm = ref(null); const loginForm = ref(null);
const model1 = reactive({ const model1 = reactive({
userInfo: { userInfo: {

View File

@ -1,14 +1,16 @@
<template> <template>
<view class="baseinfo"> <view class="baseinfo">
<view class="box"> <view class="box">
<view> 用户 {{ profile.userName }} </view> <view> {{ profile.userName }} </view>
<view> 手机号码 {{ profile.phone }} </view> <view> 手机号码 {{ profile.phone }} </view>
</view> </view>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useMemberStore } from '@/store/index' import { useMemberStore } from '@/store/index'
const store = useMemberStore() import pinia from '@/store'
const store = useMemberStore(pinia)
const profile = store.profile.userInfo const profile = store.profile.userInfo
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -67,6 +67,8 @@ import { useMemberStore } from "@/store/index";
import TabBar from "@/components/TabBar/index.vue"; import TabBar from "@/components/TabBar/index.vue";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
import Box from "@/components/Box/index.vue"; import Box from "@/components/Box/index.vue";
import pinia from '@/store'
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
@ -82,7 +84,7 @@ const handleOk = () => {
} }
}); });
}; };
const store = useMemberStore(); const store = useMemberStore(pinia);
const profile = store.profile.userInfo; const profile = store.profile.userInfo;
const list = reactive([ const list = reactive([
{ {
@ -113,7 +115,7 @@ const hanldeClick = (item: any) => {
.bg { .bg {
width: 100%; width: 100%;
position: absolute; position: absolute;
top: -60rpx; top: 0rpx;
z-index: -1; z-index: -1;
} }
.baseinfo { .baseinfo {

View File

@ -60,10 +60,14 @@
v-model="model1.order.fileLists" v-model="model1.order.fileLists"
@delete="handleDelete" @delete="handleDelete"
></uni-file-picker> ></uni-file-picker>
<!-- 当定价后编辑入库单 不能更改称重方式 -->
<u-radio-group <u-radio-group
v-if="item.type === 'radio'" v-if="item.type === 'radio'"
v-model="(model1.order as any)[item.key]" v-model="(model1.order as any)[item.key]"
placement="row" placement="row"
:disabled="
model1.order.scaleStatus === 1 && item.key === 'weighingMethod'
"
> >
<u-radio <u-radio
v-for="(c, index) in item.child" v-for="(c, index) in item.child"
@ -126,15 +130,15 @@ import {
SupplierApi, SupplierApi,
} from "@/services/index"; } from "@/services/index";
import _ from "underscore"; import _ from "underscore";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad, onShow } from "@dcloudio/uni-app";
import { ImagesType, OrderType } from "@/utils/enum"; import { ImagesType, OrderType } from "@/utils/enum";
import SupplierDialog from "../components/SupplierDialog.vue"; import SupplierDialog from "../components/SupplierDialog.vue";
import ProductDialog from "../components/ProductDialog.vue"; import ProductDialog from "../components/ProductDialog.vue";
import valid from "@/utils/validate"; import valid from "@/utils/validate";
import { countDots } from "@/utils"; import { countDots } from "@/utils";
const handleClear = (item:any) => { const handleClear = (item: any) => {
(model1.order as any)[item.key] = ''; (model1.order as any)[item.key] = "";
} };
// //
const showDialog = < const showDialog = <
{ {
@ -220,6 +224,7 @@ const model1 = reactive<{ order: Order }>({
fileLists: [], fileLists: [],
scaleStatus: 1, scaleStatus: 1,
netWeight: 0, netWeight: 0,
balanceTotalPrice: 0,
}, },
}); });
@ -287,7 +292,12 @@ const formAttrList = reactive<ComType>([
childKey: "userSelect", childKey: "userSelect",
required: true, required: true,
fn: () => { fn: () => {
// handleDialog("showSupplier", true); uni.navigateTo({
url:
"/pagesApp/components/addSupplier?title=编辑供应商&item=" +
model1.order.userId, //
});
uni.hideKeyboard(); uni.hideKeyboard();
}, },
}, },
@ -521,9 +531,14 @@ watch(
实际收入实际结算金额-运费-杂费 实际收入实际结算金额-运费-杂费
*/ */
if (model1.order.scaleStatus === 0) { if (model1.order.scaleStatus === 0) {
return return;
} }
model1.order.netWeight = parseFloat(((parseFloat(grossWeightNew as any) || 0) - (parseFloat(tareNew as any) || 0)).toFixed(2)); model1.order.netWeight = parseFloat(
(
(parseFloat(grossWeightNew as any) || 0) -
(parseFloat(tareNew as any) || 0)
).toFixed(2)
);
if (model1.order.buttonType === 0) { if (model1.order.buttonType === 0) {
if (model1.order.subtractNum) { if (model1.order.subtractNum) {
model1.order.netWeight = model1.order.netWeight =
@ -542,11 +557,11 @@ watch(
} }
); );
SupplierApi.getSupplierUserList({}).then((res) => { // SupplierApi.getSupplierUserList({}).then((res) => {
if (res.code === 200) { // if (res.code === 200) {
contrlModalParams.userSelect.list = res.data; // contrlModalParams.userSelect.list = res.data;
} // }
}); // });
ReceiveProductApi.getAllReProducts().then((res) => { ReceiveProductApi.getAllReProducts().then((res) => {
if (res.code === 200) { if (res.code === 200) {
contrlModalParams.productSelect.list = _.map( contrlModalParams.productSelect.list = _.map(
@ -646,7 +661,8 @@ const save = () => {
} }
if ( if (
model1.order.price && model1.order.price &&
model1.order.price.toString()[model1.order.price.toString().length - 1] === "." model1.order.price.toString()[model1.order.price.toString().length - 1] ===
"."
) { ) {
uni.showToast({ uni.showToast({
title: "请输入正确的单价", title: "请输入正确的单价",
@ -759,6 +775,7 @@ onLoad((option) => {
title: "编辑信息", title: "编辑信息",
}); });
} }
if (model1.order.id) { if (model1.order.id) {
ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => { ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
@ -793,6 +810,16 @@ onLoad((option) => {
} }
}); });
} }
uni.$on("pricingParams", (data) => {
model1.order.userName = data.name
});
});
onShow(() => {});
onUnmounted(() => {
uni.$off("pricingParams", () => {});
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -74,7 +74,9 @@
> >
</view> </view>
<view class="flex-box"> <view class="flex-box">
<text>货款金额{{ item.balanceTotalPrice || 0 }}</text> <!-- 若是等待审核显示预估总价 其他显示货款金额 -->
<text v-if="currentTab === 2">预估总价{{ item.totalPrice || 0 }}</text>
<text v-else>货款金额{{ item.balanceTotalPrice || 0 }}</text>
</view> </view>
</view> </view>
<view> <view>

View File

@ -17,9 +17,7 @@
<text class="address">{{ item.deviceName || "-" }}</text> <text class="address">{{ item.deviceName || "-" }}</text>
</view> </view>
<view> <view>
<text class="number" <text class="number">收货单号{{ item.receiptNumber }}</text>
>收货单号{{ item.receiptNumber }}</text
>
</view> </view>
<view> <view>
<text class="name">{{ item.userName }}</text> <text class="name">{{ item.userName }}</text>
@ -42,7 +40,11 @@
</view> </view>
<view class="flex-box"> <view class="flex-box">
<text>毛重{{ item.grossWeight }}kg</text> <text>毛重{{ item.grossWeight }}kg</text>
<text>单价{{ state.scaleStatus === 0 ? '未定价' : item.price + '元/KG'}}</text> <text
>单价{{
state.scaleStatus === 0 ? "未定价" : item.price + "元/KG"
}}</text
>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<u-button <u-button
@ -85,9 +87,16 @@ const pageList: PageResult<Order> = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}); });
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const state = reactive({ const state = reactive({
scaleStatus: 0 scaleStatus: 0,
}) });
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
const deleteId = ref(0); const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => { const handleModal = (v: boolean, id: number) => {
@ -100,9 +109,20 @@ const handleScenePhoto = (imagesId: number) => {
}); });
}; };
const pricingDetail = (id: number) => { const pricingDetail = (id: number) => {
//
ReceiveApi.getDetailById({ id: id }).then((res: any) => {
if (res.code === 200) {
if (res.data.scaleStatus > 1) {
uni.showToast({title : '当前订单已处理'});
resetPageList();
getList();
} else {
uni.redirectTo({ uni.redirectTo({
url: "/pagesReceive/form/pricingForm?id=" + id, // url: "/pagesReceive/form/pricingForm?id=" + id, //
}); });
}
}
});
}; };
const getList = (v?: boolean) => { const getList = (v?: boolean) => {
@ -146,11 +166,11 @@ onLoad((option) => {
// //
if (state.scaleStatus === ScaleStatus.ToBePriced) { if (state.scaleStatus === ScaleStatus.ToBePriced) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '待定价', title: "待定价",
}); });
} else if (state.scaleStatus === ScaleStatus.ToBeTare) { } else if (state.scaleStatus === ScaleStatus.ToBeTare) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '待过皮重', title: "待过皮重",
}); });
} }
}); });

View File

@ -97,7 +97,10 @@
<view @click="handleReviewNoPay"> 审核暂不支付 </view> <view @click="handleReviewNoPay"> 审核暂不支付 </view>
<view class="active" @click="handleReviewPay"> 审核立即支付 </view> <view class="active" @click="handleReviewPay"> 审核立即支付 </view>
</view> </view>
<view v-if="state.order.scaleStatus === 2"> <!-- 零皮重不需要重新过皮 -->
<view
v-if="state.order.scaleStatus === 2 && state.order.weighingMethod === 0"
>
<u-button <u-button
text="重新过皮" text="重新过皮"
plain plain
@ -122,6 +125,7 @@
text="打印" text="打印"
type="primary" type="primary"
:customStyle="{ 'border-radius': '43rpx' }" :customStyle="{ 'border-radius': '43rpx' }"
@click="handlePrint"
></u-button> ></u-button>
</view> </view>
</view> </view>
@ -163,10 +167,10 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ReceiveApi } from "@/services/index"; import { DeviceApi, ReceiveApi } from "@/services/index";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
import { ScaleStatus } from "@/utils/enum"; import { OrderType, ScaleStatus } from "@/utils/enum";
const keyword = ref(""); const keyword = ref("");
const contrlModalParams = reactive<{ [attrName: string]: any }>({ const contrlModalParams = reactive<{ [attrName: string]: any }>({
paySelect: { paySelect: {
@ -221,6 +225,7 @@ const state = reactive<{
}>({ }>({
order: { order: {
carNumber: "", carNumber: "",
balanceTotalPrice: 0,
}, },
sheetList: [ sheetList: [
{ {
@ -317,6 +322,7 @@ const handleConfirm = () => {
], ],
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
state.order.balanceTotalPrice = amount.value || 0;
uni.showToast({ title: "修改成功" }); uni.showToast({ title: "修改成功" });
gridList1[gridList1.length - 1].num = amount.value || ""; gridList1[gridList1.length - 1].num = amount.value || "";
isInput.value = false; isInput.value = false;
@ -384,6 +390,20 @@ const handleReWeight = () => {
} }
}); });
}; };
const handlePrint = () => {
DeviceApi.print({
id: state.order.id,
orderType: OrderType.Receive,
userId: state.order.deviceId
}).then((res) => {
if (res.code === 200) {
uni.showToast({
title: "打印成功",
})
}
});
};
onLoad((option) => { onLoad((option) => {
state.order.id = parseInt((option as any).id); state.order.id = parseInt((option as any).id);
state.scaleStatus = parseInt((option as any).scaleStatus); state.scaleStatus = parseInt((option as any).scaleStatus);

View File

@ -108,9 +108,9 @@ import {
} from "@/utils/enum"; } from "@/utils/enum";
import valid from "@/utils/validate"; import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
const handleClear = (item:any) => { const handleClear = (item: any) => {
(model1.order as any)[item.key] = ''; (model1.order as any)[item.key] = "";
} };
const isShowFormItem = (item: any) => { const isShowFormItem = (item: any) => {
if (model1.scaleStatusBtnType === ScaleStatusBtnType.ShipmentPay) { if (model1.scaleStatusBtnType === ScaleStatusBtnType.ShipmentPay) {
return true; return true;
@ -175,6 +175,8 @@ const model1 = reactive<{
unitPrice: 0, unitPrice: 0,
estimatePrice: 0, estimatePrice: 0,
subtractNum: 0, subtractNum: 0,
grossWeight: 0, //
tare: 0, //
}, },
}); });
const rules = reactive({ const rules = reactive({
@ -462,9 +464,9 @@ watch(
(model1.order.unitPrice || 0) * (model1.order.settlementWeight || 0) (model1.order.unitPrice || 0) * (model1.order.settlementWeight || 0)
).toFixed(2) ).toFixed(2)
); );
if (!model1.order.totalPrice) { // if (!model1.order.totalPrice) {
model1.order.totalPrice = model1.order.estimatePrice; // model1.order.totalPrice = model1.order.estimatePrice;
} // }
model1.order.realIncome = model1.order.realIncome =
(model1.order.totalPrice || 0) - (model1.order.totalPrice || 0) -
@ -562,6 +564,27 @@ const save = () => {
check().then((res) => { check().then((res) => {
if (res) { if (res) {
if (
!model1.order.paymentMethodName &&
model1.scaleStatusBtnType === ScaleStatusBtnType.ShipmentPay
) {
uni.showToast({
title: "请选择结算方式",
icon: "none",
});
return;
}
if (
parseFloat(model1.order.settlementTare.toString()) >
parseFloat(model1.order.settlementGross.toString())
) {
uni.showToast({
title: `毛重需大于皮重`,
icon: "none",
});
return;
}
startSave(); startSave();
} }
}); });

View File

@ -13,13 +13,13 @@
</view> </view>
</view> </view>
<view> <view>
<text class="btn" @click="handleScenePhoto((item.imagesId as number))" <text class="btn" @click="handleScenePhoto(item.imagesId as number)"
>现场照片</text >现场照片</text
> >
</view> </view>
</view> </view>
<view> <view>
<text class="desc">过磅时间{{ item.grossTime || '-' }}</text> <text class="desc">过磅时间{{ item.grossTime || "-" }}</text>
</view> </view>
<view class="flex-box"> <view class="flex-box">
<text>皮重{{ item.tare }}kg</text> <text>皮重{{ item.tare }}kg</text>
@ -29,12 +29,12 @@
text="点击作废" text="点击作废"
color="#E8E8E8" color="#E8E8E8"
:customStyle="{ color: '#999' }" :customStyle="{ color: '#999' }"
@click="handleModal(true, (item.id as any))" @click="handleModal(true, item.id as any)"
></u-button> ></u-button>
<u-button <u-button
type="primary" type="primary"
text="点击编辑" text="点击编辑"
@click="pricingDetail((item.id as any))" @click="pricingDetail(item.id as any)"
></u-button> ></u-button>
</view> </view>
</view> </view>
@ -53,18 +53,20 @@
import { ShipmentApi } from "@/services/index"; import { ShipmentApi } from "@/services/index";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
interface PageResult<T> { const pageList: PageResult<Order> = reactive({
total: number; noMoreData: false,
list: T[];
pageNum: number;
pageSize: number;
}
const pageList: PageResult<Shipment> = reactive({
total: 0, total: 0,
list: [], list: [],
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}); });
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
const deleteId = ref(0); const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => { const handleModal = (v: boolean, id: number) => {
@ -77,28 +79,57 @@ const handleScenePhoto = (imagesId: number) => {
}); });
}; };
const pricingDetail = (id: string) => { const pricingDetail = (id: string) => {
//
debugger
ShipmentApi.getDetailById({ id: id }).then((res: any) => {
if (res.code === 200) {
if (res.data.scaleStatus > 1) {
uni.showToast({ title: "当前订单已处理" });
resetPageList();
getList();
} else {
uni.navigateTo({ uni.navigateTo({
url: "/pagesShipment/form/shipmentForm?id=" + id, // url: "/pagesShipment/form/shipmentForm?id=" + id, //
}); });
}
}
});
}; };
const getOrderList = () => {
ShipmentApi.getOrderPage({ pageNumber: 1, pageSize: 10, scaleStatus: 1 }).then((res) => { const getList = (v?: boolean) => {
if (v) {
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
pageList.pageNum++;
} else {
pageList.noMoreData = true;
return;
}
}
let params: any = {
pageSize: pageList.pageSize,
pageNumber: pageList.pageNum,
scaleStatus: 1,
};
pageList.isLoading = true;
ShipmentApi.getOrderPage(params).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
(pageList as any).list = res.data.list; pageList.isLoading = false;
(pageList as any).list = pageList.list.concat(res.data.list);
pageList.total = (res.data as any).total;
} }
}); });
}; };
const handleOk = () => { const handleOk = () => {
console.log(deleteId.value); console.log(deleteId.value);
ShipmentApi.deleteOrder({ids:[deleteId.value]}).then((res) => { ShipmentApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
getOrderList(); getList();
} }
}); });
}; };
onMounted(() => { onMounted(() => {
getOrderList(); getList();
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -20,7 +20,7 @@
></view> ></view>
<view <view
><u-tag ><u-tag
text="货单作废" text="货单作废"
plain plain
shape="circle" shape="circle"
:borderColor="'rgba(255, 147, 68, 1) !important'" :borderColor="'rgba(255, 147, 68, 1) !important'"
@ -155,6 +155,7 @@
" "
> >
<u-button <u-button
v-if="!state.order.repairFlag"
text="重新过毛" text="重新过毛"
plain plain
:customStyle="{ :customStyle="{
@ -179,6 +180,7 @@
text="打印" text="打印"
type="primary" type="primary"
:customStyle="{ 'border-radius': '43rpx' }" :customStyle="{ 'border-radius': '43rpx' }"
@click="handlePrint"
></u-button> ></u-button>
</view> </view>
</view> </view>
@ -206,8 +208,8 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ShipmentApi } from "@/services/index"; import { DeviceApi, ShipmentApi } from "@/services/index";
import { ScaleStatusBtnType } from "@/utils/enum"; import { OrderType, ScaleStatusBtnType } from "@/utils/enum";
import { onLoad, onShow } from "@dcloudio/uni-app"; import { onLoad, onShow } from "@dcloudio/uni-app";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
const payMethodMap: any = { const payMethodMap: any = {
@ -474,7 +476,7 @@ const handleSettlement = () => {
}; };
const handleScenePhoto = (id: string) => { const handleScenePhoto = (id: string) => {
uni.navigateTo({ uni.navigateTo({
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, // url: "/pagesScenePhoto/index?orderType=2&imagesType=1&id=" + id, //
}); });
}; };
// // 3 // // 3
@ -584,9 +586,22 @@ const init = () => {
} }
}); });
} }
} };
const handlePrint = () => {
DeviceApi.print({
id: state.order.id,
orderType: OrderType.Shipment,
userId: state.order.deviceId
}).then((res) => {
if (res.code === 200) {
uni.showToast({
title: "打印成功",
})
}
});
};
onShow(() => { onShow(() => {
init() init();
}); });
onLoad((option) => { onLoad((option) => {
state.order.id = (option as any).id; state.order.id = (option as any).id;
@ -596,7 +611,7 @@ onLoad((option) => {
console.log(data); console.log(data);
state.order.id = data.id; state.order.id = data.id;
state.scaleStatusBtnType = data.scaleStatusBtnType; state.scaleStatusBtnType = data.scaleStatusBtnType;
init() init();
}); });
}); });
onUnmounted(() => { onUnmounted(() => {

View File

@ -123,6 +123,7 @@
import { ShipmentApi } from "@/services/index"; import { ShipmentApi } from "@/services/index";
import { ScaleStatus, ScaleStatusBtnType } from "@/utils/enum"; import { ScaleStatus, ScaleStatusBtnType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import { onShow } from "@dcloudio/uni-app";
import PageView from "@/components/PageView/index.vue"; import PageView from "@/components/PageView/index.vue";
// scaleStatus // scaleStatus
const pageList: PageResult<Shipment> = reactive({ const pageList: PageResult<Shipment> = reactive({
@ -251,7 +252,8 @@ const getList = (v?: boolean) => {
} }
}); });
}; };
onMounted(() => { onShow(() => {
resetPageList()
getList(); getList();
}); });
onLoad((option) => { onLoad((option) => {

View File

@ -102,9 +102,21 @@ const handleScenePhoto = (id: any) => {
}); });
}; };
const pricingDetail = (id: string) => { const pricingDetail = (id: string) => {
console.log(state.scaleStatus) ShipmentApi.getDetailById({ id: id }).then((res: any) => {
if (res.code === 200) {
if (res.data.scaleStatus > 1) {
uni.showToast({ title: "当前订单已处理" });
resetPageList();
getList();
} else {
uni.navigateTo({ uni.navigateTo({
url: "/pagesShipment/form/shipmentForm?id=" + id + `&scaleStatus=${state.scaleStatus}`, // url:
"/pagesShipment/form/shipmentForm?id=" +
id +
`&scaleStatus=${state.scaleStatus}`, //
});
}
}
}); });
}; };
const getList = (v?: boolean) => { const getList = (v?: boolean) => {
@ -124,9 +136,7 @@ const getList = (v?: boolean) => {
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
pageList.isLoading = false; pageList.isLoading = false;
(pageList as any).list = ( (pageList as any).list = (pageList as any).list.concat(res.data.list);
pageList as any
).list.concat(res.data.list);
pageList.total = (res.data as any).total; pageList.total = (res.data as any).total;
} }
}); });
@ -146,19 +156,19 @@ onShow(() => {
}); });
const state = reactive({ const state = reactive({
scaleStatus: 0 scaleStatus: 0,
}) });
onLoad((option) => { onLoad((option) => {
// //
state.scaleStatus = parseInt((option as any).scaleStatus); state.scaleStatus = parseInt((option as any).scaleStatus);
// //
if (state.scaleStatus === ScaleStatus.ToBeShipment) { if (state.scaleStatus === ScaleStatus.ToBeShipment) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '待出货', title: "待出货",
}); });
} else if (state.scaleStatus === ScaleStatus.ToBeGrossWeight) { } else if (state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '待过毛重', title: "待过毛重",
}); });
} }
}); });

View File

@ -1,46 +1,54 @@
import { http } from '@/utils/http' import { http } from "@/utils/http";
// 设备信息新增 // 设备信息新增
export const addDevice = (data: any) => { export const addDevice = (data: any) => {
return http({ return http({
method: 'POST', method: "POST",
url: '/api/device/addDevice', url: "/api/device/addDevice",
data, data,
}) });
} };
// 设备信息修改 // 设备信息修改
export const editDevice = (data: any) => { export const editDevice = (data: any) => {
return http({ return http({
method: 'POST', method: "POST",
url: '/api/device/edit', url: "/api/device/edit",
data, data,
}) });
} };
// 设备信息逻辑删除 // 设备信息逻辑删除
export const deleteDevice = (data: any) => { export const deleteDevice = (data: any) => {
return http({ return http({
method: 'POST', method: "POST",
url: '/api/device/deleteDevice', url: "/api/device/deleteDevice",
data, data,
}) });
} };
// 设备信息根据id查询 // 设备信息根据id查询
export const selectDeviceId = (data: any) => { export const selectDeviceId = (data: any) => {
return http({ return http({
method: 'POST', method: "POST",
url: '/api/device/selectDeviceId', url: "/api/device/selectDeviceId",
data, data,
}) });
} };
// 设备信息根据id查询 // 设备信息根据id查询
export const getDeviceList = (data: any) => { export const getDeviceList = (data: any) => {
return http({ return http({
method: 'POST', method: "POST",
url: '/api/device/getDeviceList', url: "/api/device/getDeviceList",
data, data,
}) });
} };
// 打印
export const print = (data: any) => {
return http({
method: "POST",
url: "/api/machine/print",
data,
});
};

11
src/types/order.d.ts vendored
View File

@ -113,9 +113,9 @@ interface Shipment {
carNumber?: string; //车牌号 carNumber?: string; //车牌号
scaleStatus?: number; //出库单状态 scaleStatus?: number; //出库单状态
orderNumber?: string; //订单编号 orderNumber?: string; //订单编号
grossWeight?: number; //毛重 grossWeight: number; //毛重
grossTime?: string; //过毛时间 grossTime?: string; //过毛时间
tare?: number; //皮重 tare: number; //皮重
tareTime?: string; //过皮时间 tareTime?: string; //过皮时间
netWeight?: number; //净重 netWeight?: number; //净重
number?: number; //数量 number?: number; //数量
@ -144,8 +144,8 @@ interface Shipment {
updateTime?: string; //undefined updateTime?: string; //undefined
isDeleted?: string; //删除标识true删除false未删除 isDeleted?: string; //删除标识true删除false未删除
settlementWeight?: number; // 结算重量 settlementWeight?: number; // 结算重量
settlementGross?: number; // 结算毛重 settlementGross: number; // 结算毛重
settlementTare?: number; // 结算皮重 settlementTare: number; // 结算皮重
settlementNet?: number; // 结算净重 settlementNet?: number; // 结算净重
signTime?: string; // 签收时间 signTime?: string; // 签收时间
paymentMethod?: string; //支付方式0:未支付,1:现金支付2银行卡支付3线上支付微信4支付宝 paymentMethod?: string; //支付方式0:未支付,1:现金支付2银行卡支付3线上支付微信4支付宝
@ -211,5 +211,6 @@ interface StockCard {
cardCode?: string, cardCode?: string,
type?: number, // 库存卡类型1=出库2=入库 type?: number, // 库存卡类型1=出库2=入库
cardCode?: string, cardCode?: string,
name?: string name?: string,
customUserName?:string
} }

View File

@ -1,5 +1,6 @@
import { useMemberStore } from "@/store/modules/member"; import { useMemberStore } from "@/store/modules/member";
import ENV_CONFIG from "../config/env"; import ENV_CONFIG from "../config/env";
import pinia from '@/store'
// 基础地址 // 基础地址
let baseUrl = ""; let baseUrl = "";
@ -10,7 +11,7 @@ let baseUrl = "";
baseUrl = (process.env as any).config[(process.env as any).NODE_ENV] baseUrl = (process.env as any).config[(process.env as any).NODE_ENV]
.VITE_APP_BASE_URL; .VITE_APP_BASE_URL;
const store = useMemberStore(); const store = useMemberStore(pinia);
const obj = { const obj = {
// 拦截前触发 // 拦截前触发

View File

@ -4,9 +4,10 @@ import AutoImport from "unplugin-auto-import/vite";
import path from "path"; // 引入pnpm install @types/node --save-dev import path from "path"; // 引入pnpm install @types/node --save-dev
import ENV_CONFIG from "./src/config/env"; import ENV_CONFIG from "./src/config/env";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
// process.env.NODE_ENV === "development"
export default defineConfig({ export default defineConfig({
build: { build: {
sourcemap: process.env.NODE_ENV === "development", sourcemap: false,
}, },
define: { define: {
"process.env.config": ENV_CONFIG, "process.env.config": ENV_CONFIG,