update: 更新出货产品显示
This commit is contained in:
parent
c5e191c697
commit
954126079a
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -5,18 +5,21 @@
|
|||
<view v-if="isShipment">
|
||||
<view v-for="(item, index) in state.list" :key="index">
|
||||
<view class="first-title">{{ item.shmCategoryName }}</view>
|
||||
<view v-for="(cItem, cIndex) in item.childrenList" :key="cIndex">
|
||||
<view class="second-title">{{ cItem.shmCategoryName }}</view>
|
||||
|
||||
<view class="dialog-product-layout">
|
||||
<view v-if="item.childrenList">
|
||||
<view v-if="cItem.childrenLists">
|
||||
<text
|
||||
v-for="(cItem, cIndex) in item.childrenList"
|
||||
:key="cIndex"
|
||||
:class="{ active: state.current === cItem.id }"
|
||||
@click="handleSelect(cItem)"
|
||||
>{{ cItem.shmCategoryName }}</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;">
|
||||
<view v-else style="flex: auto">
|
||||
<u-empty
|
||||
mode="data"
|
||||
icon="http://cdn.uviewui.com/uview/empty/data.png"
|
||||
|
@ -26,6 +29,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="dialog-product-layout" v-else>
|
||||
<text
|
||||
v-for="(item, index) in state.list"
|
||||
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
|
@ -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',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue