Compare commits

..

11 Commits

Author SHA1 Message Date
admin 447d9ab591 update: 新增收货产品价格比较 2024-06-07 10:49:08 +08:00
admin a2eaa00117 update: 1.支付明细 收入明细 系统数据不可删除 2.出货批量审核优化 2024-06-07 09:35:36 +08:00
admin ebd6e37efa update:
1. 账单详情  出货结算 付款审核 客户列表 库存卡对应的分页
2. 定价单:预估总价显示问题 当为待审核是不用判断是否为补单数据
3. 上传对应的接口url更新
2024-06-06 16:47:00 +08:00
admin 6725ac0f3f update: 付款审核tab切换 全选重置 2024-06-05 15:58:21 +08:00
admin a896baaa35 update: ordertype 类型优化 2024-06-05 13:44:33 +08:00
admin e99c77e58e update: 网络请求更新 2024-06-04 10:35:28 +08:00
admin 87bd3b0544 update: 细节优化 2024-06-04 09:50:18 +08:00
admin 4b4c39ae5a update: 结算部分优化 2024-05-31 14:30:23 +08:00
admin b4f15aeb8b update: 兼容性优化 2024-05-30 15:15:03 +08:00
admin 509476fbce update: 细节优化 2024-05-30 10:07:35 +08:00
admin e86e17b7c9 update: 细节优化 2024-05-23 13:37:29 +08:00
36 changed files with 498 additions and 206 deletions

View File

@ -1,19 +1,21 @@
<script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
const isFirstLaunch = ref(true);
// 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" });
}
// console.log(Boolean(uni.getStorageSync("hasLaunched")))
// //
// if (Boolean(uni.getStorageSync("hasLaunched"))) {
// //
// isFirstLaunch.value = false;
// console.log("");
// } else {
// //
// uni.redirectTo({ url: "pagesLaunch/index" });
// uni.setStorageSync("hasLaunched", true);
// console.log('******* ')
// }
});
onShow(() => {
console.log("App Show");

View File

@ -26,7 +26,9 @@
<view
>{{ state.type === "1" ? "应付" : "应收" }}金额<text class="num"
>¥{{
state.type === "1" ? formatMoney(item.balanceTotalPrice) : formatMoney(item.totalPrice)
state.type === "1"
? formatMoney(item.balanceTotalPrice)
: formatMoney(item.totalPrice)
}}</text
></view
>
@ -85,22 +87,25 @@ const getList = (v?: boolean) => {
ReceiveApi.getOrderPage(params).then((res) => {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = (res.data.list as any).map((item: any) => {
return { ...item, isChecked: false };
});
pageList.list = pageList.list.concat(
res.data.list.map((item: any) => {
return { ...item, isChecked: false };
})
);
pageList.total = (res.data as any).total;
}
});
} else if (state.type === "2") {
ShipmentApi.getOrderPage(params).then((res) => {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = (res.data.list as any).map((item: any) => {
return { ...item, isChecked: false };
});
pageList.list = pageList.list.concat(
res.data.list.map((item: any) => {
return { ...item, isChecked: false };
})
);
pageList.total = (res.data as any).total;
}
});
}

View File

@ -79,12 +79,9 @@ const handleSelect = (item: any) => {
};
const getList = () => {
if (props.isShipment) {
GoodsApi.getChildrenList().then((res) => {
if (res.code === 200) {
if (res.code === 200) {
state.list = res.data;
}
state.list = res.data;
}
});
} else {

View File

@ -49,7 +49,6 @@ const props = defineProps<{
}>();
const emit = defineEmits(["handleDialog", "changeProduct"]);
const handleClose = () => {
debugger
emit("handleDialog", false);
};

View File

@ -157,7 +157,7 @@ const gridList2 = reactive([
]);
const handleScenePhoto = (id: string) => {
uni.navigateTo({
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, //
url: "/pagesScenePhoto/index?orderType=2&imagesType=1&id=" + id, //
});
};
const state = reactive<any>({

View File

@ -19,8 +19,8 @@ const props = withDefaults(
}
);
const navbarRect = reactive({
height: 32,
top: 28,
height: 42,
top: 48,
safeHeight: 500,
});
const getSafeHeight = () => {

View File

@ -67,8 +67,8 @@ const props = withDefaults(
);
const navbarRect = reactive({
height: 32,
top: 28,
height: 42,
top: 48,
msgCount: 10,
});
onMounted(() => {

View File

@ -15,8 +15,8 @@
</template>
<script setup lang="ts">
const navbarRect = reactive({
height: 32,
top: 28,
height: 42,
top: 48,
msgCount: 10,
});

View File

@ -3,7 +3,7 @@ const development = {
// VITE_APP_BASE_URL: 'http://47.100.31.83:8081',
// VITE_APP_BASE_URL: 'https://47.100.31.83:8081',
// appid: '',
VITE_APP_BASE_URL: 'https://ifanda.52zaisheng.cn/prod',
VITE_APP_BASE_URL: 'https://cloud.52zaisheng.cn',
appid: 'wx9251d74fe0e87028',
}
@ -13,7 +13,7 @@ const test = {
}
const production = {
VITE_APP_BASE_URL: 'https://ifanda.52zaisheng.cn/prod',
VITE_APP_BASE_URL: 'https://cloud.52zaisheng.cn',
appid: 'wx9251d74fe0e87028',
}

View File

@ -4,11 +4,13 @@
"appid" : "__UNI__898003A",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"versionCode" : 100,
"transformPx" : false,
/* 5+App */
"app-plus" : {
"ignoreVersion": false,
"compatible" : {
"ignoreVersion" : true
},
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,

View File

@ -83,8 +83,10 @@ const handleInput = (e: any, item: any) => {
icon: "none",
});
}
const minPrice = parseFloat(model1.formData.minPrice)
const maxPrice = parseFloat(model1.formData.maxPrice)
if (item.key === "maxPrice") {
if (model1.formData.minPrice > model1.formData.maxPrice) {
if (minPrice > maxPrice) {
uni.showToast({
title: `${item.name}应小于${model1.formData.maxPrice}`,
icon: "none",
@ -93,10 +95,10 @@ const handleInput = (e: any, item: any) => {
}
}
if (item.key === "commonPrice") {
if (model1.formData.minPrice > -1 && model1.formData.maxPrice > -1) {
if (minPrice > -1 && maxPrice > -1) {
if (
temp < model1.formData.minPrice ||
temp > model1.formData.maxPrice
!(temp >= minPrice &&
temp <= maxPrice)
) {
uni.showToast({
title: `${item.name}应在${model1.formData.minPrice}-${model1.formData.maxPrice}之间`,
@ -253,16 +255,20 @@ const check = () => {
};
const save = () => {
if (model1.formData.minPrice > model1.formData.maxPrice) {
const minPrice = parseFloat(model1.formData.minPrice)
const maxPrice = parseFloat(model1.formData.maxPrice)
if (minPrice > maxPrice) {
uni.showToast({
title: `最低价应小于${model1.formData.maxPrice}`,
icon: "none",
});
return;
}
if (model1.formData.minPrice > -1 && model1.formData.maxPrice > -1) {
if (minPrice > -1 &&maxPrice > -1) {
const temp = model1.formData.commonPrice;
if (temp < model1.formData.minPrice || temp > model1.formData.maxPrice) {
if (!(temp >= minPrice && temp <= maxPrice)) {
uni.showToast({
title: `常用价格应在${model1.formData.minPrice}-${model1.formData.maxPrice}之间`,
icon: "none",
@ -270,7 +276,6 @@ const save = () => {
return;
}
}
console.log(model1.formData);
check().then((res) => {
if (res) {
startSave();

View File

@ -65,7 +65,7 @@ const handleModal = (v: boolean, id: number) => {
deleteId.value = id;
};
const handleOk = () => {
deleteCustomer({id: deleteId.value})
deleteCustomer({ id: deleteId.value });
};
const state = reactive<any>({
name: "",
@ -125,16 +125,16 @@ const getList = (v?: boolean) => {
params.supplierTypeId = state.supplierTypeId;
}
pageList.isLoading = true;
CustomerApi.getCustomUserPage(params).then((res) => {
CustomerApi.getCustomUserPage(params).then((res: any) => {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = (res.data as any).list;
pageList.total = (res.data as any).total;
pageList.list = pageList.list = pageList.list.concat(res.data.list);
pageList.total = res.data.total;
}
});
};
onShow(() => {
resetPageList()
resetPageList();
getList();
});
</script>

View File

@ -50,6 +50,7 @@
<u-swipe-action-item
:options="options1"
v-for="(item, index) in pageList.list"
:disabled="[1].indexOf(item.paymentType) === -1"
:key="index"
@click="handleItem(item)"
>

View File

@ -45,6 +45,7 @@
<u-swipe-action-item
:options="options1"
v-for="(item, index) in pageList.list"
:disabled="[2,3].indexOf(item.paymentType) === -1"
:key="index"
@click="handleItem(item)"
>

View File

@ -40,7 +40,8 @@
<view class="type">{{ item.productName }}</view>
<view class="flex-box">
<text>定价人{{ item.pricingUserName }}</text>
<text>过磅时间{{ item.tareTime }}</text>
<!-- 过毛时间 -->
<text>过磅时间{{ item.grossTime }}</text>
</view>
<view class="more">

View File

@ -496,7 +496,6 @@ const handleUpload = () => {
const handleSelect = (key: string, v: any) => {
contrlModalParams[key].isShow = false;
if (key === "user") {
debugger;
model1.order.userName = v.name;
model1.order.userId = v.id;
} else if (key === "product") {

View File

@ -25,15 +25,19 @@
:isLoading="pageList.isLoading"
>
<view class="box">
<view v-for="(item, index) in pageList.list" :key="index">
<view>
<view>{{ item.roleName }}</view>
<block v-for="(item, index) in pageList.list" :key="index">
<view v-if="item.roleName !== '超级管理员'">
<view>
<view>{{ item.roleName }}</view>
</view>
<view class="op-box">
<view class="btn" @click="edit(item)"> 编辑 </view>
<view class="btn" @click="handleModal(true, item.id)">
删除
</view>
</view>
</view>
<view class="op-box">
<view class="btn" @click="edit(item)"> 编辑 </view>
<view class="btn" @click="handleModal(true, item.id)"> 删除 </view>
</view>
</view>
</block>
</view>
</page-view>
</view>
@ -60,7 +64,7 @@ const handleModal = (v: boolean, id: number) => {
deleteId.value = id;
};
const handleOk = () => {
deleteRole({id: deleteId.value})
deleteRole({ id: deleteId.value });
};
const state = reactive<any>({
@ -68,7 +72,7 @@ const state = reactive<any>({
});
const pageList: PageResult<{
roleName: string;
id: number
id: number;
}> = reactive({
noMoreData: false,
total: 0,
@ -98,13 +102,13 @@ const edit = (item: any) => {
const deleteRole = (item: any) => {
ProfileApi.updateRole({ isDeleted: true, id: item.id }).then((res) => {
if (res.code === 200) {
resetPageList()
resetPageList();
getList();
}
});
};
const handleSearch = () => {
resetPageList()
resetPageList();
getList();
};
const getList = (v?: boolean) => {
@ -122,16 +126,14 @@ const getList = (v?: boolean) => {
pageList.isLoading = true;
ProfileApi.getRoleList(params).then((res) => {
if (res.code === 200) {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = res.data as any;
}
pageList.isLoading = false;
(pageList as any).list = res.data as any;
}
});
};
onShow(() => {
resetPageList()
resetPageList();
getList();
});
</script>

View File

@ -171,7 +171,7 @@ const gridList1 = reactive([
]);
const handleScenePhoto = (id: string) => {
uni.navigateTo({
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, //
url: "/pagesScenePhoto/index?orderType=2&imagesType=1&id=" + id, //
});
};

View File

@ -347,7 +347,7 @@ const gridList1 = reactive([
]);
const handleScenePhoto = (id: string) => {
uni.navigateTo({
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, //
url: "/pagesScenePhoto/index?orderType=2&imagesType=1&id=" + id, //
});
};
const getScaleStatus = (type: number) => {

View File

@ -71,7 +71,7 @@ const handleModal = (v: boolean, id: number) => {
deleteId.value = id;
};
const handleOk = () => {
deleteStockCard({id: deleteId.value})
deleteStockCard({ id: deleteId.value });
};
const state = reactive<any>({
@ -131,17 +131,18 @@ const getList = (v?: boolean) => {
if (state.supplierTypeId > -1) {
params.supplierTypeId = state.supplierTypeId;
}
StockCardApi.getStockCardList(params).then((res) => {
pageList.isLoading = true;
StockCardApi.getStockCardList(params).then((res: any) => {
if (res.code === 200) {
if (res.code === 200) {
(pageList as any).list = (res.data as any).list;
}
pageList.isLoading = false;
pageList.list = pageList.list = pageList.list.concat(res.data.list);
pageList.total = res.data.total;
}
});
};
onShow(() => {
resetPageList()
resetPageList();
getList();
});
</script>

View File

@ -169,8 +169,8 @@ import pinia from "@/store";
const store = useMemberStore(pinia);
const navbarRect = reactive({
height: 32,
top: 28,
height: 42,
top: 48,
safeHeight: 500,
});
@ -393,7 +393,7 @@ const appList = reactive([
},
},
{
icon: "09.png",
icon: "11.png",
title: "收货产品",
fn: () => {
uni.navigateTo({
@ -411,7 +411,7 @@ const appList = reactive([
},
},
{
icon: "11.png",
icon: "09.png",
title: "出货产品",
fn: () => {
uni.navigateTo({
@ -565,7 +565,21 @@ onMounted(() => {
// #endif
});
onShow(() => {
init();
if (store.profile?.token) {
init();
} else {
//
if (Boolean(uni.getStorageSync("hasLaunched"))) {
//
uni.reLaunch({
url: "/pagesLogin/login/index",
});
} else {
//
uni.setStorageSync("hasLaunched", true);
uni.reLaunch({ url: "/pagesLaunch/index" });
}
}
});
</script>
@ -656,7 +670,7 @@ onShow(() => {
// display: flex;
// align-items: center;
position: relative;
top: 50%;
// top: 50%;
// transform: translateY(-50%);
.num {
font-size: 32rpx;

View File

@ -1,5 +1,5 @@
<template>
<NavBar :count="0" :title="'登'"></NavBar>
<NavBar :count="0" :title="'登'"></NavBar>
<LoginLayout>
<template #form-box>
<u-form
@ -9,6 +9,23 @@
ref="loginForm"
:labelWidth="0"
>
<u-form-item prop="userInfo.dpName" @click="state.isShow = true">
<u-input
v-model="model1.userInfo.dpName"
:placeholder="`请选择基地名称`"
clearable
:customStyle="{}"
border="none"
:disabledColor="''"
:disabled="true"
>
<!-- @change="(e:any) => {handleInput(e, item)}"
@clear="handleClear(item)" -->
</u-input>
<template #right>
<u-icon name="arrow-right" color="#dadbde"></u-icon>
</template>
</u-form-item>
<u-form-item prop="userInfo.userName">
<u-input
v-model="model1.userInfo.userName"
@ -19,10 +36,11 @@
'border-color':
currentFocus === 'userName' ? '#00dcee !important' : '',
}"
border="none"
type="number"
@focus="handleFocus('userName')"
@change="(e:any) => {handleInput(e, 'userName')}"
@clear="handleClear({key: 'userName'})"
@clear="handleClear({ key: 'userName' })"
>
</u-input>
</u-form-item>
@ -37,10 +55,11 @@
'border-color':
currentFocus === 'password' ? '#00dcee !important' : '',
}"
border="none"
@focus="handleFocus('password')"
clearable
@change="(e:any) => {handleInput(e, 'password')}"
@clear="handleClear({key: 'password'})"
@clear="handleClear({ key: 'password' })"
>
<template #suffix>
<image
@ -109,6 +128,15 @@
</view>
</template>
</LoginLayout>
<u-action-sheet
:actions="state.dpList"
:title="'基地名称'"
:show="state.isShow"
@select="(v: any) => handleSelect(v)"
@close="state.isShow = false"
:closeOnClickAction="true"
></u-action-sheet>
</template>
<script setup lang="ts">
@ -116,8 +144,7 @@ import { ProfileApi } from "@/services/index";
import LoginLayout from "./components/loginLayout.vue";
import { useMemberStore } from "@/store/index";
import valid from "@/utils/validate";
import pinia from '@/store'
import pinia from "@/store";
const handleClear = (item: any) => {
setTimeout(() => {
@ -130,6 +157,7 @@ const model1 = reactive({
userInfo: {
userName: "",
password: "",
dpName: "",
},
});
// focus
@ -143,6 +171,12 @@ const checkGroup = reactive({
});
const rules = ref({
"userInfo.dpName": {
type: "string",
required: true,
message: "请选择基地名称",
trigger: ["blur", "change"],
},
"userInfo.userName": {
type: "string",
required: true,
@ -206,7 +240,7 @@ const submit = () => {
ProfileApi.loginByAccount(model1.userInfo).then((res: any) => {
if (res.code === 200) {
store.setProfile(res.data);
uni.navigateTo({
uni.reLaunch({
url: "/pagesHome/index", //
});
}
@ -258,9 +292,36 @@ const openDoc = (item: string) => {
// },
// });
};
const handleSelect = (v: any) => {
state.isShow = false;
state.dpObj = v;
model1.userInfo.dpName = v.name;
console.log(v.dbIp);
store.setChildPath(v.dbIp);
};
const state = reactive({
dpList: [],
isShow: false,
dpObj: {},
});
//
ProfileApi.getDbInfo({}).then((res) => {
if (res.code === 200) {
state.dpList = res.data.map((item: any) => {
return { name: item.dbName, ...item };
});
}
});
</script>
<style lang="scss" scoped>
::v-deep .u-form-item__body__right__content {
border-radius: 100px;
border: 1px solid #dadbde;
}
.custom-icon {
width: 37.18rpx;
height: 18.59rpx;

View File

@ -551,9 +551,14 @@ watch(
}
}
model1.order.totalPrice =
(model1.order.price || 0) * (model1.order.netWeight || 0);
Math.round(
(model1.order.price || 0) * (model1.order.netWeight || 0) * 100
) / 100;
// =
model1.order.balanceTotalPrice = model1.order.totalPrice;
if (<number>model1.order.balanceTotalPrice <= 0) {
model1.order.balanceTotalPrice = model1.order.totalPrice;
}
}
);
@ -562,16 +567,16 @@ watch(
// contrlModalParams.userSelect.list = res.data;
// }
// });
ReceiveProductApi.getAllReProducts().then((res) => {
if (res.code === 200) {
contrlModalParams.productSelect.list = _.map(
res.data as any,
function (item: any) {
return { name: item.reProductsName, ...item };
}
);
}
});
// ReceiveProductApi.getAllReProducts().then((res) => {
// if (res.code === 200) {
// contrlModalParams.productSelect.list = _.map(
// res.data as any,
// function (item: any) {
// return { name: item.reProductsName, ...item };
// }
// );
// }
// });
const handleSelect = (key: string, v: any) => {
contrlModalParams[key].isShow = false;
if (key === "userSelect") {
@ -590,7 +595,6 @@ const handleBack = () => {
// const files = ref<FileObj[]>([]);
const filesRef = ref();
const handleUpload = () => {
// console.log(event.tempFilePaths)
return filesRef.value[0].filesList.map((item: any, index: number) => {
if (item.fileID) {
return;
@ -621,7 +625,6 @@ const handleUpload = () => {
*
*/
const handleDelete = (e: any) => {
console.log(model1.order.fileLists);
if (e.tempFile.fileID) {
PictureApi.deleteById({ id: e.tempFile.fileID }).then((res) => {
if (res.code === 200) {
@ -703,9 +706,14 @@ const save = () => {
};
const startSave = () => {
Promise.all(handleUpload()).then((res) => {
console.log("***** 所有文件已经上传成功", res);
if (res.filter((item) => item).length > 0) {
PictureApi.addListAnnex({ annexPos: res.filter((item) => item) }).then(
(res1) => {
console.log(
"***** 关联的内容是",
res.filter((item) => item)
);
if (res1.code === 200) {
console.log("*** 资源文件更新成功");
}
@ -724,11 +732,14 @@ const updateOrder = () => {
零皮重 scaleState = 2 带审核
*/
//
if (!model1.order.repairFlag) {
if (model1.order.weighingMethod === 0) {
model1.order.scaleStatus = 1;
} else if (model1.order.weighingMethod === 1) {
model1.order.scaleStatus = 2;
//
if (<number>model1.order.scaleStatus < 2) {
if (!model1.order.repairFlag) {
if (model1.order.weighingMethod === 0) {
model1.order.scaleStatus = 1;
} else if (model1.order.weighingMethod === 1) {
model1.order.scaleStatus = 2;
}
}
}
@ -802,7 +813,7 @@ onLoad((option) => {
});
PictureApi.getAnnex({
businessId: model1.order.id.toString(),
orderType: 1,
orderType: OrderType.Receive,
imagesType: ImagesType.NORMARL,
}).then((res) => {
if (res.code === 200) {
@ -812,7 +823,7 @@ onLoad((option) => {
}
uni.$on("pricingParams", (data) => {
model1.order.userName = data.name
model1.order.userName = data.name;
});
});

View File

@ -210,6 +210,7 @@ const resetPageList = () => {
};
const currentTab = ref(2);
const handleTab = (item: any) => {
state.isAll = false;
currentTab.value = item.key;
resetPageList();
getList();
@ -288,12 +289,14 @@ const getList = (v?: boolean) => {
pageNumber: pageList.pageNum,
scaleStatus: currentTab.value,
userName: keyword.value
}).then((res) => {
}).then((res:any) => {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = (res.data.list as any).map((item: any) => {
return { ...item, isChecked: false };
});
pageList.list = pageList.list.concat(
res.data.list.map((item: any) => {
return { ...item, isChecked: false };
})
);
pageList.total = (res.data as any).total;
}
});

View File

@ -151,6 +151,7 @@ const getList = (v?: boolean) => {
const handleOk = () => {
ReceiveApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
if (res.code === 200) {
resetPageList();
getList();
}
});

View File

@ -299,7 +299,9 @@ const handleScenePhoto = (id: any) => {
};
// // 3
const handleReviewNoPay = () => {
ReceiveApi.updateOne({ ...state.order, scaleStatus: 3 }).then((res) => {
ReceiveApi.updateOrderIn({
orderInPos: [{ ...state.order, scaleStatus: 3 }],
}).then((res) => {
if (res.code === 200) {
uni.redirectTo({
url: "/pagesReceive/payReview?scaleStatus=3", //
@ -366,7 +368,7 @@ const handleOk = () => {
ReceiveApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
if (res.code === 200) {
uni.redirectTo({
url: "/pagesReceive/payReview?scaleStatus=2", //
url: "/pagesReceive/payReview?scaleStatus=" + state.scaleStatus, //
});
}
});
@ -395,12 +397,12 @@ const handlePrint = () => {
DeviceApi.print({
id: state.order.id,
orderType: OrderType.Receive,
userId: state.order.deviceId
userId: state.order.deviceId,
}).then((res) => {
if (res.code === 200) {
uni.showToast({
title: "打印成功",
})
});
}
});
};
@ -434,7 +436,15 @@ onLoad((option) => {
state.order[item.enName] = state.order["totalPrice"];
}
} else {
item.num = state.order[item.enName as string];
if (item.enName === "buckleMiscellaneous") {
if (state.order[item.enName as string]) {
item.num = state.order[item.enName as string];
} else {
item.num = 0;
}
} else {
item.num = state.order[item.enName as string];
}
}
});
}

View File

@ -113,7 +113,14 @@ const handleClear = (item: any) => {
};
const isShowFormItem = (item: any) => {
if (model1.scaleStatusBtnType === ScaleStatusBtnType.ShipmentPay) {
return true;
if (
model1.order.deliveryMethod === 1 &&
["freight", "incidentals"].indexOf(item.key) > -1
) {
return false;
} else {
return true;
}
} else {
return (
item.key !== "paymentMethodName" &&
@ -574,7 +581,7 @@ const save = () => {
});
return;
}
if (
parseFloat(model1.order.settlementTare.toString()) >
parseFloat(model1.order.settlementGross.toString())
@ -636,15 +643,23 @@ const updateOrder = () => {
icon: "success",
});
uni.navigateBack({
delta: 1,
success: (res) => {
uni.$emit("shipmentReviewUrlParams", {
id: model1.order.id,
scaleStatusBtnType: model1.scaleStatusBtnType,
});
},
});
//
if (scaleStatus.value === ScaleStatus.ToBeShipmentPay) {
uni.navigateBack({
delta: 1,
success: (res) => {
uni.$emit("shipmentReviewUrlParams", {
id: model1.order.id,
scaleStatusBtnType: model1.scaleStatusBtnType,
});
},
});
}
if (scaleStatus.value === ScaleStatus.ShipmentPaid) {
uni.redirectTo({
url: "/pagesShipment/shipmentSettlement?scaleStatus=4", //
});
}
}
});
};

View File

@ -418,7 +418,6 @@ const updateOrder = () => {
// else if (state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
// status = ScaleStatus.ToBeShipmentReview;
// }
debugger
let status = 0;
if (state.scaleStatus === ScaleStatus.ToBeShipment) {
status = ScaleStatus.ToBeGrossWeight;

View File

@ -80,7 +80,6 @@ const handleScenePhoto = (imagesId: number) => {
};
const pricingDetail = (id: string) => {
//
debugger
ShipmentApi.getDetailById({ id: id }).then((res: any) => {
if (res.code === 200) {
if (res.data.scaleStatus > 1) {
@ -120,9 +119,9 @@ const getList = (v?: boolean) => {
});
};
const handleOk = () => {
console.log(deleteId.value);
ShipmentApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
if (res.code === 200) {
resetPageList();
getList();
}
});

View File

@ -539,7 +539,9 @@ const handleOk = () => {
ShipmentApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
if (res.code === 200) {
uni.navigateTo({
url: "/pagesShipment/shipmentSettlement?scaleStatus=2", //
url:
"/pagesShipment/shipmentSettlement?scaleStatus=" +
state.scaleStatus, //
});
}
});
@ -591,22 +593,22 @@ const handlePrint = () => {
DeviceApi.print({
id: state.order.id,
orderType: OrderType.Shipment,
userId: state.order.deviceId
userId: state.order.deviceId,
}).then((res) => {
if (res.code === 200) {
uni.showToast({
title: "打印成功",
})
});
}
});
};
onShow(() => {
init();
});
onLoad((option) => {
onLoad((option:any) => {
state.order.id = (option as any).id;
state.scaleStatusBtnType = parseInt((option as any).scaleStatusBtnType);
state.scaleStatus = parseInt(option.scaleStatus);
uni.$on("shipmentReviewUrlParams", (data) => {
console.log(data);
state.order.id = data.id;

View File

@ -37,7 +37,12 @@
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="ScaleStatus.ShipmentPaid === currentTab ? 160 : 240"
:height="
ScaleStatus.ShipmentPaid === currentTab ||
ScaleStatus.ToBeShipmentReview === currentTab
? 160
: 240
"
:isLoading="pageList.isLoading"
>
<block v-for="(item, index) in pageList.list" :key="index">
@ -45,7 +50,6 @@
<view style="min-width: 20px"
><checkbox
v-if="
ScaleStatus.ToBeShipmentReview === currentTab ||
ScaleStatus.ToBeShipmentPay === currentTab
"
:color="'#00D2E3'"
@ -102,10 +106,7 @@
</block>
</page-view>
</view>
<view
class="btn-box"
v-if="(currentTab === 2 || currentTab === 3) && pageList.list.length > 0"
>
<view class="btn-box" v-if="currentTab === 3 && pageList.list.length > 0">
<u-button
text="全选/取消"
color="#fff"
@ -114,10 +115,21 @@
></u-button>
<u-button
type="primary"
:text="`${currentTab === 2 ? '批量审核' : '批量支付'}`"
@click="handleReviewOrPay(currentTab)"
:text="`批量支付`"
@click="handleReviewOrPay()"
></u-button>
</view>
<block>
<u-action-sheet
:actions="contrlModalParams.select.list"
:title="contrlModalParams.select.title"
:show="contrlModalParams.select.isShow"
@select="(v: any) => handleSelect1('select', v)"
@close="contrlModalParams.select.isShow = false"
:closeOnClickAction="true"
></u-action-sheet>
</block>
</template>
<script setup lang="ts">
import { ShipmentApi } from "@/services/index";
@ -125,6 +137,43 @@ import { ScaleStatus, ScaleStatusBtnType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
import { onShow } from "@dcloudio/uni-app";
import PageView from "@/components/PageView/index.vue";
import type { ComType } from "@/types/global";
const contrlModalParams = reactive<ComType>({
select: {
isShow: false,
title: "标题",
list: [
{
name: "微信",
key: 3,
},
{
name: "现金",
key: 1,
},
{
name: "支付宝",
key: 4,
},
{
name: "转账",
key: 2,
},
],
},
});
const payState = reactive({
paymentMethodName: "",
paymentMethod: "",
});
const handleSelect1 = (key: string, v: any) => {
contrlModalParams.select.isShow = false;
payState.paymentMethodName = v.name;
payState.paymentMethod = v.key;
updateStatus(ScaleStatus.ShipmentPaid);
};
// scaleStatus
const pageList: PageResult<Shipment> = reactive({
isLoading: false,
@ -158,6 +207,7 @@ const tabList = reactive([
]);
const currentTab = ref(2);
const handleTab = (item: any) => {
state.isAll = false;
currentTab.value = item.key;
resetPageList();
getList();
@ -171,26 +221,35 @@ const handleReview = (id: string, scaleStatus: number) => {
} else if (scaleStatus === 4) {
type = ScaleStatusBtnType.ShipmentPay;
}
console.log("**************", type);
uni.navigateTo({
url: "/pagesShipment/review/index?id=" + id + `&scaleStatusBtnType=${type}`, //
url:
"/pagesShipment/review/index?id=" +
id +
`&scaleStatusBtnType=${type}&scaleStatus=${scaleStatus}`, //
});
};
const handleReviewOrPay = (status: number) => {
//
if (ScaleStatus.ToBeShipmentReview === status) {
updateStatus(ScaleStatus.ToBeShipmentPay);
} else if (ScaleStatus.ToBeShipmentPay === status) {
//
updateStatus(ScaleStatus.ShipmentPaid);
const handleReviewOrPay = () => {
const list = pageList.list
.filter((item) => item.isChecked)
if (list.length === 0) {
uni.showToast({ icon: "none", title: "请至少选择一个出货单" });
return;
}
//
contrlModalParams.select.isShow = true;
contrlModalParams.select.title = "结算方式";
};
const updateStatus = (status: number) => {
const list = pageList.list
.filter((item) => item.isChecked)
.map((item) => {
return { ...item, scaleStatus: status };
return {
...item,
scaleStatus: status,
paymentMethodName: payState.paymentMethodName,
paymentMethod: payState.paymentMethod,
};
});
if (list.length === 0) {
uni.showToast({ icon: "none", title: "请至少选择一个出货单" });
@ -243,8 +302,8 @@ const getList = (v?: boolean) => {
// (pageList as any).list = (res.data.list as any).map((item: any) => {
// return { ...item, isChecked: false };
// });
(pageList as any).list = (pageList as any).list.concat(
(res.data.list as any).map((item: any) => {
pageList.list = pageList.list.concat(
res.data.list.map((item: any) => {
return { ...item, isChecked: false };
})
);
@ -253,7 +312,7 @@ const getList = (v?: boolean) => {
});
};
onShow(() => {
resetPageList()
resetPageList();
getList();
});
onLoad((option) => {

View File

@ -98,7 +98,7 @@ const handleModal = (v: boolean, id: number) => {
};
const handleScenePhoto = (id: any) => {
uni.navigateTo({
url: `/pagesScenePhoto/index?orderType=1&id=${id}&imagesType=1`, //
url: `/pagesScenePhoto/index?orderType=2&id=${id}&imagesType=1`, //
});
};
const pricingDetail = (id: string) => {
@ -145,6 +145,7 @@ const handleOk = () => {
console.log(deleteId.value);
ShipmentApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
if (res.code === 200) {
resetPageList();
getList();
}
});

View File

@ -1,8 +1,10 @@
// 存放路径: src/services/home.ts
// import { useMemberStore } from "@/store/modules/member";
// import pinia from "@/store";
// const store = useMemberStore(pinia);
import type { User } from "@/types/user";
import { http } from "@/utils/http";
// console.log(store.profile.childPath)
// 登陆
export const loginByAccount = (data: {
userName: string;
@ -250,3 +252,13 @@ export const forgetPwd = (data: any) => {
data,
});
};
// 获取基地信息
export const getDbInfo = (data: any) => {
return http<User>({
method: "POST",
url: "/prod/gateway/api/db/getDbInfo",
data,
});
};

View File

@ -8,31 +8,55 @@ export const useMemberStore = defineStore(
() => {
// 会员信息
const profile = ref<LoginResult>({
token: '',
token: "",
userInfo: {
userName: "",
factoryName: "",
},
menusList:[],
menusNameList: []
menusList: [],
menusNameList: [],
childPath: '/test/sh0001',
err: null
});
// 保存会员信息,登录时使用
const setProfile = (val: any) => {
profile.value = val;
profile.value = {...profile.value, ...val};
profile.value.menusNameList = _.pluck(val.menusList, "name");
};
const setChildPath= (v: string) => {
profile.value.childPath = v
}
const setErr= (v: any) => {
profile.value.err = v
}
// 清理会员信息,退出时使用
const clearProfile = () => {
// profile.value = undefined
profile.value = {
token: "",
userInfo: {
userName: "",
factoryName: "",
},
menusList: [],
menusNameList: [],
childPath: ''
};
};
// 记得 return
return {
profile,
setProfile,
clearProfile,
setChildPath,
setErr,
clearProfile
};
},
{

View File

@ -1,6 +1,6 @@
import { useMemberStore } from "@/store/modules/member";
import ENV_CONFIG from "../config/env";
import pinia from '@/store'
import pinia from "@/store";
// 基础地址
let baseUrl = "";
@ -8,11 +8,10 @@ let baseUrl = "";
(process.env as any).config = ENV_CONFIG;
// #endif
const store = useMemberStore(pinia);
baseUrl = (process.env as any).config[(process.env as any).NODE_ENV]
.VITE_APP_BASE_URL;
const store = useMemberStore(pinia);
const obj = {
// 拦截前触发
invoke(options: UniApp.RequestOptions) {
@ -20,7 +19,11 @@ const obj = {
options.timeout = 10000;
// 拼接完整路径
if (!options.url.startsWith("http")) {
options.url = baseUrl + options.url;
if (options.url.indexOf("/prod/gateway/api/db/getDbInfo") === -1) {
options.url = baseUrl + store.profile.childPath + options.url;
} else {
options.url = baseUrl + options.url;
}
}
// 请求头标识
// 1.小程序唯一标识
@ -53,50 +56,111 @@ interface Data<T> {
*/
export const http = <T>(options: UniApp.RequestOptions) => {
return new Promise<Data<T>>((resolve, reject) => {
console.log(options);
if ((options as any).header?.type === "UPLOAD") {
uni.uploadFile({
header: {
"x-userToken": store.profile?.token,
// #ifdef H5
"Content-Type": "multipart/form-data",
// #endif
// 压缩图片
uni.compressImage({
src: (options as any).data.path,
quality: 80, // 压缩质量
success: (compressRes) => {
const compressedTempFilePath = compressRes.tempFilePath;
uni.uploadFile({
header: {
"x-userToken": store.profile?.token,
// #ifdef H5
"Content-Type": "multipart/form-data",
// #endif
},
timeout: 1800000,
url: baseUrl + store.profile.childPath + options.url,//仅为示例,非真实的接口地址
fileType: "image",
// #ifdef H5
files: (options as any).data.files,
// #endif
// #ifdef MP-WEIXIN
filePath: compressedTempFilePath,
// #endif
name: "file",
formData: {
file: (options as any).data.files,
}, // HTTP 请求中其他额外的 form data
success: (res) => {
resolve(JSON.parse(res.data) as Data<T>);
},
fail(err) {
console.log("上传失败了", err);
resolve(err as any);
},
});
// 上传图片
// uni.uploadFile({
// url: 'https://your-api-upload-endpoint.com/upload', // 你的上传接口
// filePath: compressedTempFilePath,
// name: 'file',
// formData: {
// 'user': 'test'
// },
// success: (uploadFileRes) => {
// console.log('upload success:', uploadFileRes);
// },
// fail: (uploadFileErr) => {
// console.error('upload fail:', uploadFileErr);
// }
// });
},
url: baseUrl + options.url, //仅为示例,非真实的接口地址
fileType: "image",
// #ifdef H5
files: (options as any).data.files,
// #endif
// #ifdef MP-WEIXIN
filePath: (options as any).data.path,
// #endif
name: "file",
formData: {
file: (options as any).data.files,
}, // HTTP 请求中其他额外的 form data
success: (res) => {
resolve(JSON.parse(res.data) as Data<T>);
},
fail(err) {
console.log(err);
resolve(err as any)
fail: (compressErr) => {
console.error("compress fail:", compressErr);
},
});
// uni.uploadFile({
// header: {
// "x-userToken": store.profile?.token,
// // #ifdef H5
// "Content-Type": "multipart/form-data",
// // #endif
// },
// timeout: 1800000,
// url: baseUrl + store.profile.childPath + options.url,//仅为示例,非真实的接口地址
// fileType: "image",
// // #ifdef H5
// files: (options as any).data.files,
// // #endif
// // #ifdef MP-WEIXIN
// filePath: (options as any).data.path,
// // #endif
// name: "file",
// formData: {
// file: (options as any).data.files,
// }, // HTTP 请求中其他额外的 form data
// success: (res) => {
// resolve(JSON.parse(res.data) as Data<T>);
// },
// fail(err) {
// console.log("上传失败了", err);
// resolve(err as any);
// },
// });
} else {
uni.request({
...options,
dataType:'string', //1.先将dataType设置为string
dataType: "string", //1.先将dataType设置为string
success(res) {
var json=(res.data as any).replace(/:s*([0-9]{15,})s*(,?)/g, ': "$1" $2')
var json = (res.data as any).replace(
/:s*([0-9]{15,})s*(,?)/g,
': "$1" $2'
);
//2.根据后端返回的数据调用一次或者两次replace替换
var json1=json.replace(/:s*([0-9]{15,})s*(,?)/g, ': "$1" $2')
var json1 = json.replace(/:s*([0-9]{15,})s*(,?)/g, ': "$1" $2');
//3.手动转换回json数据即可
let res1 = JSON.parse(json1);
console.log(res1)
let res1: any = JSON.parse(json1);
console.log(res1);
if (res.statusCode >= 200 && res.statusCode < 300) {
if (
(res1 as any).code === 1001 ||
(res1 as any).code === 1002
res1.code === 1001 ||
res1.code === 1002 ||
res1.code === 1003 ||
res1.code === 1004
) {
uni.showToast({
icon: "none",
@ -107,12 +171,12 @@ export const http = <T>(options: UniApp.RequestOptions) => {
url: "/pagesLogin/login/index",
});
return;
}else if ((res1 as any).code === 10001) {
} else if ((res1 as any).code === 10001) {
uni.showToast({
icon: "none",
title: (res1 as Data<T>).message || "请求失败",
});
return
return;
} else if ((res1 as any).code === 5001) {
uni.showToast({
icon: "none",
@ -131,6 +195,7 @@ export const http = <T>(options: UniApp.RequestOptions) => {
fail(err) {
uni.showToast({
icon: "none",
// title: JSON.stringify(err),
title: "网络错误,请检查网络",
});
reject(err);

View File

@ -259,3 +259,4 @@ export function getScaleStatus(type: number, value: number) {
}
}
}