update: 更新常用应用分页以及非空校验
This commit is contained in:
parent
26e2e82669
commit
1dc643ca8a
|
@ -7,9 +7,10 @@
|
|||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
|
@ -53,7 +54,6 @@
|
|||
:closeOnClickAction="true"
|
||||
:scroll="true"
|
||||
></u-action-sheet>
|
||||
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
|
@ -71,16 +71,40 @@ const model1 = reactive<any>({
|
|||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
"formData.reProductsName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
message: "请输入货产品",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
"formData.reCategoryName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
message: "请选择收货分类",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.substationName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入所属分站",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.minPrice": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入最低价",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.maxPrice": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入最高价",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.commonPrice": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入常用价格",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
|
@ -150,7 +174,32 @@ const handleSelect = (key: string, v: any) => {
|
|||
}
|
||||
};
|
||||
|
||||
const form = ref();
|
||||
const check = () => {
|
||||
return new Promise((resolve) => {
|
||||
form.value
|
||||
.validate()
|
||||
.then((res: boolean) => {
|
||||
resolve(res);
|
||||
})
|
||||
.catch((errors: any) => {
|
||||
resolve(false);
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: errors[0].message || "校验失败",
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
};
|
||||
const startSave = () => {
|
||||
if (model1.formData.id) {
|
||||
GoodsApi.EditReceiveProduct(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
|
@ -69,16 +70,10 @@ const model1 = reactive<any>({
|
|||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
"formData.reCategoryName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
message: "请输入收货分类",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
|
@ -86,14 +81,17 @@ const contrlModalParams = reactive<any>({
|
|||
cardType: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [{
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
name: '出库卡'
|
||||
},{
|
||||
name: "出库卡",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '入库卡'
|
||||
}],
|
||||
}
|
||||
name: "入库卡",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
|
@ -112,8 +110,32 @@ const handleSelect = (key: string, v: any) => {
|
|||
model1.formData.type = v.id;
|
||||
}
|
||||
};
|
||||
const form = ref();
|
||||
const check = () => {
|
||||
return new Promise((resolve) => {
|
||||
form.value
|
||||
.validate()
|
||||
.then((res: boolean) => {
|
||||
resolve(res);
|
||||
})
|
||||
.catch((errors: any) => {
|
||||
resolve(false);
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: errors[0].message || "校验失败",
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
};
|
||||
const startSave = () => {
|
||||
if (model1.formData.id) {
|
||||
GoodsApi.editReceiveCategory(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
@ -133,15 +155,14 @@ const save = () => {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
const title = (option as any).title;
|
||||
model1.formData = JSON.parse((option as any).item);
|
||||
if (model1.formData.type === 1) {
|
||||
model1.formData.typeName = '出库卡'
|
||||
model1.formData.typeName = "出库卡";
|
||||
} else if (model1.formData.type === 2) {
|
||||
model1.formData.typeName = '入库卡'
|
||||
model1.formData.typeName = "入库卡";
|
||||
}
|
||||
// 设置页面标题
|
||||
uni.setNavigationBarTitle({
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
|
@ -96,18 +97,12 @@ const model1 = reactive<any>({
|
|||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
"formData.roleName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
message: "请输入角色名称",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
}
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
checkedMap: {},
|
||||
|
@ -121,6 +116,7 @@ const formAttrList = reactive<any>([
|
|||
name: "角色名称",
|
||||
key: "roleName",
|
||||
type: "input",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "权限配置",
|
||||
|
@ -138,8 +134,32 @@ const formAttrList = reactive<any>([
|
|||
// model1.formData.roleIds = [v.id];
|
||||
// }
|
||||
// };
|
||||
const form = ref();
|
||||
const check = () => {
|
||||
return new Promise((resolve) => {
|
||||
form.value
|
||||
.validate()
|
||||
.then((res: boolean) => {
|
||||
resolve(res);
|
||||
})
|
||||
.catch((errors: any) => {
|
||||
resolve(false);
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: errors[0].message || "校验失败",
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
};
|
||||
const startSave = () => {
|
||||
let list: any = [];
|
||||
contrlModalParams.menu.list.forEach((item: any) => {
|
||||
item.childrenList.forEach((c: any) => {
|
||||
|
@ -149,13 +169,15 @@ const save = () => {
|
|||
});
|
||||
});
|
||||
if (model1.formData.id) {
|
||||
ProfileApi.updateRole({...deleteBaseKey(model1.formData), list}).then((res) => {
|
||||
ProfileApi.updateRole({ ...deleteBaseKey(model1.formData), list }).then(
|
||||
(res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/role", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
} else {
|
||||
ProfileApi.addRole({ ...model1.formData, list }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
|
@ -81,21 +82,21 @@ import { formatDate } from "@/utils";
|
|||
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
"formData.shmProductsName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
message: "请输入出货产品",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
"formData.reCategoryName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
message: "请选择出货分类",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
|
@ -154,21 +155,45 @@ const handleChange = (e: any) => {
|
|||
|
||||
const confirm = (e: any) => {
|
||||
if (e.value[1]) {
|
||||
model1.formData.shmCategoryId = e.value[1].id
|
||||
model1.formData.reCategoryName = e.value[1].shmCategoryName
|
||||
contrlModalParams['reCategory'].isShow = false
|
||||
model1.formData.shmCategoryId = e.value[1].id;
|
||||
model1.formData.reCategoryName = e.value[1].shmCategoryName;
|
||||
contrlModalParams["reCategory"].isShow = false;
|
||||
}
|
||||
};
|
||||
const form = ref();
|
||||
const check = () => {
|
||||
return new Promise((resolve) => {
|
||||
form.value
|
||||
.validate()
|
||||
.then((res: boolean) => {
|
||||
resolve(res);
|
||||
})
|
||||
.catch((errors: any) => {
|
||||
resolve(false);
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: errors[0].message || "校验失败",
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
};
|
||||
const startSave = () => {
|
||||
if (model1.formData.id) {
|
||||
// GoodsApi.EditReceiveProduct(model1.formData).then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// uni.redirectTo({
|
||||
// url: "/pagesApp/shipmentProduct", // 要跳转到的页面路径
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
GoodsApi.editShipmentProduct(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/shipmentProduct", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
GoodsApi.addShipmentProduct(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
|
@ -69,16 +70,16 @@ const model1 = reactive<any>({
|
|||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
"formData.parentName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
message: "请选择上级菜单",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
"formData.shmCategoryName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
message: "请输入出货分类",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
|
@ -86,11 +87,13 @@ const contrlModalParams = reactive<any>({
|
|||
parent: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [{
|
||||
list: [
|
||||
{
|
||||
id: 0,
|
||||
name: '主分类'
|
||||
}],
|
||||
}
|
||||
name: "主分类",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
|
@ -120,8 +123,32 @@ const handleSelect = (key: string, v: any) => {
|
|||
model1.formData.parentId = v.id;
|
||||
}
|
||||
};
|
||||
const form = ref();
|
||||
const check = () => {
|
||||
return new Promise((resolve) => {
|
||||
form.value
|
||||
.validate()
|
||||
.then((res: boolean) => {
|
||||
resolve(res);
|
||||
})
|
||||
.catch((errors: any) => {
|
||||
resolve(false);
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: errors[0].message || "校验失败",
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
};
|
||||
const startSave = () => {
|
||||
if (model1.formData.id) {
|
||||
GoodsApi.editReceiveCategory(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
@ -141,7 +168,6 @@ const save = () => {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
const title = (option as any).title;
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
|
@ -60,7 +61,7 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { StockCardApi } from "@/services";
|
||||
import { formatDate } from "@/utils";
|
||||
import { deleteBaseKey, formatDate } from "@/utils";
|
||||
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
|
@ -69,31 +70,34 @@ const model1 = reactive<any>({
|
|||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
"formData.cardCode": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
message: "请输入卡号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
"formData.typeName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
message: "请选择类型",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
}
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
cardType: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [{
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
name: '出库卡'
|
||||
},{
|
||||
name: "出库卡",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '入库卡'
|
||||
}],
|
||||
}
|
||||
name: "入库卡",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
|
@ -123,10 +127,34 @@ const handleSelect = (key: string, v: any) => {
|
|||
model1.formData.type = v.id;
|
||||
}
|
||||
};
|
||||
const form = ref();
|
||||
const check = () => {
|
||||
return new Promise((resolve) => {
|
||||
form.value
|
||||
.validate()
|
||||
.then((res: boolean) => {
|
||||
resolve(res);
|
||||
})
|
||||
.catch((errors: any) => {
|
||||
resolve(false);
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: errors[0].message || "校验失败",
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
};
|
||||
const startSave = () => {
|
||||
if (model1.formData.id) {
|
||||
StockCardApi.updateStockCard(model1.formData).then((res) => {
|
||||
StockCardApi.updateStockCard({...deleteBaseKey(model1.formData)}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/stockCard", // 要跳转到的页面路径
|
||||
|
@ -144,15 +172,14 @@ const save = () => {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
const title = (option as any).title;
|
||||
model1.formData = JSON.parse((option as any).item);
|
||||
if (model1.formData.type === 1) {
|
||||
model1.formData.typeName = '出库卡'
|
||||
model1.formData.typeName = "出库卡";
|
||||
} else if (model1.formData.type === 2) {
|
||||
model1.formData.typeName = '入库卡'
|
||||
model1.formData.typeName = "入库卡";
|
||||
}
|
||||
// 设置页面标题
|
||||
uni.setNavigationBarTitle({
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
|
@ -69,31 +70,28 @@ const model1 = reactive<any>({
|
|||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
"formData.name": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
message: "请输入供应商分类",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
}
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
cardType: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [{
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
name: '出库卡'
|
||||
},{
|
||||
name: "出库卡",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '入库卡'
|
||||
}],
|
||||
}
|
||||
name: "入库卡",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
|
@ -113,7 +111,33 @@ const handleSelect = (key: string, v: any) => {
|
|||
}
|
||||
};
|
||||
|
||||
const form = ref();
|
||||
const check = () => {
|
||||
return new Promise((resolve) => {
|
||||
form.value
|
||||
.validate()
|
||||
.then((res: boolean) => {
|
||||
resolve(res);
|
||||
})
|
||||
.catch((errors: any) => {
|
||||
resolve(false);
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: errors[0].message || "校验失败",
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const startSave = () => {
|
||||
if (model1.formData.id) {
|
||||
SupplierApi.updateSupplierType(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
@ -133,15 +157,14 @@ const save = () => {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
const title = (option as any).title;
|
||||
model1.formData = JSON.parse((option as any).item);
|
||||
if (model1.formData.type === 1) {
|
||||
model1.formData.typeName = '出库卡'
|
||||
model1.formData.typeName = "出库卡";
|
||||
} else if (model1.formData.type === 2) {
|
||||
model1.formData.typeName = '入库卡'
|
||||
model1.formData.typeName = "入库卡";
|
||||
}
|
||||
// 设置页面标题
|
||||
uni.setNavigationBarTitle({
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
|
@ -70,13 +71,13 @@ const model1 = reactive<any>({
|
|||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
"formData.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
message: "请输入用户名",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
"formData.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
|
@ -92,14 +93,16 @@ const contrlModalParams = reactive<any>({
|
|||
gender: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [{
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
name: '男'
|
||||
name: "男",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '女'
|
||||
}],
|
||||
name: "女",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -160,7 +163,33 @@ const handleSelect = (key: string, v: any) => {
|
|||
}
|
||||
};
|
||||
|
||||
const form = ref();
|
||||
const check = () => {
|
||||
return new Promise((resolve) => {
|
||||
form.value
|
||||
.validate()
|
||||
.then((res: boolean) => {
|
||||
resolve(res);
|
||||
})
|
||||
.catch((errors: any) => {
|
||||
resolve(false);
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: errors[0].message || "校验失败",
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const startSave = () => {
|
||||
if (model1.formData.id) {
|
||||
ProfileApi.updateUserById(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
|
|
@ -13,6 +13,17 @@
|
|||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="100"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="box" v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>
|
||||
|
@ -25,11 +36,13 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</page-view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { GoodsApi } from "@/services";
|
||||
import { UsersType } from "@/utils/enum";
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
supplierTypeId: -1,
|
||||
|
@ -41,24 +54,33 @@ const pageList: PageResult<{
|
|||
minPrice: number;
|
||||
maxPrice: number;
|
||||
}> = reactive({
|
||||
isLoading: false,
|
||||
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 handleSearch = () => {
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
|
||||
const update = (item: any) => {
|
||||
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then(
|
||||
(res) => {
|
||||
|
||||
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
resetPageList();
|
||||
getList();
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
const edit = (item: any) => {
|
||||
|
@ -68,17 +90,28 @@ const edit = (item: any) => {
|
|||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const getList = () => {
|
||||
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: 10,
|
||||
pageNum: 1,
|
||||
pageSize: pageList.pageSize,
|
||||
pageNum: pageList.pageNum,
|
||||
reProductsName: state.name,
|
||||
};
|
||||
GoodsApi.getReceiveProductListByPage(params).then((res) => {
|
||||
pageList.isLoading = true;
|
||||
GoodsApi.getReceiveProductListByPage(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 as any).list = (pageList as any).list = pageList.list.concat(
|
||||
res.data.list
|
||||
);
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
></u-search>
|
||||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="100"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="box">
|
||||
<view v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
|
@ -23,23 +34,32 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</page-view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { GoodsApi } from "@/services";
|
||||
import { StockCardType } from "@/utils/enum";
|
||||
|
||||
const keyword = ref("");
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
});
|
||||
const pageList: PageResult<{ reCategoryName: string }> = reactive({
|
||||
isLoading: false,
|
||||
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 add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addReceiveType", // 要跳转到的页面路径
|
||||
|
@ -55,27 +75,40 @@ const edit = (item: any) => {
|
|||
const deleteType = (item: any) => {
|
||||
GoodsApi.editReceiveCategory({ isDeleted: true, id: item.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
resetPageList();
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleSearch = () => {
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
const getList = () => {
|
||||
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: 10,
|
||||
pageNum: 1,
|
||||
pageSize: pageList.pageSize,
|
||||
pageNum: pageList.pageNum,
|
||||
reCategoryName: state.name,
|
||||
};
|
||||
if (state.supplierTypeId > -1) {
|
||||
params.supplierTypeId = state.supplierTypeId;
|
||||
}
|
||||
GoodsApi.getPage(params).then((res) => {
|
||||
pageList.isLoading = true;
|
||||
GoodsApi.getPage(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 as any).list = (pageList as any).list = pageList.list.concat(
|
||||
res.data.list
|
||||
);
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="100"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="box">
|
||||
<view v-for="(item, index) in pageList.list" :key="index">
|
||||
|
@ -27,7 +30,7 @@
|
|||
</view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
<view class="btn" @click="deleteCustomer(item)"> 删除 </view>
|
||||
<view class="btn" @click="deleteRole(item)"> 删除 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -52,6 +55,13 @@ const pageList: PageResult<{
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const resetPageList = () => {
|
||||
pageList.noMoreData = false;
|
||||
pageList.total = 0;
|
||||
pageList.list = [];
|
||||
pageList.pageNum = 1;
|
||||
pageList.pageSize = 10;
|
||||
};
|
||||
const add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addRole", // 要跳转到的页面路径
|
||||
|
@ -64,14 +74,16 @@ const edit = (item: any) => {
|
|||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const deleteCustomer = (item: any) => {
|
||||
StockCardApi.updateStockCard({ isDeleted: true, id: item.id }).then((res) => {
|
||||
const deleteRole = (item: any) => {
|
||||
ProfileApi.updateRole({ isDeleted: true, id: item.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
resetPageList()
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleSearch = () => {
|
||||
resetPageList()
|
||||
getList();
|
||||
};
|
||||
const getList = (v?: boolean) => {
|
||||
|
@ -92,7 +104,6 @@ const getList = (v?: boolean) => {
|
|||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
(pageList as any).list = res.data as any;
|
||||
pageList.total = (res.data as any).total
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -13,11 +13,24 @@
|
|||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="100"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="box" v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>
|
||||
<view>{{ item.shmProductsName }}</view>
|
||||
<view>分类:{{ item.parentName }} / {{ item.shmCategoryName }} </view>
|
||||
<view
|
||||
>分类:{{ item.parentName }} / {{ item.shmCategoryName }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
|
@ -25,11 +38,13 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</page-view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { GoodsApi } from "@/services";
|
||||
import { UsersType } from "@/utils/enum";
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
supplierTypeId: -1,
|
||||
|
@ -41,24 +56,32 @@ const pageList: PageResult<{
|
|||
parentName: string;
|
||||
shmCategoryName: string;
|
||||
}> = reactive({
|
||||
isLoading: false,
|
||||
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 handleSearch = () => {
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
|
||||
const update = (item: any) => {
|
||||
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then(
|
||||
(res) => {
|
||||
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
resetPageList();
|
||||
getList();
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
const edit = (item: any) => {
|
||||
|
@ -68,17 +91,26 @@ const edit = (item: any) => {
|
|||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const getList = () => {
|
||||
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: 10,
|
||||
pageNum: 1,
|
||||
pageSize: pageList.pageSize,
|
||||
pageNum: pageList.pageNum,
|
||||
name: state.name,
|
||||
};
|
||||
GoodsApi.getShipmentProductByPage(params).then((res) => {
|
||||
GoodsApi.getShipmentProductByPage(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (res.data as any).list;
|
||||
}
|
||||
(pageList as any).list = (pageList as any).list = pageList.list.concat(
|
||||
res.data.list
|
||||
);
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="100"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="box">
|
||||
<view v-for="(item, index) in pageList.list" :key="index">
|
||||
|
@ -38,19 +41,26 @@
|
|||
import { GoodsApi } from "@/services";
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
|
||||
|
||||
const keyword = ref("");
|
||||
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
});
|
||||
const pageList: PageResult<{ reCategoryName: string }> = reactive({
|
||||
isLoading: false,
|
||||
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 add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addShipmentType", // 要跳转到的页面路径
|
||||
|
@ -71,19 +81,20 @@ const deleteType = (item: any) => {
|
|||
});
|
||||
};
|
||||
const handleSearch = () => {
|
||||
resetPageList()
|
||||
getList();
|
||||
};
|
||||
|
||||
const getList = (v?: boolean) => {
|
||||
if (v) {
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
|
||||
pageList.pageNum ++
|
||||
pageList.pageNum++;
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) <= pageList.pageNum) {
|
||||
pageList.noMoreData = true
|
||||
pageList.noMoreData = true;
|
||||
}
|
||||
} else {
|
||||
pageList.noMoreData = true
|
||||
return
|
||||
pageList.noMoreData = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
let params: any = {
|
||||
|
@ -96,8 +107,10 @@ const getList = (v?: boolean) => {
|
|||
}
|
||||
GoodsApi.getPage(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (pageList as any).list.concat((res.data as any).list);
|
||||
pageList.total = (res.data as any).total
|
||||
(pageList as any).list = (pageList as any).list.concat(
|
||||
(res.data as any).list
|
||||
);
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -12,12 +12,31 @@
|
|||
></u-search>
|
||||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="100"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="box">
|
||||
<view v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>{{item.type === StockCardType.Shipment ? '客户' : '供应商'}}:{{ item.name }}</view>
|
||||
<view
|
||||
>{{
|
||||
item.type === StockCardType.Shipment ? "客户" : "供应商"
|
||||
}}:{{ item.name }}</view
|
||||
>
|
||||
<view>卡号:{{ item.cardCode }}</view>
|
||||
<view>类型:{{ item.type === StockCardType.Shipment ? '出库卡' : '入库卡' }}</view>
|
||||
<view
|
||||
>类型:{{
|
||||
item.type === StockCardType.Shipment ? "出库卡" : "入库卡"
|
||||
}}</view
|
||||
>
|
||||
</view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
|
@ -25,13 +44,13 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</page-view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { StockCardApi } from "@/services";
|
||||
import { StockCardType } from "@/utils/enum";
|
||||
|
||||
const keyword = ref("");
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
|
@ -42,6 +61,13 @@ const pageList: PageResult<StockCard> = reactive({
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const resetPageList = () => {
|
||||
pageList.noMoreData = false;
|
||||
pageList.total = 0;
|
||||
pageList.list = [];
|
||||
pageList.pageNum = 1;
|
||||
pageList.pageSize = 10;
|
||||
};
|
||||
const add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addStockCard", // 要跳转到的页面路径
|
||||
|
@ -57,18 +83,28 @@ const edit = (item: any) => {
|
|||
const deleteCustomer = (item: any) => {
|
||||
StockCardApi.updateStockCard({ isDeleted: true, id: item.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
resetPageList();
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleSearch = () => {
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
const getList = () => {
|
||||
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: 10,
|
||||
pageNum: 1,
|
||||
name: state.name,
|
||||
pageSize: pageList.pageSize,
|
||||
pageNum: pageList.pageNum,
|
||||
cardCode: state.name,
|
||||
};
|
||||
if (state.supplierTypeId > -1) {
|
||||
params.supplierTypeId = state.supplierTypeId;
|
||||
|
|
|
@ -76,11 +76,11 @@ const resetPageList = () => {
|
|||
};
|
||||
const handleSelect = (v: any) => {
|
||||
state.supplierTypeId = v.id;
|
||||
resetPageList()
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
const handleSearch = () => {
|
||||
resetPageList()
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
|
||||
|
@ -88,7 +88,7 @@ const update = (item: any) => {
|
|||
SupplierApi.updateSupplierUser({ isDeleted: true, id: item.id }).then(
|
||||
(res) => {
|
||||
if (res.code === 200) {
|
||||
resetPageList()
|
||||
resetPageList();
|
||||
getList();
|
||||
}
|
||||
}
|
||||
|
@ -120,10 +120,12 @@ const getList = (v?: boolean) => {
|
|||
params.supplierTypeId = state.supplierTypeId;
|
||||
}
|
||||
pageList.isLoading = true;
|
||||
SupplierApi.getSupplierUserPage(params).then((res) => {
|
||||
SupplierApi.getSupplierUserPage(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
(pageList as any).list = (res.data as any).list;
|
||||
(pageList as any).list = (pageList as any).list = pageList.list.concat(
|
||||
res.data.list
|
||||
);
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
});
|
||||
|
@ -131,7 +133,7 @@ const getList = (v?: boolean) => {
|
|||
const getSupplierTypeList = () => {
|
||||
SupplierApi.getSupplierTypeList().then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
state.typeList = [{id: -1, name: '全部'}].concat(res.data);
|
||||
state.typeList = [{ id: -1, name: "全部" }].concat(res.data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="100"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="box">
|
||||
<view v-for="(item, index) in pageList.list" :key="index">
|
||||
|
@ -50,6 +53,13 @@ const pageList: PageResult<StockCard> = reactive({
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const resetPageList = () => {
|
||||
pageList.noMoreData = false;
|
||||
pageList.total = 0;
|
||||
pageList.list = [];
|
||||
pageList.pageNum = 1;
|
||||
pageList.pageSize = 10;
|
||||
};
|
||||
const add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addSupplierType", // 要跳转到的页面路径
|
||||
|
@ -66,12 +76,14 @@ const deleteType = (item: any) => {
|
|||
SupplierApi.updateSupplierType({ isDeleted: true, id: item.id }).then(
|
||||
(res) => {
|
||||
if (res.code === 200) {
|
||||
resetPageList();
|
||||
getList();
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
const handleSearch = () => {
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
const getList = (v?: boolean) => {
|
||||
|
@ -79,7 +91,7 @@ const getList = (v?: boolean) => {
|
|||
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
|
||||
pageList.pageNum++;
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) <= pageList.pageNum) {
|
||||
pageList.noMoreData = true
|
||||
pageList.noMoreData = true;
|
||||
}
|
||||
} else {
|
||||
pageList.noMoreData = true;
|
||||
|
@ -94,10 +106,14 @@ const getList = (v?: boolean) => {
|
|||
if (state.supplierTypeId > -1) {
|
||||
params.supplierTypeId = state.supplierTypeId;
|
||||
}
|
||||
SupplierApi.getSupplierTypePage(params).then((res) => {
|
||||
pageList.isLoading = true;
|
||||
SupplierApi.getSupplierTypePage(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 as any).list = (pageList as any).list = pageList.list.concat(
|
||||
res.data.list
|
||||
);
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -168,6 +168,15 @@ export const addShipmentProduct = (data: any) => {
|
|||
})
|
||||
}
|
||||
|
||||
// 出货产品编辑
|
||||
export const editShipmentProduct = (data: any) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/api/shmproducts/edit',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 出货产品分页查询
|
||||
export const getShipmentProductByPage = (data: any) => {
|
||||
return http({
|
||||
|
|
|
@ -59,10 +59,10 @@ export const addRole = (data: { roleCode: string; roleName: string }) => {
|
|||
};
|
||||
// 修改角色
|
||||
export const updateRole = (data: {
|
||||
id: string;
|
||||
roleCode: string;
|
||||
roleName: string;
|
||||
isDeleted: string;
|
||||
id?: string;
|
||||
roleCode?: string;
|
||||
roleName?: string;
|
||||
isDeleted?: boolean;
|
||||
}) => {
|
||||
return http({
|
||||
method: "POST",
|
||||
|
|
Loading…
Reference in New Issue