<template>
|
<view class="prod-costing">
|
<PageHeader title="生产核算" />
|
|
<view class="search_form">
|
<u-form>
|
|
<view class="form-row">
|
<u-form-item label="生产人" label-width="80">
|
<up-input v-model="searchForm.schedulingUserName" placeholder="请输入" clearable @change="handleQuery" />
|
</u-form-item>
|
</view>
|
<view class="form-actions">
|
<u-button type="primary" size="small" @click="handleQuery">搜索</u-button>
|
|
</view>
|
</u-form>
|
</view>
|
|
<view class="list_container">
|
<u-loading-icon v-if="tableLoading" text="加载中..." />
|
<view v-else>
|
<view v-if="!tableData || tableData.length === 0" class="empty">暂无数据</view>
|
<view v-else class="card_list">
|
<view v-for="item in tableData" :key="item.id" class="card_item">
|
<view class="card_header">
|
<text class="card_title">{{ item.projectName }}</text>
|
</view>
|
<view class="card_body">
|
<view class="row"><text class="label">生产日期</text><text class="value">{{ item.schedulingDate }}</text></view>
|
<view class="row"><text class="label">生产人</text><text class="value">{{ item.schedulingUserName }}</text></view>
|
<view class="row"><text class="label">合同号</text><text class="value">{{ item.salesContractNo }}</text></view>
|
<view class="row"><text class="label">客户合同号</text><text class="value">{{ item.customerContractNo }}</text></view>
|
<view class="row"><text class="label">客户名称</text><text class="value">{{ item.customerName }}</text></view>
|
<view class="row"><text class="label">产品大类</text><text class="value">{{ item.productCategory }}</text></view>
|
<view class="row"><text class="label">规格型号</text><text class="value">{{ item.specificationModel }}</text></view>
|
<view class="row inline">
|
<view class="col"><text class="label">单位</text><text class="value">{{ item.unit }}</text></view>
|
<view class="col"><text class="label">工序</text><text class="value">{{ item.process }}</text></view>
|
<view class="col"><text class="label">生产数量</text><text class="value">{{ item.finishedNum }}</text></view>
|
<view class="col"><text class="label">工时定额</text><text class="value">{{ item.workHours }}</text></view>
|
<view class="col"><text class="label">工资</text><text class="value">{{ item.wages }}</text></view>
|
</view>
|
</view>
|
</view>
|
</view>
|
|
|
</view>
|
</view>
|
|
|
</view>
|
</template>
|
|
<script setup>
|
import { onMounted, ref, reactive, toRefs } from "vue";
|
import PageHeader from '@/components/PageHeader.vue'
|
import { productionAccountingListPage } from "@/api/productionManagement/productionCosting.js";
|
|
// state
|
const tableData = ref([]);
|
const tableLoading = ref(false);
|
const page = reactive({ current: -1, size: -1 });
|
const data = reactive({
|
searchForm: {
|
schedulingUserName: "",
|
},
|
});
|
const { searchForm } = toRefs(data);
|
|
// 无日期筛选
|
|
// 查询(不分页,固定传 -1)
|
const handleQuery = () => { page.current = -1; page.size = -1; getList(); };
|
const getList = () => {
|
tableLoading.value = true;
|
const params = { ...searchForm.value, ...page };
|
productionAccountingListPage(params).then((res) => {
|
tableLoading.value = false;
|
tableData.value = res.data.records || [];
|
}).catch(() => { tableLoading.value = false; })
|
};
|
|
onMounted(() => { getList(); });
|
</script>
|
|
<style scoped lang="scss">
|
.prod-costing { padding-bottom: 12px; }
|
.search_form { margin: 12px; background: #fff; border-radius: 8px; padding: 10px; }
|
.form-row { display: flex; gap: 12px; }
|
.form-actions { display: flex; justify-content: flex-end; }
|
.ml8 { margin-left: 8px; }
|
.list_container { padding: 0 12px; }
|
.empty { text-align: center; color: #888; padding: 20px 0; }
|
.card_list { display: flex; flex-direction: column; gap: 10px; }
|
.card_item { background: #fff; border-radius: 10px; padding: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
|
.card_header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
|
.card_title { font-weight: 500; color: #333; }
|
.card_body .row { display: flex; justify-content: space-between; padding: 4px 0; }
|
.card_body .row.inline { display: flex; gap: 10px; flex-wrap: wrap; }
|
.card_body .row.inline .col { min-width: 45%; display: flex; justify-content: space-between; }
|
.label { color: #666; font-size: 12px; }
|
.value { color: #333; font-size: 12px; }
|
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 0; }
|
.page_text { color: #666; font-size: 12px; }
|
</style>
|