update: 供应商分类、供应商管理、客户管理、库存卡管理
This commit is contained in:
parent
954126079a
commit
3f3b65c9a7
|
@ -31,6 +31,8 @@
|
||||||
:clearable="true"
|
:clearable="true"
|
||||||
:customStyle="{}"
|
:customStyle="{}"
|
||||||
border="none"
|
border="none"
|
||||||
|
:disabled="item.type === 'select'"
|
||||||
|
disabledColor="#ffffff"
|
||||||
>
|
>
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<text>
|
<text>
|
||||||
|
@ -110,6 +112,10 @@ const formAttrList = reactive<any>([
|
||||||
childKey: "stockCard",
|
childKey: "stockCard",
|
||||||
required: true,
|
required: true,
|
||||||
fn: () => {
|
fn: () => {
|
||||||
|
if (contrlModalParams.stockCard.list.length === 0) {
|
||||||
|
uni.showToast({icon: 'none', title: '当前无可用卡号,请添加出库卡'})
|
||||||
|
return
|
||||||
|
}
|
||||||
contrlModalParams.stockCard.isShow = true;
|
contrlModalParams.stockCard.isShow = true;
|
||||||
contrlModalParams.stockCard.title = "卡号";
|
contrlModalParams.stockCard.title = "卡号";
|
||||||
},
|
},
|
||||||
|
@ -183,7 +189,7 @@ const startSave = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getStockCardList = () => {
|
const getStockCardList = () => {
|
||||||
StockCardApi.getStockCardListInfo({ vincolante: StockCardType.Receive }).then((res) => {
|
StockCardApi.getStockCardListInfo({ vincolante: StockCardType.Shipment }).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
contrlModalParams.stockCard.list = (res.data as any).map(
|
contrlModalParams.stockCard.list = (res.data as any).map(
|
||||||
(item: any) => {
|
(item: any) => {
|
||||||
|
|
|
@ -23,14 +23,16 @@
|
||||||
:placeholder="`请输入${item.name}`"
|
:placeholder="`请输入${item.name}`"
|
||||||
></u-textarea>
|
></u-textarea>
|
||||||
<u-input
|
<u-input
|
||||||
v-if="item.type === 'select' || item.type === 'input'"
|
v-if="item.type === 'select' || item.type === 'input' || item.type === 'selectCustom'"
|
||||||
v-model="(model1.formData as any)[item.key]"
|
v-model="(model1.formData as any)[item.key]"
|
||||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
:placeholder="`请${item.type.indexOf('select') > -1 ? '选择' : '输入'}${
|
||||||
item.name
|
item.name
|
||||||
}`"
|
}`"
|
||||||
:clearable="true"
|
:clearable="true"
|
||||||
:customStyle="{}"
|
:customStyle="{}"
|
||||||
border="none"
|
border="none"
|
||||||
|
:disabled="item.type === 'selectCustom'"
|
||||||
|
disabledColor="#ffffff"
|
||||||
>
|
>
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<text>
|
<text>
|
||||||
|
@ -38,14 +40,14 @@
|
||||||
</text>
|
</text>
|
||||||
</template>
|
</template>
|
||||||
</u-input>
|
</u-input>
|
||||||
<template #right v-if="item.type === 'select'">
|
<template #right v-if="item.type === 'select' || item.type === 'selectCustom'">
|
||||||
<u-icon name="arrow-right"></u-icon>
|
<u-icon name="arrow-right"></u-icon>
|
||||||
</template>
|
</template>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</u-form>
|
</u-form>
|
||||||
<block v-for="(item, index) in formAttrList" :key="index">
|
<block v-for="(item, index) in formAttrList" :key="index">
|
||||||
<u-action-sheet
|
<u-action-sheet
|
||||||
v-if="item.type === 'select'"
|
v-if="item.type === 'select' || item.type === 'selectCustom'"
|
||||||
:actions="contrlModalParams[item.childKey].list"
|
:actions="contrlModalParams[item.childKey].list"
|
||||||
:title="contrlModalParams[item.childKey].title"
|
:title="contrlModalParams[item.childKey].title"
|
||||||
:show="contrlModalParams[item.childKey].isShow"
|
:show="contrlModalParams[item.childKey].isShow"
|
||||||
|
@ -110,7 +112,7 @@ const formAttrList = reactive<any>([
|
||||||
{
|
{
|
||||||
name: "类型",
|
name: "类型",
|
||||||
key: "typeName",
|
key: "typeName",
|
||||||
type: "select",
|
type: "selectCustom",
|
||||||
childKey: "cardType",
|
childKey: "cardType",
|
||||||
required: true,
|
required: true,
|
||||||
fn: () => {
|
fn: () => {
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
:clearable="true"
|
:clearable="true"
|
||||||
:customStyle="{}"
|
:customStyle="{}"
|
||||||
border="none"
|
border="none"
|
||||||
|
@change="(e:any) => {handleInput(e, item)}"
|
||||||
|
:disabled="item.type === 'select'"
|
||||||
|
disabledColor="#ffffff"
|
||||||
>
|
>
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<text>
|
<text>
|
||||||
|
@ -63,9 +66,17 @@
|
||||||
import { StockCardApi, SupplierApi } from "@/services";
|
import { StockCardApi, SupplierApi } from "@/services";
|
||||||
import { formatDate } from "@/utils";
|
import { formatDate } from "@/utils";
|
||||||
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
|
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
|
||||||
|
import valid from "@/utils/validate";
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import _ from "underscore";
|
import _ from "underscore";
|
||||||
|
const handleInput = (e: any, item: any) => {
|
||||||
|
if (item.key === "phone" || item.key === 'bankNumber') {
|
||||||
|
const temp = e?.replace(valid.valid_number, "");
|
||||||
|
setTimeout(() => {
|
||||||
|
model1.formData[item.key] = temp;
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
};
|
||||||
const model1 = reactive<any>({
|
const model1 = reactive<any>({
|
||||||
formData: {},
|
formData: {},
|
||||||
});
|
});
|
||||||
|
@ -114,6 +125,10 @@ const formAttrList = reactive<any>([
|
||||||
childKey: "stockCard",
|
childKey: "stockCard",
|
||||||
required: true,
|
required: true,
|
||||||
fn: () => {
|
fn: () => {
|
||||||
|
if (contrlModalParams.stockCard.list.length === 0) {
|
||||||
|
uni.showToast({icon: 'none', title: '当前无可用卡号,请添加入库卡'})
|
||||||
|
return
|
||||||
|
}
|
||||||
contrlModalParams.stockCard.isShow = true;
|
contrlModalParams.stockCard.isShow = true;
|
||||||
contrlModalParams.stockCard.title = "卡号";
|
contrlModalParams.stockCard.title = "卡号";
|
||||||
},
|
},
|
||||||
|
@ -221,6 +236,18 @@ const check = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const save = () => {
|
const save = () => {
|
||||||
|
if (model1.formData.phone) {
|
||||||
|
if (!valid.mobile.pattern.test(model1.formData.phone)) {
|
||||||
|
uni.showToast({ icon: "none", title: "请输入正确的手机号" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (model1.formData.card) {
|
||||||
|
if (!valid.valid_id_card.pattern.test(model1.formData.card)) {
|
||||||
|
uni.showToast({ icon: "none", title: "请输入正确的身份证号码" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
check().then((res) => {
|
check().then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
startSave();
|
startSave();
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
></u-textarea>
|
></u-textarea>
|
||||||
<u-input
|
<u-input
|
||||||
v-if="item.type === 'select' || item.type === 'input'"
|
v-if="item.type === 'select' || item.type === 'input'"
|
||||||
:password="item.name === 'password'"
|
:password="item.key === 'password'"
|
||||||
v-model="(model1.formData as any)[item.key]"
|
v-model="(model1.formData as any)[item.key]"
|
||||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||||
item.name
|
item.name
|
||||||
|
@ -32,6 +32,10 @@
|
||||||
:clearable="true"
|
:clearable="true"
|
||||||
:customStyle="{}"
|
:customStyle="{}"
|
||||||
border="none"
|
border="none"
|
||||||
|
:maxlength="item.key === 'password' ? 6 : -1"
|
||||||
|
@change="(e:any) => {handleInput(e, item)}"
|
||||||
|
:disabled="item.type === 'select'"
|
||||||
|
disabledColor="#ffffff"
|
||||||
>
|
>
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<text>
|
<text>
|
||||||
|
@ -64,11 +68,20 @@
|
||||||
import { ProfileApi, StockCardApi } from "@/services";
|
import { ProfileApi, StockCardApi } from "@/services";
|
||||||
import { formatDate } from "@/utils";
|
import { formatDate } from "@/utils";
|
||||||
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
|
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
|
||||||
|
import valid from "@/utils/validate";
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import _ from "underscore";
|
import _ from "underscore";
|
||||||
|
const handleInput = (e: any, item: any) => {
|
||||||
|
if (item.key === "phone") {
|
||||||
|
const temp = e?.replace(valid.valid_number, "");
|
||||||
|
setTimeout(() => {
|
||||||
|
model1.formData[item.key] = temp;
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
};
|
||||||
const model1 = reactive<any>({
|
const model1 = reactive<any>({
|
||||||
formData: {},
|
formData: {
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
"formData.userName": {
|
"formData.userName": {
|
||||||
|
@ -159,7 +172,7 @@ const handleSelect = (key: string, v: any) => {
|
||||||
}
|
}
|
||||||
if (key === "gender") {
|
if (key === "gender") {
|
||||||
model1.formData.genderName = v.name;
|
model1.formData.genderName = v.name;
|
||||||
model1.formData.genderId = v.id;
|
model1.formData.gender = v.id;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -182,6 +195,12 @@ const check = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const save = () => {
|
const save = () => {
|
||||||
|
if (model1.formData.phone) {
|
||||||
|
if (!valid.mobile.pattern.test(model1.formData.phone)) {
|
||||||
|
uni.showToast({ icon: "none", title: "请输入正确的手机号" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
check().then((res) => {
|
check().then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
startSave();
|
startSave();
|
||||||
|
@ -227,11 +246,11 @@ onMounted(() => {
|
||||||
onLoad((option) => {
|
onLoad((option) => {
|
||||||
// 接收传递的标题参数;
|
// 接收传递的标题参数;
|
||||||
const title = (option as any).title;
|
const title = (option as any).title;
|
||||||
model1.formData = JSON.parse((option as any).item);
|
const obj = JSON.parse((option as any).item)
|
||||||
if (model1.formData.type === 1) {
|
model1.formData = {...obj, genderName: ['未知','男','女'][obj.gender]};
|
||||||
model1.formData.typeName = "出库卡";
|
if (obj.roleVos.length > 0) {
|
||||||
} else if (model1.formData.type === 2) {
|
model1.formData.roleIds = [obj.roleVos[0].id]
|
||||||
model1.formData.typeName = "入库卡";
|
model1.formData.roleName = obj.roleVos[0].roleName
|
||||||
}
|
}
|
||||||
// 设置页面标题;
|
// 设置页面标题;
|
||||||
if (title) {
|
if (title) {
|
||||||
|
|
|
@ -33,17 +33,38 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="op-box">
|
<view class="op-box">
|
||||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||||
<view class="btn" @click="deleteCustomer(item)"> 删除 </view>
|
<view class="btn" @click="handleModal(true, item.id)"> 删除 </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</page-view>
|
</page-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<SmallModal
|
||||||
|
:title="'确认删除吗?'"
|
||||||
|
:content="'确认删除后,不能恢复!'"
|
||||||
|
:okText="'确认删除'"
|
||||||
|
:isMain="true"
|
||||||
|
:show="isShowCancelModal"
|
||||||
|
@handleModal="(v:boolean) => {handleModal(v, deleteId)}"
|
||||||
|
@handleOk="handleOk()"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { CustomerApi } from "@/services";
|
import { CustomerApi } from "@/services";
|
||||||
import { UsersType } from "@/utils/enum";
|
import { UsersType } from "@/utils/enum";
|
||||||
import PageView from "@/components/PageView/index.vue";
|
import PageView from "@/components/PageView/index.vue";
|
||||||
|
import type { Customer } from "@/types/user";
|
||||||
|
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||||
|
const isShowCancelModal = ref(false);
|
||||||
|
const deleteId = ref(0);
|
||||||
|
const handleModal = (v: boolean, id: number) => {
|
||||||
|
isShowCancelModal.value = v;
|
||||||
|
deleteId.value = id;
|
||||||
|
};
|
||||||
|
const handleOk = () => {
|
||||||
|
deleteCustomer({id: deleteId.value})
|
||||||
|
};
|
||||||
const state = reactive<any>({
|
const state = reactive<any>({
|
||||||
name: "",
|
name: "",
|
||||||
});
|
});
|
||||||
|
|
|
@ -40,17 +40,37 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="op-box">
|
<view class="op-box">
|
||||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||||
<view class="btn" @click="deleteCustomer(item)"> 删除 </view>
|
<view class="btn" @click="handleModal(true, item.id)"> 删除 </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</page-view>
|
</page-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<SmallModal
|
||||||
|
:title="'确认删除吗?'"
|
||||||
|
:content="'确认删除后,不能恢复!'"
|
||||||
|
:okText="'确认删除'"
|
||||||
|
:isMain="true"
|
||||||
|
:show="isShowCancelModal"
|
||||||
|
@handleModal="(v:boolean) => {handleModal(v, deleteId)}"
|
||||||
|
@handleOk="handleOk()"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { StockCardApi } from "@/services";
|
import { StockCardApi } from "@/services";
|
||||||
import { StockCardType } from "@/utils/enum";
|
import { StockCardType } from "@/utils/enum";
|
||||||
import PageView from "@/components/PageView/index.vue";
|
import PageView from "@/components/PageView/index.vue";
|
||||||
|
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||||
|
const isShowCancelModal = ref(false);
|
||||||
|
const deleteId = ref(0);
|
||||||
|
const handleModal = (v: boolean, id: number) => {
|
||||||
|
isShowCancelModal.value = v;
|
||||||
|
deleteId.value = id;
|
||||||
|
};
|
||||||
|
const handleOk = () => {
|
||||||
|
deleteStockCard({id: deleteId.value})
|
||||||
|
};
|
||||||
|
|
||||||
const state = reactive<any>({
|
const state = reactive<any>({
|
||||||
name: "",
|
name: "",
|
||||||
|
@ -80,7 +100,7 @@ const edit = (item: any) => {
|
||||||
JSON.stringify(item), // 要跳转到的页面路径
|
JSON.stringify(item), // 要跳转到的页面路径
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const deleteCustomer = (item: any) => {
|
const deleteStockCard = (item: any) => {
|
||||||
StockCardApi.updateStockCard({ isDeleted: true, id: item.id }).then((res) => {
|
StockCardApi.updateStockCard({ isDeleted: true, id: item.id }).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
resetPageList();
|
resetPageList();
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="op-box">
|
<view class="op-box">
|
||||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||||
<view class="btn" @click="update(item)"> 删除 </view>
|
<view class="btn" @click="handleModal(true, item.id)"> 删除 </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -50,18 +50,38 @@
|
||||||
@close="state.isShowType = false"
|
@close="state.isShowType = false"
|
||||||
@select="handleSelect"
|
@select="handleSelect"
|
||||||
></u-action-sheet>
|
></u-action-sheet>
|
||||||
|
|
||||||
|
<SmallModal
|
||||||
|
:title="'确认删除吗?'"
|
||||||
|
:content="'确认删除后,不能恢复!'"
|
||||||
|
:okText="'确认删除'"
|
||||||
|
:isMain="true"
|
||||||
|
:show="isShowCancelModal"
|
||||||
|
@handleModal="(v:boolean) => {handleModal(v, deleteId)}"
|
||||||
|
@handleOk="handleOk()"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { SupplierApi } from "@/services";
|
import { SupplierApi } from "@/services";
|
||||||
import { UsersType } from "@/utils/enum";
|
import { UsersType } from "@/utils/enum";
|
||||||
import PageView from "@/components/PageView/index.vue";
|
import PageView from "@/components/PageView/index.vue";
|
||||||
|
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||||
|
const isShowCancelModal = ref(false);
|
||||||
|
const deleteId = ref(0);
|
||||||
|
const handleModal = (v: boolean, id: number) => {
|
||||||
|
isShowCancelModal.value = v;
|
||||||
|
deleteId.value = id;
|
||||||
|
};
|
||||||
|
const handleOk = () => {
|
||||||
|
update({id: deleteId.value})
|
||||||
|
};
|
||||||
const state = reactive<any>({
|
const state = reactive<any>({
|
||||||
name: "",
|
name: "",
|
||||||
supplierTypeId: -1,
|
supplierTypeId: -1,
|
||||||
isShowType: false,
|
isShowType: false,
|
||||||
typeList: [],
|
typeList: [],
|
||||||
});
|
});
|
||||||
const pageList: PageResult<User> = reactive({
|
const pageList: PageResult<Supplier> = reactive({
|
||||||
total: 0,
|
total: 0,
|
||||||
list: [],
|
list: [],
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
|
|
|
@ -30,23 +30,40 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="op-box">
|
<view class="op-box">
|
||||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||||
<view class="btn" @click="deleteType(item)"> 删除 </view>
|
<view class="btn" @click="handleModal(true, item.id)"> 删除 </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</page-view>
|
</page-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<SmallModal
|
||||||
|
:title="'确认删除吗?'"
|
||||||
|
:content="'确认删除后,不能恢复!'"
|
||||||
|
:okText="'确认删除'"
|
||||||
|
:isMain="true"
|
||||||
|
:show="isShowCancelModal"
|
||||||
|
@handleModal="(v:boolean) => {handleModal(v, deleteId)}"
|
||||||
|
@handleOk="handleOk()"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { StockCardApi, SupplierApi } from "@/services";
|
import { StockCardApi, SupplierApi } from "@/services";
|
||||||
import PageView from "@/components/PageView/index.vue";
|
import PageView from "@/components/PageView/index.vue";
|
||||||
|
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||||
const keyword = ref("");
|
const isShowCancelModal = ref(false);
|
||||||
|
const deleteId = ref(0);
|
||||||
|
const handleModal = (v: boolean, id: number) => {
|
||||||
|
isShowCancelModal.value = v;
|
||||||
|
deleteId.value = id;
|
||||||
|
};
|
||||||
|
const handleOk = () => {
|
||||||
|
deleteType({id: deleteId.value})
|
||||||
|
};
|
||||||
const state = reactive<any>({
|
const state = reactive<any>({
|
||||||
name: "",
|
name: "",
|
||||||
});
|
});
|
||||||
const pageList: PageResult<StockCard> = reactive({
|
const pageList: PageResult<SupplierType> = reactive({
|
||||||
noMoreData: false,
|
noMoreData: false,
|
||||||
total: 0,
|
total: 0,
|
||||||
list: [],
|
list: [],
|
||||||
|
|
|
@ -35,20 +35,38 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="op-box">
|
<view class="op-box">
|
||||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||||
<view class="btn" @click="deleteCustomer(item)"> 下线 </view>
|
<view class="btn" @click="handleModal(true, item.id)"> 删除 </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</page-view>
|
</page-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<SmallModal
|
||||||
|
:title="'确认删除吗?'"
|
||||||
|
:content="'确认删除后,不能恢复!'"
|
||||||
|
:okText="'确认删除'"
|
||||||
|
:isMain="true"
|
||||||
|
:show="isShowCancelModal"
|
||||||
|
@handleModal="(v:boolean) => {handleModal(v, deleteId)}"
|
||||||
|
@handleOk="handleOk()"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import PageView from "@/components/PageView/index.vue";
|
import PageView from "@/components/PageView/index.vue";
|
||||||
import { ProfileApi, StockCardApi } from "@/services";
|
import { ProfileApi } from "@/services";
|
||||||
import { pageListInit } from "@/utils";
|
import type { User } from "@/types/user";
|
||||||
import { StockCardType } from "@/utils/enum";
|
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||||
|
|
||||||
const keyword = ref("");
|
const isShowCancelModal = ref(false);
|
||||||
|
const deleteId = ref(0);
|
||||||
|
const handleModal = (v: boolean, id: number) => {
|
||||||
|
isShowCancelModal.value = v;
|
||||||
|
deleteId.value = id;
|
||||||
|
};
|
||||||
|
const handleOk = () => {
|
||||||
|
deleteCustomer({id: deleteId.value})
|
||||||
|
};
|
||||||
|
|
||||||
const state = reactive<any>({
|
const state = reactive<any>({
|
||||||
name: "",
|
name: "",
|
||||||
|
@ -75,6 +93,7 @@ const edit = (item: any) => {
|
||||||
const deleteCustomer = (item: any) => {
|
const deleteCustomer = (item: any) => {
|
||||||
ProfileApi.updateUserByIdOffline({ id: item.id }).then((res) => {
|
ProfileApi.updateUserByIdOffline({ id: item.id }).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
resetPageList();
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
type SupplierType = {
|
||||||
|
id: number,
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
|
||||||
|
type Supplier = {
|
||||||
|
id: number,
|
||||||
|
name: string,
|
||||||
|
cardCode: string,
|
||||||
|
}
|
|
@ -207,6 +207,7 @@ interface ReceiveProduct {
|
||||||
// 库存卡
|
// 库存卡
|
||||||
|
|
||||||
interface StockCard {
|
interface StockCard {
|
||||||
|
id: number
|
||||||
cardCode?: string,
|
cardCode?: string,
|
||||||
type?: number, // 库存卡类型1=出库2=入库
|
type?: number, // 库存卡类型1=出库2=入库
|
||||||
cardCode?: string,
|
cardCode?: string,
|
||||||
|
|
|
@ -16,6 +16,7 @@ export type User = {
|
||||||
} & BaseField;
|
} & BaseField;
|
||||||
|
|
||||||
interface Customer {
|
interface Customer {
|
||||||
|
id: number,
|
||||||
name?: string,
|
name?: string,
|
||||||
stockCardId?: number,
|
stockCardId?: number,
|
||||||
contacts?:string,
|
contacts?:string,
|
||||||
|
|
|
@ -24,6 +24,10 @@ const valid = {
|
||||||
valid_decimal: {
|
valid_decimal: {
|
||||||
pattern: /[^0-9.]/g,
|
pattern: /[^0-9.]/g,
|
||||||
message: "请输入正确的数字",
|
message: "请输入正确的数字",
|
||||||
|
},
|
||||||
|
valid_id_card: {
|
||||||
|
pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
||||||
|
message: '请输入正确的身份证号码'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
export default valid;
|
export default valid;
|
||||||
|
|
Loading…
Reference in New Issue