diff --git a/src/pagesApp/components/addUser.vue b/src/pagesApp/components/addUser.vue
index dd6b091..b430586 100644
--- a/src/pagesApp/components/addUser.vue
+++ b/src/pagesApp/components/addUser.vue
@@ -3,7 +3,7 @@
@@ -35,7 +35,9 @@
:maxlength="item.key === 'password' ? 8 : -1"
@change="(e:any) => {handleInput(e, item)}"
:disabled="item.type === 'select'"
- :disabledColor="['性别', '用户角色'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
+ :disabledColor="
+ ['性别', '用户角色'].indexOf(item.name) > -1 ? '#ffffff' : '#f5f7fa'
+ "
@clear="handleClear(item)"
>
@@ -49,7 +51,7 @@
-
+
{
- (model1.formData as any)[item.key] = '';
-}
+const handleClear = (item: any) => {
+ (model1.formData as any)[item.key] = "";
+};
const handleInput = (e: any, item: any) => {
if (item.key === "phone") {
const temp = e?.replace(valid.valid_number, "");
@@ -90,10 +92,9 @@ const handleInput = (e: any, item: any) => {
}
};
const model1 = reactive({
- formData: {
- },
+ formData: {},
});
-const rules = ref({
+const rules1 = ref({
"formData.userName": {
type: "string",
required: true,
@@ -107,6 +108,14 @@ const rules = ref({
trigger: ["blur", "change"],
},
});
+const rules2 = ref({
+ "formData.userName": {
+ type: "string",
+ required: true,
+ message: "请输入账号",
+ trigger: ["blur", "change"],
+ },
+});
const contrlModalParams = reactive({
role: {
isShow: false,
@@ -129,7 +138,7 @@ const contrlModalParams = reactive({
},
});
-const formAttrList = reactive([
+const formAttrList1 = reactive([
{
name: "姓名",
key: "name",
@@ -174,6 +183,45 @@ const formAttrList = reactive([
},
]);
+const formAttrList2 = reactive([
+ {
+ 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",
+ 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) => {
contrlModalParams[key].isShow = false;
if (key === "role") {
@@ -211,15 +259,18 @@ const save = () => {
return;
}
}
- if (model1.formData.password) {
- if (!valid.valid_password.pattern.test(model1.formData.password)) {
- uni.showToast({
- icon: "none",
- title: valid.valid_password.message,
- });
- 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) => {
if (res) {
startSave();
@@ -229,15 +280,22 @@ const save = () => {
const startSave = () => {
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) {
- uni.navigateBack()
+ uni.navigateBack();
}
});
} else {
ProfileApi.addUser({ userType: 1, ...model1.formData }).then((res) => {
if (res.code === 200) {
- uni.navigateBack()
+ uni.navigateBack();
}
});
}
@@ -261,11 +319,11 @@ onMounted(() => {
onLoad((option) => {
// 接收传递的标题参数;
const title = (option as any).title;
- const obj = JSON.parse((option as any).item)
- model1.formData = {...obj, genderName: ['未知','男','女'][obj.gender]};
+ const obj = JSON.parse((option as any).item);
+ model1.formData = { ...obj, genderName: ["未知", "男", "女"][obj.gender] };
if (obj.roleVos.length > 0) {
- model1.formData.roleIds = [obj.roleVos[0].id]
- model1.formData.roleName = obj.roleVos[0].roleName
+ model1.formData.roleIds = [obj.roleVos[0].id];
+ model1.formData.roleName = obj.roleVos[0].roleName;
}
// 设置页面标题;
if (title) {
diff --git a/src/pagesApp/role.vue b/src/pagesApp/role.vue
index e9bd754..e24c367 100644
--- a/src/pagesApp/role.vue
+++ b/src/pagesApp/role.vue
@@ -91,7 +91,7 @@ const add = () => {
const edit = (item: any) => {
uni.navigateTo({
url:
- "/pagesApp/components/addRole?title=新增角色&item=" +
+ "/pagesApp/components/addRole?title=编辑角色&item=" +
JSON.stringify(item), // 要跳转到的页面路径
});
};
diff --git a/src/pagesApp/shipmentProduct.vue b/src/pagesApp/shipmentProduct.vue
index 58e1509..f7612cb 100644
--- a/src/pagesApp/shipmentProduct.vue
+++ b/src/pagesApp/shipmentProduct.vue
@@ -109,7 +109,7 @@ const update = (item: any) => {
const edit = (item: any) => {
uni.navigateTo({
url:
- "/pagesApp/components/addShipmentProduct?title=编辑收货产品&item=" +
+ "/pagesApp/components/addShipmentProduct?title=编辑出货产品&item=" +
JSON.stringify(item), // 要跳转到的页面路径
});
};
diff --git a/src/pagesLogin/profile/baseinfo.vue b/src/pagesLogin/profile/baseinfo.vue
index a16d3bb..46091b1 100644
--- a/src/pagesLogin/profile/baseinfo.vue
+++ b/src/pagesLogin/profile/baseinfo.vue
@@ -1,7 +1,7 @@
- 用户名: {{ profile.userName }}
+ 姓名: {{ profile.userName }}
手机号码: {{ profile.phone }}
diff --git a/src/pagesReceive/pricing.vue b/src/pagesReceive/pricing.vue
index 57351a4..80b9438 100644
--- a/src/pagesReceive/pricing.vue
+++ b/src/pagesReceive/pricing.vue
@@ -17,9 +17,7 @@
{{ item.deviceName || "-" }}
- 收货单号:{{ item.receiptNumber }}
+ 收货单号:{{ item.receiptNumber }}
{{ item.userName }}
@@ -42,7 +40,11 @@
毛重:{{ item.grossWeight }}kg
- 单价:{{ state.scaleStatus === 0 ? '未定价' : item.price + '元/KG'}}
+ 单价:{{
+ state.scaleStatus === 0 ? "未定价" : item.price + "元/KG"
+ }}
= reactive({
pageNum: 1,
pageSize: 10,
});
+const resetPageList = () => {
+ pageList.noMoreData = false;
+ pageList.total = 0;
+ pageList.list = [];
+ pageList.pageNum = 1;
+ pageList.pageSize = 10;
+};
const state = reactive({
- scaleStatus: 0
-})
+ scaleStatus: 0,
+});
const isShowCancelModal = ref(false);
const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => {
@@ -100,8 +109,19 @@ const handleScenePhoto = (imagesId: number) => {
});
};
const pricingDetail = (id: number) => {
- uni.redirectTo({
- url: "/pagesReceive/form/pricingForm?id=" + id, // 要跳转到的页面路径
+ // 待过皮的时候 编辑前先查询当前状态 若是待过皮,则可继续编辑 否则提示该数据已处理 刷新当前页面
+ ReceiveApi.getDetailById({ id: id }).then((res: any) => {
+ if (res.code === 200) {
+ if (res.data.scaleStatus > 1) {
+ uni.showToast({title : '当前订单已处理'});
+ resetPageList();
+ getList();
+ } else {
+ uni.redirectTo({
+ url: "/pagesReceive/form/pricingForm?id=" + id, // 要跳转到的页面路径
+ });
+ }
+ }
});
};
@@ -143,14 +163,14 @@ onMounted(() => {
onLoad((option) => {
// 接收传递的标题参数
state.scaleStatus = parseInt((option as any).scaleStatus);
- // 设置页面标题
+ // 设置页面标题
if (state.scaleStatus === ScaleStatus.ToBePriced) {
uni.setNavigationBarTitle({
- title: '待定价',
+ title: "待定价",
});
} else if (state.scaleStatus === ScaleStatus.ToBeTare) {
uni.setNavigationBarTitle({
- title: '待过皮重',
+ title: "待过皮重",
});
}
});
diff --git a/src/pagesShipment/grossWeight.vue b/src/pagesShipment/grossWeight.vue
index b3a5e99..9156273 100644
--- a/src/pagesShipment/grossWeight.vue
+++ b/src/pagesShipment/grossWeight.vue
@@ -13,13 +13,13 @@
- 现场照片
- 过磅时间:{{ item.grossTime || '-' }}
+ 过磅时间:{{ item.grossTime || "-" }}
皮重:{{ item.tare }}kg
@@ -29,12 +29,12 @@
text="点击作废"
color="#E8E8E8"
:customStyle="{ color: '#999' }"
- @click="handleModal(true, (item.id as any))"
+ @click="handleModal(true, item.id as any)"
>
@@ -53,18 +53,20 @@
import { ShipmentApi } from "@/services/index";
import SmallModal from "@/components/Modal/smallModal.vue";
-interface PageResult {
- total: number;
- list: T[];
- pageNum: number;
- pageSize: number;
-}
-const pageList: PageResult = reactive({
+const pageList: PageResult = reactive({
+ noMoreData: false,
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
+const resetPageList = () => {
+ pageList.noMoreData = false;
+ pageList.total = 0;
+ pageList.list = [];
+ pageList.pageNum = 1;
+ pageList.pageSize = 10;
+};
const isShowCancelModal = ref(false);
const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => {
@@ -77,28 +79,57 @@ const handleScenePhoto = (imagesId: number) => {
});
};
const pricingDetail = (id: string) => {
- uni.navigateTo({
- url: "/pagesShipment/form/shipmentForm?id=" + id, // 要跳转到的页面路径
+ // 待过皮的时候 编辑前先查询当前状态 若是待过皮,则可继续编辑 否则提示该数据已处理 刷新当前页面
+ 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({
+ 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) {
- (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 = () => {
console.log(deleteId.value);
- ShipmentApi.deleteOrder({ids:[deleteId.value]}).then((res) => {
+ ShipmentApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
if (res.code === 200) {
- getOrderList();
+ getList();
}
});
};
onMounted(() => {
- getOrderList();
+ getList();
});