Merge branch 'master' of https://e.coding.net/g-cphe0354/cashier/cashier-web into dwb
This commit is contained in:
@@ -74,7 +74,8 @@ const contentConfig: IContentConfig = {
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 300,
|
||||
templet: "tool",
|
||||
templet: "custom",
|
||||
slotName: 'tools',
|
||||
operat: [
|
||||
{
|
||||
text: "查看明细",
|
||||
|
||||
@@ -39,6 +39,76 @@
|
||||
style="margin-left: 2px"
|
||||
/>
|
||||
</template>
|
||||
<template #tools="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
@click="
|
||||
handleOperatClick({
|
||||
name: 'detail',
|
||||
row: scope.row,
|
||||
column: scope.column,
|
||||
$index: scope.$index,
|
||||
})
|
||||
"
|
||||
>
|
||||
查看明细
|
||||
</el-button>
|
||||
|
||||
<el-button type="primary" link size="small" @click="handleEditClick(scope.row)">
|
||||
编辑
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:style="{ color: scope.row.repaymentMethod == 'order' ? '#999' : '' }"
|
||||
size="small"
|
||||
@click="
|
||||
handleOperatClick({
|
||||
name: 'huankuan',
|
||||
row: scope.row,
|
||||
column: scope.column,
|
||||
$index: scope.$index,
|
||||
})
|
||||
"
|
||||
>
|
||||
还款
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
@click="
|
||||
handleOperatClick({
|
||||
name: 'huankuan_detail',
|
||||
row: scope.row,
|
||||
column: scope.column,
|
||||
$index: scope.$index,
|
||||
})
|
||||
"
|
||||
>
|
||||
还款记录
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
@click="
|
||||
handleOperatClick({
|
||||
name: 'delete',
|
||||
row: scope.row,
|
||||
column: scope.column,
|
||||
$index: scope.$index,
|
||||
})
|
||||
"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</page-content>
|
||||
|
||||
<!-- 新增 -->
|
||||
@@ -74,7 +144,7 @@ import contentConfig from "./config/content";
|
||||
import editModalConfig from "./config/edit";
|
||||
import searchConfig from "./config/search";
|
||||
import { returnOptionsLabel } from "./config/config";
|
||||
|
||||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
const {
|
||||
searchRef,
|
||||
contentRef,
|
||||
@@ -124,7 +194,7 @@ async function handleOperatClick(data: IOperatData) {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (data.name == "huankuan") {
|
||||
if (data.name == "huankuan" && data.row.repaymentMethod == "total") {
|
||||
refHuanKuanShow(data.row, {});
|
||||
return;
|
||||
}
|
||||
@@ -132,6 +202,23 @@ async function handleOperatClick(data: IOperatData) {
|
||||
refHuanKuanRecordShow(data.row, {});
|
||||
return;
|
||||
}
|
||||
if (data.name == "delete") {
|
||||
ElMessageBox.alert("是否删除挂账人" + data.row.debtor + "?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
callback: async (action: string) => {
|
||||
if (action == "confirm") {
|
||||
const res = await creditApi.delete(data.row.id);
|
||||
if (res.code == 200) {
|
||||
ElMessage.success("删除成功");
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 还款
|
||||
|
||||
116
src/views/inventory/consumables/components/DataStatistics.vue
Normal file
116
src/views/inventory/consumables/components/DataStatistics.vue
Normal file
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<div class="DataStatistics">
|
||||
<div style="width: 200px">
|
||||
<el-icon class="iconStyle">
|
||||
<UserFilled />
|
||||
</el-icon>
|
||||
<span>耗材种数</span>
|
||||
<span class="font-700">{{ data.totalRow || 0 }}</span>
|
||||
</div>
|
||||
<div style="width: 300px">
|
||||
<el-icon class="iconStyle">
|
||||
<UserFilled />
|
||||
</el-icon>
|
||||
<div>
|
||||
<div>
|
||||
<span>增加数量:</span>
|
||||
<span class="num">{{ data.inSumTotal || 0 }}</span>
|
||||
</div>
|
||||
<div style="display: flex">
|
||||
<div>
|
||||
<span>手动增加:</span>
|
||||
<span class="num">{{ data.winInNum || 0 }}</span>
|
||||
</div>
|
||||
<span style="margin: 0 20px; color: #ccc">|</span>
|
||||
<div>
|
||||
<span>入库:</span>
|
||||
<span class="num">{{ data.stockInNum || 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 500px">
|
||||
<el-icon class="iconStyle">
|
||||
<UserFilled />
|
||||
</el-icon>
|
||||
<div>
|
||||
<div>
|
||||
<span>减少数量:</span>
|
||||
<span class="num">{{ data.outSumTotal || 0 }}</span>
|
||||
</div>
|
||||
<div style="display: flex">
|
||||
<div>
|
||||
<span>手动减少:</span>
|
||||
<span class="num">{{ data.lossOutNum || 0 }}</span>
|
||||
</div>
|
||||
<span style="margin: 0 20px; color: #ccc">|</span>
|
||||
<div>
|
||||
<span>消耗:</span>
|
||||
<span class="num">{{ data.consumeNum || 0 }}</span>
|
||||
</div>
|
||||
<span style="margin: 0 20px; color: #ccc">|</span>
|
||||
<div>
|
||||
<span>报损:</span>
|
||||
<span class="num">{{ data.damageNum || 0 }}</span>
|
||||
</div>
|
||||
<span style="margin: 0 20px; color: #ccc">|</span>
|
||||
<div>
|
||||
<span>出库:</span>
|
||||
<span class="num">{{ data.stockOutNum || 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped lang="scss">
|
||||
.DataStatistics {
|
||||
border: 1px solid #e4e7ed;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
margin-top: 12px;
|
||||
margin-bottom: 12px;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
|
||||
> div {
|
||||
height: 80px;
|
||||
background-color: #f4f9ff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
|
||||
padding: 20px;
|
||||
|
||||
.iconStyle {
|
||||
background-color: #d4e9fe;
|
||||
border-radius: 50%;
|
||||
padding: 6px;
|
||||
font-size: 36px;
|
||||
color: #3f9eff;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
&.num {
|
||||
color: #3f9eff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -5,9 +5,11 @@
|
||||
<page-search
|
||||
ref="searchRef"
|
||||
:search-config="searchConfig"
|
||||
@query-click="handleQueryClick"
|
||||
@query-click="newHandleQueryClick"
|
||||
@reset-click="handleResetClick"
|
||||
/>
|
||||
<!-- 统计 -->
|
||||
<data-tongji :data="gongjiData"></data-tongji>
|
||||
<!-- 列表 -->
|
||||
<page-content
|
||||
ref="contentRef"
|
||||
@@ -92,15 +94,15 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import addHaocai from "./components/add-haocai.vue";
|
||||
import dataTongji from "./components/DataStatistics.vue";
|
||||
import addConsTakin from "./components/addConsTakin.vue";
|
||||
import orderApi, { type getListResponse, OrderInfoVo } from "@/api/order/order";
|
||||
import consApi from "@/api/product/cons";
|
||||
import type { IObject, IOperatData } from "@/components/CURD/types";
|
||||
import usePage from "@/components/CURD/usePage";
|
||||
import contentConfig from "./config/content";
|
||||
import editModalConfig from "./config/edit";
|
||||
import searchConfig from "./config/search";
|
||||
import { returnOptionsLabel } from "./config/config";
|
||||
|
||||
const router = useRouter();
|
||||
const {
|
||||
searchRef,
|
||||
@@ -113,6 +115,26 @@ const {
|
||||
handleSearchClick,
|
||||
handleFilterChange,
|
||||
} = usePage();
|
||||
//统计数据
|
||||
const gongjiData = reactive({ totalRow: 0 });
|
||||
function getTongji(params: IObject | undefined) {
|
||||
consApi.statistics(params).then((res) => {
|
||||
Object.assign(gongjiData, res);
|
||||
});
|
||||
}
|
||||
|
||||
function newHandleQueryClick(e: IObject | undefined) {
|
||||
const filterParams = contentRef.value?.getFilterParams();
|
||||
contentRef.value?.fetchPageData({ ...e, ...filterParams }, true);
|
||||
getTongji(e);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => contentRef.value?.pagination.total,
|
||||
(newval) => {
|
||||
gongjiData.totalRow = newval as number;
|
||||
}
|
||||
);
|
||||
|
||||
//耗材盘点
|
||||
const refAddHaocaiTakin = ref();
|
||||
@@ -123,14 +145,15 @@ function refAddHaocaiTakinShow(item: any) {
|
||||
function refresh() {
|
||||
console.log("refresh");
|
||||
contentRef.value?.fetchPageData();
|
||||
getTongji(undefined);
|
||||
}
|
||||
const refAddHaocai = ref();
|
||||
function refAddHaocaiOpen(item) {
|
||||
function refAddHaocaiOpen(item: any) {
|
||||
refAddHaocai.value.open(item);
|
||||
}
|
||||
// 新增
|
||||
async function handleAddClick() {
|
||||
refAddHaocaiOpen();
|
||||
refAddHaocaiOpen(undefined);
|
||||
}
|
||||
// 编辑
|
||||
async function handleEditClick(row: IObject) {
|
||||
@@ -184,29 +207,9 @@ function returnStateType(status: string) {
|
||||
}
|
||||
}
|
||||
|
||||
const route = useRouter();
|
||||
// 结账
|
||||
function toPayOrder(order: getListResponse) {
|
||||
route.push({
|
||||
path: "/tool/index",
|
||||
query: {
|
||||
id: order.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
//详情
|
||||
const refDetail = ref();
|
||||
function showdetail(row: OrderInfoVo) {
|
||||
refDetail.value.show(row);
|
||||
}
|
||||
function toGoods(id: number) {
|
||||
router.push({
|
||||
path: "/product/index",
|
||||
query: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
}
|
||||
onMounted(() => {
|
||||
getTongji({});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -205,9 +205,9 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
let isXianFuKuan = computed(() => {
|
||||
if (!props.table.tableCode) {
|
||||
return true;
|
||||
}
|
||||
// if (!props.table.tableCode) {
|
||||
// return true;
|
||||
// }
|
||||
return shopUser.userInfo.registerType === "before" ? true : false;
|
||||
});
|
||||
const canWeiFee = computed(() => {
|
||||
|
||||
@@ -579,7 +579,8 @@ let goodsMapisFinish = ref(false);
|
||||
async function getGoods() {
|
||||
const res = await productApi.getPage({
|
||||
page: 1,
|
||||
size: 200,
|
||||
size: 400,
|
||||
status: "on_sale",
|
||||
...goods.query,
|
||||
});
|
||||
goods.list = res.records;
|
||||
|
||||
Reference in New Issue
Block a user