update: 更新出货产品显示

This commit is contained in:
admin 2024-04-17 09:51:39 +08:00
parent c5e191c697
commit 954126079a
6 changed files with 64 additions and 23 deletions

View File

@ -30,24 +30,43 @@
</view>
<view class="op-box">
<view class="btn" @click="edit(item)"> 编辑 </view>
<view class="btn" @click="deleteRole(item)"> 删除 </view>
<view class="btn" @click="handleModal(true, item.id)"> 删除 </view>
</view>
</view>
</view>
</page-view>
</view>
<SmallModal
:title="'确认删除吗?'"
:content="'确认删除后,不能恢复!'"
:okText="'确认删除'"
:isMain="true"
:show="isShowCancelModal"
@handleModal="(v:boolean) => {handleModal(v, deleteId)}"
@handleOk="handleOk()"
/>
</template>
<script setup lang="ts">
import { ProfileApi, StockCardApi } from "@/services";
import PageView from "@/components/PageView/index.vue";
const keyword = ref("");
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 = () => {
deleteRole({id: deleteId.value})
};
const state = reactive<any>({
name: "",
});
const pageList: PageResult<{
roleName: string;
id: number
}> = reactive({
noMoreData: false,
total: 0,

View File

@ -76,7 +76,7 @@ const handleSearch = () => {
};
const update = (item: any) => {
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then((res) => {
GoodsApi.deleteShmProducts({ id: item.id }).then((res) => {
if (res.code === 200) {
resetPageList();
getList();

View File

@ -129,7 +129,6 @@ const getList = (v?: boolean) => {
});
};
const handleOk = () => {
console.log(deleteId.value);
ReceiveApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
if (res.code === 200) {
getList();

View File

@ -5,23 +5,27 @@
<view v-if="isShipment">
<view v-for="(item, index) in state.list" :key="index">
<view class="first-title">{{ item.shmCategoryName }}</view>
<view class="dialog-product-layout">
<view v-if="item.childrenList">
<text
v-for="(cItem, cIndex) in item.childrenList"
:key="cIndex"
:class="{ active: state.current === cItem.id }"
@click="handleSelect(cItem)"
>{{ cItem.shmCategoryName }}</text
>
</view>
<view v-for="(cItem, cIndex) in item.childrenList" :key="cIndex">
<view class="second-title">{{ cItem.shmCategoryName }}</view>
<view v-else style="flex: auto;">
<u-empty
mode="data"
icon="http://cdn.uviewui.com/uview/empty/data.png"
>
</u-empty>
<view class="dialog-product-layout">
<view v-if="cItem.childrenLists">
<text
v-for="(child, childIndex) in cItem.childrenLists"
:key="childIndex"
:class="{ active: state.current === child.childIndex }"
@click="handleSelect(child)"
>{{ child.shmProductsName }}</text
>
</view>
<view v-else style="flex: auto">
<u-empty
mode="data"
icon="http://cdn.uviewui.com/uview/empty/data.png"
>
</u-empty>
</view>
</view>
</view>
</view>
@ -67,7 +71,7 @@ const getList = () => {
// }
// });
GoodsApi.getShipmentCategory().then((res) => {
GoodsApi.getChildrenList().then((res) => {
if (res.code === 200) {
if (res.code === 200) {
state.list = res.data;

View File

@ -136,7 +136,7 @@ const handleDialog = (key: string, v: boolean) => {
//
const changeProduct = (obj: any) => {
model1.order.productName = obj.shmCategoryName; //
model1.order.productName = obj.shmProductsName; //
model1.order.productId = obj.id; // Id,
};

View File

@ -193,3 +193,22 @@ export const getShipmentProductList = () => {
url: '/api/shmproducts/allShmProducts',
})
}
// 出货产品删除
export const deleteShmProducts = (data: any) => {
return http({
method: 'POST',
url: '/api/shmproducts/deleteShmProducts',
data,
})
}
// 出货产品分类树
export const getChildrenList = () => {
return http({
method: 'GET',
url: '/api/shmcategory/getChildrenList',
})
}