update: 更新收货入库

This commit is contained in:
admin 2024-03-22 13:45:34 +08:00
parent 970f6ee148
commit d9d0024c73
7 changed files with 268 additions and 107 deletions

View File

@ -3,11 +3,15 @@
:scroll-y="true" :scroll-y="true"
class="scroll-view-custom" class="scroll-view-custom"
@scrolltolower="loadMore" @scrolltolower="loadMore"
:style="{ 'max-height': clientHeight + 'px' }" :style="{ height: clientHeight + 'px' }"
> >
<slot> </slot> <slot> </slot>
<!-- 加载更多提示 --> <!-- 加载更多提示 -->
<view v-if="noMoreData || isLoading" class="no-more-data-text"> <view
v-if="noMoreData || isLoading"
class="no-more-data-text"
style="padding: 20rpx"
>
<u-loadmore <u-loadmore
:status="isLoading ? 'loading' : 'nomore'" :status="isLoading ? 'loading' : 'nomore'"
:line="true" :line="true"
@ -15,7 +19,10 @@
:marginTop="30" :marginTop="30"
/> />
</view> </view>
<view v-if="!isLoading && list.length === 0" style="justify-content: center"> <view
v-if="!isLoading && list.length === 0"
style="justify-content: center; padding: 20rpx"
>
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty> </u-empty>
</view> </view>
@ -28,7 +35,7 @@ import { onLoad } from "@dcloudio/uni-app";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
noMoreData: boolean; noMoreData: boolean;
isLoading: boolean isLoading: boolean;
list: any; list: any;
height: number; height: number;
}>(), }>(),
@ -44,6 +51,7 @@ const emit = defineEmits(["loadList"]);
const clientHeight = ref(500); const clientHeight = ref(500);
const loadMore = () => { const loadMore = () => {
console.log("**** 加载更多");
if (props.noMoreData) return; // if (props.noMoreData) return; //
emit("loadList", true); emit("loadList", true);
}; };
@ -68,6 +76,15 @@ const getClineHeight = () => {
}, },
}); });
}; };
watch(
() => props.height,
(newValue, oldValue) => {
getClineHeight();
}
);
// ,{ deep: true, immediate:true}
onLoad(() => { onLoad(() => {
// #ifdef APP-PLUS || MP-WEIXIN // #ifdef APP-PLUS || MP-WEIXIN
getClineHeight(); getClineHeight();

View File

@ -1,19 +1,20 @@
// 不同的环境变量配置 // 不同的环境变量配置
const development = { const development = {
// VITE_APP_BASE_URL: 'http://47.100.31.83:8081', // VITE_APP_BASE_URL: 'http://47.100.31.83:8081',
VITE_APP_BASE_URL: 'http://47.100.31.83:8081', // VITE_APP_BASE_URL: 'https://47.100.31.83:8081',
// appid: '',
appid: '', VITE_APP_BASE_URL: 'https://ifanda.52zaisheng.cn/prod',
appid: 'wx9251d74fe0e87028',
} }
const test = { const test = {
VITE_APP_BASE_URL: 'http://47.100.31.83:8081', VITE_APP_BASE_URL: 'https://47.100.31.83:8081',
appid: 'wxd5xxxxee0fce1c81', appid: 'wxd5xxxxee0fce1c81',
} }
const production = { const production = {
VITE_APP_BASE_URL: 'http://124.70.167.140:8081', VITE_APP_BASE_URL: 'https://ifanda.52zaisheng.cn/prod',
appid: 'wx3xxxx1ce403cab3', appid: 'wx9251d74fe0e87028',
} }
export default { export default {

View File

@ -113,7 +113,7 @@ const gridList1 = reactive([
}, },
{ {
name: "作废人", name: "作废人",
enName: "updateUserName", enName: "updateName",
unit: "", unit: "",
isBefore: false, isBefore: false,
isCustomStyle: true, isCustomStyle: true,

View File

@ -391,12 +391,13 @@ const startSave = () => {
PictureApi.addListAnnex({ annexPos: res.filter((item) => item) }).then( PictureApi.addListAnnex({ annexPos: res.filter((item) => item) }).then(
(res1) => { (res1) => {
if (res1.code === 200) { if (res1.code === 200) {
updateOrder() console.log("*** 资源文件更新成功");
} }
} }
); );
} }
}); });
updateOrder();
}; };
const updateOrder = () => { const updateOrder = () => {
@ -427,20 +428,28 @@ const updateOrder = () => {
ReceiveApi.updateOne({ ...model1.order }).then((res) => { ReceiveApi.updateOne({ ...model1.order }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
// - -> // - ->
uni.showToast({ //
title: "定价成功", if (prePage.value === "review") {
icon: "success", uni.redirectTo({
url:
"/pagesReceive/review/index?id=" +
model1.order.id +
`&scaleStatus=` +
model1.order.scaleStatus, //
}); });
} else {
// 0 1 // 0 1
uni.redirectTo({ uni.redirectTo({
url: "/pagesHome/index", // url: "/pagesHome/index", //
}); });
} }
}
}); });
}; };
const prePage = ref("");
onLoad((option) => { onLoad((option) => {
model1.order.id = parseInt((option as any).id); model1.order.id = parseInt((option as any).id);
prePage.value = (option as any).prePage;
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) {

View File

@ -28,14 +28,30 @@
</text> </text>
</view> </view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="ScaleStatus.Paid === currentTab ? 160 : 240 "
:isLoading="pageList.isLoading"
>
<block v-for="(item, index) in pageList.list" :key="index"> <block v-for="(item, index) in pageList.list" :key="index">
<view class="c-layout"> <view class="c-layout">
<view <view style="min-width: 20px;">
><checkbox <checkbox
v-if="
ScaleStatus.ToBeReview === currentTab ||
ScaleStatus.ToBePay === currentTab
"
value="cb" value="cb"
:color="'#00D2E3'" :color="'#00D2E3'"
:checked="state.checkMap[(item.id as number)]" :checked="item.isChecked"
style="transform: scale(0.5)" style="transform: scale(0.5)"
@click="item.isChecked = !item.isChecked"
/></view> /></view>
<view class="inner-box"> <view class="inner-box">
<view class="top-flex-box"> <view class="top-flex-box">
@ -56,18 +72,26 @@
> >
</view> </view>
<view class="flex-box"> <view class="flex-box">
<text>货款金额{{ item.totalPrice || 0 }}</text> <text>货款金额{{ item.balanceTotalPrice || 0 }}</text>
</view> </view>
</view> </view>
<view> <view>
<text class="btn"> <text class="btn">
<text <text
v-if="currentTab === 2" v-if="currentTab === 2"
@click="handleReview(item.id as number, 2)" @click="handleReview(item.id as number, 2, '去审核')"
>去审核</text >去审核</text
> >
<text v-if="currentTab === 3" @click="handleReview(item.id as number, 3)">去支付</text> <text
<text v-if="currentTab === 4" @click="handleReview(item.id as number, 4)">查看</text> v-if="currentTab === 3"
@click="handleReview(item.id as number, 3, '去支付')"
>去支付</text
>
<text
v-if="currentTab === 4"
@click="handleReview(item.id as number, 4, '查看详情')"
>查看</text
>
</text> </text>
</view> </view>
</view> </view>
@ -79,28 +103,34 @@
v-if="index < pageList.list.length - 1" v-if="index < pageList.list.length - 1"
></u-gap> ></u-gap>
</block> </block>
</page-view>
</view> </view>
<view class="btn-box" v-if="(currentTab === 2 || currentTab === 3) && pageList.list.length > 0"> <view
class="btn-box"
v-if="(currentTab === 2 || currentTab === 3) && pageList.list.length > 0"
>
<u-button <u-button
text="全选/取消" text="全选/取消"
color="#fff" color="#fff"
:customStyle="{ color: '#00DCEE', border: '1px solid #00DCEE' }" :customStyle="{ color: '#00DCEE', border: '1px solid #00DCEE' }"
@click="handleSelect" @click="handleSelect"
></u-button> ></u-button>
<u-button type="primary" :text="`${currentTab === 2 ? '批量审核' : '批量支付'}`"></u-button> <u-button
type="primary"
:text="`${currentTab === 2 ? '批量审核' : '批量支付'}`"
@click="handleReviewOrPay(currentTab)"
></u-button>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ReceiveApi } from "@/services/index"; import { ReceiveApi } from "@/services/index";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import PageView from "@/components/PageView/index.vue";
import { ScaleStatus } from "@/utils/enum";
// scaleStatus // scaleStatus
interface PageResult<T> {
total: number;
list: T[];
pageNum: number;
pageSize: number;
}
const pageList: PageResult<Order> = reactive({ const pageList: PageResult<Order> = reactive({
isLoading: false,
noMoreData: false,
total: 0, total: 0,
list: [], list: [],
pageNum: 1, pageNum: 1,
@ -111,7 +141,6 @@ const isShowSearch = ref(false);
const state = reactive<{ const state = reactive<{
[attrName: string]: any; [attrName: string]: any;
}>({ }>({
checkMap: {},
isAll: false, isAll: false,
}); });
const tabList = reactive([ const tabList = reactive([
@ -128,40 +157,87 @@ const tabList = reactive([
key: 4, key: 4,
}, },
]); ]);
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const currentTab = ref(2); const currentTab = ref(2);
const handleTab = (item: any) => { const handleTab = (item: any) => {
currentTab.value = item.key; currentTab.value = item.key;
getOrderList(); resetPageList();
getList();
}; };
const handleReview = (id: number, scaleStatus: number) => { const handleReview = (id: number, scaleStatus: number, title: string) => {
uni.navigateTo({ uni.navigateTo({
url: "/pagesReceive/review/index?id=" + id + `&scaleStatus=`+ scaleStatus, // url:
"/pagesReceive/review/index?id=" +
id +
`&scaleStatus=` +
scaleStatus +
`&title=${title}`, //
});
};
const handleReviewOrPay = (status: number) => {
//
if (ScaleStatus.ToBeReview === status) {
updateStatus(ScaleStatus.ToBePay);
} else if (ScaleStatus.ToBePay === status) {
//
updateStatus(ScaleStatus.Paid);
}
};
const updateStatus = (status: number) => {
const list = pageList.list
.filter((item) => item.isChecked)
.map((item) => {
return { ...item, scaleStatus: status };
});
ReceiveApi.updateOrderIn({ orderInPos: list }).then((res) => {
if (res.code === 200) {
resetPageList();
getList();
}
}); });
}; };
const handleSelect = () => { const handleSelect = () => {
state.isAll = !state.isAll; state.isAll = !state.isAll;
Object.keys(state.checkMap).forEach((item) => { console.log(state.isAll);
state.checkMap[item] = state.isAll; pageList.list = pageList.list.map((item) => {
return { ...item, isChecked: state.isAll };
}); });
}; };
const getOrderList = () => { const getList = (v?: boolean) => {
ReceiveApi.getOrderPage({ pageNumber: 1, pageSize: 10, scaleStatus: currentTab.value }).then( if (v) {
(res) => { if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
pageList.pageNum++;
} else {
pageList.noMoreData = true;
return;
}
}
ReceiveApi.getOrderPage({
pageSize: pageList.pageSize,
pageNumber: pageList.pageNum,
scaleStatus: currentTab.value,
}).then((res) => {
if (res.code === 200) { if (res.code === 200) {
(pageList as any).list = res.data.list; (pageList as any).list = (res.data.list as any).map((item: any) => {
(res.data.list as any).forEach((item: any) => { return { ...item, isChecked: false };
state.checkMap[parseInt(item.id)] = false;
}); });
pageList.total = (res.data as any).total;
} }
} });
);
}; };
onMounted(() => { onMounted(() => {
getOrderList(); getList();
}); });
onLoad((option) => { onLoad((option) => {
currentTab.value = parseInt((option as any).scaleStatus); currentTab.value = parseInt((option as any).scaleStatus);
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.search { .search {

View File

@ -95,12 +95,12 @@ const handleModal = (v: boolean, id: number) => {
deleteId.value = id; deleteId.value = id;
}; };
const handleScenePhoto = (imagesId: number) => { const handleScenePhoto = (imagesId: number) => {
uni.navigateTo({ uni.redirectTo({
url: `/pagesScenePhoto/index?orderType=1&id=${imagesId}&imagesType=1`, // url: `/pagesScenePhoto/index?orderType=1&id=${imagesId}&imagesType=1`, //
}); });
}; };
const pricingDetail = (id: number) => { const pricingDetail = (id: number) => {
uni.navigateTo({ uni.redirectTo({
url: "/pagesReceive/form/pricingForm?id=" + id, // url: "/pagesReceive/form/pricingForm?id=" + id, //
}); });
}; };

View File

@ -15,7 +15,7 @@
plain plain
shape="circle" shape="circle"
:bgColor="'rgba(237, 254, 255, 1)'" :bgColor="'rgba(237, 254, 255, 1)'"
@click="handleScenePhoto(state.order.imagesId as number)" @click="handleScenePhoto(state.order.id)"
></u-tag ></u-tag
></view> ></view>
<view <view
@ -43,13 +43,17 @@
></view> ></view>
</view> </view>
</view> </view>
<view class="flex-box" v-if="state.order.scaleStatus === 2"> <view
class="flex-box"
v-if="state.order.scaleStatus === ScaleStatus.ToBeReview"
>
<text>定价人{{ state.order.pricingUserName || "-" }}</text> <text>定价人{{ state.order.pricingUserName || "-" }}</text>
<text>创建时间{{ state.order.createTime }}</text> <text>过磅时间{{ state.order.grossTime }}</text>
</view> </view>
<!-- 入库 过磅时间对应过毛时间 --> <!-- 入库 过磅时间对应过毛时间 -->
<view class="flex-box" v-if="getIsShow()" style="border: none"> <view class="flex-box" v-if="getIsShow()" style="border: none">
<text>过磅时间{{ state.order.grossTime || "-" }}</text> <text>过磅时间{{ state.order.grossTime || "-" }}</text>
<!-- {{ state.order.createTime }} -->
</view> </view>
<view class="flex-box" v-if="getIsShow()"> <view class="flex-box" v-if="getIsShow()">
<text>定价人{{ state.order.pricingUserName || "-" }}</text> <text>定价人{{ state.order.pricingUserName || "-" }}</text>
@ -61,10 +65,24 @@
<view v-if="getIsShow()"></view> <view v-if="getIsShow()"></view>
<view v-for="(item, index) in gridList1" :key="index"> <view v-for="(item, index) in gridList1" :key="index">
<text v-if="item.name">{{ item.name }}</text <text v-if="item.name">{{ item.name }}</text
><text ><text>
>{{ item.isBefore ? item.unit : "" }} {{ item.isBefore ? item.unit : "" }}
{{ item.num }} {{ item.num }}
{{ item.isBefore ? "" : item.unit }} {{ item.isBefore ? "" : item.unit }}
<text
v-if="item.name === '货款金额' && ScaleStatus.ToBeReview === state.order.scaleStatus"
@click="handleEdit()"
:style="{
color: 'rgba(0, 220, 238, 1)',
border: '1px solid #00DCEE',
'border-radius': '20rpx',
fontSize: '12px',
padding: '1px 10px',
marginLeft: '10rpx'
}"
>
编辑
</text>
</text> </text>
</view> </view>
</view> </view>
@ -123,11 +141,27 @@
@handleModal="(v:boolean) => {handleModal(v, deleteId)}" @handleModal="(v:boolean) => {handleModal(v, deleteId)}"
@handleOk="handleOk()" @handleOk="handleOk()"
/> />
<u-modal
showCancelButton
:confirmColor="'#00D2E3'"
:show="isInput"
:title="'修改货款金额'"
@confirm="handleConfirm"
@cancel="isInput = false"
>
<up-input
placeholder="请输入货款金额"
type="number"
v-model="amount"
></up-input>
</u-modal>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ReceiveApi } from "@/services/index"; import { ReceiveApi } from "@/services/index";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import SmallModal from "@/components/Modal/smallModal.vue";
import { ScaleStatus } from "@/utils/enum";
const keyword = ref(""); const keyword = ref("");
const contrlModalParams = reactive<{ [attrName: string]: any }>({ const contrlModalParams = reactive<{ [attrName: string]: any }>({
paySelect: { paySelect: {
@ -236,7 +270,7 @@ const gridList1 = reactive([
isBefore: false, isBefore: false,
}, },
{ {
name: "货款总价", name: "货款金额",
enName: "balanceTotalPrice", enName: "balanceTotalPrice",
num: "", num: "",
unit: "元", unit: "元",
@ -246,21 +280,42 @@ const gridList1 = reactive([
const getIsShow = () => { const getIsShow = () => {
return state.order.scaleStatus === 3 || state.order.scaleStatus === 4; return state.order.scaleStatus === 3 || state.order.scaleStatus === 4;
}; };
const handleScenePhoto = (imagesId: number) => { const handleScenePhoto = (id: any) => {
uni.navigateTo({ uni.redirectTo({
url: "/pagesScenePhoto/index?orderType=1&id=" + imagesId, // url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, //
}); });
}; };
// // 3 // // 3
const handleReviewNoPay = () => { const handleReviewNoPay = () => {
ReceiveApi.updateOne({ ...state.order, scaleStatus: 3 }).then((res) => { ReceiveApi.updateOne({ ...state.order, scaleStatus: 3 }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.navigateTo({ uni.redirectTo({
url: "/pagesReceive/payReview?scaleStatus=3", // url: "/pagesReceive/payReview?scaleStatus=3", //
}); });
} }
}); });
}; };
const isInput = ref(false);
const amount = ref(null);
const handleEdit = () => {
isInput.value = true;
};
const handleConfirm = () => {
ReceiveApi.updateOrderIn({
orderInPos: [
{
...state.order,
balanceTotalPrice: amount.value,
},
],
}).then((res) => {
if (res.code === 200) {
uni.showToast({ title: "修改成功" });
gridList1[gridList1.length - 1].num = amount.value || "";
isInput.value = false;
}
});
};
// //
const handleReviewPay = () => { const handleReviewPay = () => {
contrlModalParams.paySelect.isShow = true; contrlModalParams.paySelect.isShow = true;
@ -280,7 +335,7 @@ const handleSelect = (key: string, v: any) => {
title: "支付成功", title: "支付成功",
icon: "success", icon: "success",
}); });
uni.navigateTo({ uni.redirectTo({
url: "/pagesReceive/payReview?scaleStatus=4", // url: "/pagesReceive/payReview?scaleStatus=4", //
}); });
} }
@ -299,7 +354,7 @@ const handleModal = (v: boolean, id: number) => {
const handleOk = () => { const handleOk = () => {
ReceiveApi.deleteOrder({ ids: [deleteId.value] }).then((res) => { ReceiveApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.navigateTo({ uni.redirectTo({
url: "/pagesReceive/payReview?scaleStatus=2", // url: "/pagesReceive/payReview?scaleStatus=2", //
}); });
} }
@ -307,15 +362,15 @@ const handleOk = () => {
}; };
const handleUpdateOrder = () => { const handleUpdateOrder = () => {
uni.navigateTo({ uni.navigateTo({
url: "/pagesReceive/form/pricingForm?id=" + state.order.id, // url: "/pagesReceive/form/pricingForm?prePage=review&id=" + state.order.id, //
}); });
}; };
// //
const handleReWeight = () => { const handleReWeight = () => {
ReceiveApi.reTare({ id: state.order.id }).then((res) => { ReceiveApi.reTare({ id: state.order.id }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.navigateTo({ uni.redirectTo({
url: "/pagesReceive/tareing", // url: "/pagesReceive/pricing?scaleStatus=1", //
}); });
} }
}); });
@ -323,6 +378,9 @@ const handleReWeight = () => {
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);
uni.setNavigationBarTitle({
title: (option as any).title,
});
if (state.order.id) { if (state.order.id) {
ReceiveApi.getDetailById({ id: state.order.id }).then((res) => { ReceiveApi.getDetailById({ id: state.order.id }).then((res) => {
if (res.code === 200) { if (res.code === 200) {