update: 更新出货产品显示
This commit is contained in:
parent
c5e191c697
commit
954126079a
|
@ -30,24 +30,43 @@
|
||||||
</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="deleteRole(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 { ProfileApi, StockCardApi } from "@/services";
|
import { ProfileApi, StockCardApi } 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 = () => {
|
||||||
|
deleteRole({id: deleteId.value})
|
||||||
|
};
|
||||||
|
|
||||||
const state = reactive<any>({
|
const state = reactive<any>({
|
||||||
name: "",
|
name: "",
|
||||||
});
|
});
|
||||||
const pageList: PageResult<{
|
const pageList: PageResult<{
|
||||||
roleName: string;
|
roleName: string;
|
||||||
|
id: number
|
||||||
}> = reactive({
|
}> = reactive({
|
||||||
noMoreData: false,
|
noMoreData: false,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
|
|
@ -76,7 +76,7 @@ const handleSearch = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const update = (item: any) => {
|
const update = (item: any) => {
|
||||||
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then((res) => {
|
GoodsApi.deleteShmProducts({ id: item.id }).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
resetPageList();
|
resetPageList();
|
||||||
getList();
|
getList();
|
||||||
|
|
|
@ -129,7 +129,6 @@ const getList = (v?: boolean) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
console.log(deleteId.value);
|
|
||||||
ReceiveApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
|
ReceiveApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
getList();
|
getList();
|
||||||
|
|
|
@ -5,18 +5,21 @@
|
||||||
<view v-if="isShipment">
|
<view v-if="isShipment">
|
||||||
<view v-for="(item, index) in state.list" :key="index">
|
<view v-for="(item, index) in state.list" :key="index">
|
||||||
<view class="first-title">{{ item.shmCategoryName }}</view>
|
<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 class="dialog-product-layout">
|
||||||
<view v-if="item.childrenList">
|
<view v-if="cItem.childrenLists">
|
||||||
<text
|
<text
|
||||||
v-for="(cItem, cIndex) in item.childrenList"
|
v-for="(child, childIndex) in cItem.childrenLists"
|
||||||
:key="cIndex"
|
:key="childIndex"
|
||||||
:class="{ active: state.current === cItem.id }"
|
:class="{ active: state.current === child.childIndex }"
|
||||||
@click="handleSelect(cItem)"
|
@click="handleSelect(child)"
|
||||||
>{{ cItem.shmCategoryName }}</text
|
>{{ child.shmProductsName }}</text
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-else style="flex: auto;">
|
<view v-else style="flex: auto">
|
||||||
<u-empty
|
<u-empty
|
||||||
mode="data"
|
mode="data"
|
||||||
icon="http://cdn.uviewui.com/uview/empty/data.png"
|
icon="http://cdn.uviewui.com/uview/empty/data.png"
|
||||||
|
@ -26,6 +29,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<view class="dialog-product-layout" v-else>
|
<view class="dialog-product-layout" v-else>
|
||||||
<text
|
<text
|
||||||
v-for="(item, index) in state.list"
|
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) {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
state.list = res.data;
|
state.list = res.data;
|
||||||
|
|
|
@ -136,7 +136,7 @@ const handleDialog = (key: string, v: boolean) => {
|
||||||
|
|
||||||
// 收货产品选择
|
// 收货产品选择
|
||||||
const changeProduct = (obj: any) => {
|
const changeProduct = (obj: any) => {
|
||||||
model1.order.productName = obj.shmCategoryName; // 收货产品名称
|
model1.order.productName = obj.shmProductsName; // 收货产品名称
|
||||||
model1.order.productId = obj.id; // 收货产品Id,
|
model1.order.productId = obj.id; // 收货产品Id,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -193,3 +193,22 @@ export const getShipmentProductList = () => {
|
||||||
url: '/api/shmproducts/allShmProducts',
|
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