update: 更新收货入库
This commit is contained in:
parent
970f6ee148
commit
d9d0024c73
|
@ -3,19 +3,26 @@
|
|||
:scroll-y="true"
|
||||
class="scroll-view-custom"
|
||||
@scrolltolower="loadMore"
|
||||
:style="{ 'max-height': clientHeight + 'px' }"
|
||||
:style="{ height: clientHeight + 'px' }"
|
||||
>
|
||||
<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
|
||||
:status="isLoading ? 'loading' :'nomore'"
|
||||
:status="isLoading ? 'loading' : 'nomore'"
|
||||
:line="true"
|
||||
:fontSize="12"
|
||||
:marginTop="30"
|
||||
/>
|
||||
</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>
|
||||
</view>
|
||||
|
@ -28,7 +35,7 @@ import { onLoad } from "@dcloudio/uni-app";
|
|||
const props = withDefaults(
|
||||
defineProps<{
|
||||
noMoreData: boolean;
|
||||
isLoading: boolean
|
||||
isLoading: boolean;
|
||||
list: any;
|
||||
height: number;
|
||||
}>(),
|
||||
|
@ -44,6 +51,7 @@ const emit = defineEmits(["loadList"]);
|
|||
const clientHeight = ref(500);
|
||||
|
||||
const loadMore = () => {
|
||||
console.log("**** 加载更多");
|
||||
if (props.noMoreData) return; // 如果没有更多数据,直接返回
|
||||
emit("loadList", true);
|
||||
};
|
||||
|
@ -68,6 +76,15 @@ const getClineHeight = () => {
|
|||
},
|
||||
});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.height,
|
||||
(newValue, oldValue) => {
|
||||
getClineHeight();
|
||||
}
|
||||
);
|
||||
// ,{ deep: true, immediate:true}
|
||||
|
||||
onLoad(() => {
|
||||
// #ifdef APP-PLUS || MP-WEIXIN
|
||||
getClineHeight();
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
// 不同的环境变量配置
|
||||
const development = {
|
||||
// VITE_APP_BASE_URL: 'http://47.100.31.83:8081',
|
||||
VITE_APP_BASE_URL: 'http://47.100.31.83:8081',
|
||||
|
||||
appid: '',
|
||||
// VITE_APP_BASE_URL: 'https://47.100.31.83:8081',
|
||||
// appid: '',
|
||||
VITE_APP_BASE_URL: 'https://ifanda.52zaisheng.cn/prod',
|
||||
appid: 'wx9251d74fe0e87028',
|
||||
}
|
||||
|
||||
const test = {
|
||||
VITE_APP_BASE_URL: 'http://47.100.31.83:8081',
|
||||
VITE_APP_BASE_URL: 'https://47.100.31.83:8081',
|
||||
appid: 'wxd5xxxxee0fce1c81',
|
||||
}
|
||||
|
||||
const production = {
|
||||
VITE_APP_BASE_URL: 'http://124.70.167.140:8081',
|
||||
appid: 'wx3xxxx1ce403cab3',
|
||||
VITE_APP_BASE_URL: 'https://ifanda.52zaisheng.cn/prod',
|
||||
appid: 'wx9251d74fe0e87028',
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -113,7 +113,7 @@ const gridList1 = reactive([
|
|||
},
|
||||
{
|
||||
name: "作废人",
|
||||
enName: "updateUserName",
|
||||
enName: "updateName",
|
||||
unit: "",
|
||||
isBefore: false,
|
||||
isCustomStyle: true,
|
||||
|
|
|
@ -391,12 +391,13 @@ const startSave = () => {
|
|||
PictureApi.addListAnnex({ annexPos: res.filter((item) => item) }).then(
|
||||
(res1) => {
|
||||
if (res1.code === 200) {
|
||||
updateOrder()
|
||||
console.log("*** 资源文件更新成功");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
updateOrder();
|
||||
};
|
||||
|
||||
const updateOrder = () => {
|
||||
|
@ -427,20 +428,28 @@ const updateOrder = () => {
|
|||
ReceiveApi.updateOne({ ...model1.order }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
// 定价后 若是零皮-》跳转到【付款审核】 有皮重->【待过皮重】
|
||||
uni.showToast({
|
||||
title: "定价成功",
|
||||
icon: "success",
|
||||
// 当上一页为审核页
|
||||
if (prePage.value === "review") {
|
||||
uni.redirectTo({
|
||||
url:
|
||||
"/pagesReceive/review/index?id=" +
|
||||
model1.order.id +
|
||||
`&scaleStatus=` +
|
||||
model1.order.scaleStatus, // 要跳转到的页面路径
|
||||
});
|
||||
} else {
|
||||
// 0:有皮重 1:零皮重
|
||||
uni.redirectTo({
|
||||
url: "/pagesHome/index", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const prePage = ref("");
|
||||
onLoad((option) => {
|
||||
model1.order.id = parseInt((option as any).id);
|
||||
prePage.value = (option as any).prePage;
|
||||
if (model1.order.id) {
|
||||
ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
|
|
@ -28,14 +28,30 @@
|
|||
</text>
|
||||
</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">
|
||||
<view class="c-layout">
|
||||
<view
|
||||
><checkbox
|
||||
<view style="min-width: 20px;">
|
||||
<checkbox
|
||||
v-if="
|
||||
ScaleStatus.ToBeReview === currentTab ||
|
||||
ScaleStatus.ToBePay === currentTab
|
||||
"
|
||||
value="cb"
|
||||
:color="'#00D2E3'"
|
||||
:checked="state.checkMap[(item.id as number)]"
|
||||
:checked="item.isChecked"
|
||||
style="transform: scale(0.5)"
|
||||
@click="item.isChecked = !item.isChecked"
|
||||
/></view>
|
||||
<view class="inner-box">
|
||||
<view class="top-flex-box">
|
||||
|
@ -56,18 +72,26 @@
|
|||
>
|
||||
</view>
|
||||
<view class="flex-box">
|
||||
<text>货款金额:{{ item.totalPrice || 0 }}元</text>
|
||||
<text>货款金额:{{ item.balanceTotalPrice || 0 }}元</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="btn">
|
||||
<text
|
||||
v-if="currentTab === 2"
|
||||
@click="handleReview(item.id as number, 2)"
|
||||
@click="handleReview(item.id as number, 2, '去审核')"
|
||||
>去审核</text
|
||||
>
|
||||
<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
|
||||
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>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -79,28 +103,34 @@
|
|||
v-if="index < pageList.list.length - 1"
|
||||
></u-gap>
|
||||
</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 === 2 || currentTab === 3) && pageList.list.length > 0"
|
||||
>
|
||||
<u-button
|
||||
text="全选/取消"
|
||||
color="#fff"
|
||||
:customStyle="{ color: '#00DCEE', border: '1px solid #00DCEE' }"
|
||||
@click="handleSelect"
|
||||
></u-button>
|
||||
<u-button type="primary" :text="`${currentTab === 2 ? '批量审核' : '批量支付'}`"></u-button>
|
||||
<u-button
|
||||
type="primary"
|
||||
:text="`${currentTab === 2 ? '批量审核' : '批量支付'}`"
|
||||
@click="handleReviewOrPay(currentTab)"
|
||||
></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ReceiveApi } from "@/services/index";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
import { ScaleStatus } from "@/utils/enum";
|
||||
// scaleStatus
|
||||
interface PageResult<T> {
|
||||
total: number;
|
||||
list: T[];
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
}
|
||||
const pageList: PageResult<Order> = reactive({
|
||||
isLoading: false,
|
||||
noMoreData: false,
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
|
@ -111,7 +141,6 @@ const isShowSearch = ref(false);
|
|||
const state = reactive<{
|
||||
[attrName: string]: any;
|
||||
}>({
|
||||
checkMap: {},
|
||||
isAll: false,
|
||||
});
|
||||
const tabList = reactive([
|
||||
|
@ -128,40 +157,87 @@ const tabList = reactive([
|
|||
key: 4,
|
||||
},
|
||||
]);
|
||||
|
||||
const resetPageList = () => {
|
||||
pageList.noMoreData = false;
|
||||
pageList.total = 0;
|
||||
pageList.list = [];
|
||||
pageList.pageNum = 1;
|
||||
pageList.pageSize = 10;
|
||||
};
|
||||
const currentTab = ref(2);
|
||||
const handleTab = (item: any) => {
|
||||
currentTab.value = item.key;
|
||||
getOrderList();
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
const handleReview = (id: number, scaleStatus: number) => {
|
||||
const handleReview = (id: number, scaleStatus: number, title: string) => {
|
||||
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 = () => {
|
||||
state.isAll = !state.isAll;
|
||||
Object.keys(state.checkMap).forEach((item) => {
|
||||
state.checkMap[item] = state.isAll;
|
||||
console.log(state.isAll);
|
||||
pageList.list = pageList.list.map((item) => {
|
||||
return { ...item, isChecked: state.isAll };
|
||||
});
|
||||
};
|
||||
const getOrderList = () => {
|
||||
ReceiveApi.getOrderPage({ pageNumber: 1, pageSize: 10, scaleStatus: currentTab.value }).then(
|
||||
(res) => {
|
||||
const getList = (v?: boolean) => {
|
||||
if (v) {
|
||||
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) {
|
||||
(pageList as any).list = res.data.list;
|
||||
(res.data.list as any).forEach((item: any) => {
|
||||
state.checkMap[parseInt(item.id)] = false;
|
||||
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
||||
return { ...item, isChecked: false };
|
||||
});
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getOrderList();
|
||||
getList();
|
||||
});
|
||||
onLoad((option) => {
|
||||
currentTab.value = parseInt((option as any).scaleStatus);
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.search {
|
||||
|
|
|
@ -95,12 +95,12 @@ const handleModal = (v: boolean, id: number) => {
|
|||
deleteId.value = id;
|
||||
};
|
||||
const handleScenePhoto = (imagesId: number) => {
|
||||
uni.navigateTo({
|
||||
uni.redirectTo({
|
||||
url: `/pagesScenePhoto/index?orderType=1&id=${imagesId}&imagesType=1`, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const pricingDetail = (id: number) => {
|
||||
uni.navigateTo({
|
||||
uni.redirectTo({
|
||||
url: "/pagesReceive/form/pricingForm?id=" + id, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
plain
|
||||
shape="circle"
|
||||
:bgColor="'rgba(237, 254, 255, 1)'"
|
||||
@click="handleScenePhoto(state.order.imagesId as number)"
|
||||
@click="handleScenePhoto(state.order.id)"
|
||||
></u-tag
|
||||
></view>
|
||||
<view
|
||||
|
@ -43,13 +43,17 @@
|
|||
></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.createTime }}</text>
|
||||
<text>过磅时间:{{ state.order.grossTime }}</text>
|
||||
</view>
|
||||
<!-- 入库 过磅时间对应过毛时间 -->
|
||||
<view class="flex-box" v-if="getIsShow()" style="border: none">
|
||||
<text>过磅时间:{{ state.order.grossTime || "-" }}</text>
|
||||
<!-- {{ state.order.createTime }} -->
|
||||
</view>
|
||||
<view class="flex-box" v-if="getIsShow()">
|
||||
<text>定价人:{{ state.order.pricingUserName || "-" }}</text>
|
||||
|
@ -61,10 +65,24 @@
|
|||
<view v-if="getIsShow()"></view>
|
||||
<view v-for="(item, index) in gridList1" :key="index">
|
||||
<text v-if="item.name">{{ item.name }}:</text
|
||||
><text
|
||||
>{{ item.isBefore ? item.unit : "" }}
|
||||
><text>
|
||||
{{ item.isBefore ? item.unit : "" }}
|
||||
{{ item.num }}
|
||||
{{ 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>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -123,11 +141,27 @@
|
|||
@handleModal="(v:boolean) => {handleModal(v, deleteId)}"
|
||||
@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>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ReceiveApi } from "@/services/index";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||
import { ScaleStatus } from "@/utils/enum";
|
||||
const keyword = ref("");
|
||||
const contrlModalParams = reactive<{ [attrName: string]: any }>({
|
||||
paySelect: {
|
||||
|
@ -236,7 +270,7 @@ const gridList1 = reactive([
|
|||
isBefore: false,
|
||||
},
|
||||
{
|
||||
name: "货款总价",
|
||||
name: "货款金额",
|
||||
enName: "balanceTotalPrice",
|
||||
num: "",
|
||||
unit: "元",
|
||||
|
@ -246,21 +280,42 @@ const gridList1 = reactive([
|
|||
const getIsShow = () => {
|
||||
return state.order.scaleStatus === 3 || state.order.scaleStatus === 4;
|
||||
};
|
||||
const handleScenePhoto = (imagesId: number) => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesScenePhoto/index?orderType=1&id=" + imagesId, // 要跳转到的页面路径
|
||||
const handleScenePhoto = (id: any) => {
|
||||
uni.redirectTo({
|
||||
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
// 审核暂不支付 // 更新状态为3
|
||||
const handleReviewNoPay = () => {
|
||||
ReceiveApi.updateOne({ ...state.order, scaleStatus: 3 }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.navigateTo({
|
||||
uni.redirectTo({
|
||||
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 = () => {
|
||||
contrlModalParams.paySelect.isShow = true;
|
||||
|
@ -280,7 +335,7 @@ const handleSelect = (key: string, v: any) => {
|
|||
title: "支付成功",
|
||||
icon: "success",
|
||||
});
|
||||
uni.navigateTo({
|
||||
uni.redirectTo({
|
||||
url: "/pagesReceive/payReview?scaleStatus=4", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
|
@ -299,7 +354,7 @@ const handleModal = (v: boolean, id: number) => {
|
|||
const handleOk = () => {
|
||||
ReceiveApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.navigateTo({
|
||||
uni.redirectTo({
|
||||
url: "/pagesReceive/payReview?scaleStatus=2", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
|
@ -307,15 +362,15 @@ const handleOk = () => {
|
|||
};
|
||||
const handleUpdateOrder = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesReceive/form/pricingForm?id=" + state.order.id, // 要跳转到的页面路径
|
||||
url: "/pagesReceive/form/pricingForm?prePage=review&id=" + state.order.id, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
// 重新过皮
|
||||
const handleReWeight = () => {
|
||||
ReceiveApi.reTare({ id: state.order.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.navigateTo({
|
||||
url: "/pagesReceive/tareing", // 要跳转到的页面路径
|
||||
uni.redirectTo({
|
||||
url: "/pagesReceive/pricing?scaleStatus=1", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -323,6 +378,9 @@ const handleReWeight = () => {
|
|||
onLoad((option) => {
|
||||
state.order.id = parseInt((option as any).id);
|
||||
state.scaleStatus = parseInt((option as any).scaleStatus);
|
||||
uni.setNavigationBarTitle({
|
||||
title: (option as any).title,
|
||||
});
|
||||
if (state.order.id) {
|
||||
ReceiveApi.getDetailById({ id: state.order.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
|
Loading…
Reference in New Issue